aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-04 02:00:40 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-04 02:00:40 +0000
commitf805ec840f2402c122d74c5da2cb57d74a7dc6b7 (patch)
treebbaf4ddf285d335adf09a1e9ee05b9665bddd53a
parentf270c5e7b552cdf63fc4872e6d8a6368a1ce5e9b (diff)
Mainline merge rev 179430.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/integration@179485 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog4
-rw-r--r--MAINTAINERS1
-rw-r--r--contrib/ChangeLog.google-integration6
-rw-r--r--contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail10
-rw-r--r--fixincludes/ChangeLog14
-rw-r--r--fixincludes/fixincl.x143
-rw-r--r--fixincludes/inclhack.def59
-rwxr-xr-xfixincludes/mkfixinc.sh1
-rw-r--r--fixincludes/tests/base/rtldef/decc$types.h21
-rw-r--r--fixincludes/tests/base/rtldef/string.h15
-rw-r--r--fixincludes/tests/base/testing.h11
-rw-r--r--gcc/ChangeLog1202
-rw-r--r--gcc/ChangeLog.google-integration4
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in14
-rw-r--r--gcc/ada/ChangeLog322
-rw-r--r--gcc/ada/a-cbhase.adb100
-rw-r--r--gcc/ada/a-cbhase.ads62
-rw-r--r--gcc/ada/a-cbmutr.adb112
-rw-r--r--gcc/ada/a-cbmutr.ads11
-rw-r--r--gcc/ada/a-cborse.adb152
-rw-r--r--gcc/ada/a-cborse.ads78
-rw-r--r--gcc/ada/a-cihase.adb98
-rw-r--r--gcc/ada/a-cihase.ads63
-rw-r--r--gcc/ada/a-cimutr.adb101
-rw-r--r--gcc/ada/a-cimutr.ads11
-rw-r--r--gcc/ada/a-ciorma.adb140
-rw-r--r--gcc/ada/a-ciorma.ads72
-rw-r--r--gcc/ada/a-ciorse.adb72
-rw-r--r--gcc/ada/a-ciorse.ads76
-rw-r--r--gcc/ada/a-comutr.adb97
-rw-r--r--gcc/ada/a-comutr.ads15
-rw-r--r--gcc/ada/a-coorma.ads48
-rw-r--r--gcc/ada/a-coorse.adb72
-rw-r--r--gcc/ada/a-coorse.ads82
-rw-r--r--gcc/ada/checks.adb2
-rw-r--r--gcc/ada/debug.adb5
-rw-r--r--gcc/ada/einfo.ads9
-rw-r--r--gcc/ada/exp_aggr.adb5
-rw-r--r--gcc/ada/exp_ch9.adb53
-rw-r--r--gcc/ada/exp_dist.adb1
-rw-r--r--gcc/ada/exp_util.adb87
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in15
-rw-r--r--gcc/ada/gcc-interface/Makefile.in129
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h24
-rw-r--r--gcc/ada/gcc-interface/decl.c49
-rw-r--r--gcc/ada/gcc-interface/gigi.h2
-rw-r--r--gcc/ada/gcc-interface/trans.c361
-rw-r--r--gcc/ada/gcc-interface/utils.c162
-rw-r--r--gcc/ada/gcc-interface/utils2.c320
-rw-r--r--gcc/ada/gnat1drv.adb16
-rw-r--r--gcc/ada/gnat_rm.texi17
-rw-r--r--gcc/ada/mlib-tgt-specific-darwin.adb7
-rw-r--r--gcc/ada/opt.ads5
-rw-r--r--gcc/ada/par-ch3.adb3
-rw-r--r--gcc/ada/rtsfind.ads2
-rw-r--r--gcc/ada/s-atocou-x86.adb4
-rw-r--r--gcc/ada/s-osinte-aix.ads8
-rw-r--r--gcc/ada/s-osinte-darwin.ads8
-rw-r--r--gcc/ada/s-osinte-freebsd.ads8
-rw-r--r--gcc/ada/s-osinte-hpux.ads8
-rw-r--r--gcc/ada/s-osinte-irix.ads10
-rw-r--r--gcc/ada/s-osinte-linux.ads62
-rw-r--r--gcc/ada/s-osinte-solaris-posix.ads8
-rw-r--r--gcc/ada/s-taprob.adb4
-rw-r--r--gcc/ada/s-taprob.ads6
-rw-r--r--gcc/ada/s-taprop-irix.adb8
-rw-r--r--gcc/ada/s-taprop-linux.adb83
-rw-r--r--gcc/ada/s-taprop-posix.adb8
-rw-r--r--gcc/ada/s-taspri-dummy.ads2
-rw-r--r--gcc/ada/s-taspri-hpux-dce.ads2
-rw-r--r--gcc/ada/s-taspri-mingw.ads2
-rw-r--r--gcc/ada/s-taspri-posix-noaltstack.ads8
-rw-r--r--gcc/ada/s-taspri-posix.ads16
-rw-r--r--gcc/ada/s-taspri-solaris.ads2
-rw-r--r--gcc/ada/s-taspri-tru64.ads2
-rw-r--r--gcc/ada/s-taspri-vxworks.ads2
-rw-r--r--gcc/ada/s-tassta.adb2
-rw-r--r--gcc/ada/sem_ch3.adb97
-rw-r--r--gcc/ada/sem_ch4.adb5
-rw-r--r--gcc/ada/sem_ch5.adb5
-rw-r--r--gcc/ada/sem_ch6.adb10
-rw-r--r--gcc/ada/sem_prag.adb15
-rw-r--r--gcc/ada/sem_util.adb3
-rw-r--r--gcc/ada/sinfo.ads3
-rw-r--r--gcc/ada/snames.ads-tmpl8
-rw-r--r--gcc/c-decl.c16
-rw-r--r--gcc/c-family/c-common.h3
-rw-r--r--gcc/c-typeck.c54
-rw-r--r--gcc/calls.c31
-rw-r--r--gcc/cgraph.c3
-rw-r--r--gcc/cgraphunit.c17
-rw-r--r--gcc/common.opt12
-rw-r--r--gcc/common/config/c6x/c6x-common.c1
-rw-r--r--gcc/config.gcc34
-rw-r--r--gcc/config.in18
-rw-r--r--gcc/config/arm/arm-protos.h1
-rw-r--r--gcc/config/arm/arm.c69
-rw-r--r--gcc/config/arm/arm.h7
-rw-r--r--gcc/config/arm/arm.md26
-rw-r--r--gcc/config/arm/bpabi.h9
-rw-r--r--gcc/config/arm/iterators.md8
-rw-r--r--gcc/config/arm/neon.md259
-rw-r--r--gcc/config/arm/predicates.md16
-rw-r--r--gcc/config/avr/avr-log.c330
-rw-r--r--gcc/config/avr/avr-protos.h38
-rw-r--r--gcc/config/avr/avr.c1328
-rw-r--r--gcc/config/avr/avr.md756
-rw-r--r--gcc/config/avr/avr.opt3
-rw-r--r--gcc/config/avr/constraints.md50
-rw-r--r--gcc/config/avr/t-avr4
-rw-r--r--gcc/config/c6x/c6x.c784
-rw-r--r--gcc/config/c6x/c6x.md100
-rw-r--r--gcc/config/darwin9.h2
-rw-r--r--gcc/config/frv/frv.c28
-rw-r--r--gcc/config/frv/frvbegin.c2
-rw-r--r--gcc/config/frv/frvend.c2
-rw-r--r--gcc/config/i386/bmi2intrin.h23
-rw-r--r--gcc/config/i386/i386.c134
-rw-r--r--gcc/config/i386/sse.md125
-rw-r--r--gcc/config/i386/winnt.c11
-rw-r--r--gcc/config/iq2000/iq2000.md2
-rw-r--r--gcc/config/m32r/m32r.md10
-rw-r--r--gcc/config/mips/mips.c20
-rw-r--r--gcc/config/rx/predicates.md10
-rw-r--r--gcc/config/rx/rx.md104
-rw-r--r--gcc/config/sh/sh.c24
-rw-r--r--gcc/config/sh/sh.md123
-rw-r--r--gcc/config/sparc/constraints.md15
-rw-r--r--gcc/config/sparc/niagara.md2
-rw-r--r--gcc/config/sparc/niagara2.md4
-rw-r--r--gcc/config/sparc/predicates.md35
-rw-r--r--gcc/config/sparc/sol2.h8
-rw-r--r--gcc/config/sparc/sparc-c.c63
-rw-r--r--gcc/config/sparc/sparc-modes.def1
-rw-r--r--gcc/config/sparc/sparc-protos.h1
-rw-r--r--gcc/config/sparc/sparc.c562
-rw-r--r--gcc/config/sparc/sparc.h64
-rw-r--r--gcc/config/sparc/sparc.md972
-rw-r--r--gcc/config/sparc/sparc.opt14
-rw-r--r--gcc/config/sparc/t-sparc36
-rw-r--r--gcc/config/sparc/ultra1_2.md4
-rw-r--r--gcc/config/sparc/ultra3.md7
-rw-r--r--gcc/config/sparc/visintrin.h452
-rwxr-xr-xgcc/configure74
-rw-r--r--gcc/configure.ac21
-rw-r--r--gcc/cp/ChangeLog197
-rw-r--r--gcc/cp/call.c60
-rw-r--r--gcc/cp/class.c70
-rw-r--r--gcc/cp/cp-gimplify.c10
-rw-r--r--gcc/cp/cp-tree.h23
-rw-r--r--gcc/cp/cvt.c13
-rw-r--r--gcc/cp/decl.c98
-rw-r--r--gcc/cp/decl2.c18
-rw-r--r--gcc/cp/error.c18
-rw-r--r--gcc/cp/except.c21
-rw-r--r--gcc/cp/friend.c4
-rw-r--r--gcc/cp/init.c24
-rw-r--r--gcc/cp/mangle.c11
-rw-r--r--gcc/cp/method.c34
-rw-r--r--gcc/cp/parser.c245
-rw-r--r--gcc/cp/parser.h4
-rw-r--r--gcc/cp/pt.c34
-rw-r--r--gcc/cp/repo.c3
-rw-r--r--gcc/cp/rtti.c4
-rw-r--r--gcc/cp/semantics.c32
-rw-r--r--gcc/cp/tree.c19
-rw-r--r--gcc/cp/typeck.c27
-rw-r--r--gcc/cp/typeck2.c6
-rw-r--r--gcc/ddg.c40
-rw-r--r--gcc/ddg.h2
-rw-r--r--gcc/doc/extend.texi135
-rw-r--r--gcc/doc/invoke.texi77
-rw-r--r--gcc/doc/tm.texi2
-rw-r--r--gcc/emit-rtl.c17
-rw-r--r--gcc/expr.c11
-rw-r--r--gcc/final.c2
-rw-r--r--gcc/fold-const.c586
-rw-r--r--gcc/fortran/ChangeLog48
-rw-r--r--gcc/fortran/check.c2
-rw-r--r--gcc/fortran/expr.c10
-rw-r--r--gcc/fortran/interface.c51
-rw-r--r--gcc/fortran/resolve.c23
-rw-r--r--gcc/fortran/symbol.c1
-rw-r--r--gcc/fortran/trans-types.c26
-rw-r--r--gcc/fwprop.c21
-rw-r--r--gcc/gcc.c22
-rw-r--r--gcc/gimple-fold.c65
-rw-r--r--gcc/gimple.c27
-rw-r--r--gcc/gimple.h1
-rw-r--r--gcc/go/gofrontend/expressions.cc135
-rw-r--r--gcc/go/gofrontend/expressions.h10
-rw-r--r--gcc/go/gofrontend/gogo.cc180
-rw-r--r--gcc/go/gofrontend/gogo.h99
-rw-r--r--gcc/go/gofrontend/parse.cc113
-rw-r--r--gcc/go/gofrontend/parse.h4
-rw-r--r--gcc/go/gofrontend/runtime.def4
-rw-r--r--gcc/go/gofrontend/statements.cc54
-rw-r--r--gcc/go/gofrontend/statements.h6
-rw-r--r--gcc/go/gofrontend/types.cc2
-rw-r--r--gcc/go/gofrontend/unsafe.cc1
-rw-r--r--gcc/godump.c12
-rw-r--r--gcc/graphite-scop-detection.c10
-rw-r--r--gcc/haifa-sched.c338
-rw-r--r--gcc/hw-doloop.c2
-rw-r--r--gcc/hwint.h1
-rw-r--r--gcc/ifcvt.c56
-rw-r--r--gcc/incpath.c2
-rw-r--r--gcc/ipa-cp.c22
-rw-r--r--gcc/ipa-inline-analysis.c807
-rw-r--r--gcc/ipa-inline-transform.c4
-rw-r--r--gcc/ipa-inline.c11
-rw-r--r--gcc/ipa-inline.h23
-rw-r--r--gcc/ipa-prop.c125
-rw-r--r--gcc/ipa-prop.h16
-rw-r--r--gcc/ipa.c9
-rw-r--r--gcc/ira-color.c2
-rw-r--r--gcc/lto-cgraph.c30
-rw-r--r--gcc/lto-section-in.c1
-rw-r--r--gcc/lto-streamer-in.c41
-rw-r--r--gcc/lto-streamer-out.c64
-rw-r--r--gcc/lto-streamer.c8
-rw-r--r--gcc/lto-streamer.h24
-rw-r--r--gcc/lto-symtab.c16
-rw-r--r--gcc/lto/ChangeLog28
-rw-r--r--gcc/lto/common.c5
-rw-r--r--gcc/lto/common.h5
-rw-r--r--gcc/lto/lto.c95
-rw-r--r--gcc/modulo-sched.c28
-rw-r--r--gcc/opts.c6
-rw-r--r--gcc/output.h1
-rw-r--r--gcc/params.def24
-rw-r--r--gcc/passes.c5
-rw-r--r--gcc/reload.c7
-rw-r--r--gcc/reload1.c41
-rw-r--r--gcc/rtl.h5
-rw-r--r--gcc/sched-ebb.c121
-rw-r--r--gcc/sched-int.h11
-rw-r--r--gcc/simplify-rtx.c10
-rw-r--r--gcc/target.def2
-rw-r--r--gcc/testsuite/ChangeLog485
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted2.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-defer2.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi1.C53
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi2.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi3.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi4.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr24.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr25.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr42844-2.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr50491.C17
-rw-r--r--gcc/testsuite/g++.dg/dfp/44473-1.C122
-rw-r--r--gcc/testsuite/g++.dg/dfp/44473-2.C25
-rw-r--r--gcc/testsuite/g++.dg/dfp/mangle-1.C40
-rw-r--r--gcc/testsuite/g++.dg/dfp/mangle-2.C28
-rw-r--r--gcc/testsuite/g++.dg/dfp/mangle-3.C28
-rw-r--r--gcc/testsuite/g++.dg/dfp/mangle-4.C35
-rw-r--r--gcc/testsuite/g++.dg/dfp/mangle-5.C29
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/bindings1.C18
-rw-r--r--gcc/testsuite/g++.dg/ext/int128-1.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/int128-2.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/int128-2.h10
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/warn5.C11
-rw-r--r--gcc/testsuite/g++.dg/init/const8.C11
-rw-r--r--gcc/testsuite/g++.dg/init/pr20039.C1
-rw-r--r--gcc/testsuite/g++.dg/init/pr42844.C14
-rw-r--r--gcc/testsuite/g++.dg/other/final1.C26
-rw-r--r--gcc/testsuite/g++.dg/other/i386-3.C1
-rw-r--r--gcc/testsuite/g++.dg/other/i386-4.C1
-rw-r--r--gcc/testsuite/g++.dg/other/i386-8.C1
-rw-r--r--gcc/testsuite/g++.dg/other/mmintrin.C1
-rw-r--r--gcc/testsuite/g++.dg/other/pr34435.C1
-rw-r--r--gcc/testsuite/g++.dg/other/pr39060.C18
-rw-r--r--gcc/testsuite/g++.dg/other/pr39496.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr50464.C170
-rw-r--r--gcc/testsuite/g++.dg/overload/ref-conv1.C6
-rw-r--r--gcc/testsuite/g++.dg/overload/ref-conv2.C15
-rw-r--r--gcc/testsuite/g++.dg/overload/rvalue3.C8
-rw-r--r--gcc/testsuite/g++.dg/parse/crash56.C8
-rw-r--r--gcc/testsuite/g++.dg/parse/error40.C10
-rw-r--r--gcc/testsuite/g++.dg/template/bitfield1.C11
-rw-r--r--gcc/testsuite/g++.dg/template/friend52.C17
-rw-r--r--gcc/testsuite/g++.dg/template/partial12.C27
-rw-r--r--gcc/testsuite/g++.dg/template/partial13.C25
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae28.C24
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/restrict2.C62
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr50413.cc22
-rw-r--r--gcc/testsuite/g++.dg/warn/Wextra-3.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/incomplete1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init4.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/941014-1.x15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c123
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c27
-rw-r--r--gcc/testsuite/gcc.dg/fold-compare-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-3.c25
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-4.c29
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inline-5.c35
-rw-r--r--gcc/testsuite/gcc.dg/pr43864-2.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr43864-3.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr43864-4.c28
-rw-r--r--gcc/testsuite/gcc.dg/pr43864.c35
-rw-r--r--gcc/testsuite/gcc.dg/pr46309.c66
-rw-r--r--gcc/testsuite/gcc.dg/pr50571.c11
-rw-r--r--gcc/testsuite/gcc.dg/sms-10.c119
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-1.c47
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-10.c80
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-11.c70
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-12.c90
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-12g.c6
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-13.c68
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-14g.c115
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-14gf.c24
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-15.c60
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-16g.c34
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-17g.c57
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-18g.c82
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-19.c81
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-1f.c18
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-2.c49
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-20.c95
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-21.c66
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-2f.c18
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-3.c66
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-4.c75
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-4g.c14
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-4gf.c19
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-5.c57
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-6.c86
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-7.c53
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-8.c52
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-9.c109
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt.h59
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr50363.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr50472.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pred-2_c.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-11.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-24.c59
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-26.c60
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-27.c49
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-28.c71
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr50451.c18
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-cond-7.c68
-rw-r--r--gcc/testsuite/gcc.dg/vector-compare-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/vector-compare-2.c26
-rw-r--r--gcc/testsuite/gcc.target/arm/cmp-1.c37
-rw-r--r--gcc/testsuite/gcc.target/arm/cmp-2.c49
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-thumb2-move.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42835.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/pr50099.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-cond-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/avxfp-1.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/avxfp-2.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/bmi2-mulx32-2.c47
-rw-r--r--gcc/testsuite/gcc.target/i386/bmi2-mulx32-2a.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/bmi2-mulx64-2.c51
-rw-r--r--gcc/testsuite/gcc.target/i386/bmi2-mulx64-2a.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-10.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-4.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-5a.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-5b.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-6a.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-6b.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-7.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-8.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pad-9.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr50482.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-blendps.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-cond-1.c75
-rw-r--r--gcc/testsuite/gcc.target/i386/vect-double-1.c1
-rw-r--r--gcc/testsuite/gcc.target/s390/addr-constraints-1.c70
-rw-r--r--gcc/testsuite/gcc.target/sh/mfmovd.c6
-rw-r--r--gcc/testsuite/gcc.target/sh/pr49468-si.c22
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c16
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-cos.c10
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-cosf.c10
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-fsrra.c10
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-memmovua.c11
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sin.c10
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sincos.c8
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sincosf.c8
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sinf.c10
-rw-r--r--gcc/testsuite/gcc.target/sh/struct-arg-dw2.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/array.c21
-rw-r--r--gcc/testsuite/gcc.target/sparc/bmaskbshuf.c34
-rw-r--r--gcc/testsuite/gcc.target/sparc/cmask.c21
-rw-r--r--gcc/testsuite/gcc.target/sparc/edge.c39
-rw-r--r--gcc/testsuite/gcc.target/sparc/edgen.c39
-rw-r--r--gcc/testsuite/gcc.target/sparc/fcmp.c53
-rw-r--r--gcc/testsuite/gcc.target/sparc/fpadds.c55
-rw-r--r--gcc/testsuite/gcc.target/sparc/fpaddsubi.c58
-rw-r--r--gcc/testsuite/gcc.target/sparc/fshift.c53
-rw-r--r--gcc/testsuite/gcc.target/sparc/fucmp.c28
-rw-r--r--gcc/testsuite/gcc.target/sparc/rdgsr.c9
-rw-r--r--gcc/testsuite/gcc.target/sparc/vis3misc.c37
-rw-r--r--gcc/testsuite/gcc.target/sparc/wrgsr.c15
-rw-r--r--gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/bessel_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/common_15.f909
-rw-r--r--gcc/testsuite/gfortran.dg/dummy_procedure_5.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/impure_actual_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/interface_26.f902
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_11.f906
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_15.f908
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_32.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_33.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f908
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_result_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pure_formal_proc_3.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/stfunc_7.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/storage_size_2.f084
-rw-r--r--gcc/testsuite/gnat.dg/array17.adb11
-rw-r--r--gcc/testsuite/gnat.dg/array17_pkg.ads8
-rw-r--r--gcc/testsuite/gnat.dg/frame_overflow.adb25
-rw-r--r--gcc/testsuite/gnat.dg/frame_overflow.ads17
-rw-r--r--gcc/testsuite/gnat.dg/opt19.adb27
-rw-r--r--gcc/testsuite/gnat.dg/opt20.adb15
-rw-r--r--gcc/testsuite/gnat.dg/opt20.ads10
-rw-r--r--gcc/testsuite/gnat.dg/opt20_pkg.ads13
-rw-r--r--gcc/testsuite/gnat.dg/opt21.adb11
-rw-r--r--gcc/testsuite/gnat.dg/opt21_pkg.adb17
-rw-r--r--gcc/testsuite/gnat.dg/opt21_pkg.ads15
-rw-r--r--gcc/testsuite/gnat.dg/opt22.adb20
-rw-r--r--gcc/testsuite/gnat.dg/opt22_pkg.adb15
-rw-r--r--gcc/testsuite/gnat.dg/opt22_pkg.ads7
-rw-r--r--gcc/testsuite/gnat.dg/specs/addr1.ads2
-rw-r--r--gcc/testsuite/go.test/go-test.exp33
-rw-r--r--gcc/testsuite/go.test/test/bench/regex-dna-parallel.go2
-rw-r--r--gcc/testsuite/go.test/test/bench/regex-dna.go2
-rw-r--r--gcc/testsuite/go.test/test/bench/timing.log226
-rw-r--r--gcc/testsuite/go.test/test/chan/select6.go34
-rw-r--r--gcc/testsuite/go.test/test/chan/zerosize.go16
-rw-r--r--gcc/testsuite/go.test/test/declbad.go2
-rw-r--r--gcc/testsuite/go.test/test/divide.go54
-rwxr-xr-xgcc/testsuite/go.test/test/errchk54
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug140.go4
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug178.go12
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug205.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug228.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug229.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug231.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug238.go1
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug273.go12
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug274.go3
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug297.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug298.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug322.dir/lib.go (renamed from gcc/testsuite/go.test/test/bugs/bug322.dir/lib.go)0
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug322.dir/main.go (renamed from gcc/testsuite/go.test/test/bugs/bug322.dir/main.go)7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug322.go (renamed from gcc/testsuite/go.test/test/bugs/bug322.go)0
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug324.dir/main.go (renamed from gcc/testsuite/go.test/test/bugs/bug324.dir/main.go)7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug324.dir/p.go (renamed from gcc/testsuite/go.test/test/bugs/bug324.dir/p.go)0
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug324.go (renamed from gcc/testsuite/go.test/test/bugs/bug324.go)2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug327.go24
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug328.go14
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug329.go46
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug330.go13
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug331.go36
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug332.go17
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug333.go19
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug334.go31
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go9
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go11
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug335.go10
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug336.go86
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug337.go19
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug338.go22
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug339.go20
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug340.go17
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug341.go22
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug342.go24
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug343.go33
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug344.go24
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug345.dir/io.go15
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug345.dir/main.go28
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug345.go7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug346.go19
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug347.go49
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug348.go46
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug349.go13
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug350.go15
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug351.go13
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug352.go19
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug353.go30
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug354.go26
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug355.go18
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug356.go41
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug357.go26
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug358.go26
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug359.go26
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug361.go15
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug362.go16
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug363.go21
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug364.go25
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug365.go22
-rw-r--r--gcc/testsuite/go.test/test/func6.go14
-rw-r--r--gcc/testsuite/go.test/test/func7.go29
-rw-r--r--gcc/testsuite/go.test/test/gc2.go42
-rw-r--r--gcc/testsuite/go.test/test/golden.out15
-rw-r--r--gcc/testsuite/go.test/test/goprint.go14
-rw-r--r--gcc/testsuite/go.test/test/goto.go535
-rw-r--r--gcc/testsuite/go.test/test/if.go14
-rw-r--r--gcc/testsuite/go.test/test/import1.go4
-rw-r--r--gcc/testsuite/go.test/test/initializerr.go2
-rw-r--r--gcc/testsuite/go.test/test/interface/explicit.go2
-rw-r--r--gcc/testsuite/go.test/test/interface/pointer.go1
-rw-r--r--gcc/testsuite/go.test/test/interface/private.go32
-rw-r--r--gcc/testsuite/go.test/test/interface/private1.go18
-rw-r--r--gcc/testsuite/go.test/test/malloc1.go1
-rw-r--r--gcc/testsuite/go.test/test/mallocrand.go1
-rw-r--r--gcc/testsuite/go.test/test/method2.go10
-rw-r--r--gcc/testsuite/go.test/test/nil.go142
-rw-r--r--gcc/testsuite/go.test/test/nul1.go6
-rw-r--r--gcc/testsuite/go.test/test/rename1.go2
-rwxr-xr-xgcc/testsuite/go.test/test/run33
-rw-r--r--gcc/testsuite/go.test/test/shift1.go36
-rw-r--r--gcc/testsuite/go.test/test/shift2.go42
-rw-r--r--gcc/testsuite/go.test/test/sizeof.go23
-rw-r--r--gcc/testsuite/lib/target-supports.exp23
-rw-r--r--gcc/timevar.def4
-rw-r--r--gcc/toplev.c109
-rw-r--r--gcc/toplev.h2
-rw-r--r--gcc/tree-cfg.c4
-rw-r--r--gcc/tree-data-ref.c43
-rw-r--r--gcc/tree-data-ref.h2
-rw-r--r--gcc/tree-eh.c9
-rw-r--r--gcc/tree-loop-distribution.c2
-rw-r--r--gcc/tree-object-size.c5
-rw-r--r--gcc/tree-pass.h2
-rw-r--r--gcc/tree-predcom.c2
-rw-r--r--gcc/tree-scalar-evolution.c4
-rw-r--r--gcc/tree-sra.c3
-rw-r--r--gcc/tree-ssa-alias.c60
-rw-r--r--gcc/tree-ssa-alias.h1
-rw-r--r--gcc/tree-ssa-ccp.c11
-rw-r--r--gcc/tree-ssa-pre.c26
-rw-r--r--gcc/tree-ssa-propagate.c50
-rw-r--r--gcc/tree-ssa-propagate.h4
-rw-r--r--gcc/tree-ssa-reassoc.c455
-rw-r--r--gcc/tree-ssa-sccvn.c13
-rw-r--r--gcc/tree-ssa-sccvn.h14
-rw-r--r--gcc/tree-ssa-strlen.c1997
-rw-r--r--gcc/tree-ssa-structalias.c42
-rw-r--r--gcc/tree-ssa-tail-merge.c1706
-rw-r--r--gcc/tree-streamer-out.c15
-rw-r--r--gcc/tree-streamer.h2
-rw-r--r--gcc/tree-vect-generic.c75
-rw-r--r--gcc/tree-vect-slp.c133
-rw-r--r--gcc/tree-vect-stmts.c28
-rw-r--r--gcc/tree.c32
-rw-r--r--gcc/tree.h2
-rw-r--r--gcc/varasm.c4
-rw-r--r--include/ChangeLog19
-rw-r--r--include/demangle.h4
-rw-r--r--include/libiberty.h4
-rw-r--r--include/plugin-api.h11
-rw-r--r--include/timeval-utils.h40
-rw-r--r--libgcc/ChangeLog9
-rw-r--r--libgcc/config/rx/rx-abi.h17
-rw-r--r--libgcc/config/rx/rx-lib.h3
-rw-r--r--libgo/MERGE2
-rw-r--r--libgo/Makefile.am5
-rw-r--r--libgo/Makefile.in5
-rw-r--r--libgo/go/go/types/testdata/test0.src154
-rw-r--r--libgo/go/gob/doc.go3
-rw-r--r--libgo/go/html/testdata/webkit/adoption01.dat194
-rw-r--r--libgo/go/html/testdata/webkit/adoption02.dat31
-rw-r--r--libgo/go/html/testdata/webkit/html5test-com.dat246
-rw-r--r--libgo/go/html/testdata/webkit/inbody01.dat43
-rw-r--r--libgo/go/html/testdata/webkit/isindex.dat40
-rw-r--r--libgo/go/html/testdata/webkit/pending-spec-changes.dat28
-rw-r--r--libgo/go/html/testdata/webkit/plain-text-unsafe.dat8
-rw-r--r--libgo/go/html/testdata/webkit/scripted/adoption01.dat15
-rw-r--r--libgo/go/html/testdata/webkit/scripted/webkit01.dat28
-rw-r--r--libgo/go/html/testdata/webkit/tables01.dat197
-rw-r--r--libgo/go/html/testdata/webkit/tests17.dat153
-rw-r--r--libgo/go/html/testdata/webkit/tests18.dat269
-rw-r--r--libgo/go/html/testdata/webkit/tests19.dat1220
-rw-r--r--libgo/go/html/testdata/webkit/tests20.dat455
-rw-r--r--libgo/go/html/testdata/webkit/tests21.dat221
-rw-r--r--libgo/go/html/testdata/webkit/tests22.dat157
-rw-r--r--libgo/go/html/testdata/webkit/tests23.dat155
-rw-r--r--libgo/go/html/testdata/webkit/tests24.dat79
-rw-r--r--libgo/go/html/testdata/webkit/tests25.dat219
-rw-r--r--libgo/go/html/testdata/webkit/tests26.dat195
-rw-r--r--libgo/go/html/testdata/webkit/tests_innerHTML_1.dat733
-rw-r--r--libgo/go/html/testdata/webkit/tricky01.dat261
-rw-r--r--libgo/go/html/testdata/webkit/webkit02.dat104
-rw-r--r--libgo/go/http/cgi/host_test.go4
-rwxr-xr-xlibgo/go/http/cgi/testdata/test.cgi96
-rw-r--r--libgo/go/image/png/testdata/pngsuite/basn3p08-trns.pngbin0 -> 1538 bytes
-rw-r--r--libgo/go/image/png/testdata/pngsuite/basn3p08-trns.sng301
-rw-r--r--libgo/go/json/decode.go22
-rw-r--r--libgo/go/json/decode_test.go11
-rw-r--r--libgo/go/json/encode.go62
-rw-r--r--libgo/go/json/encode_test.go38
-rw-r--r--libgo/go/json/tags.go44
-rw-r--r--libgo/go/json/tags_test.go28
-rw-r--r--libgo/go/reflect/type.go3
-rwxr-xr-x[-rw-r--r--]libgo/merge.sh2
-rwxr-xr-xlibgo/mksysinfo.sh15
-rw-r--r--libgo/runtime/go-make-slice.c3
-rw-r--r--libgo/runtime/go-map-delete.c4
-rw-r--r--libgo/runtime/go-map-index.c8
-rw-r--r--libgo/runtime/go-new-channel.c2
-rw-r--r--libgo/runtime/map.goc11
-rw-r--r--libgo/syscalls/exec.go21
-rwxr-xr-xlibgo/testsuite/gotest4
-rw-r--r--libiberty/ChangeLog26
-rw-r--r--libiberty/argv.c23
-rw-r--r--libiberty/cp-demangle.c57
-rw-r--r--libiberty/md5.c10
-rw-r--r--libiberty/testsuite/demangle-expected47
-rw-r--r--libiberty/timeval-utils.c87
-rw-r--r--libjava/classpath/ChangeLog6
-rwxr-xr-xlibjava/classpath/tools/Makefile.am1
-rw-r--r--libjava/classpath/tools/Makefile.in1
-rw-r--r--libquadmath/ChangeLog5
-rw-r--r--libquadmath/Makefile.am3
-rw-r--r--libquadmath/Makefile.in3
-rw-r--r--libstdc++-v3/ChangeLog109
-rw-r--r--libstdc++-v3/acinclude.m421
-rw-r--r--libstdc++-v3/config.h.in2
-rw-r--r--libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver56
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver2
-rwxr-xr-xlibstdc++-v3/configure46
-rw-r--r--libstdc++-v3/configure.ac8
-rw-r--r--libstdc++-v3/doc/Makefile.am17
-rw-r--r--libstdc++-v3/doc/Makefile.in17
-rw-r--r--libstdc++-v3/doc/html/api.html11
-rw-r--r--libstdc++-v3/doc/html/bk02.html2
-rw-r--r--libstdc++-v3/doc/html/bk03.html2
-rw-r--r--libstdc++-v3/doc/html/faq.html6
-rw-r--r--libstdc++-v3/doc/html/images/confdeps.pngbin0 -> 20653 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_balls_and_bins.pngbin0 -> 10139 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push.pngbin0 -> 32915 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push_pop.pngbin0 -> 33264 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_cc_hash_int_find.pngbin0 -> 66803 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_find.pngbin0 -> 67129 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_insert.pngbin0 -> 67625 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_ccgp_hash_int_subscript_insert.pngbin0 -> 64083 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_container_tag_hierarchy.pngbin0 -> 85192 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_different_underlying_dss_1.pngbin0 -> 31858 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_different_underlying_dss_2.pngbin0 -> 15660 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_embedded_lists_1.pngbin0 -> 16350 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_embedded_lists_2.pngbin0 -> 18206 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_embedded_lists_3.pngbin0 -> 5612 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_exception_hierarchy.pngbin0 -> 18245 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_gp_hash_int_find.pngbin0 -> 46447 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_find.pngbin0 -> 47232 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_insert.pngbin0 -> 49697 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_int_erase_mem.pngbin0 -> 48012 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_policy_cd.pngbin0 -> 25302 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram.pngbin0 -> 12962 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram2.pngbin0 -> 8918 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_ranged_hash_range_hashing_fns.pngbin0 -> 19773 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_text_find.pngbin0 -> 57070 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_hash_zlob_int_find.pngbin0 -> 53858 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram1.pngbin0 -> 25834 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram2.pngbin0 -> 25522 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram3.pngbin0 -> 24542 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_invalidation_guarantee_erase.pngbin0 -> 25884 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_invalidation_tag_hierarchy.pngbin0 -> 14178 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_list_update.pngbin0 -> 20987 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_hash.pngbin0 -> 45704 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_tree.pngbin0 -> 37835 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_hash.pngbin0 -> 44996 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_tree.pngbin0 -> 37341 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_hash.pngbin0 -> 46498 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_tree.pngbin0 -> 37488 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_hash.pngbin0 -> 49055 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_tree.pngbin0 -> 41256 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_hash.pngbin0 -> 48026 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_tree.pngbin0 -> 40541 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_hash.pngbin0 -> 47330 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_tree.pngbin0 -> 38337 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_node_invariants.pngbin0 -> 16553 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_down_thin.pngbin0 -> 25795 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_up_thin.pngbin0 -> 26470 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push.pngbin0 -> 35873 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push_pop.pngbin0 -> 34785 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_pat_trie.pngbin0 -> 26182 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_point_iterator_hierarchy.pngbin0 -> 20307 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_1.pngbin0 -> 14206 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_2.pngbin0 -> 12876 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_different_underlying_dss.pngbin0 -> 15660 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_int_push.pngbin0 -> 44300 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_int_push_pop.pngbin0 -> 47243 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_tag_hierarchy.pngbin0 -> 29346 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_join.pngbin0 -> 49521 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_down.pngbin0 -> 45433 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_up.pngbin0 -> 44676 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_pop_mem.pngbin0 -> 44599 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_push.pngbin0 -> 43555 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_priority_queue_text_push_pop.pngbin0 -> 44314 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_rationale_null_node_updator.pngbin0 -> 25097 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_resize_policy_cd.pngbin0 -> 20806 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_restoring_node_invariants.pngbin0 -> 14432 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_simple_list.pngbin0 -> 4299 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_int_find.pngbin0 -> 37647 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_node_invalidations.pngbin0 -> 32276 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_node_invariants.pngbin0 -> 16553 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_node_updator_policy_cd.pngbin0 -> 9236 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_order_statistics.pngbin0 -> 36565 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_split_join.pngbin0 -> 38092 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_text_find.pngbin0 -> 43323 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_text_insert_node.pngbin0 -> 35682 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_text_insert_trie.pngbin0 -> 28044 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_text_insert_vector.pngbin0 -> 28291 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_tree_text_lor_find.pngbin0 -> 43242 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_trie_node_updator_policy_cd.pngbin0 -> 12126 bytes
-rw-r--r--libstdc++-v3/doc/html/images/pbds_update_seq_diagram.pngbin0 -> 10789 bytes
-rw-r--r--libstdc++-v3/doc/html/index.html211
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html62
-rw-r--r--libstdc++-v3/doc/html/manual/algorithms.html8
-rw-r--r--libstdc++-v3/doc/html/manual/api.html8
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_contributing.html6
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_free.html6
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gfdl.html4
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_gpl.html8
-rw-r--r--libstdc++-v3/doc/html/manual/appendix_porting.html32
-rw-r--r--libstdc++-v3/doc/html/manual/associative.html6
-rw-r--r--libstdc++-v3/doc/html/manual/atomics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html61
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator.html319
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02.html12
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s02.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html6
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s02.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s04.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch18s05.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html6
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s04.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s05.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s06.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html6
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch20s02.html39
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch20s03.html161
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch20s04.html79
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch20s05.html107
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html352
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html50
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch30s02.html41
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03ch30s03.html36
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt03pr01.html13
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt04.html30
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html4
-rw-r--r--libstdc++-v3/doc/html/manual/concurrency.html6
-rw-r--r--libstdc++-v3/doc/html/manual/configure.html4
-rw-r--r--libstdc++-v3/doc/html/manual/containers.html8
-rw-r--r--libstdc++-v3/doc/html/manual/containers_and_c.html4
-rw-r--r--libstdc++-v3/doc/html/manual/debug.html6
-rw-r--r--libstdc++-v3/doc/html/manual/debug_mode.html7
-rw-r--r--libstdc++-v3/doc/html/manual/diagnostics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/documentation_hacking.html12
-rw-r--r--libstdc++-v3/doc/html/manual/dynamic_memory.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_algorithms.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_allocators.html397
-rw-r--r--libstdc++-v3/doc/html/manual/ext_compile_checks.html4
-rw-r--r--libstdc++-v3/doc/html/manual/ext_concurrency.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_containers.html47
-rw-r--r--libstdc++-v3/doc/html/manual/ext_demangling.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_io.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_iterators.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_numerics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/ext_utilities.html6
-rw-r--r--libstdc++-v3/doc/html/manual/extensions.html71
-rw-r--r--libstdc++-v3/doc/html/manual/facets.html90
-rw-r--r--libstdc++-v3/doc/html/manual/fstreams.html4
-rw-r--r--libstdc++-v3/doc/html/manual/generalized_numeric_operations.html4
-rw-r--r--libstdc++-v3/doc/html/manual/index.html166
-rw-r--r--libstdc++-v3/doc/html/manual/internals.html4
-rw-r--r--libstdc++-v3/doc/html/manual/intro.html8
-rw-r--r--libstdc++-v3/doc/html/manual/io.html6
-rw-r--r--libstdc++-v3/doc/html/manual/io_and_c.html6
-rw-r--r--libstdc++-v3/doc/html/manual/iterators.html6
-rw-r--r--libstdc++-v3/doc/html/manual/license.html4
-rw-r--r--libstdc++-v3/doc/html/manual/localization.html27
-rw-r--r--libstdc++-v3/doc/html/manual/make.html4
-rw-r--r--libstdc++-v3/doc/html/manual/memory.html86
-rw-r--r--libstdc++-v3/doc/html/manual/mt_allocator.html23
-rw-r--r--libstdc++-v3/doc/html/manual/numerics.html6
-rw-r--r--libstdc++-v3/doc/html/manual/numerics_and_c.html4
-rw-r--r--libstdc++-v3/doc/html/manual/pairs.html4
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode.html10
-rw-r--r--libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html3813
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures.html1312
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_biblio.html29
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_design.html1430
-rw-r--r--libstdc++-v3/doc/html/manual/policy_data_structures_using.html483
-rw-r--r--libstdc++-v3/doc/html/manual/profile_mode.html8
-rw-r--r--libstdc++-v3/doc/html/manual/setup.html4
-rw-r--r--libstdc++-v3/doc/html/manual/source_code_style.html4
-rw-r--r--libstdc++-v3/doc/html/manual/source_design_notes.html4
-rw-r--r--libstdc++-v3/doc/html/manual/source_organization.html4
-rw-r--r--libstdc++-v3/doc/html/manual/spine.html67
-rw-r--r--libstdc++-v3/doc/html/manual/status.html20
-rw-r--r--libstdc++-v3/doc/html/manual/streambufs.html4
-rw-r--r--libstdc++-v3/doc/html/manual/strings.html6
-rw-r--r--libstdc++-v3/doc/html/manual/stringstreams.html4
-rw-r--r--libstdc++-v3/doc/html/manual/support.html6
-rw-r--r--libstdc++-v3/doc/html/manual/termination.html4
-rw-r--r--libstdc++-v3/doc/html/manual/test.html6
-rw-r--r--libstdc++-v3/doc/html/manual/traits.html4
-rw-r--r--libstdc++-v3/doc/html/manual/using.html8
-rw-r--r--libstdc++-v3/doc/html/manual/using_concurrency.html4
-rw-r--r--libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html4
-rw-r--r--libstdc++-v3/doc/html/manual/using_exceptions.html41
-rw-r--r--libstdc++-v3/doc/html/manual/using_headers.html16
-rw-r--r--libstdc++-v3/doc/html/manual/using_macros.html4
-rw-r--r--libstdc++-v3/doc/html/manual/using_namespaces.html4
-rw-r--r--libstdc++-v3/doc/html/manual/utilities.html8
-rw-r--r--libstdc++-v3/doc/html/spine.html62
-rw-r--r--libstdc++-v3/doc/xml/api.xml10
-rw-r--r--libstdc++-v3/doc/xml/manual/spine.xml141
-rw-r--r--libstdc++-v3/doc/xml/spine.xml206
-rw-r--r--libstdc++-v3/include/bits/c++config37
-rw-r--r--libstdc++-v3/include/bits/deque.tcc4
-rw-r--r--libstdc++-v3/include/bits/hashtable.h6
-rw-r--r--libstdc++-v3/include/bits/random.tcc8
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h3
-rw-r--r--libstdc++-v3/include/bits/vector.tcc9
-rw-r--r--libstdc++-v3/include/c_global/cwchar4
-rw-r--r--libstdc++-v3/include/debug/deque6
-rw-r--r--libstdc++-v3/include/debug/vector15
-rw-r--r--libstdc++-v3/include/std/limits74
-rw-r--r--libstdc++-v3/include/std/type_traits12
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc5
-rw-r--r--libstdc++-v3/src/future.cc2
-rw-r--r--libstdc++-v3/src/limits.cc94
-rw-r--r--libstdc++-v3/src/system_error.cc4
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc5
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc4
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc4
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/bind/48698.cc31
-rw-r--r--libstdc++-v3/testsuite/20_util/is_floating_point/value.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/is_integral/value.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/is_signed/value.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/is_unsigned/value.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc10
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc10
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc38
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_common_types.h8
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_error.h4
-rw-r--r--lto-plugin/ChangeLog17
-rw-r--r--lto-plugin/lto-plugin.c26
876 files changed, 41387 insertions, 6011 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b26feb7e42..69c10e7f241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-21 Jakub Jelinek <jakub@redhat.com>
+
+ * MAINTAINERS (sparc port): Remove myself.
+
2011-09-14 Tom de Vries <tom@codesourcery.com>
* MAINTAINERS (Write After Approval): Add myself.
diff --git a/MAINTAINERS b/MAINTAINERS
index fdb63d9b1fc..9eae7f94e25 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -98,7 +98,6 @@ sh port Alexandre Oliva aoliva@redhat.com
sh port Kaz Kojima kkojima@gcc.gnu.org
sparc port Richard Henderson rth@redhat.com
sparc port David S. Miller davem@redhat.com
-sparc port Jakub Jelinek jakub@redhat.com
sparc port Eric Botcazou ebotcazou@libertysurf.fr
spu port Trevor Smigiel trevor_smigiel@playstation.sony.com
spu port David Edelsohn dje.gcc@gmail.com
diff --git a/contrib/ChangeLog.google-integration b/contrib/ChangeLog.google-integration
index f4242ab5a10..b278e8c92c6 100644
--- a/contrib/ChangeLog.google-integration
+++ b/contrib/ChangeLog.google-integration
@@ -1,3 +1,9 @@
+2011-10-02 Diego Novillo <dnovillo@google.com>
+
+ * testsuite-management/x86_64-unknown-linux-gnu.xfail: Update with
+ failures fixed in trunk.
+ Mark boehm-gc.c/gctest.c flaky.
+
2011-09-20 Diego Novillo <dnovillo@google.com>
* testsuite-management/x86_64-unknown-linux-gnu.xfail: Update with
diff --git a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
index a16ab6c3aed..1a2a5a5afec 100644
--- a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
@@ -18,14 +18,13 @@ XPASS: gcc.dg/unroll_2.c (test for excess errors)
XPASS: gcc.dg/unroll_3.c (test for excess errors)
XPASS: gcc.dg/unroll_4.c (test for excess errors)
FAIL: libmudflap.c++/pass55-frag.cxx ( -O) execution test
-FAIL: g++.dg/vect/slp-pr50413.cc scan-tree-dump-times slp "basic block vectorized using SLP" 0
# The following tests are failing with gold. The LTO plugin is not resolving
# names properly. Only builds configured to use gold will show these.
-UNRESOLVED: gcc.c-torture/execute/builtins/strstr-asm.c execution, -O2 -flto
-FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation, -O2 -flto
-FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation, -O2 -flto -flto-partition=none
-UNRESOLVED: gcc.c-torture/execute/builtins/strstr-asm.c execution, -O2 -flto -flto-partition=none
+UNRESOLVED: g++.dg/lto/20100302 cp_lto_20100302_0.o-cp_lto_20100302_1.o execute -flto -fabi-version=2
+FAIL: g++.dg/lto/20100302 cp_lto_20100302_0.o-cp_lto_20100302_1.o link, -flto -fabi-version=2 (internal compiler error)
+UNRESOLVED: gcc.dg/lto/pr47259 c_lto_pr47259_0.o-c_lto_pr47259_1.o execute -O2 -flto -w
+FAIL: gcc.dg/lto/pr47259 c_lto_pr47259_0.o-c_lto_pr47259_1.o link, -O2 -flto -w
# These tests only fail when boehm-gc.c is enabled.
FAIL: boehm-gc.c/thread_leak_test.c -O2 (test for excess errors)
@@ -42,3 +41,4 @@ flaky | FAIL: libmudflap.cth/pass40-frag.c (-O3) output pattern test
flaky | FAIL: libmudflap.cth/pass40-frag.c execution test
flaky | FAIL: libmudflap.cth/pass40-frag.c output pattern test
flaky | FAIL: libmudflap.cth/pass40-frag.c (-O2) execution test
+flaky | FAIL: boehm-gc.c/gctest.c -O2 execution test
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index d286e5020bd..cb67edccde9 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,17 @@
+2011-09-26 Tristan Gingold <gingold@adacore.com>
+
+ * inclhack.def (ms_define_can_use_extern_prefix):
+ (vms_use_pragma_extern_model, vms_disable_decc_string_builtins):
+ New fixes.
+ * fixincl.x: Regenerate.
+ * tests/base/rtldef/string.h: New test.
+ * tests/base/rtldef/decc$types.h: Likewise.
+ * tests/base/testing.h: Update
+
+2011-09-22 Tristan Gingold <gingold@adacore.com>
+
+ * mkfixinc.sh (target): Remove alpha-vms from particular targets.
+
2011-08-23 Steve Ellcey <sje@cup.hp.com>
PR libstdc++/50153
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index e936b70557f..cc25834c399 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Monday August 22, 2011 at 05:03:34 PM PDT
+ * It has been AutoGen-ed September 22, 2011 at 04:28:52 PM by AutoGen 5.11.1
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Aug 22 17:03:34 PDT 2011
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Sep 22 16:28:52 CEST 2011
*
* 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 217 fixup descriptions.
+ * This file contains 220 fixup descriptions.
*
* See README for more information.
*
@@ -8446,6 +8446,121 @@ static const char* apzVa_I960_MacroPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Vms_Define_Can_Use_Extern_Prefix fix
+ */
+tSCC zVms_Define_Can_Use_Extern_PrefixName[] =
+ "vms_define_can_use_extern_prefix";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVms_Define_Can_Use_Extern_PrefixList[] =
+ "rtldef/decc$types.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVms_Define_Can_Use_Extern_PrefixMachs[] = {
+ "*-*-*vms*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zVms_Define_Can_Use_Extern_PrefixSelect0[] =
+ "#[ \t]*else\n\
+#[ \t]*if defined\\(__DECCXX\\)\n\
+#[ \t]*define __CAN_USE_EXTERN_PREFIX 1\n";
+
+#define VMS_DEFINE_CAN_USE_EXTERN_PREFIX_TEST_CT 1
+static tTestDesc aVms_Define_Can_Use_Extern_PrefixTests[] = {
+ { TT_EGREP, zVms_Define_Can_Use_Extern_PrefixSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Vms_Define_Can_Use_Extern_Prefix
+ */
+static const char* apzVms_Define_Can_Use_Extern_PrefixPatch[] = {
+ "format",
+ "%0# elif defined (__GNUC__)\n\
+#\tdefine __CAN_USE_EXTERN_PREFIX 1\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Vms_Use_Pragma_Extern_Model fix
+ */
+tSCC zVms_Use_Pragma_Extern_ModelName[] =
+ "vms_use_pragma_extern_model";
+
+/*
+ * File name selection pattern
+ */
+#define zVms_Use_Pragma_Extern_ModelList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVms_Use_Pragma_Extern_ModelMachs[] = {
+ "*-*-*vms*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zVms_Use_Pragma_Extern_ModelSelect0[] =
+ "#if defined\\(__DECC\\) \\|\\| defined\\(__DECCXX\\)\n\
+# pragma extern_model __save\n";
+
+#define VMS_USE_PRAGMA_EXTERN_MODEL_TEST_CT 1
+static tTestDesc aVms_Use_Pragma_Extern_ModelTests[] = {
+ { TT_EGREP, zVms_Use_Pragma_Extern_ModelSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Vms_Use_Pragma_Extern_Model
+ */
+static const char* apzVms_Use_Pragma_Extern_ModelPatch[] = {
+ "format",
+ "#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)\n\
+# pragma extern_model __save\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Vms_Disable_Decc_String_Builtins fix
+ */
+tSCC zVms_Disable_Decc_String_BuiltinsName[] =
+ "vms_disable_decc_string_builtins";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVms_Disable_Decc_String_BuiltinsList[] =
+ "rtldef/string.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVms_Disable_Decc_String_BuiltinsMachs[] = {
+ "*-*-*vms*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zVms_Disable_Decc_String_BuiltinsSelect0[] =
+ "#if !defined\\(__VAX\\)\n";
+
+#define VMS_DISABLE_DECC_STRING_BUILTINS_TEST_CT 1
+static tTestDesc aVms_Disable_Decc_String_BuiltinsTests[] = {
+ { TT_EGREP, zVms_Disable_Decc_String_BuiltinsSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Vms_Disable_Decc_String_Builtins
+ */
+static const char* apzVms_Disable_Decc_String_BuiltinsPatch[] = {
+ "format",
+ "#if !defined(__VAX) && !defined(__GNUC__)\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Void_Null fix
*/
tSCC zVoid_NullName[] =
@@ -8838,9 +8953,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 258
+#define REGEX_COUNT 261
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 217
+#define FIX_COUNT 220
/*
* Enumerate the fixes
@@ -9054,6 +9169,9 @@ typedef enum {
ULTRIX_CONST_FIXIDX,
ULTRIX_CONST2_FIXIDX,
VA_I960_MACRO_FIXIDX,
+ VMS_DEFINE_CAN_USE_EXTERN_PREFIX_FIXIDX,
+ VMS_USE_PRAGMA_EXTERN_MODEL_FIXIDX,
+ VMS_DISABLE_DECC_STRING_BUILTINS_FIXIDX,
VOID_NULL_FIXIDX,
VXWORKS_GCC_PROBLEM_FIXIDX,
VXWORKS_NEEDS_VXTYPES_FIXIDX,
@@ -10106,6 +10224,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
VA_I960_MACRO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVa_I960_MacroTests, apzVa_I960_MacroPatch, 0 },
+ { zVms_Define_Can_Use_Extern_PrefixName, zVms_Define_Can_Use_Extern_PrefixList,
+ apzVms_Define_Can_Use_Extern_PrefixMachs,
+ VMS_DEFINE_CAN_USE_EXTERN_PREFIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVms_Define_Can_Use_Extern_PrefixTests, apzVms_Define_Can_Use_Extern_PrefixPatch, 0 },
+
+ { zVms_Use_Pragma_Extern_ModelName, zVms_Use_Pragma_Extern_ModelList,
+ apzVms_Use_Pragma_Extern_ModelMachs,
+ VMS_USE_PRAGMA_EXTERN_MODEL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVms_Use_Pragma_Extern_ModelTests, apzVms_Use_Pragma_Extern_ModelPatch, 0 },
+
+ { zVms_Disable_Decc_String_BuiltinsName, zVms_Disable_Decc_String_BuiltinsList,
+ apzVms_Disable_Decc_String_BuiltinsMachs,
+ VMS_DISABLE_DECC_STRING_BUILTINS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVms_Disable_Decc_String_BuiltinsTests, apzVms_Disable_Decc_String_BuiltinsPatch, 0 },
+
{ zVoid_NullName, zVoid_NullList,
apzVoid_NullMachs,
VOID_NULL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index d670d60dee4..afaabc0422d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -4508,6 +4508,65 @@ fix = {
/*
+ * Define __CAN_USE_EXTERN_PREFIX on vms.
+ */
+fix = {
+ hackname = vms_define_can_use_extern_prefix;
+ files = "rtldef/decc$types.h";
+ select = "#[ \t]*else\n"
+ "#[ \t]*if defined\\(__DECCXX\\)\n"
+ "#[ \t]*define __CAN_USE_EXTERN_PREFIX 1\n";
+ mach = "*-*-*vms*";
+ c_fix = format;
+
+ c_fix_arg = "%0"
+ "# elif defined (__GNUC__)\n"
+ "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n";
+
+ test_text = "# else\n"
+ "# if defined(__DECCXX)\n"
+ "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n"
+ "# endif\n"
+ "# endif\n";
+};
+
+/*
+ * On VMS, use pragma extern_model instead of VAX-C keywords.
+ */
+fix = {
+ hackname = vms_use_pragma_extern_model;
+ select = "#if defined\\(__DECC\\) \\|\\| defined\\(__DECCXX\\)\n"
+ "# pragma extern_model __save\n";
+ mach = "*-*-*vms*";
+ c_fix = format;
+
+ c_fix_arg = "#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)\n"
+ "# pragma extern_model __save\n";
+
+ test_text = "#if defined(__DECC) || defined(__DECCXX)\n"
+ "# pragma extern_model __save\n"
+ "# pragma extern_model strict_refdef\n"
+ " extern struct x zz$yy;\n"
+ "# pragma extern_model __restore\n"
+ "#endif\n";
+};
+
+/*
+ * On VMS, disable the use of dec-c string builtins
+ */
+fix = {
+ hackname = vms_disable_decc_string_builtins;
+ select = "#if !defined\\(__VAX\\)\n";
+ mach = "*-*-*vms*";
+ files = "rtldef/string.h";
+ c_fix = format;
+
+ c_fix_arg = "#if !defined(__VAX) && !defined(__GNUC__)\n";
+
+ test_text = "#if !defined(__VAX)\n";
+};
+
+/*
* AIX and Interix headers define NULL to be cast to a void pointer,
* which is illegal in ANSI C++.
*/
diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index bd8d37a321f..89e8ab7d5f2 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -11,7 +11,6 @@ target=fixinc.sh
# Check for special fix rules for particular targets
case $machine in
- alpha*-dec-*vms* | \
i?86-*-cygwin* | \
i?86-*-mingw32* | \
x86_64-*-mingw32* | \
diff --git a/fixincludes/tests/base/rtldef/decc$types.h b/fixincludes/tests/base/rtldef/decc$types.h
new file mode 100644
index 00000000000..5a7e0fc68e8
--- /dev/null
+++ b/fixincludes/tests/base/rtldef/decc$types.h
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/rtldef/decc$types.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK )
+# else
+# if defined(__DECCXX)
+# define __CAN_USE_EXTERN_PREFIX 1
+# elif defined (__GNUC__)
+# define __CAN_USE_EXTERN_PREFIX 1
+# endif
+# endif
+
+#endif /* VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK */
diff --git a/fixincludes/tests/base/rtldef/string.h b/fixincludes/tests/base/rtldef/string.h
new file mode 100644
index 00000000000..1ac9b2add92
--- /dev/null
+++ b/fixincludes/tests/base/rtldef/string.h
@@ -0,0 +1,15 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/rtldef/string.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( VMS_DISABLE_DECC_STRING_BUILTINS_CHECK )
+#if !defined(__VAX) && !defined(__GNUC__)
+
+#endif /* VMS_DISABLE_DECC_STRING_BUILTINS_CHECK */
diff --git a/fixincludes/tests/base/testing.h b/fixincludes/tests/base/testing.h
index 43a4ff715df..c15a151280f 100644
--- a/fixincludes/tests/base/testing.h
+++ b/fixincludes/tests/base/testing.h
@@ -120,3 +120,14 @@ extern unsigned int
extern size_t
strlen(), strspn();
#endif /* SYSV68_STRING_CHECK */
+
+
+#if defined( VMS_USE_PRAGMA_EXTERN_MODEL_CHECK )
+#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)
+# pragma extern_model __save
+# pragma extern_model strict_refdef
+ extern struct x zz;
+# pragma extern_model __restore
+#endif
+
+#endif /* VMS_USE_PRAGMA_EXTERN_MODEL_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c58a0936dd3..4aa277aac4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1205 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (verify_edge_count_and_frequency): Bounds check.
+
+ * cgraphunit.c (ipa_passes): Remove unrechable nodes.
+ * lto-streamer-out.c (produce_symtab): Skip unused extern declarations.
+ * ipa.c (cgraph_remove_unreachable_nodes): Do not assume that external
+ functions are reachable when address is taken.
+ * tree-sra.c (modify_function): Free dominance info.
+
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (inline_summary_alloc): Bounds check.
+
+ * ipa-inline-analysis.c (reset_inline_edge_summary): New function.
+ (reset_inline_summary): New function.
+ (compute_inline_parameters, inline_node_removal_hook,
+ inline_edge_removal_hook): Use it.
+ (inline_free_summary): Reset holders correctly.
+ (inline_generate_summary): Free summary before computing it.
+
+2011-10-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR preprocessor/36819
+ * incpath.c (merge_include_chains): Call free_path on
+ heads[QUOTE] and tails[QUOTE].
+
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47247
+ * lto-symtab.c (lto_symtab_resolve_symbols): Do not resolve
+ when resolution is already availbale from plugin.
+ (lto_symtab_merge_decls_1): Handle LDPR_PREVAILING_DEF_IRONLY_EXP.
+ * cgraph.c (ld_plugin_symbol_resolution): Add prevailing_def_ironly_exp.
+ * lto-cgraph.c (LDPR_NUM_KNOWN): Update.
+ * ipa.c (varpool_externally_visible_p): IRONLY variables are never
+ externally visible.
+ * varasm.c (resolution_to_local_definition_p): Add
+ LDPR_PREVAILING_DEF_IRONLY_EXP.
+ (resolution_local_p): Likewise.
+
+2011-10-01 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.opt (VIS3): New option.
+ * doc/invoke.texi: Document it.
+ * config/sparc/sparc.h: Force TARGET_VIS3 to zero if assembler is
+ not capable of such instructions.
+ * config/sparc/sparc-c.c (sparc_target_macros): Define __VIS__
+ to 0x300 when TARGET_VIS3.
+ * config/sparc/sparc-modes.def: Create 16-byte vector modes.
+ * config/sparc/sparc.md (UNSPEC_CMASK8, UNSPEC_CMASK16, UNSPEC_CMASK32,
+ UNSPEC_FCHKSM16, UNSPEC_PDISTN, UNSPC_FUCMP): New unspecs.
+ (V64N8, VASS): New mode iterators.
+ (vis3_shift, vis3_addsub_ss): New code iterators.
+ (vbits, vconstr): New mode attributes.
+ (vis3_shift_insn, vis3_addsub_ss_insn): New code attributes.
+ (cmask8<P:mode>_vis, cmask16<P:mode>_vis, cmask32<P:mode>_vis,
+ fchksm16_vis, <vis3_shift_insn><vbits>_vis, pdistn<mode>_vis,
+ fmean16_vis, fpadd64_vis, fpsub64_vis, <vis3_addsub_ss_insn><vbits>_vis,
+ fucmp<code>8<P:mode>_vis): New VIS 3.0 instruction patterns.
+ * config/sparc/sparc.c (sparc_option_override): Set MASK_VIS3 by
+ default when targetting capable cpus. TARGET_VIS3 implies
+ TARGET_VIS2 and TARGET_VIS, and clear them when TARGET_FPU is
+ disabled.
+ (sparc_vis_init_builtins): Emit new VIS 3.0 builtins.
+ (sparc_fold_builtin): Do not eliminate cmask{8,16,32} when result
+ is ignored.
+ * config/sparc/visintrin.h (__vis_cmask8, __vis_cmask16,
+ __vis_cmask32, __vis_fchksm16, __vis_fsll16, __vis_fslas16,
+ __vis_fsrl16, __vis_fsra16, __vis_fsll32, __vis_fslas32,
+ __vis_fsrl32, __vis_fsra32, __vis_pdistn, __vis_fmean16,
+ __vis_fpadd64, __vis_fpsub64, __vis_fpadds16, __vis_fpadds16s,
+ __vis_fpsubs16, __vis_fpsubs16s, __vis_fpadds32, __vis_fpadds32s,
+ __vis_fpsubs32, __vis_fpsubs32s, __vis_fucmple8, __vis_fucmpne8,
+ __vis_fucmpgt8, __vis_fucmpeq8): New VIS 3.0 interfaces.
+ * doc/extend.texi: Document new VIS 3.0 builtins.
+
+2011-10-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ira-color.c (assign_hard_reg): Fix typo.
+
+2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Add missing ','.
+
+2011-09-30 Bernd Schmidt <bernds@codesourcery.com>
+
+ * common/config/c6x/c6x-common.c (c6x_option_optimization_table):
+ Enable -fmodulo-sched at -O2 and above.
+ * config/c6x/c6x.md (doloop_end): New expander.
+ (mvilc, sploop, spkernel, loop_end): New patterns.
+ (loop_end with memory destination splitter): New.
+ * config/c6x/c6x.c: Include "hw-doloop.h".
+ (enum unitreqs): New.
+ (unit_req_table): New typedef.
+ (unit_reqs): New static variable.
+ (unit_req_factor, get_unit_reqs, count_unit_reqs, merge_unit_reqs,
+ res_mii, split_delayed_nonbranch, undo_split_delayed_nonbranch,
+ hwloop_pattern_reg, bb_earliest_end_cycle, filter_insns_above,
+ hwloop_optimize, hwloop_fail, c6x_hwloops): New static functions.
+ (struct c6x_sched_context): New member last_scheduled_iter0.
+ (init_sched_state): Initialize it.
+ (c6x_variable_issue): Update it.
+ (sploop_max_uid_iter0): New static variable.
+ (c6x_sched_reorder_1): Be careful about issuing sploop.
+ (c6x_reorg): Call c6x_hwlooops before the final schedule.
+
+2011-09-30 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50566
+ * config/avr/avr-protos.h (avr_log_t): New field address_cost.
+ * config/avr/avr.c (avr_address_cost): Use it.
+ * config/avr/avr-log.c (avr_log_set_avr_log): Initialize it.
+ (avr_log_vadump): Unknown %-codes finish printing.
+
+2011-09-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/50571
+ * gimple-fold.c (fold_stmt_1) <case GIMPLE_ASM>: If
+ input constraints allow mem and not reg, pass true instead of
+ false as second argument to maybe_fold_reference.
+
+ PR tree-optimization/46309
+ * fold-const.c (make_range, merge_ranges): Remove prototypes.
+ (make_range_step): New function.
+ (make_range): Use it.
+ * tree.h (make_range_step): New prototypes.
+ * Makefile.in (tree-ssa-reassoc.o): Depend on $(DIAGNOSTIC_CORE_H).
+ * tree-ssa-reassoc.c: Include diagnostic-core.h.
+ (struct range_entry): New type.
+ (init_range_entry, range_entry_cmp, update_range_test,
+ optimize_range_tests): New functions.
+ (reassociate_bb): Call optimize_range_tests.
+
+2011-09-30 Jakub Jelinek <jakub@redhat.com>
+ Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (find_func_aliases_for_builtin_call): Handle
+ BUILT_IN_STRDUP and BUILT_IN_STRNDUP.
+ * tree-ssa-alias.c (call_may_clobber_ref_p_1): Likewise. Fix
+ handling of BUILT_IN_STRNCAT and BUILT_IN_STRNCAT_CHK.
+ (ref_maybe_used_by_call_p_1): Fix handling of BUILT_IN_STRCAT,
+ BUILT_IN_STRNCAT, BUILT_IN_STRCAT_CHK and BUILT_IN_STRNCAT_CHK.
+
+2011-09-30 Jan Beulich <jbeulich@suse.com>
+
+ * lto-cgraph.c (output_cgraph): Remove processing of
+ 'cgraph_asm_nodes', call lto_output_toplevel_asms() instead.
+ (input_cgraph_1): Remove loop calling cgraph_add_asm_node(), call
+ lto_input_toplevel_asms() instead.
+ * lto-section-in.c (lto_section_name): Add "asm" entry.
+ * lto-streamer-in.c (lto_input_toplevel_asms): New.
+ * lto-streamer-out.c (lto_output_toplevel_asms): New.
+ * lto-streamer.h (LTO_minor_version): Bump.
+ (enum lto_section_type): Add LTO_section_asm.
+ (struct lto_asm_header): New.
+ (lto_input_toplevel_asms, lto_output_toplevel_asms): Declare.
+ * tree-streamer.h (streamer_write_string_cst): Declare.
+ * tree-streamer-out.c (write_string_cst): Rename to
+ streamer_write_string_cst and make global. Handle incoming string
+ being NULL.
+ (streamer_write_tree_header): Adjust call to renamed function.
+
+2011-09-30 Bernd Schmidt <bernds@codesourcery.com>
+
+ * haifa-sched.c (modulo_ii, modulo_max_states, modulo_n_insns,
+ modulo_insns_scheduled, modulo_iter0_max_uid, modulo_backtracks_left,
+ modulo_last_stage): New static variables.
+ (set_modulo_params, discard_delay_pairs_above): New functions.
+ (struct delay_pair): New member stages.
+ (htab_i2_traverse, htab_i1_traverse): New static functions.
+ (record_delay_slot_pair): New arg stages. All callers changed.
+ Record it.
+ (pair_delay): Take stages into account.
+ (add_delay_dependencies): Don't do so for stage pairs.
+ (struct sched_block_state): New member modulo_epilogue.
+ (save_backtrack_point): Don't set SHADOW_P for stage pairs.
+ (unschedule_insns_until): Decrease modulo_insns_scheduled.
+ Set HARD_DEP without using or.
+ (resolve_dependencies): New static function.
+ (prune_ready_list): New arg modulo_epilogue_p. All callers changed.
+ If it is true, allow only insns with INSN_EXACT_TICK set.
+ (schedule_block): Return bool, always true for normal scheduling,
+ true or false depending on modulo scheduling success otherwise.
+ Add bookkeeping for modulo scheduling, and call resolve_dependencies
+ on everything left over after a modulo schedule.
+ (haifa_sched_init): Remove check_cfg call. Clear modulo_ii.
+ * sched-int.h (schedule_block, record_delay_slot_pair): Adjust
+ declarations.
+ (set_modulo_params, discard_delay_pairs_above): Declare.
+ * params.def (PARAM_MAX_MODULO_BACKTRACK_ATTEMPS): New.
+ * doc/invoke.texi (--param): Document it.
+
+ * sched-ebb.c (schedule_ebb): No longer static. Remove declaration.
+ New arg modulo_scheduling. All callers changed. Move note handling
+ code here from schedule_ebbs.
+ (schedule_ebbs_finish, schedule_ebbs_init): New functions, broken
+ out of schedule_ebbs.
+ (schedule_ebbs): Call them. Remove note handling code moved to
+ schedule_ebb.
+ * sched-int.h (schedule_ebb, schedule_ebbs_init,
+ schedule_ebbs_finish): Declare.
+
+2011-09-30 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/50574
+ * tree-cfg.c (verify_gimple_comparison): Compare component
+ mode sizes for vector comparisons.
+
+2011-09-30 Revital Eres <revital.eres@linaro.org>
+
+ * ddg.c (autoinc_var_is_used_p): New function.
+ (create_ddg_dep_from_intra_loop_link,
+ add_cross_iteration_register_deps): Call it.
+ * ddg.h (autoinc_var_is_used_p): Declare.
+ * modulo-sched.c (generate_reg_moves): Call autoinc_var_is_used_p.
+ (sms_schedule): Handle instructions with REG_INC.
+
+2011-09-30 Revital Eres <revital.eres@linaro.org>
+
+ * modulo-sched.c (generate_reg_moves): Skip instructions that
+ do not set a register and verify no regmoves are created for
+ !single_set instructions.
+
+2011-09-30 Bernd Schmidt <bernds@codesourcery.com>
+
+ * hw-doloop.c (scan_loop): Compute register usage only for non-debug
+ insns.
+
+2011-09-30 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
+
+ PR target/50099
+ * config/arm/iterators.md (qhs_zextenddi_cstr): New.
+ (qhs_zextenddi_op): New.
+ * config/arm/arm.md ("zero_extend<mode>di2"): Use them.
+ * config/arm/predicates.md ("arm_extendqisi_mem_op"):
+ Distinguish between ARM and Thumb2 states.
+
+2011-09-30 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.opt (VIS2): New option.
+ * doc/invoke.texi: Document it.
+ * config/sparc/sparc.md (UNSPEC_EDGE8N, UNSPEC_EDGE8LN,
+ UNSPEC_EDGE16N, UNSPEC_EDGE16LN, UNSPEC_EDGE32N,
+ UNSPEC_EDGE32LN, UNSPEC_BSHUFFLE): New unspecs.
+ (define_attr type): New insn type 'edgen'.
+ (bmask<P:mode>_vis, bshuffle<V64I:mode>_vis, edge8n<P:mode>_vis,
+ edge8ln<P:mode>_vis, edge16n<P:mode>_vis, edge16ln<P:mode>_vis,
+ edge32n<P:mode>_vis, edge32ln<P:mode>_vis): New insn VIS 2.0
+ patterns.
+ * niagara.md: Handle edgen.
+ * niagara2.md: Likewise.
+ * ultra1_2.md: Likewise.
+ * ultra3.md: Likewise.
+ * config/sparc/sparc-c.c (sparc_target_macros): Define __VIS__
+ to 0x200 when TARGET_VIS2.
+ * config/sparc/sparc.c (sparc_option_override): Set MASK_VIS2 by
+ default when targetting capable cpus. TARGET_VIS2 implies
+ TARGET_VIS, clear and it when TARGET_FPU is disabled.
+ (sparc_vis_init_builtins): Emit new VIS 2.0 builtins.
+ (sparc_expand_builtin): Fix predicate indexing when builtin returns
+ void.
+ (sparc_fold_builtin): Do not eliminate bmask when result is ignored.
+ * config/sparc/visintrin.h (__vis_bmask, __vis_bshuffledi,
+ __vis_bshufflev2si, __vis_bshufflev4hi, __vis_bshufflev8qi,
+ __vis_edge8n, __vis_edge8ln, __vis_edge16n, __vis_edge16ln,
+ __vis_edge32n, __vis_edge32ln): New VIS 2.0 interfaces.
+ * doc/extend.texi: Document new VIS 2.0 builtins.
+
+2011-09-29 Nick Clifton <nickc@redhat.com>
+ Bernd Schmidt <bernds@codesourcery.com>
+
+ * config/frv/frvbegin.c: Fix location of unwind-dw2-fde.h header
+ file.
+ * config/frv/frvend.c: Likewise.
+ * config/frv/frv.c (frv_function_prologue): Move misplaced
+ CALL_ARG_LOCATION notes back to their proper locations.
+
+2011-09-29 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50566
+ * config/avr/avr-log.c (avr_log_vadump): Use %b to print bool.
+ * config/avr/avr.c (avr_rtx_costs_1): New static function, renamed
+ from avr_rtx_costs.
+ (avr_legitimate_address_p): Use avr_edump to print log information
+ filtered by avr_log.
+ (extra_constraint_Q): Ditto.
+ (avr_legitimize_address): Ditto.
+ (avr_rtx_costs): Ditto. Rewrite as wrapper for avr_rtx_costs_1.
+ (final_prescan_insn): Use avr_log.rtx_costs as filter.
+
+2011-09-29 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * config/arm/arm-protos.h (arm_modes_tieable_p): Declare.
+ * config/arm/arm.h (MODES_TIEABLE_P): Use it.
+ * config/arm/arm.c (arm_modes_tieable_p): New function. Allow
+ NEON vector and structure modes to be tied.
+
+2011-09-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * graphite-scop-detection.c (make_close_phi_nodes_unique): New
+ forward declaration.
+ (remove_duplicate_close_phi): Detect and repair creation of
+ duplicate close-phis for a containing loop.
+
+2011-09-27 Andi Kleen <ak@linux.intel.com>
+
+ * gcc.c (get_local_tick). Rename to get_random_number.
+ Read from /dev/urandom.
+ Add getpid call.
+ (compare_debug_dump_opt_spec_function): Drop getpid call.
+
+2011-09-26 Andi Kleen <ak@linux.intel.com>
+
+ * toplev.c (init_local_tick): Try reading random seed from /dev/urandom
+
+2011-09-26 Andi Kleen <ak@linux.intel.com>
+
+ * hwint.h (HOST_WIDE_INT_PRINT_HEX_PURE): Add.
+ * lto-streamer.c (lto_get_section_name): Remove crc32_string.
+ Handle numerical random seed.
+ * lto-streamer.h (lto_file_decl_data): Change id to unsigned HOST_WIDE_INT.
+ * toplev.c (random_seed): Add.
+ (init_random_seed): Change for numerical random seed.
+ (get_random_seed): Return as HOST_WIDE_INT.
+ (set_random_seed): Crc32 existing string.
+ * toplev.h (get_random_seed): Change to numercal return.
+ * tree.c (get_file_function_name): Remove CRC. Handle numerical random seed.
+
+2011-09-29 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50566
+ * config.gcc (extra_objs): Add avr-log.o for $target in:
+ avr-*-rtems*, avr-*-*.
+ * config/avr/t-avr (avr-log.o): New rule to compile...
+ * config/avr/avr-log.c: ...this new file.
+ * config/avr/avr.opt (mlog=): New option.
+ * config/avr/avr-protos.h (avr_edump, avr_fdump): New macros.
+ (avr_log_set_caller_e, avr_log_set_caller_f): New prototypes.
+ (avr_log_set_avr_log): New prototype.
+ (avr_log_t): New typedef.
+ (avr_log): New declaration.
+ * config/avr/avr.c (avr_option_override): Call avr_log_set_avr_log.
+
+2011-09-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>
+
+ * expr.c (do_store_flag): Expand vector comparison by
+ building an appropriate VEC_COND_EXPR.
+ * c-typeck.c (build_binary_op): Typecheck vector comparisons.
+ (c_objc_common_truthvalue_conversion): Adjust.
+ * tree-vect-generic.c (do_compare): Helper function.
+ (expand_vector_comparison): Check if hardware supports
+ vector comparison of the given type or expand vector
+ piecewise.
+ (expand_vector_operation): Treat comparison as binary
+ operation of vector type.
+ (expand_vector_operations_1): Adjust.
+
+2011-09-29 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (build_opaque_vector_type): Make opaque vectors
+ variant types of the corresponding non-opaque type. Make
+ sure to share opaque vector types properly.
+
+2011-09-29 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (UNSPEC_ARRAY8, UNSPEC_ARRAY16,
+ UNSPEC_ARRAY32): New unspec.
+ (define_attr type): New type 'array'.
+ (array{8,16,32}<P:mode>_vis): New patterns.
+ * config/sparc/ultra1_2.md: Add reservations for 'array'.
+ * config/sparc/ultra3.md: Likewise.
+ * config/sparc/niagara.md: Likewise.
+ * config/sparc/niagara2.md: Likewise.
+ * config/sparc/sparc.c (sparc_vis_init_builtins): Build new
+ array builtins.
+ * config/sparc/visintrin.h (__vis_array8, __vis_array16,
+ __vis_array32): New.
+ * doc/extend.texi: Document new VIS builtins.
+
+ * config/sparc/sparc.md (gcond_name): Delete unnecessary code attr.
+ (VIS pixel-compare insn): Just use <gcond:name>.
+
+ * config/sparc/sparc.md (VIS pixel-compare insn): There is only one
+ code iterator used, so just use <code>. There are two mode iterators
+ so explicitly use <GCM:gcm_name>.
+
+2011-09-29 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/darwin9.h (STACK_CHECK_STATIC_BUILTIN): Enable for
+ Darwin >= 9.
+
+2011-09-28 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (UNSPEC_FCMPLE, UNSPEC_FCMPNE,
+ UNSPEC_FCMPGT, UNSPEC_FCMPEQ): Delete and reduce to...
+ (UNSPEC_FCMP): New unspec.
+ (gcond): New code iterator.
+ (gcond_name): New code attr.
+ (GCM): New mode iterator.
+ (gcm_name): New mode attr.
+ (fcmp{le,ne,gt,eq}{16,32}_vis): Reimplement using iterators.
+
+2011-09-28 Oleg Endo <oleg.endo@t-online.de>
+
+ PR target/49486
+ * config/sh/sh.md (negdi2): Move expansion into split to
+ allow more combination options. Add T_REG clobber.
+ (abssi2): New expander.
+ (*negdi2, *abssi2, *negabssi2): New insns.
+ (cneg): Change from insn to insn_and_split. Rename to
+ negsi_cond. Add alternative for non-SH4.
+
+2011-09-28 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * config/arm/neon.md (neon_move_lo_quad_<mode>): Delete.
+ (neon_move_hi_quad_<mode>): Likewise.
+ (move_hi_quad_<mode>, move_lo_quad_<mode>): Use subreg moves.
+
+2011-09-28 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/predicates.md (rx_minmax_operand): New predicate.
+ Accepts immediates and a restricted subset of MEMs.
+ * config/rx/rx.md (int_modes): New iterator.
+ (smaxsi3, sminsi3): Delete and replace with...
+ (smax<int_mode>3, smin<int_mode>3): New patterns.
+ (umax<>3_u, umax<>3_ur, umax<>3, umin<>3): New patterns.
+
+2011-09-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/50460
+ * fold-const.c (try_move_mult_to_index): Handle &a.array the
+ same as &a.array[0].
+
+2011-09-28 Kai Tietz <ktietz@redhat.com>
+
+ * configure.ac: Add test for new section attribute
+ specifier "e" via define HAVE_GAS_SECTION_EXCLUDE.
+ * config.in: Regenerated.
+ * configure: Regenerated.
+ * config/i386/winnt.c (i386_pe_asm_named_section): Emit
+ new section flag "e" for excluded sections, if supported.
+ Otherwise we mark section withc SECTION_EXCLUDE flag as never-load.
+
+2011-09-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/m32r/m32r.md: Use match_test rather than eq/ne symbol_ref
+ throughout file.
+
+2011-09-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/iq2000/iq2000.md: Use match_test rather than eq/ne symbol_ref
+ throughout file.
+
+2011-09-27 Sriraman Tallam <tmsriram@google.com>
+
+ * output.h (SECTION_EXCLUDE): New macro.
+ * varasm.c (default_elf_asm_named_section): Check for SECTION_EXCLUDE.
+
+2011-09-27 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * fwprop.c (forward_propagate_and_simplify): After checking
+ reg/subreg combinations, check whether the modes are the same.
+
+2011-09-27 Bernd Schmidt <bernds@codesourcery.com>
+ Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips_add_cfa_restore): New function.
+ (mips16e_save_restore_reg): Use it.
+ (mips_restore_reg): Likewise. Split double FPRs for
+ REG_CFA_RESTORE notes.
+
+2011-09-27 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR middle-end/50386
+ PR middle-end/50326
+ * tree-sra.c (build_ref_for_model): Use the type of the field as
+ the type of the COMPONENT_REF.
+
+2011-09-27 Jeff Law <law@redhat.com>
+
+ * ifcvt.c (cheap_bb_rtx_cost_p): Add SCALE argument. Scale
+ non-jumping insns by REG_BR_PROB_BASE and the maximum cost by SCALE.
+ (find_if_case_1): Use the probability of the THEN clause when
+ determining if speculation is profitable.
+ (find_if_case_2): Similarly for the ELSE clause.
+
+2011-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ * common.opt: Add -foptimize-strlen option.
+ * Makefile.in (OBJS): Add tree-ssa-strlen.o.
+ (tree-sssa-strlen.o): Add dependencies.
+ * opts.c (default_options_table): Enable -foptimize-strlen
+ by default at -O2 if not -Os.
+ * passes.c (init_optimization_passes): Add pass_strlen
+ after pass_object_sizes.
+ * timevar.def (TV_TREE_STRLEN): New timevar.
+ * params.def (PARAM_MAX_TRACKED_STRLENS): New parameter.
+ * tree-pass.h (pass_strlen): Declare.
+ * tree-ssa-strlen.c: New file.
+ * c-decl.c (merge_decls): If compatible stpcpy prototype
+ is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
+
+2011-09-27 Tom de Vries <tom@codesourcery.com>
+
+ PR middle-end/43864
+ * tree-ssa-tail-merge.c: New file.
+ (struct same_succ_def): Define.
+ (same_succ, const_same_succ): New typedef.
+ (struct bb_cluster_def): Define.
+ (bb_cluster, const_bb_cluster): New typedef.
+ (struct aux_bb_info): Define.
+ (BB_SIZE, BB_SAME_SUCC, BB_CLUSTER, BB_VOP_AT_EXIT): Define.
+ (gvn_uses_equal): New function.
+ (same_succ_print, same_succ_print_traverse, update_dep_bb)
+ (stmt_update_dep_bb, local_def, same_succ_hash)
+ (inverse_flags, same_succ_equal, same_succ_alloc, same_succ_delete)
+ (same_succ_reset): New function.
+ (same_succ_htab, same_succ_edge_flags)
+ (deleted_bbs, deleted_bb_preds): New var.
+ (debug_same_succ): New function.
+ (worklist): New var.
+ (print_worklist, add_to_worklist, find_same_succ_bb, find_same_succ)
+ (init_worklist, delete_worklist, delete_basic_block_same_succ)
+ (same_succ_flush_bbs, purge_bbs, update_worklist): New function.
+ (print_cluster, debug_cluster, update_rep_bb)
+ (add_bb_to_cluster, new_cluster, delete_cluster): New function.
+ (all_clusters): New var.
+ (alloc_cluster_vectors, reset_cluster_vectors, delete_cluster_vectors)
+ (merge_clusters, set_cluster): New function.
+ (gimple_equal_p, gsi_advance_bw_nondebug_nonlocal, find_duplicate)
+ (same_phi_alternatives_1, same_phi_alternatives, bb_has_non_vop_phi)
+ (deps_ok_for_redirect_from_bb_to_bb, deps_ok_for_redirect)
+ (find_clusters_1, find_clusters): New function.
+ (update_vuses, vop_phi, vop_at_entry, replace_block_by): New function.
+ (update_bbs): New var.
+ (apply_clusters): New function.
+ (update_debug_stmt, update_debug_stmts): New function.
+ (tail_merge_optimize): New function.
+ tree-pass.h (tail_merge_optimize): Declare.
+ * tree-ssa-pre.c (execute_pre): Use tail_merge_optimize.
+ * Makefile.in (OBJS-common): Add tree-ssa-tail-merge.o.
+ (tree-ssa-tail-merge.o): New rule.
+ * opts.c (default_options_table): Set OPT_ftree_tail_merge by
+ default at OPT_LEVELS_2_PLUS.
+ * tree-ssa-sccvn.c (vn_valueize): Move to ...
+ * tree-ssa-sccvn.h (vn_valueize): Here.
+ * timevar.def (TV_TREE_TAIL_MERGE): New timevar.
+ * common.opt (ftree-tail-merge): New switch.
+ * params.def (PARAM_MAX_TAIL_MERGE_COMPARISONS)
+ (PARAM_MAX_TAIL_MERGE_ITERATIONS): New parameter.
+ * doc/invoke.texi (Optimization Options, -O2): Add -ftree-tail-merge.
+ (-ftree-tail-merge, max-tail-merge-comparisons)
+ (max-tail-merge-iterations): New item.
+
+2011-09-27 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (MAX_TIME): Reduce to avoid overflows.
+
+2011-09-27 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle
+ parameters passed by reference; handle loads from non-SSA scalars
+ and update comments.
+
+2011-09-27 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR rtl-optimization/50249
+ * reload1.c (reload_reg_reaches_end_p): Accept a reloadnum argument
+ instead of opnum and type. All callers changed. Remove useless
+ declaration.
+ Search forward for other reloads of the same type for the same operand
+ using the same register; if any are found, return false.
+ (reload_regs_reach_end_p): Same argument changes; all callers changed.
+
+2011-09-27 Andi Kleen <ak@linux.intel.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * doc/invoke.texi (ffat-lto-objects): Document.
+ * toplev.c (compile_file): Do not output assembly when doing slim lto;
+ Output __gnu_slim_lto when doing slim lto.
+ * cgraphunit.c (ipa_passes): Do only analysis when producing slim lto.
+ (cgraph_optimize): Return early when doing slim lto.
+ * opts.c (finish_options): Complain about lack of linker plugin
+ when doing slim lto.
+ * common.opt (ffat-lto-objects): New.
+
+2011-09-27 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * ipa-inline-analysis.c (predicate_probability): Avoid comparison
+ between signed and unsigned.
+
+2011-09-27 Ira Rosen <ira.rosen@linaro.org>
+
+ * tree-vect-stmts.c (vectorizable_type_demotion): Handle basic block
+ vectorization.
+ (vectorizable_type_promotion): Likewise.
+ (vect_analyze_stmt): Call vectorizable_type_demotion and
+ vectorizable_type_promotion for basic blocks.
+ (supportable_widening_operation): Don't assume loop vectorization.
+ * tree-vect-slp.c (vect_build_slp_tree): Allow multiple types for
+ basic blocks. Update vectorization factor for basic block
+ vectorization.
+ (vect_analyze_slp_instance): Allow multiple types for basic block
+ vectorization. Recheck unrolling factor after construction of SLP
+ instance.
+
+2011-09-27 Richard Guenther <rguenther@suse.de>
+
+ * tree-object-size.c (compute_object_sizes): Fix dumping of
+ folded statement.
+
+2011-09-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50363
+ * tree-ssa-pre.c (create_expression_by_pieces): Handle
+ pointer conversions in POINTER_PLUS_EXPRs properly.
+
+2011-09-27 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * config/arm/neon.md (neon_vget_highv16qi, neon_vget_highv8hi)
+ (neon_vget_highv4si, neon_vget_highv4sf, neon_vget_highv2di)
+ (neon_vget_lowv16qi, neon_vget_lowv8hi, neon_vget_lowv4si)
+ (neon_vget_lowv4sf, neon_vget_lowv2di): Turn into define_expands
+ that produce subreg moves. Define using VQX iterators.
+
+2011-09-27 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.md (ashrqi3): Split alternative "n"
+ into its remaining parts C03, C04, C05, C06, C07 and describe
+ impact in CC by attribute "cc" appropriately.
+ * config/avr/avr.c (notice_update_cc): Clean-up: Don't patch CC0
+ by digging RTX.
+
+2011-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ * rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
+ from 3 x MAX_MACHINE_MODE.
+ (CONSTM1_RTX): Define.
+ * emit-rtl.c (const_tiny_rtx): Change into array of
+ 4 x MAX_MACHINE_MODE from 3 x MAX_MACHINE_MODE.
+ (gen_rtx_CONST_VECTOR): Use CONSTM1_RTX if all inner constants are
+ CONSTM1_RTX.
+ (init_emit_once): Initialize CONSTM1_RTX for MODE_INT and
+ MODE_VECTOR_INT modes.
+ * simplify-rtx.c (simplify_binary_operation_1) <case IOR, XOR, AND>:
+ Optimize if one operand is CONSTM1_RTX.
+ * config/i386/i386.c (ix86_expand_sse_movcc): Optimize mask ? -1 : x
+ into mask | x.
+
+2011-09-26 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (edge{8,16,32}{,l}): Return Pmode.
+ (fcmp{le,ne,gt,eq}{16,32}): Likewise.
+ * config/sparc/visintrin.h: Update edge and pixel-compare
+ intrinsics to return 'long' instead of 'int'.
+ * doc/extend.texi: Update documentation to match.
+ * config/sparc/sparc.c (eligible_for_return_delay): When leaf or
+ flat, allow any instruction. Otherwise, when V9 allow parallels
+ which consist only of sets to registers outside of %o0 to %o5.
+ (sparc_vis_init_builtins): Update VIS builtin types for edge
+ and pixel-compare.
+
+ * config/sparc/sparc.c (sparc_conditional_register_usage): When VIS
+ is enabled, mark %gsr as global.
+ * config/sparc/sparc.md (UNSPEC_WRGSR): Delete.
+ (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus): Don't wrap in an unspec.
+
+ * config/sparc/sparc-c.c: New file implementing sparc_target_macros,
+ which will now define __VIS and __VIS__ when -mvis is enabled.
+ * config/sparc/t-sparc: Likewise.
+ * config.gcc: Add sparc-c.o to c_target_objs and cxx_target_objs,
+ and add t-sparc to tmake_file for all sparc targets.
+ * config/sparc/sparc-protos.h (sparc_target_macros): Declare.
+ * config/sparc/sparc.h (TARGE_CPU_CPP_BUILTINS): Call it.
+
+ * config/sparc/sparc.c (sparc_vis_init_builtins): Add explicit
+ builtins for VIS vector addition and subtraction.
+ * config/sparc/visintrin.h (__vis_fpadd16, __vis_fpadd16s,
+ __vis_fpadd32, __vis_fpadd32s, __vis_fpsub16, __vis_fpsub16s,
+ __vis_fpsub32, __vis_fpsub32s): New.
+ * doc/extend.texi: Document new VIS intrinsics.
+
+2011-09-26 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.md (peephole casesi+2): Use -1 instead of 65536.
+ * config/avr/avr.c (avr_out_compare): Print shorter sequence for
+ EQ/NE comparisons against +/-1 in the case of unused-after,
+ non-ld-regs target.
+
+2011-09-26 Jakub Jelinek <jakub@redhat.com>
+
+ * gimple-fold.c (gimplify_and_update_call_from_tree): Set
+ gctx.into_ssa after push_gimplify_context.
+
+ * gimple.c (gimple_build_call_valist): New function.
+ * gimple.h (gimple_build_call_valist): New prototype.
+ * tree-ssa-propagate.c (finish_update_gimple_call): New function.
+ (update_gimple_call): Likewise.
+ (update_call_from_tree): Use finish_update_gimple_call.
+ * tree-ssa-propagate.h (update_gimple_call): New prototype.
+
+2011-09-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50472
+ * gimple-fold.c (fold_const_aggregate_ref_1): Do not fold
+ volatile references.
+
+2011-09-26 Bingfeng Mei <bmei@broadcom.com>
+
+ * doc/tm.texi: Correct documentation for TARGET_ADDR_SPACE_SUBSET_P.
+ * target.def: (addr_space_subset_p): Likewise.
+
+2011-09-26 Tom de Vries <tom@codesourcery.com>
+
+ * tree-ssa-alias.h (pt_solution_singleton_p): Declare.
+ * tree-ssa-structalias.c (pt_solution_singleton_p): New function.
+ * tree-ssa-ccp.c (fold_builtin_alloca_for_var): Set points-to solution
+ of new var.
+
+2011-09-26 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50465
+ * config/avr/avr-protos.h (output_reload_insisf): Don't pass insn.
+ * config/avr/avr.md (*reload_insi, *reload_insf): Change call to
+ output_reload_insisf.
+ (adjust_len): Set default to "no".
+ Remove alternative "yes". Add alternatives: "mov8", "mov16",
+ "mov32", "ashlqi", "ashrqi", "lshrqi", "ashlhi", "ashrhi",
+ "lshrhi", "ashlsi, "ashrsi", "lshrsi".
+ (*movqi, *movhi, *movsi, *ashlqi3, ashlhi3, ashlsi3,
+ *ashlhi3_const, *ashlsi3_const, ashrqi3, ashrhi3, ashrsi3,
+ *ashrhi3_const, *ashrsi3_const, *lshrqi3, lshrhi3, *lshrhi3_const,
+ *lshrsi3_const): Set attribute "adjust_len".
+ * config/avr/avr.c (output_reload_insisf): Remove parameter "insn".
+ (output_movsisf): Don't pass insn to output_reload_insisf.
+ (adjust_insn_length): Handle new alternatives to adjust_len.
+ Remove handling of ADJUST_LEN_YES. Clean-up code.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ifcvt.c (noce_try_cmove_arith): Use may_trap_or_fault_p in lieu of
+ may_trap_p to detect loads that may trap of fault.
+
+2011-09-26 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr-protos.h (output_reload_inhi): Change prototype.
+ * config/avr/avr.md (adjust_len): Add "reload_in16" alternative.
+ (*reload_inhi): Use it. Adapt call to output_reload_inhi to new
+ prototype.
+ (*movhi): Split constraint alternative "r,rL" into "r,r" and "r,L".
+ * config/avr/avr.c: Rename output_reload_insisf_1 to
+ output_reload_in_const.
+ (avr_popcount_each_byte): Handle SFmode, too.
+ (output_reload_in_const): Change so it can handle HI loads, too.
+ Use avr_popcount_each_byte to work out if scratch register must be
+ created on the fly.
+ (output_reload_inhi): Rewrite using output_reload_in_const and...
+ (output_movhi): ...use it to print constants' loads.
+ (adjust_insn_length): New case ADJUST_LEN_RELOAD_IN16. Cleanup code.
+
+2011-09-25 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/constraints.md (C, P, Z): New constraints for
+ const_doube, const_int, and const_vector "all ones" values.
+ Make unused constraint letters comment match reality.
+ * config/sparc/predicates.md (const_all_ones_operand,
+ register_or_zero_or_all_ones_operand): New predicates.
+ * config/sparc/sparc.c (sparc_expand_move): Allow all ones
+ as well as zero constants when VIS.
+ (sparc_legitimate_constant_p): Likewise.
+ * config/sparc/sparc.md (movsi_insn): Add fones alternative.
+ (movsf_insn): Likewise
+ (movdi_insn_sp64): Add fone alternative.
+ (movdf_insn_sp32_v9): Likewise.
+ (movdf_insn_sp64): Likewise.
+
+ * configure.ac: Add feature check to make sure the assembler
+ supports the FMAF, HPC, and VIS 3.0 instructions found on
+ Niagara-3 and later cpus.
+ * configure: Rebuild.
+ * config.in: Likewise.
+ * config/sparc/sparc.opt: New option '-mfmaf'.
+ * config/sparc/sparc.md: Add float fused multiply-add patterns.
+ * config/sparc/sparc.h (AS_NIAGARA3_FLAG): New macro.
+ (ASM_CPU64_DEFAULT_SPEC, ASM_CPU_SPEC): Use it, as needed.
+ * config/sparc/sol2.h (ASM_CPU32_DEFAULT_SPEC,
+ ASM_CPU64_DEFAULT_SPEC, ASM_CPU_SPEC): Likewise.
+ * config/sparc/sparc.c (sparc_option_override): Turn MASK_FMAF on
+ by default for Niagara-3 and later. Turn it off if TARGET_FPU is
+ disabled.
+ (sparc_rtx_costs): Handle 'FMA'.
+ * doc/invoke.texi: Document -mfmaf.
+
+2011-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-ssa-structalias.c (intra_create_variable_infos): Treat
+ TYPE_RESTRICT REFERENCE_TYPE parameters like restricted
+ DECL_BY_REFERENCE parameters.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-eh.c (cleanup_empty_eh): Allow a call to __builtin_stack_restore
+ if there is no outgoing edge.
+
+ * tree-scalar-evolution.c (simple_iv): Accept all kinds of pointer and
+ integral types.
+
+2011-09-25 Ira Rosen <ira.rosen@linaro.org>
+
+ * tree-vect-slp.c (vect_slp_analyze_bb_1): Split out core part
+ of vect_analyze_bb here.
+ (vect_analyze_bb): Loop over vector sizes calling vect_analyze_bb_1.
+
+2011-09-25 Ira Rosen <ira.rosen@linaro.org>
+
+ * tree-data-ref.c (dr_analyze_innermost): Add new argument.
+ Allow not simple iv if analyzing basic block.
+ (create_data_ref): Update call to dr_analyze_innermost.
+ (stmt_with_adjacent_zero_store_dr_p, ref_base_address): Likewise.
+ * tree-loop-distribution.c (generate_memset_zero): Likewise.
+ * tree-predcom.c (find_looparound_phi): Likewise.
+ * tree-data-ref.h (dr_analyze_innermost): Add new argument.
+
+2011-09-24 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.h (FIRST_PSEUDO_REGISTER): Bump to 103.
+ (SPARC_GSR_REG): Define.
+ (FIXED_REGISTERS): Mark GSR as fixed.
+ (CALL_USED_REGISTERS): Mark GSR as call used.
+ (HARD_REGNO_NREGS): GSR is always 1 register.
+ (REG_CLASS_CONTENTS): Add GSR to ALL_REGS.
+ (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): Add GSR to the end.
+ (REGISTER_NAMES): Add "%gsr".
+ * config/sparc/sparc.md (UNSPEC_ALIGNADDR, UNSPEC_ALIGNADDRL): Delete.
+ (UNSPEC_WRGSR): New unspec.
+ (GSR_REG): New constant.
+ (type): Add new insn type 'gsr'.
+ (fpack16_vis, fpackfix_vis, fpack32_vis,
+ faligndata<V64I:MODE>_vis)): Add use of GSR_REG.
+ (wrgsr_vis, *wrgsr_sp64, wrgsr_v8plus, rdgsr_vis, *rdgsr_sp64,
+ rdgsr_v8plus): New expanders and insns.
+ (alignaddr<P:mode>_vis, alignaddrl<P:mode>_vis): Reimplement
+ using patterns which show that this is a plus in addition to a
+ modification of GSR_REG, instead of an unspec.
+ * config/sparc/ultra1_2.md: Handle 'gsr'.
+ * config/sparc/ultra3.md: Likewise.
+ * config/sparc/niagara.md: Likewise.
+ * config/sparc/niagara2.md: Likewise.
+ * config/sparc/sparc.c (leaf_reg_remap, sparc_leaf_regs): Fill out
+ end of table.
+ (sparc_option_override): Make -mvis imply -mv8plus.
+ (hard_32bit_mode_classes, hard_64bit_mode_classes): Add entries
+ for %gsr.
+ (sparc_vis_init_builtins): Build __builtin_vis_write_gsr and
+ __builtin_vis_read_gsr.
+ (sparc_expand_buildin): Handle builtins that take one argument and
+ return void.
+ (sparc_fold_builtin): Never fold writes to %gsr.
+ * config/sparc/visintrin.h (__vis_write_gsr, __vis_read_gsr): New.
+ * doc/extend.texi: Document new VIS intrinsics.
+
+2011-09-23 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-transform.c (inline_call): Add comment.
+ * ipa-inline.h (inline_param_summary): New structure and vector.
+ (struct inline_edge_summary): Add param field.
+ * ipa-inline-analysis.c (CHANGED): New constant.
+ (add_clause): Handle CHANGED and NOT_CONSTANT.
+ (predicate_probability): New function.
+ (dump_condition): Dump CHANGED predicate.
+ (evaluate_conditions_for_known_args): Handle ERROR_MARK as marker
+ of unknown function wide invariant.
+ (evaluate_conditions_for_edge): Handle change probabilities.
+ (inline_edge_duplication_hook): Copy param summaries.
+ (inline_edge_removal_hook): Free param summaries.
+ (dump_inline_edge_summary): Fix dumping of indirect edges and callee
+ sizes; dump param summaries.
+ (will_be_nonconstant_predicate): Use CHANGED predicate.
+ (record_modified_bb_info): New structure.
+ (record_modified): New function.
+ (param_change_prob): New function.
+ (estimate_function_body_sizes): Compute param summaries.
+ (estimate_edge_size_and_time): Add probability argument.
+ (estimate_node_size_and_time): Add inline_param_summary argument;
+ handle predicate probabilities.
+ (remap_predicate): Fix formating.
+ (remap_edge_change_prob): New function.
+ (remap_edge_summaries): Rename from ...; use remap_edge_change_prob.
+ (remap_edge_predicates): ... this one.
+ (inline_merge_summary): Remap edge summaries; handle predicate
+ probabilities; remove param summaries after we are done.
+ (do_estimate_edge_time): Update.
+ (do_estimate_edge_growth): Update.
+ (read_inline_edge_summary): Read param info.
+ (inline_read_summary): Fix formating.
+ (write_inline_edge_summary): Write param summaries.
+
+2011-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_print_operand): Handle %~.
+ (ix86_print_operand_punct_valid_p): Return true also for '~'.
+ * config/i386/sse.md (i128): New mode_attr.
+ (vec_extract_hi_<mode>, vec_extract_hi_<mode>,
+ avx_vbroadcastf128_<mode>, *avx_vperm2f128<mode>_full,
+ *avx_vperm2f128<mode>_nozero, vec_set_lo_<mode>,
+ vec_set_hi_<mode>, *vec_concat<mode>_avx): Use <i128> in the
+ patterns, use "<sseinsnmode>" for "mode" attribute.
+ (vec_extract_hi_v16hi, vec_extract_hi_v32qi, vec_set_lo_v16hi,
+ vec_set_hi_v16hi, vec_set_lo_v32qi, vec_set_hi_v32qi): Use
+ %~128 in the patterns, use "OI" for "mode" attribute.
+
+2011-09-23 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50447
+ * config/avr/avr.md (adjust_len): Add alternatives "tsthi",
+ "tstsi", "compare".
+ (*cmpqi_sign_extend): Use s8_operand.
+ (*cmphi, *cmpsi): Rewrite using avr_out_compare.
+ * config/avr/avr-protos.h (compare_diff_p, compare_eq_p): Remove
+ prototypes.
+ (out_tsthi, out_tstsi): Remove prototypes.
+ (avr_out_tsthi, avr_out_tstsi): New prototypes.
+ * config/avr/avr.c (out_tsthi, out_tstsi): Remove functions.
+ (avr_asm_len): Negative length now sets *plen to -length.
+ (compare_sign_p): Return bool instead of int.
+ (compare_diff_p, compare_eq_p): Ditto and make static.
+ (avr_out_tsthi): New function.
+ (avr_out_tstsi): New function.
+ (avr_out_compare): New function.
+ (adjust_insn_length): Handle ADJUST_LEN_TSTHI, ADJUST_LEN_TSTSI,
+ ADJUST_LEN_COMPARE.
+
+2011-09-23 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50447
+ * config/avr/avr.md: (adjust_len): Add alternative "out_plus".
+ (addsi3): Rewrite using QI scratch register. Adjust text
+ peepholes using plus:SI.
+ (*addsi3_zero_extend.hi): New insn.
+ (*subsi3_zero_extend.hi): New insn.
+ (*subhi3_zero_extend1): Set attribute "cc" to "set_czn".
+ (*subsi3_zero_extend): Ditto.
+ (subsi3): Change predicate #2 to register_operand.
+ * config/avr/avr-protos.h (avr_out_plus): New prototype.
+ (avr_out_plus_1): New static function.
+ (avr_out_plus): New function.
+ (adjust_insn_length): Handle ADJUST_LEN_OUT_PLUS.
+
+2011-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): For
+ GE/GT/UNLE/UNLT swap arguments and condition even for TARGET_AVX.
+
+2011-09-23 Ian Lance Taylor <iant@google.com>
+
+ * godump.c (go_define): Treat a single character in single quotes,
+ or a string, as an operand.
+
+2011-09-23 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.h (jump_func_type): Updated comments.
+ (ipa_known_type_data): New type.
+ (ipa_jump_func): Use it to describe known type jump functions.
+ * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Updated to
+ reflect the new known type jump function contents.
+ (compute_known_type_jump_func): Likewise.
+ (combine_known_type_and_ancestor_jfs): Likewise.
+ (try_make_edge_direct_virtual_call): Likewise.
+ (ipa_write_jump_function): Likewise.
+ (ipa_read_jump_function): Likewise.
+ * ipa-cp.c (ipa_value_from_known_type_jfunc): New function.
+ (ipa_value_from_jfunc): Use ipa_value_from_known_type_jfunc.
+ (propagate_accross_jump_function): Likewise.
+
+2011-09-23 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50446
+ * config/avr/avr.md (rotlqi3): Support all offsets 0..7.
+ (rotlqi3_4): Turn insn into expander.
+ (*rotlqi3): New insn.
+ (rotlhi3, rotlsi3): Support rotate left/right by 1.
+ (*rotlhi2.1, *rotlhi2.15): New insns.
+ (*rotlsi2.1, *rotlsi2.31): New insns.
+ * config/avr/constraints.md (C03, C05, C06, C07): New constraints.
+
+2011-09-23 Bin Cheng <bin.cheng@arm.com>
+
+ * config/arm/bpabi.h (BE8_LINK_SPEC): Add cortex-m arch and processors.
+
+2011-09-22 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * ipa-prop.c (ipa_print_node_jump_functions): Fix typos.
+
+2011-09-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * reload.c (find_reloads): Set operand_mode to Pmode for address
+ operands consisting of just a CONST_INT.
+
+2011-09-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/50482
+ * config/i386/i386.c (ix86_expand_sse_movcc): When generating
+ blendv, force op_true to register if it doesn't satisfy
+ nonimmediate_operand predicate.
+
+2011-09-22 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR middle-end/50113
+ PR middle-end/50061
+ * calls.c (emit_library_call_value_1): Use BLOCK_REG_PADDING to
+ get the locate.where_pad value for register-only arguments.
+ * config/arm/arm.c (arm_pad_arg_upward): Remove HFmode handling.
+ (arm_pad_reg_upward): Handle null types.
+
+2011-09-22 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c: Fix overly long lines.
+
+2011-09-22 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-transform.c (inline_call): Always update jump functions
+ after inlining.
+ * ipa-inline.c (ipa_inline): Likewise; do not call
+ ipa_create_all_structures_for_iinln.
+ (ipa_inline): Always free jump functions.
+ * ipa-inline-analysis.c (evaluate_conditions_for_edge): Remove hack.
+ (remap_edge_predicates): Fix pasto.
+ (inline_merge_summary): Remove nlined edge predicate; remove hack.
+ (inline_analyze_function): Always initialize jump functions.
+ (inline_generate_summary): Likewise.
+ (inline_write_summary): Always write jump functions when ipa-cp
+ is not doing that.
+ (inline_read_summary): Always read jump functions when ipa-cp
+ is not doing that.
+ * ipa-prop.c (iinlining_processed_edges): Remove.
+ (update_indirect_edges_after_inlining): Do not use
+ iinlining_processed_edges; instead set param_index to -1.
+ (propagate_info_to_inlined_callees): Only try to indirect inlining
+ when asked to do so; update jump functions of indirect calls, too;
+ remove jump functions of the inlined edge.
+ (ipa_edge_duplication_hook): Do not copy iinlining_processed_edges.
+ (ipa_create_all_structures_for_iinln): Remove.
+ (ipa_free_all_structures_after_iinln): Do not free
+ iinlining_processed_edges.
+ * ipa-prop.h (ipa_create_all_structures_for_iinln): Remove.
+
+2011-09-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * config/arm/predicates.md (expandable_comparison_operator): New
+ predicate, extracted from...
+ (arm_comparison_operator): ...here.
+ * config/arm/arm.md (cbranchsi4, cbranchsf4, cbranchdf4, cbranchdi4)
+ (cstoresi4, cstoresf4, cstoredf4, cstoredi4, movsicc, movsfcc)
+ (movdfcc): Use expandable_comparison_operator.
+
+2011-09-22 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50447
+ PR target/50465
+ * config/avr/avr-protos.h (avr_out_bitop): New prototype.
+ (avr_popcount_each_byte): New prototype.
+ * config/avr/avr.c (avr_popcount): New static function.
+ (avr_popcount_each_byte): New function.
+ (avr_out_bitop): New function.
+ (adjust_insn_length): ADJUST_LEN_OUT_BITOP dispatches to
+ avr_out_bitop. Cleanup code.
+ * config/avr/constraints.md (Ca2, Co2, Cx2): New constraints.
+ (Ca4, Co4, Cx4): New constraints.
+ * config/avr/avr.md (adjust_len): Add "out_bitop" insn attribute
+ alternative.
+ (andhi3, iorhi3, xorhi3): Rewrite insns using avr_out_bitop.
+ (andsi3, iorsi3, xorsi3): Ditto.
+ (*iorhi3_clobber, *iorsi3_clobber): Remove insns.
+
+2011-09-22 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/50451
+ * tree-vect-slp.c (vect_get_constant_vectors): Don't fail for
+ constant operands in reduction.
+ (vect_get_slp_defs): Don't create vector operand for NULL scalar
+ operand.
+
+2011-09-22 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.c (sparc_vis_init_builtins): Do not mark
+ fpack16, fpack32, fpackfix as const.
+
+ * config/sparc/sparc.md (G[0-7]_REG, O[0-7]_REG, L[0-7]_REG,
+ I[0-7]_REG, F[0-62]_REG, FCC[0-3]_REG, CC_REG, SFP_REG): New
+ constants. Use them everywhere.
+
+2011-09-22 Oleg Endo <oleg.endo@t-online.de>
+
+ * config/sh/sh.c (andcosts): Renamed to and_xor_ior_costs.
+ Added AND special case. Adapted comments.
+ (sh_rtx_costs): Added XOR and IOR case.
+
+2011-09-21 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analsis.c (compute_inline_parameters): Set
+ cfun and current_function_decl.
+
+2011-09-21 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (set_cond_stmt_execution_predicate): Allow
+ handled components in parameter of builtin_constant_p.
+ (will_be_nonconstant_predicate): Allow loads of non-SSA parameters.
+
+2011-09-21 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (relative_time_benefit): Fix wrong bracketting.
+ * ipa-inline.h (estimate_edge_time): Fix pasto.
+ * ipa-inline-analysis.c (do_estiamte_edge_time): Remove capping.
+
+2011-09-21 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_sse_movcc): Use
+ blendvps, blendvpd and pblendvb if possible.
+
+2011-09-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/50464
+ * config/i386/sse.md (xop_pcmov_<mode><avxsizesuffix>): Change
+ operand 1 predicate to register_operand and operand 2 predicate
+ to nonimmediate_operand.
+ * config/i386/i386.c (ix86_expand_sse_movcc): When generating
+ xop_pcmov, force op_true to register. Also, force op_false to
+ register if it doesn't satisfy nonimmediate_operand predicate.
+
+2011-09-21 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * config/i386/bmi2intrin.h (_mulx_u64): New.
+ (_mulx_u32): Ditto.
+
+2011-09-21 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/50433
+ * ipa-inline-analysis.c (eliminated_by_inlining_prob):
+ Use get_base_address.
+
+2011-09-21 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/sse.md (<code><mode>3 smaxmin:VI124_128 expander): Use
+ nonimmediate_operand instead of register_operand predicate for operands
+ 1 and 2, force them into registers if expanding them as comparison.
+ (<code><mode>3 umaxmin:VI124_128 expander): Similarly. For UMAX
+ V8HImode force into register just operand 1.
+
+2011-09-21 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/45099
+ * config/avr/avr.c (avr_function_arg_advance): Change error to
+ warning if a fixed register is needed as function argument.
+
+2011-09-21 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50449
+ PR target/50465
+ * config/avr/avr.md (adjust_len): New insn attribute.
+ (*reload_insi, *reload_insf): Use it.
+ (*movsi, *movsf): Use new interface of output_movsisf.
+ * config/avr/avr-protos.h (output_movsisf): Change prototype.
+ * config/avr/avr.c (output_movsisf): Ditto.
+ (adjust_insn_length): Use insn attribute "adjust_len" to adjust
+ lengths of insns *reload_insi, *reload_insf.
+ (output_reload_insisf_1): New static function.
+ (output_reload_insisf): Use it.
+
+2011-09-21 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.c (def_builtin): Change from macro into function.
+ (def_builtin_const): New.
+ (sparc_vis_init_builtins): Use def_builtin_const for all VIS builtins
+ other than alignaddr and falignaddr.
+
+ * config/sparc/sparc.md (UNSPEC_FCMPLE, UNSPEC_FCMPNE, UNSPEC_FCMPGT,
+ UNSPEC_FCMPEQ): New unspec codes.
+ (fcmple16_vis, fcmple32_vis, fcmpne16_vis, fcmpne32_vis, fcmpgt16_vis,
+ fcmpgt32_vis, fcmpeq16_vis, fcmpeq32_vis): New patterns.
+ * config/sparc/sparc.c (sparc_vis_init_builtins): Create builtins for
+ new pixel compare VIS patterns.
+ * config/sparc/visintrin.h (__vis_fcmple16, __vis_fcmple32,
+ __vis_fcmpne16, __vis_fcmpne32, __vis_fcmpgt16, __vis_fcmpgt32,
+ __vis_fcmpeq16, __vis_fcmpeq32): New.
+ * doc/extend.texi: Document new pixel compare VIS intrinsics.
+
+2011-09-21 Tom de Vries <tom@codesourcery.com>
+
+ * final.c (final): Handle if JUMP_LABEL is not LABEL_P.
+
+2011-09-20 David S. Miller <davem@davemloft.net>
+
+ * config/sparc/sparc.md (UNSPEC_ALIGNADDRL): New unspec.
+ (aligneddrl<P:mode>_vis): New pattern.
+ (edge8_vis, edge8l_vis, edge16_vis, edge16l_vis, edge32_vis,
+ edge32l_vis): Adjust to take Pmode arguments, and return SImode.
+ * config/sparc/sparc.c (sparc_vis_init_builtins): Handle new
+ alignaddrl insn, and adjust edge operations for updated types.
+ * config/sparc/visintrin.h: Likewise.
+ * doc/extend.texi: Make typing in VIS documentation match reality.
+
2011-09-20 Terry Guo <terry.guo@arm.com>
* config/arm/arm-arches.def: Add armv6s-m.
diff --git a/gcc/ChangeLog.google-integration b/gcc/ChangeLog.google-integration
index 76303a10899..0407ab6f575 100644
--- a/gcc/ChangeLog.google-integration
+++ b/gcc/ChangeLog.google-integration
@@ -1,3 +1,7 @@
+2011-10-03 Diego Novillo <dnovillo@google.com>
+
+ Mainline merge rev 179430.
+
2011-09-21 Diego Novillo <dnovillo@google.com>
Mainline merge rev 178998.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 1bff9f14fda..f17a6f27735 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20110920
+20111002
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 4803666dfd4..ab657262a91 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1475,7 +1475,9 @@ OBJS = \
tree-ssa-reassoc.o \
tree-ssa-sccvn.o \
tree-ssa-sink.o \
+ tree-ssa-strlen.o \
tree-ssa-structalias.o \
+ tree-ssa-tail-merge.o \
tree-ssa-ter.o \
tree-ssa-threadedge.o \
tree-ssa-threadupdate.o \
@@ -2383,6 +2385,13 @@ stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) output.h $(RTL_H) \
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
$(DIAGNOSTIC_CORE_H) $(CGRAPH_H) $(TREE_INLINE_H) $(TREE_DUMP_H) $(GIMPLE_H)
+tree-ssa-tail-merge.o: tree-ssa-tail-merge.c \
+ $(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(BITMAP_H) \
+ $(FLAGS_H) $(TM_P_H) $(BASIC_BLOCK_H) output.h \
+ $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) \
+ $(GIMPLE_H) $(FUNCTION_H) \
+ $(TIMEVAR_H) tree-ssa-sccvn.h \
+ $(CGRAPH_H) gimple-pretty-print.h tree-pretty-print.h $(PARAMS_H)
tree-ssa-structalias.o: tree-ssa-structalias.c \
$(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(GGC_H) $(OBSTACK_H) $(BITMAP_H) \
$(FLAGS_H) $(TM_P_H) $(BASIC_BLOCK_H) output.h \
@@ -2642,7 +2651,7 @@ tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(FLAGS_H) \
tree-iterator.h $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_INLINE_H) \
$(VEC_H) langhooks.h alloc-pool.h pointer-set.h $(CFGLOOP_H) \
- tree-pretty-print.h gimple-pretty-print.h
+ tree-pretty-print.h gimple-pretty-print.h $(DIAGNOSTIC_CORE_H)
tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(GGC_H) output.h \
$(DIAGNOSTIC_H) $(BASIC_BLOCK_H) $(FLAGS_H) $(TIMEVAR_H) $(TM_H) \
@@ -3161,6 +3170,9 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) $(TREE_PASS_H) langhooks.h $(PARAMS_H) \
tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(DIAGNOSTIC_CORE_H) \
$(DBGCNT_H) tree-pretty-print.h gimple-pretty-print.h gimple-fold.h
+tree-ssa-strlen.o : tree-ssa-strlen.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TREE_FLOW_H) $(TREE_PASS_H) domwalk.h alloc-pool.h tree-ssa-propagate.h \
+ gimple-pretty-print.h $(PARAMS_H)
tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \
$(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) \
$(IPA_PROP_H) $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1d0a10cf32e..a7be9a2af55 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,321 @@
+2011-09-30 Iain Sandoe <iains@gcc.gnu.org>
+
+ * gcc-interface/Makefile.in (Darwin): Partial reversion of previous
+ change to powerpc section.
+
+2011-09-29 Iain Sandoe <iains@gcc.gnu.org>
+
+ * gcc-interface/Makefile.in (Darwin): Factor LIBGNAT_TARGET_PAIRS
+ across the port.
+
+2011-09-27 Ed Schonberg <schonberg@adacore.com>
+
+ * a-cbhase.adb, a-cbhase.ads, a-cborse.adb, a-cborse.ads,
+ a-cihase.adb, a-cihase.ads, a-ciorse.adb, a-ciorse.ads,
+ a-coorse.adb, a-coorse.ads: Add iterator machinery to bounded sets and
+ indefinite sets.
+ * a-coorma.ads: Minor reformmating.
+ * einfo.ads: Improve the comment describing the
+ Directly_Designated_Type function.
+ * a-ciorma.adb, a-ciorma.ads: Add iterator machinery to indefinite
+ ordered maps.
+ * gcc-interface/Makefile.in, gcc-interface/Make-lang.in: Update
+ dependencies.
+
+2011-09-27 Robert Dewar <dewar@adacore.com>
+
+ * a-comutr.ads: Minor reformatting.
+
+2011-09-27 Ed Schonberg <schonberg@adacore.com>
+
+ * a-cimutr.adb, a-cimutr.ads, a-cbmutr.adb, a-cbmutr.ads: Add children
+ iterators to multiway trees.
+
+2011-09-27 Yannick Moy <moy@adacore.com>
+
+ * debug.adb (d.D): New option for strict Alfa mode.
+ * opt.ads (Strict_Alfa_Mode): New flag to interpret compiler
+ permissions as strictly as possible.
+ * sem_ch3.adb (Signed_Integer_Type_Declaration): In non-strict
+ Alfa mode, now, interpret ranges of base types like GNAT does; in
+ strict mode, simply change the range of the implicit base Itype.
+ * gnat1drv.adb: Update comments. Set Strict_Alfa_Mode.
+
+2011-09-27 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch9.adb: Minor comment fixes.
+
+2011-09-27 Ed Schonberg <schonberg@adacore.com>
+
+ * a-comutr.adb, a-comutr.ads: Add children iterators on multiway
+ trees.
+
+2011-09-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * checks.adb (Apply_Scalar_Range_Check): Use Designated_Type
+ instead of Directly_Designated_Type in the indirect array case.
+
+2011-09-27 Robert Dewar <dewar@adacore.com>
+
+ * exp_util.adb, exp_aggr.adb: Minor reformatting.
+
+2011-09-27 Ed Schonberg <schonberg@adacore.com>
+
+ * sinfo.ads, par-ch3.adb: Minor comment update: aspect specification
+ on subtype declarations.
+ * exp_aggr.adb: Minor comment update.
+
+2011-09-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_util.adb (Safe_Prefixed_Reference): Remove always-false
+ test in the N_Explicit_Dereference case. Fold double logical
+ negation in the special loop case and conditionalize it on
+ Variable_Ref being true.
+
+2011-09-27 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Selected_Component): If the prefix is a
+ single protected object and the selector is a discriminant or an
+ entry family, this is a non-overloaded candidate interpretation,
+ and possible primitive operations of the type must not be
+ examined.
+
+2011-09-27 Arnaud Charlet <charlet@adacore.com>
+
+ * s-taspri-posix-noaltstack.ads (Lock): Mark fields aliased.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * s-osinte-hpux.ads, s-osinte-aix.ads, s-osinte-solaris-posix.ads,
+ s-osinte-irix.ads, s-osinte-darwin.ads, s-osinte-freebsd.ads:
+ Add dummy definitions for pthread_rwlock_t
+ and pthread_rwlockattr_t on all POSIX platforms.
+ * s-taprop-irix.adb, s-taprop-posix.adb (Initialize_Lock): Fix lock
+ reference.
+ (Finalize_Lock): Likewise.
+ (Write_Lock): Likewise.
+ (Unlock): Likewise.
+
+2011-09-27 Tristan Gingold <gingold@adacore.com>
+
+ * s-tassta.adb (Task_Wrapper): Increase Guard_Page_Size value for
+ windows 64.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * s-osinte-hpux.ads, s-taprop-vxworks.adb, s-taspri-vxworks.ads,
+ s-taprop-tru64.adb, s-osinte-aix.ads, s-taspri-posix-noaltstack.ads,
+ s-taspri-mingw.ads, s-taprop-vms.adb, s-tpoben.adb, s-tpoben.ads,
+ s-taprop-mingw.adb, s-taprob.adb, s-taprob.ads,
+ s-osinte-solaris-posix.ads, s-taprop-solaris.adb, s-taspri-solaris.ads,
+ s-osinte-irix.ads, s-taprop-irix.adb, s-osinte-darwin.ads,
+ s-taspri-dummy.ads, s-taspri-posix.ads, s-taprop.ads,
+ s-taspri-vms.ads, s-osinte-freebsd.ads, s-taprop-hpux-dce.adb,
+ s-taspri-hpux-dce.ads, s-taspri-tru64.ads, s-taprop-dummy.adb,
+ s-taprop-posix.adb: Revert previous changes.
+ (Lock): Now a record containing the two possible lock
+ (mutex and read/write) defined in OS_Interface.
+ * s-taprop-linux.adb (Finalize_Protection): Use r/w lock for
+ 'R' locking policy.
+ (Initialize_Protection): Likewise.
+ (Lock): Likewise.
+ (Lock_Read_Only): Likewise.
+ (Unlock): Likewise.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * s-taspri-posix-noaltstack.ads (RW_Lock): This type is now defined as
+ OS_Interface.pthread_rwlock_t.
+
+2011-09-27 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch9.adb, a-cimutr.adb, a-cimutr.ads, gnat1drv.adb, a-comutr.adb,
+ a-comutr.ads, exp_dist.adb, a-cbmutr.adb, a-cbmutr.ads,
+ sem_ch5.adb, sem_util.adb: Minor reformatting.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * s-taprop.ads (Initialize_Lock)[RW_Lock]: New spec for r/w lock.
+ (Finalize_Lock)[RW_Lock]: Likewise.
+ (Write_Lock)[RW_Lock]: Likewise.
+ (Unlock)[RW_Lock]: Likewise.
+ (Read_Lock): Define L as RW_Lock (instead of Lock).
+ * s-taprop-linux.adb (Initialize_Lock)[RW_Lock]: New
+ routine for r/w lock.
+ (Finalize_Lock)[RW_Lock]: Likewise.
+ (Write_Lock)[RW_Lock]: Likewise.
+ (Unlock)[RW_Lock]: Likewise.
+ (Read_Lock): Define L as RW_Lock (instead of Lock).
+
+ * s-taprop-vxworks.adb, s-taprop-tru64.adb, s-taprop-vms.adb,
+ s-taprop-mingw.adb, s-taprop-solaris.adb, s-taprop-irix.adb,
+ s-taprop-hpux-dce.adb, s-taprop-dummy.adb, s-taprop-posix.adb
+ (Initialize_Lock)[RW_Lock]: Same implementation as corresponding
+ routine for standard lock.
+ (Finalize_Lock)[RW_Lock]: Likewise.
+ (Write_Lock)[RW_Lock]: Likewise.
+ (Unlock)[RW_Lock]: Likewise.
+ (Read_Lock): Define L as RW_Lock (instead of Lock).
+ * s-taprob.ads, s-tpoben.ads (Protection): Add RWL (RW_Lock)
+ in the record definition.
+ * s-taprob.adb, s-taproben.adb (Finalize_Protection): Use r/w
+ lock for 'R' locking policy.
+ (Initialize_Protection): Likewise.
+ (Lock): Likewise.
+ (Lock_Read_Only): Likewise.
+ (Unlock): Likewise.
+ * s-taspri-posix.ads (RW_Lock): New type defined as
+ OS_Interface.pthread_rwlock_t.
+
+ * s-taspri-vxworks.ads, s-taspri-posix-noaltstack.ads,
+ s-taspri-mingw.ads, s-taspri-solaris.ads, s-taspri-dummy.ads,
+ s-taspri-posix.ads, s-taspri-vms.ads, s-taspri-hpux-dce.ads,
+ s-taspri-tru64.ads (RW_Lock): New type defined as alias to Lock.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * exp_ch9.adb, s-taspri-posix.ads: Minor reformatting.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * s-osinte-aix.ads, s-osinte-darwin.ads, s-osinte-freebsd.ads,
+ s-osinte-hpux.ads, s-osinte-irix.ads,
+ s-osinte-solaris-posix.ads (pthread_rwlock_t): New definition alias of
+ pthread_mutex_t.
+ (pthread_rwlockattr_t): New definition alias of pthread_mutexattr_t.
+ * s-osinte-linux.ads (pthread_rwlock_t, pthread_rwlockattr_t,
+ pthread_rwlockattr_init, pthread_rwlockattr_destroy,
+ pthread_rwlockattr_setkind_np, pthread_rwlock_init,
+ pthread_rwlock_destroy, pthread_rwlock_rdlock,
+ pthread_rwlock_wrlock, pthread_rwlock_unlock): New.
+
+2011-09-27 Pascal Obry <obry@adacore.com>
+
+ * rtsfind.ads: Add RE_Lock_Read_Only into rtsfind circuitry.
+ (RE_Id): Add RE_Lock_Read_Only.
+ (RE_Unit_Table): Likewise.
+ * sem_prag.adb (Process_Convention): Change Pragma_Locking_Policy
+ to lift restriction on first character. Handle now the
+ Name_Concurrent_Readers_Locking where policy character is set to
+ 'R'.
+ * snames.ads-tmpl (Name_Concurrent_Readers_Locking): New
+ constant.
+ * exp_ch9.adb (Build_Protected_Subprogram_Body): Generate a
+ read only lock for function in protected object.
+ * s-taprob.ads (Lock_Read_Only): Remove obsolete comment as
+ this routine is now used.
+
+2011-09-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * s-atocou-x86.adb (Decrement): Use %;.
+ (Increment): Likewise.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils2.c (build_allocator): Set TREE_THIS_NOTRAP on the
+ dereference of the pointer to the storage area. Remove useless type
+ conversions and factor out common code.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (maybe_unconstrained_array): Declare TYPE local
+ variable and use it throughout.
+ <UNCONSTRAINED_ARRAY_TYPE>: Add 'break' at the end.
+ <RECORD_TYPE>: Do not unconditionally convert to the unpadded type as a
+ first step. Also convert to the unpadded type as a last step.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/gigi.h (create_subprog_decl): Replace TREE_CHAIN with
+ DECL_CHAIN in comment.
+ * gcc-interface/trans.c (gigi): Likewise.
+ (Attribute_to_gnu): Likewise.
+ (build_function_stub): Likewise.
+ (gnat_to_gnu): Likewise.
+ * gcc-interface/utils.c (create_subprog_decl): Likewise.
+ (convert_vms_descriptor64): Likewise.
+ (convert_vms_descriptor32): Likewise.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (assoc_to_constructor): Minor tweaks.
+ * gcc-interface/utils2.c (build_simple_component_ref): Fix formatting
+ issues. Use COMPLETE_TYPE_P in assertion. Also set TREE_READONLY if
+ the type of the record is TYPE_READONLY.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+ Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb (Set_Formal_Mode): Set Can_Never_Be_Null on an IN or IN
+ OUT formal parameter which is of an null-exclusion access subtype.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (DECL_CAN_NEVER_BE_NULL_P): New macro.
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Set the flag.
+ (gnat_to_gnu_param): Likewise.
+ * gcc-interface/utils.c (convert) <UNCONSTRAINED_ARRAY_REF>: Invoke
+ maybe_unconstrained_array instead of doing the work manually.
+ (maybe_unconstrained_array): Propagate the TREE_THIS_NOTRAP flag.
+ * gcc-interface/utils2.c (build_unary_op) <INDIRECT_REF>: If operand
+ is a DECL with the flag, set TREE_THIS_NOTRAP on the reference.
+ (gnat_stabilize_reference_1): Propagate the TREE_THIS_NOTRAP flag.
+ (gnat_stabilize_reference): Likewise.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (TYPE_NULL_BOUNDS): New macro.
+ (SET_TYPE_NULL_BOUNDS): Likewise.
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Set again
+ TREE_THIS_NOTRAP on the INDIRECT_REF node built for the template.
+ * gcc-interface/trans.c (Identifier_to_gnu): Return initializers of fat
+ pointer types.
+ * gcc-interface/utils.c (create_var_decl_1): If the object is external,
+ check that the initializer is a valid constant expression for use in
+ initializing a static variable. Add missing guard.
+ (update_pointer_to): Adjust TYPE_NULL_BOUNDS if set.
+ (convert_to_fat_pointer): In the null fat pointer case, build a valid
+ pointer for the bounds.
+ * gcc-interface/utils2.c (compare_fat_pointers): New function.
+ (build_binary_op) <EQ_EXPR>: Call it to compare fat pointers.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (TREE_THIS_NOTRAP): Redefine.
+ * gcc-interface/trans.c (Identifier_to_gnu): Factor out common code in
+ the by-ref case. Do not set TREE_READONLY on a renamed object. Set
+ TREE_THIS_NOTRAP on UNCONSTRAINED_ARRAY_REF nodes.
+ (Attribute_to_gnu) <Attr_Length>: Expand the use of the parameter cache
+ to the indirect case.
+ * gcc-interface/utils.c (convert) <UNCONSTRAINED_ARRAY_REF>: Preserve
+ the TREE_THIS_NOTRAP flag.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Loop_Statement_to_gnu): In the case of an
+ iteration scheme, always generate the do-while form if optimization
+ is enabled. Use more straightforward test at the end.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Subtype>: Use
+ XNEW instead of xmalloc. Do not build useless pointer type.
+ <E_Anonymous_Access_Subprogram_Type>: Use XNEW instead of xmalloc.
+ * gcc-interface/trans.c (gnat_to_gnu) <N_Raise_Constraint_Error>: Tidy.
+ * gcc-interface/utils2.c (build_unary_op): Remove local variable.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Do not promote
+ the alignment if this doesn't prevent BLKmode access to the object.
+
+2011-09-24 Iain Sandoe <iains@gcc.gnu.org>
+
+ * gcc-interface/Makefile.in (darwin): Do not issue the
+ '-flat_namespace' linker flag during Ada build.
+ * mlib-tgt-specific-darwin.adb: Remove '-flat_namespace' flag from the
+ default shared library options.
+
2011-09-19 Alexandre Oliva <aoliva@redhat.com>
* gcc-interface/decl.c (annotate_value): Look up expression for
@@ -11149,7 +11467,7 @@
* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Use libcommon.a
instead of version.o.
-2011-05-18 Kai Tietz <ktietz@redhat.com>
+2011-05-18 Kai Tietz <ktietz@redhat.com>
* gcc-interface/trans.c (Exception_Handler_to_gnu_sjlj): Use
boolean_false_node instead of integer_zero_node.
@@ -14341,7 +14659,7 @@ notice and this notice are preserved.
* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Use libcommon.a
instead of version.o.
-2011-05-18 Kai Tietz <ktietz@redhat.com>
+2011-05-18 Kai Tietz <ktietz@redhat.com>
* gcc-interface/trans.c (Exception_Handler_to_gnu_sjlj): Use
boolean_false_node instead of integer_zero_node.
diff --git a/gcc/ada/a-cbhase.adb b/gcc/ada/a-cbhase.adb
index d2d5b6c53b5..7dcd074995d 100644
--- a/gcc/ada/a-cbhase.adb
+++ b/gcc/ada/a-cbhase.adb
@@ -39,6 +39,17 @@ with System; use type System.Address;
package body Ada.Containers.Bounded_Hashed_Sets is
+ type Iterator is new Set_Iterator_Interfaces.Forward_Iterator with record
+ Container : Set_Access;
+ Position : Cursor;
+ end record;
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -593,6 +604,16 @@ package body Ada.Containers.Bounded_Hashed_Sets is
return Cursor'(Container'Unrestricted_Access, Node);
end First;
+ overriding function First (Object : Iterator) return Cursor is
+ Node : constant Count_Type := HT_Ops.First (Object.Container.all);
+ begin
+ if Node = 0 then
+ return No_Element;
+ end if;
+
+ return Cursor'(Object.Container, Node);
+ end First;
+
-----------------
-- Has_Element --
-----------------
@@ -899,6 +920,12 @@ package body Ada.Containers.Bounded_Hashed_Sets is
B := B - 1;
end Iterate;
+ function Iterate (Container : Set)
+ return Set_Iterator_Interfaces.Forward_Iterator'Class is
+ begin
+ return Iterator'(Container'Unrestricted_Access, First (Container));
+ end Iterate;
+
------------
-- Length --
------------
@@ -962,6 +989,23 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Position := Next (Position);
end Next;
+ function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor
+ is
+ begin
+ if Position.Container /= Object.Container then
+ raise Program_Error with
+ "Position cursor designates wrong set";
+ end if;
+
+ if Position.Node = 0 then
+ return No_Element;
+ end if;
+
+ return Next (Position);
+ end Next;
+
-------------
-- Overlap --
-------------
@@ -1083,6 +1127,31 @@ package body Ada.Containers.Bounded_Hashed_Sets is
raise Program_Error with "attempt to stream set cursor";
end Read;
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ ---------------
+ -- Reference --
+ ---------------
+
+ function Constant_Reference
+ (Container : aliased Set;
+ Position : Cursor) return Constant_Reference_Type
+ is
+ S : Set renames Position.Container.all;
+ N : Node_Type renames S.Nodes (Position.Node);
+
+ begin
+ pragma Unreferenced (Container);
+
+ return (Element => N.Element'Unrestricted_Access);
+ end Constant_Reference;
+
-------------
-- Replace --
-------------
@@ -1476,6 +1545,14 @@ package body Ada.Containers.Bounded_Hashed_Sets is
raise Program_Error with "attempt to stream set cursor";
end Write;
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
package body Generic_Keys is
-----------------------
@@ -1731,6 +1808,29 @@ package body Ada.Containers.Bounded_Hashed_Sets is
raise Program_Error with "key was modified";
end Update_Element_Preserving_Key;
+ ------------------------------
+ -- Reference_Preserving_Key --
+ ------------------------------
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Position : Cursor) return Reference_Type
+ is
+ N : Node_Type renames Container.Nodes (Position.Node);
+ begin
+ return (Element => N.Element'Unrestricted_Access);
+ end Reference_Preserving_Key;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+ N : Node_Type renames Container.Nodes (Position.Node);
+ begin
+ return (Element => N.Element'Unrestricted_Access);
+ end Reference_Preserving_Key;
+
end Generic_Keys;
end Ada.Containers.Bounded_Hashed_Sets;
diff --git a/gcc/ada/a-cbhase.ads b/gcc/ada/a-cbhase.ads
index 711c0116963..c72b8ab8597 100644
--- a/gcc/ada/a-cbhase.ads
+++ b/gcc/ada/a-cbhase.ads
@@ -31,6 +31,7 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
+with Ada.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Streams;
@@ -48,7 +49,11 @@ package Ada.Containers.Bounded_Hashed_Sets is
pragma Pure;
pragma Remote_Types;
- type Set (Capacity : Count_Type; Modulus : Hash_Type) is tagged private;
+ type Set (Capacity : Count_Type; Modulus : Hash_Type) is tagged private
+ with Constant_Indexing => Constant_Reference,
+ Default_Iterator => Iterate,
+ Iterator_Element => Element_Type;
+
pragma Preelaborable_Initialization (Set);
type Cursor is private;
@@ -62,6 +67,12 @@ package Ada.Containers.Bounded_Hashed_Sets is
-- Cursor objects declared without an initialization expression are
-- initialized to the value No_Element.
+ function Has_Element (Position : Cursor) return Boolean;
+ -- Equivalent to Position /= No_Element
+
+ package Set_Iterator_Interfaces is new
+ Ada.Iterator_Interfaces (Cursor, Has_Element);
+
function "=" (Left, Right : Set) return Boolean;
-- For each element in Left, set equality attempts to find the equal
-- element in Right; if a search fails, then set equality immediately
@@ -129,7 +140,16 @@ package Ada.Containers.Bounded_Hashed_Sets is
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
-- Calls Process with the element (having only a constant view) of the node
- -- designed by the cursor.
+ -- designated by the cursor.
+
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is private
+ with Implicit_Dereference => Element;
+
+ function Constant_Reference
+ (Container : aliased Set;
+ Position : Cursor)
+ return Constant_Reference_Type;
procedure Assign (Target : in out Set; Source : Set);
-- If Target denotes the same object as Source, then the operation has no
@@ -314,9 +334,6 @@ package Ada.Containers.Bounded_Hashed_Sets is
function Contains (Container : Set; Item : Element_Type) return Boolean;
-- Equivalent to Find (Container, Item) /= No_Element
- function Has_Element (Position : Cursor) return Boolean;
- -- Equivalent to Position /= No_Element
-
function Equivalent_Elements (Left, Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Elements with the elements of
-- the nodes designated by cursors Left and Right.
@@ -338,6 +355,9 @@ package Ada.Containers.Bounded_Hashed_Sets is
Process : not null access procedure (Position : Cursor));
-- Calls Process for each node in the set
+ function Iterate (Container : Set)
+ return Set_Iterator_Interfaces.Forward_Iterator'Class;
+
generic
type Key_Type (<>) is private;
@@ -406,6 +426,23 @@ package Ada.Containers.Bounded_Hashed_Sets is
-- completes. Otherwise, the node is removed from the map and
-- Program_Error is raised.
+ type Reference_Type (Element : not null access Element_Type) is private
+ with Implicit_Dereference => Element;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Position : Cursor)
+ return Reference_Type;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type)
+ return Reference_Type;
+
+ private
+ type Reference_Type (Element : not null access Element_Type)
+ is null record;
+
end Generic_Keys;
private
@@ -466,6 +503,21 @@ private
for Set'Read use Read;
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
Empty_Set : constant Set :=
(Hash_Table_Type with Capacity => 0, Modulus => 0);
diff --git a/gcc/ada/a-cbmutr.adb b/gcc/ada/a-cbmutr.adb
index 32ab0828942..f4bdc5e4035 100644
--- a/gcc/ada/a-cbmutr.adb
+++ b/gcc/ada/a-cbmutr.adb
@@ -40,10 +40,29 @@ package body Ada.Containers.Bounded_Multiway_Trees is
end record;
overriding function First (Object : Iterator) return Cursor;
+
overriding function Next
(Object : Iterator;
Position : Cursor) return Cursor;
+ type Child_Iterator is new Tree_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Tree_Access;
+ Position : Cursor;
+ end record;
+
+ overriding function First (Object : Child_Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Last (Object : Child_Iterator) return Cursor;
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -1241,6 +1260,14 @@ package body Ada.Containers.Bounded_Multiway_Trees is
return Object.Position;
end First;
+ function First (Object : Child_Iterator) return Cursor is
+ Node : Count_Type'Base;
+
+ begin
+ Node := Object.Container.Nodes (Object.Position.Node).Children.First;
+ return (Object.Container, Node);
+ end First;
+
-----------------
-- First_Child --
-----------------
@@ -1737,19 +1764,14 @@ package body Ada.Containers.Bounded_Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
- (Container'Unrestricted_Access, Root_Node (Container));
+ (Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
- First_Child (Root_Cursor), From_Root => True);
+ First_Child (Root_Cursor),
+ From_Root => True);
end Iterate;
- function Iterate_Subtree (Position : Cursor)
- return Tree_Iterator_Interfaces.Forward_Iterator'Class is
- begin
- return Iterator'(Position.Container, Position, From_Root => False);
- end Iterate_Subtree;
-
----------------------
-- Iterate_Children --
----------------------
@@ -1814,10 +1836,28 @@ package body Ada.Containers.Bounded_Multiway_Trees is
end loop;
end Iterate_Children;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class
+ is
+ pragma Unreferenced (Container);
+ begin
+ return Child_Iterator'(Parent.Container, Parent);
+ end Iterate_Children;
+
---------------------
-- Iterate_Subtree --
---------------------
+ function Iterate_Subtree
+ (Position : Cursor)
+ return Tree_Iterator_Interfaces.Forward_Iterator'Class
+ is
+ begin
+ return Iterator'(Position.Container, Position, From_Root => False);
+ end Iterate_Subtree;
+
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
@@ -1841,7 +1881,6 @@ package body Ada.Containers.Bounded_Multiway_Trees is
if Is_Root (Position) then
Iterate_Children (T, Position.Node, Process);
-
else
Iterate_Subtree (T, Position.Node, Process);
end if;
@@ -1869,6 +1908,15 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Iterate_Children (Container, Subtree, Process);
end Iterate_Subtree;
+ ----------
+ -- Last --
+ ----------
+
+ overriding function Last (Object : Child_Iterator) return Cursor is
+ begin
+ return Last_Child (Object.Position);
+ end Last;
+
----------------
-- Last_Child --
----------------
@@ -1938,7 +1986,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
begin
if Is_Leaf (Position) then
- -- If sibling is present, return it.
+ -- If sibling is present, return it
if N.Next /= 0 then
return (Object.Container, N.Next);
@@ -1955,7 +2003,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
while Par.Next = 0 loop
Pos := Par.Parent;
- -- If we are back at the root the iteration is complete.
+ -- If we are back at the root the iteration is complete
if Pos = No_Node then
return No_Element;
@@ -1983,12 +2031,24 @@ package body Ada.Containers.Bounded_Multiway_Trees is
end;
end if;
+ -- If an internal node, return its first child
+
else
+ return (Object.Container, N.Children.First);
+ end if;
+ end Next;
- -- If an internal node, return its first child.
+ function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
- return (Object.Container, N.Children.First);
+ begin
+ if Object.Container /= Position.Container then
+ raise Program_Error;
end if;
+
+ return Next_Sibling (Position);
end Next;
------------------
@@ -2136,6 +2196,22 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Container.Count := Container.Count + Count;
end Prepend_Child;
+ --------------
+ -- Previous --
+ --------------
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
+ begin
+ if Object.Container /= Position.Container then
+ raise Program_Error;
+ end if;
+
+ return Previous_Sibling (Position);
+ end Previous;
+
----------------------
-- Previous_Sibling --
----------------------
@@ -2351,24 +2427,22 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Container : aliased Tree;
Position : Cursor) return Constant_Reference_Type
is
- begin
pragma Unreferenced (Container);
-
+ begin
return
(Element =>
- Position.Container.Elements (Position.Node)'Unchecked_Access);
+ Position.Container.Elements (Position.Node)'Unchecked_Access);
end Constant_Reference;
function Reference
(Container : aliased Tree;
Position : Cursor) return Reference_Type
is
- begin
pragma Unreferenced (Container);
-
+ begin
return
(Element =>
- Position.Container.Elements (Position.Node)'Unchecked_Access);
+ Position.Container.Elements (Position.Node)'Unchecked_Access);
end Reference;
--------------------
diff --git a/gcc/ada/a-cbmutr.ads b/gcc/ada/a-cbmutr.ads
index f20af0487c5..e014f82d453 100644
--- a/gcc/ada/a-cbmutr.ads
+++ b/gcc/ada/a-cbmutr.ads
@@ -179,6 +179,11 @@ package Ada.Containers.Bounded_Multiway_Trees is
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
+
function Child_Count (Parent : Cursor) return Count_Type;
function Child_Depth (Parent, Child : Cursor) return Count_Type;
@@ -377,13 +382,11 @@ private
function Constant_Reference
(Container : aliased Tree;
- Position : Cursor)
- return Constant_Reference_Type;
+ Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
- Position : Cursor)
- return Reference_Type;
+ Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Capacity => 0, others => <>);
diff --git a/gcc/ada/a-cborse.adb b/gcc/ada/a-cborse.adb
index 4a4bc71d416..1974c6cccef 100644
--- a/gcc/ada/a-cborse.adb
+++ b/gcc/ada/a-cborse.adb
@@ -42,6 +42,24 @@ with System; use type System.Address;
package body Ada.Containers.Bounded_Ordered_Sets is
+ type Iterator is new
+ Ordered_Set_Iterator_Interfaces.Reversible_Iterator with record
+ Container : access constant Set;
+ Node : Count_Type;
+ end record;
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
------------------------------
-- Access to Fields of Node --
------------------------------
@@ -598,6 +616,18 @@ package body Ada.Containers.Bounded_Ordered_Sets is
return Cursor'(Container'Unrestricted_Access, Container.First);
end First;
+ function First (Object : Iterator) return Cursor is
+ begin
+ if Object.Container.First = 0 then
+ return No_Element;
+ else
+ return
+ Cursor'(
+ Object.Container.all'Unrestricted_Access,
+ Object.Container.First);
+ end if;
+ end First;
+
-------------------
-- First_Element --
-------------------
@@ -891,6 +921,53 @@ package body Ada.Containers.Bounded_Ordered_Sets is
raise Program_Error with "key was modified";
end Update_Element_Preserving_Key;
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Node = 0 then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return
+ (Element =>
+ Container.Nodes (Position.Node).Element'Unrestricted_Access);
+ end Reference_Preserving_Key;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Node = 0 then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return
+ (Element =>
+ Container.Nodes (Position.Node).Element'Unrestricted_Access);
+ end Reference_Preserving_Key;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
end Generic_Keys;
-----------------
@@ -1185,6 +1262,25 @@ package body Ada.Containers.Bounded_Ordered_Sets is
B := B - 1;
end Iterate;
+ function Iterate (Container : Set)
+ return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class
+ is
+ begin
+ if Container.Length = 0 then
+ return Iterator'(null, 0);
+ else
+ return Iterator'(Container'Unchecked_Access, Container.First);
+ end if;
+ end Iterate;
+
+ function Iterate (Container : Set; Start : Cursor)
+ return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class
+ is
+ It : constant Iterator := (Container'Unchecked_Access, Start.Node);
+ begin
+ return It;
+ end Iterate;
+
----------
-- Last --
----------
@@ -1198,6 +1294,17 @@ package body Ada.Containers.Bounded_Ordered_Sets is
return Cursor'(Container'Unrestricted_Access, Container.Last);
end Last;
+ function Last (Object : Iterator) return Cursor is
+ begin
+ if Object.Container.Last = 0 then
+ return No_Element;
+ else
+ return Cursor'(
+ Object.Container.all'Unrestricted_Access,
+ Object.Container.Last);
+ end if;
+ end Last;
+
------------------
-- Last_Element --
------------------
@@ -1279,6 +1386,13 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Position := Next (Position);
end Next;
+ function Next (Object : Iterator; Position : Cursor) return Cursor is
+ pragma Unreferenced (Object);
+
+ begin
+ return Next (Position);
+ end Next;
+
-------------
-- Overlap --
-------------
@@ -1328,6 +1442,12 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Position := Previous (Position);
end Previous;
+ function Previous (Object : Iterator; Position : Cursor) return Cursor is
+ pragma Unreferenced (Object);
+ begin
+ return Previous (Position);
+ end Previous;
+
-------------------
-- Query_Element --
-------------------
@@ -1408,6 +1528,30 @@ package body Ada.Containers.Bounded_Ordered_Sets is
raise Program_Error with "attempt to stream set cursor";
end Read;
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ ---------------
+ -- Reference --
+ ---------------
+
+ function Constant_Reference (Container : Set; Position : Cursor)
+ return Constant_Reference_Type
+ is
+ begin
+ if Position.Container = null then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return (Element =>
+ Container.Nodes (Position.Node).Element'Unrestricted_Access);
+ end Constant_Reference;
+
-------------
-- Replace --
-------------
@@ -1716,4 +1860,12 @@ package body Ada.Containers.Bounded_Ordered_Sets is
raise Program_Error with "attempt to stream set cursor";
end Write;
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
end Ada.Containers.Bounded_Ordered_Sets;
diff --git a/gcc/ada/a-cborse.ads b/gcc/ada/a-cborse.ads
index e56b71b4c61..0c8ae6b1703 100644
--- a/gcc/ada/a-cborse.ads
+++ b/gcc/ada/a-cborse.ads
@@ -31,8 +31,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
+with Ada.Iterator_Interfaces;
private with Ada.Containers.Red_Black_Trees;
-private with Ada.Streams;
+with Ada.Streams; use Ada.Streams;
generic
type Element_Type is private;
@@ -46,7 +47,11 @@ package Ada.Containers.Bounded_Ordered_Sets is
function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
- type Set (Capacity : Count_Type) is tagged private;
+ type Set (Capacity : Count_Type) is tagged private
+ with Constant_Indexing => Constant_Reference,
+ Default_Iterator => Iterate,
+ Iterator_Element => Element_Type;
+
pragma Preelaborable_Initialization (Set);
type Cursor is private;
@@ -55,6 +60,20 @@ package Ada.Containers.Bounded_Ordered_Sets is
Empty_Set : constant Set;
No_Element : constant Cursor;
+ function Has_Element (Position : Cursor) return Boolean;
+
+ package Ordered_Set_Iterator_Interfaces is new
+ Ada.Iterator_Interfaces (Cursor, Has_Element);
+
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is
+ private
+ with
+ Implicit_Dereference => Element;
+
+ function Constant_Reference
+ (Container : Set; Position : Cursor)
+ return Constant_Reference_Type;
function "=" (Left, Right : Set) return Boolean;
@@ -171,8 +190,6 @@ package Ada.Containers.Bounded_Ordered_Sets is
function Contains (Container : Set; Item : Element_Type) return Boolean;
- function Has_Element (Position : Cursor) return Boolean;
-
function "<" (Left, Right : Cursor) return Boolean;
function ">" (Left, Right : Cursor) return Boolean;
@@ -193,6 +210,15 @@ package Ada.Containers.Bounded_Ordered_Sets is
(Container : Set;
Process : not null access procedure (Position : Cursor));
+ function Iterate
+ (Container : Set)
+ return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class;
+
+ function Iterate
+ (Container : Set;
+ Start : Cursor)
+ return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class;
+
generic
type Key_Type (<>) is private;
@@ -231,6 +257,34 @@ package Ada.Containers.Bounded_Ordered_Sets is
Process : not null access
procedure (Element : in out Element_Type));
+ type Reference_Type (Element : not null access Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type;
+
+ private
+ type Reference_Type
+ (Element : not null access Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
end Generic_Keys;
private
@@ -267,7 +321,6 @@ private
end record;
use Tree_Types;
- use Ada.Streams;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
@@ -295,6 +348,21 @@ private
for Set'Read use Read;
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
Empty_Set : constant Set := Set'(Tree_Type with Capacity => 0);
end Ada.Containers.Bounded_Ordered_Sets;
diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb
index 0a42fb239b3..dd43229b5e2 100644
--- a/gcc/ada/a-cihase.adb
+++ b/gcc/ada/a-cihase.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
@@ -41,6 +41,17 @@ with System; use type System.Address;
package body Ada.Containers.Indefinite_Hashed_Sets is
+ type Iterator is new Set_Iterator_Interfaces.Forward_Iterator with record
+ Container : Set_Access;
+ Position : Cursor;
+ end record;
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -602,6 +613,16 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
return Cursor'(Container'Unrestricted_Access, Node);
end First;
+ function First (Object : Iterator) return Cursor is
+ Node : constant Node_Access := HT_Ops.First (Object.Container.HT);
+ begin
+ if Node = null then
+ return No_Element;
+ end if;
+
+ return Cursor'(Object.Container, Node);
+ end First;
+
----------
-- Free --
----------
@@ -956,6 +977,12 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
B := B - 1;
end Iterate;
+ function Iterate (Container : Set)
+ return Set_Iterator_Interfaces.Forward_Iterator'Class is
+ begin
+ return Iterator'(Container'Unrestricted_Access, First (Container));
+ end Iterate;
+
------------
-- Length --
------------
@@ -1013,6 +1040,23 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Position := Next (Position);
end Next;
+ function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor
+ is
+ begin
+ if Position.Container /= Object.Container then
+ raise Program_Error with
+ "Position cursor designates wrong set";
+ end if;
+
+ if Position.Node = null then
+ return No_Element;
+ end if;
+
+ return Next (Position);
+ end Next;
+
-------------
-- Overlap --
-------------
@@ -1106,6 +1150,14 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
raise Program_Error with "attempt to stream set cursor";
end Read;
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
---------------
-- Read_Node --
---------------
@@ -1123,6 +1175,20 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
raise;
end Read_Node;
+ ---------------
+ -- Reference --
+ ---------------
+
+ function Constant_Reference
+ (Container : aliased Set;
+ Position : Cursor) return Constant_Reference_Type
+ is
+ begin
+ pragma Unreferenced (Container);
+
+ return (Element => Position.Node.Element);
+ end Constant_Reference;
+
-------------
-- Replace --
-------------
@@ -1746,6 +1812,14 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
raise Program_Error with "attempt to stream set cursor";
end Write;
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
----------------
-- Write_Node --
----------------
@@ -2017,6 +2091,28 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
raise Program_Error with "key was modified";
end Update_Element_Preserving_Key;
+ ------------------------------
+ -- Reference_Preserving_Key --
+ ------------------------------
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Position : Cursor) return Reference_Type
+ is
+ pragma Unreferenced (Container);
+ begin
+ return (Element => Position.Node.Element);
+ end Reference_Preserving_Key;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+ begin
+ return (Element => Position.Node.Element);
+ end Reference_Preserving_Key;
+
end Generic_Keys;
end Ada.Containers.Indefinite_Hashed_Sets;
diff --git a/gcc/ada/a-cihase.ads b/gcc/ada/a-cihase.ads
index df091031bc5..b055c1be153 100644
--- a/gcc/ada/a-cihase.ads
+++ b/gcc/ada/a-cihase.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -31,6 +31,7 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
+with Ada.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Streams;
private with Ada.Finalization;
@@ -49,7 +50,11 @@ package Ada.Containers.Indefinite_Hashed_Sets is
pragma Preelaborate;
pragma Remote_Types;
- type Set is tagged private;
+ type Set is tagged private
+ with Constant_Indexing => Constant_Reference,
+ Default_Iterator => Iterate,
+ Iterator_Element => Element_Type;
+
pragma Preelaborable_Initialization (Set);
type Cursor is private;
@@ -63,6 +68,12 @@ package Ada.Containers.Indefinite_Hashed_Sets is
-- Cursor objects declared without an initialization expression are
-- initialized to the value No_Element.
+ function Has_Element (Position : Cursor) return Boolean;
+ -- Equivalent to Position /= No_Element
+
+ package Set_Iterator_Interfaces is new
+ Ada.Iterator_Interfaces (Cursor, Has_Element);
+
function "=" (Left, Right : Set) return Boolean;
-- For each element in Left, set equality attempts to find the equal
-- element in Right; if a search fails, then set equality immediately
@@ -131,7 +142,16 @@ package Ada.Containers.Indefinite_Hashed_Sets is
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
-- Calls Process with the element (having only a constant view) of the node
- -- designed by the cursor.
+ -- designated by the cursor.
+
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is private
+ with Implicit_Dereference => Element;
+
+ function Constant_Reference
+ (Container : aliased Set;
+ Position : Cursor)
+ return Constant_Reference_Type;
procedure Move (Target : in out Set; Source : in out Set);
-- Clears Target (if it's not empty), and then moves (not copies) the
@@ -297,9 +317,6 @@ package Ada.Containers.Indefinite_Hashed_Sets is
function Contains (Container : Set; Item : Element_Type) return Boolean;
-- Equivalent to Find (Container, Item) /= No_Element
- function Has_Element (Position : Cursor) return Boolean;
- -- Equivalent to Position /= No_Element
-
function Equivalent_Elements (Left, Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Elements with the elements of
-- the nodes designated by cursors Left and Right.
@@ -321,6 +338,9 @@ package Ada.Containers.Indefinite_Hashed_Sets is
Process : not null access procedure (Position : Cursor));
-- Calls Process for each node in the set
+ function Iterate (Container : Set)
+ return Set_Iterator_Interfaces.Forward_Iterator'Class;
+
generic
type Key_Type (<>) is private;
@@ -389,6 +409,22 @@ package Ada.Containers.Indefinite_Hashed_Sets is
-- completes. Otherwise, the node is removed from the map and
-- Program_Error is raised.
+ type Reference_Type (Element : not null access Element_Type) is private
+ with Implicit_Dereference => Element;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Position : Cursor)
+ return Reference_Type;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type)
+ return Reference_Type;
+
+ private
+ type Reference_Type (Element : not null access Element_Type)
+ is null record;
end Generic_Keys;
private
@@ -454,6 +490,21 @@ private
for Set'Read use Read;
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
Empty_Set : constant Set := (Controlled with HT => (null, 0, 0, 0));
end Ada.Containers.Indefinite_Hashed_Sets;
diff --git a/gcc/ada/a-cimutr.adb b/gcc/ada/a-cimutr.adb
index 96c1fe26d7a..2fdc8a75469 100644
--- a/gcc/ada/a-cimutr.adb
+++ b/gcc/ada/a-cimutr.adb
@@ -39,11 +39,28 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
From_Root : Boolean;
end record;
+ type Child_Iterator is new Tree_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Tree_Access;
+ Position : Cursor;
+ end record;
+
overriding function First (Object : Iterator) return Cursor;
overriding function Next
(Object : Iterator;
Position : Cursor) return Cursor;
+ overriding function First (Object : Child_Iterator) return Cursor;
+ overriding function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Last (Object : Child_Iterator) return Cursor;
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -936,6 +953,11 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
return Object.Position;
end First;
+ function First (Object : Child_Iterator) return Cursor is
+ begin
+ return (Object.Container, Object.Position.Node.Children.First);
+ end First;
+
-----------------
-- First_Child --
-----------------
@@ -1305,19 +1327,14 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
- (Container'Unrestricted_Access, Root_Node (Container));
+ (Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
- First_Child (Root_Cursor), From_Root => True);
+ First_Child (Root_Cursor),
+ From_Root => True);
end Iterate;
- function Iterate_Subtree (Position : Cursor)
- return Tree_Iterator_Interfaces.Forward_Iterator'Class is
- begin
- return Iterator'(Position.Container, Position, From_Root => False);
- end Iterate_Subtree;
-
----------------------
-- Iterate_Children --
----------------------
@@ -1374,10 +1391,28 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
end loop;
end Iterate_Children;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class
+ is
+ pragma Unreferenced (Container);
+ begin
+ return Child_Iterator'(Parent.Container, Parent);
+ end Iterate_Children;
+
---------------------
-- Iterate_Subtree --
---------------------
+ function Iterate_Subtree
+ (Position : Cursor)
+ return Tree_Iterator_Interfaces.Forward_Iterator'Class
+ is
+ begin
+ return Iterator'(Position.Container, Position, From_Root => False);
+ end Iterate_Subtree;
+
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
@@ -1422,6 +1457,15 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
Iterate_Children (Container, Subtree, Process);
end Iterate_Subtree;
+ ----------
+ -- Last --
+ ----------
+
+ overriding function Last (Object : Child_Iterator) return Cursor is
+ begin
+ return (Object.Container, Object.Position.Node.Children.Last);
+ end Last;
+
----------------
-- Last_Child --
----------------
@@ -1498,7 +1542,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
begin
if Is_Leaf (Position) then
- -- If sibling is present, return it.
+ -- If sibling is present, return it
if N.Next /= null then
return (Object.Container, N.Next);
@@ -1513,7 +1557,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
begin
while Par.Next = null loop
- -- If we are back at the root the iteration is complete.
+ -- If we are back at the root the iteration is complete
if Par = Root_Node (T) then
return No_Element;
@@ -1541,11 +1585,25 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
end;
end if;
+ -- If an internal node, return its first child
+
else
+ return (Object.Container, N.Children.First);
+ end if;
+ end Next;
- -- If an internal node, return its first child.
+ function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
+ C : constant Tree_Node_Access := Position.Node.Next;
- return (Object.Container, N.Children.First);
+ begin
+ if C = null then
+ return No_Element;
+
+ else
+ return (Object.Container, C);
end if;
end Next;
@@ -1671,6 +1729,25 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
Container.Count := Container.Count + Count;
end Prepend_Child;
+ --------------
+ -- Previous --
+ --------------
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
+ C : constant Tree_Node_Access := Position.Node.Prev;
+
+ begin
+ if C = null then
+ return No_Element;
+
+ else
+ return (Object.Container, C);
+ end if;
+ end Previous;
+
----------------------
-- Previous_Sibling --
----------------------
diff --git a/gcc/ada/a-cimutr.ads b/gcc/ada/a-cimutr.ads
index c47f986c9b3..29be8ca39ea 100644
--- a/gcc/ada/a-cimutr.ads
+++ b/gcc/ada/a-cimutr.ads
@@ -181,6 +181,11 @@ package Ada.Containers.Indefinite_Multiway_Trees is
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
+
function Child_Count (Parent : Cursor) return Count_Type;
function Child_Depth (Parent, Child : Cursor) return Count_Type;
@@ -397,13 +402,11 @@ private
function Constant_Reference
(Container : aliased Tree;
- Position : Cursor)
- return Constant_Reference_Type;
+ Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
- Position : Cursor)
- return Reference_Type;
+ Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Controlled with others => <>);
diff --git a/gcc/ada/a-ciorma.adb b/gcc/ada/a-ciorma.adb
index 9cfcd3f5a80..c30abd08046 100644
--- a/gcc/ada/a-ciorma.adb
+++ b/gcc/ada/a-ciorma.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
@@ -37,6 +37,24 @@ pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
package body Ada.Containers.Indefinite_Ordered_Maps is
+ type Iterator is new
+ Map_Iterator_Interfaces.Reversible_Iterator with record
+ Container : Map_Access;
+ Node : Node_Access;
+ end record;
+
+ overriding function First (Object : Iterator) return Cursor;
+
+ overriding function Last (Object : Iterator) return Cursor;
+
+ overriding function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor;
+
-----------------------------
-- Node Access Subprograms --
-----------------------------
@@ -305,6 +323,17 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
return Node.Color;
end Color;
+ ------------------------
+ -- Constant_Reference --
+ ------------------------
+
+ function Constant_Reference
+ (Container : Map;
+ Key : Key_Type) return Constant_Reference_Type
+ is
+ begin return (Element => Container.Element (Key)'Unrestricted_Access);
+ end Constant_Reference;
+
--------------
-- Contains --
--------------
@@ -503,6 +532,18 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
return Cursor'(Container'Unrestricted_Access, T.First);
end First;
+ function First (Object : Iterator) return Cursor is
+ M : constant Map_Access := Object.Container;
+ N : constant Node_Access := M.Tree.First;
+
+ begin
+ if N = null then
+ return No_Element;
+ else
+ return Cursor'(Object.Container.all'Unchecked_Access, N);
+ end if;
+ end First;
+
-------------------
-- First_Element --
-------------------
@@ -810,6 +851,24 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
B := B - 1;
end Iterate;
+ function Iterate
+ (Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'class
+ is
+ Node : constant Node_Access := Container.Tree.First;
+ It : constant Iterator := (Container'Unrestricted_Access, Node);
+
+ begin
+ return It;
+ end Iterate;
+
+ function Iterate (Container : Map; Start : Cursor)
+ return Map_Iterator_Interfaces.Reversible_Iterator'class
+ is
+ It : constant Iterator := (Container'Unrestricted_Access, Start.Node);
+ begin
+ return It;
+ end Iterate;
+
---------
-- Key --
---------
@@ -847,6 +906,17 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
return Cursor'(Container'Unrestricted_Access, T.Last);
end Last;
+ function Last (Object : Iterator) return Cursor is
+ M : constant Map_Access := Object.Container;
+ N : constant Node_Access := M.Tree.Last;
+ begin
+ if N = null then
+ return No_Element;
+ else
+ return Cursor'(Object.Container.all'Unchecked_Access, N);
+ end if;
+ end Last;
+
------------------
-- Last_Element --
------------------
@@ -941,6 +1011,18 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
Position := Next (Position);
end Next;
+ function Next
+ (Object : Iterator;
+ Position : Cursor) return Cursor
+ is
+ begin
+ if Position.Node = null then
+ return No_Element;
+ else
+ return (Object.Container, Tree_Operations.Next (Position.Node));
+ end if;
+ end Next;
+
------------
-- Parent --
------------
@@ -984,6 +1066,18 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
Position := Previous (Position);
end Previous;
+ function Previous
+ (Object : Iterator;
+ Position : Cursor) return Cursor
+ is
+ begin
+ if Position.Node = null then
+ return No_Element;
+ else
+ return (Object.Container, Tree_Operations.Previous (Position.Node));
+ end if;
+ end Previous;
+
-------------------
-- Query_Element --
-------------------
@@ -1084,6 +1178,35 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
raise Program_Error with "attempt to stream map cursor";
end Read;
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ ---------------
+ -- Reference --
+ ---------------
+
+ function Reference
+ (Container : Map;
+ Key : Key_Type)
+ return Reference_Type
+ is
+ begin
+ return (Element => Container.Element (Key)'Unrestricted_Access);
+ end Reference;
+
-------------
-- Replace --
-------------
@@ -1359,4 +1482,19 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
raise Program_Error with "attempt to stream map cursor";
end Write;
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
end Ada.Containers.Indefinite_Ordered_Maps;
diff --git a/gcc/ada/a-ciorma.ads b/gcc/ada/a-ciorma.ads
index 56e40d9bf32..b31dc0d2e25 100644
--- a/gcc/ada/a-ciorma.ads
+++ b/gcc/ada/a-ciorma.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -31,6 +31,7 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
+with Ada.Iterator_Interfaces;
private with Ada.Containers.Red_Black_Trees;
private with Ada.Finalization;
private with Ada.Streams;
@@ -48,7 +49,12 @@ package Ada.Containers.Indefinite_Ordered_Maps is
function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
- type Map is tagged private;
+ type Map is tagged private
+ with constant_Indexing => Constant_Reference,
+ Variable_Indexing => Reference,
+ Default_Iterator => Iterate,
+ Iterator_Element => Element_Type;
+
pragma Preelaborable_Initialization (Map);
type Cursor is private;
@@ -57,6 +63,10 @@ package Ada.Containers.Indefinite_Ordered_Maps is
Empty_Map : constant Map;
No_Element : constant Cursor;
+ function Has_Element (Position : Cursor) return Boolean;
+
+ package Map_Iterator_Interfaces is new
+ Ada.Iterator_Interfaces (Cursor, Has_Element);
function "=" (Left, Right : Map) return Boolean;
@@ -150,8 +160,6 @@ package Ada.Containers.Indefinite_Ordered_Maps is
function Contains (Container : Map; Key : Key_Type) return Boolean;
- function Has_Element (Position : Cursor) return Boolean;
-
function "<" (Left, Right : Cursor) return Boolean;
function ">" (Left, Right : Cursor) return Boolean;
@@ -164,6 +172,23 @@ package Ada.Containers.Indefinite_Ordered_Maps is
function ">" (Left : Key_Type; Right : Cursor) return Boolean;
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ type Reference_Type (Element : not null access Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ function Constant_Reference
+ (Container : Map;
+ Key : Key_Type) return Constant_Reference_Type;
+
+ function Reference
+ (Container : Map;
+ Key : Key_Type) return Reference_Type;
+
procedure Iterate
(Container : Map;
Process : not null access procedure (Position : Cursor));
@@ -172,6 +197,15 @@ package Ada.Containers.Indefinite_Ordered_Maps is
(Container : Map;
Process : not null access procedure (Position : Cursor));
+ function Iterate
+ (Container : Map)
+ return Map_Iterator_Interfaces.Forward_Iterator'class;
+
+ function Iterate
+ (Container : Map;
+ Start : Cursor)
+ return Map_Iterator_Interfaces.Reversible_Iterator'class;
+
private
pragma Inline (Next);
@@ -243,6 +277,36 @@ private
for Map'Read use Read;
+ type Constant_Reference_Type
+ (Element : not null access constant Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
+ type Reference_Type
+ (Element : not null access Element_Type) is null record;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
Empty_Map : constant Map :=
(Controlled with Tree => (First => null,
Last => null,
diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb
index 673cd510a3c..a330ed8b6c5 100644
--- a/gcc/ada/a-ciorse.adb
+++ b/gcc/ada/a-ciorse.adb
@@ -926,6 +926,50 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
raise Program_Error with "key was modified";
end Update_Element_Preserving_Key;
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Container = null then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return (Element => Position.Node.Element);
+ end Reference_Preserving_Key;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Container = null then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return (Element => Position.Node.Element);
+ end Reference_Preserving_Key;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
end Generic_Keys;
-----------------
@@ -1500,14 +1544,6 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
procedure Read
(Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type)
- is
- begin
- raise Program_Error with "attempt to stream reference";
- end Read;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type)
is
begin
@@ -1530,18 +1566,6 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
return (Element => Position.Node.Element.all'Access);
end Constant_Reference;
- function Reference (Container : Set; Position : Cursor)
- return Reference_Type
- is
- pragma Unreferenced (Container);
- begin
- if Position.Container = null then
- raise Constraint_Error with "Position cursor has no element";
- end if;
-
- return (Element => Position.Node.Element.all'Access);
- end Reference;
-
-------------
-- Replace --
-------------
@@ -1876,14 +1900,6 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
procedure Write
(Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type)
- is
- begin
- raise Program_Error with "attempt to stream reference";
- end Write;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
Item : Constant_Reference_Type)
is
begin
diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads
index 78b5d764b06..f397f1d464e 100644
--- a/gcc/ada/a-ciorse.ads
+++ b/gcc/ada/a-ciorse.ads
@@ -50,7 +50,6 @@ package Ada.Containers.Indefinite_Ordered_Sets is
type Set is tagged private with
Constant_Indexing => Constant_Reference,
- Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type;
@@ -73,6 +72,10 @@ package Ada.Containers.Indefinite_Ordered_Sets is
private with
Implicit_Dereference => Element;
+ function Constant_Reference
+ (Container : Set;
+ Position : Cursor) return Constant_Reference_Type;
+
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type);
@@ -85,30 +88,6 @@ package Ada.Containers.Indefinite_Ordered_Sets is
for Constant_Reference_Type'Write use Write;
- function Constant_Reference
- (Container : Set;
- Position : Cursor) return Constant_Reference_Type;
-
- type Reference_Type (Element : not null access Element_Type) is private
- with
- Implicit_Dereference => Element;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type);
-
- for Reference_Type'Write use Write;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type);
-
- for Reference_Type'Read use Read;
-
- function Reference
- (Container : Set; Position : Cursor)
- return Reference_Type;
-
function "=" (Left, Right : Set) return Boolean;
function Equivalent_Sets (Left, Right : Set) return Boolean;
@@ -212,13 +191,21 @@ package Ada.Containers.Indefinite_Ordered_Sets is
procedure Previous (Position : in out Cursor);
- function Find (Container : Set; Item : Element_Type) return Cursor;
+ function Find
+ (Container : Set;
+ Item : Element_Type) return Cursor;
- function Floor (Container : Set; Item : Element_Type) return Cursor;
+ function Floor
+ (Container : Set;
+ Item : Element_Type) return Cursor;
- function Ceiling (Container : Set; Item : Element_Type) return Cursor;
+ function Ceiling
+ (Container : Set;
+ Item : Element_Type) return Cursor;
- function Contains (Container : Set; Item : Element_Type) return Boolean;
+ function Contains
+ (Container : Set;
+ Item : Element_Type) return Boolean;
function "<" (Left, Right : Cursor) return Boolean;
@@ -295,10 +282,36 @@ package Ada.Containers.Indefinite_Ordered_Sets is
Process : not null access
procedure (Element : in out Element_Type));
+ type Reference_Type (Element : not null access Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type;
+
+ private
+ type Reference_Type
+ (Element : not null access Element_Type) is null record;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
end Generic_Keys;
private
-
pragma Inline (Next);
pragma Inline (Previous);
@@ -368,9 +381,6 @@ private
type Constant_Reference_Type
(Element : not null access constant Element_Type) is null record;
- type Reference_Type
- (Element : not null access Element_Type) is null record;
-
Empty_Set : constant Set :=
(Controlled with Tree => (First => null,
Last => null,
diff --git a/gcc/ada/a-comutr.adb b/gcc/ada/a-comutr.adb
index 17b70d4dc1b..0fcb3d6d51c 100644
--- a/gcc/ada/a-comutr.adb
+++ b/gcc/ada/a-comutr.adb
@@ -40,11 +40,28 @@ package body Ada.Containers.Multiway_Trees is
From_Root : Boolean;
end record;
+ type Child_Iterator is new Tree_Iterator_Interfaces.Reversible_Iterator with
+ record
+ Container : Tree_Access;
+ Position : Cursor;
+ end record;
+
overriding function First (Object : Iterator) return Cursor;
overriding function Next
(Object : Iterator;
Position : Cursor) return Cursor;
+ overriding function First (Object : Child_Iterator) return Cursor;
+ overriding function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor;
+
+ overriding function Last (Object : Child_Iterator) return Cursor;
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -912,6 +929,11 @@ package body Ada.Containers.Multiway_Trees is
return Object.Position;
end First;
+ function First (Object : Child_Iterator) return Cursor is
+ begin
+ return (Object.Container, Object.Position.Node.Children.First);
+ end First;
+
-----------------
-- First_Child --
-----------------
@@ -1348,19 +1370,14 @@ package body Ada.Containers.Multiway_Trees is
return Tree_Iterator_Interfaces.Forward_Iterator'Class
is
Root_Cursor : constant Cursor :=
- (Container'Unrestricted_Access, Root_Node (Container));
+ (Container'Unrestricted_Access, Root_Node (Container));
begin
return
Iterator'(Container'Unrestricted_Access,
- First_Child (Root_Cursor), From_Root => True);
+ First_Child (Root_Cursor),
+ From_Root => True);
end Iterate;
- function Iterate_Subtree (Position : Cursor)
- return Tree_Iterator_Interfaces.Forward_Iterator'Class is
- begin
- return Iterator'(Position.Container, Position, From_Root => False);
- end Iterate_Subtree;
-
----------------------
-- Iterate_Children --
----------------------
@@ -1417,10 +1434,28 @@ package body Ada.Containers.Multiway_Trees is
end loop;
end Iterate_Children;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class
+ is
+ pragma Unreferenced (Container);
+ begin
+ return Child_Iterator'(Parent.Container, Parent);
+ end Iterate_Children;
+
---------------------
-- Iterate_Subtree --
---------------------
+ function Iterate_Subtree
+ (Position : Cursor)
+ return Tree_Iterator_Interfaces.Forward_Iterator'Class
+ is
+ begin
+ return Iterator'(Position.Container, Position, From_Root => False);
+ end Iterate_Subtree;
+
procedure Iterate_Subtree
(Position : Cursor;
Process : not null access procedure (Position : Cursor))
@@ -1438,7 +1473,6 @@ package body Ada.Containers.Multiway_Trees is
if Is_Root (Position) then
Iterate_Children (Position.Container, Position.Node, Process);
-
else
Iterate_Subtree (Position.Container, Position.Node, Process);
end if;
@@ -1466,13 +1500,21 @@ package body Ada.Containers.Multiway_Trees is
Iterate_Children (Container, Subtree, Process);
end Iterate_Subtree;
+ ----------
+ -- Last --
+ ----------
+
+ overriding function Last (Object : Child_Iterator) return Cursor is
+ begin
+ return (Object.Container, Object.Position.Node.Children.Last);
+ end Last;
+
----------------
-- Last_Child --
----------------
function Last_Child (Parent : Cursor) return Cursor is
Node : Tree_Node_Access;
-
begin
if Parent = No_Element then
raise Constraint_Error with "Parent cursor has no element";
@@ -1586,13 +1628,27 @@ package body Ada.Containers.Multiway_Trees is
end if;
else
-
-- If an internal node, return its first child.
return (Object.Container, N.Children.First);
end if;
end Next;
+ function Next
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
+ C : constant Tree_Node_Access := Position.Node.Next;
+
+ begin
+ if C = null then
+ return No_Element;
+
+ else
+ return (Object.Container, C);
+ end if;
+ end Next;
+
------------------
-- Next_Sibling --
------------------
@@ -1712,6 +1768,25 @@ package body Ada.Containers.Multiway_Trees is
Container.Count := Container.Count + Count;
end Prepend_Child;
+ --------------
+ -- Previous --
+ --------------
+
+ overriding function Previous
+ (Object : Child_Iterator;
+ Position : Cursor) return Cursor
+ is
+ C : constant Tree_Node_Access := Position.Node.Prev;
+
+ begin
+ if C = null then
+ return No_Element;
+
+ else
+ return (Object.Container, C);
+ end if;
+ end Previous;
+
----------------------
-- Previous_Sibling --
----------------------
diff --git a/gcc/ada/a-comutr.ads b/gcc/ada/a-comutr.ads
index 00a78e3aebb..b035e1637fe 100644
--- a/gcc/ada/a-comutr.ads
+++ b/gcc/ada/a-comutr.ads
@@ -171,8 +171,8 @@ package Ada.Containers.Multiway_Trees is
Process : not null access procedure (Position : Cursor));
procedure Iterate_Subtree
- (Position : Cursor;
- Process : not null access procedure (Position : Cursor));
+ (Position : Cursor;
+ Process : not null access procedure (Position : Cursor));
function Iterate (Container : Tree)
return Tree_Iterator_Interfaces.Forward_Iterator'Class;
@@ -180,6 +180,11 @@ package Ada.Containers.Multiway_Trees is
function Iterate_Subtree (Position : Cursor)
return Tree_Iterator_Interfaces.Forward_Iterator'Class;
+ function Iterate_Children
+ (Container : Tree;
+ Parent : Cursor)
+ return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
+
function Child_Count (Parent : Cursor) return Count_Type;
function Child_Depth (Parent, Child : Cursor) return Count_Type;
@@ -442,13 +447,11 @@ private
function Constant_Reference
(Container : aliased Tree;
- Position : Cursor)
- return Constant_Reference_Type;
+ Position : Cursor) return Constant_Reference_Type;
function Reference
(Container : aliased Tree;
- Position : Cursor)
- return Reference_Type;
+ Position : Cursor) return Reference_Type;
Empty_Tree : constant Tree := (Controlled with others => <>);
diff --git a/gcc/ada/a-coorma.ads b/gcc/ada/a-coorma.ads
index 1beea7bbff5..6fd45b78253 100644
--- a/gcc/ada/a-coorma.ads
+++ b/gcc/ada/a-coorma.ads
@@ -183,34 +183,10 @@ package Ada.Containers.Ordered_Maps is
with
Implicit_Dereference => Element;
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Constant_Reference_Type);
-
- for Constant_Reference_Type'Read use Read;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Constant_Reference_Type);
-
- for Constant_Reference_Type'Write use Write;
-
type Reference_Type (Element : not null access Element_Type) is private
with
Implicit_Dereference => Element;
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type);
-
- for Reference_Type'Read use Read;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type);
-
- for Reference_Type'Write use Write;
-
function Constant_Reference
(Container : Map;
Key : Key_Type) -- SHOULD BE ALIASED???
@@ -308,6 +284,30 @@ private
type Reference_Type
(Element : not null access Element_Type) is null record;
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Constant_Reference_Type);
+
+ for Constant_Reference_Type'Read use Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Constant_Reference_Type);
+
+ for Constant_Reference_Type'Write use Write;
+
Empty_Map : constant Map :=
(Controlled with Tree => (First => null,
Last => null,
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb
index 7465f930b1f..d52ed67c9a0 100644
--- a/gcc/ada/a-coorse.adb
+++ b/gcc/ada/a-coorse.adb
@@ -860,6 +860,50 @@ package body Ada.Containers.Ordered_Sets is
raise Program_Error with "key was modified";
end Update_Element_Preserving_Key;
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Container = null then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return (Element => Position.Node.Element'Access);
+ end Reference_Preserving_Key;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type
+ is
+ Position : constant Cursor := Find (Container, Key);
+
+ begin
+ if Position.Container = null then
+ raise Constraint_Error with "Position cursor has no element";
+ end if;
+
+ return (Element => Position.Node.Element'Access);
+ end Reference_Preserving_Key;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Read;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type)
+ is
+ begin
+ raise Program_Error with "attempt to stream reference";
+ end Write;
+
end Generic_Keys;
-----------------
@@ -1412,14 +1456,6 @@ package body Ada.Containers.Ordered_Sets is
procedure Read
(Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type)
- is
- begin
- raise Program_Error with "attempt to stream reference";
- end Read;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type)
is
begin
@@ -1442,18 +1478,6 @@ package body Ada.Containers.Ordered_Sets is
return (Element => Position.Node.Element'Access);
end Constant_Reference;
- function Reference (Container : Set; Position : Cursor)
- return Reference_Type
- is
- pragma Unreferenced (Container);
- begin
- if Position.Container = null then
- raise Constraint_Error with "Position cursor has no element";
- end if;
-
- return (Element => Position.Node.Element'Access);
- end Reference;
-
-------------
-- Replace --
-------------
@@ -1771,14 +1795,6 @@ package body Ada.Containers.Ordered_Sets is
procedure Write
(Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type)
- is
- begin
- raise Program_Error with "attempt to stream reference";
- end Write;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
Item : Constant_Reference_Type)
is
begin
diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads
index 21eb7197779..8349ef85fb4 100644
--- a/gcc/ada/a-coorse.ads
+++ b/gcc/ada/a-coorse.ads
@@ -50,11 +50,9 @@ package Ada.Containers.Ordered_Sets is
function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
type Set is tagged private
- with
- Constant_Indexing => Constant_Reference,
- Variable_Indexing => Reference,
- Default_Iterator => Iterate,
- Iterator_Element => Element_Type;
+ with Constant_Indexing => Constant_Reference,
+ Default_Iterator => Iterate,
+ Iterator_Element => Element_Type;
pragma Preelaborable_Initialization (Set);
@@ -67,18 +65,6 @@ package Ada.Containers.Ordered_Sets is
No_Element : constant Cursor;
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Cursor);
-
- for Cursor'Write use Write;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Cursor);
-
- for Cursor'Read use Read;
-
package Ordered_Set_Iterator_Interfaces is new
Ada.Iterator_Interfaces (Cursor, Has_Element);
@@ -104,26 +90,6 @@ package Ada.Containers.Ordered_Sets is
for Constant_Reference_Type'Read use Read;
- type Reference_Type (Element : not null access Element_Type) is private
- with
- Implicit_Dereference => Element;
-
- procedure Write
- (Stream : not null access Root_Stream_Type'Class;
- Item : Reference_Type);
-
- for Reference_Type'Write use Write;
-
- procedure Read
- (Stream : not null access Root_Stream_Type'Class;
- Item : out Reference_Type);
-
- for Reference_Type'Read use Read;
-
- function Reference
- (Container : Set; Position : Cursor)
- return Reference_Type;
-
function "=" (Left, Right : Set) return Boolean;
function Equivalent_Sets (Left, Right : Set) return Boolean;
@@ -302,6 +268,33 @@ package Ada.Containers.Ordered_Sets is
Process : not null access
procedure (Element : in out Element_Type));
+ type Reference_Type (Element : not null access Element_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Constant_Reference_Type;
+
+ function Reference_Preserving_Key
+ (Container : aliased in out Set;
+ Key : Key_Type) return Reference_Type;
+
+ private
+ type Reference_Type
+ (Element : not null access Element_Type) is null record;
+
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Reference_Type);
+
+ for Reference_Type'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Reference_Type);
+
+ for Reference_Type'Read use Read;
end Generic_Keys;
private
@@ -343,6 +336,18 @@ private
Node : Node_Access;
end record;
+ procedure Write
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : Cursor);
+
+ for Cursor'Write use Write;
+
+ procedure Read
+ (Stream : not null access Root_Stream_Type'Class;
+ Item : out Cursor);
+
+ for Cursor'Read use Read;
+
No_Element : constant Cursor := Cursor'(null, null);
procedure Write
@@ -360,9 +365,6 @@ private
type Constant_Reference_Type
(Element : not null access constant Element_Type) is null record;
- type Reference_Type
- (Element : not null access Element_Type) is null record;
-
Empty_Set : constant Set :=
(Controlled with Tree => (First => null,
Last => null,
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 0d2322afa6f..e07d70e47be 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -1879,7 +1879,7 @@ package body Checks is
Arr_Typ := Get_Actual_Subtype_If_Available (Arr);
if Is_Access_Type (Arr_Typ) then
- Arr_Typ := Directly_Designated_Type (Arr_Typ);
+ Arr_Typ := Designated_Type (Arr_Typ);
end if;
end if;
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 2e565b94054..b3eb5cfd8e8 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -121,7 +121,7 @@ package body Debug is
-- d.A Read/write Aspect_Specifications hash table to tree
-- d.B
-- d.C Generate concatenation call, do not generate inline code
- -- d.D
+ -- d.D Strict Alfa mode
-- d.E Force Alfa mode for gnat2why
-- d.F Alfa mode
-- d.G Precondition only mode for gnat2why
@@ -580,6 +580,9 @@ package body Debug is
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code.
+ -- d.D Strict Alfa mode. Interpret compiler permissions as strictly as
+ -- possible in Alfa mode.
+
-- d.E Force Alfa mode for gnat2why. In this mode, errors are issued for
-- all violations of Alfa in user code, and warnings are issued for
-- constructs not yet implemented in gnat2why.
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index c366e0274b3..93d914fd855 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -817,10 +817,11 @@ package Einfo is
-- Present in access types. This field points to the type that is
-- directly designated by the access type. In the case of an access
-- type to an incomplete type, this field references the incomplete
--- type. Note that in the semantic processing, what is useful in
--- nearly all cases is the full type designated by the access type.
--- The function Designated_Type obtains this full type in the case of
--- access to an incomplete type.
+-- type. Directly_Designated_Type is typically used in implementing the
+-- static semantics of the language; in implementing dynamic semantics,
+-- we typically want the full view of the designated type. The function
+-- Designated_Type obtains this full type in the case of access to an
+-- incomplete type.
-- Discard_Names (Flag88)
-- Present in types and exception entities. Set if pragma Discard_Names
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 82b73188b26..d06d8b9fb54 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -229,6 +229,11 @@ package body Exp_Aggr is
-- Packed_Array_Aggregate_Handled, we set this parameter to True, since
-- these are cases we handle in there.
+ -- It would seem worthwhile to have a higher default value for Max_Others_
+ -- replicate, but aggregates in the compiler make this impossible: the
+ -- compiler bootstrap fails if Max_Others_Replicate is greater than 25.
+ -- This is unexpected ???
+
procedure Expand_Array_Aggregate (N : Node_Id);
-- This is the top-level routine to perform array aggregate expansion.
-- N is the N_Aggregate node to be expanded.
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 5b9d4f8f608..fc70238aedb 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -71,8 +71,7 @@ package body Exp_Ch9 is
-- types with defaulted discriminant of an integer type, when the bound
-- of some entry family depends on a discriminant. The limitation to
-- entry families of 128K should be reasonable in all cases, and is a
- -- documented implementation restriction. It will be lifted when protected
- -- entry families are re-implemented as a single ordered queue.
+ -- documented implementation restriction.
Entry_Family_Bound : constant Int := 2**16;
@@ -1690,7 +1689,7 @@ package body Exp_Ch9 is
-- The parameter that designates the synchronized object in the call
Actuals : constant List_Id := New_List;
- -- the actuals in the entry call.
+ -- The actuals in the entry call
Decls : constant List_Id := New_List;
@@ -3008,7 +3007,7 @@ package body Exp_Ch9 is
raise Program_Error;
end case;
- -- Establish link between subprogram body entity and source entry.
+ -- Establish link between subprogram body entity and source entry
Set_Corresponding_Protected_Entry (Edef, Ent);
@@ -3243,6 +3242,7 @@ package body Exp_Ch9 is
Stmts : List_Id;
Object_Parm : Node_Id;
Exc_Safe : Boolean;
+ Lock_Kind : RE_Id;
function Is_Exception_Safe (Subprogram : Node_Id) return Boolean;
-- Tell whether a given subprogram cannot raise an exception
@@ -3389,12 +3389,16 @@ package body Exp_Ch9 is
Parameter_Associations => Uactuals));
end if;
+ Lock_Kind := RE_Lock_Read_Only;
+
else
Unprot_Call :=
Make_Procedure_Call_Statement (Loc,
Name =>
Make_Identifier (Loc, Chars (Defining_Unit_Name (N_Op_Spec))),
Parameter_Associations => Uactuals);
+
+ Lock_Kind := RE_Lock;
end if;
-- Wrap call in block that will be covered by an at_end handler
@@ -3419,7 +3423,7 @@ package body Exp_Ch9 is
Service_Name := New_Reference_To (RTE (RE_Service_Entry), Loc);
when System_Tasking_Protected_Objects =>
- Lock_Name := New_Reference_To (RTE (RE_Lock), Loc);
+ Lock_Name := New_Reference_To (RTE (Lock_Kind), Loc);
Service_Name := New_Reference_To (RTE (RE_Unlock), Loc);
when others =>
@@ -8332,7 +8336,7 @@ package body Exp_Ch9 is
Insert_After (Current_Node, Sub);
Analyze (Sub);
- -- build wrapper procedure for pre/postconditions.
+ -- Build wrapper procedure for pre/postconditions
Build_PPC_Wrapper (Comp_Id, N);
@@ -10610,29 +10614,34 @@ package body Exp_Ch9 is
Make_Defining_Identifier (Sloc (Tasktyp),
Chars => New_External_Name (Tasknm, 'Z')));
- if Present (Taskdef) and then Has_Storage_Size_Pragma (Taskdef) and then
- Is_Static_Expression (Expression (First (
- Pragma_Argument_Associations (Find_Task_Or_Protected_Pragma (
- Taskdef, Name_Storage_Size)))))
+ if Present (Taskdef)
+ and then Has_Storage_Size_Pragma (Taskdef)
+ and then
+ Is_Static_Expression
+ (Expression
+ (First (Pragma_Argument_Associations
+ (Find_Task_Or_Protected_Pragma
+ (Taskdef, Name_Storage_Size)))))
then
Size_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Storage_Size_Variable (Tasktyp),
- Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
- Expression =>
+ Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
+ Expression =>
Convert_To (RTE (RE_Size_Type),
- Relocate_Node (
- Expression (First (
- Pragma_Argument_Associations (
- Find_Task_Or_Protected_Pragma
- (Taskdef, Name_Storage_Size)))))));
+ Relocate_Node
+ (Expression (First (Pragma_Argument_Associations
+ (Find_Task_Or_Protected_Pragma
+ (Taskdef, Name_Storage_Size)))))));
else
Size_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Storage_Size_Variable (Tasktyp),
- Object_Definition => New_Reference_To (RTE (RE_Size_Type), Loc),
- Expression => New_Reference_To (RTE (RE_Unspecified_Size), Loc));
+ Object_Definition =>
+ New_Reference_To (RTE (RE_Size_Type), Loc),
+ Expression =>
+ New_Reference_To (RTE (RE_Unspecified_Size), Loc));
end if;
Insert_After (Elab_Decl, Size_Decl);
@@ -10645,7 +10654,7 @@ package body Exp_Ch9 is
Append_To (Cdecls,
Make_Component_Declaration (Loc,
- Defining_Identifier =>
+ Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uTask_Id),
Component_Definition =>
Make_Component_Definition (Loc,
@@ -10666,8 +10675,8 @@ package body Exp_Ch9 is
Make_Component_Definition (Loc,
Aliased_Present => True,
Subtype_Indication => Make_Subtype_Indication (Loc,
- Subtype_Mark => New_Occurrence_Of
- (RTE (RE_Ada_Task_Control_Block), Loc),
+ Subtype_Mark =>
+ New_Occurrence_Of (RTE (RE_Ada_Task_Control_Block), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index f857d0e82c4..4a59b2a6343 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -11075,7 +11075,6 @@ package body Exp_Dist is
function RPC_Receiver_Decl (RACW_Type : Entity_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (RACW_Type);
-
begin
return
Make_Object_Declaration (Loc,
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 34901abafd4..295006a29c3 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -5912,30 +5912,77 @@ package body Exp_Util is
-- We do NOT exclude dereferences of access-to-constant types because
-- we handle them as constant view of variables.
- -- Exception is an access to an entity that is a constant or an
- -- in-parameter.
-
elsif Nkind (Prefix (N)) = N_Explicit_Dereference
and then Variable_Ref
then
- declare
- DDT : constant Entity_Id :=
- Designated_Type (Etype (Prefix (Prefix (N))));
- begin
- return Ekind_In (DDT, E_Constant, E_In_Parameter);
- end;
-
- -- The following test is the simplest way of solving a complex
- -- problem uncovered by BB08-010: Side effect on loop bound that
- -- is a subcomponent of a global variable:
-
- -- If a loop bound is a subcomponent of a global variable, a
- -- modification of that variable within the loop may incorrectly
- -- affect the execution of the loop.
+ return False;
- elsif not
- (Nkind (Parent (Parent (N))) /= N_Loop_Parameter_Specification
- or else not Within_In_Parameter (Prefix (N)))
+ -- Note: The following test is the simplest way of solving a complex
+ -- problem uncovered by the following test (Side effect on loop bound
+ -- that is a subcomponent of a global variable:
+
+ -- with Text_Io; use Text_Io;
+ -- procedure Tloop is
+ -- type X is
+ -- record
+ -- V : Natural := 4;
+ -- S : String (1..5) := (others => 'a');
+ -- end record;
+ -- X1 : X;
+
+ -- procedure Modi;
+
+ -- generic
+ -- with procedure Action;
+ -- procedure Loop_G (Arg : X; Msg : String)
+
+ -- procedure Loop_G (Arg : X; Msg : String) is
+ -- begin
+ -- Put_Line ("begin loop_g " & Msg & " will loop till: "
+ -- & Natural'Image (Arg.V));
+ -- for Index in 1 .. Arg.V loop
+ -- Text_Io.Put_Line
+ -- (Natural'Image (Index) & " " & Arg.S (Index));
+ -- if Index > 2 then
+ -- Modi;
+ -- end if;
+ -- end loop;
+ -- Put_Line ("end loop_g " & Msg);
+ -- end;
+
+ -- procedure Loop1 is new Loop_G (Modi);
+ -- procedure Modi is
+ -- begin
+ -- X1.V := 1;
+ -- Loop1 (X1, "from modi");
+ -- end;
+ --
+ -- begin
+ -- Loop1 (X1, "initial");
+ -- end;
+
+ -- The output of the above program should be:
+
+ -- begin loop_g initial will loop till: 4
+ -- 1 a
+ -- 2 a
+ -- 3 a
+ -- begin loop_g from modi will loop till: 1
+ -- 1 a
+ -- end loop_g from modi
+ -- 4 a
+ -- begin loop_g from modi will loop till: 1
+ -- 1 a
+ -- end loop_g from modi
+ -- end loop_g initial
+
+ -- If a loop bound is a subcomponent of a global variable, a
+ -- modification of that variable within the loop may incorrectly
+ -- affect the execution of the loop.
+
+ elsif Nkind (Parent (Parent (N))) = N_Loop_Parameter_Specification
+ and then Within_In_Parameter (Prefix (N))
+ and then Variable_Ref
then
return False;
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 50dd0b751ab..9f25fc26d92 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1811,20 +1811,19 @@ ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/exp_alfa.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
- ada/exp_alfa.ads ada/exp_alfa.adb ada/exp_attr.ads ada/exp_ch6.ads \
- ada/exp_dbug.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \
- ada/interfac.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
- ada/nlists.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \
- ada/sem_aux.ads ada/sem_aux.adb ada/sem_res.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/exp_alfa.ads ada/exp_alfa.adb ada/exp_attr.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_dbug.ads ada/gnat.ads ada/g-htable.ads \
+ ada/hostparm.ads ada/interfac.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/rtsfind.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_res.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads \
- ada/exp_ch4.ads
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/exp_atag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 6f8cf3b4beb..a6c54e8d81d 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -597,7 +597,6 @@ ifeq ($(strip $(filter-out powerpc% e500v2 wrs vxworksae,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
g-io.adb<g-io-vxworks-ppc-cert.adb \
- g-io.ads<g-io-vxworks-ppc-cert.ads \
s-inmaop.adb<s-inmaop-vxworks.adb \
s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
@@ -660,7 +659,6 @@ ifeq ($(strip $(filter-out e500% powerpc% wrs vxworksmils,$(targ))),)
a-intnam.ads<a-intnam-vxworks.ads \
a-numaux.ads<a-numaux-vxworks.ads \
g-io.adb<g-io-vxworks-ppc-cert.adb \
- g-io.ads<g-io-vxworks-ppc-cert.ads \
s-inmaop.adb<s-inmaop-vxworks.adb \
s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
@@ -715,7 +713,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworksae vxworksmils,$(targ))),)
a-sytaco.ads<1asytaco.ads \
a-sytaco.adb<1asytaco.adb \
g-io.adb<g-io-vxworks-ppc-cert.adb \
- g-io.ads<g-io-vxworks-ppc-cert.ads \
s-inmaop.adb<s-inmaop-vxworks.adb \
s-interr.adb<s-interr-hwint.adb \
s-intman.ads<s-intman-vxworks.ads \
@@ -1115,62 +1112,36 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
s-intman.adb<s-intman-posix.adb \
s-tpopsp.adb<s-tpopsp-tls.adb \
g-sercom.adb<g-sercom-linux.adb \
+ a-exetim.adb<a-exetim-posix.adb \
+ a-exetim.ads<a-exetim-default.ads \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ system.ads<system-linux-x86.ads \
$(ATOMICS_TARGET_PAIRS) \
$(X86_TARGET_PAIRS)
- ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
+ ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS += \
- a-exetim.adb<a-exetim-linux-marte.adb \
- a-exetim.ads<a-exetim-linux-marte.ads \
- a-extiti.adb<a-extiti-linux-marte.adb \
- a-extiti.ads<a-extiti-linux-marte.ads \
- a-rttiev.adb<a-rttiev-linux-marte.adb \
- a-rttiev.ads<a-rttiev-linux-marte.ads \
- s-osinte.adb<s-osinte-linux-marte.adb \
- s-osinte.ads<s-osinte-linux-marte.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux-marte.adb \
- s-taspri.ads<s-taspri-posix.ads \
- system.ads<system-linux-x86.ads
-
- EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
-
- EH_MECHANISM=
- THREADSLIB = -lmarte
+ s-osinte.ads<s-osinte-linux-xenomai.ads \
+ s-osprim.adb<s-osprim-linux-xenomai.adb \
+ s-taprop.adb<s-taprop-linux-xenomai.adb \
+ s-taspri.ads<s-taspri-linux-xenomai.ads
else
LIBGNAT_TARGET_PAIRS += \
- a-exetim.adb<a-exetim-posix.adb \
- a-exetim.ads<a-exetim-default.ads \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- system.ads<system-linux-x86.ads
-
- ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.ads<s-osinte-linux-xenomai.ads \
- s-osprim.adb<s-osprim-linux-xenomai.adb \
- s-taprop.adb<s-taprop-linux-xenomai.adb \
- s-taspri.ads<s-taspri-linux-xenomai.ads
-
- EH_MECHANISM=-gcc
- else
- LIBGNAT_TARGET_PAIRS += \
- s-mudido.adb<s-mudido-affinity.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads
-
- EH_MECHANISM=-gcc
- endif
-
- THREADSLIB = -lpthread -lrt
- EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
+ s-mudido.adb<s-mudido-affinity.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads
endif
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread -lrt
+ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
+
TOOLS_TARGET_PAIRS = \
mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
@@ -2019,7 +1990,7 @@ ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
TOOLS_TARGET_PAIRS = \
mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-linux.adb
-
+
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
MISCLIB=
@@ -2164,22 +2135,24 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
endif
ifeq ($(strip $(filter-out darwin%,$(osys))),)
- SO_OPTS = -Wl,-flat_namespace -shared-libgcc
- ifeq ($(strip $(filter-out %86,$(arch))),)
- LIBGNAT_TARGET_PAIRS = \
+ SO_OPTS = -shared-libgcc
+ LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-darwin.ads \
i-forbla.adb<i-forbla-darwin.adb \
s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-susv3.adb \
s-osinte.adb<s-osinte-darwin.adb \
s-osinte.ads<s-osinte-darwin.ads \
- s-osprim.adb<s-osprim-darwin.adb \
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
g-trasym.ads<g-trasym-unimplemented.ads \
- g-trasym.adb<g-trasym-unimplemented.adb \
- $(ATOMICS_TARGET_PAIRS)
+ g-trasym.adb<g-trasym-unimplemented.adb
+
+ ifeq ($(strip $(filter-out %86,$(arch))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-intman.adb<s-intman-susv3.adb \
+ s-osprim.adb<s-osprim-darwin.adb \
+ $(ATOMICS_TARGET_PAIRS)
ifeq ($(strip $(MULTISUBDIR)),/x86_64)
LIBGNAT_TARGET_PAIRS += \
@@ -2194,20 +2167,10 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
endif
ifeq ($(strip $(filter-out %x86_64,$(arch))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-darwin.ads \
- i-forbla.adb<i-forbla-darwin.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-susv3.adb \
- s-osinte.adb<s-osinte-darwin.adb \
- s-osinte.ads<s-osinte-darwin.ads \
- s-osprim.adb<s-osprim-darwin.adb \
- s-taprop.adb<s-taprop-posix.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-trasym.ads<g-trasym-unimplemented.ads \
- g-trasym.adb<g-trasym-unimplemented.adb \
- $(ATOMICS_TARGET_PAIRS)
+ LIBGNAT_TARGET_PAIRS += \
+ s-intman.adb<s-intman-susv3.adb \
+ s-osprim.adb<s-osprim-darwin.adb \
+ $(ATOMICS_TARGET_PAIRS)
ifeq ($(strip $(MULTISUBDIR)),/i386)
LIBGNAT_TARGET_PAIRS += \
@@ -2222,21 +2185,11 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
endif
ifeq ($(strip $(filter-out powerpc%,$(arch))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-darwin.ads \
- i-forbla.adb<i-forbla-darwin.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-darwin.adb \
- s-osinte.ads<s-osinte-darwin.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-posix.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- a-numaux.ads<a-numaux-darwin.ads \
- a-numaux.adb<a-numaux-darwin.adb \
- g-trasym.ads<g-trasym-unimplemented.ads \
- g-trasym.adb<g-trasym-unimplemented.adb
+ LIBGNAT_TARGET_PAIRS += \
+ s-intman.adb<s-intman-posix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ a-numaux.ads<a-numaux-darwin.ads \
+ a-numaux.adb<a-numaux-darwin.adb
ifeq ($(strip $(MULTISUBDIR)),/ppc64)
LIBGNAT_TARGET_PAIRS += \
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 2d0e6e4945e..d10fcf0ad92 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -275,7 +275,8 @@ do { \
/* For an INTEGER_TYPE with TYPE_MODULAR_P, this is the value of the
modulus. */
-#define TYPE_MODULUS(NODE) GET_TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+#define TYPE_MODULUS(NODE) \
+ GET_TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
#define SET_TYPE_MODULUS(NODE, X) \
SET_TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE), X)
@@ -301,6 +302,13 @@ do { \
#define SET_TYPE_ACTUAL_BOUNDS(NODE, X) \
SET_TYPE_LANG_SPECIFIC (TREE_CHECK2 (NODE, INTEGER_TYPE, ARRAY_TYPE), X)
+/* For a POINTER_TYPE that points to the template type of an unconstrained
+ array type, this is the address to be used in a null fat pointer. */
+#define TYPE_NULL_BOUNDS(NODE) \
+ GET_TYPE_LANG_SPECIFIC (POINTER_TYPE_CHECK (NODE))
+#define SET_TYPE_NULL_BOUNDS(NODE, X) \
+ SET_TYPE_LANG_SPECIFIC (POINTER_TYPE_CHECK (NODE), X)
+
/* For a RECORD_TYPE that is a fat pointer, this is the type for the
unconstrained object. Likewise for a RECORD_TYPE that is pointed
to by a thin pointer. */
@@ -344,6 +352,9 @@ do { \
is needed to access the object. */
#define DECL_BY_REF_P(NODE) DECL_LANG_FLAG_1 (NODE)
+/* Nonzero in a DECL if it is made for a pointer that can never be null. */
+#define DECL_CAN_NEVER_BE_NULL_P(NODE) DECL_LANG_FLAG_2 (NODE)
+
/* Nonzero in a FIELD_DECL that is a dummy built for some internal reason. */
#define DECL_INTERNAL_P(NODE) DECL_LANG_FLAG_3 (FIELD_DECL_CHECK (NODE))
@@ -356,7 +367,7 @@ do { \
DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (NODE))
/* Nonzero in a DECL if it is made for a pointer that points to something which
- is readonly. Used mostly for fat pointers. */
+ is readonly. */
#define DECL_POINTS_TO_READONLY_P(NODE) DECL_LANG_FLAG_4 (NODE)
/* Nonzero in a PARM_DECL if we are to pass by descriptor. */
@@ -426,6 +437,15 @@ do { \
SET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE), X)
+/* Flags added to ref nodes. */
+
+/* Nonzero means this node will not trap. */
+#undef TREE_THIS_NOTRAP
+#define TREE_THIS_NOTRAP(NODE) \
+ (TREE_CHECK4 (NODE, INDIRECT_REF, ARRAY_REF, UNCONSTRAINED_ARRAY_REF, \
+ ARRAY_RANGE_REF)->base.nothrow_flag)
+
+
/* Fields and macros for statements. */
#define IS_ADA_STMT(NODE) \
(STATEMENT_CLASS_P (NODE) && TREE_CODE (NODE) >= STMT_STMT)
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index a6bfd37c41f..98d68fe01a6 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -817,16 +817,30 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& No (Address_Clause (gnat_entity))))
&& TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST)
{
- /* No point in jumping through all the hoops needed in order
+ unsigned int size_cap, align_cap;
+
+ /* No point in promoting the alignment if this doesn't prevent
+ BLKmode access to the object, in particular block copy, as
+ this will for example disable the NRV optimization for it.
+ No point in jumping through all the hoops needed in order
to support BIGGEST_ALIGNMENT if we don't really have to.
So we cap to the smallest alignment that corresponds to
a known efficient memory access pattern of the target. */
- unsigned int align_cap = Is_Atomic (gnat_entity)
- ? BIGGEST_ALIGNMENT
- : get_mode_alignment (ptr_mode);
+ if (Is_Atomic (gnat_entity))
+ {
+ size_cap = UINT_MAX;
+ align_cap = BIGGEST_ALIGNMENT;
+ }
+ else
+ {
+ size_cap = MAX_FIXED_MODE_SIZE;
+ align_cap = get_mode_alignment (ptr_mode);
+ }
if (!host_integerp (TYPE_SIZE (gnu_type), 1)
- || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0)
+ || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0)
+ align = 0;
+ else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0)
align = align_cap;
else
align = ceil_alignment (tree_low_cst (TYPE_SIZE (gnu_type), 1));
@@ -1403,6 +1417,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnat_entity);
DECL_BY_REF_P (gnu_decl) = used_by_ref;
DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag;
+ DECL_CAN_NEVER_BE_NULL_P (gnu_decl) = Can_Never_Be_Null (gnat_entity);
/* If we are defining an Out parameter and optimization isn't enabled,
create a fake PARM_DECL for debugging purposes and make it point to
@@ -1995,6 +2010,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_template_reference
= build_unary_op (INDIRECT_REF, gnu_template_type, tem);
TREE_READONLY (gnu_template_reference) = 1;
+ TREE_THIS_NOTRAP (gnu_template_reference) = 1;
/* Now create the GCC type for each index and add the fields for that
index to the template. */
@@ -3498,8 +3514,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
fill it in later. */
if (!definition && defer_incomplete_level != 0)
{
- struct incomplete *p
- = (struct incomplete *) xmalloc (sizeof (struct incomplete));
+ struct incomplete *p = XNEW (struct incomplete);
gnu_type
= build_pointer_type
@@ -3824,15 +3839,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
case E_Access_Subtype:
/* We treat this as identical to its base type; any constraint is
- meaningful only to the front end.
+ meaningful only to the front-end.
The designated type must be elaborated as well, if it does
not have its own freeze node. Designated (sub)types created
for constrained components of records with discriminants are
- not frozen by the front end and thus not elaborated by gigi,
+ not frozen by the front-end and thus not elaborated by gigi,
because their use may appear before the base type is frozen,
and because it is not clear that they are needed anywhere in
- Gigi. With the current model, there is no correct place where
+ gigi. With the current model, there is no correct place where
they could be elaborated. */
gnu_type = gnat_to_gnu_type (Etype (gnat_entity));
@@ -3846,20 +3861,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
elaborate it later. */
if (!definition && defer_incomplete_level != 0)
{
- struct incomplete *p
- = (struct incomplete *) xmalloc (sizeof (struct incomplete));
- tree gnu_ptr_type
- = build_pointer_type
- (make_dummy_type (Directly_Designated_Type (gnat_entity)));
+ struct incomplete *p = XNEW (struct incomplete);
- p->old_type = TREE_TYPE (gnu_ptr_type);
+ p->old_type
+ = make_dummy_type (Directly_Designated_Type (gnat_entity));
p->full_type = Directly_Designated_Type (gnat_entity);
p->next = defer_incomplete_list;
defer_incomplete_list = p;
}
else if (!IN (Ekind (Base_Type
- (Directly_Designated_Type (gnat_entity))),
- Incomplete_Or_Private_Kind))
+ (Directly_Designated_Type (gnat_entity))),
+ Incomplete_Or_Private_Kind))
gnat_to_gnu_entity (Directly_Designated_Type (gnat_entity),
NULL_TREE, 0);
}
@@ -5557,6 +5569,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
mech == By_Short_Descriptor);
DECL_POINTS_TO_READONLY_P (gnu_param)
= (ro_param && (by_ref || by_component_ptr));
+ DECL_CAN_NEVER_BE_NULL_P (gnu_param) = Can_Never_Be_Null (gnat_param);
/* Save the alternate descriptor type, if any. */
if (gnu_param_type_alt)
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 2614eb25c8c..30fa99e96d5 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -671,7 +671,7 @@ extern tree create_label_decl (tree label_name);
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
- PARM_DECL nodes chained through the TREE_CHAIN field).
+ PARM_DECL nodes chained through the DECL_CHAIN field).
INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 27e240226c0..71e659e265f 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -218,6 +218,7 @@ static bool set_end_locus_from_node (tree, Node_Id);
static void set_gnu_expr_location_from_node (tree, Node_Id);
static int lvalue_required_p (Node_Id, tree, bool, bool, bool);
static tree build_raise_check (int, enum exception_info_kind);
+static tree create_init_temporary (const char *, tree, tree *, Node_Id);
/* Hooks for debug info back-ends, only supported and used in a restricted set
of configurations. */
@@ -539,7 +540,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
tree field
= create_field_decl (NULL_TREE, ptr_void_ftype, fdesc_type_node,
NULL_TREE, NULL_TREE, 0, 1);
- TREE_CHAIN (field) = field_list;
+ DECL_CHAIN (field) = field_list;
field_list = field;
elt->index = field;
elt->value = null_node;
@@ -988,8 +989,8 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
&& DECL_BY_COMPONENT_PTR_P (gnu_result))))
{
const bool read_only = DECL_POINTS_TO_READONLY_P (gnu_result);
- tree renamed_obj;
+ /* First do the first dereference if needed. */
if (TREE_CODE (gnu_result) == PARM_DECL
&& DECL_BY_DOUBLE_REF_P (gnu_result))
{
@@ -998,42 +999,37 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
TREE_THIS_NOTRAP (gnu_result) = 1;
}
+ /* If it's a PARM_DECL to foreign convention subprogram, convert it. */
if (TREE_CODE (gnu_result) == PARM_DECL
&& DECL_BY_COMPONENT_PTR_P (gnu_result))
- {
- gnu_result
- = build_unary_op (INDIRECT_REF, NULL_TREE,
- convert (build_pointer_type (gnu_result_type),
- gnu_result));
- if (TREE_CODE (gnu_result) == INDIRECT_REF)
- TREE_THIS_NOTRAP (gnu_result) = 1;
- }
+ gnu_result
+ = convert (build_pointer_type (gnu_result_type), gnu_result);
+
+ /* If it's a CONST_DECL, return the underlying constant like below. */
+ else if (TREE_CODE (gnu_result) == CONST_DECL)
+ gnu_result = DECL_INITIAL (gnu_result);
/* If it's a renaming pointer and we are at the right binding level,
we can reference the renamed object directly, since the renamed
expression has been protected against multiple evaluations. */
- else if (TREE_CODE (gnu_result) == VAR_DECL
- && (renamed_obj = DECL_RENAMED_OBJECT (gnu_result))
- && (!DECL_RENAMING_GLOBAL_P (gnu_result)
- || global_bindings_p ()))
- gnu_result = renamed_obj;
-
- /* Return the underlying CST for a CONST_DECL like a few lines below,
- after dereferencing in this case. */
- else if (TREE_CODE (gnu_result) == CONST_DECL)
- gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE,
- DECL_INITIAL (gnu_result));
+ if (TREE_CODE (gnu_result) == VAR_DECL
+ && DECL_RENAMED_OBJECT (gnu_result)
+ && (!DECL_RENAMING_GLOBAL_P (gnu_result) || global_bindings_p ()))
+ gnu_result = DECL_RENAMED_OBJECT (gnu_result);
+ /* Otherwise, do the final dereference. */
else
{
gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
- if (TREE_CODE (gnu_result) == INDIRECT_REF
+
+ if ((TREE_CODE (gnu_result) == INDIRECT_REF
+ || TREE_CODE (gnu_result) == UNCONSTRAINED_ARRAY_REF)
&& No (Address_Clause (gnat_temp)))
TREE_THIS_NOTRAP (gnu_result) = 1;
- }
- if (read_only)
- TREE_READONLY (gnu_result) = 1;
+ if (read_only)
+ TREE_READONLY (gnu_result) = 1;
+ }
}
/* The GNAT tree has the type of a function as the type of its result. Also
@@ -1056,6 +1052,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
&& DECL_P (gnu_result)
&& DECL_INITIAL (gnu_result)
&& !(AGGREGATE_TYPE_P (TREE_TYPE (gnu_result))
+ && !TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_result))
&& type_contains_placeholder_p (TREE_TYPE (gnu_result))))
{
bool constant_only = (TREE_CODE (gnu_result) == CONST_DECL
@@ -1289,7 +1286,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
+ TARGET_VTABLE_USES_DESCRIPTORS - 1);
for (gnu_field = TYPE_FIELDS (gnu_result_type), i = 0;
i < TARGET_VTABLE_USES_DESCRIPTORS;
- gnu_field = TREE_CHAIN (gnu_field), i++)
+ gnu_field = DECL_CHAIN (gnu_field), i++)
{
if (build_descriptor)
{
@@ -1423,7 +1420,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
{
gnu_type = TYPE_OBJECT_RECORD_TYPE (gnu_type);
if (attribute != Attr_Max_Size_In_Storage_Elements)
- gnu_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
+ gnu_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
}
/* If we're looking for the size of a field, return the field size.
@@ -1596,11 +1593,26 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* Make sure any implicit dereference gets done. */
gnu_prefix = maybe_implicit_deref (gnu_prefix);
gnu_prefix = maybe_unconstrained_array (gnu_prefix);
+
/* We treat unconstrained array In parameters specially. */
- if (Nkind (Prefix (gnat_node)) == N_Identifier
- && !Is_Constrained (Etype (Prefix (gnat_node)))
- && Ekind (Entity (Prefix (gnat_node))) == E_In_Parameter)
- gnat_param = Entity (Prefix (gnat_node));
+ if (!Is_Constrained (Etype (Prefix (gnat_node))))
+ {
+ Node_Id gnat_prefix = Prefix (gnat_node);
+
+ /* This is the direct case. */
+ if (Nkind (gnat_prefix) == N_Identifier
+ && Ekind (Entity (gnat_prefix)) == E_In_Parameter)
+ gnat_param = Entity (gnat_prefix);
+
+ /* This is the indirect case. Note that we need to be sure that
+ the access value cannot be null as we'll hoist the load. */
+ if (Nkind (gnat_prefix) == N_Explicit_Dereference
+ && Nkind (Prefix (gnat_prefix)) == N_Identifier
+ && Ekind (Entity (Prefix (gnat_prefix))) == E_In_Parameter
+ && Can_Never_Be_Null (Entity (Prefix (gnat_prefix))))
+ gnat_param = Entity (Prefix (gnat_prefix));
+ }
+
gnu_type = TREE_TYPE (gnu_prefix);
prefix_unused = true;
gnu_result_type = get_unpadded_type (Etype (gnat_node));
@@ -2161,8 +2173,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
tree gnu_loop_stmt = build4 (LOOP_STMT, void_type_node, NULL_TREE,
NULL_TREE, NULL_TREE, NULL_TREE);
tree gnu_loop_label = create_artificial_label (input_location);
- tree gnu_loop_var = NULL_TREE, gnu_cond_expr = NULL_TREE;
- tree gnu_result;
+ tree gnu_cond_expr = NULL_TREE, gnu_result;
/* Set location information for statement and end label. */
set_expr_location_from_node (gnu_loop_stmt, gnat_node);
@@ -2196,9 +2207,9 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
tree gnu_high = TYPE_MAX_VALUE (gnu_type);
tree gnu_base_type = get_base_type (gnu_type);
tree gnu_one_node = convert (gnu_base_type, integer_one_node);
- tree gnu_first, gnu_last;
+ tree gnu_loop_var, gnu_loop_iv, gnu_first, gnu_last, gnu_stmt;
enum tree_code update_code, test_code, shift_code;
- bool reverse = Reverse_Present (gnat_loop_spec), fallback = false;
+ bool reverse = Reverse_Present (gnat_loop_spec), use_iv = false;
/* We must disable modulo reduction for the iteration variable, if any,
in order for the loop comparison to be effective. */
@@ -2222,8 +2233,8 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
/* We use two different strategies to translate the loop, depending on
whether optimization is enabled.
- If it is, we try to generate the canonical form of loop expected by
- the loop optimizer, which is the do-while form:
+ If it is, we generate the canonical loop form expected by the loop
+ optimizer and the loop vectorizer, which is the do-while form:
ENTRY_COND
loop:
@@ -2232,10 +2243,12 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
BOTTOM_COND
GOTO loop
- This makes it possible to bypass loop header copying and to turn the
- BOTTOM_COND into an inequality test. This should catch (almost) all
- loops with constant starting point. If we cannot, we try to generate
- the default form, which is:
+ This avoids an implicit dependency on loop header copying and makes
+ it possible to turn BOTTOM_COND into an inequality test.
+
+ If optimization is disabled, loop header copying doesn't come into
+ play and we try to generate the loop form with the fewer conditional
+ branches. First, the default form, which is:
loop:
TOP_COND
@@ -2243,53 +2256,54 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
BOTTOM_UPDATE
GOTO loop
- It will be rotated during loop header copying and an entry test added
- to yield the do-while form. This should catch (almost) all loops with
- constant ending point. If we cannot, we generate the fallback form:
+ It should catch most loops with constant ending point. Then, if we
+ cannot, we try to generate the shifted form:
- ENTRY_COND
loop:
+ TOP_COND
+ TOP_UPDATE
BODY
- BOTTOM_COND
- BOTTOM_UPDATE
GOTO loop
- which works in all cases but for which loop header copying will copy
- the BOTTOM_COND, thus adding a third conditional branch.
-
- If optimization is disabled, loop header copying doesn't come into
- play and we try to generate the loop forms with the less conditional
- branches directly. First, the default form, it should catch (almost)
- all loops with constant ending point. Then, if we cannot, we try to
- generate the shifted form:
+ which should catch loops with constant starting point. Otherwise, if
+ we cannot, we generate the fallback form:
+ ENTRY_COND
loop:
- TOP_COND
- TOP_UPDATE
BODY
+ BOTTOM_COND
+ BOTTOM_UPDATE
GOTO loop
- which should catch loops with constant starting point. Otherwise, if
- we cannot, we generate the fallback form. */
+ which works in all cases. */
if (optimize)
{
- /* We can use the do-while form if GNU_FIRST-1 doesn't overflow. */
+ /* We can use the do-while form directly if GNU_FIRST-1 doesn't
+ overflow. */
if (!can_equal_min_val_p (gnu_first, gnu_base_type, reverse))
- {
- gnu_first = build_binary_op (shift_code, gnu_base_type,
- gnu_first, gnu_one_node);
- LOOP_STMT_TOP_UPDATE_P (gnu_loop_stmt) = 1;
- LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1;
- }
-
- /* Otherwise, we can use the default form if GNU_LAST+1 doesn't. */
- else if (!can_equal_max_val_p (gnu_last, gnu_base_type, reverse))
;
- /* Otherwise, use the fallback form. */
+ /* Otherwise, use the do-while form with the help of a special
+ induction variable in the (unsigned version of) the base
+ type, in order to have wrap-around arithmetics for it. */
else
- fallback = true;
+ {
+ if (!TYPE_UNSIGNED (gnu_base_type))
+ {
+ gnu_base_type = gnat_unsigned_type (gnu_base_type);
+ gnu_first = convert (gnu_base_type, gnu_first);
+ gnu_last = convert (gnu_base_type, gnu_last);
+ gnu_one_node = convert (gnu_base_type, integer_one_node);
+ }
+ use_iv = true;
+ }
+
+ gnu_first
+ = build_binary_op (shift_code, gnu_base_type, gnu_first,
+ gnu_one_node);
+ LOOP_STMT_TOP_UPDATE_P (gnu_loop_stmt) = 1;
+ LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1;
}
else
{
@@ -2302,21 +2316,20 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
else if (!can_equal_min_val_p (gnu_first, gnu_base_type, reverse)
&& !can_equal_min_val_p (gnu_last, gnu_base_type, reverse))
{
- gnu_first = build_binary_op (shift_code, gnu_base_type,
- gnu_first, gnu_one_node);
- gnu_last = build_binary_op (shift_code, gnu_base_type,
- gnu_last, gnu_one_node);
+ gnu_first
+ = build_binary_op (shift_code, gnu_base_type, gnu_first,
+ gnu_one_node);
+ gnu_last
+ = build_binary_op (shift_code, gnu_base_type, gnu_last,
+ gnu_one_node);
LOOP_STMT_TOP_UPDATE_P (gnu_loop_stmt) = 1;
}
/* Otherwise, use the fallback form. */
else
- fallback = true;
+ LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1;
}
- if (fallback)
- LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt) = 1;
-
/* If we use the BOTTOM_COND, we can turn the test into an inequality
test but we may have to add ENTRY_COND to protect the empty loop. */
if (LOOP_STMT_BOTTOM_COND_P (gnu_loop_stmt))
@@ -2338,6 +2351,19 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
start_stmt_group ();
gnat_pushlevel ();
+ /* If we use the special induction variable, create it and set it to
+ its initial value. Morever, the regular iteration variable cannot
+ itself be initialized, lest the initial value wrapped around. */
+ if (use_iv)
+ {
+ gnu_loop_iv
+ = create_init_temporary ("I", gnu_first, &gnu_stmt, gnat_loop_var);
+ add_stmt (gnu_stmt);
+ gnu_first = NULL_TREE;
+ }
+ else
+ gnu_loop_iv = NULL_TREE;
+
/* Declare the iteration variable and set it to its initial value. */
gnu_loop_var = gnat_to_gnu_entity (gnat_loop_var, gnu_first, 1);
if (DECL_BY_REF_P (gnu_loop_var))
@@ -2347,18 +2373,42 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
gnu_loop_var = convert (gnu_base_type, gnu_loop_var);
/* Set either the top or bottom exit condition. */
- LOOP_STMT_COND (gnu_loop_stmt)
- = build_binary_op (test_code, boolean_type_node, gnu_loop_var,
- gnu_last);
+ if (use_iv)
+ LOOP_STMT_COND (gnu_loop_stmt)
+ = build_binary_op (test_code, boolean_type_node, gnu_loop_iv,
+ gnu_last);
+ else
+ LOOP_STMT_COND (gnu_loop_stmt)
+ = build_binary_op (test_code, boolean_type_node, gnu_loop_var,
+ gnu_last);
/* Set either the top or bottom update statement and give it the source
location of the iteration for better coverage info. */
- LOOP_STMT_UPDATE (gnu_loop_stmt)
- = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_loop_var,
- build_binary_op (update_code, gnu_base_type,
- gnu_loop_var, gnu_one_node));
- set_expr_location_from_node (LOOP_STMT_UPDATE (gnu_loop_stmt),
- gnat_iter_scheme);
+ if (use_iv)
+ {
+ gnu_stmt
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_loop_iv,
+ build_binary_op (update_code, gnu_base_type,
+ gnu_loop_iv, gnu_one_node));
+ set_expr_location_from_node (gnu_stmt, gnat_iter_scheme);
+ append_to_statement_list (gnu_stmt,
+ &LOOP_STMT_UPDATE (gnu_loop_stmt));
+ gnu_stmt
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_loop_var,
+ gnu_loop_iv);
+ set_expr_location_from_node (gnu_stmt, gnat_iter_scheme);
+ append_to_statement_list (gnu_stmt,
+ &LOOP_STMT_UPDATE (gnu_loop_stmt));
+ }
+ else
+ {
+ gnu_stmt
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_loop_var,
+ build_binary_op (update_code, gnu_base_type,
+ gnu_loop_var, gnu_one_node));
+ set_expr_location_from_node (gnu_stmt, gnat_iter_scheme);
+ LOOP_STMT_UPDATE (gnu_loop_stmt) = gnu_stmt;
+ }
}
/* If the loop was named, have the name point to this loop. In this case,
@@ -2372,9 +2422,9 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
= build_stmt_group (Statements (gnat_node), true);
TREE_SIDE_EFFECTS (gnu_loop_stmt) = 1;
- /* If we declared a variable, then we are in a statement group for that
- declaration. Add the LOOP_STMT to it and make that the "loop". */
- if (gnu_loop_var)
+ /* If we have an iteration scheme, then we are in a statement group. Add
+ the LOOP_STMT to it, finish it and make it the "loop". */
+ if (Present (gnat_iter_scheme) && No (Condition (gnat_iter_scheme)))
{
add_stmt (gnu_loop_stmt);
gnat_poplevel ();
@@ -2517,8 +2567,8 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
for (gnu_stub_param = DECL_ARGUMENTS (gnu_stub_decl),
gnu_subprog_param = DECL_ARGUMENTS (gnu_subprog);
gnu_stub_param;
- gnu_stub_param = TREE_CHAIN (gnu_stub_param),
- gnu_subprog_param = TREE_CHAIN (gnu_subprog_param))
+ gnu_stub_param = DECL_CHAIN (gnu_stub_param),
+ gnu_subprog_param = DECL_CHAIN (gnu_subprog_param))
{
if (DECL_BY_DESCRIPTOR_P (gnu_stub_param))
{
@@ -4645,7 +4695,7 @@ gnat_to_gnu (Node_Id gnat_node)
if (TREE_CODE (gnu_result_type) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (gnu_result_type))
gnu_aggr_type
- = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_result_type)));
+ = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_result_type)));
else if (TREE_CODE (gnu_result_type) == VECTOR_TYPE)
gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type);
@@ -5794,7 +5844,6 @@ gnat_to_gnu (Node_Id gnat_node)
{
const int reason = UI_To_Int (Reason (gnat_node));
const Node_Id cond = Condition (gnat_node);
- bool handled = false;
if (type_annotate_only)
{
@@ -5807,65 +5856,58 @@ gnat_to_gnu (Node_Id gnat_node)
if (Exception_Extra_Info
&& !No_Exception_Handlers_Set ()
&& !get_exception_label (kind)
- && TREE_CODE (gnu_result_type) == VOID_TYPE
+ && VOID_TYPE_P (gnu_result_type)
&& Present (cond))
- {
- if (reason == CE_Access_Check_Failed)
- {
- gnu_result = build_call_raise_column (reason, gnat_node);
- handled = true;
- }
- else if ((reason == CE_Index_Check_Failed
- || reason == CE_Range_Check_Failed
- || reason == CE_Invalid_Data)
- && Nkind (cond) == N_Op_Not
- && Nkind (Right_Opnd (cond)) == N_In
- && Nkind (Right_Opnd (Right_Opnd (cond))) == N_Range)
- {
- Node_Id op = Right_Opnd (cond); /* N_In node */
- Node_Id index = Left_Opnd (op);
- Node_Id type = Etype (index);
+ switch (reason)
+ {
+ case CE_Access_Check_Failed:
+ gnu_result = build_call_raise_column (reason, gnat_node);
+ break;
- if (Is_Type (type)
- && Known_Esize (type)
- && UI_To_Int (Esize (type)) <= 32)
- {
- Node_Id right_op = Right_Opnd (op);
+ case CE_Index_Check_Failed:
+ case CE_Range_Check_Failed:
+ case CE_Invalid_Data:
+ if (Nkind (cond) == N_Op_Not
+ && Nkind (Right_Opnd (cond)) == N_In
+ && Nkind (Right_Opnd (Right_Opnd (cond))) == N_Range)
+ {
+ Node_Id op = Right_Opnd (cond); /* N_In node */
+ Node_Id index = Left_Opnd (op);
+ Node_Id range = Right_Opnd (op);
+ Node_Id type = Etype (index);
+ if (Is_Type (type)
+ && Known_Esize (type)
+ && UI_To_Int (Esize (type)) <= 32)
gnu_result
- = build_call_raise_range
- (reason, gnat_node,
- gnat_to_gnu (index), /* index */
- gnat_to_gnu (Low_Bound (right_op)), /* first */
- gnat_to_gnu (High_Bound (right_op))); /* last */
- handled = true;
- }
- }
+ = build_call_raise_range (reason, gnat_node,
+ gnat_to_gnu (index),
+ gnat_to_gnu
+ (Low_Bound (range)),
+ gnat_to_gnu
+ (High_Bound (range)));
+ }
+ break;
+
+ default:
+ break;
}
- if (handled)
+ if (gnu_result == error_mark_node)
+ gnu_result = build_call_raise (reason, gnat_node, kind);
+
+ set_expr_location_from_node (gnu_result, gnat_node);
+
+ /* If the type is VOID, this is a statement, so we need to generate
+ the code for the call. Handle a condition, if there is one. */
+ if (VOID_TYPE_P (gnu_result_type))
{
- set_expr_location_from_node (gnu_result, gnat_node);
- gnu_result = build3 (COND_EXPR, void_type_node,
- gnat_to_gnu (cond),
- gnu_result, alloc_stmt_list ());
+ if (Present (cond))
+ gnu_result
+ = build3 (COND_EXPR, void_type_node, gnat_to_gnu (cond),
+ gnu_result, alloc_stmt_list ());
}
else
- {
- gnu_result = build_call_raise (reason, gnat_node, kind);
-
- /* If the type is VOID, this is a statement, so we need to generate
- the code for the call. Handle a Condition, if there is one. */
- if (TREE_CODE (gnu_result_type) == VOID_TYPE)
- {
- set_expr_location_from_node (gnu_result, gnat_node);
- if (Present (cond))
- gnu_result = build3 (COND_EXPR, void_type_node,
- gnat_to_gnu (cond),
- gnu_result, alloc_stmt_list ());
- }
- else
- gnu_result = build1 (NULL_EXPR, gnu_result_type, gnu_result);
- }
+ gnu_result = build1 (NULL_EXPR, gnu_result_type, gnu_result);
}
break;
@@ -7686,24 +7728,21 @@ process_type (Entity_Id gnat_entity)
}
}
-/* GNAT_ENTITY is the type of the resulting constructors,
- GNAT_ASSOC is the front of the Component_Associations of an N_Aggregate,
- and GNU_TYPE is the GCC type of the corresponding record.
-
- Return a CONSTRUCTOR to build the record. */
+/* GNAT_ENTITY is the type of the resulting constructor, GNAT_ASSOC is the
+ front of the Component_Associations of an N_Aggregate and GNU_TYPE is the
+ GCC type of the corresponding record type. Return the CONSTRUCTOR. */
static tree
assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
{
- tree gnu_list, gnu_result;
+ tree gnu_list = NULL_TREE, gnu_result;
/* We test for GNU_FIELD being empty in the case where a variant
was the last thing since we don't take things off GNAT_ASSOC in
that case. We check GNAT_ASSOC in case we have a variant, but it
has no fields. */
- for (gnu_list = NULL_TREE; Present (gnat_assoc);
- gnat_assoc = Next (gnat_assoc))
+ for (; Present (gnat_assoc); gnat_assoc = Next (gnat_assoc))
{
Node_Id gnat_field = First (Choices (gnat_assoc));
tree gnu_field = gnat_to_gnu_field_decl (Entity (gnat_field));
@@ -7720,8 +7759,8 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
continue;
/* Also ignore discriminants of Unchecked_Unions. */
- else if (Is_Unchecked_Union (gnat_entity)
- && Ekind (Entity (gnat_field)) == E_Discriminant)
+ if (Is_Unchecked_Union (gnat_entity)
+ && Ekind (Entity (gnat_field)) == E_Discriminant)
continue;
/* Before assigning a value in an aggregate make sure range checks
@@ -7738,13 +7777,9 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
gnu_result = extract_values (gnu_list, gnu_type);
#ifdef ENABLE_CHECKING
- {
- tree gnu_field;
-
- /* Verify every entry in GNU_LIST was used. */
- for (gnu_field = gnu_list; gnu_field; gnu_field = TREE_CHAIN (gnu_field))
- gcc_assert (TREE_ADDRESSABLE (gnu_field));
- }
+ /* Verify that every entry in GNU_LIST was used. */
+ for (; gnu_list; gnu_list = TREE_CHAIN (gnu_list))
+ gcc_assert (TREE_ADDRESSABLE (gnu_list));
#endif
return gnu_result;
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 0176c3ea0c4..feae636dece 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1391,10 +1391,14 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
bool static_flag, bool const_decl_allowed_p,
struct attrib *attr_list, Node_Id gnat_node)
{
+ /* Whether the initializer is a constant initializer. At the global level
+ or for an external object or an object to be allocated in static memory,
+ we check that it is a valid constant expression for use in initializing
+ a static variable; otherwise, we only check that it is constant. */
bool init_const
= (var_init != 0
&& gnat_types_compatible_p (type, TREE_TYPE (var_init))
- && (global_bindings_p () || static_flag
+ && (global_bindings_p () || extern_flag || static_flag
? initializer_constant_valid_p (var_init, TREE_TYPE (var_init)) != 0
: TREE_CONSTANT (var_init)));
@@ -1460,6 +1464,7 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
section which runs afoul of the PE-COFF run-time relocation mechanism. */
if (extern_flag
&& constant_p
+ && var_init
&& initializer_constant_valid_p (var_init, TREE_TYPE (var_init))
!= null_pointer_node)
DECL_IGNORED_P (var_decl) = 1;
@@ -1856,7 +1861,7 @@ create_label_decl (tree label_name)
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
- PARM_DECL nodes chained through the TREE_CHAIN field).
+ PARM_DECL nodes chained through the DECL_CHAIN field).
INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
@@ -3034,10 +3039,10 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
- tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
+ tree p_bounds_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type);
- tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
+ tree max_field = DECL_CHAIN (TYPE_FIELDS (template_type));
tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
@@ -3074,11 +3079,11 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* If so, there is already a template in the descriptor and
it is located right after the POINTER field. The fields are
64bits so they must be repacked. */
- t = TREE_CHAIN (pointer);
+ t = DECL_CHAIN (pointer);
lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
@@ -3086,7 +3091,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Build the template in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2);
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield);
- CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (template_type)),
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (template_type)),
ufield);
template_tree = gnat_build_constructor (template_type, v);
@@ -3104,7 +3109,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the next field in the descriptor after
aflags. */
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */
@@ -3126,7 +3131,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
@@ -3188,10 +3193,10 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
- tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
+ tree p_bounds_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type);
- tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
+ tree max_field = DECL_CHAIN (TYPE_FIELDS (template_type));
tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
@@ -3226,7 +3231,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
u = build_binary_op (EQ_EXPR, boolean_type_node, t, u);
/* If so, there is already a template in the descriptor and
it is located right after the POINTER field. */
- t = TREE_CHAIN (pointer);
+ t = DECL_CHAIN (pointer);
template_tree
= build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Otherwise use the {1, LENGTH} template we build above. */
@@ -3241,7 +3246,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (pointer)));
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the 8th field in the descriptor. */
- t = TREE_CHAIN (t);
+ t = DECL_CHAIN (t);
dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */
@@ -3489,7 +3494,11 @@ update_pointer_to (tree old_type, tree new_type)
/* Now adjust them. */
for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
for (t = TYPE_MAIN_VARIANT (ptr); t; t = TYPE_NEXT_VARIANT (t))
- TREE_TYPE (t) = new_type;
+ {
+ TREE_TYPE (t) = new_type;
+ if (TYPE_NULL_BOUNDS (t))
+ TREE_TYPE (TREE_OPERAND (TYPE_NULL_BOUNDS (t), 0)) = new_type;
+ }
/* If we have adjusted named types, finalize them. This is necessary
since we had forced a DWARF typedef for them in gnat_pushdecl. */
@@ -3560,16 +3569,36 @@ convert_to_fat_pointer (tree type, tree expr)
tree template_tree;
VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 2);
- /* If EXPR is null, make a fat pointer that contains null pointers to the
- template and array. */
+ /* If EXPR is null, make a fat pointer that contains a null pointer to the
+ array (compare_fat_pointers ensures that this is the full discriminant)
+ and a valid pointer to the bounds. This latter property is necessary
+ since the compiler can hoist the load of the bounds done through it. */
if (integer_zerop (expr))
{
+ tree ptr_template_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type)));
+ tree null_bounds, t;
+
+ if (TYPE_NULL_BOUNDS (ptr_template_type))
+ null_bounds = TYPE_NULL_BOUNDS (ptr_template_type);
+ else
+ {
+ /* The template type can still be dummy at this point so we build an
+ empty constructor. The middle-end will fill it in with zeros. */
+ t = build_constructor (template_type, NULL);
+ TREE_CONSTANT (t) = TREE_STATIC (t) = 1;
+ null_bounds = build_unary_op (ADDR_EXPR, NULL_TREE, t);
+ SET_TYPE_NULL_BOUNDS (ptr_template_type, null_bounds);
+ }
+
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type),
- convert (p_array_type, expr));
- CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)),
- convert (build_pointer_type (template_type),
- expr));
- return gnat_build_constructor (type, v);
+ fold_convert (p_array_type, null_pointer_node));
+ CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)), null_bounds);
+ t = build_constructor (type, v);
+ /* Do not set TREE_CONSTANT so as to force T to static memory. */
+ TREE_CONSTANT (t) = 0;
+ TREE_STATIC (t) = 1;
+
+ return t;
}
/* If EXPR is a thin pointer, make template and data from the record.. */
@@ -3790,8 +3819,7 @@ convert (tree type, tree expr)
return gnat_build_constructor (type, v);
}
- /* There are some special cases of expressions that we process
- specially. */
+ /* There are some cases of expressions that we process specially. */
switch (TREE_CODE (expr))
{
case ERROR_MARK:
@@ -3947,14 +3975,8 @@ convert (tree type, tree expr)
break;
case UNCONSTRAINED_ARRAY_REF:
- /* Convert this to the type of the inner array by getting the address of
- the array from the template. */
- expr = TREE_OPERAND (expr, 0);
- expr = build_unary_op (INDIRECT_REF, NULL_TREE,
- build_component_ref (expr, NULL_TREE,
- TYPE_FIELDS
- (TREE_TYPE (expr)),
- false));
+ /* First retrieve the underlying array. */
+ expr = maybe_unconstrained_array (expr);
etype = TREE_TYPE (expr);
ecode = TREE_CODE (etype);
break;
@@ -3992,8 +4014,9 @@ convert (tree type, tree expr)
&& !TYPE_IS_FAT_POINTER_P (etype))
return convert (type, op0);
}
+
+ break;
}
- break;
default:
break;
@@ -4241,72 +4264,77 @@ tree
maybe_unconstrained_array (tree exp)
{
enum tree_code code = TREE_CODE (exp);
+ tree type = TREE_TYPE (exp);
- switch (TREE_CODE (TREE_TYPE (exp)))
+ switch (TREE_CODE (type))
{
case UNCONSTRAINED_ARRAY_TYPE:
if (code == UNCONSTRAINED_ARRAY_REF)
{
const bool read_only = TREE_READONLY (exp);
+ const bool no_trap = TREE_THIS_NOTRAP (exp);
+
exp = TREE_OPERAND (exp, 0);
+ type = TREE_TYPE (exp);
+
if (TREE_CODE (exp) == COND_EXPR)
{
tree op1
= build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (exp, 1),
NULL_TREE,
- TYPE_FIELDS
- (TREE_TYPE (exp)),
+ TYPE_FIELDS (type),
false));
tree op2
= build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (exp, 2),
NULL_TREE,
- TYPE_FIELDS
- (TREE_TYPE (exp)),
+ TYPE_FIELDS (type),
false));
exp = build3 (COND_EXPR,
- TREE_TYPE (TREE_TYPE (TYPE_FIELDS
- (TREE_TYPE (exp)))),
+ TREE_TYPE (TREE_TYPE (TYPE_FIELDS (type))),
TREE_OPERAND (exp, 0), op1, op2);
}
else
- exp = build_unary_op (INDIRECT_REF, NULL_TREE,
- build_component_ref (exp, NULL_TREE,
- TYPE_FIELDS
- (TREE_TYPE (exp)),
- false));
- TREE_READONLY (exp) = read_only;
- return exp;
+ {
+ exp = build_unary_op (INDIRECT_REF, NULL_TREE,
+ build_component_ref (exp, NULL_TREE,
+ TYPE_FIELDS (type),
+ false));
+ TREE_READONLY (exp) = read_only;
+ TREE_THIS_NOTRAP (exp) = no_trap;
+ }
}
else if (code == NULL_EXPR)
- return build1 (NULL_EXPR,
- TREE_TYPE (TREE_TYPE (TYPE_FIELDS
- (TREE_TYPE (TREE_TYPE (exp))))),
- TREE_OPERAND (exp, 0));
+ exp = build1 (NULL_EXPR,
+ TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (type)))),
+ TREE_OPERAND (exp, 0));
+ break;
case RECORD_TYPE:
- /* If this is a padded type, convert to the unpadded type and see if
- it contains a template. */
- if (TYPE_PADDING_P (TREE_TYPE (exp)))
+ /* If this is a padded type and it contains a template, convert to the
+ unpadded type first. */
+ if (TYPE_PADDING_P (type)
+ && TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == RECORD_TYPE
+ && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (TYPE_FIELDS (type))))
{
- tree new_exp
- = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
- if (TREE_CODE (TREE_TYPE (new_exp)) == RECORD_TYPE
- && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new_exp)))
- return
- build_component_ref (new_exp, NULL_TREE,
- DECL_CHAIN
- (TYPE_FIELDS (TREE_TYPE (new_exp))),
- false);
+ exp = convert (TREE_TYPE (TYPE_FIELDS (type)), exp);
+ type = TREE_TYPE (exp);
+ }
+
+ if (TYPE_CONTAINS_TEMPLATE_P (type))
+ {
+ exp = build_component_ref (exp, NULL_TREE,
+ DECL_CHAIN (TYPE_FIELDS (type)),
+ false);
+ type = TREE_TYPE (exp);
+
+ /* If the array type is padded, convert to the unpadded type. */
+ if (TYPE_IS_PADDING_P (type))
+ exp = convert (TREE_TYPE (TYPE_FIELDS (type)), exp);
}
- else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))
- return
- build_component_ref (exp, NULL_TREE,
- DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))),
- false);
break;
default:
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 87cb269a140..cf290a397b1 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -420,6 +420,80 @@ compare_arrays (location_t loc, tree result_type, tree a1, tree a2)
return result;
}
+
+/* Return an expression tree representing an equality comparison of P1 and P2,
+ two objects of fat pointer type. The result should be of type RESULT_TYPE.
+
+ Two fat pointers are equal in one of two ways: (1) if both have a null
+ pointer to the array or (2) if they contain the same couple of pointers.
+ We perform the comparison in as efficient a manner as possible. */
+
+static tree
+compare_fat_pointers (location_t loc, tree result_type, tree p1, tree p2)
+{
+ tree p1_array, p2_array, p1_bounds, p2_bounds, same_array, same_bounds;
+ tree p1_array_is_null, p2_array_is_null;
+
+ /* If either operand has side-effects, they have to be evaluated only once
+ in spite of the multiple references to the operand in the comparison. */
+ p1 = gnat_protect_expr (p1);
+ p2 = gnat_protect_expr (p2);
+
+ /* The constant folder doesn't fold fat pointer types so we do it here. */
+ if (TREE_CODE (p1) == CONSTRUCTOR)
+ p1_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 0)->value;
+ else
+ p1_array = build_component_ref (p1, NULL_TREE,
+ TYPE_FIELDS (TREE_TYPE (p1)), true);
+
+ p1_array_is_null
+ = fold_build2_loc (loc, EQ_EXPR, result_type, p1_array,
+ fold_convert_loc (loc, TREE_TYPE (p1_array),
+ null_pointer_node));
+
+ if (TREE_CODE (p2) == CONSTRUCTOR)
+ p2_array = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 0)->value;
+ else
+ p2_array = build_component_ref (p2, NULL_TREE,
+ TYPE_FIELDS (TREE_TYPE (p2)), true);
+
+ p2_array_is_null
+ = fold_build2_loc (loc, EQ_EXPR, result_type, p2_array,
+ fold_convert_loc (loc, TREE_TYPE (p2_array),
+ null_pointer_node));
+
+ /* If one of the pointers to the array is null, just compare the other. */
+ if (integer_zerop (p1_array))
+ return p2_array_is_null;
+ else if (integer_zerop (p2_array))
+ return p1_array_is_null;
+
+ /* Otherwise, do the fully-fledged comparison. */
+ same_array
+ = fold_build2_loc (loc, EQ_EXPR, result_type, p1_array, p2_array);
+
+ if (TREE_CODE (p1) == CONSTRUCTOR)
+ p1_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p1), 1)->value;
+ else
+ p1_bounds
+ = build_component_ref (p1, NULL_TREE,
+ DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (p1))), true);
+
+ if (TREE_CODE (p2) == CONSTRUCTOR)
+ p2_bounds = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (p2), 1)->value;
+ else
+ p2_bounds
+ = build_component_ref (p2, NULL_TREE,
+ DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (p2))), true);
+
+ same_bounds
+ = fold_build2_loc (loc, EQ_EXPR, result_type, p1_bounds, p2_bounds);
+
+ /* P1_ARRAY == P2_ARRAY && (P1_ARRAY == NULL || P1_BOUNDS == P2_BOUNDS). */
+ return build_binary_op (TRUTH_ANDIF_EXPR, result_type, same_array,
+ build_binary_op (TRUTH_ORIF_EXPR, result_type,
+ p1_array_is_null, same_bounds));
+}
/* Compute the result of applying OP_CODE to LHS and RHS, where both are of
type TYPE. We know that TYPE is a modular type with a nonbinary
@@ -848,19 +922,18 @@ build_binary_op (enum tree_code op_code, tree result_type,
right_operand = convert (right_base_type, right_operand);
}
- /* If we are comparing a fat pointer against zero, we just need to
- compare the data pointer. */
- if (TYPE_IS_FAT_POINTER_P (left_base_type)
- && TREE_CODE (right_operand) == CONSTRUCTOR
- && integer_zerop (VEC_index (constructor_elt,
- CONSTRUCTOR_ELTS (right_operand),
- 0)->value))
+ /* If both objects are fat pointers, compare them specially. */
+ if (TYPE_IS_FAT_POINTER_P (left_base_type))
{
- left_operand
- = build_component_ref (left_operand, NULL_TREE,
- TYPE_FIELDS (left_base_type), false);
- right_operand
- = convert (TREE_TYPE (left_operand), integer_zero_node);
+ result
+ = compare_fat_pointers (input_location,
+ result_type, left_operand, right_operand);
+ if (op_code == NE_EXPR)
+ result = invert_truthvalue_loc (EXPR_LOCATION (result), result);
+ else
+ gcc_assert (op_code == EQ_EXPR);
+
+ return result;
}
modulus = NULL_TREE;
@@ -1000,7 +1073,6 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
tree base_type = get_base_type (type);
tree operation_type = result_type;
tree result;
- bool side_effects = false;
if (operation_type
&& TREE_CODE (operation_type) == RECORD_TYPE
@@ -1204,40 +1276,60 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
break;
case INDIRECT_REF:
- /* If we want to refer to an unconstrained array, use the appropriate
- expression to do so. This will never survive down to the back-end.
- But if TYPE is a thin pointer, first convert to a fat pointer. */
- if (TYPE_IS_THIN_POINTER_P (type)
- && TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
- {
- operand
- = convert (TREE_TYPE (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))),
+ {
+ bool can_never_be_null;
+ tree t = operand;
+
+ while (CONVERT_EXPR_P (t) || TREE_CODE (t) == VIEW_CONVERT_EXPR)
+ t = TREE_OPERAND (t, 0);
+
+ can_never_be_null = DECL_P (t) && DECL_CAN_NEVER_BE_NULL_P (t);
+
+ /* If TYPE is a thin pointer, first convert to the fat pointer. */
+ if (TYPE_IS_THIN_POINTER_P (type)
+ && TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
+ {
+ operand = convert
+ (TREE_TYPE (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))),
operand);
- type = TREE_TYPE (operand);
- }
+ type = TREE_TYPE (operand);
+ }
- if (TYPE_IS_FAT_POINTER_P (type))
- {
- result = build1 (UNCONSTRAINED_ARRAY_REF,
- TYPE_UNCONSTRAINED_ARRAY (type), operand);
- TREE_READONLY (result)
- = TYPE_READONLY (TYPE_UNCONSTRAINED_ARRAY (type));
- }
+ /* If we want to refer to an unconstrained array, use the appropriate
+ expression. But this will never survive down to the back-end. */
+ if (TYPE_IS_FAT_POINTER_P (type))
+ {
+ result = build1 (UNCONSTRAINED_ARRAY_REF,
+ TYPE_UNCONSTRAINED_ARRAY (type), operand);
+ TREE_READONLY (result)
+ = TYPE_READONLY (TYPE_UNCONSTRAINED_ARRAY (type));
+ }
- /* If we are dereferencing an ADDR_EXPR, return its operand. */
- else if (TREE_CODE (operand) == ADDR_EXPR)
- result = TREE_OPERAND (operand, 0);
+ /* If we are dereferencing an ADDR_EXPR, return its operand. */
+ else if (TREE_CODE (operand) == ADDR_EXPR)
+ result = TREE_OPERAND (operand, 0);
- /* Otherwise, build and fold the indirect reference. */
- else
- {
- result = build_fold_indirect_ref (operand);
- TREE_READONLY (result) = TYPE_READONLY (TREE_TYPE (type));
- }
+ /* Otherwise, build and fold the indirect reference. */
+ else
+ {
+ result = build_fold_indirect_ref (operand);
+ TREE_READONLY (result) = TYPE_READONLY (TREE_TYPE (type));
+ }
- side_effects
- = (!TYPE_IS_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type)));
- break;
+ if (!TYPE_IS_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type)))
+ {
+ TREE_SIDE_EFFECTS (result) = 1;
+ if (TREE_CODE (result) == INDIRECT_REF)
+ TREE_THIS_VOLATILE (result) = TYPE_VOLATILE (TREE_TYPE (result));
+ }
+
+ if ((TREE_CODE (result) == INDIRECT_REF
+ || TREE_CODE (result) == UNCONSTRAINED_ARRAY_REF)
+ && can_never_be_null)
+ TREE_THIS_NOTRAP (result) = 1;
+
+ break;
+ }
case NEGATE_EXPR:
case BIT_NOT_EXPR:
@@ -1322,13 +1414,6 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
convert (operation_type, operand));
}
- if (side_effects)
- {
- TREE_SIDE_EFFECTS (result) = 1;
- if (TREE_CODE (result) == INDIRECT_REF)
- TREE_THIS_VOLATILE (result) = TYPE_VOLATILE (TREE_TYPE (result));
- }
-
if (result_type && TREE_TYPE (result) != result_type)
result = convert (result_type, result);
@@ -1671,14 +1756,15 @@ build_simple_component_ref (tree record_variable, tree component,
gcc_assert ((TREE_CODE (record_type) == RECORD_TYPE
|| TREE_CODE (record_type) == UNION_TYPE
|| TREE_CODE (record_type) == QUAL_UNION_TYPE)
- && TYPE_SIZE (record_type)
- && (component != 0) != (field != 0));
+ && COMPLETE_TYPE_P (record_type)
+ && (component == NULL_TREE) != (field == NULL_TREE));
- /* If no field was specified, look for a field with the specified name
- in the current record only. */
+ /* If no field was specified, look for a field with the specified name in
+ the current record only. */
if (!field)
- for (field = TYPE_FIELDS (record_type); field;
- field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (record_type);
+ field;
+ field = DECL_CHAIN (field))
if (DECL_NAME (field) == component)
break;
@@ -1692,7 +1778,8 @@ build_simple_component_ref (tree record_variable, tree component,
tree new_field;
/* First loop thru normal components. */
- for (new_field = TYPE_FIELDS (record_type); new_field;
+ for (new_field = TYPE_FIELDS (record_type);
+ new_field;
new_field = DECL_CHAIN (new_field))
if (SAME_FIELD_P (field, new_field))
break;
@@ -1712,12 +1799,12 @@ build_simple_component_ref (tree record_variable, tree component,
return ref;
}
- /* Next, loop thru DECL_INTERNAL_P components if we haven't found
- the component in the first search. Doing this search in 2 steps
- is required to avoiding hidden homonymous fields in the
- _Parent field. */
+ /* Next, loop thru DECL_INTERNAL_P components if we haven't found the
+ component in the first search. Doing this search in two steps is
+ required to avoid hidden homonymous fields in the _Parent field. */
if (!new_field)
- for (new_field = TYPE_FIELDS (record_type); new_field;
+ for (new_field = TYPE_FIELDS (record_type);
+ new_field;
new_field = DECL_CHAIN (new_field))
if (DECL_INTERNAL_P (new_field))
{
@@ -1726,7 +1813,6 @@ build_simple_component_ref (tree record_variable, tree component,
NULL_TREE, new_field, no_fold_p);
ref = build_simple_component_ref (field_ref, NULL_TREE, field,
no_fold_p);
-
if (ref)
return ref;
}
@@ -1737,16 +1823,15 @@ build_simple_component_ref (tree record_variable, tree component,
if (!field)
return NULL_TREE;
- /* If the field's offset has overflowed, do not attempt to access it
- as doing so may trigger sanity checks deeper in the back-end.
- Note that we don't need to warn since this will be done on trying
- to declare the object. */
+ /* If the field's offset has overflowed, do not try to access it, as doing
+ so may trigger sanity checks deeper in the back-end. Note that we don't
+ need to warn since this will be done on trying to declare the object. */
if (TREE_CODE (DECL_FIELD_OFFSET (field)) == INTEGER_CST
&& TREE_OVERFLOW (DECL_FIELD_OFFSET (field)))
return NULL_TREE;
- /* Look through conversion between type variants. Note that this
- is transparent as far as the field is concerned. */
+ /* Look through conversion between type variants. This is transparent as
+ far as the field is concerned. */
if (TREE_CODE (record_variable) == VIEW_CONVERT_EXPR
&& TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (record_variable, 0)))
== record_type)
@@ -1757,9 +1842,13 @@ build_simple_component_ref (tree record_variable, tree component,
ref = build3 (COMPONENT_REF, TREE_TYPE (field), inner_variable, field,
NULL_TREE);
- if (TREE_READONLY (record_variable) || TREE_READONLY (field))
+ if (TREE_READONLY (record_variable)
+ || TREE_READONLY (field)
+ || TYPE_READONLY (record_type))
TREE_READONLY (ref) = 1;
- if (TREE_THIS_VOLATILE (record_variable) || TREE_THIS_VOLATILE (field)
+
+ if (TREE_THIS_VOLATILE (record_variable)
+ || TREE_THIS_VOLATILE (field)
|| TYPE_VOLATILE (record_type))
TREE_THIS_VOLATILE (ref) = 1;
@@ -1768,8 +1857,8 @@ build_simple_component_ref (tree record_variable, tree component,
/* The generic folder may punt in this case because the inner array type
can be self-referential, but folding is in fact not problematic. */
- else if (TREE_CODE (record_variable) == CONSTRUCTOR
- && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (record_variable)))
+ if (TREE_CODE (record_variable) == CONSTRUCTOR
+ && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (record_variable)))
{
VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (record_variable);
unsigned HOST_WIDE_INT idx;
@@ -1780,8 +1869,7 @@ build_simple_component_ref (tree record_variable, tree component,
return ref;
}
- else
- return fold (ref);
+ return fold (ref);
}
/* Like build_simple_component_ref, except that we give an error if the
@@ -2024,9 +2112,9 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, tree gnu_type,
}
}
-/* Build a GCC tree to correspond to allocating an object of TYPE whose
+/* Build a GCC tree that corresponds to allocating an object of TYPE whose
initial value is INIT, if INIT is nonzero. Convert the expression to
- RESULT_TYPE, which must be some type of pointer. Return the tree.
+ RESULT_TYPE, which must be some pointer type, and return the result.
GNAT_PROC and GNAT_POOL optionally give the procedure to call and
the storage pool to use. GNAT_NODE is used to provide an error
@@ -2039,8 +2127,7 @@ tree
build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
Entity_Id gnat_pool, Node_Id gnat_node, bool ignore_init_type)
{
- tree size = TYPE_SIZE_UNIT (type);
- tree result;
+ tree size, storage, storage_deref, storage_init;
/* If the initializer, if present, is a NULL_EXPR, just return a new one. */
if (init && TREE_CODE (init) == NULL_EXPR)
@@ -2066,19 +2153,19 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
get_identifier ("ALLOC"), false);
tree template_type = TREE_TYPE (TYPE_FIELDS (storage_type));
tree storage_ptr_type = build_pointer_type (storage_type);
- tree storage;
size = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_SIZE_UNIT (storage_type),
init);
- /* If the size overflows, pass -1 so the allocator will raise
- storage error. */
+ /* If the size overflows, pass -1 so Storage_Error will be raised. */
if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size))
size = ssize_int (-1);
storage = build_call_alloc_dealloc (NULL_TREE, size, storage_type,
gnat_proc, gnat_pool, gnat_node);
storage = convert (storage_ptr_type, gnat_protect_expr (storage));
+ storage_deref = build_unary_op (INDIRECT_REF, NULL_TREE, storage);
+ TREE_THIS_NOTRAP (storage_deref) = 1;
/* If there is an initializing expression, then make a constructor for
the entire object including the bounds and copy it into the object.
@@ -2091,29 +2178,24 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
build_template (template_type, type, init));
CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (storage_type)),
init);
- return convert
- (result_type,
- build2 (COMPOUND_EXPR, storage_ptr_type,
- build_binary_op
- (MODIFY_EXPR, NULL_TREE,
- build_unary_op (INDIRECT_REF, NULL_TREE,
- convert (storage_ptr_type, storage)),
- gnat_build_constructor (storage_type, v)),
- convert (storage_ptr_type, storage)));
+ storage_init
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, storage_deref,
+ gnat_build_constructor (storage_type, v));
}
else
- return build2
- (COMPOUND_EXPR, result_type,
- build_binary_op
- (MODIFY_EXPR, NULL_TREE,
- build_component_ref
- (build_unary_op (INDIRECT_REF, NULL_TREE,
- convert (storage_ptr_type, storage)),
- NULL_TREE, TYPE_FIELDS (storage_type), false),
- build_template (template_type, type, NULL_TREE)),
- convert (result_type, convert (storage_ptr_type, storage)));
+ storage_init
+ = build_binary_op (MODIFY_EXPR, NULL_TREE,
+ build_component_ref (storage_deref, NULL_TREE,
+ TYPE_FIELDS (storage_type),
+ false),
+ build_template (template_type, type, NULL_TREE));
+
+ return build2 (COMPOUND_EXPR, result_type,
+ storage_init, convert (result_type, storage));
}
+ size = TYPE_SIZE_UNIT (type);
+
/* If we have an initializing expression, see if its size is simpler
than the size from the type. */
if (!ignore_init_type && init && TYPE_SIZE_UNIT (TREE_TYPE (init))
@@ -2133,32 +2215,28 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
size = max_size (size, true);
}
- /* If the size overflows, pass -1 so the allocator will raise
- storage error. */
+ /* If the size overflows, pass -1 so Storage_Error will be raised. */
if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size))
size = ssize_int (-1);
- result = convert (result_type,
- build_call_alloc_dealloc (NULL_TREE, size, type,
- gnat_proc, gnat_pool,
- gnat_node));
+ storage = convert (result_type,
+ build_call_alloc_dealloc (NULL_TREE, size, type,
+ gnat_proc, gnat_pool,
+ gnat_node));
/* If we have an initial value, protect the new address, assign the value
and return the address with a COMPOUND_EXPR. */
if (init)
{
- result = gnat_protect_expr (result);
- result
- = build2 (COMPOUND_EXPR, TREE_TYPE (result),
- build_binary_op
- (MODIFY_EXPR, NULL_TREE,
- build_unary_op (INDIRECT_REF,
- TREE_TYPE (TREE_TYPE (result)), result),
- init),
- result);
+ storage = gnat_protect_expr (storage);
+ storage_deref = build_unary_op (INDIRECT_REF, NULL_TREE, storage);
+ TREE_THIS_NOTRAP (storage_deref) = 1;
+ storage_init
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, storage_deref, init);
+ return build2 (COMPOUND_EXPR, result_type, storage_init, storage);
}
- return convert (result_type, result);
+ return storage;
}
/* Indicate that we need to take the address of T and that it therefore
@@ -2373,7 +2451,10 @@ gnat_stabilize_reference_1 (tree e, bool force)
TREE_SIDE_EFFECTS (result) |= TREE_SIDE_EFFECTS (e);
TREE_THIS_VOLATILE (result) = TREE_THIS_VOLATILE (e);
- if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
+ if (code == INDIRECT_REF
+ || code == UNCONSTRAINED_ARRAY_REF
+ || code == ARRAY_REF
+ || code == ARRAY_RANGE_REF)
TREE_THIS_NOTRAP (result) = TREE_THIS_NOTRAP (e);
return result;
@@ -2509,7 +2590,10 @@ gnat_stabilize_reference (tree ref, bool force, bool *success)
TREE_SIDE_EFFECTS (result) |= TREE_SIDE_EFFECTS (ref);
TREE_THIS_VOLATILE (result) = TREE_THIS_VOLATILE (ref);
- if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
+ if (code == INDIRECT_REF
+ || code == UNCONSTRAINED_ARRAY_REF
+ || code == ARRAY_REF
+ || code == ARRAY_RANGE_REF)
TREE_THIS_NOTRAP (result) = TREE_THIS_NOTRAP (ref);
return result;
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index 8a8c8050cd5..57456cc67ff 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -392,6 +392,12 @@ procedure Gnat1drv is
Alfa_Mode := True;
+ -- Set strict standard interpretation of compiler permissions
+
+ if Debug_Flag_Dot_DD then
+ Strict_Alfa_Mode := True;
+ end if;
+
-- Turn off inlining, which would confuse formal verification output
-- and gain nothing.
@@ -428,6 +434,8 @@ procedure Gnat1drv is
Debug_Generated_Code := False;
-- Turn cross-referencing on in case it was disabled (e.g. by -gnatD)
+ -- as it is needed for computing effects of subprograms in the formal
+ -- verification backend.
Xref_Active := True;
@@ -473,11 +481,15 @@ procedure Gnat1drv is
Warning_Mode := Suppress;
- -- Suppress the generation of name tables for enumerations
+ -- Suppress the generation of name tables for enumerations, which are
+ -- not needed for formal verification, and fall outside the Alfa
+ -- subset (use of pointers).
Global_Discard_Names := True;
- -- Suppress the expansion of tagged types and dispatching calls
+ -- Suppress the expansion of tagged types and dispatching calls,
+ -- which lead to the generation of non-Alfa code (use of pointers),
+ -- which is more complex to formally verify than the original source.
Tagged_Type_Expansion := False;
end if;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 7e9ff7d8b7e..50cafb536c6 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -7916,8 +7916,9 @@ Not followed. This implementation is not targeted to such a domain.
The implementation should use names that end with @samp{_Locking} for
locking policies defined by the implementation.
@end cartouche
-Followed. A single implementation-defined locking policy is defined,
-whose name (@code{Inheritance_Locking}) follows this suggestion.
+Followed. Two implementation-defined locking policies are defined,
+whose names (@code{Inheritance_Locking} and
+@code{Concurrent_Readers_Locking}) follow this suggestion.
@cindex Entry queuing policies
@unnumberedsec D.4(16): Entry Queuing Policies
@@ -9895,11 +9896,15 @@ The policy is the same as that of the underlying threads implementation.
in a pragma @code{Locking_Policy}. See D.3(4).
@end cartouche
@noindent
-The only implementation defined policy permitted in GNAT is
-@code{Inheritance_Locking}. On targets that support this policy, locking
-is implemented by inheritance, i.e.@: the task owning the lock operates
+The two implementation defined policies permitted in GNAT are
+@code{Inheritance_Locking} and @code{Conccurent_Readers_Locking}. On
+targets that support the @code{Inheritance_Locking} policy, locking is
+implemented by inheritance, i.e.@: the task owning the lock operates
at a priority equal to the highest priority of any task currently
-requesting the lock.
+requesting the lock. On targets that support the
+@code{Conccurent_Readers_Locking} policy, locking is implemented with a
+read/write lock allowing multiple propected object functions to enter
+concurrently.
@sp 1
@cartouche
diff --git a/gcc/ada/mlib-tgt-specific-darwin.adb b/gcc/ada/mlib-tgt-specific-darwin.adb
index 5bab21df797..e04225370eb 100644
--- a/gcc/ada/mlib-tgt-specific-darwin.adb
+++ b/gcc/ada/mlib-tgt-specific-darwin.adb
@@ -57,15 +57,10 @@ package body MLib.Tgt.Specific is
-- Local objects
- Flat_Namespace : aliased String := "-Wl,-flat_namespace";
- -- Instruct the linker to build the shared library as a flat
- -- namespace image. The default is a two-level namespace image.
-
Shared_Libgcc : aliased String := "-shared-libgcc";
Shared_Options : constant Argument_List :=
- (1 => Flat_Namespace'Access,
- 2 => Shared_Libgcc'Access);
+ (1 => Shared_Libgcc'Access);
-----------------------------
-- Archive_Indexer_Options --
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index b84e4ec1adb..65a2d17b8e0 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -1883,6 +1883,11 @@ package Opt is
-- generation of Why code for those parts of the input code that belong to
-- the Alfa subset of Ada. Set by debug flag -gnatd.F.
+ Strict_Alfa_Mode : Boolean := False;
+ -- Interpret compiler permissions as strictly as possible. E.g. base ranges
+ -- for integers are limited to the strict minimum with this option. Set by
+ -- debug flag -gnatd.D.
+
function Full_Expander_Active return Boolean;
pragma Inline (Full_Expander_Active);
-- Returns the value of (Expander_Active and not Alfa_Mode). This "flag"
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 897b8c96b4e..d58bce10451 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -951,7 +951,8 @@ package body Ch3 is
--------------------------------
-- SUBTYPE_DECLARATION ::=
- -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION;
+ -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION
+ -- {ASPECT_SPECIFICATIONS];
-- The caller has checked that the initial token is SUBTYPE
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index ddbede2bf04..07bf0121a56 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -1653,6 +1653,7 @@ package Rtsfind is
RE_Initialize_Protection, -- System.Tasking.Protected_Objects
RE_Finalize_Protection, -- System.Tasking.Protected_Objects
RE_Lock, -- System.Tasking.Protected_Objects
+ RE_Lock_Read_Only, -- System.Tasking.Protected_Objects
RE_Get_Ceiling, -- System.Tasking.Protected_Objects
RE_Set_Ceiling, -- System.Tasking.Protected_Objects
RE_Unlock, -- System.Tasking.Protected_Objects
@@ -2883,6 +2884,7 @@ package Rtsfind is
RE_Initialize_Protection => System_Tasking_Protected_Objects,
RE_Finalize_Protection => System_Tasking_Protected_Objects,
RE_Lock => System_Tasking_Protected_Objects,
+ RE_Lock_Read_Only => System_Tasking_Protected_Objects,
RE_Get_Ceiling => System_Tasking_Protected_Objects,
RE_Set_Ceiling => System_Tasking_Protected_Objects,
RE_Unlock => System_Tasking_Protected_Objects,
diff --git a/gcc/ada/s-atocou-x86.adb b/gcc/ada/s-atocou-x86.adb
index f7c0bcb3147..bd02c35699f 100644
--- a/gcc/ada/s-atocou-x86.adb
+++ b/gcc/ada/s-atocou-x86.adb
@@ -50,7 +50,7 @@ package body System.Atomic_Counters is
begin
System.Machine_Code.Asm
(Template =>
- "lock decl" & ASCII.HT & "%0" & ASCII.LF & ASCII.HT
+ "lock%; decl" & ASCII.HT & "%0" & ASCII.LF & ASCII.HT
& "sete %1",
Outputs =>
(Unsigned_32'Asm_Output ("=m", Item.Value),
@@ -68,7 +68,7 @@ package body System.Atomic_Counters is
procedure Increment (Item : in out Atomic_Counter) is
begin
System.Machine_Code.Asm
- (Template => "lock incl" & ASCII.HT & "%0",
+ (Template => "lock%; incl" & ASCII.HT & "%0",
Outputs => Unsigned_32'Asm_Output ("=m", Item.Value),
Inputs => Unsigned_32'Asm_Input ("m", Item.Value),
Volatile => True);
diff --git a/gcc/ada/s-osinte-aix.ads b/gcc/ada/s-osinte-aix.ads
index 586d42f8f0a..c8e66082604 100644
--- a/gcc/ada/s-osinte-aix.ads
+++ b/gcc/ada/s-osinte-aix.ads
@@ -276,6 +276,14 @@ package System.OS_Interface is
PTHREAD_SCOPE_PROCESS : constant := 1;
PTHREAD_SCOPE_SYSTEM : constant := 0;
+ -- Read/Write lock not supported on AIX. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
-----------
-- Stack --
-----------
diff --git a/gcc/ada/s-osinte-darwin.ads b/gcc/ada/s-osinte-darwin.ads
index 2bd15a8b211..fe2a10a3315 100644
--- a/gcc/ada/s-osinte-darwin.ads
+++ b/gcc/ada/s-osinte-darwin.ads
@@ -256,6 +256,14 @@ package System.OS_Interface is
PTHREAD_SCOPE_PROCESS : constant := 2;
PTHREAD_SCOPE_SYSTEM : constant := 1;
+ -- Read/Write lock not supported on Darwin. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
-----------
-- Stack --
-----------
diff --git a/gcc/ada/s-osinte-freebsd.ads b/gcc/ada/s-osinte-freebsd.ads
index 5c46c29b983..d3d5c8763e4 100644
--- a/gcc/ada/s-osinte-freebsd.ads
+++ b/gcc/ada/s-osinte-freebsd.ads
@@ -289,6 +289,14 @@ package System.OS_Interface is
PTHREAD_SCOPE_PROCESS : constant := 0;
PTHREAD_SCOPE_SYSTEM : constant := 2;
+ -- Read/Write lock not supported on freebsd. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
-----------
-- Stack --
-----------
diff --git a/gcc/ada/s-osinte-hpux.ads b/gcc/ada/s-osinte-hpux.ads
index 716d821654a..bc9a7091d6f 100644
--- a/gcc/ada/s-osinte-hpux.ads
+++ b/gcc/ada/s-osinte-hpux.ads
@@ -265,6 +265,14 @@ package System.OS_Interface is
PTHREAD_SCOPE_PROCESS : constant := 2;
PTHREAD_SCOPE_SYSTEM : constant := 1;
+ -- Read/Write lock not supported on HPUX. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
-----------
-- Stack --
-----------
diff --git a/gcc/ada/s-osinte-irix.ads b/gcc/ada/s-osinte-irix.ads
index 8af4bd87542..ddeadcb6147 100644
--- a/gcc/ada/s-osinte-irix.ads
+++ b/gcc/ada/s-osinte-irix.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2011, 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- --
@@ -250,6 +250,14 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 1;
+ -- Read/Write lock not supported on SGI. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
-----------
-- Stack --
-----------
diff --git a/gcc/ada/s-osinte-linux.ads b/gcc/ada/s-osinte-linux.ads
index bd37c119fd1..38748663797 100644
--- a/gcc/ada/s-osinte-linux.ads
+++ b/gcc/ada/s-osinte-linux.ads
@@ -272,12 +272,14 @@ package System.OS_Interface is
function To_pthread_t is
new Ada.Unchecked_Conversion (unsigned_long, pthread_t);
- type pthread_mutex_t is limited private;
- type pthread_cond_t is limited private;
- type pthread_attr_t is limited private;
- type pthread_mutexattr_t is limited private;
- type pthread_condattr_t is limited private;
- type pthread_key_t is private;
+ type pthread_mutex_t is limited private;
+ type pthread_rwlock_t is limited private;
+ type pthread_cond_t is limited private;
+ type pthread_attr_t is limited private;
+ type pthread_mutexattr_t is limited private;
+ type pthread_rwlockattr_t is limited private;
+ type pthread_condattr_t is limited private;
+ type pthread_key_t is private;
PTHREAD_CREATE_DETACHED : constant := 1;
@@ -358,6 +360,42 @@ package System.OS_Interface is
function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
+ function pthread_rwlockattr_init
+ (attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlockattr_init, "pthread_rwlockattr_init");
+
+ function pthread_rwlockattr_destroy
+ (attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy");
+
+ PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0;
+ PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
+
+ function pthread_rwlockattr_setkind_np
+ (attr : access pthread_rwlockattr_t;
+ pref : int) return int;
+ pragma Import
+ (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
+
+ function pthread_rwlock_init
+ (mutex : access pthread_rwlock_t;
+ attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlock_init, "pthread_rwlock_init");
+
+ function pthread_rwlock_destroy
+ (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_destroy, "pthread_rwlock_destroy");
+
+ function pthread_rwlock_rdlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_rdlock, "pthread_rwlock_rdlock");
+
+ function pthread_rwlock_wrlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_wrlock, "pthread_rwlock_wrlock");
+
+ function pthread_rwlock_unlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_unlock, "pthread_rwlock_unlock");
+
function pthread_condattr_init
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
@@ -588,6 +626,18 @@ private
pragma Convention (C, pthread_mutex_t);
for pthread_mutex_t'Alignment use Interfaces.C.unsigned_long'Alignment;
+ type pthread_rwlockattr_t is record
+ Data : char_array (1 .. OS_Constants.PTHREAD_RWLOCKATTR_SIZE);
+ end record;
+ pragma Convention (C, pthread_rwlockattr_t);
+ for pthread_rwlockattr_t'Alignment use Interfaces.C.unsigned_long'Alignment;
+
+ type pthread_rwlock_t is record
+ Data : char_array (1 .. OS_Constants.PTHREAD_RWLOCK_SIZE);
+ end record;
+ pragma Convention (C, pthread_rwlock_t);
+ for pthread_rwlock_t'Alignment use Interfaces.C.unsigned_long'Alignment;
+
type pthread_cond_t is record
Data : char_array (1 .. OS_Constants.PTHREAD_COND_SIZE);
end record;
diff --git a/gcc/ada/s-osinte-solaris-posix.ads b/gcc/ada/s-osinte-solaris-posix.ads
index 6c266f9babf..8781a12dd67 100644
--- a/gcc/ada/s-osinte-solaris-posix.ads
+++ b/gcc/ada/s-osinte-solaris-posix.ads
@@ -255,6 +255,14 @@ package System.OS_Interface is
type pthread_condattr_t is limited private;
type pthread_key_t is private;
+ -- Read/Write lock not supported on Solaris. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
+
PTHREAD_CREATE_DETACHED : constant := 16#40#;
PTHREAD_SCOPE_PROCESS : constant := 0;
diff --git a/gcc/ada/s-taprob.adb b/gcc/ada/s-taprob.adb
index e38e755ee8f..ab0557d86dd 100644
--- a/gcc/ada/s-taprob.adb
+++ b/gcc/ada/s-taprob.adb
@@ -6,8 +6,8 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2010, AdaCore --
+-- Copyright (C) 1991-1994, Florida State University --
+-- Copyright (C) 1995-2011, AdaCore --
-- --
-- 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- --
diff --git a/gcc/ada/s-taprob.ads b/gcc/ada/s-taprob.ads
index 0342f70e031..fa2a99fa794 100644
--- a/gcc/ada/s-taprob.ads
+++ b/gcc/ada/s-taprob.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -193,10 +193,6 @@ package System.Tasking.Protected_Objects is
-- has been made by the caller. Other calls to Lock_Read_Only may (but
-- need not) return before the call to Unlock, and the corresponding
-- callers will also own the lock for read access.
- --
- -- Note: we are not currently using this interface, it is provided
- -- for possible future use. At the current time, everyone uses Lock
- -- for both read and write locks.
procedure Set_Ceiling
(Object : Protection_Access;
diff --git a/gcc/ada/s-taprop-irix.adb b/gcc/ada/s-taprop-irix.adb
index 26469049920..5b4d4bef16e 100644
--- a/gcc/ada/s-taprop-irix.adb
+++ b/gcc/ada/s-taprop-irix.adb
@@ -255,7 +255,7 @@ package body System.Task_Primitives.Operations is
pragma Assert (Result = 0);
end if;
- Result := pthread_mutex_init (L, Attributes'Access);
+ Result := pthread_mutex_init (L.WO'Access, Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
@@ -314,7 +314,7 @@ package body System.Task_Primitives.Operations is
procedure Finalize_Lock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_destroy (L);
+ Result := pthread_mutex_destroy (L.WO'Access);
pragma Assert (Result = 0);
end Finalize_Lock;
@@ -335,7 +335,7 @@ package body System.Task_Primitives.Operations is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_lock (L);
+ Result := pthread_mutex_lock (L.WO'Access);
Ceiling_Violation := Result = EINVAL;
-- Assumes the cause of EINVAL is a priority ceiling violation
@@ -381,7 +381,7 @@ package body System.Task_Primitives.Operations is
procedure Unlock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_unlock (L);
+ Result := pthread_mutex_unlock (L.WO'Access);
pragma Assert (Result = 0);
end Unlock;
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index 84c663a282a..c63d5531b62 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -95,6 +95,9 @@ package body System.Task_Primitives.Operations is
Dispatching_Policy : Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
+ Locking_Policy : Character;
+ pragma Import (C, Locking_Policy, "__gl_locking_policy");
+
Foreign_Task_Elaborated : aliased Boolean := True;
-- Used to identified fake tasks (i.e., non-Ada Threads)
@@ -260,19 +263,49 @@ package body System.Task_Primitives.Operations is
is
pragma Unreferenced (Prio);
- Mutex_Attr : aliased pthread_mutexattr_t;
- Result : Interfaces.C.int;
-
begin
- Result := pthread_mutexattr_init (Mutex_Attr'Access);
- pragma Assert (Result = 0);
+ if Locking_Policy = 'R' then
+ declare
+ RWlock_Attr : aliased pthread_rwlockattr_t;
+ Result : Interfaces.C.int;
- Result := pthread_mutex_init (L, Mutex_Attr'Access);
+ begin
+ -- Set the rwlock to prefer writer to avoid writers starvation
- pragma Assert (Result = 0 or else Result = ENOMEM);
+ Result := pthread_rwlockattr_init (RWlock_Attr'Access);
+ pragma Assert (Result = 0);
- if Result = ENOMEM then
- raise Storage_Error with "Failed to allocate a lock";
+ Result := pthread_rwlockattr_setkind_np
+ (RWlock_Attr'Access,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+ pragma Assert (Result = 0);
+
+ Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
+
+ pragma Assert (Result = 0 or else Result = ENOMEM);
+
+ if Result = ENOMEM then
+ raise Storage_Error with "Failed to allocate a lock";
+ end if;
+ end;
+
+ else
+ declare
+ Mutex_Attr : aliased pthread_mutexattr_t;
+ Result : Interfaces.C.int;
+
+ begin
+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
+ pragma Assert (Result = 0);
+
+ Result := pthread_mutex_init (L.WO'Access, Mutex_Attr'Access);
+
+ pragma Assert (Result = 0 or else Result = ENOMEM);
+
+ if Result = ENOMEM then
+ raise Storage_Error with "Failed to allocate a lock";
+ end if;
+ end;
end if;
end Initialize_Lock;
@@ -305,7 +338,11 @@ package body System.Task_Primitives.Operations is
procedure Finalize_Lock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_destroy (L);
+ if Locking_Policy = 'R' then
+ Result := pthread_rwlock_destroy (L.RW'Access);
+ else
+ Result := pthread_mutex_destroy (L.WO'Access);
+ end if;
pragma Assert (Result = 0);
end Finalize_Lock;
@@ -326,7 +363,12 @@ package body System.Task_Primitives.Operations is
is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_lock (L);
+ if Locking_Policy = 'R' then
+ Result := pthread_rwlock_wrlock (L.RW'Access);
+ else
+ Result := pthread_mutex_lock (L.WO'Access);
+ end if;
+
Ceiling_Violation := Result = EINVAL;
-- Assume the cause of EINVAL is a priority ceiling violation
@@ -363,8 +405,19 @@ package body System.Task_Primitives.Operations is
(L : not null access Lock;
Ceiling_Violation : out Boolean)
is
+ Result : Interfaces.C.int;
begin
- Write_Lock (L, Ceiling_Violation);
+ if Locking_Policy = 'R' then
+ Result := pthread_rwlock_rdlock (L.RW'Access);
+ else
+ Result := pthread_mutex_lock (L.WO'Access);
+ end if;
+
+ Ceiling_Violation := Result = EINVAL;
+
+ -- Assume the cause of EINVAL is a priority ceiling violation
+
+ pragma Assert (Result = 0 or else Result = EINVAL);
end Read_Lock;
------------
@@ -374,7 +427,11 @@ package body System.Task_Primitives.Operations is
procedure Unlock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_unlock (L);
+ if Locking_Policy = 'R' then
+ Result := pthread_rwlock_unlock (L.RW'Access);
+ else
+ Result := pthread_mutex_unlock (L.WO'Access);
+ end if;
pragma Assert (Result = 0);
end Unlock;
diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb
index af0a597e5fc..1dec99966ee 100644
--- a/gcc/ada/s-taprop-posix.adb
+++ b/gcc/ada/s-taprop-posix.adb
@@ -310,7 +310,7 @@ package body System.Task_Primitives.Operations is
pragma Assert (Result = 0);
end if;
- Result := pthread_mutex_init (L, Attributes'Access);
+ Result := pthread_mutex_init (L.WO'Access, Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
@@ -372,7 +372,7 @@ package body System.Task_Primitives.Operations is
procedure Finalize_Lock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_destroy (L);
+ Result := pthread_mutex_destroy (L.WO'Access);
pragma Assert (Result = 0);
end Finalize_Lock;
@@ -393,7 +393,7 @@ package body System.Task_Primitives.Operations is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_lock (L);
+ Result := pthread_mutex_lock (L.WO'Access);
-- Assume that the cause of EINVAL is a priority ceiling violation
@@ -439,7 +439,7 @@ package body System.Task_Primitives.Operations is
procedure Unlock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
- Result := pthread_mutex_unlock (L);
+ Result := pthread_mutex_unlock (L.WO'Access);
pragma Assert (Result = 0);
end Unlock;
diff --git a/gcc/ada/s-taspri-dummy.ads b/gcc/ada/s-taspri-dummy.ads
index eaf3a61942e..5fe9fa34277 100644
--- a/gcc/ada/s-taspri-dummy.ads
+++ b/gcc/ada/s-taspri-dummy.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-taspri-hpux-dce.ads b/gcc/ada/s-taspri-hpux-dce.ads
index 31d6cec1819..9d51d5c4517 100644
--- a/gcc/ada/s-taspri-hpux-dce.ads
+++ b/gcc/ada/s-taspri-hpux-dce.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-taspri-mingw.ads b/gcc/ada/s-taspri-mingw.ads
index fab05aaa294..cc4f4019fa9 100644
--- a/gcc/ada/s-taspri-mingw.ads
+++ b/gcc/ada/s-taspri-mingw.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-taspri-posix-noaltstack.ads b/gcc/ada/s-taspri-posix-noaltstack.ads
index 75cc28d8012..ac0e743af8f 100644
--- a/gcc/ada/s-taspri-posix-noaltstack.ads
+++ b/gcc/ada/s-taspri-posix-noaltstack.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2010, AdaCore --
+-- Copyright (C) 1995-2011, AdaCore --
-- --
-- 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- --
@@ -78,7 +78,11 @@ package System.Task_Primitives is
private
- type Lock is new System.OS_Interface.pthread_mutex_t;
+ type Lock is record
+ WO : aliased System.OS_Interface.pthread_mutex_t;
+ RW : aliased System.OS_Interface.pthread_rwlock_t;
+ end record;
+
type RTS_Lock is new System.OS_Interface.pthread_mutex_t;
type Suspension_Object is record
diff --git a/gcc/ada/s-taspri-posix.ads b/gcc/ada/s-taspri-posix.ads
index 6a076d35196..9f40693aa74 100644
--- a/gcc/ada/s-taspri-posix.ads
+++ b/gcc/ada/s-taspri-posix.ads
@@ -1,13 +1,13 @@
------------------------------------------------------------------------------
-- --
--- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
--- S Y S T E M . T A S K _ P R I M I T I V E S --
+-- S Y S T E M . T A S K _ P R I M I T I V E S --
-- --
--- S p e c --
+-- S p e c --
-- --
--- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2010, AdaCore --
+-- Copyright (C) 1991-1994, Florida State University --
+-- Copyright (C) 1995-2011, AdaCore --
-- --
-- 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- --
@@ -77,7 +77,11 @@ package System.Task_Primitives is
private
- type Lock is new System.OS_Interface.pthread_mutex_t;
+ type Lock is record
+ RW : aliased System.OS_Interface.pthread_rwlock_t;
+ WO : aliased System.OS_Interface.pthread_mutex_t;
+ end record;
+
type RTS_Lock is new System.OS_Interface.pthread_mutex_t;
type Suspension_Object is record
diff --git a/gcc/ada/s-taspri-solaris.ads b/gcc/ada/s-taspri-solaris.ads
index ef21e4ed5ef..0c9c43267fc 100644
--- a/gcc/ada/s-taspri-solaris.ads
+++ b/gcc/ada/s-taspri-solaris.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-taspri-tru64.ads b/gcc/ada/s-taspri-tru64.ads
index da170cb4c35..41c9aeaa3cd 100644
--- a/gcc/ada/s-taspri-tru64.ads
+++ b/gcc/ada/s-taspri-tru64.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-taspri-vxworks.ads b/gcc/ada/s-taspri-vxworks.ads
index 8662ac6fa9b..9b67dd91c28 100644
--- a/gcc/ada/s-taspri-vxworks.ads
+++ b/gcc/ada/s-taspri-vxworks.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 6449bf6b017..27c847df6e9 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -1164,7 +1164,7 @@ package body System.Tasking.Stages is
if System.Stack_Usage.Is_Enabled then
declare
- Guard_Page_Size : constant := 12 * 1024;
+ Guard_Page_Size : constant := 16 * 1024;
-- Part of the stack used as a guard page. This is an OS dependent
-- value, so we need to use the maximum. This value is only used
-- when the stack address is known, that is currently Windows.
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 8802ae52077..dd48cff4d17 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -19792,7 +19792,6 @@ package body Sem_Ch3 is
-- Complete both implicit base and declared first subtype entities
Set_Etype (Implicit_Base, Base_Typ);
- Set_Scalar_Range (Implicit_Base, Scalar_Range (Base_Typ));
Set_Size_Info (Implicit_Base, (Base_Typ));
Set_RM_Size (Implicit_Base, RM_Size (Base_Typ));
Set_First_Rep_Item (Implicit_Base, First_Rep_Item (Base_Typ));
@@ -19800,80 +19799,64 @@ package body Sem_Ch3 is
Set_Ekind (T, E_Signed_Integer_Subtype);
Set_Etype (T, Implicit_Base);
- -- In formal verification mode, override partially the decisions above
- -- to restrict base type's range to the minimum allowed by RM 3.5.4,
- -- namely the smallest symmetric range around zero with a possible extra
- -- negative value that contains the subtype range. Keep Size, RM_Size
- -- and First_Rep_Item info, which should not be relied upon in formal
- -- verification.
-
- if Alfa_Mode then
-
- -- If the range of the type is already symmetric with a possible
- -- extra negative value, leave it this way.
-
- if UI_Le (Lo_Val, Hi_Val)
- and then (UI_Eq (Lo_Val, UI_Negate (Hi_Val))
- or else
- UI_Eq (Lo_Val, UI_Sub (UI_Negate (Hi_Val), Uint_1)))
- then
- null;
+ -- In formal verification mode, restrict the base type's range to the
+ -- minimum allowed by RM 3.5.4, namely the smallest symmetric range
+ -- around zero with a possible extra negative value that contains the
+ -- subtype range. Keep Size, RM_Size and First_Rep_Item info, which
+ -- should not be relied upon in formal verification.
- else
- declare
- Sym_Hi_Val : Uint;
- Sym_Lo_Val : Uint;
- Decl : Node_Id;
- Dloc : constant Source_Ptr := Sloc (Def);
- Lbound : Node_Id;
- Ubound : Node_Id;
+ if Strict_Alfa_Mode then
+ declare
+ Sym_Hi_Val : Uint;
+ Sym_Lo_Val : Uint;
+ Dloc : constant Source_Ptr := Sloc (Def);
+ Lbound : Node_Id;
+ Ubound : Node_Id;
+ Bounds : Node_Id;
- begin
- -- If the subtype range is empty, the smallest base type range
- -- is the symmetric range around zero containing Lo_Val and
- -- Hi_Val.
+ begin
+ -- If the subtype range is empty, the smallest base type range
+ -- is the symmetric range around zero containing Lo_Val and
+ -- Hi_Val.
- if UI_Gt (Lo_Val, Hi_Val) then
- Sym_Hi_Val := UI_Max (UI_Abs (Lo_Val), UI_Abs (Hi_Val));
- Sym_Lo_Val := UI_Negate (Sym_Hi_Val);
+ if UI_Gt (Lo_Val, Hi_Val) then
+ Sym_Hi_Val := UI_Max (UI_Abs (Lo_Val), UI_Abs (Hi_Val));
+ Sym_Lo_Val := UI_Negate (Sym_Hi_Val);
-- Otherwise, if the subtype range is not empty and Hi_Val has
-- the largest absolute value, Hi_Val is non negative and the
-- smallest base type range is the symmetric range around zero
-- containing Hi_Val.
- elsif UI_Le (UI_Abs (Lo_Val), UI_Abs (Hi_Val)) then
- Sym_Hi_Val := Hi_Val;
- Sym_Lo_Val := UI_Negate (Hi_Val);
+ elsif UI_Le (UI_Abs (Lo_Val), UI_Abs (Hi_Val)) then
+ Sym_Hi_Val := Hi_Val;
+ Sym_Lo_Val := UI_Negate (Hi_Val);
-- Otherwise, the subtype range is not empty, Lo_Val has the
-- strictly largest absolute value, Lo_Val is negative and the
-- smallest base type range is the symmetric range around zero
-- with an extra negative value Lo_Val.
- else
- Sym_Lo_Val := Lo_Val;
- Sym_Hi_Val := UI_Sub (UI_Negate (Lo_Val), Uint_1);
- end if;
+ else
+ Sym_Lo_Val := Lo_Val;
+ Sym_Hi_Val := UI_Sub (UI_Negate (Lo_Val), Uint_1);
+ end if;
- Lbound := Make_Integer_Literal (Dloc, Sym_Lo_Val);
- Ubound := Make_Integer_Literal (Dloc, Sym_Hi_Val);
- Set_Is_Static_Expression (Lbound);
- Set_Is_Static_Expression (Ubound);
+ Lbound := Make_Integer_Literal (Dloc, Sym_Lo_Val);
+ Ubound := Make_Integer_Literal (Dloc, Sym_Hi_Val);
+ Set_Is_Static_Expression (Lbound);
+ Set_Is_Static_Expression (Ubound);
+ Analyze_And_Resolve (Lbound, Any_Integer);
+ Analyze_And_Resolve (Ubound, Any_Integer);
- Decl := Make_Full_Type_Declaration (Dloc,
- Defining_Identifier => Implicit_Base,
- Type_Definition =>
- Make_Signed_Integer_Type_Definition (Dloc,
- Low_Bound => Lbound,
- High_Bound => Ubound));
+ Bounds := Make_Range (Dloc, Lbound, Ubound);
+ Set_Etype (Bounds, Base_Typ);
- Analyze (Decl);
- Set_Etype (Implicit_Base, Base_Type (Implicit_Base));
- Set_Etype (T, Base_Type (Implicit_Base));
- Insert_Before (Parent (Def), Decl);
- end;
- end if;
+ Set_Scalar_Range (Implicit_Base, Bounds);
+ end;
+
+ else
+ Set_Scalar_Range (Implicit_Base, Scalar_Range (Base_Typ));
end if;
Set_Size_Info (T, (Implicit_Base));
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 8bdc569d1e7..742e1c9afae 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4125,6 +4125,11 @@ package body Sem_Ch4 is
Set_Entity_With_Style_Check (Sel, Comp);
Generate_Reference (Comp, Sel);
+ -- The selector is not overloadable, so we have a candidate
+ -- interpretation.
+
+ Has_Candidate := True;
+
else
goto Next_Comp;
end if;
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index fdd4b1fbc67..875eb1c0778 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -2302,8 +2302,9 @@ package body Sem_Ch5 is
Typ : Entity_Id;
begin
- -- In semantics and Alfa modes, introduce loop variable so that loop
- -- body can be properly analyzed. Otherwise this is one after expansion.
+ -- In semantics/Alfa modes, we won't be further expanding the loop, so
+ -- introduce loop variable so that loop body can be properly analyzed.
+ -- Otherwise this happens after expansion.
if Operating_Mode = Check_Semantics
or else Alfa_Mode
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index b2a046bb4f8..a9a45bc6445 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -10267,6 +10267,16 @@ package body Sem_Ch6 is
and then Can_Never_Be_Null (Etype (Formal_Id))
then
Set_Is_Known_Non_Null (Formal_Id);
+
+ -- We can also set Can_Never_Be_Null (thus preventing some junk
+ -- access checks) for the case of an IN parameter, which cannot
+ -- be changed, or for an IN OUT parameter, which can be changed but
+ -- not to a null value. But for an OUT parameter, the initial value
+ -- passed in can be null, so we can't set this flag in that case.
+
+ if Ekind (Formal_Id) /= E_Out_Parameter then
+ Set_Can_Never_Be_Null (Formal_Id);
+ end if;
end if;
Set_Mechanism (Formal_Id, Default_Mechanism);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 74d889e283a..46906943762 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10834,16 +10834,23 @@ package body Sem_Prag is
-- pragma Locking_Policy (policy_IDENTIFIER);
when Pragma_Locking_Policy => declare
- LP : Character;
-
+ subtype LP_Range is Name_Id
+ range First_Locking_Policy_Name .. Last_Locking_Policy_Name;
+ LP_Val : LP_Range;
+ LP : Character;
begin
Check_Ada_83_Warning;
Check_Arg_Count (1);
Check_No_Identifiers;
Check_Arg_Is_Locking_Policy (Arg1);
Check_Valid_Configuration_Pragma;
- Get_Name_String (Chars (Get_Pragma_Arg (Arg1)));
- LP := Fold_Upper (Name_Buffer (1));
+ LP_Val := Chars (Get_Pragma_Arg (Arg1));
+
+ case LP_Val is
+ when Name_Ceiling_Locking => LP := 'C';
+ when Name_Inheritance_Locking => LP := 'I';
+ when Name_Concurrent_Readers_Locking => LP := 'R';
+ end case;
if Locking_Policy /= ' '
and then Locking_Policy /= LP
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 26d90af4dd6..5df84dcf7d7 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2274,9 +2274,9 @@ package body Sem_Util is
is
Comp : Node_Id;
Comps : constant List_Id := New_List;
+
begin
Comp := First_Component (Underlying_Type (R_Typ));
-
while Present (Comp) loop
if Comes_From_Source (Comp) then
declare
@@ -2291,6 +2291,7 @@ package body Sem_Util is
(Component_Definition (Comp_Decl), New_Sloc => Loc)));
end;
end if;
+
Next_Component (Comp);
end loop;
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 4e239b8203b..3a03c04c7e6 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -2191,7 +2191,8 @@ package Sinfo is
--------------------------------
-- SUBTYPE_DECLARATION ::=
- -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION;
+ -- subtype DEFINING_IDENTIFIER is [NULL_EXCLUSION] SUBTYPE_INDICATION
+ -- [ASPECT_SPECIFICATIONS];
-- The subtype indication field is set to Empty for subtypes
-- declared in package Standard (Positive, Natural).
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 5f321db7f39..f7c441e97aa 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -909,13 +909,10 @@ package Snames is
-- Names of recognized locking policy identifiers
- -- Note: policies are identified by the first character of the
- -- name (e.g. C for Ceiling_Locking). If new policy names are added,
- -- the first character must be distinct.
-
First_Locking_Policy_Name : constant Name_Id := N + $;
Name_Ceiling_Locking : constant Name_Id := N + $;
Name_Inheritance_Locking : constant Name_Id := N + $;
+ Name_Concurrent_Readers_Locking : constant Name_Id := N + $; -- GNAT
Last_Locking_Policy_Name : constant Name_Id := N + $;
-- Names of recognized queuing policy identifiers
@@ -1500,7 +1497,8 @@ package Snames is
type Locking_Policy_Id is (
Locking_Policy_Inheritance_Locking,
- Locking_Policy_Ceiling_Locking);
+ Locking_Policy_Ceiling_Locking,
+ Locking_Policy_Concurrent_Readers_Locking);
---------------------------
-- Pragma ID Definitions --
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5d4564abc87..cb58d324dca 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2369,7 +2369,21 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
C_DECL_DECLARED_BUILTIN (newdecl) = 1;
if (new_is_prototype)
- C_DECL_BUILTIN_PROTOTYPE (newdecl) = 0;
+ {
+ C_DECL_BUILTIN_PROTOTYPE (newdecl) = 0;
+ if (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (newdecl))
+ {
+ /* If a compatible prototype of these builtin functions
+ is seen, assume the runtime implements it with the
+ expected semantics. */
+ case BUILT_IN_STPCPY:
+ implicit_built_in_decls[DECL_FUNCTION_CODE (newdecl)]
+ = built_in_decls[DECL_FUNCTION_CODE (newdecl)];
+ default:
+ break;
+ }
+ }
else
C_DECL_BUILTIN_PROTOTYPE (newdecl)
= C_DECL_BUILTIN_PROTOTYPE (olddecl);
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 7241d666d22..a1f7ebef400 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -43,8 +43,7 @@ never after.
#include "diagnostic-core.h"
/* Usage of TREE_LANG_FLAG_?:
- 0: TREE_NEGATED_INT (in INTEGER_CST).
- IDENTIFIER_MARKED (used by search routines).
+ 0: IDENTIFIER_MARKED (used by search routines).
DECL_PRETTY_FUNCTION_P (in VAR_DECL)
C_MAYBE_CONST_EXPR_INT_OPERANDS (in C_MAYBE_CONST_EXPR, for C)
1: C_DECLARED_LABEL_FLAG (in LABEL_DECL)
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1f08031e71d..e1c17a2c211 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -9910,6 +9910,31 @@ build_binary_op (location_t location, enum tree_code code,
case EQ_EXPR:
case NE_EXPR:
+ if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
+ {
+ tree intt;
+ if (TREE_TYPE (type0) != TREE_TYPE (type1))
+ {
+ error_at (location, "comparing vectors with different "
+ "element types");
+ return error_mark_node;
+ }
+
+ if (TYPE_VECTOR_SUBPARTS (type0) != TYPE_VECTOR_SUBPARTS (type1))
+ {
+ error_at (location, "comparing vectors with different "
+ "number of elements");
+ return error_mark_node;
+ }
+
+ /* Always construct signed integer vector type. */
+ intt = c_common_type_for_size (GET_MODE_BITSIZE
+ (TYPE_MODE (TREE_TYPE (type0))), 0);
+ result_type = build_opaque_vector_type (intt,
+ TYPE_VECTOR_SUBPARTS (type0));
+ converted = 1;
+ break;
+ }
if (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1))
warning_at (location,
OPT_Wfloat_equal,
@@ -10022,6 +10047,31 @@ build_binary_op (location_t location, enum tree_code code,
case GE_EXPR:
case LT_EXPR:
case GT_EXPR:
+ if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
+ {
+ tree intt;
+ if (TREE_TYPE (type0) != TREE_TYPE (type1))
+ {
+ error_at (location, "comparing vectors with different "
+ "element types");
+ return error_mark_node;
+ }
+
+ if (TYPE_VECTOR_SUBPARTS (type0) != TYPE_VECTOR_SUBPARTS (type1))
+ {
+ error_at (location, "comparing vectors with different "
+ "number of elements");
+ return error_mark_node;
+ }
+
+ /* Always construct signed integer vector type. */
+ intt = c_common_type_for_size (GET_MODE_BITSIZE
+ (TYPE_MODE (TREE_TYPE (type0))), 0);
+ result_type = build_opaque_vector_type (intt,
+ TYPE_VECTOR_SUBPARTS (type0));
+ converted = 1;
+ break;
+ }
build_type = integer_type_node;
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
|| code0 == FIXED_POINT_TYPE)
@@ -10429,6 +10479,10 @@ c_objc_common_truthvalue_conversion (location_t location, tree expr)
case FUNCTION_TYPE:
gcc_unreachable ();
+ case VECTOR_TYPE:
+ error_at (location, "used vector type where scalar is required");
+ return error_mark_node;
+
default:
break;
}
diff --git a/gcc/calls.c b/gcc/calls.c
index 1413c8d9dd6..3fa70b571f4 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3577,20 +3577,29 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
argvec[count].partial
= targetm.calls.arg_partial_bytes (args_so_far, mode, NULL_TREE, 1);
- locate_and_pad_parm (mode, NULL_TREE,
+ if (argvec[count].reg == 0
+ || argvec[count].partial != 0
+ || reg_parm_stack_space > 0)
+ {
+ locate_and_pad_parm (mode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
- 1,
+ 1,
#else
- argvec[count].reg != 0,
+ argvec[count].reg != 0,
+#endif
+ argvec[count].partial,
+ NULL_TREE, &args_size, &argvec[count].locate);
+ args_size.constant += argvec[count].locate.size.constant;
+ gcc_assert (!argvec[count].locate.size.var);
+ }
+#ifdef BLOCK_REG_PADDING
+ else
+ /* The argument is passed entirely in registers. See at which
+ end it should be padded. */
+ argvec[count].locate.where_pad =
+ BLOCK_REG_PADDING (mode, NULL_TREE,
+ GET_MODE_SIZE (mode) <= UNITS_PER_WORD);
#endif
- argvec[count].partial,
- NULL_TREE, &args_size, &argvec[count].locate);
-
- gcc_assert (!argvec[count].locate.size.var);
-
- if (argvec[count].reg == 0 || argvec[count].partial != 0
- || reg_parm_stack_space > 0)
- args_size.constant += argvec[count].locate.size.constant;
targetm.calls.function_arg_advance (args_so_far, mode, (tree) 0, true);
}
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 14e7a3b0f08..84d6bd5198a 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -110,7 +110,8 @@ const char * const ld_plugin_symbol_resolution_names[]=
"preempted_ir",
"resolved_ir",
"resolved_exec",
- "resolved_dyn"
+ "resolved_dyn",
+ "prevailing_def_ironly_exp"
};
static void cgraph_node_remove_callers (struct cgraph_node *node);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 2dedcc5c31a..c75c1300408 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -426,7 +426,9 @@ verify_edge_count_and_frequency (struct cgraph_edge *e)
Remove this once edges are actualy removed from the function at that time. */
&& (e->frequency
|| (inline_edge_summary_vec
- && !inline_edge_summary (e)->predicate))
+ && ((VEC_length(inline_edge_summary_t, inline_edge_summary_vec)
+ <= (unsigned) e->uid)
+ || !inline_edge_summary (e)->predicate)))
&& (e->frequency
!= compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt))))
@@ -2011,6 +2013,12 @@ ipa_passes (void)
return;
}
+ /* We never run removal of unreachable nodes after early passes. This is
+ because TODO is run before the subpasses. It is important to remove
+ the unreachable functions to save works at IPA level and to get LTO
+ symbol tables right. */
+ cgraph_remove_unreachable_nodes (true, cgraph_dump_file);
+
/* If pass_all_early_optimizations was not scheduled, the state of
the cgraph will not be properly updated. Update it now. */
if (cgraph_state < CGRAPH_STATE_IPA_SSA)
@@ -2042,7 +2050,7 @@ ipa_passes (void)
if (flag_generate_lto)
targetm.asm_out.lto_end ();
- if (!flag_ltrans)
+ if (!flag_ltrans && (in_lto_p || !flag_lto || flag_fat_lto_objects))
execute_ipa_pass_list (all_regular_ipa_passes);
invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_END, NULL);
@@ -2080,8 +2088,9 @@ cgraph_optimize (void)
if (!seen_error ())
ipa_passes ();
- /* Do nothing else if any IPA pass found errors. */
- if (seen_error ())
+ /* Do nothing else if any IPA pass found errors or if we are just streaming LTO. */
+ if (seen_error ()
+ || (!in_lto_p && flag_lto && !flag_fat_lto_objects))
{
timevar_pop (TV_CGRAPHOPT);
return;
diff --git a/gcc/common.opt b/gcc/common.opt
index 5c59d4d9eb8..a1e02dfba81 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1129,6 +1129,10 @@ Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
ffast-math
Common
+ffat-lto-objects
+Common Var(flag_fat_lto_objects) Init(1)
+Output lto objects containing both the intermediate language and binary output.
+
ffinite-math-only
Common Report Var(flag_finite_math_only) Optimization SetByCombined
Assume no NaNs or infinities are generated
@@ -1983,6 +1987,10 @@ ftree-dominator-opts
Common Report Var(flag_tree_dom) Optimization
Enable dominator optimizations
+ftree-tail-merge
+Common Report Var(flag_tree_tail_merge) Optimization
+Enable tail merging on trees
+
ftree-dse
Common Report Var(flag_tree_dse) Optimization
Enable dead store elimination
@@ -1995,6 +2003,10 @@ ftree-fre
Common Report Var(flag_tree_fre) Optimization
Enable Full Redundancy Elimination (FRE) on trees
+foptimize-strlen
+Common Report Var(flag_optimize_strlen) Optimization
+Enable string length optimizations on trees
+
ftree-loop-distribution
Common Report Var(flag_tree_loop_distribution) Optimization
Enable loop distribution on trees
diff --git a/gcc/common/config/c6x/c6x-common.c b/gcc/common/config/c6x/c6x-common.c
index 133dddadbf4..a9c98af2266 100644
--- a/gcc/common/config/c6x/c6x-common.c
+++ b/gcc/common/config/c6x/c6x-common.c
@@ -33,6 +33,7 @@ static const struct default_options c6x_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_frename_registers, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fmodulo_sched, NULL, 1 },
{ OPT_LEVELS_ALL, OPT_freciprocal_math, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
diff --git a/gcc/config.gcc b/gcc/config.gcc
index eadd229bea4..dec145bb397 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -422,6 +422,8 @@ score*-*-*)
;;
sparc*-*-*)
cpu_type=sparc
+ c_target_objs="sparc-c.o"
+ cxx_target_objs="sparc-c.o"
extra_headers="visintrin.h"
need_64bit_hwint=yes
;;
@@ -943,14 +945,14 @@ avr-*-rtems*)
libgcc_tm_file="$libgcc_tm_file avr/avr-lib.h"
tmake_file="avr/t-avr t-rtems avr/t-rtems"
extra_gcc_objs="driver-avr.o avr-devices.o"
- extra_objs="avr-devices.o"
+ extra_objs="avr-devices.o avr-log.o"
;;
avr-*-*)
tm_file="elfos.h avr/elf.h avr/avr.h dbxelf.h newlib-stdint.h"
libgcc_tm_file="$libgcc_tm_file avr/avr-lib.h"
use_gcc_stdint=wrap
extra_gcc_objs="driver-avr.o avr-devices.o"
- extra_objs="avr-devices.o"
+ extra_objs="avr-devices.o avr-log.o"
;;
bfin*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
@@ -2469,32 +2471,32 @@ sparc-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
case ${target} in
*-leon-*)
- tmake_file="sparc/t-leon"
+ tmake_file="sparc/t-sparc sparc/t-leon"
;;
*-leon[3-9]*)
- tmake_file="sparc/t-leon3"
+ tmake_file="sparc/t-sparc sparc/t-leon3"
;;
*)
- tmake_file="sparc/t-elf"
+ tmake_file="sparc/t-sparc sparc/t-elf"
;;
esac
;;
sparc-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
- tmake_file="sparc/t-elf t-rtems"
+ tmake_file="sparc/t-sparc sparc/t-elf t-rtems"
;;
sparc-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
case ${target} in
*-leon-*)
- tmake_file="${tmake_file} sparc/t-leon"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
;;
*-leon[3-9]*)
- tmake_file="${tmake_file} sparc/t-leon3"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
;;
*)
- tmake_file="${tmake_file} sparc/t-linux"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux"
;;
esac
if test x$enable_targets = xall; then
@@ -2509,6 +2511,7 @@ sparc-*-netbsdelf*)
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
+ tmake_file="${tmake_file} sparc/t-sparc"
;;
sparc*-*-solaris2*)
tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sol2-bi.h"
@@ -2520,25 +2523,26 @@ sparc*-*-solaris2*)
test x$with_cpu != x || with_cpu=v9
;;
esac
- tmake_file="${tmake_file} sparc/t-sol2-64"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2-64"
;;
sparc-wrs-vxworks)
tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
- tmake_file="${tmake_file} sparc/t-vxworks"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
;;
sparc64-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
extra_options="${extra_options} sparc/little-endian.opt"
+ tmake_file="${tmake_file} sparc/t-sparc"
;;
sparc64-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
extra_options="${extra_options} sparc/little-endian.opt"
- tmake_file="${tmake_file} t-rtems"
+ tmake_file="${tmake_file} sparc/t-sparc t-rtems"
;;
sparc64-*-linux*)
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
- tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux sparc/t-linux64"
extra_parts="${extra_parts} crtfastmath.o"
;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*)
@@ -2550,13 +2554,14 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
esac
extra_parts="${extra_parts} crtfastmath.o"
+ tmake_file="${tmake_file} sparc/t-sparc"
;;
sparc64-*-netbsd*)
tm_file="sparc/biarch64.h ${tm_file}"
tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
- tmake_file="${tmake_file} sparc/t-netbsd64"
+ tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
;;
sparc64-*-openbsd*)
tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
@@ -2565,6 +2570,7 @@ sparc64-*-openbsd*)
extra_options="${extra_options} sparc/little-endian.opt"
gas=yes gnu_ld=yes
with_cpu=ultrasparc
+ tmake_file="${tmake_file} sparc/t-sparc"
;;
spu-*-elf*)
tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
diff --git a/gcc/config.in b/gcc/config.in
index b7d29a1ad32..fd50da3b191 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -272,6 +272,12 @@
#endif
+/* Define if your assembler supports FMAF, HPC, and VIS 3.0 instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_FMAF_HPC_VIS3
+#endif
+
+
/* Define if your assembler supports fprnd. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_FPRND
@@ -1015,6 +1021,12 @@
#endif
+/* Define if your assembler supports specifying the section flag e. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GAS_SECTION_EXCLUDE
+#endif
+
+
/* Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.
*/
#ifndef USED_FOR_TARGET
@@ -1053,12 +1065,6 @@
#endif
-/* Define if _Unwind_GetIPInfo is available. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_GETIPINFO
-#endif
-
-
/* Define to 1 if you have the `getrlimit' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_GETRLIMIT
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 9030e96052e..23a29c6639b 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -46,6 +46,7 @@ extern void arm_output_fn_unwind (FILE *, bool);
extern bool arm_vector_mode_supported_p (enum machine_mode);
extern bool arm_small_register_classes_for_mode_p (enum machine_mode);
extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
+extern bool arm_modes_tieable_p (enum machine_mode, enum machine_mode);
extern int const_ok_for_arm (HOST_WIDE_INT);
extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b45f9392e2f..51614396da4 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -11573,7 +11573,7 @@ arm_must_pass_in_stack (enum machine_mode mode, const_tree type)
aggregate types are placed in the lowest memory address. */
bool
-arm_pad_arg_upward (enum machine_mode mode, const_tree type)
+arm_pad_arg_upward (enum machine_mode mode ATTRIBUTE_UNUSED, const_tree type)
{
if (!TARGET_AAPCS_BASED)
return DEFAULT_FUNCTION_ARG_PADDING(mode, type) == upward;
@@ -11581,36 +11581,38 @@ arm_pad_arg_upward (enum machine_mode mode, const_tree type)
if (type && BYTES_BIG_ENDIAN && INTEGRAL_TYPE_P (type))
return false;
- /* Half-float values are only passed to libcalls, not regular functions.
- They should be passed and returned as "short"s (see RTABI). To achieve
- that effect in big-endian mode, pad downwards so the value is passed in
- the least-significant end of the register. ??? This needs to be here
- rather than in arm_pad_reg_upward due to peculiarity in the handling of
- libcall arguments. */
- if (BYTES_BIG_ENDIAN && mode == HFmode)
- return false;
-
return true;
}
/* Similarly, for use by BLOCK_REG_PADDING (MODE, TYPE, FIRST).
- For non-AAPCS, return !BYTES_BIG_ENDIAN if the least significant
- byte of the register has useful data, and return the opposite if the
- most significant byte does.
- For AAPCS, small aggregates and small complex types are always padded
- upwards. */
+ Return !BYTES_BIG_ENDIAN if the least significant byte of the
+ register has useful data, and return the opposite if the most
+ significant byte does. */
bool
-arm_pad_reg_upward (enum machine_mode mode ATTRIBUTE_UNUSED,
+arm_pad_reg_upward (enum machine_mode mode,
tree type, int first ATTRIBUTE_UNUSED)
{
- if (TARGET_AAPCS_BASED
- && BYTES_BIG_ENDIAN
- && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE
- || FIXED_POINT_TYPE_P (type))
- && int_size_in_bytes (type) <= 4)
- return true;
+ if (TARGET_AAPCS_BASED && BYTES_BIG_ENDIAN)
+ {
+ /* For AAPCS, small aggregates, small fixed-point types,
+ and small complex types are always padded upwards. */
+ if (type)
+ {
+ if ((AGGREGATE_TYPE_P (type)
+ || TREE_CODE (type) == COMPLEX_TYPE
+ || FIXED_POINT_TYPE_P (type))
+ && int_size_in_bytes (type) <= 4)
+ return true;
+ }
+ else
+ {
+ if ((COMPLEX_MODE_P (mode) || ALL_FIXED_POINT_MODE_P (mode))
+ && GET_MODE_SIZE (mode) <= 4)
+ return true;
+ }
+ }
/* Otherwise, use default padding. */
return !BYTES_BIG_ENDIAN;
@@ -18258,6 +18260,29 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
&& regno <= LAST_FPA_REGNUM);
}
+/* Implement MODES_TIEABLE_P. */
+
+bool
+arm_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
+{
+ if (GET_MODE_CLASS (mode1) == GET_MODE_CLASS (mode2))
+ return true;
+
+ /* We specifically want to allow elements of "structure" modes to
+ be tieable to the structure. This more general condition allows
+ other rarer situations too. */
+ if (TARGET_NEON
+ && (VALID_NEON_DREG_MODE (mode1)
+ || VALID_NEON_QREG_MODE (mode1)
+ || VALID_NEON_STRUCT_MODE (mode1))
+ && (VALID_NEON_DREG_MODE (mode2)
+ || VALID_NEON_QREG_MODE (mode2)
+ || VALID_NEON_STRUCT_MODE (mode2)))
+ return true;
+
+ return false;
+}
+
/* For efficiency and historical reasons LO_REGS, HI_REGS and CC_REGS are
not used in arm mode. */
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index a76988efac8..993e3a07874 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -975,12 +975,7 @@ extern int arm_arch_thumb_hwdiv;
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
arm_hard_regno_mode_ok ((REGNO), (MODE))
-/* Value is 1 if it is a good idea to tie two pseudo registers
- when one has mode MODE1 and one has mode MODE2.
- If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
- for any hard reg, then this must be 0 for correct output. */
-#define MODES_TIEABLE_P(MODE1, MODE2) \
- (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
+#define MODES_TIEABLE_P(MODE1, MODE2) arm_modes_tieable_p (MODE1, MODE2)
#define VALID_IWMMXT_REG_MODE(MODE) \
(arm_vector_mode_supported_p (MODE) || (MODE) == DImode)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index bb9e3283fc3..baa7eb41b4e 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4389,8 +4389,8 @@
(define_insn "zero_extend<mode>di2"
[(set (match_operand:DI 0 "s_register_operand" "=r")
- (zero_extend:DI (match_operand:QHSI 1 "<qhs_extenddi_op>"
- "<qhs_extenddi_cstr>")))]
+ (zero_extend:DI (match_operand:QHSI 1 "<qhs_zextenddi_op>"
+ "<qhs_zextenddi_cstr>")))]
"TARGET_32BIT <qhs_zextenddi_cond>"
"#"
[(set_attr "length" "8")
@@ -6791,7 +6791,7 @@
(define_expand "cbranchsi4"
[(set (pc) (if_then_else
- (match_operator 0 "arm_comparison_operator"
+ (match_operator 0 "expandable_comparison_operator"
[(match_operand:SI 1 "s_register_operand" "")
(match_operand:SI 2 "nonmemory_operand" "")])
(label_ref (match_operand 3 "" ""))
@@ -6842,7 +6842,7 @@
(define_expand "cbranchsf4"
[(set (pc) (if_then_else
- (match_operator 0 "arm_comparison_operator"
+ (match_operator 0 "expandable_comparison_operator"
[(match_operand:SF 1 "s_register_operand" "")
(match_operand:SF 2 "arm_float_compare_operand" "")])
(label_ref (match_operand 3 "" ""))
@@ -6854,7 +6854,7 @@
(define_expand "cbranchdf4"
[(set (pc) (if_then_else
- (match_operator 0 "arm_comparison_operator"
+ (match_operator 0 "expandable_comparison_operator"
[(match_operand:DF 1 "s_register_operand" "")
(match_operand:DF 2 "arm_float_compare_operand" "")])
(label_ref (match_operand 3 "" ""))
@@ -6866,7 +6866,7 @@
(define_expand "cbranchdi4"
[(set (pc) (if_then_else
- (match_operator 0 "arm_comparison_operator"
+ (match_operator 0 "expandable_comparison_operator"
[(match_operand:DI 1 "cmpdi_operand" "")
(match_operand:DI 2 "cmpdi_operand" "")])
(label_ref (match_operand 3 "" ""))
@@ -7721,7 +7721,7 @@
(define_expand "cstoresi4"
[(set (match_operand:SI 0 "s_register_operand" "")
- (match_operator:SI 1 "arm_comparison_operator"
+ (match_operator:SI 1 "expandable_comparison_operator"
[(match_operand:SI 2 "s_register_operand" "")
(match_operand:SI 3 "reg_or_int_operand" "")]))]
"TARGET_32BIT || TARGET_THUMB1"
@@ -7857,7 +7857,7 @@
(define_expand "cstoresf4"
[(set (match_operand:SI 0 "s_register_operand" "")
- (match_operator:SI 1 "arm_comparison_operator"
+ (match_operator:SI 1 "expandable_comparison_operator"
[(match_operand:SF 2 "s_register_operand" "")
(match_operand:SF 3 "arm_float_compare_operand" "")]))]
"TARGET_32BIT && TARGET_HARD_FLOAT"
@@ -7867,7 +7867,7 @@
(define_expand "cstoredf4"
[(set (match_operand:SI 0 "s_register_operand" "")
- (match_operator:SI 1 "arm_comparison_operator"
+ (match_operator:SI 1 "expandable_comparison_operator"
[(match_operand:DF 2 "s_register_operand" "")
(match_operand:DF 3 "arm_float_compare_operand" "")]))]
"TARGET_32BIT && TARGET_HARD_FLOAT && !TARGET_VFP_SINGLE"
@@ -7877,7 +7877,7 @@
(define_expand "cstoredi4"
[(set (match_operand:SI 0 "s_register_operand" "")
- (match_operator:SI 1 "arm_comparison_operator"
+ (match_operator:SI 1 "expandable_comparison_operator"
[(match_operand:DI 2 "cmpdi_operand" "")
(match_operand:DI 3 "cmpdi_operand" "")]))]
"TARGET_32BIT"
@@ -7997,7 +7997,7 @@
(define_expand "movsicc"
[(set (match_operand:SI 0 "s_register_operand" "")
- (if_then_else:SI (match_operand 1 "arm_comparison_operator" "")
+ (if_then_else:SI (match_operand 1 "expandable_comparison_operator" "")
(match_operand:SI 2 "arm_not_operand" "")
(match_operand:SI 3 "arm_not_operand" "")))]
"TARGET_32BIT"
@@ -8017,7 +8017,7 @@
(define_expand "movsfcc"
[(set (match_operand:SF 0 "s_register_operand" "")
- (if_then_else:SF (match_operand 1 "arm_comparison_operator" "")
+ (if_then_else:SF (match_operand 1 "expandable_comparison_operator" "")
(match_operand:SF 2 "s_register_operand" "")
(match_operand:SF 3 "nonmemory_operand" "")))]
"TARGET_32BIT && TARGET_HARD_FLOAT"
@@ -8043,7 +8043,7 @@
(define_expand "movdfcc"
[(set (match_operand:DF 0 "s_register_operand" "")
- (if_then_else:DF (match_operand 1 "arm_comparison_operator" "")
+ (if_then_else:DF (match_operand 1 "expandable_comparison_operator" "")
(match_operand:DF 2 "s_register_operand" "")
(match_operand:DF 3 "arm_float_add_operand" "")))]
"TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP_DOUBLE)"
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index 7b5ee623107..20ff2f82929 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -55,8 +55,13 @@
#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
"|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
-#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5"\
- "|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15:%{!r:--be8}}}"
+#define BE8_LINK_SPEC \
+ " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 \
+ |mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
+ |march=armv7-m|mcpu=cortex-m3 \
+ |march=armv7e-m|mcpu=cortex-m4 \
+ |march=armv6-m|mcpu=cortex-m0 \
+ :%{!r:--be8}}}"
/* Tell the assembler to build BPABI binaries. */
#undef SUBTARGET_EXTRA_ASM_SPEC
diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md
index 219918c8064..da1f7af9b7a 100644
--- a/gcc/config/arm/iterators.md
+++ b/gcc/config/arm/iterators.md
@@ -390,10 +390,14 @@
(define_mode_attr qhs_zextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "")])
(define_mode_attr qhs_sextenddi_cond [(SI "") (HI "&& arm_arch6")
(QI "&& arm_arch6")])
-(define_mode_attr qhs_extenddi_op [(SI "s_register_operand")
+(define_mode_attr qhs_zextenddi_op [(SI "s_register_operand")
(HI "nonimmediate_operand")
(QI "nonimmediate_operand")])
-(define_mode_attr qhs_extenddi_cstr [(SI "r") (HI "rm") (QI "rm")])
+(define_mode_attr qhs_extenddi_op [(SI "s_register_operand")
+ (HI "nonimmediate_operand")
+ (QI "arm_reg_or_extendqisi_mem_op")])
+(define_mode_attr qhs_extenddi_cstr [(SI "r") (HI "rm") (QI "rUq")])
+(define_mode_attr qhs_zextenddi_cstr [(SI "r") (HI "rm") (QI "rm")])
;; Mode attributes used for fixed-point support.
(define_mode_attr qaddsub_suf [(V4UQQ "8") (V2UHQ "16") (UQQ "8") (UHQ "16")
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 0d94a49adbb..ea09da246ff 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -1251,66 +1251,14 @@
(const_string "neon_int_1") (const_string "neon_int_5")))]
)
-; FIXME: We wouldn't need the following insns if we could write subregs of
-; vector registers. Make an attempt at removing unnecessary moves, though
-; we're really at the mercy of the register allocator.
-
-(define_insn "neon_move_lo_quad_<mode>"
- [(set (match_operand:ANY128 0 "s_register_operand" "+w")
- (vec_concat:ANY128
- (match_operand:<V_HALF> 1 "s_register_operand" "w")
- (vec_select:<V_HALF>
- (match_dup 0)
- (match_operand:ANY128 2 "vect_par_constant_high" ""))))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%e0, %P1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_move_hi_quad_<mode>"
- [(set (match_operand:ANY128 0 "s_register_operand" "+w")
- (vec_concat:ANY128
- (vec_select:<V_HALF>
- (match_dup 0)
- (match_operand:ANY128 2 "vect_par_constant_low" ""))
- (match_operand:<V_HALF> 1 "s_register_operand" "w")))]
-
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%f0, %P1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
(define_expand "move_hi_quad_<mode>"
[(match_operand:ANY128 0 "s_register_operand" "")
(match_operand:<V_HALF> 1 "s_register_operand" "")]
"TARGET_NEON"
{
- rtvec v = rtvec_alloc (<V_mode_nunits>/2);
- rtx t1;
- int i;
-
- for (i=0; i < (<V_mode_nunits>/2); i++)
- RTVEC_ELT (v, i) = GEN_INT (i);
-
- t1 = gen_rtx_PARALLEL (<MODE>mode, v);
- emit_insn (gen_neon_move_hi_quad_<mode> (operands[0], operands[1], t1));
-
+ emit_move_insn (simplify_gen_subreg (<V_HALF>mode, operands[0], <MODE>mode,
+ GET_MODE_SIZE (<V_HALF>mode)),
+ operands[1]);
DONE;
})
@@ -1319,16 +1267,9 @@
(match_operand:<V_HALF> 1 "s_register_operand" "")]
"TARGET_NEON"
{
- rtvec v = rtvec_alloc (<V_mode_nunits>/2);
- rtx t1;
- int i;
-
- for (i=0; i < (<V_mode_nunits>/2); i++)
- RTVEC_ELT (v, i) = GEN_INT ((<V_mode_nunits>/2) + i);
-
- t1 = gen_rtx_PARALLEL (<MODE>mode, v);
- emit_insn (gen_neon_move_lo_quad_<mode> (operands[0], operands[1], t1));
-
+ emit_move_insn (simplify_gen_subreg (<V_HALF>mode, operands[0],
+ <MODE>mode, 0),
+ operands[1]);
DONE;
})
@@ -2969,183 +2910,27 @@
(set_attr "neon_type" "neon_bp_simple")]
)
-(define_insn "neon_vget_highv16qi"
- [(set (match_operand:V8QI 0 "s_register_operand" "=w")
- (vec_select:V8QI (match_operand:V16QI 1 "s_register_operand" "w")
- (parallel [(const_int 8) (const_int 9)
- (const_int 10) (const_int 11)
- (const_int 12) (const_int 13)
- (const_int 14) (const_int 15)])))]
+(define_expand "neon_vget_high<mode>"
+ [(match_operand:<V_HALF> 0 "s_register_operand")
+ (match_operand:VQX 1 "s_register_operand")]
"TARGET_NEON"
{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src + 2)
- return "vmov\t%P0, %f1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_highv8hi"
- [(set (match_operand:V4HI 0 "s_register_operand" "=w")
- (vec_select:V4HI (match_operand:V8HI 1 "s_register_operand" "w")
- (parallel [(const_int 4) (const_int 5)
- (const_int 6) (const_int 7)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src + 2)
- return "vmov\t%P0, %f1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_highv4si"
- [(set (match_operand:V2SI 0 "s_register_operand" "=w")
- (vec_select:V2SI (match_operand:V4SI 1 "s_register_operand" "w")
- (parallel [(const_int 2) (const_int 3)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src + 2)
- return "vmov\t%P0, %f1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_highv4sf"
- [(set (match_operand:V2SF 0 "s_register_operand" "=w")
- (vec_select:V2SF (match_operand:V4SF 1 "s_register_operand" "w")
- (parallel [(const_int 2) (const_int 3)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src + 2)
- return "vmov\t%P0, %f1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_highv2di"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (vec_select:DI (match_operand:V2DI 1 "s_register_operand" "w")
- (parallel [(const_int 1)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src + 2)
- return "vmov\t%P0, %f1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_lowv16qi"
- [(set (match_operand:V8QI 0 "s_register_operand" "=w")
- (vec_select:V8QI (match_operand:V16QI 1 "s_register_operand" "w")
- (parallel [(const_int 0) (const_int 1)
- (const_int 2) (const_int 3)
- (const_int 4) (const_int 5)
- (const_int 6) (const_int 7)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%P0, %e1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_lowv8hi"
- [(set (match_operand:V4HI 0 "s_register_operand" "=w")
- (vec_select:V4HI (match_operand:V8HI 1 "s_register_operand" "w")
- (parallel [(const_int 0) (const_int 1)
- (const_int 2) (const_int 3)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%P0, %e1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_lowv4si"
- [(set (match_operand:V2SI 0 "s_register_operand" "=w")
- (vec_select:V2SI (match_operand:V4SI 1 "s_register_operand" "w")
- (parallel [(const_int 0) (const_int 1)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%P0, %e1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
-
-(define_insn "neon_vget_lowv4sf"
- [(set (match_operand:V2SF 0 "s_register_operand" "=w")
- (vec_select:V2SF (match_operand:V4SF 1 "s_register_operand" "w")
- (parallel [(const_int 0) (const_int 1)])))]
- "TARGET_NEON"
-{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%P0, %e1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
+ emit_move_insn (operands[0],
+ simplify_gen_subreg (<V_HALF>mode, operands[1], <MODE>mode,
+ GET_MODE_SIZE (<V_HALF>mode)));
+ DONE;
+})
-(define_insn "neon_vget_lowv2di"
- [(set (match_operand:DI 0 "s_register_operand" "=w")
- (vec_select:DI (match_operand:V2DI 1 "s_register_operand" "w")
- (parallel [(const_int 0)])))]
+(define_expand "neon_vget_low<mode>"
+ [(match_operand:<V_HALF> 0 "s_register_operand")
+ (match_operand:VQX 1 "s_register_operand")]
"TARGET_NEON"
{
- int dest = REGNO (operands[0]);
- int src = REGNO (operands[1]);
-
- if (dest != src)
- return "vmov\t%P0, %e1";
- else
- return "";
-}
- [(set_attr "neon_type" "neon_bp_simple")]
-)
+ emit_move_insn (operands[0],
+ simplify_gen_subreg (<V_HALF>mode, operands[1],
+ <MODE>mode, 0));
+ DONE;
+})
(define_insn "neon_vcvt<mode>"
[(set (match_operand:<V_CVTTO> 0 "s_register_operand" "=w")
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index df8990ea648..27ba6033f78 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -249,9 +249,14 @@
;; True for integer comparisons and, if FP is active, for comparisons
;; other than LTGT or UNEQ.
+(define_special_predicate "expandable_comparison_operator"
+ (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,
+ unordered,ordered,unlt,unle,unge,ungt"))
+
+;; Likewise, but only accept comparisons that are directly supported
+;; by ARM condition codes.
(define_special_predicate "arm_comparison_operator"
- (and (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,
- unordered,ordered,unlt,unle,unge,ungt")
+ (and (match_operand 0 "expandable_comparison_operator")
(match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
(define_special_predicate "lt_ge_comparison_operator"
@@ -296,8 +301,11 @@
(define_special_predicate "arm_extendqisi_mem_op"
(and (match_operand 0 "memory_operand")
- (match_test "arm_legitimate_address_outer_p (mode, XEXP (op, 0),
- SIGN_EXTEND, 0)")))
+ (match_test "TARGET_ARM ? arm_legitimate_address_outer_p (mode,
+ XEXP (op, 0),
+ SIGN_EXTEND,
+ 0)
+ : memory_address_p (QImode, XEXP (op, 0))")))
(define_special_predicate "arm_reg_or_extendqisi_mem_op"
(ior (match_operand 0 "arm_extendqisi_mem_op")
diff --git a/gcc/config/avr/avr-log.c b/gcc/config/avr/avr-log.c
new file mode 100644
index 00000000000..cdeb6690fde
--- /dev/null
+++ b/gcc/config/avr/avr-log.c
@@ -0,0 +1,330 @@
+/* Subroutines for log output for Atmel AVR back end.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Georg-Johann Lay (avr@gjlay.de)
+
+ 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 3, 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 COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "tree.h"
+#include "output.h"
+#include "input.h"
+#include "function.h"
+#include "tm_p.h"
+#include "tree-pass.h"
+
+/* This file supplies some functions for AVR back-end developers
+ with a printf-like interface. The functions are called through
+ macros avr_edump or avr_fdump from avr-protos.h:
+
+ avr_edump (const char * fmt, ...);
+
+ avr_fdump (FILE * stream, const char * fmt, ...);
+
+ avr_edump (fmt, ...) is a shortcut for avr_fdump (stderr, fmt, ...)
+
+ == known %-codes ==
+
+ b: bool
+ r: rtx
+ t: tree
+ T: tree (brief)
+ C: enum rtx_code
+ m: enum machine_mode
+ R: enum reg_class
+ L: insn list
+ H: location_t
+
+ == no arguments ==
+
+ A: call abort()
+ f: current_function_name()
+ F: caller (via __FUNCTION__)
+ P: Pass name and number
+ ?: Print caller, current function and pass info
+
+ == same as printf ==
+
+ %: %
+ c: char
+ s: string
+ d: int (decimal)
+ x: int (hex)
+*/
+
+/* Set according to -mlog= option. */
+avr_log_t avr_log;
+
+/* The caller as of __FUNCTION__ */
+static const char *avr_log_caller = "?";
+
+/* The worker function implementing the %-codes */
+static void avr_log_vadump (FILE*, const char*, va_list);
+
+/* As we have no variadic macros, avr_edump maps to a call to
+ avr_log_set_caller_e which saves __FUNCTION__ to avr_log_caller and
+ returns a function pointer to avr_log_fdump_e. avr_fdump_e
+ gets the printf-like arguments and calls avr_log_vadump, the
+ worker function. avr_fdump works the same way. */
+
+/* Provide avr_log_fdump_e/f so that avr_log_set_caller_e/_f can return
+ their address. */
+
+static int
+avr_log_fdump_e (const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ avr_log_vadump (stderr, fmt, ap);
+ va_end (ap);
+
+ return 1;
+}
+
+static int
+avr_log_fdump_f (FILE *stream, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ if (stream)
+ avr_log_vadump (stream, fmt, ap);
+ va_end (ap);
+
+ return 1;
+}
+
+/* Macros avr_edump/avr_fdump map to calls of the following two functions,
+ respectively. You don't need to call them directly. */
+
+int (*
+avr_log_set_caller_e (const char *caller)
+ )(const char*, ...)
+{
+ avr_log_caller = caller;
+
+ return avr_log_fdump_e;
+}
+
+int (*
+avr_log_set_caller_f (const char *caller)
+ )(FILE*, const char*, ...)
+{
+ avr_log_caller = caller;
+
+ return avr_log_fdump_f;
+}
+
+/* Worker function implementing the %-codes and forwarding to
+ respective print/dump function. */
+
+static void
+avr_log_vadump (FILE *file, const char *fmt, va_list ap)
+{
+ char bs[3] = {'\\', '?', '\0'};
+
+ while (*fmt)
+ {
+ switch (*fmt++)
+ {
+ default:
+ fputc (*(fmt-1), file);
+ break;
+
+ case '\\':
+ bs[1] = *fmt++;
+ fputs (bs, file);
+ break;
+
+ case '%':
+ switch (*fmt++)
+ {
+ case '%':
+ fputc ('%', file);
+ break;
+
+ case 't':
+ {
+ tree t = va_arg (ap, tree);
+ if (NULL_TREE == t)
+ fprintf (file, "<NULL-TREE>");
+ else
+ {
+ if (stderr == file)
+ debug_tree (t);
+ else
+ {
+ print_node (file, "", t, 0);
+ putc ('\n', file);
+ }
+ }
+ break;
+ }
+
+ case 'T':
+ print_node_brief (file, "", va_arg (ap, tree), 3);
+ break;
+
+ case 'd':
+ fprintf (file, "%d", va_arg (ap, int));
+ break;
+
+ case 'x':
+ fprintf (file, "%x", va_arg (ap, int));
+ break;
+
+ case 'b':
+ fprintf (file, "%s", va_arg (ap, int) ? "true" : "false");
+ break;
+
+ case 'c':
+ fputc (va_arg (ap, int), file);
+ break;
+
+ case 'r':
+ print_inline_rtx (file, va_arg (ap, rtx), 0);
+ break;
+
+ case 'L':
+ {
+ rtx insn = va_arg (ap, rtx);
+
+ while (insn)
+ {
+ print_inline_rtx (file, insn, 0);
+ fprintf (file, "\n");
+ insn = NEXT_INSN (insn);
+ }
+ break;
+ }
+
+ case 'f':
+ if (cfun && cfun->decl)
+ fputs (current_function_name(), file);
+ break;
+
+ case 's':
+ {
+ const char *str = va_arg (ap, char*);
+ fputs (str ? str : "(null)", file);
+ }
+ break;
+
+ case 'm':
+ fputs (GET_MODE_NAME (va_arg (ap, enum machine_mode)), file);
+ break;
+
+ case 'C':
+ fputs (rtx_name[va_arg (ap, enum rtx_code)], file);
+ break;
+
+ case 'R':
+ fputs (reg_class_names[va_arg (ap, enum reg_class)], file);
+ break;
+
+ case 'F':
+ fputs (avr_log_caller, file);
+ break;
+
+ case 'H':
+ {
+ location_t loc = va_arg (ap, location_t);
+
+ if (BUILTINS_LOCATION == loc)
+ fprintf (file, "<BUILTIN-LOCATION");
+ else if (UNKNOWN_LOCATION == loc)
+ fprintf (file, "<UNKNOWN-LOCATION>");
+ else
+ fprintf (file, "%s:%d",
+ LOCATION_FILE (loc), LOCATION_LINE (loc));
+
+ break;
+ }
+
+ case '!':
+ if (!current_pass)
+ return;
+ /* FALLTHRU */
+
+ case '?':
+ avr_log_fdump_f (file, "%F[%f:%P]");
+ break;
+
+ case 'P':
+ if (current_pass)
+ fprintf (file, "%s(%d)",
+ current_pass->name,
+ current_pass->static_pass_number);
+ else
+ fprintf (file, "pass=?");
+
+ break;
+
+ case 'A':
+ fflush (file);
+ abort();
+
+ default:
+ /* Unknown %-code: Stop printing */
+
+ fprintf (file, "??? %%%c ???%s\n", *(fmt-1), fmt);
+ fmt = "";
+
+ break;
+ }
+ break; /* % */
+ }
+ }
+
+ fflush (file);
+}
+
+
+/* Called from avr.c:avr_option_override().
+ Parse argument of -mlog= and set respective fields in avr_log. */
+
+void
+avr_log_set_avr_log (void)
+{
+ if (avr_log_details)
+ {
+ /* Adding , at beginning and end of string makes searching easier. */
+
+ char *str = (char*) alloca (3 + strlen (avr_log_details));
+
+ str[0] = ',';
+ strcat (stpcpy (str+1, avr_log_details), ",");
+
+#define SET_DUMP_DETAIL(S) \
+ avr_log.S = (TARGET_ALL_DEBUG \
+ || NULL != strstr (str, "," #S ",") \
+ || NULL != strstr (str, ",all,"))
+
+ SET_DUMP_DETAIL (rtx_costs);
+ SET_DUMP_DETAIL (legitimate_address_p);
+ SET_DUMP_DETAIL (legitimize_address);
+ SET_DUMP_DETAIL (legitimize_reload_address);
+ SET_DUMP_DETAIL (constraints);
+ SET_DUMP_DETAIL (address_cost);
+
+#undef SET_DUMP_DETAIL
+ }
+}
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index ba7da70d1e8..91e51088917 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -47,7 +47,6 @@ extern void init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
#ifdef RTX_CODE
extern void asm_output_external_libcall (FILE *file, rtx symref);
-extern int compare_diff_p (rtx insn);
extern const char *output_movqi (rtx insn, rtx operands[], int *l);
extern const char *output_movhi (rtx insn, rtx operands[], int *l);
extern const char *out_movqi_r_mr (rtx insn, rtx op[], int *l);
@@ -56,9 +55,10 @@ extern const char *out_movhi_r_mr (rtx insn, rtx op[], int *l);
extern const char *out_movhi_mr_r (rtx insn, rtx op[], int *l);
extern const char *out_movsi_r_mr (rtx insn, rtx op[], int *l);
extern const char *out_movsi_mr_r (rtx insn, rtx op[], int *l);
-extern const char *output_movsisf (rtx insn, rtx operands[], rtx clobber, int *l);
-extern const char *out_tstsi (rtx insn, rtx src, int *l);
-extern const char *out_tsthi (rtx insn, rtx src, int *l);
+extern const char *output_movsisf (rtx insn, rtx operands[], int *l);
+extern const char *avr_out_tstsi (rtx, rtx*, int*);
+extern const char *avr_out_tsthi (rtx, rtx*, int*);
+extern const char *avr_out_compare (rtx, rtx*, int*);
extern const char *ret_cond_branch (rtx x, int len, int reverse);
extern const char *ashlqi3_out (rtx insn, rtx operands[], int *len);
@@ -81,11 +81,14 @@ extern int avr_epilogue_uses (int regno);
extern void avr_output_bld (rtx operands[], int bit_nr);
extern void avr_output_addr_vec_elt (FILE *stream, int value);
extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
+extern const char* avr_out_bitop (rtx, rtx*, int*);
+extern const char* avr_out_plus (rtx*, int*);
+extern bool avr_popcount_each_byte (rtx, int, int);
extern int extra_constraint_Q (rtx x);
extern int adjust_insn_length (rtx insn, int len);
-extern const char *output_reload_inhi (rtx insn, rtx *operands, int *len);
-extern const char *output_reload_insisf (rtx insn, rtx *operands, rtx clobber, int *len);
+extern const char* output_reload_inhi (rtx*, rtx, int*);
+extern const char* output_reload_insisf (rtx*, rtx, int*);
extern void notice_update_cc (rtx body, rtx insn);
extern void print_operand (FILE *file, rtx x, int code);
extern void print_operand_address (FILE *file, rtx addr);
@@ -100,7 +103,6 @@ extern void final_prescan_insn (rtx insn, rtx *operand, int num_operands);
extern int avr_simplify_comparison_p (enum machine_mode mode,
RTX_CODE op, rtx x);
extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
-extern int compare_eq_p (rtx insn);
extern void out_shift_with_cnt (const char *templ, rtx insn,
rtx operands[], int *len, int t_len);
extern rtx avr_incoming_return_addr_rtx (void);
@@ -109,3 +111,25 @@ extern rtx avr_incoming_return_addr_rtx (void);
#ifdef REAL_VALUE_TYPE
extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
#endif
+
+/* From avr-log.c */
+
+#define avr_edump (avr_log_set_caller_e (__FUNCTION__))
+#define avr_fdump (avr_log_set_caller_f (__FUNCTION__))
+
+extern int (*avr_log_set_caller_e (const char*))(const char*, ...);
+extern int (*avr_log_set_caller_f (const char*))(FILE*, const char*, ...);
+
+extern void avr_log_set_avr_log (void);
+
+typedef struct
+{
+ unsigned rtx_costs :1;
+ unsigned legitimate_address_p :1;
+ unsigned legitimize_address :1;
+ unsigned legitimize_reload_address :1;
+ unsigned constraints :1;
+ unsigned address_cost :1;
+} avr_log_t;
+
+extern avr_log_t avr_log;
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index b69efa95075..55fbae4649e 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -69,9 +69,7 @@ static const char *ptrreg_to_str (int);
static const char *cond_string (enum rtx_code);
static int avr_num_arg_regs (enum machine_mode, const_tree);
-static RTX_CODE compare_condition (rtx insn);
static rtx avr_legitimize_address (rtx, rtx, enum machine_mode);
-static int compare_sign_p (rtx insn);
static tree avr_handle_progmem_attribute (tree *, tree, tree, int, bool *);
static tree avr_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
static tree avr_handle_fntype_attribute (tree *, tree, tree, int, bool *);
@@ -303,6 +301,51 @@ avr_replace_prefix (const char *old_str,
return (const char*) new_str;
}
+
+/* Custom function to count number of set bits. */
+
+static inline int
+avr_popcount (unsigned int val)
+{
+ int pop = 0;
+
+ while (val)
+ {
+ val &= val-1;
+ pop++;
+ }
+
+ return pop;
+}
+
+
+/* Constraint helper function. XVAL is a CONST_INT or a CONST_DOUBLE.
+ Return true if the least significant N_BYTES bytes of XVAL all have a
+ popcount in POP_MASK and false, otherwise. POP_MASK represents a subset
+ of integers which contains an integer N iff bit N of POP_MASK is set. */
+
+bool
+avr_popcount_each_byte (rtx xval, int n_bytes, int pop_mask)
+{
+ int i;
+
+ enum machine_mode mode = GET_MODE (xval);
+
+ if (VOIDmode == mode)
+ mode = SImode;
+
+ for (i = 0; i < n_bytes; i++)
+ {
+ rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
+ unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
+
+ if (0 == (pop_mask & (1 << avr_popcount (val8))))
+ return false;
+ }
+
+ return true;
+}
+
static void
avr_option_override (void)
{
@@ -316,6 +359,8 @@ avr_option_override (void)
zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO);
init_machine_status = avr_init_machine_status;
+
+ avr_log_set_avr_log();
}
/* Function to set up the backend function structure. */
@@ -408,7 +453,7 @@ signal_function_p (tree func)
return avr_lookup_function_attribute1 (func, "signal");
}
-/* Return nonzero if FUNC is a OS_task function. */
+/* Return nonzero if FUNC is an OS_task function. */
static int
avr_OS_task_function_p (tree func)
@@ -416,7 +461,7 @@ avr_OS_task_function_p (tree func)
return avr_lookup_function_attribute1 (func, "OS_task");
}
-/* Return nonzero if FUNC is a OS_main function. */
+/* Return nonzero if FUNC is an OS_main function. */
static int
avr_OS_main_function_p (tree func)
@@ -439,7 +484,7 @@ avr_regs_to_save (HARD_REG_SET *set)
count = 0;
/* No need to save any registers if the function never returns or
- is have "OS_task" or "OS_main" attribute. */
+ has the "OS_task" or "OS_main" attribute. */
if (TREE_THIS_VOLATILE (current_function_decl)
|| cfun->machine->is_OS_task
|| cfun->machine->is_OS_main)
@@ -512,7 +557,7 @@ avr_return_addr_rtx (int count, rtx tem)
{
rtx r;
- /* Can only return this functions return address. Others not supported. */
+ /* Can only return this function's return address. Others not supported. */
if (count)
return NULL;
@@ -790,7 +835,7 @@ expand_prologue (void)
fp=sp
fp-=size
sp=fp
- OR
+ OR
sp-=size
fp=sp
the optimum method depends on function type, stack and frame size.
@@ -1148,27 +1193,7 @@ avr_cannot_modify_jumps_p (void)
bool
avr_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
{
- enum reg_class r = NO_REGS;
-
- if (TARGET_ALL_DEBUG)
- {
- fprintf (stderr, "mode: (%s) %s %s %s %s:",
- GET_MODE_NAME(mode),
- strict ? "(strict)": "",
- reload_completed ? "(reload_completed)": "",
- reload_in_progress ? "(reload_in_progress)": "",
- reg_renumber ? "(reg_renumber)" : "");
- if (GET_CODE (x) == PLUS
- && REG_P (XEXP (x, 0))
- && GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) >= 0
- && INTVAL (XEXP (x, 1)) <= MAX_LD_OFFSET (mode)
- && reg_renumber
- )
- fprintf (stderr, "(r%d ---> r%d)", REGNO (XEXP (x, 0)),
- true_regnum (XEXP (x, 0)));
- debug_rtx (x);
- }
+ reg_class_t r = NO_REGS;
if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x)
: REG_OK_FOR_BASE_NOSTRICT_P (x)))
@@ -1202,10 +1227,27 @@ avr_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
{
r = POINTER_REGS;
}
- if (TARGET_ALL_DEBUG)
+
+ if (avr_log.legitimate_address_p)
{
- fprintf (stderr, " ret = %c\n", r + '0');
+ avr_edump ("\n%?: ret=%d=%R, mode=%m strict=%d "
+ "reload_completed=%d reload_in_progress=%d %s:",
+ !!r, r, mode, strict, reload_completed, reload_in_progress,
+ reg_renumber ? "(reg_renumber)" : "");
+
+ if (GET_CODE (x) == PLUS
+ && REG_P (XEXP (x, 0))
+ && CONST_INT_P (XEXP (x, 1))
+ && IN_RANGE (INTVAL (XEXP (x, 1)), 0, MAX_LD_OFFSET (mode))
+ && reg_renumber)
+ {
+ avr_edump ("(r%d ---> r%d)", REGNO (XEXP (x, 0)),
+ true_regnum (XEXP (x, 0)));
+ }
+
+ avr_edump ("\n%r\n", x);
}
+
return r == NO_REGS ? 0 : (int)r;
}
@@ -1215,30 +1257,35 @@ avr_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
rtx
avr_legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
{
+ bool big_offset_p = false;
+
x = oldx;
- if (TARGET_ALL_DEBUG)
+
+ if (GET_CODE (oldx) == PLUS
+ && REG_P (XEXP (oldx, 0)))
{
- fprintf (stderr, "legitimize_address mode: %s", GET_MODE_NAME(mode));
- debug_rtx (oldx);
+ if (REG_P (XEXP (oldx, 1)))
+ x = force_reg (GET_MODE (oldx), oldx);
+ else if (CONST_INT_P (XEXP (oldx, 1)))
+ {
+ int offs = INTVAL (XEXP (oldx, 1));
+ if (frame_pointer_rtx != XEXP (oldx, 0)
+ && offs > MAX_LD_OFFSET (mode))
+ {
+ big_offset_p = true;
+ x = force_reg (GET_MODE (oldx), oldx);
+ }
+ }
}
- if (GET_CODE (oldx) == PLUS
- && REG_P (XEXP (oldx,0)))
+ if (avr_log.legitimize_address)
{
- if (REG_P (XEXP (oldx,1)))
- x = force_reg (GET_MODE (oldx), oldx);
- else if (GET_CODE (XEXP (oldx, 1)) == CONST_INT)
- {
- int offs = INTVAL (XEXP (oldx,1));
- if (frame_pointer_rtx != XEXP (oldx,0))
- if (offs > MAX_LD_OFFSET (mode))
- {
- if (TARGET_ALL_DEBUG)
- fprintf (stderr, "force_reg (big offset)\n");
- x = force_reg (GET_MODE (oldx), oldx);
- }
- }
+ avr_edump ("\n%?: mode=%m\n %r\n", mode, oldx);
+
+ if (x != oldx)
+ avr_edump (" %s --> %r\n", big_offset_p ? "(big offset)" : "", x);
}
+
return x;
}
@@ -1251,7 +1298,8 @@ avr_legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
by OPERANDS. This is just forwarding to output_asm_insn.
If PLEN != NULL:
- Add N_WORDS to *PLEN.
+ If N_WORDS >= 0 Add N_WORDS to *PLEN.
+ If N_WORDS < 0 Set *PLEN to -N_WORDS.
Don't output anything.
*/
@@ -1264,7 +1312,10 @@ avr_asm_len (const char* tpl, rtx* operands, int* plen, int n_words)
}
else
{
- *plen += n_words;
+ if (n_words < 0)
+ *plen = -n_words;
+ else
+ *plen += n_words;
}
}
@@ -1527,26 +1578,6 @@ notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
case CC_CLOBBER:
/* Insn doesn't leave CC in a usable state. */
CC_STATUS_INIT;
-
- /* Correct CC for the ashrqi3 with the shift count as CONST_INT < 6 */
- set = single_set (insn);
- if (set)
- {
- rtx src = SET_SRC (set);
-
- if (GET_CODE (src) == ASHIFTRT
- && GET_MODE (src) == QImode)
- {
- rtx x = XEXP (src, 1);
-
- if (CONST_INT_P (x)
- && IN_RANGE (INTVAL (x), 1, 5))
- {
- cc_status.value1 = SET_DEST (set);
- cc_status.flags |= CC_OVERFLOW_UNUSABLE;
- }
- }
- }
break;
}
}
@@ -1682,7 +1713,7 @@ void
final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
int num_operands ATTRIBUTE_UNUSED)
{
- if (TARGET_ALL_DEBUG)
+ if (avr_log.rtx_costs)
{
rtx set = single_set (insn);
@@ -1810,7 +1841,7 @@ avr_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode,
/* Test if all registers needed by the ABI are actually available. If the
user has fixed a GPR needed to pass an argument, an (implicit) function
- call would clobber that fixed register. See PR45099 for an example. */
+ call will clobber that fixed register. See PR45099 for an example. */
if (cum->regno >= 8
&& cum->nregs >= 0)
@@ -1819,8 +1850,8 @@ avr_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode,
for (regno = cum->regno; regno < cum->regno + bytes; regno++)
if (fixed_regs[regno])
- error ("Register %s is needed to pass a parameter but is fixed",
- reg_names[regno]);
+ warning (0, "fixed register %s used to pass parameter to function",
+ reg_names[regno]);
}
if (cum->nregs <= 0)
@@ -2035,84 +2066,9 @@ output_movhi (rtx insn, rtx operands[], int *l)
}
}
else if (CONSTANT_P (src))
- {
- if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
- {
- *l = 2;
- return (AS2 (ldi,%A0,lo8(%1)) CR_TAB
- AS2 (ldi,%B0,hi8(%1)));
- }
-
- if (GET_CODE (src) == CONST_INT)
- {
- if (src == const0_rtx) /* mov r,L */
- {
- *l = 2;
- return (AS1 (clr,%A0) CR_TAB
- AS1 (clr,%B0));
- }
- else if (src == const1_rtx)
- {
- *l = 3;
- return (AS1 (clr,%A0) CR_TAB
- AS1 (clr,%B0) CR_TAB
- AS1 (inc,%A0));
- }
- else if (src == constm1_rtx)
- {
- /* Immediate constants -1 to any register */
- *l = 3;
- return (AS1 (clr,%0) CR_TAB
- AS1 (dec,%A0) CR_TAB
- AS2 (mov,%B0,%A0));
- }
- else
- {
- int bit_nr = exact_log2 (INTVAL (src));
-
- if (bit_nr >= 0)
- {
- *l = 4;
- if (!real_l)
- output_asm_insn ((AS1 (clr,%A0) CR_TAB
- AS1 (clr,%B0) CR_TAB
- "set"), operands);
- if (!real_l)
- avr_output_bld (operands, bit_nr);
-
- return "";
- }
- }
-
- if ((INTVAL (src) & 0xff) == 0)
- {
- *l = 5;
- return (AS2 (mov,__tmp_reg__,r31) CR_TAB
- AS1 (clr,%A0) CR_TAB
- AS2 (ldi,r31,hi8(%1)) CR_TAB
- AS2 (mov,%B0,r31) CR_TAB
- AS2 (mov,r31,__tmp_reg__));
- }
- else if ((INTVAL (src) & 0xff00) == 0)
- {
- *l = 5;
- return (AS2 (mov,__tmp_reg__,r31) CR_TAB
- AS2 (ldi,r31,lo8(%1)) CR_TAB
- AS2 (mov,%A0,r31) CR_TAB
- AS1 (clr,%B0) CR_TAB
- AS2 (mov,r31,__tmp_reg__));
- }
- }
-
- /* Last resort, equal to loading from memory. */
- *l = 6;
- return (AS2 (mov,__tmp_reg__,r31) CR_TAB
- AS2 (ldi,r31,lo8(%1)) CR_TAB
- AS2 (mov,%A0,r31) CR_TAB
- AS2 (ldi,r31,hi8(%1)) CR_TAB
- AS2 (mov,%B0,r31) CR_TAB
- AS2 (mov,r31,__tmp_reg__));
- }
+ {
+ return output_reload_inhi (operands, NULL, real_l);
+ }
else if (GET_CODE (src) == MEM)
return out_movhi_r_mr (insn, operands, real_l); /* mov r,m */
}
@@ -2673,7 +2629,7 @@ out_movsi_mr_r (rtx insn, rtx op[], int *l)
}
const char *
-output_movsisf (rtx insn, rtx operands[], rtx clobber_reg, int *l)
+output_movsisf (rtx insn, rtx operands[], int *l)
{
int dummy;
rtx dest = operands[0];
@@ -2719,7 +2675,7 @@ output_movsisf (rtx insn, rtx operands[], rtx clobber_reg, int *l)
else if (CONST_INT_P (src)
|| CONST_DOUBLE_P (src))
{
- return output_reload_insisf (insn, operands, clobber_reg, real_l);
+ return output_reload_insisf (operands, NULL_RTX, real_l);
}
else if (CONSTANT_P (src))
{
@@ -3012,28 +2968,30 @@ compare_condition (rtx insn)
return UNKNOWN;
}
-/* Returns nonzero if INSN is a tst insn that only tests the sign. */
-static int
+/* Returns true iff INSN is a tst insn that only tests the sign. */
+
+static bool
compare_sign_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
return (cond == GE || cond == LT);
}
-/* Returns nonzero if the next insn is a JUMP_INSN with a condition
+
+/* Returns true iff the next insn is a JUMP_INSN with a condition
that needs to be swapped (GT, GTU, LE, LEU). */
-int
+static bool
compare_diff_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
return (cond == GT || cond == GTU || cond == LE || cond == LEU) ? cond : 0;
}
-/* Returns nonzero if INSN is a compare insn with the EQ or NE condition. */
+/* Returns true iff INSN is a compare insn with the EQ or NE condition. */
-int
+static bool
compare_eq_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
@@ -3041,56 +2999,204 @@ compare_eq_p (rtx insn)
}
+/* Output compare instruction
+
+ compare (XOP[0], XOP[1])
+
+ for an HI/SI register XOP[0] and an integer XOP[1]. Return "".
+ XOP[2] is an 8-bit scratch register as needed.
+
+ PLEN == NULL: Output instructions.
+ PLEN != NULL: Set *PLEN to the length (in words) of the sequence.
+ Don't output anything. */
+
+const char*
+avr_out_compare (rtx insn, rtx *xop, int *plen)
+{
+ /* Register to compare and value to compare against. */
+ rtx xreg = xop[0];
+ rtx xval = xop[1];
+
+ /* MODE of the comparison. */
+ enum machine_mode mode = GET_MODE (xreg);
+
+ /* Number of bytes to operate on. */
+ int i, n_bytes = GET_MODE_SIZE (mode);
+
+ /* Value (0..0xff) held in clobber register xop[2] or -1 if unknown. */
+ int clobber_val = -1;
+
+ gcc_assert (REG_P (xreg)
+ && CONST_INT_P (xval));
+
+ if (plen)
+ *plen = 0;
+
+ /* Comparisons == +/-1 and != +/-1 can be done similar to camparing
+ against 0 by ORing the bytes. This is one instruction shorter. */
+
+ if (!test_hard_reg_class (LD_REGS, xreg)
+ && compare_eq_p (insn)
+ && reg_unused_after (insn, xreg))
+ {
+ if (xval == const1_rtx)
+ {
+ avr_asm_len ("dec %A0" CR_TAB
+ "or %A0,%B0", xop, plen, 2);
+
+ if (n_bytes == 4)
+ avr_asm_len ("or %A0,%C0" CR_TAB
+ "or %A0,%D0", xop, plen, 2);
+
+ return "";
+ }
+ else if (xval == constm1_rtx)
+ {
+ if (n_bytes == 4)
+ avr_asm_len ("and %A0,%D0" CR_TAB
+ "and %A0,%C0", xop, plen, 2);
+
+ avr_asm_len ("and %A0,%B0" CR_TAB
+ "com %A0", xop, plen, 2);
+
+ return "";
+ }
+ }
+
+ for (i = 0; i < n_bytes; i++)
+ {
+ /* We compare byte-wise. */
+ rtx reg8 = simplify_gen_subreg (QImode, xreg, mode, i);
+ rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
+
+ /* 8-bit value to compare with this byte. */
+ unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
+
+ /* Registers R16..R31 can operate with immediate. */
+ bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);
+
+ xop[0] = reg8;
+ xop[1] = gen_int_mode (val8, QImode);
+
+ /* Word registers >= R24 can use SBIW/ADIW with 0..63. */
+
+ if (i == 0
+ && test_hard_reg_class (ADDW_REGS, reg8))
+ {
+ int val16 = trunc_int_for_mode (INTVAL (xval), HImode);
+
+ if (IN_RANGE (val16, 0, 63)
+ && (val8 == 0
+ || reg_unused_after (insn, xreg)))
+ {
+ avr_asm_len ("sbiw %0,%1", xop, plen, 1);
+ i++;
+ continue;
+ }
+
+ if (n_bytes == 2
+ && IN_RANGE (val16, -63, -1)
+ && compare_eq_p (insn)
+ && reg_unused_after (insn, xreg))
+ {
+ avr_asm_len ("adiw %0,%n1", xop, plen, 1);
+ break;
+ }
+ }
+
+ /* Comparing against 0 is easy. */
+
+ if (val8 == 0)
+ {
+ avr_asm_len (i == 0
+ ? "cp %0,__zero_reg__"
+ : "cpc %0,__zero_reg__", xop, plen, 1);
+ continue;
+ }
+
+ /* Upper registers can compare and subtract-with-carry immediates.
+ Notice that compare instructions do the same as respective subtract
+ instruction; the only difference is that comparisons don't write
+ the result back to the target register. */
+
+ if (ld_reg_p)
+ {
+ if (i == 0)
+ {
+ avr_asm_len ("cpi %0,%1", xop, plen, 1);
+ continue;
+ }
+ else if (reg_unused_after (insn, xreg))
+ {
+ avr_asm_len ("sbci %0,%1", xop, plen, 1);
+ continue;
+ }
+ }
+
+ /* Must load the value into the scratch register. */
+
+ gcc_assert (REG_P (xop[2]));
+
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", xop, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len (i == 0
+ ? "cp %0,%2"
+ : "cpc %0,%2", xop, plen, 1);
+ }
+
+ return "";
+}
+
+
/* Output test instruction for HImode. */
-const char *
-out_tsthi (rtx insn, rtx op, int *l)
+const char*
+avr_out_tsthi (rtx insn, rtx *op, int *plen)
{
if (compare_sign_p (insn))
{
- if (l) *l = 1;
- return AS1 (tst,%B0);
+ avr_asm_len ("tst %B0", op, plen, -1);
}
- if (reg_unused_after (insn, op)
- && compare_eq_p (insn))
+ else if (reg_unused_after (insn, op[0])
+ && compare_eq_p (insn))
{
/* Faster than sbiw if we can clobber the operand. */
- if (l) *l = 1;
- return "or %A0,%B0";
+ avr_asm_len ("or %A0,%B0", op, plen, -1);
}
- if (test_hard_reg_class (ADDW_REGS, op))
+ else
{
- if (l) *l = 1;
- return AS2 (sbiw,%0,0);
+ avr_out_compare (insn, op, plen);
}
- if (l) *l = 2;
- return (AS2 (cp,%A0,__zero_reg__) CR_TAB
- AS2 (cpc,%B0,__zero_reg__));
+
+ return "";
}
/* Output test instruction for SImode. */
-const char *
-out_tstsi (rtx insn, rtx op, int *l)
+const char*
+avr_out_tstsi (rtx insn, rtx *op, int *plen)
{
if (compare_sign_p (insn))
{
- if (l) *l = 1;
- return AS1 (tst,%D0);
+ avr_asm_len ("tst %D0", op, plen, -1);
}
- if (test_hard_reg_class (ADDW_REGS, op))
+ else if (reg_unused_after (insn, op[0])
+ && compare_eq_p (insn))
+ {
+ /* Faster than sbiw if we can clobber the operand. */
+ avr_asm_len ("or %A0,%B0" CR_TAB
+ "or %A0,%C0" CR_TAB
+ "or %A0,%D0", op, plen, -3);
+ }
+ else
{
- if (l) *l = 3;
- return (AS2 (sbiw,%A0,0) CR_TAB
- AS2 (cpc,%C0,__zero_reg__) CR_TAB
- AS2 (cpc,%D0,__zero_reg__));
+ avr_out_compare (insn, op, plen);
}
- if (l) *l = 4;
- return (AS2 (cp,%A0,__zero_reg__) CR_TAB
- AS2 (cpc,%B0,__zero_reg__) CR_TAB
- AS2 (cpc,%C0,__zero_reg__) CR_TAB
- AS2 (cpc,%D0,__zero_reg__));
+
+ return "";
}
@@ -4462,6 +4568,318 @@ lshrsi3_out (rtx insn, rtx operands[], int *len)
return "";
}
+
+/* Output addition of register XOP[0] and compile time constant XOP[2]:
+
+ XOP[0] = XOP[0] + XOP[2]
+
+ and return "". If PLEN == NULL, print assembler instructions to perform the
+ addition; otherwise, set *PLEN to the length of the instruction sequence (in
+ words) printed with PLEN == NULL. XOP[3] is an 8-bit scratch register.
+ CODE == PLUS: perform addition by using ADD instructions.
+ CODE == MINUS: perform addition by using SUB instructions. */
+
+static void
+avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code)
+{
+ /* MODE of the operation. */
+ enum machine_mode mode = GET_MODE (xop[0]);
+
+ /* Number of bytes to operate on. */
+ int i, n_bytes = GET_MODE_SIZE (mode);
+
+ /* Value (0..0xff) held in clobber register op[3] or -1 if unknown. */
+ int clobber_val = -1;
+
+ /* op[0]: 8-bit destination register
+ op[1]: 8-bit const int
+ op[2]: 8-bit scratch register */
+ rtx op[3];
+
+ /* Started the operation? Before starting the operation we may skip
+ adding 0. This is no more true after the operation started because
+ carry must be taken into account. */
+ bool started = false;
+
+ /* Value to add. There are two ways to add VAL: R += VAL and R -= -VAL. */
+ rtx xval = xop[2];
+
+ if (MINUS == code)
+ xval = gen_int_mode (-UINTVAL (xval), mode);
+
+ op[2] = xop[3];
+
+ if (plen)
+ *plen = 0;
+
+ for (i = 0; i < n_bytes; i++)
+ {
+ /* We operate byte-wise on the destination. */
+ rtx reg8 = simplify_gen_subreg (QImode, xop[0], mode, i);
+ rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
+
+ /* 8-bit value to operate with this byte. */
+ unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
+
+ /* Registers R16..R31 can operate with immediate. */
+ bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);
+
+ op[0] = reg8;
+ op[1] = GEN_INT (val8);
+
+ if (!started && i % 2 == 0
+ && test_hard_reg_class (ADDW_REGS, reg8))
+ {
+ rtx xval16 = simplify_gen_subreg (HImode, xval, mode, i);
+ unsigned int val16 = UINTVAL (xval16) & GET_MODE_MASK (HImode);
+
+ /* Registers R24, X, Y, Z can use ADIW/SBIW with constants < 64
+ i.e. operate word-wise. */
+
+ if (val16 < 64)
+ {
+ if (val16 != 0)
+ {
+ started = true;
+ avr_asm_len (code == PLUS ? "adiw %0,%1" : "sbiw %0,%1",
+ op, plen, 1);
+ }
+
+ i++;
+ continue;
+ }
+ }
+
+ if (val8 == 0)
+ {
+ if (started)
+ avr_asm_len (code == PLUS
+ ? "adc %0,__zero_reg__" : "sbc %0,__zero_reg__",
+ op, plen, 1);
+ continue;
+ }
+
+ switch (code)
+ {
+ case PLUS:
+
+ gcc_assert (plen != NULL || REG_P (op[2]));
+
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", op, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len (started ? "adc %0,%2" : "add %0,%2", op, plen, 1);
+
+ break; /* PLUS */
+
+ case MINUS:
+
+ if (ld_reg_p)
+ avr_asm_len (started ? "sbci %0,%1" : "subi %0,%1", op, plen, 1);
+ else
+ {
+ gcc_assert (plen != NULL || REG_P (op[2]));
+
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", op, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len (started ? "sbc %0,%2" : "sub %0,%2", op, plen, 1);
+ }
+
+ break; /* MINUS */
+
+ default:
+ /* Unknown code */
+ gcc_unreachable();
+ }
+
+ started = true;
+
+ } /* for all sub-bytes */
+}
+
+
+/* Output addition of register XOP[0] and compile time constant XOP[2]:
+
+ XOP[0] = XOP[0] + XOP[2]
+
+ and return "". If PLEN == NULL, print assembler instructions to perform the
+ addition; otherwise, set *PLEN to the length of the instruction sequence (in
+ words) printed with PLEN == NULL. */
+
+const char*
+avr_out_plus (rtx *xop, int *plen)
+{
+ int len_plus, len_minus;
+
+ /* Work out if XOP[0] += XOP[2] is better or XOP[0] -= -XOP[2]. */
+
+ avr_out_plus_1 (xop, &len_plus, PLUS);
+ avr_out_plus_1 (xop, &len_minus, MINUS);
+
+ if (plen)
+ *plen = (len_minus <= len_plus) ? len_minus : len_plus;
+ else if (len_minus <= len_plus)
+ avr_out_plus_1 (xop, NULL, MINUS);
+ else
+ avr_out_plus_1 (xop, NULL, PLUS);
+
+ return "";
+}
+
+
+/* Output bit operation (IOR, AND, XOR) with register XOP[0] and compile
+ time constant XOP[2]:
+
+ XOP[0] = XOP[0] <op> XOP[2]
+
+ and return "". If PLEN == NULL, print assembler instructions to perform the
+ operation; otherwise, set *PLEN to the length of the instruction sequence
+ (in words) printed with PLEN == NULL. XOP[3] is either an 8-bit clobber
+ register or SCRATCH if no clobber register is needed for the operation. */
+
+const char*
+avr_out_bitop (rtx insn, rtx *xop, int *plen)
+{
+ /* CODE and MODE of the operation. */
+ enum rtx_code code = GET_CODE (SET_SRC (single_set (insn)));
+ enum machine_mode mode = GET_MODE (xop[0]);
+
+ /* Number of bytes to operate on. */
+ int i, n_bytes = GET_MODE_SIZE (mode);
+
+ /* Value of T-flag (0 or 1) or -1 if unknow. */
+ int set_t = -1;
+
+ /* Value (0..0xff) held in clobber register op[3] or -1 if unknown. */
+ int clobber_val = -1;
+
+ /* op[0]: 8-bit destination register
+ op[1]: 8-bit const int
+ op[2]: 8-bit clobber register or SCRATCH
+ op[3]: 8-bit register containing 0xff or NULL_RTX */
+ rtx op[4];
+
+ op[2] = xop[3];
+ op[3] = NULL_RTX;
+
+ if (plen)
+ *plen = 0;
+
+ for (i = 0; i < n_bytes; i++)
+ {
+ /* We operate byte-wise on the destination. */
+ rtx reg8 = simplify_gen_subreg (QImode, xop[0], mode, i);
+ rtx xval8 = simplify_gen_subreg (QImode, xop[2], mode, i);
+
+ /* 8-bit value to operate with this byte. */
+ unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
+
+ /* Number of bits set in the current byte of the constant. */
+ int pop8 = avr_popcount (val8);
+
+ /* Registers R16..R31 can operate with immediate. */
+ bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);
+
+ op[0] = reg8;
+ op[1] = GEN_INT (val8);
+
+ switch (code)
+ {
+ case IOR:
+
+ if (0 == pop8)
+ continue;
+ else if (ld_reg_p)
+ avr_asm_len ("ori %0,%1", op, plen, 1);
+ else if (1 == pop8)
+ {
+ if (set_t != 1)
+ avr_asm_len ("set", op, plen, 1);
+ set_t = 1;
+
+ op[1] = GEN_INT (exact_log2 (val8));
+ avr_asm_len ("bld %0,%1", op, plen, 1);
+ }
+ else if (8 == pop8)
+ {
+ if (op[3] != NULL_RTX)
+ avr_asm_len ("mov %0,%3", op, plen, 1);
+ else
+ avr_asm_len ("clr %0" CR_TAB
+ "dec %0", op, plen, 2);
+
+ op[3] = op[0];
+ }
+ else
+ {
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", op, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len ("or %0,%2", op, plen, 1);
+ }
+
+ continue; /* IOR */
+
+ case AND:
+
+ if (8 == pop8)
+ continue;
+ else if (0 == pop8)
+ avr_asm_len ("clr %0", op, plen, 1);
+ else if (ld_reg_p)
+ avr_asm_len ("andi %0,%1", op, plen, 1);
+ else if (7 == pop8)
+ {
+ if (set_t != 0)
+ avr_asm_len ("clt", op, plen, 1);
+ set_t = 0;
+
+ op[1] = GEN_INT (exact_log2 (GET_MODE_MASK (QImode) & ~val8));
+ avr_asm_len ("bld %0,%1", op, plen, 1);
+ }
+ else
+ {
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", op, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len ("and %0,%2", op, plen, 1);
+ }
+
+ continue; /* AND */
+
+ case XOR:
+
+ if (0 == pop8)
+ continue;
+ else if (8 == pop8)
+ avr_asm_len ("com %0", op, plen, 1);
+ else if (ld_reg_p && val8 == (1 << 7))
+ avr_asm_len ("subi %0,%1", op, plen, 1);
+ else
+ {
+ if (clobber_val != (int) val8)
+ avr_asm_len ("ldi %2,%1", op, plen, 1);
+ clobber_val = (int) val8;
+
+ avr_asm_len ("eor %0,%2", op, plen, 1);
+ }
+
+ continue; /* XOR */
+
+ default:
+ /* Unknown rtx_code */
+ gcc_unreachable();
+ }
+ } /* for all sub-bytes */
+
+ return "";
+}
+
/* Create RTL split patterns for byte sized rotate expressions. This
produces a series of move instructions and considers overlap situations.
Overlapping non-HImode operands need a scratch register. */
@@ -4611,151 +5029,75 @@ avr_rotate_bytes (rtx operands[])
}
/* Modifies the length assigned to instruction INSN
- LEN is the initially computed length of the insn. */
+ LEN is the initially computed length of the insn. */
int
adjust_insn_length (rtx insn, int len)
{
- rtx patt = PATTERN (insn);
- rtx set;
+ rtx *op = recog_data.operand;
+ enum attr_adjust_len adjust_len;
- if (GET_CODE (patt) == SET)
+ /* Some complex insns don't need length adjustment and therefore
+ the length need not/must not be adjusted for these insns.
+ It is easier to state this in an insn attribute "adjust_len" than
+ to clutter up code here... */
+
+ if (-1 == recog_memoized (insn))
{
- rtx op[10];
- op[1] = SET_SRC (patt);
- op[0] = SET_DEST (patt);
- if (general_operand (op[1], VOIDmode)
- && general_operand (op[0], VOIDmode))
- {
- switch (GET_MODE (op[0]))
- {
- case QImode:
- output_movqi (insn, op, &len);
- break;
- case HImode:
- output_movhi (insn, op, &len);
- break;
- case SImode:
- case SFmode:
- output_movsisf (insn, op, NULL_RTX, &len);
- break;
- default:
- break;
- }
- }
- else if (op[0] == cc0_rtx && REG_P (op[1]))
- {
- switch (GET_MODE (op[1]))
- {
- case HImode: out_tsthi (insn, op[1], &len); break;
- case SImode: out_tstsi (insn, op[1], &len); break;
- default: break;
- }
- }
- else if (GET_CODE (op[1]) == AND)
- {
- if (GET_CODE (XEXP (op[1],1)) == CONST_INT)
- {
- HOST_WIDE_INT mask = INTVAL (XEXP (op[1],1));
- if (GET_MODE (op[1]) == SImode)
- len = (((mask & 0xff) != 0xff)
- + ((mask & 0xff00) != 0xff00)
- + ((mask & 0xff0000L) != 0xff0000L)
- + ((mask & 0xff000000L) != 0xff000000L));
- else if (GET_MODE (op[1]) == HImode)
- len = (((mask & 0xff) != 0xff)
- + ((mask & 0xff00) != 0xff00));
- }
- }
- else if (GET_CODE (op[1]) == IOR)
- {
- if (GET_CODE (XEXP (op[1],1)) == CONST_INT)
- {
- HOST_WIDE_INT mask = INTVAL (XEXP (op[1],1));
- if (GET_MODE (op[1]) == SImode)
- len = (((mask & 0xff) != 0)
- + ((mask & 0xff00) != 0)
- + ((mask & 0xff0000L) != 0)
- + ((mask & 0xff000000L) != 0));
- else if (GET_MODE (op[1]) == HImode)
- len = (((mask & 0xff) != 0)
- + ((mask & 0xff00) != 0));
- }
- }
+ return len;
}
- set = single_set (insn);
- if (set)
+
+ /* Read from insn attribute "adjust_len" if/how length is to be adjusted. */
+
+ adjust_len = get_attr_adjust_len (insn);
+
+ if (adjust_len == ADJUST_LEN_NO)
+ {
+ /* Nothing to adjust: The length from attribute "length" is fine.
+ This is the default. */
+
+ return len;
+ }
+
+ /* Extract insn's operands. */
+
+ extract_constrain_insn_cached (insn);
+
+ /* Dispatch to right function. */
+
+ switch (adjust_len)
{
- rtx op[10];
+ case ADJUST_LEN_RELOAD_IN16: output_reload_inhi (op, op[2], &len); break;
+ case ADJUST_LEN_RELOAD_IN32: output_reload_insisf (op, op[2], &len); break;
+
+ case ADJUST_LEN_OUT_BITOP: avr_out_bitop (insn, op, &len); break;
+
+ case ADJUST_LEN_OUT_PLUS: avr_out_plus (op, &len); break;
+
+ case ADJUST_LEN_MOV8: output_movqi (insn, op, &len); break;
+ case ADJUST_LEN_MOV16: output_movhi (insn, op, &len); break;
+ case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
+
+ case ADJUST_LEN_TSTHI: avr_out_tsthi (insn, op, &len); break;
+ case ADJUST_LEN_TSTSI: avr_out_tstsi (insn, op, &len); break;
+ case ADJUST_LEN_COMPARE: avr_out_compare (insn, op, &len); break;
- op[1] = SET_SRC (set);
- op[0] = SET_DEST (set);
+ case ADJUST_LEN_LSHRQI: lshrqi3_out (insn, op, &len); break;
+ case ADJUST_LEN_LSHRHI: lshrhi3_out (insn, op, &len); break;
+ case ADJUST_LEN_LSHRSI: lshrsi3_out (insn, op, &len); break;
- if (GET_CODE (patt) == PARALLEL
- && general_operand (op[1], VOIDmode)
- && general_operand (op[0], VOIDmode))
- {
- if (XVECLEN (patt, 0) == 2)
- op[2] = XVECEXP (patt, 0, 1);
+ case ADJUST_LEN_ASHRQI: ashrqi3_out (insn, op, &len); break;
+ case ADJUST_LEN_ASHRHI: ashrhi3_out (insn, op, &len); break;
+ case ADJUST_LEN_ASHRSI: ashrsi3_out (insn, op, &len); break;
- switch (GET_MODE (op[0]))
- {
- case QImode:
- len = 2;
- break;
- case HImode:
- output_reload_inhi (insn, op, &len);
- break;
- case SImode:
- case SFmode:
- output_reload_insisf (insn, op, XEXP (op[2], 0), &len);
- break;
- default:
- break;
- }
- }
- else if (GET_CODE (op[1]) == ASHIFT
- || GET_CODE (op[1]) == ASHIFTRT
- || GET_CODE (op[1]) == LSHIFTRT)
- {
- rtx ops[10];
- ops[0] = op[0];
- ops[1] = XEXP (op[1],0);
- ops[2] = XEXP (op[1],1);
- switch (GET_CODE (op[1]))
- {
- case ASHIFT:
- switch (GET_MODE (op[0]))
- {
- case QImode: ashlqi3_out (insn,ops,&len); break;
- case HImode: ashlhi3_out (insn,ops,&len); break;
- case SImode: ashlsi3_out (insn,ops,&len); break;
- default: break;
- }
- break;
- case ASHIFTRT:
- switch (GET_MODE (op[0]))
- {
- case QImode: ashrqi3_out (insn,ops,&len); break;
- case HImode: ashrhi3_out (insn,ops,&len); break;
- case SImode: ashrsi3_out (insn,ops,&len); break;
- default: break;
- }
- break;
- case LSHIFTRT:
- switch (GET_MODE (op[0]))
- {
- case QImode: lshrqi3_out (insn,ops,&len); break;
- case HImode: lshrhi3_out (insn,ops,&len); break;
- case SImode: lshrsi3_out (insn,ops,&len); break;
- default: break;
- }
- break;
- default:
- break;
- }
- }
+ case ADJUST_LEN_ASHLQI: ashlqi3_out (insn, op, &len); break;
+ case ADJUST_LEN_ASHLHI: ashlhi3_out (insn, op, &len); break;
+ case ADJUST_LEN_ASHLSI: ashlsi3_out (insn, op, &len); break;
+
+ default:
+ gcc_unreachable();
}
+
return len;
}
@@ -5485,14 +5827,15 @@ avr_operand_rtx_cost (rtx x, enum machine_mode mode, enum rtx_code outer,
return total;
}
-/* The AVR backend's rtx_cost function. X is rtx expression whose cost
- is to be calculated. Return true if the complete cost has been
- computed, and false if subexpressions should be scanned. In either
- case, *TOTAL contains the cost result. */
+/* Worker function for AVR backend's rtx_cost function.
+ X is rtx expression whose cost is to be calculated.
+ Return true if the complete cost has been computed.
+ Return false if subexpressions should be scanned.
+ In either case, *TOTAL contains the cost result. */
static bool
-avr_rtx_costs (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
- int opno ATTRIBUTE_UNUSED, int *total, bool speed)
+avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
+ int opno ATTRIBUTE_UNUSED, int *total, bool speed)
{
enum rtx_code code = (enum rtx_code) codearg;
enum machine_mode mode = GET_MODE (x);
@@ -6211,23 +6554,52 @@ avr_rtx_costs (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED,
return false;
}
-/* Calculate the cost of a memory address. */
+
+/* Implement `TARGET_RTX_COSTS'. */
+
+static bool
+avr_rtx_costs (rtx x, int codearg, int outer_code,
+ int opno, int *total, bool speed)
+{
+ bool done = avr_rtx_costs_1 (x, codearg, outer_code,
+ opno, total, speed);
+
+ if (avr_log.rtx_costs)
+ {
+ avr_edump ("\n%?=%b (%s) total=%d, outer=%C:\n%r\n",
+ done, speed ? "speed" : "size", *total, outer_code, x);
+ }
+
+ return done;
+}
+
+
+/* Implement `TARGET_ADDRESS_COST'. */
static int
avr_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
{
+ int cost = 4;
+
if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x,1)) == CONST_INT
- && (REG_P (XEXP (x,0)) || GET_CODE (XEXP (x,0)) == SUBREG)
- && INTVAL (XEXP (x,1)) >= 61)
- return 18;
- if (CONSTANT_ADDRESS_P (x))
+ && CONST_INT_P (XEXP (x, 1))
+ && (REG_P (XEXP (x, 0))
+ || GET_CODE (XEXP (x, 0)) == SUBREG))
{
- if (optimize > 0 && io_address_operand (x, QImode))
- return 2;
- return 4;
+ if (INTVAL (XEXP (x, 1)) >= 61)
+ cost = 18;
+ }
+ else if (CONSTANT_ADDRESS_P (x))
+ {
+ if (optimize > 0
+ && io_address_operand (x, QImode))
+ cost = 2;
}
- return 4;
+
+ if (avr_log.address_cost)
+ avr_edump ("\n%?: %d = %r\n", cost, x);
+
+ return cost;
}
/* Test for extra memory constraint 'Q'.
@@ -6236,6 +6608,8 @@ avr_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
int
extra_constraint_Q (rtx x)
{
+ int ok = 0;
+
if (GET_CODE (XEXP (x,0)) == PLUS
&& REG_P (XEXP (XEXP (x,0), 0))
&& GET_CODE (XEXP (XEXP (x,0), 1)) == CONST_INT
@@ -6244,23 +6618,21 @@ extra_constraint_Q (rtx x)
{
rtx xx = XEXP (XEXP (x,0), 0);
int regno = REGNO (xx);
- if (TARGET_ALL_DEBUG)
- {
- fprintf (stderr, ("extra_constraint:\n"
- "reload_completed: %d\n"
- "reload_in_progress: %d\n"),
- reload_completed, reload_in_progress);
- debug_rtx (x);
- }
- if (regno >= FIRST_PSEUDO_REGISTER)
- return 1; /* allocate pseudos */
- else if (regno == REG_Z || regno == REG_Y)
- return 1; /* strictly check */
- else if (xx == frame_pointer_rtx
- || xx == arg_pointer_rtx)
- return 1; /* XXX frame & arg pointer checks */
+
+ ok = (/* allocate pseudos */
+ regno >= FIRST_PSEUDO_REGISTER
+ /* strictly check */
+ || regno == REG_Z || regno == REG_Y
+ /* XXX frame & arg pointer checks */
+ || xx == frame_pointer_rtx
+ || xx == arg_pointer_rtx);
+
+ if (avr_log.constraints)
+ avr_edump ("\n%?=%d reload_completed=%d reload_in_progress=%d\n %r\n",
+ ok, reload_completed, reload_in_progress, x);
}
- return 0;
+
+ return ok;
}
/* Convert condition code CONDITION to the valid AVR condition code. */
@@ -6658,61 +7030,18 @@ avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
return !(regno & 1);
}
-const char *
-output_reload_inhi (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
-{
- int tmp;
- if (!len)
- len = &tmp;
-
- if (GET_CODE (operands[1]) == CONST_INT)
- {
- int val = INTVAL (operands[1]);
- if ((val & 0xff) == 0)
- {
- *len = 3;
- return (AS2 (mov,%A0,__zero_reg__) CR_TAB
- AS2 (ldi,%2,hi8(%1)) CR_TAB
- AS2 (mov,%B0,%2));
- }
- else if ((val & 0xff00) == 0)
- {
- *len = 3;
- return (AS2 (ldi,%2,lo8(%1)) CR_TAB
- AS2 (mov,%A0,%2) CR_TAB
- AS2 (mov,%B0,__zero_reg__));
- }
- else if ((val & 0xff) == ((val & 0xff00) >> 8))
- {
- *len = 3;
- return (AS2 (ldi,%2,lo8(%1)) CR_TAB
- AS2 (mov,%A0,%2) CR_TAB
- AS2 (mov,%B0,%2));
- }
- }
- *len = 4;
- return (AS2 (ldi,%2,lo8(%1)) CR_TAB
- AS2 (mov,%A0,%2) CR_TAB
- AS2 (ldi,%2,hi8(%1)) CR_TAB
- AS2 (mov,%B0,%2));
-}
-
-
-/* Reload a SI or SF compile time constant (OP[1]) into a GPR (OP[0]).
- CLOBBER_REG is a QI clobber reg needed to move vast majority of consts
- into a NO_LD_REGS. If CLOBBER_REG is NULL_RTX we either don't need a
- clobber reg or have to cook one up.
-
- LEN == NULL: Output instructions.
-
- LEN != NULL: Output nothing. Increment *LEN by number of words occupied
- by the insns printed.
- Return "". */
+/* A helper for `output_reload_insisf' and `output_reload_inhi'. */
+/* Set 32-bit register OP[0] to compile-time constant OP[1].
+ CLOBBER_REG is a QI clobber register or NULL_RTX.
+ LEN == NULL: output instructions.
+ LEN != NULL: set *LEN to the length of the instruction sequence
+ (in words) printed with LEN = NULL.
+ If CLEAR_P is true, OP[0] had been cleard to Zero already.
+ If CLEAR_P is false, nothing is known about OP[0]. */
-const char *
-output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
- rtx *op, rtx clobber_reg, int *len)
+static void
+output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
{
rtx src = op[1];
rtx dest = op[0];
@@ -6732,7 +7061,8 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
/* (REG:SI 14) is special: It's neither in LD_REGS nor in NO_LD_REGS
but has some subregs that are in LD_REGS. Use the MSB (REG:QI 17). */
- if (14 == REGNO (dest))
+ if (14 == REGNO (dest)
+ && 4 == GET_MODE_SIZE (mode))
{
clobber_reg = gen_rtx_REG (QImode, 17);
}
@@ -6742,25 +7072,16 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
a byte that is neither 0, -1 or a power of 2. */
if (NULL_RTX == clobber_reg
- && !test_hard_reg_class (LD_REGS, dest))
+ && !test_hard_reg_class (LD_REGS, dest)
+ && !avr_popcount_each_byte (src, GET_MODE_SIZE (mode),
+ (1 << 0) | (1 << 1) | (1 << 8)))
{
- for (n = 0; n < GET_MODE_SIZE (mode); n++)
- {
- xval = simplify_gen_subreg (QImode, src, mode, n);
-
- if (!(const0_rtx == xval
- || constm1_rtx == xval
- || single_one_operand (xval, QImode)))
- {
- /* We have no clobber reg but need one. Cook one up.
- That's cheaper than loading from constant pool. */
-
- cooked_clobber_p = true;
- clobber_reg = gen_rtx_REG (QImode, REG_Z + 1);
- avr_asm_len ("mov __tmp_reg__,%0", &clobber_reg, len, 1);
- break;
- }
- }
+ /* We have no clobber register but need one. Cook one up.
+ That's cheaper than loading from constant pool. */
+
+ cooked_clobber_p = true;
+ clobber_reg = gen_rtx_REG (QImode, REG_Z + 1);
+ avr_asm_len ("mov __tmp_reg__,%0", &clobber_reg, len, 1);
}
/* Now start filling DEST from LSB to MSB. */
@@ -6787,7 +7108,12 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
if (INTVAL (lo16) == INTVAL (hi16))
{
- avr_asm_len ("movw %C0,%A0", &op[0], len, 1);
+ if (0 != INTVAL (lo16)
+ || !clear_p)
+ {
+ avr_asm_len ("movw %C0,%A0", &op[0], len, 1);
+ }
+
break;
}
}
@@ -6797,7 +7123,9 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
if (ival[n] == 0)
{
- avr_asm_len ("clr %0", &xdest[n], len, 1);
+ if (!clear_p)
+ avr_asm_len ("clr %0", &xdest[n], len, 1);
+
continue;
}
@@ -6837,8 +7165,18 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
if (-1 == ival[n])
{
- avr_asm_len ("clr %0" CR_TAB
- "dec %0", &xdest[n], len, 2);
+ if (!clear_p)
+ avr_asm_len ("clr %0", &xdest[n], len, 1);
+
+ avr_asm_len ("dec %0", &xdest[n], len, 1);
+ continue;
+ }
+ else if (1 == ival[n])
+ {
+ if (!clear_p)
+ avr_asm_len ("clr %0", &xdest[n], len, 1);
+
+ avr_asm_len ("inc %0", &xdest[n], len, 1);
continue;
}
@@ -6848,13 +7186,6 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
if (NULL_RTX == clobber_reg
&& single_one_operand (xval, QImode))
{
- if (1 == ival[n])
- {
- avr_asm_len ("clr %0" CR_TAB
- "inc %0", &xdest[n], len, 2);
- continue;
- }
-
xop[0] = xdest[n];
xop[1] = GEN_INT (exact_log2 (ival[n] & GET_MODE_MASK (QImode)));
@@ -6866,8 +7197,10 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
avr_asm_len ("set", xop, len, 1);
}
- avr_asm_len ("clr %0" CR_TAB
- "bld %0,%1", xop, len, 2);
+ if (!clear_p)
+ avr_asm_len ("clr %0", xop, len, 1);
+
+ avr_asm_len ("bld %0,%1", xop, len, 1);
continue;
}
@@ -6890,7 +7223,124 @@ output_reload_insisf (rtx insn ATTRIBUTE_UNUSED,
{
avr_asm_len ("mov %0,__tmp_reg__", &clobber_reg, len, 1);
}
-
+}
+
+
+/* Reload the constant OP[1] into the HI register OP[0].
+ CLOBBER_REG is a QI clobber reg needed to move vast majority of consts
+ into a NO_LD_REGS register. If CLOBBER_REG is NULL_RTX we either don't
+ need a clobber reg or have to cook one up.
+
+ PLEN == NULL: Output instructions.
+ PLEN != NULL: Output nothing. Set *PLEN to number of words occupied
+ by the insns printed.
+
+ Return "". */
+
+const char*
+output_reload_inhi (rtx *op, rtx clobber_reg, int *plen)
+{
+ if (CONST_INT_P (op[1]))
+ {
+ output_reload_in_const (op, clobber_reg, plen, false);
+ }
+ else if (test_hard_reg_class (LD_REGS, op[0]))
+ {
+ avr_asm_len ("ldi %A0,lo8(%1)" CR_TAB
+ "ldi %B0,hi8(%1)", op, plen, -2);
+ }
+ else
+ {
+ rtx xop[3];
+
+ xop[0] = op[0];
+ xop[1] = op[1];
+ xop[2] = clobber_reg;
+
+ if (plen)
+ *plen = 0;
+
+ if (clobber_reg == NULL_RTX)
+ {
+ /* No scratch register provided: cook une up. */
+
+ xop[2] = gen_rtx_REG (QImode, REG_Z + 1);
+ avr_asm_len ("mov __tmp_reg__,%2", xop, plen, 1);
+ }
+
+ avr_asm_len ("ldi %2,lo8(%1)" CR_TAB
+ "mov %A0,%2" CR_TAB
+ "ldi %2,hi8(%1)" CR_TAB
+ "mov %B0,%2", xop, plen, 4);
+
+ if (clobber_reg == NULL_RTX)
+ {
+ avr_asm_len ("mov %2,__tmp_reg__", xop, plen, 1);
+ }
+ }
+
+ return "";
+}
+
+
+/* Reload a SI or SF compile time constant OP[1] into the register OP[0].
+ CLOBBER_REG is a QI clobber reg needed to move vast majority of consts
+ into a NO_LD_REGS register. If CLOBBER_REG is NULL_RTX we either don't
+ need a clobber reg or have to cook one up.
+
+ LEN == NULL: Output instructions.
+
+ LEN != NULL: Output nothing. Set *LEN to number of words occupied
+ by the insns printed.
+
+ Return "". */
+
+const char *
+output_reload_insisf (rtx *op, rtx clobber_reg, int *len)
+{
+ gcc_assert (REG_P (op[0])
+ && CONSTANT_P (op[1]));
+
+ if (AVR_HAVE_MOVW
+ && !test_hard_reg_class (LD_REGS, op[0]))
+ {
+ int len_clr, len_noclr;
+
+ /* In some cases it is better to clear the destination beforehand, e.g.
+
+ CLR R2 CLR R3 MOVW R4,R2 INC R2
+
+ is shorther than
+
+ CLR R2 INC R2 CLR R3 CLR R4 CLR R5
+
+ We find it too tedious to work that out in the print function.
+ Instead, we call the print function twice to get the lengths of
+ both methods and use the shortest one. */
+
+ output_reload_in_const (op, clobber_reg, &len_clr, true);
+ output_reload_in_const (op, clobber_reg, &len_noclr, false);
+
+ if (len_noclr - len_clr == 4)
+ {
+ /* Default needs 4 CLR instructions: clear register beforehand. */
+
+ avr_asm_len ("clr %A0" CR_TAB
+ "clr %B0" CR_TAB
+ "movw %C0,%A0", &op[0], len, 3);
+
+ output_reload_in_const (op, clobber_reg, len, true);
+
+ if (len)
+ *len += 3;
+
+ return "";
+ }
+ }
+
+ /* Default: destination not pre-cleared. */
+
+ output_reload_in_const (op, clobber_reg, len, false);
return "";
}
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 80bb8f5300d..3b1800d3fb0 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -128,6 +128,22 @@
(const_int 2))]
(const_int 2)))
+;; Lengths of several insns are adjusted in avr.c:adjust_insn_length().
+;; Following insn attribute tells if and how the adjustment has to be
+;; done:
+;; no No adjustment needed; attribute "length" is fine.
+;; yes Analyse pattern in adjust_insn_length by hand.
+;; Otherwise do special processing depending on the attribute.
+
+(define_attr "adjust_len"
+ "out_bitop, out_plus, tsthi, tstsi, compare,
+ mov8, mov16, mov32, reload_in16, reload_in32,
+ ashlqi, ashrqi, lshrqi,
+ ashlhi, ashrhi, lshrhi,
+ ashlsi, ashrsi, lshrsi,
+ no"
+ (const_string "no"))
+
;; Define mode iterators
(define_mode_iterator QIHI [(QI "") (HI "")])
(define_mode_iterator QIHI2 [(QI "") (HI "")])
@@ -286,6 +302,7 @@
|| register_operand (operands[1], QImode) || const0_rtx == operands[1])"
"* return output_movqi (insn, operands, NULL);"
[(set_attr "length" "1,1,5,5,1,1,4")
+ (set_attr "adjust_len" "mov8")
(set_attr "cc" "none,none,clobber,clobber,none,none,clobber")])
;; This is used in peephole2 to optimize loading immediate constants
@@ -376,18 +393,22 @@
(match_operand:HI 1 "immediate_operand" "i"))
(clobber (match_operand:QI 2 "register_operand" "=&d"))]
"reload_completed"
- "* return output_reload_inhi (insn, operands, NULL);"
+ {
+ return output_reload_inhi (operands, operands[2], NULL);
+ }
[(set_attr "length" "4")
+ (set_attr "adjust_len" "reload_in16")
(set_attr "cc" "none")])
(define_insn "*movhi"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,d,*r,q,r")
- (match_operand:HI 1 "general_operand" "rL,m,rL,i,i,r,q"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m,d,*r,q,r")
+ (match_operand:HI 1 "general_operand" "r,L,m,rL,i,i,r,q"))]
"(register_operand (operands[0],HImode)
|| register_operand (operands[1],HImode) || const0_rtx == operands[1])"
"* return output_movhi (insn, operands, NULL);"
- [(set_attr "length" "2,6,7,2,6,5,2")
- (set_attr "cc" "none,clobber,clobber,none,clobber,none,none")])
+ [(set_attr "length" "2,2,6,7,2,6,5,2")
+ (set_attr "adjust_len" "mov16")
+ (set_attr "cc" "none,clobber,clobber,clobber,none,clobber,none,none")])
(define_peephole2 ; movw
[(set (match_operand:QI 0 "even_register_operand" "")
@@ -454,9 +475,10 @@
(clobber (match_operand:QI 2 "register_operand" "=&d"))]
"reload_completed"
{
- return output_reload_insisf (insn, operands, operands[2], NULL);
+ return output_reload_insisf (operands, operands[2], NULL);
}
[(set_attr "length" "8")
+ (set_attr "adjust_len" "reload_in32")
(set_attr "cc" "clobber")])
@@ -466,9 +488,10 @@
"(register_operand (operands[0],SImode)
|| register_operand (operands[1],SImode) || const0_rtx == operands[1])"
{
- return output_movsisf (insn, operands, NULL_RTX, NULL);
+ return output_movsisf (insn, operands, NULL);
}
[(set_attr "length" "4,4,8,9,4,10")
+ (set_attr "adjust_len" "mov32")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")])
;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
@@ -495,9 +518,10 @@
|| register_operand (operands[1], SFmode)
|| operands[1] == CONST0_RTX (SFmode)"
{
- return output_movsisf (insn, operands, NULL_RTX, NULL);
+ return output_movsisf (insn, operands, NULL);
}
[(set_attr "length" "4,4,8,9,4,10")
+ (set_attr "adjust_len" "mov32")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")])
(define_peephole2 ; *reload_insf
@@ -518,9 +542,10 @@
(clobber (match_operand:QI 2 "register_operand" "=&d"))]
"reload_completed"
{
- return output_reload_insisf (insn, operands, operands[2], NULL);
+ return output_reload_insisf (operands, operands[2], NULL);
}
[(set_attr "length" "8")
+ (set_attr "adjust_len" "reload_in32")
(set_attr "cc" "clobber")])
;;=========================================================================
@@ -896,31 +921,46 @@
(set_attr "cc" "set_n,set_czn,set_czn,set_czn,set_n,set_n")])
(define_insn "addsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r")
- (plus:SI
- (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,l,l ,d,r")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0 ,0 ,0,0,0 ,0,0")
+ (match_operand:SI 2 "nonmemory_operand" "r,I ,J ,s,P,N ,n,n")))
+ (clobber (match_scratch:QI 3 "=X,X ,X ,X,X,X ,X,&d"))]
""
- "@
- add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2
- adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__
- sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__
- subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2))
- sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__
- sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
- [(set_attr "length" "4,3,3,4,5,5")
- (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n")])
+ {
+ static const char * const asm_code[] =
+ {
+ "add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2",
+ "adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__",
+ "sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__",
+ "subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2))",
+ "sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__",
+ "sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
+ };
+
+ if (which_alternative >= (signed) (sizeof (asm_code) / sizeof (*asm_code)))
+ return avr_out_plus (operands, NULL);
+
+ return asm_code [which_alternative];
+ }
+ [(set_attr "length" "4,3,3,4,5,5,8,8")
+ (set_attr "adjust_len" "*,*,*,*,*,*,out_plus,out_plus")
+ (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n,clobber,clobber")])
(define_insn "*addsi3_zero_extend"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (plus:SI (zero_extend:SI
- (match_operand:QI 1 "register_operand" "r"))
- (match_operand:SI 2 "register_operand" "0")))]
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (zero_extend:SI (match_operand:QI 1 "register_operand" "r"))
+ (match_operand:SI 2 "register_operand" "0")))]
""
- "add %A0,%1
- adc %B0,__zero_reg__
- adc %C0,__zero_reg__
- adc %D0,__zero_reg__"
+ "add %A0,%1\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_n")])
+
+(define_insn "*addsi3_zero_extend.hi"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "r"))
+ (match_operand:SI 2 "register_operand" "0")))]
+ ""
+ "add %A0,%1\;adc %B0,%B1\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__"
[(set_attr "length" "4")
(set_attr "cc" "set_n")])
@@ -949,39 +989,40 @@
(set_attr "cc" "set_czn,set_czn")])
(define_insn "*subhi3_zero_extend1"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (minus:HI (match_operand:HI 1 "register_operand" "0")
- (zero_extend:HI
- (match_operand:QI 2 "register_operand" "r"))))]
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (minus:HI (match_operand:HI 1 "register_operand" "0")
+ (zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
""
- "sub %A0,%2
- sbc %B0,__zero_reg__"
+ "sub %A0,%2\;sbc %B0,__zero_reg__"
[(set_attr "length" "2")
- (set_attr "cc" "set_n")])
+ (set_attr "cc" "set_czn")])
(define_insn "subsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,d")
- (minus:SI (match_operand:SI 1 "register_operand" "0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,i")))]
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0")
+ (match_operand:SI 2 "register_operand" "r")))]
""
- "@
- sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2
- subi %A0,lo8(%2)\;sbci %B0,hi8(%2)\;sbci %C0,hlo8(%2)\;sbci %D0,hhi8(%2)"
- [(set_attr "length" "4,4")
- (set_attr "cc" "set_czn,set_czn")])
+ "sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_czn")])
(define_insn "*subsi3_zero_extend"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (match_operand:SI 1 "register_operand" "0")
- (zero_extend:SI
- (match_operand:QI 2 "register_operand" "r"))))]
- ""
- "sub %A0,%2
- sbc %B0,__zero_reg__
- sbc %C0,__zero_reg__
- sbc %D0,__zero_reg__"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0")
+ (zero_extend:SI (match_operand:QI 2 "register_operand" "r"))))]
+ ""
+ "sub %A0,%2\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
[(set_attr "length" "4")
- (set_attr "cc" "set_n")])
+ (set_attr "cc" "set_czn")])
+
+(define_insn "*subsi3_zero_extend.hi"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0")
+ (zero_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
+ ""
+ "sub %A0,%2\;sbc %B0,%B2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_czn")])
;******************************************************************************
; mul
@@ -2225,71 +2266,41 @@
(set_attr "cc" "set_zn,set_zn")])
(define_insn "andhi3"
- [(set (match_operand:HI 0 "register_operand" "=r,d,r")
- (and:HI (match_operand:HI 1 "register_operand" "%0,0,0")
- (match_operand:HI 2 "nonmemory_operand" "r,i,M")))
- (clobber (match_scratch:QI 3 "=X,X,&d"))]
+ [(set (match_operand:HI 0 "register_operand" "=r,d,d,r ,r")
+ (and:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0")
+ (match_operand:HI 2 "nonmemory_operand" "r,s,n,Ca2,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))]
""
-{
- if (which_alternative==0)
- return ("and %A0,%A2" CR_TAB
- "and %B0,%B2");
- else if (which_alternative==1)
- {
- if (GET_CODE (operands[2]) == CONST_INT)
- {
- int mask = INTVAL (operands[2]);
- if ((mask & 0xff) != 0xff)
- output_asm_insn (AS2 (andi,%A0,lo8(%2)), operands);
- if ((mask & 0xff00) != 0xff00)
- output_asm_insn (AS2 (andi,%B0,hi8(%2)), operands);
- return "";
- }
- return (AS2 (andi,%A0,lo8(%2)) CR_TAB
- AS2 (andi,%B0,hi8(%2)));
- }
- return (AS2 (ldi,%3,lo8(%2)) CR_TAB
- "and %A0,%3" CR_TAB
- AS1 (clr,%B0));
-}
- [(set_attr "length" "2,2,3")
- (set_attr "cc" "set_n,clobber,set_n")])
+ {
+ if (which_alternative == 0)
+ return "and %A0,%A2\;and %B0,%B2";
+ else if (which_alternative == 1)
+ return "andi %A0,lo8(%2)\;andi %B0,hi8(%2)";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "2,2,2,4,4")
+ (set_attr "adjust_len" "*,*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
(define_insn "andsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,d")
- (and:SI (match_operand:SI 1 "register_operand" "%0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,i")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,d,r ,r")
+ (and:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
+ (match_operand:SI 2 "nonmemory_operand" "r,n,Ca4,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
""
-{
- if (which_alternative==0)
- return ("and %0,%2" CR_TAB
- "and %B0,%B2" CR_TAB
- "and %C0,%C2" CR_TAB
- "and %D0,%D2");
- else if (which_alternative==1)
- {
- if (GET_CODE (operands[2]) == CONST_INT)
- {
- HOST_WIDE_INT mask = INTVAL (operands[2]);
- if ((mask & 0xff) != 0xff)
- output_asm_insn (AS2 (andi,%A0,lo8(%2)), operands);
- if ((mask & 0xff00) != 0xff00)
- output_asm_insn (AS2 (andi,%B0,hi8(%2)), operands);
- if ((mask & 0xff0000L) != 0xff0000L)
- output_asm_insn (AS2 (andi,%C0,hlo8(%2)), operands);
- if ((mask & 0xff000000L) != 0xff000000L)
- output_asm_insn (AS2 (andi,%D0,hhi8(%2)), operands);
- return "";
- }
- return (AS2 (andi, %A0,lo8(%2)) CR_TAB
- AS2 (andi, %B0,hi8(%2)) CR_TAB
- AS2 (andi, %C0,hlo8(%2)) CR_TAB
- AS2 (andi, %D0,hhi8(%2)));
- }
- return "bug";
-}
- [(set_attr "length" "4,4")
- (set_attr "cc" "set_n,clobber")])
+ {
+ if (which_alternative == 0)
+ return "and %0,%2" CR_TAB
+ "and %B0,%B2" CR_TAB
+ "and %C0,%C2" CR_TAB
+ "and %D0,%D2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "4,4,8,8")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber,clobber")])
(define_peephole2 ; andi
[(set (match_operand:QI 0 "d_register_operand" "")
@@ -2319,84 +2330,41 @@
(set_attr "cc" "set_zn,set_zn")])
(define_insn "iorhi3"
- [(set (match_operand:HI 0 "register_operand" "=r,d")
- (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
- (match_operand:HI 2 "nonmemory_operand" "r,i")))]
+ [(set (match_operand:HI 0 "register_operand" "=r,d,d,r ,r")
+ (ior:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0")
+ (match_operand:HI 2 "nonmemory_operand" "r,s,n,Co2,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))]
""
-{
- if (which_alternative==0)
- return ("or %A0,%A2" CR_TAB
- "or %B0,%B2");
- if (GET_CODE (operands[2]) == CONST_INT)
- {
- int mask = INTVAL (operands[2]);
- if (mask & 0xff)
- output_asm_insn (AS2 (ori,%A0,lo8(%2)), operands);
- if (mask & 0xff00)
- output_asm_insn (AS2 (ori,%B0,hi8(%2)), operands);
- return "";
- }
- return (AS2 (ori,%0,lo8(%2)) CR_TAB
- AS2 (ori,%B0,hi8(%2)));
-}
- [(set_attr "length" "2,2")
- (set_attr "cc" "set_n,clobber")])
+ {
+ if (which_alternative == 0)
+ return "or %A0,%A2\;or %B0,%B2";
+ else if (which_alternative == 1)
+ return "ori %A0,lo8(%2)\;ori %B0,hi8(%2)";
-(define_insn "*iorhi3_clobber"
- [(set (match_operand:HI 0 "register_operand" "=r,r")
- (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
- (match_operand:HI 2 "immediate_operand" "M,i")))
- (clobber (match_scratch:QI 3 "=&d,&d"))]
- ""
- "@
- ldi %3,lo8(%2)\;or %A0,%3
- ldi %3,lo8(%2)\;or %A0,%3\;ldi %3,hi8(%2)\;or %B0,%3"
- [(set_attr "length" "2,4")
- (set_attr "cc" "clobber,set_n")])
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "2,2,2,4,4")
+ (set_attr "adjust_len" "*,*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
(define_insn "iorsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,d")
- (ior:SI (match_operand:SI 1 "register_operand" "%0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,i")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,d,r ,r")
+ (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
+ (match_operand:SI 2 "nonmemory_operand" "r,n,Co4,n")))
+ (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
""
-{
- if (which_alternative==0)
- return ("or %0,%2" CR_TAB
- "or %B0,%B2" CR_TAB
- "or %C0,%C2" CR_TAB
- "or %D0,%D2");
- if (GET_CODE (operands[2]) == CONST_INT)
- {
- HOST_WIDE_INT mask = INTVAL (operands[2]);
- if (mask & 0xff)
- output_asm_insn (AS2 (ori,%A0,lo8(%2)), operands);
- if (mask & 0xff00)
- output_asm_insn (AS2 (ori,%B0,hi8(%2)), operands);
- if (mask & 0xff0000L)
- output_asm_insn (AS2 (ori,%C0,hlo8(%2)), operands);
- if (mask & 0xff000000L)
- output_asm_insn (AS2 (ori,%D0,hhi8(%2)), operands);
- return "";
- }
- return (AS2 (ori, %A0,lo8(%2)) CR_TAB
- AS2 (ori, %B0,hi8(%2)) CR_TAB
- AS2 (ori, %C0,hlo8(%2)) CR_TAB
- AS2 (ori, %D0,hhi8(%2)));
-}
- [(set_attr "length" "4,4")
- (set_attr "cc" "set_n,clobber")])
+ {
+ if (which_alternative == 0)
+ return "or %0,%2" CR_TAB
+ "or %B0,%B2" CR_TAB
+ "or %C0,%C2" CR_TAB
+ "or %D0,%D2";
-(define_insn "*iorsi3_clobber"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (ior:SI (match_operand:SI 1 "register_operand" "%0,0")
- (match_operand:SI 2 "immediate_operand" "M,i")))
- (clobber (match_scratch:QI 3 "=&d,&d"))]
- ""
- "@
- ldi %3,lo8(%2)\;or %A0,%3
- ldi %3,lo8(%2)\;or %A0,%3\;ldi %3,hi8(%2)\;or %B0,%3\;ldi %3,hlo8(%2)\;or %C0,%3\;ldi %3,hhi8(%2)\;or %D0,%3"
- [(set_attr "length" "2,8")
- (set_attr "cc" "clobber,set_n")])
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "4,4,8,8")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber,clobber")])
;;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;; xor
@@ -2411,49 +2379,77 @@
(set_attr "cc" "set_zn")])
(define_insn "xorhi3"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (xor:HI (match_operand:HI 1 "register_operand" "%0")
- (match_operand:HI 2 "register_operand" "r")))]
+ [(set (match_operand:HI 0 "register_operand" "=r,r ,r")
+ (xor:HI (match_operand:HI 1 "register_operand" "%0,0 ,0")
+ (match_operand:HI 2 "nonmemory_operand" "r,Cx2,n")))
+ (clobber (match_scratch:QI 3 "=X,X ,&d"))]
""
- "eor %0,%2
- eor %B0,%B2"
- [(set_attr "length" "2")
- (set_attr "cc" "set_n")])
+ {
+ if (which_alternative == 0)
+ return "eor %A0,%A2\;eor %B0,%B2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "2,2,4")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber")])
(define_insn "xorsi3"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (xor:SI (match_operand:SI 1 "register_operand" "%0")
- (match_operand:SI 2 "register_operand" "r")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r ,r")
+ (xor:SI (match_operand:SI 1 "register_operand" "%0,0 ,0")
+ (match_operand:SI 2 "nonmemory_operand" "r,Cx4,n")))
+ (clobber (match_scratch:QI 3 "=X,X ,&d"))]
""
- "eor %0,%2
- eor %B0,%B2
- eor %C0,%C2
- eor %D0,%D2"
- [(set_attr "length" "4")
- (set_attr "cc" "set_n")])
+ {
+ if (which_alternative == 0)
+ return "eor %0,%2" CR_TAB
+ "eor %B0,%B2" CR_TAB
+ "eor %C0,%C2" CR_TAB
+ "eor %D0,%D2";
+
+ return avr_out_bitop (insn, operands, NULL);
+ }
+ [(set_attr "length" "4,8,8")
+ (set_attr "adjust_len" "*,out_bitop,out_bitop")
+ (set_attr "cc" "set_n,clobber,clobber")])
;; swap swap swap swap swap swap swap swap swap swap swap swap swap swap swap
;; swap
(define_expand "rotlqi3"
[(set (match_operand:QI 0 "register_operand" "")
- (rotate:QI (match_operand:QI 1 "register_operand" "")
- (match_operand:QI 2 "const_int_operand" "")))]
+ (rotate:QI (match_operand:QI 1 "register_operand" "")
+ (match_operand:QI 2 "const_0_to_7_operand" "")))]
""
- "
-{
- if (!CONST_INT_P (operands[2]) || (INTVAL (operands[2]) != 4))
- FAIL;
-}")
+ {
+ if (!CONST_INT_P (operands[2]))
+ FAIL;
-(define_insn "rotlqi3_4"
- [(set (match_operand:QI 0 "register_operand" "=r")
- (rotate:QI (match_operand:QI 1 "register_operand" "0")
- (const_int 4)))]
+ operands[2] = gen_int_mode (INTVAL (operands[2]) & 7, QImode);
+ })
+
+;; Expander used by __builtin_avr_swap
+(define_expand "rotlqi3_4"
+ [(set (match_operand:QI 0 "register_operand" "")
+ (rotate:QI (match_operand:QI 1 "register_operand" "")
+ (const_int 4)))])
+
+(define_insn "*rotlqi3"
+ [(set (match_operand:QI 0 "register_operand" "=r,r,r ,r ,r ,r ,r ,r")
+ (rotate:QI (match_operand:QI 1 "register_operand" "0,0,0 ,0 ,0 ,0 ,0 ,0")
+ (match_operand:QI 2 "const_0_to_7_operand" "P,K,C03,C04,C05,C06,C07,L")))]
""
- "swap %0"
- [(set_attr "length" "1")
- (set_attr "cc" "none")])
+ "@
+ lsl %0\;adc %0,__zero_reg__
+ lsl %0\;adc %0,__zero_reg__\;lsl %0\;adc %0,__zero_reg__
+ swap %0\;bst %0,0\;ror %0\;bld %0,7
+ swap %0
+ swap %0\;lsl %0\;adc %0,__zero_reg__
+ swap %0\;lsl %0\;adc %0,__zero_reg__\;lsl %0\;adc %0,__zero_reg__
+ bst %0,0\;ror %0\;bld %0,7
+ "
+ [(set_attr "length" "2,4,4,1,3,5,3,0")
+ (set_attr "cc" "set_n,set_n,clobber,none,set_n,set_n,clobber,none")])
;; Split all rotates of HI,SI and DImode registers where rotation is by
;; a whole number of bytes. The split creates the appropriate moves and
@@ -2465,25 +2461,79 @@
(define_mode_attr rotx [(DI "&r,&r,X") (SI "&r,&r,X") (HI "X,X,X")])
(define_mode_attr rotsmode [(DI "QI") (SI "HI") (HI "QI")])
+;; "rotlhi3"
+;; "rotlsi3"
+;; "rotldi3"
(define_expand "rotl<mode>3"
[(parallel [(set (match_operand:HIDI 0 "register_operand" "")
- (rotate:HIDI (match_operand:HIDI 1 "register_operand" "")
- (match_operand:VOID 2 "const_int_operand" "")))
- (clobber (match_dup 3))])]
+ (rotate:HIDI (match_operand:HIDI 1 "register_operand" "")
+ (match_operand:VOID 2 "const_int_operand" "")))
+ (clobber (match_dup 3))])]
""
{
- if (CONST_INT_P (operands[2])
- && 0 == INTVAL (operands[2]) % 8)
+ int offset;
+
+ if (!CONST_INT_P (operands[2]))
+ FAIL;
+
+ offset = INTVAL (operands[2]);
+
+ if (0 == offset % 8)
{
- if (AVR_HAVE_MOVW && 0 == INTVAL (operands[2]) % 16)
+ if (AVR_HAVE_MOVW && 0 == offset % 16)
operands[3] = gen_rtx_SCRATCH (<rotsmode>mode);
else
operands[3] = gen_rtx_SCRATCH (QImode);
}
+ else if (<MODE>mode != DImode
+ && (offset == 1
+ || offset == GET_MODE_BITSIZE (<MODE>mode) -1))
+ {
+ /*; Support rotate left/right by 1 */
+
+ emit_move_insn (operands[0],
+ gen_rtx_ROTATE (<MODE>mode, operands[1], operands[2]));
+ DONE;
+ }
else
FAIL;
})
+(define_insn "*rotlhi2.1"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (rotate:HI (match_operand:HI 1 "register_operand" "0")
+ (const_int 1)))]
+ ""
+ "lsl %A0\;rol %B0\;adc %A0,__zero_reg__"
+ [(set_attr "length" "3")
+ (set_attr "cc" "clobber")])
+
+(define_insn "*rotlhi2.15"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (rotate:HI (match_operand:HI 1 "register_operand" "0")
+ (const_int 15)))]
+ ""
+ "bst %A0,0\;ror %B0\;ror %A0\;bld %B0,7"
+ [(set_attr "length" "3")
+ (set_attr "cc" "clobber")])
+
+(define_insn "*rotlsi2.1"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (rotate:SI (match_operand:SI 1 "register_operand" "0")
+ (const_int 1)))]
+ ""
+ "lsl %A0\;rol %B0\;rol %C0\;rol %D0\;adc %A0,__zero_reg__"
+ [(set_attr "length" "5")
+ (set_attr "cc" "clobber")])
+
+(define_insn "*rotlsi2.31"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (rotate:SI (match_operand:SI 1 "register_operand" "0")
+ (const_int 31)))]
+ ""
+ "bst %A0,0\;ror %D0\;ror %C0\;ror %B0\;ror %A0\;bld %D0,7"
+ [(set_attr "length" "6")
+ (set_attr "cc" "clobber")])
;; Overlapping non-HImode registers often (but not always) need a scratch.
;; The best we can do is use early clobber alternative "#&r" so that
@@ -2491,7 +2541,11 @@
;; allocation does not prefer non-overlapping.
-; Split word aligned rotates using scratch that is mode dependent.
+;; Split word aligned rotates using scratch that is mode dependent.
+
+;; "*rotwhi"
+;; "*rotwsi"
+;; "*rotwdi"
(define_insn_and_split "*rotw<mode>"
[(set (match_operand:HIDI 0 "register_operand" "=r,r,#&r")
(rotate:HIDI (match_operand:HIDI 1 "register_operand" "0,r,r")
@@ -2509,7 +2563,11 @@
})
-; Split byte aligned rotates using scratch that is always QI mode.
+;; Split byte aligned rotates using scratch that is always QI mode.
+
+;; "*rotbhi"
+;; "*rotbsi"
+;; "*rotbdi"
(define_insn_and_split "*rotb<mode>"
[(set (match_operand:HIDI 0 "register_operand" "=r,r,#&r")
(rotate:HIDI (match_operand:HIDI 1 "register_operand" "0,r,r")
@@ -2574,6 +2632,7 @@
""
"* return ashlqi3_out (insn, operands, NULL);"
[(set_attr "length" "5,0,1,2,4,6,9")
+ (set_attr "adjust_len" "ashlqi")
(set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
(define_insn "ashlhi3"
@@ -2583,6 +2642,7 @@
""
"* return ashlhi3_out (insn, operands, NULL);"
[(set_attr "length" "6,0,2,2,4,10,10")
+ (set_attr "adjust_len" "ashlhi")
(set_attr "cc" "clobber,none,set_n,clobber,set_n,clobber,clobber")])
@@ -2674,6 +2734,7 @@
""
"* return ashlsi3_out (insn, operands, NULL);"
[(set_attr "length" "8,0,4,4,8,10,12")
+ (set_attr "adjust_len" "ashlsi")
(set_attr "cc" "clobber,none,set_n,clobber,set_n,clobber,clobber")])
;; Optimize if a scratch register from LD_REGS happens to be available.
@@ -2731,6 +2792,7 @@
"reload_completed"
"* return ashlhi3_out (insn, operands, NULL);"
[(set_attr "length" "0,2,2,4,10")
+ (set_attr "adjust_len" "ashlhi")
(set_attr "cc" "none,set_n,clobber,set_n,clobber")])
(define_peephole2
@@ -2751,19 +2813,21 @@
"reload_completed"
"* return ashlsi3_out (insn, operands, NULL);"
[(set_attr "length" "0,4,4,10")
+ (set_attr "adjust_len" "ashlsi")
(set_attr "cc" "none,set_n,clobber,clobber")])
;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
;; arithmetic shift right
(define_insn "ashrqi3"
- [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r,r")
- (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0")
- (match_operand:QI 2 "general_operand" "r,L,P,K,n,Qm")))]
+ [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r ,r ,r")
+ (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0 ,0 ,0")
+ (match_operand:QI 2 "general_operand" "r,L,P,K,C03 C04 C05,C06 C07,Qm")))]
""
"* return ashrqi3_out (insn, operands, NULL);"
- [(set_attr "length" "5,0,1,2,5,9")
- (set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber")])
+ [(set_attr "length" "5,0,1,2,5,4,9")
+ (set_attr "adjust_len" "ashrqi")
+ (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,clobber,clobber")])
(define_insn "ashrhi3"
[(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r,r")
@@ -2772,6 +2836,7 @@
""
"* return ashrhi3_out (insn, operands, NULL);"
[(set_attr "length" "6,0,2,4,4,10,10")
+ (set_attr "adjust_len" "ashrhi")
(set_attr "cc" "clobber,none,clobber,set_n,clobber,clobber,clobber")])
(define_insn "ashrsi3"
@@ -2781,6 +2846,7 @@
""
"* return ashrsi3_out (insn, operands, NULL);"
[(set_attr "length" "8,0,4,6,8,10,12")
+ (set_attr "adjust_len" "ashrsi")
(set_attr "cc" "clobber,none,clobber,set_n,clobber,clobber,clobber")])
;; Optimize if a scratch register from LD_REGS happens to be available.
@@ -2803,6 +2869,7 @@
"reload_completed"
"* return ashrhi3_out (insn, operands, NULL);"
[(set_attr "length" "0,2,4,4,10")
+ (set_attr "adjust_len" "ashrhi")
(set_attr "cc" "none,clobber,set_n,clobber,clobber")])
(define_peephole2
@@ -2823,6 +2890,7 @@
"reload_completed"
"* return ashrsi3_out (insn, operands, NULL);"
[(set_attr "length" "0,4,4,10")
+ (set_attr "adjust_len" "ashrsi")
(set_attr "cc" "none,clobber,set_n,clobber")])
;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
@@ -2871,6 +2939,7 @@
""
"* return lshrqi3_out (insn, operands, NULL);"
[(set_attr "length" "5,0,1,2,4,6,9")
+ (set_attr "adjust_len" "lshrqi")
(set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
(define_insn "lshrhi3"
@@ -2880,6 +2949,7 @@
""
"* return lshrhi3_out (insn, operands, NULL);"
[(set_attr "length" "6,0,2,2,4,10,10")
+ (set_attr "adjust_len" "lshrhi")
(set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber,clobber")])
(define_insn "lshrsi3"
@@ -2889,6 +2959,7 @@
""
"* return lshrsi3_out (insn, operands, NULL);"
[(set_attr "length" "8,0,4,4,8,10,12")
+ (set_attr "adjust_len" "lshrsi")
(set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber,clobber")])
;; Optimize if a scratch register from LD_REGS happens to be available.
@@ -2946,6 +3017,7 @@
"reload_completed"
"* return lshrhi3_out (insn, operands, NULL);"
[(set_attr "length" "0,2,2,4,10")
+ (set_attr "adjust_len" "lshrhi")
(set_attr "cc" "none,clobber,clobber,clobber,clobber")])
(define_peephole2
@@ -2966,6 +3038,7 @@
"reload_completed"
"* return lshrsi3_out (insn, operands, NULL);"
[(set_attr "length" "0,4,4,10")
+ (set_attr "adjust_len" "lshrsi")
(set_attr "cc" "none,clobber,clobber,clobber")])
;; abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x)
@@ -3298,125 +3371,62 @@
(define_insn "*cmpqi_sign_extend"
[(set (cc0)
- (compare (sign_extend:HI
- (match_operand:QI 0 "register_operand" "d"))
- (match_operand:HI 1 "const_int_operand" "n")))]
- "INTVAL (operands[1]) >= -128 && INTVAL (operands[1]) <= 127"
+ (compare (sign_extend:HI (match_operand:QI 0 "register_operand" "d"))
+ (match_operand:HI 1 "s8_operand" "n")))]
+ ""
"cpi %0,lo8(%1)"
[(set_attr "cc" "compare")
(set_attr "length" "1")])
(define_insn "*cmphi"
[(set (cc0)
- (compare (match_operand:HI 0 "register_operand" "!w,r,r,d,d,r,r")
- (match_operand:HI 1 "nonmemory_operand" "L,L,r,M,i,M,i")))
- (clobber (match_scratch:QI 2 "=X,X,X,X,&d,&d,&d"))]
+ (compare (match_operand:HI 0 "register_operand" "!w,r,r,d ,r ,d,r")
+ (match_operand:HI 1 "nonmemory_operand" "L ,L,r,s ,s ,M,n")))
+ (clobber (match_scratch:QI 2 "=X ,X,X,&d,&d ,X,&d"))]
""
- "*{
- switch (which_alternative)
- {
- case 0: case 1:
- return out_tsthi (insn, operands[0], NULL);
-
- case 2:
- return (AS2 (cp,%A0,%A1) CR_TAB
- AS2 (cpc,%B0,%B1));
- case 3:
- if (reg_unused_after (insn, operands[0])
- && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63
- && test_hard_reg_class (ADDW_REGS, operands[0]))
- return AS2 (sbiw,%0,%1);
- else
- return (AS2 (cpi,%0,%1) CR_TAB
- AS2 (cpc,%B0,__zero_reg__));
- case 4:
- if (reg_unused_after (insn, operands[0]))
- return (AS2 (subi,%0,lo8(%1)) CR_TAB
- AS2 (sbci,%B0,hi8(%1)));
- else
- return (AS2 (ldi, %2,hi8(%1)) CR_TAB
- AS2 (cpi, %A0,lo8(%1)) CR_TAB
- AS2 (cpc, %B0,%2));
- case 5:
- return (AS2 (ldi, %2,lo8(%1)) CR_TAB
- AS2 (cp, %A0,%2) CR_TAB
- AS2 (cpc, %B0,__zero_reg__));
-
- case 6:
- return (AS2 (ldi, %2,lo8(%1)) CR_TAB
- AS2 (cp, %A0,%2) CR_TAB
- AS2 (ldi, %2,hi8(%1)) CR_TAB
- AS2 (cpc, %B0,%2));
- }
- return \"bug\";
-}"
- [(set_attr "cc" "compare,compare,compare,compare,compare,compare,compare")
- (set_attr "length" "1,2,2,2,3,3,4")])
+ {
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ return avr_out_tsthi (insn, operands, NULL);
+
+ case 2:
+ return "cp %A0,%A1\;cpc %B0,%B1";
+
+ case 3:
+ return reg_unused_after (insn, operands[0])
+ ? "subi %A0,lo8(%1)\;sbci %B0,hi8(%1)"
+ : "ldi %2,hi8(%1)\;cpi %A0,lo8(%1)\;cpc %B0,%2";
+
+ case 4:
+ return "ldi %2,lo8(%1)\;cp %A0,%2\;ldi %2,hi8(%1)\;cpc %B0,%2";
+ }
+
+ return avr_out_compare (insn, operands, NULL);
+ }
+ [(set_attr "cc" "compare")
+ (set_attr "length" "1,2,2,3,4,2,4")
+ (set_attr "adjust_len" "tsthi,tsthi,*,*,*,compare,compare")])
(define_insn "*cmpsi"
[(set (cc0)
- (compare (match_operand:SI 0 "register_operand" "r,r,d,d,r,r")
- (match_operand:SI 1 "nonmemory_operand" "L,r,M,i,M,i")))
- (clobber (match_scratch:QI 2 "=X,X,X,&d,&d,&d"))]
+ (compare (match_operand:SI 0 "register_operand" "r,r ,d,r ,r")
+ (match_operand:SI 1 "nonmemory_operand" "L,r ,M,M ,n")))
+ (clobber (match_scratch:QI 2 "=X,X ,X,&d,&d"))]
""
- "*{
- switch (which_alternative)
- {
- case 0:
- return out_tstsi (insn, operands[0], NULL);
-
- case 1:
- return (AS2 (cp,%A0,%A1) CR_TAB
- AS2 (cpc,%B0,%B1) CR_TAB
- AS2 (cpc,%C0,%C1) CR_TAB
- AS2 (cpc,%D0,%D1));
- case 2:
- if (reg_unused_after (insn, operands[0])
- && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63
- && test_hard_reg_class (ADDW_REGS, operands[0]))
- return (AS2 (sbiw,%0,%1) CR_TAB
- AS2 (cpc,%C0,__zero_reg__) CR_TAB
- AS2 (cpc,%D0,__zero_reg__));
- else
- return (AS2 (cpi,%A0,lo8(%1)) CR_TAB
- AS2 (cpc,%B0,__zero_reg__) CR_TAB
- AS2 (cpc,%C0,__zero_reg__) CR_TAB
- AS2 (cpc,%D0,__zero_reg__));
- case 3:
- if (reg_unused_after (insn, operands[0]))
- return (AS2 (subi,%A0,lo8(%1)) CR_TAB
- AS2 (sbci,%B0,hi8(%1)) CR_TAB
- AS2 (sbci,%C0,hlo8(%1)) CR_TAB
- AS2 (sbci,%D0,hhi8(%1)));
- else
- return (AS2 (cpi, %A0,lo8(%1)) CR_TAB
- AS2 (ldi, %2,hi8(%1)) CR_TAB
- AS2 (cpc, %B0,%2) CR_TAB
- AS2 (ldi, %2,hlo8(%1)) CR_TAB
- AS2 (cpc, %C0,%2) CR_TAB
- AS2 (ldi, %2,hhi8(%1)) CR_TAB
- AS2 (cpc, %D0,%2));
- case 4:
- return (AS2 (ldi,%2,lo8(%1)) CR_TAB
- AS2 (cp,%A0,%2) CR_TAB
- AS2 (cpc,%B0,__zero_reg__) CR_TAB
- AS2 (cpc,%C0,__zero_reg__) CR_TAB
- AS2 (cpc,%D0,__zero_reg__));
- case 5:
- return (AS2 (ldi, %2,lo8(%1)) CR_TAB
- AS2 (cp, %A0,%2) CR_TAB
- AS2 (ldi, %2,hi8(%1)) CR_TAB
- AS2 (cpc, %B0,%2) CR_TAB
- AS2 (ldi, %2,hlo8(%1)) CR_TAB
- AS2 (cpc, %C0,%2) CR_TAB
- AS2 (ldi, %2,hhi8(%1)) CR_TAB
- AS2 (cpc, %D0,%2));
- }
- return \"bug\";
-}"
- [(set_attr "cc" "compare,compare,compare,compare,compare,compare")
- (set_attr "length" "4,4,4,7,5,8")])
+ {
+ if (0 == which_alternative)
+ return avr_out_tstsi (insn, operands, NULL);
+ else if (1 == which_alternative)
+ return "cp %A0,%A1\;cpc %B0,%B1\;cpc %C0,%C1\;cpc %D0,%D1";
+
+ return avr_out_compare (insn, operands, NULL);
+ }
+ [(set_attr "cc" "compare")
+ (set_attr "length" "4,4,4,5,8")
+ (set_attr "adjust_len" "tstsi,*,compare,compare,compare")])
;; ----------------------------------------------------------------------
@@ -4063,42 +4073,44 @@
;; ************************* Peepholes ********************************
(define_peephole
- [(set (match_operand:SI 0 "d_register_operand" "")
- (plus:SI (match_dup 0)
- (const_int -1)))
- (parallel
- [(set (cc0)
- (compare (match_dup 0)
- (const_int -1)))
- (clobber (match_operand:QI 1 "d_register_operand" ""))])
+ [(parallel [(set (match_operand:SI 0 "d_register_operand" "")
+ (plus:SI (match_dup 0)
+ (const_int -1)))
+ (clobber (scratch:QI))])
+ (parallel [(set (cc0)
+ (compare (match_dup 0)
+ (const_int -1)))
+ (clobber (match_operand:QI 1 "d_register_operand" ""))])
(set (pc)
- (if_then_else (ne (cc0) (const_int 0))
- (label_ref (match_operand 2 "" ""))
- (pc)))]
+ (if_then_else (ne (cc0)
+ (const_int 0))
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
""
- "*
-{
- CC_STATUS_INIT;
- if (test_hard_reg_class (ADDW_REGS, operands[0]))
- output_asm_insn (AS2 (sbiw,%0,1) CR_TAB
- AS2 (sbc,%C0,__zero_reg__) CR_TAB
- AS2 (sbc,%D0,__zero_reg__) \"\\n\", operands);
- else
- output_asm_insn (AS2 (subi,%A0,1) CR_TAB
- AS2 (sbc,%B0,__zero_reg__) CR_TAB
- AS2 (sbc,%C0,__zero_reg__) CR_TAB
- AS2 (sbc,%D0,__zero_reg__) \"\\n\", operands);
- switch (avr_jump_mode (operands[2],insn))
{
- case 1:
- return AS1 (brcc,%2);
- case 2:
- return (AS1 (brcs,.+2) CR_TAB
- AS1 (rjmp,%2));
- }
- return (AS1 (brcs,.+4) CR_TAB
- AS1 (jmp,%2));
-}")
+ CC_STATUS_INIT;
+ if (test_hard_reg_class (ADDW_REGS, operands[0]))
+ output_asm_insn (AS2 (sbiw,%0,1) CR_TAB
+ AS2 (sbc,%C0,__zero_reg__) CR_TAB
+ AS2 (sbc,%D0,__zero_reg__) "\n", operands);
+ else
+ output_asm_insn (AS2 (subi,%A0,1) CR_TAB
+ AS2 (sbc,%B0,__zero_reg__) CR_TAB
+ AS2 (sbc,%C0,__zero_reg__) CR_TAB
+ AS2 (sbc,%D0,__zero_reg__) "\n", operands);
+
+ switch (avr_jump_mode (operands[2], insn))
+ {
+ case 1:
+ return AS1 (brcc,%2);
+ case 2:
+ return (AS1 (brcs,.+2) CR_TAB
+ AS1 (rjmp,%2));
+ }
+
+ return (AS1 (brcs,.+4) CR_TAB
+ AS1 (jmp,%2));
+ })
(define_peephole
[(set (match_operand:HI 0 "d_register_operand" "")
@@ -4107,7 +4119,7 @@
(parallel
[(set (cc0)
(compare (match_dup 0)
- (const_int 65535)))
+ (const_int -1)))
(clobber (match_operand:QI 1 "d_register_operand" ""))])
(set (pc)
(if_then_else (ne (cc0) (const_int 0))
diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt
index 59d6393c506..1128dd3bf02 100644
--- a/gcc/config/avr/avr.opt
+++ b/gcc/config/avr/avr.opt
@@ -29,6 +29,9 @@ Target RejectNegative Joined Var(avr_mcu_index) Init(0) Enum(avr_mcu)
mdeb
Target Report Undocumented Mask(ALL_DEBUG)
+mlog=
+Target RejectNegative Joined Undocumented Var(avr_log_details)
+
mint8
Target Report Mask(INT8)
Use an 8-bit 'int' type
diff --git a/gcc/config/avr/constraints.md b/gcc/config/avr/constraints.md
index e754c79070b..f02c1978673 100644
--- a/gcc/config/avr/constraints.md
+++ b/gcc/config/avr/constraints.md
@@ -108,7 +108,57 @@
(and (match_code "mem")
(match_test "extra_constraint_Q (op)")))
+(define_constraint "C03"
+ "Constant integer 3."
+ (and (match_code "const_int")
+ (match_test "ival == 3")))
+
(define_constraint "C04"
"Constant integer 4."
(and (match_code "const_int")
(match_test "ival == 4")))
+
+(define_constraint "C05"
+ "Constant integer 5."
+ (and (match_code "const_int")
+ (match_test "ival == 5")))
+
+(define_constraint "C06"
+ "Constant integer 6."
+ (and (match_code "const_int")
+ (match_test "ival == 6")))
+
+(define_constraint "C07"
+ "Constant integer 7."
+ (and (match_code "const_int")
+ (match_test "ival == 7")))
+
+(define_constraint "Ca2"
+ "Constant 2-byte integer that allows AND without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<7) | (1<<8))")))
+
+(define_constraint "Ca4"
+ "Constant 4-byte integer that allows AND without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 4, (1<<0) | (1<<7) | (1<<8))")))
+
+(define_constraint "Co2"
+ "Constant 2-byte integer that allows OR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<1) | (1<<8))")))
+
+(define_constraint "Co4"
+ "Constant 4-byte integer that allows OR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 4, (1<<0) | (1<<1) | (1<<8))")))
+
+(define_constraint "Cx2"
+ "Constant 2-byte integer that allows XOR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 2, (1<<0) | (1<<8))")))
+
+(define_constraint "Cx4"
+ "Constant 4-byte integer that allows XOR without clobber register."
+ (and (match_code "const_int")
+ (match_test "avr_popcount_each_byte (op, 4, (1<<0) | (1<<8))")))
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 85f374527b3..30e8d96447e 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -30,6 +30,10 @@ avr-c.o: $(srcdir)/config/avr/avr-c.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_COMMON_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+avr-log.o: $(srcdir)/config/avr/avr-log.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(INPUT_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
$(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh \
$(srcdir)/config/avr/avr-mcus.def
$(SHELL) $(srcdir)/config/avr/genopt.sh $(srcdir)/config/avr > \
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index f2ab0b88aa9..57e62d9b98d 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -50,6 +50,7 @@
#include "sel-sched.h"
#include "debug.h"
#include "opts.h"
+#include "hw-doloop.h"
/* Table of supported architecture variants. */
typedef struct
@@ -160,6 +161,27 @@ static int c6x_unit_codes[ARRAY_SIZE (c6x_unit_names)];
#define RESERVATION_S1 2
#define RESERVATION_S2 10
+
+/* An enum for the unit requirements we count in the UNIT_REQS table. */
+enum unitreqs
+{
+ UNIT_REQ_D,
+ UNIT_REQ_L,
+ UNIT_REQ_S,
+ UNIT_REQ_M,
+ UNIT_REQ_DL,
+ UNIT_REQ_DS,
+ UNIT_REQ_LS,
+ UNIT_REQ_DLS,
+ UNIT_REQ_T,
+ UNIT_REQ_X,
+ UNIT_REQ_MAX
+};
+
+/* A table used to count unit requirements. Used when computing minimum
+ iteration intervals. */
+typedef int unit_req_table[2][UNIT_REQ_MAX];
+static unit_req_table unit_reqs;
/* Register map for debugging. */
int const dbx_register_map[FIRST_PSEUDO_REGISTER] =
@@ -3164,6 +3186,149 @@ assign_reservations (rtx head, rtx end)
}
}
}
+
+/* Return a factor by which to weight unit imbalances for a reservation
+ R. */
+static int
+unit_req_factor (enum unitreqs r)
+{
+ switch (r)
+ {
+ case UNIT_REQ_D:
+ case UNIT_REQ_L:
+ case UNIT_REQ_S:
+ case UNIT_REQ_M:
+ case UNIT_REQ_X:
+ case UNIT_REQ_T:
+ return 1;
+ case UNIT_REQ_DL:
+ case UNIT_REQ_LS:
+ case UNIT_REQ_DS:
+ return 2;
+ case UNIT_REQ_DLS:
+ return 3;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Examine INSN, and store in REQ1/SIDE1 and REQ2/SIDE2 the unit
+ requirements. Returns zero if INSN can't be handled, otherwise
+ either one or two to show how many of the two pairs are in use.
+ REQ1 is always used, it holds what is normally thought of as the
+ instructions reservation, e.g. UNIT_REQ_DL. REQ2 is used to either
+ describe a cross path, or for loads/stores, the T unit. */
+static int
+get_unit_reqs (rtx insn, int *req1, int *side1, int *req2, int *side2)
+{
+ enum attr_units units;
+ enum attr_cross cross;
+ int side, req;
+
+ if (!NONDEBUG_INSN_P (insn) || recog_memoized (insn) < 0)
+ return 0;
+ units = get_attr_units (insn);
+ if (units == UNITS_UNKNOWN)
+ return 0;
+ side = get_insn_side (insn, units);
+ cross = get_attr_cross (insn);
+
+ req = (units == UNITS_D ? UNIT_REQ_D
+ : units == UNITS_D_ADDR ? UNIT_REQ_D
+ : units == UNITS_DL ? UNIT_REQ_DL
+ : units == UNITS_DS ? UNIT_REQ_DS
+ : units == UNITS_L ? UNIT_REQ_L
+ : units == UNITS_LS ? UNIT_REQ_LS
+ : units == UNITS_S ? UNIT_REQ_S
+ : units == UNITS_M ? UNIT_REQ_M
+ : units == UNITS_DLS ? UNIT_REQ_DLS
+ : -1);
+ gcc_assert (req != -1);
+ *req1 = req;
+ *side1 = side;
+ if (units == UNITS_D_ADDR)
+ {
+ *req2 = UNIT_REQ_T;
+ *side2 = side ^ (cross == CROSS_Y ? 1 : 0);
+ return 2;
+ }
+ else if (cross == CROSS_Y)
+ {
+ *req2 = UNIT_REQ_X;
+ *side2 = side;
+ return 2;
+ }
+ return 1;
+}
+
+/* Walk the insns between and including HEAD and TAIL, and mark the
+ resource requirements in the unit_reqs table. */
+static void
+count_unit_reqs (unit_req_table reqs, rtx head, rtx tail)
+{
+ rtx insn;
+
+ memset (reqs, 0, sizeof (unit_req_table));
+
+ for (insn = head; insn != NEXT_INSN (tail); insn = NEXT_INSN (insn))
+ {
+ int side1, side2, req1, req2;
+
+ switch (get_unit_reqs (insn, &req1, &side1, &req2, &side2))
+ {
+ case 2:
+ reqs[side2][req2]++;
+ /* fall through */
+ case 1:
+ reqs[side1][req1]++;
+ break;
+ }
+ }
+}
+
+/* Update the table REQS by merging more specific unit reservations into
+ more general ones, i.e. counting (for example) UNIT_REQ_D also in
+ UNIT_REQ_DL, DS, and DLS. */
+static void
+merge_unit_reqs (unit_req_table reqs)
+{
+ int side;
+ for (side = 0; side < 2; side++)
+ {
+ int d = reqs[side][UNIT_REQ_D];
+ int l = reqs[side][UNIT_REQ_L];
+ int s = reqs[side][UNIT_REQ_S];
+ int dl = reqs[side][UNIT_REQ_DL];
+ int ls = reqs[side][UNIT_REQ_LS];
+ int ds = reqs[side][UNIT_REQ_DS];
+
+ reqs[side][UNIT_REQ_DL] += d;
+ reqs[side][UNIT_REQ_DL] += l;
+ reqs[side][UNIT_REQ_DS] += d;
+ reqs[side][UNIT_REQ_DS] += s;
+ reqs[side][UNIT_REQ_LS] += l;
+ reqs[side][UNIT_REQ_LS] += s;
+ reqs[side][UNIT_REQ_DLS] += ds + dl + ls + d + l + s;
+ }
+}
+
+/* Return the resource-constrained minimum iteration interval given the
+ data in the REQS table. This must have been processed with
+ merge_unit_reqs already. */
+static int
+res_mii (unit_req_table reqs)
+{
+ int side, req;
+ int worst = 1;
+ for (side = 0; side < 2; side++)
+ for (req = 0; req < UNIT_REQ_MAX; req++)
+ {
+ int factor = unit_req_factor (req);
+ worst = MAX ((reqs[side][UNIT_REQ_D] + factor - 1) / factor, worst);
+ }
+
+ return worst;
+}
/* Backend scheduling state. */
typedef struct c6x_sched_context
@@ -3196,13 +3361,15 @@ typedef struct c6x_sched_context
/* The following variable value is the last issued insn. */
rtx last_scheduled_insn;
+ /* The last issued insn that isn't a shadow of another. */
+ rtx last_scheduled_iter0;
/* The following variable value is DFA state before issuing the
first insn in the current clock cycle. We do not use this member
of the structure directly; we copy the data in and out of
prev_cycle_state. */
state_t prev_cycle_state_ctx;
-
+
int reg_n_accesses[FIRST_PSEUDO_REGISTER];
int reg_n_xaccesses[FIRST_PSEUDO_REGISTER];
int reg_set_in_cycle[FIRST_PSEUDO_REGISTER];
@@ -3223,6 +3390,10 @@ static state_t prev_cycle_state;
many accesses of the same register. */
static bool reg_access_stall;
+/* The highest insn uid after delayed insns were split, but before loop bodies
+ were copied by the modulo scheduling code. */
+static int sploop_max_uid_iter0;
+
/* Look up the jump cycle with index N. For an out-of-bounds N, we return 0,
so the caller does not specifically have to test for it. */
static int
@@ -3421,6 +3592,7 @@ static void
init_sched_state (c6x_sched_context_t sc)
{
sc->last_scheduled_insn = NULL_RTX;
+ sc->last_scheduled_iter0 = NULL_RTX;
sc->issued_this_cycle = 0;
memset (sc->jump_cycles, 0, sizeof sc->jump_cycles);
memset (sc->jump_cond, 0, sizeof sc->jump_cond);
@@ -3481,7 +3653,7 @@ c6x_clear_sched_context (void *_sc)
c6x_sched_context_t sc = (c6x_sched_context_t) _sc;
gcc_assert (_sc != NULL);
- free (sc->prev_cycle_state_ctx);
+ free (sc->prev_cycle_state_ctx);
}
/* Free _SC. */
@@ -3716,7 +3888,7 @@ c6x_sched_reorder_1 (rtx *ready, int *pn_ready, int clock_var)
bool is_asm = (icode < 0
&& (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0));
- bool no_parallel = (is_asm
+ bool no_parallel = (is_asm || icode == CODE_FOR_sploop
|| (icode >= 0
&& get_attr_type (insn) == TYPE_ATOMIC));
@@ -3725,7 +3897,8 @@ c6x_sched_reorder_1 (rtx *ready, int *pn_ready, int clock_var)
code always assumes at least 1 cycle, which may be wrong. */
if ((no_parallel
&& (ss.issued_this_cycle > 0 || clock_var < ss.delays_finished_at))
- || c6x_registers_update (insn))
+ || c6x_registers_update (insn)
+ || (ss.issued_this_cycle > 0 && icode == CODE_FOR_sploop))
{
memmove (ready + 1, ready, (insnp - ready) * sizeof (rtx));
*ready = insn;
@@ -3924,6 +4097,8 @@ c6x_variable_issue (FILE *dump ATTRIBUTE_UNUSED,
rtx insn, int can_issue_more ATTRIBUTE_UNUSED)
{
ss.last_scheduled_insn = insn;
+ if (INSN_UID (insn) < sploop_max_uid_iter0 && !JUMP_P (insn))
+ ss.last_scheduled_iter0 = insn;
if (GET_CODE (PATTERN (insn)) != USE && GET_CODE (PATTERN (insn)) != CLOBBER)
ss.issued_this_cycle++;
if (insn_info)
@@ -4810,7 +4985,118 @@ split_delayed_branch (rtx insn)
i1 = emit_insn_before (pat, insn);
PATTERN (insn) = newpat;
INSN_CODE (insn) = -1;
- record_delay_slot_pair (i1, insn, 5);
+ record_delay_slot_pair (i1, insn, 5, 0);
+}
+
+/* If INSN is a multi-cycle insn that should be handled properly in
+ modulo-scheduling, split it into a real insn and a shadow.
+ Return true if we made a change.
+
+ It is valid for us to fail to split an insn; the caller has to deal
+ with the possibility. Currently we handle loads and most mpy2 and
+ mpy4 insns. */
+static bool
+split_delayed_nonbranch (rtx insn)
+{
+ int code = recog_memoized (insn);
+ enum attr_type type;
+ rtx i1, newpat, src, dest;
+ rtx pat = PATTERN (insn);
+ rtvec rtv;
+ int delay;
+
+ if (GET_CODE (pat) == COND_EXEC)
+ pat = COND_EXEC_CODE (pat);
+
+ if (code < 0 || GET_CODE (pat) != SET)
+ return false;
+ src = SET_SRC (pat);
+ dest = SET_DEST (pat);
+ if (!REG_P (dest))
+ return false;
+
+ type = get_attr_type (insn);
+ if (code >= 0
+ && (type == TYPE_LOAD
+ || type == TYPE_LOADN))
+ {
+ if (!MEM_P (src)
+ && (GET_CODE (src) != ZERO_EXTEND
+ || !MEM_P (XEXP (src, 0))))
+ return false;
+
+ if (GET_MODE_SIZE (GET_MODE (dest)) > 4
+ && (GET_MODE_SIZE (GET_MODE (dest)) != 8 || !TARGET_LDDW))
+ return false;
+
+ rtv = gen_rtvec (2, GEN_INT (REGNO (SET_DEST (pat))),
+ SET_SRC (pat));
+ newpat = gen_load_shadow (SET_DEST (pat));
+ pat = gen_rtx_UNSPEC (VOIDmode, rtv, UNSPEC_REAL_LOAD);
+ delay = 4;
+ }
+ else if (code >= 0
+ && (type == TYPE_MPY2
+ || type == TYPE_MPY4))
+ {
+ /* We don't handle floating point multiplies yet. */
+ if (GET_MODE (dest) == SFmode)
+ return false;
+
+ rtv = gen_rtvec (2, GEN_INT (REGNO (SET_DEST (pat))),
+ SET_SRC (pat));
+ newpat = gen_mult_shadow (SET_DEST (pat));
+ pat = gen_rtx_UNSPEC (VOIDmode, rtv, UNSPEC_REAL_MULT);
+ delay = type == TYPE_MPY2 ? 1 : 3;
+ }
+ else
+ return false;
+
+ pat = duplicate_cond (pat, insn);
+ newpat = duplicate_cond (newpat, insn);
+ i1 = emit_insn_before (pat, insn);
+ PATTERN (insn) = newpat;
+ INSN_CODE (insn) = -1;
+ recog_memoized (insn);
+ recog_memoized (i1);
+ record_delay_slot_pair (i1, insn, delay, 0);
+ return true;
+}
+
+/* Examine if INSN is the result of splitting a load into a real load and a
+ shadow, and if so, undo the transformation. */
+static void
+undo_split_delayed_nonbranch (rtx insn)
+{
+ int icode = recog_memoized (insn);
+ enum attr_type type;
+ rtx prev_pat, insn_pat, prev;
+
+ if (icode < 0)
+ return;
+ type = get_attr_type (insn);
+ if (type != TYPE_LOAD_SHADOW && type != TYPE_MULT_SHADOW)
+ return;
+ prev = PREV_INSN (insn);
+ prev_pat = PATTERN (prev);
+ insn_pat = PATTERN (insn);
+ if (GET_CODE (prev_pat) == COND_EXEC)
+ {
+ prev_pat = COND_EXEC_CODE (prev_pat);
+ insn_pat = COND_EXEC_CODE (insn_pat);
+ }
+
+ gcc_assert (GET_CODE (prev_pat) == UNSPEC
+ && ((XINT (prev_pat, 1) == UNSPEC_REAL_LOAD
+ && type == TYPE_LOAD_SHADOW)
+ || (XINT (prev_pat, 1) == UNSPEC_REAL_MULT
+ && type == TYPE_MULT_SHADOW)));
+ insn_pat = gen_rtx_SET (VOIDmode, SET_DEST (insn_pat),
+ XVECEXP (prev_pat, 0, 1));
+ insn_pat = duplicate_cond (insn_pat, prev);
+ PATTERN (insn) = insn_pat;
+ INSN_CODE (insn) = -1;
+ delete_insn (prev);
}
/* Split every insn (i.e. jumps and calls) which can have delay slots into
@@ -4853,6 +5139,481 @@ conditionalize_after_sched (void)
}
}
+/* A callback for the hw-doloop pass. This function examines INSN; if
+ it is a loop_end pattern we recognize, return the reg rtx for the
+ loop counter. Otherwise, return NULL_RTX. */
+
+static rtx
+hwloop_pattern_reg (rtx insn)
+{
+ rtx pat, reg;
+
+ if (!JUMP_P (insn) || recog_memoized (insn) != CODE_FOR_loop_end)
+ return NULL_RTX;
+
+ pat = PATTERN (insn);
+ reg = SET_DEST (XVECEXP (pat, 0, 1));
+ if (!REG_P (reg))
+ return NULL_RTX;
+ return reg;
+}
+
+/* Return the number of cycles taken by BB, as computed by scheduling,
+ including the latencies of all insns with delay slots. IGNORE is
+ an insn we should ignore in the calculation, usually the final
+ branch. */
+static int
+bb_earliest_end_cycle (basic_block bb, rtx ignore)
+{
+ int earliest = 0;
+ rtx insn;
+
+ FOR_BB_INSNS (bb, insn)
+ {
+ int cycles, this_clock;
+
+ if (LABEL_P (insn) || NOTE_P (insn) || DEBUG_INSN_P (insn)
+ || GET_CODE (PATTERN (insn)) == USE
+ || GET_CODE (PATTERN (insn)) == CLOBBER
+ || insn == ignore)
+ continue;
+
+ this_clock = insn_get_clock (insn);
+ cycles = get_attr_cycles (insn);
+
+ if (earliest < this_clock + cycles)
+ earliest = this_clock + cycles;
+ }
+ return earliest;
+}
+
+/* Examine the insns in BB and remove all which have a uid greater or
+ equal to MAX_UID. */
+static void
+filter_insns_above (basic_block bb, int max_uid)
+{
+ rtx insn, next;
+ bool prev_ti = false;
+ int prev_cycle = -1;
+
+ FOR_BB_INSNS_SAFE (bb, insn, next)
+ {
+ int this_cycle;
+ if (!NONDEBUG_INSN_P (insn))
+ continue;
+ if (insn == BB_END (bb))
+ return;
+ this_cycle = insn_get_clock (insn);
+ if (prev_ti && this_cycle == prev_cycle)
+ {
+ gcc_assert (GET_MODE (insn) != TImode);
+ PUT_MODE (insn, TImode);
+ }
+ prev_ti = false;
+ if (INSN_UID (insn) >= max_uid)
+ {
+ if (GET_MODE (insn) == TImode)
+ {
+ prev_ti = true;
+ prev_cycle = this_cycle;
+ }
+ delete_insn (insn);
+ }
+ }
+}
+
+/* A callback for the hw-doloop pass. Called to optimize LOOP in a
+ machine-specific fashion; returns true if successful and false if
+ the hwloop_fail function should be called. */
+
+static bool
+hwloop_optimize (hwloop_info loop)
+{
+ basic_block entry_bb, bb;
+ rtx seq, insn, prev, entry_after, end_packet;
+ rtx head_insn, tail_insn, new_insns, last_insn;
+ int loop_earliest, entry_earliest, entry_end_cycle;
+ int n_execute_packets;
+ edge entry_edge;
+ unsigned ix;
+ int max_uid_before, delayed_splits;
+ int i, sp_ii, min_ii, max_ii, max_parallel, n_insns, n_real_insns, stages;
+ rtx *orig_vec;
+ rtx *copies;
+ rtx **insn_copies;
+
+ if (!c6x_flag_modulo_sched || !c6x_flag_schedule_insns2
+ || !TARGET_INSNS_64PLUS)
+ return false;
+
+ if (loop->iter_reg_used || loop->depth > 1)
+ return false;
+ if (loop->has_call || loop->has_asm)
+ return false;
+
+ if (loop->head != loop->tail)
+ return false;
+
+ gcc_assert (loop->incoming_dest == loop->head);
+
+ entry_edge = NULL;
+ FOR_EACH_VEC_ELT (edge, loop->incoming, i, entry_edge)
+ if (entry_edge->flags & EDGE_FALLTHRU)
+ break;
+ if (entry_edge == NULL)
+ return false;
+
+ schedule_ebbs_init ();
+ schedule_ebb (BB_HEAD (loop->tail), loop->loop_end, true);
+ schedule_ebbs_finish ();
+
+ bb = loop->head;
+ loop_earliest = bb_earliest_end_cycle (bb, loop->loop_end) + 1;
+
+ max_uid_before = get_max_uid ();
+
+ /* Split all multi-cycle operations, such as loads. For normal
+ scheduling, we only do this for branches, as the generated code
+ would otherwise not be interrupt-safe. When using sploop, it is
+ safe and beneficial to split them. If any multi-cycle operations
+ remain after splitting (because we don't handle them yet), we
+ cannot pipeline the loop. */
+ delayed_splits = 0;
+ FOR_BB_INSNS (bb, insn)
+ {
+ if (NONDEBUG_INSN_P (insn))
+ {
+ recog_memoized (insn);
+ if (split_delayed_nonbranch (insn))
+ delayed_splits++;
+ else if (INSN_CODE (insn) >= 0
+ && get_attr_cycles (insn) > 1)
+ goto undo_splits;
+ }
+ }
+
+ /* Count the number of insns as well as the number real insns, and save
+ the original sequence of insns in case we must restore it later. */
+ n_insns = n_real_insns = 0;
+ FOR_BB_INSNS (bb, insn)
+ {
+ n_insns++;
+ if (NONDEBUG_INSN_P (insn) && insn != loop->loop_end)
+ n_real_insns++;
+ }
+ orig_vec = XNEWVEC (rtx, n_insns);
+ n_insns = 0;
+ FOR_BB_INSNS (bb, insn)
+ orig_vec[n_insns++] = insn;
+
+ /* Count the unit reservations, and compute a minimum II from that
+ table. */
+ count_unit_reqs (unit_reqs, loop->start_label,
+ PREV_INSN (loop->loop_end));
+ merge_unit_reqs (unit_reqs);
+
+ min_ii = res_mii (unit_reqs);
+ max_ii = loop_earliest < 15 ? loop_earliest : 14;
+
+ /* Make copies of the loop body, up to a maximum number of stages we want
+ to handle. */
+ max_parallel = loop_earliest / min_ii + 1;
+
+ copies = XCNEWVEC (rtx, (max_parallel + 1) * n_real_insns);
+ insn_copies = XNEWVEC (rtx *, max_parallel + 1);
+ for (i = 0; i < max_parallel + 1; i++)
+ insn_copies[i] = copies + i * n_real_insns;
+
+ head_insn = next_nonnote_nondebug_insn (loop->start_label);
+ tail_insn = prev_real_insn (BB_END (bb));
+
+ i = 0;
+ FOR_BB_INSNS (bb, insn)
+ if (NONDEBUG_INSN_P (insn) && insn != loop->loop_end)
+ insn_copies[0][i++] = insn;
+
+ sploop_max_uid_iter0 = get_max_uid ();
+
+ /* Generate the copies of the loop body, and save them in the
+ INSN_COPIES array. */
+ start_sequence ();
+ for (i = 0; i < max_parallel; i++)
+ {
+ int j;
+ rtx this_iter;
+
+ this_iter = duplicate_insn_chain (head_insn, tail_insn);
+ j = 0;
+ while (this_iter)
+ {
+ rtx prev_stage_insn = insn_copies[i][j];
+ gcc_assert (INSN_CODE (this_iter) == INSN_CODE (prev_stage_insn));
+
+ if (INSN_CODE (this_iter) >= 0
+ && (get_attr_type (this_iter) == TYPE_LOAD_SHADOW
+ || get_attr_type (this_iter) == TYPE_MULT_SHADOW))
+ {
+ rtx prev = PREV_INSN (this_iter);
+ record_delay_slot_pair (prev, this_iter,
+ get_attr_cycles (prev) - 1, 0);
+ }
+ else
+ record_delay_slot_pair (prev_stage_insn, this_iter, i, 1);
+
+ insn_copies[i + 1][j] = this_iter;
+ j++;
+ this_iter = next_nonnote_nondebug_insn (this_iter);
+ }
+ }
+ new_insns = get_insns ();
+ last_insn = insn_copies[max_parallel][n_real_insns - 1];
+ end_sequence ();
+ emit_insn_before (new_insns, BB_END (bb));
+
+ /* Try to schedule the loop using varying initiation intervals,
+ starting with the smallest possible and incrementing it
+ on failure. */
+ for (sp_ii = min_ii; sp_ii <= max_ii; sp_ii++)
+ {
+ basic_block tmp_bb;
+ if (dump_file)
+ fprintf (dump_file, "Trying to schedule for II %d\n", sp_ii);
+
+ df_clear_flags (DF_LR_RUN_DCE);
+
+ schedule_ebbs_init ();
+ set_modulo_params (sp_ii, max_parallel, n_real_insns,
+ sploop_max_uid_iter0);
+ tmp_bb = schedule_ebb (BB_HEAD (bb), last_insn, true);
+ schedule_ebbs_finish ();
+
+ if (tmp_bb)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Found schedule with II %d\n", sp_ii);
+ break;
+ }
+ }
+
+ discard_delay_pairs_above (max_uid_before);
+
+ if (sp_ii > max_ii)
+ goto restore_loop;
+
+ stages = insn_get_clock (ss.last_scheduled_iter0) / sp_ii + 1;
+
+ if (stages == 1 && sp_ii > 5)
+ goto restore_loop;
+
+ /* At this point, we know we've been successful, unless we find later that
+ there are too many execute packets for the loop buffer to hold. */
+
+ /* Assign reservations to the instructions in the loop. We must find
+ the stage that contains the full loop kernel, and transfer the
+ reservations of the instructions contained in it to the corresponding
+ instructions from iteration 0, which are the only ones we'll keep. */
+ assign_reservations (BB_HEAD (bb), ss.last_scheduled_insn);
+ PREV_INSN (BB_END (bb)) = ss.last_scheduled_iter0;
+ NEXT_INSN (ss.last_scheduled_iter0) = BB_END (bb);
+ filter_insns_above (bb, sploop_max_uid_iter0);
+
+ for (i = 0; i < n_real_insns; i++)
+ {
+ rtx insn = insn_copies[0][i];
+ int uid = INSN_UID (insn);
+ int stage = insn_uid_get_clock (uid) / sp_ii;
+
+ if (stage + 1 < stages)
+ {
+ int copy_uid;
+ stage = stages - stage - 1;
+ copy_uid = INSN_UID (insn_copies[stage][i]);
+ INSN_INFO_ENTRY (uid).reservation
+ = INSN_INFO_ENTRY (copy_uid).reservation;
+ }
+ }
+ if (stages == 1)
+ stages++;
+
+ /* Compute the number of execute packets the pipelined form of the loop will
+ require. */
+ prev = NULL_RTX;
+ n_execute_packets = 0;
+ for (insn = loop->start_label; insn != loop->loop_end; insn = NEXT_INSN (insn))
+ {
+ if (NONDEBUG_INSN_P (insn) && GET_MODE (insn) == TImode
+ && !shadow_p (insn))
+ {
+ n_execute_packets++;
+ if (prev && insn_get_clock (prev) + 1 != insn_get_clock (insn))
+ /* We need an extra NOP instruction. */
+ n_execute_packets++;
+
+ prev = insn;
+ }
+ }
+
+ end_packet = ss.last_scheduled_iter0;
+ while (!NONDEBUG_INSN_P (end_packet) || GET_MODE (end_packet) != TImode)
+ end_packet = PREV_INSN (end_packet);
+
+ /* The earliest cycle in which we can emit the SPKERNEL instruction. */
+ loop_earliest = (stages - 1) * sp_ii;
+ if (loop_earliest > insn_get_clock (end_packet))
+ {
+ n_execute_packets++;
+ end_packet = loop->loop_end;
+ }
+ else
+ loop_earliest = insn_get_clock (end_packet);
+
+ if (n_execute_packets > 14)
+ goto restore_loop;
+
+ /* Generate the spkernel instruction, and place it at the appropriate
+ spot. */
+ PUT_MODE (end_packet, VOIDmode);
+
+ insn = gen_spkernel (GEN_INT (stages - 1),
+ const0_rtx, JUMP_LABEL (loop->loop_end));
+ insn = emit_jump_insn_before (insn, end_packet);
+ JUMP_LABEL (insn) = JUMP_LABEL (loop->loop_end);
+ insn_set_clock (insn, loop_earliest);
+ PUT_MODE (insn, TImode);
+ INSN_INFO_ENTRY (INSN_UID (insn)).ebb_start = false;
+ delete_insn (loop->loop_end);
+
+ /* Place the mvc and sploop instructions before the loop. */
+ entry_bb = entry_edge->src;
+
+ start_sequence ();
+
+ insn = emit_insn (gen_mvilc (loop->iter_reg));
+ insn = emit_insn (gen_sploop (GEN_INT (sp_ii)));
+
+ seq = get_insns ();
+
+ if (!single_succ_p (entry_bb) || VEC_length (edge, loop->incoming) > 1)
+ {
+ basic_block new_bb;
+ edge e;
+ edge_iterator ei;
+
+ emit_insn_before (seq, BB_HEAD (loop->head));
+ seq = emit_label_before (gen_label_rtx (), seq);
+
+ new_bb = create_basic_block (seq, insn, entry_bb);
+ FOR_EACH_EDGE (e, ei, loop->incoming)
+ {
+ if (!(e->flags & EDGE_FALLTHRU))
+ redirect_edge_and_branch_force (e, new_bb);
+ else
+ redirect_edge_succ (e, new_bb);
+ }
+ make_edge (new_bb, loop->head, 0);
+ }
+ else
+ {
+ entry_after = BB_END (entry_bb);
+ while (DEBUG_INSN_P (entry_after)
+ || (NOTE_P (entry_after)
+ && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK))
+ entry_after = PREV_INSN (entry_after);
+ emit_insn_after (seq, entry_after);
+ }
+
+ end_sequence ();
+
+ /* Make sure we don't try to schedule this loop again. */
+ for (ix = 0; VEC_iterate (basic_block, loop->blocks, ix, bb); ix++)
+ bb->flags |= BB_DISABLE_SCHEDULE;
+
+ return true;
+
+ restore_loop:
+ if (dump_file)
+ fprintf (dump_file, "Unable to pipeline loop.\n");
+
+ for (i = 1; i < n_insns; i++)
+ {
+ NEXT_INSN (orig_vec[i - 1]) = orig_vec[i];
+ PREV_INSN (orig_vec[i]) = orig_vec[i - 1];
+ }
+ PREV_INSN (orig_vec[0]) = PREV_INSN (BB_HEAD (bb));
+ NEXT_INSN (PREV_INSN (BB_HEAD (bb))) = orig_vec[0];
+ NEXT_INSN (orig_vec[n_insns - 1]) = NEXT_INSN (BB_END (bb));
+ PREV_INSN (NEXT_INSN (BB_END (bb))) = orig_vec[n_insns - 1];
+ BB_HEAD (bb) = orig_vec[0];
+ BB_END (bb) = orig_vec[n_insns - 1];
+ undo_splits:
+ free_delay_pairs ();
+ FOR_BB_INSNS (bb, insn)
+ if (NONDEBUG_INSN_P (insn))
+ undo_split_delayed_nonbranch (insn);
+ return false;
+}
+
+/* A callback for the hw-doloop pass. Called when a loop we have discovered
+ turns out not to be optimizable; we have to split the doloop_end pattern
+ into a subtract and a test. */
+static void
+hwloop_fail (hwloop_info loop)
+{
+ rtx insn, test, testreg;
+
+ if (dump_file)
+ fprintf (dump_file, "splitting doloop insn %d\n",
+ INSN_UID (loop->loop_end));
+ insn = gen_addsi3 (loop->iter_reg, loop->iter_reg, constm1_rtx);
+ /* See if we can emit the add at the head of the loop rather than at the
+ end. */
+ if (loop->head == NULL
+ || loop->iter_reg_used_outside
+ || loop->iter_reg_used
+ || TEST_HARD_REG_BIT (loop->regs_set_in_loop, REGNO (loop->iter_reg))
+ || loop->incoming_dest != loop->head
+ || EDGE_COUNT (loop->head->preds) != 2)
+ emit_insn_before (insn, loop->loop_end);
+ else
+ {
+ rtx t = loop->start_label;
+ while (!NOTE_P (t) || NOTE_KIND (t) != NOTE_INSN_BASIC_BLOCK)
+ t = NEXT_INSN (t);
+ emit_insn_after (insn, t);
+ }
+
+ testreg = SET_DEST (XVECEXP (PATTERN (loop->loop_end), 0, 2));
+ if (GET_CODE (testreg) == SCRATCH)
+ testreg = loop->iter_reg;
+ else
+ emit_insn_before (gen_movsi (testreg, loop->iter_reg), loop->loop_end);
+
+ test = gen_rtx_NE (VOIDmode, testreg, const0_rtx);
+ insn = emit_jump_insn_before (gen_cbranchsi4 (test, testreg, const0_rtx,
+ loop->start_label),
+ loop->loop_end);
+
+ JUMP_LABEL (insn) = loop->start_label;
+ LABEL_NUSES (loop->start_label)++;
+ delete_insn (loop->loop_end);
+}
+
+static struct hw_doloop_hooks c6x_doloop_hooks =
+{
+ hwloop_pattern_reg,
+ hwloop_optimize,
+ hwloop_fail
+};
+
+/* Run the hw-doloop pass to modulo-schedule hardware loops, or split the
+ doloop_end patterns where such optimizations are impossible. */
+static void
+c6x_hwloops (void)
+{
+ if (optimize)
+ reorg_loops (true, &c6x_doloop_hooks);
+}
+
/* Implement the TARGET_MACHINE_DEPENDENT_REORG pass. We split call insns here
into a sequence that loads the return register and performs the call,
and emit the return label.
@@ -4881,10 +5642,17 @@ c6x_reorg (void)
int sz = get_max_uid () * 3 / 2 + 1;
insn_info = VEC_alloc (c6x_sched_insn_info, heap, sz);
+ }
+
+ /* Make sure the real-jump insns we create are not deleted. When modulo-
+ scheduling, situations where a reg is only stored in a loop can also
+ cause dead code when doing the initial unrolling. */
+ sched_no_dce = true;
- /* Make sure the real-jump insns we create are not deleted. */
- sched_no_dce = true;
+ c6x_hwloops ();
+ if (c6x_flag_schedule_insns2)
+ {
split_delayed_insns ();
timevar_push (TV_SCHED2);
if (do_selsched)
@@ -4895,8 +5663,8 @@ c6x_reorg (void)
timevar_pop (TV_SCHED2);
free_delay_pairs ();
- sched_no_dce = false;
}
+ sched_no_dce = false;
call_labels = XCNEWVEC (rtx, get_max_uid () + 1);
diff --git a/gcc/config/c6x/c6x.md b/gcc/config/c6x/c6x.md
index c2502ca1a42..c2196ac6fe2 100644
--- a/gcc/config/c6x/c6x.md
+++ b/gcc/config/c6x/c6x.md
@@ -1391,6 +1391,106 @@
)
;; -------------------------------------------------------------------------
+;; Doloop
+;; -------------------------------------------------------------------------
+
+; operand 0 is the loop count pseudo register
+; operand 1 is the number of loop iterations or 0 if it is unknown
+; operand 2 is the maximum number of loop iterations
+; operand 3 is the number of levels of enclosed loops
+; operand 4 is the label to jump to at the top of the loop
+(define_expand "doloop_end"
+ [(parallel [(set (pc) (if_then_else
+ (ne (match_operand:SI 0 "" "")
+ (const_int 1))
+ (label_ref (match_operand 4 "" ""))
+ (pc)))
+ (set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (const_int -1)))
+ (clobber (match_scratch:SI 5 ""))])]
+ "TARGET_INSNS_64PLUS && optimize"
+{
+ /* The loop optimizer doesn't check the predicates... */
+ if (GET_MODE (operands[0]) != SImode)
+ FAIL;
+})
+
+(define_insn "mvilc"
+ [(set (reg:SI REG_ILC)
+ (unspec [(match_operand:SI 0 "register_operand" "a,b")] UNSPEC_MVILC))]
+ "TARGET_INSNS_64PLUS"
+ "%|%.\\tmvc\\t%$\\t%0, ILC"
+ [(set_attr "predicable" "no")
+ (set_attr "cross" "y,n")
+ (set_attr "units" "s")
+ (set_attr "dest_regfile" "b")
+ (set_attr "type" "mvilc")])
+
+(define_insn "sploop"
+ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "i")
+ (reg:SI REG_ILC)]
+ UNSPECV_SPLOOP)]
+ "TARGET_INSNS_64PLUS"
+ "%|%.\\tsploop\t%0"
+ [(set_attr "predicable" "no")
+ (set_attr "type" "sploop")])
+
+(define_insn "spkernel"
+ [(set (pc)
+ (if_then_else
+ (ne (unspec_volatile:SI
+ [(match_operand:SI 0 "const_int_operand" "i")
+ (match_operand:SI 1 "const_int_operand" "i")]
+ UNSPECV_SPKERNEL)
+ (const_int 1))
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ "TARGET_INSNS_64PLUS"
+ "%|%.\\tspkernel\t%0, %1"
+ [(set_attr "predicable" "no")
+ (set_attr "type" "spkernel")])
+
+(define_insn "loop_end"
+ [(set (pc)
+ (if_then_else (ne (match_operand:SI 3 "nonimmediate_operand" "0,0,0,*r")
+ (const_int 1))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (set (match_operand:SI 0 "nonimmediate_operand" "=AB,*r,m,m")
+ (plus:SI (match_dup 3)
+ (const_int -1)))
+ (clobber (match_scratch:SI 2 "=X,&AB,&AB,&AB"))]
+ "TARGET_INSNS_64PLUS && optimize"
+ "#"
+ [(set_attr "type" "spkernel")])
+
+(define_split
+ [(set (pc)
+ (if_then_else (ne (match_operand:SI 3 "nonimmediate_operand" "")
+ (const_int 1))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (set (match_operand:SI 0 "memory_operand" "")
+ (plus:SI (match_dup 3)
+ (const_int -1)))
+ (clobber (match_scratch 2))]
+ ""
+ [(set (match_dup 2) (plus:SI (match_dup 3) (const_int -1)))
+ (set (match_dup 0) (match_dup 2))
+ (set (pc)
+ (if_then_else (ne (match_dup 2) (const_int 0))
+ (label_ref (match_dup 1))
+ (pc)))]
+{
+ if (!REG_P (operands[3]))
+ {
+ emit_move_insn (operands[2], operands[3]);
+ operands[3] = operands[2];
+ }
+})
+
+;; -------------------------------------------------------------------------
;; Delayed-branch real jumps and shadows
;; -------------------------------------------------------------------------
diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h
index 3b479122411..483a7e5269c 100644
--- a/gcc/config/darwin9.h
+++ b/gcc/config/darwin9.h
@@ -55,3 +55,5 @@ along with GCC; see the file COPYING3. If not see
#undef DEF_MIN_OSX_VERSION
#define DEF_MIN_OSX_VERSION "10.5"
+#undef STACK_CHECK_STATIC_BUILTIN
+#define STACK_CHECK_STATIC_BUILTIN 1
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 7d8b47bb1dd..e7a3c7ae49d 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1424,6 +1424,8 @@ frv_function_contains_far_jump (void)
static void
frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
+ rtx insn, next, last_call;
+
/* If no frame was created, check whether the function uses a call
instruction to implement a far jump. If so, save the link in gr3 and
replace all returns to LR with returns to GR3. GR3 is used because it
@@ -1464,6 +1466,32 @@ frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
/* Allow the garbage collector to free the nops created by frv_reorg. */
memset (frv_nops, 0, sizeof (frv_nops));
+
+ /* Locate CALL_ARG_LOCATION notes that have been misplaced
+ and move them back to where they should be located. */
+ last_call = NULL_RTX;
+ for (insn = get_insns (); insn; insn = next)
+ {
+ next = NEXT_INSN (insn);
+ if (CALL_P (insn)
+ || (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE
+ && CALL_P (XVECEXP (PATTERN (insn), 0, 0))))
+ last_call = insn;
+
+ if (!NOTE_P (insn) || NOTE_KIND (insn) != NOTE_INSN_CALL_ARG_LOCATION)
+ continue;
+
+ if (NEXT_INSN (last_call) == insn)
+ continue;
+
+ NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
+ PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
+ PREV_INSN (insn) = last_call;
+ NEXT_INSN (insn) = NEXT_INSN (last_call);
+ PREV_INSN (NEXT_INSN (insn)) = insn;
+ NEXT_INSN (PREV_INSN (insn)) = insn;
+ last_call = insn;
+ }
}
diff --git a/gcc/config/frv/frvbegin.c b/gcc/config/frv/frvbegin.c
index 963ebd091cd..23cbf1ecc93 100644
--- a/gcc/config/frv/frvbegin.c
+++ b/gcc/config/frv/frvbegin.c
@@ -28,7 +28,7 @@
#include "defaults.h"
#include <stddef.h>
-#include "unwind-dw2-fde.h"
+#include "../libgcc/unwind-dw2-fde.h"
#include "gbl-ctors.h"
/* Declare a pointer to void function type. */
diff --git a/gcc/config/frv/frvend.c b/gcc/config/frv/frvend.c
index 04b880df32a..0bb07b56b4a 100644
--- a/gcc/config/frv/frvend.c
+++ b/gcc/config/frv/frvend.c
@@ -25,7 +25,7 @@
#include "defaults.h"
#include <stddef.h>
-#include "unwind-dw2-fde.h"
+#include "../libgcc/unwind-dw2-fde.h"
#ifdef __FRV_UNDERSCORE__
#define UNDERSCORE "_"
diff --git a/gcc/config/i386/bmi2intrin.h b/gcc/config/i386/bmi2intrin.h
index a72c9a985ee..4c13a70adab 100644
--- a/gcc/config/i386/bmi2intrin.h
+++ b/gcc/config/i386/bmi2intrin.h
@@ -76,6 +76,27 @@ _pext_u64 (unsigned long long __X, unsigned long long __Y)
return __builtin_ia32_pext_di (__X, __Y);
}
-#endif /* __x86_64__ */
+extern __inline unsigned long long
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mulx_u64 (unsigned long long __X, unsigned long long __Y,
+ unsigned long long *__P)
+{
+ unsigned __int128 __res = (unsigned __int128) __X * __Y;
+ *__P = (unsigned long long) (__res >> 64);
+ return (unsigned long long) __res;
+}
+
+#else /* !__x86_64__ */
+
+extern __inline unsigned int
+__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
+{
+ unsigned long long __res = (unsigned long long) __X * __Y;
+ *__P = (unsigned int) (__res >> 32);
+ return (unsigned int) __res;
+}
+
+#endif /* !__x86_64__ */
#endif /* _BMI2INTRIN_H_INCLUDED */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 57cc8e3b937..7e89dbde7b9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -13513,6 +13513,7 @@ get_some_local_dynamic_name (void)
Y -- print condition for XOP pcom* instruction.
+ -- print a branch hint as 'cs' or 'ds' prefix
; -- print a semicolon (after prefixes due to bug in older gas).
+ ~ -- print "i" if TARGET_AVX2, "f" otherwise.
@ -- print a segment register of thread base pointer load
*/
@@ -14006,6 +14007,10 @@ ix86_print_operand (FILE *file, rtx x, int code)
fputs ("gs", file);
return;
+ case '~':
+ putc (TARGET_AVX2 ? 'i' : 'f', file);
+ return;
+
default:
output_operand_lossage ("invalid operand code '%c'", code);
}
@@ -14141,7 +14146,7 @@ static bool
ix86_print_operand_punct_valid_p (unsigned char code)
{
return (code == '@' || code == '*' || code == '+'
- || code == '&' || code == ';');
+ || code == '&' || code == ';' || code == '~');
}
/* Print a memory operand whose address is ADDR. */
@@ -18735,15 +18740,13 @@ ix86_prepare_sse_fp_compare_args (rtx dest, enum rtx_code code,
{
rtx tmp;
- /* AVX supports all the needed comparisons, no need to swap arguments
- nor help reload. */
- if (TARGET_AVX)
- return code;
-
switch (code)
{
case LTGT:
case UNEQ:
+ /* AVX supports all the needed comparisons. */
+ if (TARGET_AVX)
+ break;
/* We have no LTGT as an operator. We could implement it with
NE & ORDERED, but this requires an extra temporary. It's
not clear that it's worth it. */
@@ -18760,6 +18763,9 @@ ix86_prepare_sse_fp_compare_args (rtx dest, enum rtx_code code,
case NE:
case UNORDERED:
case ORDERED:
+ /* AVX has 3 operand comparisons, no need to swap anything. */
+ if (TARGET_AVX)
+ break;
/* For commutative operators, try to canonicalize the destination
operand to be first in the comparison - this helps reload to
avoid extra moves. */
@@ -18771,8 +18777,10 @@ ix86_prepare_sse_fp_compare_args (rtx dest, enum rtx_code code,
case GT:
case UNLE:
case UNLT:
- /* These are not supported directly. Swap the comparison operands
- to transform into something that is supported. */
+ /* These are not supported directly before AVX, and furthermore
+ ix86_expand_sse_fp_minmax only optimizes LT/UNGE. Swap the
+ comparison operands to transform into something that is
+ supported. */
tmp = *pop0;
*pop0 = *pop1;
*pop1 = tmp;
@@ -18882,7 +18890,12 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false)
enum machine_mode mode = GET_MODE (dest);
rtx t2, t3, x;
- if (op_false == CONST0_RTX (mode))
+ if (vector_all_ones_operand (op_true, GET_MODE (op_true))
+ && rtx_equal_p (op_false, CONST0_RTX (mode)))
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, dest, cmp));
+ }
+ else if (op_false == CONST0_RTX (mode))
{
op_true = force_reg (mode, op_true);
x = gen_rtx_AND (mode, cmp, op_true);
@@ -18895,34 +18908,103 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false)
x = gen_rtx_AND (mode, x, op_false);
emit_insn (gen_rtx_SET (VOIDmode, dest, x));
}
+ else if (INTEGRAL_MODE_P (mode) && op_true == CONSTM1_RTX (mode))
+ {
+ op_false = force_reg (mode, op_false);
+ x = gen_rtx_IOR (mode, cmp, op_false);
+ emit_insn (gen_rtx_SET (VOIDmode, dest, x));
+ }
else if (TARGET_XOP)
{
- rtx pcmov = gen_rtx_SET (mode, dest,
- gen_rtx_IF_THEN_ELSE (mode, cmp,
- op_true,
- op_false));
- emit_insn (pcmov);
+ op_true = force_reg (mode, op_true);
+
+ if (!nonimmediate_operand (op_false, mode))
+ op_false = force_reg (mode, op_false);
+
+ emit_insn (gen_rtx_SET (mode, dest,
+ gen_rtx_IF_THEN_ELSE (mode, cmp,
+ op_true,
+ op_false)));
}
else
{
- op_true = force_reg (mode, op_true);
+ rtx (*gen) (rtx, rtx, rtx, rtx) = NULL;
+
+ if (!nonimmediate_operand (op_true, mode))
+ op_true = force_reg (mode, op_true);
+
op_false = force_reg (mode, op_false);
- t2 = gen_reg_rtx (mode);
- if (optimize)
- t3 = gen_reg_rtx (mode);
+ switch (mode)
+ {
+ case V4SFmode:
+ if (TARGET_SSE4_1)
+ gen = gen_sse4_1_blendvps;
+ break;
+ case V2DFmode:
+ if (TARGET_SSE4_1)
+ gen = gen_sse4_1_blendvpd;
+ break;
+ case V16QImode:
+ case V8HImode:
+ case V4SImode:
+ case V2DImode:
+ if (TARGET_SSE4_1)
+ {
+ gen = gen_sse4_1_pblendvb;
+ dest = gen_lowpart (V16QImode, dest);
+ op_false = gen_lowpart (V16QImode, op_false);
+ op_true = gen_lowpart (V16QImode, op_true);
+ cmp = gen_lowpart (V16QImode, cmp);
+ }
+ break;
+ case V8SFmode:
+ if (TARGET_AVX)
+ gen = gen_avx_blendvps256;
+ break;
+ case V4DFmode:
+ if (TARGET_AVX)
+ gen = gen_avx_blendvpd256;
+ break;
+ case V32QImode:
+ case V16HImode:
+ case V8SImode:
+ case V4DImode:
+ if (TARGET_AVX2)
+ {
+ gen = gen_avx2_pblendvb;
+ dest = gen_lowpart (V32QImode, dest);
+ op_false = gen_lowpart (V32QImode, op_false);
+ op_true = gen_lowpart (V32QImode, op_true);
+ cmp = gen_lowpart (V32QImode, cmp);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (gen != NULL)
+ emit_insn (gen (dest, op_false, op_true, cmp));
else
- t3 = dest;
+ {
+ op_true = force_reg (mode, op_true);
- x = gen_rtx_AND (mode, op_true, cmp);
- emit_insn (gen_rtx_SET (VOIDmode, t2, x));
+ t2 = gen_reg_rtx (mode);
+ if (optimize)
+ t3 = gen_reg_rtx (mode);
+ else
+ t3 = dest;
- x = gen_rtx_NOT (mode, cmp);
- x = gen_rtx_AND (mode, x, op_false);
- emit_insn (gen_rtx_SET (VOIDmode, t3, x));
+ x = gen_rtx_AND (mode, op_true, cmp);
+ emit_insn (gen_rtx_SET (VOIDmode, t2, x));
- x = gen_rtx_IOR (mode, t3, t2);
- emit_insn (gen_rtx_SET (VOIDmode, dest, x));
+ x = gen_rtx_NOT (mode, cmp);
+ x = gen_rtx_AND (mode, x, op_false);
+ emit_insn (gen_rtx_SET (VOIDmode, t3, x));
+
+ x = gen_rtx_IOR (mode, t3, t2);
+ emit_insn (gen_rtx_SET (VOIDmode, dest, x));
+ }
}
}
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5e1701c858b..baa22a6bc04 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -293,6 +293,11 @@
;; Instruction suffix for sign and zero extensions.
(define_code_attr extsuffix [(sign_extend "sx") (zero_extend "zx")])
+;; i128 for integer vectors and TARGET_AVX2, f128 otherwise.
+(define_mode_attr i128
+ [(V8SF "f128") (V4DF "f128") (V32QI "%~128") (V16HI "%~128")
+ (V8SI "%~128") (V4DI "%~128")])
+
;; Mix-n-match
(define_mode_iterator AVX256MODE2P [V8SI V8SF V4DF])
@@ -3834,23 +3839,13 @@
(match_operand:VI8F_256 1 "register_operand" "x,x")
(parallel [(const_int 2) (const_int 3)])))]
"TARGET_AVX"
-{
- if (get_attr_mode (insn) == MODE_OI)
- return "vextracti128\t{$0x1, %1, %0|%0, %1, 0x1}";
- else
- return "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}";
-}
+ "vextract<i128>\t{$0x1, %1, %0|%0, %1, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "memory" "none,store")
(set_attr "prefix" "vex")
- (set (attr "mode")
- (if_then_else
- (and (match_test "TARGET_AVX2")
- (eq (const_string "<MODE>mode") (const_string "V4DImode")))
- (const_string "OI")
- (const_string "V4DF")))])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn_and_split "vec_extract_lo_<mode>"
[(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=x,m")
@@ -3879,23 +3874,13 @@
(parallel [(const_int 4) (const_int 5)
(const_int 6) (const_int 7)])))]
"TARGET_AVX"
-{
- if (get_attr_mode (insn) == MODE_OI)
- return "vextracti128\t{$0x1, %1, %0|%0, %1, 0x1}";
- else
- return "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}";
-}
+ "vextract<i128>\t{$0x1, %1, %0|%0, %1, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "memory" "none,store")
(set_attr "prefix" "vex")
- (set (attr "mode")
- (if_then_else
- (and (match_test "TARGET_AVX2")
- (eq (const_string "<MODE>mode") (const_string "V8SImode")))
- (const_string "OI")
- (const_string "V8SF")))])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn_and_split "vec_extract_lo_v16hi"
[(set (match_operand:V8HI 0 "nonimmediate_operand" "=x,m")
@@ -3928,21 +3913,13 @@
(const_int 12) (const_int 13)
(const_int 14) (const_int 15)])))]
"TARGET_AVX"
-{
- if (get_attr_mode (insn) == MODE_OI)
- return "vextracti128\t{$0x1, %1, %0|%0, %1, 0x1}";
- else
- return "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}";
-}
+ "vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "memory" "none,store")
(set_attr "prefix" "vex")
- (set (attr "mode")
- (if_then_else (match_test "TARGET_AVX2")
- (const_string "OI")
- (const_string "V8SF")))])
+ (set_attr "mode" "OI")])
(define_insn_and_split "vec_extract_lo_v32qi"
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
@@ -3983,21 +3960,13 @@
(const_int 28) (const_int 29)
(const_int 30) (const_int 31)])))]
"TARGET_AVX"
-{
- if (get_attr_mode (insn) == MODE_OI)
- return "vextracti128\t{$0x1, %1, %0|%0, %1, 0x1}";
- else
- return "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}";
-}
+ "vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "memory" "none,store")
(set_attr "prefix" "vex")
- (set (attr "mode")
- (if_then_else (match_test "TARGET_AVX2")
- (const_string "OI")
- (const_string "V8SF")))])
+ (set_attr "mode" "OI")])
(define_insn_and_split "*sse4_1_extractps"
[(set (match_operand:SF 0 "nonimmediate_operand" "=rm,x,x")
@@ -5887,8 +5856,8 @@
(define_expand "<code><mode>3"
[(set (match_operand:VI124_128 0 "register_operand" "")
- (smaxmin:VI124_128 (match_operand:VI124_128 1 "register_operand" "")
- (match_operand:VI124_128 2 "register_operand" "")))]
+ (smaxmin:VI124_128 (match_operand:VI124_128 1 "nonimmediate_operand" "")
+ (match_operand:VI124_128 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
{
if (TARGET_SSE4_1 || <MODE>mode == V8HImode)
@@ -5899,6 +5868,8 @@
bool ok;
xops[0] = operands[0];
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+ operands[2] = force_reg (<MODE>mode, operands[2]);
if (<CODE> == SMAX)
{
@@ -5954,8 +5925,8 @@
(define_expand "<code><mode>3"
[(set (match_operand:VI124_128 0 "register_operand" "")
- (umaxmin:VI124_128 (match_operand:VI124_128 1 "register_operand" "")
- (match_operand:VI124_128 2 "register_operand" "")))]
+ (umaxmin:VI124_128 (match_operand:VI124_128 1 "nonimmediate_operand" "")
+ (match_operand:VI124_128 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
{
if (TARGET_SSE4_1 || <MODE>mode == V16QImode)
@@ -5963,6 +5934,7 @@
else if (<CODE> == UMAX && <MODE>mode == V8HImode)
{
rtx op0 = operands[0], op2 = operands[2], op3 = op0;
+ operands[1] = force_reg (<MODE>mode, operands[1]);
if (rtx_equal_p (op3, op2))
op3 = gen_reg_rtx (V8HImode);
emit_insn (gen_sse2_ussubv8hi3 (op3, operands[1], op2));
@@ -5974,6 +5946,9 @@
rtx xops[6];
bool ok;
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+ operands[2] = force_reg (<MODE>mode, operands[2]);
+
xops[0] = operands[0];
if (<CODE> == UMAX)
@@ -10395,8 +10370,8 @@
[(set (match_operand:V 0 "register_operand" "=x,x")
(if_then_else:V
(match_operand:V 3 "nonimmediate_operand" "x,m")
- (match_operand:V 1 "vector_move_operand" "x,x")
- (match_operand:V 2 "vector_move_operand" "xm,x")))]
+ (match_operand:V 1 "register_operand" "x,x")
+ (match_operand:V 2 "nonimmediate_operand" "xm,x")))]
"TARGET_XOP"
"vpcmov\t{%3, %2, %1, %0|%0, %1, %2, %3}"
[(set_attr "type" "sse4arg")])
@@ -11606,14 +11581,14 @@
(match_dup 1)))]
"TARGET_AVX"
"@
- vbroadcastf128\t{%1, %0|%0, %1}
- vinsertf128\t{$1, %1, %0, %0|%0, %0, %1, 1}
- vperm2f128\t{$0, %t1, %t1, %0|%0, %t1, %t1, 0}"
+ vbroadcast<i128>\t{%1, %0|%0, %1}
+ vinsert<i128>\t{$1, %1, %0, %0|%0, %0, %1, 1}
+ vperm2<i128>\t{$0, %t1, %t1, %0|%0, %t1, %t1, 0}"
[(set_attr "type" "ssemov,sselog1,sselog1")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "0,1,1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V4SF,V8SF,V8SF")])
+ (set_attr "mode" "<sseinsnmode>")])
;; Recognize broadcast as a vec_select as produced by builtin_vec_perm.
;; If it so happens that the input is in memory, use vbroadcast.
@@ -11807,12 +11782,12 @@
(match_operand:SI 3 "const_0_to_255_operand" "n")]
UNSPEC_VPERMIL2F128))]
"TARGET_AVX"
- "vperm2f128\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ "vperm2<i128>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn "*avx_vperm2f128<mode>_nozero"
[(set (match_operand:AVX256MODE2P 0 "register_operand" "=x")
@@ -11827,13 +11802,13 @@
{
int mask = avx_vperm2f128_parallel (operands[3], <MODE>mode) - 1;
operands[3] = GEN_INT (mask);
- return "vperm2f128\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+ return "vperm2<i128>\t{%3, %2, %1, %0|%0, %1, %2, %3}";
}
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_expand "avx_vinsertf128<mode>"
[(match_operand:V_256 0 "register_operand" "")
@@ -11898,12 +11873,12 @@
(match_operand:VI8F_256 1 "register_operand" "x")
(parallel [(const_int 2) (const_int 3)]))))]
"TARGET_AVX"
- "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ "vinsert<i128>\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V4DF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn "vec_set_hi_<mode>"
[(set (match_operand:VI8F_256 0 "register_operand" "=x")
@@ -11913,12 +11888,12 @@
(parallel [(const_int 0) (const_int 1)]))
(match_operand:<ssehalfvecmode> 2 "nonimmediate_operand" "xm")))]
"TARGET_AVX"
- "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ "vinsert<i128>\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V4DF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn "vec_set_lo_<mode>"
[(set (match_operand:VI4F_256 0 "register_operand" "=x")
@@ -11929,12 +11904,12 @@
(parallel [(const_int 4) (const_int 5)
(const_int 6) (const_int 7)]))))]
"TARGET_AVX"
- "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ "vinsert<i128>\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn "vec_set_hi_<mode>"
[(set (match_operand:VI4F_256 0 "register_operand" "=x")
@@ -11945,12 +11920,12 @@
(const_int 2) (const_int 3)]))
(match_operand:<ssehalfvecmode> 2 "nonimmediate_operand" "xm")))]
"TARGET_AVX"
- "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ "vinsert<i128>\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "<sseinsnmode>")])
(define_insn "vec_set_lo_v16hi"
[(set (match_operand:V16HI 0 "register_operand" "=x")
@@ -11963,12 +11938,12 @@
(const_int 12) (const_int 13)
(const_int 14) (const_int 15)]))))]
"TARGET_AVX"
- "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ "vinsert%~128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "OI")])
(define_insn "vec_set_hi_v16hi"
[(set (match_operand:V16HI 0 "register_operand" "=x")
@@ -11981,12 +11956,12 @@
(const_int 6) (const_int 7)]))
(match_operand:V8HI 2 "nonimmediate_operand" "xm")))]
"TARGET_AVX"
- "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ "vinsert%~128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "OI")])
(define_insn "vec_set_lo_v32qi"
[(set (match_operand:V32QI 0 "register_operand" "=x")
@@ -12003,12 +11978,12 @@
(const_int 28) (const_int 29)
(const_int 30) (const_int 31)]))))]
"TARGET_AVX"
- "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ "vinsert%~128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "OI")])
(define_insn "vec_set_hi_v32qi"
[(set (match_operand:V32QI 0 "register_operand" "=x")
@@ -12025,12 +12000,12 @@
(const_int 14) (const_int 15)]))
(match_operand:V16QI 2 "nonimmediate_operand" "xm")))]
"TARGET_AVX"
- "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ "vinsert%~128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
- (set_attr "mode" "V8SF")])
+ (set_attr "mode" "OI")])
(define_expand "<avx_avx2>_maskload<ssemodesuffix><avxsizesuffix>"
[(set (match_operand:V48_AVX2 0 "register_operand" "")
@@ -12411,7 +12386,7 @@
switch (which_alternative)
{
case 0:
- return "vinsertf128\t{$0x1, %2, %t1, %0|%0, %t1, %2, 0x1}";
+ return "vinsert<i128>\t{$0x1, %2, %t1, %0|%0, %t1, %2, 0x1}";
case 1:
switch (get_attr_mode (insn))
{
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 8e7043f1fe5..af3f9757137 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -484,6 +484,11 @@ i386_pe_asm_named_section (const char *name, unsigned int flags,
{
char flagchars[8], *f = flagchars;
+#if defined (HAVE_GAS_SECTION_EXCLUDE) && HAVE_GAS_SECTION_EXCLUDE == 1
+ if ((flags & SECTION_EXCLUDE) != 0)
+ *f++ = 'e';
+#endif
+
if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0)
/* readonly data */
{
@@ -498,6 +503,12 @@ i386_pe_asm_named_section (const char *name, unsigned int flags,
*f++ = 'w';
if (flags & SECTION_PE_SHARED)
*f++ = 's';
+#if !defined (HAVE_GAS_SECTION_EXCLUDE) || HAVE_GAS_SECTION_EXCLUDE == 0
+ /* If attribute "e" isn't supported we mark this section as
+ never-load. */
+ if ((flags & SECTION_EXCLUDE) != 0)
+ *f++ = 'n';
+#endif
}
/* LTO sections need 1-byte alignment to avoid confusing the
diff --git a/gcc/config/iq2000/iq2000.md b/gcc/config/iq2000/iq2000.md
index 7ad113d9538..51fbe22fbe2 100644
--- a/gcc/config/iq2000/iq2000.md
+++ b/gcc/config/iq2000/iq2000.md
@@ -161,7 +161,7 @@
(define_attr "branch_likely" "no,yes"
(const
- (if_then_else (ne (symbol_ref "GENERATE_BRANCHLIKELY") (const_int 0))
+ (if_then_else (match_test "GENERATE_BRANCHLIKELY")
(const_string "yes")
(const_string "no"))))
diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md
index 0719357350e..cce8f1ccb74 100644
--- a/gcc/config/m32r/m32r.md
+++ b/gcc/config/m32r/m32r.md
@@ -69,9 +69,9 @@
;; The target CPU we're compiling for.
(define_attr "cpu" "m32r,m32r2,m32rx"
- (cond [(ne (symbol_ref "TARGET_M32RX") (const_int 0))
+ (cond [(match_test "TARGET_M32RX")
(const_string "m32rx")
- (ne (symbol_ref "TARGET_M32R2") (const_int 0))
+ (match_test "TARGET_M32R2")
(const_string "m32r2")]
(const_string "m32r")))
@@ -2012,8 +2012,7 @@
}"
[(set_attr "type" "call")
(set (attr "length")
- (if_then_else (eq (symbol_ref "call26_operand (operands[0], FUNCTION_MODE)")
- (const_int 0))
+ (if_then_else (not (match_test "call26_operand (operands[0], FUNCTION_MODE)"))
(const_int 12) ; 10 + 2 for nop filler
; The return address must be on a 4 byte boundary so
; there's no point in using a value of 2 here. A 2 byte
@@ -2072,8 +2071,7 @@
}"
[(set_attr "type" "call")
(set (attr "length")
- (if_then_else (eq (symbol_ref "call26_operand (operands[1], FUNCTION_MODE)")
- (const_int 0))
+ (if_then_else (not (match_test "call26_operand (operands[1], FUNCTION_MODE)"))
(const_int 12) ; 10 + 2 for nop filler
; The return address must be on a 4 byte boundary so
; there's no point in using a value of 2 here. A 2 byte
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 22cb60b6b11..d0b6b4c2b74 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -8202,6 +8202,15 @@ mips_frame_set (rtx mem, rtx reg)
return set;
}
+
+/* Record that the epilogue has restored call-saved register REG. */
+
+static void
+mips_add_cfa_restore (rtx reg)
+{
+ mips_epilogue.cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg,
+ mips_epilogue.cfa_restores);
+}
/* If a MIPS16e SAVE or RESTORE instruction saves or restores register
mips16e_s2_s8_regs[X], it must also save the registers in indexes
@@ -8393,8 +8402,7 @@ mips16e_save_restore_reg (bool restore_p, bool reg_parm_p,
reg = gen_rtx_REG (SImode, regno);
if (restore_p)
{
- mips_epilogue.cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg,
- mips_epilogue.cfa_restores);
+ mips_add_cfa_restore (reg);
return gen_rtx_SET (VOIDmode, reg, mem);
}
if (reg_parm_p)
@@ -10290,9 +10298,13 @@ mips_restore_reg (rtx reg, rtx mem)
$7 instead and adjust the return insn appropriately. */
if (TARGET_MIPS16 && REGNO (reg) == RETURN_ADDR_REGNUM)
reg = gen_rtx_REG (GET_MODE (reg), GP_REG_FIRST + 7);
+ else if (GET_MODE (reg) == DFmode && !TARGET_FLOAT64)
+ {
+ mips_add_cfa_restore (mips_subword (reg, true));
+ mips_add_cfa_restore (mips_subword (reg, false));
+ }
else
- mips_epilogue.cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg,
- mips_epilogue.cfa_restores);
+ mips_add_cfa_restore (reg);
mips_emit_save_slot_move (reg, mem, MIPS_EPILOGUE_TEMP (GET_MODE (reg)));
if (REGNO (reg) == REGNO (mips_epilogue.cfa_reg))
diff --git a/gcc/config/rx/predicates.md b/gcc/config/rx/predicates.md
index 77b3353ac3e..aa0321e13b7 100644
--- a/gcc/config/rx/predicates.md
+++ b/gcc/config/rx/predicates.md
@@ -72,6 +72,16 @@
(match_operand 0 "rx_restricted_mem_operand"))
)
+;; Check that the operand is suitable as the source operand
+;; for a min/max instruction. This is the same as
+;; rx_source_operand except that CONST_INTs are allowed but
+;; REGs and SUBREGs are not.
+
+(define_predicate "rx_minmaxex_operand"
+ (ior (match_operand 0 "immediate_operand")
+ (match_operand 0 "rx_restricted_mem_operand"))
+)
+
;; Return true if OP is a store multiple operation. This looks like:
;;
;; [(set (SP) (MINUS (SP) (INT)))
diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md
index f7b8e16eb91..f082ed2763c 100644
--- a/gcc/config/rx/rx.md
+++ b/gcc/config/rx/rx.md
@@ -22,6 +22,9 @@
;; This code iterator is used for sign- and zero- extensions.
(define_mode_iterator small_int_modes [(HI "") (QI "")])
+;; This code iterator is used for max and min operations.
+(define_mode_iterator int_modes [(SI "") (HI "") (QI "")])
+
;; We do not handle DFmode here because it is either
;; the same as SFmode, or if -m64bit-doubles is active
;; then all operations on doubles have to be handled by
@@ -1160,28 +1163,109 @@
(set_attr "timings" "22,44")]
)
-(define_insn "smaxsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
- (smax:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
- (match_operand:SI 2 "rx_source_operand"
- "r,Sint08,Sint16,Sint24,i,Q")))]
+(define_insn "smax<int_modes:mode>3"
+ [(set (match_operand:int_modes 0 "register_operand" "=r,r,r,r,r,r")
+ (smax:int_modes (match_operand:int_modes 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:int_modes 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))]
""
"max\t%Q2, %0"
[(set_attr "length" "3,4,5,6,7,6")
(set_attr "timings" "11,11,11,11,11,33")]
)
-(define_insn "sminsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
- (smin:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
- (match_operand:SI 2 "rx_source_operand"
- "r,Sint08,Sint16,Sint24,i,Q")))]
+(define_insn "smin<int_modes:mode>3"
+ [(set (match_operand:int_modes 0 "register_operand" "=r,r,r,r,r,r")
+ (smin:int_modes (match_operand:int_modes 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:int_modes 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))]
""
"min\t%Q2, %0"
[(set_attr "length" "3,4,5,6,7,6")
(set_attr "timings" "11,11,11,11,11,33")]
)
+(define_insn "umax<small_int_modes:mode>3_u"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (smax:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
+ (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
+ "r,Sint08,Sint16,Sint24,i,Q"))))]
+ ""
+ "max\t%R2, %0"
+ [(set_attr "length" "3,4,5,6,7,6")
+ (set_attr "timings" "11,11,11,11,11,33")]
+)
+
+(define_insn "umin<small_int_modes:mode>3_ur"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (smin:SI (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
+ "r,Sint08,Sint16,Sint24,i,Q"))
+ (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")))]
+ ""
+ "min\t%R2, %0"
+ [(set_attr "length" "3,4,5,6,7,6")
+ (set_attr "timings" "11,11,11,11,11,33")]
+)
+
+(define_insn "umax<small_int_modes:mode>3_ur"
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
+ (smax:SI (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
+ "r,Sint08,Sint16,Sint24,i,Q"))
+ (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")))]
+ ""
+ "max\t%R2, %0"
+ [(set_attr "length" "3,4,5,6,7,6")
+ (set_attr "timings" "11,11,11,11,11,33")]
+)
+
+(define_expand "umax<small_int_modes:mode>3"
+ [(set (match_dup 4)
+ (zero_extend:SI (match_operand:small_int_modes 1 "register_operand" "%0,0,0,0,0,0")))
+ (set (match_dup 3)
+ (smax:SI (match_dup 4)
+ (match_operand:small_int_modes 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))
+ (set (match_operand:small_int_modes 0 "register_operand" "=r,r,r,r,r,r")
+ (match_dup 6))
+ ]
+ ""
+ "operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_reg_rtx (SImode);
+ operands[5] = gen_reg_rtx (SImode);
+ operands[6] = gen_rtx_SUBREG (GET_MODE (operands[0]), operands[3],
+ TARGET_BIG_ENDIAN_DATA ? (GET_MODE (operands[0]) == HImode ? 2 : 3) : 0);
+ if (GET_CODE (operands[2]) != CONST_INT)
+ {
+ emit_move_insn (operands[5], gen_rtx_ZERO_EXTEND (SImode, operands[2]));
+ operands[2] = operands[5];
+ }
+ "
+)
+
+(define_expand "umin<small_int_modes:mode>3"
+ [(set (match_dup 4)
+ (zero_extend:SI (match_operand:small_int_modes 1 "register_operand" "%0,0,0,0,0,0")))
+ (set (match_dup 3)
+ (smin:SI (match_dup 4)
+ (match_operand:small_int_modes 2 "rx_source_operand"
+ "r,Sint08,Sint16,Sint24,i,Q")))
+ (set (match_operand:small_int_modes 0 "register_operand" "=r,r,r,r,r,r")
+ (match_dup 6))
+ ]
+ ""
+ "operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_reg_rtx (SImode);
+ operands[5] = gen_reg_rtx (SImode);
+ operands[6] = gen_rtx_SUBREG (GET_MODE (operands[0]), operands[3],
+ TARGET_BIG_ENDIAN_DATA ? (GET_MODE (operands[0]) == HImode ? 2 : 3) : 0);
+ if (GET_CODE (operands[2]) != CONST_INT)
+ {
+ emit_move_insn (operands[5], gen_rtx_ZERO_EXTEND (SImode, operands[2]));
+ operands[2] = operands[5];
+ }
+ "
+)
+
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
(mult:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,0,r,r")
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 93477ff8b05..c0bfdd3af49 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -242,7 +242,7 @@ static void sh_file_start (void);
static int flow_dependent_p (rtx, rtx);
static void flow_dependent_p_1 (rtx, const_rtx, void *);
static int shiftcosts (rtx);
-static int andcosts (rtx);
+static int and_xor_ior_costs (rtx, int code);
static int addsubcosts (rtx);
static int multcosts (rtx);
static bool unspec_caller_rtx_p (rtx);
@@ -2830,14 +2830,15 @@ shiftcosts (rtx x)
return shift_insns[value];
}
-/* Return the cost of an AND operation. */
+/* Return the cost of an AND/XOR/IOR operation. */
static inline int
-andcosts (rtx x)
+and_xor_ior_costs (rtx x, int code)
{
int i;
- /* Anding with a register is a single cycle and instruction. */
+ /* A logical operation with two registers is a single cycle
+ instruction. */
if (!CONST_INT_P (XEXP (x, 1)))
return 1;
@@ -2853,17 +2854,18 @@ andcosts (rtx x)
}
/* These constants are single cycle extu.[bw] instructions. */
- if (i == 0xff || i == 0xffff)
+ if ((i == 0xff || i == 0xffff) && code == AND)
return 1;
- /* Constants that can be used in an and immediate instruction in a single
- cycle, but this requires r0, so make it a little more expensive. */
+ /* Constants that can be used in an instruction as an immediate are
+ a single cycle, but this requires r0, so make it a little more
+ expensive. */
if (CONST_OK_FOR_K08 (i))
return 2;
- /* Constants that can be loaded with a mov immediate and an and.
+ /* Constants that can be loaded with a mov immediate need one more cycle.
This case is probably unnecessary. */
if (CONST_OK_FOR_I08 (i))
return 2;
- /* Any other constants requires a 2 cycle pc-relative load plus an and.
+ /* Any other constant requires an additional 2 cycle pc-relative load.
This case is probably unnecessary. */
return 3;
}
@@ -3032,7 +3034,9 @@ sh_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
return true;
case AND:
- *total = COSTS_N_INSNS (andcosts (x));
+ case XOR:
+ case IOR:
+ *total = COSTS_N_INSNS (and_xor_ior_costs (x, code));
return true;
case MULT:
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index f2c4e551ada..63cb9393653 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -4282,28 +4282,39 @@ label:
"sub r63, %1, %0"
[(set_attr "type" "arith_media")])
+
+
+;; Don't expand immediately because otherwise neg:DI (abs:DI) will not be
+;; combined.
(define_expand "negdi2"
- [(set (match_operand:DI 0 "arith_reg_operand" "")
- (neg:DI (match_operand:DI 1 "arith_reg_operand" "")))]
+ [(set (match_operand:DI 0 "arith_reg_dest" "")
+ (neg:DI (match_operand:DI 1 "arith_reg_operand" "")))
+ (clobber (reg:SI T_REG))]
""
+ "")
+
+(define_insn_and_split "*negdi2"
+ [(set (match_operand:DI 0 "arith_reg_dest" "=r")
+ (neg:DI (match_operand:DI 1 "arith_reg_operand" "r")))]
+ "TARGET_SH1"
+ "#"
+ "TARGET_SH1"
+ [(const_int 0)]
"
{
- if (TARGET_SH1)
- {
- int low_word = (TARGET_LITTLE_ENDIAN ? 0 : 1);
- int high_word = (TARGET_LITTLE_ENDIAN ? 1 : 0);
+ int low_word = (TARGET_LITTLE_ENDIAN ? 0 : 1);
+ int high_word = (TARGET_LITTLE_ENDIAN ? 1 : 0);
- rtx low_src = operand_subword (operands[1], low_word, 0, DImode);
- rtx high_src = operand_subword (operands[1], high_word, 0, DImode);
+ rtx low_src = operand_subword (operands[1], low_word, 0, DImode);
+ rtx high_src = operand_subword (operands[1], high_word, 0, DImode);
- rtx low_dst = operand_subword (operands[0], low_word, 1, DImode);
- rtx high_dst = operand_subword (operands[0], high_word, 1, DImode);
+ rtx low_dst = operand_subword (operands[0], low_word, 1, DImode);
+ rtx high_dst = operand_subword (operands[0], high_word, 1, DImode);
- emit_insn (gen_clrt ());
- emit_insn (gen_negc (low_dst, low_src));
- emit_insn (gen_negc (high_dst, high_src));
- DONE;
- }
+ emit_insn (gen_clrt ());
+ emit_insn (gen_negc (low_dst, low_src));
+ emit_insn (gen_negc (high_dst, high_src));
+ DONE;
}")
(define_insn "negsi2"
@@ -4326,27 +4337,77 @@ label:
(const_int -1)))]
"TARGET_SHMEDIA" "")
-/* The SH4 202 can do zero-offset branches without pipeline stalls.
- This can be used as some kind of conditional execution, which is useful
- for abs. */
-(define_split
+(define_expand "abssi2"
[(set (match_operand:SI 0 "arith_reg_dest" "")
- (plus:SI (xor:SI (neg:SI (reg:SI T_REG))
- (match_operand:SI 1 "arith_reg_operand" ""))
- (reg:SI T_REG)))]
- "TARGET_HARD_SH4"
+ (abs:SI (match_operand:SI 1 "arith_reg_operand" "")))
+ (clobber (reg:SI T_REG))]
+ ""
+ "")
+
+(define_insn_and_split "*abssi2"
+ [(set (match_operand:SI 0 "arith_reg_dest" "=r")
+ (abs:SI (match_operand:SI 1 "arith_reg_operand" "r")))]
+ "TARGET_SH1"
+ "#"
+ "TARGET_SH1"
[(const_int 0)]
- "emit_insn (gen_movsi_i (operands[0], operands[1]));
- emit_insn (gen_cneg (operands[0], operands[0], operands[0]));
- DONE;")
+ "
+{
+ emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
+ emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1],
+ const1_rtx));
+ DONE;
+}")
-(define_insn "cneg"
+(define_insn_and_split "*negabssi2"
[(set (match_operand:SI 0 "arith_reg_dest" "=r")
- (if_then_else:SI (eq:SI (reg:SI T_REG) (const_int 0))
- (match_operand:SI 1 "arith_reg_operand" "0")
- (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))]
+ (neg:SI (abs:SI (match_operand:SI 1 "arith_reg_operand" "r"))))]
+ "TARGET_SH1"
+ "#"
+ "TARGET_SH1"
+ [(const_int 0)]
+ "
+{
+ emit_insn (gen_cmpgesi_t (operands[1], const0_rtx));
+ emit_insn (gen_negsi_cond (operands[0], operands[1], operands[1],
+ const0_rtx));
+ DONE;
+}")
+
+
+;; The SH4 202 can do zero-offset branches without pipeline stalls.
+;; This can be used as some kind of conditional execution, which is useful
+;; for abs.
+;; Actually the instruction scheduling should decide whether to use a
+;; zero-offset branch or not for any generic case involving a single
+;; instruction on SH4 202.
+
+(define_insn_and_split "negsi_cond"
+ [(set (match_operand:SI 0 "arith_reg_dest" "=r,r")
+ (if_then_else:SI (eq:SI (reg:SI T_REG)
+ (match_operand:SI 3 "const_int_operand" "M,N"))
+ (match_operand:SI 1 "arith_reg_operand" "0,0")
+ (neg:SI (match_operand:SI 2 "arith_reg_operand" "r,r"))))]
"TARGET_HARD_SH4"
- "bf 0f\;neg %2,%0\\n0:"
+ "@
+ bt\\t0f\;neg\\t%2,%0\\n0:
+ bf\\t0f\;neg\\t%2,%0\\n0:"
+ "!TARGET_HARD_SH4"
+ [(const_int 0)]
+ "
+{
+ rtx skip_neg_label = gen_label_rtx ();
+
+ emit_insn (gen_movsi (operands[0], operands[1]));
+
+ emit_jump_insn (INTVAL (operands[3])
+ ? gen_branch_true (skip_neg_label)
+ : gen_branch_false (skip_neg_label));
+
+ emit_label_after (skip_neg_label,
+ emit_insn (gen_negsi2 (operands[0], operands[1])));
+ DONE;
+}"
[(set_attr "type" "arith") ;; poor approximation
(set_attr "length" "4")])
diff --git a/gcc/config/sparc/constraints.md b/gcc/config/sparc/constraints.md
index cca34ede595..317602c6e95 100644
--- a/gcc/config/sparc/constraints.md
+++ b/gcc/config/sparc/constraints.md
@@ -18,7 +18,7 @@
;; <http://www.gnu.org/licenses/>.
;;; Unused letters:
-;;; ABCD P Z
+;;; AB
;;; a jkl q tuvwxyz
@@ -52,6 +52,10 @@
(and (match_code "const_double")
(match_test "const_zero_operand (op, mode)")))
+(define_constraint "C"
+ "The floating-point all-ones constant"
+ (and (match_code "const_double")
+ (match_test "const_all_ones_operand (op, mode)")))
;; Integer constant constraints
@@ -95,6 +99,10 @@
(and (match_code "const_int")
(match_test "ival == 4096")))
+(define_constraint "P"
+ "The integer constant -1"
+ (and (match_code "const_int")
+ (match_test "ival == -1")))
;; Extra constraints
;; Our memory extra constraints have to emulate the behavior of 'm' and 'o',
@@ -146,3 +154,8 @@
"The vector zero constant"
(and (match_code "const_vector")
(match_test "const_zero_operand (op, mode)")))
+
+(define_constraint "Z"
+ "The vector all ones constant"
+ (and (match_code "const_vector")
+ (match_test "const_all_ones_operand (op, mode)")))
diff --git a/gcc/config/sparc/niagara.md b/gcc/config/sparc/niagara.md
index a618b195a43..c7a2245ecfa 100644
--- a/gcc/config/sparc/niagara.md
+++ b/gcc/config/sparc/niagara.md
@@ -114,5 +114,5 @@
*/
(define_insn_reservation "niag_vis" 8
(and (eq_attr "cpu" "niagara")
- (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge"))
+ (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge,edgen,gsr,array"))
"niag_pipe*8")
diff --git a/gcc/config/sparc/niagara2.md b/gcc/config/sparc/niagara2.md
index d53be84e096..fa07becd822 100644
--- a/gcc/config/sparc/niagara2.md
+++ b/gcc/config/sparc/niagara2.md
@@ -111,10 +111,10 @@
(define_insn_reservation "niag2_vis" 6
(and (eq_attr "cpu" "niagara2")
- (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge"))
+ (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge,edgen,array,gsr"))
"niag2_pipe*6")
(define_insn_reservation "niag3_vis" 9
(and (eq_attr "cpu" "niagara3")
- (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge"))
+ (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge,edgen,array,gsr"))
"niag2_pipe*9")
diff --git a/gcc/config/sparc/predicates.md b/gcc/config/sparc/predicates.md
index 4af960a880e..21399b5902a 100644
--- a/gcc/config/sparc/predicates.md
+++ b/gcc/config/sparc/predicates.md
@@ -29,6 +29,35 @@
(and (match_code "const_int,const_double,const_vector")
(match_test "op == CONST1_RTX (mode)")))
+;; Return true if the integer representation of OP is
+;; all-ones.
+(define_predicate "const_all_ones_operand"
+ (match_code "const_int,const_double,const_vector")
+{
+ if (GET_CODE (op) == CONST_INT && INTVAL (op) == -1)
+ return true;
+#if HOST_BITS_PER_WIDE_INT == 32
+ if (GET_CODE (op) == CONST_DOUBLE
+ && GET_MODE (op) == VOIDmode
+ && CONST_DOUBLE_HIGH (op) == ~(HOST_WIDE_INT)0
+ && CONST_DOUBLE_LOW (op) == ~(HOST_WIDE_INT)0)
+ return true;
+#endif
+ if (GET_CODE (op) == CONST_VECTOR)
+ {
+ int i, num_elem = CONST_VECTOR_NUNITS (op);
+
+ for (i = 0; i < num_elem; i++)
+ {
+ rtx n = CONST_VECTOR_ELT (op, i);
+ if (! const_all_ones_operand (n, mode))
+ return false;
+ }
+ return true;
+ }
+ return false;
+})
+
;; Return true if OP is the integer constant 4096.
(define_predicate "const_4096_operand"
(and (match_code "const_int")
@@ -211,6 +240,12 @@
(ior (match_operand 0 "register_operand")
(match_operand 0 "const_zero_operand")))
+;; Return true if OP is either the zero constant, the all-ones
+;; constant, or a register.
+(define_predicate "register_or_zero_or_all_ones_operand"
+ (ior (match_operand 0 "register_or_zero_operand")
+ (match_operand 0 "const_all_ones_operand")))
+
;; Return true if OP is a register operand in a floating point register.
(define_predicate "fp_register_operand"
(match_operand 0 "register_operand")
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index bd58c9f8c7b..fea60d0543b 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -125,9 +125,9 @@ along with GCC; see the file COPYING3. If not see
#undef CPP_CPU64_DEFAULT_SPEC
#define CPP_CPU64_DEFAULT_SPEC ""
#undef ASM_CPU32_DEFAULT_SPEC
-#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb"
+#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus" AS_NIAGARA3_FLAG
#undef ASM_CPU64_DEFAULT_SPEC
-#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
+#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG AS_NIAGARA3_FLAG
#undef ASM_CPU_DEFAULT_SPEC
#define ASM_CPU_DEFAULT_SPEC ASM_CPU32_DEFAULT_SPEC
#endif
@@ -240,8 +240,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
%{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
%{mcpu=niagara:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
%{mcpu=niagara2:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
-%{mcpu=niagara3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
-%{mcpu=niagara4:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
+%{mcpu=niagara3:" DEF_ARCH32_SPEC("-xarch=v8plus" AS_NIAGARA3_FLAG) DEF_ARCH64_SPEC(AS_SPARC64_FLAG AS_NIAGARA3_FLAG) "} \
+%{mcpu=niagara4:" DEF_ARCH32_SPEC("-xarch=v8plus" AS_NIAGARA3_FLAG) DEF_ARCH64_SPEC(AS_SPARC64_FLAG AS_NIAGARA3_FLAG) "} \
%{!mcpu=niagara4:%{!mcpu=niagara3:%{!mcpu=niagara2:%{!mcpu=niagara:%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}}}}}} \
%{!mcpu*:%(asm_cpu_default)} \
"
diff --git a/gcc/config/sparc/sparc-c.c b/gcc/config/sparc/sparc-c.c
new file mode 100644
index 00000000000..c18797045ae
--- /dev/null
+++ b/gcc/config/sparc/sparc-c.c
@@ -0,0 +1,63 @@
+/* Subroutines used for macro/preprocessor support on SPARC.
+ Copyright (C) 2011
+ 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 3, 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 COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "tm_p.h"
+#include "flags.h"
+#include "c-family/c-common.h"
+#include "c-family/c-pragma.h"
+#include "cpplib.h"
+
+void
+sparc_target_macros (void)
+{
+ builtin_define_std ("sparc");
+
+ if (TARGET_64BIT)
+ {
+ cpp_assert (parse_in, "cpu=sparc64");
+ cpp_assert (parse_in, "machine=sparc64");
+ }
+ else
+ {
+ cpp_assert (parse_in, "cpu=sparc");
+ cpp_assert (parse_in, "machine=sparc");
+ }
+
+ if (TARGET_VIS3)
+ {
+ cpp_define (parse_in, "__VIS__=0x300");
+ cpp_define (parse_in, "__VIS=0x300");
+ }
+ else if (TARGET_VIS2)
+ {
+ cpp_define (parse_in, "__VIS__=0x200");
+ cpp_define (parse_in, "__VIS=0x200");
+ }
+ else if (TARGET_VIS)
+ {
+ cpp_define (parse_in, "__VIS__=0x100");
+ cpp_define (parse_in, "__VIS=0x100");
+ }
+}
diff --git a/gcc/config/sparc/sparc-modes.def b/gcc/config/sparc/sparc-modes.def
index 6284700867d..ed135ccc1b7 100644
--- a/gcc/config/sparc/sparc-modes.def
+++ b/gcc/config/sparc/sparc-modes.def
@@ -43,5 +43,6 @@ CC_MODE (CCFP);
CC_MODE (CCFPE);
/* Vector modes. */
+VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */
VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */
VECTOR_MODES (INT, 4); /* V4QI V2HI */
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index a5e25879793..dfa461a5f58 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -47,6 +47,7 @@ extern int short_branch (int, int);
extern void sparc_profile_hook (int);
extern void sparc_override_options (void);
extern void sparc_output_scratch_registers (FILE *);
+extern void sparc_target_macros (void);
#ifdef RTX_CODE
extern enum machine_mode select_cc_mode (enum rtx_code, rtx, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 6ccc97b7416..4df9f6a8088 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -329,7 +329,7 @@ char leaf_reg_remap[] =
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100};
+ 96, 97, 98, 99, 100, 101, 102};
/* Vector, indexed by hard register number, which contains 1
for a register that is allowable in a candidate for leaf
@@ -347,7 +347,7 @@ char sparc_leaf_regs[] =
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1};
+ 1, 1, 1, 1, 1, 1, 1};
struct GTY(()) machine_function
{
@@ -769,16 +769,16 @@ sparc_option_override (void)
/* UltraSPARC III */
/* ??? Check if %y issue still holds true. */
{ MASK_ISA,
- MASK_V9|MASK_DEPRECATED_V8_INSNS},
+ MASK_V9|MASK_DEPRECATED_V8_INSNS|MASK_VIS2},
/* UltraSPARC T1 */
{ MASK_ISA,
MASK_V9|MASK_DEPRECATED_V8_INSNS},
/* UltraSPARC T2 */
- { MASK_ISA, MASK_V9},
+ { MASK_ISA, MASK_V9|MASK_VIS2},
/* UltraSPARC T3 */
- { MASK_ISA, MASK_V9},
+ { MASK_ISA, MASK_V9|MASK_VIS2|MASK_VIS3|MASK_FMAF},
/* UltraSPARC T4 */
- { MASK_ISA, MASK_V9},
+ { MASK_ISA, MASK_V9|MASK_VIS2|MASK_VIS3|MASK_FMAF},
};
const struct cpu_table *cpu;
unsigned int i;
@@ -857,9 +857,17 @@ sparc_option_override (void)
if (target_flags_explicit & MASK_FPU)
target_flags = (target_flags & ~MASK_FPU) | fpu;
- /* Don't allow -mvis if FPU is disabled. */
+ /* -mvis2 implies -mvis */
+ if (TARGET_VIS2)
+ target_flags |= MASK_VIS;
+
+ /* -mvis3 implies -mvis2 and -mvis */
+ if (TARGET_VIS3)
+ target_flags |= MASK_VIS2 | MASK_VIS;
+
+ /* Don't allow -mvis, -mvis2, -mvis3, or -mfmaf if FPU is disabled. */
if (! TARGET_FPU)
- target_flags &= ~MASK_VIS;
+ target_flags &= ~(MASK_VIS | MASK_VIS2 | MASK_VIS3 | MASK_FMAF);
/* -mvis assumes UltraSPARC+, so we are sure v9 instructions
are available.
@@ -870,6 +878,10 @@ sparc_option_override (void)
target_flags &= ~(MASK_V8 | MASK_SPARCLET | MASK_SPARCLITE);
}
+ /* -mvis also implies -mv8plus on 32-bit */
+ if (TARGET_VIS && ! TARGET_ARCH64)
+ target_flags |= MASK_V8PLUS;
+
/* Use the deprecated v8 insns for sparc64 in 32 bit mode. */
if (TARGET_V9 && TARGET_ARCH32)
target_flags |= MASK_DEPRECATED_V8_INSNS;
@@ -1166,9 +1178,11 @@ sparc_expand_move (enum machine_mode mode, rtx *operands)
if (operands [1] == const0_rtx)
operands[1] = CONST0_RTX (mode);
- /* We can clear FP registers if TARGET_VIS, and always other regs. */
+ /* We can clear or set to all-ones FP registers if TARGET_VIS, and
+ always other regs. */
if ((TARGET_VIS || REGNO (operands[0]) < SPARC_FIRST_FP_REG)
- && const_zero_operand (operands[1], mode))
+ && (const_zero_operand (operands[1], mode)
+ || const_all_ones_operand (operands[1], mode)))
return false;
if (REGNO (operands[0]) < SPARC_FIRST_FP_REG
@@ -2851,9 +2865,10 @@ eligible_for_restore_insn (rtx trial, bool return_p)
int
eligible_for_return_delay (rtx trial)
{
+ int regno;
rtx pat;
- if (GET_CODE (trial) != INSN || GET_CODE (PATTERN (trial)) != SET)
+ if (GET_CODE (trial) != INSN)
return 0;
if (get_attr_length (trial) != 1)
@@ -2870,17 +2885,45 @@ eligible_for_return_delay (rtx trial)
get_attr_in_uncond_branch_delay (trial) == IN_UNCOND_BRANCH_DELAY_TRUE;
pat = PATTERN (trial);
+ if (GET_CODE (pat) == PARALLEL)
+ {
+ int i;
+
+ if (! TARGET_V9)
+ return 0;
+ for (i = XVECLEN (pat, 0) - 1; i >= 0; i--)
+ {
+ rtx expr = XVECEXP (pat, 0, i);
+ if (GET_CODE (expr) != SET)
+ return 0;
+ if (GET_CODE (SET_DEST (expr)) != REG)
+ return 0;
+ regno = REGNO (SET_DEST (expr));
+ if (regno >= 8 && regno < 24)
+ return 0;
+ }
+ return !epilogue_renumber (&pat, 1)
+ && (get_attr_in_uncond_branch_delay (trial)
+ == IN_UNCOND_BRANCH_DELAY_TRUE);
+ }
+
+ if (GET_CODE (pat) != SET)
+ return 0;
+
+ if (GET_CODE (SET_DEST (pat)) != REG)
+ return 0;
+
+ regno = REGNO (SET_DEST (pat));
/* Otherwise, only operations which can be done in tandem with
a `restore' or `return' insn can go into the delay slot. */
- if (GET_CODE (SET_DEST (pat)) != REG
- || (REGNO (SET_DEST (pat)) >= 8 && REGNO (SET_DEST (pat)) < 24))
+ if (regno >= 8 && regno < 24)
return 0;
/* If this instruction sets up floating point register and we have a return
instruction, it can probably go in. But restore will not work
with FP_REGS. */
- if (REGNO (SET_DEST (pat)) >= 32)
+ if (regno >= 32)
return (TARGET_V9
&& !epilogue_renumber (&pat, 1)
&& get_attr_in_uncond_branch_delay (trial)
@@ -3092,19 +3135,21 @@ sparc_legitimate_constant_p (enum machine_mode mode, rtx x)
return true;
/* Floating point constants are generally not ok.
- The only exception is 0.0 in VIS. */
+ The only exception is 0.0 and all-ones in VIS. */
if (TARGET_VIS
&& SCALAR_FLOAT_MODE_P (mode)
- && const_zero_operand (x, mode))
+ && (const_zero_operand (x, mode)
+ || const_all_ones_operand (x, mode)))
return true;
return false;
case CONST_VECTOR:
/* Vector constants are generally not ok.
- The only exception is 0 in VIS. */
+ The only exception is 0 or -1 in VIS. */
if (TARGET_VIS
- && const_zero_operand (x, mode))
+ && (const_zero_operand (x, mode)
+ || const_all_ones_operand (x, mode)))
return true;
return false;
@@ -4036,8 +4081,8 @@ static const int hard_32bit_mode_classes[] = {
/* %fcc[0123] */
CCFP_MODES, CCFP_MODES, CCFP_MODES, CCFP_MODES,
- /* %icc */
- CC_MODES
+ /* %icc, %sfp, %gsr */
+ CC_MODES, 0, D_MODES
};
static const int hard_64bit_mode_classes[] = {
@@ -4061,8 +4106,8 @@ static const int hard_64bit_mode_classes[] = {
/* %fcc[0123] */
CCFP_MODES, CCFP_MODES, CCFP_MODES, CCFP_MODES,
- /* %icc */
- CC_MODES
+ /* %icc, %sfp, %gsr */
+ CC_MODES, 0, D_MODES
};
int sparc_mode_class [NUM_MACHINE_MODES];
@@ -9100,9 +9145,21 @@ sparc_init_libfuncs (void)
}
}
-#define def_builtin(NAME, CODE, TYPE) \
- add_builtin_function((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, \
- NULL_TREE)
+static tree def_builtin(const char *name, int code, tree type)
+{
+ return add_builtin_function(name, type, code, BUILT_IN_MD, NULL,
+ NULL_TREE);
+}
+
+static tree def_builtin_const(const char *name, int code, tree type)
+{
+ tree t = def_builtin(name, code, type);
+
+ if (t)
+ TREE_READONLY (t) = 1;
+
+ return t;
+}
/* Implement the TARGET_INIT_BUILTINS target hook.
Create builtin functions for special SPARC instructions. */
@@ -9124,6 +9181,7 @@ sparc_vis_init_builtins (void)
tree v4hi = build_vector_type (intHI_type_node, 4);
tree v2hi = build_vector_type (intHI_type_node, 2);
tree v2si = build_vector_type (intSI_type_node, 2);
+ tree v1si = build_vector_type (intSI_type_node, 1);
tree v4qi_ftype_v4hi = build_function_type_list (v4qi, v4hi, 0);
tree v8qi_ftype_v2si_v8qi = build_function_type_list (v8qi, v2si, v8qi, 0);
@@ -9137,44 +9195,75 @@ sparc_vis_init_builtins (void)
tree v4hi_ftype_v4hi_v4hi = build_function_type_list (v4hi, v4hi, v4hi, 0);
tree v2si_ftype_v2si_v2si = build_function_type_list (v2si, v2si, v2si, 0);
tree v8qi_ftype_v8qi_v8qi = build_function_type_list (v8qi, v8qi, v8qi, 0);
+ tree v2hi_ftype_v2hi_v2hi = build_function_type_list (v2hi, v2hi, v2hi, 0);
+ tree v1si_ftype_v1si_v1si = build_function_type_list (v1si, v1si, v1si, 0);
tree di_ftype_v8qi_v8qi_di = build_function_type_list (intDI_type_node,
v8qi, v8qi,
intDI_type_node, 0);
+ tree di_ftype_v8qi_v8qi = build_function_type_list (intDI_type_node,
+ v8qi, v8qi, 0);
+ tree si_ftype_v8qi_v8qi = build_function_type_list (intSI_type_node,
+ v8qi, v8qi, 0);
tree di_ftype_di_di = build_function_type_list (intDI_type_node,
intDI_type_node,
intDI_type_node, 0);
+ tree si_ftype_si_si = build_function_type_list (intSI_type_node,
+ intSI_type_node,
+ intSI_type_node, 0);
tree ptr_ftype_ptr_si = build_function_type_list (ptr_type_node,
ptr_type_node,
intSI_type_node, 0);
tree ptr_ftype_ptr_di = build_function_type_list (ptr_type_node,
ptr_type_node,
intDI_type_node, 0);
+ tree si_ftype_ptr_ptr = build_function_type_list (intSI_type_node,
+ ptr_type_node,
+ ptr_type_node, 0);
+ tree di_ftype_ptr_ptr = build_function_type_list (intDI_type_node,
+ ptr_type_node,
+ ptr_type_node, 0);
+ tree si_ftype_v4hi_v4hi = build_function_type_list (intSI_type_node,
+ v4hi, v4hi, 0);
+ tree si_ftype_v2si_v2si = build_function_type_list (intSI_type_node,
+ v2si, v2si, 0);
+ tree di_ftype_v4hi_v4hi = build_function_type_list (intDI_type_node,
+ v4hi, v4hi, 0);
+ tree di_ftype_v2si_v2si = build_function_type_list (intDI_type_node,
+ v2si, v2si, 0);
+ tree void_ftype_di = build_function_type_list (void_type_node,
+ intDI_type_node, 0);
+ tree di_ftype_void = build_function_type_list (intDI_type_node,
+ void_type_node, 0);
+ tree void_ftype_si = build_function_type_list (void_type_node,
+ intSI_type_node, 0);
/* Packing and expanding vectors. */
- def_builtin ("__builtin_vis_fpack16", CODE_FOR_fpack16_vis, v4qi_ftype_v4hi);
+ def_builtin ("__builtin_vis_fpack16", CODE_FOR_fpack16_vis,
+ v4qi_ftype_v4hi);
def_builtin ("__builtin_vis_fpack32", CODE_FOR_fpack32_vis,
v8qi_ftype_v2si_v8qi);
def_builtin ("__builtin_vis_fpackfix", CODE_FOR_fpackfix_vis,
v2hi_ftype_v2si);
- def_builtin ("__builtin_vis_fexpand", CODE_FOR_fexpand_vis, v4hi_ftype_v4qi);
- def_builtin ("__builtin_vis_fpmerge", CODE_FOR_fpmerge_vis,
- v8qi_ftype_v4qi_v4qi);
+ def_builtin_const ("__builtin_vis_fexpand", CODE_FOR_fexpand_vis,
+ v4hi_ftype_v4qi);
+ def_builtin_const ("__builtin_vis_fpmerge", CODE_FOR_fpmerge_vis,
+ v8qi_ftype_v4qi_v4qi);
/* Multiplications. */
- def_builtin ("__builtin_vis_fmul8x16", CODE_FOR_fmul8x16_vis,
- v4hi_ftype_v4qi_v4hi);
- def_builtin ("__builtin_vis_fmul8x16au", CODE_FOR_fmul8x16au_vis,
- v4hi_ftype_v4qi_v2hi);
- def_builtin ("__builtin_vis_fmul8x16al", CODE_FOR_fmul8x16al_vis,
- v4hi_ftype_v4qi_v2hi);
- def_builtin ("__builtin_vis_fmul8sux16", CODE_FOR_fmul8sux16_vis,
- v4hi_ftype_v8qi_v4hi);
- def_builtin ("__builtin_vis_fmul8ulx16", CODE_FOR_fmul8ulx16_vis,
- v4hi_ftype_v8qi_v4hi);
- def_builtin ("__builtin_vis_fmuld8sux16", CODE_FOR_fmuld8sux16_vis,
- v2si_ftype_v4qi_v2hi);
- def_builtin ("__builtin_vis_fmuld8ulx16", CODE_FOR_fmuld8ulx16_vis,
- v2si_ftype_v4qi_v2hi);
+ def_builtin_const ("__builtin_vis_fmul8x16", CODE_FOR_fmul8x16_vis,
+ v4hi_ftype_v4qi_v4hi);
+ def_builtin_const ("__builtin_vis_fmul8x16au", CODE_FOR_fmul8x16au_vis,
+ v4hi_ftype_v4qi_v2hi);
+ def_builtin_const ("__builtin_vis_fmul8x16al", CODE_FOR_fmul8x16al_vis,
+ v4hi_ftype_v4qi_v2hi);
+ def_builtin_const ("__builtin_vis_fmul8sux16", CODE_FOR_fmul8sux16_vis,
+ v4hi_ftype_v8qi_v4hi);
+ def_builtin_const ("__builtin_vis_fmul8ulx16", CODE_FOR_fmul8ulx16_vis,
+ v4hi_ftype_v8qi_v4hi);
+ def_builtin_const ("__builtin_vis_fmuld8sux16", CODE_FOR_fmuld8sux16_vis,
+ v2si_ftype_v4qi_v2hi);
+ def_builtin_const ("__builtin_vis_fmuld8ulx16", CODE_FOR_fmuld8ulx16_vis,
+ v2si_ftype_v4qi_v2hi);
/* Data aligning. */
def_builtin ("__builtin_vis_faligndatav4hi", CODE_FOR_faligndatav4hi_vis,
@@ -9184,31 +9273,286 @@ sparc_vis_init_builtins (void)
def_builtin ("__builtin_vis_faligndatav2si", CODE_FOR_faligndatav2si_vis,
v2si_ftype_v2si_v2si);
def_builtin ("__builtin_vis_faligndatadi", CODE_FOR_faligndatadi_vis,
- di_ftype_di_di);
+ di_ftype_di_di);
+
+ def_builtin ("__builtin_vis_write_gsr", CODE_FOR_wrgsr_vis,
+ void_ftype_di);
+ def_builtin ("__builtin_vis_read_gsr", CODE_FOR_rdgsr_vis,
+ di_ftype_void);
+
if (TARGET_ARCH64)
- def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrdi_vis,
- ptr_ftype_ptr_di);
+ {
+ def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrdi_vis,
+ ptr_ftype_ptr_di);
+ def_builtin ("__builtin_vis_alignaddrl", CODE_FOR_alignaddrldi_vis,
+ ptr_ftype_ptr_di);
+ }
else
- def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrsi_vis,
- ptr_ftype_ptr_si);
+ {
+ def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrsi_vis,
+ ptr_ftype_ptr_si);
+ def_builtin ("__builtin_vis_alignaddrl", CODE_FOR_alignaddrlsi_vis,
+ ptr_ftype_ptr_si);
+ }
/* Pixel distance. */
- def_builtin ("__builtin_vis_pdist", CODE_FOR_pdist_vis,
- di_ftype_v8qi_v8qi_di);
+ def_builtin_const ("__builtin_vis_pdist", CODE_FOR_pdist_vis,
+ di_ftype_v8qi_v8qi_di);
/* Edge handling. */
- def_builtin ("__builtin_vis_edge8", CODE_FOR_edge8_vis,
- di_ftype_di_di);
- def_builtin ("__builtin_vis_edge8l", CODE_FOR_edge8l_vis,
- di_ftype_di_di);
- def_builtin ("__builtin_vis_edge16", CODE_FOR_edge16_vis,
- di_ftype_di_di);
- def_builtin ("__builtin_vis_edge16l", CODE_FOR_edge16l_vis,
- di_ftype_di_di);
- def_builtin ("__builtin_vis_edge32", CODE_FOR_edge32_vis,
- di_ftype_di_di);
- def_builtin ("__builtin_vis_edge32l", CODE_FOR_edge32l_vis,
- di_ftype_di_di);
+ if (TARGET_ARCH64)
+ {
+ def_builtin_const ("__builtin_vis_edge8", CODE_FOR_edge8di_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge8l", CODE_FOR_edge8ldi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16", CODE_FOR_edge16di_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16l", CODE_FOR_edge16ldi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32", CODE_FOR_edge32di_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32l", CODE_FOR_edge32ldi_vis,
+ di_ftype_ptr_ptr);
+ if (TARGET_VIS2)
+ {
+ def_builtin_const ("__builtin_vis_edge8n", CODE_FOR_edge8ndi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge8ln", CODE_FOR_edge8lndi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16n", CODE_FOR_edge16ndi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16ln", CODE_FOR_edge16lndi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32n", CODE_FOR_edge32ndi_vis,
+ di_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32ln", CODE_FOR_edge32lndi_vis,
+ di_ftype_ptr_ptr);
+ }
+ }
+ else
+ {
+ def_builtin_const ("__builtin_vis_edge8", CODE_FOR_edge8si_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge8l", CODE_FOR_edge8lsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16", CODE_FOR_edge16si_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16l", CODE_FOR_edge16lsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32", CODE_FOR_edge32si_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32l", CODE_FOR_edge32lsi_vis,
+ si_ftype_ptr_ptr);
+ if (TARGET_VIS2)
+ {
+ def_builtin_const ("__builtin_vis_edge8n", CODE_FOR_edge8nsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge8ln", CODE_FOR_edge8lnsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16n", CODE_FOR_edge16nsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge16ln", CODE_FOR_edge16lnsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32n", CODE_FOR_edge32nsi_vis,
+ si_ftype_ptr_ptr);
+ def_builtin_const ("__builtin_vis_edge32ln", CODE_FOR_edge32lnsi_vis,
+ si_ftype_ptr_ptr);
+ }
+ }
+
+ /* Pixel compare. */
+ if (TARGET_ARCH64)
+ {
+ def_builtin_const ("__builtin_vis_fcmple16", CODE_FOR_fcmple16di_vis,
+ di_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmple32", CODE_FOR_fcmple32di_vis,
+ di_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpne16", CODE_FOR_fcmpne16di_vis,
+ di_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpne32", CODE_FOR_fcmpne32di_vis,
+ di_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpgt16", CODE_FOR_fcmpgt16di_vis,
+ di_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpgt32", CODE_FOR_fcmpgt32di_vis,
+ di_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpeq16", CODE_FOR_fcmpeq16di_vis,
+ di_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpeq32", CODE_FOR_fcmpeq32di_vis,
+ di_ftype_v2si_v2si);
+ }
+ else
+ {
+ def_builtin_const ("__builtin_vis_fcmple16", CODE_FOR_fcmple16si_vis,
+ si_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmple32", CODE_FOR_fcmple32si_vis,
+ si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpne16", CODE_FOR_fcmpne16si_vis,
+ si_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpne32", CODE_FOR_fcmpne32si_vis,
+ si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpgt16", CODE_FOR_fcmpgt16si_vis,
+ si_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpgt32", CODE_FOR_fcmpgt32si_vis,
+ si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fcmpeq16", CODE_FOR_fcmpeq16si_vis,
+ si_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fcmpeq32", CODE_FOR_fcmpeq32si_vis,
+ si_ftype_v2si_v2si);
+ }
+
+ /* Addition and subtraction. */
+ def_builtin_const ("__builtin_vis_fpadd16", CODE_FOR_addv4hi3,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fpadd16s", CODE_FOR_addv2hi3,
+ v2hi_ftype_v2hi_v2hi);
+ def_builtin_const ("__builtin_vis_fpadd32", CODE_FOR_addv2si3,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fpadd32s", CODE_FOR_addsi3,
+ v1si_ftype_v1si_v1si);
+ def_builtin_const ("__builtin_vis_fpsub16", CODE_FOR_subv4hi3,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fpsub16s", CODE_FOR_subv2hi3,
+ v2hi_ftype_v2hi_v2hi);
+ def_builtin_const ("__builtin_vis_fpsub32", CODE_FOR_subv2si3,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fpsub32s", CODE_FOR_subsi3,
+ v1si_ftype_v1si_v1si);
+
+ /* Three-dimensional array addressing. */
+ if (TARGET_ARCH64)
+ {
+ def_builtin_const ("__builtin_vis_array8", CODE_FOR_array8di_vis,
+ di_ftype_di_di);
+ def_builtin_const ("__builtin_vis_array16", CODE_FOR_array16di_vis,
+ di_ftype_di_di);
+ def_builtin_const ("__builtin_vis_array32", CODE_FOR_array32di_vis,
+ di_ftype_di_di);
+ }
+ else
+ {
+ def_builtin_const ("__builtin_vis_array8", CODE_FOR_array8si_vis,
+ si_ftype_si_si);
+ def_builtin_const ("__builtin_vis_array16", CODE_FOR_array16si_vis,
+ si_ftype_si_si);
+ def_builtin_const ("__builtin_vis_array32", CODE_FOR_array32si_vis,
+ si_ftype_si_si);
+ }
+
+ if (TARGET_VIS2)
+ {
+ /* Byte mask and shuffle */
+ if (TARGET_ARCH64)
+ def_builtin ("__builtin_vis_bmask", CODE_FOR_bmaskdi_vis,
+ di_ftype_di_di);
+ else
+ def_builtin ("__builtin_vis_bmask", CODE_FOR_bmasksi_vis,
+ si_ftype_si_si);
+ def_builtin ("__builtin_vis_bshufflev4hi", CODE_FOR_bshufflev4hi_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin ("__builtin_vis_bshufflev8qi", CODE_FOR_bshufflev8qi_vis,
+ v8qi_ftype_v8qi_v8qi);
+ def_builtin ("__builtin_vis_bshufflev2si", CODE_FOR_bshufflev2si_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin ("__builtin_vis_bshuffledi", CODE_FOR_bshuffledi_vis,
+ di_ftype_di_di);
+ }
+
+ if (TARGET_VIS3)
+ {
+ if (TARGET_ARCH64)
+ {
+ def_builtin ("__builtin_vis_cmask8", CODE_FOR_cmask8di_vis,
+ void_ftype_di);
+ def_builtin ("__builtin_vis_cmask16", CODE_FOR_cmask16di_vis,
+ void_ftype_di);
+ def_builtin ("__builtin_vis_cmask32", CODE_FOR_cmask32di_vis,
+ void_ftype_di);
+ }
+ else
+ {
+ def_builtin ("__builtin_vis_cmask8", CODE_FOR_cmask8si_vis,
+ void_ftype_si);
+ def_builtin ("__builtin_vis_cmask16", CODE_FOR_cmask16si_vis,
+ void_ftype_si);
+ def_builtin ("__builtin_vis_cmask32", CODE_FOR_cmask32si_vis,
+ void_ftype_si);
+ }
+
+ def_builtin_const ("__builtin_vis_fchksm16", CODE_FOR_fchksm16_vis,
+ v4hi_ftype_v4hi_v4hi);
+
+ def_builtin_const ("__builtin_vis_fsll16", CODE_FOR_fsll16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fslas16", CODE_FOR_fslas16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fsrl16", CODE_FOR_fsrl16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fsra16", CODE_FOR_fsra16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fsll32", CODE_FOR_fsll32_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fslas32", CODE_FOR_fslas32_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fsrl32", CODE_FOR_fsrl32_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fsra32", CODE_FOR_fsra32_vis,
+ v2si_ftype_v2si_v2si);
+
+ if (TARGET_ARCH64)
+ def_builtin_const ("__builtin_vis_pdistn", CODE_FOR_pdistndi_vis,
+ di_ftype_v8qi_v8qi);
+ else
+ def_builtin_const ("__builtin_vis_pdistn", CODE_FOR_pdistnsi_vis,
+ si_ftype_v8qi_v8qi);
+
+ def_builtin_const ("__builtin_vis_fmean16", CODE_FOR_fmean16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fpadd64", CODE_FOR_fpadd64_vis,
+ di_ftype_di_di);
+ def_builtin_const ("__builtin_vis_fpsub64", CODE_FOR_fpsub64_vis,
+ di_ftype_di_di);
+
+ def_builtin_const ("__builtin_vis_fpadds16", CODE_FOR_fpadds16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fpadds16s", CODE_FOR_fpadds16s_vis,
+ v2hi_ftype_v2hi_v2hi);
+ def_builtin_const ("__builtin_vis_fpsubs16", CODE_FOR_fpsubs16_vis,
+ v4hi_ftype_v4hi_v4hi);
+ def_builtin_const ("__builtin_vis_fpsubs16s", CODE_FOR_fpsubs16s_vis,
+ v2hi_ftype_v2hi_v2hi);
+ def_builtin_const ("__builtin_vis_fpadds32", CODE_FOR_fpadds32_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fpadds32s", CODE_FOR_fpadds32s_vis,
+ v1si_ftype_v1si_v1si);
+ def_builtin_const ("__builtin_vis_fpsubs32", CODE_FOR_fpsubs32_vis,
+ v2si_ftype_v2si_v2si);
+ def_builtin_const ("__builtin_vis_fpsubs32s", CODE_FOR_fpsubs32s_vis,
+ v1si_ftype_v1si_v1si);
+
+ if (TARGET_ARCH64)
+ {
+ def_builtin_const ("__builtin_vis_fucmple8", CODE_FOR_fucmple8di_vis,
+ di_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpne8", CODE_FOR_fucmpne8di_vis,
+ di_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpgt8", CODE_FOR_fucmpgt8di_vis,
+ di_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpeq8", CODE_FOR_fucmpeq8di_vis,
+ di_ftype_v8qi_v8qi);
+ }
+ else
+ {
+ def_builtin_const ("__builtin_vis_fucmple8", CODE_FOR_fucmple8si_vis,
+ si_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpne8", CODE_FOR_fucmpne8si_vis,
+ si_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpgt8", CODE_FOR_fucmpgt8si_vis,
+ si_ftype_v8qi_v8qi);
+ def_builtin_const ("__builtin_vis_fucmpeq8", CODE_FOR_fucmpeq8si_vis,
+ si_ftype_v8qi_v8qi);
+ }
+ }
}
/* Handle TARGET_EXPAND_BUILTIN target hook.
@@ -9225,32 +9569,49 @@ sparc_expand_builtin (tree exp, rtx target,
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
unsigned int icode = DECL_FUNCTION_CODE (fndecl);
rtx pat, op[4];
- enum machine_mode mode[4];
int arg_count = 0;
+ bool nonvoid;
- mode[0] = insn_data[icode].operand[0].mode;
- if (!target
- || GET_MODE (target) != mode[0]
- || ! (*insn_data[icode].operand[0].predicate) (target, mode[0]))
- op[0] = gen_reg_rtx (mode[0]);
- else
- op[0] = target;
+ nonvoid = TREE_TYPE (TREE_TYPE (fndecl)) != void_type_node;
+ if (nonvoid)
+ {
+ enum machine_mode tmode = insn_data[icode].operand[0].mode;
+ if (!target
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ op[0] = gen_reg_rtx (tmode);
+ else
+ op[0] = target;
+ }
FOR_EACH_CALL_EXPR_ARG (arg, iter, exp)
{
+ const struct insn_operand_data *insn_op;
+ int idx;
+
+ if (arg == error_mark_node)
+ return NULL_RTX;
+
arg_count++;
- mode[arg_count] = insn_data[icode].operand[arg_count].mode;
+ idx = arg_count - !nonvoid;
+ insn_op = &insn_data[icode].operand[idx];
op[arg_count] = expand_normal (arg);
- if (! (*insn_data[icode].operand[arg_count].predicate) (op[arg_count],
- mode[arg_count]))
- op[arg_count] = copy_to_mode_reg (mode[arg_count], op[arg_count]);
+ if (! (*insn_data[icode].operand[idx].predicate) (op[arg_count],
+ insn_op->mode))
+ op[arg_count] = copy_to_mode_reg (insn_op->mode, op[arg_count]);
}
switch (arg_count)
{
+ case 0:
+ pat = GEN_FCN (icode) (op[0]);
+ break;
case 1:
- pat = GEN_FCN (icode) (op[0], op[1]);
+ if (nonvoid)
+ pat = GEN_FCN (icode) (op[0], op[1]);
+ else
+ pat = GEN_FCN (icode) (op[1]);
break;
case 2:
pat = GEN_FCN (icode) (op[0], op[1], op[2]);
@@ -9267,7 +9628,10 @@ sparc_expand_builtin (tree exp, rtx target,
emit_insn (pat);
- return op[0];
+ if (nonvoid)
+ return op[0];
+ else
+ return const0_rtx;
}
static int
@@ -9350,10 +9714,27 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED,
tree rtype = TREE_TYPE (TREE_TYPE (fndecl));
enum insn_code icode = (enum insn_code) DECL_FUNCTION_CODE (fndecl);
- if (ignore
- && icode != CODE_FOR_alignaddrsi_vis
- && icode != CODE_FOR_alignaddrdi_vis)
- return build_zero_cst (rtype);
+ if (ignore)
+ {
+ switch (icode)
+ {
+ case CODE_FOR_alignaddrsi_vis:
+ case CODE_FOR_alignaddrdi_vis:
+ case CODE_FOR_wrgsr_vis:
+ case CODE_FOR_bmasksi_vis:
+ case CODE_FOR_bmaskdi_vis:
+ case CODE_FOR_cmask8si_vis:
+ case CODE_FOR_cmask8di_vis:
+ case CODE_FOR_cmask16si_vis:
+ case CODE_FOR_cmask16di_vis:
+ case CODE_FOR_cmask32si_vis:
+ case CODE_FOR_cmask32di_vis:
+ break;
+
+ default:
+ return build_zero_cst (rtype);
+ }
+ }
switch (icode)
{
@@ -9545,6 +9926,25 @@ sparc_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
*total = COSTS_N_INSNS (1);
return false;
+ case FMA:
+ {
+ rtx sub;
+
+ gcc_assert (float_mode_p);
+ *total = sparc_costs->float_mul;
+
+ sub = XEXP (x, 0);
+ if (GET_CODE (sub) == NEG)
+ sub = XEXP (sub, 0);
+ *total += rtx_cost (sub, FMA, 0, speed);
+
+ sub = XEXP (x, 2);
+ if (GET_CODE (sub) == NEG)
+ sub = XEXP (sub, 0);
+ *total += rtx_cost (sub, FMA, 2, speed);
+ return true;
+ }
+
case MULT:
if (float_mode_p)
*total = sparc_costs->float_mul;
@@ -10306,6 +10706,8 @@ sparc_conditional_register_usage (void)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
leaf_reg_remap [regno] = regno;
}
+ if (TARGET_VIS)
+ global_regs[SPARC_GSR_REG] = 1;
}
/* Implement TARGET_PREFERRED_RELOAD_CLASS
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index afdca1e3aab..fa943877550 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -105,25 +105,7 @@ struct processor_costs {
extern const struct processor_costs *sparc_costs;
-/* Target CPU builtins. FIXME: Defining sparc is for the benefit of
- Solaris only; otherwise just define __sparc__. Sadly the headers
- are such a mess there is no Solaris-specific header. */
-#define TARGET_CPU_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("sparc"); \
- if (TARGET_64BIT) \
- { \
- builtin_assert ("cpu=sparc64"); \
- builtin_assert ("machine=sparc64"); \
- } \
- else \
- { \
- builtin_assert ("cpu=sparc"); \
- builtin_assert ("machine=sparc"); \
- } \
- } \
- while (0)
+#define TARGET_CPU_CPP_BUILTINS() sparc_target_macros ()
/* Specify this in a cover file to provide bi-architecture (32/64) support. */
/* #define SPARC_BI_ARCH */
@@ -287,11 +269,11 @@ extern enum cmodel sparc_cmodel;
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara3
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
-#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
+#define ASM_CPU64_DEFAULT_SPEC "-Av9" AS_NIAGARA3_FLAG
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara4
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
-#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
+#define ASM_CPU64_DEFAULT_SPEC "-Av9" AS_NIAGARA3_FLAG
#endif
#else
@@ -431,8 +413,8 @@ extern enum cmodel sparc_cmodel;
%{mcpu=ultrasparc3:%{!mv8plus:-Av9b}} \
%{mcpu=niagara:%{!mv8plus:-Av9b}} \
%{mcpu=niagara2:%{!mv8plus:-Av9b}} \
-%{mcpu=niagara3:%{!mv8plus:-Av9b}} \
-%{mcpu=niagara4:%{!mv8plus:-Av9b}} \
+%{mcpu=niagara3:%{!mv8plus:-Av9" AS_NIAGARA3_FLAG "}} \
+%{mcpu=niagara4:%{!mv8plus:-Av9" AS_NIAGARA3_FLAG "}} \
%{!mcpu*:%(asm_cpu_default)} \
"
@@ -691,7 +673,7 @@ extern enum cmodel sparc_cmodel;
Register 100 is used as the integer condition code register.
Register 101 is used as the soft frame pointer register. */
-#define FIRST_PSEUDO_REGISTER 102
+#define FIRST_PSEUDO_REGISTER 103
#define SPARC_FIRST_FP_REG 32
/* Additional V9 fp regs. */
@@ -704,6 +686,7 @@ extern enum cmodel sparc_cmodel;
#define SPARC_FCC_REG 96
/* Integer CC reg. We don't distinguish %icc from %xcc. */
#define SPARC_ICC_REG 100
+#define SPARC_GSR_REG 102
/* Nonzero if REGNO is an fp reg. */
#define SPARC_FP_REG_P(REGNO) \
@@ -757,7 +740,7 @@ extern enum cmodel sparc_cmodel;
0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, \
\
- 0, 0, 0, 0, 0, 1}
+ 0, 0, 0, 0, 0, 1, 1}
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
@@ -782,7 +765,7 @@ extern enum cmodel sparc_cmodel;
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}
/* Return number of consecutive hard regs needed starting at reg REGNO
to hold something of mode MODE.
@@ -796,11 +779,12 @@ extern enum cmodel sparc_cmodel;
included in the hard register count). */
#define HARD_REGNO_NREGS(REGNO, MODE) \
- (TARGET_ARCH64 \
- ? ((REGNO) < 32 || (REGNO) == FRAME_POINTER_REGNUM \
- ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD \
- : (GET_MODE_SIZE (MODE) + 3) / 4) \
- : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+ ((REGNO) == SPARC_GSR_REG ? 1 : \
+ (TARGET_ARCH64 \
+ ? ((REGNO) < 32 || (REGNO) == FRAME_POINTER_REGNUM \
+ ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD \
+ : (GET_MODE_SIZE (MODE) + 3) / 4) \
+ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)))
/* Due to the ARCH64 discrepancy above we must override this next
macro too. */
@@ -985,7 +969,7 @@ enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS,
{0, -1, -1, 0}, /* EXTRA_FP_REGS */ \
{-1, -1, 0, 0x20}, /* GENERAL_OR_FP_REGS */ \
{-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */ \
- {-1, -1, -1, 0x3f}} /* ALL_REGS */
+ {-1, -1, -1, 0x7f}} /* ALL_REGS */
/* The same information, inverted:
Return the class number of the smallest class containing
@@ -1046,7 +1030,7 @@ extern enum reg_class sparc_regno_reg_class[FIRST_PSEUDO_REGISTER];
88, 89, 90, 91, 92, 93, 94, 95, /* %f56-%f63 */ \
39, 38, 37, 36, 35, 34, 33, 32, /* %f7-%f0 */ \
96, 97, 98, 99, /* %fcc0-3 */ \
- 100, 0, 14, 30, 101} /* %icc, %g0, %o6, %i6, %sfp */
+ 100, 0, 14, 30, 101, 102 } /* %icc, %g0, %o6, %i6, %sfp, %gsr */
/* This is the order in which to allocate registers for
leaf functions. If all registers can fit in the global and
@@ -1085,7 +1069,7 @@ extern enum reg_class sparc_regno_reg_class[FIRST_PSEUDO_REGISTER];
88, 89, 90, 91, 92, 93, 94, 95, /* %f56-%f63 */ \
39, 38, 37, 36, 35, 34, 33, 32, /* %f7-%f0 */ \
96, 97, 98, 99, /* %fcc0-3 */ \
- 100, 0, 14, 30, 31, 101} /* %icc, %g0, %o6, %i6, %i7, %sfp */
+ 100, 0, 14, 30, 31, 101, 102 } /* %icc, %g0, %o6, %i6, %i7, %sfp, %gsr */
#define ADJUST_REG_ALLOC_ORDER order_regs_for_local_alloc ()
@@ -1724,7 +1708,7 @@ do { \
"%f40", "%f41", "%f42", "%f43", "%f44", "%f45", "%f46", "%f47", \
"%f48", "%f49", "%f50", "%f51", "%f52", "%f53", "%f54", "%f55", \
"%f56", "%f57", "%f58", "%f59", "%f60", "%f61", "%f62", "%f63", \
- "%fcc0", "%fcc1", "%fcc2", "%fcc3", "%icc", "%sfp" }
+ "%fcc0", "%fcc1", "%fcc2", "%fcc3", "%icc", "%sfp", "%gsr" }
/* Define additional names for use in asm clobbers and asm declarations. */
@@ -1880,6 +1864,16 @@ extern int sparc_indent_opcode;
#define TARGET_SUN_TLS TARGET_TLS
#define TARGET_GNU_TLS 0
+#ifndef HAVE_AS_FMAF_HPC_VIS3
+#define AS_NIAGARA3_FLAG "b"
+#undef TARGET_FMAF
+#define TARGET_FMAF 0
+#undef TARGET_VIS3
+#define TARGET_VIS3 0
+#else
+#define AS_NIAGARA3_FLAG "d"
+#endif
+
/* 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 483dea13dbc..03158c7f07c 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -58,7 +58,7 @@
(UNSPEC_MUL8UL 46)
(UNSPEC_MULDUL 47)
(UNSPEC_ALIGNDATA 48)
- (UNSPEC_ALIGNADDR 49)
+ (UNSPEC_FCMP 49)
(UNSPEC_PDIST 50)
(UNSPEC_EDGE8 51)
(UNSPEC_EDGE8L 52)
@@ -66,9 +66,26 @@
(UNSPEC_EDGE16L 54)
(UNSPEC_EDGE32 55)
(UNSPEC_EDGE32L 56)
+ (UNSPEC_ARRAY8 57)
+ (UNSPEC_ARRAY16 58)
+ (UNSPEC_ARRAY32 59)
(UNSPEC_SP_SET 60)
(UNSPEC_SP_TEST 61)
+
+ (UNSPEC_EDGE8N 70)
+ (UNSPEC_EDGE8LN 71)
+ (UNSPEC_EDGE16N 72)
+ (UNSPEC_EDGE16LN 73)
+ (UNSPEC_EDGE32N 74)
+ (UNSPEC_EDGE32LN 75)
+ (UNSPEC_BSHUFFLE 76)
+ (UNSPEC_CMASK8 77)
+ (UNSPEC_CMASK16 78)
+ (UNSPEC_CMASK32 79)
+ (UNSPEC_FCHKSM16 80)
+ (UNSPEC_PDISTN 81)
+ (UNSPEC_FUCMP 82)
])
(define_constants
@@ -83,6 +100,95 @@
(UNSPECV_PROBE_STACK_RANGE 11)
])
+(define_constants
+ [(G0_REG 0)
+ (G1_REG 1)
+ (G2_REG 2)
+ (G3_REG 3)
+ (G4_REG 4)
+ (G5_REG 5)
+ (G6_REG 6)
+ (G7_REG 7)
+ (O0_REG 8)
+ (O1_REG 9)
+ (O2_REG 10)
+ (O3_REG 11)
+ (O4_REG 12)
+ (O5_REG 13)
+ (O6_REG 14)
+ (O7_REG 15)
+ (L0_REG 16)
+ (L1_REG 17)
+ (L2_REG 18)
+ (L3_REG 19)
+ (L4_REG 20)
+ (L5_REG 21)
+ (L6_REG 22)
+ (L7_REG 23)
+ (I0_REG 24)
+ (I1_REG 25)
+ (I2_REG 26)
+ (I3_REG 27)
+ (I4_REG 28)
+ (I5_REG 29)
+ (I6_REG 30)
+ (I7_REG 31)
+ (F0_REG 32)
+ (F1_REG 33)
+ (F2_REG 34)
+ (F3_REG 35)
+ (F4_REG 36)
+ (F5_REG 37)
+ (F6_REG 38)
+ (F7_REG 39)
+ (F8_REG 40)
+ (F9_REG 41)
+ (F10_REG 42)
+ (F11_REG 43)
+ (F12_REG 44)
+ (F13_REG 45)
+ (F14_REG 46)
+ (F15_REG 47)
+ (F16_REG 48)
+ (F17_REG 49)
+ (F18_REG 50)
+ (F19_REG 51)
+ (F20_REG 52)
+ (F21_REG 53)
+ (F22_REG 54)
+ (F23_REG 55)
+ (F24_REG 56)
+ (F25_REG 57)
+ (F26_REG 58)
+ (F27_REG 59)
+ (F28_REG 60)
+ (F29_REG 61)
+ (F30_REG 62)
+ (F31_REG 63)
+ (F32_REG 64)
+ (F34_REG 66)
+ (F36_REG 68)
+ (F38_REG 70)
+ (F40_REG 72)
+ (F42_REG 74)
+ (F44_REG 76)
+ (F46_REG 78)
+ (F48_REG 80)
+ (F50_REG 82)
+ (F52_REG 84)
+ (F54_REG 86)
+ (F56_REG 88)
+ (F58_REG 90)
+ (F60_REG 92)
+ (F62_REG 94)
+ (FCC0_REG 96)
+ (FCC1_REG 97)
+ (FCC2_REG 98)
+ (FCC3_REG 99)
+ (CC_REG 100)
+ (SFP_REG 101)
+ (GSR_REG 102)
+ ])
(define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
(define_mode_iterator I [QI HI SI DI])
@@ -95,12 +201,16 @@
(define_mode_iterator V64 [DF V2SI V4HI V8QI])
(define_mode_iterator V64I [DI V2SI V4HI V8QI])
+(define_mode_iterator V64N8 [V2SI V4HI])
+
;; The upper 32 fp regs on the v9 can't hold SFmode values. To deal with this
;; a second register class, EXTRA_FP_REGS, exists for the v9 chip. The name
;; is a bit of a misnomer as it covers all 64 fp regs. The corresponding
;; constraint letter is 'e'. To avoid any confusion, 'e' is used instead of
;; 'f' for all DF/TFmode values, including those that are specific to the v8.
+(define_mode_attr vbits [(V2SI "32") (V4HI "16") (SI "32s") (V2HI "16s")])
+(define_mode_attr vconstr [(V2SI "e") (V4HI "e") (SI "f") (V2HI "f")])
;; Attribute for cpu type.
;; These must match the values for enum processor_type in sparc.h.
@@ -148,7 +258,7 @@
fpcmp,
fpmul,fpdivs,fpdivd,
fpsqrts,fpsqrtd,
- fga,fgm_pack,fgm_mul,fgm_pdist,fgm_cmp,edge,
+ fga,fgm_pack,fgm_mul,fgm_pdist,fgm_cmp,edge,edgen,gsr,array,
cmove,
ialuX,
multi,savew,flushw,iflush,trap"
@@ -378,7 +488,7 @@
;; The compare DEFINE_INSNs.
(define_insn "*cmpsi_insn"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "arith_operand" "rI")))]
""
@@ -386,7 +496,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmpdi_sp64"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 1 "arith_operand" "rI")))]
"TARGET_ARCH64"
@@ -512,7 +622,7 @@
(match_operand:SI 2 "register_operand" "")))
(parallel [(set (match_operand:SI 0 "register_operand" "")
(eq:SI (match_dup 3) (const_int 0)))
- (clobber (reg:CC 100))])]
+ (clobber (reg:CC CC_REG))])]
""
{ operands[3] = gen_reg_rtx (SImode); })
@@ -531,7 +641,7 @@
(match_operand:SI 2 "register_operand" "")))
(parallel [(set (match_operand:SI 0 "register_operand" "")
(ne:SI (match_dup 3) (const_int 0)))
- (clobber (reg:CC 100))])]
+ (clobber (reg:CC CC_REG))])]
""
{ operands[3] = gen_reg_rtx (SImode); })
@@ -556,13 +666,13 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(ne:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (ltu:SI (reg:CC 100) (const_int 0)))]
+ (set (match_dup 0) (ltu:SI (reg:CC CC_REG) (const_int 0)))]
""
[(set_attr "length" "2")])
@@ -570,13 +680,13 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (ne:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
+ (set (match_dup 0) (neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
[(set_attr "length" "2")])
@@ -584,16 +694,16 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(ne:DI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"TARGET_ARCH64"
"#"
"&& 1"
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (minus:SI (const_int 0)
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (minus:SI (const_int 0)
(match_dup 1))
(const_int 0)))
(set (match_dup 0) (zero_extend:DI (plus:SI (plus:SI (const_int 0)
(const_int 0))
- (ltu:SI (reg:CC_NOOV 100)
+ (ltu:SI (reg:CC_NOOV CC_REG)
(const_int 0)))))]
""
[(set_attr "length" "2")])
@@ -647,13 +757,13 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (geu:SI (reg:CC 100) (const_int 0)))]
+ (set (match_dup 0) (geu:SI (reg:CC CC_REG) (const_int 0)))]
""
[(set_attr "length" "2")])
@@ -661,13 +771,13 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (neg:SI (geu:SI (reg:CC 100) (const_int 0))))]
+ (set (match_dup 0) (neg:SI (geu:SI (reg:CC CC_REG) (const_int 0))))]
""
[(set_attr "length" "2")])
@@ -675,16 +785,16 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(eq:DI (match_operand:SI 1 "register_operand" "r")
(const_int 0)))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"TARGET_ARCH64"
"#"
"&& 1"
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (minus:SI (const_int 0)
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (minus:SI (const_int 0)
(match_dup 1))
(const_int 0)))
(set (match_dup 0) (zero_extend:DI (minus:SI (minus:SI (const_int 0)
(const_int -1))
- (ltu:SI (reg:CC_NOOV 100)
+ (ltu:SI (reg:CC_NOOV CC_REG)
(const_int 0)))))]
""
[(set_attr "length" "2")])
@@ -743,13 +853,13 @@
(plus:SI (ne:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))
(match_operand:SI 2 "register_operand" "r")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (set (match_dup 0) (plus:SI (ltu:SI (reg:CC CC_REG) (const_int 0))
(match_dup 2)))]
""
[(set_attr "length" "2")])
@@ -759,14 +869,14 @@
(minus:SI (match_operand:SI 2 "register_operand" "r")
(ne:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
(set (match_dup 0) (minus:SI (match_dup 2)
- (ltu:SI (reg:CC 100) (const_int 0))))]
+ (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
[(set_attr "length" "2")])
@@ -775,13 +885,13 @@
(plus:SI (eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))
(match_operand:SI 2 "register_operand" "r")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
- (set (match_dup 0) (plus:SI (geu:SI (reg:CC 100) (const_int 0))
+ (set (match_dup 0) (plus:SI (geu:SI (reg:CC CC_REG) (const_int 0))
(match_dup 2)))]
""
[(set_attr "length" "2")])
@@ -791,14 +901,14 @@
(minus:SI (match_operand:SI 2 "register_operand" "r")
(eq:SI (match_operand:SI 1 "register_operand" "r")
(const_int 0))))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
""
"#"
""
- [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
+ [(set (reg:CC_NOOV CC_REG) (compare:CC_NOOV (neg:SI (match_dup 1))
(const_int 0)))
(set (match_dup 0) (minus:SI (match_dup 2)
- (geu:SI (reg:CC 100) (const_int 0))))]
+ (geu:SI (reg:CC CC_REG) (const_int 0))))]
""
[(set_attr "length" "2")])
@@ -808,14 +918,14 @@
(define_insn "*sltu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
- (ltu:SI (reg:CC 100) (const_int 0)))]
+ (ltu:SI (reg:CC CC_REG) (const_int 0)))]
""
"addx\t%%g0, 0, %0"
[(set_attr "type" "ialuX")])
(define_insn "*neg_sltu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
- (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
+ (neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
"subx\t%%g0, 0, %0"
[(set_attr "type" "ialuX")])
@@ -823,7 +933,7 @@
;; ??? Combine should canonicalize these next two to the same pattern.
(define_insn "*neg_sltu_minus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
- (minus:SI (neg:SI (ltu:SI (reg:CC 100) (const_int 0)))
+ (minus:SI (neg:SI (ltu:SI (reg:CC CC_REG) (const_int 0)))
(match_operand:SI 1 "arith_operand" "rI")))]
""
"subx\t%%g0, %1, %0"
@@ -831,7 +941,7 @@
(define_insn "*neg_sltu_plus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
- (neg:SI (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (neg:SI (plus:SI (ltu:SI (reg:CC CC_REG) (const_int 0))
(match_operand:SI 1 "arith_operand" "rI"))))]
""
"subx\t%%g0, %1, %0"
@@ -839,14 +949,14 @@
(define_insn "*sgeu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
- (geu:SI (reg:CC 100) (const_int 0)))]
+ (geu:SI (reg:CC CC_REG) (const_int 0)))]
""
"subx\t%%g0, -1, %0"
[(set_attr "type" "ialuX")])
(define_insn "*neg_sgeu_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
- (neg:SI (geu:SI (reg:CC 100) (const_int 0))))]
+ (neg:SI (geu:SI (reg:CC CC_REG) (const_int 0))))]
""
"addx\t%%g0, -1, %0"
[(set_attr "type" "ialuX")])
@@ -857,7 +967,7 @@
(define_insn "*sltu_plus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
- (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (plus:SI (ltu:SI (reg:CC CC_REG) (const_int 0))
(match_operand:SI 1 "arith_operand" "rI")))]
""
"addx\t%%g0, %1, %0"
@@ -865,7 +975,7 @@
(define_insn "*sltu_plus_x_plus_y"
[(set (match_operand:SI 0 "register_operand" "=r")
- (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (plus:SI (ltu:SI (reg:CC CC_REG) (const_int 0))
(plus:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))))]
""
@@ -875,7 +985,7 @@
(define_insn "*x_minus_sltu"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "r")
- (ltu:SI (reg:CC 100) (const_int 0))))]
+ (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
"subx\t%1, 0, %0"
[(set_attr "type" "ialuX")])
@@ -885,7 +995,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC 100) (const_int 0))))]
+ (ltu:SI (reg:CC CC_REG) (const_int 0))))]
""
"subx\t%r1, %2, %0"
[(set_attr "type" "ialuX")])
@@ -893,7 +1003,7 @@
(define_insn "*x_minus_sltu_plus_y"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
- (plus:SI (ltu:SI (reg:CC 100) (const_int 0))
+ (plus:SI (ltu:SI (reg:CC CC_REG) (const_int 0))
(match_operand:SI 2 "arith_operand" "rI"))))]
""
"subx\t%r1, %2, %0"
@@ -901,7 +1011,7 @@
(define_insn "*sgeu_plus_x"
[(set (match_operand:SI 0 "register_operand" "=r")
- (plus:SI (geu:SI (reg:CC 100) (const_int 0))
+ (plus:SI (geu:SI (reg:CC CC_REG) (const_int 0))
(match_operand:SI 1 "register_operand" "r")))]
""
"subx\t%1, -1, %0"
@@ -910,7 +1020,7 @@
(define_insn "*x_minus_sgeu"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "r")
- (geu:SI (reg:CC 100) (const_int 0))))]
+ (geu:SI (reg:CC CC_REG) (const_int 0))))]
""
"addx\t%1, -1, %0"
[(set_attr "type" "ialuX")])
@@ -986,7 +1096,7 @@
(define_insn "*normal_branch"
[(set (pc)
(if_then_else (match_operator 0 "noov_compare_operator"
- [(reg 100) (const_int 0)])
+ [(reg CC_REG) (const_int 0)])
(label_ref (match_operand 1 "" ""))
(pc)))]
""
@@ -1002,7 +1112,7 @@
(define_insn "*inverted_branch"
[(set (pc)
(if_then_else (match_operator 0 "noov_compare_operator"
- [(reg 100) (const_int 0)])
+ [(reg CC_REG) (const_int 0)])
(pc)
(label_ref (match_operand 1 "" ""))))]
""
@@ -1131,7 +1241,7 @@
(unspec:P [(match_operand:P 1 "symbolic_operand" "")
(match_operand:P 2 "call_address_operand" "")
(match_operand:P 3 "const_int_operand" "")] UNSPEC_LOAD_PCREL_SYM))
- (clobber (reg:P 15))]
+ (clobber (reg:P O7_REG))]
"REGNO (operands[0]) == INTVAL (operands[3])"
{
if (flag_delayed_branch)
@@ -1209,10 +1319,10 @@
})
(define_insn "*movsi_insn"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,!f,!f,!m,d")
- (match_operand:SI 1 "input_operand" "rI,K,m,rJ,f,m,f,J"))]
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,!f,!f,!m,d,d")
+ (match_operand:SI 1 "input_operand" "rI,K,m,rJ,f,m,f,J,P"))]
"(register_operand (operands[0], SImode)
- || register_or_zero_operand (operands[1], SImode))"
+ || register_or_zero_or_all_ones_operand (operands[1], SImode))"
"@
mov\t%1, %0
sethi\t%%hi(%a1), %0
@@ -1221,8 +1331,9 @@
fmovs\t%1, %0
ld\t%1, %0
st\t%1, %0
- fzeros\t%0"
- [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga")])
+ fzeros\t%0
+ fones\t%0"
+ [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga,fga")])
(define_insn "*movsi_lo_sum"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -1411,11 +1522,11 @@
(set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*")])
(define_insn "*movdi_insn_sp64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,m,?e,?e,?W,b")
- (match_operand:DI 1 "input_operand" "rI,N,m,rJ,e,W,e,J"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,m,?e,?e,?W,b,b")
+ (match_operand:DI 1 "input_operand" "rI,N,m,rJ,e,W,e,J,P"))]
"TARGET_ARCH64
&& (register_operand (operands[0], DImode)
- || register_or_zero_operand (operands[1], DImode))"
+ || register_or_zero_or_all_ones_operand (operands[1], DImode))"
"@
mov\t%1, %0
sethi\t%%hi(%a1), %0
@@ -1424,9 +1535,10 @@
fmovd\t%1, %0
ldd\t%1, %0
std\t%1, %0
- fzero\t%0"
- [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga")
- (set_attr "fptype" "*,*,*,*,double,*,*,double")])
+ fzero\t%0
+ fone\t%0"
+ [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga,fga")
+ (set_attr "fptype" "*,*,*,*,double,*,*,double,double")])
(define_expand "movdi_pic_label_ref"
[(set (match_dup 3) (high:DI
@@ -1824,16 +1936,16 @@
})
(define_insn "*movsf_insn"
- [(set (match_operand:V32 0 "nonimmediate_operand" "=d,f,*r,*r,*r,f,*r,m,m")
- (match_operand:V32 1 "input_operand" "GY,f,*rRY,Q,S,m,m,f,*rGY"))]
+ [(set (match_operand:V32 0 "nonimmediate_operand" "=d,d,f,*r,*r,*r,f,*r,m,m")
+ (match_operand:V32 1 "input_operand" "GY,ZC,f,*rRY,Q,S,m,m,f,*rGY"))]
"TARGET_FPU
&& (register_operand (operands[0], <V32:MODE>mode)
- || register_or_zero_operand (operands[1], <V32:MODE>mode))"
+ || register_or_zero_or_all_ones_operand (operands[1], <V32:MODE>mode))"
{
if (GET_CODE (operands[1]) == CONST_DOUBLE
- && (which_alternative == 2
- || which_alternative == 3
- || which_alternative == 4))
+ && (which_alternative == 3
+ || which_alternative == 4
+ || which_alternative == 5))
{
REAL_VALUE_TYPE r;
long i;
@@ -1848,24 +1960,26 @@
case 0:
return "fzeros\t%0";
case 1:
- return "fmovs\t%1, %0";
+ return "fones\t%0";
case 2:
- return "mov\t%1, %0";
+ return "fmovs\t%1, %0";
case 3:
- return "sethi\t%%hi(%a1), %0";
+ return "mov\t%1, %0";
case 4:
- return "#";
+ return "sethi\t%%hi(%a1), %0";
case 5:
+ return "#";
case 6:
- return "ld\t%1, %0";
case 7:
+ return "ld\t%1, %0";
case 8:
+ case 9:
return "st\t%r1, %0";
default:
gcc_unreachable ();
}
}
- [(set_attr "type" "fga,fpmove,*,*,*,fpload,load,fpstore,store")])
+ [(set_attr "type" "fga,fga,fpmove,*,*,*,fpload,load,fpstore,store")])
;; Exactly the same as above, except that all `f' cases are deleted.
;; This is necessary to prevent reload from ever trying to use a `f' reg
@@ -1997,15 +2111,16 @@
;; We have available v9 double floats but not 64-bit integer registers.
(define_insn "*movdf_insn_sp32_v9"
- [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,T,W,U,T,f,*r,o")
- (match_operand:V64 1 "input_operand" "GY,e,W#F,GY,e,T,U,o#F,*roGYDF,*rGYf"))]
+ [(set (match_operand:V64 0 "nonimmediate_operand" "=b,b,e,e,T,W,U,T,f,*r,o")
+ (match_operand:V64 1 "input_operand" "GY,ZC,e,W#F,GY,e,T,U,o#F,*roGYDF,*rGYf"))]
"TARGET_FPU
&& TARGET_V9
&& ! TARGET_ARCH64
&& (register_operand (operands[0], <V64:MODE>mode)
- || register_or_zero_operand (operands[1], <V64:MODE>mode))"
+ || register_or_zero_or_all_ones_operand (operands[1], <V64:MODE>mode))"
"@
fzero\t%0
+ fone\t%0
fmovd\t%1, %0
ldd\t%1, %0
stx\t%r1, %0
@@ -2015,9 +2130,9 @@
#
#
#"
- [(set_attr "type" "fga,fpmove,load,store,store,load,store,*,*,*")
- (set_attr "length" "*,*,*,*,*,*,*,2,2,2")
- (set_attr "fptype" "double,double,*,*,*,*,*,*,*,*")])
+ [(set_attr "type" "fga,fga,fpmove,load,store,store,load,store,*,*,*")
+ (set_attr "length" "*,*,*,*,*,*,*,*,2,2,2")
+ (set_attr "fptype" "double,double,double,*,*,*,*,*,*,*,*")])
(define_insn "*movdf_insn_sp32_v9_no_fpu"
[(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,T,r,o")
@@ -2038,14 +2153,15 @@
;; We have available both v9 double floats and 64-bit integer registers.
(define_insn "*movdf_insn_sp64"
- [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,W,*r,*r,m,*r")
- (match_operand:V64 1 "input_operand" "GY,e,W#F,e,*rGY,m,*rGY,DF"))]
+ [(set (match_operand:V64 0 "nonimmediate_operand" "=b,b,e,e,W,*r,*r,m,*r")
+ (match_operand:V64 1 "input_operand" "GY,ZC,e,W#F,e,*rGY,m,*rGY,DF"))]
"TARGET_FPU
&& TARGET_ARCH64
&& (register_operand (operands[0], <V64:MODE>mode)
- || register_or_zero_operand (operands[1], <V64:MODE>mode))"
+ || register_or_zero_or_all_ones_operand (operands[1], <V64:MODE>mode))"
"@
fzero\t%0
+ fone\t%0
fmovd\t%1, %0
ldd\t%1, %0
std\t%1, %0
@@ -2053,9 +2169,9 @@
ldx\t%1, %0
stx\t%r1, %0
#"
- [(set_attr "type" "fga,fpmove,load,store,*,load,store,*")
- (set_attr "length" "*,*,*,*,*,*,*,2")
- (set_attr "fptype" "double,double,*,*,*,*,*,*")])
+ [(set_attr "type" "fga,fga,fpmove,load,store,*,load,store,*")
+ (set_attr "length" "*,*,*,*,*,*,*,*,2")
+ (set_attr "fptype" "double,double,double,*,*,*,*,*,*")])
(define_insn "*movdf_insn_sp64_no_fpu"
[(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m")
@@ -2913,7 +3029,7 @@
;; Simplify comparisons of extended values.
(define_insn "*cmp_zero_extendqisi2"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (zero_extend:SI (match_operand:QI 0 "register_operand" "r"))
(const_int 0)))]
""
@@ -2921,7 +3037,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_qi"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (match_operand:QI 0 "register_operand" "r")
(const_int 0)))]
""
@@ -2929,7 +3045,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extendqisi2_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (zero_extend:SI (match_operand:QI 1 "register_operand" "r"))
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
@@ -2939,7 +3055,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extendqisi2_andcc_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (and:SI (match_operand:SI 1 "register_operand" "r")
(const_int 255))
(const_int 0)))
@@ -2950,7 +3066,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extendqidi2"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (zero_extend:DI (match_operand:QI 0 "register_operand" "r"))
(const_int 0)))]
"TARGET_ARCH64"
@@ -2958,7 +3074,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_qi_sp64"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (match_operand:QI 0 "register_operand" "r")
(const_int 0)))]
"TARGET_ARCH64"
@@ -2966,7 +3082,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extendqidi2_set"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
@@ -2976,7 +3092,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extendqidi2_andcc_set"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (and:DI (match_operand:DI 1 "register_operand" "r")
(const_int 255))
(const_int 0)))
@@ -2989,7 +3105,7 @@
;; Similarly, handle {SI,DI}->QI mode truncation followed by a compare.
(define_insn "*cmp_siqi_trunc"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (subreg:QI (match_operand:SI 0 "register_operand" "r") 3)
(const_int 0)))]
""
@@ -2997,7 +3113,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_siqi_trunc_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (subreg:QI (match_operand:SI 1 "register_operand" "r") 3)
(const_int 0)))
(set (match_operand:QI 0 "register_operand" "=r")
@@ -3007,7 +3123,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_diqi_trunc"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (subreg:QI (match_operand:DI 0 "register_operand" "r") 7)
(const_int 0)))]
"TARGET_ARCH64"
@@ -3015,7 +3131,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_diqi_trunc_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (subreg:QI (match_operand:DI 1 "register_operand" "r") 7)
(const_int 0)))
(set (match_operand:QI 0 "register_operand" "=r")
@@ -3216,7 +3332,7 @@
;; because combine uses this as a canonical form.
(define_insn "*cmp_zero_extract"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(zero_extract:SI (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "small_int_operand" "I")
@@ -3233,7 +3349,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_zero_extract_sp64"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(zero_extract:DI (match_operand:DI 0 "register_operand" "r")
(match_operand:SI 1 "small_int_operand" "I")
@@ -3529,11 +3645,11 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (match_operand:DI 1 "arith_double_operand" "%r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
- [(parallel [(set (reg:CC_NOOV 100)
+ [(parallel [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (plus:SI (match_dup 4)
(match_dup 5))
(const_int 0)))
@@ -3542,7 +3658,7 @@
(set (match_dup 6)
(plus:SI (plus:SI (match_dup 7)
(match_dup 8))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
{
operands[3] = gen_lowpart (SImode, operands[0]);
operands[4] = gen_lowpart (SImode, operands[1]);
@@ -3568,7 +3684,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (plus:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
""
"addx\t%1, %2, %0"
[(set_attr "type" "ialuX")])
@@ -3578,12 +3694,12 @@
(zero_extend:DI (plus:SI (plus:SI
(match_operand:SI 1 "register_or_zero_operand" "%rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0)))))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
[(set (match_dup 3) (plus:SI (plus:SI (match_dup 1) (match_dup 2))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))
(set (match_dup 4) (const_int 0))]
"operands[3] = gen_lowpart (SImode, operands[0]);
operands[4] = gen_highpart_mode (SImode, DImode, operands[1]);"
@@ -3593,7 +3709,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0)))))]
"TARGET_ARCH64"
"addx\t%r1, %2, %0"
[(set_attr "type" "ialuX")])
@@ -3602,17 +3718,17 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
(match_operand:DI 2 "register_operand" "r")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
- [(parallel [(set (reg:CC_NOOV 100)
+ [(parallel [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (plus:SI (match_dup 3) (match_dup 1))
(const_int 0)))
(set (match_dup 5) (plus:SI (match_dup 3) (match_dup 1)))])
(set (match_dup 6)
(plus:SI (plus:SI (match_dup 4) (const_int 0))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
"operands[3] = gen_lowpart (SImode, operands[2]);
operands[4] = gen_highpart (SImode, operands[2]);
operands[5] = gen_lowpart (SImode, operands[0]);
@@ -3641,7 +3757,7 @@
(set_attr "fptype" "*,*,single")])
(define_insn "*cmp_cc_plus"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (plus:SI (match_operand:SI 0 "arith_operand" "%r")
(match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))]
@@ -3650,7 +3766,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_plus"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (plus:DI (match_operand:DI 0 "arith_operand" "%r")
(match_operand:DI 1 "arith_operand" "rI"))
(const_int 0)))]
@@ -3659,7 +3775,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_plus_set"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (plus:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -3670,7 +3786,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_plus_set"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (plus:DI (match_operand:DI 1 "arith_operand" "%r")
(match_operand:DI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -3702,11 +3818,11 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_double_operand" "rHI")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
- [(parallel [(set (reg:CC_NOOV 100)
+ [(parallel [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (minus:SI (match_dup 4)
(match_dup 5))
(const_int 0)))
@@ -3715,7 +3831,7 @@
(set (match_dup 6)
(minus:SI (minus:SI (match_dup 7)
(match_dup 8))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
{
operands[3] = gen_lowpart (SImode, operands[0]);
operands[4] = gen_lowpart (SImode, operands[1]);
@@ -3741,7 +3857,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
""
"subx\t%r1, %2, %0"
[(set_attr "type" "ialuX")])
@@ -3750,7 +3866,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0)))))]
"TARGET_ARCH64"
"subx\t%r1, %2, %0"
[(set_attr "type" "ialuX")])
@@ -3759,12 +3875,12 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0)))))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
[(set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 2))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))
(set (match_dup 4) (const_int 0))]
"operands[3] = gen_lowpart (SImode, operands[0]);
operands[4] = gen_highpart (SImode, operands[0]);"
@@ -3774,17 +3890,17 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (match_operand:DI 1 "register_operand" "r")
(zero_extend:DI (match_operand:SI 2 "register_operand" "r"))))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
- [(parallel [(set (reg:CC_NOOV 100)
+ [(parallel [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (minus:SI (match_dup 3) (match_dup 2))
(const_int 0)))
(set (match_dup 5) (minus:SI (match_dup 3) (match_dup 2)))])
(set (match_dup 6)
(minus:SI (minus:SI (match_dup 4) (const_int 0))
- (ltu:SI (reg:CC_NOOV 100) (const_int 0))))]
+ (ltu:SI (reg:CC_NOOV CC_REG) (const_int 0))))]
"operands[3] = gen_lowpart (SImode, operands[1]);
operands[4] = gen_highpart (SImode, operands[1]);
operands[5] = gen_lowpart (SImode, operands[0]);
@@ -3813,7 +3929,7 @@
(set_attr "fptype" "*,*,single")])
(define_insn "*cmp_minus_cc"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (minus:SI (match_operand:SI 0 "register_or_zero_operand" "rJ")
(match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))]
@@ -3822,7 +3938,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_minus_ccx"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (minus:DI (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 1 "arith_operand" "rI"))
(const_int 0)))]
@@ -3831,7 +3947,7 @@
[(set_attr "type" "compare")])
(define_insn "cmp_minus_cc_set"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -3842,7 +3958,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_minus_ccx_set"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:DI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -3926,7 +4042,7 @@
(set_attr "length" "9,8")])
(define_insn "*cmp_mul_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (mult:SI (match_operand:SI 1 "arith_operand" "%r")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -4410,7 +4526,7 @@
[(set_attr "type" "idiv")])
(define_insn "*cmp_sdiv_cc_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (div:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -4501,7 +4617,7 @@
[(set_attr "type" "idiv")])
(define_insn "*cmp_udiv_cc_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (udiv:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "rI"))
(const_int 0)))
@@ -4915,7 +5031,7 @@
;; want to set the condition code.
(define_insn "*cmp_cc_arith_op"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(match_operator:SI 2 "cc_arith_operator"
[(match_operand:SI 0 "arith_operand" "%r")
@@ -4926,7 +5042,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_arith_op"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(match_operator:DI 2 "cc_arith_operator"
[(match_operand:DI 0 "arith_operand" "%r")
@@ -4937,7 +5053,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_arith_op_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(match_operator:SI 3 "cc_arith_operator"
[(match_operand:SI 1 "arith_operand" "%r")
@@ -4950,7 +5066,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_arith_op_set"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(match_operator:DI 3 "cc_arith_operator"
[(match_operand:DI 1 "arith_operand" "%r")
@@ -4963,7 +5079,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_xor_not"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(not:SI (xor:SI (match_operand:SI 0 "register_or_zero_operand" "%rJ")
(match_operand:SI 1 "arith_operand" "rI")))
@@ -4973,7 +5089,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_xor_not"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(not:DI (xor:DI (match_operand:DI 0 "register_or_zero_operand" "%rJ")
(match_operand:DI 1 "arith_operand" "rI")))
@@ -4983,7 +5099,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_xor_not_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(not:SI (xor:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ")
(match_operand:SI 2 "arith_operand" "rI")))
@@ -4995,7 +5111,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_xor_not_set"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(not:DI (xor:DI (match_operand:DI 1 "register_or_zero_operand" "%rJ")
(match_operand:DI 2 "arith_operand" "rI")))
@@ -5007,7 +5123,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_arith_op_not"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(match_operator:SI 2 "cc_arith_not_operator"
[(not:SI (match_operand:SI 0 "arith_operand" "rI"))
@@ -5018,7 +5134,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_arith_op_not"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(match_operator:DI 2 "cc_arith_not_operator"
[(not:DI (match_operand:DI 0 "arith_operand" "rI"))
@@ -5029,7 +5145,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_arith_op_not_set"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC
(match_operator:SI 3 "cc_arith_not_operator"
[(not:SI (match_operand:SI 1 "arith_operand" "rI"))
@@ -5043,7 +5159,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_arith_op_not_set"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX
(match_operator:DI 3 "cc_arith_not_operator"
[(not:DI (match_operand:DI 1 "arith_operand" "rI"))
@@ -5081,16 +5197,16 @@
(define_insn_and_split "*negdi2_sp32"
[(set (match_operand:DI 0 "register_operand" "=r")
(neg:DI (match_operand:DI 1 "register_operand" "r")))
- (clobber (reg:CC 100))]
+ (clobber (reg:CC CC_REG))]
"! TARGET_ARCH64"
"#"
"&& reload_completed"
- [(parallel [(set (reg:CC_NOOV 100)
+ [(parallel [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (minus:SI (const_int 0) (match_dup 5))
(const_int 0)))
(set (match_dup 4) (minus:SI (const_int 0) (match_dup 5)))])
(set (match_dup 2) (minus:SI (minus:SI (const_int 0) (match_dup 3))
- (ltu:SI (reg:CC 100) (const_int 0))))]
+ (ltu:SI (reg:CC CC_REG) (const_int 0))))]
"operands[2] = gen_highpart (SImode, operands[0]);
operands[3] = gen_highpart (SImode, operands[1]);
operands[4] = gen_lowpart (SImode, operands[0]);
@@ -5110,7 +5226,7 @@
"sub\t%%g0, %1, %0")
(define_insn "*cmp_cc_neg"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (neg:SI (match_operand:SI 0 "arith_operand" "rI"))
(const_int 0)))]
""
@@ -5118,7 +5234,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_neg"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_operand" "rI"))
(const_int 0)))]
"TARGET_ARCH64"
@@ -5126,7 +5242,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_set_neg"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (neg:SI (match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
@@ -5136,7 +5252,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_set_neg"
- [(set (reg:CCX_NOOV 100)
+ [(set (reg:CCX_NOOV CC_REG)
(compare:CCX_NOOV (neg:DI (match_operand:DI 1 "arith_operand" "rI"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
@@ -5197,7 +5313,7 @@
(set_attr "fptype" "*,single")])
(define_insn "*cmp_cc_not"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (not:SI (match_operand:SI 0 "arith_operand" "rI"))
(const_int 0)))]
""
@@ -5205,7 +5321,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_not"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (not:DI (match_operand:DI 0 "arith_operand" "rI"))
(const_int 0)))]
"TARGET_ARCH64"
@@ -5213,7 +5329,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_set_not"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(compare:CC (not:SI (match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
@@ -5223,7 +5339,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_ccx_set_not"
- [(set (reg:CCX 100)
+ [(set (reg:CCX CC_REG)
(compare:CCX (not:DI (match_operand:DI 1 "arith_operand" "rI"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
@@ -5235,7 +5351,7 @@
(define_insn "*cmp_cc_set"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "register_operand" "r"))
- (set (reg:CC 100)
+ (set (reg:CC CC_REG)
(compare:CC (match_dup 1)
(const_int 0)))]
""
@@ -5245,7 +5361,7 @@
(define_insn "*cmp_ccx_set64"
[(set (match_operand:DI 0 "register_operand" "=r")
(match_operand:DI 1 "register_operand" "r"))
- (set (reg:CCX 100)
+ (set (reg:CCX CC_REG)
(compare:CCX (match_dup 1)
(const_int 0)))]
"TARGET_ARCH64"
@@ -5351,6 +5467,78 @@
"fmuls\t%1, %2, %0"
[(set_attr "type" "fpmul")])
+(define_insn "fmadf4"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (fma:DF (match_operand:DF 1 "register_operand" "e")
+ (match_operand:DF 2 "register_operand" "e")
+ (match_operand:DF 3 "register_operand" "e")))]
+ "TARGET_FMAF"
+ "fmaddd\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "fmsdf4"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (fma:DF (match_operand:DF 1 "register_operand" "e")
+ (match_operand:DF 2 "register_operand" "e")
+ (neg:DF (match_operand:DF 3 "register_operand" "e"))))]
+ "TARGET_FMAF"
+ "fmsubd\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "*nfmadf4"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (neg:DF (fma:DF (match_operand:DF 1 "register_operand" "e")
+ (match_operand:DF 2 "register_operand" "e")
+ (match_operand:DF 3 "register_operand" "e"))))]
+ "TARGET_FMAF"
+ "fnmaddd\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "*nfmsdf4"
+ [(set (match_operand:DF 0 "register_operand" "=e")
+ (neg:DF (fma:DF (match_operand:DF 1 "register_operand" "e")
+ (match_operand:DF 2 "register_operand" "e")
+ (neg:DF (match_operand:DF 3 "register_operand" "e")))))]
+ "TARGET_FMAF"
+ "fnmsubd\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "fmasf4"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (fma:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")
+ (match_operand:SF 3 "register_operand" "f")))]
+ "TARGET_FMAF"
+ "fmadds\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "fmssf4"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (fma:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")
+ (neg:SF (match_operand:SF 3 "register_operand" "f"))))]
+ "TARGET_FMAF"
+ "fmsubs\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "*nfmasf4"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (fma:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")
+ (match_operand:SF 3 "register_operand" "f"))))]
+ "TARGET_FMAF"
+ "fnmadds\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
+(define_insn "*nfmssf4"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (fma:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")
+ (neg:SF (match_operand:SF 3 "register_operand" "f")))))]
+ "TARGET_FMAF"
+ "fnmsubs\t%1, %2, %3, %0"
+ [(set_attr "type" "fpmul")])
+
(define_insn "*muldf3_extend"
[(set (match_operand:DF 0 "register_operand" "=e")
(mult:DF (float_extend:DF (match_operand:SF 1 "register_operand" "f"))
@@ -5688,7 +5876,7 @@
; (set_attr "length" "4")])
(define_insn "*cmp_cc_ashift_1"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (ashift:SI (match_operand:SI 0 "register_operand" "r")
(const_int 1))
(const_int 0)))]
@@ -5697,7 +5885,7 @@
[(set_attr "type" "compare")])
(define_insn "*cmp_cc_set_ashift_1"
- [(set (reg:CC_NOOV 100)
+ [(set (reg:CC_NOOV CC_REG)
(compare:CC_NOOV (ashift:SI (match_operand:SI 1 "register_operand" "r")
(const_int 1))
(const_int 0)))
@@ -6034,7 +6222,7 @@
(define_insn "*call_address_sp32"
[(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
(match_operand 1 "" ""))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64"
"call\t%a0, %1%#"
@@ -6043,7 +6231,7 @@
(define_insn "*call_symbolic_sp32"
[(call (mem:SI (match_operand:SI 0 "symbolic_operand" "s"))
(match_operand 1 "" ""))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64"
"call\t%a0, %1%#"
@@ -6052,7 +6240,7 @@
(define_insn "*call_address_sp64"
[(call (mem:DI (match_operand:DI 0 "address_operand" "p"))
(match_operand 1 "" ""))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
;;- Do not use operand 1 for most machines.
"TARGET_ARCH64"
"call\t%a0, %1%#"
@@ -6061,7 +6249,7 @@
(define_insn "*call_symbolic_sp64"
[(call (mem:DI (match_operand:DI 0 "symbolic_operand" "s"))
(match_operand 1 "" ""))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
;;- Do not use operand 1 for most machines.
"TARGET_ARCH64"
"call\t%a0, %1%#"
@@ -6073,7 +6261,7 @@
[(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
(match_operand 1 "" ""))
(match_operand 2 "immediate_operand" "")
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0"
{
@@ -6089,7 +6277,7 @@
[(call (mem:SI (match_operand:SI 0 "symbolic_operand" "s"))
(match_operand 1 "" ""))
(match_operand 2 "immediate_operand" "")
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0"
{
@@ -6105,7 +6293,7 @@
[(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
(match_operand 1 "" ""))
(match_operand 2 "immediate_operand" "")
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0"
"call\t%a0, %1\n\t nop\n\tnop"
@@ -6118,7 +6306,7 @@
[(call (mem:SI (match_operand:SI 0 "symbolic_operand" "s"))
(match_operand 1 "" ""))
(match_operand 2 "immediate_operand" "")
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 1 for most machines.
"! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0"
"call\t%a0, %1\n\t nop\n\tnop"
@@ -6156,7 +6344,7 @@
[(set (match_operand 0 "" "=rf")
(call (mem:SI (match_operand:SI 1 "address_operand" "p"))
(match_operand 2 "" "")))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 2 for most machines.
"! TARGET_ARCH64"
"call\t%a1, %2%#"
@@ -6166,7 +6354,7 @@
[(set (match_operand 0 "" "=rf")
(call (mem:SI (match_operand:SI 1 "symbolic_operand" "s"))
(match_operand 2 "" "")))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
;;- Do not use operand 2 for most machines.
"! TARGET_ARCH64"
"call\t%a1, %2%#"
@@ -6176,7 +6364,7 @@
[(set (match_operand 0 "" "")
(call (mem:DI (match_operand:DI 1 "address_operand" "p"))
(match_operand 2 "" "")))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
;;- Do not use operand 2 for most machines.
"TARGET_ARCH64"
"call\t%a1, %2%#"
@@ -6186,7 +6374,7 @@
[(set (match_operand 0 "" "")
(call (mem:DI (match_operand:DI 1 "symbolic_operand" "s"))
(match_operand 2 "" "")))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
;;- Do not use operand 2 for most machines.
"TARGET_ARCH64"
"call\t%a1, %2%#"
@@ -6765,7 +6953,7 @@
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "register_operand" ""))
- (set (reg:CC 100)
+ (set (reg:CC CC_REG)
(compare:CC (match_operand:SI 2 "register_operand" "")
(const_int 0)))]
"(rtx_equal_p (operands[2], operands[0])
@@ -6773,14 +6961,14 @@
&& ! SPARC_FP_REG_P (REGNO (operands[0]))
&& ! SPARC_FP_REG_P (REGNO (operands[1]))"
[(parallel [(set (match_dup 0) (match_dup 1))
- (set (reg:CC 100)
+ (set (reg:CC CC_REG)
(compare:CC (match_dup 1) (const_int 0)))])]
"")
(define_peephole2
[(set (match_operand:DI 0 "register_operand" "")
(match_operand:DI 1 "register_operand" ""))
- (set (reg:CCX 100)
+ (set (reg:CCX CC_REG)
(compare:CCX (match_operand:DI 2 "register_operand" "")
(const_int 0)))]
"TARGET_ARCH64
@@ -6789,7 +6977,7 @@
&& ! SPARC_FP_REG_P (REGNO (operands[0]))
&& ! SPARC_FP_REG_P (REGNO (operands[1]))"
[(parallel [(set (match_dup 0) (match_dup 1))
- (set (reg:CCX 100)
+ (set (reg:CCX CC_REG)
(compare:CCX (match_dup 1) (const_int 0)))])]
"")
@@ -6896,7 +7084,7 @@
(define_insn ""
- [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CC 100) (const_int 0)])
+ [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CC CC_REG) (const_int 0)])
(match_operand:SI 1 "arith_operand" "rM"))]
""
{
@@ -6908,7 +7096,7 @@
[(set_attr "type" "trap")])
(define_insn ""
- [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CCX 100) (const_int 0)])
+ [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CCX CC_REG) (const_int 0)])
(match_operand:SI 1 "arith_operand" "rM"))]
"TARGET_V9"
"t%C0\t%%xcc, %1"
@@ -6956,7 +7144,7 @@
(match_operand 2 "tgd_symbolic_operand" "")]
UNSPEC_TLSGD))
(match_operand 3 "" "")))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
"TARGET_TLS && TARGET_ARCH32"
"call\t%a1, %%tgd_call(%a2)%#"
[(set_attr "type" "call")])
@@ -6967,7 +7155,7 @@
(match_operand 2 "tgd_symbolic_operand" "")]
UNSPEC_TLSGD))
(match_operand 3 "" "")))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
"TARGET_TLS && TARGET_ARCH64"
"call\t%a1, %%tgd_call(%a2)%#"
[(set_attr "type" "call")])
@@ -7006,7 +7194,7 @@
(call (mem:SI (unspec:SI [(match_operand:SI 1 "symbolic_operand" "s")]
UNSPEC_TLSLDM))
(match_operand 2 "" "")))
- (clobber (reg:SI 15))]
+ (clobber (reg:SI O7_REG))]
"TARGET_TLS && TARGET_ARCH32"
"call\t%a1, %%tldm_call(%&)%#"
[(set_attr "type" "call")])
@@ -7016,7 +7204,7 @@
(call (mem:DI (unspec:DI [(match_operand:DI 1 "symbolic_operand" "s")]
UNSPEC_TLSLDM))
(match_operand 2 "" "")))
- (clobber (reg:DI 15))]
+ (clobber (reg:DI O7_REG))]
"TARGET_TLS && TARGET_ARCH64"
"call\t%a1, %%tldm_call(%&)%#"
[(set_attr "type" "call")])
@@ -7547,7 +7735,7 @@
})
(define_insn "stack_protect_testsi"
- [(set (reg:CC 100)
+ [(set (reg:CC CC_REG)
(unspec:CC [(match_operand:SI 0 "memory_operand" "m")
(match_operand:SI 1 "memory_operand" "m")]
UNSPEC_SP_TEST))
@@ -7658,7 +7846,8 @@
(define_insn "fpack16_vis"
[(set (match_operand:V4QI 0 "register_operand" "=f")
(unspec:V4QI [(match_operand:V4HI 1 "register_operand" "e")]
- UNSPEC_FPACK16))]
+ UNSPEC_FPACK16))
+ (use (reg:DI GSR_REG))]
"TARGET_VIS"
"fpack16\t%1, %0"
[(set_attr "type" "fga")
@@ -7667,7 +7856,8 @@
(define_insn "fpackfix_vis"
[(set (match_operand:V2HI 0 "register_operand" "=f")
(unspec:V2HI [(match_operand:V2SI 1 "register_operand" "e")]
- UNSPEC_FPACKFIX))]
+ UNSPEC_FPACKFIX))
+ (use (reg:DI GSR_REG))]
"TARGET_VIS"
"fpackfix\t%1, %0"
[(set_attr "type" "fga")
@@ -7677,7 +7867,8 @@
[(set (match_operand:V8QI 0 "register_operand" "=e")
(unspec:V8QI [(match_operand:V2SI 1 "register_operand" "e")
(match_operand:V8QI 2 "register_operand" "e")]
- UNSPEC_FPACK32))]
+ UNSPEC_FPACK32))
+ (use (reg:DI GSR_REG))]
"TARGET_VIS"
"fpack32\t%1, %2, %0"
[(set_attr "type" "fga")
@@ -7777,6 +7968,63 @@
[(set_attr "type" "fpmul")
(set_attr "fptype" "double")])
+(define_expand "wrgsr_vis"
+ [(set (reg:DI GSR_REG) (match_operand:DI 0 "arith_operand" ""))]
+ "TARGET_VIS"
+{
+ if (! TARGET_ARCH64)
+ {
+ emit_insn (gen_wrgsr_v8plus (operands[0]));
+ DONE;
+ }
+})
+
+(define_insn "*wrgsr_sp64"
+ [(set (reg:DI GSR_REG) (match_operand:DI 0 "arith_operand" "rI"))]
+ "TARGET_VIS && TARGET_ARCH64"
+ "wr\t%%g0, %0, %%gsr"
+ [(set_attr "type" "gsr")])
+
+(define_insn "wrgsr_v8plus"
+ [(set (reg:DI GSR_REG) (match_operand:DI 0 "arith_operand" "I,r"))
+ (clobber (match_scratch:SI 1 "=X,&h"))]
+ "TARGET_VIS && ! TARGET_ARCH64"
+{
+ if (GET_CODE (operands[0]) == CONST_INT
+ || sparc_check_64 (operands[0], insn))
+ return "wr\t%%g0, %0, %%gsr";
+
+ output_asm_insn("srl\t%L0, 0, %L0", operands);
+ return "sllx\t%H0, 32, %1\n\tor\t%L0, %1, %1\n\twr\t%%g0, %1, %%gsr";
+}
+ [(set_attr "type" "multi")])
+
+(define_expand "rdgsr_vis"
+ [(set (match_operand:DI 0 "register_operand" "") (reg:DI GSR_REG))]
+ "TARGET_VIS"
+{
+ if (! TARGET_ARCH64)
+ {
+ emit_insn (gen_rdgsr_v8plus (operands[0]));
+ DONE;
+ }
+})
+
+(define_insn "*rdgsr_sp64"
+ [(set (match_operand:DI 0 "register_operand" "=r") (reg:DI GSR_REG))]
+ "TARGET_VIS && TARGET_ARCH64"
+ "rd\t%%gsr, %0"
+ [(set_attr "type" "gsr")])
+
+(define_insn "rdgsr_v8plus"
+ [(set (match_operand:DI 0 "register_operand" "=r") (reg:DI GSR_REG))
+ (clobber (match_scratch:SI 1 "=&h"))]
+ "TARGET_VIS && ! TARGET_ARCH64"
+{
+ return "rd\t%%gsr, %1\n\tsrlx\t%1, 32, %H0\n\tmov %1, %L0";
+}
+ [(set_attr "type" "multi")])
+
;; Using faligndata only makes sense after an alignaddr since the choice of
;; bytes to take out of each operand is dependent on the results of the last
;; alignaddr.
@@ -7784,20 +8032,60 @@
[(set (match_operand:V64I 0 "register_operand" "=e")
(unspec:V64I [(match_operand:V64I 1 "register_operand" "e")
(match_operand:V64I 2 "register_operand" "e")]
- UNSPEC_ALIGNDATA))]
+ UNSPEC_ALIGNDATA))
+ (use (reg:SI GSR_REG))]
"TARGET_VIS"
"faligndata\t%1, %2, %0"
[(set_attr "type" "fga")
(set_attr "fptype" "double")])
-(define_insn "alignaddr<P:mode>_vis"
- [(set (match_operand:P 0 "register_operand" "=r")
- (unspec:P [(match_operand:P 1 "register_or_zero_operand" "rJ")
- (match_operand:P 2 "register_or_zero_operand" "rJ")]
- UNSPEC_ALIGNADDR))]
+(define_insn "alignaddrsi_vis"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
+ (match_operand:SI 2 "register_or_zero_operand" "rJ")))
+ (set (reg:SI GSR_REG)
+ (ior:SI (and:SI (reg:SI GSR_REG) (const_int -8))
+ (and:SI (plus:SI (match_dup 1) (match_dup 2))
+ (const_int 7))))]
"TARGET_VIS"
"alignaddr\t%r1, %r2, %0")
+(define_insn "alignaddrdi_vis"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_or_zero_operand" "rJ")
+ (match_operand:DI 2 "register_or_zero_operand" "rJ")))
+ (set (reg:SI GSR_REG)
+ (ior:SI (and:SI (reg:SI GSR_REG) (const_int -8))
+ (and:SI (truncate:SI (plus:DI (match_dup 1) (match_dup 2)))
+ (const_int 7))))]
+ "TARGET_VIS"
+ "alignaddr\t%r1, %r2, %0")
+
+(define_insn "alignaddrlsi_vis"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ")
+ (match_operand:SI 2 "register_or_zero_operand" "rJ")))
+ (set (reg:SI GSR_REG)
+ (ior:SI (and:SI (reg:SI GSR_REG) (const_int -8))
+ (xor:SI (and:SI (plus:SI (match_dup 1) (match_dup 2))
+ (const_int 7))
+ (const_int 7))))]
+ "TARGET_VIS"
+ "alignaddrl\t%r1, %r2, %0")
+
+(define_insn "alignaddrldi_vis"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (plus:DI (match_operand:DI 1 "register_or_zero_operand" "rJ")
+ (match_operand:DI 2 "register_or_zero_operand" "rJ")))
+ (set (reg:SI GSR_REG)
+ (ior:SI (and:SI (reg:SI GSR_REG) (const_int -8))
+ (xor:SI (and:SI (truncate:SI (plus:DI (match_dup 1)
+ (match_dup 2)))
+ (const_int 7))
+ (const_int 7))))]
+ "TARGET_VIS"
+ "alignaddrl\t%r1, %r2, %0")
+
(define_insn "pdist_vis"
[(set (match_operand:DI 0 "register_operand" "=e")
(unspec:DI [(match_operand:V8QI 1 "register_operand" "e")
@@ -7811,70 +8099,288 @@
;; Edge instructions produce condition codes equivalent to a 'subcc'
;; with the same operands.
-(define_insn "edge8_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE8))]
+(define_insn "edge8<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE8))]
"TARGET_VIS"
"edge8\t%r1, %r2, %0"
[(set_attr "type" "edge")])
-(define_insn "edge8l_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE8L))]
+(define_insn "edge8l<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE8L))]
"TARGET_VIS"
"edge8l\t%r1, %r2, %0"
[(set_attr "type" "edge")])
-(define_insn "edge16_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE16))]
+(define_insn "edge16<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE16))]
"TARGET_VIS"
"edge16\t%r1, %r2, %0"
[(set_attr "type" "edge")])
-(define_insn "edge16l_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE16L))]
+(define_insn "edge16l<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE16L))]
"TARGET_VIS"
"edge16l\t%r1, %r2, %0"
[(set_attr "type" "edge")])
-(define_insn "edge32_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE32))]
+(define_insn "edge32<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE32))]
"TARGET_VIS"
"edge32\t%r1, %r2, %0"
[(set_attr "type" "edge")])
-(define_insn "edge32l_vis"
- [(set (reg:CCX_NOOV 100)
- (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "rJ")
- (match_operand:DI 2 "register_operand" "rJ"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_dup 1) (match_dup 2)] UNSPEC_EDGE32L))]
+(define_insn "edge32l<P:mode>_vis"
+ [(set (reg:CC_NOOV CC_REG)
+ (compare:CC_NOOV (minus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ"))
+ (const_int 0)))
+ (set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_EDGE32L))]
"TARGET_VIS"
"edge32l\t%r1, %r2, %0"
[(set_attr "type" "edge")])
+(define_code_iterator gcond [le ne gt eq])
+(define_mode_iterator GCM [V4HI V2SI])
+(define_mode_attr gcm_name [(V4HI "16") (V2SI "32")])
+
+(define_insn "fcmp<code><GCM:gcm_name><P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(gcond:GCM (match_operand:GCM 1 "register_operand" "e")
+ (match_operand:GCM 2 "register_operand" "e"))]
+ UNSPEC_FCMP))]
+ "TARGET_VIS"
+ "fcmp<code><GCM:gcm_name>\t%1, %2, %0"
+ [(set_attr "type" "fpmul")
+ (set_attr "fptype" "double")])
+
+(define_insn "array8<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_ARRAY8))]
+ "TARGET_VIS"
+ "array8\t%r1, %r2, %0"
+ [(set_attr "type" "array")])
+
+(define_insn "array16<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_ARRAY16))]
+ "TARGET_VIS"
+ "array16\t%r1, %r2, %0"
+ [(set_attr "type" "array")])
+
+(define_insn "array32<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_ARRAY32))]
+ "TARGET_VIS"
+ "array32\t%r1, %r2, %0"
+ [(set_attr "type" "array")])
+
+(define_insn "bmask<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (plus:P (match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")))
+ (clobber (reg:SI GSR_REG))]
+ "TARGET_VIS2"
+ "bmask\t%r1, %r2, %0"
+ [(set_attr "type" "array")])
+
+(define_insn "bshuffle<V64I:mode>_vis"
+ [(set (match_operand:V64I 0 "register_operand" "=e")
+ (unspec:V64I [(match_operand:V64I 1 "register_operand" "e")
+ (match_operand:V64I 2 "register_operand" "e")]
+ UNSPEC_BSHUFFLE))
+ (use (reg:SI GSR_REG))]
+ "TARGET_VIS2"
+ "bshuffle\t%1, %2, %0"
+ [(set_attr "type" "fga")
+ (set_attr "fptype" "double")])
+
+;; VIS 2.0 adds edge variants which do not set the condition codes
+(define_insn "edge8n<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE8N))]
+ "TARGET_VIS2"
+ "edge8n\t%r1, %r2, %0"
+ [(set_attr "type" "edgen")])
+
+(define_insn "edge8ln<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE8LN))]
+ "TARGET_VIS2"
+ "edge8ln\t%r1, %r2, %0"
+ [(set_attr "type" "edgen")])
+
+(define_insn "edge16n<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE16N))]
+ "TARGET_VIS2"
+ "edge16n\t%r1, %r2, %0"
+ [(set_attr "type" "edgen")])
+
+(define_insn "edge16ln<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE16LN))]
+ "TARGET_VIS2"
+ "edge16ln\t%r1, %r2, %0"
+ [(set_attr "type" "edgen")])
+
+(define_insn "edge32n<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE32N))]
+ "TARGET_VIS2"
+ "edge32n\t%r1, %r2, %0"
+ [(set_attr "type" "edgen")])
+
+(define_insn "edge32ln<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:P 1 "register_operand" "rJ")
+ (match_operand:P 2 "register_operand" "rJ")]
+ UNSPEC_EDGE32LN))]
+ "TARGET_VIS2"
+ "edge32ln\t%r1, %r2, %0"
+ [(set_attr "type" "edge")])
+
+;; Conditional moves are possible via fcmpX --> cmaskX -> bshuffle
+(define_insn "cmask8<P:mode>_vis"
+ [(set (reg:DI GSR_REG)
+ (unspec:DI [(match_operand:P 0 "register_operand" "r")
+ (reg:DI GSR_REG)]
+ UNSPEC_CMASK8))]
+ "TARGET_VIS3"
+ "cmask8\t%r0")
+
+(define_insn "cmask16<P:mode>_vis"
+ [(set (reg:DI GSR_REG)
+ (unspec:DI [(match_operand:P 0 "register_operand" "r")
+ (reg:DI GSR_REG)]
+ UNSPEC_CMASK16))]
+ "TARGET_VIS3"
+ "cmask16\t%r0")
+
+(define_insn "cmask32<P:mode>_vis"
+ [(set (reg:DI GSR_REG)
+ (unspec:DI [(match_operand:P 0 "register_operand" "r")
+ (reg:DI GSR_REG)]
+ UNSPEC_CMASK32))]
+ "TARGET_VIS3"
+ "cmask32\t%r0")
+
+(define_insn "fchksm16_vis"
+ [(set (match_operand:V4HI 0 "register_operand" "=e")
+ (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "e")
+ (match_operand:V4HI 2 "register_operand" "e")]
+ UNSPEC_FCHKSM16))]
+ "TARGET_VIS3"
+ "fchksm16\t%1, %2, %0")
+
+(define_code_iterator vis3_shift [ashift ss_ashift lshiftrt ashiftrt])
+(define_code_attr vis3_shift_insn
+ [(ashift "fsll") (ss_ashift "fslas") (lshiftrt "fsrl") (ashiftrt "fsra")])
+
+(define_insn "<vis3_shift_insn><vbits>_vis"
+ [(set (match_operand:V64N8 0 "register_operand" "=<vconstr>")
+ (vis3_shift:V64N8 (match_operand:V64N8 1 "register_operand" "<vconstr>")
+ (match_operand:V64N8 2 "register_operand" "<vconstr>")))]
+ "TARGET_VIS3"
+ "<vis3_shift_insn><vbits>\t%1, %2, %0")
+
+(define_insn "pdistn<mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(match_operand:V8QI 1 "register_operand" "e")
+ (match_operand:V8QI 2 "register_operand" "e")]
+ UNSPEC_PDISTN))]
+ "TARGET_VIS3"
+ "pdistn\t%1, %2, %0")
+
+(define_insn "fmean16_vis"
+ [(set (match_operand:V4HI 0 "register_operand" "=e")
+ (truncate:V4HI
+ (lshiftrt:V4SI
+ (plus:V4SI
+ (plus:V4SI
+ (zero_extend:V4SI
+ (match_operand:V4HI 1 "register_operand" "e"))
+ (zero_extend:V4SI
+ (match_operand:V4HI 2 "register_operand" "e")))
+ (const_vector:V4SI [(const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)]))
+ (const_int 1))))]
+ "TARGET_VIS3"
+ "fmean16\t%1, %2, %0")
+
+(define_insn "fpadd64_vis"
+ [(set (match_operand:DI 0 "register_operand" "=e")
+ (plus:DI (match_operand:DI 1 "register_operand" "e")
+ (match_operand:DI 2 "register_operand" "e")))]
+ "TARGET_VIS3"
+ "fpadd64\t%1, %2, %0")
+
+(define_insn "fpsub64_vis"
+ [(set (match_operand:DI 0 "register_operand" "=e")
+ (minus:DI (match_operand:DI 1 "register_operand" "e")
+ (match_operand:DI 2 "register_operand" "e")))]
+ "TARGET_VIS3"
+ "fpsub64\t%1, %2, %0")
+
+(define_mode_iterator VASS [V4HI V2SI V2HI SI])
+(define_code_iterator vis3_addsub_ss [ss_plus ss_minus])
+(define_code_attr vis3_addsub_ss_insn
+ [(ss_plus "fpadds") (ss_minus "fpsubs")])
+
+(define_insn "<vis3_addsub_ss_insn><vbits>_vis"
+ [(set (match_operand:VASS 0 "register_operand" "=<vconstr>")
+ (vis3_addsub_ss:VASS (match_operand:VASS 1 "register_operand" "<vconstr>")
+ (match_operand:VASS 2 "register_operand" "<vconstr>")))]
+ "TARGET_VIS3"
+ "<vis3_addsub_ss_insn><vbits>\t%1, %2, %0")
+
+(define_insn "fucmp<code>8<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+ (unspec:P [(gcond:V8QI (match_operand:V8QI 1 "register_operand" "e")
+ (match_operand:V8QI 2 "register_operand" "e"))]
+ UNSPEC_FUCMP))]
+ "TARGET_VIS3"
+ "fucmp<code>8\t%1, %2, %0")
+
(include "sync.md")
diff --git a/gcc/config/sparc/sparc.opt b/gcc/config/sparc/sparc.opt
index ce6fa94fde8..613ae731c8e 100644
--- a/gcc/config/sparc/sparc.opt
+++ b/gcc/config/sparc/sparc.opt
@@ -59,7 +59,19 @@ Compile for V8+ ABI
mvis
Target Report Mask(VIS)
-Use UltraSPARC Visual Instruction Set extensions
+Use UltraSPARC Visual Instruction Set version 1.0 extensions
+
+mvis2
+Target Report Mask(VIS2)
+Use UltraSPARC Visual Instruction Set version 2.0 extensions
+
+mvis3
+Target Report Mask(VIS3)
+Use UltraSPARC Visual Instruction Set version 3.0 extensions
+
+mfmaf
+Target Report Mask(FMAF)
+Use UltraSPARC Fused Multiply-Add extensions
mptr64
Target Report RejectNegative Mask(PTR64)
diff --git a/gcc/config/sparc/t-sparc b/gcc/config/sparc/t-sparc
new file mode 100644
index 00000000000..ea9d0e824e2
--- /dev/null
+++ b/gcc/config/sparc/t-sparc
@@ -0,0 +1,36 @@
+# General rules that all sparc/ targets must have.
+#
+# Copyright (C) 2011 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 3, 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 COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+sparc.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h \
+ insn-codes.h conditions.h output.h $(INSN_ATTR_H) $(FLAGS_H) \
+ $(FUNCTION_H) $(EXCEPT_H) $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
+ $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TM_P_H) debug.h $(TARGET_H) \
+ $(TARGET_DEF_H) $(COMMON_TARGET_H) $(CFGLAYOUT_H) $(GIMPLE_H) \
+ langhooks.h reload.h $(PARAMS_H) $(DF_H) dwarf2out.h $(OPTS_H) \
+ gt-sparc.h
+
+sparc-c.o: $(srcdir)/config/sparc/sparc-c.c \
+ $(srcdir)/config/sparc/sparc-protos.h \
+ $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) $(FLAGS_H) \
+ $(TM_P_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(C_COMMON_H) $(C_PRAGMA_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/config/sparc/sparc-c.c
diff --git a/gcc/config/sparc/ultra1_2.md b/gcc/config/sparc/ultra1_2.md
index a24cb81aef2..9cdebab620b 100644
--- a/gcc/config/sparc/ultra1_2.md
+++ b/gcc/config/sparc/ultra1_2.md
@@ -79,7 +79,7 @@
(define_insn_reservation "us1_single" 1
(and (eq_attr "cpu" "ultrasparc")
- (eq_attr "type" "multi,savew,flushw,iflush,trap"))
+ (eq_attr "type" "multi,savew,flushw,iflush,trap,gsr"))
"us1_single_issue")
(define_insn_reservation "us1_simple_ieuN" 1
@@ -94,7 +94,7 @@
(define_insn_reservation "us1_simple_ieu1" 1
(and (eq_attr "cpu" "ultrasparc")
- (eq_attr "type" "compare,edge"))
+ (eq_attr "type" "compare,edge,edgen,array"))
"us1_ieu1 + us1_slot012")
(define_insn_reservation "us1_ialuX" 1
diff --git a/gcc/config/sparc/ultra3.md b/gcc/config/sparc/ultra3.md
index d438812683f..c891e356205 100644
--- a/gcc/config/sparc/ultra3.md
+++ b/gcc/config/sparc/ultra3.md
@@ -36,7 +36,7 @@
(define_insn_reservation "us3_single" 1
(and (eq_attr "cpu" "ultrasparc3")
- (eq_attr "type" "multi,savew,flushw,iflush,trap,edge"))
+ (eq_attr "type" "multi,savew,flushw,iflush,trap,edge,gsr"))
"us3_single_issue")
(define_insn_reservation "us3_integer" 1
@@ -54,6 +54,11 @@
(eq_attr "type" "cmove"))
"us3_ms + us3_br + us3_slotany, nothing")
+(define_insn_reservation "us3_array" 2
+ (and (eq_attr "cpu" "ultrasparc3")
+ (eq_attr "type" "array,edgen"))
+ "us3_ms + us3_slotany, nothing")
+
;; ??? Not entirely accurate.
;; ??? It can run from 6 to 9 cycles. The first cycle the MS pipe
;; ??? is needed, and the instruction group is broken right after
diff --git a/gcc/config/sparc/visintrin.h b/gcc/config/sparc/visintrin.h
index 25d7bab9b1e..32e44e55810 100644
--- a/gcc/config/sparc/visintrin.h
+++ b/gcc/config/sparc/visintrin.h
@@ -25,12 +25,27 @@
#define _VISINTRIN_H_INCLUDED
typedef int __v2si __attribute__ ((__vector_size__ (8)));
+typedef int __v1si __attribute__ ((__vector_size__ (4)));
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
typedef short __v2hi __attribute__ ((__vector_size__ (4)));
typedef unsigned char __v8qi __attribute__ ((__vector_size__ (8)));
typedef unsigned char __v4qi __attribute__ ((__vector_size__ (4)));
typedef int __i64 __attribute__ ((__mode__ (DI)));
+extern __inline void
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_write_gsr (__i64 __A)
+{
+ __builtin_vis_write_gsr (__A);
+}
+
+extern __inline __i64
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_read_gsr (void)
+{
+ return __builtin_vis_read_gsr ();
+}
+
extern __inline void *
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
__vis_alignaddr (void *__A, long __B)
@@ -38,6 +53,13 @@ __vis_alignaddr (void *__A, long __B)
return __builtin_vis_alignaddr (__A, __B);
}
+extern __inline void *
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_alignaddrl (void *__A, long __B)
+{
+ return __builtin_vis_alignaddrl (__A, __B);
+}
+
extern __inline __i64
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
__vis_faligndatadi (__i64 __A, __i64 __B)
@@ -157,46 +179,452 @@ __vis_pdist (__v8qi __A, __v8qi __B, __i64 __C)
return __builtin_vis_pdist (__A, __B, __C);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge8 (__i64 __A, __i64 __B)
+__vis_edge8 (void *__A, void *__B)
{
return __builtin_vis_edge8 (__A, __B);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge8l (__i64 __A, __i64 __B)
+__vis_edge8l (void *__A, void *__B)
{
return __builtin_vis_edge8l (__A, __B);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge16 (__i64 __A, __i64 __B)
+__vis_edge16 (void *__A, void *__B)
{
return __builtin_vis_edge16 (__A, __B);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge16l (__i64 __A, __i64 __B)
+__vis_edge16l (void *__A, void *__B)
{
return __builtin_vis_edge16l (__A, __B);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge32 (__i64 __A, __i64 __B)
+__vis_edge32 (void *__A, void *__B)
{
return __builtin_vis_edge32 (__A, __B);
}
-extern __inline __i64
+extern __inline long
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-__vis_edge32l (__i64 __A, __i64 __B)
+__vis_edge32l (void *__A, void *__B)
{
return __builtin_vis_edge32l (__A, __B);
}
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmple16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fcmple16 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmple32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fcmple32 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpne16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fcmpne16 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpne32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fcmpne32 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpgt16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fcmpgt16 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpgt32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fcmpgt32 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpeq16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fcmpeq16 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fcmpeq32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fcmpeq32 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadd16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fpadd16 (__A, __B);
+}
+
+extern __inline __v2hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadd16s (__v2hi __A, __v2hi __B)
+{
+ return __builtin_vis_fpadd16s (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadd32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fpadd32 (__A, __B);
+}
+
+extern __inline __v1si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadd32s (__v1si __A, __v1si __B)
+{
+ return __builtin_vis_fpadd32s (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsub16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fpsub16 (__A, __B);
+}
+
+extern __inline __v2hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsub16s (__v2hi __A, __v2hi __B)
+{
+ return __builtin_vis_fpsub16s (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsub32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fpsub32 (__A, __B);
+}
+
+extern __inline __v1si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsub32s (__v1si __A, __v1si __B)
+{
+ return __builtin_vis_fpsub32s (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_array8 (long __A, long __B)
+{
+ return __builtin_vis_array8 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_array16 (long __A, long __B)
+{
+ return __builtin_vis_array16 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_array32 (long __A, long __B)
+{
+ return __builtin_vis_array32 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_bmask (long __A, long __B)
+{
+ return __builtin_vis_bmask (__A, __B);
+}
+
+extern __inline __i64
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_bshuffledi (__i64 __A, __i64 __B)
+{
+ return __builtin_vis_bshuffledi (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_bshufflev2si (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_bshufflev2si (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_bshufflev4hi (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_bshufflev4hi (__A, __B);
+}
+
+extern __inline __v8qi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_bshufflev8qi (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_bshufflev8qi (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge8n (void *__A, void *__B)
+{
+ return __builtin_vis_edge8n (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge8ln (void *__A, void *__B)
+{
+ return __builtin_vis_edge8ln (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge16n (void *__A, void *__B)
+{
+ return __builtin_vis_edge16n (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge16ln (void *__A, void *__B)
+{
+ return __builtin_vis_edge16ln (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge32n (void *__A, void *__B)
+{
+ return __builtin_vis_edge32n (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_edge32ln (void *__A, void *__B)
+{
+ return __builtin_vis_edge32ln (__A, __B);
+}
+
+extern __inline void
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_cmask8 (long __A)
+{
+ return __builtin_vis_cmask8 (__A);
+}
+
+extern __inline void
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_cmask16 (long __A)
+{
+ return __builtin_vis_cmask16 (__A);
+}
+
+extern __inline void
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_cmask32 (long __A)
+{
+ return __builtin_vis_cmask32 (__A);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fchksm16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fchksm16 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsll16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fsll16 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fslas16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fslas16 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsrl16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fsrl16 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsra16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fsra16 (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsll32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fsll32 (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fslas32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fslas32 (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsrl32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fsrl32 (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fsra32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fsra32 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_pdistn (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_pdistn (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fmean16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fmean16 (__A, __B);
+}
+
+extern __inline __i64
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadd64 (__i64 __A, __i64 __B)
+{
+ return __builtin_vis_fpadd64 (__A, __B);
+}
+
+extern __inline __i64
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsub64 (__i64 __A, __i64 __B)
+{
+ return __builtin_vis_fpsub64 (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadds16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fpadds16 (__A, __B);
+}
+
+extern __inline __v2hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadds16s (__v2hi __A, __v2hi __B)
+{
+ return __builtin_vis_fpadds16s (__A, __B);
+}
+
+extern __inline __v4hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsubs16 (__v4hi __A, __v4hi __B)
+{
+ return __builtin_vis_fpsubs16 (__A, __B);
+}
+
+extern __inline __v2hi
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsubs16s (__v2hi __A, __v2hi __B)
+{
+ return __builtin_vis_fpsubs16s (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadds32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fpadds32 (__A, __B);
+}
+
+extern __inline __v1si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpadds32s (__v1si __A, __v1si __B)
+{
+ return __builtin_vis_fpadds32s (__A, __B);
+}
+
+extern __inline __v2si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsubs32 (__v2si __A, __v2si __B)
+{
+ return __builtin_vis_fpsubs32 (__A, __B);
+}
+
+extern __inline __v1si
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fpsubs32s (__v1si __A, __v1si __B)
+{
+ return __builtin_vis_fpsubs32s (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fucmple8 (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_fucmple8 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fucmpne8 (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_fucmpne8 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fucmpgt8 (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_fucmpgt8 (__A, __B);
+}
+
+extern __inline long
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+__vis_fucmpeq8 (__v8qi __A, __v8qi __B)
+{
+ return __builtin_vis_fucmpeq8 (__A, __B);
+}
+
#endif /* _VISINTRIN_H_INCLUDED */
diff --git a/gcc/configure b/gcc/configure
index 60722671837..dbae03e7e8a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -24124,6 +24124,42 @@ if test $gcc_cv_as_sparc_offsetable_lo10 = yes; then
$as_echo "#define HAVE_AS_OFFSETABLE_LO10 1" >>confdefs.h
fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for FMAF, HPC, and VIS 3.0 instructions" >&5
+$as_echo_n "checking assembler for FMAF, HPC, and VIS 3.0 instructions... " >&6; }
+if test "${gcc_cv_as_sparc_fmaf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_sparc_fmaf=no
+ if test x$gcc_cv_as != x; then
+ $as_echo '.text
+ .align 4
+ fmaddd %f0, %f2, %f4, %f6
+ addxccc %g1, %g2, %g3
+ fsrl32 %f2, %f4, %f8
+ fnaddd %f10, %f12, %f14' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -xarch=v9d -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_sparc_fmaf=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sparc_fmaf" >&5
+$as_echo "$gcc_cv_as_sparc_fmaf" >&6; }
+if test $gcc_cv_as_sparc_fmaf = yes; then
+
+$as_echo "#define HAVE_AS_FMAF_HPC_VIS3 1" >>confdefs.h
+
+fi
;;
i[34567]86-*-* | x86_64-*-*)
@@ -24277,6 +24313,44 @@ $as_echo "$as_me: WARNING: LTO for $target requires binutils >= 2.20.1, but vers
;;
esac
fi
+ # Test if the assembler supports the section flag 'e' for specifying
+ # an excluded section.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .section with e" >&5
+$as_echo_n "checking assembler for .section with e... " >&6; }
+if test "${gcc_cv_as_section_has_e+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_section_has_e=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 22 \) \* 1000 + 51`
+ then gcc_cv_as_section_has_e=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo '.section foo1,"e"
+.byte 0,0,0,0' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_section_has_e=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_section_has_e" >&5
+$as_echo "$gcc_cv_as_section_has_e" >&6; }
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GAS_SECTION_EXCLUDE `if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`
+_ACEOF
+
;;
esac
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 6b661be2ffe..acc8427b06e 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3519,6 +3519,18 @@ foo:
fi],
[AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
[Define if your assembler supports offsetable %lo().])])
+
+ gcc_GAS_CHECK_FEATURE([FMAF, HPC, and VIS 3.0 instructions],
+ gcc_cv_as_sparc_fmaf,,
+ [-xarch=v9d],
+ [.text
+ .align 4
+ fmaddd %f0, %f2, %f4, %f6
+ addxccc %g1, %g2, %g3
+ fsrl32 %f2, %f4, %f8
+ fnaddd %f10, %f12, %f14],,
+ [AC_DEFINE(HAVE_AS_FMAF_HPC_VIS3, 1,
+ [Define if your assembler supports FMAF, HPC, and VIS 3.0 instructions.])])
;;
changequote(,)dnl
@@ -3582,6 +3594,15 @@ foo: nop
;;
esac
fi
+ # Test if the assembler supports the section flag 'e' for specifying
+ # an excluded section.
+ gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e,
+ [2,22,51],,
+[.section foo1,"e"
+.byte 0,0,0,0])
+ AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE,
+ [`if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`],
+ [Define if your assembler supports specifying the section flag e.])
;;
esac
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a6de5fae3c7..e9173050249 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,200 @@
+2011-09-30 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (TREE_NEGATED_INT): Remove.
+ * semantics.c (finish_unary_op_expr): Don't set it.
+
+2011-09-30 Janis Johnson <janisjo@codesourcery.com>
+
+ PR c++/44473
+ * mangle.c (write_type): Handle CV qualifiers for decimal classes.
+
+2011-09-26 Andi Kleen <ak@linux.intel.com>
+
+ * repo.c (finish_repo): Use HOST_WIDE_INT_PRINT_HEX_PURE.
+
+2011-09-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/45278
+ * typeck.c (cp_build_binary_op): With -Wextra, warn for ordered
+ comparison of pointer with zero.
+
+2011-09-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/31489
+ * parser.c (cp_parser_elaborated_type_specifier): For RECORD_TYPE,
+ set CLASSTYPE_DECLARED_CLASS.
+
+2011-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (duplicate_decls): If compatible stpcpy prototype
+ is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
+
+2011-09-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/45012
+ * pt.c (tsubst_copy_and_build) [CONST_DECL]: Don't pull out
+ constant value if we're still in a template.
+
+ PR c++/46105
+ * typeck.c (structural_comptypes): Ignore cv-quals on typename scope.
+
+ PR c++/50508
+ * semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
+ rather than ==.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/45487
+ * error.c (dump_template_bindings): Separate bindings with semicolons
+ instead of commas.
+
+2011-09-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/50512
+ * call.c (compare_ics): Only consider rvaluedness_matches_p
+ if the target type is the same or it too differs in rvalueness.
+
+ PR c++/50523
+ * call.c (implicit_conversion): Mask out inappropriate LOOKUP
+ flags at the top of the function.
+
+ * pt.c (tsubst_copy) [PARM_DECL]: Handle 'this' in NSDMI.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/26747
+ * cp-gimplify.c (get_bc_label): Remove obsolete diagnostics.
+
+2011-09-25 Jason Merrill <jason@redhat.com>
+
+ * parser.c (inject_this_parameter): Split out from
+ cp_parser_late_return_type_opt.
+ (cp_parser_class_specifier_1): Use it for NSDMIs.
+ * tree.c (bot_replace): Replace NSDMI 'this' with real 'this'.
+
+2011-09-24 Jason Merrill <jason@redhat.com>
+
+ * except.c (expr_noexcept_p): Split out from finish_noexcept_expr.
+ * cp-tree.h: Declare it.
+ * method.c (walk_field_subobs): Use it.
+
+ * init.c (perform_member_init): Instantiate NSDMI here.
+ * pt.c (tsubst_decl) [FIELD_DECL]: Not here.
+
+ Handle deferred parsing of NSDMIs.
+ * parser.h (cp_unparsed_functions_entry): Add nsdmis field.
+ * parser.c (unparsed_nsdmis, cp_parser_save_nsdmi): New.
+ (cp_parser_late_parse_one_default_arg): Split out from
+ cp_parser_late_parsing_default_args.
+ (cp_parser_late_parsing_nsdmi): New.
+ (push_unparsed_function_queues): Set it.
+ (cp_parser_parameter_declaration): Save the '=' token.
+ (cp_parser_template_parameter): Likewise.
+ (cp_parser_default_argument): Call cp_parser_initializer
+ rather than cp_parser_initializer_clause.
+ (cp_parser_class_specifier_1): Parse unparsed_nsdmis.
+ (cp_parser_member_declaration): Handle nsdmis.
+ * decl2.c (grokfield): Handle DEFAULT_ARG for a function.
+
+ Implement C++11 non-static data member initializers.
+ * cp-tree.h (enum cpp_warn_str): Add CPP0X_NSDMI.
+ * error.c (maybe_warn_cpp0x): Handle it.
+ * call.c (convert_like_real) [ck_user]: Don't complain about
+ using an explicit constructor for direct-initialization.
+ * class.c (check_field_decl): Fix ancient typo.
+ (check_field_decls): NSDMIs make the default ctor non-trivial.
+ * decl.c (cp_finish_decl): Record NSDMI.
+ (grokdeclarator): Allow NSDMI.
+ * decl2.c (grokfield): Allow NSDMI. Correct LOOKUP flags.
+ * init.c (perform_member_init): Use NSDMI.
+ * method.c (walk_field_subobs): Check for NSDMI.
+ * parser.c (cp_parser_member_declaration): Parse { } init.
+ * semantics.c (register_constexpr_fundef): Don't talk about
+ a return statement in a constexpr constructor.
+ (cxx_eval_call_expression): Check DECL_INITIAL instead of
+ DECL_SAVED_TREE.
+
+2011-09-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44267
+ * class.c (build_base_path): Add a tsubst_flags_t parameter.
+ (convert_to_base): Adjust call.
+ * typeck.c (build_class_member_access_expr,
+ get_member_function_from_ptrfunc, build_static_cast_1): Likewise.
+ * init.c (dfs_initialize_vtbl_ptrs, emit_mem_initializers): Likewise.
+ * method.c (do_build_copy_constructor, do_build_copy_assign): Likewise.
+ * rtti.c (build_dynamic_cast_1): Likewise.
+ * typeck2.c (build_scoped_ref, build_m_component_ref): Likewise.
+ * call.c (build_over_call, build_special_member_call): Likewise.
+ * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
+ build_up_reference): Likewise.
+ * cp-tree.h (build_base_path): Adjust declaration.
+
+2011-09-23 Jason Merrill <jason@redhat.com>
+
+ Core 253 - allow const objects with no initializer or
+ user-provided default constructor if the defaulted constructor
+ initializes all the subobjects.
+ PR c++/20039
+ PR c++/42844
+ * class.c (default_init_uninitialized_part): New.
+ * cp-tree.h: Declare it.
+ * decl.c (check_for_uninitialized_const_var): Use it.
+ * init.c (perform_member_init): Likewise.
+ (build_new_1): Likewise.
+ * method.c (walk_field_subobs): Likewise.
+
+2011-09-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50258
+ * decl.c (check_static_variable_definition): Allow in-class
+ initialization of static data member of non-integral type in
+ permissive mode.
+
+2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50491
+ * semantics.c (potential_constant_expression_1): Handle USING_DECL.
+
+2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50371
+ * pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
+
+2011-09-22 Jonathan Wakely <jwakely.gcc@gmail.com>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50344
+ * friend.c (make_friend_class): cv-qualification is ok in a
+ friend declaration.
+
+2011-09-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50454
+ * decl.c (grokdeclarator): Consistently handle both __int128
+ and unsigned __int128 with -pedantic; suppress diagnostic in
+ system headers.
+
+2011-09-20 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (DECL_TEMPLOID_INSTANTIATION): New.
+ (DECL_GENERATED_P): New.
+ * class.c (finalize_literal_type_property): Use them.
+ * semantics.c (is_instantiation_of_constexpr): Likewise.
+ (register_constexpr_fundef): Likewise.
+
+ * call.c (convert_default_arg): Avoid redundant copy.
+ * tree.c (bot_manip): Copy everything.
+
+2011-09-20 Roberto Agostino Vitillo <ravitillo@lbl.gov>
+
+ * call.c (build_new_method_call_1): Use non-virtual lookup
+ for final virtual functions.
+
2011-09-16 Jason Merrill <jason@redhat.com>
PR c++/50424
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index bdbede7fbe6..a52ec29eb66 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1660,6 +1660,12 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
|| expr == error_mark_node)
return NULL;
+ /* Other flags only apply to the primary function in overload
+ resolution, or after we've chosen one. */
+ flags &= (LOOKUP_ONLYCONVERTING|LOOKUP_NO_CONVERSION|LOOKUP_COPY_PARM
+ |LOOKUP_NO_TEMP_BIND|LOOKUP_NO_RVAL_BIND|LOOKUP_PREFER_RVALUE
+ |LOOKUP_NO_NARROWING|LOOKUP_PROTECT);
+
if (TREE_CODE (to) == REFERENCE_TYPE)
conv = reference_binding (to, from, expr, c_cast_p, flags);
else
@@ -1716,15 +1722,13 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
&& (flags & LOOKUP_NO_CONVERSION) == 0)
{
struct z_candidate *cand;
- int convflags = (flags & (LOOKUP_NO_TEMP_BIND|LOOKUP_ONLYCONVERTING
- |LOOKUP_NO_NARROWING));
if (CLASS_TYPE_P (to)
&& BRACE_ENCLOSED_INITIALIZER_P (expr)
&& !CLASSTYPE_NON_AGGREGATE (complete_type (to)))
return build_aggr_conv (to, expr, flags);
- cand = build_user_type_conversion_1 (to, expr, convflags);
+ cand = build_user_type_conversion_1 (to, expr, flags);
if (cand)
conv = cand->second_conv;
@@ -5648,6 +5652,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
/* When converting from an init list we consider explicit
constructors, but actually trying to call one is an error. */
if (DECL_NONCONVERTING_P (convfn) && DECL_CONSTRUCTOR_P (convfn)
+ /* Unless this is for direct-list-initialization. */
+ && !(BRACE_ENCLOSED_INITIALIZER_P (expr)
+ && CONSTRUCTOR_IS_DIRECT_INIT (expr))
/* Unless we're calling it for value-initialization from an
empty list, since that is handled separately in 8.5.4. */
&& cand->num_convs > 0)
@@ -6130,6 +6137,8 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum)
we must not perform access checks here. */
push_deferring_access_checks (dk_no_check);
+ /* We must make a copy of ARG, in case subsequent processing
+ alters any part of it. */
arg = break_out_target_exprs (arg);
if (TREE_CODE (arg) == CONSTRUCTOR)
{
@@ -6140,14 +6149,6 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum)
}
else
{
- /* We must make a copy of ARG, in case subsequent processing
- alters any part of it. For example, during gimplification a
- cast of the form (T) &X::f (where "f" is a member function)
- will lead to replacing the PTRMEM_CST for &X::f with a
- VAR_DECL. We can avoid the copy for constants, since they
- are never modified in place. */
- if (!CONSTANT_CLASS_P (arg))
- arg = unshare_expr (arg);
arg = convert_for_initialization (0, type, arg, LOOKUP_IMPLICIT,
ICR_DEFAULT_ARGUMENT, fn, parmnum,
tf_warning_or_error);
@@ -6455,7 +6456,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
converted_arg = build_base_path (PLUS_EXPR,
arg,
cand->conversion_path,
- 1);
+ 1, complain);
/* Check that the base class is accessible. */
if (!accessible_base_p (TREE_TYPE (argtype),
BINFO_TYPE (cand->conversion_path), true))
@@ -6468,7 +6469,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)),
TREE_TYPE (parmtype), ba_unique, NULL);
converted_arg = build_base_path (PLUS_EXPR, converted_arg,
- base_binfo, 1);
+ base_binfo, 1, complain);
argarray[j++] = converted_arg;
parm = TREE_CHAIN (parm);
@@ -6712,7 +6713,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
if (TREE_DEPRECATED (fn))
warn_deprecated_use (fn, NULL_TREE);
- argarray[0] = build_base_path (PLUS_EXPR, argarray[0], binfo, 1);
+ argarray[0] = build_base_path (PLUS_EXPR, argarray[0], binfo, 1,
+ complain);
if (TREE_SIDE_EFFECTS (argarray[0]))
argarray[0] = save_expr (argarray[0]);
t = build_pointer_type (TREE_TYPE (fn));
@@ -6922,7 +6924,7 @@ build_special_member_call (tree instance, tree name, VEC(tree,gc) **args,
/* However, for assignment operators, we must convert
dynamically if the base is virtual. */
instance = build_base_path (PLUS_EXPR, instance,
- binfo, /*nonnull=*/1);
+ binfo, /*nonnull=*/1, complain);
}
}
@@ -7282,8 +7284,11 @@ build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
}
else
{
+ /* Optimize away vtable lookup if we know that this function
+ can't be overridden. */
if (DECL_VINDEX (fn) && ! (flags & LOOKUP_NONVIRTUAL)
- && resolves_to_fixed_type_p (instance, 0))
+ && (resolves_to_fixed_type_p (instance, 0)
+ || DECL_FINAL_P (fn) || CLASSTYPE_FINAL (basetype)))
flags |= LOOKUP_NONVIRTUAL;
if (explicit_targs)
flags |= LOOKUP_EXPLICIT_TMPL_ARGS;
@@ -7859,18 +7864,25 @@ compare_ics (conversion *ics1, conversion *ics2)
types to which the references refer are the same type except for
top-level cv-qualifiers, and the type to which the reference
initialized by S2 refers is more cv-qualified than the type to
- which the reference initialized by S1 refers */
+ which the reference initialized by S1 refers.
+
+ DR 1328 [over.match.best]: the context is an initialization by
+ conversion function for direct reference binding (13.3.1.6) of a
+ reference to function type, the return type of F1 is the same kind of
+ reference (i.e. lvalue or rvalue) as the reference being initialized,
+ and the return type of F2 is not. */
if (ref_conv1 && ref_conv2)
{
- if (!ref_conv1->this_p && !ref_conv2->this_p)
+ if (!ref_conv1->this_p && !ref_conv2->this_p
+ && (ref_conv1->rvaluedness_matches_p
+ != ref_conv2->rvaluedness_matches_p)
+ && (same_type_p (ref_conv1->type, ref_conv2->type)
+ || (TYPE_REF_IS_RVALUE (ref_conv1->type)
+ != TYPE_REF_IS_RVALUE (ref_conv2->type))))
{
- if (ref_conv1->rvaluedness_matches_p
- > ref_conv2->rvaluedness_matches_p)
- return 1;
- if (ref_conv2->rvaluedness_matches_p
- > ref_conv1->rvaluedness_matches_p)
- return -1;
+ return (ref_conv1->rvaluedness_matches_p
+ - ref_conv2->rvaluedness_matches_p);
}
if (same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2))
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a4a7468bad1..a7d8218055f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -235,7 +235,8 @@ tree
build_base_path (enum tree_code code,
tree expr,
tree binfo,
- int nonnull)
+ int nonnull,
+ tsubst_flags_t complain)
{
tree v_binfo = NULL_TREE;
tree d_binfo = NULL_TREE;
@@ -276,14 +277,16 @@ build_base_path (enum tree_code code,
if (code == MINUS_EXPR && v_binfo)
{
- error ("cannot convert from base %qT to derived type %qT via virtual base %qT",
- BINFO_TYPE (binfo), BINFO_TYPE (d_binfo), BINFO_TYPE (v_binfo));
+ if (complain & tf_error)
+ error ("cannot convert from base %qT to derived type %qT via "
+ "virtual base %qT", BINFO_TYPE (binfo), BINFO_TYPE (d_binfo),
+ BINFO_TYPE (v_binfo));
return error_mark_node;
}
if (!want_pointer)
/* This must happen before the call to save_expr. */
- expr = cp_build_addr_expr (expr, tf_warning_or_error);
+ expr = cp_build_addr_expr (expr, complain);
else
expr = mark_rvalue_use (expr);
@@ -341,7 +344,7 @@ build_base_path (enum tree_code code,
interesting to the optimizers anyway. */
&& !has_empty)
{
- expr = cp_build_indirect_ref (expr, RO_NULL, tf_warning_or_error);
+ expr = cp_build_indirect_ref (expr, RO_NULL, complain);
expr = build_simple_base_path (expr, binfo);
if (want_pointer)
expr = build_address (expr);
@@ -366,19 +369,18 @@ build_base_path (enum tree_code code,
t = TREE_TYPE (TYPE_VFIELD (current_class_type));
t = build_pointer_type (t);
v_offset = convert (t, current_vtt_parm);
- v_offset = cp_build_indirect_ref (v_offset, RO_NULL,
- tf_warning_or_error);
+ v_offset = cp_build_indirect_ref (v_offset, RO_NULL, complain);
}
else
v_offset = build_vfield_ref (cp_build_indirect_ref (expr, RO_NULL,
- tf_warning_or_error),
+ complain),
TREE_TYPE (TREE_TYPE (expr)));
v_offset = fold_build_pointer_plus (v_offset, BINFO_VPTR_FIELD (v_binfo));
v_offset = build1 (NOP_EXPR,
build_pointer_type (ptrdiff_type_node),
v_offset);
- v_offset = cp_build_indirect_ref (v_offset, RO_NULL, tf_warning_or_error);
+ v_offset = cp_build_indirect_ref (v_offset, RO_NULL, complain);
TREE_CONSTANT (v_offset) = 1;
offset = convert_to_integer (ptrdiff_type_node,
@@ -418,7 +420,7 @@ build_base_path (enum tree_code code,
null_test = NULL;
if (!want_pointer)
- expr = cp_build_indirect_ref (expr, RO_NULL, tf_warning_or_error);
+ expr = cp_build_indirect_ref (expr, RO_NULL, complain);
out:
if (null_test)
@@ -523,7 +525,7 @@ convert_to_base (tree object, tree type, bool check_access, bool nonnull,
if (!binfo || binfo == error_mark_node)
return error_mark_node;
- return build_base_path (PLUS_EXPR, object, binfo, nonnull);
+ return build_base_path (PLUS_EXPR, object, binfo, nonnull, complain);
}
/* EXPR is an expression with unqualified class type. BASE is a base
@@ -2956,7 +2958,7 @@ check_field_decl (tree field,
{
/* `build_class_init_list' does not recognize
non-FIELD_DECLs. */
- if (TREE_CODE (t) == UNION_TYPE && any_default_members != 0)
+ if (TREE_CODE (t) == UNION_TYPE && *any_default_members != 0)
error ("multiple fields in union %qT initialized", t);
*any_default_members = 1;
}
@@ -3254,6 +3256,14 @@ check_field_decls (tree t, tree *access_decls,
" but does not override %<operator=(const %T&)%>", t);
}
+ /* Non-static data member initializers make the default constructor
+ non-trivial. */
+ if (any_default_members)
+ {
+ TYPE_NEEDS_CONSTRUCTING (t) = true;
+ TYPE_HAS_COMPLEX_DFLT (t) = true;
+ }
+
/* If any of the fields couldn't be packed, unset TYPE_PACKED. */
if (cant_pack)
TYPE_PACKED (t) = 0;
@@ -4356,6 +4366,40 @@ type_has_user_provided_default_constructor (tree t)
return false;
}
+/* If default-initialization leaves part of TYPE uninitialized, returns
+ a DECL for the field or TYPE itself (DR 253). */
+
+tree
+default_init_uninitialized_part (tree type)
+{
+ tree t, r, binfo;
+ int i;
+
+ type = strip_array_types (type);
+ if (!CLASS_TYPE_P (type))
+ return type;
+ if (type_has_user_provided_default_constructor (type))
+ return NULL_TREE;
+ for (binfo = TYPE_BINFO (type), i = 0;
+ BINFO_BASE_ITERATE (binfo, i, t); ++i)
+ {
+ r = default_init_uninitialized_part (BINFO_TYPE (t));
+ if (r)
+ return r;
+ }
+ for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
+ if (TREE_CODE (t) == FIELD_DECL
+ && !DECL_ARTIFICIAL (t)
+ && !DECL_INITIAL (t))
+ {
+ r = default_init_uninitialized_part (TREE_TYPE (t));
+ if (r)
+ return DECL_P (r) ? r : t;
+ }
+
+ return NULL_TREE;
+}
+
/* Returns true iff for class T, a trivial synthesized default constructor
would be constexpr. */
@@ -4581,7 +4625,7 @@ finalize_literal_type_property (tree t)
&& !DECL_CONSTRUCTOR_P (fn))
{
DECL_DECLARED_CONSTEXPR_P (fn) = false;
- if (!DECL_TEMPLATE_INFO (fn))
+ if (!DECL_GENERATED_P (fn))
{
error ("enclosing class of constexpr non-static member "
"function %q+#D is not a literal type", fn);
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 6aeae75b063..af45f591846 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -86,16 +86,6 @@ get_bc_label (enum bc_t bc)
{
tree label = bc_label[bc];
- if (label == NULL_TREE)
- {
- if (bc == bc_break)
- error ("break statement not within loop or switch");
- else
- error ("continue statement not within loop or switch");
-
- return NULL_TREE;
- }
-
/* Mark the label used for finish_bc_block. */
TREE_USED (label) = 1;
return label;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 8e52e282a3b..7e5aac750f3 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -394,7 +394,9 @@ typedef enum cpp0x_warn_str
/* inline namespaces */
CPP0X_INLINE_NAMESPACES,
/* override controls, override/final */
- CPP0X_OVERRIDE_CONTROLS
+ CPP0X_OVERRIDE_CONTROLS,
+ /* non-static data member initializers */
+ CPP0X_NSDMI
} cpp0x_warn_str;
/* The various kinds of operation used by composite_pointer_type. */
@@ -2987,10 +2989,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define TYPENAME_IS_RESOLVING_P(NODE) \
(TREE_LANG_FLAG_2 (TYPENAME_TYPE_CHECK (NODE)))
-/* Nonzero in INTEGER_CST means that this int is negative by dint of
- using a twos-complement negated operand. */
-#define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE))
-
/* [class.virtual]
A class that declares or inherits a virtual function is called a
@@ -3705,6 +3703,17 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
(DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
+/* Nonzero if DECL is a function generated from a function 'temploid',
+ i.e. template, member of class template, or dependent friend. */
+#define DECL_TEMPLOID_INSTANTIATION(DECL) \
+ (DECL_TEMPLATE_INSTANTIATION (DECL) \
+ || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (DECL))
+
+/* Nonzero if DECL is either defined implicitly by the compiler or
+ generated from a temploid. */
+#define DECL_GENERATED_P(DECL) \
+ (DECL_TEMPLOID_INSTANTIATION (DECL) || DECL_DEFAULTED_FN (DECL))
+
/* Nonzero iff we are currently processing a declaration for an
entity with its own template parameter list, and which is not a
full specialization. */
@@ -4779,7 +4788,7 @@ extern void validate_conversion_obstack (void);
/* in class.c */
extern tree build_vfield_ref (tree, tree);
extern tree build_base_path (enum tree_code, tree,
- tree, int);
+ tree, int, tsubst_flags_t);
extern tree convert_to_base (tree, tree, bool, bool,
tsubst_flags_t);
extern tree convert_to_base_statically (tree, tree);
@@ -4827,6 +4836,7 @@ extern tree in_class_defaulted_default_constructor (tree);
extern bool user_provided_p (tree);
extern bool type_has_user_provided_constructor (tree);
extern bool type_has_user_provided_default_constructor (tree);
+extern tree default_init_uninitialized_part (tree);
extern bool trivial_default_constructor_is_constexpr (tree);
extern bool type_has_constexpr_default_constructor (tree);
extern bool type_has_virtual_destructor (tree);
@@ -5033,6 +5043,7 @@ extern tree build_throw (tree);
extern int nothrow_libfn_p (const_tree);
extern void check_handlers (tree);
extern tree finish_noexcept_expr (tree, tsubst_flags_t);
+extern bool expr_noexcept_p (tree, tsubst_flags_t);
extern void perform_deferred_noexcept_checks (void);
extern bool nothrow_spec_p (const_tree);
extern bool type_noexcept_p (const_tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 8a23d5199f6..3e618d320ad 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -1,7 +1,7 @@
/* Language-level data type conversion for GNU C++.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -157,7 +157,8 @@ cp_convert_to_pointer (tree type, tree expr)
if (binfo || same_p)
{
if (binfo)
- expr = build_base_path (code, expr, binfo, 0);
+ expr = build_base_path (code, expr, binfo, 0,
+ tf_warning_or_error);
/* Add any qualifier conversions. */
return build_nop (type, expr);
}
@@ -275,7 +276,8 @@ convert_to_pointer_force (tree type, tree expr)
return error_mark_node;
if (binfo)
{
- expr = build_base_path (code, expr, binfo, 0);
+ expr = build_base_path (code, expr, binfo, 0,
+ tf_warning_or_error);
if (expr == error_mark_node)
return error_mark_node;
/* Add any qualifier conversions. */
@@ -341,7 +343,8 @@ build_up_reference (tree type, tree arg, int flags, tree decl)
return error_mark_node;
if (binfo == NULL_TREE)
return error_not_base_type (target_type, argtype);
- rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
+ rval = build_base_path (PLUS_EXPR, rval, binfo, 1,
+ tf_warning_or_error);
}
else
rval
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a61b3598cb8..30f92dae243 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2135,6 +2135,18 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* If we're keeping the built-in definition, keep the rtl,
regardless of declaration matches. */
COPY_DECL_RTL (olddecl, newdecl);
+ if (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (newdecl))
+ {
+ /* If a compatible prototype of these builtin functions
+ is seen, assume the runtime implements it with the
+ expected semantics. */
+ case BUILT_IN_STPCPY:
+ implicit_built_in_decls[DECL_FUNCTION_CODE (newdecl)]
+ = built_in_decls[DECL_FUNCTION_CODE (newdecl)];
+ default:
+ break;
+ }
}
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
@@ -4899,15 +4911,16 @@ check_for_uninitialized_const_var (tree decl)
if (TREE_CODE (decl) == VAR_DECL
&& TREE_CODE (type) != REFERENCE_TYPE
&& CP_TYPE_CONST_P (type)
- && (!TYPE_NEEDS_CONSTRUCTING (type)
- || !type_has_user_provided_default_constructor (type))
&& !DECL_INITIAL (decl))
{
+ tree field = default_init_uninitialized_part (type);
+ if (!field)
+ return;
+
permerror (DECL_SOURCE_LOCATION (decl),
"uninitialized const %qD", decl);
- if (CLASS_TYPE_P (type)
- && !type_has_user_provided_default_constructor (type))
+ if (CLASS_TYPE_P (type))
{
tree defaulted_ctor;
@@ -4918,6 +4931,8 @@ check_for_uninitialized_const_var (tree decl)
inform (DECL_SOURCE_LOCATION (defaulted_ctor),
"constructor is not user-provided because it is "
"explicitly defaulted in the class body");
+ inform (0, "and the implicitly-defined constructor does not "
+ "initialize %q+#D", field);
}
}
}
@@ -6072,6 +6087,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
return;
}
+ /* Just store non-static data member initializers for later. */
+ if (init && TREE_CODE (decl) == FIELD_DECL)
+ DECL_INITIAL (decl) = init;
+
/* Take care of TYPE_DECLs up front. */
if (TREE_CODE (decl) == TYPE_DECL)
{
@@ -7716,8 +7735,9 @@ check_static_variable_definition (tree decl, tree type)
else if (cxx_dialect >= cxx0x && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
if (literal_type_p (type))
- error ("%<constexpr%> needed for in-class initialization of static "
- "data member %q#D of non-integral type", decl);
+ permerror (input_location,
+ "%<constexpr%> needed for in-class initialization of "
+ "static data member %q#D of non-integral type", decl);
else
error ("in-class initialization of static data member %q#D of "
"non-literal type", decl);
@@ -8640,6 +8660,18 @@ grokdeclarator (const cp_declarator *declarator,
ctype = NULL_TREE;
+ if (explicit_int128)
+ {
+ if (int128_integer_type_node == NULL_TREE)
+ {
+ error ("%<__int128%> is not supported by this target");
+ explicit_int128 = false;
+ }
+ else if (pedantic && ! in_system_header)
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ does not support %<__int128%> for %qs", name);
+ }
+
/* Now process the modifiers that were specified
and check for invalid combinations. */
@@ -8663,8 +8695,6 @@ grokdeclarator (const cp_declarator *declarator,
error ("%<signed%> and %<unsigned%> specified together for %qs", name);
else if (longlong && TREE_CODE (type) != INTEGER_TYPE)
error ("%<long long%> invalid for %qs", name);
- else if (explicit_int128 && TREE_CODE (type) != INTEGER_TYPE)
- error ("%<__int128%> invalid for %qs", name);
else if (long_p && TREE_CODE (type) == REAL_TYPE)
error ("%<long%> invalid for %qs", name);
else if (short_p && TREE_CODE (type) == REAL_TYPE)
@@ -8695,22 +8725,6 @@ grokdeclarator (const cp_declarator *declarator,
if (flag_pedantic_errors)
ok = 0;
}
- if (explicit_int128)
- {
- if (int128_integer_type_node == NULL_TREE)
- {
- error ("%<__int128%> is not supported by this target");
- ok = 0;
- }
- else if (pedantic)
- {
- pedwarn (input_location, OPT_pedantic,
- "ISO C++ does not support %<__int128%> for %qs",
- name);
- if (flag_pedantic_errors)
- ok = 0;
- }
- }
}
/* Discard the type modifiers if they are invalid. */
@@ -8721,7 +8735,6 @@ grokdeclarator (const cp_declarator *declarator,
long_p = false;
short_p = false;
longlong = 0;
- explicit_int128 = false;
}
}
@@ -10090,36 +10103,6 @@ grokdeclarator (const cp_declarator *declarator,
if (decl == NULL_TREE)
{
- if (initialized)
- {
- if (!staticp)
- {
- /* An attempt is being made to initialize a non-static
- member. But, from [class.mem]:
-
- 4 A member-declarator can contain a
- constant-initializer only if it declares a static
- member (_class.static_) of integral or enumeration
- type, see _class.static.data_.
-
- This used to be relatively common practice, but
- the rest of the compiler does not correctly
- handle the initialization unless the member is
- static so we make it static below. */
- if (cxx_dialect >= cxx0x)
- {
- sorry ("non-static data member initializers");
- }
- else
- {
- permerror (input_location, "ISO C++ forbids initialization of member %qD",
- unqualified_id);
- permerror (input_location, "making %qD static", unqualified_id);
- staticp = 1;
- }
- }
- }
-
if (staticp)
{
/* C++ allows static class members. All other work
@@ -10160,6 +10143,11 @@ grokdeclarator (const cp_declarator *declarator,
DECL_MUTABLE_P (decl) = 1;
storage_class = sc_none;
}
+
+ if (initialized)
+ /* An attempt is being made to initialize a non-static
+ member. This is new in C++11. */
+ maybe_warn_cpp0x (CPP0X_NSDMI);
}
bad_specifiers (decl, BSP_FIELD, virtualp,
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 68e9b9b7bac..6e5f7cc7d75 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -795,7 +795,7 @@ grokfield (const cp_declarator *declarator,
{
tree value;
const char *asmspec = 0;
- int flags = LOOKUP_ONLYCONVERTING;
+ int flags;
tree name;
if (init
@@ -902,6 +902,8 @@ grokfield (const cp_declarator *declarator,
DECL_DECLARED_INLINE_P (value) = 1;
}
}
+ else if (TREE_CODE (init) == DEFAULT_ARG)
+ error ("invalid initializer for member function %qD", value);
else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
{
if (integer_zerop (init))
@@ -919,9 +921,10 @@ grokfield (const cp_declarator *declarator,
value);
}
}
- else if (pedantic && TREE_CODE (value) != VAR_DECL)
- /* Already complained in grokdeclarator. */
- init = NULL_TREE;
+ else if (TREE_CODE (value) == FIELD_DECL)
+ /* C++11 NSDMI, keep going. */;
+ else if (TREE_CODE (value) != VAR_DECL)
+ gcc_unreachable ();
else if (!processing_template_decl)
{
if (TREE_CODE (init) == CONSTRUCTOR)
@@ -955,6 +958,12 @@ grokfield (const cp_declarator *declarator,
if (attrlist)
cplus_decl_attributes (&value, attrlist, 0);
+ if (init && BRACE_ENCLOSED_INITIALIZER_P (init)
+ && CONSTRUCTOR_IS_DIRECT_INIT (init))
+ flags = LOOKUP_NORMAL;
+ else
+ flags = LOOKUP_IMPLICIT;
+
switch (TREE_CODE (value))
{
case VAR_DECL:
@@ -969,7 +978,6 @@ grokfield (const cp_declarator *declarator,
init = error_mark_node;
cp_finish_decl (value, init, /*init_const_expr_p=*/false,
NULL_TREE, flags);
- DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1;
return value;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 598ddf10e5d..4d12a0dd43d 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-objc.h"
#define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
+#define pp_separate_with_semicolon(PP) pp_cxx_separate_with (PP, ';')
/* The global buffer where we dump everything. It is there only for
transitional purpose. It is expected, in the near future, to be
@@ -259,7 +260,7 @@ dump_template_parameter (tree parm, int flags)
static void
dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
{
- int need_comma = 0;
+ bool need_semicolon = false;
int i;
tree t;
@@ -283,8 +284,8 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
if (lvl_args && NUM_TMPL_ARGS (lvl_args) > arg_idx)
arg = TREE_VEC_ELT (lvl_args, arg_idx);
- if (need_comma)
- pp_separate_with_comma (cxx_pp);
+ if (need_semicolon)
+ pp_separate_with_semicolon (cxx_pp);
dump_template_parameter (TREE_VEC_ELT (p, i), TFF_PLAIN_IDENTIFIER);
pp_cxx_whitespace (cxx_pp);
pp_equal (cxx_pp);
@@ -301,7 +302,7 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
pp_string (cxx_pp, M_("<missing>"));
++arg_idx;
- need_comma = 1;
+ need_semicolon = true;
}
parms = TREE_CHAIN (parms);
@@ -313,8 +314,8 @@ dump_template_bindings (tree parms, tree args, VEC(tree,gc)* typenames)
FOR_EACH_VEC_ELT (tree, typenames, i, t)
{
- if (need_comma)
- pp_separate_with_comma (cxx_pp);
+ if (need_semicolon)
+ pp_separate_with_semicolon (cxx_pp);
dump_type (t, TFF_PLAIN_IDENTIFIER);
pp_cxx_whitespace (cxx_pp);
pp_equal (cxx_pp);
@@ -3236,6 +3237,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
"override controls (override/final) "
"only available with -std=c++0x or -std=gnu++0x");
break;
+ case CPP0X_NSDMI:
+ pedwarn (input_location, 0,
+ "non-static data member initializers "
+ "only available with -std=c++0x or -std=gnu++0x");
+ break;
default:
gcc_unreachable();
}
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index bfc520d93d2..ceec858be1f 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1125,14 +1125,27 @@ perform_deferred_noexcept_checks (void)
tree
finish_noexcept_expr (tree expr, tsubst_flags_t complain)
{
- tree fn;
-
if (expr == error_mark_node)
return error_mark_node;
if (processing_template_decl)
return build_min (NOEXCEPT_EXPR, boolean_type_node, expr);
+ return (expr_noexcept_p (expr, complain)
+ ? boolean_true_node : boolean_false_node);
+}
+
+/* Returns whether EXPR is noexcept, possibly warning if allowed by
+ COMPLAIN. */
+
+bool
+expr_noexcept_p (tree expr, tsubst_flags_t complain)
+{
+ tree fn;
+
+ if (expr == error_mark_node)
+ return false;
+
fn = cp_walk_tree_without_duplicates (&expr, check_noexcept_r, 0);
if (fn)
{
@@ -1151,10 +1164,10 @@ finish_noexcept_expr (tree expr, tsubst_flags_t complain)
else
maybe_noexcept_warning (fn);
}
- return boolean_false_node;
+ return false;
}
else
- return boolean_true_node;
+ return true;
}
/* Return true iff SPEC is throw() or noexcept(true). */
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 36fcca4f737..b6bd387b829 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -1,6 +1,6 @@
/* Help friends in C++.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007, 2008, 2010 Free Software Foundation, Inc.
+ 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -237,6 +237,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
return;
}
+ friend_type = cv_unqualified (friend_type);
+
if (friend_depth)
/* If the TYPE is a template then it makes sense for it to be
friends with itself; this means that each instantiation is
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index ff1884b361d..f246286e767 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -100,7 +100,8 @@ dfs_initialize_vtbl_ptrs (tree binfo, void *data)
{
tree base_ptr = TREE_VALUE ((tree) data);
- base_ptr = build_base_path (PLUS_EXPR, base_ptr, binfo, /*nonnull=*/1);
+ base_ptr = build_base_path (PLUS_EXPR, base_ptr, binfo, /*nonnull=*/1,
+ tf_warning_or_error);
expand_virtual_init (binfo, base_ptr);
}
@@ -492,6 +493,21 @@ perform_member_init (tree member, tree init)
tree decl;
tree type = TREE_TYPE (member);
+ /* Use the non-static data member initializer if there was no
+ mem-initializer for this field. */
+ if (init == NULL_TREE)
+ {
+ if (CLASSTYPE_TEMPLATE_INSTANTIATION (DECL_CONTEXT (member)))
+ /* Do deferred instantiation of the NSDMI. */
+ init = (tsubst_copy_and_build
+ (DECL_INITIAL (member),
+ CLASSTYPE_TI_ARGS (DECL_CONTEXT (member)),
+ tf_warning_or_error, member, /*function_p=*/false,
+ /*integral_constant_expression_p=*/false));
+ else
+ init = break_out_target_exprs (DECL_INITIAL (member));
+ }
+
/* Effective C++ rule 12 requires that all data members be
initialized. */
if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)
@@ -579,7 +595,7 @@ perform_member_init (tree member, tree init)
flags |= LOOKUP_DEFAULTED;
if (CP_TYPE_CONST_P (type)
&& init == NULL_TREE
- && !type_has_user_provided_default_constructor (type))
+ && default_init_uninitialized_part (type))
/* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
vtable; still give this diagnostic. */
permerror (DECL_SOURCE_LOCATION (current_function_decl),
@@ -963,7 +979,7 @@ emit_mem_initializers (tree mem_inits)
tree base_addr;
base_addr = build_base_path (PLUS_EXPR, current_class_ptr,
- subobject, 1);
+ subobject, 1, tf_warning_or_error);
expand_aggr_init_1 (subobject, NULL_TREE,
cp_build_indirect_ref (base_addr, RO_NULL,
tf_warning_or_error),
@@ -2088,7 +2104,7 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts,
}
if (CP_TYPE_CONST_P (elt_type) && *init == NULL
- && !type_has_user_provided_default_constructor (elt_type))
+ && default_init_uninitialized_part (elt_type))
{
if (complain & tf_error)
error ("uninitialized const in %<new%> of %q#T", elt_type);
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 1fcd999e585..55851e646b2 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1802,11 +1802,6 @@ write_type (tree type)
if (find_substitution (type))
return;
- /* According to the C++ ABI, some library classes are passed the
- same as the scalar type of their single member and use the same
- mangling. */
- if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
- type = TREE_TYPE (first_field (type));
if (write_CV_qualifiers_for_type (type) > 0)
/* If TYPE was CV-qualified, we just wrote the qualifiers; now
@@ -1826,6 +1821,12 @@ write_type (tree type)
/* See through any typedefs. */
type = TYPE_MAIN_VARIANT (type);
+ /* According to the C++ ABI, some library classes are passed the
+ same as the scalar type of their single member and use the same
+ mangling. */
+ if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
+ type = TREE_TYPE (first_field (type));
+
if (TYPE_PTRMEM_P (type))
write_pointer_to_member_type (type);
else
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 5b24f8f0285..1316dfb6a83 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -516,7 +516,8 @@ do_build_copy_constructor (tree fndecl)
for (vbases = CLASSTYPE_VBASECLASSES (current_class_type), i = 0;
VEC_iterate (tree, vbases, i, binfo); i++)
{
- init = build_base_path (PLUS_EXPR, parm, binfo, 1);
+ init = build_base_path (PLUS_EXPR, parm, binfo, 1,
+ tf_warning_or_error);
if (move_p)
init = move (init);
member_init_list
@@ -531,7 +532,8 @@ do_build_copy_constructor (tree fndecl)
if (BINFO_VIRTUAL_P (base_binfo))
continue;
- init = build_base_path (PLUS_EXPR, parm, base_binfo, 1);
+ init = build_base_path (PLUS_EXPR, parm, base_binfo, 1,
+ tf_warning_or_error);
if (move_p)
init = move (init);
member_init_list
@@ -624,7 +626,8 @@ do_build_copy_assign (tree fndecl)
/* We must convert PARM directly to the base class
explicitly since the base class may be ambiguous. */
- converted_parm = build_base_path (PLUS_EXPR, parm, base_binfo, 1);
+ converted_parm = build_base_path (PLUS_EXPR, parm, base_binfo, 1,
+ tf_warning_or_error);
if (move_p)
converted_parm = move (converted_parm);
/* Call the base class assignment operator. */
@@ -1015,8 +1018,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
{
bool bad = true;
if (CP_TYPE_CONST_P (mem_type)
- && (!CLASS_TYPE_P (mem_type)
- || !type_has_user_provided_default_constructor (mem_type)))
+ && default_init_uninitialized_part (mem_type))
{
if (msg)
error ("uninitialized non-static const member %q#D",
@@ -1034,10 +1036,26 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
if (bad && deleted_p)
*deleted_p = true;
+ if (DECL_INITIAL (field))
+ {
+ if (msg && DECL_INITIAL (field) == error_mark_node)
+ inform (0, "initializer for %q+#D is invalid", field);
+ if (trivial_p)
+ *trivial_p = false;
+ /* Core 1351: If the field has an NSDMI that could throw, the
+ default constructor is noexcept(false). FIXME this is
+ broken by deferred parsing and 1360 saying we can't
+ lazily declare a non-trivial default constructor. */
+ if (spec_p && !expr_noexcept_p (DECL_INITIAL (field), complain))
+ *spec_p = noexcept_false_spec;
+
+ /* Don't do the normal processing. */
+ continue;
+ }
+
/* For an implicitly-defined default constructor to be constexpr,
- every member must have a user-provided default constructor. */
- /* FIXME will need adjustment for non-static data member
- initializers. */
+ every member must have a user-provided default constructor or
+ an explicit initializer. */
if (constexpr_p && !CLASS_TYPE_P (mem_type))
{
*constexpr_p = false;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 22833124330..83d7b71c8c4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -1486,6 +1486,8 @@ cp_parser_context_new (cp_parser_context* next)
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->funs_with_default_args
#define unparsed_funs_with_definitions \
VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->funs_with_definitions
+#define unparsed_nsdmis \
+ VEC_last (cp_unparsed_functions_entry, parser->unparsed_queues)->nsdmis
static void
push_unparsed_function_queues (cp_parser *parser)
@@ -1494,6 +1496,7 @@ push_unparsed_function_queues (cp_parser *parser)
parser->unparsed_queues, NULL);
unparsed_funs_with_default_args = NULL;
unparsed_funs_with_definitions = make_tree_vector ();
+ unparsed_nsdmis = NULL;
}
static void
@@ -1936,12 +1939,18 @@ static tree cp_parser_functional_cast
(cp_parser *, tree);
static tree cp_parser_save_member_function_body
(cp_parser *, cp_decl_specifier_seq *, cp_declarator *, tree);
+static tree cp_parser_save_nsdmi
+ (cp_parser *);
static tree cp_parser_enclosed_template_argument_list
(cp_parser *);
static void cp_parser_save_default_args
(cp_parser *, tree);
static void cp_parser_late_parsing_for_member
(cp_parser *, tree);
+static tree cp_parser_late_parse_one_default_arg
+ (cp_parser *, tree, tree, tree);
+static void cp_parser_late_parsing_nsdmi
+ (cp_parser *, tree);
static void cp_parser_late_parsing_default_args
(cp_parser *, tree);
static tree cp_parser_sizeof_operand
@@ -11343,9 +11352,7 @@ cp_parser_template_parameter (cp_parser* parser, bool *is_non_type,
user may try to do so, so we'll parse them and give an
appropriate diagnostic here. */
- /* Consume the `='. */
cp_token *start_token = cp_lexer_peek_token (parser->lexer);
- cp_lexer_consume_token (parser->lexer);
/* Find the name of the parameter pack. */
id_declarator = parameter_declarator->declarator;
@@ -13416,7 +13423,13 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
}
if (tag_type != enum_type)
- cp_parser_check_class_key (tag_type, type);
+ {
+ /* Indicate whether this class was declared as a `class' or as a
+ `struct'. */
+ if (TREE_CODE (type) == RECORD_TYPE)
+ CLASSTYPE_DECLARED_CLASS (type) = (tag_type == class_type);
+ cp_parser_check_class_key (tag_type, type);
+ }
/* A "<" cannot follow an elaborated type specifier. If that
happens, the user was probably trying to form a template-id. */
@@ -15683,6 +15696,31 @@ cp_parser_virt_specifier_seq_opt (cp_parser* parser)
return virt_specifiers;
}
+/* Used by handling of trailing-return-types and NSDMI, in which 'this'
+ is in scope even though it isn't real. */
+
+static void
+inject_this_parameter (tree ctype, cp_cv_quals quals)
+{
+ tree this_parm;
+
+ if (current_class_ptr)
+ {
+ /* We don't clear this between NSDMIs. Is it already what we want? */
+ tree type = TREE_TYPE (TREE_TYPE (current_class_ptr));
+ if (same_type_ignoring_top_level_qualifiers_p (ctype, type)
+ && cp_type_quals (type) == quals)
+ return;
+ }
+
+ this_parm = build_this_parm (ctype, quals);
+ /* Clear this first to avoid shortcut in cp_build_indirect_ref. */
+ current_class_ptr = NULL_TREE;
+ current_class_ref
+ = cp_build_indirect_ref (this_parm, RO_NULL, tf_warning_or_error);
+ current_class_ptr = this_parm;
+}
+
/* Parse a late-specified return type, if any. This is not a separate
non-terminal, but part of a function declarator, which looks like
@@ -15711,12 +15749,8 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals)
if (quals >= 0)
{
/* DR 1207: 'this' is in scope in the trailing return type. */
- tree this_parm = build_this_parm (current_class_type, quals);
gcc_assert (current_class_ptr == NULL_TREE);
- current_class_ref
- = cp_build_indirect_ref (this_parm, RO_NULL, tf_warning_or_error);
- /* Set this second to avoid shortcut in cp_build_indirect_ref. */
- current_class_ptr = this_parm;
+ inject_this_parameter (current_class_type, quals);
}
type = cp_parser_trailing_type_id (parser);
@@ -16323,9 +16357,6 @@ cp_parser_parameter_declaration (cp_parser *parser,
/* If the next token is `=', then process a default argument. */
if (cp_lexer_next_token_is (parser->lexer, CPP_EQ))
{
- /* Consume the `='. */
- cp_lexer_consume_token (parser->lexer);
-
/* If we are defining a class, then the tokens that make up the
default argument must be saved and processed later. */
if (!template_parm_p && at_class_scope_p ()
@@ -16535,7 +16566,7 @@ cp_parser_default_argument (cp_parser *parser, bool template_parm_p)
tree default_argument = NULL_TREE;
bool saved_greater_than_is_operator_p;
bool saved_local_variables_forbidden_p;
- bool non_constant_p;
+ bool non_constant_p, is_direct_init;
/* Make sure that PARSER->GREATER_THAN_IS_OPERATOR_P is
set correctly. */
@@ -16549,7 +16580,7 @@ cp_parser_default_argument (cp_parser *parser, bool template_parm_p)
if (template_parm_p)
push_deferring_access_checks (dk_no_deferred);
default_argument
- = cp_parser_initializer_clause (parser, &non_constant_p);
+ = cp_parser_initializer (parser, &is_direct_init, &non_constant_p);
if (BRACE_ENCLOSED_INITIALIZER_P (default_argument))
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
if (template_parm_p)
@@ -17265,11 +17296,12 @@ cp_parser_class_specifier_1 (cp_parser* parser)
there is no need to delay the parsing of `A::B::f'. */
if (--parser->num_classes_being_defined == 0)
{
- tree fn;
+ tree decl;
tree class_type = NULL_TREE;
tree pushed_scope = NULL_TREE;
unsigned ix;
cp_default_arg_entry *e;
+ tree save_ccp, save_ccr;
/* In a first pass, parse default arguments to the functions.
Then, in a second pass, parse the bodies of the functions.
@@ -17284,7 +17316,7 @@ cp_parser_class_specifier_1 (cp_parser* parser)
FOR_EACH_VEC_ELT (cp_default_arg_entry, unparsed_funs_with_default_args,
ix, e)
{
- fn = e->decl;
+ decl = e->decl;
/* If there are default arguments that have not yet been processed,
take care of them now. */
if (class_type != e->class_type)
@@ -17295,18 +17327,36 @@ cp_parser_class_specifier_1 (cp_parser* parser)
pushed_scope = push_scope (class_type);
}
/* Make sure that any template parameters are in scope. */
- maybe_begin_member_template_processing (fn);
+ maybe_begin_member_template_processing (decl);
/* Parse the default argument expressions. */
- cp_parser_late_parsing_default_args (parser, fn);
+ cp_parser_late_parsing_default_args (parser, decl);
/* Remove any template parameters from the symbol table. */
maybe_end_member_template_processing ();
}
+ VEC_truncate (cp_default_arg_entry, unparsed_funs_with_default_args, 0);
+ /* Now parse any NSDMIs. */
+ save_ccp = current_class_ptr;
+ save_ccr = current_class_ref;
+ FOR_EACH_VEC_ELT (tree, unparsed_nsdmis, ix, decl)
+ {
+ if (class_type != DECL_CONTEXT (decl))
+ {
+ if (pushed_scope)
+ pop_scope (pushed_scope);
+ class_type = DECL_CONTEXT (decl);
+ pushed_scope = push_scope (class_type);
+ }
+ inject_this_parameter (class_type, TYPE_UNQUALIFIED);
+ cp_parser_late_parsing_nsdmi (parser, decl);
+ }
+ VEC_truncate (tree, unparsed_nsdmis, 0);
+ current_class_ptr = save_ccp;
+ current_class_ref = save_ccr;
if (pushed_scope)
pop_scope (pushed_scope);
- VEC_truncate (cp_default_arg_entry, unparsed_funs_with_default_args, 0);
/* Now parse the body of the functions. */
- FOR_EACH_VEC_ELT (tree, unparsed_funs_with_definitions, ix, fn)
- cp_parser_late_parsing_for_member (parser, fn);
+ FOR_EACH_VEC_ELT (tree, unparsed_funs_with_definitions, ix, decl)
+ cp_parser_late_parsing_for_member (parser, decl);
VEC_truncate (tree, unparsed_funs_with_definitions, 0);
}
@@ -18185,8 +18235,14 @@ cp_parser_member_declaration (cp_parser* parser)
constant-initializer. When we call `grokfield', it will
perform more stringent semantics checks. */
initializer_token_start = cp_lexer_peek_token (parser->lexer);
- if (function_declarator_p (declarator))
+ if (function_declarator_p (declarator)
+ || (decl_specifiers.type
+ && TREE_CODE (decl_specifiers.type) == TYPE_DECL
+ && (TREE_CODE (TREE_TYPE (decl_specifiers.type))
+ == FUNCTION_TYPE)))
initializer = cp_parser_pure_specifier (parser);
+ else if (decl_specifiers.storage_class != sc_static)
+ initializer = cp_parser_save_nsdmi (parser);
else if (cxx_dialect >= cxx0x)
{
bool nonconst;
@@ -18202,6 +18258,15 @@ cp_parser_member_declaration (cp_parser* parser)
/* Parse the initializer. */
initializer = cp_parser_constant_initializer (parser);
}
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
+ && !function_declarator_p (declarator))
+ {
+ bool x;
+ if (decl_specifiers.storage_class != sc_static)
+ initializer = cp_parser_save_nsdmi (parser);
+ else
+ initializer = cp_parser_initializer (parser, &x, &x);
+ }
/* Otherwise, there is no initializer. */
else
initializer = NULL_TREE;
@@ -18286,6 +18351,11 @@ cp_parser_member_declaration (cp_parser* parser)
if (TREE_CODE (decl) == FUNCTION_DECL)
cp_parser_save_default_args (parser, decl);
+ else if (TREE_CODE (decl) == FIELD_DECL
+ && !DECL_C_BIT_FIELD (decl)
+ && DECL_INITIAL (decl))
+ /* Add DECL to the queue of NSDMI to be parsed later. */
+ VEC_safe_push (tree, gc, unparsed_nsdmis, decl);
}
if (assume_semicolon)
@@ -20533,6 +20603,30 @@ cp_parser_save_member_function_body (cp_parser* parser,
return fn;
}
+/* Save the tokens that make up the in-class initializer for a non-static
+ data member. Returns a DEFAULT_ARG. */
+
+static tree
+cp_parser_save_nsdmi (cp_parser* parser)
+{
+ /* Save away the tokens that make up the body of the
+ function. */
+ cp_token *first = parser->lexer->next_token;
+ cp_token *last;
+ tree node;
+
+ cp_parser_cache_group (parser, CPP_CLOSE_PAREN, /*depth=*/0);
+
+ last = parser->lexer->next_token;
+
+ node = make_node (DEFAULT_ARG);
+ DEFARG_TOKENS (node) = cp_token_cache_new (first, last);
+ DEFARG_INSTANTIATIONS (node) = NULL;
+
+ return node;
+}
+
+
/* Parse a template-argument-list, as well as the trailing ">" (but
not the opening ">"). See cp_parser_template_argument_list for the
return value. */
@@ -20738,6 +20832,83 @@ cp_parser_save_default_args (cp_parser* parser, tree decl)
}
}
+/* DEFAULT_ARG contains the saved tokens for the initializer of DECL,
+ which is either a FIELD_DECL or PARM_DECL. Parse it and return
+ the result. For a PARM_DECL, PARMTYPE is the corresponding type
+ from the parameter-type-list. */
+
+static tree
+cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl,
+ tree default_arg, tree parmtype)
+{
+ cp_token_cache *tokens;
+ tree parsed_arg;
+ bool dummy;
+
+ /* Push the saved tokens for the default argument onto the parser's
+ lexer stack. */
+ tokens = DEFARG_TOKENS (default_arg);
+ cp_parser_push_lexer_for_tokens (parser, tokens);
+
+ start_lambda_scope (decl);
+
+ /* Parse the default argument. */
+ parsed_arg = cp_parser_initializer (parser, &dummy, &dummy);
+ if (BRACE_ENCLOSED_INITIALIZER_P (parsed_arg))
+ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
+
+ finish_lambda_scope ();
+
+ if (!processing_template_decl)
+ {
+ /* In a non-template class, check conversions now. In a template,
+ we'll wait and instantiate these as needed. */
+ if (TREE_CODE (decl) == PARM_DECL)
+ parsed_arg = check_default_argument (parmtype, parsed_arg);
+ else
+ {
+ int flags = LOOKUP_IMPLICIT;
+ if (BRACE_ENCLOSED_INITIALIZER_P (parsed_arg)
+ && CONSTRUCTOR_IS_DIRECT_INIT (parsed_arg))
+ flags = LOOKUP_NORMAL;
+ parsed_arg = digest_init_flags (TREE_TYPE (decl), parsed_arg, flags);
+ }
+ }
+
+ /* If the token stream has not been completely used up, then
+ there was extra junk after the end of the default
+ argument. */
+ if (!cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ {
+ if (TREE_CODE (decl) == PARM_DECL)
+ cp_parser_error (parser, "expected %<,%>");
+ else
+ cp_parser_error (parser, "expected %<;%>");
+ }
+
+ /* Revert to the main lexer. */
+ cp_parser_pop_lexer (parser);
+
+ return parsed_arg;
+}
+
+/* FIELD is a non-static data member with an initializer which we saved for
+ later; parse it now. */
+
+static void
+cp_parser_late_parsing_nsdmi (cp_parser *parser, tree field)
+{
+ tree def;
+
+ push_unparsed_function_queues (parser);
+ def = cp_parser_late_parse_one_default_arg (parser, field,
+ DECL_INITIAL (field),
+ NULL_TREE);
+ pop_unparsed_function_queues (parser);
+
+ DECL_INITIAL (field) = def;
+}
+
/* FN is a FUNCTION_DECL which may contains a parameter with an
unparsed DEFAULT_ARG. Parse the default args now. This function
assumes that the current scope is the scope in which the default
@@ -20747,7 +20918,6 @@ static void
cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
{
bool saved_local_variables_forbidden_p;
- bool non_constant_p;
tree parm, parmdecl;
/* While we're parsing the default args, we might (due to the
@@ -20769,7 +20939,6 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
parm = TREE_CHAIN (parm),
parmdecl = DECL_CHAIN (parmdecl))
{
- cp_token_cache *tokens;
tree default_arg = TREE_PURPOSE (parm);
tree parsed_arg;
VEC(tree,gc) *insts;
@@ -20784,25 +20953,14 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
already declared with default arguments. */
continue;
- /* Push the saved tokens for the default argument onto the parser's
- lexer stack. */
- tokens = DEFARG_TOKENS (default_arg);
- cp_parser_push_lexer_for_tokens (parser, tokens);
-
- start_lambda_scope (parmdecl);
-
- /* Parse the assignment-expression. */
- parsed_arg = cp_parser_initializer_clause (parser, &non_constant_p);
+ parsed_arg
+ = cp_parser_late_parse_one_default_arg (parser, parmdecl,
+ default_arg,
+ TREE_VALUE (parm));
if (parsed_arg == error_mark_node)
{
- cp_parser_pop_lexer (parser);
continue;
}
- if (BRACE_ENCLOSED_INITIALIZER_P (parsed_arg))
- maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
-
- if (!processing_template_decl)
- parsed_arg = check_default_argument (TREE_VALUE (parm), parsed_arg);
TREE_PURPOSE (parm) = parsed_arg;
@@ -20810,17 +20968,6 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
for (insts = DEFARG_INSTANTIATIONS (default_arg), ix = 0;
VEC_iterate (tree, insts, ix, copy); ix++)
TREE_PURPOSE (copy) = parsed_arg;
-
- finish_lambda_scope ();
-
- /* If the token stream has not been completely used up, then
- there was extra junk after the end of the default
- argument. */
- if (!cp_lexer_next_token_is (parser->lexer, CPP_EOF))
- cp_parser_error (parser, "expected %<,%>");
-
- /* Revert to the main lexer. */
- cp_parser_pop_lexer (parser);
}
pop_defarg_context ();
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index 33582fbc0f1..e08c0b415a0 100644
--- a/gcc/cp/parser.h
+++ b/gcc/cp/parser.h
@@ -169,6 +169,10 @@ typedef struct GTY(()) cp_unparsed_functions_entry_d {
/* Functions with defintions that require post-processing. Functions
appear in this list in declaration order. */
VEC(tree,gc) *funs_with_definitions;
+
+ /* Non-static data members with initializers that require post-processing.
+ FIELD_DECLs appear in this list in declaration order. */
+ VEC(tree,gc) *nsdmis;
} cp_unparsed_functions_entry;
DEF_VEC_O(cp_unparsed_functions_entry);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ee33daf1fb9..4d57f94d2b1 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5951,6 +5951,16 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
if (expr == error_mark_node)
return expr;
}
+ else if (NULLPTR_TYPE_P (type))
+ {
+ if (expr != nullptr_node)
+ {
+ error ("%qE is not a valid template argument for type %qT "
+ "because it is of type %qT", expr, type, TREE_TYPE (expr));
+ return NULL_TREE;
+ }
+ return expr;
+ }
/* A template non-type parameter must be one of the above. */
else
gcc_unreachable ();
@@ -10264,11 +10274,14 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
TREE_TYPE (r) = type;
cp_apply_type_quals_to_decl (cp_type_quals (type), r);
- /* DECL_INITIAL gives the number of bits in a bit-field. */
- DECL_INITIAL (r)
- = tsubst_expr (DECL_INITIAL (t), args,
- complain, in_decl,
- /*integral_constant_expression_p=*/true);
+ if (DECL_C_BIT_FIELD (r))
+ /* For bit-fields, DECL_INITIAL gives the number of bits. For
+ non-bit-fields DECL_INITIAL is a non-static data member
+ initializer, which gets deferred instantiation. */
+ DECL_INITIAL (r)
+ = tsubst_expr (DECL_INITIAL (t), args,
+ complain, in_decl,
+ /*integral_constant_expression_p=*/true);
/* We don't have to set DECL_CONTEXT here; it is set by
finish_member_declaration. */
DECL_CHAIN (r) = NULL_TREE;
@@ -11737,6 +11750,13 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (r == NULL)
{
tree c;
+
+ /* We get here for a use of 'this' in an NSDMI. */
+ if (DECL_NAME (t) == this_identifier
+ && at_function_scope_p ()
+ && DECL_CONSTRUCTOR_P (current_function_decl))
+ return current_class_ptr;
+
/* This can happen for a parameter name used later in a function
declaration (such as in a late-specified return type). Just
make a dummy decl, since it's only used for its type. */
@@ -13896,7 +13916,7 @@ tsubst_copy_and_build (tree t,
t = tsubst_copy (t, args, complain, in_decl);
/* As in finish_id_expression, we resolve enumeration constants
to their underlying values. */
- if (TREE_CODE (t) == CONST_DECL)
+ if (TREE_CODE (t) == CONST_DECL && !processing_template_decl)
{
used_types_insert (TREE_TYPE (t));
return DECL_INITIAL (t);
@@ -18717,6 +18737,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0;
else if (TREE_CODE (type) == DECLTYPE_TYPE)
return 0;
+ else if (TREE_CODE (type) == NULLPTR_TYPE)
+ return 0;
if (complain & tf_error)
error ("%q#T is not a valid type for a template constant parameter", type);
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 16a192e4de9..ca971b61b59 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -263,7 +263,8 @@ finish_repo (void)
anonymous namespaces will get the same mangling when this
file is recompiled. */
if (!strstr (args, "'-frandom-seed="))
- fprintf (repo_file, " '-frandom-seed=%s'", get_random_seed (false));
+ fprintf (repo_file, " '-frandom-seed=" HOST_WIDE_INT_PRINT_HEX_PURE "'",
+ get_random_seed (false));
fprintf (repo_file, "\n");
}
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 434b7725ba8..818b8d0eee4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1,6 +1,6 @@
/* RunTime Type Identification
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Mostly written by Jason Merrill (jason@cygnus.com).
@@ -616,7 +616,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
if (binfo)
{
expr = build_base_path (PLUS_EXPR, convert_from_reference (expr),
- binfo, 0);
+ binfo, 0, complain);
if (TREE_CODE (exprtype) == POINTER_TYPE)
expr = rvalue (expr);
return expr;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f782df9ec36..7ad1e8d5ebd 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2312,19 +2312,6 @@ tree
finish_unary_op_expr (enum tree_code code, tree expr)
{
tree result = build_x_unary_op (code, expr, tf_warning_or_error);
- /* Inside a template, build_x_unary_op does not fold the
- expression. So check whether the result is folded before
- setting TREE_NEGATED_INT. */
- if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST
- && TREE_CODE (result) == INTEGER_CST
- && !TYPE_UNSIGNED (TREE_TYPE (result))
- && INT_CST_LT (result, integer_zero_node))
- {
- /* RESULT may be a cached INTEGER_CST, so we must copy it before
- setting TREE_NEGATED_INT. */
- result = copy_node (result);
- TREE_NEGATED_INT (result) = 1;
- }
if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr))
overflow_warning (input_location, result);
@@ -3559,7 +3546,7 @@ emit_associated_thunks (tree fn)
static inline bool
is_instantiation_of_constexpr (tree fun)
{
- return (DECL_TEMPLATE_INFO (fun)
+ return (DECL_TEMPLOID_INSTANTIATION (fun)
&& DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT
(DECL_TI_TEMPLATE (fun))));
}
@@ -5820,26 +5807,26 @@ register_constexpr_fundef (tree fun, tree body)
constexpr_fundef entry;
constexpr_fundef **slot;
- if (!is_valid_constexpr_fn (fun, !DECL_TEMPLATE_INFO (fun)))
+ if (!is_valid_constexpr_fn (fun, !DECL_GENERATED_P (fun)))
return NULL;
body = massage_constexpr_body (fun, body);
if (body == NULL_TREE || body == error_mark_node)
{
- error ("body of constexpr function %qD not a return-statement", fun);
- DECL_DECLARED_CONSTEXPR_P (fun) = false;
+ if (!DECL_CONSTRUCTOR_P (fun))
+ error ("body of constexpr function %qD not a return-statement", fun);
return NULL;
}
if (!potential_rvalue_constant_expression (body))
{
- if (!DECL_TEMPLATE_INFO (fun))
+ if (!DECL_GENERATED_P (fun))
require_potential_rvalue_constant_expression (body);
return NULL;
}
if (DECL_CONSTRUCTOR_P (fun)
- && cx_check_missing_mem_inits (fun, body, !DECL_TEMPLATE_INFO (fun)))
+ && cx_check_missing_mem_inits (fun, body, !DECL_GENERATED_P (fun)))
return NULL;
/* Create the constexpr function table if necessary. */
@@ -6245,7 +6232,7 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t,
{
if (!allow_non_constant)
{
- if (DECL_SAVED_TREE (fun))
+ if (DECL_INITIAL (fun))
{
/* The definition of fun was somehow unsuitable. */
error_at (loc, "%qD called in a constant expression", fun);
@@ -6680,9 +6667,9 @@ cxx_eval_logical_expression (const constexpr_call *call, tree t,
allow_non_constant, addr,
non_constant_p);
VERIFY_CONSTANT (lhs);
- if (lhs == bailout_value)
+ if (tree_int_cst_equal (lhs, bailout_value))
return lhs;
- gcc_assert (lhs == continue_value);
+ gcc_assert (tree_int_cst_equal (lhs, continue_value));
r = cxx_eval_constant_expression (call, TREE_OPERAND (t, 1),
allow_non_constant, addr, non_constant_p);
VERIFY_CONSTANT (r);
@@ -7751,6 +7738,7 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
/* We can see a FIELD_DECL in a pointer-to-member expression. */
case FIELD_DECL:
case PARM_DECL:
+ case USING_DECL:
return true;
case AGGR_INIT_EXPR:
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 998795302c3..f23b888f376 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1865,9 +1865,13 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
if (!TYPE_P (t) && TREE_CONSTANT (t) && !TREE_SIDE_EFFECTS (t))
{
- /* There can't be any TARGET_EXPRs or their slot variables below
- this point. */
+ /* There can't be any TARGET_EXPRs or their slot variables below this
+ point. But we must make a copy, in case subsequent processing
+ alters any part of it. For example, during gimplification a cast
+ of the form (T) &X::f (where "f" is a member function) will lead
+ to replacing the PTRMEM_CST for &X::f with a VAR_DECL. */
*walk_subtrees = 0;
+ *tp = unshare_expr (t);
return NULL_TREE;
}
if (TREE_CODE (t) == TARGET_EXPR)
@@ -1922,14 +1926,21 @@ bot_replace (tree* t,
if (n)
*t = (tree) n->value;
}
+ else if (TREE_CODE (*t) == PARM_DECL
+ && DECL_NAME (*t) == this_identifier)
+ {
+ /* In an NSDMI we need to replace the 'this' parameter we used for
+ parsing with the real one for this function. */
+ *t = current_class_ptr;
+ }
return NULL_TREE;
}
/* When we parse a default argument expression, we may create
temporary variables via TARGET_EXPRs. When we actually use the
- default-argument expression, we make a copy of the expression, but
- we must replace the temporaries with appropriate local versions. */
+ default-argument expression, we make a copy of the expression
+ and replace the temporaries with appropriate local versions. */
tree
break_out_target_exprs (tree t)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ed52f3c4f3f..d416b42db3b 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1300,7 +1300,9 @@ structural_comptypes (tree t1, tree t2, int strict)
if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
TYPENAME_TYPE_FULLNAME (t2)))
return false;
- if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2)))
+ /* Qualifiers don't matter on scopes. */
+ if (!same_type_ignoring_top_level_qualifiers_p (TYPE_CONTEXT (t1),
+ TYPE_CONTEXT (t2)))
return false;
break;
@@ -2221,7 +2223,7 @@ build_class_member_access_expr (tree object, tree member,
/* Convert to the base. */
object = build_base_path (PLUS_EXPR, object, binfo,
- /*nonnull=*/1);
+ /*nonnull=*/1, complain);
/* If we found the base successfully then we should be able
to convert to it successfully. */
gcc_assert (object != error_mark_node);
@@ -3073,7 +3075,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
basetype = lookup_base (TREE_TYPE (TREE_TYPE (instance_ptr)),
basetype, ba_check, NULL);
instance_ptr = build_base_path (PLUS_EXPR, instance_ptr, basetype,
- 1);
+ 1, tf_warning_or_error);
if (instance_ptr == error_mark_node)
return error_mark_node;
}
@@ -4187,9 +4189,19 @@ cp_build_binary_op (location_t location,
result_type = composite_pointer_type (type0, type1, op0, op1,
CPO_COMPARISON, complain);
else if (code0 == POINTER_TYPE && null_ptr_cst_p (op1))
- result_type = type0;
+ {
+ result_type = type0;
+ if (extra_warnings && (complain & tf_warning))
+ warning (OPT_Wextra,
+ "ordered comparison of pointer with integer zero");
+ }
else if (code1 == POINTER_TYPE && null_ptr_cst_p (op0))
- result_type = type1;
+ {
+ result_type = type1;
+ if (extra_warnings && (complain & tf_warning))
+ warning (OPT_Wextra,
+ "ordered comparison of pointer with integer zero");
+ }
else if (null_ptr_cst_p (op0) && null_ptr_cst_p (op1))
/* One of the operands must be of nullptr_t type. */
result_type = TREE_TYPE (nullptr_node);
@@ -5772,7 +5784,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
/* 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);
+ base, /*nonnull=*/false, complain);
/* Convert the pointer to a reference -- but then remember that
there are no expressions with reference type in C++.
@@ -5874,7 +5886,8 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
base = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
c_cast_p ? ba_unique : ba_check,
NULL);
- expr = build_base_path (MINUS_EXPR, expr, base, /*nonnull=*/false);
+ expr = build_base_path (MINUS_EXPR, expr, base, /*nonnull=*/false,
+ complain);
return cp_fold_convert(type, expr);
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 1c0bb38a8b8..96b95c2b5ce 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1398,7 +1398,8 @@ build_scoped_ref (tree datum, tree basetype, tree* binfo_p)
}
*binfo_p = binfo;
- return build_base_path (PLUS_EXPR, datum, binfo, 1);
+ return build_base_path (PLUS_EXPR, datum, binfo, 1,
+ tf_warning_or_error);
}
/* Build a reference to an object specified by the C++ `->' operator.
@@ -1565,7 +1566,8 @@ build_m_component_ref (tree datum, tree component)
/* Convert object to the correct base. */
if (binfo)
- datum = build_base_path (PLUS_EXPR, datum, binfo, 1);
+ datum = build_base_path (PLUS_EXPR, datum, binfo, 1,
+ tf_warning_or_error);
/* Build an expression for "object + offset" where offset is the
value stored in the pointer-to-data-member. */
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 856fa4e6800..2b1cfe827b9 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -145,6 +145,27 @@ mem_access_insn_p (rtx insn)
return rtx_mem_access_p (PATTERN (insn));
}
+/* Return true if DEF_INSN contains address being auto-inc or auto-dec
+ which is used in USE_INSN. Otherwise return false. The result is
+ being used to decide whether to remove the edge between def_insn and
+ use_insn when -fmodulo-sched-allow-regmoves is set. This function
+ doesn't need to consider the specific address register; no reg_moves
+ will be allowed for any life range defined by def_insn and used
+ by use_insn, if use_insn uses an address register auto-inc'ed by
+ def_insn. */
+bool
+autoinc_var_is_used_p (rtx def_insn, rtx use_insn)
+{
+ rtx note;
+
+ for (note = REG_NOTES (def_insn); note; note = XEXP (note, 1))
+ if (REG_NOTE_KIND (note) == REG_INC
+ && reg_referenced_p (XEXP (note, 0), PATTERN (use_insn)))
+ return true;
+
+ return false;
+}
+
/* Computes the dependence parameters (latency, distance etc.), creates
a ddg_edge and adds it to the given DDG. */
static void
@@ -173,10 +194,15 @@ create_ddg_dep_from_intra_loop_link (ddg_ptr g, ddg_node_ptr src_node,
compensate for that by generating reg-moves based on the life-range
analysis. The anti-deps that will be deleted are the ones which
have true-deps edges in the opposite direction (in other words
- the kernel has only one def of the relevant register). TODO:
- support the removal of all anti-deps edges, i.e. including those
+ the kernel has only one def of the relevant register).
+ If the address that is being auto-inc or auto-dec in DEST_NODE
+ is used in SRC_NODE then do not remove the edge to make sure
+ reg-moves will not be created for this address.
+ TODO: support the removal of all anti-deps edges, i.e. including those
whose register has multiple defs in the loop. */
- if (flag_modulo_sched_allow_regmoves && (t == ANTI_DEP && dt == REG_DEP))
+ if (flag_modulo_sched_allow_regmoves
+ && (t == ANTI_DEP && dt == REG_DEP)
+ && !autoinc_var_is_used_p (dest_node->insn, src_node->insn))
{
rtx set;
@@ -302,10 +328,14 @@ add_cross_iteration_register_deps (ddg_ptr g, df_ref last_def)
gcc_assert (first_def_node);
/* Always create the edge if the use node is a branch in
- order to prevent the creation of reg-moves. */
+ order to prevent the creation of reg-moves.
+ If the address that is being auto-inc or auto-dec in LAST_DEF
+ is used in USE_INSN then do not remove the edge to make sure
+ reg-moves will not be created for that address. */
if (DF_REF_ID (last_def) != DF_REF_ID (first_def)
|| !flag_modulo_sched_allow_regmoves
- || JUMP_P (use_node->insn))
+ || JUMP_P (use_node->insn)
+ || autoinc_var_is_used_p (DF_REF_INSN (last_def), use_insn))
create_ddg_dep_no_link (g, use_node, first_def_node, ANTI_DEP,
REG_DEP, 1);
diff --git a/gcc/ddg.h b/gcc/ddg.h
index e17e534af4d..8452a366253 100644
--- a/gcc/ddg.h
+++ b/gcc/ddg.h
@@ -186,4 +186,6 @@ void free_ddg_all_sccs (ddg_all_sccs_ptr);
int find_nodes_on_paths (sbitmap result, ddg_ptr, sbitmap from, sbitmap to);
int longest_simple_path (ddg_ptr, int from, int to, sbitmap via);
+bool autoinc_var_is_used_p (rtx, rtx);
+
#endif /* GCC_DDG_H */
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 75f4874ad1f..1c688dcf60a 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -6561,6 +6561,29 @@ invoke undefined behavior at runtime. Warnings for out of bound
accesses for vector subscription can be enabled with
@option{-Warray-bounds}.
+In GNU C vector comparison is supported within standard comparison
+operators: @code{==, !=, <, <=, >, >=}. Comparison operands can be
+vector expressions of integer-type or real-type. Comparison between
+integer-type vectors and real-type vectors are not supported. The
+result of the comparison is a vector of the same width and number of
+elements as the comparison operands with a signed integral element
+type.
+
+Vectors are compared element-wise producing 0 when comparison is false
+and -1 (constant of the appropriate type where all bits are set)
+otherwise. Consider the following example.
+
+@smallexample
+typedef int v4si __attribute__ ((vector_size (16)));
+
+v4si a = @{1,2,3,4@};
+v4si b = @{3,2,1,4@};
+v4si c;
+
+c = a > b; /* The result would be @{0, 0,-1, 0@} */
+c = a == b; /* The result would be @{0,-1, 0,-1@} */
+@end smallexample
+
You can declare variables and use them in function calls and returns, as
well as in assignments and some casts. You can specify a vector type as
a return type for a function. Vector types can also be used as function
@@ -6699,8 +6722,8 @@ return the new value. That is,
builtin as @code{*ptr = ~(*ptr & value)} instead of
@code{*ptr = ~*ptr & value}.
-@item bool __sync_bool_compare_and_swap (@var{type} *ptr, @var{type} oldval @var{type} newval, ...)
-@itemx @var{type} __sync_val_compare_and_swap (@var{type} *ptr, @var{type} oldval @var{type} newval, ...)
+@item bool __sync_bool_compare_and_swap (@var{type} *ptr, @var{type} oldval, @var{type} newval, ...)
+@itemx @var{type} __sync_val_compare_and_swap (@var{type} *ptr, @var{type} oldval, @var{type} newval, ...)
@findex __sync_bool_compare_and_swap
@findex __sync_val_compare_and_swap
These builtins perform an atomic compare and swap. That is, if the current
@@ -12929,13 +12952,18 @@ the SPARC Visual Instruction Set (VIS). When you use the @option{-mvis}
switch, the VIS extension is exposed as the following built-in functions:
@smallexample
+typedef int v1si __attribute__ ((vector_size (4)));
typedef int v2si __attribute__ ((vector_size (8)));
typedef short v4hi __attribute__ ((vector_size (8)));
typedef short v2hi __attribute__ ((vector_size (4)));
-typedef char v8qi __attribute__ ((vector_size (8)));
-typedef char v4qi __attribute__ ((vector_size (4)));
+typedef unsigned char v8qi __attribute__ ((vector_size (8)));
+typedef unsigned char v4qi __attribute__ ((vector_size (4)));
+
+void __builtin_vis_write_gsr (int64_t);
+int64_t __builtin_vis_read_gsr (void);
void * __builtin_vis_alignaddr (void *, long);
+void * __builtin_vis_alignaddrl (void *, long);
int64_t __builtin_vis_faligndatadi (int64_t, int64_t);
v2si __builtin_vis_faligndatav2si (v2si, v2si);
v4hi __builtin_vis_faligndatav4hi (v4si, v4si);
@@ -12944,26 +12972,107 @@ v8qi __builtin_vis_faligndatav8qi (v8qi, v8qi);
v4hi __builtin_vis_fexpand (v4qi);
v4hi __builtin_vis_fmul8x16 (v4qi, v4hi);
-v4hi __builtin_vis_fmul8x16au (v4qi, v4hi);
-v4hi __builtin_vis_fmul8x16al (v4qi, v4hi);
+v4hi __builtin_vis_fmul8x16au (v4qi, v2hi);
+v4hi __builtin_vis_fmul8x16al (v4qi, v2hi);
v4hi __builtin_vis_fmul8sux16 (v8qi, v4hi);
v4hi __builtin_vis_fmul8ulx16 (v8qi, v4hi);
v2si __builtin_vis_fmuld8sux16 (v4qi, v2hi);
v2si __builtin_vis_fmuld8ulx16 (v4qi, v2hi);
v4qi __builtin_vis_fpack16 (v4hi);
-v8qi __builtin_vis_fpack32 (v2si, v2si);
+v8qi __builtin_vis_fpack32 (v2si, v8qi);
v2hi __builtin_vis_fpackfix (v2si);
v8qi __builtin_vis_fpmerge (v4qi, v4qi);
int64_t __builtin_vis_pdist (v8qi, v8qi, int64_t);
-int64_t __builtin_vis_edge8 (int64_t, int64_t);
-int64_t __builtin_vis_edge8l (int64_t, int64_t);
-int64_t __builtin_vis_edge16 (int64_t, int64_t);
-int64_t __builtin_vis_edge16l (int64_t, int64_t);
-int64_t __builtin_vis_edge32 (int64_t, int64_t);
-int64_t __builtin_vis_edge32l (int64_t, int64_t);
+long __builtin_vis_edge8 (void *, void *);
+long __builtin_vis_edge8l (void *, void *);
+long __builtin_vis_edge16 (void *, void *);
+long __builtin_vis_edge16l (void *, void *);
+long __builtin_vis_edge32 (void *, void *);
+long __builtin_vis_edge32l (void *, void *);
+
+long __builtin_vis_fcmple16 (v4hi, v4hi);
+long __builtin_vis_fcmple32 (v2si, v2si);
+long __builtin_vis_fcmpne16 (v4hi, v4hi);
+long __builtin_vis_fcmpne32 (v2si, v2si);
+long __builtin_vis_fcmpgt16 (v4hi, v4hi);
+long __builtin_vis_fcmpgt32 (v2si, v2si);
+long __builtin_vis_fcmpeq16 (v4hi, v4hi);
+long __builtin_vis_fcmpeq32 (v2si, v2si);
+
+v4hi __builtin_vis_fpadd16 (v4hi, v4hi);
+v2hi __builtin_vis_fpadd16s (v2hi, v2hi);
+v2si __builtin_vis_fpadd32 (v2si, v2si);
+v1si __builtin_vis_fpadd32s (v1si, v1si);
+v4hi __builtin_vis_fpsub16 (v4hi, v4hi);
+v2hi __builtin_vis_fpsub16s (v2hi, v2hi);
+v2si __builtin_vis_fpsub32 (v2si, v2si);
+v1si __builtin_vis_fpsub32s (v1si, v1si);
+
+long __builtin_vis_array8 (long, long);
+long __builtin_vis_array16 (long, long);
+long __builtin_vis_array32 (long, long);
+@end smallexample
+
+When you use the @option{-mvis2} switch, the VIS version 2.0 built-in
+functions also become available:
+
+@smallexample
+long __builtin_vis_bmask (long, long);
+int64_t __builtin_vis_bshuffledi (int64_t, int64_t);
+v2si __builtin_vis_bshufflev2si (v2si, v2si);
+v4hi __builtin_vis_bshufflev2si (v4hi, v4hi);
+v8qi __builtin_vis_bshufflev2si (v8qi, v8qi);
+
+long __builtin_vis_edge8n (void *, void *);
+long __builtin_vis_edge8ln (void *, void *);
+long __builtin_vis_edge16n (void *, void *);
+long __builtin_vis_edge16ln (void *, void *);
+long __builtin_vis_edge32n (void *, void *);
+long __builtin_vis_edge32ln (void *, void *);
+@end smallexample
+
+When you use the @option{-mvis3} switch, the VIS version 3.0 built-in
+functions also become available:
+
+@smallexample
+void __builtin_vis_cmask8 (long);
+void __builtin_vis_cmask16 (long);
+void __builtin_vis_cmask32 (long);
+
+v4hi __builtin_vis_fchksm16 (v4hi, v4hi);
+
+v4hi __builtin_vis_fsll16 (v4hi, v4hi);
+v4hi __builtin_vis_fslas16 (v4hi, v4hi);
+v4hi __builtin_vis_fsrl16 (v4hi, v4hi);
+v4hi __builtin_vis_fsra16 (v4hi, v4hi);
+v2si __builtin_vis_fsll16 (v2si, v2si);
+v2si __builtin_vis_fslas16 (v2si, v2si);
+v2si __builtin_vis_fsrl16 (v2si, v2si);
+v2si __builtin_vis_fsra16 (v2si, v2si);
+
+long __builtin_vis_pdistn (v8qi, v8qi);
+
+v4hi __builtin_vis_fmean16 (v4hi, v4hi);
+
+int64_t __builtin_vis_fpadd64 (int64_t, int64_t);
+int64_t __builtin_vis_fpsub64 (int64_t, int64_t);
+
+v4hi __builtin_vis_fpadds16 (v4hi, v4hi);
+v2hi __builtin_vis_fpadds16s (v2hi, v2hi);
+v4hi __builtin_vis_fpsubs16 (v4hi, v4hi);
+v2hi __builtin_vis_fpsubs16s (v2hi, v2hi);
+v2si __builtin_vis_fpadds32 (v2si, v2si);
+v1si __builtin_vis_fpadds32s (v1si, v1si);
+v2si __builtin_vis_fpsubs32 (v2si, v2si);
+v1si __builtin_vis_fpsubs32s (v1si, v1si);
+
+long __builtin_vis_fucmple8 (v8qi, v8qi);
+long __builtin_vis_fucmpne8 (v8qi, v8qi);
+long __builtin_vis_fucmpgt8 (v8qi, v8qi);
+long __builtin_vis_fucmpeq8 (v8qi, v8qi);
@end smallexample
@node SPU Built-in Functions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 801093f7493..5482ce8c266 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -355,8 +355,8 @@ Objective-C and Objective-C++ Dialects}.
-fcx-limited-range @gol
-fdata-sections -fdce -fdce -fdelayed-branch @gol
-fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
--fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
--ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
+-fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
+-ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
-fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
-fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
@@ -407,7 +407,7 @@ Objective-C and Objective-C++ Dialects}.
-ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
--ftree-sink -ftree-sra -ftree-switch-conversion @gol
+-ftree-sink -ftree-sra -ftree-switch-conversion -ftree-tail-merge @gol
-ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
-funit-at-a-time -funroll-all-loops -funroll-loops @gol
-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
@@ -879,7 +879,9 @@ See RS/6000 and PowerPC Options.
-mlittle-endian @gol
-mstack-bias -mno-stack-bias @gol
-munaligned-doubles -mno-unaligned-doubles @gol
--mv8plus -mno-v8plus -mvis -mno-vis}
+-mv8plus -mno-v8plus -mvis -mno-vis @gol
+-mvis2 -mno-vis2 -mvis3 -mno-vis3 @gol
+-mfmaf -mno-fmaf}
@emph{SPU Options}
@gccoptlist{-mwarn-reloc -merror-reloc @gol
@@ -6145,7 +6147,7 @@ also turns on the following optimization flags:
-fsched-interblock -fsched-spec @gol
-fschedule-insns -fschedule-insns2 @gol
-fstrict-aliasing -fstrict-overflow @gol
--ftree-switch-conversion @gol
+-ftree-switch-conversion -ftree-tail-merge @gol
-ftree-pre @gol
-ftree-vrp}
@@ -7028,6 +7030,13 @@ Perform conversion of simple initializations in a switch to
initializations from a scalar array. This flag is enabled by default
at @option{-O2} and higher.
+@item -ftree-tail-merge
+Look for identical code sequences. When found, replace one with a jump to the
+other. This optimization is known as tail merging or cross jumping. This flag
+is enabled by default at @option{-O2} and higher. The run time of this pass can
+be limited using @option{max-tail-merge-comparisons} parameter and
+@option{max-tail-merge-iterations} parameter.
+
@item -ftree-dce
@opindex ftree-dce
Perform dead code elimination (DCE) on trees. This flag is enabled by
@@ -7899,6 +7908,22 @@ use it.
Enabled by default when LTO support in GCC is enabled and GCC was compiled
with a linker supporting plugins (GNU ld 2.21 or newer or gold).
+@item -ffat-lto-objects
+@opindex ffat-lto-objects
+Fat LTO objects are object files that contain both the intermediate language
+and the object code. This makes them useable for both LTO linking and normal
+linking. This option makes effect only with @option{-flto} and is ignored
+at linktime.
+
+@option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
+requires the complete toolchain to be aware of LTO. It requires a linker with
+linker plugin support for basic functionality. Additionally, nm, ar and ranlib
+need to support linker plugins to allow a full-featured build environment
+(capable of building static libraries etc).
+
+The default is @option{-ffat-lto-objects} but this default is intended to
+change in future releases when linker plugin enabled environments become more
+common.
@item -fcompare-elim
@opindex fcompare-elim
After register allocation and post-register allocation instruction splitting,
@@ -8459,6 +8484,11 @@ before flushing the current state and starting over. Large functions
with few branches or calls can create excessively large lists which
needlessly consume memory and resources.
+@item max-modulo-backtrack-attempts
+The maximum number of backtrack attempts the scheduler should make
+when modulo scheduling a loop. Larger values can exponentially increase
+compile time.
+
@item max-inline-insns-single
Several parameters control the tree inliner used in gcc.
This number sets the maximum number of instructions (counted in GCC's
@@ -8595,6 +8625,14 @@ This is used to avoid quadratic behavior in hoisting algorithm.
The value of 0 will avoid limiting the search, but may slow down compilation
of huge functions. The default value is 30.
+@item max-tail-merge-comparisons
+The maximum amount of similar bbs to compare a bb with. This is used to
+avoid quadratic behaviour in tree tail merging. The default value is 10.
+
+@item max-tail-merge-iterations
+The maximum amount of iterations of the pass over the function. This is used to
+limit run time in tree tail merging. The default value is 2.
+
@item max-unrolled-insns
The maximum number of instructions that a loop should have if that loop
is unrolled, and if the loop is unrolled, it determines how many times
@@ -17406,6 +17444,35 @@ mode for all SPARC-V9 processors.
@opindex mno-vis
With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
Visual Instruction Set extensions. The default is @option{-mno-vis}.
+
+@item -mvis2
+@itemx -mno-vis2
+@opindex mvis2
+@opindex mno-vis2
+With @option{-mvis2}, GCC generates code that takes advantage of
+version 2.0 of the UltraSPARC Visual Instruction Set extensions. The
+default is @option{-mvis2} when targetting a cpu that supports such
+instructions, such as UltraSPARC-III and later. Setting @option{-mvis2}
+also sets @option{-mvis}.
+
+@item -mvis3
+@itemx -mno-vis3
+@opindex mvis3
+@opindex mno-vis3
+With @option{-mvis3}, GCC generates code that takes advantage of
+version 3.0 of the UltraSPARC Visual Instruction Set extensions. The
+default is @option{-mvis3} when targetting a cpu that supports such
+instructions, such as niagara-3 and later. Setting @option{-mvis3}
+also sets @option{-mvis2} and @option{-mvis}.
+
+@item -mfmaf
+@itemx -mno-fmaf
+@opindex mfmaf
+@opindex mno-fmaf
+With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
+Fused Multiply-Add Floating-point extensions. The default is @option{-mfmaf}
+when targetting a cpu that supports such instructions, such as Niagara-3 and
+later.
@end table
These @samp{-m} options are supported in addition to the above
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 335c1d1f51d..7143f0f1c92 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -10256,7 +10256,7 @@ hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook,
except that it includes explicit named address space support.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t @var{superset}, addr_space_t @var{subset})
+@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t @var{subset}, addr_space_t @var{superset})
Define this to return whether the @var{subset} named address space is
contained within the @var{superset} named address space. Pointers to
a named address space that is a subset of another named address space
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index ee38d3c90b0..dae7669297a 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -93,9 +93,10 @@ static GTY(()) int label_num = 1;
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
- record a copy of const[012]_rtx. */
+ record a copy of const[012]_rtx and constm1_rtx. CONSTM1_RTX
+ is set only for MODE_INT and MODE_VECTOR_INT modes. */
-rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
+rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
rtx const_true_rtx;
@@ -5514,6 +5515,8 @@ gen_rtx_CONST_VECTOR (enum machine_mode mode, rtvec v)
return CONST0_RTX (mode);
else if (x == CONST1_RTX (inner))
return CONST1_RTX (mode);
+ else if (x == CONSTM1_RTX (inner))
+ return CONSTM1_RTX (mode);
}
return gen_rtx_raw_CONST_VECTOR (mode, v);
@@ -5674,7 +5677,7 @@ init_emit_once (void)
dconsthalf = dconst1;
SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1);
- for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++)
+ for (i = 0; i < 3; i++)
{
const REAL_VALUE_TYPE *const r =
(i == 0 ? &dconst0 : i == 1 ? &dconst1 : &dconst2);
@@ -5704,6 +5707,13 @@ init_emit_once (void)
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
}
+ const_tiny_rtx[3][(int) VOIDmode] = constm1_rtx;
+
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ const_tiny_rtx[3][(int) mode] = constm1_rtx;
+
for (mode = GET_CLASS_NARROWEST_MODE (MODE_COMPLEX_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
@@ -5726,6 +5736,7 @@ init_emit_once (void)
{
const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
+ const_tiny_rtx[3][(int) mode] = gen_const_vector (mode, 3);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
diff --git a/gcc/expr.c b/gcc/expr.c
index 29bf68b6723..97edd460019 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -10309,6 +10309,17 @@ do_store_flag (sepops ops, rtx target, enum machine_mode mode)
STRIP_NOPS (arg0);
STRIP_NOPS (arg1);
+ /* For vector typed comparisons emit code to generate the desired
+ all-ones or all-zeros mask. Conveniently use the VEC_COND_EXPR
+ expander for this. */
+ if (TREE_CODE (ops->type) == VECTOR_TYPE)
+ {
+ tree ifexp = build2 (ops->code, ops->type, arg0, arg1);
+ tree if_true = constant_boolean_node (true, ops->type);
+ tree if_false = constant_boolean_node (false, ops->type);
+ return expand_vec_cond_expr (ops->type, ifexp, if_true, if_false, target);
+ }
+
/* Get the rtx comparison code to use. We know that EXP is a comparison
operation of some type. Some comparisons against 1 and -1 can be
converted to comparisons with zero. Do so here so that the tests
diff --git a/gcc/final.c b/gcc/final.c
index 328599c42c4..e6d288639b7 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1739,7 +1739,7 @@ final (rtx first, FILE *file, int optimize_p)
if (optimize_p && JUMP_P (insn))
{
rtx lab = JUMP_LABEL (insn);
- if (lab && LABEL_NUSES (lab) == 1)
+ if (lab && LABEL_P (lab) && LABEL_NUSES (lab) == 1)
{
LABEL_REFS (lab) = insn;
}
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 5807a5533ba..79ebd8b5701 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -115,9 +115,6 @@ static int simple_operand_p (const_tree);
static tree range_binop (enum tree_code, tree, tree, int, tree, int);
static tree range_predecessor (tree);
static tree range_successor (tree);
-extern tree make_range (tree, int *, tree *, tree *, bool *);
-extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
- tree, tree);
static tree fold_range_test (location_t, enum tree_code, tree, tree, tree);
static tree fold_cond_expr_with_comparison (location_t, tree, tree, tree, tree);
static tree unextend (tree, int, int, tree);
@@ -3790,288 +3787,308 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p,
return constant_boolean_node (result, type);
}
-/* Given EXP, a logical expression, set the range it is testing into
- variables denoted by PIN_P, PLOW, and PHIGH. Return the expression
- actually being tested. *PLOW and *PHIGH will be made of the same
- type as the returned expression. If EXP is not a comparison, we
- will most likely not be returning a useful value and range. Set
- *STRICT_OVERFLOW_P to true if the return value is only valid
- because signed overflow is undefined; otherwise, do not change
- *STRICT_OVERFLOW_P. */
+/* Helper routine for make_range. Perform one step for it, return
+ new expression if the loop should continue or NULL_TREE if it should
+ stop. */
tree
-make_range (tree exp, int *pin_p, tree *plow, tree *phigh,
- bool *strict_overflow_p)
+make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1,
+ tree exp_type, tree *p_low, tree *p_high, int *p_in_p,
+ bool *strict_overflow_p)
{
- enum tree_code code;
- tree arg0 = NULL_TREE, arg1 = NULL_TREE;
- tree exp_type = NULL_TREE, arg0_type = NULL_TREE;
- int in_p, n_in_p;
- tree low, high, n_low, n_high;
- location_t loc = EXPR_LOCATION (exp);
-
- /* Start with simply saying "EXP != 0" and then look at the code of EXP
- and see if we can refine the range. Some of the cases below may not
- happen, but it doesn't seem worth worrying about this. We "continue"
- the outer loop when we've changed something; otherwise we "break"
- the switch, which will "break" the while. */
-
- in_p = 0;
- low = high = build_int_cst (TREE_TYPE (exp), 0);
+ tree arg0_type = TREE_TYPE (arg0);
+ tree n_low, n_high, low = *p_low, high = *p_high;
+ int in_p = *p_in_p, n_in_p;
- while (1)
+ switch (code)
{
- code = TREE_CODE (exp);
- exp_type = TREE_TYPE (exp);
+ case TRUTH_NOT_EXPR:
+ *p_in_p = ! in_p;
+ return arg0;
+
+ case EQ_EXPR: case NE_EXPR:
+ case LT_EXPR: case LE_EXPR: case GE_EXPR: case GT_EXPR:
+ /* We can only do something if the range is testing for zero
+ and if the second operand is an integer constant. Note that
+ saying something is "in" the range we make is done by
+ complementing IN_P since it will set in the initial case of
+ being not equal to zero; "out" is leaving it alone. */
+ if (low == NULL_TREE || high == NULL_TREE
+ || ! integer_zerop (low) || ! integer_zerop (high)
+ || TREE_CODE (arg1) != INTEGER_CST)
+ return NULL_TREE;
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
+ switch (code)
{
- if (TREE_OPERAND_LENGTH (exp) > 0)
- arg0 = TREE_OPERAND (exp, 0);
- if (TREE_CODE_CLASS (code) == tcc_comparison
- || TREE_CODE_CLASS (code) == tcc_unary
- || TREE_CODE_CLASS (code) == tcc_binary)
- arg0_type = TREE_TYPE (arg0);
- if (TREE_CODE_CLASS (code) == tcc_binary
- || TREE_CODE_CLASS (code) == tcc_comparison
- || (TREE_CODE_CLASS (code) == tcc_expression
- && TREE_OPERAND_LENGTH (exp) > 1))
- arg1 = TREE_OPERAND (exp, 1);
+ case NE_EXPR: /* - [c, c] */
+ low = high = arg1;
+ break;
+ case EQ_EXPR: /* + [c, c] */
+ in_p = ! in_p, low = high = arg1;
+ break;
+ case GT_EXPR: /* - [-, c] */
+ low = 0, high = arg1;
+ break;
+ case GE_EXPR: /* + [c, -] */
+ in_p = ! in_p, low = arg1, high = 0;
+ break;
+ case LT_EXPR: /* - [c, -] */
+ low = arg1, high = 0;
+ break;
+ case LE_EXPR: /* + [-, c] */
+ in_p = ! in_p, low = 0, high = arg1;
+ break;
+ default:
+ gcc_unreachable ();
}
- switch (code)
+ /* If this is an unsigned comparison, we also know that EXP is
+ greater than or equal to zero. We base the range tests we make
+ on that fact, so we record it here so we can parse existing
+ range tests. We test arg0_type since often the return type
+ of, e.g. EQ_EXPR, is boolean. */
+ if (TYPE_UNSIGNED (arg0_type) && (low == 0 || high == 0))
{
- case TRUTH_NOT_EXPR:
- in_p = ! in_p, exp = arg0;
- continue;
-
- case EQ_EXPR: case NE_EXPR:
- case LT_EXPR: case LE_EXPR: case GE_EXPR: case GT_EXPR:
- /* We can only do something if the range is testing for zero
- and if the second operand is an integer constant. Note that
- saying something is "in" the range we make is done by
- complementing IN_P since it will set in the initial case of
- being not equal to zero; "out" is leaving it alone. */
- if (low == 0 || high == 0
- || ! integer_zerop (low) || ! integer_zerop (high)
- || TREE_CODE (arg1) != INTEGER_CST)
- break;
+ if (! merge_ranges (&n_in_p, &n_low, &n_high,
+ in_p, low, high, 1,
+ build_int_cst (arg0_type, 0),
+ NULL_TREE))
+ return NULL_TREE;
- switch (code)
- {
- case NE_EXPR: /* - [c, c] */
- low = high = arg1;
- break;
- case EQ_EXPR: /* + [c, c] */
- in_p = ! in_p, low = high = arg1;
- break;
- case GT_EXPR: /* - [-, c] */
- low = 0, high = arg1;
- break;
- case GE_EXPR: /* + [c, -] */
- in_p = ! in_p, low = arg1, high = 0;
- break;
- case LT_EXPR: /* - [c, -] */
- low = arg1, high = 0;
- break;
- case LE_EXPR: /* + [-, c] */
- in_p = ! in_p, low = 0, high = arg1;
- break;
- default:
- gcc_unreachable ();
- }
+ in_p = n_in_p, low = n_low, high = n_high;
- /* If this is an unsigned comparison, we also know that EXP is
- greater than or equal to zero. We base the range tests we make
- on that fact, so we record it here so we can parse existing
- range tests. We test arg0_type since often the return type
- of, e.g. EQ_EXPR, is boolean. */
- if (TYPE_UNSIGNED (arg0_type) && (low == 0 || high == 0))
+ /* If the high bound is missing, but we have a nonzero low
+ bound, reverse the range so it goes from zero to the low bound
+ minus 1. */
+ if (high == 0 && low && ! integer_zerop (low))
{
- if (! merge_ranges (&n_in_p, &n_low, &n_high,
- in_p, low, high, 1,
- build_int_cst (arg0_type, 0),
- NULL_TREE))
- break;
-
- in_p = n_in_p, low = n_low, high = n_high;
-
- /* If the high bound is missing, but we have a nonzero low
- bound, reverse the range so it goes from zero to the low bound
- minus 1. */
- if (high == 0 && low && ! integer_zerop (low))
- {
- in_p = ! in_p;
- high = range_binop (MINUS_EXPR, NULL_TREE, low, 0,
- integer_one_node, 0);
- low = build_int_cst (arg0_type, 0);
- }
+ in_p = ! in_p;
+ high = range_binop (MINUS_EXPR, NULL_TREE, low, 0,
+ integer_one_node, 0);
+ low = build_int_cst (arg0_type, 0);
}
+ }
- exp = arg0;
- continue;
-
- case NEGATE_EXPR:
- /* (-x) IN [a,b] -> x in [-b, -a] */
- n_low = range_binop (MINUS_EXPR, exp_type,
- build_int_cst (exp_type, 0),
- 0, high, 1);
- n_high = range_binop (MINUS_EXPR, exp_type,
- build_int_cst (exp_type, 0),
- 0, low, 0);
- if (n_high != 0 && TREE_OVERFLOW (n_high))
- break;
- goto normalize;
+ *p_low = low;
+ *p_high = high;
+ *p_in_p = in_p;
+ return arg0;
- case BIT_NOT_EXPR:
- /* ~ X -> -X - 1 */
- exp = build2_loc (loc, MINUS_EXPR, exp_type, negate_expr (arg0),
- build_int_cst (exp_type, 1));
- continue;
+ case NEGATE_EXPR:
+ /* (-x) IN [a,b] -> x in [-b, -a] */
+ n_low = range_binop (MINUS_EXPR, exp_type,
+ build_int_cst (exp_type, 0),
+ 0, high, 1);
+ n_high = range_binop (MINUS_EXPR, exp_type,
+ build_int_cst (exp_type, 0),
+ 0, low, 0);
+ if (n_high != 0 && TREE_OVERFLOW (n_high))
+ return NULL_TREE;
+ goto normalize;
- case PLUS_EXPR: case MINUS_EXPR:
- if (TREE_CODE (arg1) != INTEGER_CST)
- break;
+ case BIT_NOT_EXPR:
+ /* ~ X -> -X - 1 */
+ return build2_loc (loc, MINUS_EXPR, exp_type, negate_expr (arg0),
+ build_int_cst (exp_type, 1));
- /* If flag_wrapv and ARG0_TYPE is signed, then we cannot
- move a constant to the other side. */
- if (!TYPE_UNSIGNED (arg0_type)
- && !TYPE_OVERFLOW_UNDEFINED (arg0_type))
- break;
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ if (TREE_CODE (arg1) != INTEGER_CST)
+ return NULL_TREE;
- /* If EXP is signed, any overflow in the computation is undefined,
- so we don't worry about it so long as our computations on
- the bounds don't overflow. For unsigned, overflow is defined
- and this is exactly the right thing. */
- n_low = range_binop (code == MINUS_EXPR ? PLUS_EXPR : MINUS_EXPR,
- arg0_type, low, 0, arg1, 0);
- n_high = range_binop (code == MINUS_EXPR ? PLUS_EXPR : MINUS_EXPR,
- arg0_type, high, 1, arg1, 0);
- if ((n_low != 0 && TREE_OVERFLOW (n_low))
- || (n_high != 0 && TREE_OVERFLOW (n_high)))
- break;
+ /* If flag_wrapv and ARG0_TYPE is signed, then we cannot
+ move a constant to the other side. */
+ if (!TYPE_UNSIGNED (arg0_type)
+ && !TYPE_OVERFLOW_UNDEFINED (arg0_type))
+ return NULL_TREE;
- if (TYPE_OVERFLOW_UNDEFINED (arg0_type))
- *strict_overflow_p = true;
+ /* If EXP is signed, any overflow in the computation is undefined,
+ so we don't worry about it so long as our computations on
+ the bounds don't overflow. For unsigned, overflow is defined
+ and this is exactly the right thing. */
+ n_low = range_binop (code == MINUS_EXPR ? PLUS_EXPR : MINUS_EXPR,
+ arg0_type, low, 0, arg1, 0);
+ n_high = range_binop (code == MINUS_EXPR ? PLUS_EXPR : MINUS_EXPR,
+ arg0_type, high, 1, arg1, 0);
+ if ((n_low != 0 && TREE_OVERFLOW (n_low))
+ || (n_high != 0 && TREE_OVERFLOW (n_high)))
+ return NULL_TREE;
- normalize:
- /* Check for an unsigned range which has wrapped around the maximum
- value thus making n_high < n_low, and normalize it. */
- if (n_low && n_high && tree_int_cst_lt (n_high, n_low))
- {
- low = range_binop (PLUS_EXPR, arg0_type, n_high, 0,
- integer_one_node, 0);
- high = range_binop (MINUS_EXPR, arg0_type, n_low, 0,
- integer_one_node, 0);
+ if (TYPE_OVERFLOW_UNDEFINED (arg0_type))
+ *strict_overflow_p = true;
- /* If the range is of the form +/- [ x+1, x ], we won't
- be able to normalize it. But then, it represents the
- whole range or the empty set, so make it
- +/- [ -, - ]. */
- if (tree_int_cst_equal (n_low, low)
- && tree_int_cst_equal (n_high, high))
- low = high = 0;
- else
- in_p = ! in_p;
- }
- else
- low = n_low, high = n_high;
-
- exp = arg0;
- continue;
+ normalize:
+ /* Check for an unsigned range which has wrapped around the maximum
+ value thus making n_high < n_low, and normalize it. */
+ if (n_low && n_high && tree_int_cst_lt (n_high, n_low))
+ {
+ low = range_binop (PLUS_EXPR, arg0_type, n_high, 0,
+ integer_one_node, 0);
+ high = range_binop (MINUS_EXPR, arg0_type, n_low, 0,
+ integer_one_node, 0);
+
+ /* If the range is of the form +/- [ x+1, x ], we won't
+ be able to normalize it. But then, it represents the
+ whole range or the empty set, so make it
+ +/- [ -, - ]. */
+ if (tree_int_cst_equal (n_low, low)
+ && tree_int_cst_equal (n_high, high))
+ low = high = 0;
+ else
+ in_p = ! in_p;
+ }
+ else
+ low = n_low, high = n_high;
- CASE_CONVERT: case NON_LVALUE_EXPR:
- if (TYPE_PRECISION (arg0_type) > TYPE_PRECISION (exp_type))
- break;
+ *p_low = low;
+ *p_high = high;
+ *p_in_p = in_p;
+ return arg0;
- if (! INTEGRAL_TYPE_P (arg0_type)
- || (low != 0 && ! int_fits_type_p (low, arg0_type))
- || (high != 0 && ! int_fits_type_p (high, arg0_type)))
- break;
+ CASE_CONVERT:
+ case NON_LVALUE_EXPR:
+ if (TYPE_PRECISION (arg0_type) > TYPE_PRECISION (exp_type))
+ return NULL_TREE;
- n_low = low, n_high = high;
+ if (! INTEGRAL_TYPE_P (arg0_type)
+ || (low != 0 && ! int_fits_type_p (low, arg0_type))
+ || (high != 0 && ! int_fits_type_p (high, arg0_type)))
+ return NULL_TREE;
- if (n_low != 0)
- n_low = fold_convert_loc (loc, arg0_type, n_low);
+ n_low = low, n_high = high;
- if (n_high != 0)
- n_high = fold_convert_loc (loc, arg0_type, n_high);
+ if (n_low != 0)
+ n_low = fold_convert_loc (loc, arg0_type, n_low);
+ if (n_high != 0)
+ n_high = fold_convert_loc (loc, arg0_type, n_high);
- /* If we're converting arg0 from an unsigned type, to exp,
- a signed type, we will be doing the comparison as unsigned.
- The tests above have already verified that LOW and HIGH
- are both positive.
+ /* If we're converting arg0 from an unsigned type, to exp,
+ a signed type, we will be doing the comparison as unsigned.
+ The tests above have already verified that LOW and HIGH
+ are both positive.
- So we have to ensure that we will handle large unsigned
- values the same way that the current signed bounds treat
- negative values. */
+ So we have to ensure that we will handle large unsigned
+ values the same way that the current signed bounds treat
+ negative values. */
- if (!TYPE_UNSIGNED (exp_type) && TYPE_UNSIGNED (arg0_type))
- {
- tree high_positive;
- tree equiv_type;
- /* For fixed-point modes, we need to pass the saturating flag
- as the 2nd parameter. */
- if (ALL_FIXED_POINT_MODE_P (TYPE_MODE (arg0_type)))
- equiv_type = lang_hooks.types.type_for_mode
- (TYPE_MODE (arg0_type),
- TYPE_SATURATING (arg0_type));
- else
- equiv_type = lang_hooks.types.type_for_mode
- (TYPE_MODE (arg0_type), 1);
-
- /* A range without an upper bound is, naturally, unbounded.
- Since convert would have cropped a very large value, use
- the max value for the destination type. */
- high_positive
- = TYPE_MAX_VALUE (equiv_type) ? TYPE_MAX_VALUE (equiv_type)
- : TYPE_MAX_VALUE (arg0_type);
-
- if (TYPE_PRECISION (exp_type) == TYPE_PRECISION (arg0_type))
- high_positive = fold_build2_loc (loc, RSHIFT_EXPR, arg0_type,
+ if (!TYPE_UNSIGNED (exp_type) && TYPE_UNSIGNED (arg0_type))
+ {
+ tree high_positive;
+ tree equiv_type;
+ /* For fixed-point modes, we need to pass the saturating flag
+ as the 2nd parameter. */
+ if (ALL_FIXED_POINT_MODE_P (TYPE_MODE (arg0_type)))
+ equiv_type
+ = lang_hooks.types.type_for_mode (TYPE_MODE (arg0_type),
+ TYPE_SATURATING (arg0_type));
+ else
+ equiv_type
+ = lang_hooks.types.type_for_mode (TYPE_MODE (arg0_type), 1);
+
+ /* A range without an upper bound is, naturally, unbounded.
+ Since convert would have cropped a very large value, use
+ the max value for the destination type. */
+ high_positive
+ = TYPE_MAX_VALUE (equiv_type) ? TYPE_MAX_VALUE (equiv_type)
+ : TYPE_MAX_VALUE (arg0_type);
+
+ if (TYPE_PRECISION (exp_type) == TYPE_PRECISION (arg0_type))
+ high_positive = fold_build2_loc (loc, RSHIFT_EXPR, arg0_type,
fold_convert_loc (loc, arg0_type,
high_positive),
build_int_cst (arg0_type, 1));
- /* If the low bound is specified, "and" the range with the
- range for which the original unsigned value will be
- positive. */
- if (low != 0)
- {
- if (! merge_ranges (&n_in_p, &n_low, &n_high,
- 1, n_low, n_high, 1,
- fold_convert_loc (loc, arg0_type,
- integer_zero_node),
- high_positive))
- break;
+ /* If the low bound is specified, "and" the range with the
+ range for which the original unsigned value will be
+ positive. */
+ if (low != 0)
+ {
+ if (! merge_ranges (&n_in_p, &n_low, &n_high, 1, n_low, n_high,
+ 1, fold_convert_loc (loc, arg0_type,
+ integer_zero_node),
+ high_positive))
+ return NULL_TREE;
- in_p = (n_in_p == in_p);
- }
- else
- {
- /* Otherwise, "or" the range with the range of the input
- that will be interpreted as negative. */
- if (! merge_ranges (&n_in_p, &n_low, &n_high,
- 0, n_low, n_high, 1,
- fold_convert_loc (loc, arg0_type,
- integer_zero_node),
- high_positive))
- break;
+ in_p = (n_in_p == in_p);
+ }
+ else
+ {
+ /* Otherwise, "or" the range with the range of the input
+ that will be interpreted as negative. */
+ if (! merge_ranges (&n_in_p, &n_low, &n_high, 0, n_low, n_high,
+ 1, fold_convert_loc (loc, arg0_type,
+ integer_zero_node),
+ high_positive))
+ return NULL_TREE;
- in_p = (in_p != n_in_p);
- }
+ in_p = (in_p != n_in_p);
}
+ }
- exp = arg0;
- low = n_low, high = n_high;
- continue;
+ *p_low = n_low;
+ *p_high = n_high;
+ *p_in_p = in_p;
+ return arg0;
- default:
- break;
+ default:
+ return NULL_TREE;
+ }
+}
+
+/* Given EXP, a logical expression, set the range it is testing into
+ variables denoted by PIN_P, PLOW, and PHIGH. Return the expression
+ actually being tested. *PLOW and *PHIGH will be made of the same
+ type as the returned expression. If EXP is not a comparison, we
+ will most likely not be returning a useful value and range. Set
+ *STRICT_OVERFLOW_P to true if the return value is only valid
+ because signed overflow is undefined; otherwise, do not change
+ *STRICT_OVERFLOW_P. */
+
+tree
+make_range (tree exp, int *pin_p, tree *plow, tree *phigh,
+ bool *strict_overflow_p)
+{
+ enum tree_code code;
+ tree arg0, arg1 = NULL_TREE;
+ tree exp_type, nexp;
+ int in_p;
+ tree low, high;
+ location_t loc = EXPR_LOCATION (exp);
+
+ /* Start with simply saying "EXP != 0" and then look at the code of EXP
+ and see if we can refine the range. Some of the cases below may not
+ happen, but it doesn't seem worth worrying about this. We "continue"
+ the outer loop when we've changed something; otherwise we "break"
+ the switch, which will "break" the while. */
+
+ in_p = 0;
+ low = high = build_int_cst (TREE_TYPE (exp), 0);
+
+ while (1)
+ {
+ code = TREE_CODE (exp);
+ exp_type = TREE_TYPE (exp);
+ arg0 = NULL_TREE;
+
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
+ {
+ if (TREE_OPERAND_LENGTH (exp) > 0)
+ arg0 = TREE_OPERAND (exp, 0);
+ if (TREE_CODE_CLASS (code) == tcc_binary
+ || TREE_CODE_CLASS (code) == tcc_comparison
+ || (TREE_CODE_CLASS (code) == tcc_expression
+ && TREE_OPERAND_LENGTH (exp) > 1))
+ arg1 = TREE_OPERAND (exp, 1);
}
+ if (arg0 == NULL_TREE)
+ break;
- break;
+ nexp = make_range_step (loc, code, arg0, arg1, exp_type, &low,
+ &high, &in_p, strict_overflow_p);
+ if (nexp == NULL_TREE)
+ break;
+ exp = nexp;
}
/* If EXP is a constant, we can evaluate whether this is true or false. */
@@ -6870,6 +6887,60 @@ try_move_mult_to_index (location_t loc, tree addr, tree op1)
break;
}
+ else if (TREE_CODE (ref) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (ref)) == ARRAY_TYPE)
+ {
+ tree domain;
+
+ /* Remember if this was a multi-dimensional array. */
+ if (TREE_CODE (TREE_OPERAND (ref, 0)) == ARRAY_REF)
+ mdim = true;
+
+ domain = TYPE_DOMAIN (TREE_TYPE (ref));
+ if (! domain)
+ continue;
+ itype = TREE_TYPE (domain);
+
+ step = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ref)));
+ if (TREE_CODE (step) != INTEGER_CST)
+ continue;
+
+ if (s)
+ {
+ if (! tree_int_cst_equal (step, s))
+ continue;
+ }
+ else
+ {
+ /* Try if delta is a multiple of step. */
+ tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step);
+ if (! tmp)
+ continue;
+ delta = tmp;
+ }
+
+ /* Only fold here if we can verify we do not overflow one
+ dimension of a multi-dimensional array. */
+ if (mdim)
+ {
+ tree tmp;
+
+ if (!TYPE_MIN_VALUE (domain)
+ || !TYPE_MAX_VALUE (domain)
+ || TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST)
+ continue;
+
+ tmp = fold_binary_loc (loc, PLUS_EXPR, itype,
+ fold_convert_loc (loc, itype,
+ TYPE_MIN_VALUE (domain)),
+ fold_convert_loc (loc, itype, delta));
+ if (TREE_CODE (tmp) != INTEGER_CST
+ || tree_int_cst_lt (TYPE_MAX_VALUE (domain), tmp))
+ continue;
+ }
+
+ break;
+ }
else
mdim = false;
@@ -6892,12 +6963,29 @@ try_move_mult_to_index (location_t loc, tree addr, tree op1)
pos = TREE_OPERAND (pos, 0);
}
- TREE_OPERAND (pos, 1) = fold_build2_loc (loc, PLUS_EXPR, itype,
- fold_convert_loc (loc, itype,
- TREE_OPERAND (pos, 1)),
- fold_convert_loc (loc, itype, delta));
-
- return fold_build1_loc (loc, ADDR_EXPR, TREE_TYPE (addr), ret);
+ if (TREE_CODE (ref) == ARRAY_REF)
+ {
+ TREE_OPERAND (pos, 1)
+ = fold_build2_loc (loc, PLUS_EXPR, itype,
+ fold_convert_loc (loc, itype, TREE_OPERAND (pos, 1)),
+ fold_convert_loc (loc, itype, delta));
+ return fold_build1_loc (loc, ADDR_EXPR, TREE_TYPE (addr), ret);
+ }
+ else if (TREE_CODE (ref) == COMPONENT_REF)
+ {
+ gcc_assert (ret == pos);
+ ret = build4_loc (loc, ARRAY_REF, TREE_TYPE (TREE_TYPE (ref)), ret,
+ fold_build2_loc
+ (loc, PLUS_EXPR, itype,
+ fold_convert_loc (loc, itype,
+ TYPE_MIN_VALUE
+ (TYPE_DOMAIN (TREE_TYPE (ref)))),
+ fold_convert_loc (loc, itype, delta)),
+ NULL_TREE, NULL_TREE);
+ return build_fold_addr_expr_loc (loc, ret);
+ }
+ else
+ gcc_unreachable ();
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index acd99edd497..c6bea2a28f7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,51 @@
+2011-10-01 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50585
+ * interface.c (get_expr_storage_size): Check if 'length' component is
+ associated.
+
+2011-09-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50547
+ * resolve.c (resolve_formal_arglist): Fix pureness check for dummy
+ functions.
+
+ PR fortran/50553
+ * symbol.c (check_conflict): Forbid TARGET attribute for statement
+ functions.
+
+2011-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-types.c (gfc_type_for_size): Return wider type
+ if no suitable narrower type has been found.
+ (gfc_type_for_mode): Return NULL_TREE if gfc_type_for_size
+ returned type doesn't have expected TYPE_MODE.
+
+2011-09-26 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50515
+ * resolve.c (resolve_common_blocks): Check for EXTERNAL attribute.
+
+ PR fortran/50517
+ * interface.c (gfc_compare_interfaces): Bugfix in check for result type.
+
+2011-09-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41733
+ * expr.c (gfc_check_pointer_assign): Check for nonintrinsic elemental
+ procedures.
+ * interface.c (gfc_compare_interfaces): Rename 'intent_flag'. Check
+ for PURE and ELEMENTAL attributes.
+ (compare_actual_formal): Remove pureness check here.
+
+2011-09-20 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * check.c (gfc_check_c_sizeof): Remove redundant word.
+
+2011-09-20 Simon Baldwin <simonb@google.com>
+
+ * module.c (gfc_dump_module): Omit timestamp from output.
+
2011-09-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/50403
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 5b692eec151..b1fc38accb8 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -3489,7 +3489,7 @@ gfc_check_c_sizeof (gfc_expr *arg)
{
if (verify_c_interop (&arg->ts) != SUCCESS)
{
- gfc_error ("'%s' argument of '%s' intrinsic at %L must be be an "
+ gfc_error ("'%s' argument of '%s' intrinsic at %L must be an "
"interoperable data entity",
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
&arg->where);
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3c09a2a99c4..813a99d037b 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3432,7 +3432,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
rvalue->symtree->name, &rvalue->where);
return FAILURE;
}
- /* Check for C727. */
+ /* Check for F08:C729. */
if (attr.flavor == FL_PROCEDURE)
{
if (attr.proc == PROC_ST_FUNCTION)
@@ -3448,6 +3448,14 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
rvalue->symtree->name, &rvalue->where) == FAILURE)
return FAILURE;
}
+ /* Check for F08:C730. */
+ if (attr.elemental && !attr.intrinsic)
+ {
+ gfc_error ("Nonintrinsic elemental procedure '%s' is invalid "
+ "in procedure pointer assigment at %L",
+ rvalue->symtree->name, &rvalue->where);
+ return FAILURE;
+ }
/* Ensure that the calling convention is the same. As other attributes
such as DLLEXPORT may differ, one explicitly only tests for the
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 7962403a505..aa075a90401 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1087,12 +1087,12 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
/* 'Compare' two formal interfaces associated with a pair of symbols.
We return nonzero if there exists an actual argument list that
would be ambiguous between the two interfaces, zero otherwise.
- 'intent_flag' specifies whether INTENT and OPTIONAL of the arguments are
+ 'strict_flag' specifies whether all the characteristics are
required to match, which is not the case for ambiguity checks.*/
int
gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
- int generic_flag, int intent_flag,
+ int generic_flag, int strict_flag,
char *errmsg, int err_len)
{
gfc_formal_arglist *f1, *f2;
@@ -1115,17 +1115,32 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
return 0;
}
- /* If the arguments are functions, check type and kind
- (only for dummy procedures and procedure pointer assignments). */
- if (!generic_flag && intent_flag && s1->attr.function && s2->attr.function)
+ /* Do strict checks on all characteristics
+ (for dummy procedures and procedure pointer assignments). */
+ if (!generic_flag && strict_flag)
{
- if (s1->ts.type == BT_UNKNOWN)
- return 1;
- if ((s1->ts.type != s2->ts.type) || (s1->ts.kind != s2->ts.kind))
+ if (s1->attr.function && s2->attr.function)
{
- if (errmsg != NULL)
- snprintf (errmsg, err_len, "Type/kind mismatch in return value "
- "of '%s'", name2);
+ /* If both are functions, check result type. */
+ if (s1->ts.type == BT_UNKNOWN)
+ return 1;
+ if (!compare_type_rank (s1,s2))
+ {
+ if (errmsg != NULL)
+ snprintf (errmsg, err_len, "Type/rank mismatch in return value "
+ "of '%s'", name2);
+ return 0;
+ }
+ }
+
+ if (s1->attr.pure && !s2->attr.pure)
+ {
+ snprintf (errmsg, err_len, "Mismatch in PURE attribute");
+ return 0;
+ }
+ if (s1->attr.elemental && !s2->attr.elemental)
+ {
+ snprintf (errmsg, err_len, "Mismatch in ELEMENTAL attribute");
return 0;
}
}
@@ -1166,7 +1181,7 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
return 0;
}
- if (intent_flag)
+ if (strict_flag)
{
/* Check all characteristics. */
if (check_dummy_characteristics (f1->sym, f2->sym,
@@ -1944,7 +1959,7 @@ get_expr_storage_size (gfc_expr *e)
{
/* The string length is the substring length.
Set now to full string length. */
- if (ref->u.ss.length == NULL
+ if (!ref->u.ss.length || !ref->u.ss.length->length
|| ref->u.ss.length->length->expr_type != EXPR_CONSTANT)
return 0;
@@ -2276,16 +2291,6 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
return 0;
}
- if (f->sym->attr.flavor == FL_PROCEDURE && f->sym->attr.pure
- && a->expr->ts.type == BT_PROCEDURE
- && !a->expr->symtree->n.sym->attr.pure)
- {
- if (where)
- gfc_error ("Expected a PURE procedure for argument '%s' at %L",
- f->sym->name, &a->expr->where);
- return 0;
- }
-
if (f->sym->as && f->sym->as->type == AS_ASSUMED_SHAPE
&& a->expr->expr_type == EXPR_VARIABLE
&& a->expr->symtree->n.sym->as
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 62750af850b..84db3ddb019 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -269,18 +269,21 @@ resolve_formal_arglist (gfc_symbol *proc)
if (sym->attr.if_source != IFSRC_UNKNOWN)
resolve_formal_arglist (sym);
+ /* F08:C1279. */
+ if (gfc_pure (proc)
+ && sym->attr.flavor == FL_PROCEDURE && !gfc_pure (sym))
+ {
+ gfc_error ("Dummy procedure '%s' of PURE procedure at %L must "
+ "also be PURE", sym->name, &sym->declared_at);
+ continue;
+ }
+
if (sym->attr.subroutine || sym->attr.external || sym->attr.intrinsic)
{
- if (gfc_pure (proc) && !gfc_pure (sym))
- {
- gfc_error ("Dummy procedure '%s' of PURE procedure at %L must "
- "also be PURE", sym->name, &sym->declared_at);
- continue;
- }
-
if (proc->attr.implicit_pure && !gfc_pure(sym))
proc->attr.implicit_pure = 0;
+ /* F08:C1289. */
if (gfc_elemental (proc))
{
gfc_error ("Dummy procedure at %L not allowed in ELEMENTAL "
@@ -382,7 +385,7 @@ resolve_formal_arglist (gfc_symbol *proc)
if (gfc_elemental (proc))
{
- /* F2008, C1289. */
+ /* F08:C1289. */
if (sym->attr.codimension)
{
gfc_error ("Coarray dummy argument '%s' at %L to elemental "
@@ -905,6 +908,10 @@ resolve_common_blocks (gfc_symtree *common_root)
gfc_error ("COMMON block '%s' at %L is used as PARAMETER at %L",
sym->name, &common_root->n.common->where, &sym->declared_at);
+ if (sym->attr.external)
+ gfc_error ("COMMON block '%s' at %L can not have the EXTERNAL attribute",
+ sym->name, &common_root->n.common->where);
+
if (sym->attr.intrinsic)
gfc_error ("COMMON block '%s' at %L is also an intrinsic procedure",
sym->name, &common_root->n.common->where);
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 25186c977ad..46eccb46aba 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -684,6 +684,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
{
case PROC_ST_FUNCTION:
conf2 (dummy);
+ conf2 (target);
break;
case PROC_MODULE:
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 43f1a19cc83..aa8e43bd8b8 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2791,18 +2791,29 @@ gfc_type_for_size (unsigned bits, int unsignedp)
if (bits == TYPE_PRECISION (intTI_type_node))
return intTI_type_node;
#endif
+
+ if (bits <= TYPE_PRECISION (intQI_type_node))
+ return intQI_type_node;
+ if (bits <= TYPE_PRECISION (intHI_type_node))
+ return intHI_type_node;
+ if (bits <= TYPE_PRECISION (intSI_type_node))
+ return intSI_type_node;
+ if (bits <= TYPE_PRECISION (intDI_type_node))
+ return intDI_type_node;
+ if (bits <= TYPE_PRECISION (intTI_type_node))
+ return intTI_type_node;
}
else
{
- if (bits == TYPE_PRECISION (unsigned_intQI_type_node))
+ if (bits <= TYPE_PRECISION (unsigned_intQI_type_node))
return unsigned_intQI_type_node;
- if (bits == TYPE_PRECISION (unsigned_intHI_type_node))
+ if (bits <= TYPE_PRECISION (unsigned_intHI_type_node))
return unsigned_intHI_type_node;
- if (bits == TYPE_PRECISION (unsigned_intSI_type_node))
+ if (bits <= TYPE_PRECISION (unsigned_intSI_type_node))
return unsigned_intSI_type_node;
- if (bits == TYPE_PRECISION (unsigned_intDI_type_node))
+ if (bits <= TYPE_PRECISION (unsigned_intDI_type_node))
return unsigned_intDI_type_node;
- if (bits == TYPE_PRECISION (unsigned_intTI_type_node))
+ if (bits <= TYPE_PRECISION (unsigned_intTI_type_node))
return unsigned_intTI_type_node;
}
@@ -2823,7 +2834,10 @@ gfc_type_for_mode (enum machine_mode mode, int unsignedp)
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
base = gfc_complex_types;
else if (SCALAR_INT_MODE_P (mode))
- return gfc_type_for_size (GET_MODE_PRECISION (mode), unsignedp);
+ {
+ tree type = gfc_type_for_size (GET_MODE_PRECISION (mode), unsignedp);
+ return type != NULL_TREE && mode == TYPE_MODE (type) ? type : NULL_TREE;
+ }
else if (VECTOR_MODE_P (mode))
{
enum machine_mode inner_mode = GET_MODE_INNER (mode);
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 236dda2dea5..5368d187f4b 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1232,21 +1232,24 @@ forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set)
/* If def and use are subreg, check if they match. */
reg = DF_REF_REG (use);
- if (GET_CODE (reg) == SUBREG
- && GET_CODE (SET_DEST (def_set)) == SUBREG
- && (SUBREG_BYTE (SET_DEST (def_set)) != SUBREG_BYTE (reg)
- || GET_MODE (SET_DEST (def_set)) != GET_MODE (reg)))
- return false;
-
+ if (GET_CODE (reg) == SUBREG && GET_CODE (SET_DEST (def_set)) == SUBREG)
+ {
+ if (SUBREG_BYTE (SET_DEST (def_set)) != SUBREG_BYTE (reg))
+ return false;
+ }
/* Check if the def had a subreg, but the use has the whole reg. */
- if (REG_P (reg) && GET_CODE (SET_DEST (def_set)) == SUBREG)
+ else if (REG_P (reg) && GET_CODE (SET_DEST (def_set)) == SUBREG)
return false;
-
/* Check if the use has a subreg, but the def had the whole reg. Unlike the
previous case, the optimization is possible and often useful indeed. */
- if (GET_CODE (reg) == SUBREG && REG_P (SET_DEST (def_set)))
+ else if (GET_CODE (reg) == SUBREG && REG_P (SET_DEST (def_set)))
reg = SUBREG_REG (reg);
+ /* Make sure that we can treat REG as having the same mode as the
+ source of DEF_SET. */
+ if (GET_MODE (SET_DEST (def_set)) != GET_MODE (reg))
+ return false;
+
/* Check if the substitution is valid (last, because it's the most
expensive check!). */
src = SET_SRC (def_set);
diff --git a/gcc/gcc.c b/gcc/gcc.c
index da5a638cb41..e96049dcc2b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -8068,12 +8068,22 @@ print_asm_header_spec_function (int arg ATTRIBUTE_UNUSED,
return NULL;
}
-/* Compute a timestamp to initialize flag_random_seed. */
+/* Get a random number for -frandom-seed */
-static unsigned
-get_local_tick (void)
+static unsigned HOST_WIDE_INT
+get_random_number (void)
{
- unsigned ret = 0;
+ unsigned HOST_WIDE_INT ret = 0;
+ int fd;
+
+ fd = open ("/dev/urandom", O_RDONLY);
+ if (fd >= 0)
+ {
+ read (fd, &ret, sizeof (HOST_WIDE_INT));
+ close (fd);
+ if (ret)
+ return ret;
+ }
/* Get some more or less random data. */
#ifdef HAVE_GETTIMEOFDAY
@@ -8092,7 +8102,7 @@ get_local_tick (void)
}
#endif
- return ret;
+ return ret ^ getpid();
}
/* %:compare-debug-dump-opt spec function. Save the last argument,
@@ -8151,7 +8161,7 @@ compare_debug_dump_opt_spec_function (int arg,
if (!which)
{
- unsigned HOST_WIDE_INT value = get_local_tick () ^ getpid ();
+ unsigned HOST_WIDE_INT value = get_random_number ();
sprintf (random_seed, HOST_WIDE_INT_PRINT_HEX, value);
}
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index b481c4a5fa1..f8e5035e297 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -551,6 +551,7 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
reaching_vuse = gimple_vuse (stmt);
push_gimplify_context (&gctx);
+ gctx.into_ssa = gimple_in_ssa_p (cfun);
if (lhs == NULL_TREE)
{
@@ -1200,28 +1201,45 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace)
case GIMPLE_ASM:
/* Fold *& in asm operands. */
- for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
- {
- tree link = gimple_asm_output_op (stmt, i);
- tree op = TREE_VALUE (link);
- if (REFERENCE_CLASS_P (op)
- && (op = maybe_fold_reference (op, true)) != NULL_TREE)
- {
- TREE_VALUE (link) = op;
- changed = true;
- }
- }
- for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
- {
- tree link = gimple_asm_input_op (stmt, i);
- tree op = TREE_VALUE (link);
- if (REFERENCE_CLASS_P (op)
- && (op = maybe_fold_reference (op, false)) != NULL_TREE)
- {
- TREE_VALUE (link) = op;
- changed = true;
- }
- }
+ {
+ size_t noutputs;
+ const char **oconstraints;
+ const char *constraint;
+ bool allows_mem, allows_reg;
+
+ noutputs = gimple_asm_noutputs (stmt);
+ oconstraints = XALLOCAVEC (const char *, noutputs);
+
+ for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+ {
+ tree link = gimple_asm_output_op (stmt, i);
+ tree op = TREE_VALUE (link);
+ oconstraints[i]
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ if (REFERENCE_CLASS_P (op)
+ && (op = maybe_fold_reference (op, true)) != NULL_TREE)
+ {
+ TREE_VALUE (link) = op;
+ changed = true;
+ }
+ }
+ for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
+ {
+ tree link = gimple_asm_input_op (stmt, i);
+ tree op = TREE_VALUE (link);
+ constraint
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ parse_input_constraint (&constraint, 0, 0, noutputs, 0,
+ oconstraints, &allows_mem, &allows_reg);
+ if (REFERENCE_CLASS_P (op)
+ && (op = maybe_fold_reference (op, !allows_reg && allows_mem))
+ != NULL_TREE)
+ {
+ TREE_VALUE (link) = op;
+ changed = true;
+ }
+ }
+ }
break;
case GIMPLE_DEBUG:
@@ -2919,6 +2937,9 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree))
HOST_WIDE_INT offset, size, max_size;
tree tem;
+ if (TREE_THIS_VOLATILE (t))
+ return NULL_TREE;
+
if (TREE_CODE_CLASS (TREE_CODE (t)) == tcc_declaration)
return get_symbol_constant_value (t);
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 75885bbb20e..9b8e1b1d7be 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -215,9 +215,10 @@ gimple_call_reset_alias_info (gimple s)
pt_solution_reset (gimple_call_clobber_set (s));
}
-/* Helper for gimple_build_call, gimple_build_call_vec and
- gimple_build_call_from_tree. Build the basic components of a
- GIMPLE_CALL statement to function FN with NARGS arguments. */
+/* Helper for gimple_build_call, gimple_build_call_valist,
+ gimple_build_call_vec and gimple_build_call_from_tree. Build the basic
+ components of a GIMPLE_CALL statement to function FN with NARGS
+ arguments. */
static inline gimple
gimple_build_call_1 (tree fn, unsigned nargs)
@@ -272,6 +273,26 @@ gimple_build_call (tree fn, unsigned nargs, ...)
}
+/* Build a GIMPLE_CALL statement to function FN. NARGS is the number of
+ arguments. AP contains the arguments. */
+
+gimple
+gimple_build_call_valist (tree fn, unsigned nargs, va_list ap)
+{
+ gimple call;
+ unsigned i;
+
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL || is_gimple_call_addr (fn));
+
+ call = gimple_build_call_1 (fn, nargs);
+
+ for (i = 0; i < nargs; i++)
+ gimple_call_set_arg (call, i, va_arg (ap, tree));
+
+ return call;
+}
+
+
/* Helper for gimple_build_call_internal and gimple_build_call_internal_vec.
Build the basic components of a GIMPLE_CALL statement to internal
function FN with NARGS arguments. */
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 46d8373085f..75e19a72b87 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -831,6 +831,7 @@ gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
gimple gimple_build_call_vec (tree, VEC(tree, heap) *);
gimple gimple_build_call (tree, unsigned, ...);
+gimple gimple_build_call_valist (tree, unsigned, va_list);
gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
gimple gimple_build_call_internal_vec (enum internal_fn, VEC(tree, heap) *);
gimple gimple_build_call_from_tree (tree);
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 70f5f7c4423..bf829b520ee 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -135,13 +135,13 @@ Expression::do_traverse(Traverse*)
}
// This virtual function is called by the parser if the value of this
-// expression is being discarded. By default, we warn. Expressions
-// with side effects override.
+// expression is being discarded. By default, we give an error.
+// Expressions with side effects override.
void
Expression::do_discarding_value()
{
- this->warn_about_unused_value();
+ this->unused_value_error();
}
// This virtual function is called to export expressions. This will
@@ -153,12 +153,12 @@ Expression::do_export(Export*) const
go_unreachable();
}
-// Warn that the value of the expression is not used.
+// Give an error saying that the value of the expression is not used.
void
-Expression::warn_about_unused_value()
+Expression::unused_value_error()
{
- warning_at(this->location(), OPT_Wunused_value, "value computed is not used");
+ error_at(this->location(), "value computed is not used");
}
// Note that this expression is an error. This is called by children
@@ -5671,6 +5671,50 @@ Binary_expression::do_lower(Gogo*, Named_object*, Statement_inserter*, int)
return Expression::make_string(left_string + right_string, location);
}
+ // Special case for shift of a floating point constant.
+ if (op == OPERATOR_LSHIFT || op == OPERATOR_RSHIFT)
+ {
+ mpfr_t left_val;
+ mpfr_init(left_val);
+ Type* left_type;
+ mpz_t right_val;
+ mpz_init(right_val);
+ Type* right_type;
+ if (left->float_constant_value(left_val, &left_type)
+ && right->integer_constant_value(false, right_val, &right_type)
+ && mpfr_integer_p(left_val)
+ && (left_type == NULL
+ || left_type->is_abstract()
+ || left_type->integer_type() != NULL))
+ {
+ mpz_t left_int;
+ mpz_init(left_int);
+ mpfr_get_z(left_int, left_val, GMP_RNDN);
+
+ mpz_t val;
+ mpz_init(val);
+
+ Expression* ret = NULL;
+ if (Binary_expression::eval_integer(op, left_type, left_int,
+ right_type, right_val,
+ location, val))
+ ret = Expression::make_integer(&val, left_type, location);
+
+ mpz_clear(left_int);
+ mpz_clear(val);
+
+ if (ret != NULL)
+ {
+ mpfr_clear(left_val);
+ mpz_clear(right_val);
+ return ret;
+ }
+ }
+
+ mpfr_clear(left_val);
+ mpz_clear(right_val);
+ }
+
return this;
}
@@ -5832,7 +5876,7 @@ Binary_expression::do_discarding_value()
if (this->op_ == OPERATOR_OROR || this->op_ == OPERATOR_ANDAND)
this->right_->discarding_value();
else
- this->warn_about_unused_value();
+ this->unused_value_error();
}
// Get type.
@@ -5939,14 +5983,8 @@ Binary_expression::do_determine_type(const Type_context* context)
// Set the context for the left hand operand.
if (is_shift_op)
{
- // The right hand operand plays no role in determining the type
- // of the left hand operand. A shift of an abstract integer in
- // a string context gets special treatment, which may be a
- // language bug.
- if (subcontext.type != NULL
- && subcontext.type->is_string_type()
- && tleft->is_abstract())
- error_at(this->location(), "shift of non-integer operand");
+ // The right hand operand of a shift plays no role in
+ // determining the type of the left hand operand.
}
else if (!tleft->is_abstract())
subcontext.type = tleft;
@@ -5979,10 +6017,21 @@ Binary_expression::do_determine_type(const Type_context* context)
this->left_->determine_type(&subcontext);
- // The context for the right hand operand is the same as for the
- // left hand operand, except for a shift operator.
if (is_shift_op)
{
+ // We may have inherited an unusable type for the shift operand.
+ // Give a useful error if that happened.
+ if (tleft->is_abstract()
+ && subcontext.type != NULL
+ && (this->left_->type()->integer_type() == NULL
+ || (subcontext.type->integer_type() == NULL
+ && subcontext.type->float_type() == NULL
+ && subcontext.type->complex_type() == NULL)))
+ this->report_error(("invalid context-determined non-integer type "
+ "for shift operand"));
+
+ // The context for the right hand operand is the same as for the
+ // left hand operand, except for a shift operator.
subcontext.type = Type::lookup_integer_type("uint");
subcontext.may_be_abstract = false;
}
@@ -6951,6 +7000,9 @@ class Builtin_call_expression : public Call_expression
bool
do_complex_constant_value(mpfr_t, mpfr_t, Type**) const;
+ void
+ do_discarding_value();
+
Type*
do_type();
@@ -7760,6 +7812,44 @@ Builtin_call_expression::do_complex_constant_value(mpfr_t real, mpfr_t imag,
return false;
}
+// Give an error if we are discarding the value of an expression which
+// should not normally be discarded. We don't give an error for
+// discarding the value of an ordinary function call, but we do for
+// builtin functions, purely for consistency with the gc compiler.
+
+void
+Builtin_call_expression::do_discarding_value()
+{
+ switch (this->code_)
+ {
+ case BUILTIN_INVALID:
+ default:
+ go_unreachable();
+
+ case BUILTIN_APPEND:
+ case BUILTIN_CAP:
+ case BUILTIN_COMPLEX:
+ case BUILTIN_IMAG:
+ case BUILTIN_LEN:
+ case BUILTIN_MAKE:
+ case BUILTIN_NEW:
+ case BUILTIN_REAL:
+ case BUILTIN_ALIGNOF:
+ case BUILTIN_OFFSETOF:
+ case BUILTIN_SIZEOF:
+ this->unused_value_error();
+ break;
+
+ case BUILTIN_CLOSE:
+ case BUILTIN_COPY:
+ case BUILTIN_PANIC:
+ case BUILTIN_PRINT:
+ case BUILTIN_PRINTLN:
+ case BUILTIN_RECOVER:
+ break;
+ }
+}
+
// Return the type.
Type*
@@ -9689,7 +9779,10 @@ Call_result_expression::do_type()
if (fntype == NULL)
{
if (ce->issue_error())
- this->report_error(_("expected function"));
+ {
+ if (!ce->fn()->type()->is_error())
+ this->report_error(_("expected function"));
+ }
this->set_is_error();
return Type::make_error_type();
}
@@ -10002,7 +10095,9 @@ Array_index_expression::do_check_types(Gogo*)
this->report_error(_("index must be integer"));
if (this->end_ != NULL
&& this->end_->type()->integer_type() == NULL
- && !this->end_->is_nil_expression())
+ && !this->end_->type()->is_error()
+ && !this->end_->is_nil_expression()
+ && !this->end_->is_error_expression())
this->report_error(_("slice end must be integer"));
Array_type* array_type = this->array_->type()->array_type();
@@ -11241,7 +11336,7 @@ Selector_expression::lower_method_expression(Gogo* gogo)
size_t count = call->result_count();
Statement* s;
if (count == 0)
- s = Statement::make_statement(call);
+ s = Statement::make_statement(call, true);
else
{
Expression_list* retvals = new Expression_list();
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index c6ae12ce048..8cdf94d2e78 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -359,9 +359,9 @@ class Expression
string_constant_value(std::string* val) const
{ return this->do_string_constant_value(val); }
- // This is called by the parser if the value of this expression is
- // being discarded. This issues warnings about computed values
- // being unused.
+ // This is called if the value of this expression is being
+ // discarded. This issues warnings about computed values being
+ // unused.
void
discarding_value()
{ this->do_discarding_value(); }
@@ -725,9 +725,9 @@ class Expression
virtual void
do_export(Export*) const;
- // For children to call to warn about an unused value.
+ // For children to call to give an error for an unused value.
void
- warn_about_unused_value();
+ unused_value_error();
// For children to call when they detect that they are in error.
void
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 4a89ca80ba5..9df9402fcf3 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -857,7 +857,7 @@ Gogo::add_label_definition(const std::string& label_name,
{
go_assert(!this->functions_.empty());
Function* func = this->functions_.back().function->func_value();
- Label* label = func->add_label_definition(label_name, location);
+ Label* label = func->add_label_definition(this, label_name, location);
this->add_statement(Statement::make_label_statement(label, location));
return label;
}
@@ -865,11 +865,21 @@ Gogo::add_label_definition(const std::string& label_name,
// Add a label reference.
Label*
-Gogo::add_label_reference(const std::string& label_name)
+Gogo::add_label_reference(const std::string& label_name,
+ source_location location, bool issue_goto_errors)
{
go_assert(!this->functions_.empty());
Function* func = this->functions_.back().function->func_value();
- return func->add_label_reference(label_name);
+ return func->add_label_reference(this, label_name, location,
+ issue_goto_errors);
+}
+
+// Return the current binding state.
+
+Bindings_snapshot*
+Gogo::bindings_snapshot(source_location location)
+{
+ return new Bindings_snapshot(this->current_block(), location);
}
// Add a statement.
@@ -2017,7 +2027,7 @@ Order_eval::statement(Block* block, size_t* pindex, Statement* s)
// be handled specially. We can't create a temporary
// because there is no type to give it. Any actual uses of
// the values will be done via Call_result_expressions.
- s = Statement::make_statement(*pexpr);
+ s = Statement::make_statement(*pexpr, true);
}
block->insert_statement_before(*pindex, s);
@@ -2072,7 +2082,7 @@ Order_eval::variable(Named_object* no)
{
// A call expression which returns multiple results needs to
// be handled specially.
- s = Statement::make_statement(*pexpr);
+ s = Statement::make_statement(*pexpr, true);
}
var->add_preinit_statement(this->gogo_, s);
}
@@ -2266,7 +2276,7 @@ Build_recover_thunks::function(Named_object* orig_no)
Statement* s;
if (orig_fntype->results() == NULL || orig_fntype->results()->empty())
- s = Statement::make_statement(call);
+ s = Statement::make_statement(call, true);
else
{
Expression_list* vals = new Expression_list();
@@ -2843,30 +2853,24 @@ Function::is_method() const
// Add a label definition.
Label*
-Function::add_label_definition(const std::string& label_name,
+Function::add_label_definition(Gogo* gogo, const std::string& label_name,
source_location location)
{
Label* lnull = NULL;
std::pair<Labels::iterator, bool> ins =
this->labels_.insert(std::make_pair(label_name, lnull));
+ Label* label;
if (ins.second)
{
// This is a new label.
- Label* label = new Label(label_name);
- label->define(location);
+ label = new Label(label_name);
ins.first->second = label;
- return label;
}
else
{
// The label was already in the hash table.
- Label* label = ins.first->second;
- if (!label->is_defined())
- {
- label->define(location);
- return label;
- }
- else
+ label = ins.first->second;
+ if (label->is_defined())
{
error_at(location, "label %qs already defined",
Gogo::message_name(label_name).c_str());
@@ -2875,31 +2879,55 @@ Function::add_label_definition(const std::string& label_name,
return new Label(label_name);
}
}
+
+ label->define(location, gogo->bindings_snapshot(location));
+
+ // Issue any errors appropriate for any previous goto's to this
+ // label.
+ const std::vector<Bindings_snapshot*>& refs(label->refs());
+ for (std::vector<Bindings_snapshot*>::const_iterator p = refs.begin();
+ p != refs.end();
+ ++p)
+ (*p)->check_goto_to(gogo->current_block());
+ label->clear_refs();
+
+ return label;
}
// Add a reference to a label.
Label*
-Function::add_label_reference(const std::string& label_name)
+Function::add_label_reference(Gogo* gogo, const std::string& label_name,
+ source_location location, bool issue_goto_errors)
{
Label* lnull = NULL;
std::pair<Labels::iterator, bool> ins =
this->labels_.insert(std::make_pair(label_name, lnull));
+ Label* label;
if (!ins.second)
{
// The label was already in the hash table.
- Label* label = ins.first->second;
- label->set_is_used();
- return label;
+ label = ins.first->second;
}
else
{
go_assert(ins.first->second == NULL);
- Label* label = new Label(label_name);
+ label = new Label(label_name);
ins.first->second = label;
- label->set_is_used();
- return label;
}
+
+ label->set_is_used();
+
+ if (issue_goto_errors)
+ {
+ Bindings_snapshot* snapshot = label->snapshot();
+ if (snapshot != NULL)
+ snapshot->check_goto_from(gogo->current_block(), location);
+ else
+ label->add_snapshot_ref(gogo->bindings_snapshot(location));
+ }
+
+ return label;
}
// Warn about labels that are defined but not used.
@@ -3407,6 +3435,92 @@ Block::get_backend(Translate_context* context)
return ret;
}
+// Class Bindings_snapshot.
+
+Bindings_snapshot::Bindings_snapshot(const Block* b, source_location location)
+ : block_(b), counts_(), location_(location)
+{
+ while (b != NULL)
+ {
+ this->counts_.push_back(b->bindings()->size_definitions());
+ b = b->enclosing();
+ }
+}
+
+// Report errors appropriate for a goto from B to this.
+
+void
+Bindings_snapshot::check_goto_from(const Block* b, source_location loc)
+{
+ size_t dummy;
+ if (!this->check_goto_block(loc, b, this->block_, &dummy))
+ return;
+ this->check_goto_defs(loc, this->block_,
+ this->block_->bindings()->size_definitions(),
+ this->counts_[0]);
+}
+
+// Report errors appropriate for a goto from this to B.
+
+void
+Bindings_snapshot::check_goto_to(const Block* b)
+{
+ size_t index;
+ if (!this->check_goto_block(this->location_, this->block_, b, &index))
+ return;
+ this->check_goto_defs(this->location_, b, this->counts_[index],
+ b->bindings()->size_definitions());
+}
+
+// Report errors appropriate for a goto at LOC from BFROM to BTO.
+// Return true if all is well, false if we reported an error. If this
+// returns true, it sets *PINDEX to the number of blocks BTO is above
+// BFROM.
+
+bool
+Bindings_snapshot::check_goto_block(source_location loc, const Block* bfrom,
+ const Block* bto, size_t* pindex)
+{
+ // It is an error if BTO is not either BFROM or above BFROM.
+ size_t index = 0;
+ for (const Block* pb = bfrom; pb != bto; pb = pb->enclosing(), ++index)
+ {
+ if (pb == NULL)
+ {
+ error_at(loc, "goto jumps into block");
+ inform(bto->start_location(), "goto target block starts here");
+ return false;
+ }
+ }
+ *pindex = index;
+ return true;
+}
+
+// Report errors appropriate for a goto at LOC ending at BLOCK, where
+// CFROM is the number of names defined at the point of the goto and
+// CTO is the number of names defined at the point of the label.
+
+void
+Bindings_snapshot::check_goto_defs(source_location loc, const Block* block,
+ size_t cfrom, size_t cto)
+{
+ if (cfrom < cto)
+ {
+ Bindings::const_definitions_iterator p =
+ block->bindings()->begin_definitions();
+ for (size_t i = 0; i < cfrom; ++i)
+ {
+ go_assert(p != block->bindings()->end_definitions());
+ ++p;
+ }
+ go_assert(p != block->bindings()->end_definitions());
+
+ std::string n = (*p)->message_name();
+ error_at(loc, "goto jumps over declaration of %qs", n.c_str());
+ inform((*p)->location(), "%qs defined here", n.c_str());
+ }
+}
+
// Class Variable.
Variable::Variable(Type* type, Expression* init, bool is_global,
@@ -4482,6 +4596,12 @@ Bindings::new_definition(Named_object* old_object, Named_object* new_object)
case Named_object::NAMED_OBJECT_VAR:
case Named_object::NAMED_OBJECT_RESULT_VAR:
+ // We have already given an error in the parser for cases where
+ // one parameter or result variable redeclares another one.
+ if ((new_object->is_variable()
+ && new_object->var_value()->is_parameter())
+ || new_object->is_result_variable())
+ return old_object;
break;
case Named_object::NAMED_OBJECT_SINK:
@@ -4692,6 +4812,18 @@ Bindings::traverse(Traverse* traverse, bool is_global)
// Class Label.
+// Clear any references to this label.
+
+void
+Label::clear_refs()
+{
+ for (std::vector<Bindings_snapshot*>::iterator p = this->refs_.begin();
+ p != this->refs_.end();
+ ++p)
+ delete *p;
+ this->refs_.clear();
+}
+
// Get the backend representation for a label.
Blabel*
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h
index dae22f51c05..91e814c31d8 100644
--- a/gcc/go/gofrontend/gogo.h
+++ b/gcc/go/gofrontend/gogo.h
@@ -22,6 +22,7 @@ class Temporary_statement;
class Block;
class Function;
class Bindings;
+class Bindings_snapshot;
class Package;
class Variable;
class Pointer_type;
@@ -246,6 +247,10 @@ class Gogo
Named_object*
current_function() const;
+ // Return the current block.
+ Block*
+ current_block();
+
// Start a new block. This is not initially associated with a
// function.
void
@@ -269,9 +274,16 @@ class Gogo
Label*
add_label_definition(const std::string&, source_location);
- // Add a label reference.
+ // Add a label reference. ISSUE_GOTO_ERRORS is true if we should
+ // report errors for a goto from the current location to the label
+ // location.
Label*
- add_label_reference(const std::string&);
+ add_label_reference(const std::string&, source_location,
+ bool issue_goto_errors);
+
+ // Return a snapshot of the current binding state.
+ Bindings_snapshot*
+ bindings_snapshot(source_location);
// Add a statement to the current block.
void
@@ -551,10 +563,6 @@ class Gogo
const Bindings*
current_bindings() const;
- // Return the current block.
- Block*
- current_block();
-
// Get the name of the magic initialization function.
const std::string&
get_init_fn_name();
@@ -833,11 +841,14 @@ class Function
// Add a label definition to the function.
Label*
- add_label_definition(const std::string& label_name, source_location);
+ add_label_definition(Gogo*, const std::string& label_name, source_location);
- // Add a label reference to a function.
+ // Add a label reference to a function. ISSUE_GOTO_ERRORS is true
+ // if we should report errors for a goto from the current location
+ // to the label location.
Label*
- add_label_reference(const std::string& label_name);
+ add_label_reference(Gogo*, const std::string& label_name,
+ source_location, bool issue_goto_errors);
// Warn about labels that are defined but not used.
void
@@ -980,6 +991,40 @@ class Function
bool has_recover_thunk_;
};
+// A snapshot of the current binding state.
+
+class Bindings_snapshot
+{
+ public:
+ Bindings_snapshot(const Block*, source_location);
+
+ // Report any errors appropriate for a goto from the current binding
+ // state of B to this one.
+ void
+ check_goto_from(const Block* b, source_location);
+
+ // Report any errors appropriate for a goto from this binding state
+ // to the current state of B.
+ void
+ check_goto_to(const Block* b);
+
+ private:
+ bool
+ check_goto_block(source_location, const Block*, const Block*, size_t*);
+
+ void
+ check_goto_defs(source_location, const Block*, size_t, size_t);
+
+ // The current block.
+ const Block* block_;
+ // The number of names currently defined in each open block.
+ // Element 0 is this->block_, element 1 is
+ // this->block_->enclosing(), etc.
+ std::vector<size_t> counts_;
+ // The location where this snapshot was taken.
+ source_location location_;
+};
+
// A function declaration.
class Function_declaration
@@ -2108,7 +2153,8 @@ class Label
{
public:
Label(const std::string& name)
- : name_(name), location_(0), is_used_(false), blabel_(NULL)
+ : name_(name), location_(0), snapshot_(NULL), refs_(), is_used_(false),
+ blabel_(NULL)
{ }
// Return the label's name.
@@ -2136,12 +2182,36 @@ class Label
location() const
{ return this->location_; }
- // Define the label at LOCATION.
+ // Return the bindings snapshot.
+ Bindings_snapshot*
+ snapshot() const
+ { return this->snapshot_; }
+
+ // Add a snapshot of a goto which refers to this label.
void
- define(source_location location)
+ add_snapshot_ref(Bindings_snapshot* snapshot)
{
go_assert(this->location_ == 0);
+ this->refs_.push_back(snapshot);
+ }
+
+ // Return the list of snapshots of goto statements which refer to
+ // this label.
+ const std::vector<Bindings_snapshot*>&
+ refs() const
+ { return this->refs_; }
+
+ // Clear the references.
+ void
+ clear_refs();
+
+ // Define the label at LOCATION with the given bindings snapshot.
+ void
+ define(source_location location, Bindings_snapshot* snapshot)
+ {
+ go_assert(this->location_ == 0 && this->snapshot_ == NULL);
this->location_ = location;
+ this->snapshot_ = snapshot;
}
// Return the backend representation for this label.
@@ -2160,6 +2230,11 @@ class Label
// The location of the definition. This is 0 if the label has not
// yet been defined.
source_location location_;
+ // A snapshot of the set of bindings defined at this label, used to
+ // issue errors about invalid goto statements.
+ Bindings_snapshot* snapshot_;
+ // A list of snapshots of goto statements which refer to this label.
+ std::vector<Bindings_snapshot*> refs_;
// Whether the label has been used.
bool is_used_;
// The backend representation.
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index b18c9892285..8c42fa2b24f 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -335,10 +335,17 @@ Parse::type_name(bool issue_error)
bool ok = true;
if (named_object == NULL)
{
- if (package != NULL)
- ok = false;
- else
+ if (package == NULL)
named_object = this->gogo_->add_unknown_name(name, location);
+ else
+ {
+ const std::string& packname(package->package_value()->name());
+ error_at(location, "reference to undefined identifier %<%s.%s%>",
+ Gogo::message_name(packname).c_str(),
+ Gogo::message_name(name).c_str());
+ issue_error = false;
+ ok = false;
+ }
}
else if (named_object->is_type())
{
@@ -677,6 +684,32 @@ Parse::channel_type()
return Type::make_channel_type(send, receive, element_type);
}
+// Give an error for a duplicate parameter or receiver name.
+
+void
+Parse::check_signature_names(const Typed_identifier_list* params,
+ Parse::Names* names)
+{
+ for (Typed_identifier_list::const_iterator p = params->begin();
+ p != params->end();
+ ++p)
+ {
+ if (p->name().empty() || Gogo::is_sink_name(p->name()))
+ continue;
+ std::pair<std::string, const Typed_identifier*> val =
+ std::make_pair(p->name(), &*p);
+ std::pair<Parse::Names::iterator, bool> ins = names->insert(val);
+ if (!ins.second)
+ {
+ error_at(p->location(), "redefinition of %qs",
+ Gogo::message_name(p->name()).c_str());
+ inform(ins.first->second->location(),
+ "previous definition of %qs was here",
+ Gogo::message_name(p->name()).c_str());
+ }
+ }
+}
+
// Signature = Parameters [ Result ] .
// RECEIVER is the receiver if there is one, or NULL. LOCATION is the
@@ -691,18 +724,24 @@ Parse::signature(Typed_identifier* receiver, source_location location)
Typed_identifier_list* params;
bool params_ok = this->parameters(&params, &is_varargs);
- Typed_identifier_list* result = NULL;
+ Typed_identifier_list* results = NULL;
if (this->peek_token()->is_op(OPERATOR_LPAREN)
|| this->type_may_start_here())
{
- if (!this->result(&result))
+ if (!this->result(&results))
return NULL;
}
if (!params_ok)
return NULL;
- Function_type* ret = Type::make_function_type(receiver, params, result,
+ Parse::Names names;
+ if (params != NULL)
+ this->check_signature_names(params, &names);
+ if (results != NULL)
+ this->check_signature_names(results, &names);
+
+ Function_type* ret = Type::make_function_type(receiver, params, results,
location);
if (is_varargs)
ret->set_is_varargs();
@@ -1260,6 +1299,13 @@ Parse::declaration_may_start_here()
void
Parse::decl(void (Parse::*pfn)(void*), void* varg)
{
+ if (this->peek_token()->is_eof())
+ {
+ if (!saw_errors())
+ error_at(this->location(), "unexpected end of file");
+ return;
+ }
+
if (!this->peek_token()->is_op(OPERATOR_LPAREN))
(this->*pfn)(varg);
else
@@ -1839,7 +1885,7 @@ Parse::init_var(const Typed_identifier& tid, Type* type, Expression* init,
if (!type_from_init && init != NULL)
{
if (!this->gogo_->in_global_scope())
- this->gogo_->add_statement(Statement::make_statement(init));
+ this->gogo_->add_statement(Statement::make_statement(init, true));
else
return this->create_dummy_global(type, init, location);
}
@@ -3460,7 +3506,21 @@ Parse::simple_stat(bool may_be_composite_lit, bool* return_exp,
else if (return_exp != NULL)
return this->verify_not_sink(exp);
else
- this->expression_stat(this->verify_not_sink(exp));
+ {
+ exp = this->verify_not_sink(exp);
+
+ if (token->is_op(OPERATOR_COLONEQ))
+ {
+ if (!exp->is_error_expression())
+ error_at(token->location(), "non-name on left side of %<:=%>");
+ while (!token->is_op(OPERATOR_SEMICOLON)
+ && !token->is_eof())
+ token = this->advance_token();
+ return NULL;
+ }
+
+ this->expression_stat(exp);
+ }
return NULL;
}
@@ -3506,8 +3566,7 @@ Parse::statement_list_may_start_here()
void
Parse::expression_stat(Expression* exp)
{
- exp->discarding_value();
- this->gogo_->add_statement(Statement::make_statement(exp));
+ this->gogo_->add_statement(Statement::make_statement(exp, false));
}
// SendStmt = Channel "&lt;-" Expression .
@@ -3782,7 +3841,8 @@ Parse::return_stat()
this->gogo_->add_statement(Statement::make_return_statement(vals, location));
}
-// IfStmt = "if" [ SimpleStmt ";" ] Expression Block [ "else" Statement ] .
+// IfStmt = "if" [ SimpleStmt ";" ] Expression Block
+// [ "else" ( IfStmt | Block ) ] .
void
Parse::if_stat()
@@ -3852,10 +3912,17 @@ Parse::if_stat()
Block* else_block = NULL;
if (this->peek_token()->is_keyword(KEYWORD_ELSE))
{
- this->advance_token();
- // We create a block to gather the statement.
this->gogo_->start_block(this->location());
- this->statement(NULL);
+ const Token* token = this->advance_token();
+ if (token->is_keyword(KEYWORD_IF))
+ this->if_stat();
+ else if (token->is_op(OPERATOR_LCURLY))
+ this->block();
+ else
+ {
+ error_at(this->location(), "expected %<if%> or %<{%>");
+ this->statement(NULL);
+ }
else_block = this->gogo_->finish_block(this->location());
}
@@ -4234,8 +4301,19 @@ Parse::type_switch_case(std::vector<Type*>* types, bool* is_default)
while (true)
{
Type* t = this->type();
+
if (!t->is_error_type())
types->push_back(t);
+ else
+ {
+ token = this->peek_token();
+ while (!token->is_op(OPERATOR_COLON)
+ && !token->is_op(OPERATOR_COMMA)
+ && !token->is_op(OPERATOR_RCURLY)
+ && !token->is_eof())
+ token = this->advance_token();
+ }
+
if (!this->peek_token()->is_op(OPERATOR_COMMA))
break;
this->advance_token();
@@ -4883,7 +4961,7 @@ Parse::break_stat()
{
// If there is a label with this name, mark it as used to
// avoid a useless error about an unused label.
- this->gogo_->add_label_reference(token->identifier());
+ this->gogo_->add_label_reference(token->identifier(), 0, false);
error_at(token->location(), "invalid break label %qs",
Gogo::message_name(token->identifier()).c_str());
@@ -4938,7 +5016,7 @@ Parse::continue_stat()
{
// If there is a label with this name, mark it as used to
// avoid a useless error about an unused label.
- this->gogo_->add_label_reference(token->identifier());
+ this->gogo_->add_label_reference(token->identifier(), 0, false);
error_at(token->location(), "invalid continue label %qs",
Gogo::message_name(token->identifier()).c_str());
@@ -4972,7 +5050,8 @@ Parse::goto_stat()
error_at(this->location(), "expected label for goto");
else
{
- Label* label = this->gogo_->add_label_reference(token->identifier());
+ Label* label = this->gogo_->add_label_reference(token->identifier(),
+ location, true);
Statement* s = Statement::make_goto_statement(label, location);
this->gogo_->add_statement(s);
this->advance_token();
diff --git a/gcc/go/gofrontend/parse.h b/gcc/go/gofrontend/parse.h
index f072fd35932..0da86fbae42 100644
--- a/gcc/go/gofrontend/parse.h
+++ b/gcc/go/gofrontend/parse.h
@@ -131,6 +131,9 @@ class Parse
// A set of Enclosing_var entries.
typedef std::set<Enclosing_var, Enclosing_var_comparison> Enclosing_vars;
+ // Used to detect duplicate parameter/result names.
+ typedef std::map<std::string, const Typed_identifier*> Names;
+
// Peek at the current token from the lexer.
const Token*
peek_token();
@@ -165,6 +168,7 @@ class Parse
void field_decl(Struct_field_list*);
Type* pointer_type();
Type* channel_type();
+ void check_signature_names(const Typed_identifier_list*, Names*);
Function_type* signature(Typed_identifier*, source_location);
bool parameters(Typed_identifier_list**, bool* is_varargs);
Typed_identifier_list* parameter_list(bool* is_varargs);
diff --git a/gcc/go/gofrontend/runtime.def b/gcc/go/gofrontend/runtime.def
index a7828edeb2e..a72942d385d 100644
--- a/gcc/go/gofrontend/runtime.def
+++ b/gcc/go/gofrontend/runtime.def
@@ -87,8 +87,8 @@ DEF_GO_RUNTIME(MAP_INDEX, "__go_map_index", P3(MAP, POINTER, BOOL),
R1(POINTER))
// Look up a key in a map returning whether it is present.
-DEF_GO_RUNTIME(MAPACCESS2, "runtime.mapaccess2", P3(MAP, POINTER, POINTER),
- R1(BOOL))
+DEF_GO_RUNTIME(MAPACCESS2, "runtime.mapaccess2",
+ P4(TYPE, MAP, POINTER, POINTER), R1(BOOL))
// Tuple assignment to a map element.
DEF_GO_RUNTIME(MAPASSIGN2, "runtime.mapassign2",
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index 82be1129028..8c1f168d950 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -924,7 +924,7 @@ Tuple_assignment_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
if ((*plhs)->is_sink_expression())
{
- b->add_statement(Statement::make_statement(*prhs));
+ b->add_statement(Statement::make_statement(*prhs, true));
continue;
}
@@ -1085,14 +1085,16 @@ Tuple_map_assignment_statement::do_lower(Gogo*, Named_object*,
Statement::make_temporary(Type::lookup_bool_type(), NULL, loc);
b->add_statement(present_temp);
- // present_temp = mapaccess2(MAP, &key_temp, &val_temp)
+ // present_temp = mapaccess2(DESCRIPTOR, MAP, &key_temp, &val_temp)
+ Expression* a1 = Expression::make_type_descriptor(map_type, loc);
+ Expression* a2 = map_index->map();
Temporary_reference_expression* ref =
Expression::make_temporary_reference(key_temp, loc);
- Expression* a1 = Expression::make_unary(OPERATOR_AND, ref, loc);
+ Expression* a3 = Expression::make_unary(OPERATOR_AND, ref, loc);
ref = Expression::make_temporary_reference(val_temp, loc);
- Expression* a2 = Expression::make_unary(OPERATOR_AND, ref, loc);
- Expression* call = Runtime::make_call(Runtime::MAPACCESS2, loc, 3,
- map_index->map(), a1, a2);
+ Expression* a4 = Expression::make_unary(OPERATOR_AND, ref, loc);
+ Expression* call = Runtime::make_call(Runtime::MAPACCESS2, loc, 4,
+ a1, a2, a3, a4);
ref = Expression::make_temporary_reference(present_temp, loc);
ref->set_is_lvalue();
@@ -1240,7 +1242,7 @@ Map_assignment_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
Expression* p4 = Expression::make_temporary_reference(insert_temp, loc);
Expression* call = Runtime::make_call(Runtime::MAPASSIGN2, loc, 4,
p1, p2, p3, p4);
- Statement* s = Statement::make_statement(call);
+ Statement* s = Statement::make_statement(call, true);
b->add_statement(s);
return Statement::make_block_statement(b, loc);
@@ -1614,9 +1616,9 @@ Statement::make_tuple_type_guard_assignment(Expression* val, Expression* ok,
class Expression_statement : public Statement
{
public:
- Expression_statement(Expression* expr)
+ Expression_statement(Expression* expr, bool is_ignored)
: Statement(STATEMENT_EXPRESSION, expr->location()),
- expr_(expr)
+ expr_(expr), is_ignored_(is_ignored)
{ }
Expression*
@@ -1632,6 +1634,9 @@ class Expression_statement : public Statement
do_determine_types()
{ this->expr_->determine_type_no_context(); }
+ void
+ do_check_types(Gogo*);
+
bool
do_may_fall_through() const;
@@ -1643,8 +1648,21 @@ class Expression_statement : public Statement
private:
Expression* expr_;
+ // Whether the value of this expression is being explicitly ignored.
+ bool is_ignored_;
};
+// Check the types of an expression statement. The only check we do
+// is to possibly give an error about discarding the value of the
+// expression.
+
+void
+Expression_statement::do_check_types(Gogo*)
+{
+ if (!this->is_ignored_)
+ this->expr_->discarding_value();
+}
+
// An expression statement may fall through unless it is a call to a
// function which does not return.
@@ -1699,9 +1717,9 @@ Expression_statement::do_dump_statement(Ast_dump_context* ast_dump_context)
// Make an expression statement from an Expression.
Statement*
-Statement::make_statement(Expression* expr)
+Statement::make_statement(Expression* expr, bool is_ignored)
{
- return new Expression_statement(expr);
+ return new Expression_statement(expr, is_ignored);
}
// A block statement--a list of statements which may include variable
@@ -2275,7 +2293,7 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name)
Label* retaddr_label = NULL;
if (may_call_recover)
{
- retaddr_label = gogo->add_label_reference("retaddr");
+ retaddr_label = gogo->add_label_reference("retaddr", location, false);
Expression* arg = Expression::make_label_addr(retaddr_label, location);
Expression* call = Runtime::make_call(Runtime::SET_DEFER_RETADDR,
location, 1, arg);
@@ -2374,7 +2392,7 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name)
// receiver parameter.
call->set_varargs_are_lowered();
- Statement* call_statement = Statement::make_statement(call);
+ Statement* call_statement = Statement::make_statement(call, true);
gogo->add_statement(call_statement);
@@ -3791,7 +3809,7 @@ Switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
Expression* val = this->val_;
if (val == NULL)
val = Expression::make_boolean(true, loc);
- return Statement::make_statement(val);
+ return Statement::make_statement(val, true);
}
Temporary_statement* val_temp;
@@ -4516,7 +4534,7 @@ Select_clauses::Select_clause::lower(Gogo* gogo, Named_object* function,
}
else
{
- init->add_statement(Statement::make_statement(recv));
+ init->add_statement(Statement::make_statement(recv, true));
}
}
@@ -5593,7 +5611,7 @@ For_range_statement::lower_range_map(Gogo*,
Expression* ref = Expression::make_temporary_reference(hiter, loc);
Expression* p2 = Expression::make_unary(OPERATOR_AND, ref, loc);
Expression* call = Runtime::make_call(Runtime::MAPITERINIT, loc, 2, p1, p2);
- init->add_statement(Statement::make_statement(call));
+ init->add_statement(Statement::make_statement(call, true));
*pinit = init;
@@ -5634,7 +5652,7 @@ For_range_statement::lower_range_map(Gogo*,
Expression* p3 = Expression::make_unary(OPERATOR_AND, ref, loc);
call = Runtime::make_call(Runtime::MAPITER2, loc, 3, p1, p2, p3);
}
- iter_init->add_statement(Statement::make_statement(call));
+ iter_init->add_statement(Statement::make_statement(call, true));
*piter_init = iter_init;
@@ -5646,7 +5664,7 @@ For_range_statement::lower_range_map(Gogo*,
ref = Expression::make_temporary_reference(hiter, loc);
p1 = Expression::make_unary(OPERATOR_AND, ref, loc);
call = Runtime::make_call(Runtime::MAPITERNEXT, loc, 1, p1);
- post->add_statement(Statement::make_statement(call));
+ post->add_statement(Statement::make_statement(call, true));
*ppost = post;
}
diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h
index a22090a5fe9..86b0f305148 100644
--- a/gcc/go/gofrontend/statements.h
+++ b/gcc/go/gofrontend/statements.h
@@ -178,9 +178,11 @@ class Statement
Expression* expr, Type* type,
source_location);
- // Make an expression statement from an Expression.
+ // Make an expression statement from an Expression. IS_IGNORED is
+ // true if the value is being explicitly ignored, as in an
+ // assignment to _.
static Statement*
- make_statement(Expression*);
+ make_statement(Expression*, bool is_ignored);
// Make a block statement from a Block. This is an embedded list of
// statements which may also include variable definitions.
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index fa3332ad556..68c35f40764 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -7432,7 +7432,7 @@ Type::build_one_stub_method(Gogo* gogo, Method* method,
call->set_hidden_fields_are_ok();
size_t count = call->result_count();
if (count == 0)
- gogo->add_statement(Statement::make_statement(call));
+ gogo->add_statement(Statement::make_statement(call, true));
else
{
Expression_list* retvals = new Expression_list();
diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc
index 80b367cc46d..434932bbeb0 100644
--- a/gcc/go/gofrontend/unsafe.cc
+++ b/gcc/go/gofrontend/unsafe.cc
@@ -31,6 +31,7 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported,
return;
}
+ package->set_location(location);
package->set_is_imported();
Bindings* bindings = package->bindings();
diff --git a/gcc/godump.c b/gcc/godump.c
index 3f78eead279..11cd32998ec 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -301,11 +301,13 @@ go_define (unsigned int lineno, const char *buffer)
case '\'':
{
char quote;
+ int count;
if (saw_operand)
goto unknown;
quote = *p;
*q++ = *p++;
+ count = 0;
while (*p != quote)
{
int c;
@@ -313,6 +315,8 @@ go_define (unsigned int lineno, const char *buffer)
if (*p == '\0')
goto unknown;
+ ++count;
+
if (*p != '\\')
{
*q++ = *p++;
@@ -358,7 +362,15 @@ go_define (unsigned int lineno, const char *buffer)
goto unknown;
}
}
+
*q++ = *p++;
+
+ if (quote == '\'' && count != 1)
+ goto unknown;
+
+ saw_operand = true;
+ need_operand = false;
+
break;
}
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 346056899d3..e8370ef4e5a 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -36,6 +36,9 @@ along with GCC; see the file COPYING3. If not see
#include "graphite-poly.h"
#include "graphite-scop-detection.h"
+/* Forward declarations. */
+static void make_close_phi_nodes_unique (basic_block);
+
/* The type of the analyzed basic block. */
typedef enum gbb_type {
@@ -1231,6 +1234,13 @@ remove_duplicate_close_phi (gimple phi, gimple_stmt_iterator *gsi)
SET_USE (use_p, res);
update_stmt (use_stmt);
+
+ /* It is possible that we just created a duplicate close-phi
+ for an already-processed containing loop. Check for this
+ case and clean it up. */
+ if (gimple_code (use_stmt) == GIMPLE_PHI
+ && gimple_phi_num_args (use_stmt) == 1)
+ make_close_phi_nodes_unique (gimple_bb (use_stmt));
}
remove_phi_node (gsi, true);
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 34a692fd712..a5b4aebefee 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -163,6 +163,31 @@ int issue_rate;
enable a DCE pass. */
bool sched_no_dce;
+/* The current initiation interval used when modulo scheduling. */
+static int modulo_ii;
+
+/* The maximum number of stages we are prepared to handle. */
+static int modulo_max_stages;
+
+/* The number of insns that exist in each iteration of the loop. We use this
+ to detect when we've scheduled all insns from the first iteration. */
+static int modulo_n_insns;
+
+/* The current count of insns in the first iteration of the loop that have
+ already been scheduled. */
+static int modulo_insns_scheduled;
+
+/* The maximum uid of insns from the first iteration of the loop. */
+static int modulo_iter0_max_uid;
+
+/* The number of times we should attempt to backtrack when modulo scheduling.
+ Decreased each time we have to backtrack. */
+static int modulo_backtracks_left;
+
+/* The stage in which the last insn from the original loop was
+ scheduled. */
+static int modulo_last_stage;
+
/* sched-verbose controls the amount of debugging output the
scheduler prints. It is controlled by -fsched-verbose=N:
N>0 and no -DSR : the output is directed to stderr.
@@ -507,6 +532,29 @@ haifa_classify_insn (const_rtx insn)
{
return haifa_classify_rtx (PATTERN (insn));
}
+
+/* After the scheduler initialization function has been called, this function
+ can be called to enable modulo scheduling. II is the initiation interval
+ we should use, it affects the delays for delay_pairs that were recorded as
+ separated by a given number of stages.
+
+ MAX_STAGES provides us with a limit
+ after which we give up scheduling; the caller must have unrolled at least
+ as many copies of the loop body and recorded delay_pairs for them.
+
+ INSNS is the number of real (non-debug) insns in one iteration of
+ the loop. MAX_UID can be used to test whether an insn belongs to
+ the first iteration of the loop; all of them have a uid lower than
+ MAX_UID. */
+void
+set_modulo_params (int ii, int max_stages, int insns, int max_uid)
+{
+ modulo_ii = ii;
+ modulo_max_stages = max_stages;
+ modulo_n_insns = insns;
+ modulo_iter0_max_uid = max_uid;
+ modulo_backtracks_left = PARAM_VALUE (PARAM_MAX_MODULO_BACKTRACK_ATTEMPTS);
+}
/* A structure to record a pair of insns where the first one is a real
insn that has delay slots, and the second is its delayed shadow.
@@ -518,6 +566,10 @@ struct delay_pair
struct delay_pair *next_same_i1;
rtx i1, i2;
int cycles;
+ /* When doing modulo scheduling, we a delay_pair can also be used to
+ show that I1 and I2 are the same insn in a different stage. If that
+ is the case, STAGES will be nonzero. */
+ int stages;
};
/* Two hash tables to record delay_pairs, one indexed by I1 and the other
@@ -525,6 +577,62 @@ struct delay_pair
static htab_t delay_htab;
static htab_t delay_htab_i2;
+/* Called through htab_traverse. Walk the hashtable using I2 as
+ index, and delete all elements involving an UID higher than
+ that pointed to by *DATA. */
+static int
+htab_i2_traverse (void **slot, void *data)
+{
+ int maxuid = *(int *)data;
+ struct delay_pair *p = *(struct delay_pair **)slot;
+ if (INSN_UID (p->i2) >= maxuid || INSN_UID (p->i1) >= maxuid)
+ {
+ htab_clear_slot (delay_htab_i2, slot);
+ }
+ return 1;
+}
+
+/* Called through htab_traverse. Walk the hashtable using I2 as
+ index, and delete all elements involving an UID higher than
+ that pointed to by *DATA. */
+static int
+htab_i1_traverse (void **slot, void *data)
+{
+ int maxuid = *(int *)data;
+ struct delay_pair **pslot = (struct delay_pair **)slot;
+ struct delay_pair *p, *first, **pprev;
+
+ if (INSN_UID ((*pslot)->i1) >= maxuid)
+ {
+ htab_clear_slot (delay_htab, slot);
+ return 1;
+ }
+ pprev = &first;
+ for (p = *pslot; p; p = p->next_same_i1)
+ {
+ if (INSN_UID (p->i2) < maxuid)
+ {
+ *pprev = p;
+ pprev = &p->next_same_i1;
+ }
+ }
+ *pprev = NULL;
+ if (first == NULL)
+ htab_clear_slot (delay_htab, slot);
+ else
+ *pslot = first;
+ return 1;
+}
+
+/* Discard all delay pairs which involve an insn with an UID higher
+ than MAX_UID. */
+void
+discard_delay_pairs_above (int max_uid)
+{
+ htab_traverse (delay_htab, htab_i1_traverse, &max_uid);
+ htab_traverse (delay_htab_i2, htab_i2_traverse, &max_uid);
+}
+
/* Returns a hash value for X (which really is a delay_pair), based on
hashing just I1. */
static hashval_t
@@ -555,18 +663,24 @@ delay_i2_eq (const void *x, const void *y)
return ((const struct delay_pair *) x)->i2 == y;
}
-/* This function can be called by a port just before it starts the
- final scheduling pass. It records the fact that an instruction
- with delay slots has been split into two insns, I1 and I2. The
- first one will be scheduled normally and initiates the operation.
- The second one is a shadow which must follow a specific number of
- CYCLES after I1; its only purpose is to show the side effect that
- occurs at that cycle in the RTL. If a JUMP_INSN or a CALL_INSN has
- been split, I1 should be a normal INSN, while I2 retains the
- original insn type. */
+/* This function can be called by a port just before it starts the final
+ scheduling pass. It records the fact that an instruction with delay
+ slots has been split into two insns, I1 and I2. The first one will be
+ scheduled normally and initiates the operation. The second one is a
+ shadow which must follow a specific number of cycles after I1; its only
+ purpose is to show the side effect that occurs at that cycle in the RTL.
+ If a JUMP_INSN or a CALL_INSN has been split, I1 should be a normal INSN,
+ while I2 retains the original insn type.
+
+ There are two ways in which the number of cycles can be specified,
+ involving the CYCLES and STAGES arguments to this function. If STAGES
+ is zero, we just use the value of CYCLES. Otherwise, STAGES is a factor
+ which is multiplied by MODULO_II to give the number of cycles. This is
+ only useful if the caller also calls set_modulo_params to enable modulo
+ scheduling. */
void
-record_delay_slot_pair (rtx i1, rtx i2, int cycles)
+record_delay_slot_pair (rtx i1, rtx i2, int cycles, int stages)
{
struct delay_pair *p = XNEW (struct delay_pair);
struct delay_pair **slot;
@@ -574,6 +688,7 @@ record_delay_slot_pair (rtx i1, rtx i2, int cycles)
p->i1 = i1;
p->i2 = i2;
p->cycles = cycles;
+ p->stages = stages;
if (!delay_htab)
{
@@ -596,7 +711,10 @@ record_delay_slot_pair (rtx i1, rtx i2, int cycles)
static int
pair_delay (struct delay_pair *p)
{
- return p->cycles;
+ if (p->stages == 0)
+ return p->cycles;
+ else
+ return p->stages * modulo_ii;
}
/* Given an insn INSN, add a dependence on its delayed shadow if it
@@ -619,6 +737,8 @@ add_delay_dependencies (rtx insn)
if (!pair)
return;
add_dependence (insn, pair->i1, REG_DEP_ANTI);
+ if (pair->stages)
+ return;
FOR_EACH_DEP (pair->i2, SD_LIST_BACK, sd_it, dep)
{
@@ -626,7 +746,7 @@ add_delay_dependencies (rtx insn)
struct delay_pair *other_pair
= (struct delay_pair *)htab_find_with_hash (delay_htab_i2, pro,
htab_hash_pointer (pro));
- if (!other_pair)
+ if (!other_pair || other_pair->stages)
continue;
if (pair_delay (other_pair) >= pair_delay (pair))
{
@@ -1851,6 +1971,9 @@ struct sched_block_state
/* True if a shadow insn has been scheduled in the current cycle, which
means that no more normal insns can be issued. */
bool shadows_only_p;
+ /* True if we're winding down a modulo schedule, which means that we only
+ issue insns with INSN_EXACT_TICK set. */
+ bool modulo_epilogue;
/* Initialized with the machine's issue rate every cycle, and updated
by calls to the variable_issue hook. */
int can_issue_more;
@@ -2223,7 +2346,7 @@ save_backtrack_point (struct delay_pair *pair,
mark_backtrack_feeds (pair->i2, 1);
INSN_TICK (pair->i2) = INVALID_TICK;
INSN_EXACT_TICK (pair->i2) = clock_var + pair_delay (pair);
- SHADOW_P (pair->i2) = true;
+ SHADOW_P (pair->i2) = pair->stages == 0;
pair = pair->next_same_i1;
}
}
@@ -2249,11 +2372,14 @@ unschedule_insns_until (rtx insn)
if (last != insn)
INSN_TICK (last) = INVALID_TICK;
+ if (modulo_ii > 0 && INSN_UID (last) < modulo_iter0_max_uid)
+ modulo_insns_scheduled--;
+
for (sd_it = sd_iterator_start (last, SD_LIST_RES_FORW);
sd_iterator_cond (&sd_it, &dep);)
{
rtx con = DEP_CON (dep);
- TODO_SPEC (con) |= HARD_DEP;
+ TODO_SPEC (con) = HARD_DEP;
INSN_TICK (con) = INVALID_TICK;
sd_unresolve_dep (sd_it);
}
@@ -2467,6 +2593,56 @@ estimate_shadow_tick (struct delay_pair *p)
return 0;
}
+/* If INSN has no unresolved backwards dependencies, add it to the schedule and
+ recursively resolve all its forward dependencies. */
+static void
+resolve_dependencies (rtx insn)
+{
+ sd_iterator_def sd_it;
+ dep_t dep;
+
+ /* Don't use sd_lists_empty_p; it ignores debug insns. */
+ if (DEPS_LIST_FIRST (INSN_HARD_BACK_DEPS (insn)) != NULL
+ || DEPS_LIST_FIRST (INSN_SPEC_BACK_DEPS (insn)) != NULL)
+ return;
+
+ if (sched_verbose >= 4)
+ fprintf (sched_dump, ";;\tquickly resolving %d\n", INSN_UID (insn));
+
+ if (QUEUE_INDEX (insn) >= 0)
+ queue_remove (insn);
+
+ VEC_safe_push (rtx, heap, scheduled_insns, insn);
+
+ /* Update dependent instructions. */
+ for (sd_it = sd_iterator_start (insn, SD_LIST_FORW);
+ sd_iterator_cond (&sd_it, &dep);)
+ {
+ rtx next = DEP_CON (dep);
+
+ if (sched_verbose >= 4)
+ fprintf (sched_dump, ";;\t\tdep %d against %d\n", INSN_UID (insn),
+ INSN_UID (next));
+
+ /* Resolve the dependence between INSN and NEXT.
+ sd_resolve_dep () moves current dep to another list thus
+ advancing the iterator. */
+ sd_resolve_dep (sd_it);
+
+ if (!IS_SPECULATION_BRANCHY_CHECK_P (insn))
+ {
+ resolve_dependencies (next);
+ }
+ else
+ /* Check always has only one forward dependence (to the first insn in
+ the recovery block), therefore, this will be executed only once. */
+ {
+ gcc_assert (sd_lists_empty_p (insn, SD_LIST_FORW));
+ }
+ }
+}
+
+
/* Return the head and tail pointers of ebb starting at BEG and ending
at END. */
void
@@ -3448,15 +3624,12 @@ commit_schedule (rtx prev_head, rtx tail, basic_block *target_bb)
issue an asm statement.
If SHADOWS_ONLY_P is true, we eliminate all real insns and only
- leave those for which SHADOW_P is true.
-
- Return the number of cycles we must
- advance to find the next ready instruction, or zero if there remain
- insns on the ready list. */
+ leave those for which SHADOW_P is true. If MODULO_EPILOGUE is true,
+ we only leave insns which have an INSN_EXACT_TICK. */
static void
prune_ready_list (state_t temp_state, bool first_cycle_insn_p,
- bool shadows_only_p)
+ bool shadows_only_p, bool modulo_epilogue_p)
{
int i;
@@ -3467,6 +3640,12 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p,
int cost = 0;
const char *reason = "resource conflict";
+ if (modulo_epilogue_p && !DEBUG_INSN_P (insn)
+ && INSN_EXACT_TICK (insn) == INVALID_TICK)
+ {
+ cost = max_insn_queue_index;
+ reason = "not an epilogue insn";
+ }
if (shadows_only_p && !DEBUG_INSN_P (insn) && !SHADOW_P (insn))
{
cost = 1;
@@ -3580,10 +3759,11 @@ verify_shadows (void)
TARGET_BB, possibly bringing insns from subsequent blocks in the same
region. */
-void
+bool
schedule_block (basic_block *target_bb)
{
int i;
+ bool success = modulo_ii == 0;
struct sched_block_state ls;
state_t temp_state = NULL; /* It is used for multipass scheduling. */
int sort_p, advance, start_clock_var;
@@ -3704,6 +3884,9 @@ schedule_block (basic_block *target_bb)
gcc_assert (VEC_length (rtx, scheduled_insns) == 0);
sort_p = TRUE;
must_backtrack = false;
+ modulo_insns_scheduled = 0;
+
+ ls.modulo_epilogue = false;
/* Loop until all the insns in BB are scheduled. */
while ((*current_sched_info->schedule_more_p) ())
@@ -3733,8 +3916,41 @@ schedule_block (basic_block *target_bb)
}
while (advance > 0);
- if (ready.n_ready > 0)
- prune_ready_list (temp_state, true, false);
+ if (ls.modulo_epilogue)
+ {
+ int stage = clock_var / modulo_ii;
+ if (stage > modulo_last_stage * 2 + 2)
+ {
+ if (sched_verbose >= 2)
+ fprintf (sched_dump,
+ ";;\t\tmodulo scheduled succeeded at II %d\n",
+ modulo_ii);
+ success = true;
+ goto end_schedule;
+ }
+ }
+ else if (modulo_ii > 0)
+ {
+ int stage = clock_var / modulo_ii;
+ if (stage > modulo_max_stages)
+ {
+ if (sched_verbose >= 2)
+ fprintf (sched_dump,
+ ";;\t\tfailing schedule due to excessive stages\n");
+ goto end_schedule;
+ }
+ if (modulo_n_insns == modulo_insns_scheduled
+ && stage > modulo_last_stage)
+ {
+ if (sched_verbose >= 2)
+ fprintf (sched_dump,
+ ";;\t\tfound kernel after %d stages, II %d\n",
+ stage, modulo_ii);
+ ls.modulo_epilogue = true;
+ }
+ }
+
+ prune_ready_list (temp_state, true, false, ls.modulo_epilogue);
if (ready.n_ready == 0)
continue;
if (must_backtrack)
@@ -3912,6 +4128,11 @@ schedule_block (basic_block *target_bb)
/* DECISION is made. */
+ if (modulo_ii > 0 && INSN_UID (insn) < modulo_iter0_max_uid)
+ {
+ modulo_insns_scheduled++;
+ modulo_last_stage = clock_var / modulo_ii;
+ }
if (TODO_SPEC (insn) & SPECULATIVE)
generate_recovery_code (insn);
@@ -3964,7 +4185,8 @@ schedule_block (basic_block *target_bb)
ls.first_cycle_insn_p = false;
if (ready.n_ready > 0)
- prune_ready_list (temp_state, false, ls.shadows_only_p);
+ prune_ready_list (temp_state, false, ls.shadows_only_p,
+ ls.modulo_epilogue);
}
do_backtrack:
@@ -3979,6 +4201,12 @@ schedule_block (basic_block *target_bb)
break;
}
}
+ if (must_backtrack && modulo_ii > 0)
+ {
+ if (modulo_backtracks_left == 0)
+ goto end_schedule;
+ modulo_backtracks_left--;
+ }
while (must_backtrack)
{
struct haifa_saved_data *failed;
@@ -4012,7 +4240,48 @@ schedule_block (basic_block *target_bb)
}
}
}
+ if (ls.modulo_epilogue)
+ success = true;
end_schedule:
+ if (modulo_ii > 0)
+ {
+ /* Once again, debug insn suckiness: they can be on the ready list
+ even if they have unresolved dependencies. To make our view
+ of the world consistent, remove such "ready" insns. */
+ restart_debug_insn_loop:
+ for (i = ready.n_ready - 1; i >= 0; i--)
+ {
+ rtx x;
+
+ x = ready_element (&ready, i);
+ if (DEPS_LIST_FIRST (INSN_HARD_BACK_DEPS (x)) != NULL
+ || DEPS_LIST_FIRST (INSN_SPEC_BACK_DEPS (x)) != NULL)
+ {
+ ready_remove (&ready, i);
+ goto restart_debug_insn_loop;
+ }
+ }
+ for (i = ready.n_ready - 1; i >= 0; i--)
+ {
+ rtx x;
+
+ x = ready_element (&ready, i);
+ resolve_dependencies (x);
+ }
+ for (i = 0; i <= max_insn_queue_index; i++)
+ {
+ rtx link;
+ while ((link = insn_queue[i]) != NULL)
+ {
+ rtx x = XEXP (link, 0);
+ insn_queue[i] = XEXP (link, 1);
+ QUEUE_INDEX (x) = QUEUE_NOWHERE;
+ free_INSN_LIST_node (link);
+ resolve_dependencies (x);
+ }
+ }
+ }
+
/* Debug info. */
if (sched_verbose)
{
@@ -4020,11 +4289,11 @@ schedule_block (basic_block *target_bb)
debug_ready_list (&ready);
}
- if (current_sched_info->queue_must_finish_empty)
+ if (modulo_ii == 0 && current_sched_info->queue_must_finish_empty)
/* Sanity check -- queue must be empty now. Meaningless if region has
multiple bbs. */
gcc_assert (!q_size && !ready.n_ready && !ready.n_debug);
- else
+ else if (modulo_ii == 0)
{
/* We must maintain QUEUE_INDEX between blocks in region. */
for (i = ready.n_ready - 1; i >= 0; i--)
@@ -4052,9 +4321,16 @@ schedule_block (basic_block *target_bb)
}
}
- commit_schedule (prev_head, tail, target_bb);
- if (sched_verbose)
- fprintf (sched_dump, ";; total time = %d\n", clock_var);
+ if (success)
+ {
+ commit_schedule (prev_head, tail, target_bb);
+ if (sched_verbose)
+ fprintf (sched_dump, ";; total time = %d\n", clock_var);
+ }
+ else
+ last_scheduled_insn = tail;
+
+ VEC_truncate (rtx, scheduled_insns, 0);
if (!current_sched_info->queue_must_finish_empty
|| haifa_recovery_bb_recently_added_p)
@@ -4092,6 +4368,8 @@ schedule_block (basic_block *target_bb)
current_sched_info->tail = tail;
free_backtrack_queue ();
+
+ return success;
}
/* Set_priorities: compute priority of each insn in the block. */
@@ -4302,6 +4580,8 @@ haifa_sched_init (void)
nr_begin_data = nr_begin_control = nr_be_in_data = nr_be_in_control = 0;
before_recovery = 0;
after_recovery = 0;
+
+ modulo_ii = 0;
}
/* Finish work with the data specific to the Haifa scheduler. */
diff --git a/gcc/hw-doloop.c b/gcc/hw-doloop.c
index 3d59200a84b..4ba7b4c2e74 100644
--- a/gcc/hw-doloop.c
+++ b/gcc/hw-doloop.c
@@ -123,7 +123,7 @@ scan_loop (hwloop_info loop)
df_ref *def_rec;
HARD_REG_SET set_this_insn;
- if (!INSN_P (insn))
+ if (!NONDEBUG_INSN_P (insn))
continue;
if (recog_memoized (insn) < 0
diff --git a/gcc/hwint.h b/gcc/hwint.h
index 2643aee3e01..f5e0beec112 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -102,6 +102,7 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
#define HOST_WIDE_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC HOST_WIDE_INT_PRINT_C
#define HOST_WIDE_INT_PRINT_UNSIGNED "%" HOST_WIDE_INT_PRINT "u"
#define HOST_WIDE_INT_PRINT_HEX "%#" HOST_WIDE_INT_PRINT "x"
+#define HOST_WIDE_INT_PRINT_HEX_PURE "%" HOST_WIDE_INT_PRINT "x"
/* Set HOST_WIDEST_INT. This is a 64-bit type unless the compiler
in use has no 64-bit type at all; in that case it's 32 bits. */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 0fcacb6141f..272cbb7175f 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -85,7 +85,7 @@ static int cond_exec_changed_p;
/* Forward references. */
static int count_bb_insns (const_basic_block);
-static bool cheap_bb_rtx_cost_p (const_basic_block, int);
+static bool cheap_bb_rtx_cost_p (const_basic_block, int, int);
static rtx first_active_insn (basic_block);
static rtx last_active_insn (basic_block, int);
static rtx find_active_insn_before (basic_block, rtx);
@@ -131,20 +131,31 @@ count_bb_insns (const_basic_block bb)
/* Determine whether the total insn_rtx_cost on non-jump insns in
basic block BB is less than MAX_COST. This function returns
- false if the cost of any instruction could not be estimated. */
+ false if the cost of any instruction could not be estimated.
+
+ The cost of the non-jump insns in BB is scaled by REG_BR_PROB_BASE
+ as those insns are being speculated. MAX_COST is scaled with SCALE
+ plus a small fudge factor. */
static bool
-cheap_bb_rtx_cost_p (const_basic_block bb, int max_cost)
+cheap_bb_rtx_cost_p (const_basic_block bb, int scale, int max_cost)
{
int count = 0;
rtx insn = BB_HEAD (bb);
bool speed = optimize_bb_for_speed_p (bb);
+ /* Our branch probability/scaling factors are just estimates and don't
+ account for cases where we can get speculation for free and other
+ secondary benefits. So we fudge the scale factor to make speculating
+ appear a little more profitable. */
+ scale += REG_BR_PROB_BASE / 8;
+ max_cost *= scale;
+
while (1)
{
if (NONJUMP_INSN_P (insn))
{
- int cost = insn_rtx_cost (PATTERN (insn), speed);
+ int cost = insn_rtx_cost (PATTERN (insn), speed) * REG_BR_PROB_BASE;
if (cost == 0)
return false;
@@ -1519,9 +1530,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
}
/* ??? We could handle this if we knew that a load from A or B could
- not fault. This is also true if we've already loaded
+ not trap or fault. This is also true if we've already loaded
from the address along the path from ENTRY. */
- else if (may_trap_p (a) || may_trap_p (b))
+ else if (may_trap_or_fault_p (a) || may_trap_or_fault_p (b))
return FALSE;
/* if (test) x = a + b; else x = c - d;
@@ -3796,8 +3807,8 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest;
basic_block new_bb;
+ int then_bb_index, then_prob;
rtx else_target = NULL_RTX;
- int then_bb_index;
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
@@ -3840,8 +3851,14 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
"\nIF-CASE-1 found, start %d, then %d\n",
test_bb->index, then_bb->index);
- /* THEN is small. */
- if (! cheap_bb_rtx_cost_p (then_bb,
+ if (then_edge->probability)
+ then_prob = REG_BR_PROB_BASE - then_edge->probability;
+ else
+ then_prob = REG_BR_PROB_BASE / 2;
+
+ /* We're speculating from the THEN path, we want to make sure the cost
+ of speculation is within reason. */
+ if (! cheap_bb_rtx_cost_p (then_bb, then_prob,
COSTS_N_INSNS (BRANCH_COST (optimize_bb_for_speed_p (then_edge->src),
predictable_edge_p (then_edge)))))
return FALSE;
@@ -3910,7 +3927,7 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest;
edge else_succ;
- rtx note;
+ int then_prob, else_prob;
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
@@ -3949,9 +3966,19 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
if (then_bb->index < NUM_FIXED_BLOCKS)
return FALSE;
+ if (else_edge->probability)
+ {
+ else_prob = else_edge->probability;
+ then_prob = REG_BR_PROB_BASE - else_prob;
+ }
+ else
+ {
+ else_prob = REG_BR_PROB_BASE / 2;
+ then_prob = REG_BR_PROB_BASE / 2;
+ }
+
/* ELSE is predicted or SUCC(ELSE) postdominates THEN. */
- note = find_reg_note (BB_END (test_bb), REG_BR_PROB, NULL_RTX);
- if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
+ if (else_prob > then_prob)
;
else if (else_succ->dest->index < NUM_FIXED_BLOCKS
|| dominated_by_p (CDI_POST_DOMINATORS, then_bb,
@@ -3966,8 +3993,9 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
"\nIF-CASE-2 found, start %d, else %d\n",
test_bb->index, else_bb->index);
- /* ELSE is small. */
- if (! cheap_bb_rtx_cost_p (else_bb,
+ /* We're speculating from the ELSE path, we want to make sure the cost
+ of speculation is within reason. */
+ if (! cheap_bb_rtx_cost_p (else_bb, else_prob,
COSTS_N_INSNS (BRANCH_COST (optimize_bb_for_speed_p (else_edge->src),
predictable_edge_p (else_edge)))))
return FALSE;
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 7d95ce218b5..aab6e15ab1a 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -362,6 +362,8 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
void
split_quote_chain (void)
{
+ free_path (heads[QUOTE], REASON_QUIET);
+ free_path (tails[QUOTE], REASON_QUIET);
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
heads[BRACKET] = NULL;
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index f440b1dc74d..45cb00b2169 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -674,6 +674,20 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
return NULL_TREE;
}
+/* Extract the acual BINFO being described by JFUNC which must be a known type
+ jump function. */
+
+static tree
+ipa_value_from_known_type_jfunc (struct ipa_jump_func *jfunc)
+{
+ tree base_binfo = TYPE_BINFO (jfunc->value.known_type.base_type);
+ if (!base_binfo)
+ return NULL_TREE;
+ return get_binfo_at_offset (base_binfo,
+ jfunc->value.known_type.offset,
+ jfunc->value.known_type.component_type);
+}
+
/* Determine whether JFUNC evaluates to a known value (that is either a
constant or a binfo) and if so, return it. Otherwise return NULL. INFO
describes the caller node so that pass-through jump functions can be
@@ -685,7 +699,7 @@ ipa_value_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc)
if (jfunc->type == IPA_JF_CONST)
return jfunc->value.constant;
else if (jfunc->type == IPA_JF_KNOWN_TYPE)
- return jfunc->value.base_binfo;
+ return ipa_value_from_known_type_jfunc (jfunc);
else if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
@@ -991,7 +1005,11 @@ propagate_accross_jump_function (struct cgraph_edge *cs,
tree val;
if (jfunc->type == IPA_JF_KNOWN_TYPE)
- val = jfunc->value.base_binfo;
+ {
+ val = ipa_value_from_known_type_jfunc (jfunc);
+ if (!val)
+ return set_lattice_contains_variable (dest_lat);
+ }
else
val = jfunc->value.constant;
return add_value_to_lattice (dest_lat, val, cs, NULL, 0);
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 6bc96c7788e..8499cb57f42 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -92,7 +92,7 @@ along with GCC; see the file COPYING3. If not see
/* Estimate runtime of function can easilly run into huge numbers with many
nested loops. Be sure we can compute time * INLINE_SIZE_SCALE in integer.
For anything larger we use gcov_type. */
-#define MAX_TIME 1000000
+#define MAX_TIME 500000
/* Number of bits in integer, but we really want to be stable across different
hosts. */
@@ -108,6 +108,11 @@ enum predicate_conditions
/* Special condition code we use to represent test that operand is compile time
constant. */
#define IS_NOT_CONSTANT ERROR_MARK
+/* Special condition code we use to represent test that operand is not changed
+ across invocation of the function. When operand IS_NOT_CONSTANT it is always
+ CHANGED, however i.e. loop invariants can be NOT_CHANGED given percentage
+ of executions even when they are not compile time constants. */
+#define CHANGED IDENTIFIER_NODE
/* Holders of ipa cgraph hooks: */
static struct cgraph_node_hook_list *function_insertion_hook_holder;
@@ -269,7 +274,8 @@ add_clause (conditions conditions, struct predicate *p, clause_t clause)
/* If p->clause[i] implies clause, there is nothing to add. */
if ((p->clause[i] & clause) == p->clause[i])
{
- /* We had nothing to add, none of clauses should've become redundant. */
+ /* We had nothing to add, none of clauses should've become
+ redundant. */
gcc_checking_assert (i == i2);
return;
}
@@ -286,22 +292,37 @@ add_clause (conditions conditions, struct predicate *p, clause_t clause)
/* Look for clauses that are obviously true. I.e.
op0 == 5 || op0 != 5. */
for (c1 = predicate_first_dynamic_condition; c1 < NUM_CONDITIONS; c1++)
- for (c2 = c1 + 1; c2 <= NUM_CONDITIONS; c2++)
- if ((clause & (1 << c1))
- && (clause & (1 << c2)))
- {
- condition *cc1 = VEC_index (condition,
- conditions,
- c1 - predicate_first_dynamic_condition);
- condition *cc2 = VEC_index (condition,
- conditions,
- c2 - predicate_first_dynamic_condition);
- if (cc1->operand_num == cc2->operand_num
- && cc1->val == cc2->val
- && cc1->code == invert_tree_comparison (cc2->code,
- HONOR_NANS (TYPE_MODE (TREE_TYPE (cc1->val)))))
- return;
- }
+ {
+ condition *cc1;
+ if (!(clause & (1 << c1)))
+ continue;
+ cc1 = VEC_index (condition,
+ conditions,
+ c1 - predicate_first_dynamic_condition);
+ /* We have no way to represent !CHANGED and !IS_NOT_CONSTANT
+ and thus there is no point for looking for them. */
+ if (cc1->code == CHANGED
+ || cc1->code == IS_NOT_CONSTANT)
+ continue;
+ for (c2 = c1 + 1; c2 <= NUM_CONDITIONS; c2++)
+ if (clause & (1 << c2))
+ {
+ condition *cc1 = VEC_index (condition,
+ conditions,
+ c1 - predicate_first_dynamic_condition);
+ condition *cc2 = VEC_index (condition,
+ conditions,
+ c2 - predicate_first_dynamic_condition);
+ if (cc1->operand_num == cc2->operand_num
+ && cc1->val == cc2->val
+ && cc2->code != IS_NOT_CONSTANT
+ && cc2->code != CHANGED
+ && cc1->code == invert_tree_comparison
+ (cc2->code,
+ HONOR_NANS (TYPE_MODE (TREE_TYPE (cc1->val)))))
+ return;
+ }
+ }
/* We run out of variants. Be conservative in positive direction. */
@@ -359,7 +380,8 @@ predicates_equal_p (struct predicate *p, struct predicate *p2)
{
gcc_checking_assert (i < MAX_CLAUSES);
gcc_checking_assert (p->clause [i] > p->clause[i + 1]);
- gcc_checking_assert (!p2->clause[i] || p2->clause [i] > p2->clause[i + 1]);
+ gcc_checking_assert (!p2->clause[i]
+ || p2->clause [i] > p2->clause[i + 1]);
if (p->clause[i] != p2->clause[i])
return false;
}
@@ -394,8 +416,8 @@ or_predicates (conditions conditions, struct predicate *p, struct predicate *p2)
}
-/* Having partial truth assignment in POSSIBLE_TRUTHS, return false if predicate P
- to be false. */
+/* Having partial truth assignment in POSSIBLE_TRUTHS, return false
+ if predicate P is known to be false. */
static bool
evaluate_predicate (struct predicate *p, clause_t possible_truths)
@@ -418,6 +440,70 @@ evaluate_predicate (struct predicate *p, clause_t possible_truths)
return true;
}
+/* Return the probability in range 0...REG_BR_PROB_BASE that the predicated
+ instruction will be recomputed per invocation of the inlined call. */
+
+static int
+predicate_probability (conditions conds,
+ struct predicate *p, clause_t possible_truths,
+ VEC (inline_param_summary_t, heap) *inline_param_summary)
+{
+ int i;
+ int combined_prob = REG_BR_PROB_BASE;
+
+ /* True remains true. */
+ if (true_predicate_p (p))
+ return REG_BR_PROB_BASE;
+
+ if (false_predicate_p (p))
+ return 0;
+
+ gcc_assert (!(possible_truths & (1 << predicate_false_condition)));
+
+ /* See if we can find clause we can disprove. */
+ for (i = 0; p->clause[i]; i++)
+ {
+ gcc_checking_assert (i < MAX_CLAUSES);
+ if (!(p->clause[i] & possible_truths))
+ return 0;
+ else
+ {
+ int this_prob = 0;
+ int i2;
+ if (!inline_param_summary)
+ return REG_BR_PROB_BASE;
+ for (i2 = 0; i2 < NUM_CONDITIONS; i2++)
+ if ((p->clause[i] & possible_truths) & (1 << i2))
+ {
+ if (i2 >= predicate_first_dynamic_condition)
+ {
+ condition *c = VEC_index
+ (condition, conds,
+ i2 - predicate_first_dynamic_condition);
+ if (c->code == CHANGED
+ && (c->operand_num
+ < (int) VEC_length (inline_param_summary_t,
+ inline_param_summary)))
+ {
+ int iprob = VEC_index (inline_param_summary_t,
+ inline_param_summary,
+ c->operand_num)->change_prob;
+ this_prob = MAX (this_prob, iprob);
+ }
+ else
+ this_prob = REG_BR_PROB_BASE;
+ }
+ else
+ this_prob = REG_BR_PROB_BASE;
+ }
+ combined_prob = MIN (this_prob, combined_prob);
+ if (!combined_prob)
+ return 0;
+ }
+ }
+ return combined_prob;
+}
+
/* Dump conditional COND. */
@@ -431,13 +517,19 @@ dump_condition (FILE *f, conditions conditions, int cond)
fprintf (f, "not inlined");
else
{
- c = VEC_index (condition, conditions, cond - predicate_first_dynamic_condition);
+ c = VEC_index (condition, conditions,
+ cond - predicate_first_dynamic_condition);
fprintf (f, "op%i", c->operand_num);
if (c->code == IS_NOT_CONSTANT)
{
fprintf (f, " not constant");
return;
}
+ if (c->code == CHANGED)
+ {
+ fprintf (f, " changed");
+ return;
+ }
fprintf (f, " %s ", op_symbol_code (c->code));
print_generic_expr (f, c->val, 1);
}
@@ -488,7 +580,8 @@ dump_predicate (FILE *f, conditions conds, struct predicate *pred)
/* Record SIZE and TIME under condition PRED into the inline summary. */
static void
-account_size_time (struct inline_summary *summary, int size, int time, struct predicate *pred)
+account_size_time (struct inline_summary *summary, int size, int time,
+ struct predicate *pred)
{
size_time_entry *e;
bool found = false;
@@ -523,7 +616,8 @@ account_size_time (struct inline_summary *summary, int size, int time, struct pr
if (dump_file && (dump_flags & TDF_DETAILS) && (time || size))
{
fprintf (dump_file, "\t\tAccounting size:%3.2f, time:%3.2f on %spredicate:",
- ((double)size) / INLINE_SIZE_SCALE, ((double)time) / INLINE_TIME_SCALE,
+ ((double)size) / INLINE_SIZE_SCALE,
+ ((double)time) / INLINE_TIME_SCALE,
found ? "" : "new ");
dump_predicate (dump_file, summary->conds, pred);
}
@@ -567,7 +661,9 @@ edge_set_predicate (struct cgraph_edge *e, struct predicate *predicate)
/* KNOWN_VALS is partial mapping of parameters of NODE to constant values.
Return clause of possible truths. When INLINE_P is true, assume that
- we are inlining. */
+ we are inlining.
+
+ ERROR_MARK means compile time invariant. */
static clause_t
evaluate_conditions_for_known_args (struct cgraph_node *node,
@@ -592,12 +688,15 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
else
val = NULL;
+ if (val == error_mark_node && c->code != CHANGED)
+ val = NULL;
+
if (!val)
{
clause |= 1 << (i + predicate_first_dynamic_condition);
continue;
}
- if (c->code == IS_NOT_CONSTANT)
+ if (c->code == IS_NOT_CONSTANT || c->code == CHANGED)
continue;
res = fold_binary_to_constant (c->code, boolean_type_node, val, c->val);
if (res
@@ -619,13 +718,11 @@ evaluate_conditions_for_edge (struct cgraph_edge *e, bool inline_p)
struct inline_summary *info = inline_summary (callee);
int i;
- if (ipa_node_params_vector && info->conds
- /* FIXME: it seems that we forget to get argument count in some cases,
- probaby for previously indirect edges or so. */
- && ipa_get_cs_argument_count (IPA_EDGE_REF (e)))
+ if (ipa_node_params_vector && info->conds)
{
struct ipa_node_params *parms_info;
struct ipa_edge_args *args = IPA_EDGE_REF (e);
+ struct inline_edge_summary *es = inline_edge_summary (e);
int i, count = ipa_get_cs_argument_count (args);
VEC (tree, heap) *known_vals = NULL;
@@ -634,13 +731,19 @@ evaluate_conditions_for_edge (struct cgraph_edge *e, bool inline_p)
else
parms_info = IPA_NODE_REF (e->caller);
- VEC_safe_grow_cleared (tree, heap, known_vals, count);
+ if (count)
+ VEC_safe_grow_cleared (tree, heap, known_vals, count);
for (i = 0; i < count; i++)
{
tree cst = ipa_cst_from_jfunc (parms_info,
ipa_get_ith_jump_func (args, i));
if (cst)
VEC_replace (tree, known_vals, i, cst);
+ else if (inline_p
+ && !VEC_index (inline_param_summary_t,
+ es->param,
+ i)->change_prob)
+ VEC_replace (tree, known_vals, i, error_mark_node);
}
clause = evaluate_conditions_for_known_args (callee,
inline_p, known_vals);
@@ -681,10 +784,53 @@ inline_summary_alloc (void)
VEC_safe_grow_cleared (inline_edge_summary_t, heap,
inline_edge_summary_vec, cgraph_edge_max_uid + 1);
if (!edge_predicate_pool)
- edge_predicate_pool = create_alloc_pool ("edge predicates", sizeof (struct predicate),
+ edge_predicate_pool = create_alloc_pool ("edge predicates",
+ sizeof (struct predicate),
10);
}
+/* We are called multiple time for given function; clear
+ data from previous run so they are not cumulated. */
+
+static void
+reset_inline_edge_summary (struct cgraph_edge *e)
+{
+ if (e->uid
+ < (int)VEC_length (inline_edge_summary_t, inline_edge_summary_vec))
+ {
+ struct inline_edge_summary *es = inline_edge_summary (e);
+
+ es->call_stmt_size = es->call_stmt_time =0;
+ if (es->predicate)
+ pool_free (edge_predicate_pool, es->predicate);
+ es->predicate = NULL;
+ VEC_free (inline_param_summary_t, heap, es->param);
+ }
+}
+
+/* We are called multiple time for given function; clear
+ data from previous run so they are not cumulated. */
+
+static void
+reset_inline_summary (struct cgraph_node *node)
+{
+ struct inline_summary *info = inline_summary (node);
+ struct cgraph_edge *e;
+
+ info->self_size = info->self_time = 0;
+ info->estimated_stack_size = 0;
+ info->estimated_self_stack_size = 0;
+ info->stack_frame_offset = 0;
+ info->size = 0;
+ info->time = 0;
+ VEC_free (condition, gc, info->conds);
+ VEC_free (size_time_entry,gc, info->entry);
+ for (e = node->callees; e; e = e->next_callee)
+ reset_inline_edge_summary (e);
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ reset_inline_edge_summary (e);
+}
+
/* Hook that is called by cgraph.c when a node is removed. */
static void
@@ -695,11 +841,7 @@ inline_node_removal_hook (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
<= (unsigned)node->uid)
return;
info = inline_summary (node);
- reset_node_growth_cache (node);
- VEC_free (condition, gc, info->conds);
- VEC_free (size_time_entry, gc, info->entry);
- info->conds = NULL;
- info->entry = NULL;
+ reset_inline_summary (node);
memset (info, 0, sizeof (inline_summary_t));
}
@@ -766,7 +908,8 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
/* Remap size_time vectors.
Simplify the predicate by prunning out alternatives that are known
to be false.
- TODO: as on optimization, we can also eliminate conditions known to be true. */
+ TODO: as on optimization, we can also eliminate conditions known
+ to be true. */
for (i = 0; VEC_iterate (size_time_entry, entry, i, e); i++)
{
struct predicate new_predicate = true_predicate ();
@@ -788,7 +931,8 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
account_size_time (info, e->size, e->time, &new_predicate);
}
- /* Remap edge predicates with the same simplificaiton as above. */
+ /* Remap edge predicates with the same simplification as above.
+ Also copy constantness arrays. */
for (edge = dst->callees; edge; edge = edge->next_callee)
{
struct predicate new_predicate = true_predicate ();
@@ -819,7 +963,8 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
*es->predicate = new_predicate;
}
- /* Remap indirect edge predicates with the same simplificaiton as above. */
+ /* Remap indirect edge predicates with the same simplificaiton as above.
+ Also copy constantness arrays. */
for (edge = dst->indirect_calls; edge; edge = edge->next_callee)
{
struct predicate new_predicate = true_predicate ();
@@ -892,6 +1037,7 @@ inline_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
sizeof (struct inline_edge_summary));
info->predicate = NULL;
edge_set_predicate (dst, srcinfo->predicate);
+ info->param = VEC_copy (inline_param_summary_t, heap, srcinfo->param);
}
@@ -902,11 +1048,7 @@ inline_edge_removal_hook (struct cgraph_edge *edge, void *data ATTRIBUTE_UNUSED)
{
if (edge_growth_cache)
reset_edge_growth_cache (edge);
- if (edge->uid < (int)VEC_length (inline_edge_summary_t, inline_edge_summary_vec))
- {
- edge_set_predicate (edge, NULL);
- memset (inline_edge_summary (edge), 0, sizeof (struct inline_edge_summary));
- }
+ reset_inline_edge_summary (edge);
}
@@ -947,6 +1089,8 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
{
struct inline_edge_summary *es = inline_edge_summary (edge);
struct cgraph_node *callee = cgraph_function_or_thunk_node (edge->callee, NULL);
+ int i;
+
fprintf (f, "%*s%s/%i %s\n%*s loop depth:%2i freq:%4i size:%2i time: %2i callee size:%2i stack:%2i",
indent, "", cgraph_node_name (callee),
callee->uid,
@@ -957,8 +1101,9 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
edge->frequency,
es->call_stmt_size,
es->call_stmt_time,
- (int)inline_summary (callee)->size,
+ (int)inline_summary (callee)->size / INLINE_SIZE_SCALE,
(int)inline_summary (callee)->estimated_stack_size);
+
if (es->predicate)
{
fprintf (f, " predicate: ");
@@ -966,9 +1111,24 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
}
else
fprintf (f, "\n");
+ if (es->param)
+ for (i = 0; i < (int)VEC_length (inline_param_summary_t, es->param);
+ i++)
+ {
+ int prob = VEC_index (inline_param_summary_t,
+ es->param, i)->change_prob;
+
+ if (!prob)
+ fprintf (f, "%*s op%i is compile time invariant\n",
+ indent + 2, "", i);
+ else if (prob != REG_BR_PROB_BASE)
+ fprintf (f, "%*s op%i change %f%% of time\n", indent + 2, "", i,
+ prob * 100.0 / REG_BR_PROB_BASE);
+ }
if (!edge->inline_failed)
{
- fprintf (f, "%*sStack frame offset %i, callee self size %i, callee size %i\n",
+ fprintf (f, "%*sStack frame offset %i, callee self size %i,"
+ " callee size %i\n",
indent+2, "",
(int)inline_summary (callee)->stack_frame_offset,
(int)inline_summary (callee)->estimated_self_stack_size,
@@ -979,7 +1139,8 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
for (edge = node->indirect_calls; edge; edge = edge->next_callee)
{
struct inline_edge_summary *es = inline_edge_summary (edge);
- fprintf (f, "%*sindirect call loop depth:%2i freq:%4i size:%2i time: %2i\n",
+ fprintf (f, "%*sindirect call loop depth:%2i freq:%4i size:%2i"
+ " time: %2i",
indent, "",
es->loop_depth,
edge->frequency,
@@ -991,7 +1152,7 @@ dump_inline_edge_summary (FILE * f, int indent, struct cgraph_node *node,
dump_predicate (f, info->conds, es->predicate);
}
else
- fprintf (f, "\n");
+ fprintf (f, "\n");
}
}
@@ -1149,31 +1310,75 @@ eliminated_by_inlining_prob (gimple stmt)
{
tree rhs = gimple_assign_rhs1 (stmt);
tree lhs = gimple_assign_lhs (stmt);
- tree inner_rhs = rhs;
- tree inner_lhs = lhs;
+ tree inner_rhs = get_base_address (rhs);
+ tree inner_lhs = get_base_address (lhs);
bool rhs_free = false;
bool lhs_free = false;
- while (handled_component_p (inner_lhs)
- || TREE_CODE (inner_lhs) == MEM_REF)
- inner_lhs = TREE_OPERAND (inner_lhs, 0);
- while (handled_component_p (inner_rhs)
- || TREE_CODE (inner_rhs) == ADDR_EXPR
- || TREE_CODE (inner_rhs) == MEM_REF)
- inner_rhs = TREE_OPERAND (inner_rhs, 0);
+ if (!inner_rhs)
+ inner_rhs = rhs;
+ if (!inner_lhs)
+ inner_lhs = lhs;
+ /* Reads of parameter are expected to be free. */
if (unmodified_parm (stmt, inner_rhs))
rhs_free = true;
+
+ /* When parameter is not SSA register because its address is taken
+ and it is just copied into one, the statement will be completely
+ free after inlining (we will copy propagate backward). */
+ if (rhs_free && is_gimple_reg (lhs))
+ return 2;
+
+ /* Reads of parameters passed by reference
+ expected to be free (i.e. optimized out after inlining). */
+ if (TREE_CODE(inner_rhs) == MEM_REF
+ && unmodified_parm (stmt, TREE_OPERAND (inner_rhs, 0)))
+ rhs_free = true;
+
+ /* Copying parameter passed by reference into gimple register is
+ probably also going to copy propagate, but we can't be quite
+ sure. */
if (rhs_free && is_gimple_reg (lhs))
lhs_free = true;
- if (((TREE_CODE (inner_lhs) == PARM_DECL
- || (TREE_CODE (inner_lhs) == SSA_NAME
- && SSA_NAME_IS_DEFAULT_DEF (inner_lhs)
- && TREE_CODE (SSA_NAME_VAR (inner_lhs)) == PARM_DECL))
- && inner_lhs != lhs)
- || TREE_CODE (inner_lhs) == RESULT_DECL
- || (TREE_CODE (inner_lhs) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (inner_lhs)) == RESULT_DECL))
+
+ /* Writes to parameters, parameters passed by value and return value
+ (either dirrectly or passed via invisible reference) are free.
+
+ TODO: We ought to handle testcase like
+ struct a {int a,b;};
+ struct a
+ retrurnsturct (void)
+ {
+ struct a a ={1,2};
+ return a;
+ }
+
+ This translate into:
+
+ retrurnsturct ()
+ {
+ int a$b;
+ int a$a;
+ struct a a;
+ struct a D.2739;
+
+ <bb 2>:
+ D.2739.a = 1;
+ D.2739.b = 2;
+ return D.2739;
+
+ }
+ For that we either need to copy ipa-split logic detecting writes
+ to return value. */
+ if (TREE_CODE (inner_lhs) == PARM_DECL
+ || TREE_CODE (inner_lhs) == RESULT_DECL
+ || (TREE_CODE(inner_lhs) == MEM_REF
+ && (unmodified_parm (stmt, TREE_OPERAND (inner_lhs, 0))
+ || (TREE_CODE (TREE_OPERAND (inner_lhs, 0)) == SSA_NAME
+ && TREE_CODE (SSA_NAME_VAR
+ (TREE_OPERAND (inner_lhs, 0)))
+ == RESULT_DECL))))
lhs_free = true;
if (lhs_free
&& (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
@@ -1205,6 +1410,7 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
gimple set_stmt;
tree op2;
tree parm;
+ tree base;
last = last_stmt (bb);
if (!last
@@ -1223,8 +1429,9 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
if (index == -1)
return;
code = gimple_cond_code (last);
- inverted_code = invert_tree_comparison (code,
- HONOR_NANS (TYPE_MODE (TREE_TYPE (op))));
+ inverted_code
+ = invert_tree_comparison (code,
+ HONOR_NANS (TYPE_MODE (TREE_TYPE (op))));
FOR_EACH_EDGE (e, ei, bb->succs)
{
@@ -1255,7 +1462,8 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
|| gimple_call_num_args (set_stmt) != 1)
return;
op2 = gimple_call_arg (set_stmt, 0);
- parm = unmodified_parm (set_stmt, op2);
+ base = get_base_address (op2);
+ parm = unmodified_parm (set_stmt, base ? base : op2);
if (!parm)
return;
index = ipa_get_param_decl_index (info, parm);
@@ -1367,7 +1575,8 @@ compute_bb_predicates (struct cgraph_node *node,
}
/* Entry block is always executable. */
- ENTRY_BLOCK_PTR_FOR_FUNCTION (my_function)->aux = pool_alloc (edge_predicate_pool);
+ ENTRY_BLOCK_PTR_FOR_FUNCTION (my_function)->aux
+ = pool_alloc (edge_predicate_pool);
*(struct predicate *)ENTRY_BLOCK_PTR_FOR_FUNCTION (my_function)->aux
= true_predicate ();
@@ -1385,10 +1594,12 @@ compute_bb_predicates (struct cgraph_node *node,
{
if (e->src->aux)
{
- struct predicate this_bb_predicate = *(struct predicate *)e->src->aux;
+ struct predicate this_bb_predicate
+ = *(struct predicate *)e->src->aux;
if (e->aux)
- this_bb_predicate = and_predicates (summary->conds, &this_bb_predicate,
- (struct predicate *)e->aux);
+ this_bb_predicate
+ = and_predicates (summary->conds, &this_bb_predicate,
+ (struct predicate *)e->aux);
p = or_predicates (summary->conds, &p, &this_bb_predicate);
if (true_predicate_p (&p))
break;
@@ -1422,8 +1633,8 @@ DEF_VEC_O (predicate_t);
DEF_VEC_ALLOC_O (predicate_t, heap);
-/* Return predicate specifying when the STMT might have result that is not a compile
- time constant. */
+/* Return predicate specifying when the STMT might have result that is not
+ a compile time constant. */
static struct predicate
will_be_nonconstant_predicate (struct ipa_node_params *info,
@@ -1436,6 +1647,7 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
ssa_op_iter iter;
tree use;
struct predicate op_non_const;
+ bool is_load;
/* What statments might be optimized away
when their arguments are constant
@@ -1446,11 +1658,29 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
&& gimple_code (stmt) != GIMPLE_SWITCH)
return p;
- /* Stores and loads will stay anyway.
- TODO: Constant memory accesses could be handled here, too. */
- if (gimple_vuse (stmt))
+ /* Stores will stay anyway. */
+ if (gimple_vdef (stmt))
return p;
+ is_load = gimple_vuse (stmt) != NULL;
+
+ /* Loads can be optimized when the value is known. */
+ if (is_load)
+ {
+ tree op = gimple_assign_rhs1 (stmt);
+ tree base = get_base_address (op);
+ tree parm;
+
+ gcc_assert (gimple_assign_single_p (stmt));
+ if (!base)
+ return p;
+ parm = unmodified_parm (stmt, base);
+ if (!parm )
+ return p;
+ if (ipa_get_param_decl_index (info, parm) < 0)
+ return p;
+ }
+
/* See if we understand all operands before we start
adding conditionals. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
@@ -1469,13 +1699,22 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
return p;
}
op_non_const = false_predicate ();
+ if (is_load)
+ {
+ tree parm = unmodified_parm
+ (stmt, get_base_address (gimple_assign_rhs1 (stmt)));
+ p = add_condition (summary,
+ ipa_get_param_decl_index (info, parm),
+ CHANGED, NULL);
+ op_non_const = or_predicates (summary->conds, &p, &op_non_const);
+ }
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
tree parm = unmodified_parm (stmt, use);
if (parm && ipa_get_param_decl_index (info, parm) >= 0)
p = add_condition (summary,
ipa_get_param_decl_index (info, parm),
- IS_NOT_CONSTANT, NULL);
+ CHANGED, NULL);
else
p = *VEC_index (predicate_t, nonconstant_names,
SSA_NAME_VERSION (use));
@@ -1488,6 +1727,116 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
return op_non_const;
}
+struct record_modified_bb_info
+{
+ bitmap bb_set;
+ gimple stmt;
+};
+
+/* Callback of walk_aliased_vdefs. Records basic blocks where the value may be
+ set except for info->stmt. */
+
+static bool
+record_modified (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef,
+ void *data)
+{
+ struct record_modified_bb_info *info = (struct record_modified_bb_info *) data;
+ if (SSA_NAME_DEF_STMT (vdef) == info->stmt)
+ return false;
+ bitmap_set_bit (info->bb_set,
+ SSA_NAME_IS_DEFAULT_DEF (vdef)
+ ? ENTRY_BLOCK_PTR->index : gimple_bb (SSA_NAME_DEF_STMT (vdef))->index);
+ return false;
+}
+
+/* Return probability (based on REG_BR_PROB_BASE) that I-th parameter of STMT
+ will change since last invocation of STMT.
+
+ Value 0 is reserved for compile time invariants.
+ For common parameters it is REG_BR_PROB_BASE. For loop invariants it
+ ought to be REG_BR_PROB_BASE / estimated_iters. */
+
+static int
+param_change_prob (gimple stmt, int i)
+{
+ tree op = gimple_call_arg (stmt, i);
+ basic_block bb = gimple_bb (stmt);
+ tree base;
+
+ if (is_gimple_min_invariant (op))
+ return 0;
+ /* We would have to do non-trivial analysis to really work out what
+ is the probability of value to change (i.e. when init statement
+ is in a sibling loop of the call).
+
+ We do an conservative estimate: when call is executed N times more often
+ than the statement defining value, we take the frequency 1/N. */
+ if (TREE_CODE (op) == SSA_NAME)
+ {
+ int init_freq;
+
+ if (!bb->frequency)
+ return REG_BR_PROB_BASE;
+
+ if (SSA_NAME_IS_DEFAULT_DEF (op))
+ init_freq = ENTRY_BLOCK_PTR->frequency;
+ else
+ init_freq = gimple_bb (SSA_NAME_DEF_STMT (op))->frequency;
+
+ if (!init_freq)
+ init_freq = 1;
+ if (init_freq < bb->frequency)
+ return MAX ((init_freq * REG_BR_PROB_BASE +
+ bb->frequency / 2) / bb->frequency, 1);
+ else
+ return REG_BR_PROB_BASE;
+ }
+
+ base = get_base_address (op);
+ if (base)
+ {
+ ao_ref refd;
+ int max;
+ struct record_modified_bb_info info;
+ bitmap_iterator bi;
+ unsigned index;
+
+ if (const_value_known_p (base))
+ return 0;
+ if (!bb->frequency)
+ return REG_BR_PROB_BASE;
+ ao_ref_init (&refd, op);
+ info.stmt = stmt;
+ info.bb_set = BITMAP_ALLOC (NULL);
+ walk_aliased_vdefs (&refd, gimple_vuse (stmt), record_modified, &info,
+ NULL);
+ if (bitmap_bit_p (info.bb_set, bb->index))
+ {
+ BITMAP_FREE (info.bb_set);
+ return REG_BR_PROB_BASE;
+ }
+
+ /* Assume that every memory is initialized at entry.
+ TODO: Can we easilly determine if value is always defined
+ and thus we may skip entry block? */
+ if (ENTRY_BLOCK_PTR->frequency)
+ max = ENTRY_BLOCK_PTR->frequency;
+ else
+ max = 1;
+
+ EXECUTE_IF_SET_IN_BITMAP (info.bb_set, 0, index, bi)
+ max = MIN (max, BASIC_BLOCK (index)->frequency);
+
+ BITMAP_FREE (info.bb_set);
+ if (max < bb->frequency)
+ return MAX ((max * REG_BR_PROB_BASE +
+ bb->frequency / 2) / bb->frequency, 1);
+ else
+ return REG_BR_PROB_BASE;
+ }
+ return REG_BR_PROB_BASE;
+}
+
/* Compute function body size parameters for NODE.
When EARLY is true, we compute only simple summaries without
@@ -1588,7 +1937,24 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
{
struct predicate false_p = false_predicate ();
VEC_replace (predicate_t, nonconstant_names,
- SSA_NAME_VERSION (gimple_call_lhs (stmt)), &false_p);
+ SSA_NAME_VERSION (gimple_call_lhs (stmt)),
+ &false_p);
+ }
+ if (ipa_node_params_vector)
+ {
+ int count = gimple_call_num_args (stmt);
+ int i;
+
+ if (count)
+ VEC_safe_grow_cleared (inline_param_summary_t, heap,
+ es->param, count);
+ for (i = 0; i < count; i++)
+ {
+ int prob = param_change_prob (stmt, i);
+ gcc_assert (prob >= 0 && prob <= REG_BR_PROB_BASE);
+ VEC_index (inline_param_summary_t,
+ es->param, i)->change_prob = prob;
+ }
}
es->call_stmt_size = this_size;
@@ -1600,9 +1966,9 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
mismatches in argument or return types. */
if (edge->callee
&& cgraph_function_or_thunk_node (edge->callee, NULL)
- && !gimple_check_call_matching_types (stmt,
- cgraph_function_or_thunk_node (edge->callee,
- NULL)->decl))
+ && !gimple_check_call_matching_types
+ (stmt, cgraph_function_or_thunk_node (edge->callee,
+ NULL)->decl))
{
edge->call_stmt_cannot_inline_p = true;
gimple_call_set_cannot_inline (stmt, true);
@@ -1630,10 +1996,11 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
if (prob == 1 && dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\t\t50%% will be eliminated by inlining\n");
if (prob == 2 && dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\t\twill eliminated by inlining\n");
+ fprintf (dump_file, "\t\tWill be eliminated by inlining\n");
if (parms_info)
- p = and_predicates (info->conds, &bb_predicate, &will_be_nonconstant);
+ p = and_predicates (info->conds, &bb_predicate,
+ &will_be_nonconstant);
else
p = true_predicate ();
@@ -1697,12 +2064,14 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
HOST_WIDE_INT self_stack_size;
struct cgraph_edge *e;
struct inline_summary *info;
+ tree old_decl = current_function_decl;
gcc_assert (!node->global.inlined_to);
inline_summary_alloc ();
info = inline_summary (node);
+ reset_inline_summary (node);
/* FIXME: Thunks are inlinable, but tree-inline don't know how to do that.
Once this happen, we will need to more curefully predict call
@@ -1721,6 +2090,10 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
return;
}
+ /* Even is_gimple_min_invariant rely on current_function_decl. */
+ current_function_decl = node->decl;
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+
/* Estimate the stack size for the function if we're optimizing. */
self_stack_size = optimize ? estimated_stack_frame_size (node) : 0;
info->estimated_self_stack_size = self_stack_size;
@@ -1760,6 +2133,8 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
info->size = info->self_size;
info->stack_frame_offset = 0;
info->estimated_stack_size = info->estimated_self_stack_size;
+ current_function_decl = old_decl;
+ pop_cfun ();
}
@@ -1796,11 +2171,12 @@ struct gimple_opt_pass pass_inline_parameters =
/* Increase SIZE and TIME for size and time needed to handle edge E. */
static void
-estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time)
+estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time,
+ int prob)
{
struct inline_edge_summary *es = inline_edge_summary (e);
*size += es->call_stmt_size * INLINE_SIZE_SCALE;
- *time += (es->call_stmt_time
+ *time += (es->call_stmt_time * prob / REG_BR_PROB_BASE
* e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE));
if (*time > MAX_TIME * INLINE_TIME_SCALE)
*time = MAX_TIME * INLINE_TIME_SCALE;
@@ -1820,7 +2196,11 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time,
if (!es->predicate || evaluate_predicate (es->predicate, possible_truths))
{
if (e->inline_failed)
- estimate_edge_size_and_time (e, size, time);
+ {
+ /* Predicates of calls shall not use NOT_CHANGED codes,
+ sowe do not need to compute probabilities. */
+ estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE);
+ }
else
estimate_calls_size_and_time (e->callee, size, time,
possible_truths);
@@ -1831,7 +2211,7 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time,
{
struct inline_edge_summary *es = inline_edge_summary (e);
if (!es->predicate || evaluate_predicate (es->predicate, possible_truths))
- estimate_edge_size_and_time (e, size, time);
+ estimate_edge_size_and_time (e, size, time, REG_BR_PROB_BASE);
}
}
@@ -1842,7 +2222,9 @@ estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time,
static void
estimate_node_size_and_time (struct cgraph_node *node,
clause_t possible_truths,
- int *ret_size, int *ret_time)
+ int *ret_size, int *ret_time,
+ VEC (inline_param_summary_t, heap)
+ *inline_param_summary)
{
struct inline_summary *info = inline_summary (node);
size_time_entry *e;
@@ -1872,7 +2254,20 @@ estimate_node_size_and_time (struct cgraph_node *node,
for (i = 0; VEC_iterate (size_time_entry, info->entry, i, e); i++)
if (evaluate_predicate (&e->predicate, possible_truths))
- time += e->time, size += e->size;
+ {
+ size += e->size;
+ if (!inline_param_summary)
+ time += e->time;
+ else
+ {
+ int prob = predicate_probability (info->conds,
+ &e->predicate,
+ possible_truths,
+ inline_param_summary);
+ time += e->time * prob / REG_BR_PROB_BASE;
+ }
+
+ }
if (time > MAX_TIME * INLINE_TIME_SCALE)
time = MAX_TIME * INLINE_TIME_SCALE;
@@ -1905,21 +2300,23 @@ estimate_ipcp_clone_size_and_time (struct cgraph_node *node,
clause_t clause;
clause = evaluate_conditions_for_known_args (node, false, known_vals);
- estimate_node_size_and_time (node, clause, ret_size, ret_time);
+ estimate_node_size_and_time (node, clause, ret_size, ret_time,
+ NULL);
}
-/* Translate all conditions from callee representation into caller representation and
- symbolically evaluate predicate P into new predicate.
+/* Translate all conditions from callee representation into caller
+ representation and symbolically evaluate predicate P into new predicate.
- INFO is inline_summary of function we are adding predicate into, CALLEE_INFO is summary
- of function predicate P is from. OPERAND_MAP is array giving callee formal IDs the
- caller formal IDs. POSSSIBLE_TRUTHS is clausule of all callee conditions that
- may be true in caller context. TOPLEV_PREDICATE is predicate under which callee
- is executed. */
+ INFO is inline_summary of function we are adding predicate into,
+ CALLEE_INFO is summary of function predicate P is from. OPERAND_MAP is
+ array giving callee formal IDs the caller formal IDs. POSSSIBLE_TRUTHS is
+ clausule of all callee conditions that may be true in caller context.
+ TOPLEV_PREDICATE is predicate under which callee is executed. */
static struct predicate
-remap_predicate (struct inline_summary *info, struct inline_summary *callee_info,
+remap_predicate (struct inline_summary *info,
+ struct inline_summary *callee_info,
struct predicate *p,
VEC (int, heap) *operand_map,
clause_t possible_truths,
@@ -2011,12 +2408,61 @@ inline_update_callee_summaries (struct cgraph_node *node,
inline_edge_summary (e)->loop_depth += depth;
}
+/* Update change_prob of EDGE after INLINED_EDGE has been inlined.
+ When functoin A is inlined in B and A calls C with parameter that
+ changes with probability PROB1 and C is known to be passthroug
+ of argument if B that change with probability PROB2, the probability
+ of change is now PROB1*PROB2. */
-/* Remap predicates of callees of NODE. Rest of arguments match
- remap_predicate. */
+static void
+remap_edge_change_prob (struct cgraph_edge *inlined_edge,
+ struct cgraph_edge *edge)
+{
+ if (ipa_node_params_vector)
+ {
+ int i;
+ struct ipa_edge_args *args = IPA_EDGE_REF (edge);
+ struct inline_edge_summary *es = inline_edge_summary (edge);
+ struct inline_edge_summary *inlined_es
+ = inline_edge_summary (inlined_edge);
+
+ for (i = 0; i < ipa_get_cs_argument_count (args); i++)
+ {
+ struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
+ if (jfunc->type == IPA_JF_PASS_THROUGH
+ && (jfunc->value.pass_through.formal_id
+ < (int) VEC_length (inline_param_summary_t,
+ inlined_es->param)))
+ {
+ int prob1 = VEC_index (inline_param_summary_t,
+ es->param, i)->change_prob;
+ int prob2 = VEC_index
+ (inline_param_summary_t,
+ inlined_es->param,
+ jfunc->value.pass_through.formal_id)->change_prob;
+ int prob = ((prob1 * prob2 + REG_BR_PROB_BASE / 2)
+ / REG_BR_PROB_BASE);
+
+ if (prob1 && prob2 && !prob)
+ prob = 1;
+
+ VEC_index (inline_param_summary_t,
+ es->param, i)->change_prob = prob;
+ }
+ }
+ }
+}
+
+/* Update edge summaries of NODE after INLINED_EDGE has been inlined.
+
+ Remap predicates of callees of NODE. Rest of arguments match
+ remap_predicate.
+
+ Also update change probabilities. */
static void
-remap_edge_predicates (struct cgraph_node *node,
+remap_edge_summaries (struct cgraph_edge *inlined_edge,
+ struct cgraph_node *node,
struct inline_summary *info,
struct inline_summary *callee_info,
VEC (int, heap) *operand_map,
@@ -2028,39 +2474,47 @@ remap_edge_predicates (struct cgraph_node *node,
{
struct inline_edge_summary *es = inline_edge_summary (e);
struct predicate p;
- if (es->predicate)
+
+ if (e->inline_failed)
{
- p = remap_predicate (info, callee_info,
- es->predicate, operand_map, possible_truths,
- toplev_predicate);
- edge_set_predicate (e, &p);
- /* TODO: We should remove the edge for code that will be optimized out,
- but we need to keep verifiers and tree-inline happy.
- Make it cold for now. */
- if (false_predicate_p (&p))
+ remap_edge_change_prob (inlined_edge, e);
+
+ if (es->predicate)
{
- e->count = 0;
- e->frequency = 0;
+ p = remap_predicate (info, callee_info,
+ es->predicate, operand_map, possible_truths,
+ toplev_predicate);
+ edge_set_predicate (e, &p);
+ /* TODO: We should remove the edge for code that will be
+ optimized out, but we need to keep verifiers and tree-inline
+ happy. Make it cold for now. */
+ if (false_predicate_p (&p))
+ {
+ e->count = 0;
+ e->frequency = 0;
+ }
}
+ else
+ edge_set_predicate (e, toplev_predicate);
}
- if (!e->inline_failed)
- remap_edge_predicates (e->callee, info, callee_info, operand_map,
- possible_truths, toplev_predicate);
else
- edge_set_predicate (e, toplev_predicate);
+ remap_edge_summaries (inlined_edge, e->callee, info, callee_info,
+ operand_map, possible_truths, toplev_predicate);
}
for (e = node->indirect_calls; e; e = e->next_callee)
{
struct inline_edge_summary *es = inline_edge_summary (e);
struct predicate p;
+
+ remap_edge_change_prob (inlined_edge, e);
if (es->predicate)
{
p = remap_predicate (info, callee_info,
es->predicate, operand_map, possible_truths,
toplev_predicate);
edge_set_predicate (e, &p);
- /* TODO: We should remove the edge for code that will be optimized out,
- but we need to keep verifiers and tree-inline happy.
+ /* TODO: We should remove the edge for code that will be optimized
+ out, but we need to keep verifiers and tree-inline happy.
Make it cold for now. */
if (false_predicate_p (&p))
{
@@ -2088,6 +2542,7 @@ inline_merge_summary (struct cgraph_edge *edge)
VEC (int, heap) *operand_map = NULL;
int i;
struct predicate toplev_predicate;
+ struct predicate true_p = true_predicate ();
struct inline_edge_summary *es = inline_edge_summary (edge);
if (es->predicate)
@@ -2095,18 +2550,15 @@ inline_merge_summary (struct cgraph_edge *edge)
else
toplev_predicate = true_predicate ();
- if (ipa_node_params_vector && callee_info->conds
- /* FIXME: it seems that we forget to get argument count in some cases,
- probaby for previously indirect edges or so.
- Removing the test leads to ICE on tramp3d. */
- && ipa_get_cs_argument_count (IPA_EDGE_REF (edge)))
+ if (ipa_node_params_vector && callee_info->conds)
{
struct ipa_edge_args *args = IPA_EDGE_REF (edge);
int count = ipa_get_cs_argument_count (args);
int i;
clause = evaluate_conditions_for_edge (edge, true);
- VEC_safe_grow_cleared (int, heap, operand_map, count);
+ if (count)
+ VEC_safe_grow_cleared (int, heap, operand_map, count);
for (i = 0; i < count; i++)
{
struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
@@ -2124,14 +2576,27 @@ inline_merge_summary (struct cgraph_edge *edge)
struct predicate p = remap_predicate (info, callee_info,
&e->predicate, operand_map, clause,
&toplev_predicate);
- gcov_type add_time = ((gcov_type)e->time * edge->frequency
- + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
- if (add_time > MAX_TIME)
- add_time = MAX_TIME;
- account_size_time (info, e->size, add_time, &p);
- }
- remap_edge_predicates (edge->callee, info, callee_info, operand_map,
- clause, &toplev_predicate);
+ if (!false_predicate_p (&p))
+ {
+ gcov_type add_time = ((gcov_type)e->time * edge->frequency
+ + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
+ int prob = predicate_probability (callee_info->conds,
+ &e->predicate,
+ clause, es->param);
+ add_time = add_time * prob / REG_BR_PROB_BASE;
+ if (add_time > MAX_TIME * INLINE_TIME_SCALE)
+ add_time = MAX_TIME * INLINE_TIME_SCALE;
+ if (prob != REG_BR_PROB_BASE
+ && dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "\t\tScaling time by probability:%f\n",
+ (double)prob / REG_BR_PROB_BASE);
+ }
+ account_size_time (info, e->size, add_time, &p);
+ }
+ }
+ remap_edge_summaries (edge, edge->callee, info, callee_info, operand_map,
+ clause, &toplev_predicate);
info->size = 0;
info->time = 0;
for (i = 0; VEC_iterate (size_time_entry, info->entry, i, e); i++)
@@ -2142,6 +2607,11 @@ inline_merge_summary (struct cgraph_edge *edge)
inline_update_callee_summaries (edge->callee,
inline_edge_summary (edge)->loop_depth);
+ /* We do not maintain predicates of inlined edges, free it. */
+ edge_set_predicate (edge, &true_p);
+ /* Similarly remove param summaries. */
+ VEC_free (inline_param_summary_t, heap, es->param);
+
info->time = (info->time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE;
info->size = (info->size + INLINE_SIZE_SCALE / 2) / INLINE_SIZE_SCALE;
}
@@ -2163,14 +2633,14 @@ do_estimate_edge_time (struct cgraph_edge *edge)
struct inline_edge_summary *es = inline_edge_summary (edge);
gcc_checking_assert (edge->inline_failed);
- estimate_node_size_and_time (cgraph_function_or_thunk_node (edge->callee, NULL),
+ estimate_node_size_and_time (cgraph_function_or_thunk_node (edge->callee,
+ NULL),
evaluate_conditions_for_edge (edge, true),
- &size, &time);
+ &size, &time, es->param);
- ret = (((gcov_type)time - es->call_stmt_time) * edge->frequency
+ ret = (((gcov_type)time
+ - es->call_stmt_time) * edge->frequency
+ CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
- if (ret > MAX_TIME)
- ret = MAX_TIME;
/* When caching, update the cache entry. */
if (edge_growth_cache)
@@ -2218,7 +2688,7 @@ do_estimate_edge_growth (struct cgraph_edge *edge)
gcc_checking_assert (edge->inline_failed);
estimate_node_size_and_time (callee,
evaluate_conditions_for_edge (edge, true),
- &size, NULL);
+ &size, NULL, NULL);
gcc_checking_assert (inline_edge_summary (edge)->call_stmt_size);
return size - inline_edge_summary (edge)->call_stmt_size;
}
@@ -2312,19 +2782,22 @@ do_estimate_growth (struct cgraph_node *node)
if (!DECL_EXTERNAL (node->decl)
&& cgraph_will_be_removed_from_program_if_no_direct_calls (node))
d.growth -= info->size;
- /* COMDAT functions are very often not shared across multiple units since they
- come from various template instantiations. Take this into account. */
+ /* COMDAT functions are very often not shared across multiple units
+ since they come from various template instantiations.
+ Take this into account. */
else if (DECL_COMDAT (node->decl)
&& cgraph_can_remove_if_no_direct_calls_p (node))
d.growth -= (info->size
- * (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY)) + 50) / 100;
+ * (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY))
+ + 50) / 100;
}
if (node_growth_cache)
{
if ((int)VEC_length (int, node_growth_cache) <= node->uid)
VEC_safe_grow_cleared (int, heap, node_growth_cache, cgraph_max_uid);
- VEC_replace (int, node_growth_cache, node->uid, d.growth + (d.growth >= 0));
+ VEC_replace (int, node_growth_cache, node->uid,
+ d.growth + (d.growth >= 0));
}
return d.growth;
}
@@ -2356,9 +2829,7 @@ inline_analyze_function (struct cgraph_node *node)
if (dump_file)
fprintf (dump_file, "\nAnalyzing function: %s/%u\n",
cgraph_node_name (node), node->uid);
- /* FIXME: We should remove the optimize check after we ensure we never run
- IPA passes when not optimizing. */
- if (flag_indirect_inlining && optimize && !node->thunk.thunk_p)
+ if (optimize && !node->thunk.thunk_p)
inline_indirect_intraprocedural_analysis (node);
compute_inline_parameters (node, false);
@@ -2386,8 +2857,8 @@ inline_generate_summary (void)
function_insertion_hook_holder =
cgraph_add_function_insertion_hook (&add_new_function, NULL);
- if (flag_indirect_inlining)
- ipa_register_cgraph_hooks ();
+ ipa_register_cgraph_hooks ();
+ inline_free_summary ();
FOR_EACH_DEFINED_FUNCTION (node)
if (!node->alias)
@@ -2426,12 +2897,21 @@ read_inline_edge_summary (struct lto_input_block *ib, struct cgraph_edge *e)
{
struct inline_edge_summary *es = inline_edge_summary (e);
struct predicate p;
+ int length, i;
es->call_stmt_size = streamer_read_uhwi (ib);
es->call_stmt_time = streamer_read_uhwi (ib);
es->loop_depth = streamer_read_uhwi (ib);
p = read_predicate (ib);
edge_set_predicate (e, &p);
+ length = streamer_read_uhwi (ib);
+ if (length)
+ {
+ VEC_safe_grow_cleared (inline_param_summary_t, heap, es->param, length);
+ for (i = 0; i < length; i++)
+ VEC_index (inline_param_summary_t, es->param, i)->change_prob
+ = streamer_read_uhwi (ib);
+ }
}
@@ -2530,16 +3010,18 @@ inline_read_summary (void)
while ((file_data = file_data_vec[j++]))
{
size_t len;
- const char *data = lto_get_section_data (file_data, LTO_section_inline_summary, NULL, &len);
+ const char *data = lto_get_section_data (file_data,
+ LTO_section_inline_summary,
+ NULL, &len);
if (data)
inline_read_section (file_data, data, len);
else
- /* Fatal error here. We do not want to support compiling ltrans units with
- different version of compiler or different flags than the WPA unit, so
- this should never happen. */
+ /* Fatal error here. We do not want to support compiling ltrans units
+ with different version of compiler or different flags than the WPA
+ unit, so this should never happen. */
fatal_error ("ipa inline summary is missing in input file");
}
- if (flag_indirect_inlining)
+ if (optimize)
{
ipa_register_cgraph_hooks ();
if (!flag_ipa_cp)
@@ -2572,10 +3054,16 @@ static void
write_inline_edge_summary (struct output_block *ob, struct cgraph_edge *e)
{
struct inline_edge_summary *es = inline_edge_summary (e);
+ int i;
+
streamer_write_uhwi (ob, es->call_stmt_size);
streamer_write_uhwi (ob, es->call_stmt_time);
streamer_write_uhwi (ob, es->loop_depth);
write_predicate (ob, es->predicate);
+ streamer_write_uhwi (ob, VEC_length (inline_param_summary_t, es->param));
+ for (i = 0; i < (int)VEC_length (inline_param_summary_t, es->param); i++)
+ streamer_write_uhwi (ob, VEC_index (inline_param_summary_t,
+ es->param, i)->change_prob);
}
@@ -2643,7 +3131,7 @@ inline_write_summary (cgraph_node_set set,
produce_asm (ob, NULL);
destroy_output_block (ob);
- if (flag_indirect_inlining && !flag_ipa_cp)
+ if (optimize && !flag_ipa_cp)
ipa_prop_write_jump_functions (set);
}
@@ -2653,19 +3141,24 @@ inline_write_summary (cgraph_node_set set,
void
inline_free_summary (void)
{
+ struct cgraph_node *node;
+ FOR_EACH_DEFINED_FUNCTION (node)
+ reset_inline_summary (node);
if (function_insertion_hook_holder)
cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
function_insertion_hook_holder = NULL;
if (node_removal_hook_holder)
cgraph_remove_node_removal_hook (node_removal_hook_holder);
+ node_removal_hook_holder = NULL;
if (edge_removal_hook_holder)
cgraph_remove_edge_removal_hook (edge_removal_hook_holder);
- node_removal_hook_holder = NULL;
+ edge_removal_hook_holder = NULL;
if (node_duplication_hook_holder)
cgraph_remove_node_duplication_hook (node_duplication_hook_holder);
+ node_duplication_hook_holder = NULL;
if (edge_duplication_hook_holder)
cgraph_remove_edge_duplication_hook (edge_duplication_hook_holder);
- node_duplication_hook_holder = NULL;
+ edge_duplication_hook_holder = NULL;
VEC_free (inline_summary_t, gc, inline_summary_vec);
inline_summary_vec = NULL;
VEC_free (inline_edge_summary_t, heap, inline_edge_summary_vec);
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 600eb0d7eb0..6eb8e7388cf 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -248,7 +248,9 @@ inline_call (struct cgraph_edge *e, bool update_original,
*overall_size += new_size - old_size;
ncalls_inlined++;
- if (flag_indirect_inlining && optimize)
+ /* This must happen after inline_merge_summary that rely on jump
+ functions of callee to not be updated. */
+ if (optimize)
return ipa_propagate_indirect_call_infos (curr, new_edges);
else
return false;
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index c10a6182283..f069914cf64 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -710,9 +710,8 @@ relative_time_benefit (struct inline_summary *callee_info,
uninlined_call_time =
((gcov_type)
(callee_info->time
- + inline_edge_summary (edge)->call_stmt_time
- + CGRAPH_FREQ_BASE / 2) * edge->frequency
- / CGRAPH_FREQ_BASE);
+ + inline_edge_summary (edge)->call_stmt_time) * edge->frequency
+ + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
/* Compute relative time benefit, i.e. how much the call becomes faster.
??? perhaps computing how much the caller+calle together become faster
would lead to more realistic results. */
@@ -1660,10 +1659,8 @@ ipa_inline (void)
XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
int i;
- if (in_lto_p && flag_indirect_inlining)
+ if (in_lto_p && optimize)
ipa_update_after_lto_read ();
- if (flag_indirect_inlining)
- ipa_create_all_structures_for_iinln ();
if (dump_file)
dump_inline_summaries (dump_file);
@@ -1758,7 +1755,7 @@ ipa_inline (void)
}
/* Free ipa-prop structures if they are no longer needed. */
- if (flag_indirect_inlining)
+ if (optimize)
ipa_free_all_structures_after_iinln ();
if (dump_file)
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index bba13b6af46..6df7867b019 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -104,11 +104,28 @@ struct GTY(()) inline_summary
VEC(size_time_entry,gc) *entry;
};
+
typedef struct inline_summary inline_summary_t;
DEF_VEC_O(inline_summary_t);
DEF_VEC_ALLOC_O(inline_summary_t,gc);
extern GTY(()) VEC(inline_summary_t,gc) *inline_summary_vec;
+/* Information kept about parameter of call site. */
+struct inline_param_summary
+{
+ /* REG_BR_PROB_BASE based probability that parameter will change in between
+ two invocation of the calls.
+ I.e. loop invariant parameters
+ REG_BR_PROB_BASE/estimated_iterations and regular
+ parameters REG_BR_PROB_BASE.
+
+ Value 0 is reserved for compile time invariants. */
+ int change_prob;
+};
+typedef struct inline_param_summary inline_param_summary_t;
+DEF_VEC_O(inline_param_summary_t);
+DEF_VEC_ALLOC_O(inline_param_summary_t,heap);
+
/* Information kept about callgraph edges. */
struct inline_edge_summary
{
@@ -118,6 +135,10 @@ struct inline_edge_summary
/* Depth of loop nest, 0 means no nesting. */
unsigned short int loop_depth;
struct predicate *predicate;
+ /* Array indexed by parameters.
+ 0 means that parameter change all the time, REG_BR_PROB_BASE means
+ that parameter is constant. */
+ VEC (inline_param_summary_t, heap) *param;
};
typedef struct inline_edge_summary inline_edge_summary_t;
@@ -219,7 +240,7 @@ estimate_edge_time (struct cgraph_edge *edge)
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache) <= edge->uid
|| !(ret = VEC_index (edge_growth_cache_entry,
edge_growth_cache,
- edge->uid)->size))
+ edge->uid)->time))
return do_estimate_edge_time (edge);
return ret - (ret > 0);
}
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 066bbdbf03e..54ba4178020 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -56,10 +56,6 @@ VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
/* Vector where the parameter infos are actually stored. */
VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
-/* Bitmap with all UIDs of call graph edges that have been already processed
- by indirect inlining. */
-static bitmap iinlining_processed_edges;
-
/* Holders of ipa cgraph hooks: */
static struct cgraph_edge_hook_list *edge_removal_hook_holder;
static struct cgraph_node_hook_list *node_removal_hook_holder;
@@ -164,10 +160,12 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
fprintf (f, "UNKNOWN\n");
else if (type == IPA_JF_KNOWN_TYPE)
{
- tree binfo_type = TREE_TYPE (jump_func->value.base_binfo);
- fprintf (f, "KNOWN TYPE, type in binfo is: ");
- print_generic_expr (f, binfo_type, 0);
- fprintf (f, " (%u)\n", TYPE_UID (binfo_type));
+ fprintf (f, "KNOWN TYPE: base ");
+ print_generic_expr (f, jump_func->value.known_type.base_type, 0);
+ fprintf (f, ", offset "HOST_WIDE_INT_PRINT_DEC", component ",
+ jump_func->value.known_type.offset);
+ print_generic_expr (f, jump_func->value.known_type.component_type, 0);
+ fprintf (f, "\n");
}
else if (type == IPA_JF_CONST)
{
@@ -199,9 +197,9 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
tree_code_name[(int)
jump_func->value.pass_through.operation]);
if (jump_func->value.pass_through.operation != NOP_EXPR)
- print_generic_expr (dump_file,
+ print_generic_expr (f,
jump_func->value.pass_through.operand, 0);
- fprintf (dump_file, "\n");
+ fprintf (f, "\n");
}
else if (type == IPA_JF_ANCESTOR)
{
@@ -210,7 +208,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
jump_func->value.ancestor.formal_id,
jump_func->value.ancestor.offset);
print_generic_expr (f, jump_func->value.ancestor.type, 0);
- fprintf (dump_file, "\n");
+ fprintf (f, "\n");
}
}
}
@@ -638,7 +636,7 @@ compute_known_type_jump_func (tree op, struct ipa_jump_func *jfunc,
gimple call)
{
HOST_WIDE_INT offset, size, max_size;
- tree base, binfo;
+ tree base;
if (!flag_devirtualize
|| TREE_CODE (op) != ADDR_EXPR
@@ -654,18 +652,14 @@ compute_known_type_jump_func (tree op, struct ipa_jump_func *jfunc,
|| is_global_var (base))
return;
- if (detect_type_change (op, base, call, jfunc, offset))
+ if (detect_type_change (op, base, call, jfunc, offset)
+ || !TYPE_BINFO (TREE_TYPE (base)))
return;
- binfo = TYPE_BINFO (TREE_TYPE (base));
- if (!binfo)
- return;
- binfo = get_binfo_at_offset (binfo, offset, TREE_TYPE (op));
- if (binfo)
- {
- jfunc->type = IPA_JF_KNOWN_TYPE;
- jfunc->value.base_binfo = binfo;
- }
+ jfunc->type = IPA_JF_KNOWN_TYPE;
+ jfunc->value.known_type.base_type = TREE_TYPE (base);
+ jfunc->value.known_type.offset = offset;
+ jfunc->value.known_type.component_type = TREE_TYPE (op);
}
@@ -1504,18 +1498,16 @@ static void
combine_known_type_and_ancestor_jfs (struct ipa_jump_func *src,
struct ipa_jump_func *dst)
{
- tree new_binfo;
+ HOST_WIDE_INT combined_offset;
+ tree combined_type;
- new_binfo = get_binfo_at_offset (src->value.base_binfo,
- dst->value.ancestor.offset,
- dst->value.ancestor.type);
- if (new_binfo)
- {
- dst->type = IPA_JF_KNOWN_TYPE;
- dst->value.base_binfo = new_binfo;
- }
- else
- dst->type = IPA_JF_UNKNOWN;
+ combined_offset = src->value.known_type.offset + dst->value.ancestor.offset;
+ combined_type = dst->value.ancestor.type;
+
+ dst->type = IPA_JF_KNOWN_TYPE;
+ dst->value.known_type.base_type = src->value.known_type.base_type;
+ dst->value.known_type.offset = combined_offset;
+ dst->value.known_type.component_type = combined_type;
}
/* Update the jump functions associated with call graph edge E when the call
@@ -1650,22 +1642,19 @@ static struct cgraph_edge *
try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
struct ipa_jump_func *jfunc)
{
- tree binfo, type, target;
- HOST_WIDE_INT token;
-
- if (jfunc->type == IPA_JF_KNOWN_TYPE)
- binfo = jfunc->value.base_binfo;
- else
- return NULL;
+ tree binfo, target;
- if (!binfo)
+ if (jfunc->type != IPA_JF_KNOWN_TYPE)
return NULL;
- token = ie->indirect_info->otr_token;
- type = ie->indirect_info->otr_type;
- binfo = get_binfo_at_offset (binfo, ie->indirect_info->anc_offset, type);
+ binfo = TYPE_BINFO (jfunc->value.known_type.base_type);
+ gcc_checking_assert (binfo);
+ binfo = get_binfo_at_offset (binfo, jfunc->value.known_type.offset
+ + ie->indirect_info->anc_offset,
+ ie->indirect_info->otr_type);
if (binfo)
- target = gimple_get_virt_method_for_binfo (token, binfo);
+ target = gimple_get_virt_method_for_binfo (ie->indirect_info->otr_token,
+ binfo);
else
return NULL;
@@ -1699,18 +1688,14 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
struct ipa_jump_func *jfunc;
next_ie = ie->next_callee;
- if (bitmap_bit_p (iinlining_processed_edges, ie->uid))
- continue;
- /* If we ever use indirect edges for anything other than indirect
- inlining, we will need to skip those with negative param_indices. */
if (ici->param_index == -1)
continue;
/* We must check range due to calls with variable number of arguments: */
if (ici->param_index >= ipa_get_cs_argument_count (top))
{
- bitmap_set_bit (iinlining_processed_edges, ie->uid);
+ ici->param_index = -1;
continue;
}
@@ -1725,7 +1710,10 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
}
else
/* Either we can find a destination for this edge now or never. */
- bitmap_set_bit (iinlining_processed_edges, ie->uid);
+ ici->param_index = -1;
+
+ if (!flag_indirect_inlining)
+ continue;
if (ici->polymorphic)
new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc);
@@ -1771,6 +1759,8 @@ propagate_info_to_inlined_callees (struct cgraph_edge *cs,
res |= propagate_info_to_inlined_callees (cs, e->callee, new_edges);
else
update_jump_functions_after_inlining (cs, e);
+ for (e = node->indirect_calls; e; e = e->next_callee)
+ update_jump_functions_after_inlining (cs, e);
return res;
}
@@ -1785,13 +1775,19 @@ bool
ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
VEC (cgraph_edge_p, heap) **new_edges)
{
+ bool changed;
/* Do nothing if the preparation phase has not been carried out yet
(i.e. during early inlining). */
if (!ipa_node_params_vector)
return false;
gcc_assert (ipa_edge_args_vector);
- return propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+ changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+
+ /* We do not keep jump functions of inlined edges up to date. Better to free
+ them so we do not access them accidentally. */
+ ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
+ return changed;
}
/* Frees all dynamically allocated structures that the argument info points
@@ -1889,10 +1885,6 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
new_args->jump_functions = VEC_copy (ipa_jump_func_t, gc,
old_args->jump_functions);
-
- if (iinlining_processed_edges
- && bitmap_bit_p (iinlining_processed_edges, src->uid))
- bitmap_set_bit (iinlining_processed_edges, dst->uid);
}
/* Hook that is called by cgraph.c when a node is duplicated. */
@@ -1963,21 +1955,13 @@ ipa_unregister_cgraph_hooks (void)
function_insertion_hook_holder = NULL;
}
-/* Allocate all necessary data structures necessary for indirect inlining. */
-
-void
-ipa_create_all_structures_for_iinln (void)
-{
- iinlining_processed_edges = BITMAP_ALLOC (NULL);
-}
-
/* Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after ipa-cp. */
void
ipa_free_all_structures_after_ipa_cp (void)
{
- if (!flag_indirect_inlining)
+ if (!optimize)
{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
@@ -1993,8 +1977,6 @@ ipa_free_all_structures_after_ipa_cp (void)
void
ipa_free_all_structures_after_iinln (void)
{
- BITMAP_FREE (iinlining_processed_edges);
-
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();
@@ -2589,7 +2571,9 @@ ipa_write_jump_function (struct output_block *ob,
case IPA_JF_UNKNOWN:
break;
case IPA_JF_KNOWN_TYPE:
- stream_write_tree (ob, jump_func->value.base_binfo, true);
+ streamer_write_uhwi (ob, jump_func->value.known_type.offset);
+ stream_write_tree (ob, jump_func->value.known_type.base_type, true);
+ stream_write_tree (ob, jump_func->value.known_type.component_type, true);
break;
case IPA_JF_CONST:
stream_write_tree (ob, jump_func->value.constant, true);
@@ -2625,7 +2609,10 @@ ipa_read_jump_function (struct lto_input_block *ib,
case IPA_JF_UNKNOWN:
break;
case IPA_JF_KNOWN_TYPE:
- jump_func->value.base_binfo = stream_read_tree (ib, data_in);
+ jump_func->value.known_type.offset = streamer_read_uhwi (ib);
+ jump_func->value.known_type.base_type = stream_read_tree (ib, data_in);
+ jump_func->value.known_type.component_type = stream_read_tree (ib,
+ data_in);
break;
case IPA_JF_CONST:
jump_func->value.constant = stream_read_tree (ib, data_in);
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index fafd17d2fce..58caa92c305 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -72,13 +72,24 @@ along with GCC; see the file COPYING3. If not see
enum jump_func_type
{
IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
- IPA_JF_KNOWN_TYPE, /* represented by field base_binfo */
+ IPA_JF_KNOWN_TYPE, /* represented by field known_type */
IPA_JF_CONST, /* represented by field costant */
IPA_JF_CONST_MEMBER_PTR, /* represented by field member_cst */
IPA_JF_PASS_THROUGH, /* represented by field pass_through */
IPA_JF_ANCESTOR /* represented by field ancestor */
};
+/* Structure holding data required to describe a known type jump function. */
+struct GTY(()) ipa_known_type_data
+{
+ /* Offset of the component of the base_type being described. */
+ HOST_WIDE_INT offset;
+ /* Type of the whole object. */
+ tree base_type;
+ /* Type of the component of the object that is being described. */
+ tree component_type;
+};
+
/* Structure holding data required to describe a pass-through jump function. */
struct GTY(()) ipa_pass_through_data
@@ -127,7 +138,7 @@ typedef struct GTY (()) ipa_jump_func
functions and member_cst holds constant c++ member functions. */
union jump_func_value
{
- tree GTY ((tag ("IPA_JF_KNOWN_TYPE"))) base_binfo;
+ struct ipa_known_type_data GTY ((tag ("IPA_JF_KNOWN_TYPE"))) known_type;
tree GTY ((tag ("IPA_JF_CONST"))) constant;
struct ipa_member_ptr_cst GTY ((tag ("IPA_JF_CONST_MEMBER_PTR"))) member_cst;
struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
@@ -282,7 +293,6 @@ void ipa_free_edge_args_substructures (struct ipa_edge_args *);
void ipa_free_node_params_substructures (struct ipa_node_params *);
void ipa_free_all_node_params (void);
void ipa_free_all_edge_args (void);
-void ipa_create_all_structures_for_iinln (void);
void ipa_free_all_structures_after_ipa_cp (void);
void ipa_free_all_structures_after_iinln (void);
void ipa_register_cgraph_hooks (void);
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 9d54811e5c9..dfd8eef99ca 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -196,12 +196,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
/* Keep around virtual functions for possible devirtualization. */
|| (before_inlining_p
&& DECL_VIRTUAL_P (node->decl)
- && (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl)))
- /* Also external functions with address taken are better to stay
- for indirect inlining. */
- || (before_inlining_p
- && DECL_EXTERNAL (node->decl)
- && node->address_taken)))
+ && (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl)))))
{
gcc_assert (!node->global.inlined_to);
enqueue_cgraph_node (node, &first);
@@ -685,6 +680,8 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
This is needed for i.e. references from asm statements. */
if (varpool_used_from_object_file_p (vnode))
return true;
+ if (vnode->resolution == LDPR_PREVAILING_DEF_IRONLY)
+ return false;
/* As a special case, the COMDAT virutal tables can be unshared.
In LTO mode turn vtables into static variables. The variable is readonly,
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index e78012b1f4a..2b21fdd8ad2 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -1769,7 +1769,7 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
if (best_hard_regno >= 0)
{
for (i = hard_regno_nregs[best_hard_regno][mode] - 1; i >= 0; i--)
- allocated_hardreg_p[best_hard_regno + 1] = true;
+ allocated_hardreg_p[best_hard_regno + i] = true;
}
ALLOCNO_HARD_REGNO (a) = best_hard_regno;
ALLOCNO_ASSIGNED_P (a) = true;
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index edc3ad7759e..9254b8f9014 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -52,7 +52,7 @@ static void output_cgraph_opt_summary (cgraph_node_set set);
static void input_cgraph_opt_summary (VEC (cgraph_node_ptr, heap) * nodes);
/* Number of LDPR values known to GCC. */
-#define LDPR_NUM_KNOWN (LDPR_RESOLVED_DYN + 1)
+#define LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1)
/* Cgraph streaming is organized as set of record whose type
is indicated by a tag. */
@@ -817,7 +817,6 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
int i, n_nodes;
lto_cgraph_encoder_t encoder;
lto_varpool_encoder_t varpool_encoder;
- struct cgraph_asm_node *can;
static bool asm_nodes_output = false;
if (flag_wpa)
@@ -854,6 +853,8 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
streamer_write_uhwi_stream (ob->main_stream, 0);
+ lto_destroy_simple_output_block (ob);
+
/* Emit toplevel asms.
When doing WPA we must output every asm just once. Since we do not partition asm
nodes at all, output them to first output. This is kind of hack, but should work
@@ -861,19 +862,9 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset)
if (!asm_nodes_output)
{
asm_nodes_output = true;
- for (can = cgraph_asm_nodes; can; can = can->next)
- {
- int len = TREE_STRING_LENGTH (can->asm_str);
- streamer_write_uhwi_stream (ob->main_stream, len);
- for (i = 0; i < len; ++i)
- streamer_write_char_stream (ob->main_stream,
- TREE_STRING_POINTER (can->asm_str)[i]);
- }
+ lto_output_toplevel_asms ();
}
- streamer_write_uhwi_stream (ob->main_stream, 0);
-
- lto_destroy_simple_output_block (ob);
output_varpool (set, vset);
output_refs (set, vset, encoder, varpool_encoder);
}
@@ -1185,7 +1176,6 @@ input_cgraph_1 (struct lto_file_decl_data *file_data,
VEC(cgraph_node_ptr, heap) *nodes = NULL;
struct cgraph_node *node;
unsigned i;
- unsigned HOST_WIDE_INT len;
tag = streamer_read_enum (ib, LTO_cgraph_tags, LTO_cgraph_last_tag);
while (tag)
@@ -1206,18 +1196,8 @@ input_cgraph_1 (struct lto_file_decl_data *file_data,
tag = streamer_read_enum (ib, LTO_cgraph_tags, LTO_cgraph_last_tag);
}
- /* Input toplevel asms. */
- len = streamer_read_uhwi (ib);
- while (len)
- {
- char *str = (char *)xmalloc (len + 1);
- for (i = 0; i < len; ++i)
- str[i] = streamer_read_uchar (ib);
- cgraph_add_asm_node (build_string (len, str));
- free (str);
+ lto_input_toplevel_asms (file_data);
- len = streamer_read_uhwi (ib);
- }
/* AUX pointers should be all non-zero for nodes read from the stream. */
#ifdef ENABLE_CHECKING
FOR_EACH_VEC_ELT (cgraph_node_ptr, nodes, i, node)
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
index 1c285faf19e..6783f4aab5f 100644
--- a/gcc/lto-section-in.c
+++ b/gcc/lto-section-in.c
@@ -53,6 +53,7 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] =
"cgraph",
"vars",
"refs",
+ "asm",
"jmpfuncs",
"pureconst",
"reference",
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index bae21d5bc4a..ef972cab1d0 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1141,6 +1141,47 @@ lto_input_tree (struct lto_input_block *ib, struct data_in *data_in)
}
+/* Input toplevel asms. */
+
+void
+lto_input_toplevel_asms (struct lto_file_decl_data *file_data)
+{
+ size_t len;
+ const char *data = lto_get_section_data (file_data, LTO_section_asm,
+ NULL, &len);
+ const struct lto_asm_header *header = (const struct lto_asm_header *) data;
+ int32_t string_offset;
+ struct data_in *data_in;
+ struct lto_input_block ib;
+ tree str;
+
+ if (! data)
+ return;
+
+ string_offset = sizeof (*header) + header->main_size;
+
+ LTO_INIT_INPUT_BLOCK (ib,
+ data + sizeof (*header),
+ 0,
+ header->main_size);
+
+ data_in = lto_data_in_create (file_data, data + string_offset,
+ header->string_size, NULL);
+
+ /* Make sure the file was generated by the exact same compiler. */
+ lto_check_version (header->lto_header.major_version,
+ header->lto_header.minor_version);
+
+ while ((str = streamer_read_string_cst (data_in, &ib)))
+ cgraph_add_asm_node (str);
+
+ clear_line_info (data_in);
+ lto_data_in_delete (data_in);
+
+ lto_free_section_data (file_data, LTO_section_asm, NULL, data, len);
+}
+
+
/* Initialization for the LTO reader. */
void
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index a8d60073c77..d107b916e56 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -934,6 +934,61 @@ output_unreferenced_globals (cgraph_node_set set, varpool_node_set vset)
}
+/* Emit toplevel asms. */
+
+void
+lto_output_toplevel_asms (void)
+{
+ struct output_block *ob;
+ struct cgraph_asm_node *can;
+ char *section_name;
+ struct lto_output_stream *header_stream;
+ struct lto_asm_header header;
+
+ if (! cgraph_asm_nodes)
+ return;
+
+ ob = create_output_block (LTO_section_asm);
+
+ /* Make string 0 be a NULL string. */
+ streamer_write_char_stream (ob->string_stream, 0);
+
+ for (can = cgraph_asm_nodes; can; can = can->next)
+ streamer_write_string_cst (ob, ob->main_stream, can->asm_str);
+
+ streamer_write_string_cst (ob, ob->main_stream, NULL_TREE);
+
+ section_name = lto_get_section_name (LTO_section_asm, NULL, NULL);
+ lto_begin_section (section_name, !flag_wpa);
+ free (section_name);
+
+ /* The entire header stream is computed here. */
+ memset (&header, 0, sizeof (header));
+
+ /* Write the header. */
+ header.lto_header.major_version = LTO_major_version;
+ header.lto_header.minor_version = LTO_minor_version;
+ header.lto_header.section_type = LTO_section_asm;
+
+ header.main_size = ob->main_stream->total_size;
+ header.string_size = ob->string_stream->total_size;
+
+ header_stream = XCNEW (struct lto_output_stream);
+ lto_output_data_stream (header_stream, &header, sizeof (header));
+ lto_write_stream (header_stream);
+ free (header_stream);
+
+ /* Put all of the gimple and the string table out the asm file as a
+ block of text. */
+ lto_write_stream (ob->main_stream);
+ lto_write_stream (ob->string_stream);
+
+ lto_end_section ();
+
+ destroy_output_block (ob);
+}
+
+
/* Copy the function body of NODE without deserializing. */
static void
@@ -1352,6 +1407,15 @@ produce_symtab (struct output_block *ob,
node = lto_cgraph_encoder_deref (encoder, i);
if (!DECL_EXTERNAL (node->decl))
continue;
+ /* We keep around unused extern inlines in order to be able to inline
+ them indirectly or via vtables. Do not output them to symbol
+ table: they end up being undefined and just consume space. */
+ if (!node->address_taken && !node->callers)
+ {
+ gcc_assert (node->analyzed);
+ gcc_assert (DECL_DECLARED_INLINE_P (node->decl));
+ continue;
+ }
if (DECL_COMDAT (node->decl)
&& cgraph_comdat_can_be_unshared_p (node))
continue;
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c
index 633c3ce4d50..e3ccb79d813 100644
--- a/gcc/lto-streamer.c
+++ b/gcc/lto-streamer.c
@@ -166,13 +166,13 @@ lto_get_section_name (int section_type, const char *name, struct lto_file_decl_d
doesn't confuse the reader with merged sections.
For options don't add a ID, the option reader cannot deal with them
- and merging should be ok here.
-
- XXX: use crc64 to minimize collisions? */
+ and merging should be ok here. */
if (section_type == LTO_section_opts)
strcpy (post, "");
+ else if (f != NULL)
+ sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, f->id);
else
- sprintf (post, ".%x", f ? f->id : crc32_string(0, get_random_seed (false)));
+ sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, get_random_seed (false));
return concat (LTO_SECTION_NAME_PREFIX, sep, add, post, NULL);
}
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 190d6a3a821..ee818429328 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -142,7 +142,7 @@ along with GCC; see the file COPYING3. If not see
#define LTO_SECTION_NAME_PREFIX ".gnu.lto_"
#define LTO_major_version 2
-#define LTO_minor_version 0
+#define LTO_minor_version 1
typedef unsigned char lto_decl_flags_t;
@@ -238,6 +238,7 @@ enum lto_section_type
LTO_section_cgraph,
LTO_section_varpool,
LTO_section_refs,
+ LTO_section_asm,
LTO_section_jump_functions,
LTO_section_ipa_pure_const,
LTO_section_ipa_reference,
@@ -387,6 +388,23 @@ struct lto_decl_header
};
+/* Structure describing top level asm()s. */
+struct lto_asm_header
+{
+ /* The header for all types of sections. */
+ struct lto_header lto_header;
+
+ /* Size compressed or 0 if not compressed. */
+ int32_t compressed_size;
+
+ /* Size of region for expressions, decls, types, etc. */
+ int32_t main_size;
+
+ /* Size of the string table. */
+ int32_t string_size;
+};
+
+
/* Statistics gathered during LTO, WPA and LTRANS. */
struct lto_stats_d
{
@@ -552,7 +570,7 @@ struct GTY(()) lto_file_decl_data
struct lto_file_decl_data *next;
/* Sub ID for merged objects. */
- unsigned id;
+ unsigned HOST_WIDE_INT id;
/* Symbol resolutions for this file */
VEC(ld_plugin_symbol_resolution_t,heap) * GTY((skip)) resolutions;
@@ -789,6 +807,7 @@ extern void lto_input_function_body (struct lto_file_decl_data *, tree,
const char *);
extern void lto_input_constructors_and_inits (struct lto_file_decl_data *,
const char *);
+extern void lto_input_toplevel_asms (struct lto_file_decl_data *);
extern struct data_in *lto_data_in_create (struct lto_file_decl_data *,
const char *, unsigned,
VEC(ld_plugin_symbol_resolution_t,heap) *);
@@ -807,6 +826,7 @@ extern void lto_register_decl_definition (tree, struct lto_file_decl_data *);
extern struct output_block *create_output_block (enum lto_section_type);
extern void destroy_output_block (struct output_block *);
extern void lto_output_tree (struct output_block *, tree, bool);
+extern void lto_output_toplevel_asms (void);
extern void produce_asm (struct output_block *ob, tree fn);
void lto_output_decl_state_streams (struct output_block *,
struct lto_out_decl_state *);
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 3a7c783f770..68c6231760e 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -441,12 +441,14 @@ lto_symtab_resolve_symbols (void **slot)
e->node = cgraph_get_node (e->decl);
else if (TREE_CODE (e->decl) == VAR_DECL)
e->vnode = varpool_get_node (e->decl);
+ if (e->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
+ || e->resolution == LDPR_PREVAILING_DEF)
+ prevailing = e;
}
- e = (lto_symtab_entry_t) *slot;
-
/* If the chain is already resolved there is nothing else to do. */
- if (e->resolution != LDPR_UNKNOWN)
+ if (prevailing)
return;
/* Find the single non-replaceable prevailing symbol and
@@ -586,6 +588,7 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
for (prevailing = (lto_symtab_entry_t) *slot;
prevailing
&& prevailing->resolution != LDPR_PREVAILING_DEF_IRONLY
+ && prevailing->resolution != LDPR_PREVAILING_DEF_IRONLY_EXP
&& prevailing->resolution != LDPR_PREVAILING_DEF;
prevailing = prevailing->next)
;
@@ -595,6 +598,7 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
for (e = prevailing->next; e; e = e->next)
{
if (e->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
|| e->resolution == LDPR_PREVAILING_DEF)
fatal_error ("multiple prevailing defs for %qE",
DECL_NAME (prevailing->decl));
@@ -685,9 +689,9 @@ lto_symtab_merge_decls_1 (void **slot, void *data ATTRIBUTE_UNUSED)
to handle UNKNOWN relocation well.
The problem with storing guessed decision is whether to use
- PREVAILING_DEF or PREVAILING_DEF_IRONLY. First one would disable
- some whole program optimizations, while ther second would imply
- to many whole program assumptions. */
+ PREVAILING_DEF, PREVAILING_DEF_IRONLY, PREVAILING_DEF_IRONLY_EXP.
+ First one would disable some whole program optimizations, while
+ ther second would imply to many whole program assumptions. */
if (prevailing->node && !flag_ltrans && !prevailing->guessed)
prevailing->node->resolution = prevailing->resolution;
else if (prevailing->vnode && !flag_ltrans && !prevailing->guessed)
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 6e1e187e0c4..d3d7ffd484e 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,31 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47247
+ * common.c (lto_resolution_str): Add new resolution.
+ * common.h (lto_resolution_str): Likewise.
+
+2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
+ Andi Kleen <ak@linux.intel.com>
+
+ PR lto/50568
+ * lto.c (lto_splay_tree_delete_id): New.
+ (lto_splay_tree_compare_ids): Likewise.
+ (lto_splay_tree_lookup): Likewise.
+ (lto_splay_tree_id_equal_p): Likewise.
+ (lto_splay_tree_insert): Likewise.
+ (lto_splay_tree_new): Likewise.
+ (lto_resolution_read): Change id to unsigned HOST_WIDE_INT.
+ Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup.
+ (create_subid_section_table): Use lto_splay_tree_lookup and
+ lto_splay_tree_insert.
+ (lto_file_read): Use lto_splay_tree_new.
+
+2011-09-26 Andi Kleen <ak@linux.intel.com>
+
+ * lto.c (lto_resolution_read): Remove id dumping.
+ (lto_section_with_id): Turn id HOST_WIDE_ID.
+ (create_subid_section_table): Dito.
+
2011-08-28 Dodji Seketeli <dodji@redhat.com>
* lto-lang.c (lto_init): Likewise. Also, avoid calling
diff --git a/gcc/lto/common.c b/gcc/lto/common.c
index b54ec491e12..a23fdbb8434 100644
--- a/gcc/lto/common.c
+++ b/gcc/lto/common.c
@@ -31,7 +31,7 @@ const char *lto_visibility_str[4] __attribute__ ((visibility ("hidden"))) =
"INTERNAL", "HIDDEN"
};
-const char *lto_resolution_str[9] __attribute__ ((visibility ("hidden"))) =
+const char *lto_resolution_str[10] __attribute__ ((visibility ("hidden"))) =
{
"UNKNOWN",
"UNDEF",
@@ -41,6 +41,7 @@ const char *lto_resolution_str[9] __attribute__ ((visibility ("hidden"))) =
"PREEMPTED_IR",
"RESOLVED_IR",
"RESOLVED_EXEC",
- "RESOLVED_DYN"
+ "RESOLVED_DYN",
+ "PREVAILING_DEF_IRONLY_EXP",
};
diff --git a/gcc/lto/common.h b/gcc/lto/common.h
index e82184795ba..6f9a6928916 100644
--- a/gcc/lto/common.h
+++ b/gcc/lto/common.h
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
-static const char *lto_resolution_str[9] =
+static const char *lto_resolution_str[10] =
{
"UNKNOWN",
"UNDEF",
@@ -30,5 +30,6 @@ static const char *lto_resolution_str[9] =
"PREEMPTED_IR",
"RESOLVED_IR",
"RESOLVED_EXEC",
- "RESOLVED_DYN"
+ "RESOLVED_DYN",
+ "PREVAILING_DEF_IRONLY_EXP",
};
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 0b1dcb9c8b5..778e33eee01 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -93,6 +93,71 @@ lto_obj_create_section_hash_table (void)
return htab_create (37, hash_name, eq_name, free_with_string);
}
+/* Delete an allocated integer KEY in the splay tree. */
+
+static void
+lto_splay_tree_delete_id (splay_tree_key key)
+{
+ free ((void *) key);
+}
+
+/* Compare splay tree node ids A and B. */
+
+static int
+lto_splay_tree_compare_ids (splay_tree_key a, splay_tree_key b)
+{
+ unsigned HOST_WIDE_INT ai;
+ unsigned HOST_WIDE_INT bi;
+
+ ai = *(unsigned HOST_WIDE_INT *) a;
+ bi = *(unsigned HOST_WIDE_INT *) b;
+
+ if (ai < bi)
+ return -1;
+ else if (ai > bi)
+ return 1;
+ return 0;
+}
+
+/* Look up splay tree node by ID in splay tree T. */
+
+static splay_tree_node
+lto_splay_tree_lookup (splay_tree t, unsigned HOST_WIDE_INT id)
+{
+ return splay_tree_lookup (t, (splay_tree_key) &id);
+}
+
+/* Check if KEY has ID. */
+
+static bool
+lto_splay_tree_id_equal_p (splay_tree_key key, unsigned HOST_WIDE_INT id)
+{
+ return *(unsigned HOST_WIDE_INT *) key == id;
+}
+
+/* Insert a splay tree node into tree T with ID as key and FILE_DATA as value.
+ The ID is allocated separately because we need HOST_WIDE_INTs which may
+ be wider than a splay_tree_key. */
+
+static void
+lto_splay_tree_insert (splay_tree t, unsigned HOST_WIDE_INT id,
+ struct lto_file_decl_data *file_data)
+{
+ unsigned HOST_WIDE_INT *idp = XCNEW (unsigned HOST_WIDE_INT);
+ *idp = id;
+ splay_tree_insert (t, (splay_tree_key) idp, (splay_tree_value) file_data);
+}
+
+/* Create a splay tree. */
+
+static splay_tree
+lto_splay_tree_new (void)
+{
+ return splay_tree_new (lto_splay_tree_compare_ids,
+ lto_splay_tree_delete_id,
+ NULL);
+}
+
/* Read the constructors and inits. */
static void
@@ -944,14 +1009,16 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file)
for (i = 0; i < num_symbols; i++)
{
int t;
- unsigned index, id;
+ unsigned index;
+ unsigned HOST_WIDE_INT id;
char r_str[27];
enum ld_plugin_symbol_resolution r = (enum ld_plugin_symbol_resolution) 0;
unsigned int j;
unsigned int lto_resolution_str_len =
sizeof (lto_resolution_str) / sizeof (char *);
- t = fscanf (resolution, "%u %x %26s %*[^\n]\n", &index, &id, r_str);
+ t = fscanf (resolution, "%u " HOST_WIDE_INT_PRINT_HEX_PURE " %26s %*[^\n]\n",
+ &index, &id, r_str);
if (t != 3)
internal_error ("invalid line in the resolution file");
if (index > max_index)
@@ -968,17 +1035,15 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file)
if (j == lto_resolution_str_len)
internal_error ("invalid resolution in the resolution file");
- if (!(nd && nd->key == id))
+ if (!(nd && lto_splay_tree_id_equal_p (nd->key, id)))
{
- nd = splay_tree_lookup (file_ids, id);
+ nd = lto_splay_tree_lookup (file_ids, id);
if (nd == NULL)
- internal_error ("resolution sub id %x not in object file", id);
+ internal_error ("resolution sub id " HOST_WIDE_INT_PRINT_HEX_PURE
+ " not in object file", id);
}
file_data = (struct lto_file_decl_data *)nd->value;
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Adding resolution %u %u to id %x\n",
- index, r, file_data->id);
VEC_safe_grow_cleared (ld_plugin_symbol_resolution_t, heap,
file_data->resolutions,
max_index + 1);
@@ -990,14 +1055,14 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file)
/* Is the name for a id'ed LTO section? */
static int
-lto_section_with_id (const char *name, unsigned *id)
+lto_section_with_id (const char *name, unsigned HOST_WIDE_INT *id)
{
const char *s;
if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX)))
return 0;
s = strrchr (name, '.');
- return s && sscanf (s, ".%x", id) == 1;
+ return s && sscanf (s, "." HOST_WIDE_INT_PRINT_HEX_PURE, id) == 1;
}
/* Create file_data of each sub file id */
@@ -1008,7 +1073,7 @@ create_subid_section_table (void **slot, void *data)
struct lto_section_slot s_slot, *new_slot;
struct lto_section_slot *ls = *(struct lto_section_slot **)slot;
splay_tree file_ids = (splay_tree)data;
- unsigned id;
+ unsigned HOST_WIDE_INT id;
splay_tree_node nd;
void **hash_slot;
char *new_name;
@@ -1018,7 +1083,7 @@ create_subid_section_table (void **slot, void *data)
return 1;
/* Find hash table of sub module id */
- nd = splay_tree_lookup (file_ids, id);
+ nd = lto_splay_tree_lookup (file_ids, id);
if (nd != NULL)
{
file_data = (struct lto_file_decl_data *)nd->value;
@@ -1029,7 +1094,7 @@ create_subid_section_table (void **slot, void *data)
memset(file_data, 0, sizeof (struct lto_file_decl_data));
file_data->id = id;
file_data->section_hash_table = lto_obj_create_section_hash_table ();;
- splay_tree_insert (file_ids, id, (splay_tree_value)file_data);
+ lto_splay_tree_insert (file_ids, id, file_data);
}
/* Copy section into sub module hash table */
@@ -1080,7 +1145,7 @@ static int lto_create_files_from_ids (splay_tree_node node, void *data)
lto_file_finalize (file_data, lw->file);
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Creating file %s with sub id %x\n",
+ fprintf (cgraph_dump_file, "Creating file %s with sub id " HOST_WIDE_INT_PRINT_HEX "\n",
file_data->file_name, file_data->id);
file_data->next = *lw->file_data;
*lw->file_data = file_data;
@@ -1107,7 +1172,7 @@ lto_file_read (lto_file *file, FILE *resolution_file, int *count)
/* Find all sub modules in the object and put their sections into new hash
tables in a splay tree. */
- file_ids = splay_tree_new (splay_tree_compare_ints, NULL, NULL);
+ file_ids = lto_splay_tree_new ();
htab_traverse (section_hash_table, create_subid_section_table, file_ids);
/* Add resolutions to file ids */
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 28be9425b44..57186ec8710 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -476,7 +476,12 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan)
sbitmap *uses_of_defs;
rtx last_reg_move;
rtx prev_reg, old_reg;
-
+ rtx set = single_set (u->insn);
+
+ /* Skip instructions that do not set a register. */
+ if ((set && !REG_P (SET_DEST (set))))
+ continue;
+
/* Compute the number of reg_moves needed for u, by looking at life
ranges started at u (excluding self-loops). */
for (e = u->out; e; e = e->next_out)
@@ -493,6 +498,20 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan)
&& SCHED_COLUMN (e->dest) < SCHED_COLUMN (e->src))
nreg_moves4e--;
+ if (nreg_moves4e >= 1)
+ {
+ /* !single_set instructions are not supported yet and
+ thus we do not except to encounter them in the loop
+ except from the doloop part. For the latter case
+ we assume no regmoves are generated as the doloop
+ instructions are tied to the branch with an edge. */
+ gcc_assert (set);
+ /* If the instruction contains auto-inc register then
+ validate that the regmov is being generated for the
+ target regsiter rather then the inc'ed register. */
+ gcc_assert (!autoinc_var_is_used_p (u->insn, e->dest->insn));
+ }
+
nreg_moves = MAX (nreg_moves, nreg_moves4e);
}
@@ -1266,12 +1285,10 @@ sms_schedule (void)
continue;
}
- /* Don't handle BBs with calls or barriers or auto-increment insns
- (to avoid creating invalid reg-moves for the auto-increment insns),
+ /* Don't handle BBs with calls or barriers
or !single_set with the exception of instructions that include
count_reg---these instructions are part of the control part
that do-loop recognizes.
- ??? Should handle auto-increment insns.
??? Should handle insns defining subregs. */
for (insn = head; insn != NEXT_INSN (tail); insn = NEXT_INSN (insn))
{
@@ -1282,7 +1299,6 @@ sms_schedule (void)
|| (NONDEBUG_INSN_P (insn) && !JUMP_P (insn)
&& !single_set (insn) && GET_CODE (PATTERN (insn)) != USE
&& !reg_mentioned_p (count_reg, insn))
- || (FIND_REG_INC_NOTE (insn, NULL_RTX) != 0)
|| (INSN_P (insn) && (set = single_set (insn))
&& GET_CODE (SET_DEST (set)) == SUBREG))
break;
@@ -1296,8 +1312,6 @@ sms_schedule (void)
fprintf (dump_file, "SMS loop-with-call\n");
else if (BARRIER_P (insn))
fprintf (dump_file, "SMS loop-with-barrier\n");
- else if (FIND_REG_INC_NOTE (insn, NULL_RTX) != 0)
- fprintf (dump_file, "SMS reg inc\n");
else if ((NONDEBUG_INSN_P (insn) && !JUMP_P (insn)
&& !single_set (insn) && GET_CODE (PATTERN (insn)) != USE))
fprintf (dump_file, "SMS loop-with-not-single-set\n");
diff --git a/gcc/opts.c b/gcc/opts.c
index 52b6ba75254..c16ca09b81f 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -484,6 +484,8 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_2_PLUS, OPT_falign_jumps, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_falign_labels, NULL, 1 },
{ OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 },
+ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_foptimize_strlen, NULL, 1 },
/* -O3 optimizations. */
{ OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
@@ -779,7 +781,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
#else
error_at (loc, "LTO support has not been enabled in this configuration");
#endif
- }
+ if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
+ error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
+}
if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
+ (opts->x_flag_lto_partition_none != 0) >= 1)
{
diff --git a/gcc/output.h b/gcc/output.h
index 6b7c4b8781c..661b623807c 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -443,6 +443,7 @@ extern void no_asm_to_stream (FILE *);
#define SECTION_COMMON 0x800000 /* contains common data */
#define SECTION_RELRO 0x1000000 /* data is readonly after relocation processing */
#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
+#define SECTION_EXCLUDE 0x4000000 /* discarded by the linker */
/* This SECTION_STYLE is used for unnamed sections that we can switch
to using a special assembler directive. */
diff --git a/gcc/params.def b/gcc/params.def
index c376c80ebfb..5e49c48f7b9 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -165,6 +165,13 @@ DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
"The maximum length of scheduling's pending operations list",
32, 0, 0)
+/* This parameter limits the number of backtracking attempts when using the
+ haifa scheduler for modulo scheduling. */
+DEFPARAM(PARAM_MAX_MODULO_BACKTRACK_ATTEMPTS,
+ "max-modulo-backtrack-attempts",
+ "The maximum number of backtrack attempts the scheduler should make when modulo scheduling a loop",
+ 40, 0, 0)
+
DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
"large-function-insns",
"The size of function body to be considered large",
@@ -921,6 +928,23 @@ DEFPARAM (PARAM_TREE_REASSOC_WIDTH,
"reassociated tree. If 0, use the target dependent heuristic.",
0, 0, 0)
+DEFPARAM (PARAM_MAX_TAIL_MERGE_COMPARISONS,
+ "max-tail-merge-comparisons",
+ "Maximum amount of similar bbs to compare a bb with",
+ 10, 0, 0)
+
+DEFPARAM (PARAM_MAX_TAIL_MERGE_ITERATIONS,
+ "max-tail-merge-iterations",
+ "Maximum amount of iterations of the pass over a function",
+ 2, 0, 0)
+
+/* Maximum number of strings for which strlen optimization pass will
+ track string lenths. */
+DEFPARAM (PARAM_MAX_TRACKED_STRLENS,
+ "max-tracked-strlens",
+ "Maximum number of strings for which strlen optimization pass will "
+ "track string lengths",
+ 1000, 0, 0)
/*
Local variables:
diff --git a/gcc/passes.c b/gcc/passes.c
index 88b71478bb7..4d8ca6e42f2 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1,7 +1,7 @@
/* Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1321,6 +1321,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_phiopt);
NEXT_PASS (pass_object_sizes);
+ NEXT_PASS (pass_strlen);
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_cse_sincos);
diff --git a/gcc/reload.c b/gcc/reload.c
index c671765ba93..53dcd2dafed 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -2825,6 +2825,13 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* Address operands are reloaded in their existing mode,
no matter what is specified in the machine description. */
operand_mode[i] = GET_MODE (recog_data.operand[i]);
+
+ /* If the address is a single CONST_INT pick address mode
+ instead otherwise we will later not know in which mode
+ the reload should be performed. */
+ if (operand_mode[i] == VOIDmode)
+ operand_mode[i] = Pmode;
+
}
else if (code == MEM)
{
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 7e4e092d469..6070eaa81a6 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -396,7 +396,6 @@ static int reload_reg_free_for_value_p (int, int, int, enum reload_type,
rtx, rtx, int, int);
static int free_for_value_p (int, enum machine_mode, int, enum reload_type,
rtx, rtx, int, int);
-static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type);
static int allocate_reload_reg (struct insn_chain *, int, int);
static int conflicts_with_override (rtx);
static void failed_reload (rtx, int);
@@ -5346,19 +5345,37 @@ reload_reg_free_p (unsigned int regno, int opnum, enum reload_type type)
}
}
-/* Return 1 if the value in reload reg REGNO, as used by a reload
- needed for the part of the insn specified by OPNUM and TYPE,
- is still available in REGNO at the end of the insn.
+/* Return 1 if the value in reload reg REGNO, as used by the reload with
+ the number RELOADNUM, is still available in REGNO at the end of the insn.
We can assume that the reload reg was already tested for availability
at the time it is needed, and we should not check this again,
in case the reg has already been marked in use. */
static int
-reload_reg_reaches_end_p (unsigned int regno, int opnum, enum reload_type type)
+reload_reg_reaches_end_p (unsigned int regno, int reloadnum)
{
+ int opnum = rld[reloadnum].opnum;
+ enum reload_type type = rld[reloadnum].when_needed;
int i;
+ /* See if there is a reload with the same type for this operand, using
+ the same register. This case is not handled by the code below. */
+ for (i = reloadnum + 1; i < n_reloads; i++)
+ {
+ rtx reg;
+ int nregs;
+
+ if (rld[i].opnum != opnum || rld[i].when_needed != type)
+ continue;
+ reg = rld[i].reg_rtx;
+ if (reg == NULL_RTX)
+ continue;
+ nregs = hard_regno_nregs[REGNO (reg)][GET_MODE (reg)];
+ if (regno >= REGNO (reg) && regno < REGNO (reg) + nregs)
+ return 0;
+ }
+
switch (type)
{
case RELOAD_OTHER:
@@ -5485,13 +5502,12 @@ reload_reg_reaches_end_p (unsigned int regno, int opnum, enum reload_type type)
every register in the range [REGNO, REGNO + NREGS). */
static bool
-reload_regs_reach_end_p (unsigned int regno, int nregs,
- int opnum, enum reload_type type)
+reload_regs_reach_end_p (unsigned int regno, int nregs, int reloadnum)
{
int i;
for (i = 0; i < nregs; i++)
- if (!reload_reg_reaches_end_p (regno + i, opnum, type))
+ if (!reload_reg_reaches_end_p (regno + i, reloadnum))
return false;
return true;
}
@@ -8103,8 +8119,7 @@ emit_reload_insns (struct insn_chain *chain)
/* For a multi register reload, we need to check if all or part
of the value lives to the end. */
for (k = 0; k < nr; k++)
- if (reload_reg_reaches_end_p (i + k, rld[r].opnum,
- rld[r].when_needed))
+ if (reload_reg_reaches_end_p (i + k, r))
CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k);
/* Maybe the spill reg contains a copy of reload_out. */
@@ -8135,8 +8150,7 @@ emit_reload_insns (struct insn_chain *chain)
mode = GET_MODE (reg);
regno = REGNO (reg);
nregs = hard_regno_nregs[regno][mode];
- if (reload_regs_reach_end_p (regno, nregs, rld[r].opnum,
- rld[r].when_needed))
+ if (reload_regs_reach_end_p (regno, nregs, r))
{
rtx out = (REG_P (rld[r].out)
? rld[r].out
@@ -8208,8 +8222,7 @@ emit_reload_insns (struct insn_chain *chain)
mode = GET_MODE (reg);
regno = REGNO (reg);
nregs = hard_regno_nregs[regno][mode];
- if (reload_regs_reach_end_p (regno, nregs, rld[r].opnum,
- rld[r].when_needed))
+ if (reload_regs_reach_end_p (regno, nregs, r))
{
int in_regno;
int in_nregs;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 860f6c47af2..567aff93668 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2074,17 +2074,18 @@ extern GTY(()) rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
#define constm1_rtx (const_int_rtx[MAX_SAVED_CONST_INT-1])
extern GTY(()) rtx const_true_rtx;
-extern GTY(()) rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
+extern GTY(()) rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
/* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
same as VOIDmode. */
#define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
-/* Likewise, for the constants 1 and 2. */
+/* Likewise, for the constants 1 and 2 and -1. */
#define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
#define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
+#define CONSTM1_RTX(MODE) (const_tiny_rtx[3][(int) (MODE)])
/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
is used to represent the frame pointer. This is because the
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index ca0e1441275..5ec1de017b4 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -66,7 +66,6 @@ static int rank (rtx, rtx);
static int ebb_contributes_to_priority (rtx, rtx);
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);
static void debug_ebb_dependencies (rtx, rtx);
static void ebb_add_remove_insn (rtx, int);
@@ -476,14 +475,35 @@ add_deps_for_risky_insns (rtx head, rtx tail)
}
}
-/* Schedule a single extended basic block, defined by the boundaries HEAD
- and TAIL. */
+/* Schedule a single extended basic block, defined by the boundaries
+ HEAD and TAIL.
-static basic_block
-schedule_ebb (rtx head, rtx tail)
+ We change our expectations about scheduler behaviour depending on
+ whether MODULO_SCHEDULING is true. If it is, we expect that the
+ caller has already called set_modulo_params and created delay pairs
+ as appropriate. If the modulo schedule failed, we return
+ NULL_RTX. */
+
+basic_block
+schedule_ebb (rtx head, rtx tail, bool modulo_scheduling)
{
basic_block first_bb, target_bb;
struct deps_desc tmp_deps;
+ bool success;
+
+ /* Blah. We should fix the rest of the code not to get confused by
+ a note or two. */
+ while (head != tail)
+ {
+ if (NOTE_P (head) || DEBUG_INSN_P (head))
+ head = NEXT_INSN (head);
+ else if (NOTE_P (tail) || DEBUG_INSN_P (tail))
+ tail = PREV_INSN (tail);
+ else if (LABEL_P (head))
+ head = NEXT_INSN (head);
+ else
+ break;
+ }
first_bb = BLOCK_FOR_INSN (head);
last_bb = BLOCK_FOR_INSN (tail);
@@ -530,7 +550,9 @@ schedule_ebb (rtx head, rtx tail)
/* Make ready list big enough to hold all the instructions from the ebb. */
sched_extend_ready_list (rgn_n_insns);
- schedule_block (&target_bb);
+ success = schedule_block (&target_bb);
+ gcc_assert (success || modulo_scheduling);
+
/* Free ready list. */
sched_finish_ready_list ();
@@ -538,7 +560,7 @@ schedule_ebb (rtx head, rtx tail)
so we may made some of them empty. Can't assert (b == last_bb). */
/* Sanity check: verify that all region insns were scheduled. */
- gcc_assert (sched_rgn_n_insns == rgn_n_insns);
+ gcc_assert (modulo_scheduling || sched_rgn_n_insns == rgn_n_insns);
/* Free dependencies. */
sched_free_deps (current_sched_info->head, current_sched_info->tail, true);
@@ -555,29 +577,14 @@ schedule_ebb (rtx head, rtx tail)
delete_basic_block (last_bb->next_bb);
}
- return last_bb;
+ return success ? last_bb : NULL;
}
-/* The one entry point in this file. */
-
+/* Perform initializations before running schedule_ebbs or a single
+ schedule_ebb. */
void
-schedule_ebbs (void)
+schedule_ebbs_init (void)
{
- basic_block bb;
- int probability_cutoff;
- rtx tail;
-
- if (profile_info && flag_branch_probabilities)
- probability_cutoff = PARAM_VALUE (TRACER_MIN_BRANCH_PROBABILITY_FEEDBACK);
- else
- probability_cutoff = PARAM_VALUE (TRACER_MIN_BRANCH_PROBABILITY);
- probability_cutoff = REG_BR_PROB_BASE / 100 * probability_cutoff;
-
- /* Taking care of this degenerate case makes the rest of
- this code simpler. */
- if (n_basic_blocks == NUM_FIXED_BLOCKS)
- return;
-
/* Setup infos. */
{
memcpy (&ebb_common_sched_info, &haifa_common_sched_info,
@@ -599,6 +606,43 @@ schedule_ebbs (void)
/* Initialize DONT_CALC_DEPS and ebb-{start, end} markers. */
bitmap_initialize (&dont_calc_deps, 0);
bitmap_clear (&dont_calc_deps);
+}
+
+/* Perform cleanups after scheduling using schedules_ebbs or schedule_ebb. */
+void
+schedule_ebbs_finish (void)
+{
+ bitmap_clear (&dont_calc_deps);
+
+ /* Reposition the prologue and epilogue notes in case we moved the
+ prologue/epilogue insns. */
+ if (reload_completed)
+ reposition_prologue_and_epilogue_notes ();
+
+ haifa_sched_finish ();
+}
+
+/* The main entry point in this file. */
+
+void
+schedule_ebbs (void)
+{
+ basic_block bb;
+ int probability_cutoff;
+ rtx tail;
+
+ /* Taking care of this degenerate case makes the rest of
+ this code simpler. */
+ if (n_basic_blocks == NUM_FIXED_BLOCKS)
+ return;
+
+ if (profile_info && flag_branch_probabilities)
+ probability_cutoff = PARAM_VALUE (TRACER_MIN_BRANCH_PROBABILITY_FEEDBACK);
+ else
+ probability_cutoff = PARAM_VALUE (TRACER_MIN_BRANCH_PROBABILITY);
+ probability_cutoff = REG_BR_PROB_BASE / 100 * probability_cutoff;
+
+ schedule_ebbs_init ();
/* Schedule every region in the subroutine. */
FOR_EACH_BB (bb)
@@ -625,30 +669,9 @@ schedule_ebbs (void)
bb = bb->next_bb;
}
- /* Blah. We should fix the rest of the code not to get confused by
- a note or two. */
- while (head != tail)
- {
- if (NOTE_P (head) || DEBUG_INSN_P (head))
- head = NEXT_INSN (head);
- else if (NOTE_P (tail) || DEBUG_INSN_P (tail))
- tail = PREV_INSN (tail);
- else if (LABEL_P (head))
- head = NEXT_INSN (head);
- else
- break;
- }
-
- bb = schedule_ebb (head, tail);
+ bb = schedule_ebb (head, tail, false);
}
- bitmap_clear (&dont_calc_deps);
-
- /* Reposition the prologue and epilogue notes in case we moved the
- prologue/epilogue insns. */
- if (reload_completed)
- reposition_prologue_and_epilogue_notes ();
-
- haifa_sched_finish ();
+ schedule_ebbs_finish ();
}
/* INSN has been added to/removed from current ebb. */
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 6797397b9bb..02e8c6055eb 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -1257,7 +1257,7 @@ extern int dep_cost (dep_t);
extern int set_priorities (rtx, rtx);
extern void sched_setup_bb_reg_pressure_info (basic_block, rtx);
-extern void schedule_block (basic_block *);
+extern bool schedule_block (basic_block *);
extern int cycle_issued_insns;
extern int issue_rate;
@@ -1280,7 +1280,12 @@ extern rtx sched_emit_insn (rtx);
extern rtx get_ready_element (int);
extern int number_in_ready (void);
+/* Types and functions in sched-ebb.c. */
+extern basic_block schedule_ebb (rtx, rtx, bool);
+extern void schedule_ebbs_init (void);
+extern void schedule_ebbs_finish (void);
+
/* Types and functions in sched-rgn.c. */
/* A region is the main entity for interblock scheduling: insns
@@ -1330,7 +1335,9 @@ extern int current_blocks;
extern int target_bb;
extern bool sched_no_dce;
-extern void record_delay_slot_pair (rtx, rtx, int);
+extern void set_modulo_params (int, int, int, int);
+extern void record_delay_slot_pair (rtx, rtx, int, int);
+extern void discard_delay_pairs_above (int);
extern void free_delay_pairs (void);
extern void add_delay_dependencies (rtx);
extern bool sched_is_disabled_for_current_region_p (void);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index d81e3a6282c..13016169859 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2431,9 +2431,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
case IOR:
if (trueop1 == CONST0_RTX (mode))
return op0;
- if (CONST_INT_P (trueop1)
- && ((UINTVAL (trueop1) & GET_MODE_MASK (mode))
- == GET_MODE_MASK (mode)))
+ if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode))
return op1;
if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
return op0;
@@ -2573,9 +2571,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
case XOR:
if (trueop1 == CONST0_RTX (mode))
return op0;
- if (CONST_INT_P (trueop1)
- && ((UINTVAL (trueop1) & GET_MODE_MASK (mode))
- == GET_MODE_MASK (mode)))
+ if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode))
return simplify_gen_unary (NOT, mode, op0, mode);
if (rtx_equal_p (trueop0, trueop1)
&& ! side_effects_p (op0)
@@ -2721,6 +2717,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
case AND:
if (trueop1 == CONST0_RTX (mode) && ! side_effects_p (op0))
return trueop1;
+ if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode))
+ return op0;
if (HWI_COMPUTABLE_MODE_P (mode))
{
HOST_WIDE_INT nzop0 = nonzero_bits (trueop0, mode);
diff --git a/gcc/target.def b/gcc/target.def
index 1e09ba7bfad..48a8e6d4a13 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -1546,7 +1546,7 @@ DEFHOOK
DEFHOOK
(subset_p,
"",
- bool, (addr_space_t superset, addr_space_t subset),
+ bool, (addr_space_t subset, addr_space_t superset),
default_addr_space_subset_p)
/* Function to convert an rtl expression from one address space to another. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index aa7ddc5a5cc..37a71e5e4d8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,488 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/ctor-empty-1.c: Update dump file.
+
+2011-10-01 David S. Miller <davem@davemloft.net>
+
+ * gcc.target/sparc/cmask.c: New test.
+ * gcc.target/sparc/fpadds.c: New test.
+ * gcc.target/sparc/fshift.c: New test.
+ * gcc.target/sparc/fucmp.c: New test.
+ * gcc.target/sparc/vis3misc.c: New test.
+
+2011-10-01 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50585
+ * gfortran.dg/assumed_charlen_arg_2.f90: New.
+
+2011-09-30 Janis Johnson <janisjo@codesourcery.com>
+
+ PR c++/44473
+ * g++.dg/dfp/44473-1.C: New test.
+ * g++.dg/dfp/44473-2.C: New test.
+ * g++.dg/dfp/mangle-1.C: New test.
+ * g++.dg/dfp/mangle-2.C: New test.
+ * g++.dg/dfp/mangle-3.C: New test.
+ * g++.dg/dfp/mangle-4.C: New test.
+ * g++.dg/dfp/mangle-5.C: New test.
+
+2011-09-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/50571
+ * gcc.dg/pr50571.c: New test.
+
+ PR tree-optimization/46309
+ * gcc.dg/pr46309.c: New test.
+
+2011-09-30 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/strlenopt-21.c: New test.
+
+2011-09-30 Revital Eres <revital.eres@linaro.org>
+
+ * gcc.dg/sms-10.c: New file.
+
+2011-09-30 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
+
+ * gcc.target/arm/pr50099.c: New test.
+
+2011-09-30 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
+ * gcc.target/arm/pr42835.c: Add -fno-tree-tail-merge.
+
+2011-09-30 David S. Miller <davem@davemloft.net>
+
+ * gcc.target/sparc/bmaskbshuf.c: New test.
+ * gcc.target/sparc/edgen.c: New test.
+
+2011-09-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50547
+ * gfortran.dg/pure_formal_proc_3.f90: New.
+
+ PR fortran/50553
+ * gfortran.dg/stfunc_7.f90: New.
+
+2011-09-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>
+
+ * gcc.c-torture/execute/vector-compare-1.c: New testcase.
+ * gcc.c-torture/execute/vector-compare-2.c: Likewise.
+ * gcc.dg/vector-compare-1.c: Likewise.
+ * gcc.dg/vector-compare-2.c: Likewise.
+
+2011-09-29 David S. Miller <davem@davemloft.net>
+
+ * gcc.target/sparc/array.c: New test.
+
+2011-09-29 Jiangning Liu <jiangning.liu@arm.com>
+
+ * gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c: Explicitly turn on
+ loop unroll and set max unroll times to 8.
+ * gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c: Likewise.
+ * gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c: Likewise.
+ * gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c: Likewise.
+ * gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c: Likewise.
+
+2011-09-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/40145
+ * g++.dg/ext/visibility/warn5.C: New.
+
+2011-09-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/45278
+ * g++.dg/warn/Wextra-3.C: New.
+
+2011-09-28 Oleg Endo <oleg.endo@t-online.de>
+
+ PR target/49486
+ * gcc.target/sh/pr49468-si.c: New.
+
+2011-09-28 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/50485
+ * gcc.target/i386/sse4_1-blendps.c: Include <stdlib.h>.
+ (TEST): Initialize src3 with random floats.
+ * gcc.target/i386/sse4_1-blendps-2.c (sse4_1_test): Remove field i from
+ union src3. Initialize src3 with random floats.
+
+2011-09-27 Oleg Endo <oleg.endo@t-online.de>
+
+ * gcc.target/sh/mfmovd.c: Extend list of supported targets.
+ * gcc.target/sh/struct-arg-dw2.c: Fix typo.
+ * gcc.target/sh/sh4a-sincos.c: Make test SH4A only.
+ * gcc.target/sh/sh4a-sincosf.c: Ditto.
+ * gcc.target/sh/sh4a-cos.c: Ditto.
+ * gcc.target/sh/sh4a-cosf.c: Ditto.
+ * gcc.target/sh/sh4a-sin.c: Ditto.
+ * gcc.target/sh/sh4a-sinf.c: Ditto.
+ * gcc.target/sh/sh4a-fsrra.c: Ditto.
+ * gcc.target/sh/sh4a-memmovua.c: Ditto.
+ * gcc.target/sh/sh4a-bitmovua.c: Ditto.
+
+2011-09-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/31489
+ * g++.dg/parse/error40.C: New.
+ * g++.dg/warn/incomplete1.C: Adjust.
+
+2011-09-27 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/49463
+ * gcc.c-torture/execute/builtins/strstr-asm-lib.c (my_strstr):
+ Mark used.
+
+2011-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/strlenopt-1.c: New test.
+ * gcc.dg/strlenopt-1f.c: New test.
+ * gcc.dg/strlenopt-2.c: New test.
+ * gcc.dg/strlenopt-2f.c: New test.
+ * gcc.dg/strlenopt-3.c: New test.
+ * gcc.dg/strlenopt-4.c: New test.
+ * gcc.dg/strlenopt-4g.c: New test.
+ * gcc.dg/strlenopt-4gf.c: New test.
+ * gcc.dg/strlenopt-5.c: New test.
+ * gcc.dg/strlenopt-6.c: New test.
+ * gcc.dg/strlenopt-7.c: New test.
+ * gcc.dg/strlenopt-8.c: New test.
+ * gcc.dg/strlenopt-9.c: New test.
+ * gcc.dg/strlenopt-10.c: New test.
+ * gcc.dg/strlenopt-11.c: New test.
+ * gcc.dg/strlenopt-12.c: New test.
+ * gcc.dg/strlenopt-12g.c: New test.
+ * gcc.dg/strlenopt-13.c: New test.
+ * gcc.dg/strlenopt-14g.c: New test.
+ * gcc.dg/strlenopt-14gf.c: New test.
+ * gcc.dg/strlenopt-15.c: New test.
+ * gcc.dg/strlenopt-16g.c: New test.
+ * gcc.dg/strlenopt-17g.c: New test.
+ * gcc.dg/strlenopt-18g.c: New test.
+ * gcc.dg/strlenopt.h: New file.
+
+2011-09-27 Tom de Vries <tom@codesourcery.com>
+
+ PR middle-end/43864
+ * gcc.dg/fold-compare-2.c (dg-options): Add -fno-tree-tail-merge.
+ * gcc/testsuite/gcc.dg/uninit-pred-2_c.c: Same.
+ * gcc.dg/pr43864.c: New test.
+ * gcc.dg/pr43864-2.c: Same.
+ * gcc.dg/pr43864-3.c: Same.
+ * gcc.dg/pr43864-4.c: Same.
+
+2011-09-27 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/inline-5.c: New testcase.
+
+2011-09-27 Ira Rosen <ira.rosen@linaro.org>
+
+ * gcc.dg/vect/bb-slp-11.c: Expect to get vectorized with 64-bit
+ vectors.
+ * gcc.dg/vect/bb-slp-27.c: New.
+ * gcc.dg/vect/bb-slp-28.c: New.
+
+2011-09-27 Bernd Schmidt <bernds@codesourcery.com>
+
+ * testsuite/lib/target-supports.exp (check_profiling_available):
+ Don't rely solely on TLS tests for -fprofile-generate, fall
+ through to the other code.
+
+2011-09-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50363
+ * gcc.dg/torture/pr50363.c: New testcase.
+
+2011-09-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/45012
+ * g++.dg/template/partial13.C: New.
+
+ PR c++/46105
+ * g++.dg/template/partial12.C: New.
+
+ PR c++/50508
+ * g++.dg/cpp0x/constexpr-typedef1.C: New.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/45487
+ * g++.dg/diagnostic/bindings1.C: New.
+ * g++.old-deja/g++.pt/memtemp77.C: Adjust.
+
+2011-09-26 David S. Miller <davem@davemloft.net>
+
+ * gcc.target/sparc/wrgsr.c: New test.
+ * gcc.target/sparc/rdgsr.c: New test.
+ * gcc.target/sparc/edge.c: New test.
+ * gcc.target/sparc/fcmp.c: New test.
+
+ * gcc.target/sparc/edge.c: Update for new return types.
+ * gcc.target/sparc/fcmp.c: Likewise.
+
+ * gcc.target/sparc/fpaddsubi.c: New test.
+
+2011-09-26 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50515
+ * gfortran.dg/common_15.f90: New.
+
+ PR fortran/50517
+ * gfortran.dg/dummy_procedure_5.f90: New.
+ * gfortran.dg/interface_26.f90: Modified error message.
+ * gfortran.dg/proc_ptr_11.f90: Ditto.
+ * gfortran.dg/proc_ptr_15.f90: Ditto.
+ * gfortran.dg/proc_ptr_comp_20.f90: Ditto.
+ * gfortran.dg/proc_ptr_result_5.f90: Ditto.
+
+2011-09-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/50512
+ * g++.dg/overload/rvalue3.C: New.
+
+ PR c++/50523
+ * g++.dg/overload/ref-conv2.C: New.
+
+ * g++.dg/cpp0x/nsdmi-template1.C: New.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/cpp0x/nullptr25.C: New.
+
+2011-09-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50472
+ * gcc.dg/torture/pr50472.c: New testcase.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt22.adb: New test.
+ * gnat.dg/opt22_pkg.ad[sb]: New helper.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt21.adb: New test.
+ * gnat.dg/opt21_pkg.ad[sb]: New helper.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt20.ad[sb]: New test.
+ * gnat.dg/opt20_pkg.ads: New helper.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/array17.adb: New test.
+ * gnat.dg/array17_pkg.ads: New helper.
+
+2011-09-25 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/nsdmi-defer4.C: New.
+
+2011-09-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/frame_overflow.ads: New.
+ * gnat.dg/frame_overflow.adb: Adjust.
+ * gnat.dg/specs/addr1.ads: Likewise.
+
+2011-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/tree-ssa/restrict2.C: New test.
+
+2011-09-25 Ira Rosen <ira.rosen@linaro.org>
+
+ * lib/target-supports.exp (check_effective_target_vect64): New.
+ * gcc.dg/vect/bb-slp-11.c: Expect the error message twice in case
+ of multiple vector sizes.
+ * gcc.dg/vect/bb-slp-26.c: New.
+
+2011-09-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50280
+ * g++.dg/template/bitfield1.C: New.
+
+2011-09-25 Ira Rosen <ira.rosen@linaro.org>
+
+ * gcc.dg/vect/bb-slp-24.c: New.
+
+2011-09-24 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/nsdmi-eh1.C: New.
+
+ * g++.dg/cpp0x/nsdmi-defer3.C: New.
+
+ * g++.dg/cpp0x/nsdmi-defer1.C: New.
+ * g++.dg/cpp0x/nsdmi-defer2.C: New.
+
+ * g++.dg/cpp0x/nsdmi1.C: New.
+ * g++.dg/cpp0x/nsdmi2.C: New.
+ * g++.dg/cpp0x/nsdmi3.C: New.
+ * g++.dg/cpp0x/nsdmi4.C: New.
+ * g++.old-deja/g++.other/init4.C: New.
+
+2011-09-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44267
+ * g++.dg/template/sfinae28.C: New.
+
+2011-09-23 Ian Lance Taylor <iant@google.com>
+
+ * go.test/go-test.exp (errchk): Handle more cases of getting
+ correct Tcl backslash quoting in regular expressions in test file.
+
+2011-09-23 Jason Merrill <jason@redhat.com>
+
+ Core 253
+ * g++.dg/init/const8.C: New.
+ * g++.dg/cpp0x/constexpr-object1.C: Add a data member.
+ * g++.dg/cpp0x/defaulted2.C: Likewise.
+ * g++.dg/cpp0x/pr42844-2.C: Likewise.
+ * g++.dg/init/pr20039.C: Likewise.
+ * g++.dg/init/pr42844.C: Likewise.
+
+2011-09-23 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/inline-1.c: new testcase.
+ * gcc.dg/ipa/inline-2.c: new testcase.
+ * gcc.dg/ipa/inline-3.c: new testcase.
+ * gcc.dg/ipa/inline-4.c: new testcase.
+
+2011-09-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50258
+ * g++.dg/cpp0x/constexpr-static8.C: New.
+
+2011-09-23 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.target/i386/avxfp-1.c: New test.
+ * gcc.target/i386/avxfp-2.c: New test.
+
+2011-09-23 Terry Guo <terry.guo@arm.com>
+
+ * gcc.c-torture/execute/941014-1.x: Deleted.
+
+2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50491
+ * g++.dg/cpp0x/pr50491.C: New.
+
+2011-09-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR testsuite/50487
+ * gfortran.dg/bessel_6.f90: Fix tolerance test.
+
+2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50371
+ * g++.dg/cpp0x/nullptr24.C: New.
+
+2011-09-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/50482
+ * gcc.target/i386/pr50482.c: New test.
+
+2011-09-22 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.target/i386/pad-2.c, gcc.target/i386/pad-3.c,
+ gcc.target/i386/pad-4.c, gcc.target/i386/pad-5a.c,
+ gcc.target/i386/pad-5b.c, gcc.target/i386/pad-6a.c,
+ gcc.target/i386/pad-6b.c, gcc.target/i386/pad-7.c,
+ gcc.target/i386/pad-8.c, gcc.target/i386/pad-9.c,
+ gcc.target/i386/pad-10.cm gcc.target/i386/vect-double-1.c: Skip if
+ multilib options contain different -march= from dg-options.
+
+2011-09-22 Jonathan Wakely <jwakely.gcc@gmail.com>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50344
+ * g++.dg/template/friend52.C: New.
+
+2011-09-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * gcc.target/arm/cmp-1.c: New test.
+ * gcc.target/arm/cmp-2.c: Likewise.
+
+2011-09-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41733
+ * gfortran.dg/impure_actual_1.f90: Modified error message.
+ * gfortran.dg/proc_ptr_32.f90: New.
+ * gfortran.dg/proc_ptr_33.f90: New.
+
+2011-09-22 Ira Rosen <ira.rosen@linaro.org>
+
+ PR tree-optimization/50451
+ * gcc.dg/vect/pr50451.c: New test.
+
+2011-09-21 Ian Lance Taylor <iant@google.com>
+
+ * go.test/go-test.exp (errchk): Add special case for bug332.
+ (go-gc-tests): Add special cases for bug347 and bug348. Recognize
+ some more test lines.
+
+2011-09-21 Uros Bizjak <ubizjak@gmail.com>
+
+ * g++.dg/other/i386-3.C: Remove duplicated dg-options.
+ * g++.dg/other/i386-4.C: Remove dg-require-effective-target directive.
+ * g++.dg/other/i386-8.C: Ditto.
+ * g++.dg/other/pr34435.C: Ditto.
+ * g++.dg/other/pr39496.C: Ditto.
+ * g++.dg/other/mmintrin.C: Ditto.
+
+2011-09-21 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/vect/vect-cond-7.c: New test.
+ * gcc.target/i386/sse4_1-cond-1.c: New test.
+ * gcc.target/i386/avx-cond-1.c: New test.
+
+2011-09-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/50464
+ * g++.dg/other/pr50464.C: New test.
+
+2011-09-21 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * gcc.target/i386/bmi2-mulx32-2.c: New test.
+ * gcc.target/i386/bmi2-mulx32-2a.c: Ditto.
+ * gcc.target/i386/bmi2-mulx64-2.c: Ditto.
+ * gcc.target/i386/bmi2-mulx64-2a.c: Ditto.
+
+2011-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt19.adb: New test.
+
+2011-09-21 Terry Guo <terry.guo@arm.com>
+
+ * gcc.target/arm/neon-thumb2-move.c: Skip the warning message
+ on arch conflict when testing case on targets other than armv7-a.
+
+2011-09-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50454
+ * g++.dg/ext/int128-1.C: New.
+ * g++.dg/ext/int128-2.C: Likewise.
+ * g++.dg/ext/int128-2.h: Likewise.
+
+2011-09-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/50469
+ * gfortran.dg/storage_size_2.f08: Replace "must be be" with
+ "must be".
+
+2011-09-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-generated1.C: New.
+
+ PR c++/50442
+ * g++.dg/overload/ref-conv1.C: New.
+
+2011-09-20 Roberto Agostino Vitillo <ravitillo@lbl.gov>
+
+ * g++.dg/other/final1.C: New.
+
+2011-09-20 Ira Rosen <ira.rosen@linaro.org>
+
+ * g++.dg/vect/slp-pr50413.cc: Don't run the test. Remove main ()
+ and get_bit ().
+
2011-09-19 Ian Bolton <ian.bolton@arm.com>
* gcc.dg/20100906-1.c: Use -fno-short-enums option for
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
new file mode 100644
index 00000000000..73ddc8f5c2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
@@ -0,0 +1,21 @@
+// { dg-options -std=c++0x }
+
+template <class T> struct A
+{
+ constexpr T f ();
+};
+
+int g();
+
+// We should complain about this.
+template<> constexpr int A<int>::f()
+{ return g(); } // { dg-error "non-constexpr" }
+
+// But not about this.
+struct B
+{
+ int i;
+ constexpr B(int i = g()):i(i) { }
+};
+struct C: B { };
+C c;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
index 3af85095fa5..4ff398bf1f0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
@@ -7,7 +7,7 @@
// p 1 constexpr specifier
// objects, static const data
-struct A1 { }; // { dg-message "no user-provided default constructor" }
+struct A1 { int i; }; // { dg-message "no user-provided default constructor" }
constexpr int i1 = 1024;
constexpr A1 a1 = A1();
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
new file mode 100644
index 00000000000..7c84cf8b07b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
@@ -0,0 +1,7 @@
+// PR c++/50258
+// { dg-options "-std=c++0x -fpermissive" }
+
+struct Foo {
+ static const double d = 3.14; // { dg-warning "constexpr" }
+};
+const double Foo::d; // { dg-warning "constexpr" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
new file mode 100644
index 00000000000..2719e3aea12
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
@@ -0,0 +1,11 @@
+// PR c++/50508
+// { dg-options -std=c++0x }
+
+template <class T>
+ struct integral_constant {
+ typedef T value_type;
+ constexpr operator value_type() { return true; }
+ };
+
+static constexpr bool value = integral_constant<bool>()
+ && true;
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
index 1f400f4fad0..e3aac8f1a9f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
@@ -17,7 +17,8 @@ void g() = delete; // { dg-error "redefinition" }
struct B // { dg-message "user-provided default constructor" }
{
- B() = default; // { dg-message "not user-provided" }
+ int i;
+ B() = default; // { dg-message "not user-provided" }
};
const B b; // { dg-error "uninitialized const" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C
new file mode 100644
index 00000000000..b3d9b935750
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C
@@ -0,0 +1,14 @@
+// { dg-options -std=c++0x }
+
+#define SA(X) static_assert(X,#X)
+
+struct A
+{
+ int i = f();
+ int j { f() };
+ static constexpr int f() { return 42; }
+};
+
+constexpr A a;
+SA(a.i == 42);
+SA(a.j == 42);
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer2.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer2.C
new file mode 100644
index 00000000000..1951262f9da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer2.C
@@ -0,0 +1,9 @@
+// { dg-options -std=c++0x }
+
+struct A
+{
+ int i = f();
+ static int f(int i = 42) { return i; }
+};
+
+A a;
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C
new file mode 100644
index 00000000000..2777fb5d8e6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C
@@ -0,0 +1,19 @@
+// Do NSDMI get deferred instantiation?
+// { dg-options -std=c++0x }
+
+template <class T>
+struct A
+{
+ T t = T(42);
+ constexpr A() { }
+ A(T t): t(t) { }
+};
+
+struct B { };
+
+#define SA(X) static_assert(X,#X)
+
+constexpr A<int> a1;
+SA(a1.t == 42);
+
+A<B> a2 {B()};
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C
new file mode 100644
index 00000000000..65b2e738077
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C
@@ -0,0 +1,18 @@
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+struct A
+{
+ int i = 42;
+ int j = f();
+ int k = this->f();
+ int f() { return i++; }
+};
+
+A a;
+
+int main()
+{
+ if (a.j != 42 || a.k != 43 || a.i != 44)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
new file mode 100644
index 00000000000..09c92d2f158
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
@@ -0,0 +1,18 @@
+// Core issue 1351
+// { dg-do run { xfail *-*-* } }
+// { dg-options -std=c++0x }
+
+bool fail;
+struct A
+{
+ int i = fail ? throw "noooooooo" : 42;
+};
+
+int main()
+{
+ A a1;
+ if (a1.i != 42) return 1;
+ fail = true;
+ try { A a2; }
+ catch (...) { }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
new file mode 100644
index 00000000000..04f1e0391d9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
@@ -0,0 +1,21 @@
+// { dg-do run }
+// { dg-options -std=c++0x }
+
+struct base
+{
+ int calc_avg() { return 42; }
+};
+
+template <class T> struct nsdmi : T
+{
+ nsdmi() {}
+ int avg() { return avg_; }
+ int avg_ = this->calc_avg();
+};
+
+int main()
+{
+ nsdmi<base> x;
+ if (x.avg() != 42)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C
new file mode 100644
index 00000000000..f6381d0fdb4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C
@@ -0,0 +1,53 @@
+// { dg-do run }
+// { dg-options -std=c++0x }
+
+struct A
+{
+ int i = 42;
+};
+
+struct B
+{
+ int i = 42;
+ B() { }
+ B(int i): i(i) { }
+};
+
+template <class T, T t>
+struct C
+{
+ T m = t;
+};
+
+template <class T, T t>
+struct D
+{
+ T m = t;
+ D() { }
+ D(T m):m(m) { }
+};
+
+int main()
+{
+ A a1;
+ if (a1.i != 42) return 1;
+ A a2 = { 24 };
+ if (a2.i != 24) return 2;
+ A a3[1];
+ if (a3[0].i != 42) return 3;
+
+ B b1;
+ if (b1.i != 42) return 3;
+ B b2 (24);
+ if (b2.i != 24) return 4;
+
+ C<int,3> c1;
+ if (c1.m != 3) return 5;
+ C<int,3> c2 { 5 };
+ if (c2.m != 5) return 6;
+
+ D<int,3> d1;
+ if (d1.m != 3) return 7;
+ D<int,3> d2 (5) ;
+ if (d2.m != 5) return 8;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi2.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi2.C
new file mode 100644
index 00000000000..9636bed8820
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi2.C
@@ -0,0 +1,21 @@
+// { dg-options -std=c++0x }
+
+struct A
+{
+ int i;
+ constexpr A(int i): i(i) {}
+};
+
+struct B
+{
+ A a1 = 1;
+ A a2 { 2 };
+ A a3 = { 3 };
+};
+
+#define SA(X) static_assert(X,#X)
+
+constexpr B b;
+SA(b.a1.i == 1);
+SA(b.a2.i == 2);
+SA(b.a3.i == 3);
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C
new file mode 100644
index 00000000000..73b2bc2e1ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C
@@ -0,0 +1,18 @@
+// { dg-options -std=c++0x }
+
+struct A
+{
+ int i;
+ explicit constexpr A(int i): i(i) {}
+};
+
+struct B
+{
+ A a1 = 1; // { dg-error "" }
+ A a2 { 2 };
+ A a3 = { 3 }; // { dg-error "" }
+};
+
+constexpr B b; // { dg-error "B::B" }
+
+// { dg-message "a1. is invalid" "" { target *-*-* } 11 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi4.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi4.C
new file mode 100644
index 00000000000..db365cb55e5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi4.C
@@ -0,0 +1,24 @@
+// { dg-do run }
+// { dg-options -std=c++0x }
+
+int c;
+
+struct A
+{
+ A() { }
+ A(const A&) { }
+};
+
+A f() { ++c; return A(); }
+
+struct B
+{
+ A a = f();
+};
+
+int main()
+{
+ B b1, b2;
+ if (c != 2)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr24.C b/gcc/testsuite/g++.dg/cpp0x/nullptr24.C
new file mode 100644
index 00000000000..f3917796627
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr24.C
@@ -0,0 +1,5 @@
+// PR c++/50371
+// { dg-options -std=c++0x }
+
+template<decltype(nullptr)>
+struct nt;
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr25.C b/gcc/testsuite/g++.dg/cpp0x/nullptr25.C
new file mode 100644
index 00000000000..b8a7f45c674
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr25.C
@@ -0,0 +1,6 @@
+// { dg-options -std=c++0x }
+
+template<decltype(nullptr)>
+struct nt{};
+
+nt<nullptr> x;
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C b/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
index 5af4ff217f3..4425aacf627 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C
@@ -4,6 +4,7 @@
struct A // { dg-message "user-provided default constructor" }
{
+ int i;
A() = default; // { dg-message "not user-provided" }
};
@@ -14,17 +15,20 @@ struct Base
struct Derived : Base // { dg-message "user-provided default constructor" }
{
+ int i;
Derived() = default; // { dg-message "not user-provided" }
};
struct Derived2 : Base // { dg-message "user-provided default constructor" }
{
+ int i;
Derived2() = default; // { dg-message "not user-provided" }
Derived2( Derived2 const& ) = default;
};
struct Derived3 : Base // { dg-message "user-provided default constructor" }
{
+ int i;
Derived3( Derived3 const& ) = default;
Derived3() = default; // { dg-message "not user-provided" }
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50491.C b/gcc/testsuite/g++.dg/cpp0x/pr50491.C
new file mode 100644
index 00000000000..48e7a1f743b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr50491.C
@@ -0,0 +1,17 @@
+// { dg-options "-std=c++0x" }
+
+struct GrandParent {
+ void *get();
+};
+
+template<class OBJ>
+struct Parent : public GrandParent{
+};
+
+template<typename T>
+struct Child : public Parent<T> {
+ using GrandParent::get;
+ void Foo() {
+ void* ex = get();
+ }
+};
diff --git a/gcc/testsuite/g++.dg/dfp/44473-1.C b/gcc/testsuite/g++.dg/dfp/44473-1.C
new file mode 100644
index 00000000000..38689fa165d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/44473-1.C
@@ -0,0 +1,122 @@
+/* { dg-do assemble } */
+
+/* Minimized from the testcase in PR c++/44473; mangling of decimal types
+ did not include CV qualifiers. */
+
+namespace std
+{
+ namespace decimal
+ {
+ class decimal32
+ {
+ public:
+ typedef float __decfloat32 __attribute__ ((mode (SD)));
+ explicit decimal32 (float __r):__val (__r) {}
+ private:
+ __decfloat32 __val;
+ };
+ };
+
+ template <typename _BI1, typename _BI2>
+ _BI2 copy_backward (_BI1 __first, _BI2 __result);
+}
+
+namespace __gnu_cxx
+{
+ template <typename _Iterator, typename _Container>
+ class __normal_iterator
+ {
+ public:
+ explicit __normal_iterator (const _Iterator & __i) {}
+ const _Iterator & base () const {}
+ };
+
+ template <typename _IteratorL, typename _IteratorR, typename _Container>
+ bool operator== (const __normal_iterator <_IteratorL, _Container> &__lhs,
+ const __normal_iterator <_IteratorR, _Container> &__rhs)
+ {
+ return __lhs.base () == __rhs.base ();
+ }
+
+ template <typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef _Tp *pointer;
+ typedef const _Tp *const_pointer;
+ template <typename _Tp1>
+ struct rebind
+ {
+ typedef new_allocator <_Tp1> other;
+ };
+ };
+}
+
+namespace std
+{
+ template <typename _Tp>
+ class allocator:public __gnu_cxx::new_allocator <_Tp> {};
+
+ template <typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind <_Tp>::other _Tp_alloc_type;
+ struct _Vector_impl:public _Tp_alloc_type
+ {
+ typename _Tp_alloc_type::pointer _M_finish;
+ };
+ public: _Vector_impl _M_impl;
+ };
+
+ template <typename _Tp, typename _Alloc = std::allocator <_Tp> >
+ class vector:protected _Vector_base <_Tp, _Alloc>
+ {
+ typedef _Vector_base <_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef typename _Tp_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator <pointer, vector> iterator;
+ typedef __gnu_cxx::__normal_iterator <const_pointer, vector>
+ const_iterator;
+ const_iterator begin () const;
+ iterator end ()
+ {
+ return iterator (this->_M_impl._M_finish);
+ }
+ const_iterator end () const
+ {
+ return const_iterator (this->_M_impl._M_finish);
+ }
+ bool empty () const
+ {
+ return begin () == end ();
+ }
+ void push_back (const value_type & __x)
+ {
+ _M_insert_aux (end ());
+ }
+ void _M_insert_aux (iterator __position);
+ };
+
+ template <typename _Tp, typename _Alloc>
+ void vector <_Tp, _Alloc>::_M_insert_aux (iterator __position)
+ {
+ std::copy_backward (__position.base (), this->_M_impl._M_finish - 1);
+ }
+}
+
+std::vector <std::decimal::decimal32> vec;
+
+int
+foo ()
+{
+ return (vec.empty ()) ? 1 : 0;
+}
+
+bool
+bar ()
+{
+ vec.push_back (std::decimal::decimal32 (0));
+}
diff --git a/gcc/testsuite/g++.dg/dfp/44473-2.C b/gcc/testsuite/g++.dg/dfp/44473-2.C
new file mode 100644
index 00000000000..311f62299b3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/44473-2.C
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+
+namespace std {
+ namespace decimal {
+ class decimal64 {
+ public:
+ typedef float __decfloat64 __attribute__ ((mode (DD)));
+ explicit decimal64 (int __r):__val (__r) {}
+ private:
+ __decfloat64 __val;
+ };
+ }
+}
+
+int bar (const std::decimal::decimal64 & x) { }
+
+int foo ()
+{
+ std::decimal::decimal64 x(0);
+ bar (x);
+}
+
+// { dg-final { scan-assembler "_Z3barRKDd:" } }
diff --git a/gcc/testsuite/g++.dg/dfp/mangle-1.C b/gcc/testsuite/g++.dg/dfp/mangle-1.C
new file mode 100644
index 00000000000..455d3e4c0ef
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/mangle-1.C
@@ -0,0 +1,40 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+// Derived from g++.dg/abi/mangle13.C.
+
+namespace std {
+ namespace decimal {
+ class decimal64 {
+ public:
+ typedef float __decfloat64 __attribute__ ((mode (DD)));
+ explicit decimal64 (float __r):__val (__r) {}
+ private:
+ __decfloat64 __val;
+ };
+ }
+}
+
+struct A {
+ template <typename T> std::decimal::decimal64 f ();
+ std::decimal::decimal64 operator+();
+ operator std::decimal::decimal64 ();
+ template <typename T>
+ std::decimal::decimal64 operator-();
+};
+
+typedef std::decimal::decimal64 (A::*P)();
+
+template <P> struct S {};
+
+template <typename T> void g (S<&T::template f<std::decimal::decimal64> >) {}
+template <typename T> void g (S<&T::operator+ >) {}
+template <typename T> void g (S<&T::operator std::decimal::decimal64>) {}
+template <typename T> void g (S<&T::template operator- <std::decimal::decimal64> >) {}
+
+template void g<A> (S<&A::f<std::decimal::decimal64> >);
+template void g<A> (S<&A::operator+>);
+template void g<A> (S<&A::operator std::decimal::decimal64>);
+
+// { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_1fIDdEEE\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_plEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/dfp/mangle-2.C b/gcc/testsuite/g++.dg/dfp/mangle-2.C
new file mode 100644
index 00000000000..1af9aa1a03b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/mangle-2.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+// Derived from g++.dg/abi/mangle15.C.
+
+namespace std {
+ namespace decimal {
+ class decimal64 {
+ public:
+ typedef float __decfloat64 __attribute__ ((mode (DD)));
+ explicit decimal64 (float __r):__val (__r) {}
+ private:
+ __decfloat64 __val;
+ };
+ }
+}
+
+struct A {
+ template <typename T> std::decimal::decimal64 f ();
+};
+
+typedef std::decimal::decimal64 (A::*P)();
+
+template <P> struct S {};
+
+void g (S<&A::f<std::decimal::decimal64> >) {}
+
+// { dg-final { scan-assembler "\n?_Z1g1SIXadL_ZN1A1fIDdEEDdvEEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/dfp/mangle-3.C b/gcc/testsuite/g++.dg/dfp/mangle-3.C
new file mode 100644
index 00000000000..c716ed0e919
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/mangle-3.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+// Derived from g++.dg/abi/mangle20-1.C.
+
+namespace std {
+ namespace decimal {
+ class decimal64 {
+ public:
+ typedef float __decfloat64 __attribute__ ((mode (DD)));
+ explicit decimal64 (int __r):__val (__r) {}
+ private:
+ __decfloat64 __val;
+ };
+ }
+}
+
+template <int I> void f(std::decimal::decimal64 (*)[2]) {}
+template <int I> void g(std::decimal::decimal64 (*)[I+2]) {}
+
+static const std::decimal::decimal64 I(1);
+static const std::decimal::decimal64 J(2);
+
+template void f<1>(std::decimal::decimal64 (*)[2]);
+template void g<1>(std::decimal::decimal64 (*)[3]);
+
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPA2_Dd\[: \t\n\]" } }
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_Dd\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/dfp/mangle-4.C b/gcc/testsuite/g++.dg/dfp/mangle-4.C
new file mode 100644
index 00000000000..899d5661c0d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/mangle-4.C
@@ -0,0 +1,35 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+// Derived from g++.dg/abi/mangle30.C.
+
+namespace std {
+ namespace decimal {
+ class decimal64 {
+ public:
+ typedef float __decfloat64 __attribute__ ((mode (DD)));
+ explicit decimal64 (int __r):__val (__r) {}
+ private:
+ __decfloat64 __val;
+ };
+ }
+}
+
+struct A
+{
+ template <class T>
+ struct B
+ {
+ typedef T myT;
+ };
+};
+
+template <class T>
+void f (T t, typename T::template B<std::decimal::decimal64>::myT u, typename T::template B<int>::myT v);
+
+void foo ()
+{
+ f (A(), std::decimal::decimal64(0), 1);
+}
+
+// { dg-final { scan-assembler "_Z1fI1AEvT_NS1_1BIDdE3myTENS2_IiE3myTE" } }
diff --git a/gcc/testsuite/g++.dg/dfp/mangle-5.C b/gcc/testsuite/g++.dg/dfp/mangle-5.C
new file mode 100644
index 00000000000..794577f866a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/dfp/mangle-5.C
@@ -0,0 +1,29 @@
+// { dg-do compile }
+
+// Mangling of classes from std::decimal are special-cased.
+// Derived from g++.dg/abi/mangle35.C.
+
+namespace std {
+ namespace decimal {
+ class decimal128 {
+ public:
+ typedef float __decfloat128 __attribute__ ((mode (TD)));
+ explicit decimal128 (int __r):__val (__r) {}
+ private:
+ __decfloat128 __val;
+ };
+ }
+}
+
+template<void (*)()> struct A {};
+
+template<typename> void foo();
+
+template<typename T> A<foo<T> > bar();
+
+void baz()
+{
+ bar<std::decimal::decimal128>();
+}
+
+// { dg-final { scan-assembler "_Z3barIDeE1AIX3fooIT_EEEv" } }
diff --git a/gcc/testsuite/g++.dg/diagnostic/bindings1.C b/gcc/testsuite/g++.dg/diagnostic/bindings1.C
new file mode 100644
index 00000000000..4972377a212
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/bindings1.C
@@ -0,0 +1,18 @@
+// PR c++/45487
+// { dg-do run }
+
+extern "C" int strcmp(const char*, const char*);
+
+template <typename T>
+const char* foo(T, typename T::type c) { return __PRETTY_FUNCTION__; }
+
+struct x {typedef int type;};
+
+int main()
+{
+ if (strcmp (foo(x(), 3), "const char* foo(T, typename T::type) "
+ "[with T = x; typename T::type = int]") == 0)
+ return 0;
+ else
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/ext/int128-1.C b/gcc/testsuite/g++.dg/ext/int128-1.C
new file mode 100644
index 00000000000..65540e84841
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/int128-1.C
@@ -0,0 +1,11 @@
+// PR c++/50454
+// { dg-do compile { target int128 } }
+
+template<typename T>
+ struct limits;
+
+template<>
+ struct limits<__int128> { }; // { dg-error "does not support" }
+
+template<>
+ struct limits<unsigned __int128> { }; // { dg-error "does not support" }
diff --git a/gcc/testsuite/g++.dg/ext/int128-2.C b/gcc/testsuite/g++.dg/ext/int128-2.C
new file mode 100644
index 00000000000..36a3f1a44d1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/int128-2.C
@@ -0,0 +1,4 @@
+// PR c++/50454
+// { dg-do compile { target int128 } }
+
+#include "int128-2.h"
diff --git a/gcc/testsuite/g++.dg/ext/int128-2.h b/gcc/testsuite/g++.dg/ext/int128-2.h
new file mode 100644
index 00000000000..4e441be8d0d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/int128-2.h
@@ -0,0 +1,10 @@
+#pragma GCC system_header
+
+template<typename T>
+ struct limits;
+
+template<>
+ struct limits<__int128> { };
+
+template<>
+ struct limits<unsigned __int128> { };
diff --git a/gcc/testsuite/g++.dg/ext/visibility/warn5.C b/gcc/testsuite/g++.dg/ext/visibility/warn5.C
new file mode 100644
index 00000000000..63538e5ada7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/warn5.C
@@ -0,0 +1,11 @@
+// PR c++/40145
+// { dg-do compile }
+// { dg-require-visibility "" }
+// { dg-options "-fvisibility=hidden" }
+
+struct EditorInternalCommand { };
+
+static void createCommandMap()
+{
+ struct CommandEntry { EditorInternalCommand command; };
+}
diff --git a/gcc/testsuite/g++.dg/init/const8.C b/gcc/testsuite/g++.dg/init/const8.C
new file mode 100644
index 00000000000..4eb293d654c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/const8.C
@@ -0,0 +1,11 @@
+// DR 234 - it should be OK to leave off the initializer of a const
+// variable if the default constructor fully initializes the object.
+
+struct A { };
+const A a;
+
+struct B { A a; };
+const B b;
+
+struct C { virtual void f(); };
+const C c;
diff --git a/gcc/testsuite/g++.dg/init/pr20039.C b/gcc/testsuite/g++.dg/init/pr20039.C
index 9b0c12d6ea3..aaac8bd4e3c 100644
--- a/gcc/testsuite/g++.dg/init/pr20039.C
+++ b/gcc/testsuite/g++.dg/init/pr20039.C
@@ -10,6 +10,7 @@ struct M
struct X
{
M m;
+ int i;
};
int mymain()
diff --git a/gcc/testsuite/g++.dg/init/pr42844.C b/gcc/testsuite/g++.dg/init/pr42844.C
index 7b423ccb64b..299a30a91d2 100644
--- a/gcc/testsuite/g++.dg/init/pr42844.C
+++ b/gcc/testsuite/g++.dg/init/pr42844.C
@@ -6,19 +6,19 @@ struct A
A(){}
};
-struct B : A {}; // { dg-message "user-provided default constructor" }
+struct B : A { int i; }; // { dg-message "user-provided default constructor" }
-struct C : A {}; // { dg-message "user-provided default constructor" }
+struct C : A { int i; }; // { dg-message "user-provided default constructor" }
struct D : B { D() {} };
-struct E {}; // { dg-message "user-provided default constructor" }
+struct E { int i; }; // { dg-message "user-provided default constructor" }
template <class T>
-struct F : A {}; // { dg-message "user-provided default constructor" }
+struct F : A { T t; }; // { dg-message "user-provided default constructor" }
template <class T>
-struct G {}; // { dg-message "user-provided default constructor" }
+struct G { T t; }; // { dg-message "user-provided default constructor" }
void f ()
{
@@ -41,9 +41,9 @@ void f ()
extern G<int> const gext;
}
-struct H {}; // { dg-message "user-provided default constructor" }
+struct H { int i; }; // { dg-message "user-provided default constructor" }
-struct I : A {}; // { dg-message "user-provided default constructor" }
+struct I : A { int i; }; // { dg-message "user-provided default constructor" }
template <class T>
void g ()
diff --git a/gcc/testsuite/g++.dg/other/final1.C b/gcc/testsuite/g++.dg/other/final1.C
new file mode 100644
index 00000000000..ffb30c3ec2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/final1.C
@@ -0,0 +1,26 @@
+/* Verify that final methods are devirtualized */
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original -std=c++0x" } */
+
+struct A final
+{
+ virtual void foo ()
+ {
+ }
+};
+
+struct B
+{
+ virtual void foo () final
+ {
+ }
+};
+
+void fun(A* a, B* b)
+{
+ a->foo();
+ b->foo();
+}
+
+/* { dg-final { scan-tree-dump-times "A::foo" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "B::foo" 2 "original" } } */
diff --git a/gcc/testsuite/g++.dg/other/i386-3.C b/gcc/testsuite/g++.dg/other/i386-3.C
index 9abbd3278a2..9dd587a5e76 100644
--- a/gcc/testsuite/g++.dg/other/i386-3.C
+++ b/gcc/testsuite/g++.dg/other/i386-3.C
@@ -1,5 +1,4 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma" } */
/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma" } */
/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
diff --git a/gcc/testsuite/g++.dg/other/i386-4.C b/gcc/testsuite/g++.dg/other/i386-4.C
index 858a3a74e00..3e0d94e952c 100644
--- a/gcc/testsuite/g++.dg/other/i386-4.C
+++ b/gcc/testsuite/g++.dg/other/i386-4.C
@@ -1,6 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O1 -msse2" } */
-/* { dg-require-effective-target sse2 } */
#include <xmmintrin.h>
diff --git a/gcc/testsuite/g++.dg/other/i386-8.C b/gcc/testsuite/g++.dg/other/i386-8.C
index 7de75c73c8b..cf833a524de 100644
--- a/gcc/testsuite/g++.dg/other/i386-8.C
+++ b/gcc/testsuite/g++.dg/other/i386-8.C
@@ -2,7 +2,6 @@
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-O2 -msse2" }
// { dg-options "-O2 -msse2 -fpic" { target fpic } }
-// { dg-require-effective-target sse2 }
#include <xmmintrin.h>
diff --git a/gcc/testsuite/g++.dg/other/mmintrin.C b/gcc/testsuite/g++.dg/other/mmintrin.C
index 8315f93d355..417a1acc6de 100644
--- a/gcc/testsuite/g++.dg/other/mmintrin.C
+++ b/gcc/testsuite/g++.dg/other/mmintrin.C
@@ -1,5 +1,4 @@
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-msse" }
-// { dg-require-effective-target sse }
#include <xmmintrin.h>
diff --git a/gcc/testsuite/g++.dg/other/pr34435.C b/gcc/testsuite/g++.dg/other/pr34435.C
index 107ff6a088b..5352a40eb69 100644
--- a/gcc/testsuite/g++.dg/other/pr34435.C
+++ b/gcc/testsuite/g++.dg/other/pr34435.C
@@ -1,6 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2 -Wno-abi" } */
-/* { dg-require-effective-target sse2 } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/g++.dg/other/pr39060.C b/gcc/testsuite/g++.dg/other/pr39060.C
index a625aea108e..e1494106bb0 100644
--- a/gcc/testsuite/g++.dg/other/pr39060.C
+++ b/gcc/testsuite/g++.dg/other/pr39060.C
@@ -3,17 +3,17 @@
struct A
{
- A(void* i=); // { dg-error "with|specification" }
- A(void* i=); // { dg-error "overloaded" }
- A(void* i=); // { dg-error "overloaded" }
+ A(void* i=); // { dg-error "with|specification|primary-expression" }
+ A(void* i=); // { dg-error "overloaded|primary-expression" }
+ A(void* i=); // { dg-error "overloaded|primary-expression" }
void operator+ (void* i=); // { dg-error "arguments" }
- virtual void foo1(=); // { dg-error "identifier" }
- void foo2(=); // { dg-error "identifier" }
- void foo3(=); // { dg-error "identifier" }
- void foo4(=); // { dg-error "identifier" }
- void foo5(=); // { dg-error "identifier" }
-}; // { dg-error "primary-expression" }
+ virtual void foo1(=); // { dg-error "identifier|primary-expression" }
+ void foo2(=); // { dg-error "identifier|primary-expression" }
+ void foo3(=); // { dg-error "identifier|primary-expression" }
+ void foo4(=); // { dg-error "identifier|primary-expression" }
+ void foo5(=); // { dg-error "identifier|primary-expression" }
+};
A::A (void* i=) {} // { dg-error "primary-expression|argument" }
diff --git a/gcc/testsuite/g++.dg/other/pr39496.C b/gcc/testsuite/g++.dg/other/pr39496.C
index f7f2433595a..e535ee0d69b 100644
--- a/gcc/testsuite/g++.dg/other/pr39496.C
+++ b/gcc/testsuite/g++.dg/other/pr39496.C
@@ -1,7 +1,7 @@
// PR target/39496
// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } }
// { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -mtune=i686 -msse2 -mfpmath=sse" }
-// { dg-require-effective-target sse2 }
+
// Verify that {foo,bar}{,2}param are all passed on the stack, using
// normal calling conventions, when not optimizing.
// { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*fooparam," } }
diff --git a/gcc/testsuite/g++.dg/other/pr50464.C b/gcc/testsuite/g++.dg/other/pr50464.C
new file mode 100644
index 00000000000..8c67213731a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr50464.C
@@ -0,0 +1,170 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O3 -mxop" }
+
+typedef long unsigned int size_t;
+typedef unsigned long ulong_t;
+typedef signed long slong_t;
+
+ template<typename _Iterator>
+ struct iterator_traits
+ {
+ typedef typename _Iterator::reference reference;
+ };
+
+ template<typename _Tp>
+ struct iterator_traits<_Tp*>
+ {
+ typedef _Tp& reference;
+ };
+
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator
+ {
+ protected:
+ _Iterator _M_current;
+ typedef iterator_traits<_Iterator> __traits_type;
+
+ public:
+ typedef typename __traits_type::reference reference;
+
+ explicit
+ __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
+
+ reference
+ operator*() const
+ { return *_M_current; }
+
+ __normal_iterator&
+ operator++()
+ {
+ ++_M_current;
+ return *this;
+ }
+
+ const _Iterator&
+ base() const
+ { return _M_current; }
+ };
+
+ template<typename _Iterator, typename _Container>
+ inline bool
+ operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+ { return __lhs.base() != __rhs.base(); }
+
+ template<typename _Tp>
+ class allocator
+ {
+ public:
+ typedef _Tp* pointer;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+ pointer allocate(size_t __n, const void* = 0)
+ {
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ struct _Vector_base
+ {
+ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
+
+ struct _Vector_impl
+ : public _Tp_alloc_type
+ {
+ typename _Tp_alloc_type::pointer _M_start;
+ typename _Tp_alloc_type::pointer _M_finish;
+ typename _Tp_alloc_type::pointer _M_end_of_storage;
+
+ _Vector_impl(_Tp_alloc_type const& __a) { }
+ };
+
+ public:
+ typedef _Alloc allocator_type;
+
+ _Vector_base(size_t __n, const allocator_type& __a)
+ : _M_impl(__a)
+ {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+
+ public:
+ _Vector_impl _M_impl;
+
+ typename _Tp_alloc_type::pointer
+ _M_allocate(size_t __n)
+ { return __n != 0 ? _M_impl.allocate(__n) : 0; }
+
+ };
+
+ template<typename _Tp, typename _Alloc = allocator<_Tp> >
+ class vector : protected _Vector_base<_Tp, _Alloc>
+ {
+ typedef _Vector_base<_Tp, _Alloc> _Base;
+ typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+
+ public:
+ typedef _Tp value_type;
+ typedef typename _Tp_alloc_type::pointer pointer;
+ typedef __normal_iterator<pointer, vector> iterator;
+ typedef _Alloc allocator_type;
+
+ protected:
+ using _Base::_M_allocate;
+ using _Base::_M_impl;
+
+ public:
+
+ explicit
+ vector(size_t __n, const value_type& __value = value_type(),
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __a)
+ { _M_fill_initialize(__n, __value); }
+
+ iterator begin()
+ { return iterator(this->_M_impl._M_start); }
+
+ iterator end()
+ { return iterator(this->_M_impl._M_finish); }
+
+ protected:
+ void
+ _M_fill_initialize(size_t __n, const value_type& __value)
+ {
+ this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
+ }
+ };
+
+ template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+ _OutputIterator
+ replace_copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result,
+ const _Tp& __old_value, const _Tp& __new_value)
+ {
+ ;
+ for (; __first != __last; ++__first, ++__result)
+ if (*__first == __old_value)
+ *__result = __new_value;
+ else
+ *__result = *__first;
+ return __result;
+ }
+
+extern size_t shape_rank;
+
+void createDataspaceIdentifier()
+{
+ vector< ulong_t > dataspaceDims( shape_rank );
+ vector< ulong_t > maxDataspaceDims( shape_rank );
+
+ replace_copy(
+ dataspaceDims.begin(), dataspaceDims.end(),
+ maxDataspaceDims.begin(), ulong_t( 0 ), ((ulong_t)(slong_t)(-1)) );
+}
diff --git a/gcc/testsuite/g++.dg/overload/ref-conv1.C b/gcc/testsuite/g++.dg/overload/ref-conv1.C
new file mode 100644
index 00000000000..7e141141264
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/ref-conv1.C
@@ -0,0 +1,6 @@
+// PR c++/50442
+
+template <typename T> struct MoveRef { operator T& () {} };
+template <typename T> MoveRef <T> Move(T&) {}
+struct Thing {};
+Thing foo(const Thing* p) { return Thing(Move(*p)); }
diff --git a/gcc/testsuite/g++.dg/overload/ref-conv2.C b/gcc/testsuite/g++.dg/overload/ref-conv2.C
new file mode 100644
index 00000000000..bb0ad39d6b1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/ref-conv2.C
@@ -0,0 +1,15 @@
+// PR c++/50523
+
+template <class T>
+struct A
+{
+ A(const T&);
+ operator T&() const;
+ operator const T&() const;
+};
+
+int main()
+{
+ A<int> a(1);
+ A<int> a2(a);
+}
diff --git a/gcc/testsuite/g++.dg/overload/rvalue3.C b/gcc/testsuite/g++.dg/overload/rvalue3.C
new file mode 100644
index 00000000000..5a5d2374290
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/rvalue3.C
@@ -0,0 +1,8 @@
+// PR c++/50512
+
+void foo (const char *const& s);
+template<typename C> void foo (const C& x) { x.a; }
+
+void f () {
+ foo ("abc");
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash56.C b/gcc/testsuite/g++.dg/parse/crash56.C
index 9a370cb5fcd..2b823aed402 100644
--- a/gcc/testsuite/g++.dg/parse/crash56.C
+++ b/gcc/testsuite/g++.dg/parse/crash56.C
@@ -5,13 +5,13 @@
struct A
{
typedef void (F)();
- F f = []{}; /* { dg-error "invalid initializer" } */
+ F f = []{}; /* { dg-error "invalid pure" } */
};
struct B
{
typedef void (F)();
- F f = 1; /* { dg-error "invalid initializer" } */
- virtual F f2 = 2; /* { dg-error "invalid initializer" } */
- F f3 = 3; /* { dg-error "invalid initializer" } */
+ F f = 1; /* { dg-error "invalid pure" } */
+ virtual F f2 = 2; /* { dg-error "invalid pure" } */
+ F f3 = 3; /* { dg-error "invalid pure" } */
};
diff --git a/gcc/testsuite/g++.dg/parse/error40.C b/gcc/testsuite/g++.dg/parse/error40.C
new file mode 100644
index 00000000000..9ab7552ae83
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error40.C
@@ -0,0 +1,10 @@
+// PR c++/31489
+
+class foo; // { dg-error "'class foo'" }
+struct bar; // { dg-error "'struct bar'" }
+
+int main()
+{
+ foo* f = new foo; // { dg-error "'class foo'" }
+ bar* b = new bar; // { dg-error "'struct bar'" }
+}
diff --git a/gcc/testsuite/g++.dg/template/bitfield1.C b/gcc/testsuite/g++.dg/template/bitfield1.C
new file mode 100644
index 00000000000..9484cb784ed
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/bitfield1.C
@@ -0,0 +1,11 @@
+// PR c++/50280
+
+struct S { int bf : 3; };
+
+template<class _T1>
+void make_pair(_T1& __x) {}
+
+void foo() {
+ const S s = S();
+ make_pair(s.bf);
+}
diff --git a/gcc/testsuite/g++.dg/template/friend52.C b/gcc/testsuite/g++.dg/template/friend52.C
new file mode 100644
index 00000000000..d4fecd95ed4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend52.C
@@ -0,0 +1,17 @@
+// PR c++/50344
+// { dg-options "" }
+
+template <typename T> class C
+{
+ friend T;
+ int i;
+};
+
+struct S
+{
+ int f()
+ {
+ C<const S> c;
+ return c.i;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/template/partial12.C b/gcc/testsuite/g++.dg/template/partial12.C
new file mode 100644
index 00000000000..05a3eca97be
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial12.C
@@ -0,0 +1,27 @@
+// PR c++/46105
+
+template< typename T >
+struct empty { // support class is like stripped-down enable_if
+ typedef void type;
+};
+
+template< class T, typename v = void > // v is always void!
+struct element {
+ typedef typename T::value_type type;
+};
+
+template< class T > // T in deduced context, T::element_type is SFINAE:
+struct element< T, typename empty< typename T::element_type >::type > {
+ typedef typename T::element_type type;
+};
+
+template< class T >
+struct element< T const, typename empty< typename T::element_type >::type > {
+ typedef typename T::element_type const type;
+};
+
+struct has_et {
+ typedef int element_type;
+};
+
+element<has_et const>::type ip = 0;
diff --git a/gcc/testsuite/g++.dg/template/partial13.C b/gcc/testsuite/g++.dg/template/partial13.C
new file mode 100644
index 00000000000..bfbe2e02864
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial13.C
@@ -0,0 +1,25 @@
+// PR c++/45012
+
+template <bool B, class T=void> struct enable_if;
+
+template <class T>
+struct enable_if<true,T>
+{
+ typedef T type;
+};
+
+enum { RUNTIME = 0 };
+// it compiles with the previous line commented out and the next commented in
+// static const int RUNTIME=0;
+
+template <class T, class U, class EN=void> struct foo;
+
+template <template<int> class V, int M>
+struct foo<V<M>,V<M>, typename enable_if<M==RUNTIME||M==2>::type> {};
+
+template <template<int> class V1, template<int> class V2, int M>
+struct foo<V1<M>,V2<M>, typename enable_if<M==RUNTIME||M==2>::type> {};
+
+template <int M> struct bar {};
+
+foo<bar<2>,bar<2> > x;
diff --git a/gcc/testsuite/g++.dg/template/sfinae28.C b/gcc/testsuite/g++.dg/template/sfinae28.C
new file mode 100644
index 00000000000..1bd9c2cd3f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sfinae28.C
@@ -0,0 +1,24 @@
+// Origin: PR c++/44267
+
+struct B {};
+struct D : B {};
+struct VD : virtual B {};
+
+template <class T> T create();
+
+typedef char one[1];
+typedef char two[2];
+
+template <class D, class B>
+one& f(char (*)[sizeof(static_cast<D>(create<B>()))]);
+
+template <class D, class B>
+two& f(...);
+
+int main()
+{
+ f<D*, int>(0);
+ f<D*, B*>(0);
+ f<VD*, B*>(0);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/restrict2.C b/gcc/testsuite/g++.dg/tree-ssa/restrict2.C
new file mode 100644
index 00000000000..35957f53541
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/restrict2.C
@@ -0,0 +1,62 @@
+// { dg-do compile }
+// { dg-options "-O2 -fdump-tree-optimized" }
+
+struct S { int *__restrict p; int q; };
+S s;
+
+int
+f1 (S x, S y)
+{
+ x.p[0] = 1;
+ y.p[0] = 0;
+// { dg-final { scan-tree-dump-times "return 1" 1 "optimized" } }
+ return x.p[0];
+}
+
+int
+f2 (S x)
+{
+ x.p[0] = 2;
+ s.p[0] = 0;
+// { dg-final { scan-tree-dump-times "return 2" 1 "optimized" } }
+ return x.p[0];
+}
+
+int
+f3 (S &__restrict x, S &__restrict y)
+{
+ x.p[0] = 3;
+ y.p[0] = 0;
+// { dg-final { scan-tree-dump-times "return 3" 1 "optimized" } }
+ return x.p[0];
+}
+
+int
+f4 (S &x, S &y)
+{
+ x.p[0] = 4;
+ y.p[0] = 0;
+// { dg-final { scan-tree-dump-times "return 4" 0 "optimized" } }
+ return x.p[0];
+}
+
+int
+f5 (S *__restrict x, S *__restrict y)
+{
+ x->p[0] = 5;
+ y->p[0] = 0;
+// We might handle this some day
+// { dg-final { scan-tree-dump-times "return 5" 1 "optimized" { xfail *-*-* } } }
+ return x->p[0];
+}
+
+int
+f6 (S *x, S *y)
+{
+ x->p[0] = 6;
+ y->p[0] = 0;
+// { dg-final { scan-tree-dump-times "return 6" 0 "optimized" } }
+ return x->p[0];
+}
+
+// { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr50413.cc b/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
index 5a8c82a604e..e7bdf1f1c32 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
@@ -1,3 +1,4 @@
+/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
typedef unsigned long long UInt64;
@@ -150,12 +151,6 @@ UInt128_BITMAP;
UInt128_BITMAP V;
-template<typename CAST>
-unsigned char get_bit(CAST value, unsigned char pos)
-{
- return ( value & (static_cast<CAST>(1) << pos) ) != 0;
-}
-
void shift(unsigned char t)
{
V.uint128.uint64_lower = (V.uint128.uint64_lower >> 1);
@@ -165,21 +160,6 @@ void shift(unsigned char t)
V.bitmap.b96 = t;
}
-int main()
-{
- V.uint128.uint64_lower = 0;
- V.uint128.uint64_upper = 0xd4004001;
-
- UInt64 Kc = 0xDD1A1B8A8A5C2400;
-
- for (int i = 0; i < 64; i++ )
- {
- shift( get_bit( Kc, i) );
- }
-
- return 0;
-}
-
/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/g++.dg/warn/Wextra-3.C b/gcc/testsuite/g++.dg/warn/Wextra-3.C
new file mode 100644
index 00000000000..04fdbba9076
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wextra-3.C
@@ -0,0 +1,9 @@
+// PR c++/45278
+// { dg-options "-Wextra" }
+
+extern void* p;
+
+int f1() { return ( p < 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" }
+int f2() { return ( p <= 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" }
+int f3() { return ( p > 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" }
+int f4() { return ( p >= 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" }
diff --git a/gcc/testsuite/g++.dg/warn/incomplete1.C b/gcc/testsuite/g++.dg/warn/incomplete1.C
index 26cfe2eae4b..9dc645d82f9 100644
--- a/gcc/testsuite/g++.dg/warn/incomplete1.C
+++ b/gcc/testsuite/g++.dg/warn/incomplete1.C
@@ -9,7 +9,7 @@
// (But the deletion does not constitute an ill-formed program. So the
// program should nevertheless compile, but it should give a warning.)
-class A; // { dg-warning "forward declaration of 'struct A'" "" }
+class A; // { dg-warning "forward declaration of 'class A'" "" }
A *a; // { dg-warning "'a' has incomplete type" "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init4.C b/gcc/testsuite/g++.old-deja/g++.other/init4.C
index 92562ef5845..f8246d68f0e 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/init4.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/init4.C
@@ -1,4 +1,4 @@
-// { dg-options -std=c++98 }
+// { dg-options "-std=c++98 -pedantic-errors" }
// { dg-do assemble }
class error {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C
index e3ca5298d4f..6dd4b546c0c 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C
@@ -19,7 +19,7 @@ const char* S3<char>::h(int) { return __PRETTY_FUNCTION__; }
int main()
{
if (strcmp (S3<double>::h(7),
- "static const char* S3<T>::h(U) [with U = int, T = double]") == 0)
+ "static const char* S3<T>::h(U) [with U = int; T = double]") == 0)
return 0;
else
return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/941014-1.x b/gcc/testsuite/gcc.c-torture/execute/941014-1.x
deleted file mode 100644
index bbe060ef812..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/941014-1.x
+++ /dev/null
@@ -1,15 +0,0 @@
-# This doesn't always work for Thumb.
-
-if { [istarget arm*-*-*] } {
- set torture_eval_before_execute {
- global compiler_conditional_xfail_data
- set compiler_conditional_xfail_data {
- "Thumb sets the last bit of function relocations" \
- { "arm*-*-*" } \
- { { "-mthumb" "-O0" } } \
- { "" }
- }
- }
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c
index a031a56a956..a912332466a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm-lib.c
@@ -7,6 +7,7 @@ extern int strncmp(const char *, const char *, size_t);
extern int inside_main;
extern const char *p;
+__attribute__ ((used))
char *
my_strstr (const char *s1, const char *s2)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c b/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c
new file mode 100644
index 00000000000..90eecb68a5d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c
@@ -0,0 +1,123 @@
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+#define check_compare(count, res, i0, i1, op, fmt) \
+do { \
+ int __i; \
+ for (__i = 0; __i < count; __i ++) { \
+ if ((res)[__i] != ((i0)[__i] op (i1)[__i] ? -1 : 0)) \
+ { \
+ __builtin_printf ("%i != ((" fmt " " #op " " fmt " ? -1 : 0) ", \
+ (res)[__i], (i0)[__i], (i1)[__i]); \
+ __builtin_abort (); \
+ } \
+ } \
+} while (0)
+
+#define test(count, v0, v1, res, fmt); \
+do { \
+ res = (v0 > v1); \
+ check_compare (count, res, v0, v1, >, fmt); \
+ res = (v0 < v1); \
+ check_compare (count, res, v0, v1, <, fmt); \
+ res = (v0 >= v1); \
+ check_compare (count, res, v0, v1, >=, fmt); \
+ res = (v0 <= v1); \
+ check_compare (count, res, v0, v1, <=, fmt); \
+ res = (v0 == v1); \
+ check_compare (count, res, v0, v1, ==, fmt); \
+ res = (v0 != v1); \
+ check_compare (count, res, v0, v1, !=, fmt); \
+} while (0)
+
+
+int main (int argc, char *argv[]) {
+#define INT int
+ vector (4, INT) i0;
+ vector (4, INT) i1;
+ vector (4, int) ires;
+ int i;
+
+ i0 = (vector (4, INT)){argc, 1, 2, 10};
+ i1 = (vector (4, INT)){0, 3, 2, (INT)-23};
+ test (4, i0, i1, ires, "%i");
+#undef INT
+
+#define INT unsigned int
+ vector (4, int) ures;
+ vector (4, INT) u0;
+ vector (4, INT) u1;
+
+ u0 = (vector (4, INT)){argc, 1, 2, 10};
+ u1 = (vector (4, INT)){0, 3, 2, (INT)-23};
+ test (4, u0, u1, ures, "%u");
+#undef INT
+
+
+#define SHORT short
+ vector (8, SHORT) s0;
+ vector (8, SHORT) s1;
+ vector (8, short) sres;
+
+ s0 = (vector (8, SHORT)){argc, 1, 2, 10, 6, 87, (SHORT)-5, 2};
+ s1 = (vector (8, SHORT)){0, 3, 2, (SHORT)-23, 12, 10, (SHORT)-2, 0};
+ test (8, s0, s1, sres, "%i");
+#undef SHORT
+
+#define SHORT unsigned short
+ vector (8, SHORT) us0;
+ vector (8, SHORT) us1;
+ vector (8, short) usres;
+
+ us0 = (vector (8, SHORT)){argc, 1, 2, 10, 6, 87, (SHORT)-5, 2};
+ us1 = (vector (8, SHORT)){0, 3, 2, (SHORT)-23, 12, 10, (SHORT)-2, 0};
+ test (8, us0, us1, usres, "%u");
+#undef SHORT
+
+#define CHAR signed char
+ vector (16, CHAR) c0;
+ vector (16, CHAR) c1;
+ vector (16, signed char) cres;
+
+ c0 = (vector (16, CHAR)){argc, 1, 2, 10, 6, 87, (CHAR)-5, 2, \
+ argc, 1, 2, 10, 6, 87, (CHAR)-5, 2 };
+
+ c1 = (vector (16, CHAR)){0, 3, 2, (CHAR)-23, 12, 10, (CHAR)-2, 0, \
+ 0, 3, 2, (CHAR)-23, 12, 10, (CHAR)-2, 0};
+ test (16, c0, c1, cres, "%i");
+#undef CHAR
+
+#define CHAR unsigned char
+ vector (16, CHAR) uc0;
+ vector (16, CHAR) uc1;
+ vector (16, signed char) ucres;
+
+ uc0 = (vector (16, CHAR)){argc, 1, 2, 10, 6, 87, (CHAR)-5, 2, \
+ argc, 1, 2, 10, 6, 87, (CHAR)-5, 2 };
+
+ uc1 = (vector (16, CHAR)){0, 3, 2, (CHAR)-23, 12, 10, (CHAR)-2, 0, \
+ 0, 3, 2, (CHAR)-23, 12, 10, (CHAR)-2, 0};
+ test (16, uc0, uc1, ucres, "%u");
+#undef CHAR
+/* Float comparison. */
+ vector (4, float) f0;
+ vector (4, float) f1;
+ vector (4, int) ifres;
+
+ f0 = (vector (4, float)){(float)argc, 1., 2., 10.};
+ f1 = (vector (4, float)){0., 3., 2., (float)-23};
+ test (4, f0, f1, ifres, "%f");
+
+/* Double comparison. */
+ vector (2, double) d0;
+ vector (2, double) d1;
+ vector (2, long long) idres;
+
+ d0 = (vector (2, double)){(double)argc, 10.};
+ d1 = (vector (2, double)){0., (double)-23};
+ test (2, d0, d1, idres, "%f");
+
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c b/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c
new file mode 100644
index 00000000000..398c8254a47
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c
@@ -0,0 +1,27 @@
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+/* Check that constant folding in
+ these simple cases works. */
+vector (4, int)
+foo (vector (4, int) x)
+{
+ return (x == x) + (x != x) + (x > x)
+ + (x < x) + (x >= x) + (x <= x);
+}
+
+int
+main (int argc, char *argv[])
+{
+ vector (4, int) t = {argc, 2, argc, 42};
+ vector (4, int) r;
+ int i;
+
+ r = foo (t);
+
+ for (i = 0; i < 4; i++)
+ if (r[i] != -3)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/fold-compare-2.c b/gcc/testsuite/gcc.dg/fold-compare-2.c
index 9746b85c5e7..15ea462d440 100644
--- a/gcc/testsuite/gcc.dg/fold-compare-2.c
+++ b/gcc/testsuite/gcc.dg/fold-compare-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fno-tree-tail-merge -fdump-tree-vrp1" } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c b/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c
index 9cd2b09fb0d..bb8e7aff25d 100644
--- a/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c
@@ -1,8 +1,8 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -c -fdump-ipa-whole-program" } */
+/* { dg-options "-O3 -c -fdump-ipa-cgraph" } */
static __attribute__((constructor))
void empty_constructor()
{
}
-/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor" "whole-program" } } */
-/* { dg-final { cleanup-ipa-dump "whole-program" } } */
+/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor" "cgraph" } } */
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-1.c b/gcc/testsuite/gcc.dg/ipa/inline-1.c
new file mode 100644
index 00000000000..c662682a3f7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-1.c
@@ -0,0 +1,37 @@
+/* Verify that analysis of function parameters works as expected. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline" } */
+struct bah {int a,b,c,d,e;};
+static struct bah bah3={2,3,4,5,6};
+const static struct bah bah4={2,3,4,5,6};
+void test (int, struct bah *, struct bah, struct bah, int, struct bah, struct bah, struct bah);
+void foo (int invariant, struct bah invariant2)
+{
+ int i;
+ struct bah bah2={1,2,3,4,5};
+ struct bah bah5={1,2,3,4,5};
+ for (i = 0; i<10; i++)
+ {
+ bah5.a=i;
+ test (i, &bah2, bah2, bah3, invariant, invariant2, bah4, bah5);
+ }
+}
+/* op0 change on every invocation. */
+/* op1 is function invariant. */
+/* { dg-final { scan-ipa-dump-not "op0 is compile time invariant" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "op0 change" "inline" } } */
+/* { dg-final { scan-ipa-dump "op1 is compile time invariant" "inline" } } */
+/* op2 is invariant within loop (we make assumption that function call does not afect it.). */
+/* { dg-final { scan-ipa-dump "op2 change 10.000000. of time" "inline" } } */
+/* op3 is invariant within loop (we make assumption that function call does not afect it.). */
+/* { dg-final { scan-ipa-dump "op3 change 10.000000. of time" "inline" } } */
+/* op4 is invariant within loop. */
+/* { dg-final { scan-ipa-dump "op4 change 10.000000. of time" "inline" } } */
+/* op5 is invariant within loop. */
+/* { dg-final { scan-ipa-dump "op5 change 10.000000. of time" "inline" } } */
+/* op6 is compile time invariant. */
+/* { dg-final { scan-ipa-dump "op6 is compile time invariant" "inline" } } */
+/* op7 change. */
+/* { dg-final { scan-ipa-dump-not "op7 is compile time invariant" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "op7 change" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-2.c b/gcc/testsuite/gcc.dg/ipa/inline-2.c
new file mode 100644
index 00000000000..376cf97e841
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-2.c
@@ -0,0 +1,33 @@
+/* Verify that logic combining probabilities works as expected. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+struct bah {int a,b,d;};
+
+__attribute__ ((noinline))
+void test(int a,int b,int c,int d,int e)
+{
+ test3(a,b,c,d,e);
+}
+inline
+static void bar (int parm1, int parm2)
+{
+ int i;
+ for (i = 0; i<10; i++)
+ {
+ test (0,0,parm1,parm2,i);
+ }
+}
+void foo (int invariant)
+{
+ int i;
+ for (i = 0; i<10; i++)
+ {
+ bar (i, invariant);
+ }
+}
+/* After inlining bar into foo, op2 is invariant within inner loop. */
+/* { dg-final { scan-ipa-dump "op2 change 10.000000. of time" "inline" } } */
+/* After inlining bar into foo, op3 is invariant within both loops. */
+/* { dg-final { scan-ipa-dump "op3 change 1.000000. of time" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-3.c b/gcc/testsuite/gcc.dg/ipa/inline-3.c
new file mode 100644
index 00000000000..d97f0c65444
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-3.c
@@ -0,0 +1,25 @@
+/* Verify that do_work is detected as being loop invariant. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining" } */
+
+struct bah {int a,b,d;};
+
+static int do_work (struct bah s)
+{
+ return s.a*s.b/s.d;
+}
+int foo (int invariant)
+{
+ int i;
+ struct bah s = {invariant,invariant,invariant};
+ int sum = 0;
+ for (i = 0; i<10; i++)
+ {
+ sum += do_work (s);
+ }
+ return sum;
+}
+
+
+/* { dg-final { scan-ipa-dump "Scaling time by probability:0.100000" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-4.c b/gcc/testsuite/gcc.dg/ipa/inline-4.c
new file mode 100644
index 00000000000..66019b30f2e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-4.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+
+void do_something (int shall_i_work)
+{
+ if (shall_i_work)
+ {
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ }
+}
+int foo (int invariant)
+{
+ do_something (0);
+ do_something (1);
+}
+
+
+/* We should inline do_something(0), but not do_something (1). */
+/* { dg-final { scan-ipa-dump "Inlined 1 calls, eliminated 0 functions" "inline" } } */
+/* Call to work_hard should be detected as optimized out. */
+/* { dg-final { scan-ipa-dump-times "predicate: .false." 8 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc/testsuite/gcc.dg/ipa/inline-5.c
new file mode 100644
index 00000000000..121f7815bcd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -0,0 +1,35 @@
+/* Check statements that are eliminated by inlining. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+struct a {int a,b,c,d,e;};
+
+void
+accessfield (struct a a)
+{
+ t(a.a);
+ /* Should compile as:
+ tmp = a.a
+ Will be eliminated by inlining
+ t (tmp); */
+ t2(&a);
+ t(a.a);
+ return;
+ /* Will be eliminated by inlining */
+}
+void
+accessreference (struct a *a)
+{
+ t(a->a);
+ /* Should compile as:
+ a.0_1 = a;
+ Will be eliminated by inlining
+ tmp = a.0_1->a;
+ 50% will be eliminated by inlining
+ t (tmp) */
+ t2(&a);
+ return;
+ /* Will be eliminated by inlining */
+}
+
+/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "inline" } } */
+/* { dg-final { scan-ipa-dump-times "50. will be eliminated" 1 "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43864-2.c b/gcc/testsuite/gcc.dg/pr43864-2.c
new file mode 100644
index 00000000000..1a0d9491a17
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43864-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int
+f (int c, int b, int d)
+{
+ int r, e;
+
+ if (c)
+ r = b + d;
+ else
+ {
+ e = b + d;
+ r = e;
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43864-3.c b/gcc/testsuite/gcc.dg/pr43864-3.c
new file mode 100644
index 00000000000..622a5649541
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43864-3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+/* Commutative case. */
+
+int f(int c, int b, int d)
+{
+ int r, e;
+
+ if (c)
+ r = b + d;
+ else
+ {
+ e = d + b;
+ r = e;
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43864-4.c b/gcc/testsuite/gcc.dg/pr43864-4.c
new file mode 100644
index 00000000000..3e3d643947d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43864-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+/* Different stmt order. */
+
+int f(int c, int b, int d)
+{
+ int r, r2, e;
+
+ if (c)
+ {
+ r = b + d;
+ r2 = d - b;
+ }
+ else
+ {
+ r2 = d - b;
+ e = d + b;
+ r = e;
+ }
+
+ return r - r2;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times " - " 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43864.c b/gcc/testsuite/gcc.dg/pr43864.c
new file mode 100644
index 00000000000..03c2d49c0fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43864.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+extern void foo (char*, int);
+extern void mysprintf (char *, char *);
+extern void myfree (void *);
+extern int access (char *, int);
+extern int fopen (char *, int);
+
+char *
+hprofStartupp (char *outputFileName, char *ctx)
+{
+ char fileName[1000];
+ int fp;
+ mysprintf (fileName, outputFileName);
+ if (access (fileName, 1) == 0)
+ {
+ myfree (ctx);
+ return 0;
+ }
+
+ fp = fopen (fileName, 0);
+ if (fp == 0)
+ {
+ myfree (ctx);
+ return 0;
+ }
+
+ foo (outputFileName, fp);
+
+ return ctx;
+}
+
+/* { dg-final { scan-tree-dump-times "myfree \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr46309.c b/gcc/testsuite/gcc.dg/pr46309.c
new file mode 100644
index 00000000000..2629a3cef37
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46309.c
@@ -0,0 +1,66 @@
+/* PR tree-optimization/46309 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc-details" } */
+
+int
+f1 (int a)
+{
+ int v1 = (a == 3);
+ int v2 = (a == 1);
+ int v3 = (a == 4);
+ int v4 = (a == 2);
+ return v1 || v2 || v3 || v4;
+}
+
+int
+f2 (int a)
+{
+ int v1 = (a == 1);
+ int v2 = (a == 2);
+ int v3 = (a == 3);
+ int v4 = (a == 4);
+ return v1 || v2 || v3 || v4;
+}
+
+int
+f3 (int a)
+{
+ int v1 = (a == 3);
+ int v2 = (a == 1);
+ return v1 || v2;
+}
+
+int
+f4 (int a)
+{
+ int v1 = (a == 1);
+ int v2 = (a == 2);
+ return v1 || v2;
+}
+
+int
+f5 (unsigned int a)
+{
+ int v1 = (a <= 31);
+ int v2 = (a >= 64 && a <= 95);
+ return v1 || v2;
+}
+
+int
+f6 (unsigned int a)
+{
+ int v1 = (a <= 31);
+ int v2 = (a >= 64 && a <= 95);
+ int v3 = (a >= 128 && a <= 159);
+ int v4 = (a >= 192 && a <= 223);
+ return v1 || v2 || v3 || v4;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.3, 3.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests D.\[0-9\]*_\[0-9\]* -.0, 31. and -.128, 159.\[\n\r\]* into" 1 "reassoc2" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc2" } } */
diff --git a/gcc/testsuite/gcc.dg/pr50571.c b/gcc/testsuite/gcc.dg/pr50571.c
new file mode 100644
index 00000000000..3fb4310d684
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50571.c
@@ -0,0 +1,11 @@
+/* PR inline-asm/50571 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static const int var[4] = { 1, 2, 3, 4 };
+
+void
+foo (void)
+{
+ __asm volatile ("" : : "m" (*(int *) var));
+}
diff --git a/gcc/testsuite/gcc.dg/sms-10.c b/gcc/testsuite/gcc.dg/sms-10.c
new file mode 100644
index 00000000000..c1de07f1619
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sms-10.c
@@ -0,0 +1,119 @@
+ /* { dg-do run } */
+ /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
+
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+extern void abort (void);
+
+struct regstat_n_sets_and_refs_t
+{
+ int sets;
+ int refs;
+};
+
+struct regstat_n_sets_and_refs_t *regstat_n_sets_and_refs;
+
+struct df_reg_info
+{
+ unsigned int n_refs;
+};
+
+struct df_d
+{
+ struct df_reg_info **def_regs;
+ struct df_reg_info **use_regs;
+};
+struct df_d *df;
+
+static inline int
+REG_N_SETS (int regno)
+{
+ return regstat_n_sets_and_refs[regno].sets;
+}
+
+__attribute__ ((noinline))
+ int max_reg_num (void)
+{
+ return 100;
+}
+
+__attribute__ ((noinline))
+ void regstat_init_n_sets_and_refs (void)
+{
+ unsigned int i;
+ unsigned int max_regno = max_reg_num ();
+
+ for (i = 0; i < max_regno; i++)
+ {
+ (regstat_n_sets_and_refs[i].sets = (df->def_regs[(i)]->n_refs));
+ (regstat_n_sets_and_refs[i].refs =
+ (df->use_regs[(i)]->n_refs) + REG_N_SETS (i));
+ }
+}
+
+int a_sets[100] =
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
+};
+
+int a_refs[100] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
+ 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76,
+ 78, 80, 82,
+ 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116,
+ 118, 120,
+ 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150,
+ 152, 154, 156,
+ 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186,
+ 188, 190, 192,
+ 194, 196, 198
+};
+
+int
+main ()
+{
+ struct df_reg_info *b[100], *c[100];
+ struct df_d df1;
+ size_t s = sizeof (struct df_reg_info);
+ struct regstat_n_sets_and_refs_t a[100];
+
+ df = &df1;
+ regstat_n_sets_and_refs = a;
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ b[i] = (struct df_reg_info *) malloc (s);
+ b[i]->n_refs = i;
+ c[i] = (struct df_reg_info *) malloc (s);
+ c[i]->n_refs = i;
+ }
+
+ df1.def_regs = b;
+ df1.use_regs = c;
+ regstat_init_n_sets_and_refs ();
+
+ for (i = 0; i < 100; i++)
+ if ((a[i].sets != a_sets[i]) || (a[i].refs != a_refs[i]))
+ abort ();
+
+ for (i = 0; i < 100; i++)
+ {
+ free (b[i]);
+ free (c[i]);
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc/testsuite/gcc.dg/strlenopt-1.c b/gcc/testsuite/gcc.dg/strlenopt-1.c
new file mode 100644
index 00000000000..5bc4f0cd176
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-1.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, char *r)
+{
+ char *q = malloc (strlen (p) + strlen (r) + 64);
+ if (q == NULL) return NULL;
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (p). */
+ strcpy (q, p);
+ /* These two strcat can be optimized into memcpy. The first one
+ could be even optimized into a *ptr = '/'; store as the '\0'
+ is immediately overwritten. */
+ strcat (q, "/");
+ strcat (q, "abcde");
+ /* Due to inefficient PTA (PR50262) the above calls invalidate
+ string length of r, so it is optimized just into strcpy instead
+ of memcpy. */
+ strcat (q, r);
+ return q;
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p, r);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcdestring2"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-10.c b/gcc/testsuite/gcc.dg/strlenopt-10.c
new file mode 100644
index 00000000000..a18c06ae069
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-10.c
@@ -0,0 +1,80 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p)
+{
+ char *q;
+ /* This can be optimized into memcpy and the size can be decreased to one,
+ as it is immediately overwritten. */
+ strcpy (p, "z");
+ q = strchr (p, '\0');
+ *q = 32;
+ /* This strlen can't be optimized away, string length is unknown here. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) void
+fn2 (char *p, const char *z, size_t *lp)
+{
+ char *q, *r;
+ char buf[64];
+ size_t l[10];
+ /* The first strlen stays, all the strcpy calls can be optimized
+ into memcpy and all other strlen calls and all strchr calls
+ optimized away. */
+ l[0] = strlen (z);
+ strcpy (buf, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, "jkl");
+ l[1] = strlen (p);
+ l[2] = strlen (q);
+ l[3] = strlen (r);
+ strcpy (r, buf);
+ l[4] = strlen (p);
+ l[5] = strlen (q);
+ l[6] = strlen (r);
+ strcpy (r, "mnopqr");
+ l[7] = strlen (p);
+ l[8] = strlen (q);
+ l[9] = strlen (r);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[10];
+ const char *volatile z = "ABCDEFG";
+ memset (buf, '\0', sizeof buf);
+ if (fn1 (buf) != 2 || buf[0] != 'z' || buf[1] != 32 || buf[2] != '\0')
+ abort ();
+ fn2 (buf, z, l);
+ if (memcmp (buf, "abcdeefghimnopqr", 17) != 0)
+ abort ();
+ if (l[0] != 7)
+ abort ();
+ if (l[1] != 13 || l[2] != 8 || l[3] != 3)
+ abort ();
+ if (l[4] != 17 || l[5] != 12 || l[6] != 7)
+ abort ();
+ if (l[7] != 16 || l[8] != 11 || l[9] != 6)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 8 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "\\*q_\[0-9\]* = 32;" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(\[^\n\r\]*, 1\\)" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-11.c b/gcc/testsuite/gcc.dg/strlenopt-11.c
new file mode 100644
index 00000000000..03f8790d0c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-11.c
@@ -0,0 +1,70 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) void
+fn1 (char *p, const char *z, size_t *lp)
+{
+ char *q, *r, *s;
+ char buf[64];
+ size_t l[11];
+ /* The first strlen stays, all the strcpy calls can be optimized
+ into memcpy and most other strlen calls and all strchr calls
+ optimized away. l[6] = strlen (r); and l[9] = strlen (r); need
+ to stay, because we need to invalidate the knowledge about
+ r strlen after strcpy (q, "jklmnopqrst"). */
+ l[0] = strlen (z);
+ strcpy (buf, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, buf);
+ l[1] = strlen (p);
+ l[2] = strlen (q);
+ l[3] = strlen (r);
+ strcpy (q, "jklmnopqrst");
+ l[4] = strlen (p);
+ l[5] = strlen (q);
+ l[6] = strlen (r);
+ s = strchr (q, '\0');
+ strcpy (s, buf);
+ l[7] = strlen (p);
+ l[8] = strlen (q);
+ l[9] = strlen (r);
+ l[10] = strlen (s);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[11];
+ const char *volatile z = "ABCDEFG";
+ memset (buf, '\0', sizeof buf);
+ fn1 (buf, z, l);
+ if (memcmp (buf, "abcdejklmnopqrstABCDEFG", 24) != 0)
+ abort ();
+ if (l[0] != 7)
+ abort ();
+ if (l[1] != 17 || l[2] != 12 || l[3] != 7)
+ abort ();
+ if (l[4] != 16 || l[5] != 11 || l[6] != 6)
+ abort ();
+ if (l[7] != 23 || l[8] != 18 || l[9] != 13 || l[10] != 7)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.0. = " 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.6. = " 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.9. = " 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-12.c b/gcc/testsuite/gcc.dg/strlenopt-12.c
new file mode 100644
index 00000000000..1005fc6709e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-12.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, size_t *l)
+{
+ char *q = strcat (p, "abcde");
+ *l = strlen (p);
+ return q;
+}
+
+__attribute__((noinline, noclone)) char *
+fn2 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ size_t l = strlen (q);
+ char *r = strcat (p, q);
+ *l1 = l;
+ *l2 = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p, const char *q, size_t *l)
+{
+ char *r = strcpy (p, q);
+ *l = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn4 (char *p, const char *q, size_t *l)
+{
+ char *r = strcat (p, q);
+ *l = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn5 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ size_t l = strlen (q);
+ size_t ll = strlen (p);
+ char *r = strcat (p, q);
+ *l1 = l;
+ *l2 = strlen (p);
+ *l3 = ll;
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn6 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ size_t l = strlen (p);
+ char *r = strcat (p, q);
+ *l1 = strlen (p);
+ *l2 = l;
+ return r;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "fgh";
+ size_t l, l1, l2, l3;
+ memset (buf, '\0', sizeof buf);
+ memset (buf, 'a', 3);
+ if (fn1 (buf, &l) != buf || l != 8 || memcmp (buf, "aaaabcde", 9) != 0)
+ abort ();
+ if (fn2 (buf, q, &l1, &l2) != buf || l1 != 3 || l2 != 11
+ || memcmp (buf, "aaaabcdefgh", 12) != 0)
+ abort ();
+ if (fn3 (buf, q, &l) != buf || l != 3
+ || memcmp (buf, "fgh\0bcdefgh", 12) != 0)
+ abort ();
+ if (fn4 (buf, q, &l) != buf || l != 6
+ || memcmp (buf, "fghfgh\0efgh", 12) != 0)
+ abort ();
+ l1 = 0;
+ l2 = 0;
+ if (fn5 (buf, q, &l1, &l2, &l3) != buf || l1 != 3 || l2 != 9 || l3 != 6
+ || memcmp (buf, "fghfghfgh\0h", 12) != 0)
+ abort ();
+ if (fn6 (buf, q, &l1, &l2) != buf || l1 != 12 || l2 != 9
+ || memcmp (buf, "fghfghfghfgh", 13) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c
new file mode 100644
index 00000000000..2b6508f01d9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c
@@ -0,0 +1,6 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2" } */
+
+#define USE_GNU
+#include "strlenopt-12.c"
diff --git a/gcc/testsuite/gcc.dg/strlenopt-13.c b/gcc/testsuite/gcc.dg/strlenopt-13.c
new file mode 100644
index 00000000000..62effcd64d0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-13.c
@@ -0,0 +1,68 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) void
+fn1 (char *p, const char *y, const char *z, size_t *lp)
+{
+ char *q, *r, *s;
+ char buf1[64], buf2[64];
+ size_t l[8];
+ /* These two strlen calls stay, all strcpy calls are optimized into
+ memcpy, all strchr calls optimized away, and most other strlen
+ calls too. */
+ l[0] = strlen (y);
+ l[1] = strlen (z);
+ strcpy (buf1, y);
+ strcpy (buf2, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, buf1);
+ l[2] = strlen (p);
+ l[3] = strlen (q);
+ l[4] = strlen (r);
+ strcpy (r, buf2);
+ /* Except for these two calls, strlen (r) before and after the above
+ is non-constant, so adding l[4] - l[1] to all previous strlens
+ might make the expressions already too complex. */
+ l[5] = strlen (p);
+ l[6] = strlen (q);
+ /* This one is of course optimized, it is l[1]. */
+ l[7] = strlen (r);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[8];
+ const char *volatile y = "ABCDEFG";
+ const char *volatile z = "HIJK";
+ memset (buf, '\0', sizeof buf);
+ fn1 (buf, y, z, l);
+ if (memcmp (buf, "abcdeefghiHIJK", 15) != 0)
+ abort ();
+ if (l[0] != 7 || l[1] != 4)
+ abort ();
+ if (l[2] != 17 || l[3] != 12 || l[4] != 7)
+ abort ();
+ if (l[5] != 14 || l[6] != 9 || l[7] != 4)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.0. = " 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.1. = " 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.5. = " 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times " D\.\[0-9_\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.6. = " 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c
new file mode 100644
index 00000000000..62a120de07b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c
@@ -0,0 +1,115 @@
+/* This test needs runtime that provides stpcpy and mempcpy functions. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, size_t *l1, size_t *l2)
+{
+ char *a = mempcpy (p, "abcde", 6);
+ /* This strlen needs to stay. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into 5. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn2 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ /* This strlen needs to stay. */
+ size_t lq = strlen (q);
+ char *a = mempcpy (p, q, lq + 1);
+ /* This strlen needs to stay. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into lq. */
+ size_t lp = strlen (p);
+ *l1 = lq;
+ *l2 = la;
+ *l3 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p, size_t *l1, size_t *l2)
+{
+ char *a = stpcpy (p, "abcde");
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into 5. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn4 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ /* This strlen needs to stay. */
+ size_t lq = strlen (q);
+ char *a = stpcpy (p, q);
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into lq. */
+ size_t lp = strlen (p);
+ *l1 = lq;
+ *l2 = la;
+ *l3 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn5 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ char *a = stpcpy (p, q);
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into a - p. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ size_t l1, l2, l3;
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 6, 'z', 7);
+ if (fn1 (buf, &l1, &l2) != buf + 6 || l1 != 7 || l2 != 5
+ || memcmp (buf, "abcde\0zzzzzzz", 14) != 0)
+ abort ();
+ if (fn2 (buf, q, &l1, &l2, &l3) != buf + 9 || l1 != 8 || l2 != 4 || l3 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ if (fn3 (buf, &l1, &l2) != buf + 5 || l1 != 0 || l2 != 5
+ || memcmp (buf, "abcde\0GH\0zzzz", 14) != 0)
+ abort ();
+ l3 = 0;
+ memset (buf, 'n', 9);
+ if (fn4 (buf, q, &l1, &l2, &l3) != buf + 8 || l1 != 8 || l2 != 0 || l3 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ memset (buf, 'm', 9);
+ if (fn5 (buf, q, &l1, &l2) != buf + 8 || l1 != 0 || l2 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c
new file mode 100644
index 00000000000..999759e86f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c
@@ -0,0 +1,24 @@
+/* This test needs runtime that provides stpcpy, mempcpy and __*_chk
+ functions. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-14g.c"
+
+/* Compared to strlenopt-14gf.c, strcpy_chk with string literal as
+ second argument isn't being optimized by builtins.c into
+ memcpy. */
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__mempcpy_chk \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-15.c b/gcc/testsuite/gcc.dg/strlenopt-15.c
new file mode 100644
index 00000000000..495166ddb9b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-15.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p, size_t l)
+{
+ memcpy (p, "abcdef", l);
+ /* This strlen can't be optimized, as l is unknown. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, const char *q, size_t *lp)
+{
+ size_t l = strlen (q), l2;
+ memcpy (p, q, 7);
+ /* This strlen can't be optimized, as l might be bigger than 7. */
+ l2 = strlen (p);
+ *lp = l;
+ return l2;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p)
+{
+ *p = 0;
+ return p + 1;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ const char *volatile q2 = "IJ\0KLMNOPQRS";
+ size_t l;
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 2, 'a', 7);
+ if (fn1 (buf, 3) != 9 || memcmp (buf, "abcaaaaaa", 10) != 0)
+ abort ();
+ if (fn1 (buf, 7) != 6 || memcmp (buf, "abcdef\0aa", 10) != 0)
+ abort ();
+ if (fn2 (buf, q, &l) != 9 || l != 8 || memcmp (buf, "ABCDEFGaa", 10) != 0)
+ abort ();
+ if (fn2 (buf, q2, &l) != 2 || l != 2 || memcmp (buf, "IJ\0KLMNaa", 10) != 0)
+ abort ();
+ if (fn3 (buf) != buf + 1 || memcmp (buf, "\0J\0KLMNaa", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c
new file mode 100644
index 00000000000..11e4d319adb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c
@@ -0,0 +1,34 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, const char *q)
+{
+ /* This strcpy can be optimized into stpcpy. */
+ strcpy (p, q);
+ /* And this strchr into the return value from it. */
+ return strchr (p, '\0');
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ if (fn1 (buf, q) != buf + 8 || memcmp (buf, "ABCDEFGH", 9) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c
new file mode 100644
index 00000000000..b61bf74b8b2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c
@@ -0,0 +1,57 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) int
+foo (const char *p)
+{
+ static int c;
+ const char *q[] = { "123498765abcde", "123498765..", "129abcde", "129abcde" };
+ if (strcmp (p, q[c]) != 0)
+ abort ();
+ return c++;
+}
+
+__attribute__((noinline, noclone)) void
+bar (const char *p, const char *q)
+{
+ size_t l;
+ /* This strlen stays. */
+ char *a = __builtin_alloca (strlen (p) + 50);
+ /* strcpy can be optimized into memcpy. */
+ strcpy (a, p);
+ /* strcat into stpcpy. */
+ strcat (a, q);
+ /* This strlen can be optimized away. */
+ l = strlen (a);
+ /* This becomes memcpy. */
+ strcat (a, "abcde");
+ if (!foo (a))
+ /* And this one too. */
+ strcpy (a + l, "..");
+ foo (a);
+}
+
+int
+main ()
+{
+ const char *volatile s1 = "1234";
+ const char *volatile s2 = "98765";
+ const char *volatile s3 = "12";
+ const char *volatile s4 = "9";
+ bar (s1, s2);
+ bar (s3, s4);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c
new file mode 100644
index 00000000000..c70daea4b28
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c
@@ -0,0 +1,82 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int x, int y, int z)
+{
+ static char buf[40];
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnopq";
+ break;
+ }
+ if (y)
+ {
+ strcpy (buf, p);
+ if (z)
+ strcat (buf, "ABCDEFG");
+ else
+ strcat (buf, "HIJKLMN");
+ }
+ else
+ {
+ strcpy (buf, p + 1);
+ if (z)
+ strcat (buf, "OPQ");
+ else
+ strcat (buf, "RST");
+ }
+ return buf;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnopq" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ int j = i >= 3;
+ fn1 (i ? 0 : 1, 1, 1);
+ q = fn1 (i, 0, 0);
+ if (memcmp (q, p + 1, 3 + j) != 0 || memcmp (q + 3 + j, "RST", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 1);
+ q = fn1 (i, 1, 0);
+ if (memcmp (q, p, 4 + j) != 0 || memcmp (q + 4 + j, "HIJKLMN", 8) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 1, 0);
+ q = fn1 (i, 0, 1);
+ if (memcmp (q, p + 1, 3 + j) != 0 || memcmp (q + 3 + j, "OPQ", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 0);
+ q = fn1 (i, 1, 1);
+ if (memcmp (q, p, 4 + j) != 0 || memcmp (q + 4 + j, "ABCDEFG", 8) != 0)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-19.c b/gcc/testsuite/gcc.dg/strlenopt-19.c
new file mode 100644
index 00000000000..042fd77b002
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-19.c
@@ -0,0 +1,81 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int x, int y, int z)
+{
+ static char buf[40];
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ /* Prevent cswitch optimization. */
+ asm volatile ("" : : : "memory");
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnop";
+ break;
+ }
+ if (y)
+ {
+ strcpy (buf, p);
+ if (z)
+ strcat (buf, "ABCDEFG");
+ else
+ strcat (buf, "HIJKLMN");
+ }
+ else
+ {
+ strcpy (buf, p + 1);
+ if (z)
+ strcat (buf, "OPQ");
+ else
+ strcat (buf, "RST");
+ }
+ return buf;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnop" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ fn1 (i ? 0 : 1, 1, 1);
+ q = fn1 (i, 0, 0);
+ if (memcmp (q, p + 1, 3) != 0 || memcmp (q + 3, "RST", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 1);
+ q = fn1 (i, 1, 0);
+ if (memcmp (q, p, 4) != 0 || memcmp (q + 4, "HIJKLMN", 8) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 1, 0);
+ q = fn1 (i, 0, 1);
+ if (memcmp (q, p + 1, 3) != 0 || memcmp (q + 3, "OPQ", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 0);
+ q = fn1 (i, 1, 1);
+ if (memcmp (q, p, 4) != 0 || memcmp (q + 4, "ABCDEFG", 8) != 0)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c
new file mode 100644
index 00000000000..4b0207fd4f7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c
@@ -0,0 +1,18 @@
+/* This test needs runtime that provides __*_chk functions. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-1.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-2.c b/gcc/testsuite/gcc.dg/strlenopt-2.c
new file mode 100644
index 00000000000..5e6557b5687
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-2.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, char *r)
+{
+ char buf[26];
+ if (strlen (p) + strlen (r) + 9 > 26)
+ return NULL;
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (p). */
+ strcpy (buf, p);
+ /* These two strcat can be optimized into memcpy. The first one
+ could be even optimized into a *ptr = '/'; store as the '\0'
+ is immediately overwritten. */
+ strcat (buf, "/");
+ strcat (buf, "abcde");
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (r). */
+ strcat (buf, r);
+ /* And this can be optimized into memcpy too. */
+ strcat (buf, "fg");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p, r);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcdestring2fg"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 5 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-20.c b/gcc/testsuite/gcc.dg/strlenopt-20.c
new file mode 100644
index 00000000000..6fe99a422e9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-20.c
@@ -0,0 +1,95 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) const char *
+fn1 (int x, int y)
+{
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ /* Prevent cswitch optimization. */
+ asm volatile ("" : : : "memory");
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnop";
+ break;
+ }
+ if (y)
+ /* strchr should be optimized into p + 4 here. */
+ return strchr (p, '\0');
+ else
+ /* and strlen into 3. */
+ return p + strlen (p + 1);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, char *q)
+{
+ size_t l;
+ /* Both strcpy calls can be optimized into memcpy, strlen needs to stay. */
+ strcpy (p, "abc");
+ p[3] = 'd';
+ l = strlen (p);
+ strcpy (q, p);
+ return l;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p)
+{
+ char *c;
+ /* The strcpy call can be optimized into memcpy, strchr needs to stay,
+ strcat is optimized into memcpy. */
+ strcpy (p, "abc");
+ p[3] = 'd';
+ c = strchr (p, '\0');
+ strcat (p, "efgh");
+ return c;
+}
+
+int
+main ()
+{
+ int i;
+ char buf[64], buf2[64];
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnop" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ q = fn1 (i, 1);
+ if (memcmp (q - 4, p, 4) != 0 || q[0] != '\0')
+ abort ();
+ q = fn1 (i, 0);
+ if (memcmp (q - 3, p, 4) != 0 || q[1] != '\0')
+ abort ();
+ }
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 4, 'z', 2);
+ if (fn2 (buf, buf2) != 6
+ || memcmp (buf, "abcdzz", 7) != 0
+ || memcmp (buf2, "abcdzz", 7) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 4, 'z', 2);
+ if (fn3 (buf) != buf + 6 || memcmp (buf, "abcdzzefgh", 11) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-21.c b/gcc/testsuite/gcc.dg/strlenopt-21.c
new file mode 100644
index 00000000000..cd5fc5d928f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-21.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+struct S { char *p; size_t l; };
+
+__attribute__((noinline, noclone)) struct S
+foo (char *x, int n)
+{
+ int i;
+ char a[64];
+ char *p = strchr (x, '\0');
+ struct S s;
+ /* strcpy here is optimized into memcpy, length computed as p - x + 1. */
+ strcpy (a, x);
+ /* strcat here is optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (a, "efg");
+ s.p = strdup (a);
+ /* The strlen should be optimized here into 4. */
+ s.l = strlen (p);
+ return s;
+}
+
+int
+main ()
+{
+ char buf[32];
+ struct S s;
+ buf[0] = 'z';
+ buf[1] = '\0';
+ s = foo (buf, 0);
+ if (s.l != 4 || memcmp (buf, "zabcd", 6) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "z", 2) != 0)
+ abort ();
+ s = foo (buf, 60);
+ if (s.l != 4 || memcmp (buf, "zabcdabcd", 10) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "zabcdefg", 9) != 0)
+ abort ();
+ s = foo (buf, 240);
+ if (s.l != 4 || memcmp (buf, "zabcdabcdabcd", 14) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "zabcdabcdefgefg", 16) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c
new file mode 100644
index 00000000000..7996e67618c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c
@@ -0,0 +1,18 @@
+/* This test needs runtime that provides __*_chk functions. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-2.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 5 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-3.c b/gcc/testsuite/gcc.dg/strlenopt-3.c
new file mode 100644
index 00000000000..1bab8f37e99
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-3.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p, char *q)
+{
+ size_t s = strlen (q);
+ strcpy (p, q);
+ return s - strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, char *q)
+{
+ size_t s = strlen (q);
+ memcpy (p, q, s + 1);
+ return s - strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn3 (char *p)
+{
+ memcpy (p, "abcd", 5);
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn4 (char *p)
+{
+ memcpy (p, "efg\0hij", 6);
+ return strlen (p);
+}
+
+int
+main ()
+{
+ char buf[64];
+ char *volatile p = buf;
+ char *volatile q = "ABCDEF";
+ buf[7] = 'G';
+ if (fn1 (p, q) != 0 || memcmp (buf, "ABCDEF\0G", 8))
+ abort ();
+ q = "HIJ";
+ if (fn2 (p + 1, q) != 0 || memcmp (buf, "AHIJ\0F\0G", 8))
+ abort ();
+ buf[6] = 'K';
+ if (fn3 (p + 1) != 4 || memcmp (buf, "Aabcd\0KG", 8))
+ abort ();
+ if (fn4 (p) != 3 || memcmp (buf, "efg\0hiKG", 8))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-4.c b/gcc/testsuite/gcc.dg/strlenopt-4.c
new file mode 100644
index 00000000000..beea4959245
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-4.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+/* If stpcpy can't be used, this is optimized into
+ strcpy (p, q); strcat (p, r); memcpy (p + strlen (p), "abcd", 5);
+ If stpcpy can be used (see strlenopt-4g.c test),
+ this is optimized into
+ memcpy (stpcpy (stpcpy (p, q), r), "abcd", 5); */
+__attribute__((noinline, noclone)) void
+foo (char *p, const char *q, const char *r)
+{
+ strcpy (p, q);
+ strcat (p, r);
+ strcat (p, "abcd");
+}
+
+/* If stpcpy can't be used, this is optimized into
+ memcpy (p, "abcd", 4); strcpy (p + 4, q); strcat (p, r);
+ If stpcpy can be used, this is optimized into
+ memcpy (p, "abcd", 4); strcpy (stpcpy (p + 4, q), r); */
+__attribute__((noinline, noclone)) void
+bar (char *p, const char *q, const char *r)
+{
+ strcpy (p, "abcd");
+ strcat (p, q);
+ strcat (p, r);
+}
+
+/* If stpcpy can't be used, this is optimized into
+ strcat (p, q); memcpy (t1 = p + strlen (p), "abcd", 4);
+ strcpy (t1 + 4, r); memcpy (p + strlen (p), "efgh", 5);
+ If stpcpy can be used, this is optimized into
+ t1 = stpcpy (p + strlen (p), q); memcpy (t1, "abcd", 4);
+ memcpy (stpcpy (t1 + 4, r), "efgh", 5); */
+__attribute__((noinline, noclone)) void
+baz (char *p, const char *q, const char *r)
+{
+ strcat (p, q);
+ strcat (p, "abcd");
+ strcat (p, r);
+ strcat (p, "efgh");
+}
+
+char buf[64];
+
+int
+main ()
+{
+ char *volatile p = buf;
+ const char *volatile q = "ij";
+ const char *volatile r = "klmno";
+ foo (p, q, r);
+ if (memcmp (buf, "ijklmnoabcd\0\0\0\0\0\0\0\0", 20) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ bar (p, q, r);
+ if (memcmp (buf, "abcdijklmno\0\0\0\0\0\0\0\0", 20) != 0)
+ abort ();
+ memset (buf, 'v', 3);
+ memset (buf + 3, '\0', -3 + sizeof buf);
+ baz (p, q, r);
+ if (memcmp (buf, "vvvijabcdklmnoefgh\0", 20) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c
new file mode 100644
index 00000000000..7b397366e9c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c
@@ -0,0 +1,14 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt-4.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 5 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c
new file mode 100644
index 00000000000..cf99212a152
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c
@@ -0,0 +1,19 @@
+/* This test needs runtime that provides stpcpy and __*_chk functions. */
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#define FORTIFY_SOURCE 2
+#include "strlenopt-4.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 5 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-5.c b/gcc/testsuite/gcc.dg/strlenopt-5.c
new file mode 100644
index 00000000000..131494ac8e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-5.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, const char *q)
+{
+ char *e = strchr (p, '\0');
+ strcat (p, q);
+ return e;
+}
+
+__attribute__((noinline, noclone)) char *
+bar (char *p)
+{
+ memcpy (p, "abcd", 5);
+ return strchr (p, '\0');
+}
+
+__attribute__((noinline, noclone)) void
+baz (char *p)
+{
+ char *e = strchr (p, '\0');
+ strcat (e, "abcd");
+}
+
+char buf[64];
+
+int
+main ()
+{
+ char *volatile p = buf;
+ const char *volatile q = "ij";
+ memset (buf, 'v', 3);
+ if (foo (p, q) != buf + 3
+ || memcmp (buf, "vvvij\0\0\0\0", 10) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ if (bar (p) != buf + 4
+ || memcmp (buf, "abcd\0\0\0\0\0", 10) != 0)
+ abort ();
+ memset (buf, 'v', 2);
+ memset (buf + 2, '\0', -2 + sizeof buf);
+ baz (p);
+ if (memcmp (buf, "vvabcd\0\0\0", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-6.c b/gcc/testsuite/gcc.dg/strlenopt-6.c
new file mode 100644
index 00000000000..d9b718758a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-6.c
@@ -0,0 +1,86 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *x)
+{
+#ifdef PR50262_FIXED
+ /* Once PTA is fixed, we'll need just one strlen here,
+ without the memcpy. */
+ char *p = x;
+ char *q = malloc (strlen (p) + 64);
+#else
+ /* This is here just because PTA can't figure that
+ *q = '\0' store below can't change p's length.
+ In this case we have one strlen and one memcpy here. */
+ char b[64];
+ char *q = malloc (strlen (x) + 64);
+ char *p = strcpy (b, x);
+#endif
+ char *r;
+ if (q == NULL) return NULL;
+ /* This store can be optimized away once strcat is
+ replaced with memcpy. */
+ *q = '\0';
+ /* These two strcat calls can be optimized into memcpy calls. */
+ strcat (q, p);
+ strcat (q, "/");
+ /* The strchr can be optimized away, as we know the current
+ string length as well as end pointer. */
+ r = strchr (q, '\0');
+ /* This store can go, as it is overwriting '\0' with the same
+ character. */
+ *r = '\0';
+ /* And this strcat can be again optimized into memcpy call. */
+ strcat (q, "abcde");
+ return q;
+}
+
+__attribute__((noinline, noclone)) char *
+bar (char *p)
+{
+ char buf[26];
+ char *r;
+ if (strlen (p) + 9 > 26)
+ return NULL;
+ *buf = '\0';
+ strcat (buf, p);
+ strcat (buf, "/");
+ r = strchr (buf, '\0');
+ *r = '\0';
+ strcat (buf, "abcde");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcde"))
+ abort ();
+ memset (q, '\0', 14);
+ free (q);
+ }
+ q = bar (p);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcde"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-7.c b/gcc/testsuite/gcc.dg/strlenopt-7.c
new file mode 100644
index 00000000000..6fd940d748b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-7.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+char buf[64];
+
+__attribute__((noinline, noclone)) size_t
+foo (void)
+{
+ char *p = memcpy (buf, "abcdefgh", 9);
+ /* This store can be optimized away as... */
+ *p = '\0';
+ /* ... the following strcat can be optimized into memcpy,
+ which overwrites that '\0'. */
+ strcat (p, "ijk");
+ /* This should be optimized into return 3. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+bar (char *p)
+{
+ char *r = strchr (p, '\0');
+ /* This store shouldn't be optimized away, because we
+ want to crash if p is e.g. a string literal. */
+ *r = '\0';
+ /* This strlen can be optimized into 0. */
+ return strlen (r);
+}
+
+int
+main ()
+{
+ char *volatile p = buf;
+ if (foo () != 3 || memcmp (buf, "ijk\0efgh\0", 10) != 0)
+ abort ();
+ if (bar (p) != 0 || memcmp (buf, "ijk\0efgh\0", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "\\*r_\[0-9\]* = 0;" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 3;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-8.c b/gcc/testsuite/gcc.dg/strlenopt-8.c
new file mode 100644
index 00000000000..3aaf660a12c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-8.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+/* Yes, there are people who write code like this. */
+
+__attribute__((noinline, noclone)) char *
+foo (int r)
+{
+ char buf[10] = "";
+ strcat (buf, r ? "r" : "w");
+ strcat (buf, "b");
+ return strdup (buf);
+}
+
+__attribute__((noinline, noclone)) char *
+bar (int r)
+{
+ char buf[10] = {};
+ strcat (buf, r ? "r" : "w");
+ strcat (buf, "b");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *q = foo (1);
+ if (q != NULL)
+ {
+ if (strcmp (q, "rb"))
+ abort ();
+ free (q);
+ }
+ q = bar (0);
+ if (q != NULL)
+ {
+ if (strcmp (q, "wb"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-9.c b/gcc/testsuite/gcc.dg/strlenopt-9.c
new file mode 100644
index 00000000000..6590d708ec7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt-9.c
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int r)
+{
+ char *p = r ? "a" : "bc";
+ /* String length for p varies, therefore strchr below isn't
+ optimized away. */
+ return strchr (p, '\0');
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (int r)
+{
+ char *p, q[10];
+ strcpy (q, "abc");
+ p = r ? "a" : q;
+ /* String length for p varies, therefore strlen below isn't
+ optimized away. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn3 (char *p, int n)
+{
+ int i;
+ p = strchr (p, '\0');
+ /* strcat here can be optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (p, "efg");
+ /* The strlen here can't be optimized away, as in the loop string
+ length of p might change. */
+ return strlen (p);
+}
+
+char buf[64];
+
+__attribute__((noinline, noclone)) size_t
+fn4 (char *x, int n)
+{
+ int i;
+ size_t l;
+ char a[64];
+ char *p = strchr (x, '\0');
+ /* strcpy here is optimized into memcpy, length computed as p - x + 1. */
+ strcpy (a, x);
+ /* strcat here is optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (a, "efg");
+ /* The strlen should be optimized here into 4. */
+ l = strlen (p);
+ /* This stays strcpy. */
+ strcpy (buf, a);
+ return l;
+}
+
+int
+main ()
+{
+ volatile int l = 1;
+ char b[64];
+
+ if (memcmp (fn1 (l) - 1, "a", 2) != 0)
+ abort ();
+ if (memcmp (fn1 (!l) - 2, "bc", 3) != 0)
+ abort ();
+ if (fn2 (l) != 1 || fn2 (!l) != 3)
+ abort ();
+ memset (b, '\0', sizeof b);
+ memset (b, 'a', 3);
+ if (fn3 (b, 10) != 4 || memcmp (b, "aaaabcd", 8) != 0)
+ abort ();
+ if (fn3 (b, 128) != 7 || memcmp (b, "aaaabcdabcdefg", 15) != 0)
+ abort ();
+ if (fn3 (b, 256) != 10 || memcmp (b, "aaaabcdabcdefgabcdefgefg", 25) != 0)
+ abort ();
+ if (fn4 (b, 10) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcd", 29) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefg", 25) != 0)
+ abort ();
+ if (fn4 (b, 128) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcd", 33) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdefg", 32) != 0)
+ abort ();
+ if (fn4 (b, 256) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcdabcd", 37) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdabcdefgefg", 39) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 4;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt.h b/gcc/testsuite/gcc.dg/strlenopt.h
new file mode 100644
index 00000000000..ef47e5ac9ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/strlenopt.h
@@ -0,0 +1,59 @@
+/* This is a replacement of needed parts from stdlib.h and string.h
+ for -foptimize-strlen testing, to ensure we are testing the builtins
+ rather than whatever the OS has in its headers. */
+
+#define NULL ((void *) 0)
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+void *malloc (size_t);
+void free (void *);
+char *strdup (const char *);
+size_t strlen (const char *);
+void *memcpy (void *__restrict, const void *__restrict, size_t);
+char *strcpy (char *__restrict, const char *__restrict);
+char *strcat (char *__restrict, const char *__restrict);
+char *strchr (const char *, int);
+void *memset (void *, int, size_t);
+int memcmp (const void *, const void *, size_t);
+int strcmp (const char *, const char *);
+#ifdef USE_GNU
+void *mempcpy (void *__restrict, const void *__restrict, size_t);
+char *stpcpy (char *__restrict, const char *__restrict);
+#endif
+
+#if defined(FORTIFY_SOURCE) && FORTIFY_SOURCE > 0 && __OPTIMIZE__
+# define bos(ptr) __builtin_object_size (ptr, FORTIFY_SOURCE > 0)
+# define bos0(ptr) __builtin_object_size (ptr, 0)
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___memcpy_chk (dest, src, len, bos0 (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+strcpy (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___strcpy_chk (dest, src, bos (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+strcat (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___strcat_chk (dest, src, bos (dest));
+}
+
+# ifdef USE_GNU
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+mempcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___mempcpy_chk (dest, src, len, bos0 (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+stpcpy (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___stpcpy_chk (dest, src, bos (dest));
+}
+# endif
+#endif
diff --git a/gcc/testsuite/gcc.dg/torture/pr50363.c b/gcc/testsuite/gcc.dg/torture/pr50363.c
new file mode 100644
index 00000000000..eb350198a43
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr50363.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-ch -fno-tree-fre" } */
+
+void
+foo (int *__restrict__ * r, int n)
+{
+ int *p;
+ for (p = *r; p < *r + n; p++)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr50472.c b/gcc/testsuite/gcc.dg/torture/pr50472.c
new file mode 100644
index 00000000000..280f2c4ea9b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr50472.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+
+static const unsigned int foo = 1;
+unsigned int test( void )
+{
+ const volatile unsigned int *bar = &foo;
+ return ( *bar );
+}
+
+/* { dg-final { scan-tree-dump-not "return 1" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
index 16bd5c910d8..f1e52e5d8c2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-do run } */
-/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
void abort (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c
index 7275f2868dd..27e53ee65cf 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-do run } */
-/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
void abort (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c
index d5002346ed2..5dfe38424bf 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
int a[1000], b[1000];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c
index 6f06b7f8bf6..c29a46ac2e7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-do run } */
-/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
/* Test for predictive commoning of expressions, without reassociation. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c b/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c
index 134fc3765dc..29444abe579 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-do run } */
-/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
/* Test for predictive commoning of expressions, with reassociation. */
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-2_c.c b/gcc/testsuite/gcc.dg/uninit-pred-2_c.c
index 941f6328d0f..bf094d12770 100644
--- a/gcc/testsuite/gcc.dg/uninit-pred-2_c.c
+++ b/gcc/testsuite/gcc.dg/uninit-pred-2_c.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wuninitialized -O2 -fno-tree-tail-merge" } */
int g;
void bar (void);
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-11.c b/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
index d329e2b70a4..225d08ec33b 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
@@ -48,7 +48,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
-/* { dg-final { scan-tree-dump-times "SLP with multiple types" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-24.c b/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
new file mode 100644
index 00000000000..cbe1cb3edea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define N 256
+
+short src[N], dst[N];
+
+void foo (short * __restrict__ dst, short * __restrict__ src, int h,
+ int stride, int dummy)
+{
+ int i;
+ h /= 8;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] += A*src[0];
+ dst[1] += A*src[1];
+ dst[2] += A*src[2];
+ dst[3] += A*src[3];
+ dst[4] += A*src[4];
+ dst[5] += A*src[5];
+ dst[6] += A*src[6];
+ dst[7] += A*src[7];
+ dst += stride;
+ src += stride;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N; i++)
+ {
+ if (dst[i] != A * i)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-26.c b/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
new file mode 100644
index 00000000000..cf8f9587d03
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define B 4
+#define N 256
+
+char src[N], dst[N];
+
+void foo (char * __restrict__ dst, char * __restrict__ src, int h,
+ int stride, int dummy)
+{
+ int i;
+ h /= 16;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] += A*src[0] + src[stride];
+ dst[1] += A*src[1] + src[1+stride];
+ dst[2] += A*src[2] + src[2+stride];
+ dst[3] += A*src[3] + src[3+stride];
+ dst[4] += A*src[4] + src[4+stride];
+ dst[5] += A*src[5] + src[5+stride];
+ dst[6] += A*src[6] + src[6+stride];
+ dst[7] += A*src[7] + src[7+stride];
+ dst += 8;
+ src += 8;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i/8;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N/2; i++)
+ {
+ if (dst[i] != A * src[i] + src[i+8])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-27.c b/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
new file mode 100644
index 00000000000..7157ebadddc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define N 16
+
+short src[N], dst[N];
+
+void foo (int a)
+{
+ dst[0] += a*src[0];
+ dst[1] += a*src[1];
+ dst[2] += a*src[2];
+ dst[3] += a*src[3];
+ dst[4] += a*src[4];
+ dst[5] += a*src[5];
+ dst[6] += a*src[6];
+ dst[7] += a*src[7];
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (A);
+
+ for (i = 0; i < 8; i++)
+ {
+ if (dst[i] != A * i)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-28.c b/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
new file mode 100644
index 00000000000..996f8f3cad8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 300
+#define N 16
+
+char src[N];
+short dst[N];
+short src1[N], dst1[N];
+
+void foo (int a)
+{
+ dst[0] = (short) (a * (int) src[0]);
+ dst[1] = (short) (a * (int) src[1]);
+ dst[2] = (short) (a * (int) src[2]);
+ dst[3] = (short) (a * (int) src[3]);
+ dst[4] = (short) (a * (int) src[4]);
+ dst[5] = (short) (a * (int) src[5]);
+ dst[6] = (short) (a * (int) src[6]);
+ dst[7] = (short) (a * (int) src[7]);
+ dst[8] = (short) (a * (int) src[8]);
+ dst[9] = (short) (a * (int) src[9]);
+ dst[10] = (short) (a * (int) src[10]);
+ dst[11] = (short) (a * (int) src[11]);
+ dst[12] = (short) (a * (int) src[12]);
+ dst[13] = (short) (a * (int) src[13]);
+ dst[14] = (short) (a * (int) src[14]);
+ dst[15] = (short) (a * (int) src[15]);
+
+ dst1[0] += src1[0];
+ dst1[1] += src1[1];
+ dst1[2] += src1[2];
+ dst1[3] += src1[3];
+ dst1[4] += src1[4];
+ dst1[5] += src1[5];
+ dst1[6] += src1[6];
+ dst1[7] += src1[7];
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 2;
+ dst1[i] = 0;
+ src[i] = i;
+ src1[i] = i+2;
+ }
+
+ foo (A);
+
+ for (i = 0; i < N; i++)
+ {
+ if (dst[i] != A * i
+ || (i < N/2 && dst1[i] != i + 2))
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_pack_trunc && vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/pr50451.c b/gcc/testsuite/gcc.dg/vect/pr50451.c
new file mode 100644
index 00000000000..0733ea2ad51
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr50451.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int integral, int decimal, int power_ten)
+{
+ while (power_ten > 0)
+ {
+ integral *= 10;
+ decimal *= 10;
+ power_ten--;
+ }
+
+ return integral+decimal;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-7.c b/gcc/testsuite/gcc.dg/vect/vect-cond-7.c
new file mode 100644
index 00000000000..227192cf24c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-cond-7.c
@@ -0,0 +1,68 @@
+#include "tree-vect.h"
+
+extern void abort (void);
+double ad[64], bd[64], cd[64], dd[64], ed[64];
+float af[64], bf[64], cf[64], df[64], ef[64];
+signed char ac[64], bc[64], cc[64], dc[64], ec[64];
+short as[64], bs[64], cs[64], ds[64], es[64];
+int ai[64], bi[64], ci[64], di[64], ei[64];
+long long all[64], bll[64], cll[64], dll[64], ell[64];
+unsigned char auc[64], buc[64], cuc[64], duc[64], euc[64];
+unsigned short aus[64], bus[64], cus[64], dus[64], eus[64];
+unsigned int au[64], bu[64], cu[64], du[64], eu[64];
+unsigned long long aull[64], bull[64], cull[64], dull[64], eull[64];
+
+#define F(var) \
+__attribute__((noinline, noclone)) void \
+f##var (void) \
+{ \
+ int i; \
+ for (i = 0; i < 64; i++) \
+ { \
+ __typeof (a##var[0]) d = d##var[i], e = e##var[i]; \
+ a##var[i] = b##var[i] > c##var[i] ? d : e; \
+ } \
+}
+
+#define TESTS \
+F (d) F (f) F (c) F (s) F (i) F (ll) F (uc) F (us) F (u) F (ull)
+
+TESTS
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+ for (i = 0; i < 64; i++)
+ {
+#undef F
+#define F(var) \
+ b##var[i] = i + 64; \
+ switch (i % 3) \
+ { \
+ case 0: c##var[i] = i + 64; break; \
+ case 1: c##var[i] = 127 - i; break; \
+ case 2: c##var[i] = i; break; \
+ } \
+ d##var[i] = i / 2; \
+ e##var[i] = i * 2;
+ TESTS
+ }
+#undef F
+#define F(var) f##var ();
+ TESTS
+ for (i = 0; i < 64; i++)
+ {
+ asm volatile ("" : : : "memory");
+#undef F
+#define F(var) \
+ if (a##var[i] != (b##var[i] > c##var[i] ? d##var[i] : e##var[i])) \
+ abort ();
+ TESTS
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vector-compare-1.c b/gcc/testsuite/gcc.dg/vector-compare-1.c
new file mode 100644
index 00000000000..b5682398810
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vector-compare-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+void
+foo (vector (4, int) x, vector (4, float) y)
+{
+ vector (4, int) p4;
+ vector (4, int) r4;
+ vector (4, unsigned int) q4;
+ vector (8, int) r8;
+ vector (4, float) f4;
+
+ r4 = x > y; /* { dg-error "comparing vectors with different element types" } */
+ r8 = (x != p4); /* { dg-error "incompatible types when assigning to type" } */
+ r8 == r4; /* { dg-error "comparing vectors with different number of elements" } */
+}
diff --git a/gcc/testsuite/gcc.dg/vector-compare-2.c b/gcc/testsuite/gcc.dg/vector-compare-2.c
new file mode 100644
index 00000000000..e672dd1d9c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vector-compare-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+/* Test if C_MAYBE_CONST are folded correctly when
+ creating VEC_COND_EXPR. */
+
+typedef int vec __attribute__((vector_size(16)));
+
+vec i,j;
+extern vec a, b, c;
+
+extern int p, q, z;
+extern vec foo (int);
+
+vec
+foo (int x)
+{
+ return foo (p ? q :z) > a;
+}
+
+vec
+bar (int x)
+{
+ return b > foo (p ? q :z);
+}
+
+
diff --git a/gcc/testsuite/gcc.target/arm/cmp-1.c b/gcc/testsuite/gcc.target/arm/cmp-1.c
new file mode 100644
index 00000000000..0d6b7c26616
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmp-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-not "\tbl\t" } } */
+/* { dg-final { scan-assembler-not "__aeabi" } } */
+int x, y;
+
+#define TEST_EXPR(NAME, ARGS, EXPR) \
+ int NAME##1 ARGS { return (EXPR); } \
+ int NAME##2 ARGS { return !(EXPR); } \
+ int NAME##3 ARGS { return (EXPR) ? x : y; } \
+ void NAME##4 ARGS { if (EXPR) x++; } \
+ void NAME##5 ARGS { if (!(EXPR)) x++; }
+
+#define TEST(NAME, TYPE, OPERATOR) \
+ TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), a1 OPERATOR a2) \
+ TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), a1 OPERATOR *a2) \
+ TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), *a1 OPERATOR a2) \
+ TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), *a1 OPERATOR *a2) \
+ TEST_EXPR (NAME##_rc, (TYPE a1), a1 OPERATOR 100) \
+ TEST_EXPR (NAME##_cr, (TYPE a1), 100 OPERATOR a1)
+
+#define TEST_OP(NAME, OPERATOR) \
+ TEST (sc_##NAME, signed char, OPERATOR) \
+ TEST (uc_##NAME, unsigned char, OPERATOR) \
+ TEST (ss_##NAME, short, OPERATOR) \
+ TEST (us_##NAME, unsigned short, OPERATOR) \
+ TEST (si_##NAME, int, OPERATOR) \
+ TEST (ui_##NAME, unsigned int, OPERATOR) \
+ TEST (sll_##NAME, long long, OPERATOR) \
+ TEST (ull_##NAME, unsigned long long, OPERATOR)
+
+TEST_OP (eq, ==)
+TEST_OP (ne, !=)
+TEST_OP (lt, <)
+TEST_OP (gt, >)
+TEST_OP (le, <=)
+TEST_OP (ge, >=)
diff --git a/gcc/testsuite/gcc.target/arm/cmp-2.c b/gcc/testsuite/gcc.target/arm/cmp-2.c
new file mode 100644
index 00000000000..ed6b609ca86
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmp-2.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
+/* { dg-options "-O -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-final { scan-assembler-not "\tbl\t" } } */
+/* { dg-final { scan-assembler-not "__aeabi" } } */
+int x, y;
+
+#define EQ(X, Y) ((X) == (Y))
+#define NE(X, Y) ((X) != (Y))
+#define LT(X, Y) ((X) < (Y))
+#define GT(X, Y) ((X) > (Y))
+#define LE(X, Y) ((X) <= (Y))
+#define GE(X, Y) ((X) >= (Y))
+
+#define TEST_EXPR(NAME, ARGS, EXPR) \
+ int NAME##1 ARGS { return (EXPR); } \
+ int NAME##2 ARGS { return !(EXPR); } \
+ int NAME##3 ARGS { return (EXPR) ? x : y; } \
+ void NAME##4 ARGS { if (EXPR) x++; } \
+ void NAME##5 ARGS { if (!(EXPR)) x++; }
+
+#define TEST(NAME, TYPE, OPERATOR) \
+ TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), OPERATOR (a1, a2)) \
+ TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), OPERATOR (a1, *a2)) \
+ TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), OPERATOR (*a1, a2)) \
+ TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), OPERATOR (*a1, *a2)) \
+ TEST_EXPR (NAME##_rc, (TYPE a1), OPERATOR (a1, 100)) \
+ TEST_EXPR (NAME##_cr, (TYPE a1), OPERATOR (100, a1))
+
+#define TEST_OP(NAME, OPERATOR) \
+ TEST (f_##NAME, float, OPERATOR) \
+ TEST (d_##NAME, double, OPERATOR) \
+ TEST (ld_##NAME, long double, OPERATOR)
+
+TEST_OP (eq, EQ)
+TEST_OP (ne, NE)
+TEST_OP (lt, LT)
+TEST_OP (gt, GT)
+TEST_OP (le, LE)
+TEST_OP (ge, GE)
+TEST_OP (blt, __builtin_isless)
+TEST_OP (bgt, __builtin_isgreater)
+TEST_OP (ble, __builtin_islessequal)
+TEST_OP (bge, __builtin_isgreaterequal)
+/* This one should be expanded into separate ordered and equality
+ comparisons. */
+TEST_OP (blg, __builtin_islessgreater)
+TEST_OP (bun, __builtin_isunordered)
diff --git a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
index 430a4d5717f..9cf86dd05fe 100644
--- a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
+++ b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
@@ -3,6 +3,7 @@
/* { dg-require-effective-target arm_thumb2_ok } */
/* { dg-options "-O2 -mthumb -march=armv7-a" } */
/* { dg-add-options arm_neon } */
+/* { dg-prune-output "switch .* conflicts with" } */
#include <arm_neon.h>
#include <stddef.h>
diff --git a/gcc/testsuite/gcc.target/arm/pr42835.c b/gcc/testsuite/gcc.target/arm/pr42835.c
index 71c51ebe31c..867dd0287f1 100644
--- a/gcc/testsuite/gcc.target/arm/pr42835.c
+++ b/gcc/testsuite/gcc.target/arm/pr42835.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mthumb -Os" } */
+/* { dg-options "-mthumb -Os -fno-tree-tail-merge" } */
/* { dg-require-effective-target arm_thumb2_ok } */
int foo(int *p, int i)
diff --git a/gcc/testsuite/gcc.target/arm/pr50099.c b/gcc/testsuite/gcc.target/arm/pr50099.c
new file mode 100644
index 00000000000..c0d143dd578
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr50099.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long long foo (signed char * arg)
+{
+ long long temp_1;
+
+ temp_1 = arg[256];
+ return temp_1;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-cond-1.c b/gcc/testsuite/gcc.target/i386/avx-cond-1.c
new file mode 100644
index 00000000000..e233ec9622c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-cond-1.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -mavx" } */
+/* { dg-require-effective-target avx_runtime } */
+
+#ifndef CHECK_H
+#define CHECK_H "avx-check.h"
+#endif
+
+#ifndef TEST
+#define TEST avx_test
+#endif
+
+#include "sse4_1-cond-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/avxfp-1.c b/gcc/testsuite/gcc.target/i386/avxfp-1.c
new file mode 100644
index 00000000000..70bc8f1edb4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avxfp-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx -mfpmath=sse" } */
+/* { dg-final { scan-assembler "vmaxsd" } } */
+/* { dg-final { scan-assembler "vminsd" } } */
+double x;
+t()
+{
+ x=x>5?x:5;
+}
+
+double x;
+q()
+{
+ x=x<5?x:5;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avxfp-2.c b/gcc/testsuite/gcc.target/i386/avxfp-2.c
new file mode 100644
index 00000000000..c34a1bd7c36
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avxfp-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx -mfpmath=sse" } */
+/* { dg-final { scan-assembler "vmaxsd" } } */
+/* { dg-final { scan-assembler "vminsd" } } */
+double x;
+q()
+{
+ x=x<5?5:x;
+}
+
+double x;
+q1()
+{
+ x=x>5?5:x;
+}
diff --git a/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2.c b/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2.c
new file mode 100644
index 00000000000..c9f159e064f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2.c
@@ -0,0 +1,47 @@
+/* { dg-do run { target { bmi2 && { ia32 } } } } */
+/* { dg-options "-mbmi2 -O2" } */
+
+#include <x86intrin.h>
+
+#include "bmi2-check.h"
+
+__attribute__((noinline))
+unsigned long long
+calc_mul_u32 (unsigned volatile a, unsigned b)
+{
+ unsigned long long res = 0;
+ int i;
+ for (i = 0; i < b; ++i)
+ res += a;
+
+ return res;
+}
+
+__attribute__((noinline))
+unsigned calc_mulx_u32 (unsigned x, unsigned y, unsigned *res_h)
+{
+ return (unsigned) _mulx_u32 (x, y, res_h);
+}
+
+static void
+bmi2_test ()
+{
+ unsigned i;
+ unsigned a = 0xce7ace0;
+ unsigned b = 0xfacefff;
+ unsigned res_l, res_h;
+ unsigned long long res, res_ref;
+
+ for (i = 0; i < 5; ++i) {
+ a = a * (i + 1);
+ b = b / (i + 1);
+
+ res_ref = calc_mul_u32 (a, b);
+ res_l = calc_mulx_u32 (a, b, &res_h);
+
+ res = ((unsigned long long) res_h << 32) | res_l;
+
+ if (res != res_ref)
+ abort();
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2a.c b/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2a.c
new file mode 100644
index 00000000000..356d593c7eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bmi2-mulx32-2a.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target { ia32 } } } */
+/* { dg-options "-O2 -mbmi2" } */
+
+#include "bmi2-mulx32-2.c"
+
+/* { dg-final { scan-assembler-times "mulx\[ \\t\]+\[^\n\]*" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2.c b/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2.c
new file mode 100644
index 00000000000..55b3554628b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2.c
@@ -0,0 +1,51 @@
+/* { dg-do run { target { bmi2 && { ! ia32 } } } } */
+/* { dg-options "-mbmi2 -O2" } */
+
+#include <x86intrin.h>
+#include "bmi2-check.h"
+
+__attribute__((noinline))
+unsigned __int128
+calc_mul_u64 (unsigned long long volatile a, unsigned long long b)
+{
+ unsigned __int128 res = 0;
+ int i;
+ for (i = 0; i < b; ++i)
+ res += (unsigned __int128) a;
+
+ return res;
+}
+
+__attribute__((noinline))
+unsigned long long
+calc_mulx_u64 (unsigned long long x,
+ unsigned long long y,
+ unsigned long long *res_h)
+{
+ return _mulx_u64 (x, y, res_h);
+}
+
+
+static void
+bmi2_test ()
+{
+ unsigned i;
+ unsigned long long a = 0xce7ace0ce7ace0;
+ unsigned long long b = 0xface;
+ unsigned long long res_l, res_h;
+ unsigned __int128 res, res_ref;
+
+ for (i=0; i<5; ++i) {
+ a = a * (i + 1);
+ b = b / (i + 1);
+
+ res_ref = calc_mul_u64 (a, b);
+
+ res_l = calc_mulx_u64 (a, b, &res_h);
+
+ res = ((unsigned __int128) res_h << 64) | res_l;
+
+ if (res != res_ref)
+ abort();
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2a.c b/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2a.c
new file mode 100644
index 00000000000..d8b3e0eccae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bmi2-mulx64-2a.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -mbmi2" } */
+
+#include "bmi2-mulx64-2.c"
+
+/* { dg-final { scan-assembler-times "mulx\[ \\t\]+\[^\n\]*" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-10.c b/gcc/testsuite/gcc.target/i386/pad-10.c
index e10d24c7da6..d721c64a5c8 100644
--- a/gcc/testsuite/gcc.target/i386/pad-10.c
+++ b/gcc/testsuite/gcc.target/i386/pad-10.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-2.c b/gcc/testsuite/gcc.target/i386/pad-2.c
index 37743c483a8..05b19d3887a 100644
--- a/gcc/testsuite/gcc.target/i386/pad-2.c
+++ b/gcc/testsuite/gcc.target/i386/pad-2.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 8 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-3.c b/gcc/testsuite/gcc.target/i386/pad-3.c
index b9a547d07d8..43d654f3f3b 100644
--- a/gcc/testsuite/gcc.target/i386/pad-3.c
+++ b/gcc/testsuite/gcc.target/i386/pad-3.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fno-pic" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-4.c b/gcc/testsuite/gcc.target/i386/pad-4.c
index 91bf0dba08e..c742310a34c 100644
--- a/gcc/testsuite/gcc.target/i386/pad-4.c
+++ b/gcc/testsuite/gcc.target/i386/pad-4.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
/* { dg-require-effective-target fpic } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fPIC" } */
/* { dg-final { scan-assembler-times "nop" 8 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-5a.c b/gcc/testsuite/gcc.target/i386/pad-5a.c
index 7aa04dbcf07..3a02262a0af 100644
--- a/gcc/testsuite/gcc.target/i386/pad-5a.c
+++ b/gcc/testsuite/gcc.target/i386/pad-5a.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 2 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-5b.c b/gcc/testsuite/gcc.target/i386/pad-5b.c
index e4bb8610f14..a3c9d30c3ac 100644
--- a/gcc/testsuite/gcc.target/i386/pad-5b.c
+++ b/gcc/testsuite/gcc.target/i386/pad-5b.c
@@ -1,4 +1,5 @@
/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-6a.c b/gcc/testsuite/gcc.target/i386/pad-6a.c
index 532e38f1d2b..97af9f9ca1b 100644
--- a/gcc/testsuite/gcc.target/i386/pad-6a.c
+++ b/gcc/testsuite/gcc.target/i386/pad-6a.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-6b.c b/gcc/testsuite/gcc.target/i386/pad-6b.c
index 5cb64ff8e6c..e4956f0c1d1 100644
--- a/gcc/testsuite/gcc.target/i386/pad-6b.c
+++ b/gcc/testsuite/gcc.target/i386/pad-6b.c
@@ -1,4 +1,5 @@
/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 6 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-7.c b/gcc/testsuite/gcc.target/i386/pad-7.c
index 65c18ffa8f9..a4dbd260bea 100644
--- a/gcc/testsuite/gcc.target/i386/pad-7.c
+++ b/gcc/testsuite/gcc.target/i386/pad-7.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-8.c b/gcc/testsuite/gcc.target/i386/pad-8.c
index 0e939fa7890..ebb6e720006 100644
--- a/gcc/testsuite/gcc.target/i386/pad-8.c
+++ b/gcc/testsuite/gcc.target/i386/pad-8.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 6 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pad-9.c b/gcc/testsuite/gcc.target/i386/pad-9.c
index dd6d3b3d761..b1a58158a87 100644
--- a/gcc/testsuite/gcc.target/i386/pad-9.c
+++ b/gcc/testsuite/gcc.target/i386/pad-9.c
@@ -1,4 +1,5 @@
/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=atom" } } */
/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr50482.c b/gcc/testsuite/gcc.target/i386/pr50482.c
new file mode 100644
index 00000000000..64c2686bd86
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr50482.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse4" } */
+
+void
+test (int code, unsigned int * image, int * colors)
+{
+ int i;
+
+ for (i = 0; i < code; ++i)
+ image[i] = (colors[i] < 0 ? ~(unsigned int) 0 : colors[i]);
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c
index af56e149acf..d569acf0af9 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendps-2.c
@@ -53,14 +53,13 @@ sse4_1_test (void)
{
__m128 x;
float f[4];
- int i[4];
} src3;
int i;
init_blendps (src1.f, src2.f);
for (i = 0; i < 4; i++)
- src3.i[i] = (int) random ();
+ src3.f[i] = (int) random ();
/* Check blendps imm8, m128, xmm */
for (i = 0; i < NUM; i++)
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
index b4d8e8ee166..aa073f33890 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
@@ -14,6 +14,7 @@
#include <smmintrin.h>
#include <string.h>
+#include <stdlib.h>
#define NUM 20
@@ -66,6 +67,9 @@ TEST (void)
init_blendps (src1.f, src2.f);
+ for (i = 0; i < 4; i++)
+ src3.f[i] = (int) random ();
+
/* Check blendps imm8, m128, xmm */
for (i = 0; i < NUM; i++)
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-cond-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-cond-1.c
new file mode 100644
index 00000000000..41e69e59f49
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-cond-1.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sse4 } */
+/* { dg-options "-O3 -msse4.1" } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
+
+extern void abort (void);
+double ad[64], bd[64], cd[64], dd[64], ed[64];
+float af[64], bf[64], cf[64], df[64], ef[64];
+signed char ac[64], bc[64], cc[64], dc[64], ec[64];
+short as[64], bs[64], cs[64], ds[64], es[64];
+int ai[64], bi[64], ci[64], di[64], ei[64];
+long long all[64], bll[64], cll[64], dll[64], ell[64];
+unsigned char auc[64], buc[64], cuc[64], duc[64], euc[64];
+unsigned short aus[64], bus[64], cus[64], dus[64], eus[64];
+unsigned int au[64], bu[64], cu[64], du[64], eu[64];
+unsigned long long aull[64], bull[64], cull[64], dull[64], eull[64];
+
+#define F(var) \
+__attribute__((noinline, noclone)) void \
+f##var (void) \
+{ \
+ int i; \
+ for (i = 0; i < 64; i++) \
+ { \
+ __typeof (a##var[0]) d = d##var[i], e = e##var[i]; \
+ a##var[i] = b##var[i] > c##var[i] ? d : e; \
+ } \
+}
+
+#define TESTS \
+F (d) F (f) F (c) F (s) F (i) F (ll) F (uc) F (us) F (u) F (ull)
+
+TESTS
+
+void
+TEST ()
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ {
+#undef F
+#define F(var) \
+ b##var[i] = i + 64; \
+ switch (i % 3) \
+ { \
+ case 0: c##var[i] = i + 64; break; \
+ case 1: c##var[i] = 127 - i; break; \
+ case 2: c##var[i] = i; break; \
+ } \
+ d##var[i] = i / 2; \
+ e##var[i] = i * 2;
+ TESTS
+ }
+#undef F
+#define F(var) f##var ();
+ TESTS
+ for (i = 0; i < 64; i++)
+ {
+ asm volatile ("" : : : "memory");
+#undef F
+#define F(var) \
+ if (a##var[i] != (b##var[i] > c##var[i] ? d##var[i] : e##var[i])) \
+ abort ();
+ TESTS
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect-double-1.c b/gcc/testsuite/gcc.target/i386/vect-double-1.c
index 87e5fe94b25..0b691bcbba6 100644
--- a/gcc/testsuite/gcc.target/i386/vect-double-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-double-1.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=core2" } } */
/* { dg-options "-O2 -ftree-vectorize -mfpmath=sse -march=core2 -fdump-tree-vect-stats" } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.target/s390/addr-constraints-1.c b/gcc/testsuite/gcc.target/s390/addr-constraints-1.c
new file mode 100644
index 00000000000..fbb48f282b3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/addr-constraints-1.c
@@ -0,0 +1,70 @@
+/* { dg-compile } */
+/* { dg-options "-O2" } */
+
+static inline unsigned long
+lay_uw(unsigned long addr)
+{
+ unsigned long result;
+
+ __asm__ ("lay %[result],%a[addr]"
+ : [result] "=d" (result)
+ : [addr] "UW" (addr));
+ return result;
+}
+
+static inline unsigned long
+la_u(unsigned long addr)
+{
+ unsigned long result;
+
+ __asm__ ("la %[result],%a[addr]"
+ : [result] "=d" (result)
+ : [addr] "U" (addr));
+ return result;
+}
+
+static inline unsigned long
+lay_zqzrzszt(unsigned long addr)
+{
+ unsigned long result;
+
+ __asm__ ("lay %[result],%a[addr]"
+ : [result] "=d" (result)
+ : [addr] "ZQZRZSZT" (addr));
+ return result;
+}
+
+static inline unsigned long
+la_zqzr(unsigned long addr)
+{
+ unsigned long result;
+
+ __asm__ ("la %[result],%a[addr]"
+ : [result] "=d" (result)
+ : [addr] "ZQZR" (addr));
+ return result;
+}
+
+
+extern unsigned long a[15];
+
+int main(void)
+{
+ a[1] = lay_uw(3333);
+ a[2] = lay_uw(4444);
+ a[3] = lay_uw(1000000);
+ a[4] = lay_uw(a[0]);
+
+ a[5] = la_u(2222);
+ a[6] = la_u(5555);
+ a[7] = la_u(a[0]);
+
+ a[8] = lay_zqzrzszt(3333);
+ a[9] = lay_zqzrzszt(4444);
+ a[10] = lay_zqzrzszt(1000000);
+ a[11] = lay_zqzrzszt(a[0]);
+
+ a[12] = la_zqzr(2222);
+ a[13] = la_zqzr(5555);
+ a[14] = la_zqzr(a[0]);
+}
diff --git a/gcc/testsuite/gcc.target/sh/mfmovd.c b/gcc/testsuite/gcc.target/sh/mfmovd.c
index c8e0094f0c1..b5653c76489 100644
--- a/gcc/testsuite/gcc.target/sh/mfmovd.c
+++ b/gcc/testsuite/gcc.target/sh/mfmovd.c
@@ -1,7 +1,9 @@
+/* Verify that we generate fmov.d instructions to move doubles when -mfmovd
+ option is enabled. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-mfmovd" } */
-/* { dg-skip-if "No double precision FPU support" { "sh*-*-*" } "-m2a-nofpu -m2a-single-only -m4-nofpu -m4-single-only -m4a-nofpu -m4a-single-only" { "" } } */
-/* { dg-final { scan-assembler "fmov.d"} } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a" "-m2a-single" "-m4" "-m4-single" "-m4-100" "-m4-100-single" "-m4-200" "-m4-200-single" "-m4-300" "-m4-300-single" "-m4a" "-m4a-single" } } */
+/* { dg-final { scan-assembler "fmov.d" } } */
extern double g;
diff --git a/gcc/testsuite/gcc.target/sh/pr49468-si.c b/gcc/testsuite/gcc.target/sh/pr49468-si.c
new file mode 100644
index 00000000000..69fbe230efa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr49468-si.c
@@ -0,0 +1,22 @@
+/* Check that 32 bit integer abs is generated as neg instruction and
+ conditional branch instead of default branch-free code. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-options "-O1" } */
+/* { dg-final { scan-assembler-times "neg" 2 } } */
+
+
+/* Normal integer absolute value. */
+int
+abs_0 (int i)
+{
+ return (i < 0) ? -i : i;
+}
+
+/* Negated integer absolute value.
+ The generated code should be the same, except that the branch
+ condition is inverted. */
+int
+abs_1 (int i)
+{
+ return (i > 0) ? -i : i;
+}
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c b/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c
index 761c7b0b5df..1c9ae6ee6bd 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c
@@ -1,9 +1,9 @@
-/* Verify that we generate movua to load unaligned 32-bit values. */
+/* Verify that we generate movua to load unaligned 32-bit values on SH4A. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O" } */
-/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 6 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } } */
+/* { dg-final { scan-assembler-times "movua.l" 6 } } */
-#ifdef __SH4A__
/* Aligned. */
struct s0 { long long d : 32; } x0;
long long f0() {
@@ -63,11 +63,5 @@ struct u4 { long long c : 32; unsigned long long d : 32; } y4;
unsigned long long g4() {
return y4.d;
}
-#else
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-#endif
+
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-cos.c b/gcc/testsuite/gcc.target/sh/sh4a-cos.c
index 198d41f8675..c2e421c6a05 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-cos.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-cos.c
@@ -1,13 +1,11 @@
/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode. */
+ (fsca) in fast math mode on SH4A with FPU. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler "fsca" } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
double test(double f) { return cos(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-cosf.c b/gcc/testsuite/gcc.target/sh/sh4a-cosf.c
index f78c140d501..68bb20f2c33 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-cosf.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-cosf.c
@@ -1,13 +1,11 @@
/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode. */
+ (fsca) in fast math mode on SH4A with FPU. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler "fsca" } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
float test(float f) { return cosf(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c b/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c
index c8f04e4d2e2..4ce2e28e22f 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c
@@ -1,13 +1,11 @@
/* Verify that we generate single-precision square root reciprocal
- approximate (fsrra) in fast math mode. */
+ approximate (fsrra) in fast math mode on SH4A with FPU. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsrra\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler "fsrra" } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
float test(float f) { return 1 / sqrtf(f); }
-#else
-asm ("fsrra\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c b/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
index 359dd8feb90..7e817c4c122 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
@@ -1,17 +1,14 @@
/* Verify that we generate movua to copy unaligned memory regions to
- 32-bit-aligned addresses. */
+ 32-bit-aligned addresses on SH4A. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O" } */
-/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 2 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } } */
+/* { dg-final { scan-assembler-times "movua.l" 2 } } */
-#ifdef __SH4A__
#include <string.h>
struct s { int i; char a[10], b[10]; } x;
int f() {
memcpy(x.a, x.b, 10);
}
-#else
-asm ("movua.l\t+");
-asm ("movua.l\t+");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sin.c b/gcc/testsuite/gcc.target/sh/sh4a-sin.c
index 9f46f600763..cd8f0783d7b 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-sin.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-sin.c
@@ -1,13 +1,11 @@
/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode. */
+ (fsca) in fast math mode on SH4A with FPU. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler "fsca" } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
double test(double f) { return sin(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sincos.c b/gcc/testsuite/gcc.target/sh/sh4a-sincos.c
index f4293797534..423dda1433b 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-sincos.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-sincos.c
@@ -3,12 +3,10 @@
sine and cosine. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler-times "\tfsca\t" 1 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler-times "fsca" 1 } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
double test(double f) { return sin(f) + cos(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c b/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c
index 42913dbd59e..0ca33e30a0f 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c
@@ -3,12 +3,10 @@
sine and cosine. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler-times "\tfsca\t" 1 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler-times "fsca" 1 } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
float test(float f) { return sinf(f) + cosf(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sinf.c b/gcc/testsuite/gcc.target/sh/sh4a-sinf.c
index 2a2343fd73a..4d9abea045b 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-sinf.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-sinf.c
@@ -1,13 +1,11 @@
/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode. */
+ (fsca) in fast math mode on SH4A with FPU. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
+/* { dg-final { scan-assembler "fsca" } } */
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
#include <math.h>
float test(float f) { return sinf(f); }
-#else
-asm ("fsca\t");
-#endif
+
diff --git a/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c b/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
index effd13d19a4..81f80df1e68 100644
--- a/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
+++ b/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
@@ -1,4 +1,4 @@
-/* Verify that we don't generate fame related insn against stack adjustment
+/* Verify that we don't generate frame related insn against stack adjustment
for the object sent partially in registers. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-g" } */
diff --git a/gcc/testsuite/gcc.target/sparc/array.c b/gcc/testsuite/gcc.target/sparc/array.c
new file mode 100644
index 00000000000..e382e22f3fe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/array.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ultrasparc -mvis" } */
+
+long test_array8 (long a, long b)
+{
+ return __builtin_vis_array8 (a, b);
+}
+
+long test_array16 (long a, long b)
+{
+ return __builtin_vis_array16 (a, b);
+}
+
+long test_array32 (long a, long b)
+{
+ return __builtin_vis_array32 (a, b);
+}
+
+/* { dg-final { scan-assembler "array8\t%" } } */
+/* { dg-final { scan-assembler "array16\t%" } } */
+/* { dg-final { scan-assembler "array32\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/bmaskbshuf.c b/gcc/testsuite/gcc.target/sparc/bmaskbshuf.c
new file mode 100644
index 00000000000..7108a018e5e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/bmaskbshuf.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc3 -mvis -mvis2" } */
+typedef long long int64_t;
+typedef int vec32 __attribute__((vector_size(8)));
+typedef short vec16 __attribute__((vector_size(8)));
+typedef unsigned char vec8 __attribute__((vector_size(8)));
+
+long test_bmask (long x, long y)
+{
+ return __builtin_vis_bmask (x, y);
+}
+
+vec16 test_bshufv4hi (vec16 x, vec16 y)
+{
+ return __builtin_vis_bshufflev4hi (x, y);
+}
+
+vec32 test_bshufv2si (vec32 x, vec32 y)
+{
+ return __builtin_vis_bshufflev2si (x, y);
+}
+
+vec8 test_bshufv8qi (vec8 x, vec8 y)
+{
+ return __builtin_vis_bshufflev8qi (x, y);
+}
+
+int64_t test_bshufdi (int64_t x, int64_t y)
+{
+ return __builtin_vis_bshuffledi (x, y);
+}
+
+/* { dg-final { scan-assembler "bmask\t%" } } */
+/* { dg-final { scan-assembler "bshuffle\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/cmask.c b/gcc/testsuite/gcc.target/sparc/cmask.c
new file mode 100644
index 00000000000..b3168ec321d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/cmask.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=niagara3 -mvis" } */
+
+void test_cm8 (long x)
+{
+ __builtin_vis_cmask8 (x);
+}
+
+void test_cm16 (long x)
+{
+ __builtin_vis_cmask16 (x);
+}
+
+void test_cm32 (long x)
+{
+ __builtin_vis_cmask32 (x);
+}
+
+/* { dg-final { scan-assembler "cmask8\t%" } } */
+/* { dg-final { scan-assembler "cmask16\t%" } } */
+/* { dg-final { scan-assembler "cmask32\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/edge.c b/gcc/testsuite/gcc.target/sparc/edge.c
new file mode 100644
index 00000000000..81d8d88563c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/edge.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc -mvis" } */
+
+long test_edge8 (void *p1, void *p2)
+{
+ return __builtin_vis_edge8 (p1, p2);
+}
+
+long test_edge8l (void *p1, void *p2)
+{
+ return __builtin_vis_edge8l (p1, p2);
+}
+
+long test_edge16 (void *p1, void *p2)
+{
+ return __builtin_vis_edge16 (p1, p2);
+}
+
+long test_edge16l (void *p1, void *p2)
+{
+ return __builtin_vis_edge16l (p1, p2);
+}
+
+long test_edge32 (void *p1, void *p2)
+{
+ return __builtin_vis_edge32 (p1, p2);
+}
+
+long test_edge32l (void *p1, void *p2)
+{
+ return __builtin_vis_edge32l (p1, p2);
+}
+
+/* { dg-final { scan-assembler "edge8\t%" } } */
+/* { dg-final { scan-assembler "edge8l\t%" } } */
+/* { dg-final { scan-assembler "edge16\t%" } } */
+/* { dg-final { scan-assembler "edge16l\t%" } } */
+/* { dg-final { scan-assembler "edge32\t%" } } */
+/* { dg-final { scan-assembler "edge32l\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/edgen.c b/gcc/testsuite/gcc.target/sparc/edgen.c
new file mode 100644
index 00000000000..11973b58c50
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/edgen.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc3 -mvis" } */
+
+long test_edge8n (void *p1, void *p2)
+{
+ return __builtin_vis_edge8n (p1, p2);
+}
+
+long test_edge8ln (void *p1, void *p2)
+{
+ return __builtin_vis_edge8ln (p1, p2);
+}
+
+long test_edge16n (void *p1, void *p2)
+{
+ return __builtin_vis_edge16n (p1, p2);
+}
+
+long test_edge16ln (void *p1, void *p2)
+{
+ return __builtin_vis_edge16ln (p1, p2);
+}
+
+long test_edge32n (void *p1, void *p2)
+{
+ return __builtin_vis_edge32n (p1, p2);
+}
+
+long test_edge32ln (void *p1, void *p2)
+{
+ return __builtin_vis_edge32ln (p1, p2);
+}
+
+/* { dg-final { scan-assembler "edge8n\t%" } } */
+/* { dg-final { scan-assembler "edge8ln\t%" } } */
+/* { dg-final { scan-assembler "edge16n\t%" } } */
+/* { dg-final { scan-assembler "edge16ln\t%" } } */
+/* { dg-final { scan-assembler "edge32n\t%" } } */
+/* { dg-final { scan-assembler "edge32ln\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/fcmp.c b/gcc/testsuite/gcc.target/sparc/fcmp.c
new file mode 100644
index 00000000000..959a674e1e7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fcmp.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ultrasparc -mvis" } */
+typedef int vec32 __attribute__((vector_size(8)));
+typedef short vec16 __attribute__((vector_size(8)));
+
+long test_fcmple16 (vec16 a, vec16 b)
+{
+ return __builtin_vis_fcmple16 (a, b);
+}
+
+long test_fcmple32 (vec32 a, vec32 b)
+{
+ return __builtin_vis_fcmple32 (a, b);
+}
+
+long test_fcmpne16 (vec16 a, vec16 b)
+{
+ return __builtin_vis_fcmpne16 (a, b);
+}
+
+long test_fcmpne32 (vec32 a, vec32 b)
+{
+ return __builtin_vis_fcmpne32 (a, b);
+}
+
+long test_fcmpgt16 (vec16 a, vec16 b)
+{
+ return __builtin_vis_fcmpgt16 (a, b);
+}
+
+long test_fcmpgt32 (vec32 a, vec32 b)
+{
+ return __builtin_vis_fcmpgt32 (a, b);
+}
+
+long test_fcmpeq16 (vec16 a, vec16 b)
+{
+ return __builtin_vis_fcmpeq16 (a, b);
+}
+
+long test_fcmpeq32 (vec32 a, vec32 b)
+{
+ return __builtin_vis_fcmpeq32 (a, b);
+}
+
+/* { dg-final { scan-assembler "fcmple16\t%" } } */
+/* { dg-final { scan-assembler "fcmple32\t%" } } */
+/* { dg-final { scan-assembler "fcmpne16\t%" } } */
+/* { dg-final { scan-assembler "fcmpne32\t%" } } */
+/* { dg-final { scan-assembler "fcmpgt16\t%" } } */
+/* { dg-final { scan-assembler "fcmpgt32\t%" } } */
+/* { dg-final { scan-assembler "fcmpeq16\t%" } } */
+/* { dg-final { scan-assembler "fcmpeq32\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/fpadds.c b/gcc/testsuite/gcc.target/sparc/fpadds.c
new file mode 100644
index 00000000000..d0704e03eda
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fpadds.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=niagara3 -mvis" } */
+typedef int __v2si __attribute__((vector_size(8)));
+typedef int __v1si __attribute__((vector_size(4)));
+typedef short __v4hi __attribute__((vector_size(8)));
+typedef short __v2hi __attribute__((vector_size(4)));
+
+__v4hi test_fpadds16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fpadds16 (x, y);
+}
+
+__v2hi test_fpadds16s (__v2hi x, __v2hi y)
+{
+ return __builtin_vis_fpadds16s (x, y);
+}
+
+__v4hi test_fpsubs16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fpsubs16 (x, y);
+}
+
+__v2hi test_fpsubs16s (__v2hi x, __v2hi y)
+{
+ return __builtin_vis_fpsubs16s (x, y);
+}
+
+__v2si test_fpadds32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fpadds32 (x, y);
+}
+
+__v1si test_fpadds32s (__v1si x, __v1si y)
+{
+ return __builtin_vis_fpadds32s (x, y);
+}
+
+__v2si test_fpsubs32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fpsubs32 (x, y);
+}
+
+__v1si test_fpsubs32s (__v1si x, __v1si y)
+{
+ return __builtin_vis_fpsubs32s (x, y);
+}
+
+/* { dg-final { scan-assembler "fpadds16\t%" } } */
+/* { dg-final { scan-assembler "fpadds16s\t%" } } */
+/* { dg-final { scan-assembler "fpsubs16\t%" } } */
+/* { dg-final { scan-assembler "fpsubs16s\t%" } } */
+/* { dg-final { scan-assembler "fpadds32\t%" } } */
+/* { dg-final { scan-assembler "fpadds32s\t%" } } */
+/* { dg-final { scan-assembler "fpsubs32\t%" } } */
+/* { dg-final { scan-assembler "fpsubs32s\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/fpaddsubi.c b/gcc/testsuite/gcc.target/sparc/fpaddsubi.c
new file mode 100644
index 00000000000..a36108e70af
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fpaddsubi.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc -mvis" } */
+typedef int __v2si __attribute__((vector_size(8)));
+typedef int __v1si __attribute__((vector_size(4)));
+typedef short __v4hi __attribute__((vector_size(8)));
+typedef short __v2hi __attribute__((vector_size(4)));
+
+extern __v1si foo_x (void);
+extern __v1si foo_y (void);
+
+__v4hi test_fpadd16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fpadd16 (x, y);
+}
+
+__v2hi test_fpadd16s (__v2hi x, __v2hi y)
+{
+ return __builtin_vis_fpadd16s (x, y);
+}
+
+__v4hi test_fpsub16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fpsub16 (x, y);
+}
+
+__v2hi test_fpsub16s (__v2hi x, __v2hi y)
+{
+ return __builtin_vis_fpsub16s (x, y);
+}
+
+__v2si test_fpadd32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fpadd32 (x, y);
+}
+
+__v1si test_fpadd32s (void)
+{
+ return __builtin_vis_fpadd32s (foo_x (), foo_y ());
+}
+
+__v2si test_fpsub32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fpsub32 (x, y);
+}
+
+__v1si test_fpsub32s (__v1si x, __v1si y)
+{
+ return __builtin_vis_fpsub32s (foo_x (), foo_y ());
+}
+
+/* { dg-final { scan-assembler "fpadd16\t%" } } */
+/* { dg-final { scan-assembler "fpadd16s\t%" } } */
+/* { dg-final { scan-assembler "fpsub16\t%" } } */
+/* { dg-final { scan-assembler "fpsub16s\t%" } } */
+/* { dg-final { scan-assembler "fpadd32\t%" } } */
+/* { dg-final { scan-assembler "fpadd32s\t%" } } */
+/* { dg-final { scan-assembler "fpsub32\t%" } } */
+/* { dg-final { scan-assembler "fpsub32s\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/fshift.c b/gcc/testsuite/gcc.target/sparc/fshift.c
new file mode 100644
index 00000000000..a12df0451cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fshift.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=niagara3 -mvis" } */
+typedef int __v2si __attribute__((vector_size(8)));
+typedef short __v4hi __attribute__((vector_size(8)));
+
+__v4hi test_fsll16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fsll16 (x, y);
+}
+
+__v4hi test_fslas16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fslas16 (x, y);
+}
+
+__v4hi test_fsrl16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fsrl16 (x, y);
+}
+
+__v4hi test_fsra16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fsra16 (x, y);
+}
+
+__v2si test_fsll32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fsll32 (x, y);
+}
+
+__v2si test_fslas32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fslas32 (x, y);
+}
+
+__v2si test_fsrl32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fsrl32 (x, y);
+}
+
+__v2si test_fsra32 (__v2si x, __v2si y)
+{
+ return __builtin_vis_fsra32 (x, y);
+}
+
+/* { dg-final { scan-assembler "fsll16\t%" } } */
+/* { dg-final { scan-assembler "fslas16\t%" } } */
+/* { dg-final { scan-assembler "fsrl16\t%" } } */
+/* { dg-final { scan-assembler "fsra16\t%" } } */
+/* { dg-final { scan-assembler "fsll32\t%" } } */
+/* { dg-final { scan-assembler "fslas32\t%" } } */
+/* { dg-final { scan-assembler "fsrl32\t%" } } */
+/* { dg-final { scan-assembler "fsra32\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/fucmp.c b/gcc/testsuite/gcc.target/sparc/fucmp.c
new file mode 100644
index 00000000000..7f291c3e7ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/fucmp.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=niagara3 -mvis" } */
+typedef unsigned char vec8 __attribute__((vector_size(8)));
+
+long test_fucmple8 (vec8 a, vec8 b)
+{
+ return __builtin_vis_fucmple8 (a, b);
+}
+
+long test_fucmpne8 (vec8 a, vec8 b)
+{
+ return __builtin_vis_fucmpne8 (a, b);
+}
+
+long test_fucmpgt8 (vec8 a, vec8 b)
+{
+ return __builtin_vis_fucmpgt8 (a, b);
+}
+
+long test_fucmpeq8 (vec8 a, vec8 b)
+{
+ return __builtin_vis_fucmpeq8 (a, b);
+}
+
+/* { dg-final { scan-assembler "fucmple8\t%" } } */
+/* { dg-final { scan-assembler "fucmpne8\t%" } } */
+/* { dg-final { scan-assembler "fucmpgt8\t%" } } */
+/* { dg-final { scan-assembler "fucmpeq8\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/rdgsr.c b/gcc/testsuite/gcc.target/sparc/rdgsr.c
new file mode 100644
index 00000000000..e67bdaccded
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/rdgsr.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc -mvis" } */
+
+long get_gsr (void)
+{
+ return __builtin_vis_read_gsr ();
+}
+
+/* { dg-final { scan-assembler "rd\t%gsr" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/vis3misc.c b/gcc/testsuite/gcc.target/sparc/vis3misc.c
new file mode 100644
index 00000000000..8a9535e8fb5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/vis3misc.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-mcpu=niagara3 -mvis" } */
+typedef int __v2si __attribute__((vector_size(8)));
+typedef short __v4hi __attribute__((vector_size(8)));
+typedef unsigned char __v8qi __attribute__((vector_size(8)));
+typedef long long int64_t;
+
+__v4hi test_fchksm16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fchksm16 (x, y);
+}
+
+long test_pdistn (__v8qi x, __v8qi y)
+{
+ return __builtin_vis_pdistn (x, y);
+}
+
+__v4hi test_fmean16 (__v4hi x, __v4hi y)
+{
+ return __builtin_vis_fmean16 (x, y);
+}
+
+int64_t test_fpadd64 (int64_t x, int64_t y)
+{
+ return __builtin_vis_fpadd64 (x, y);
+}
+
+int64_t test_fpsub64 (int64_t x, int64_t y)
+{
+ return __builtin_vis_fpsub64 (x, y);
+}
+
+/* { dg-final { scan-assembler "fchksm16\t%" } } */
+/* { dg-final { scan-assembler "pdistn\t%" } } */
+/* { dg-final { scan-assembler "fmean16\t%" } } */
+/* { dg-final { scan-assembler "fpadd64\t%" } } */
+/* { dg-final { scan-assembler "fpsub64\t%" } } */
diff --git a/gcc/testsuite/gcc.target/sparc/wrgsr.c b/gcc/testsuite/gcc.target/sparc/wrgsr.c
new file mode 100644
index 00000000000..6cfa0603a2a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/wrgsr.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mcpu=ultrasparc -mvis" } */
+
+void set_gsr (void)
+{
+ __builtin_vis_write_gsr (2 << 3);
+}
+
+void set_gsr2 (long x)
+{
+ __builtin_vis_write_gsr (x);
+}
+
+/* { dg-final { scan-assembler "wr\t%g0, 16, %gsr" } } */
+/* { dg-final { scan-assembler "wr\t%g0, %" } } */
diff --git a/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90 b/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90
new file mode 100644
index 00000000000..e9481d8ec8e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/assumed_charlen_arg_2.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR 50585: [4.6/4.7 Regression] ICE with assumed length character array argument
+!
+! Contributed by Stuart Mentzer <sgm@objexx.com>
+
+SUBROUTINE SUB1( str )
+ IMPLICIT NONE
+ CHARACTER(len=*) :: str(2)
+ CALL SUB2( str(1)(:3) )
+END SUBROUTINE
+
+SUBROUTINE SUB2( str )
+ IMPLICIT NONE
+ CHARACTER(*) :: str
+END SUBROUTINE
diff --git a/gcc/testsuite/gfortran.dg/bessel_6.f90 b/gcc/testsuite/gfortran.dg/bessel_6.f90
index eca92cbd756..e0220f7670f 100644
--- a/gcc/testsuite/gfortran.dg/bessel_6.f90
+++ b/gcc/testsuite/gfortran.dg/bessel_6.f90
@@ -12,7 +12,7 @@
implicit none
real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78]
real,parameter :: myeps(size(values)) = epsilon(0.0) &
- * [2, 7, 5, 6, 9, 12, 12, 7, 7, 8, 75, 15 ]
+ * [2, 7, 5, 6, 9, 12, 12, 7, 7, 8, 92, 15 ]
! The following is sufficient for me - the values above are a bit
! more tolerant
! * [0, 5, 3, 4, 6, 7, 7, 5, 5, 6, 66, 4 ]
diff --git a/gcc/testsuite/gfortran.dg/common_15.f90 b/gcc/testsuite/gfortran.dg/common_15.f90
new file mode 100644
index 00000000000..20694fd143b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/common_15.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+!
+! PR 50515: gfortran should not accept an external that is a common (r178939)
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+common/sub/ a ! { dg-error "can not have the EXTERNAL attribute" }
+external sub
+end
diff --git a/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90 b/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90
new file mode 100644
index 00000000000..0133cbf7d1f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR 50517: gfortran must detect that actual argument type is different from dummy argument type (r178939)
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+program main
+
+ type t
+ integer g
+ end type
+
+ type u
+ integer g
+ end type
+
+ type(u), external :: ufunc
+ call sub(ufunc) ! { dg-error "Type/rank mismatch in return value" }
+
+contains
+
+ subroutine sub(tfunc)
+ type(t), external :: tfunc
+ end subroutine
+
+end program
diff --git a/gcc/testsuite/gfortran.dg/impure_actual_1.f90 b/gcc/testsuite/gfortran.dg/impure_actual_1.f90
index 1f22c118069..12f3375bf0a 100644
--- a/gcc/testsuite/gfortran.dg/impure_actual_1.f90
+++ b/gcc/testsuite/gfortran.dg/impure_actual_1.f90
@@ -18,7 +18,7 @@ CONTAINS
END FUNCTION J
END MODULE M1
USE M1
- write(6,*) J(L) ! { dg-error "Expected a PURE procedure for argument" }
+ write(6,*) J(L) ! { dg-error "Mismatch in PURE attribute" }
END
! { dg-final { cleanup-modules "m1" } }
diff --git a/gcc/testsuite/gfortran.dg/interface_26.f90 b/gcc/testsuite/gfortran.dg/interface_26.f90
index c51dbd093c4..54ede6d53eb 100644
--- a/gcc/testsuite/gfortran.dg/interface_26.f90
+++ b/gcc/testsuite/gfortran.dg/interface_26.f90
@@ -37,7 +37,7 @@ CONTAINS
END INTERFACE
INTEGER, EXTERNAL :: UserOp
- res = UserFunction( a,b, UserOp ) ! { dg-error "Type/kind mismatch in return value" }
+ res = UserFunction( a,b, UserOp ) ! { dg-error "Type/rank mismatch in return value" }
if( res .lt. 10 ) then
res = recSum( a, res, UserFunction, UserOp )
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
index 4e8b3c25314..d1c7b4869df 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
@@ -40,11 +40,11 @@ program bsp
p2 => p1
p1 => p2
- p1 => abs ! { dg-error "Type/kind mismatch in return value" }
- p2 => abs ! { dg-error "Type/kind mismatch in return value" }
+ p1 => abs ! { dg-error "Type/rank mismatch in return value" }
+ p2 => abs ! { dg-error "Type/rank mismatch in return value" }
p3 => dsin
- p3 => sin ! { dg-error "Type/kind mismatch in return value" }
+ p3 => sin ! { dg-error "Type/rank mismatch in return value" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_15.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
index 3d37ee2d995..f5a748660e5 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
@@ -19,10 +19,10 @@ p4 => p3
p6 => p1
! invalid
-p1 => iabs ! { dg-error "Type/kind mismatch in return value" }
-p1 => p2 ! { dg-error "Type/kind mismatch in return value" }
-p1 => p5 ! { dg-error "Type/kind mismatch in return value" }
-p6 => iabs ! { dg-error "Type/kind mismatch in return value" }
+p1 => iabs ! { dg-error "Type/rank mismatch in return value" }
+p1 => p2 ! { dg-error "Type/rank mismatch in return value" }
+p1 => p5 ! { dg-error "Type/rank mismatch in return value" }
+p6 => iabs ! { dg-error "Type/rank mismatch in return value" }
p4 => p2 ! { dg-error "is not a subroutine" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_32.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_32.f90
new file mode 100644
index 00000000000..5664ddecd5d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_32.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! PR 41733: Proc-pointer conformance checks: Elemental-proc-ptr => non-elemental-procedure
+!
+! Contributed by James Van Buskirk
+
+ implicit none
+ procedure(my_dcos), pointer :: f
+ f => my_dcos ! { dg-error "invalid in procedure pointer assigment" }
+contains
+ real elemental function my_dcos(x)
+ real, intent(in) :: x
+ my_dcos = cos(x)
+ end function
+end
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_33.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_33.f90
new file mode 100644
index 00000000000..803d90e05ea
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_33.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR 41733: Proc-pointer conformance checks: Elemental-proc-ptr => non-elemental-procedure
+!
+! Contributed by James Van Buskirk
+
+module funcs
+ implicit none
+ abstract interface
+ real elemental function fun(x)
+ real, intent(in) :: x
+ end function
+ end interface
+contains
+ function my_dcos(x)
+ real, intent(in) :: x
+ real :: my_dcos
+ my_dcos = cos(x)
+ end function
+end module
+
+program start
+ use funcs
+ implicit none
+ procedure(fun), pointer :: f
+ real x(3)
+ x = [1,2,3]
+ f => my_dcos ! { dg-error "Mismatch in PURE attribute" }
+ write(*,*) f(x)
+end program start
+
+! { dg-final { cleanup-modules "funcs" } } \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
index 57660c7b70e..e38e6545370 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
@@ -27,11 +27,11 @@ type(t2) :: o2
procedure(logical),pointer :: pp1
procedure(complex),pointer :: pp2
-pp1 => pp2 ! { dg-error "Type/kind mismatch" }
-pp2 => o2%ppc ! { dg-error "Type/kind mismatch" }
+pp1 => pp2 ! { dg-error "Type/rank mismatch" }
+pp2 => o2%ppc ! { dg-error "Type/rank mismatch" }
-o1%ppc => pp1 ! { dg-error "Type/kind mismatch" }
-o1%ppc => o2%ppc ! { dg-error "Type/kind mismatch" }
+o1%ppc => pp1 ! { dg-error "Type/rank mismatch" }
+o1%ppc => o2%ppc ! { dg-error "Type/rank mismatch" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
index 0e60cbb2a81..de035233675 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
@@ -6,7 +6,7 @@
program test
procedure(real), pointer :: p
- p => f() ! { dg-error "Type/kind mismatch in return value" }
+ p => f() ! { dg-error "Type/rank mismatch in return value" }
contains
function f()
pointer :: f
diff --git a/gcc/testsuite/gfortran.dg/pure_formal_proc_3.f90 b/gcc/testsuite/gfortran.dg/pure_formal_proc_3.f90
new file mode 100644
index 00000000000..38d4552801a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pure_formal_proc_3.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR 50547: dummy procedure argument of PURE shall be PURE
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+pure function f(proc)
+ interface
+ function proc() ! { dg-error "must also be PURE" }
+ end
+ end interface
+end
diff --git a/gcc/testsuite/gfortran.dg/stfunc_7.f90 b/gcc/testsuite/gfortran.dg/stfunc_7.f90
new file mode 100644
index 00000000000..1e116462525
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/stfunc_7.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+!
+! PR 50553: statement function cannot be target (r178939)
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+
+f(x)=x
+target f ! { dg-error "attribute conflicts with" }
+end
diff --git a/gcc/testsuite/gfortran.dg/storage_size_2.f08 b/gcc/testsuite/gfortran.dg/storage_size_2.f08
index c18155e72bd..82913c88b14 100644
--- a/gcc/testsuite/gfortran.dg/storage_size_2.f08
+++ b/gcc/testsuite/gfortran.dg/storage_size_2.f08
@@ -14,10 +14,10 @@ integer(4) :: i1
integer(c_int) :: i2
type(t) :: x
-print *,c_sizeof(i1) ! { dg-error "must be be an interoperable data entity" }
+print *,c_sizeof(i1) ! { dg-error "must be an interoperable data entity" }
print *,c_sizeof(i2)
print *,c_sizeof(x)
-print *, c_sizeof(ran()) ! { dg-error "must be be an interoperable data entity" }
+print *, c_sizeof(ran()) ! { dg-error "must be an interoperable data entity" }
print *,storage_size(1.0,4)
print *,storage_size(1.0,3.2) ! { dg-error "must be INTEGER" }
diff --git a/gcc/testsuite/gnat.dg/array17.adb b/gcc/testsuite/gnat.dg/array17.adb
new file mode 100644
index 00000000000..8814ee2dd8d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array17.adb
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+
+with Array17_Pkg; use Array17_Pkg;
+
+procedure Array17 is
+ X : aliased Varray := (1 .. 8 => 1.0);
+ Y : Varray (1 .. 8) := (others => -1.0);
+ R : Varray (1 .. 8);
+begin
+ R (1 .. 4) := Y (1 .. 4) + X (1 .. 4);
+end;
diff --git a/gcc/testsuite/gnat.dg/array17_pkg.ads b/gcc/testsuite/gnat.dg/array17_pkg.ads
new file mode 100644
index 00000000000..11ad79f7463
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/array17_pkg.ads
@@ -0,0 +1,8 @@
+package Array17_Pkg is
+
+ type Varray is array (Integer range <>) of Long_Float;
+ for Varray'Alignment use 16;
+
+ function "+" (X, Y : Varray) return Varray;
+
+end Array17_Pkg;
diff --git a/gcc/testsuite/gnat.dg/frame_overflow.adb b/gcc/testsuite/gnat.dg/frame_overflow.adb
index e1ff4d36533..1e7405fa525 100644
--- a/gcc/testsuite/gnat.dg/frame_overflow.adb
+++ b/gcc/testsuite/gnat.dg/frame_overflow.adb
@@ -1,27 +1,20 @@
-- { dg-do compile }
-with System;
+package body Frame_Overflow is
-procedure frame_overflow is
-
- type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1;
- type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean;
-
- type Bitmap_T is record
- Bits : Bitmap_Array_T := (others => False);
- end record;
-
- function
+ function -- { dg-error "too large" }
Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T
is
- Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" }
+ Result: Bitmap_T := Bitmap;
begin
Result.Bits (Bitpos) := True;
return Result;
end;
- function Negate (Bitmap : Bitmap_T) return Bitmap_T is
- Result: Bitmap_T; -- { dg-error "Storage_Error" }
+ function -- { dg-error "too large" }
+ Negate (Bitmap : Bitmap_T) return Bitmap_T
+ is
+ Result: Bitmap_T;
begin
for E in Bitpos_Range_T loop
Result.Bits (E) := not Bitmap.Bits (E);
@@ -29,6 +22,4 @@ procedure frame_overflow is
return Result;
end;
-begin
- null;
-end;
+end Frame_Overflow;
diff --git a/gcc/testsuite/gnat.dg/frame_overflow.ads b/gcc/testsuite/gnat.dg/frame_overflow.ads
new file mode 100644
index 00000000000..898e37a67d1
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/frame_overflow.ads
@@ -0,0 +1,17 @@
+with System;
+
+package Frame_Overflow is
+
+ type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1;
+ type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean;
+
+ type Bitmap_T is record
+ Bits : Bitmap_Array_T := (others => False);
+ end record;
+
+ function
+ Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T;
+
+ function Negate (Bitmap : Bitmap_T) return Bitmap_T;
+
+end Frame_Overflow;
diff --git a/gcc/testsuite/gnat.dg/opt19.adb b/gcc/testsuite/gnat.dg/opt19.adb
new file mode 100644
index 00000000000..5619da12215
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt19.adb
@@ -0,0 +1,27 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+procedure Opt19 is
+
+ type Enum is (One, Two);
+
+ type Vector_T is array (Enum) of Integer;
+
+ Zero_Vector : constant Vector_T := (Enum => 0);
+
+ type T is record
+ Vector : Vector_T;
+ end record;
+
+ procedure Nested (Value : in out T; E : Enum; B : out Boolean) is
+ I : Integer renames Value.Vector(E);
+ begin
+ B := I /= 0;
+ end;
+
+ Obj : T := (Vector => Zero_Vector);
+ B : Boolean;
+
+begin
+ Nested (Obj, One, B);
+end;
diff --git a/gcc/testsuite/gnat.dg/opt20.adb b/gcc/testsuite/gnat.dg/opt20.adb
new file mode 100644
index 00000000000..6d3e240bab5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt20.adb
@@ -0,0 +1,15 @@
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+
+package body Opt20 is
+
+ type Build_Mode_State is (None, Static, Dynamic, Relocatable);
+
+ procedure Build_Library (For_Project : Integer) is
+ Project_Name : constant String := Get_Name_String (For_Project);
+ The_Build_Mode : Build_Mode_State := None;
+ begin
+ Fail (Project_Name);
+ Write_Str (To_Lower (Build_Mode_State'Image (The_Build_Mode)));
+ end;
+
+end Opt20;
diff --git a/gcc/testsuite/gnat.dg/opt20.ads b/gcc/testsuite/gnat.dg/opt20.ads
new file mode 100644
index 00000000000..58833bfab4b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt20.ads
@@ -0,0 +1,10 @@
+-- { dg-do compile }
+-- { dg-options "-O2 -gnatpn" }
+
+with Opt20_Pkg; use Opt20_Pkg;
+
+package Opt20 is
+
+ procedure Build_Library (For_Project : Integer);
+
+end Opt20;
diff --git a/gcc/testsuite/gnat.dg/opt20_pkg.ads b/gcc/testsuite/gnat.dg/opt20_pkg.ads
new file mode 100644
index 00000000000..2b9b3e8bdf0
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt20_pkg.ads
@@ -0,0 +1,13 @@
+package Opt20_Pkg is
+
+ procedure Write_Str (S : String);
+
+ type Fail_Proc is access procedure (S : String);
+
+ procedure My_Fail (S : String);
+
+ Fail : Fail_Proc := My_Fail'Access;
+
+ function Get_Name_String (Id : Integer) return String;
+
+end Opt20_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt21.adb b/gcc/testsuite/gnat.dg/opt21.adb
new file mode 100644
index 00000000000..c73fe9f228f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt21.adb
@@ -0,0 +1,11 @@
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+with System;
+with Opt21_Pkg; use Opt21_Pkg;
+
+procedure Opt21 is
+ V : System.Address := Convert (null);
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt21_pkg.adb b/gcc/testsuite/gnat.dg/opt21_pkg.adb
new file mode 100644
index 00000000000..3c87321dbff
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt21_pkg.adb
@@ -0,0 +1,17 @@
+package body Opt21_Pkg is
+
+ function Get_Object (Object : not null access R) return System.Address is
+ begin
+ return Object.Ptr;
+ end;
+
+ function Convert (W : Obj) return System.Address is
+ begin
+ if W = null then
+ return System.Null_Address;
+ else
+ return Get_Object (W);
+ end if;
+ end;
+
+end Opt21_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt21_pkg.ads b/gcc/testsuite/gnat.dg/opt21_pkg.ads
new file mode 100644
index 00000000000..251bf847748
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt21_pkg.ads
@@ -0,0 +1,15 @@
+with System;
+
+package Opt21_Pkg is
+
+ type R is record
+ Ptr : System.Address := System.Null_Address;
+ end record;
+
+ type Obj is access all R;
+
+ function Get_Object (Object : not null access R) return System.Address;
+
+ function Convert (W : Obj) return System.Address;
+
+end Opt21_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt22.adb b/gcc/testsuite/gnat.dg/opt22.adb
new file mode 100644
index 00000000000..6ea2440e970
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22.adb
@@ -0,0 +1,20 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Opt22_Pkg; use Opt22_Pkg;
+
+procedure Opt22 is
+
+ procedure Go (S : String) is
+ begin
+ begin
+ Fail;
+ exception
+ when Constraint_Error => Put ("the " & S);
+ end;
+ Put ("the " & S);
+ end;
+
+begin
+ Go ("message");
+end;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.adb b/gcc/testsuite/gnat.dg/opt22_pkg.adb
new file mode 100644
index 00000000000..fa05dfe3a55
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22_pkg.adb
@@ -0,0 +1,15 @@
+package body Opt22_Pkg is
+
+ procedure Fail is
+ begin
+ raise Constraint_Error;
+ end;
+
+ procedure Put (S : String) is
+ begin
+ if S /= "the message" then
+ raise Program_Error;
+ end if;
+ end;
+
+end Opt22_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.ads b/gcc/testsuite/gnat.dg/opt22_pkg.ads
new file mode 100644
index 00000000000..282240946f8
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22_pkg.ads
@@ -0,0 +1,7 @@
+package Opt22_Pkg is
+
+ procedure Fail;
+
+ procedure Put (S : String);
+
+end Opt22_Pkg;
diff --git a/gcc/testsuite/gnat.dg/specs/addr1.ads b/gcc/testsuite/gnat.dg/specs/addr1.ads
index 83d432cff58..ed048f68ef3 100644
--- a/gcc/testsuite/gnat.dg/specs/addr1.ads
+++ b/gcc/testsuite/gnat.dg/specs/addr1.ads
@@ -15,7 +15,7 @@ package Addr1 is
end record;
for Rec2'Size use 64;
- A: Arr (1 .. 12);
+ A: Arr (1 .. 4);
Obj1: Rec1;
for Obj1'Address use A'Address; -- { dg-bogus "alignment" }
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index 5068dd7f63d..10cd151ab93 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -61,13 +61,17 @@ proc errchk { test opts } {
# experimentation, not analysis.
regsub -all "\\.\\*" $out_line "\\\\\[ -~\\\\\]*" out_line
}
+ if [string match "*dg-error*\\\[?\\\]*" $out_line] {
+ set index [string first "dg-error" $out_line]
+ regsub -all "\\\[\(.\)\\\]" $out_line "\\\\\[\\1\\\\\]" out_line
+ }
if [string match "*dg-error*\{*" $out_line] {
set index [string first "dg-error" $out_line]
- regsub -start $index -all "\{" $out_line "\\\\\[\\\{\\\\\]" out_line
+ regsub -start $index -all "\(\[^\\\\]\)\{" $out_line "\\1\\\\\[\\\{\\\\\]" out_line
}
if [string match "*dg-error*\}*\}" $out_line] {
set index [string first "dg-error" $out_line]
- regsub -start $index -all "\}\(.\)" $out_line "\\\\\[\\\}\\\\\]\\1" out_line
+ regsub -start $index -all "\(\[^\\\\]\)\}\(.\)" $out_line "\\1\\\\\[\\\}\\\\\]\\2" out_line
}
if [string match "*dg-error*\(*" $out_line] {
set index [string first "dg-error" $out_line]
@@ -77,9 +81,11 @@ proc errchk { test opts } {
set index [string first "dg-error" $out_line]
regsub -start $index -all "\\\\\\\)\(.\)" $out_line "\\\\\[\\\)\\\\\]\\1" out_line
}
- if [string match "*dg-error*\[.\]*" $out_line] {
+ # Special case for bug332, in which the error message wants to
+ # match the file name, which is not what dg-error expects.
+ if [string match "*dg-error*bug332*" $out_line] {
set index [string first "dg-error" $out_line]
- regsub -all "\\\[\\.\\\]" $out_line "\\\\\[.\\\\\]" out_line
+ regsub -start $index "bug332" $out_line "undefined type" out_line
}
puts $fdout $out_line
}
@@ -258,6 +264,13 @@ proc go-gc-tests { } {
}
}
+ if { [string match "*bug347*" $test] \
+ || [string match "*bug348*" $test] } {
+ # These bugs rely on runtime.Caller which currently fails.
+ untested $name
+ continue
+ }
+
set fd [open $test r]
set lines_ok 1
@@ -451,15 +464,23 @@ proc go-gc-tests { } {
$test_line] \
|| [string match \
"// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \
+ $test_line] \
+ || [string match \
+ "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \
$test_line] } {
if { [string match \
+ "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \
+ $test_line] } {
+ set name1 "bug0.go"
+ set name2 "bug1.go"
+ } elseif { [string match \
"// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \
$test_line] } {
set name1 "p1.go"
set name2 "p2.go"
} else {
- set name1 "bug0.go"
- set name2 "bug1.go"
+ set name1 "b.go"
+ set name2 "a.go"
}
set hold_runtests $runtests
set runtests "go-test.exp"
diff --git a/gcc/testsuite/go.test/test/bench/regex-dna-parallel.go b/gcc/testsuite/go.test/test/bench/regex-dna-parallel.go
index e8e62b806da..1335e4d34fd 100644
--- a/gcc/testsuite/go.test/test/bench/regex-dna-parallel.go
+++ b/gcc/testsuite/go.test/test/bench/regex-dna-parallel.go
@@ -89,7 +89,7 @@ func countMatches(pat string, bytes []byte) int {
func main() {
runtime.GOMAXPROCS(4)
- bytes, err := ioutil.ReadFile("/dev/stdin")
+ bytes, err := ioutil.ReadAll(os.Stdin)
if err != nil {
fmt.Fprintf(os.Stderr, "can't read input: %s\n", err)
os.Exit(2)
diff --git a/gcc/testsuite/go.test/test/bench/regex-dna.go b/gcc/testsuite/go.test/test/bench/regex-dna.go
index dc31db7685a..042d7f28361 100644
--- a/gcc/testsuite/go.test/test/bench/regex-dna.go
+++ b/gcc/testsuite/go.test/test/bench/regex-dna.go
@@ -87,7 +87,7 @@ func countMatches(pat string, bytes []byte) int {
}
func main() {
- bytes, err := ioutil.ReadFile("/dev/stdin")
+ bytes, err := ioutil.ReadAll(os.Stdin)
if err != nil {
fmt.Fprintf(os.Stderr, "can't read input: %s\n", err)
os.Exit(2)
diff --git a/gcc/testsuite/go.test/test/bench/timing.log b/gcc/testsuite/go.test/test/bench/timing.log
index a967f27d223..2541a766b7f 100644
--- a/gcc/testsuite/go.test/test/bench/timing.log
+++ b/gcc/testsuite/go.test/test/bench/timing.log
@@ -674,3 +674,229 @@ threadring 50000000
gcc -O2 threadring.c 30.50u 258.05s 325.72r
gccgo -O2 threadring.go 92.87u 748.39s 728.46r
gc threadring 38.03u 0.01s 38.04r
+
+# Apr 15, 2011
+# Move to new machine, Intel Xeon E5520@2.27GHz.
+# (Was Opteron(tm) Processor 8214 HE)
+
+fasta -n 25000000
+OLD:
+ gcc -O2 fasta.c 3.39u 0.04s 3.42r
+ gccgo -O2 fasta.go 3.52u 0.00s 3.52r
+ gc fasta 3.63u 0.04s 3.67r
+ gc_B fasta 3.66u 0.00s 3.66r
+NEW:
+ gcc -O2 fasta.c 1.45u 0.02s 1.47r
+ gccgo -O2 fasta.go 1.51u 0.01s 1.51r
+ gc fasta 2.04u 0.00s 2.04r
+ gc_B fasta 2.05u 0.00s 2.04r
+
+reverse-complement < output-of-fasta-25000000
+OLD:
+ gcc -O2 reverse-complement.c 1.87u 1.51s 7.02r
+ gccgo -O2 reverse-complement.go 1.56u 0.54s 3.37r
+ gc reverse-complement 1.73u 0.36s 2.08r
+ gc_B reverse-complement 1.75u 0.37s 2.12r
+NEW:
+ gcc -O2 reverse-complement.c 1.20u 0.47s 12.96r
+ gccgo -O2 reverse-complement.go 0.88u 0.14s 1.01r
+ gc reverse-complement 1.13u 0.17s 1.30r
+ gc_B reverse-complement 1.11u 0.09s 1.20r
+
+nbody -n 50000000
+OLD:
+ gcc -O2 -lm nbody.c 21.90u 0.00s 21.92r
+ gccgo -O2 nbody.go 23.12u 0.03s 23.19r
+ gc nbody 29.07u 0.00s 29.07r
+ gc_B nbody 31.84u 0.00s 31.85r
+NEW:
+ gcc -O2 -lm nbody.c 13.01u 0.00s 13.03r
+ gccgo -O2 nbody.go 13.35u 0.00s 13.37r
+ gc nbody 21.78u 0.00s 21.82r
+ gc_B nbody 21.72u 0.00s 21.76r
+
+binary-tree 15 # too slow to use 20
+OLD:
+ gcc -O2 binary-tree.c -lm 0.83u 0.02s 0.84r
+ gccgo -O2 binary-tree.go 2.61u 0.02s 2.62r
+ gccgo -O2 binary-tree-freelist.go 0.32u 0.01s 0.32r
+ gc binary-tree 3.93u 0.04s 3.97r
+ gc binary-tree-freelist 0.47u 0.03s 0.50r
+NEW:
+ gcc -O2 binary-tree.c -lm 0.60u 0.00s 0.59r
+ gccgo -O2 binary-tree.go 1.53u 0.00s 1.52r
+ gccgo -O2 binary-tree-freelist.go 0.01u 0.00s 0.00r
+ gc binary-tree 1.93u 0.02s 1.95r
+ gc binary-tree-freelist 0.32u 0.01s 0.32r
+
+fannkuch 12
+OLD:
+ gcc -O2 fannkuch.c 57.64u 0.00s 57.64r
+ gccgo -O2 fannkuch.go 65.56u 0.01s 65.65r
+ gccgo -O2 fannkuch-parallel.go 179.12u 0.00s 49.82r
+ gc fannkuch 126.39u 0.00s 126.39r
+ gc fannkuch-parallel 172.49u 0.02s 45.44r
+ gc_B fannkuch 89.30u 0.00s 89.28r
+NEW:
+ gcc -O2 fannkuch.c 45.17u 0.00s 45.26r
+ gccgo -O2 fannkuch.go 53.63u 0.00s 53.73r
+ gccgo -O2 fannkuch-parallel.go 216.72u 0.00s 58.42r
+ gc fannkuch 108.21u 0.00s 108.44r
+ gc fannkuch-parallel 227.20u 0.00s 57.27r
+ gc_B fannkuch 56.14u 0.00s 56.26r
+
+regex-dna 100000
+OLD:
+ gcc -O2 regex-dna.c -lpcre 0.77u 0.01s 0.78r
+ gccgo -O2 regex-dna.go 10.15u 0.02s 10.23r
+ gccgo -O2 regex-dna-parallel.go 33.81u 3.22s 11.62r
+ gc regex-dna 6.52u 0.04s 6.56r
+ gc regex-dna-parallel 6.84u 0.03s 2.70r
+ gc_B regex-dna 6.83u 0.01s 6.84r
+NEW:
+ gcc -O2 regex-dna.c -lpcre 0.47u 0.00s 0.47r
+ gccgo -O2 regex-dna.go 6.00u 0.00s 6.00r
+ gccgo -O2 regex-dna-parallel.go 44.54u 1.57s 6.51r
+ gc regex-dna 5.41u 0.01s 5.42r
+ gc regex-dna-parallel 5.62u 0.01s 2.20r
+ gc_B regex-dna 5.50u 0.00s 5.50r
+
+spectral-norm 5500
+OLD:
+ gcc -O2 spectral-norm.c -lm 12.29u 0.00s 12.28r
+ gccgo -O2 spectral-norm.go 11.56u 0.00s 11.55r
+ gc spectral-norm 23.98u 0.00s 24.00r
+ gc_B spectral-norm 24.62u 0.00s 24.65r
+NEW:
+ gcc -O2 spectral-norm.c -lm 15.79u 0.00s 15.82r
+ gccgo -O2 spectral-norm.go 15.32u 0.00s 15.35r
+ gc spectral-norm 19.62u 0.01s 19.67r
+ gc_B spectral-norm 19.62u 0.00s 19.66r
+
+k-nucleotide 1000000
+OLD:
+ gcc -O2 k-nucleotide.c 9.82u 0.06s 9.87r
+ gccgo -O2 k-nucleotide.go 8.30u 0.02s 8.32r
+ gccgo -O2 k-nucleotide-parallel.go 8.84u 0.05s 3.02r
+ gc k-nucleotide 15.38u 0.07s 15.44r
+ gc k-nucleotide-parallel 16.40u 0.03s 5.93r
+ gc_B k-nucleotide 15.19u 0.05s 15.23r
+NEW:
+ gcc -O2 -k-nucleotide.c 4.88u 0.03s 4.92r
+ gccgo -O2 k-nucleotide.go 5.94u 0.01s 5.96r
+ gccgo -O2 k-nucleotide-parallel.go 6.44u 0.03s 1.47r
+ gc k-nucleotide 9.61u 0.01s 9.63r
+ gc k-nucleotide-parallel 9.70u 0.00s 3.39r
+ gc_B k-nucleotide 9.19u 0.03s 9.23r
+
+mandelbrot 16000
+OLD:
+ gcc -O2 mandelbrot.c 54.54u 0.00s 54.56r
+ gccgo -O2 mandelbrot.go 59.63u 0.03s 59.67r
+ gc mandelbrot 64.82u 0.00s 64.83r
+ gc_B mandelbrot 64.84u 0.00s 64.91r
+NEW:
+ gcc -O2 mandelbrot.c 36.07u 0.01s 36.15r
+ gccgo -O2 mandelbrot.go 43.57u 0.00s 43.66r
+ gc mandelbrot 60.66u 0.00s 60.79r
+ gc_B mandelbrot 60.90u 0.00s 61.03r
+
+meteor 2098
+OLD:
+ gcc -O2 meteor-contest.c 0.11u 0.00s 0.10r
+ gccgo -O2 meteor-contest.go 0.10u 0.01s 0.10r
+ gc meteor-contest 0.18u 0.00s 0.17r
+ gc_B meteor-contest 0.17u 0.00s 0.16r
+NEW:
+ gcc -O2 meteor-contest.c 0.10u 0.00s 0.09r
+ gccgo -O2 meteor-contest.go 0.10u 0.00s 0.09r
+ gc meteor-contest 0.14u 0.00s 0.14r
+ gc_B meteor-contest 0.13u 0.00s 0.13r
+
+pidigits 10000
+OLD:
+ gcc -O2 pidigits.c -lgmp 2.22u 0.00s 2.21r
+ gccgo -O2 pidigits.go 13.39u 0.00s 13.40r
+ gc pidigits 6.42u 0.04s 6.45r
+ gc_B pidigits 6.45u 0.02s 6.47r
+NEW:
+ gcc -O2 pidigits.c -lgmp 2.27u 0.00s 2.29r
+ gccgo -O2 pidigits.go 9.21u 0.00s 9.22r
+ gc pidigits 3.60u 0.00s 3.60r
+ gc_B pidigits 3.56u 0.02s 3.58r
+
+threadring 50000000
+OLD:
+ gcc -O2 threadring.c -lpthread 34.51u 267.95s 336.12r
+ gccgo -O2 threadring.go 103.51u 588.57s 627.16r
+ gc threadring 54.68u 0.00s 54.73r
+NEW:
+ gcc -O2 threadring.c 32.00u 259.39s 369.74r
+ gccgo -O2 threadring.go 133.06u 546.02s 595.33r
+ gc threadring 16.75u 0.02s 16.80r
+
+chameneos 6000000
+OLD:
+ gcc -O2 chameneosredux.c -lpthread 12.65u 31.02s 13.33r
+ gccgo -O2 chameneosredux.go 47.04u 302.84s 252.29r
+ gc chameneosredux 14.14u 0.00s 14.14r
+NEW:
+ gcc -O2 chameneosredux.c -lpthread 8.05u 63.43s 11.16r
+ gccgo -O2 chameneosredux.go 82.95u 304.37s 207.64r
+ gc chameneosredux 9.42u 0.00s 9.43r
+
+# May 13, 2011
+# after gc update to inline append when possible - 35% faster
+
+regex-dna 100000
+ gc regex-dna 3.94u 0.00s 3.95r
+ gc regex-dna-parallel 4.15u 0.01s 1.63r
+ gc_B regex-dna 4.01u 0.01s 4.02r
+
+# Aug 4, 2011
+# After various updates to locking code and some runtime changes.
+# Slowdowns believed due to slower (but more correct) memmove.
+
+fannkuch 12
+ gccgo -O2 fannkuch.go 51.59u 0.00s 51.69r # -4%
+ gccgo -O2 fannkuch-parallel.go 253.17u 0.00s 64.67r # -11%
+ gc fannkuch 103.14u 0.00s 103.36r # -5%
+ gc fannkuch-parallel 189.63u 0.00s 49.37r # +9%
+ gc_B fannkuch 49.19u 0.00s 49.29r # -14%
+
+regex-dna 100000
+ gc regex-dna 3.78u 0.00s 3.78r # -43%
+ gc regex-dna-parallel 3.84u 0.02s 1.48r # -49%
+ gc_B regex-dna 3.62u 0.00s 3.63r # -52%
+
+k-nucleotide 1000000
+ gc k-nucleotide 12.23u 0.02s 12.27r # +27%
+ gc k-nucleotide-parallel 12.76u 0.02s 4.37r # +29%
+ gc_B k-nucleotide 12.18u 0.01s 12.21r # +33%
+
+threadring 50000000
+ gc threadring 17.49u 0.00s 17.53r # +4%
+
+chameneos 6000000
+ gc chameneosredux 7.61u 0.00s 7.63r # -24%
+
+Aug 9, 2011
+# After custom algorithms for 1- 2- 4- 8-byte scalars.
+
+fannkuch 12
+ gc fannkuch-parallel 157.17u 0.00s 41.08r # -17%
+
+k-nucleotide 1000000
+ gc k-nucleotide 8.72u 0.03s 8.76r # -39%
+ gc k-nucleotide-parallel 8.79u 0.01s 3.14r # -39%
+ gc_B k-nucleotide 8.65u 0.03s 8.69r # -39%
+
+pidigits 10000
+ gc pidigits 3.71u 0.02s 3.73r # +4%
+ gc_B pidigits 3.73u 0.00s 3.73r # +4%
+
+threadring 50000000
+ gc threadring 14.51u 0.00s 14.54r # -17%
+
+chameneos 6000000
+ gc chameneosredux 7.41u 0.00s 7.42r # -3%
diff --git a/gcc/testsuite/go.test/test/chan/select6.go b/gcc/testsuite/go.test/test/chan/select6.go
new file mode 100644
index 00000000000..2ba6810ac34
--- /dev/null
+++ b/gcc/testsuite/go.test/test/chan/select6.go
@@ -0,0 +1,34 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2075
+// A bug in select corrupts channel queues of failed cases
+// if there are multiple waiters on those channels and the
+// select is the last in the queue. If further waits are made
+// on the channel without draining it first then those waiters
+// will never wake up. In the code below c1 is such a channel.
+
+package main
+
+func main() {
+ c1 := make(chan bool)
+ c2 := make(chan bool)
+ c3 := make(chan bool)
+ go func() { <-c1 }()
+ go func() {
+ select {
+ case <-c1:
+ panic("dummy")
+ case <-c2:
+ c3 <- true
+ }
+ <-c1
+ }()
+ go func() { c2 <- true }()
+ <-c3
+ c1 <- true
+ c1 <- true
+}
diff --git a/gcc/testsuite/go.test/test/chan/zerosize.go b/gcc/testsuite/go.test/test/chan/zerosize.go
new file mode 100644
index 00000000000..617c9dab341
--- /dev/null
+++ b/gcc/testsuite/go.test/test/chan/zerosize.go
@@ -0,0 +1,16 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Making channels of a zero-sized type should not panic.
+
+package main
+
+func main() {
+ _ = make(chan [0]byte)
+ _ = make(chan [0]byte, 1)
+ _ = make(chan struct{})
+ _ = make(chan struct{}, 1)
+}
diff --git a/gcc/testsuite/go.test/test/declbad.go b/gcc/testsuite/go.test/test/declbad.go
index 5e5e1450110..09f1dfb576f 100644
--- a/gcc/testsuite/go.test/test/declbad.go
+++ b/gcc/testsuite/go.test/test/declbad.go
@@ -40,7 +40,7 @@ func main() {
{
// single redeclaration
i, f, s := f3()
- i := f1() // ERROR "redeclared|no new|incompatible"
+ i := 1 // ERROR "redeclared|no new|incompatible"
_, _, _ = i, f, s
}
// double redeclaration
diff --git a/gcc/testsuite/go.test/test/divide.go b/gcc/testsuite/go.test/test/divide.go
new file mode 100644
index 00000000000..5c0f45059a2
--- /dev/null
+++ b/gcc/testsuite/go.test/test/divide.go
@@ -0,0 +1,54 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// divide corner cases
+
+package main
+
+import "fmt"
+
+func f8(x, y, q, r int8) {
+ if t := x / y; t != q {
+ fmt.Printf("%d/%d = %d, want %d\n", x, y, t, q)
+ }
+ if t := x % y; t != r {
+ fmt.Printf("%d%%%d = %d, want %d\n", x, y, t, r)
+ }
+}
+
+func f16(x, y, q, r int16) {
+ if t := x / y; t != q {
+ fmt.Printf("%d/%d = %d, want %d\n", x, y, t, q)
+ }
+ if t := x % y; t != r {
+ fmt.Printf("%d%%%d = %d, want %d\n", x, y, t, r)
+ }
+}
+
+func f32(x, y, q, r int32) {
+ if t := x / y; t != q {
+ fmt.Printf("%d/%d = %d, want %d\n", x, y, t, q)
+ }
+ if t := x % y; t != r {
+ fmt.Printf("%d%%%d = %d, want %d\n", x, y, t, r)
+ }
+}
+
+func f64(x, y, q, r int64) {
+ if t := x / y; t != q {
+ fmt.Printf("%d/%d = %d, want %d\n", x, y, t, q)
+ }
+ if t := x % y; t != r {
+ fmt.Printf("%d%%%d = %d, want %d\n", x, y, t, r)
+ }
+}
+
+func main() {
+ f8(-1<<7, -1, -1<<7, 0)
+ f16(-1<<15, -1, -1<<15, 0)
+ f32(-1<<31, -1, -1<<31, 0)
+ f64(-1<<63, -1, -1<<63, 0)
+}
diff --git a/gcc/testsuite/go.test/test/errchk b/gcc/testsuite/go.test/test/errchk
index fbb021ce417..6b00570bdec 100755
--- a/gcc/testsuite/go.test/test/errchk
+++ b/gcc/testsuite/go.test/test/errchk
@@ -17,6 +17,13 @@
use POSIX;
+my $exitcode = 1;
+
+if(@ARGV >= 1 && $ARGV[0] eq "-0") {
+ $exitcode = 0;
+ shift;
+}
+
if(@ARGV < 1) {
print STDERR "Usage: errchk COMPILER [OPTS] SOURCEFILES\n";
exit 1;
@@ -47,12 +54,18 @@ $out = join('', <CMD>);
close CMD;
-if($? == 0) {
+if($exitcode != 0 && $? == 0) {
print STDERR "BUG: errchk: command succeeded unexpectedly\n";
print STDERR @out;
exit 0;
}
+if($exitcode == 0 && $? != 0) {
+ print STDERR "BUG: errchk: command failed unexpectedly\n";
+ print STDERR @out;
+ exit 0;
+}
+
if(!WIFEXITED($?)) {
print STDERR "BUG: errchk: compiler crashed\n";
print STDERR @out, "\n";
@@ -75,25 +88,46 @@ sub chk {
$line++;
next if $src =~ m|////|; # double comment disables ERROR
next unless $src =~ m|// (GC_)?ERROR (.*)|;
- $regexp = $2;
- if($regexp !~ /^"([^"]*)"/) {
+ my $all = $2;
+ if($all !~ /^"([^"]*)"/) {
print STDERR "$file:$line: malformed regexp\n";
next;
}
- $regexp = $1;
-
@errmsg = grep { /$file:$line[:[]/ } @out;
@out = grep { !/$file:$line[:[]/ } @out;
if(@errmsg == 0) {
bug();
- print STDERR "errchk: $file:$line: missing expected error: '$regexp'\n";
+ print STDERR "errchk: $file:$line: missing expected error: '$all'\n";
next;
}
- @match = grep { /$regexp/ } @errmsg;
- if(@match == 0) {
+ foreach my $regexp ($all =~ /"([^"]*)"/g) {
+ # Turn relative line number in message into absolute line number.
+ if($regexp =~ /LINE(([+-])([0-9]+))?/) {
+ my $n = $line;
+ if(defined($1)) {
+ if($2 eq "+") {
+ $n += int($3);
+ } else {
+ $n -= int($3);
+ }
+ }
+ $regexp = "$`$file:$n$'";
+ }
+
+ @match = grep { /$regexp/ } @errmsg;
+ if(@match == 0) {
+ bug();
+ print STDERR "errchk: $file:$line: error messages do not match '$regexp'\n";
+ next;
+ }
+ @errmsg = grep { !/$regexp/ } @errmsg;
+ }
+ if(@errmsg != 0) {
bug();
- print STDERR "errchk: $file:$line: error message does not match '$regexp'\n";
- next;
+ print STDERR "errchk: $file:$line: unmatched error messages:\n";
+ foreach my $l (@errmsg) {
+ print STDERR "> $l";
+ }
}
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug140.go b/gcc/testsuite/go.test/test/fixedbugs/bug140.go
index e27b370e760..441c57a4855 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug140.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug140.go
@@ -10,14 +10,14 @@ func main() {
if true {
} else {
L1:
+ goto L1
}
if true {
} else {
+ goto L2
L2:
main()
}
- goto L1
- goto L2
}
/*
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug178.go b/gcc/testsuite/go.test/test/fixedbugs/bug178.go
index 20596102441..a7ff09daeed 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug178.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug178.go
@@ -14,6 +14,9 @@ L:
break L
}
panic("BUG: not reached - break")
+ if false {
+ goto L1
+ }
}
L2:
@@ -23,11 +26,8 @@ L2:
continue L2
}
panic("BUG: not reached - continue")
- }
- if false {
- goto L1
- }
- if false {
- goto L3
+ if false {
+ goto L3
+ }
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug205.go b/gcc/testsuite/go.test/test/fixedbugs/bug205.go
index 4262ec10dce..e12be72f925 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug205.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug205.go
@@ -12,7 +12,7 @@ var m map[string]int;
func main() {
println(t["hi"]); // ERROR "integer"
- println(s["hi"]); // ERROR "integer"
+ println(s["hi"]); // ERROR "integer" "to type uint"
println(m[0]); // ERROR "map index"
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug228.go b/gcc/testsuite/go.test/test/fixedbugs/bug228.go
index 81bc908569e..da335dbc05a 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug228.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug228.go
@@ -8,7 +8,7 @@ package main
func f(x int, y ...int) // ok
-func g(x int, y float) (...) // ERROR "[.][.][.]"
+func g(x int, y float) (...) // ERROR "[.][.][.]" "final argument"
func h(x, y ...int) // ERROR "[.][.][.]"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug229.go b/gcc/testsuite/go.test/test/fixedbugs/bug229.go
index fe0f0d8c755..6c9de9ba93e 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug229.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug229.go
@@ -16,5 +16,5 @@ func main() {
t.ch = nil // ERROR "unexported"
- println(testing.anyLowercaseName("asdf")) // ERROR "unexported"
+ println(testing.anyLowercaseName("asdf")) // ERROR "unexported" "undefined: testing.anyLowercaseName"
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug231.go b/gcc/testsuite/go.test/test/fixedbugs/bug231.go
index 91996d313c8..9500e582bbe 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug231.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug231.go
@@ -17,6 +17,6 @@ func main() {
var i I
i = m
- i = t // ERROR "not a method|has no methods"
+ i = t // ERROR "not a method|has no methods" "does not implement I"
_ = i
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug238.go b/gcc/testsuite/go.test/test/fixedbugs/bug238.go
index 7e8660d37e4..4d5a905f054 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug238.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug238.go
@@ -19,4 +19,3 @@ const h bool = false
const i int = 2
const j float64 = 5
-func main() { println(a, b, c, d, e, f, g) }
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug273.go b/gcc/testsuite/go.test/test/fixedbugs/bug273.go
index 816f69e8f13..dd5aaa7b8af 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug273.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug273.go
@@ -47,15 +47,6 @@ func bigcap() {
g1 = make([]int, 10, big)
}
-const (
- addrBits = 8*uint(unsafe.Sizeof((*byte)(nil)))
- sh = addrBits/2 - 2
-)
-var g2 [][1<<sh][1<<sh]byte
-func overflow() {
- g2 = make([][1<<sh][1<<sh]byte, 64)
-}
-
var g3 map[int]int
func badmapcap() {
g3 = make(map[int]int, minus1)
@@ -74,6 +65,8 @@ func bigchancap() {
g4 = make(chan int, big)
}
+const addrBits = unsafe.Sizeof((*byte)(nil))
+
var g5 chan [1<<15]byte
func overflowchan() {
if addrBits == 32 {
@@ -92,7 +85,6 @@ func main() {
shouldfail(badcap, "badcap")
shouldfail(badcap1, "badcap1")
shouldfail(bigcap, "bigcap")
- shouldfail(overflow, "overflow")
shouldfail(badmapcap, "badmapcap")
shouldfail(bigmapcap, "bigmapcap")
shouldfail(badchancap, "badchancap")
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug274.go b/gcc/testsuite/go.test/test/fixedbugs/bug274.go
index 348aed429e9..198544c3f54 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug274.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug274.go
@@ -25,6 +25,7 @@ func main() {
L1: // ERROR "statement"
default:
// correct since no semicolon is required before a '}'
- L2: // GCCGO_ERROR "not used"
+ goto L2
+ L2:
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug297.go b/gcc/testsuite/go.test/test/fixedbugs/bug297.go
index ba029427f24..8767cdfea54 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug297.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug297.go
@@ -11,5 +11,5 @@ package main
type ByteSize float64
const (
_ = iota; // ignore first value by assigning to blank identifier
- KB ByteSize = 1<<(10*X) // ERROR "undefined"
+ KB ByteSize = 1<<(10*X) // ERROR "undefined" "as type ByteSize"
)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug298.go b/gcc/testsuite/go.test/test/fixedbugs/bug298.go
index fe4a99a780e..c16c3f98af1 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug298.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug298.go
@@ -7,5 +7,5 @@
package ddd
func Sum() int
- for i := range []int{} { return i } // ERROR "return outside function|expected"
+ for i := range []int{} { return i } // ERROR "statement outside function|expected"
diff --git a/gcc/testsuite/go.test/test/bugs/bug322.dir/lib.go b/gcc/testsuite/go.test/test/fixedbugs/bug322.dir/lib.go
index 0de56d3d649..0de56d3d649 100644
--- a/gcc/testsuite/go.test/test/bugs/bug322.dir/lib.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug322.dir/lib.go
diff --git a/gcc/testsuite/go.test/test/bugs/bug322.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug322.dir/main.go
index 0ab5b32e453..f403c7d32e2 100644
--- a/gcc/testsuite/go.test/test/bugs/bug322.dir/main.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug322.dir/main.go
@@ -38,10 +38,3 @@ func main() {
var pi2 PI = pt
pi2.PM()
}
-
-/*
-These should not be errors anymore:
-
-bug322.dir/main.go:19: implicit assignment of unexported field 'x' of lib.T in method receiver
-bug322.dir/main.go:32: implicit assignment of unexported field 'x' of lib.T in method receiver
-*/
diff --git a/gcc/testsuite/go.test/test/bugs/bug322.go b/gcc/testsuite/go.test/test/fixedbugs/bug322.go
index ad0e62dc8c9..ad0e62dc8c9 100644
--- a/gcc/testsuite/go.test/test/bugs/bug322.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug322.go
diff --git a/gcc/testsuite/go.test/test/bugs/bug324.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug324.dir/main.go
index 4c1a18d9ca2..3ab61f3eb5e 100644
--- a/gcc/testsuite/go.test/test/bugs/bug324.dir/main.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug324.dir/main.go
@@ -14,7 +14,7 @@ type Exported interface {
type Implementation struct{}
-func (p *Implementation) private() { println("main.Implementation.private()") }
+func (p *Implementation) private() {}
func main() {
@@ -40,7 +40,12 @@ func main() {
// x = px
// this assignment unexpectedly compiles and then executes
+ defer func() {
+ recover()
+ }()
x = px.(Exported)
+
+ println("should not get this far")
// this is a legitimate call, but because of the previous assignment,
// it invokes the method private in p!
diff --git a/gcc/testsuite/go.test/test/bugs/bug324.dir/p.go b/gcc/testsuite/go.test/test/fixedbugs/bug324.dir/p.go
index d1e3b991aad..d1e3b991aad 100644
--- a/gcc/testsuite/go.test/test/bugs/bug324.dir/p.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug324.dir/p.go
diff --git a/gcc/testsuite/go.test/test/bugs/bug324.go b/gcc/testsuite/go.test/test/fixedbugs/bug324.go
index e188515d772..3da75630acf 100644
--- a/gcc/testsuite/go.test/test/bugs/bug324.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug324.go
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ! ./$A.out || echo BUG: should fail
+// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug327.go b/gcc/testsuite/go.test/test/fixedbugs/bug327.go
new file mode 100644
index 00000000000..4ba5f6072e8
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug327.go
@@ -0,0 +1,24 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Conversion between identical interfaces.
+// Issue 1647.
+
+// The compiler used to not realize this was a no-op,
+// so it generated a call to the non-existent function runtime.convE2E.
+
+package main
+
+type (
+ a interface{}
+ b interface{}
+)
+
+func main() {
+ x := a(1)
+ z := b(x)
+ _ = z
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug328.go b/gcc/testsuite/go.test/test/fixedbugs/bug328.go
new file mode 100644
index 00000000000..64041f41290
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug328.go
@@ -0,0 +1,14 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "unsafe"
+
+func main() {
+ var p unsafe.Pointer
+ println(p)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug329.go b/gcc/testsuite/go.test/test/fixedbugs/bug329.go
new file mode 100644
index 00000000000..0b7074d62ba
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug329.go
@@ -0,0 +1,46 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type Value struct {
+ X interface{}
+ Y int
+}
+
+type Struct struct {
+ X complex128
+}
+
+const magic = 1 + 2i
+
+func (Value) Complex(x complex128) {
+ if x != magic {
+ println(x)
+ panic("bad complex magic")
+ }
+}
+
+func f(x *byte, y, z int) complex128 {
+ return magic
+}
+
+func (Value) Struct(x Struct) {
+ if x.X != magic {
+ println(x.X)
+ panic("bad struct magic")
+ }
+}
+
+func f1(x *byte, y, z int) Struct {
+ return Struct{magic}
+}
+
+func main() {
+ var v Value
+ v.Struct(f1(nil, 0, 0)) // ok
+ v.Complex(f(nil, 0, 0)) // used to fail
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug330.go b/gcc/testsuite/go.test/test/fixedbugs/bug330.go
new file mode 100644
index 00000000000..114492aff80
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug330.go
@@ -0,0 +1,13 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func main() {
+ x := ""
+ x = +"hello" // ERROR "invalid operation.*string|expected numeric"
+ x = +x // ERROR "invalid operation.*string|expected numeric"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug331.go b/gcc/testsuite/go.test/test/fixedbugs/bug331.go
new file mode 100644
index 00000000000..28aee1da07f
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug331.go
@@ -0,0 +1,36 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug331
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "os"
+
+func f() (_ string, x float64, err os.Error) {
+ return
+}
+
+func g() (_ string, x float64, err os.Error) {
+ return "hello", 3.14, os.EOF
+}
+
+var _ func() (string, float64, os.Error) = f
+var _ func() (string, float64, os.Error) = g
+
+func main() {
+ x, y, z := g()
+ if x != "hello" || y != 3.14 || z != os.EOF {
+ println("wrong", x, len(x), y, z)
+ }
+}
+
+/*
+issue 1712
+
+bug331.go:12: cannot use "hello" (type string) as type float64 in assignment
+bug331.go:12: cannot use 0 (type float64) as type os.Error in assignment:
+ float64 does not implement os.Error (missing String method)
+bug331.go:12: error in shape across RETURN
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug332.go b/gcc/testsuite/go.test/test/fixedbugs/bug332.go
new file mode 100644
index 00000000000..be79286b819
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug332.go
@@ -0,0 +1,17 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// type T int
+
+func main() {}
+
+// issue 1474
+
+// important: no newline on end of next line.
+// 6g used to print <epoch> instead of bug332.go:111
+func (t *T) F() {} // ERROR "bug332" \ No newline at end of file
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug333.go b/gcc/testsuite/go.test/test/fixedbugs/bug333.go
new file mode 100644
index 00000000000..515c1f3fabd
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug333.go
@@ -0,0 +1,19 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1709
+
+package main
+
+func main() {
+ type Ts string
+ var ts Ts
+ _ = []byte(ts)
+}
+
+/*
+bug333.go:14: cannot use ts (type Ts) as type string in function argument
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug334.go b/gcc/testsuite/go.test/test/fixedbugs/bug334.go
new file mode 100644
index 00000000000..870c9ae24fb
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug334.go
@@ -0,0 +1,31 @@
+// $G $D/$F.go || echo BUG: bug334
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1716
+
+package main
+
+type (
+ cplx64 complex64
+ cplx128 complex128
+)
+
+func (c cplx64) Foo() {}
+func (c cplx128) Foo() {}
+
+func main() {
+ var c64 cplx128
+ var c128 cplx64
+ c64.Foo()
+ c128.Foo()
+}
+
+/*
+bug334.go:16: invalid receiver type cplx64
+bug334.go:17: invalid receiver type cplx128
+bug334.go:22: c64.Foo undefined (type cplx128 has no field or method Foo)
+bug334.go:23: c128.Foo undefined (type cplx64 has no field or method Foo)
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go
new file mode 100644
index 00000000000..5a8112a9de3
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go
@@ -0,0 +1,9 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+import "./b"
+
+var Bar = b.Foo
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go
new file mode 100644
index 00000000000..7428c2a918a
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go
@@ -0,0 +1,11 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package b
+
+type T interface{}
+
+func f() T { return nil }
+
+var Foo T = f()
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.go
new file mode 100644
index 00000000000..915b746578c
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.go
@@ -0,0 +1,10 @@
+// $G $D/$F.dir/b.go && $G $D/$F.dir/a.go
+// rm -f a.$A b.$A
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1705.
+
+unused (see script at top of file)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug336.go b/gcc/testsuite/go.test/test/fixedbugs/bug336.go
new file mode 100644
index 00000000000..8de36898f8c
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug336.go
@@ -0,0 +1,86 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T1 struct {
+ Next *T2
+}
+
+type T2 T1
+
+type T3 struct {
+ Next *T4
+}
+
+type T4 T5
+type T5 T6
+type T6 T7
+type T7 T8
+type T8 T9
+type T9 T3
+
+type T10 struct {
+ x struct {
+ y ***struct {
+ z *struct {
+ Next *T11
+ }
+ }
+ }
+}
+
+type T11 T10
+
+type T12 struct {
+ F1 *T15
+ F2 *T13
+ F3 *T16
+}
+
+type T13 T14
+type T14 T15
+type T15 T16
+type T16 T17
+type T17 T12
+
+// issue 1672
+type T18 *[10]T19
+type T19 T18
+
+func main() {
+ _ = &T1{&T2{}}
+ _ = &T2{&T2{}}
+ _ = &T3{&T4{}}
+ _ = &T4{&T4{}}
+ _ = &T5{&T4{}}
+ _ = &T6{&T4{}}
+ _ = &T7{&T4{}}
+ _ = &T8{&T4{}}
+ _ = &T9{&T4{}}
+ _ = &T12{&T15{}, &T13{}, &T16{}}
+
+ var (
+ tn struct{ Next *T11 }
+ tz struct{ z *struct{ Next *T11 } }
+ tpz *struct{ z *struct{ Next *T11 } }
+ tppz **struct{ z *struct{ Next *T11 } }
+ tpppz ***struct{ z *struct{ Next *T11 } }
+ ty struct {
+ y ***struct{ z *struct{ Next *T11 } }
+ }
+ )
+ tn.Next = &T11{}
+ tz.z = &tn
+ tpz = &tz
+ tppz = &tpz
+ tpppz = &tppz
+ ty.y = tpppz
+ _ = &T10{ty}
+
+ t19s := &[10]T19{}
+ _ = T18(t19s)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug337.go b/gcc/testsuite/go.test/test/fixedbugs/bug337.go
new file mode 100644
index 00000000000..ca9b4b45369
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug337.go
@@ -0,0 +1,19 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1722.
+
+// Check that the error messages says
+// bug337.go:16: len("foo") not used
+// and not
+// bug337.go:16: 3 not used
+
+package main
+
+func main() {
+ len("foo") // ERROR "len|value computed is not used"
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug338.go b/gcc/testsuite/go.test/test/fixedbugs/bug338.go
new file mode 100644
index 00000000000..c368a7fadc5
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug338.go
@@ -0,0 +1,22 @@
+// $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1787.
+
+package main
+
+import "unsafe"
+
+const x = unsafe.Sizeof([8]byte{})
+
+func main() {
+ var b [x]int
+ _ = b
+}
+
+/*
+bug338.go:14: array bound must be non-negative
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug339.go b/gcc/testsuite/go.test/test/fixedbugs/bug339.go
new file mode 100644
index 00000000000..eac7c5ee623
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug339.go
@@ -0,0 +1,20 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1608.
+// Size used to be -1000000000.
+
+package main
+
+import "unsafe"
+
+func main() {
+ var a interface{} = 0
+ size := unsafe.Sizeof(a)
+ if size != 2*unsafe.Sizeof((*int)(nil)) {
+ println("wrong size: ", size)
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug340.go b/gcc/testsuite/go.test/test/fixedbugs/bug340.go
new file mode 100644
index 00000000000..af72513e328
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug340.go
@@ -0,0 +1,17 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1606.
+
+package main
+
+func main() {
+ var x interface{}
+ switch t := x.(type) { // GC_ERROR "0 is not a type"
+ case 0: // GCCGO_ERROR "expected type"
+ t.x = 1 // ERROR "type interface \{ \}|reference to undefined field or method"
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug341.go b/gcc/testsuite/go.test/test/fixedbugs/bug341.go
new file mode 100644
index 00000000000..8ee52e1ef05
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug341.go
@@ -0,0 +1,22 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug341
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Used to panic because 8g was generating incorrect
+// code for converting a negative float to a uint64.
+
+package main
+
+func main() {
+ var x float32 = -2.5
+
+ _ = uint64(x)
+ _ = float32(0)
+}
+/*
+panic: runtime error: floating point error
+
+[signal 0x8 code=0x6 addr=0x8048c64 pc=0x8048c64]
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug342.go b/gcc/testsuite/go.test/test/fixedbugs/bug342.go
new file mode 100644
index 00000000000..0852cdd3483
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug342.go
@@ -0,0 +1,24 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1871.
+
+package p
+
+type a interface {
+ foo(x int) (x int) // ERROR "redeclared|redefinition"
+}
+
+var b interface {
+ bar(y int) (y int) // ERROR "redeclared|redefinition"
+}
+
+/*
+Previously:
+
+bug.go:1 x redclared in this block
+ previous declaration at bug.go:1
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug343.go b/gcc/testsuite/go.test/test/fixedbugs/bug343.go
new file mode 100644
index 00000000000..efc87e3d7a5
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug343.go
@@ -0,0 +1,33 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug343
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1900
+
+package main
+
+func getArgs(data map[string]interface{}, keys ...string) map[string]string {
+ ret := map[string]string{}
+ var ok bool
+ for _, k := range keys {
+ ret[k], ok = data[k].(string)
+ if !ok {}
+ }
+ return ret
+}
+
+func main() {
+ x := getArgs(map[string]interface{}{"x":"y"}, "x")
+ if x["x"] != "y" {
+ println("BUG bug343", x)
+ }
+}
+
+
+/*
+typecheck [1008592b0]
+. INDREG a(1) l(15) x(24) tc(2) runtime.ret G0 string
+bug343.go:15: internal compiler error: typecheck INDREG
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug344.go b/gcc/testsuite/go.test/test/fixedbugs/bug344.go
new file mode 100644
index 00000000000..ce953f7f2f7
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug344.go
@@ -0,0 +1,24 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+func main() {
+ // invalid use of goto.
+ // do whatever you like, just don't crash.
+ i := 42
+ a := []*int{&i, &i, &i, &i}
+ x := a[0]
+ goto start // ERROR "jumps into block"
+ z := 1
+ _ = z
+ for _, x = range a { // GCCGO_ERROR "block"
+ start:
+ fmt.Sprint(*x)
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/io.go b/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/io.go
new file mode 100644
index 00000000000..1d695c30458
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/io.go
@@ -0,0 +1,15 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package io
+
+type Writer interface {
+ WrongWrite()
+}
+
+type SectionReader struct {
+ X int
+}
+
+func SR(*SectionReader) {}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/main.go
new file mode 100644
index 00000000000..5bdc713f4e0
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug345.dir/main.go
@@ -0,0 +1,28 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "bufio"
+ "./io"
+ goio "io"
+)
+
+func main() {
+ // The errors here complain that io.X != io.X
+ // for different values of io so they should be
+ // showing the full import path, which for the
+ // "./io" import is really ..../go/test/io.
+ // For example:
+ //
+ // main.go:25: cannot use w (type "/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".Writer) as type "io".Writer in function argument:
+ // io.Writer does not implement io.Writer (missing Write method)
+ // main.go:27: cannot use &x (type *"io".SectionReader) as type *"/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".SectionReader in function argument
+
+ var w io.Writer
+ bufio.NewWriter(w) // ERROR "test/io"
+ var x goio.SectionReader
+ io.SR(&x) // ERROR "test/io"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug345.go b/gcc/testsuite/go.test/test/fixedbugs/bug345.go
new file mode 100644
index 00000000000..874710ce88a
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug345.go
@@ -0,0 +1,7 @@
+// $G $D/$F.dir/io.go && errchk $G -e $D/$F.dir/main.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug346.go b/gcc/testsuite/go.test/test/fixedbugs/bug346.go
new file mode 100644
index 00000000000..31284c31a1d
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug346.go
@@ -0,0 +1,19 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: issue2056
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "os"
+
+func main() {
+ x := 4
+ a, b, c, d := func(i int) (p int, q int, r int, s int) { return 1, i, 3, x }(2)
+
+ if a != 1 || b != 2 || c != 3 || d != 4 {
+ println("abcd: expected 1 2 3 4 got", a, b, c, d)
+ os.Exit(1)
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug347.go b/gcc/testsuite/go.test/test/fixedbugs/bug347.go
new file mode 100644
index 00000000000..5532cee8310
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug347.go
@@ -0,0 +1,49 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "runtime"
+ "strings"
+)
+
+var t *struct {
+ c chan int
+}
+
+var c chan int
+
+func f() {
+ select {
+ case <-t.c: // THIS IS LINE 22
+ break
+ case <-c:
+ break
+ }
+}
+
+func main() {
+ defer func() {
+ recover()
+ for i := 0;; i++ {
+ pc, file, line, ok := runtime.Caller(i)
+ if !ok {
+ print("BUG: bug347: cannot find caller\n")
+ return
+ }
+ if !strings.Contains(file, "bug347.go") || runtime.FuncForPC(pc).Name() != "main.f" {
+ // walk past runtime frames
+ continue
+ }
+ if line != 22 {
+ print("BUG: bug347: panic at ", file, ":", line, " in ", runtime.FuncForPC(pc).Name(), "\n")
+ }
+ return
+ }
+ }()
+ f()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug348.go b/gcc/testsuite/go.test/test/fixedbugs/bug348.go
new file mode 100644
index 00000000000..1a539aa3e47
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug348.go
@@ -0,0 +1,46 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "runtime"
+ "strings"
+)
+
+func f() {
+ var x *string
+
+ for _, i := range *x { // THIS IS LINE 17
+ println(i)
+ }
+}
+
+func g() {
+}
+
+func main() {
+ defer func() {
+ for i := 0;; i++ {
+ pc, file, line, ok := runtime.Caller(i)
+ if !ok {
+ print("BUG: bug348: cannot find caller\n")
+ return
+ }
+ if !strings.Contains(file, "bug348.go") || runtime.FuncForPC(pc).Name() != "main.f" {
+ // walk past runtime frames
+ continue
+ }
+ if line != 17 {
+ print("BUG: bug348: panic at ", file, ":", line, " in ", runtime.FuncForPC(pc).Name(), "\n")
+ return
+ }
+ recover()
+ return
+ }
+ }()
+ f()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug349.go b/gcc/testsuite/go.test/test/fixedbugs/bug349.go
new file mode 100644
index 00000000000..e7612edb77e
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug349.go
@@ -0,0 +1,13 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1192 - detail in error
+
+package main
+
+func foo() (a, b, c int) {
+ return 0, 1 2.01 // ERROR "unexpected literal 2.01|expected ';' or '}' or newline|not enough arguments to return"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug350.go b/gcc/testsuite/go.test/test/fixedbugs/bug350.go
new file mode 100644
index 00000000000..f8df3f58b96
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug350.go
@@ -0,0 +1,15 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T int
+
+func (T) m() {} // GCCGO_ERROR "previous"
+func (T) m() {} // ERROR "T[.]m redeclared|redefinition"
+
+func (*T) p() {} // GCCGO_ERROR "previous"
+func (*T) p() {} // ERROR "[(][*]T[)][.]p redeclared|redefinition"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug351.go b/gcc/testsuite/go.test/test/fixedbugs/bug351.go
new file mode 100644
index 00000000000..9625c6a501c
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug351.go
@@ -0,0 +1,13 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var x int
+
+func main() {
+ (x) := 0 // ERROR "non-name [(]x[)]|non-name on left side"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug352.go b/gcc/testsuite/go.test/test/fixedbugs/bug352.go
new file mode 100644
index 00000000000..62fd006c423
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug352.go
@@ -0,0 +1,19 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug352
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var x [10][0]byte
+var y = make([]struct{}, 10)
+
+func main() {
+ if &x[1] != &x[2] {
+ println("BUG: bug352 [0]byte")
+ }
+ if &y[1] != &y[2] {
+ println("BUG: bug352 struct{}")
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug353.go b/gcc/testsuite/go.test/test/fixedbugs/bug353.go
new file mode 100644
index 00000000000..b59d97f3384
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug353.go
@@ -0,0 +1,30 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 2089 - internal compiler error
+
+package main
+
+import (
+ "io"
+ "os"
+)
+
+func echo(fd io.ReadWriterCloser) { // ERROR "undefined.*io.ReadWriterCloser"
+ var buf [1024]byte
+ for {
+ n, err := fd.Read(buf)
+ if err != nil {
+ break
+ }
+ fd.Write(buf[0:n])
+ }
+}
+
+func main() {
+ fd, _ := os.Open("a.txt")
+ echo(fd)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug354.go b/gcc/testsuite/go.test/test/fixedbugs/bug354.go
new file mode 100644
index 00000000000..1f6a6dc9f73
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug354.go
@@ -0,0 +1,26 @@
+// $G $D/$F.go || echo BUG: bug354
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 2086
+// was calling makeclosure twice on the closure
+
+package main
+
+import (
+ "os"
+)
+
+type Inner struct {
+ F func() os.Error
+}
+
+type Outer struct {
+ Inners []Inner
+}
+
+// calls makeclosure twice on same closure
+
+var Foo = Outer{[]Inner{Inner{func() os.Error{ return nil }}}}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug355.go b/gcc/testsuite/go.test/test/fixedbugs/bug355.go
new file mode 100644
index 00000000000..a9cf0161b0d
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug355.go
@@ -0,0 +1,18 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var f = func() int {
+ type S int
+ return 42
+}
+
+func main() {
+ if f() != 42 {
+ panic("BUG: bug355")
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug356.go b/gcc/testsuite/go.test/test/fixedbugs/bug356.go
new file mode 100644
index 00000000000..d21f0cfac61
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug356.go
@@ -0,0 +1,41 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug344
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1808
+
+package main
+
+func main() {
+ var i uint64
+ var x int = 12345
+
+ if y := x << (i&5); y != 12345<<0 {
+ println("BUG bug344", y)
+ return
+ }
+
+ i++
+ if y := x << (i&5); y != 12345<<1 {
+ println("BUG bug344a", y)
+ }
+
+ i = 70
+ if y := x << i; y != 0 {
+ println("BUG bug344b", y)
+ }
+
+ i = 1<<32
+ if y := x << i; y != 0 {
+ println("BUG bug344c", y)
+ }
+}
+
+
+/*
+typecheck [1008592b0]
+. INDREG a(1) l(15) x(24) tc(2) runtime.ret G0 string
+bug343.go:15: internal compiler error: typecheck INDREG
+*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug357.go b/gcc/testsuite/go.test/test/fixedbugs/bug357.go
new file mode 100644
index 00000000000..448d9826370
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug357.go
@@ -0,0 +1,26 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1993.
+// error used to have last line number in file
+
+package main
+
+func bla1() bool {
+ return false
+}
+
+func bla5() bool {
+ _ = 1
+ false // ERROR "false not used|value computed is not used"
+ _ = 2
+ return false
+}
+
+func main() {
+ x := bla1()
+ _ = x
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug358.go b/gcc/testsuite/go.test/test/fixedbugs/bug358.go
new file mode 100644
index 00000000000..f43709b7e25
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug358.go
@@ -0,0 +1,26 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1979
+// used to get internal compiler error too
+
+package main
+
+import (
+ "http"
+ "io/ioutil" // GCCGO_ERROR "imported and not used"
+ "os"
+)
+
+func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) // ERROR "syntax error|invalid use of type"
+}
+
+type Page struct {
+ Title string
+ Body []byte
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug359.go b/gcc/testsuite/go.test/test/fixedbugs/bug359.go
new file mode 100644
index 00000000000..3701499ed20
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug359.go
@@ -0,0 +1,26 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1910
+// error on wrong line
+
+package main
+
+import "container/list"
+
+type Painting struct {
+ fragments list.List // private
+}
+
+func (p Painting) Foo() {
+ for e := p.fragments; e.Front() != nil; { // ERROR "unexported field|hidden field"
+ }
+}
+
+// from comment 4 of issue 1910
+type Foo interface {
+ Run(a int) (a int) // ERROR "a redeclared|redefinition|previous"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug361.go b/gcc/testsuite/go.test/test/fixedbugs/bug361.go
new file mode 100644
index 00000000000..d2a64bcef47
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug361.go
@@ -0,0 +1,15 @@
+// $G $D/$F.go || echo BUG: bug360
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1908
+// unreasonable width used to be internal fatal error
+
+package test
+
+func main() {
+ buf := [1<<30]byte{}
+ _ = buf[:]
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug362.go b/gcc/testsuite/go.test/test/fixedbugs/bug362.go
new file mode 100644
index 00000000000..f38572c0d0f
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug362.go
@@ -0,0 +1,16 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1662
+// iota inside var
+
+package main
+
+var (
+ a = iota // ERROR "undefined: iota|iota is only defined in const"
+ b = iota // ERROR "undefined: iota|iota is only defined in const"
+ c = iota // ERROR "undefined: iota|iota is only defined in const"
+)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug363.go b/gcc/testsuite/go.test/test/fixedbugs/bug363.go
new file mode 100644
index 00000000000..04fcfe1a875
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug363.go
@@ -0,0 +1,21 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1664
+
+package main
+
+func main() {
+ var i uint = 33
+ var a = (1<<i) + 4.5 // ERROR "shift of type float64|invalid.*shift"
+ println(a)
+
+ var b = (1<<i) + 4.0 // ERROR "shift of type float64|invalid.*shift"
+ println(b)
+
+ var c int64 = (1<<i) + 4.0 // ok - it's all int64
+ println(b)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug364.go b/gcc/testsuite/go.test/test/fixedbugs/bug364.go
new file mode 100644
index 00000000000..a1745341941
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug364.go
@@ -0,0 +1,25 @@
+package main
+
+import "fmt"
+
+var s string
+
+func accum(args ...interface{}) {
+ s += fmt.Sprintln(args...)
+}
+
+func f(){
+ v := 0.0
+ for i := 0; i < 3; i++ {
+ v += 0.1
+ defer accum(v)
+ }
+}
+
+func main() {
+ f()
+ if s != "0.30000000000000004\n0.2\n0.1\n" {
+ println("BUG: defer")
+ print(s)
+ }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug365.go b/gcc/testsuite/go.test/test/fixedbugs/bug365.go
new file mode 100644
index 00000000000..ce695050440
--- /dev/null
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug365.go
@@ -0,0 +1,22 @@
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// check that compiler doesn't stop reading struct def
+// after first unknown type.
+
+// Fixes issue 2110.
+
+package main
+
+type S struct {
+ err os.Error // ERROR "undefined|expected package"
+ Num int
+}
+
+func main() {
+ s := S{}
+ _ = s.Num // no error here please
+}
diff --git a/gcc/testsuite/go.test/test/func6.go b/gcc/testsuite/go.test/test/func6.go
new file mode 100644
index 00000000000..1356b6aa8b8
--- /dev/null
+++ b/gcc/testsuite/go.test/test/func6.go
@@ -0,0 +1,14 @@
+// $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func main() {
+ if func() bool { return true }() {} // 6g used to say this was a syntax error
+ if (func() bool { return true })() {}
+ if (func() bool { return true }()) {}
+}
+
diff --git a/gcc/testsuite/go.test/test/func7.go b/gcc/testsuite/go.test/test/func7.go
new file mode 100644
index 00000000000..e38b008cc09
--- /dev/null
+++ b/gcc/testsuite/go.test/test/func7.go
@@ -0,0 +1,29 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var calledf = false
+
+func f() int {
+ calledf = true
+ return 1
+}
+
+func g() int {
+ if !calledf {
+ println("BUG: func7 - called g before f")
+ }
+ return 0
+}
+
+func main() {
+ // 6g, 8g, 5g all used to evaluate g() before f().
+ if f() < g() {
+ panic("wrong answer")
+ }
+}
+
diff --git a/gcc/testsuite/go.test/test/gc2.go b/gcc/testsuite/go.test/test/gc2.go
new file mode 100644
index 00000000000..c54d807df72
--- /dev/null
+++ b/gcc/testsuite/go.test/test/gc2.go
@@ -0,0 +1,42 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Check that buffered channels are garbage collected properly.
+// An interesting case because they have finalizers and used to
+// have self loops that kept them from being collected.
+// (Cyclic data with finalizers is never finalized, nor collected.)
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "runtime"
+)
+
+func main() {
+ const N = 10000
+ st := runtime.MemStats
+ for i := 0; i < N; i++ {
+ c := make(chan int, 10)
+ _ = c
+ if i%100 == 0 {
+ for j := 0; j < 4; j++ {
+ runtime.GC()
+ runtime.Gosched()
+ runtime.GC()
+ runtime.Gosched()
+ }
+ }
+ }
+
+ runtime.UpdateMemStats()
+ obj := runtime.MemStats.HeapObjects - st.HeapObjects
+ if obj > N/5 {
+ fmt.Println("too many objects left:", obj)
+ os.Exit(1)
+ }
+}
diff --git a/gcc/testsuite/go.test/test/golden.out b/gcc/testsuite/go.test/test/golden.out
index cc699d4500e..655ceda5653 100644
--- a/gcc/testsuite/go.test/test/golden.out
+++ b/gcc/testsuite/go.test/test/golden.out
@@ -21,6 +21,9 @@ panic: runtime error: hash of unhashable type []int
printing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
42 true false true +1.500000e+000 world 0x0 [0/0]0x0 0x0 0x0 255
+=========== ./goprint.go
+42 true false true +1.500000e+000 world 0x0 [0/0]0x0 0x0 0x0 255
+
=========== ./helloworld.go
hello, world
@@ -157,13 +160,7 @@ panic: interface conversion: interface is int, not int32
panic: interface conversion: interface is main.T, not main.T
-== bugs/
+=========== fixedbugs/bug328.go
+0x0
-=========== bugs/bug322.go
-bugs/bug322.dir/main.go:19: implicit assignment of unexported field 'x' of lib.T in method receiver
-bugs/bug322.dir/main.go:22: implicit assignment of unexported field 'x' of lib.T in assignment
-bugs/bug322.dir/main.go:31: implicit assignment of unexported field 'x' of lib.T in method receiver
-BUG: fails incorrectly
-
-=========== bugs/bug324.go
-BUG: errchk: command succeeded unexpectedly
+== bugs/
diff --git a/gcc/testsuite/go.test/test/goprint.go b/gcc/testsuite/go.test/test/goprint.go
new file mode 100644
index 00000000000..c0e34c750e3
--- /dev/null
+++ b/gcc/testsuite/go.test/test/goprint.go
@@ -0,0 +1,14 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "time"
+
+func main() {
+ go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255))
+ time.Sleep(1e6)
+}
diff --git a/gcc/testsuite/go.test/test/goto.go b/gcc/testsuite/go.test/test/goto.go
new file mode 100644
index 00000000000..1fccb314c87
--- /dev/null
+++ b/gcc/testsuite/go.test/test/goto.go
@@ -0,0 +1,535 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Each test is in a separate function just so that if the
+// compiler stops processing after one error, we don't
+// lose other ones.
+
+package main
+
+var (
+ i, n int
+ x []int
+ c chan int
+ m map[int]int
+ s string
+)
+
+// goto after declaration okay
+func _() {
+ x := 1
+ goto L
+L:
+ _ = x
+}
+
+// goto before declaration okay
+func _() {
+ goto L
+L:
+ x := 1
+ _ = x
+}
+
+// goto across declaration not okay
+func _() {
+ goto L // ERROR "goto L jumps over declaration of x at LINE+1|goto jumps over declaration"
+ x := 1 // GCCGO_ERROR "defined here"
+ _ = x
+L:
+}
+
+// goto across declaration in inner scope okay
+func _() {
+ goto L
+ {
+ x := 1
+ _ = x
+ }
+L:
+}
+
+// goto across declaration after inner scope not okay
+func _() {
+ goto L // ERROR "goto L jumps over declaration of x at LINE+5|goto jumps over declaration"
+ {
+ x := 1
+ _ = x
+ }
+ x := 1 // GCCGO_ERROR "defined here"
+ _ = x
+L:
+}
+
+// goto across declaration in reverse okay
+func _() {
+L:
+ x := 1
+ _ = x
+ goto L
+}
+
+// error shows first offending variable
+func _() {
+ goto L // ERROR "goto L jumps over declaration of x at LINE+1|goto jumps over declaration"
+ x := 1 // GCCGO_ERROR "defined here"
+ _ = x
+ y := 1
+ _ = y
+L:
+}
+
+// goto not okay even if code path is dead
+func _() {
+ goto L // ERROR "goto L jumps over declaration of x at LINE+1|goto jumps over declaration"
+ x := 1 // GCCGO_ERROR "defined here"
+ _ = x
+ y := 1
+ _ = y
+ return
+L:
+}
+
+// goto into outer block okay
+func _() {
+ {
+ goto L
+ }
+L:
+}
+
+// goto backward into outer block okay
+func _() {
+L:
+ {
+ goto L
+ }
+}
+
+// goto into inner block not okay
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+// goto backward into inner block still not okay
+func _() {
+ { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+// error shows first (outermost) offending block
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ {
+ {
+ { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ }
+ }
+}
+
+// error prefers block diagnostic over declaration diagnostic
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+3|goto jumps into block"
+ x := 1
+ _ = x
+ { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+// many kinds of blocks, all invalid to jump into or among,
+// but valid to jump out of
+
+// if
+
+func _() {
+L:
+ if true {
+ goto L
+ }
+}
+
+func _() {
+L:
+ if true {
+ goto L
+ } else {
+ }
+}
+
+func _() {
+L:
+ if false {
+ } else {
+ goto L
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ if true { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ if true { // GCCGO_ERROR "block starts here"
+ L:
+ } else {
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ if true {
+ } else { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+func _() {
+ if false { // GCCGO_ERROR "block starts here"
+ L:
+ } else {
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+ }
+}
+
+func _() {
+ if true {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ } else { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+func _() {
+ if true {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ } else if false { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+func _() {
+ if true {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ } else if false { // GCCGO_ERROR "block starts here"
+ L:
+ } else {
+ }
+}
+
+func _() {
+ // This one is tricky. There is an implicit scope
+ // starting at the second if statement, and it contains
+ // the final else, so the outermost offending scope
+ // really is LINE+1 (like in the previous test),
+ // even though it looks like it might be LINE+3 instead.
+ if true {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ } else if false {
+ } else { // GCCGO_ERROR "block starts here"
+ L:
+ }
+}
+
+/* Want to enable these tests but gofmt mangles them. Issue 1972.
+
+func _() {
+ // This one is okay, because the else is in the
+ // implicit whole-if block and has no inner block
+ // (no { }) around it.
+ if true {
+ goto L
+ } else
+ L:
+}
+
+func _() {
+ // Still not okay.
+ if true { //// GCCGO_ERROR "block starts here"
+ L:
+ } else
+ goto L //// ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+*/
+
+// for
+
+func _() {
+ for {
+ goto L
+ }
+L:
+}
+
+func _() {
+ for {
+ goto L
+ L:
+ }
+}
+
+func _() {
+ for { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for { // GCCGO_ERROR "block starts here"
+ goto L
+ L1:
+ }
+L:
+ goto L1 // ERROR "goto L1 jumps into block starting at LINE-5|goto jumps into block"
+}
+
+func _() {
+ for i < n { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for i = 0; i < n; i++ { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for i = range x { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for i = range c { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for i = range m { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+func _() {
+ for i = range s { // GCCGO_ERROR "block starts here"
+ L:
+ }
+ goto L // ERROR "goto L jumps into block starting at LINE-3|goto jumps into block"
+}
+
+// switch
+
+func _() {
+L:
+ switch i {
+ case 0:
+ goto L
+ }
+}
+
+func _() {
+L:
+ switch i {
+ case 0:
+
+ default:
+ goto L
+ }
+}
+
+func _() {
+ switch i {
+ case 0:
+
+ default:
+ L:
+ goto L
+ }
+}
+
+func _() {
+ switch i {
+ case 0:
+
+ default:
+ goto L
+ L:
+ }
+}
+
+func _() {
+ switch i {
+ case 0:
+ goto L
+ L:
+ ;
+ default:
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ switch i {
+ case 0:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ switch i {
+ case 0:
+ L: // GCCGO_ERROR "block starts here"
+ ;
+ default:
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ switch i {
+ case 0:
+ default:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ switch i {
+ default:
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ case 0:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ switch i {
+ case 0:
+ L: // GCCGO_ERROR "block starts here"
+ ;
+ default:
+ goto L // ERROR "goto L jumps into block starting at LINE-4|goto jumps into block"
+ }
+}
+
+// select
+// different from switch. the statement has no implicit block around it.
+
+func _() {
+L:
+ select {
+ case <-c:
+ goto L
+ }
+}
+
+func _() {
+L:
+ select {
+ case c <- 1:
+
+ default:
+ goto L
+ }
+}
+
+func _() {
+ select {
+ case <-c:
+
+ default:
+ L:
+ goto L
+ }
+}
+
+func _() {
+ select {
+ case c <- 1:
+
+ default:
+ goto L
+ L:
+ }
+}
+
+func _() {
+ select {
+ case <-c:
+ goto L
+ L:
+ ;
+ default:
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+2|goto jumps into block"
+ select {
+ case c <- 1:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+2|goto jumps into block"
+ select {
+ case c <- 1:
+ L: // GCCGO_ERROR "block starts here"
+ ;
+ default:
+ }
+}
+
+func _() {
+ goto L // ERROR "goto L jumps into block starting at LINE+3|goto jumps into block"
+ select {
+ case <-c:
+ default:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ select {
+ default:
+ goto L // ERROR "goto L jumps into block starting at LINE+1|goto jumps into block"
+ case <-c:
+ L: // GCCGO_ERROR "block starts here"
+ }
+}
+
+func _() {
+ select {
+ case <-c:
+ L: // GCCGO_ERROR "block starts here"
+ ;
+ default:
+ goto L // ERROR "goto L jumps into block starting at LINE-4|goto jumps into block"
+ }
+}
diff --git a/gcc/testsuite/go.test/test/if.go b/gcc/testsuite/go.test/test/if.go
index c1bb69d277f..18a6715d7eb 100644
--- a/gcc/testsuite/go.test/test/if.go
+++ b/gcc/testsuite/go.test/test/if.go
@@ -53,25 +53,28 @@ func main() {
count = 0
if true {
count = count + 1
- } else
+ } else {
count = count - 1
+ }
assertequal(count, 1, "if else true")
count = 0
if false {
count = count + 1
- } else
+ } else {
count = count - 1
+ }
assertequal(count, -1, "if else false")
count = 0
- if t:=1; false {
+ if t := 1; false {
count = count + 1
_ = t
t := 7
_ = t
- } else
+ } else {
count = count - t
+ }
assertequal(count, -1, "if else false var")
count = 0
@@ -80,8 +83,9 @@ func main() {
count = count + 1
t := 7
_ = t
- } else
+ } else {
count = count - t
+ }
_ = t
assertequal(count, -1, "if else false var outside")
}
diff --git a/gcc/testsuite/go.test/test/import1.go b/gcc/testsuite/go.test/test/import1.go
index 8bb2a94a24f..ebd704ef995 100644
--- a/gcc/testsuite/go.test/test/import1.go
+++ b/gcc/testsuite/go.test/test/import1.go
@@ -9,9 +9,9 @@
package main
import "bufio" // GCCGO_ERROR "previous|not used"
-import bufio "os" // ERROR "redeclared|redefinition|incompatible"
+import bufio "os" // ERROR "redeclared|redefinition|incompatible" "imported and not used"
import (
"fmt" // GCCGO_ERROR "previous|not used"
- fmt "math" // ERROR "redeclared|redefinition|incompatible"
+ fmt "math" // ERROR "redeclared|redefinition|incompatible" "imported and not used"
)
diff --git a/gcc/testsuite/go.test/test/initializerr.go b/gcc/testsuite/go.test/test/initializerr.go
index 37f8a602db6..e7f8b0e92fe 100644
--- a/gcc/testsuite/go.test/test/initializerr.go
+++ b/gcc/testsuite/go.test/test/initializerr.go
@@ -17,7 +17,7 @@ type T struct {
var x = 1
var a1 = S { 0, X: 1 } // ERROR "mixture|undefined"
var a2 = S { Y: 3, Z: 2, Y: 3 } // ERROR "duplicate"
-var a3 = T { 1, 2, 3, 4, 5, 6 } // ERROR "convert|too many"
+var a3 = T { S{}, 2, 3, 4, 5, 6 } // ERROR "convert|too many"
var a4 = [5]byte{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } // ERROR "index|too many"
var a5 = []byte { x: 2 } // ERROR "index"
diff --git a/gcc/testsuite/go.test/test/interface/explicit.go b/gcc/testsuite/go.test/test/interface/explicit.go
index b6a582fffba..daae59b3618 100644
--- a/gcc/testsuite/go.test/test/interface/explicit.go
+++ b/gcc/testsuite/go.test/test/interface/explicit.go
@@ -48,7 +48,7 @@ func main() {
i2 = I2(i) // ERROR "invalid|missing N method"
e = E(t) // ok
- t = T(e) // ERROR "need explicit|need type assertion|incompatible"
+ t = T(e) // ERROR "need explicit|need type assertion|incompatible" "as type [*]T"
}
type M interface {
diff --git a/gcc/testsuite/go.test/test/interface/pointer.go b/gcc/testsuite/go.test/test/interface/pointer.go
index e628b558eaa..f1e363cbff6 100644
--- a/gcc/testsuite/go.test/test/interface/pointer.go
+++ b/gcc/testsuite/go.test/test/interface/pointer.go
@@ -33,4 +33,5 @@ func main() {
print("call addinst\n")
var x Inst = AddInst(new(Start)) // ERROR "pointer to interface"
print("return from addinst\n")
+ var y *Inst = new(Start) // ERROR "pointer to interface|incompatible type"
}
diff --git a/gcc/testsuite/go.test/test/interface/private.go b/gcc/testsuite/go.test/test/interface/private.go
new file mode 100644
index 00000000000..37890c923a5
--- /dev/null
+++ b/gcc/testsuite/go.test/test/interface/private.go
@@ -0,0 +1,32 @@
+// $G $D/${F}1.go && errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "./private1"
+
+type Exported interface {
+ private()
+}
+
+type Implementation struct{}
+
+func (p *Implementation) private() {}
+
+func main() {
+ var x Exported
+ x = new(Implementation)
+ x.private()
+
+ var px p.Exported
+ px = p.X
+
+ px.private() // ERROR "private"
+
+ px = new(Implementation) // ERROR "private"
+
+ x = px // ERROR "private"
+}
diff --git a/gcc/testsuite/go.test/test/interface/private1.go b/gcc/testsuite/go.test/test/interface/private1.go
new file mode 100644
index 00000000000..3173fbef41f
--- /dev/null
+++ b/gcc/testsuite/go.test/test/interface/private1.go
@@ -0,0 +1,18 @@
+// true # used by private.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type Exported interface {
+ private()
+}
+
+type Implementation struct{}
+
+func (p *Implementation) private() {}
+
+var X = new(Implementation)
+
diff --git a/gcc/testsuite/go.test/test/malloc1.go b/gcc/testsuite/go.test/test/malloc1.go
index 146976467b0..61f1797c75d 100644
--- a/gcc/testsuite/go.test/test/malloc1.go
+++ b/gcc/testsuite/go.test/test/malloc1.go
@@ -18,6 +18,7 @@ var chatty = flag.Bool("v", false, "chatty")
func main() {
runtime.Free(runtime.Alloc(1))
+ runtime.UpdateMemStats()
if *chatty {
fmt.Printf("%+v %v\n", runtime.MemStats, uint64(0))
}
diff --git a/gcc/testsuite/go.test/test/mallocrand.go b/gcc/testsuite/go.test/test/mallocrand.go
index e6b422e2244..f014b441b2b 100644
--- a/gcc/testsuite/go.test/test/mallocrand.go
+++ b/gcc/testsuite/go.test/test/mallocrand.go
@@ -21,6 +21,7 @@ var footprint uint64
var allocated uint64
func bigger() {
+ runtime.UpdateMemStats()
if f := runtime.MemStats.Sys; footprint < f {
footprint = f
if *chatty {
diff --git a/gcc/testsuite/go.test/test/method2.go b/gcc/testsuite/go.test/test/method2.go
index a72536e7b33..039779efbe1 100644
--- a/gcc/testsuite/go.test/test/method2.go
+++ b/gcc/testsuite/go.test/test/method2.go
@@ -12,8 +12,14 @@ type T struct {
type P *T
type P1 *T
-func (p P) val() int { return 1 } // ERROR "receiver"
-func (p *P1) val() int { return 1 } // ERROR "receiver"
+func (p P) val() int { return 1 } // ERROR "receiver.* pointer|invalid pointer or interface receiver"
+func (p *P1) val() int { return 1 } // ERROR "receiver.* pointer|invalid pointer or interface receiver"
+
+type I interface{}
+type I1 interface{}
+
+func (p I) val() int { return 1 } // ERROR "receiver.*interface|invalid pointer or interface receiver"
+func (p *I1) val() int { return 1 } // ERROR "receiver.*interface|invalid pointer or interface receiver"
type Val interface {
val() int
diff --git a/gcc/testsuite/go.test/test/nil.go b/gcc/testsuite/go.test/test/nil.go
index 4f4c7552760..30cc2705b03 100644
--- a/gcc/testsuite/go.test/test/nil.go
+++ b/gcc/testsuite/go.test/test/nil.go
@@ -6,6 +6,11 @@
package main
+import (
+ "fmt"
+ "time"
+)
+
type T struct {
i int
}
@@ -33,4 +38,141 @@ func main() {
ta[0] = nil
_, _, _, _, _, _, _, _ = i, f, s, m, c, t, in, ta
+
+ arraytest()
+ chantest()
+ maptest()
+ slicetest()
+}
+
+func shouldPanic(f func()) {
+ defer func() {
+ if recover() == nil {
+ panic("not panicking")
+ }
+ }()
+ f()
+}
+
+func shouldBlock(f func()) {
+ go func() {
+ f()
+ panic("did not block")
+ }()
+ time.Sleep(1e7)
+}
+
+// nil array pointer
+
+func arraytest() {
+ var p *[10]int
+
+ // Looping over indices is fine.
+ s := 0
+ for i := range p {
+ s += i
+ }
+ if s != 45 {
+ panic(s)
+ }
+
+ s = 0
+ for i := 0; i < len(p); i++ {
+ s += i
+ }
+ if s != 45 {
+ panic(s)
+ }
+
+ // Looping over values is not.
+ shouldPanic(func() {
+ for i, v := range p {
+ s += i + v
+ }
+ })
+
+ shouldPanic(func() {
+ for i := 0; i < len(p); i++ {
+ s += p[i]
+ }
+ })
+}
+
+// nil channel
+// select tests already handle select on nil channel
+
+func chantest() {
+ var ch chan int
+
+ // nil channel is never ready
+ shouldBlock(func() {
+ ch <- 1
+ })
+ shouldBlock(func() {
+ <-ch
+ })
+ shouldBlock(func() {
+ x, ok := <-ch
+ println(x, ok)
+ })
+
+ if len(ch) != 0 {
+ panic(len(ch))
+ }
+ if cap(ch) != 0 {
+ panic(cap(ch))
+ }
+}
+
+// nil map
+
+func maptest() {
+ var m map[int]int
+
+ // nil map appears empty
+ if len(m) != 0 {
+ panic(len(m))
+ }
+ if m[1] != 0 {
+ panic(m[1])
+ }
+ if x, ok := m[1]; x != 0 || ok {
+ panic(fmt.Sprint(x, ok))
+ }
+
+ for k, v := range m {
+ panic(k)
+ panic(v)
+ }
+
+ // but cannot be written to
+ shouldPanic(func() {
+ m[2] = 3
+ })
+ shouldPanic(func() {
+ m[2] = 0, false
+ })
+}
+
+// nil slice
+
+func slicetest() {
+ var x []int
+
+ // nil slice is just a 0-element slice.
+ if len(x) != 0 {
+ panic(len(x))
+ }
+ if cap(x) != 0 {
+ panic(cap(x))
+ }
+
+ // no 0-element slices can be read from or written to
+ var s int
+ shouldPanic(func() {
+ s += x[1]
+ })
+ shouldPanic(func() {
+ x[2] = s
+ })
}
diff --git a/gcc/testsuite/go.test/test/nul1.go b/gcc/testsuite/go.test/test/nul1.go
index 9cf51125bcc..142d4deb1f4 100644
--- a/gcc/testsuite/go.test/test/nul1.go
+++ b/gcc/testsuite/go.test/test/nul1.go
@@ -39,7 +39,7 @@ var y = ` + "`in raw string \x00 foo`" + ` // ERROR "NUL"
/* in other comment ` + "\x00" + ` */ // ERROR "NUL"
-/* in source code */ ` + "\x00" + `// ERROR "NUL"
+/* in source code */ ` + "\x00" + `// ERROR "NUL" "illegal character"
var xx = "in string ` + "\xc2\xff" + `" // ERROR "UTF-8"
@@ -50,9 +50,9 @@ var yy = ` + "`in raw string \xff foo`" + ` // ERROR "UTF-8"
/* in other comment ` + "\xe0\x00\x00" + ` */ // ERROR "UTF-8|NUL"
/* in variable name */
-var z` + "\xc1\x81" + ` int // ERROR "UTF-8"
+var z` + "\xc1\x81" + ` int // ERROR "UTF-8" "invalid identifier character"
-/* in source code */ ` + "\xc2A" + `// ERROR "UTF-8"
+/* in source code */ ` + "var \xc2A int" + `// ERROR "UTF-8" "invalid identifier character"
`)
}
diff --git a/gcc/testsuite/go.test/test/rename1.go b/gcc/testsuite/go.test/test/rename1.go
index f2399999860..3e78bfca0bc 100644
--- a/gcc/testsuite/go.test/test/rename1.go
+++ b/gcc/testsuite/go.test/test/rename1.go
@@ -10,7 +10,7 @@ func main() {
var n byte // ERROR "not a type|expected type"
var y = float(0) // ERROR "cannot call|expected function"
const (
- a = 1 + iota // ERROR "string|incompatible types"
+ a = 1 + iota // ERROR "string|incompatible types" "convert iota"
)
}
diff --git a/gcc/testsuite/go.test/test/run b/gcc/testsuite/go.test/test/run
index 28d0caa0f68..bc31d2f7140 100755
--- a/gcc/testsuite/go.test/test/run
+++ b/gcc/testsuite/go.test/test/run
@@ -5,6 +5,8 @@
eval $(gomake --no-print-directory -f ../src/Make.inc go-env)
+export E=
+
case X"$GOARCH" in
Xamd64)
export A=6
@@ -21,11 +23,6 @@ Xarm)
exit 1
esac
-case X"$GOOS" in
-Xnacl)
- export E=${GORUN:-$GOROOT/misc/nacl/naclrun}
-esac
-
export G=${A}g
export L=${A}l
export GOTRACEBACK=0
@@ -36,9 +33,9 @@ failed=0
PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$GOROOT/bin}:`pwd`
-RUNFILE=/tmp/gorun-$$-$USER
-TMP1FILE=/tmp/gotest1-$$-$USER
-TMP2FILE=/tmp/gotest2-$$-$USER
+RUNFILE="/tmp/gorun-$$-$USER"
+TMP1FILE="/tmp/gotest1-$$-$USER"
+TMP2FILE="/tmp/gotest2-$$-$USER"
# don't run the machine out of memory: limit individual processes to 4GB.
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
@@ -67,20 +64,20 @@ do
fi
export F=$(basename $i .go)
export D=$dir
- sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >$RUNFILE
- if ! { time -p bash -c "bash $RUNFILE >$TMP1FILE 2>&1" ; } 2>$TMP2FILE
+ sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE"
+ if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE"
then
echo
echo "===========" $i
- cat $TMP1FILE
+ cat "$TMP1FILE"
echo >&2 fail: $i
echo "# $i # fail" >>pass.out
- elif test -s $TMP1FILE
+ elif test -s "$TMP1FILE"
then
echo
echo "===========" $i
- cat $TMP1FILE
- if grep -q '^BUG' $TMP1FILE
+ cat "$TMP1FILE"
+ if grep -q '^BUG' "$TMP1FILE"
then
if [ $dir != bugs ]
then
@@ -96,12 +93,13 @@ do
else
echo $i >>pass.out
fi
- echo $(awk 'NR==1{print $2}' $TMP2FILE) $D/$F >>times.out
+ echo $(awk 'NR==1{print $2}' "$TMP2FILE") $D/$F >>times.out
+ rm -f $F.$A $A.out
) done
done | # clean up some stack noise
egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' |
sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
- s!'$RUNFILE'!$RUNFILE!g
+ s!'"$RUNFILE"'!$RUNFILE!g
s/^PC=0x[0-9a-f]*/pc: xxx/
s/^pc: 0x[0-9a-f]*/pc: xxx/
s/PC=0x[0-9a-f]*/PC=xxx/
@@ -109,11 +107,10 @@ done | # clean up some stack noise
/^Trace\/BPT trap/d
/RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
/^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
- /Fault in NaCl untrusted code/d
/Segmentation fault/d
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
-rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A *.a $A.out
+rm -f "$RUNFILE" "$TMP1FILE" "$TMP2FILE" *.$A *.a $A.out
diffmsg=""
if ! diff $golden run.out
then
diff --git a/gcc/testsuite/go.test/test/shift1.go b/gcc/testsuite/go.test/test/shift1.go
new file mode 100644
index 00000000000..c197eef66e5
--- /dev/null
+++ b/gcc/testsuite/go.test/test/shift1.go
@@ -0,0 +1,36 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1708, illegal cases.
+
+package p
+
+func f(x int) int { return 0 }
+func g(x interface{}) int { return 0 }
+func h(x float64) int { return 0 }
+
+// from the spec
+var (
+ s uint = 33
+ u = 1.0 << s // ERROR "invalid operation|shift of non-integer operand"
+ v float32 = 1 << s // ERROR "invalid" "as type float32"
+)
+
+// non-constant shift expressions
+var (
+ e1 = g(2.0 << s) // ERROR "invalid" "as type interface"
+ f1 = h(2 << s) // ERROR "invalid" "as type float64"
+ g1 int64 = 1.1 << s // ERROR "truncated"
+)
+
+// constant shift expressions
+const c uint = 65
+
+var (
+ a2 int = 1.0 << c // ERROR "overflow"
+ b2 = 1.0 << c // ERROR "overflow"
+ d2 = f(1.0 << c) // ERROR "overflow"
+)
diff --git a/gcc/testsuite/go.test/test/shift2.go b/gcc/testsuite/go.test/test/shift2.go
new file mode 100644
index 00000000000..ec4c7addc2d
--- /dev/null
+++ b/gcc/testsuite/go.test/test/shift2.go
@@ -0,0 +1,42 @@
+// $G $D/$F.go || echo BUG: shift2
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1708, legal cases.
+
+package p
+
+func f(x int) int { return 0 }
+func g(x interface{}) int { return 0 }
+func h(x float64) int { return 0 }
+
+// from the spec
+var (
+ s uint = 33
+ i = 1 << s // 1 has type int
+ j int32 = 1 << s // 1 has type int32; j == 0
+ k = uint64(1 << s) // 1 has type uint64; k == 1<<33
+ m int = 1.0 << s // legal: 1.0 has type int
+ w int64 = 1.0 << 33 // legal: 1.0<<33 is a constant shift expression
+)
+
+// non-constant shift expressions
+var (
+ a1 int = 2.0 << s // typeof(2.0) is int in this context => legal shift
+ d1 = f(2.0 << s) // typeof(2.0) is int in this context => legal shift
+)
+
+// constant shift expressions
+const c uint = 5
+
+var (
+ a2 int = 2.0 << c // a2 == 64 (type int)
+ b2 = 2.0 << c // b2 == 64 (untyped integer)
+ _ = f(b2) // verify b2 has type int
+ c2 float64 = 2 << c // c2 == 64.0 (type float64)
+ d2 = f(2.0 << c) // == f(64)
+ e2 = g(2.0 << c) // == g(int(64))
+ f2 = h(2 << c) // == h(float64(64.0))
+)
diff --git a/gcc/testsuite/go.test/test/sizeof.go b/gcc/testsuite/go.test/test/sizeof.go
new file mode 100644
index 00000000000..544e4c52c1b
--- /dev/null
+++ b/gcc/testsuite/go.test/test/sizeof.go
@@ -0,0 +1,23 @@
+// $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "unsafe"
+
+type T struct {
+ X int
+}
+
+var t T
+
+func isUintptr(uintptr) {}
+
+func main() {
+ isUintptr(unsafe.Sizeof(t))
+ isUintptr(unsafe.Alignof(t))
+ isUintptr(unsafe.Offsetof(t.X))
+}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5470dafafc2..accaad518ef 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -459,12 +459,9 @@ proc check_profiling_available { test_what } {
# Tree profiling requires TLS runtime support.
if { $test_what == "-fprofile-generate" } {
- # AVR does not support profile generation because
- # it does not implement needed support functions.
- if { [istarget avr-*-*] } {
+ if { ![check_effective_target_tls_runtime] } {
return 0
}
- return [check_effective_target_tls_runtime]
}
# Support for -p on solaris2 relies on mcrt1.o which comes with the
@@ -3393,6 +3390,24 @@ proc check_effective_target_vect_multiple_sizes { } {
return $et_vect_multiple_sizes_saved
}
+# Return 1 if the target supports vectors of 64 bits.
+
+proc check_effective_target_vect64 { } {
+ global et_vect64
+
+ if [info exists et_vect64_saved] {
+ verbose "check_effective_target_vect64: using cached result" 2
+ } else {
+ set et_vect64_saved 0
+ if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
+ set et_vect64_saved 1
+ }
+ }
+
+ verbose "check_effective_target_vect64: returning $et_vect64_saved" 2
+ return $et_vect64_saved
+}
+
# Return 1 if the target supports section-anchors
proc check_effective_target_section_anchors { } {
diff --git a/gcc/timevar.def b/gcc/timevar.def
index 2921c9088bd..5ad0f9dd08c 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -1,7 +1,7 @@
/* This file contains the definitions for timing variables used to
measure run-time performance of the compiler.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010
+ 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
@@ -127,6 +127,7 @@ DEFTIMEVAR (TV_TREE_GIMPLIFY , "tree gimplify")
DEFTIMEVAR (TV_TREE_EH , "tree eh")
DEFTIMEVAR (TV_TREE_CFG , "tree CFG construction")
DEFTIMEVAR (TV_TREE_CLEANUP_CFG , "tree CFG cleanup")
+DEFTIMEVAR (TV_TREE_TAIL_MERGE , "tree tail merge")
DEFTIMEVAR (TV_TREE_VRP , "tree VRP")
DEFTIMEVAR (TV_TREE_COPY_PROP , "tree copy propagation")
DEFTIMEVAR (TV_FIND_REFERENCED_VARS , "tree find ref. vars")
@@ -183,6 +184,7 @@ DEFTIMEVAR (TV_TREE_COPY_RENAME , "tree rename SSA copies")
DEFTIMEVAR (TV_TREE_SSA_VERIFY , "tree SSA verifier")
DEFTIMEVAR (TV_TREE_STMT_VERIFY , "tree STMT verifier")
DEFTIMEVAR (TV_TREE_SWITCH_CONVERSION, "tree switch initialization conversion")
+DEFTIMEVAR (TV_TREE_STRLEN , "tree strlen optimization")
DEFTIMEVAR (TV_CGRAPH_VERIFY , "callgraph verifier")
DEFTIMEVAR (TV_DOM_FRONTIERS , "dominance frontiers")
DEFTIMEVAR (TV_DOMINANCE , "dominance computation")
diff --git a/gcc/toplev.c b/gcc/toplev.c
index de0a58a6773..ab6b5a41837 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -141,6 +141,9 @@ static const char *flag_random_seed;
user has specified a particular random seed. */
unsigned local_tick;
+/* Random number for this compilation */
+HOST_WIDE_INT random_seed;
+
/* -f flags. */
/* Generate code for GNU or NeXT Objective-C runtime environment. */
@@ -251,7 +254,7 @@ announce_function (tree decl)
}
}
-/* Initialize local_tick with the time of day, or -1 if
+/* Initialize local_tick with a random number or -1 if
flag_random_seed is set. */
static void
@@ -259,7 +262,17 @@ init_local_tick (void)
{
if (!flag_random_seed)
{
- /* Get some more or less random data. */
+ /* Try urandom first. Time of day is too likely to collide.
+ In case of any error we just use the local tick. */
+
+ int fd = open ("/dev/urandom", O_RDONLY);
+ if (fd >= 0)
+ {
+ read (fd, &random_seed, sizeof (random_seed));
+ close (fd);
+ }
+
+ /* Now get the tick anyways */
#ifdef HAVE_GETTIMEOFDAY
{
struct timeval tv;
@@ -286,24 +299,28 @@ init_local_tick (void)
static void
init_random_seed (void)
{
- unsigned HOST_WIDE_INT value;
- static char random_seed[HOST_BITS_PER_WIDE_INT / 4 + 3];
-
- value = local_tick ^ getpid ();
+ if (flag_random_seed)
+ {
+ char *endp;
- sprintf (random_seed, HOST_WIDE_INT_PRINT_HEX, value);
- flag_random_seed = random_seed;
+ /* When the driver passed in a hex number don't crc it again */
+ random_seed = strtoul (flag_random_seed, &endp, 0);
+ if (!(endp > flag_random_seed && *endp == 0))
+ random_seed = crc32_string (0, flag_random_seed);
+ }
+ else if (!random_seed)
+ random_seed = local_tick ^ getpid (); /* Old racey fallback method */
}
-/* Obtain the random_seed string. Unless NOINIT, initialize it if
+/* Obtain the random_seed. Unless NOINIT, initialize it if
it's not provided in the command line. */
-const char *
+HOST_WIDE_INT
get_random_seed (bool noinit)
{
if (!flag_random_seed && !noinit)
init_random_seed ();
- return flag_random_seed;
+ return random_seed;
}
/* Modify the random_seed string to VAL. Return its previous
@@ -569,40 +586,45 @@ compile_file (void)
return;
}
- varpool_assemble_pending_decls ();
- finish_aliases_2 ();
+ /* Compilation unit is finalized. When producing non-fat LTO object, we are
+ basically finished. */
+ if (in_lto_p || !flag_lto || flag_fat_lto_objects)
+ {
+ varpool_assemble_pending_decls ();
+ finish_aliases_2 ();
- /* Likewise for mudflap static object registrations. */
- if (flag_mudflap)
- mudflap_finish_file ();
+ /* Likewise for mudflap static object registrations. */
+ if (flag_mudflap)
+ mudflap_finish_file ();
- output_shared_constant_pool ();
- output_object_blocks ();
+ output_shared_constant_pool ();
+ output_object_blocks ();
- /* Write out any pending weak symbol declarations. */
- weak_finish ();
+ /* Write out any pending weak symbol declarations. */
+ weak_finish ();
- /* This must be at the end before unwind and debug info.
- Some target ports emit PIC setup thunks here. */
- targetm.asm_out.code_end ();
+ /* This must be at the end before unwind and debug info.
+ Some target ports emit PIC setup thunks here. */
+ targetm.asm_out.code_end ();
- /* Do dbx symbols. */
- timevar_push (TV_SYMOUT);
+ /* Do dbx symbols. */
+ timevar_push (TV_SYMOUT);
-#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
- if (dwarf2out_do_frame ())
- dwarf2out_frame_finish ();
-#endif
+ #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
+ if (dwarf2out_do_frame ())
+ dwarf2out_frame_finish ();
+ #endif
- (*debug_hooks->finish) (main_input_filename);
- timevar_pop (TV_SYMOUT);
+ (*debug_hooks->finish) (main_input_filename);
+ timevar_pop (TV_SYMOUT);
- /* Output some stuff at end of file if nec. */
+ /* Output some stuff at end of file if nec. */
- dw2_output_indirect_constants ();
+ dw2_output_indirect_constants ();
- /* Flush any pending external directives. */
- process_pending_assemble_externals ();
+ /* Flush any pending external directives. */
+ process_pending_assemble_externals ();
+ }
/* Emit LTO marker if LTO info has been previously emitted. This is
used by collect2 to determine whether an object file contains IL.
@@ -623,6 +645,23 @@ compile_file (void)
(unsigned HOST_WIDE_INT) 1,
(unsigned HOST_WIDE_INT) 1);
#endif
+ /* Let linker plugin know that this is a slim object and must be LTOed
+ even when user did not ask for it. */
+ if (!flag_fat_lto_objects)
+ {
+#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON
+ ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, NULL_TREE,
+ "__gnu_slim_lto",
+ (unsigned HOST_WIDE_INT) 1, 8);
+#elif defined ASM_OUTPUT_ALIGNED_COMMON
+ ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, "__gnu_slim_lto",
+ (unsigned HOST_WIDE_INT) 1, 8);
+#else
+ ASM_OUTPUT_COMMON (asm_out_file, "__gnu_slim_lto",
+ (unsigned HOST_WIDE_INT) 1,
+ (unsigned HOST_WIDE_INT) 1);
+#endif
+ }
}
/* Attach a special .ident directive to the end of the file to identify
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 2455dc02263..588cfdbb6d2 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -77,7 +77,7 @@ extern bool set_src_pwd (const char *);
/* Functions used to manipulate the random seed. */
-extern const char *get_random_seed (bool);
+extern HOST_WIDE_INT get_random_seed (bool);
extern const char *set_random_seed (const char *);
#endif /* ! GCC_TOPLEV_H */
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 20feff91f72..5e5de8f372b 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3229,8 +3229,8 @@ verify_gimple_comparison (tree type, tree op0, tree op1)
}
if (TYPE_VECTOR_SUBPARTS (type) != TYPE_VECTOR_SUBPARTS (op0_type)
- || (GET_MODE_SIZE (TYPE_MODE (type))
- != GET_MODE_SIZE (TYPE_MODE (op0_type))))
+ || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (type)))
+ != GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0_type)))))
{
error ("invalid vector comparison resulting type");
debug_generic_expr (type);
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 72ecfe9a8c8..a4c9367d9c6 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -722,11 +722,11 @@ canonicalize_base_object_address (tree addr)
}
/* Analyzes the behavior of the memory reference DR in the innermost loop or
- basic block that contains it. Returns true if analysis succeed or false
+ basic block that contains it. Returns true if analysis succeed or false
otherwise. */
bool
-dr_analyze_innermost (struct data_reference *dr)
+dr_analyze_innermost (struct data_reference *dr, struct loop *nest)
{
gimple stmt = DR_STMT (dr);
struct loop *loop = loop_containing_stmt (stmt);
@@ -769,14 +769,25 @@ dr_analyze_innermost (struct data_reference *dr)
}
else
base = build_fold_addr_expr (base);
+
if (in_loop)
{
if (!simple_iv (loop, loop_containing_stmt (stmt), base, &base_iv,
false))
{
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "failed: evolution of base is not affine.\n");
- return false;
+ if (nest)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "failed: evolution of base is not"
+ " affine.\n");
+ return false;
+ }
+ else
+ {
+ base_iv.base = base;
+ base_iv.step = ssize_int (0);
+ base_iv.no_overflow = true;
+ }
}
}
else
@@ -801,10 +812,18 @@ dr_analyze_innermost (struct data_reference *dr)
else if (!simple_iv (loop, loop_containing_stmt (stmt),
poffset, &offset_iv, false))
{
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "failed: evolution of offset is not"
- " affine.\n");
- return false;
+ if (nest)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "failed: evolution of offset is not"
+ " affine.\n");
+ return false;
+ }
+ else
+ {
+ offset_iv.base = poffset;
+ offset_iv.step = ssize_int (0);
+ }
}
}
@@ -972,7 +991,7 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple stmt,
DR_REF (dr) = memref;
DR_IS_READ (dr) = is_read;
- dr_analyze_innermost (dr);
+ dr_analyze_innermost (dr, nest);
dr_analyze_indices (dr, nest, loop);
dr_analyze_alias (dr);
@@ -5150,7 +5169,7 @@ stmt_with_adjacent_zero_store_dr_p (gimple stmt)
DR_STMT (dr) = stmt;
DR_REF (dr) = op0;
- res = dr_analyze_innermost (dr)
+ res = dr_analyze_innermost (dr, loop_containing_stmt (stmt))
&& stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0));
free_data_ref (dr);
@@ -5190,7 +5209,7 @@ ref_base_address (gimple stmt, data_ref_loc *ref)
DR_STMT (dr) = stmt;
DR_REF (dr) = *ref->pos;
- dr_analyze_innermost (dr);
+ dr_analyze_innermost (dr, loop_containing_stmt (stmt));
base_address = DR_BASE_ADDRESS (dr);
if (!base_address)
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 86f056884ea..c55bd48a81e 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -386,7 +386,7 @@ DEF_VEC_O (data_ref_loc);
DEF_VEC_ALLOC_O (data_ref_loc, heap);
bool get_references_in_stmt (gimple, VEC (data_ref_loc, heap) **);
-bool dr_analyze_innermost (struct data_reference *);
+bool dr_analyze_innermost (struct data_reference *, struct loop *);
extern bool compute_data_dependences_for_loop (struct loop *, bool,
VEC (loop_p, heap) **,
VEC (data_reference_p, heap) **,
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index f10d72d1d68..3a582678f33 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3863,8 +3863,15 @@ cleanup_empty_eh (eh_landing_pad lp)
return cleanup_empty_eh_unsplit (bb, e_out, lp);
}
- /* The block should consist only of a single RESX statement. */
+ /* The block should consist only of a single RESX statement, modulo a
+ preceding call to __builtin_stack_restore if there is no outgoing
+ edge, since the call can be eliminated in this case. */
resx = gsi_stmt (gsi);
+ if (!e_out && gimple_call_builtin_p (resx, BUILT_IN_STACK_RESTORE))
+ {
+ gsi_next (&gsi);
+ resx = gsi_stmt (gsi);
+ }
if (!is_gimple_resx (resx))
return false;
gcc_assert (gsi_one_before_end_p (gsi));
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index f1db27a007d..fd633b4d320 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -268,7 +268,7 @@ generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
DR_STMT (dr) = stmt;
DR_REF (dr) = op0;
- res = dr_analyze_innermost (dr);
+ res = dr_analyze_innermost (dr, loop_containing_stmt (stmt));
gcc_assert (res && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0)));
nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list);
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index b1767584da8..851bba914fa 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -1250,13 +1250,10 @@ compute_object_sizes (void)
if (!update_call_from_tree (&i, result))
gcc_unreachable ();
- /* NOTE: In the pre-tuples code, we called update_stmt here. This is
- now handled by gsi_replace, called from update_call_from_tree. */
-
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "to\n ");
- print_gimple_stmt (dump_file, call, 0, dump_flags);
+ print_gimple_stmt (dump_file, gsi_stmt (i), 0, dump_flags);
fprintf (dump_file, "\n");
}
}
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index f5de1f6c9b2..df1e24c7906 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -401,6 +401,7 @@ extern struct gimple_opt_pass pass_call_cdce;
extern struct gimple_opt_pass pass_merge_phi;
extern struct gimple_opt_pass pass_split_crit_edges;
extern struct gimple_opt_pass pass_pre;
+extern unsigned int tail_merge_optimize (unsigned int);
extern struct gimple_opt_pass pass_profile;
extern struct gimple_opt_pass pass_strip_predict_hints;
extern struct gimple_opt_pass pass_lower_complex_O0;
@@ -412,6 +413,7 @@ extern struct gimple_opt_pass pass_diagnose_omp_blocks;
extern struct gimple_opt_pass pass_expand_omp;
extern struct gimple_opt_pass pass_expand_omp_ssa;
extern struct gimple_opt_pass pass_object_sizes;
+extern struct gimple_opt_pass pass_strlen;
extern struct gimple_opt_pass pass_fold_builtins;
extern struct gimple_opt_pass pass_stdarg;
extern struct gimple_opt_pass pass_early_warn_uninitialized;
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 7dfb480e9e1..c55c89e9b71 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1116,7 +1116,7 @@ find_looparound_phi (struct loop *loop, dref ref, dref root)
memset (&init_dr, 0, sizeof (struct data_reference));
DR_REF (&init_dr) = init_ref;
DR_STMT (&init_dr) = phi;
- if (!dr_analyze_innermost (&init_dr))
+ if (!dr_analyze_innermost (&init_dr, loop))
return NULL;
if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref))
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 6c32923852e..2077c8dc9f3 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -3172,8 +3172,8 @@ simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op,
iv->no_overflow = false;
type = TREE_TYPE (op);
- if (TREE_CODE (type) != INTEGER_TYPE
- && TREE_CODE (type) != POINTER_TYPE)
+ if (!POINTER_TYPE_P (type)
+ && !INTEGRAL_TYPE_P (type))
return false;
ev = analyze_scalar_evolution_in_loop (wrto_loop, use_loop, op,
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index c85a7f51206..c83f480643c 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1504,7 +1504,7 @@ build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset,
offset -= TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (fld));
exp_type = TREE_TYPE (TREE_OPERAND (model->expr, 0));
t = build_ref_for_offset (loc, base, offset, exp_type, gsi, insert_after);
- return fold_build3_loc (loc, COMPONENT_REF, model->type, t, fld,
+ return fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (fld), t, fld,
TREE_OPERAND (model->expr, 2));
}
else
@@ -4622,6 +4622,7 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
VEC (cgraph_edge_p, heap) * redirect_callers = collect_callers_of_node (node);
rebuild_cgraph_edges ();
+ free_dominance_info (CDI_DOMINATORS);
pop_cfun ();
current_function_decl = NULL_TREE;
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 10c529b114f..82307decaf4 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1178,8 +1178,20 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
&& DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (callee))
{
- /* All the following functions clobber memory pointed to by
- their first argument. */
+ /* All the following functions read memory pointed to by
+ their second argument. strcat/strncat additionally
+ reads memory pointed to by the first argument. */
+ case BUILT_IN_STRCAT:
+ case BUILT_IN_STRNCAT:
+ {
+ ao_ref dref;
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 0),
+ NULL_TREE);
+ if (refs_may_alias_p_1 (&dref, ref, false))
+ return true;
+ }
+ /* FALLTHRU */
case BUILT_IN_STRCPY:
case BUILT_IN_STRNCPY:
case BUILT_IN_MEMCPY:
@@ -1187,8 +1199,6 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
case BUILT_IN_MEMPCPY:
case BUILT_IN_STPCPY:
case BUILT_IN_STPNCPY:
- case BUILT_IN_STRCAT:
- case BUILT_IN_STRNCAT:
{
ao_ref dref;
tree size = NULL_TREE;
@@ -1199,14 +1209,23 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ case BUILT_IN_STRCAT_CHK:
+ case BUILT_IN_STRNCAT_CHK:
+ {
+ ao_ref dref;
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 0),
+ NULL_TREE);
+ if (refs_may_alias_p_1 (&dref, ref, false))
+ return true;
+ }
+ /* FALLTHRU */
case BUILT_IN_STRCPY_CHK:
case BUILT_IN_STRNCPY_CHK:
case BUILT_IN_MEMCPY_CHK:
case BUILT_IN_MEMMOVE_CHK:
case BUILT_IN_MEMPCPY_CHK:
case BUILT_IN_STPCPY_CHK:
- case BUILT_IN_STRCAT_CHK:
- case BUILT_IN_STRNCAT_CHK:
{
ao_ref dref;
tree size = NULL_TREE;
@@ -1226,6 +1245,19 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ /* These read memory pointed to by the first argument. */
+ case BUILT_IN_STRDUP:
+ case BUILT_IN_STRNDUP:
+ {
+ ao_ref dref;
+ tree size = NULL_TREE;
+ if (gimple_call_num_args (call) == 2)
+ size = gimple_call_arg (call, 1);
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 0),
+ size);
+ return refs_may_alias_p_1 (&dref, ref, false);
+ }
/* The following builtins do not read from memory. */
case BUILT_IN_FREE:
case BUILT_IN_MALLOC:
@@ -1467,7 +1499,12 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
{
ao_ref dref;
tree size = NULL_TREE;
- if (gimple_call_num_args (call) == 3)
+ /* Don't pass in size for strncat, as the maximum size
+ is strlen (dest) + n + 1 instead of n, resp.
+ n + 1 at dest + strlen (dest), but strlen (dest) isn't
+ known. */
+ if (gimple_call_num_args (call) == 3
+ && DECL_FUNCTION_CODE (callee) != BUILT_IN_STRNCAT)
size = gimple_call_arg (call, 2);
ao_ref_init_from_ptr_and_size (&dref,
gimple_call_arg (call, 0),
@@ -1486,7 +1523,12 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
{
ao_ref dref;
tree size = NULL_TREE;
- if (gimple_call_num_args (call) == 4)
+ /* Don't pass in size for __strncat_chk, as the maximum size
+ is strlen (dest) + n + 1 instead of n, resp.
+ n + 1 at dest + strlen (dest), but strlen (dest) isn't
+ known. */
+ if (gimple_call_num_args (call) == 4
+ && DECL_FUNCTION_CODE (callee) != BUILT_IN_STRNCAT_CHK)
size = gimple_call_arg (call, 2);
ao_ref_init_from_ptr_and_size (&dref,
gimple_call_arg (call, 0),
@@ -1506,6 +1548,8 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
being the definition point for the pointer. */
case BUILT_IN_MALLOC:
case BUILT_IN_CALLOC:
+ case BUILT_IN_STRDUP:
+ case BUILT_IN_STRNDUP:
/* Unix98 specifies that errno is set on allocation failure. */
if (flag_errno_math
&& targetm.ref_may_alias_errno (ref))
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index 75e4303a7ab..c2ab2113c1e 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -126,6 +126,7 @@ extern void dump_alias_stats (FILE *);
/* In tree-ssa-structalias.c */
extern unsigned int compute_may_aliases (void);
extern bool pt_solution_empty_p (struct pt_solution *);
+extern bool pt_solution_singleton_p (struct pt_solution *, unsigned *);
extern bool pt_solution_includes_global (struct pt_solution *);
extern bool pt_solution_includes (struct pt_solution *, const_tree);
extern bool pt_solutions_intersect (struct pt_solution *, struct pt_solution *);
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index fc59d386cad..b5774040e32 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1729,6 +1729,17 @@ fold_builtin_alloca_for_var (gimple stmt)
array_type = build_array_type_nelts (elem_type, n_elem);
var = create_tmp_var (array_type, NULL);
DECL_ALIGN (var) = align;
+ {
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (lhs);
+ if (pi != NULL && !pi->pt.anything)
+ {
+ bool singleton_p;
+ unsigned uid;
+ singleton_p = pt_solution_singleton_p (&pi->pt, &uid);
+ gcc_assert (singleton_p);
+ SET_DECL_PT_UID (var, uid);
+ }
+ }
/* Fold alloca to the address of the array. */
return fold_convert (TREE_TYPE (lhs), build_fold_addr_expr (var));
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index bee6ef52c6c..a7f6cee35d8 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3085,11 +3085,15 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
stmts, domstmt);
if (!genop[i])
return NULL_TREE;
- /* Ensure genop[1] is a ptrofftype for POINTER_PLUS_EXPR. It
- may be a constant with the wrong type. */
- if (i == 1
- && nary->opcode == POINTER_PLUS_EXPR)
- genop[i] = convert_to_ptrofftype (genop[i]);
+ /* Ensure genop[] is properly typed for POINTER_PLUS_EXPR. It
+ may have conversions stripped. */
+ if (nary->opcode == POINTER_PLUS_EXPR)
+ {
+ if (i == 0)
+ genop[i] = fold_convert (nary->type, genop[i]);
+ else if (i == 1)
+ genop[i] = convert_to_ptrofftype (genop[i]);
+ }
else
genop[i] = fold_convert (TREE_TYPE (nary->op[i]), genop[i]);
}
@@ -4911,7 +4915,6 @@ execute_pre (bool do_fre)
statistics_counter_event (cfun, "Constified", pre_stats.constified);
clear_expression_ids ();
- free_scc_vn ();
if (!do_fre)
{
remove_dead_inserted_code ();
@@ -4921,6 +4924,17 @@ execute_pre (bool do_fre)
scev_finalize ();
fini_pre (do_fre);
+ if (!do_fre)
+ /* TODO: tail_merge_optimize may merge all predecessors of a block, in which
+ case we can merge the block with the remaining predecessor of the block.
+ It should either:
+ - call merge_blocks after each tail merge iteration
+ - call merge_blocks after all tail merge iterations
+ - mark TODO_cleanup_cfg when necessary
+ - share the cfg cleanup with fini_pre. */
+ todo |= tail_merge_optimize (todo);
+ free_scc_vn ();
+
return todo;
}
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 7741db88686..05abaa58549 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -1,5 +1,5 @@
/* Generic SSA value propagation engine.
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
@@ -673,6 +673,40 @@ move_ssa_defining_stmt_for_defs (gimple new_stmt, gimple old_stmt)
}
}
+/* Helper function for update_gimple_call and update_call_from_tree.
+ A GIMPLE_CALL STMT is being replaced with GIMPLE_CALL NEW_STMT. */
+
+static void
+finish_update_gimple_call (gimple_stmt_iterator *si_p, gimple new_stmt,
+ gimple stmt)
+{
+ gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+ gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+ gimple_set_location (new_stmt, gimple_location (stmt));
+ if (gimple_block (new_stmt) == NULL_TREE)
+ gimple_set_block (new_stmt, gimple_block (stmt));
+ gsi_replace (si_p, new_stmt, false);
+}
+
+/* Update a GIMPLE_CALL statement at iterator *SI_P to call to FN
+ with number of arguments NARGS, where the arguments in GIMPLE form
+ follow NARGS argument. */
+
+bool
+update_gimple_call (gimple_stmt_iterator *si_p, tree fn, int nargs, ...)
+{
+ va_list ap;
+ gimple new_stmt, stmt = gsi_stmt (*si_p);
+
+ gcc_assert (is_gimple_call (stmt));
+ va_start (ap, nargs);
+ new_stmt = gimple_build_call_valist (fn, nargs, ap);
+ finish_update_gimple_call (si_p, new_stmt, stmt);
+ va_end (ap);
+ return true;
+}
/* Update a GIMPLE_CALL statement at iterator *SI_P to reflect the
value of EXPR, which is expected to be the result of folding the
@@ -689,14 +723,8 @@ move_ssa_defining_stmt_for_defs (gimple new_stmt, gimple old_stmt)
bool
update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
{
- tree lhs;
-
gimple stmt = gsi_stmt (*si_p);
- gcc_assert (is_gimple_call (stmt));
-
- lhs = gimple_call_lhs (stmt);
-
if (valid_gimple_call_p (expr))
{
/* The call has simplified to another call. */
@@ -716,18 +744,14 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
}
new_stmt = gimple_build_call_vec (fn, args);
- gimple_call_set_lhs (new_stmt, lhs);
- move_ssa_defining_stmt_for_defs (new_stmt, stmt);
- gimple_set_vuse (new_stmt, gimple_vuse (stmt));
- gimple_set_vdef (new_stmt, gimple_vdef (stmt));
- gimple_set_location (new_stmt, gimple_location (stmt));
- gsi_replace (si_p, new_stmt, false);
+ finish_update_gimple_call (si_p, new_stmt, stmt);
VEC_free (tree, heap, args);
return true;
}
else if (valid_gimple_rhs_p (expr))
{
+ tree lhs = gimple_call_lhs (stmt);
gimple new_stmt;
/* The call has simplified to an expression
diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h
index 778f650d030..86e22e6ca5c 100644
--- a/gcc/tree-ssa-propagate.h
+++ b/gcc/tree-ssa-propagate.h
@@ -1,6 +1,7 @@
/* Data structures and function declarations for the SSA value propagation
engine.
- Copyright (C) 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2010, 2011
+ Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -72,6 +73,7 @@ typedef tree (*ssa_prop_get_value_fn) (tree);
void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
bool valid_gimple_rhs_p (tree);
void move_ssa_defining_stmt_for_defs (gimple, gimple);
+bool update_gimple_call (gimple_stmt_iterator *, tree, int, ...);
bool update_call_from_tree (gimple_stmt_iterator *, tree);
bool stmt_makes_single_store (gimple);
bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn, bool);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 03e06724266..f7c21e70eb8 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "target.h"
#include "params.h"
+#include "diagnostic-core.h"
/* This is a simple global reassociation pass. It is, in part, based
on the LLVM pass of the same name (They do some things more/less
@@ -1568,6 +1569,457 @@ optimize_ops_list (enum tree_code opcode,
optimize_ops_list (opcode, ops);
}
+/* The following functions are subroutines to optimize_range_tests and allow
+ it to try to change a logical combination of comparisons into a range
+ test.
+
+ For example, both
+ X == 2 || X == 5 || X == 3 || X == 4
+ and
+ X >= 2 && X <= 5
+ are converted to
+ (unsigned) (X - 2) <= 3
+
+ For more information see comments above fold_test_range in fold-const.c,
+ this implementation is for GIMPLE. */
+
+struct range_entry
+{
+ tree exp;
+ tree low;
+ tree high;
+ bool in_p;
+ bool strict_overflow_p;
+ unsigned int idx, next;
+};
+
+/* This is similar to make_range in fold-const.c, but on top of
+ GIMPLE instead of trees. */
+
+static void
+init_range_entry (struct range_entry *r, tree exp)
+{
+ int in_p;
+ tree low, high;
+ bool is_bool, strict_overflow_p;
+
+ r->exp = NULL_TREE;
+ r->in_p = false;
+ r->strict_overflow_p = false;
+ r->low = NULL_TREE;
+ r->high = NULL_TREE;
+ if (TREE_CODE (exp) != SSA_NAME || !INTEGRAL_TYPE_P (TREE_TYPE (exp)))
+ return;
+
+ /* Start with simply saying "EXP != 0" and then look at the code of EXP
+ and see if we can refine the range. Some of the cases below may not
+ happen, but it doesn't seem worth worrying about this. We "continue"
+ the outer loop when we've changed something; otherwise we "break"
+ the switch, which will "break" the while. */
+ low = build_int_cst (TREE_TYPE (exp), 0);
+ high = low;
+ in_p = 0;
+ strict_overflow_p = false;
+ is_bool = false;
+ if (TYPE_PRECISION (TREE_TYPE (exp)) == 1)
+ {
+ if (TYPE_UNSIGNED (TREE_TYPE (exp)))
+ is_bool = true;
+ else
+ return;
+ }
+ else if (TREE_CODE (TREE_TYPE (exp)) == BOOLEAN_TYPE)
+ is_bool = true;
+
+ while (1)
+ {
+ gimple stmt;
+ enum tree_code code;
+ tree arg0, arg1, exp_type;
+ tree nexp;
+ location_t loc;
+
+ if (TREE_CODE (exp) != SSA_NAME)
+ break;
+
+ stmt = SSA_NAME_DEF_STMT (exp);
+ if (!is_gimple_assign (stmt))
+ break;
+
+ code = gimple_assign_rhs_code (stmt);
+ arg0 = gimple_assign_rhs1 (stmt);
+ arg1 = gimple_assign_rhs2 (stmt);
+ exp_type = TREE_TYPE (exp);
+ loc = gimple_location (stmt);
+ switch (code)
+ {
+ case BIT_NOT_EXPR:
+ if (TREE_CODE (TREE_TYPE (exp)) == BOOLEAN_TYPE)
+ {
+ in_p = !in_p;
+ exp = arg0;
+ continue;
+ }
+ break;
+ case SSA_NAME:
+ exp = arg0;
+ continue;
+ CASE_CONVERT:
+ if (is_bool)
+ goto do_default;
+ if (TYPE_PRECISION (TREE_TYPE (arg0)) == 1)
+ {
+ if (TYPE_UNSIGNED (TREE_TYPE (arg0)))
+ is_bool = true;
+ else
+ return;
+ }
+ else if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE)
+ is_bool = true;
+ goto do_default;
+ case EQ_EXPR:
+ case NE_EXPR:
+ case LT_EXPR:
+ case LE_EXPR:
+ case GE_EXPR:
+ case GT_EXPR:
+ is_bool = true;
+ /* FALLTHRU */
+ default:
+ if (!is_bool)
+ return;
+ do_default:
+ nexp = make_range_step (loc, code, arg0, arg1, exp_type,
+ &low, &high, &in_p,
+ &strict_overflow_p);
+ if (nexp != NULL_TREE)
+ {
+ exp = nexp;
+ gcc_assert (TREE_CODE (exp) == SSA_NAME);
+ continue;
+ }
+ break;
+ }
+ break;
+ }
+ if (is_bool)
+ {
+ r->exp = exp;
+ r->in_p = in_p;
+ r->low = low;
+ r->high = high;
+ r->strict_overflow_p = strict_overflow_p;
+ }
+}
+
+/* Comparison function for qsort. Sort entries
+ without SSA_NAME exp first, then with SSA_NAMEs sorted
+ by increasing SSA_NAME_VERSION, and for the same SSA_NAMEs
+ by increasing ->low and if ->low is the same, by increasing
+ ->high. ->low == NULL_TREE means minimum, ->high == NULL_TREE
+ maximum. */
+
+static int
+range_entry_cmp (const void *a, const void *b)
+{
+ const struct range_entry *p = (const struct range_entry *) a;
+ const struct range_entry *q = (const struct range_entry *) b;
+
+ if (p->exp != NULL_TREE && TREE_CODE (p->exp) == SSA_NAME)
+ {
+ if (q->exp != NULL_TREE && TREE_CODE (q->exp) == SSA_NAME)
+ {
+ /* Group range_entries for the same SSA_NAME together. */
+ if (SSA_NAME_VERSION (p->exp) < SSA_NAME_VERSION (q->exp))
+ return -1;
+ else if (SSA_NAME_VERSION (p->exp) > SSA_NAME_VERSION (q->exp))
+ return 1;
+ /* If ->low is different, NULL low goes first, then by
+ ascending low. */
+ if (p->low != NULL_TREE)
+ {
+ if (q->low != NULL_TREE)
+ {
+ tree tem = fold_binary (LT_EXPR, boolean_type_node,
+ p->low, q->low);
+ if (tem && integer_onep (tem))
+ return -1;
+ tem = fold_binary (GT_EXPR, boolean_type_node,
+ p->low, q->low);
+ if (tem && integer_onep (tem))
+ return 1;
+ }
+ else
+ return 1;
+ }
+ else if (q->low != NULL_TREE)
+ return -1;
+ /* If ->high is different, NULL high goes last, before that by
+ ascending high. */
+ if (p->high != NULL_TREE)
+ {
+ if (q->high != NULL_TREE)
+ {
+ tree tem = fold_binary (LT_EXPR, boolean_type_node,
+ p->high, q->high);
+ if (tem && integer_onep (tem))
+ return -1;
+ tem = fold_binary (GT_EXPR, boolean_type_node,
+ p->high, q->high);
+ if (tem && integer_onep (tem))
+ return 1;
+ }
+ else
+ return -1;
+ }
+ else if (p->high != NULL_TREE)
+ return 1;
+ /* If both ranges are the same, sort below by ascending idx. */
+ }
+ else
+ return 1;
+ }
+ else if (q->exp != NULL_TREE && TREE_CODE (q->exp) == SSA_NAME)
+ return -1;
+
+ if (p->idx < q->idx)
+ return -1;
+ else
+ {
+ gcc_checking_assert (p->idx > q->idx);
+ return 1;
+ }
+}
+
+/* Helper routine of optimize_range_test.
+ [EXP, IN_P, LOW, HIGH, STRICT_OVERFLOW_P] is a merged range for
+ RANGE and OTHERRANGE through OTHERRANGE + COUNT - 1 ranges,
+ OPCODE and OPS are arguments of optimize_range_tests. Return
+ true if the range merge has been successful. */
+
+static bool
+update_range_test (struct range_entry *range, struct range_entry *otherrange,
+ unsigned int count, enum tree_code opcode,
+ VEC (operand_entry_t, heap) **ops, tree exp, bool in_p,
+ tree low, tree high, bool strict_overflow_p)
+{
+ tree op = VEC_index (operand_entry_t, *ops, range->idx)->op;
+ location_t loc = gimple_location (SSA_NAME_DEF_STMT (op));
+ tree tem = build_range_check (loc, TREE_TYPE (op), exp, in_p, low, high);
+ enum warn_strict_overflow_code wc = WARN_STRICT_OVERFLOW_COMPARISON;
+ gimple_stmt_iterator gsi;
+
+ if (tem == NULL_TREE)
+ return false;
+
+ if (strict_overflow_p && issue_strict_overflow_warning (wc))
+ warning_at (loc, OPT_Wstrict_overflow,
+ "assuming signed overflow does not occur "
+ "when simplifying range test");
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ struct range_entry *r;
+ fprintf (dump_file, "Optimizing range tests ");
+ print_generic_expr (dump_file, range->exp, 0);
+ fprintf (dump_file, " %c[", range->in_p ? '+' : '-');
+ print_generic_expr (dump_file, range->low, 0);
+ fprintf (dump_file, ", ");
+ print_generic_expr (dump_file, range->high, 0);
+ fprintf (dump_file, "]");
+ for (r = otherrange; r < otherrange + count; r++)
+ {
+ fprintf (dump_file, " and %c[", r->in_p ? '+' : '-');
+ print_generic_expr (dump_file, r->low, 0);
+ fprintf (dump_file, ", ");
+ print_generic_expr (dump_file, r->high, 0);
+ fprintf (dump_file, "]");
+ }
+ fprintf (dump_file, "\n into ");
+ print_generic_expr (dump_file, tem, 0);
+ fprintf (dump_file, "\n");
+ }
+
+ if (opcode == BIT_IOR_EXPR)
+ tem = invert_truthvalue_loc (loc, tem);
+
+ tem = fold_convert_loc (loc, TREE_TYPE (op), tem);
+ gsi = gsi_for_stmt (SSA_NAME_DEF_STMT (op));
+ tem = force_gimple_operand_gsi (&gsi, tem, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+
+ VEC_index (operand_entry_t, *ops, range->idx)->op = tem;
+ range->exp = exp;
+ range->low = low;
+ range->high = high;
+ range->in_p = in_p;
+ range->strict_overflow_p = false;
+
+ for (range = otherrange; range < otherrange + count; range++)
+ {
+ VEC_index (operand_entry_t, *ops, range->idx)->op = error_mark_node;
+ range->exp = NULL_TREE;
+ }
+ return true;
+}
+
+/* Optimize range tests, similarly how fold_range_test optimizes
+ it on trees. The tree code for the binary
+ operation between all the operands is OPCODE. */
+
+static void
+optimize_range_tests (enum tree_code opcode,
+ VEC (operand_entry_t, heap) **ops)
+{
+ unsigned int length = VEC_length (operand_entry_t, *ops), i, j, first;
+ operand_entry_t oe;
+ struct range_entry *ranges;
+ bool any_changes = false;
+
+ if (length == 1)
+ return;
+
+ ranges = XNEWVEC (struct range_entry, length);
+ for (i = 0; i < length; i++)
+ {
+ ranges[i].idx = i;
+ init_range_entry (ranges + i, VEC_index (operand_entry_t, *ops, i)->op);
+ /* For | invert it now, we will invert it again before emitting
+ the optimized expression. */
+ if (opcode == BIT_IOR_EXPR)
+ ranges[i].in_p = !ranges[i].in_p;
+ }
+
+ qsort (ranges, length, sizeof (*ranges), range_entry_cmp);
+ for (i = 0; i < length; i++)
+ if (ranges[i].exp != NULL_TREE && TREE_CODE (ranges[i].exp) == SSA_NAME)
+ break;
+
+ /* Try to merge ranges. */
+ for (first = i; i < length; i++)
+ {
+ tree low = ranges[i].low;
+ tree high = ranges[i].high;
+ int in_p = ranges[i].in_p;
+ bool strict_overflow_p = ranges[i].strict_overflow_p;
+ int update_fail_count = 0;
+
+ for (j = i + 1; j < length; j++)
+ {
+ if (ranges[i].exp != ranges[j].exp)
+ break;
+ if (!merge_ranges (&in_p, &low, &high, in_p, low, high,
+ ranges[j].in_p, ranges[j].low, ranges[j].high))
+ break;
+ strict_overflow_p |= ranges[j].strict_overflow_p;
+ }
+
+ if (j == i + 1)
+ continue;
+
+ if (update_range_test (ranges + i, ranges + i + 1, j - i - 1, opcode,
+ ops, ranges[i].exp, in_p, low, high,
+ strict_overflow_p))
+ {
+ i = j - 1;
+ any_changes = true;
+ }
+ /* Avoid quadratic complexity if all merge_ranges calls would succeed,
+ while update_range_test would fail. */
+ else if (update_fail_count == 64)
+ i = j - 1;
+ else
+ ++update_fail_count;
+ }
+
+ /* Optimize X == CST1 || X == CST2
+ if popcount (CST1 ^ CST2) == 1 into
+ (X & ~(CST1 ^ CST2)) == (CST1 & ~(CST1 ^ CST2)).
+ Similarly for ranges. E.g.
+ X != 2 && X != 3 && X != 10 && X != 11
+ will be transformed by the above loop into
+ (X - 2U) <= 1U && (X - 10U) <= 1U
+ and this loop can transform that into
+ ((X & ~8) - 2U) <= 1U. */
+ for (i = first; i < length; i++)
+ {
+ tree lowi, highi, lowj, highj, type, lowxor, highxor, tem, exp;
+
+ if (ranges[i].exp == NULL_TREE || ranges[i].in_p)
+ continue;
+ type = TREE_TYPE (ranges[i].exp);
+ if (!INTEGRAL_TYPE_P (type))
+ continue;
+ lowi = ranges[i].low;
+ if (lowi == NULL_TREE)
+ lowi = TYPE_MIN_VALUE (type);
+ highi = ranges[i].high;
+ if (highi == NULL_TREE)
+ continue;
+ for (j = i + 1; j < length && j < i + 64; j++)
+ {
+ if (ranges[j].exp == NULL_TREE)
+ continue;
+ if (ranges[i].exp != ranges[j].exp)
+ break;
+ if (ranges[j].in_p)
+ continue;
+ lowj = ranges[j].low;
+ if (lowj == NULL_TREE)
+ continue;
+ highj = ranges[j].high;
+ if (highj == NULL_TREE)
+ highj = TYPE_MAX_VALUE (type);
+ tem = fold_binary (GT_EXPR, boolean_type_node,
+ lowj, highi);
+ if (tem == NULL_TREE || !integer_onep (tem))
+ continue;
+ lowxor = fold_binary (BIT_XOR_EXPR, type, lowi, lowj);
+ if (lowxor == NULL_TREE || TREE_CODE (lowxor) != INTEGER_CST)
+ continue;
+ gcc_checking_assert (!integer_zerop (lowxor));
+ tem = fold_binary (MINUS_EXPR, type, lowxor,
+ build_int_cst (type, 1));
+ if (tem == NULL_TREE)
+ continue;
+ tem = fold_binary (BIT_AND_EXPR, type, lowxor, tem);
+ if (tem == NULL_TREE || !integer_zerop (tem))
+ continue;
+ highxor = fold_binary (BIT_XOR_EXPR, type, highi, highj);
+ if (!tree_int_cst_equal (lowxor, highxor))
+ continue;
+ tem = fold_build1 (BIT_NOT_EXPR, type, lowxor);
+ exp = fold_build2 (BIT_AND_EXPR, type, ranges[i].exp, tem);
+ lowj = fold_build2 (BIT_AND_EXPR, type, lowi, tem);
+ highj = fold_build2 (BIT_AND_EXPR, type, highi, tem);
+ if (update_range_test (ranges + i, ranges + j, 1, opcode, ops, exp,
+ ranges[i].in_p, lowj, highj,
+ ranges[i].strict_overflow_p
+ || ranges[j].strict_overflow_p))
+ {
+ any_changes = true;
+ break;
+ }
+ }
+ }
+
+ if (any_changes)
+ {
+ j = 0;
+ FOR_EACH_VEC_ELT (operand_entry_t, *ops, i, oe)
+ {
+ if (oe->op == error_mark_node)
+ continue;
+ else if (i != j)
+ VEC_replace (operand_entry_t, *ops, j, oe);
+ j++;
+ }
+ VEC_truncate (operand_entry_t, *ops, j);
+ }
+
+ XDELETEVEC (ranges);
+}
+
/* Return true if OPERAND is defined by a PHI node which uses the LHS
of STMT in it's operands. This is also known as a "destructive
update" operation. */
@@ -2447,6 +2899,9 @@ reassociate_bb (basic_block bb)
optimize_ops_list (rhs_code, &ops);
}
+ if (rhs_code == BIT_IOR_EXPR || rhs_code == BIT_AND_EXPR)
+ optimize_range_tests (rhs_code, &ops);
+
if (VEC_length (operand_entry_t, ops) == 1)
{
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 811cb65b424..003804b3ca8 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -2820,19 +2820,6 @@ stmt_has_constants (gimple stmt)
return false;
}
-/* Valueize NAME if it is an SSA name, otherwise just return it. */
-
-static inline tree
-vn_valueize (tree name)
-{
- if (TREE_CODE (name) == SSA_NAME)
- {
- tree tem = SSA_VAL (name);
- return tem == VN_TOP ? name : tem;
- }
- return name;
-}
-
/* Replace SSA_NAMES in expr with their value numbers, and return the
result.
This is performed in place. */
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index 97d7f8f3921..b37b084413d 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -215,4 +215,18 @@ unsigned int get_constant_value_id (tree);
unsigned int get_or_alloc_constant_value_id (tree);
bool value_id_constant_p (unsigned int);
tree fully_constant_vn_reference_p (vn_reference_t);
+
+/* Valueize NAME if it is an SSA name, otherwise just return it. */
+
+static inline tree
+vn_valueize (tree name)
+{
+ if (TREE_CODE (name) == SSA_NAME)
+ {
+ tree tem = VN_INFO (name)->valnum;
+ return tem == VN_TOP ? name : tem;
+ }
+ return name;
+}
+
#endif /* TREE_SSA_SCCVN_H */
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
new file mode 100644
index 00000000000..71cefaaabc8
--- /dev/null
+++ b/gcc/tree-ssa-strlen.c
@@ -0,0 +1,1997 @@
+/* String length optimization
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub@redhat.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, 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 COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree-flow.h"
+#include "tree-pass.h"
+#include "domwalk.h"
+#include "alloc-pool.h"
+#include "tree-ssa-propagate.h"
+#include "gimple-pretty-print.h"
+#include "params.h"
+
+/* A vector indexed by SSA_NAME_VERSION. 0 means unknown, positive value
+ is an index into strinfo vector, negative value stands for
+ string length of a string literal (~strlen). */
+static VEC (int, heap) *ssa_ver_to_stridx;
+
+/* Number of currently active string indexes plus one. */
+static int max_stridx;
+
+/* String information record. */
+typedef struct strinfo_struct
+{
+ /* String length of this string. */
+ tree length;
+ /* Any of the corresponding pointers for querying alias oracle. */
+ tree ptr;
+ /* Statement for delayed length computation. */
+ gimple stmt;
+ /* Pointer to '\0' if known, if NULL, it can be computed as
+ ptr + length. */
+ tree endptr;
+ /* Reference count. Any changes to strinfo entry possibly shared
+ with dominating basic blocks need unshare_strinfo first, except
+ for dont_invalidate which affects only the immediately next
+ maybe_invalidate. */
+ int refcount;
+ /* Copy of index. get_strinfo (si->idx) should return si; */
+ int idx;
+ /* These 3 fields are for chaining related string pointers together.
+ E.g. for
+ bl = strlen (b); dl = strlen (d); strcpy (a, b); c = a + bl;
+ strcpy (c, d); e = c + dl;
+ strinfo(a) -> strinfo(c) -> strinfo(e)
+ All have ->first field equal to strinfo(a)->idx and are doubly
+ chained through prev/next fields. The later strinfos are required
+ to point into the same string with zero or more bytes after
+ the previous pointer and all bytes in between the two pointers
+ must be non-zero. Functions like strcpy or memcpy are supposed
+ to adjust all previous strinfo lengths, but not following strinfo
+ lengths (those are uncertain, usually invalidated during
+ maybe_invalidate, except when the alias oracle knows better).
+ Functions like strcat on the other side adjust the whole
+ related strinfo chain.
+ They are updated lazily, so to use the chain the same first fields
+ and si->prev->next == si->idx needs to be verified. */
+ int first;
+ int next;
+ int prev;
+ /* A flag whether the string is known to be written in the current
+ function. */
+ bool writable;
+ /* A flag for the next maybe_invalidate that this strinfo shouldn't
+ be invalidated. Always cleared by maybe_invalidate. */
+ bool dont_invalidate;
+} *strinfo;
+DEF_VEC_P(strinfo);
+DEF_VEC_ALLOC_P(strinfo,heap);
+
+/* Pool for allocating strinfo_struct entries. */
+static alloc_pool strinfo_pool;
+
+/* Vector mapping positive string indexes to strinfo, for the
+ current basic block. The first pointer in the vector is special,
+ it is either NULL, meaning the vector isn't shared, or it is
+ a basic block pointer to the owner basic_block if shared.
+ If some other bb wants to modify the vector, the vector needs
+ to be unshared first, and only the owner bb is supposed to free it. */
+static VEC(strinfo, heap) *stridx_to_strinfo;
+
+/* One OFFSET->IDX mapping. */
+struct stridxlist
+{
+ struct stridxlist *next;
+ HOST_WIDE_INT offset;
+ int idx;
+};
+
+/* Hash table entry, mapping a DECL to a chain of OFFSET->IDX mappings. */
+struct decl_stridxlist_map
+{
+ struct tree_map_base base;
+ struct stridxlist list;
+};
+
+/* Hash table for mapping decls to a chained list of offset -> idx
+ mappings. */
+static htab_t decl_to_stridxlist_htab;
+
+/* Obstack for struct stridxlist and struct decl_stridxlist_map. */
+static struct obstack stridx_obstack;
+
+/* Last memcpy statement if it could be adjusted if the trailing
+ '\0' written is immediately overwritten, or
+ *x = '\0' store that could be removed if it is immediately overwritten. */
+struct laststmt_struct
+{
+ gimple stmt;
+ tree len;
+ int stridx;
+} laststmt;
+
+/* Hash a from tree in a decl_stridxlist_map. */
+
+static unsigned int
+decl_to_stridxlist_hash (const void *item)
+{
+ return DECL_UID (((const struct decl_stridxlist_map *) item)->base.from);
+}
+
+/* Helper function for get_stridx. */
+
+static int
+get_addr_stridx (tree exp)
+{
+ HOST_WIDE_INT off;
+ struct decl_stridxlist_map ent, *e;
+ struct stridxlist *list;
+ tree base;
+
+ if (decl_to_stridxlist_htab == NULL)
+ return 0;
+
+ base = get_addr_base_and_unit_offset (exp, &off);
+ if (base == NULL || !DECL_P (base))
+ return 0;
+
+ ent.base.from = base;
+ e = (struct decl_stridxlist_map *)
+ htab_find_with_hash (decl_to_stridxlist_htab, &ent, DECL_UID (base));
+ if (e == NULL)
+ return 0;
+
+ list = &e->list;
+ do
+ {
+ if (list->offset == off)
+ return list->idx;
+ list = list->next;
+ }
+ while (list);
+ return 0;
+}
+
+/* Return string index for EXP. */
+
+static int
+get_stridx (tree exp)
+{
+ tree l;
+
+ if (TREE_CODE (exp) == SSA_NAME)
+ return VEC_index (int, ssa_ver_to_stridx, SSA_NAME_VERSION (exp));
+
+ if (TREE_CODE (exp) == ADDR_EXPR)
+ {
+ int idx = get_addr_stridx (TREE_OPERAND (exp, 0));
+ if (idx != 0)
+ return idx;
+ }
+
+ l = c_strlen (exp, 0);
+ if (l != NULL_TREE
+ && host_integerp (l, 1))
+ {
+ unsigned HOST_WIDE_INT len = tree_low_cst (l, 1);
+ if (len == (unsigned int) len
+ && (int) len >= 0)
+ return ~(int) len;
+ }
+ return 0;
+}
+
+/* Return true if strinfo vector is shared with the immediate dominator. */
+
+static inline bool
+strinfo_shared (void)
+{
+ return VEC_length (strinfo, stridx_to_strinfo)
+ && VEC_index (strinfo, stridx_to_strinfo, 0) != NULL;
+}
+
+/* Unshare strinfo vector that is shared with the immediate dominator. */
+
+static void
+unshare_strinfo_vec (void)
+{
+ strinfo si;
+ unsigned int i = 0;
+
+ gcc_assert (strinfo_shared ());
+ stridx_to_strinfo = VEC_copy (strinfo, heap, stridx_to_strinfo);
+ for (i = 1; VEC_iterate (strinfo, stridx_to_strinfo, i, si); ++i)
+ if (si != NULL)
+ si->refcount++;
+ VEC_replace (strinfo, stridx_to_strinfo, 0, NULL);
+}
+
+/* Attempt to create a string index for exp, ADDR_EXPR's operand.
+ Return a pointer to the location where the string index can
+ be stored (if 0) or is stored, or NULL if this can't be tracked. */
+
+static int *
+addr_stridxptr (tree exp)
+{
+ void **slot;
+ struct decl_stridxlist_map ent;
+ struct stridxlist *list;
+ HOST_WIDE_INT off;
+
+ tree base = get_addr_base_and_unit_offset (exp, &off);
+ if (base == NULL_TREE || !DECL_P (base))
+ return NULL;
+
+ if (decl_to_stridxlist_htab == NULL)
+ {
+ decl_to_stridxlist_htab
+ = htab_create (64, decl_to_stridxlist_hash, tree_map_base_eq, NULL);
+ gcc_obstack_init (&stridx_obstack);
+ }
+ ent.base.from = base;
+ slot = htab_find_slot_with_hash (decl_to_stridxlist_htab, &ent,
+ DECL_UID (base), INSERT);
+ if (*slot)
+ {
+ int i;
+ list = &((struct decl_stridxlist_map *)*slot)->list;
+ for (i = 0; i < 16; i++)
+ {
+ if (list->offset == off)
+ return &list->idx;
+ if (list->next == NULL)
+ break;
+ }
+ if (i == 16)
+ return NULL;
+ list->next = XOBNEW (&stridx_obstack, struct stridxlist);
+ list = list->next;
+ }
+ else
+ {
+ struct decl_stridxlist_map *e
+ = XOBNEW (&stridx_obstack, struct decl_stridxlist_map);
+ e->base.from = base;
+ *slot = (void *) e;
+ list = &e->list;
+ }
+ list->next = NULL;
+ list->offset = off;
+ list->idx = 0;
+ return &list->idx;
+}
+
+/* Create a new string index, or return 0 if reached limit. */
+
+static int
+new_stridx (tree exp)
+{
+ int idx;
+ if (max_stridx >= PARAM_VALUE (PARAM_MAX_TRACKED_STRLENS))
+ return 0;
+ if (TREE_CODE (exp) == SSA_NAME)
+ {
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (exp))
+ return 0;
+ idx = max_stridx++;
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (exp), idx);
+ return idx;
+ }
+ if (TREE_CODE (exp) == ADDR_EXPR)
+ {
+ int *pidx = addr_stridxptr (TREE_OPERAND (exp, 0));
+ if (pidx != NULL)
+ {
+ gcc_assert (*pidx == 0);
+ *pidx = max_stridx++;
+ return *pidx;
+ }
+ }
+ return 0;
+}
+
+/* Like new_stridx, but for ADDR_EXPR's operand instead. */
+
+static int
+new_addr_stridx (tree exp)
+{
+ int *pidx;
+ if (max_stridx >= PARAM_VALUE (PARAM_MAX_TRACKED_STRLENS))
+ return 0;
+ pidx = addr_stridxptr (exp);
+ if (pidx != NULL)
+ {
+ gcc_assert (*pidx == 0);
+ *pidx = max_stridx++;
+ return *pidx;
+ }
+ return 0;
+}
+
+/* Create a new strinfo. */
+
+static strinfo
+new_strinfo (tree ptr, int idx, tree length)
+{
+ strinfo si = (strinfo) pool_alloc (strinfo_pool);
+ si->length = length;
+ si->ptr = ptr;
+ si->stmt = NULL;
+ si->endptr = NULL_TREE;
+ si->refcount = 1;
+ si->idx = idx;
+ si->first = 0;
+ si->prev = 0;
+ si->next = 0;
+ si->writable = false;
+ si->dont_invalidate = false;
+ return si;
+}
+
+/* Decrease strinfo refcount and free it if not referenced anymore. */
+
+static inline void
+free_strinfo (strinfo si)
+{
+ if (si && --si->refcount == 0)
+ pool_free (strinfo_pool, si);
+}
+
+/* Return strinfo vector entry IDX. */
+
+static inline strinfo
+get_strinfo (int idx)
+{
+ if (VEC_length (strinfo, stridx_to_strinfo) <= (unsigned int) idx)
+ return NULL;
+ return VEC_index (strinfo, stridx_to_strinfo, idx);
+}
+
+/* Set strinfo in the vector entry IDX to SI. */
+
+static inline void
+set_strinfo (int idx, strinfo si)
+{
+ if (VEC_length (strinfo, stridx_to_strinfo) && VEC_index (strinfo, stridx_to_strinfo, 0))
+ unshare_strinfo_vec ();
+ if (VEC_length (strinfo, stridx_to_strinfo) <= (unsigned int) idx)
+ VEC_safe_grow_cleared (strinfo, heap, stridx_to_strinfo, idx + 1);
+ VEC_replace (strinfo, stridx_to_strinfo, idx, si);
+}
+
+/* Return string length, or NULL if it can't be computed. */
+
+static tree
+get_string_length (strinfo si)
+{
+ if (si->length)
+ return si->length;
+
+ if (si->stmt)
+ {
+ gimple stmt = si->stmt, lenstmt;
+ tree callee, lhs, lhs_var, fn, tem;
+ location_t loc;
+ gimple_stmt_iterator gsi;
+
+ gcc_assert (is_gimple_call (stmt));
+ callee = gimple_call_fndecl (stmt);
+ gcc_assert (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL);
+ lhs = gimple_call_lhs (stmt);
+ gcc_assert (implicit_built_in_decls[BUILT_IN_STRCPY] != NULL_TREE);
+ /* unshare_strinfo is intentionally not called here. The (delayed)
+ transformation of strcpy or strcat into stpcpy is done at the place
+ of the former strcpy/strcat call and so can affect all the strinfos
+ with the same stmt. If they were unshared before and transformation
+ has been already done, the handling of BUILT_IN_STPCPY{,_CHK} should
+ just compute the right length. */
+ switch (DECL_FUNCTION_CODE (callee))
+ {
+ case BUILT_IN_STRCAT:
+ case BUILT_IN_STRCAT_CHK:
+ gsi = gsi_for_stmt (stmt);
+ fn = implicit_built_in_decls[BUILT_IN_STRLEN];
+ gcc_assert (lhs == NULL_TREE);
+ lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
+ add_referenced_var (lhs_var);
+ tem = unshare_expr (gimple_call_arg (stmt, 0));
+ lenstmt = gimple_build_call (fn, 1, tem);
+ lhs = make_ssa_name (lhs_var, lenstmt);
+ gimple_call_set_lhs (lenstmt, lhs);
+ gimple_set_vuse (lenstmt, gimple_vuse (stmt));
+ gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
+ lhs_var = create_tmp_var (TREE_TYPE (gimple_call_arg (stmt, 0)),
+ NULL);
+ add_referenced_var (lhs_var);
+ tem = gimple_call_arg (stmt, 0);
+ lenstmt
+ = gimple_build_assign_with_ops (POINTER_PLUS_EXPR,
+ make_ssa_name (lhs_var, NULL),
+ tem, lhs);
+ gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT);
+ gimple_call_set_arg (stmt, 0, gimple_assign_lhs (lenstmt));
+ lhs = NULL_TREE;
+ /* FALLTHRU */
+ case BUILT_IN_STRCPY:
+ case BUILT_IN_STRCPY_CHK:
+ if (gimple_call_num_args (stmt) == 2)
+ fn = implicit_built_in_decls[BUILT_IN_STPCPY];
+ else
+ fn = built_in_decls[BUILT_IN_STPCPY_CHK];
+ gcc_assert (lhs == NULL_TREE);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "Optimizing: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ gimple_call_set_fndecl (stmt, fn);
+ lhs_var = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
+ add_referenced_var (lhs_var);
+ lhs = make_ssa_name (lhs_var, stmt);
+ gimple_call_set_lhs (stmt, lhs);
+ update_stmt (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ /* FALLTHRU */
+ case BUILT_IN_STPCPY:
+ case BUILT_IN_STPCPY_CHK:
+ gcc_assert (lhs != NULL_TREE);
+ loc = gimple_location (stmt);
+ si->endptr = lhs;
+ si->stmt = NULL;
+ lhs = fold_convert_loc (loc, size_type_node, lhs);
+ si->length = fold_convert_loc (loc, size_type_node, si->ptr);
+ si->length = fold_build2_loc (loc, MINUS_EXPR, size_type_node,
+ lhs, si->length);
+ break;
+ default:
+ gcc_unreachable ();
+ break;
+ }
+ }
+
+ return si->length;
+}
+
+/* Invalidate string length information for strings whose length
+ might change due to stores in stmt. */
+
+static bool
+maybe_invalidate (gimple stmt)
+{
+ strinfo si;
+ unsigned int i;
+ bool nonempty = false;
+
+ for (i = 1; VEC_iterate (strinfo, stridx_to_strinfo, i, si); ++i)
+ if (si != NULL)
+ {
+ if (!si->dont_invalidate)
+ {
+ ao_ref r;
+ ao_ref_init_from_ptr_and_size (&r, si->ptr, NULL_TREE);
+ if (stmt_may_clobber_ref_p_1 (stmt, &r))
+ {
+ set_strinfo (i, NULL);
+ free_strinfo (si);
+ continue;
+ }
+ }
+ si->dont_invalidate = false;
+ nonempty = true;
+ }
+ return nonempty;
+}
+
+/* Unshare strinfo record SI, if it has recount > 1 or
+ if stridx_to_strinfo vector is shared with some other
+ bbs. */
+
+static strinfo
+unshare_strinfo (strinfo si)
+{
+ strinfo nsi;
+
+ if (si->refcount == 1 && !strinfo_shared ())
+ return si;
+
+ nsi = new_strinfo (si->ptr, si->idx, si->length);
+ nsi->stmt = si->stmt;
+ nsi->endptr = si->endptr;
+ nsi->first = si->first;
+ nsi->prev = si->prev;
+ nsi->next = si->next;
+ nsi->writable = si->writable;
+ set_strinfo (si->idx, nsi);
+ free_strinfo (si);
+ return nsi;
+}
+
+/* Return first strinfo in the related strinfo chain
+ if all strinfos in between belong to the chain, otherwise
+ NULL. */
+
+static strinfo
+verify_related_strinfos (strinfo origsi)
+{
+ strinfo si = origsi, psi;
+
+ if (origsi->first == 0)
+ return NULL;
+ for (; si->prev; si = psi)
+ {
+ if (si->first != origsi->first)
+ return NULL;
+ psi = get_strinfo (si->prev);
+ if (psi == NULL)
+ return NULL;
+ if (psi->next != si->idx)
+ return NULL;
+ }
+ if (si->idx != si->first)
+ return NULL;
+ return si;
+}
+
+/* Note that PTR, a pointer SSA_NAME initialized in the current stmt, points
+ to a zero-length string and if possible chain it to a related strinfo
+ chain whose part is or might be CHAINSI. */
+
+static strinfo
+zero_length_string (tree ptr, strinfo chainsi)
+{
+ strinfo si;
+ int idx;
+ gcc_checking_assert (TREE_CODE (ptr) == SSA_NAME
+ && get_stridx (ptr) == 0);
+
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ptr))
+ return NULL;
+ if (chainsi != NULL)
+ {
+ si = verify_related_strinfos (chainsi);
+ if (si)
+ {
+ chainsi = si;
+ for (; chainsi->next; chainsi = si)
+ {
+ if (chainsi->endptr == NULL_TREE)
+ {
+ chainsi = unshare_strinfo (chainsi);
+ chainsi->endptr = ptr;
+ }
+ si = get_strinfo (chainsi->next);
+ if (si == NULL
+ || si->first != chainsi->first
+ || si->prev != chainsi->idx)
+ break;
+ }
+ gcc_assert (chainsi->length);
+ if (chainsi->endptr == NULL_TREE)
+ {
+ chainsi = unshare_strinfo (chainsi);
+ chainsi->endptr = ptr;
+ }
+ if (integer_zerop (chainsi->length))
+ {
+ if (chainsi->next)
+ {
+ chainsi = unshare_strinfo (chainsi);
+ chainsi->next = 0;
+ }
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (ptr),
+ chainsi->idx);
+ return chainsi;
+ }
+ }
+ else if (chainsi->first || chainsi->prev || chainsi->next)
+ {
+ chainsi = unshare_strinfo (chainsi);
+ chainsi->first = 0;
+ chainsi->prev = 0;
+ chainsi->next = 0;
+ }
+ }
+ idx = new_stridx (ptr);
+ if (idx == 0)
+ return NULL;
+ si = new_strinfo (ptr, idx, build_int_cst (size_type_node, 0));
+ set_strinfo (idx, si);
+ si->endptr = ptr;
+ if (chainsi != NULL)
+ {
+ chainsi = unshare_strinfo (chainsi);
+ if (chainsi->first == 0)
+ chainsi->first = chainsi->idx;
+ chainsi->next = idx;
+ si->prev = chainsi->idx;
+ si->first = chainsi->first;
+ si->writable = chainsi->writable;
+ }
+ return si;
+}
+
+/* For strinfo ORIGSI whose length has been just updated
+ update also related strinfo lengths (add ADJ to each,
+ but don't adjust ORIGSI). */
+
+static void
+adjust_related_strinfos (location_t loc, strinfo origsi, tree adj)
+{
+ strinfo si = verify_related_strinfos (origsi);
+
+ if (si == NULL)
+ return;
+
+ while (1)
+ {
+ strinfo nsi;
+
+ if (si != origsi)
+ {
+ tree tem;
+
+ si = unshare_strinfo (si);
+ gcc_assert (si->length);
+ tem = fold_convert_loc (loc, TREE_TYPE (si->length), adj);
+ si->length = fold_build2_loc (loc, PLUS_EXPR,
+ TREE_TYPE (si->length), si->length,
+ tem);
+ si->endptr = NULL_TREE;
+ si->dont_invalidate = true;
+ }
+ if (si->next == 0)
+ return;
+ nsi = get_strinfo (si->next);
+ if (nsi == NULL
+ || nsi->first != si->first
+ || nsi->prev != si->idx)
+ return;
+ si = nsi;
+ }
+}
+
+/* Find if there are other SSA_NAME pointers equal to PTR
+ for which we don't track their string lengths yet. If so, use
+ IDX for them. */
+
+static void
+find_equal_ptrs (tree ptr, int idx)
+{
+ if (TREE_CODE (ptr) != SSA_NAME)
+ return;
+ while (1)
+ {
+ gimple stmt = SSA_NAME_DEF_STMT (ptr);
+ if (!is_gimple_assign (stmt))
+ return;
+ ptr = gimple_assign_rhs1 (stmt);
+ switch (gimple_assign_rhs_code (stmt))
+ {
+ case SSA_NAME:
+ break;
+ case ADDR_EXPR:
+ {
+ int *pidx = addr_stridxptr (TREE_OPERAND (ptr, 0));
+ if (pidx != NULL && *pidx == 0)
+ *pidx = idx;
+ return;
+ }
+ CASE_CONVERT:
+ if (POINTER_TYPE_P (TREE_TYPE (ptr)))
+ break;
+ return;
+ default:
+ return;
+ }
+
+ /* We might find an endptr created in this pass. Grow the
+ vector in that case. */
+ if (VEC_length (int, ssa_ver_to_stridx) <= SSA_NAME_VERSION (ptr))
+ VEC_safe_grow_cleared (int, heap, ssa_ver_to_stridx, num_ssa_names);
+
+ if (VEC_index (int, ssa_ver_to_stridx, SSA_NAME_VERSION (ptr)) != 0)
+ return;
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (ptr), idx);
+ }
+}
+
+/* If the last .MEM setter statement before STMT is
+ memcpy (x, y, strlen (y) + 1), the only .MEM use of it is STMT
+ and STMT is known to overwrite x[strlen (x)], adjust the last memcpy to
+ just memcpy (x, y, strlen (y)). SI must be the zero length
+ strinfo. */
+
+static void
+adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
+{
+ tree vuse, callee, len;
+ struct laststmt_struct last = laststmt;
+ strinfo lastsi, firstsi;
+
+ laststmt.stmt = NULL;
+ laststmt.len = NULL_TREE;
+ laststmt.stridx = 0;
+
+ if (last.stmt == NULL)
+ return;
+
+ vuse = gimple_vuse (stmt);
+ if (vuse == NULL_TREE
+ || SSA_NAME_DEF_STMT (vuse) != last.stmt
+ || !has_single_use (vuse))
+ return;
+
+ gcc_assert (last.stridx > 0);
+ lastsi = get_strinfo (last.stridx);
+ if (lastsi == NULL)
+ return;
+
+ if (lastsi != si)
+ {
+ if (lastsi->first == 0 || lastsi->first != si->first)
+ return;
+
+ firstsi = verify_related_strinfos (si);
+ if (firstsi == NULL)
+ return;
+ while (firstsi != lastsi)
+ {
+ strinfo nextsi;
+ if (firstsi->next == 0)
+ return;
+ nextsi = get_strinfo (firstsi->next);
+ if (nextsi == NULL
+ || nextsi->prev != firstsi->idx
+ || nextsi->first != si->first)
+ return;
+ firstsi = nextsi;
+ }
+ }
+
+ if (!is_strcat)
+ {
+ if (si->length == NULL_TREE || !integer_zerop (si->length))
+ return;
+ }
+
+ if (is_gimple_assign (last.stmt))
+ {
+ gimple_stmt_iterator gsi;
+
+ if (!integer_zerop (gimple_assign_rhs1 (last.stmt)))
+ return;
+ if (stmt_could_throw_p (last.stmt))
+ return;
+ gsi = gsi_for_stmt (last.stmt);
+ unlink_stmt_vdef (last.stmt);
+ release_defs (last.stmt);
+ gsi_remove (&gsi, true);
+ return;
+ }
+
+ if (!is_gimple_call (last.stmt))
+ return;
+ callee = gimple_call_fndecl (last.stmt);
+ if (callee == NULL_TREE || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
+ return;
+
+ switch (DECL_FUNCTION_CODE (callee))
+ {
+ case BUILT_IN_MEMCPY:
+ case BUILT_IN_MEMCPY_CHK:
+ break;
+ default:
+ return;
+ }
+
+ len = gimple_call_arg (last.stmt, 2);
+ if (host_integerp (len, 1))
+ {
+ if (!host_integerp (last.len, 1)
+ || integer_zerop (len)
+ || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
+ != (unsigned HOST_WIDE_INT) tree_low_cst (last.len, 1) + 1)
+ return;
+ /* Don't adjust the length if it is divisible by 4, it is more efficient
+ to store the extra '\0' in that case. */
+ if ((((unsigned HOST_WIDE_INT) tree_low_cst (len, 1)) & 3) == 0)
+ return;
+ }
+ else if (TREE_CODE (len) == SSA_NAME)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (len);
+ if (!is_gimple_assign (def_stmt)
+ || gimple_assign_rhs_code (def_stmt) != PLUS_EXPR
+ || gimple_assign_rhs1 (def_stmt) != last.len
+ || !integer_onep (gimple_assign_rhs2 (def_stmt)))
+ return;
+ }
+ else
+ return;
+
+ gimple_call_set_arg (last.stmt, 2, last.len);
+ update_stmt (last.stmt);
+}
+
+/* Handle a strlen call. If strlen of the argument is known, replace
+ the strlen call with the known value, otherwise remember that strlen
+ of the argument is stored in the lhs SSA_NAME. */
+
+static void
+handle_builtin_strlen (gimple_stmt_iterator *gsi)
+{
+ int idx;
+ tree src;
+ gimple stmt = gsi_stmt (*gsi);
+ tree lhs = gimple_call_lhs (stmt);
+
+ if (lhs == NULL_TREE)
+ return;
+
+ src = gimple_call_arg (stmt, 0);
+ idx = get_stridx (src);
+ if (idx)
+ {
+ strinfo si = NULL;
+ tree rhs;
+
+ if (idx < 0)
+ rhs = build_int_cst (TREE_TYPE (lhs), ~idx);
+ else
+ {
+ rhs = NULL_TREE;
+ si = get_strinfo (idx);
+ if (si != NULL)
+ rhs = get_string_length (si);
+ }
+ if (rhs != NULL_TREE)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "Optimizing: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ rhs = unshare_expr (rhs);
+ if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
+ rhs = fold_convert_loc (gimple_location (stmt),
+ TREE_TYPE (lhs), rhs);
+ if (!update_call_from_tree (gsi, rhs))
+ gimplify_and_update_call_from_tree (gsi, rhs);
+ stmt = gsi_stmt (*gsi);
+ update_stmt (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ if (si != NULL
+ && TREE_CODE (si->length) != SSA_NAME
+ && TREE_CODE (si->length) != INTEGER_CST
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ {
+ si = unshare_strinfo (si);
+ si->length = lhs;
+ }
+ return;
+ }
+ }
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ return;
+ if (idx == 0)
+ idx = new_stridx (src);
+ else if (get_strinfo (idx) != NULL)
+ return;
+ if (idx)
+ {
+ strinfo si = new_strinfo (src, idx, lhs);
+ set_strinfo (idx, si);
+ find_equal_ptrs (src, idx);
+ }
+}
+
+/* Handle a strchr call. If strlen of the first argument is known, replace
+ the strchr (x, 0) call with the endptr or x + strlen, otherwise remember
+ that lhs of the call is endptr and strlen of the argument is endptr - x. */
+
+static void
+handle_builtin_strchr (gimple_stmt_iterator *gsi)
+{
+ int idx;
+ tree src;
+ gimple stmt = gsi_stmt (*gsi);
+ tree lhs = gimple_call_lhs (stmt);
+
+ if (lhs == NULL_TREE)
+ return;
+
+ if (!integer_zerop (gimple_call_arg (stmt, 1)))
+ return;
+
+ src = gimple_call_arg (stmt, 0);
+ idx = get_stridx (src);
+ if (idx)
+ {
+ strinfo si = NULL;
+ tree rhs;
+
+ if (idx < 0)
+ rhs = build_int_cst (size_type_node, ~idx);
+ else
+ {
+ rhs = NULL_TREE;
+ si = get_strinfo (idx);
+ if (si != NULL)
+ rhs = get_string_length (si);
+ }
+ if (rhs != NULL_TREE)
+ {
+ location_t loc = gimple_location (stmt);
+
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "Optimizing: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ if (si != NULL && si->endptr != NULL_TREE)
+ {
+ rhs = unshare_expr (si->endptr);
+ if (!useless_type_conversion_p (TREE_TYPE (lhs),
+ TREE_TYPE (rhs)))
+ rhs = fold_convert_loc (loc, TREE_TYPE (lhs), rhs);
+ }
+ else
+ {
+ rhs = fold_convert_loc (loc, sizetype, unshare_expr (rhs));
+ rhs = fold_build2_loc (loc, POINTER_PLUS_EXPR,
+ TREE_TYPE (src), src, rhs);
+ if (!useless_type_conversion_p (TREE_TYPE (lhs),
+ TREE_TYPE (rhs)))
+ rhs = fold_convert_loc (loc, TREE_TYPE (lhs), rhs);
+ }
+ if (!update_call_from_tree (gsi, rhs))
+ gimplify_and_update_call_from_tree (gsi, rhs);
+ stmt = gsi_stmt (*gsi);
+ update_stmt (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ if (si != NULL
+ && si->endptr == NULL_TREE
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ {
+ si = unshare_strinfo (si);
+ si->endptr = lhs;
+ }
+ zero_length_string (lhs, si);
+ return;
+ }
+ }
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ return;
+ if (TREE_CODE (src) != SSA_NAME || !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (src))
+ {
+ if (idx == 0)
+ idx = new_stridx (src);
+ else if (get_strinfo (idx) != NULL)
+ {
+ zero_length_string (lhs, NULL);
+ return;
+ }
+ if (idx)
+ {
+ location_t loc = gimple_location (stmt);
+ tree lhsu = fold_convert_loc (loc, size_type_node, lhs);
+ tree srcu = fold_convert_loc (loc, size_type_node, src);
+ tree length = fold_build2_loc (loc, MINUS_EXPR,
+ size_type_node, lhsu, srcu);
+ strinfo si = new_strinfo (src, idx, length);
+ si->endptr = lhs;
+ set_strinfo (idx, si);
+ find_equal_ptrs (src, idx);
+ zero_length_string (lhs, si);
+ }
+ }
+ else
+ zero_length_string (lhs, NULL);
+}
+
+/* Handle a strcpy-like ({st{r,p}cpy,__st{r,p}cpy_chk}) call.
+ If strlen of the second argument is known, strlen of the first argument
+ is the same after this call. Furthermore, attempt to convert it to
+ memcpy. */
+
+static void
+handle_builtin_strcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
+{
+ int idx, didx;
+ tree src, dst, srclen, len, lhs, args, type, fn, oldlen;
+ bool success;
+ gimple stmt = gsi_stmt (*gsi);
+ strinfo si, dsi, olddsi, zsi;
+ location_t loc;
+
+ src = gimple_call_arg (stmt, 1);
+ dst = gimple_call_arg (stmt, 0);
+ lhs = gimple_call_lhs (stmt);
+ idx = get_stridx (src);
+ si = NULL;
+ if (idx > 0)
+ si = get_strinfo (idx);
+
+ didx = get_stridx (dst);
+ olddsi = NULL;
+ oldlen = NULL_TREE;
+ if (didx > 0)
+ olddsi = get_strinfo (didx);
+ else if (didx < 0)
+ return;
+
+ if (olddsi != NULL)
+ adjust_last_stmt (olddsi, stmt, false);
+
+ srclen = NULL_TREE;
+ if (si != NULL)
+ srclen = get_string_length (si);
+ else if (idx < 0)
+ srclen = build_int_cst (size_type_node, ~idx);
+
+ loc = gimple_location (stmt);
+ if (srclen == NULL_TREE)
+ switch (bcode)
+ {
+ case BUILT_IN_STRCPY:
+ case BUILT_IN_STRCPY_CHK:
+ if (implicit_built_in_decls[BUILT_IN_STPCPY] == NULL_TREE
+ || lhs != NULL_TREE)
+ return;
+ break;
+ case BUILT_IN_STPCPY:
+ case BUILT_IN_STPCPY_CHK:
+ if (lhs == NULL_TREE)
+ return;
+ else
+ {
+ tree lhsuint = fold_convert_loc (loc, size_type_node, lhs);
+ srclen = fold_convert_loc (loc, size_type_node, dst);
+ srclen = fold_build2_loc (loc, MINUS_EXPR, size_type_node,
+ lhsuint, srclen);
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (didx == 0)
+ {
+ didx = new_stridx (dst);
+ if (didx == 0)
+ return;
+ }
+ if (olddsi != NULL)
+ {
+ oldlen = olddsi->length;
+ dsi = unshare_strinfo (olddsi);
+ dsi->length = srclen;
+ /* Break the chain, so adjust_related_strinfo on later pointers in
+ the chain won't adjust this one anymore. */
+ dsi->next = 0;
+ dsi->stmt = NULL;
+ dsi->endptr = NULL_TREE;
+ }
+ else
+ {
+ dsi = new_strinfo (dst, didx, srclen);
+ set_strinfo (didx, dsi);
+ find_equal_ptrs (dst, didx);
+ }
+ dsi->writable = true;
+ dsi->dont_invalidate = true;
+
+ if (dsi->length == NULL_TREE)
+ {
+ /* If string length of src is unknown, use delayed length
+ computation. If string lenth of dst will be needed, it
+ can be computed by transforming this strcpy call into
+ stpcpy and subtracting dst from the return value. */
+ dsi->stmt = stmt;
+ return;
+ }
+
+ if (olddsi != NULL)
+ {
+ tree adj = NULL_TREE;
+ if (oldlen == NULL_TREE)
+ ;
+ else if (integer_zerop (oldlen))
+ adj = srclen;
+ else if (TREE_CODE (oldlen) == INTEGER_CST
+ || TREE_CODE (srclen) == INTEGER_CST)
+ adj = fold_build2_loc (loc, MINUS_EXPR,
+ TREE_TYPE (srclen), srclen,
+ fold_convert_loc (loc, TREE_TYPE (srclen),
+ oldlen));
+ if (adj != NULL_TREE)
+ adjust_related_strinfos (loc, dsi, adj);
+ else
+ dsi->prev = 0;
+ }
+ /* strcpy src may not overlap dst, so src doesn't need to be
+ invalidated either. */
+ if (si != NULL)
+ si->dont_invalidate = true;
+
+ fn = NULL_TREE;
+ zsi = NULL;
+ switch (bcode)
+ {
+ case BUILT_IN_STRCPY:
+ fn = implicit_built_in_decls[BUILT_IN_MEMCPY];
+ if (lhs)
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (lhs), didx);
+ break;
+ case BUILT_IN_STRCPY_CHK:
+ fn = built_in_decls[BUILT_IN_MEMCPY_CHK];
+ if (lhs)
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (lhs), didx);
+ break;
+ case BUILT_IN_STPCPY:
+ /* This would need adjustment of the lhs (subtract one),
+ or detection that the trailing '\0' doesn't need to be
+ written, if it will be immediately overwritten.
+ fn = built_in_decls[BUILT_IN_MEMPCPY]; */
+ if (lhs)
+ {
+ dsi->endptr = lhs;
+ zsi = zero_length_string (lhs, dsi);
+ }
+ break;
+ case BUILT_IN_STPCPY_CHK:
+ /* This would need adjustment of the lhs (subtract one),
+ or detection that the trailing '\0' doesn't need to be
+ written, if it will be immediately overwritten.
+ fn = built_in_decls[BUILT_IN_MEMPCPY_CHK]; */
+ if (lhs)
+ {
+ dsi->endptr = lhs;
+ zsi = zero_length_string (lhs, dsi);
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ if (zsi != NULL)
+ zsi->dont_invalidate = true;
+
+ if (fn == NULL_TREE)
+ return;
+
+ args = TYPE_ARG_TYPES (TREE_TYPE (fn));
+ type = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args)));
+
+ len = fold_convert_loc (loc, type, unshare_expr (srclen));
+ len = fold_build2_loc (loc, PLUS_EXPR, type, len, build_int_cst (type, 1));
+ len = force_gimple_operand_gsi (gsi, len, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "Optimizing: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ if (gimple_call_num_args (stmt) == 2)
+ success = update_gimple_call (gsi, fn, 3, dst, src, len);
+ else
+ success = update_gimple_call (gsi, fn, 4, dst, src, len,
+ gimple_call_arg (stmt, 2));
+ if (success)
+ {
+ stmt = gsi_stmt (*gsi);
+ update_stmt (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ /* Allow adjust_last_stmt to decrease this memcpy's size. */
+ laststmt.stmt = stmt;
+ laststmt.len = srclen;
+ laststmt.stridx = dsi->idx;
+ }
+ else if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ fprintf (dump_file, "not possible.\n");
+}
+
+/* Handle a memcpy-like ({mem{,p}cpy,__mem{,p}cpy_chk}) call.
+ If strlen of the second argument is known and length of the third argument
+ is that plus one, strlen of the first argument is the same after this
+ call. */
+
+static void
+handle_builtin_memcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
+{
+ int idx, didx;
+ tree src, dst, len, lhs, oldlen, newlen;
+ gimple stmt = gsi_stmt (*gsi);
+ strinfo si, dsi, olddsi;
+
+ len = gimple_call_arg (stmt, 2);
+ src = gimple_call_arg (stmt, 1);
+ dst = gimple_call_arg (stmt, 0);
+ idx = get_stridx (src);
+ if (idx == 0)
+ return;
+
+ didx = get_stridx (dst);
+ olddsi = NULL;
+ if (didx > 0)
+ olddsi = get_strinfo (didx);
+ else if (didx < 0)
+ return;
+
+ if (olddsi != NULL
+ && host_integerp (len, 1)
+ && !integer_zerop (len))
+ adjust_last_stmt (olddsi, stmt, false);
+
+ if (idx > 0)
+ {
+ gimple def_stmt;
+
+ /* Handle memcpy (x, y, l) where l is strlen (y) + 1. */
+ si = get_strinfo (idx);
+ if (si == NULL || si->length == NULL_TREE)
+ return;
+ if (TREE_CODE (len) != SSA_NAME)
+ return;
+ def_stmt = SSA_NAME_DEF_STMT (len);
+ if (!is_gimple_assign (def_stmt)
+ || gimple_assign_rhs_code (def_stmt) != PLUS_EXPR
+ || gimple_assign_rhs1 (def_stmt) != si->length
+ || !integer_onep (gimple_assign_rhs2 (def_stmt)))
+ return;
+ }
+ else
+ {
+ si = NULL;
+ /* Handle memcpy (x, "abcd", 5) or
+ memcpy (x, "abc\0uvw", 7). */
+ if (!host_integerp (len, 1)
+ || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
+ <= (unsigned HOST_WIDE_INT) ~idx)
+ return;
+ }
+
+ if (olddsi != NULL && TREE_CODE (len) == SSA_NAME)
+ adjust_last_stmt (olddsi, stmt, false);
+
+ if (didx == 0)
+ {
+ didx = new_stridx (dst);
+ if (didx == 0)
+ return;
+ }
+ if (si != NULL)
+ newlen = si->length;
+ else
+ newlen = build_int_cst (TREE_TYPE (len), ~idx);
+ oldlen = NULL_TREE;
+ if (olddsi != NULL)
+ {
+ dsi = unshare_strinfo (olddsi);
+ oldlen = olddsi->length;
+ dsi->length = newlen;
+ /* Break the chain, so adjust_related_strinfo on later pointers in
+ the chain won't adjust this one anymore. */
+ dsi->next = 0;
+ dsi->stmt = NULL;
+ dsi->endptr = NULL_TREE;
+ }
+ else
+ {
+ dsi = new_strinfo (dst, didx, newlen);
+ set_strinfo (didx, dsi);
+ find_equal_ptrs (dst, didx);
+ }
+ dsi->writable = true;
+ dsi->dont_invalidate = true;
+ if (olddsi != NULL)
+ {
+ tree adj = NULL_TREE;
+ location_t loc = gimple_location (stmt);
+ if (oldlen == NULL_TREE)
+ ;
+ else if (integer_zerop (oldlen))
+ adj = dsi->length;
+ else if (TREE_CODE (oldlen) == INTEGER_CST
+ || TREE_CODE (dsi->length) == INTEGER_CST)
+ adj = fold_build2_loc (loc, MINUS_EXPR,
+ TREE_TYPE (dsi->length), dsi->length,
+ fold_convert_loc (loc, TREE_TYPE (dsi->length),
+ oldlen));
+ if (adj != NULL_TREE)
+ adjust_related_strinfos (loc, dsi, adj);
+ else
+ dsi->prev = 0;
+ }
+ /* memcpy src may not overlap dst, so src doesn't need to be
+ invalidated either. */
+ if (si != NULL)
+ si->dont_invalidate = true;
+
+ lhs = gimple_call_lhs (stmt);
+ switch (bcode)
+ {
+ case BUILT_IN_MEMCPY:
+ case BUILT_IN_MEMCPY_CHK:
+ /* Allow adjust_last_stmt to decrease this memcpy's size. */
+ laststmt.stmt = stmt;
+ laststmt.len = dsi->length;
+ laststmt.stridx = dsi->idx;
+ if (lhs)
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (lhs), didx);
+ break;
+ case BUILT_IN_MEMPCPY:
+ case BUILT_IN_MEMPCPY_CHK:
+ break;
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Handle a strcat-like ({strcat,__strcat_chk}) call.
+ If strlen of the second argument is known, strlen of the first argument
+ is increased by the length of the second argument. Furthermore, attempt
+ to convert it to memcpy/strcpy if the length of the first argument
+ is known. */
+
+static void
+handle_builtin_strcat (enum built_in_function bcode, gimple_stmt_iterator *gsi)
+{
+ int idx, didx;
+ tree src, dst, srclen, dstlen, len, lhs, args, type, fn, objsz, endptr;
+ bool success;
+ gimple stmt = gsi_stmt (*gsi);
+ strinfo si, dsi;
+ location_t loc;
+
+ src = gimple_call_arg (stmt, 1);
+ dst = gimple_call_arg (stmt, 0);
+ lhs = gimple_call_lhs (stmt);
+
+ didx = get_stridx (dst);
+ if (didx < 0)
+ return;
+
+ dsi = NULL;
+ if (didx > 0)
+ dsi = get_strinfo (didx);
+ if (dsi == NULL || get_string_length (dsi) == NULL_TREE)
+ {
+ /* strcat (p, q) can be transformed into
+ tmp = p + strlen (p); endptr = strpcpy (tmp, q);
+ with length endptr - p if we need to compute the length
+ later on. Don't do this transformation if we don't need
+ it. */
+ if (implicit_built_in_decls[BUILT_IN_STPCPY] != NULL_TREE
+ && lhs == NULL_TREE)
+ {
+ if (didx == 0)
+ {
+ didx = new_stridx (dst);
+ if (didx == 0)
+ return;
+ }
+ if (dsi == NULL)
+ {
+ dsi = new_strinfo (dst, didx, NULL_TREE);
+ set_strinfo (didx, dsi);
+ find_equal_ptrs (dst, didx);
+ }
+ else
+ {
+ dsi = unshare_strinfo (dsi);
+ dsi->length = NULL_TREE;
+ dsi->next = 0;
+ dsi->endptr = NULL_TREE;
+ }
+ dsi->writable = true;
+ dsi->stmt = stmt;
+ dsi->dont_invalidate = true;
+ }
+ return;
+ }
+
+ srclen = NULL_TREE;
+ si = NULL;
+ idx = get_stridx (src);
+ if (idx < 0)
+ srclen = build_int_cst (size_type_node, ~idx);
+ else if (idx > 0)
+ {
+ si = get_strinfo (idx);
+ if (si != NULL)
+ srclen = get_string_length (si);
+ }
+
+ loc = gimple_location (stmt);
+ dstlen = dsi->length;
+ endptr = dsi->endptr;
+
+ dsi = unshare_strinfo (dsi);
+ dsi->endptr = NULL_TREE;
+ dsi->stmt = NULL;
+ dsi->writable = true;
+
+ if (srclen != NULL_TREE)
+ {
+ dsi->length = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (dsi->length),
+ dsi->length, srclen);
+ adjust_related_strinfos (loc, dsi, srclen);
+ dsi->dont_invalidate = true;
+ }
+ else
+ {
+ dsi->length = NULL;
+ if (implicit_built_in_decls[BUILT_IN_STPCPY] != NULL_TREE
+ && lhs == NULL_TREE)
+ dsi->dont_invalidate = true;
+ }
+
+ if (si != NULL)
+ /* strcat src may not overlap dst, so src doesn't need to be
+ invalidated either. */
+ si->dont_invalidate = true;
+
+ /* For now. Could remove the lhs from the call and add
+ lhs = dst; afterwards. */
+ if (lhs)
+ return;
+
+ fn = NULL_TREE;
+ objsz = NULL_TREE;
+ switch (bcode)
+ {
+ case BUILT_IN_STRCAT:
+ if (srclen != NULL_TREE)
+ fn = implicit_built_in_decls[BUILT_IN_MEMCPY];
+ else
+ fn = implicit_built_in_decls[BUILT_IN_STRCPY];
+ break;
+ case BUILT_IN_STRCAT_CHK:
+ if (srclen != NULL_TREE)
+ fn = built_in_decls[BUILT_IN_MEMCPY_CHK];
+ else
+ fn = built_in_decls[BUILT_IN_STRCPY_CHK];
+ objsz = gimple_call_arg (stmt, 2);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (fn == NULL_TREE)
+ return;
+
+ len = NULL_TREE;
+ if (srclen != NULL_TREE)
+ {
+ args = TYPE_ARG_TYPES (TREE_TYPE (fn));
+ type = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args)));
+
+ len = fold_convert_loc (loc, type, unshare_expr (srclen));
+ len = fold_build2_loc (loc, PLUS_EXPR, type, len,
+ build_int_cst (type, 1));
+ len = force_gimple_operand_gsi (gsi, len, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ }
+ if (endptr)
+ dst = fold_convert_loc (loc, TREE_TYPE (dst), unshare_expr (endptr));
+ else
+ dst = fold_build2_loc (loc, POINTER_PLUS_EXPR,
+ TREE_TYPE (dst), unshare_expr (dst),
+ fold_convert_loc (loc, sizetype,
+ unshare_expr (dstlen)));
+ dst = force_gimple_operand_gsi (gsi, dst, true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "Optimizing: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ if (srclen != NULL_TREE)
+ success = update_gimple_call (gsi, fn, 3 + (objsz != NULL_TREE),
+ dst, src, len, objsz);
+ else
+ success = update_gimple_call (gsi, fn, 2 + (objsz != NULL_TREE),
+ dst, src, objsz);
+ if (success)
+ {
+ stmt = gsi_stmt (*gsi);
+ update_stmt (stmt);
+ if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ {
+ fprintf (dump_file, "into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
+ /* If srclen == NULL, note that current string length can be
+ computed by transforming this strcpy into stpcpy. */
+ if (srclen == NULL_TREE && dsi->dont_invalidate)
+ dsi->stmt = stmt;
+ adjust_last_stmt (dsi, stmt, true);
+ if (srclen != NULL_TREE)
+ {
+ laststmt.stmt = stmt;
+ laststmt.len = srclen;
+ laststmt.stridx = dsi->idx;
+ }
+ }
+ else if (dump_file && (dump_flags & TDF_DETAILS) != 0)
+ fprintf (dump_file, "not possible.\n");
+}
+
+/* Handle a POINTER_PLUS_EXPR statement.
+ For p = "abcd" + 2; compute associated length, or if
+ p = q + off is pointing to a '\0' character of a string, call
+ zero_length_string on it. */
+
+static void
+handle_pointer_plus (gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+ tree lhs = gimple_assign_lhs (stmt), off;
+ int idx = get_stridx (gimple_assign_rhs1 (stmt));
+ strinfo si, zsi;
+
+ if (idx == 0)
+ return;
+
+ if (idx < 0)
+ {
+ tree off = gimple_assign_rhs2 (stmt);
+ if (host_integerp (off, 1)
+ && (unsigned HOST_WIDE_INT) tree_low_cst (off, 1)
+ <= (unsigned HOST_WIDE_INT) ~idx)
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (lhs),
+ ~(~idx - (int) tree_low_cst (off, 1)));
+ return;
+ }
+
+ si = get_strinfo (idx);
+ if (si == NULL || si->length == NULL_TREE)
+ return;
+
+ off = gimple_assign_rhs2 (stmt);
+ zsi = NULL;
+ if (operand_equal_p (si->length, off, 0))
+ zsi = zero_length_string (lhs, si);
+ else if (TREE_CODE (off) == SSA_NAME)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (off);
+ if (gimple_assign_single_p (def_stmt)
+ && operand_equal_p (si->length, gimple_assign_rhs1 (def_stmt), 0))
+ zsi = zero_length_string (lhs, si);
+ }
+ if (zsi != NULL
+ && si->endptr != NULL_TREE
+ && si->endptr != lhs
+ && TREE_CODE (si->endptr) == SSA_NAME)
+ {
+ enum tree_code rhs_code
+ = useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (si->endptr))
+ ? SSA_NAME : NOP_EXPR;
+ gimple_assign_set_rhs_with_ops (gsi, rhs_code, si->endptr, NULL_TREE);
+ gcc_assert (gsi_stmt (*gsi) == stmt);
+ update_stmt (stmt);
+ }
+}
+
+/* Handle a single character store. */
+
+static bool
+handle_char_store (gimple_stmt_iterator *gsi)
+{
+ int idx = -1;
+ strinfo si = NULL;
+ gimple stmt = gsi_stmt (*gsi);
+ tree ssaname = NULL_TREE, lhs = gimple_assign_lhs (stmt);
+
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == SSA_NAME)
+ {
+ if (integer_zerop (TREE_OPERAND (lhs, 1)))
+ {
+ ssaname = TREE_OPERAND (lhs, 0);
+ idx = get_stridx (ssaname);
+ }
+ }
+ else
+ idx = get_addr_stridx (lhs);
+
+ if (idx > 0)
+ {
+ si = get_strinfo (idx);
+ if (si != NULL && si->length != NULL_TREE && integer_zerop (si->length))
+ {
+ if (initializer_zerop (gimple_assign_rhs1 (stmt)))
+ {
+ /* When storing '\0', the store can be removed
+ if we know it has been stored in the current function. */
+ if (!stmt_could_throw_p (stmt) && si->writable)
+ {
+ unlink_stmt_vdef (stmt);
+ release_defs (stmt);
+ gsi_remove (gsi, true);
+ return false;
+ }
+ else
+ {
+ si->writable = true;
+ si->dont_invalidate = true;
+ }
+ }
+ else
+ /* Otherwise this statement overwrites the '\0' with
+ something, if the previous stmt was a memcpy,
+ its length may be decreased. */
+ adjust_last_stmt (si, stmt, false);
+ }
+ else if (si != NULL)
+ {
+ si = unshare_strinfo (si);
+ si->length = build_int_cst (size_type_node, 0);
+ si->endptr = NULL;
+ si->prev = 0;
+ si->next = 0;
+ si->stmt = NULL;
+ si->first = 0;
+ si->writable = true;
+ if (ssaname && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssaname))
+ si->endptr = ssaname;
+ si->dont_invalidate = true;
+ }
+ }
+ else if (idx == 0 && initializer_zerop (gimple_assign_rhs1 (stmt)))
+ {
+ if (ssaname)
+ {
+ si = zero_length_string (ssaname, NULL);
+ if (si != NULL)
+ si->dont_invalidate = true;
+ }
+ else
+ {
+ int idx = new_addr_stridx (lhs);
+ if (idx != 0)
+ {
+ si = new_strinfo (build_fold_addr_expr (lhs), idx,
+ build_int_cst (size_type_node, 0));
+ set_strinfo (idx, si);
+ si->dont_invalidate = true;
+ }
+ }
+ if (si != NULL)
+ si->writable = true;
+ }
+
+ if (si != NULL && initializer_zerop (gimple_assign_rhs1 (stmt)))
+ {
+ /* Allow adjust_last_stmt to remove it if the stored '\0'
+ is immediately overwritten. */
+ laststmt.stmt = stmt;
+ laststmt.len = build_int_cst (size_type_node, 1);
+ laststmt.stridx = si->idx;
+ }
+ return true;
+}
+
+/* Attempt to optimize a single statement at *GSI using string length
+ knowledge. */
+
+static bool
+strlen_optimize_stmt (gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+
+ if (is_gimple_call (stmt))
+ {
+ tree callee = gimple_call_fndecl (stmt);
+ if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (callee))
+ {
+ case BUILT_IN_STRLEN:
+ handle_builtin_strlen (gsi);
+ break;
+ case BUILT_IN_STRCHR:
+ handle_builtin_strchr (gsi);
+ break;
+ case BUILT_IN_STRCPY:
+ case BUILT_IN_STRCPY_CHK:
+ case BUILT_IN_STPCPY:
+ case BUILT_IN_STPCPY_CHK:
+ handle_builtin_strcpy (DECL_FUNCTION_CODE (callee), gsi);
+ break;
+ case BUILT_IN_MEMCPY:
+ case BUILT_IN_MEMCPY_CHK:
+ case BUILT_IN_MEMPCPY:
+ case BUILT_IN_MEMPCPY_CHK:
+ handle_builtin_memcpy (DECL_FUNCTION_CODE (callee), gsi);
+ break;
+ case BUILT_IN_STRCAT:
+ case BUILT_IN_STRCAT_CHK:
+ handle_builtin_strcat (DECL_FUNCTION_CODE (callee), gsi);
+ break;
+ default:
+ break;
+ }
+ }
+ else if (is_gimple_assign (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+
+ if (TREE_CODE (lhs) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (lhs)))
+ {
+ if (gimple_assign_single_p (stmt)
+ || (gimple_assign_cast_p (stmt)
+ && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
+ {
+ int idx = get_stridx (gimple_assign_rhs1 (stmt));
+ VEC_replace (int, ssa_ver_to_stridx, SSA_NAME_VERSION (lhs),
+ idx);
+ }
+ else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ handle_pointer_plus (gsi);
+ }
+ else if (TREE_CODE (lhs) != SSA_NAME && !TREE_SIDE_EFFECTS (lhs))
+ {
+ tree type = TREE_TYPE (lhs);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_MODE (type) == TYPE_MODE (char_type_node)
+ && TYPE_PRECISION (type) == TYPE_PRECISION (char_type_node))
+ {
+ if (! handle_char_store (gsi))
+ return false;
+ }
+ }
+ }
+
+ if (gimple_vdef (stmt))
+ maybe_invalidate (stmt);
+ return true;
+}
+
+/* Recursively call maybe_invalidate on stmts that might be executed
+ in between dombb and current bb and that contain a vdef. Stop when
+ *count stmts are inspected, or if the whole strinfo vector has
+ been invalidated. */
+
+static void
+do_invalidate (basic_block dombb, gimple phi, bitmap visited, int *count)
+{
+ unsigned int i, n = gimple_phi_num_args (phi);
+
+ for (i = 0; i < n; i++)
+ {
+ tree vuse = gimple_phi_arg_def (phi, i);
+ gimple stmt = SSA_NAME_DEF_STMT (vuse);
+ basic_block bb = gimple_bb (stmt);
+ if (bb == NULL
+ || bb == dombb
+ || !bitmap_set_bit (visited, bb->index)
+ || !dominated_by_p (CDI_DOMINATORS, bb, dombb))
+ continue;
+ while (1)
+ {
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ {
+ do_invalidate (dombb, stmt, visited, count);
+ if (*count == 0)
+ return;
+ break;
+ }
+ if (--*count == 0)
+ return;
+ if (!maybe_invalidate (stmt))
+ {
+ *count = 0;
+ return;
+ }
+ vuse = gimple_vuse (stmt);
+ stmt = SSA_NAME_DEF_STMT (vuse);
+ if (gimple_bb (stmt) != bb)
+ {
+ bb = gimple_bb (stmt);
+ if (bb == NULL
+ || bb == dombb
+ || !bitmap_set_bit (visited, bb->index)
+ || !dominated_by_p (CDI_DOMINATORS, bb, dombb))
+ break;
+ }
+ }
+ }
+}
+
+/* Callback for walk_dominator_tree. Attempt to optimize various
+ string ops by remembering string lenths pointed by pointer SSA_NAMEs. */
+
+static void
+strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
+ basic_block bb)
+{
+ gimple_stmt_iterator gsi;
+ basic_block dombb = get_immediate_dominator (CDI_DOMINATORS, bb);
+
+ if (dombb == NULL)
+ stridx_to_strinfo = NULL;
+ else
+ {
+ stridx_to_strinfo = (VEC(strinfo, heap) *) dombb->aux;
+ if (stridx_to_strinfo)
+ {
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ if (!is_gimple_reg (gimple_phi_result (phi)))
+ {
+ bitmap visited = BITMAP_ALLOC (NULL);
+ int count_vdef = 100;
+ do_invalidate (dombb, phi, visited, &count_vdef);
+ BITMAP_FREE (visited);
+ break;
+ }
+ }
+ }
+ }
+
+ /* If all PHI arguments have the same string index, the PHI result
+ has it as well. */
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ tree result = gimple_phi_result (phi);
+ if (is_gimple_reg (result) && POINTER_TYPE_P (TREE_TYPE (result)))
+ {
+ int idx = get_stridx (gimple_phi_arg_def (phi, 0));
+ if (idx != 0)
+ {
+ unsigned int i, n = gimple_phi_num_args (phi);
+ for (i = 1; i < n; i++)
+ if (idx != get_stridx (gimple_phi_arg_def (phi, i)))
+ break;
+ if (i == n)
+ VEC_replace (int, ssa_ver_to_stridx,
+ SSA_NAME_VERSION (result), idx);
+ }
+ }
+ }
+
+ /* Attempt to optimize individual statements. */
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
+ if (strlen_optimize_stmt (&gsi))
+ gsi_next (&gsi);
+
+ bb->aux = stridx_to_strinfo;
+ if (VEC_length (strinfo, stridx_to_strinfo) && !strinfo_shared ())
+ VEC_replace (strinfo, stridx_to_strinfo, 0, (strinfo) bb);
+}
+
+/* Callback for walk_dominator_tree. Free strinfo vector if it is
+ owned by the current bb, clear bb->aux. */
+
+static void
+strlen_leave_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
+ basic_block bb)
+{
+ if (bb->aux)
+ {
+ stridx_to_strinfo = (VEC(strinfo, heap) *) bb->aux;
+ if (VEC_length (strinfo, stridx_to_strinfo)
+ && VEC_index (strinfo, stridx_to_strinfo, 0) == (strinfo) bb)
+ {
+ unsigned int i;
+ strinfo si;
+
+ for (i = 1; VEC_iterate (strinfo, stridx_to_strinfo, i, si); ++i)
+ free_strinfo (si);
+ VEC_free (strinfo, heap, stridx_to_strinfo);
+ }
+ bb->aux = NULL;
+ }
+}
+
+/* Main entry point. */
+
+static unsigned int
+tree_ssa_strlen (void)
+{
+ struct dom_walk_data walk_data;
+
+ VEC_safe_grow_cleared (int, heap, ssa_ver_to_stridx, num_ssa_names);
+ max_stridx = 1;
+ strinfo_pool = create_alloc_pool ("strinfo_struct pool",
+ sizeof (struct strinfo_struct), 64);
+
+ calculate_dominance_info (CDI_DOMINATORS);
+
+ /* String length optimization is implemented as a walk of the dominator
+ tree and a forward walk of statements within each block. */
+ walk_data.dom_direction = CDI_DOMINATORS;
+ walk_data.initialize_block_local_data = NULL;
+ walk_data.before_dom_children = strlen_enter_block;
+ walk_data.after_dom_children = strlen_leave_block;
+ walk_data.block_local_data_size = 0;
+ walk_data.global_data = NULL;
+
+ /* Initialize the dominator walker. */
+ init_walk_dominator_tree (&walk_data);
+
+ /* Recursively walk the dominator tree. */
+ walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
+
+ /* Finalize the dominator walker. */
+ fini_walk_dominator_tree (&walk_data);
+
+ VEC_free (int, heap, ssa_ver_to_stridx);
+ free_alloc_pool (strinfo_pool);
+ if (decl_to_stridxlist_htab)
+ {
+ obstack_free (&stridx_obstack, NULL);
+ htab_delete (decl_to_stridxlist_htab);
+ decl_to_stridxlist_htab = NULL;
+ }
+ laststmt.stmt = NULL;
+ laststmt.len = NULL_TREE;
+ laststmt.stridx = 0;
+
+ return 0;
+}
+
+static bool
+gate_strlen (void)
+{
+ return flag_optimize_strlen != 0;
+}
+
+struct gimple_opt_pass pass_strlen =
+{
+ {
+ GIMPLE_PASS,
+ "strlen", /* name */
+ gate_strlen, /* gate */
+ tree_ssa_strlen, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_TREE_STRLEN, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_ggc_collect
+ | TODO_verify_ssa /* todo_flags_finish */
+ }
+};
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index edfbd649d73..821fc7d92b2 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4130,6 +4130,24 @@ find_func_aliases_for_builtin_call (gimple t)
case BUILT_IN_REMQUOL:
case BUILT_IN_FREE:
return true;
+ case BUILT_IN_STRDUP:
+ case BUILT_IN_STRNDUP:
+ if (gimple_call_lhs (t))
+ {
+ handle_lhs_call (t, gimple_call_lhs (t), gimple_call_flags (t),
+ NULL, fndecl);
+ get_constraint_for_ptr_offset (gimple_call_lhs (t),
+ NULL_TREE, &lhsc);
+ get_constraint_for_ptr_offset (gimple_call_arg (t, 0),
+ NULL_TREE, &rhsc);
+ do_deref (&lhsc);
+ do_deref (&rhsc);
+ process_all_all_constraints (lhsc, rhsc);
+ VEC_free (ce_s, heap, lhsc);
+ VEC_free (ce_s, heap, rhsc);
+ return true;
+ }
+ break;
/* Trampolines are special - they set up passing the static
frame. */
case BUILT_IN_INIT_TRAMPOLINE:
@@ -5589,10 +5607,11 @@ intra_create_variable_infos (void)
varinfo_t p;
/* For restrict qualified pointers to objects passed by
- reference build a real representative for the pointed-to object. */
- if (DECL_BY_REFERENCE (t)
- && POINTER_TYPE_P (TREE_TYPE (t))
- && TYPE_RESTRICT (TREE_TYPE (t)))
+ reference build a real representative for the pointed-to object.
+ Treat restrict qualified references the same. */
+ if (TYPE_RESTRICT (TREE_TYPE (t))
+ && ((DECL_BY_REFERENCE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
+ || TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
{
struct constraint_expr lhsc, rhsc;
varinfo_t vi;
@@ -5978,6 +5997,21 @@ pt_solution_empty_p (struct pt_solution *pt)
return true;
}
+/* Return true if the points-to solution *PT only point to a single var, and
+ return the var uid in *UID. */
+
+bool
+pt_solution_singleton_p (struct pt_solution *pt, unsigned *uid)
+{
+ if (pt->anything || pt->nonlocal || pt->escaped || pt->ipa_escaped
+ || pt->null || pt->vars == NULL
+ || !bitmap_single_bit_set_p (pt->vars))
+ return false;
+
+ *uid = bitmap_first_set_bit (pt->vars);
+ return true;
+}
+
/* Return true if the points-to solution *PT includes global memory. */
bool
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
new file mode 100644
index 00000000000..611a30f23a4
--- /dev/null
+++ b/gcc/tree-ssa-tail-merge.c
@@ -0,0 +1,1706 @@
+/* Tail merging for gimple.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Tom de Vries (tom@codesourcery.com)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, 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 COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Pass overview.
+
+
+ MOTIVATIONAL EXAMPLE
+
+ gimple representation of gcc/testsuite/gcc.dg/pr43864.c at
+
+ hprofStartupp (charD.1 * outputFileNameD.2600, charD.1 * ctxD.2601)
+ {
+ struct FILED.1638 * fpD.2605;
+ charD.1 fileNameD.2604[1000];
+ intD.0 D.3915;
+ const charD.1 * restrict outputFileName.0D.3914;
+
+ # BLOCK 2 freq:10000
+ # PRED: ENTRY [100.0%] (fallthru,exec)
+ # PT = nonlocal { D.3926 } (restr)
+ outputFileName.0D.3914_3
+ = (const charD.1 * restrict) outputFileNameD.2600_2(D);
+ # .MEMD.3923_13 = VDEF <.MEMD.3923_12(D)>
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ sprintfD.759 (&fileNameD.2604, outputFileName.0D.3914_3);
+ # .MEMD.3923_14 = VDEF <.MEMD.3923_13>
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ D.3915_4 = accessD.2606 (&fileNameD.2604, 1);
+ if (D.3915_4 == 0)
+ goto <bb 3>;
+ else
+ goto <bb 4>;
+ # SUCC: 3 [10.0%] (true,exec) 4 [90.0%] (false,exec)
+
+ # BLOCK 3 freq:1000
+ # PRED: 2 [10.0%] (true,exec)
+ # .MEMD.3923_15 = VDEF <.MEMD.3923_14>
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ freeD.898 (ctxD.2601_5(D));
+ goto <bb 7>;
+ # SUCC: 7 [100.0%] (fallthru,exec)
+
+ # BLOCK 4 freq:9000
+ # PRED: 2 [90.0%] (false,exec)
+ # .MEMD.3923_16 = VDEF <.MEMD.3923_14>
+ # PT = nonlocal escaped
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ fpD.2605_8 = fopenD.1805 (&fileNameD.2604[0], 0B);
+ if (fpD.2605_8 == 0B)
+ goto <bb 5>;
+ else
+ goto <bb 6>;
+ # SUCC: 5 [1.9%] (true,exec) 6 [98.1%] (false,exec)
+
+ # BLOCK 5 freq:173
+ # PRED: 4 [1.9%] (true,exec)
+ # .MEMD.3923_17 = VDEF <.MEMD.3923_16>
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ freeD.898 (ctxD.2601_5(D));
+ goto <bb 7>;
+ # SUCC: 7 [100.0%] (fallthru,exec)
+
+ # BLOCK 6 freq:8827
+ # PRED: 4 [98.1%] (false,exec)
+ # .MEMD.3923_18 = VDEF <.MEMD.3923_16>
+ # USE = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ # CLB = nonlocal null { fileNameD.2604 D.3926 } (restr)
+ fooD.2599 (outputFileNameD.2600_2(D), fpD.2605_8);
+ # SUCC: 7 [100.0%] (fallthru,exec)
+
+ # BLOCK 7 freq:10000
+ # PRED: 3 [100.0%] (fallthru,exec) 5 [100.0%] (fallthru,exec)
+ 6 [100.0%] (fallthru,exec)
+ # PT = nonlocal null
+
+ # ctxD.2601_1 = PHI <0B(3), 0B(5), ctxD.2601_5(D)(6)>
+ # .MEMD.3923_11 = PHI <.MEMD.3923_15(3), .MEMD.3923_17(5),
+ .MEMD.3923_18(6)>
+ # VUSE <.MEMD.3923_11>
+ return ctxD.2601_1;
+ # SUCC: EXIT [100.0%]
+ }
+
+ bb 3 and bb 5 can be merged. The blocks have different predecessors, but the
+ same successors, and the same operations.
+
+
+ CONTEXT
+
+ A technique called tail merging (or cross jumping) can fix the example
+ above. For a block, we look for common code at the end (the tail) of the
+ predecessor blocks, and insert jumps from one block to the other.
+ The example is a special case for tail merging, in that 2 whole blocks
+ can be merged, rather than just the end parts of it.
+ We currently only focus on whole block merging, so in that sense
+ calling this pass tail merge is a bit of a misnomer.
+
+ We distinguish 2 kinds of situations in which blocks can be merged:
+ - same operations, same predecessors. The successor edges coming from one
+ block are redirected to come from the other block.
+ - same operations, same successors. The predecessor edges entering one block
+ are redirected to enter the other block. Note that this operation might
+ involve introducing phi operations.
+
+ For efficient implementation, we would like to value numbers the blocks, and
+ have a comparison operator that tells us whether the blocks are equal.
+ Besides being runtime efficient, block value numbering should also abstract
+ from irrelevant differences in order of operations, much like normal value
+ numbering abstracts from irrelevant order of operations.
+
+ For the first situation (same_operations, same predecessors), normal value
+ numbering fits well. We can calculate a block value number based on the
+ value numbers of the defs and vdefs.
+
+ For the second situation (same operations, same successors), this approach
+ doesn't work so well. We can illustrate this using the example. The calls
+ to free use different vdefs: MEMD.3923_16 and MEMD.3923_14, and these will
+ remain different in value numbering, since they represent different memory
+ states. So the resulting vdefs of the frees will be different in value
+ numbering, so the block value numbers will be different.
+
+ The reason why we call the blocks equal is not because they define the same
+ values, but because uses in the blocks use (possibly different) defs in the
+ same way. To be able to detect this efficiently, we need to do some kind of
+ reverse value numbering, meaning number the uses rather than the defs, and
+ calculate a block value number based on the value number of the uses.
+ Ideally, a block comparison operator will also indicate which phis are needed
+ to merge the blocks.
+
+ For the moment, we don't do block value numbering, but we do insn-by-insn
+ matching, using scc value numbers to match operations with results, and
+ structural comparison otherwise, while ignoring vop mismatches.
+
+
+ IMPLEMENTATION
+
+ 1. The pass first determines all groups of blocks with the same successor
+ blocks.
+ 2. Within each group, it tries to determine clusters of equal basic blocks.
+ 3. The clusters are applied.
+ 4. The same successor groups are updated.
+ 5. This process is repeated from 2 onwards, until no more changes.
+
+
+ LIMITATIONS/TODO
+
+ - block only
+ - handles only 'same operations, same successors'.
+ It handles same predecessors as a special subcase though.
+ - does not implement the reverse value numbering and block value numbering.
+ - improve memory allocation: use garbage collected memory, obstacks,
+ allocpools where appropriate.
+ - no insertion of gimple_reg phis, We only introduce vop-phis.
+ - handle blocks with gimple_reg phi_nodes.
+
+
+ SWITCHES
+
+ - ftree-tail-merge. On at -O2. We may have to enable it only at -Os. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "tm_p.h"
+#include "basic-block.h"
+#include "output.h"
+#include "flags.h"
+#include "function.h"
+#include "tree-flow.h"
+#include "timevar.h"
+#include "bitmap.h"
+#include "tree-ssa-alias.h"
+#include "params.h"
+#include "tree-pretty-print.h"
+#include "hashtab.h"
+#include "gimple-pretty-print.h"
+#include "tree-ssa-sccvn.h"
+#include "tree-dump.h"
+
+/* Describes a group of bbs with the same successors. The successor bbs are
+ cached in succs, and the successor edge flags are cached in succ_flags.
+ If a bb has the EDGE_TRUE/VALSE_VALUE flags swapped compared to succ_flags,
+ it's marked in inverse.
+ Additionally, the hash value for the struct is cached in hashval, and
+ in_worklist indicates whether it's currently part of worklist. */
+
+struct same_succ_def
+{
+ /* The bbs that have the same successor bbs. */
+ bitmap bbs;
+ /* The successor bbs. */
+ bitmap succs;
+ /* Indicates whether the EDGE_TRUE/FALSE_VALUEs of succ_flags are swapped for
+ bb. */
+ bitmap inverse;
+ /* The edge flags for each of the successor bbs. */
+ VEC (int, heap) *succ_flags;
+ /* Indicates whether the struct is currently in the worklist. */
+ bool in_worklist;
+ /* The hash value of the struct. */
+ hashval_t hashval;
+};
+typedef struct same_succ_def *same_succ;
+typedef const struct same_succ_def *const_same_succ;
+
+/* A group of bbs where 1 bb from bbs can replace the other bbs. */
+
+struct bb_cluster_def
+{
+ /* The bbs in the cluster. */
+ bitmap bbs;
+ /* The preds of the bbs in the cluster. */
+ bitmap preds;
+ /* Index in all_clusters vector. */
+ int index;
+ /* The bb to replace the cluster with. */
+ basic_block rep_bb;
+};
+typedef struct bb_cluster_def *bb_cluster;
+typedef const struct bb_cluster_def *const_bb_cluster;
+
+/* Per bb-info. */
+
+struct aux_bb_info
+{
+ /* The number of non-debug statements in the bb. */
+ int size;
+ /* The same_succ that this bb is a member of. */
+ same_succ bb_same_succ;
+ /* The cluster that this bb is a member of. */
+ bb_cluster cluster;
+ /* The vop state at the exit of a bb. This is shortlived data, used to
+ communicate data between update_block_by and update_vuses. */
+ tree vop_at_exit;
+ /* The bb that either contains or is dominated by the dependencies of the
+ bb. */
+ basic_block dep_bb;
+};
+
+/* Macros to access the fields of struct aux_bb_info. */
+
+#define BB_SIZE(bb) (((struct aux_bb_info *)bb->aux)->size)
+#define BB_SAME_SUCC(bb) (((struct aux_bb_info *)bb->aux)->bb_same_succ)
+#define BB_CLUSTER(bb) (((struct aux_bb_info *)bb->aux)->cluster)
+#define BB_VOP_AT_EXIT(bb) (((struct aux_bb_info *)bb->aux)->vop_at_exit)
+#define BB_DEP_BB(bb) (((struct aux_bb_info *)bb->aux)->dep_bb)
+
+/* VAL1 and VAL2 are either:
+ - uses in BB1 and BB2, or
+ - phi alternatives for BB1 and BB2.
+ Return true if the uses have the same gvn value. */
+
+static bool
+gvn_uses_equal (tree val1, tree val2)
+{
+ gcc_checking_assert (val1 != NULL_TREE && val2 != NULL_TREE);
+
+ if (val1 == val2)
+ return true;
+
+ if (vn_valueize (val1) != vn_valueize (val2))
+ return false;
+
+ return ((TREE_CODE (val1) == SSA_NAME || CONSTANT_CLASS_P (val1))
+ && (TREE_CODE (val2) == SSA_NAME || CONSTANT_CLASS_P (val2)));
+}
+
+/* Prints E to FILE. */
+
+static void
+same_succ_print (FILE *file, const same_succ e)
+{
+ unsigned int i;
+ bitmap_print (file, e->bbs, "bbs:", "\n");
+ bitmap_print (file, e->succs, "succs:", "\n");
+ bitmap_print (file, e->inverse, "inverse:", "\n");
+ fprintf (file, "flags:");
+ for (i = 0; i < VEC_length (int, e->succ_flags); ++i)
+ fprintf (file, " %x", VEC_index (int, e->succ_flags, i));
+ fprintf (file, "\n");
+}
+
+/* Prints same_succ VE to VFILE. */
+
+static int
+same_succ_print_traverse (void **ve, void *vfile)
+{
+ const same_succ e = *((const same_succ *)ve);
+ FILE *file = ((FILE*)vfile);
+ same_succ_print (file, e);
+ return 1;
+}
+
+/* Update BB_DEP_BB (USE_BB), given a use of VAL in USE_BB. */
+
+static void
+update_dep_bb (basic_block use_bb, tree val)
+{
+ basic_block dep_bb;
+
+ /* Not a dep. */
+ if (TREE_CODE (val) != SSA_NAME)
+ return;
+
+ /* Skip use of global def. */
+ if (SSA_NAME_IS_DEFAULT_DEF (val))
+ return;
+
+ /* Skip use of local def. */
+ dep_bb = gimple_bb (SSA_NAME_DEF_STMT (val));
+ if (dep_bb == use_bb)
+ return;
+
+ if (BB_DEP_BB (use_bb) == NULL
+ || dominated_by_p (CDI_DOMINATORS, dep_bb, BB_DEP_BB (use_bb)))
+ BB_DEP_BB (use_bb) = dep_bb;
+}
+
+/* Update BB_DEP_BB, given the dependencies in STMT. */
+
+static void
+stmt_update_dep_bb (gimple stmt)
+{
+ ssa_op_iter iter;
+ use_operand_p use;
+
+ FOR_EACH_SSA_USE_OPERAND (use, stmt, iter, SSA_OP_USE)
+ update_dep_bb (gimple_bb (stmt), USE_FROM_PTR (use));
+}
+
+/* Returns whether VAL is used in the same bb as in which it is defined, or
+ in the phi of a successor bb. */
+
+static bool
+local_def (tree val)
+{
+ gimple stmt, def_stmt;
+ basic_block bb, def_bb;
+ imm_use_iterator iter;
+ bool res;
+
+ if (TREE_CODE (val) != SSA_NAME)
+ return false;
+ def_stmt = SSA_NAME_DEF_STMT (val);
+ def_bb = gimple_bb (def_stmt);
+
+ res = true;
+ FOR_EACH_IMM_USE_STMT (stmt, iter, val)
+ {
+ bb = gimple_bb (stmt);
+ if (bb == def_bb)
+ continue;
+ if (gimple_code (stmt) == GIMPLE_PHI
+ && find_edge (def_bb, bb))
+ continue;
+ res = false;
+ BREAK_FROM_IMM_USE_STMT (iter);
+ }
+ return res;
+}
+
+/* Calculates hash value for same_succ VE. */
+
+static hashval_t
+same_succ_hash (const void *ve)
+{
+ const_same_succ e = (const_same_succ)ve;
+ hashval_t hashval = bitmap_hash (e->succs);
+ int flags;
+ unsigned int i;
+ unsigned int first = bitmap_first_set_bit (e->bbs);
+ basic_block bb = BASIC_BLOCK (first);
+ int size = 0;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
+ tree arg;
+ unsigned int s;
+ bitmap_iterator bs;
+
+ for (gsi = gsi_start_nondebug_bb (bb);
+ !gsi_end_p (gsi); gsi_next_nondebug (&gsi))
+ {
+ stmt = gsi_stmt (gsi);
+ stmt_update_dep_bb (stmt);
+ if (is_gimple_assign (stmt) && local_def (gimple_get_lhs (stmt))
+ && !gimple_has_side_effects (stmt))
+ continue;
+ size++;
+
+ hashval = iterative_hash_hashval_t (gimple_code (stmt), hashval);
+ if (is_gimple_assign (stmt))
+ hashval = iterative_hash_hashval_t (gimple_assign_rhs_code (stmt),
+ hashval);
+ if (!is_gimple_call (stmt))
+ continue;
+ if (gimple_call_internal_p (stmt))
+ hashval = iterative_hash_hashval_t
+ ((hashval_t) gimple_call_internal_fn (stmt), hashval);
+ else
+ hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval);
+ for (i = 0; i < gimple_call_num_args (stmt); i++)
+ {
+ arg = gimple_call_arg (stmt, i);
+ arg = vn_valueize (arg);
+ hashval = iterative_hash_expr (arg, hashval);
+ }
+ }
+
+ hashval = iterative_hash_hashval_t (size, hashval);
+ BB_SIZE (bb) = size;
+
+ for (i = 0; i < VEC_length (int, e->succ_flags); ++i)
+ {
+ flags = VEC_index (int, e->succ_flags, i);
+ flags = flags & ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
+ hashval = iterative_hash_hashval_t (flags, hashval);
+ }
+
+ EXECUTE_IF_SET_IN_BITMAP (e->succs, 0, s, bs)
+ {
+ int n = find_edge (bb, BASIC_BLOCK (s))->dest_idx;
+ for (gsi = gsi_start_phis (BASIC_BLOCK (s)); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ tree lhs = gimple_phi_result (phi);
+ tree val = gimple_phi_arg_def (phi, n);
+
+ if (!is_gimple_reg (lhs))
+ continue;
+ update_dep_bb (bb, val);
+ }
+ }
+
+ return hashval;
+}
+
+/* Returns true if E1 and E2 have 2 successors, and if the successor flags
+ are inverse for the EDGE_TRUE_VALUE and EDGE_FALSE_VALUE flags, and equal for
+ the other edge flags. */
+
+static bool
+inverse_flags (const_same_succ e1, const_same_succ e2)
+{
+ int f1a, f1b, f2a, f2b;
+ int mask = ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
+
+ if (VEC_length (int, e1->succ_flags) != 2)
+ return false;
+
+ f1a = VEC_index (int, e1->succ_flags, 0);
+ f1b = VEC_index (int, e1->succ_flags, 1);
+ f2a = VEC_index (int, e2->succ_flags, 0);
+ f2b = VEC_index (int, e2->succ_flags, 1);
+
+ if (f1a == f2a && f1b == f2b)
+ return false;
+
+ return (f1a & mask) == (f2a & mask) && (f1b & mask) == (f2b & mask);
+}
+
+/* Compares SAME_SUCCs VE1 and VE2. */
+
+static int
+same_succ_equal (const void *ve1, const void *ve2)
+{
+ const_same_succ e1 = (const_same_succ)ve1;
+ const_same_succ e2 = (const_same_succ)ve2;
+ unsigned int i, first1, first2;
+ gimple_stmt_iterator gsi1, gsi2;
+ gimple s1, s2;
+ basic_block bb1, bb2;
+
+ if (e1->hashval != e2->hashval)
+ return 0;
+
+ if (VEC_length (int, e1->succ_flags) != VEC_length (int, e2->succ_flags))
+ return 0;
+
+ if (!bitmap_equal_p (e1->succs, e2->succs))
+ return 0;
+
+ if (!inverse_flags (e1, e2))
+ {
+ for (i = 0; i < VEC_length (int, e1->succ_flags); ++i)
+ if (VEC_index (int, e1->succ_flags, i)
+ != VEC_index (int, e1->succ_flags, i))
+ return 0;
+ }
+
+ first1 = bitmap_first_set_bit (e1->bbs);
+ first2 = bitmap_first_set_bit (e2->bbs);
+
+ bb1 = BASIC_BLOCK (first1);
+ bb2 = BASIC_BLOCK (first2);
+
+ if (BB_SIZE (bb1) != BB_SIZE (bb2))
+ return 0;
+
+ gsi1 = gsi_start_nondebug_bb (bb1);
+ gsi2 = gsi_start_nondebug_bb (bb2);
+ while (!(gsi_end_p (gsi1) || gsi_end_p (gsi2)))
+ {
+ s1 = gsi_stmt (gsi1);
+ s2 = gsi_stmt (gsi2);
+ if (gimple_code (s1) != gimple_code (s2))
+ return 0;
+ if (is_gimple_call (s1) && !gimple_call_same_target_p (s1, s2))
+ return 0;
+ gsi_next_nondebug (&gsi1);
+ gsi_next_nondebug (&gsi2);
+ }
+
+ return 1;
+}
+
+/* Alloc and init a new SAME_SUCC. */
+
+static same_succ
+same_succ_alloc (void)
+{
+ same_succ same = XNEW (struct same_succ_def);
+
+ same->bbs = BITMAP_ALLOC (NULL);
+ same->succs = BITMAP_ALLOC (NULL);
+ same->inverse = BITMAP_ALLOC (NULL);
+ same->succ_flags = VEC_alloc (int, heap, 10);
+ same->in_worklist = false;
+
+ return same;
+}
+
+/* Delete same_succ VE. */
+
+static void
+same_succ_delete (void *ve)
+{
+ same_succ e = (same_succ)ve;
+
+ BITMAP_FREE (e->bbs);
+ BITMAP_FREE (e->succs);
+ BITMAP_FREE (e->inverse);
+ VEC_free (int, heap, e->succ_flags);
+
+ XDELETE (ve);
+}
+
+/* Reset same_succ SAME. */
+
+static void
+same_succ_reset (same_succ same)
+{
+ bitmap_clear (same->bbs);
+ bitmap_clear (same->succs);
+ bitmap_clear (same->inverse);
+ VEC_truncate (int, same->succ_flags, 0);
+}
+
+/* Hash table with all same_succ entries. */
+
+static htab_t same_succ_htab;
+
+/* Array that is used to store the edge flags for a successor. */
+
+static int *same_succ_edge_flags;
+
+/* Bitmap that is used to mark bbs that are recently deleted. */
+
+static bitmap deleted_bbs;
+
+/* Bitmap that is used to mark predecessors of bbs that are
+ deleted. */
+
+static bitmap deleted_bb_preds;
+
+/* Prints same_succ_htab to stderr. */
+
+extern void debug_same_succ (void);
+DEBUG_FUNCTION void
+debug_same_succ ( void)
+{
+ htab_traverse (same_succ_htab, same_succ_print_traverse, stderr);
+}
+
+DEF_VEC_P (same_succ);
+DEF_VEC_ALLOC_P (same_succ, heap);
+
+/* Vector of bbs to process. */
+
+static VEC (same_succ, heap) *worklist;
+
+/* Prints worklist to FILE. */
+
+static void
+print_worklist (FILE *file)
+{
+ unsigned int i;
+ for (i = 0; i < VEC_length (same_succ, worklist); ++i)
+ same_succ_print (file, VEC_index (same_succ, worklist, i));
+}
+
+/* Adds SAME to worklist. */
+
+static void
+add_to_worklist (same_succ same)
+{
+ if (same->in_worklist)
+ return;
+
+ if (bitmap_count_bits (same->bbs) < 2)
+ return;
+
+ same->in_worklist = true;
+ VEC_safe_push (same_succ, heap, worklist, same);
+}
+
+/* Add BB to same_succ_htab. */
+
+static void
+find_same_succ_bb (basic_block bb, same_succ *same_p)
+{
+ unsigned int j;
+ bitmap_iterator bj;
+ same_succ same = *same_p;
+ same_succ *slot;
+ edge_iterator ei;
+ edge e;
+
+ if (bb == NULL)
+ return;
+ bitmap_set_bit (same->bbs, bb->index);
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ int index = e->dest->index;
+ bitmap_set_bit (same->succs, index);
+ same_succ_edge_flags[index] = e->flags;
+ }
+ EXECUTE_IF_SET_IN_BITMAP (same->succs, 0, j, bj)
+ VEC_safe_push (int, heap, same->succ_flags, same_succ_edge_flags[j]);
+
+ same->hashval = same_succ_hash (same);
+
+ slot = (same_succ *) htab_find_slot_with_hash (same_succ_htab, same,
+ same->hashval, INSERT);
+ if (*slot == NULL)
+ {
+ *slot = same;
+ BB_SAME_SUCC (bb) = same;
+ add_to_worklist (same);
+ *same_p = NULL;
+ }
+ else
+ {
+ bitmap_set_bit ((*slot)->bbs, bb->index);
+ BB_SAME_SUCC (bb) = *slot;
+ add_to_worklist (*slot);
+ if (inverse_flags (same, *slot))
+ bitmap_set_bit ((*slot)->inverse, bb->index);
+ same_succ_reset (same);
+ }
+}
+
+/* Find bbs with same successors. */
+
+static void
+find_same_succ (void)
+{
+ same_succ same = same_succ_alloc ();
+ basic_block bb;
+
+ FOR_EACH_BB (bb)
+ {
+ find_same_succ_bb (bb, &same);
+ if (same == NULL)
+ same = same_succ_alloc ();
+ }
+
+ same_succ_delete (same);
+}
+
+/* Initializes worklist administration. */
+
+static void
+init_worklist (void)
+{
+ alloc_aux_for_blocks (sizeof (struct aux_bb_info));
+ same_succ_htab
+ = htab_create (n_basic_blocks, same_succ_hash, same_succ_equal,
+ same_succ_delete);
+ same_succ_edge_flags = XCNEWVEC (int, last_basic_block);
+ deleted_bbs = BITMAP_ALLOC (NULL);
+ deleted_bb_preds = BITMAP_ALLOC (NULL);
+ worklist = VEC_alloc (same_succ, heap, n_basic_blocks);
+ find_same_succ ();
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "initial worklist:\n");
+ print_worklist (dump_file);
+ }
+}
+
+/* Deletes worklist administration. */
+
+static void
+delete_worklist (void)
+{
+ free_aux_for_blocks ();
+ htab_delete (same_succ_htab);
+ same_succ_htab = NULL;
+ XDELETEVEC (same_succ_edge_flags);
+ same_succ_edge_flags = NULL;
+ BITMAP_FREE (deleted_bbs);
+ BITMAP_FREE (deleted_bb_preds);
+ VEC_free (same_succ, heap, worklist);
+}
+
+/* Mark BB as deleted, and mark its predecessors. */
+
+static void
+delete_basic_block_same_succ (basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ bitmap_set_bit (deleted_bbs, bb->index);
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ bitmap_set_bit (deleted_bb_preds, e->src->index);
+}
+
+/* Removes all bbs in BBS from their corresponding same_succ. */
+
+static void
+same_succ_flush_bbs (bitmap bbs)
+{
+ unsigned int i;
+ bitmap_iterator bi;
+
+ EXECUTE_IF_SET_IN_BITMAP (bbs, 0, i, bi)
+ {
+ basic_block bb = BASIC_BLOCK (i);
+ same_succ same = BB_SAME_SUCC (bb);
+ BB_SAME_SUCC (bb) = NULL;
+ if (bitmap_single_bit_set_p (same->bbs))
+ htab_remove_elt_with_hash (same_succ_htab, same, same->hashval);
+ else
+ bitmap_clear_bit (same->bbs, i);
+ }
+}
+
+/* Delete all deleted_bbs. */
+
+static void
+purge_bbs (void)
+{
+ unsigned int i;
+ bitmap_iterator bi;
+
+ same_succ_flush_bbs (deleted_bbs);
+
+ EXECUTE_IF_SET_IN_BITMAP (deleted_bbs, 0, i, bi)
+ delete_basic_block (BASIC_BLOCK (i));
+
+ bitmap_and_compl_into (deleted_bb_preds, deleted_bbs);
+ bitmap_clear (deleted_bbs);
+}
+
+/* For deleted_bb_preds, find bbs with same successors. */
+
+static void
+update_worklist (void)
+{
+ unsigned int i;
+ bitmap_iterator bi;
+ basic_block bb;
+ same_succ same;
+
+ bitmap_clear_bit (deleted_bb_preds, ENTRY_BLOCK);
+ same_succ_flush_bbs (deleted_bb_preds);
+
+ same = same_succ_alloc ();
+ EXECUTE_IF_SET_IN_BITMAP (deleted_bb_preds, 0, i, bi)
+ {
+ bb = BASIC_BLOCK (i);
+ gcc_assert (bb != NULL);
+ find_same_succ_bb (bb, &same);
+ if (same == NULL)
+ same = same_succ_alloc ();
+ }
+ same_succ_delete (same);
+ bitmap_clear (deleted_bb_preds);
+}
+
+/* Prints cluster C to FILE. */
+
+static void
+print_cluster (FILE *file, bb_cluster c)
+{
+ if (c == NULL)
+ return;
+ bitmap_print (file, c->bbs, "bbs:", "\n");
+ bitmap_print (file, c->preds, "preds:", "\n");
+}
+
+/* Prints cluster C to stderr. */
+
+extern void debug_cluster (bb_cluster);
+DEBUG_FUNCTION void
+debug_cluster (bb_cluster c)
+{
+ print_cluster (stderr, c);
+}
+
+/* Update C->rep_bb, given that BB is added to the cluster. */
+
+static void
+update_rep_bb (bb_cluster c, basic_block bb)
+{
+ /* Initial. */
+ if (c->rep_bb == NULL)
+ {
+ c->rep_bb = bb;
+ return;
+ }
+
+ /* Current needs no deps, keep it. */
+ if (BB_DEP_BB (c->rep_bb) == NULL)
+ return;
+
+ /* Bb needs no deps, change rep_bb. */
+ if (BB_DEP_BB (bb) == NULL)
+ {
+ c->rep_bb = bb;
+ return;
+ }
+
+ /* Bb needs last deps earlier than current, change rep_bb. A potential
+ problem with this, is that the first deps might also be earlier, which
+ would mean we prefer longer lifetimes for the deps. To be able to check
+ for this, we would have to trace BB_FIRST_DEP_BB as well, besides
+ BB_DEP_BB, which is really BB_LAST_DEP_BB.
+ The benefit of choosing the bb with last deps earlier, is that it can
+ potentially be used as replacement for more bbs. */
+ if (dominated_by_p (CDI_DOMINATORS, BB_DEP_BB (c->rep_bb), BB_DEP_BB (bb)))
+ c->rep_bb = bb;
+}
+
+/* Add BB to cluster C. Sets BB in C->bbs, and preds of BB in C->preds. */
+
+static void
+add_bb_to_cluster (bb_cluster c, basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ bitmap_set_bit (c->bbs, bb->index);
+
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ bitmap_set_bit (c->preds, e->src->index);
+
+ update_rep_bb (c, bb);
+}
+
+/* Allocate and init new cluster. */
+
+static bb_cluster
+new_cluster (void)
+{
+ bb_cluster c;
+ c = XCNEW (struct bb_cluster_def);
+ c->bbs = BITMAP_ALLOC (NULL);
+ c->preds = BITMAP_ALLOC (NULL);
+ c->rep_bb = NULL;
+ return c;
+}
+
+/* Delete clusters. */
+
+static void
+delete_cluster (bb_cluster c)
+{
+ if (c == NULL)
+ return;
+ BITMAP_FREE (c->bbs);
+ BITMAP_FREE (c->preds);
+ XDELETE (c);
+}
+
+DEF_VEC_P (bb_cluster);
+DEF_VEC_ALLOC_P (bb_cluster, heap);
+
+/* Array that contains all clusters. */
+
+static VEC (bb_cluster, heap) *all_clusters;
+
+/* Allocate all cluster vectors. */
+
+static void
+alloc_cluster_vectors (void)
+{
+ all_clusters = VEC_alloc (bb_cluster, heap, n_basic_blocks);
+}
+
+/* Reset all cluster vectors. */
+
+static void
+reset_cluster_vectors (void)
+{
+ unsigned int i;
+ basic_block bb;
+ for (i = 0; i < VEC_length (bb_cluster, all_clusters); ++i)
+ delete_cluster (VEC_index (bb_cluster, all_clusters, i));
+ VEC_truncate (bb_cluster, all_clusters, 0);
+ FOR_EACH_BB (bb)
+ BB_CLUSTER (bb) = NULL;
+}
+
+/* Delete all cluster vectors. */
+
+static void
+delete_cluster_vectors (void)
+{
+ unsigned int i;
+ for (i = 0; i < VEC_length (bb_cluster, all_clusters); ++i)
+ delete_cluster (VEC_index (bb_cluster, all_clusters, i));
+ VEC_free (bb_cluster, heap, all_clusters);
+}
+
+/* Merge cluster C2 into C1. */
+
+static void
+merge_clusters (bb_cluster c1, bb_cluster c2)
+{
+ bitmap_ior_into (c1->bbs, c2->bbs);
+ bitmap_ior_into (c1->preds, c2->preds);
+}
+
+/* Register equivalence of BB1 and BB2 (members of cluster C). Store c in
+ all_clusters, or merge c with existing cluster. */
+
+static void
+set_cluster (basic_block bb1, basic_block bb2)
+{
+ basic_block merge_bb, other_bb;
+ bb_cluster merge, old, c;
+
+ if (BB_CLUSTER (bb1) == NULL && BB_CLUSTER (bb2) == NULL)
+ {
+ c = new_cluster ();
+ add_bb_to_cluster (c, bb1);
+ add_bb_to_cluster (c, bb2);
+ BB_CLUSTER (bb1) = c;
+ BB_CLUSTER (bb2) = c;
+ c->index = VEC_length (bb_cluster, all_clusters);
+ VEC_safe_push (bb_cluster, heap, all_clusters, c);
+ }
+ else if (BB_CLUSTER (bb1) == NULL || BB_CLUSTER (bb2) == NULL)
+ {
+ merge_bb = BB_CLUSTER (bb1) == NULL ? bb2 : bb1;
+ other_bb = BB_CLUSTER (bb1) == NULL ? bb1 : bb2;
+ merge = BB_CLUSTER (merge_bb);
+ add_bb_to_cluster (merge, other_bb);
+ BB_CLUSTER (other_bb) = merge;
+ }
+ else if (BB_CLUSTER (bb1) != BB_CLUSTER (bb2))
+ {
+ unsigned int i;
+ bitmap_iterator bi;
+
+ old = BB_CLUSTER (bb2);
+ merge = BB_CLUSTER (bb1);
+ merge_clusters (merge, old);
+ EXECUTE_IF_SET_IN_BITMAP (old->bbs, 0, i, bi)
+ BB_CLUSTER (BASIC_BLOCK (i)) = merge;
+ VEC_replace (bb_cluster, all_clusters, old->index, NULL);
+ update_rep_bb (merge, old->rep_bb);
+ delete_cluster (old);
+ }
+ else
+ gcc_unreachable ();
+}
+
+/* Return true if gimple statements S1 and S2 are equal. Gimple_bb (s1) and
+ gimple_bb (s2) are members of SAME_SUCC. */
+
+static bool
+gimple_equal_p (same_succ same_succ, gimple s1, gimple s2)
+{
+ unsigned int i;
+ tree lhs1, lhs2;
+ basic_block bb1 = gimple_bb (s1), bb2 = gimple_bb (s2);
+ tree t1, t2;
+ bool equal, inv_cond;
+ enum tree_code code1, code2;
+
+ if (gimple_code (s1) != gimple_code (s2))
+ return false;
+
+ switch (gimple_code (s1))
+ {
+ case GIMPLE_CALL:
+ if (gimple_call_num_args (s1) != gimple_call_num_args (s2))
+ return false;
+ if (!gimple_call_same_target_p (s1, s2))
+ return false;
+
+ equal = true;
+ for (i = 0; i < gimple_call_num_args (s1); ++i)
+ {
+ t1 = gimple_call_arg (s1, i);
+ t2 = gimple_call_arg (s2, i);
+ if (operand_equal_p (t1, t2, 0))
+ continue;
+ if (gvn_uses_equal (t1, t2))
+ continue;
+ equal = false;
+ break;
+ }
+ if (equal)
+ return true;
+
+ lhs1 = gimple_get_lhs (s1);
+ lhs2 = gimple_get_lhs (s2);
+ return (lhs1 != NULL_TREE && lhs2 != NULL_TREE
+ && TREE_CODE (lhs1) == SSA_NAME && TREE_CODE (lhs2) == SSA_NAME
+ && vn_valueize (lhs1) == vn_valueize (lhs2));
+
+ case GIMPLE_ASSIGN:
+ lhs1 = gimple_get_lhs (s1);
+ lhs2 = gimple_get_lhs (s2);
+ return (TREE_CODE (lhs1) == SSA_NAME
+ && TREE_CODE (lhs2) == SSA_NAME
+ && vn_valueize (lhs1) == vn_valueize (lhs2));
+
+ case GIMPLE_COND:
+ t1 = gimple_cond_lhs (s1);
+ t2 = gimple_cond_lhs (s2);
+ if (!operand_equal_p (t1, t2, 0)
+ && !gvn_uses_equal (t1, t2))
+ return false;
+
+ t1 = gimple_cond_rhs (s1);
+ t2 = gimple_cond_rhs (s2);
+ if (!operand_equal_p (t1, t2, 0)
+ && !gvn_uses_equal (t1, t2))
+ return false;
+
+ code1 = gimple_expr_code (s1);
+ code2 = gimple_expr_code (s2);
+ inv_cond = (bitmap_bit_p (same_succ->inverse, bb1->index)
+ != bitmap_bit_p (same_succ->inverse, bb2->index));
+ if (inv_cond)
+ {
+ bool honor_nans
+ = HONOR_NANS (TYPE_MODE (TREE_TYPE (gimple_cond_lhs (s1))));
+ code2 = invert_tree_comparison (code2, honor_nans);
+ }
+ return code1 == code2;
+
+ default:
+ return false;
+ }
+}
+
+/* Let GSI skip backwards over local defs. */
+
+static void
+gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi)
+{
+ gimple stmt;
+
+ while (true)
+ {
+ if (gsi_end_p (*gsi))
+ return;
+ stmt = gsi_stmt (*gsi);
+ if (!(is_gimple_assign (stmt) && local_def (gimple_get_lhs (stmt))
+ && !gimple_has_side_effects (stmt)))
+ return;
+ gsi_prev_nondebug (gsi);
+ }
+}
+
+/* Determines whether BB1 and BB2 (members of same_succ) are duplicates. If so,
+ clusters them. */
+
+static void
+find_duplicate (same_succ same_succ, basic_block bb1, basic_block bb2)
+{
+ gimple_stmt_iterator gsi1 = gsi_last_nondebug_bb (bb1);
+ gimple_stmt_iterator gsi2 = gsi_last_nondebug_bb (bb2);
+
+ gsi_advance_bw_nondebug_nonlocal (&gsi1);
+ gsi_advance_bw_nondebug_nonlocal (&gsi2);
+
+ while (!gsi_end_p (gsi1) && !gsi_end_p (gsi2))
+ {
+ if (!gimple_equal_p (same_succ, gsi_stmt (gsi1), gsi_stmt (gsi2)))
+ return;
+
+ gsi_prev_nondebug (&gsi1);
+ gsi_prev_nondebug (&gsi2);
+ gsi_advance_bw_nondebug_nonlocal (&gsi1);
+ gsi_advance_bw_nondebug_nonlocal (&gsi2);
+ }
+
+ if (!(gsi_end_p (gsi1) && gsi_end_p (gsi2)))
+ return;
+
+ if (dump_file)
+ fprintf (dump_file, "find_duplicates: <bb %d> duplicate of <bb %d>\n",
+ bb1->index, bb2->index);
+
+ set_cluster (bb1, bb2);
+}
+
+/* Returns whether for all phis in DEST the phi alternatives for E1 and
+ E2 are equal. */
+
+static bool
+same_phi_alternatives_1 (basic_block dest, edge e1, edge e2)
+{
+ int n1 = e1->dest_idx, n2 = e2->dest_idx;
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ tree lhs = gimple_phi_result (phi);
+ tree val1 = gimple_phi_arg_def (phi, n1);
+ tree val2 = gimple_phi_arg_def (phi, n2);
+
+ if (!is_gimple_reg (lhs))
+ continue;
+
+ if (operand_equal_for_phi_arg_p (val1, val2))
+ continue;
+ if (gvn_uses_equal (val1, val2))
+ continue;
+
+ return false;
+ }
+
+ return true;
+}
+
+/* Returns whether for all successors of BB1 and BB2 (members of SAME_SUCC), the
+ phi alternatives for BB1 and BB2 are equal. */
+
+static bool
+same_phi_alternatives (same_succ same_succ, basic_block bb1, basic_block bb2)
+{
+ unsigned int s;
+ bitmap_iterator bs;
+ edge e1, e2;
+ basic_block succ;
+
+ EXECUTE_IF_SET_IN_BITMAP (same_succ->succs, 0, s, bs)
+ {
+ succ = BASIC_BLOCK (s);
+ e1 = find_edge (bb1, succ);
+ e2 = find_edge (bb2, succ);
+ if (e1->flags & EDGE_COMPLEX
+ || e2->flags & EDGE_COMPLEX)
+ return false;
+
+ /* For all phis in bb, the phi alternatives for e1 and e2 need to have
+ the same value. */
+ if (!same_phi_alternatives_1 (succ, e1, e2))
+ return false;
+ }
+
+ return true;
+}
+
+/* Return true if BB has non-vop phis. */
+
+static bool
+bb_has_non_vop_phi (basic_block bb)
+{
+ gimple_seq phis = phi_nodes (bb);
+ gimple phi;
+
+ if (phis == NULL)
+ return false;
+
+ if (!gimple_seq_singleton_p (phis))
+ return true;
+
+ phi = gimple_seq_first_stmt (phis);
+ return is_gimple_reg (gimple_phi_result (phi));
+}
+
+/* Returns true if redirecting the incoming edges of FROM to TO maintains the
+ invariant that uses in FROM are dominates by their defs. */
+
+static bool
+deps_ok_for_redirect_from_bb_to_bb (basic_block from, basic_block to)
+{
+ basic_block cd, dep_bb = BB_DEP_BB (to);
+ edge_iterator ei;
+ edge e;
+ bitmap from_preds = BITMAP_ALLOC (NULL);
+
+ if (dep_bb == NULL)
+ return true;
+
+ FOR_EACH_EDGE (e, ei, from->preds)
+ bitmap_set_bit (from_preds, e->src->index);
+ cd = nearest_common_dominator_for_set (CDI_DOMINATORS, from_preds);
+ BITMAP_FREE (from_preds);
+
+ return dominated_by_p (CDI_DOMINATORS, dep_bb, cd);
+}
+
+/* Returns true if replacing BB1 (or its replacement bb) by BB2 (or its
+ replacement bb) and vice versa maintains the invariant that uses in the
+ replacement are dominates by their defs. */
+
+static bool
+deps_ok_for_redirect (basic_block bb1, basic_block bb2)
+{
+ if (BB_CLUSTER (bb1) != NULL)
+ bb1 = BB_CLUSTER (bb1)->rep_bb;
+
+ if (BB_CLUSTER (bb2) != NULL)
+ bb2 = BB_CLUSTER (bb2)->rep_bb;
+
+ return (deps_ok_for_redirect_from_bb_to_bb (bb1, bb2)
+ && deps_ok_for_redirect_from_bb_to_bb (bb2, bb1));
+}
+
+/* Within SAME_SUCC->bbs, find clusters of bbs which can be merged. */
+
+static void
+find_clusters_1 (same_succ same_succ)
+{
+ basic_block bb1, bb2;
+ unsigned int i, j;
+ bitmap_iterator bi, bj;
+ int nr_comparisons;
+ int max_comparisons = PARAM_VALUE (PARAM_MAX_TAIL_MERGE_COMPARISONS);
+
+ EXECUTE_IF_SET_IN_BITMAP (same_succ->bbs, 0, i, bi)
+ {
+ bb1 = BASIC_BLOCK (i);
+
+ /* TODO: handle blocks with phi-nodes. We'll have to find corresponding
+ phi-nodes in bb1 and bb2, with the same alternatives for the same
+ preds. */
+ if (bb_has_non_vop_phi (bb1))
+ continue;
+
+ nr_comparisons = 0;
+ EXECUTE_IF_SET_IN_BITMAP (same_succ->bbs, i + 1, j, bj)
+ {
+ bb2 = BASIC_BLOCK (j);
+
+ if (bb_has_non_vop_phi (bb2))
+ continue;
+
+ if (BB_CLUSTER (bb1) != NULL && BB_CLUSTER (bb1) == BB_CLUSTER (bb2))
+ continue;
+
+ /* Limit quadratic behaviour. */
+ nr_comparisons++;
+ if (nr_comparisons > max_comparisons)
+ break;
+
+ /* This is a conservative dependency check. We could test more
+ precise for allowed replacement direction. */
+ if (!deps_ok_for_redirect (bb1, bb2))
+ continue;
+
+ if (!(same_phi_alternatives (same_succ, bb1, bb2)))
+ continue;
+
+ find_duplicate (same_succ, bb1, bb2);
+ }
+ }
+}
+
+/* Find clusters of bbs which can be merged. */
+
+static void
+find_clusters (void)
+{
+ same_succ same;
+
+ while (!VEC_empty (same_succ, worklist))
+ {
+ same = VEC_pop (same_succ, worklist);
+ same->in_worklist = false;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "processing worklist entry\n");
+ same_succ_print (dump_file, same);
+ }
+ find_clusters_1 (same);
+ }
+}
+
+/* Create or update a vop phi in BB2. Use VUSE1 arguments for all the
+ REDIRECTED_EDGES, or if VUSE1 is NULL_TREE, use BB_VOP_AT_EXIT. If a new
+ phis is created, use the phi instead of VUSE2 in BB2. */
+
+static void
+update_vuses (tree vuse1, tree vuse2, basic_block bb2,
+ VEC (edge,heap) *redirected_edges)
+{
+ gimple stmt, phi = NULL;
+ tree lhs = NULL_TREE, arg;
+ unsigned int i;
+ gimple def_stmt2;
+ imm_use_iterator iter;
+ use_operand_p use_p;
+ edge_iterator ei;
+ edge e;
+
+ def_stmt2 = SSA_NAME_DEF_STMT (vuse2);
+
+ if (gimple_bb (def_stmt2) == bb2)
+ /* Update existing phi. */
+ phi = def_stmt2;
+ else
+ {
+ /* No need to create a phi with 2 equal arguments. */
+ if (vuse1 == vuse2)
+ return;
+
+ /* Create a phi. */
+ lhs = make_ssa_name (SSA_NAME_VAR (vuse2), NULL);
+ VN_INFO_GET (lhs);
+ phi = create_phi_node (lhs, bb2);
+ SSA_NAME_DEF_STMT (lhs) = phi;
+
+ /* Set default argument vuse2 for all preds. */
+ FOR_EACH_EDGE (e, ei, bb2->preds)
+ add_phi_arg (phi, vuse2, e, UNKNOWN_LOCATION);
+ }
+
+ /* Update phi. */
+ for (i = 0; i < EDGE_COUNT (redirected_edges); ++i)
+ {
+ e = VEC_index (edge, redirected_edges, i);
+ if (vuse1 != NULL_TREE)
+ arg = vuse1;
+ else
+ arg = BB_VOP_AT_EXIT (e->src);
+ add_phi_arg (phi, arg, e, UNKNOWN_LOCATION);
+ }
+
+ /* Return if we updated an existing phi. */
+ if (gimple_bb (def_stmt2) == bb2)
+ return;
+
+ /* Replace relevant uses of vuse2 with the newly created phi. */
+ FOR_EACH_IMM_USE_STMT (stmt, iter, vuse2)
+ {
+ if (stmt == phi)
+ continue;
+ if (gimple_code (stmt) != GIMPLE_PHI)
+ if (gimple_bb (stmt) != bb2)
+ continue;
+
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ {
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ {
+ unsigned int pred_index = PHI_ARG_INDEX_FROM_USE (use_p);
+ basic_block pred = EDGE_PRED (gimple_bb (stmt), pred_index)->src;
+ if (pred != bb2)
+ continue;
+ }
+ SET_USE (use_p, lhs);
+ update_stmt (stmt);
+ }
+ }
+}
+
+/* Returns the vop phi of BB, if any. */
+
+static gimple
+vop_phi (basic_block bb)
+{
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ stmt = gsi_stmt (gsi);
+ if (is_gimple_reg (gimple_phi_result (stmt)))
+ continue;
+ return stmt;
+ }
+ return NULL;
+}
+
+/* Returns the vop state at the entry of BB, if found in BB or a successor
+ bb. */
+
+static tree
+vop_at_entry (basic_block bb)
+{
+ gimple bb_phi, succ_phi;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
+ tree vuse, vdef;
+ basic_block succ;
+
+ bb_phi = vop_phi (bb);
+ if (bb_phi != NULL)
+ return gimple_phi_result (bb_phi);
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ stmt = gsi_stmt (gsi);
+ vuse = gimple_vuse (stmt);
+ vdef = gimple_vdef (stmt);
+ if (vuse != NULL_TREE)
+ return vuse;
+ if (vdef != NULL_TREE)
+ return NULL_TREE;
+ }
+
+ if (EDGE_COUNT (bb->succs) == 0)
+ return NULL_TREE;
+
+ succ = EDGE_SUCC (bb, 0)->dest;
+ succ_phi = vop_phi (succ);
+ return (succ_phi != NULL
+ ? PHI_ARG_DEF_FROM_EDGE (succ_phi, find_edge (bb, succ))
+ : NULL_TREE);
+}
+
+/* Redirect all edges from BB1 to BB2, marks BB1 for removal, and if
+ UPDATE_VOPS, inserts vop phis. */
+
+static void
+replace_block_by (basic_block bb1, basic_block bb2, bool update_vops)
+{
+ edge pred_edge;
+ unsigned int i;
+ tree phi_vuse1 = NULL_TREE, phi_vuse2 = NULL_TREE, arg;
+ VEC (edge,heap) *redirected_edges = NULL;
+ edge e;
+ edge_iterator ei;
+
+ if (update_vops)
+ {
+ /* Find the vops at entry of bb1 and bb2. */
+ phi_vuse1 = vop_at_entry (bb1);
+ phi_vuse2 = vop_at_entry (bb2);
+
+ /* If one of the 2 not found, it means there's no need to update. */
+ update_vops = phi_vuse1 != NULL_TREE && phi_vuse2 != NULL_TREE;
+ }
+
+ if (update_vops && gimple_bb (SSA_NAME_DEF_STMT (phi_vuse1)) == bb1)
+ {
+ /* If the vop at entry of bb1 is a phi, save the phi alternatives in
+ BB_VOP_AT_EXIT, before we lose that information by redirecting the
+ edges. */
+ FOR_EACH_EDGE (e, ei, bb1->preds)
+ {
+ arg = PHI_ARG_DEF_FROM_EDGE (SSA_NAME_DEF_STMT (phi_vuse1), e);
+ BB_VOP_AT_EXIT (e->src) = arg;
+ }
+ phi_vuse1 = NULL;
+ }
+
+ /* Mark the basic block for later deletion. */
+ delete_basic_block_same_succ (bb1);
+
+ if (update_vops)
+ redirected_edges = VEC_alloc (edge, heap, 10);
+
+ /* Redirect the incoming edges of bb1 to bb2. */
+ for (i = EDGE_COUNT (bb1->preds); i > 0 ; --i)
+ {
+ pred_edge = EDGE_PRED (bb1, i - 1);
+ pred_edge = redirect_edge_and_branch (pred_edge, bb2);
+ gcc_assert (pred_edge != NULL);
+ if (update_vops)
+ VEC_safe_push (edge, heap, redirected_edges, pred_edge);
+ }
+
+ /* Update the vops. */
+ if (update_vops)
+ {
+ update_vuses (phi_vuse1, phi_vuse2, bb2, redirected_edges);
+ VEC_free (edge, heap, redirected_edges);
+ }
+}
+
+/* Bbs for which update_debug_stmt need to be called. */
+
+static bitmap update_bbs;
+
+/* For each cluster in all_clusters, merge all cluster->bbs. Returns
+ number of bbs removed. Insert vop phis if UPDATE_VOPS. */
+
+static int
+apply_clusters (bool update_vops)
+{
+ basic_block bb1, bb2;
+ bb_cluster c;
+ unsigned int i, j;
+ bitmap_iterator bj;
+ int nr_bbs_removed = 0;
+
+ for (i = 0; i < VEC_length (bb_cluster, all_clusters); ++i)
+ {
+ c = VEC_index (bb_cluster, all_clusters, i);
+ if (c == NULL)
+ continue;
+
+ bb2 = c->rep_bb;
+ bitmap_set_bit (update_bbs, bb2->index);
+
+ bitmap_clear_bit (c->bbs, bb2->index);
+ EXECUTE_IF_SET_IN_BITMAP (c->bbs, 0, j, bj)
+ {
+ bb1 = BASIC_BLOCK (j);
+ bitmap_clear_bit (update_bbs, bb1->index);
+
+ replace_block_by (bb1, bb2, update_vops);
+ nr_bbs_removed++;
+ }
+ }
+
+ return nr_bbs_removed;
+}
+
+/* Resets debug statement STMT if it has uses that are not dominated by their
+ defs. */
+
+static void
+update_debug_stmt (gimple stmt)
+{
+ use_operand_p use_p;
+ ssa_op_iter oi;
+ basic_block bbdef, bbuse;
+ gimple def_stmt;
+ tree name;
+
+ if (!gimple_debug_bind_p (stmt))
+ return;
+
+ bbuse = gimple_bb (stmt);
+ FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, oi, SSA_OP_USE)
+ {
+ name = USE_FROM_PTR (use_p);
+ gcc_assert (TREE_CODE (name) == SSA_NAME);
+
+ def_stmt = SSA_NAME_DEF_STMT (name);
+ gcc_assert (def_stmt != NULL);
+
+ bbdef = gimple_bb (def_stmt);
+ if (bbdef == NULL || bbuse == bbdef
+ || dominated_by_p (CDI_DOMINATORS, bbuse, bbdef))
+ continue;
+
+ gimple_debug_bind_reset_value (stmt);
+ update_stmt (stmt);
+ }
+}
+
+/* Resets all debug statements that have uses that are not
+ dominated by their defs. */
+
+static void
+update_debug_stmts (void)
+{
+ basic_block bb;
+ bitmap_iterator bi;
+ unsigned int i;
+
+ if (!MAY_HAVE_DEBUG_STMTS)
+ return;
+
+ EXECUTE_IF_SET_IN_BITMAP (update_bbs, 0, i, bi)
+ {
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+
+ bb = BASIC_BLOCK (i);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ stmt = gsi_stmt (gsi);
+ if (!is_gimple_debug (stmt))
+ continue;
+ update_debug_stmt (stmt);
+ }
+ }
+}
+
+/* Runs tail merge optimization. */
+
+unsigned int
+tail_merge_optimize (unsigned int todo)
+{
+ int nr_bbs_removed_total = 0;
+ int nr_bbs_removed;
+ bool loop_entered = false;
+ int iteration_nr = 0;
+ bool update_vops = !symbol_marked_for_renaming (gimple_vop (cfun));
+ int max_iterations = PARAM_VALUE (PARAM_MAX_TAIL_MERGE_ITERATIONS);
+
+ if (!flag_tree_tail_merge || max_iterations == 0)
+ return 0;
+
+ timevar_push (TV_TREE_TAIL_MERGE);
+
+ calculate_dominance_info (CDI_DOMINATORS);
+ init_worklist ();
+
+ while (!VEC_empty (same_succ, worklist))
+ {
+ if (!loop_entered)
+ {
+ loop_entered = true;
+ alloc_cluster_vectors ();
+ update_bbs = BITMAP_ALLOC (NULL);
+ }
+ else
+ reset_cluster_vectors ();
+
+ iteration_nr++;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "worklist iteration #%d\n", iteration_nr);
+
+ find_clusters ();
+ gcc_assert (VEC_empty (same_succ, worklist));
+ if (VEC_empty (bb_cluster, all_clusters))
+ break;
+
+ nr_bbs_removed = apply_clusters (update_vops);
+ nr_bbs_removed_total += nr_bbs_removed;
+ if (nr_bbs_removed == 0)
+ break;
+
+ free_dominance_info (CDI_DOMINATORS);
+ purge_bbs ();
+
+ if (iteration_nr == max_iterations)
+ break;
+
+ calculate_dominance_info (CDI_DOMINATORS);
+ update_worklist ();
+ }
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "htab collision / search: %f\n",
+ htab_collisions (same_succ_htab));
+
+ if (nr_bbs_removed_total > 0)
+ {
+ calculate_dominance_info (CDI_DOMINATORS);
+ update_debug_stmts ();
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Before TODOs.\n");
+ dump_function_to_file (current_function_decl, dump_file, dump_flags);
+ }
+
+ todo |= (TODO_verify_ssa | TODO_verify_stmts | TODO_verify_flow
+ | TODO_dump_func);
+ }
+
+ delete_worklist ();
+ if (loop_entered)
+ {
+ delete_cluster_vectors ();
+ BITMAP_FREE (update_bbs);
+ }
+
+ timevar_pop (TV_TREE_TAIL_MERGE);
+
+ return todo;
+}
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index 093b4b3e6f3..58be0a385a0 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -31,14 +31,15 @@ along with GCC; see the file COPYING3. If not see
/* Output the STRING constant to the string
table in OB. Then put the index onto the INDEX_STREAM. */
-static void
-write_string_cst (struct output_block *ob,
- struct lto_output_stream *index_stream,
- tree string)
+void
+streamer_write_string_cst (struct output_block *ob,
+ struct lto_output_stream *index_stream,
+ tree string)
{
streamer_write_string_with_length (ob, index_stream,
- TREE_STRING_POINTER (string),
- TREE_STRING_LENGTH (string),
+ string ? TREE_STRING_POINTER (string)
+ : NULL,
+ string ? TREE_STRING_LENGTH (string) : 0,
true);
}
@@ -866,7 +867,7 @@ streamer_write_tree_header (struct output_block *ob, tree expr)
/* The text in strings and identifiers are completely emitted in
the header. */
if (CODE_CONTAINS_STRUCT (code, TS_STRING))
- write_string_cst (ob, ob->main_stream, expr);
+ streamer_write_string_cst (ob, ob->main_stream, expr);
else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
write_identifier (ob, ob->main_stream, expr);
else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
diff --git a/gcc/tree-streamer.h b/gcc/tree-streamer.h
index b8f2d1fd335..06313303f0b 100644
--- a/gcc/tree-streamer.h
+++ b/gcc/tree-streamer.h
@@ -75,6 +75,8 @@ tree streamer_read_integer_cst (struct lto_input_block *, struct data_in *);
struct bitpack_d streamer_read_tree_bitfields (struct lto_input_block *, tree);
/* In tree-streamer-out.c. */
+void streamer_write_string_cst (struct output_block *,
+ struct lto_output_stream *, tree);
void streamer_write_chain (struct output_block *, tree, bool);
void streamer_write_tree_header (struct output_block *, tree);
void streamer_pack_tree_bitfields (struct bitpack_d *, tree);
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index afcd63de88e..042d703e15f 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -35,6 +35,10 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "optabs.h"
+
+static void expand_vector_operations_1 (gimple_stmt_iterator *);
+
+
/* Build a constant of type TYPE, made of VALUE's bits replicated
every TYPE_SIZE (INNER_TYPE) bits to fit TYPE's precision. */
static tree
@@ -125,6 +129,31 @@ do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
return gimplify_build2 (gsi, code, inner_type, a, b);
}
+
+/* Construct expression (A[BITPOS] code B[BITPOS]) ? -1 : 0
+
+ INNER_TYPE is the type of A and B elements
+
+ returned expression is of signed integer type with the
+ size equal to the size of INNER_TYPE. */
+static tree
+do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
+ tree bitpos, tree bitsize, enum tree_code code)
+{
+ tree comp_type;
+
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
+ b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
+
+ comp_type = build_nonstandard_integer_type
+ (GET_MODE_BITSIZE (TYPE_MODE (inner_type)), 0);
+
+ return gimplify_build3 (gsi, COND_EXPR, comp_type,
+ fold_build2 (code, boolean_type_node, a, b),
+ build_int_cst (comp_type, -1),
+ build_int_cst (comp_type, 0));
+}
+
/* Expand vector addition to scalars. This does bit twiddling
in order to increase parallelism:
@@ -333,6 +362,24 @@ uniform_vector_p (tree vec)
return NULL_TREE;
}
+/* Try to expand vector comparison expression OP0 CODE OP1 by
+ querying optab if the following expression:
+ VEC_COND_EXPR< OP0 CODE OP1, {-1,...}, {0,...}>
+ can be expanded. */
+static tree
+expand_vector_comparison (gimple_stmt_iterator *gsi, tree type, tree op0,
+ tree op1, enum tree_code code)
+{
+ tree t;
+ if (! expand_vec_cond_expr_p (type, TREE_TYPE (op0)))
+ t = expand_vector_piecewise (gsi, do_compare, type,
+ TREE_TYPE (TREE_TYPE (op0)), op0, op1, code);
+ else
+ t = NULL_TREE;
+
+ return t;
+}
+
static tree
expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type,
gimple assign, enum tree_code code)
@@ -375,8 +422,27 @@ expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type
case BIT_NOT_EXPR:
return expand_vector_parallel (gsi, do_unop, type,
gimple_assign_rhs1 (assign),
- NULL_TREE, code);
+ NULL_TREE, code);
+ case EQ_EXPR:
+ case NE_EXPR:
+ case GT_EXPR:
+ case LT_EXPR:
+ case GE_EXPR:
+ case LE_EXPR:
+ case UNEQ_EXPR:
+ case UNGT_EXPR:
+ case UNLT_EXPR:
+ case UNGE_EXPR:
+ case UNLE_EXPR:
+ case LTGT_EXPR:
+ case ORDERED_EXPR:
+ case UNORDERED_EXPR:
+ {
+ tree rhs1 = gimple_assign_rhs1 (assign);
+ tree rhs2 = gimple_assign_rhs2 (assign);
+ return expand_vector_comparison (gsi, type, rhs1, rhs2, code);
+ }
default:
break;
}
@@ -450,11 +516,11 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
code = gimple_assign_rhs_code (stmt);
rhs_class = get_gimple_rhs_class (code);
+ lhs = gimple_assign_lhs (stmt);
if (rhs_class != GIMPLE_UNARY_RHS && rhs_class != GIMPLE_BINARY_RHS)
return;
- lhs = gimple_assign_lhs (stmt);
rhs1 = gimple_assign_rhs1 (stmt);
type = gimple_expr_type (stmt);
if (rhs_class == GIMPLE_BINARY_RHS)
@@ -598,6 +664,11 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
gcc_assert (code != VEC_LSHIFT_EXPR && code != VEC_RSHIFT_EXPR);
new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code);
+
+ /* Leave expression untouched for later expansion. */
+ if (new_rhs == NULL_TREE)
+ return;
+
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_rhs)))
new_rhs = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs),
new_rhs);
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 669b2bb203c..4b205bf332a 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -393,20 +393,15 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
return false;
}
- ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
- if (ncopies != 1)
+ /* In case of multiple types we need to detect the smallest type. */
+ if (*max_nunits < TYPE_VECTOR_SUBPARTS (vectype))
{
- if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump, "SLP with multiple types ");
-
- /* FORNOW: multiple types are unsupported in BB SLP. */
- if (bb_vinfo)
- return false;
+ *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
+ if (bb_vinfo)
+ vectorization_factor = *max_nunits;
}
- /* In case of multiple types we need to detect the smallest type. */
- if (*max_nunits < TYPE_VECTOR_SUBPARTS (vectype))
- *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
+ ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
if (is_gimple_call (stmt))
rhs_code = CALL_EXPR;
@@ -1201,7 +1196,6 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
if (loop_vinfo)
vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
else
- /* No multitypes in BB SLP. */
vectorization_factor = nunits;
/* Calculate the unrolling factor. */
@@ -1257,16 +1251,23 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
&max_nunits, &load_permutation, &loads,
vectorization_factor))
{
- /* Create a new SLP instance. */
- new_instance = XNEW (struct _slp_instance);
- SLP_INSTANCE_TREE (new_instance) = node;
- SLP_INSTANCE_GROUP_SIZE (new_instance) = group_size;
- /* Calculate the unrolling factor based on the smallest type in the
- loop. */
+ /* Calculate the unrolling factor based on the smallest type. */
if (max_nunits > nunits)
unrolling_factor = least_common_multiple (max_nunits, group_size)
/ group_size;
+ if (unrolling_factor != 1 && !loop_vinfo)
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ fprintf (vect_dump, "Build SLP failed: unrolling required in basic"
+ " block SLP");
+ return false;
+ }
+
+ /* Create a new SLP instance. */
+ new_instance = XNEW (struct _slp_instance);
+ SLP_INSTANCE_TREE (new_instance) = node;
+ SLP_INSTANCE_GROUP_SIZE (new_instance) = group_size;
SLP_INSTANCE_UNROLLING_FACTOR (new_instance) = unrolling_factor;
SLP_INSTANCE_OUTSIDE_OF_LOOP_COST (new_instance) = outside_cost;
SLP_INSTANCE_INSIDE_OF_LOOP_COST (new_instance) = inside_cost;
@@ -1694,42 +1695,18 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
/* Check if the basic block can be vectorized. */
-bb_vec_info
-vect_slp_analyze_bb (basic_block bb)
+static bb_vec_info
+vect_slp_analyze_bb_1 (basic_block bb)
{
bb_vec_info bb_vinfo;
VEC (ddr_p, heap) *ddrs;
VEC (slp_instance, heap) *slp_instances;
slp_instance instance;
- int i, insns = 0;
- gimple_stmt_iterator gsi;
+ int i;
int min_vf = 2;
int max_vf = MAX_VECTORIZATION_FACTOR;
bool data_dependence_in_bb = false;
- current_vector_size = 0;
-
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "===vect_slp_analyze_bb===\n");
-
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
- if (!is_gimple_debug (stmt)
- && !gimple_nop_p (stmt)
- && gimple_code (stmt) != GIMPLE_LABEL)
- insns++;
- }
-
- if (insns > PARAM_VALUE (PARAM_SLP_MAX_INSNS_IN_BB))
- {
- if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
- fprintf (vect_dump, "not vectorized: too many instructions in basic "
- "block.\n");
-
- return NULL;
- }
-
bb_vinfo = new_bb_vec_info (bb);
if (!bb_vinfo)
return NULL;
@@ -1849,6 +1826,61 @@ vect_slp_analyze_bb (basic_block bb)
}
+bb_vec_info
+vect_slp_analyze_bb (basic_block bb)
+{
+ bb_vec_info bb_vinfo;
+ int insns = 0;
+ gimple_stmt_iterator gsi;
+ unsigned int vector_sizes;
+
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "===vect_slp_analyze_bb===\n");
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!is_gimple_debug (stmt)
+ && !gimple_nop_p (stmt)
+ && gimple_code (stmt) != GIMPLE_LABEL)
+ insns++;
+ }
+
+ if (insns > PARAM_VALUE (PARAM_SLP_MAX_INSNS_IN_BB))
+ {
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+ fprintf (vect_dump, "not vectorized: too many instructions in basic "
+ "block.\n");
+
+ return NULL;
+ }
+
+ /* Autodetect first vector size we try. */
+ current_vector_size = 0;
+ vector_sizes = targetm.vectorize.autovectorize_vector_sizes ();
+
+ while (1)
+ {
+ bb_vinfo = vect_slp_analyze_bb_1 (bb);
+ if (bb_vinfo)
+ return bb_vinfo;
+
+ destroy_bb_vec_info (bb_vinfo);
+
+ vector_sizes &= ~current_vector_size;
+ if (vector_sizes == 0
+ || current_vector_size == 0)
+ return NULL;
+
+ /* Try the next biggest vector size. */
+ current_vector_size = 1 << floor_log2 (vector_sizes);
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "***** Re-trying analysis with "
+ "vector size %d\n", current_vector_size);
+ }
+}
+
+
/* SLP costs are calculated according to SLP instance unrolling factor (i.e.,
the number of created vector stmts depends on the unrolling factor).
However, the actual number of vector stmts for every SLP node depends on
@@ -1905,14 +1937,9 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
gimple def_stmt;
struct loop *loop;
- if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
+ && reduc_index != -1)
{
- if (reduc_index == -1)
- {
- VEC_free (tree, heap, *vec_oprnds);
- return;
- }
-
op_num = reduc_index - 1;
op = gimple_op (stmt, reduc_index);
/* For additional copies (see the explanation of NUMBER_OF_COPIES below)
@@ -2164,7 +2191,7 @@ vect_get_slp_defs (tree op0, tree op1, slp_tree slp_node,
return;
code = gimple_assign_rhs_code (first_stmt);
- if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1)
+ if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1 || !op1)
return;
/* The number of vector defs is determined by the number of vector statements
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 2c770919a2a..8c2edadba13 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3039,11 +3039,9 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
VEC (tree, heap) *vec_oprnds0 = NULL;
VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
tree last_oprnd, intermediate_type;
+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
- /* FORNOW: not supported by basic block SLP vectorization. */
- gcc_assert (loop_vinfo);
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
@@ -3071,7 +3069,7 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
&& CONVERT_EXPR_CODE_P (code))))
return false;
- if (!vect_is_simple_use_1 (op0, loop_vinfo, NULL,
+ if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
&def_stmt, &def, &dt[0], &vectype_in))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3318,11 +3316,9 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
int multi_step_cvt = 0;
VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
- /* FORNOW: not supported by basic block SLP vectorization. */
- gcc_assert (loop_vinfo);
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
@@ -3351,7 +3347,7 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
&& CONVERT_EXPR_CODE_P (code))))
return false;
- if (!vect_is_simple_use_1 (op0, loop_vinfo, NULL,
+ if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
&def_stmt, &def, &dt[0], &vectype_in))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -5083,7 +5079,9 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
else
{
if (bb_vinfo)
- ok = (vectorizable_shift (stmt, NULL, NULL, node)
+ ok = (vectorizable_type_promotion (stmt, NULL, NULL, node)
+ || vectorizable_type_demotion (stmt, NULL, NULL, node)
+ || vectorizable_shift (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node)
|| vectorizable_assignment (stmt, NULL, NULL, node)
|| vectorizable_load (stmt, NULL, NULL, node, NULL)
@@ -5719,7 +5717,7 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *vect_loop = LOOP_VINFO_LOOP (loop_info);
+ struct loop *vect_loop = NULL;
bool ordered_p;
enum machine_mode vec_mode;
enum insn_code icode1, icode2;
@@ -5728,6 +5726,9 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
tree wide_vectype = vectype_out;
enum tree_code c1, c2;
+ if (loop_info)
+ vect_loop = LOOP_VINFO_LOOP (loop_info);
+
/* The result of a vectorized widening operation usually requires two vectors
(because the widened results do not fit int one vector). The generated
vector results would normally be expected to be generated in the same
@@ -5748,7 +5749,8 @@ supportable_widening_operation (enum tree_code code, gimple stmt,
iterations in parallel). We therefore don't allow to change the order
of the computation in the inner-loop during outer-loop vectorization. */
- if (STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
+ if (vect_loop
+ && STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
&& !nested_in_vect_loop_p (vect_loop, stmt))
ordered_p = false;
else
diff --git a/gcc/tree.c b/gcc/tree.c
index a53c9f432ee..3e9750383e1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8749,11 +8749,11 @@ get_file_function_name (const char *type)
file = input_filename;
len = strlen (file);
- q = (char *) alloca (9 * 2 + len + 1);
+ q = (char *) alloca (9 + 17 + len + 1);
memcpy (q, file, len + 1);
- sprintf (q + len, "_%08X_%08X", crc32_string (0, name),
- crc32_string (0, get_random_seed (false)));
+ snprintf (q + len, 9 + 17 + 1, "_%08X_" HOST_WIDE_INT_PRINT_HEX,
+ crc32_string (0, name), get_random_seed (false));
p = q;
}
@@ -9752,17 +9752,29 @@ build_vector_type (tree innertype, int nunits)
return make_vector_type (innertype, nunits, VOIDmode);
}
-/* Similarly, but takes the inner type and number of units, which must be
- a power of two. */
+/* Similarly, but builds a variant type with TYPE_VECTOR_OPAQUE set. */
tree
build_opaque_vector_type (tree innertype, int nunits)
{
- tree t;
- innertype = build_distinct_type_copy (innertype);
- t = make_vector_type (innertype, nunits, VOIDmode);
- TYPE_VECTOR_OPAQUE (t) = true;
- return t;
+ tree t = make_vector_type (innertype, nunits, VOIDmode);
+ tree cand;
+ /* We always build the non-opaque variant before the opaque one,
+ so if it already exists, it is TYPE_NEXT_VARIANT of this one. */
+ cand = TYPE_NEXT_VARIANT (t);
+ if (cand
+ && TYPE_VECTOR_OPAQUE (cand)
+ && check_qualified_type (cand, t, TYPE_QUALS (t)))
+ return cand;
+ /* Othewise build a variant type and make sure to queue it after
+ the non-opaque type. */
+ cand = build_distinct_type_copy (t);
+ TYPE_VECTOR_OPAQUE (cand) = true;
+ TYPE_CANONICAL (cand) = TYPE_CANONICAL (t);
+ TYPE_NEXT_VARIANT (cand) = TYPE_NEXT_VARIANT (t);
+ TYPE_NEXT_VARIANT (t) = cand;
+ TYPE_MAIN_VARIANT (cand) = TYPE_MAIN_VARIANT (t);
+ return cand;
}
diff --git a/gcc/tree.h b/gcc/tree.h
index ac45ea6ab6f..f064bbe30f5 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5384,6 +5384,8 @@ extern unsigned int get_pointer_alignment (tree);
extern tree fold_call_stmt (gimple, bool);
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
extern tree make_range (tree, int *, tree *, tree *, bool *);
+extern tree make_range_step (location_t, enum tree_code, tree, tree, tree,
+ tree *, tree *, int *, bool *);
extern tree build_range_check (location_t, tree, tree, int, tree, tree);
extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
tree, tree);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index e83bebbb04e..9b4dfad5cbb 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6159,6 +6159,8 @@ default_elf_asm_named_section (const char *name, unsigned int flags,
if (!(flags & SECTION_DEBUG))
*f++ = 'a';
+ if (flags & SECTION_EXCLUDE)
+ *f++ = 'e';
if (flags & SECTION_WRITE)
*f++ = 'w';
if (flags & SECTION_CODE)
@@ -6681,6 +6683,7 @@ static bool
resolution_to_local_definition_p (enum ld_plugin_symbol_resolution resolution)
{
return (resolution == LDPR_PREVAILING_DEF
+ || resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
|| resolution == LDPR_PREVAILING_DEF_IRONLY);
}
@@ -6692,6 +6695,7 @@ resolution_local_p (enum ld_plugin_symbol_resolution resolution)
{
return (resolution == LDPR_PREVAILING_DEF
|| resolution == LDPR_PREVAILING_DEF_IRONLY
+ || resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
|| resolution == LDPR_PREEMPTED_REG
|| resolution == LDPR_PREEMPTED_IR
|| resolution == LDPR_RESOLVED_IR
diff --git a/include/ChangeLog b/include/ChangeLog
index 32f4c6f8fb0..342ae36e176 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,22 @@
+2011-09-28 Doug Evans <dje@google.com>
+
+ * timeval-utils.h: New file.
+
+ * libiberty.h (countargv): Declare.
+
+2011-09-26 Cary Coutant <ccoutant@google.com>
+
+ PR lto/47247
+ * plugin-api.h (enum ld_plugin_symbol_resolution): Add
+ LDPR_PREVAILING_DEF_IRONLY_EXP.
+ (enum ld_plugin_tag): Add LDPT_GET_SYMBOLS_V2.
+
+2011-09-23 Cary Coutant <ccoutant@google.com>
+
+ PR 40831
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_CLONE.
+
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* xregex.h (regoff_t): Define.
diff --git a/include/demangle.h b/include/demangle.h
index 53f6c54f524..960e88e0f2a 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -402,7 +402,9 @@ enum demangle_component_type
/* An unnamed type. */
DEMANGLE_COMPONENT_UNNAMED_TYPE,
/* A pack expansion. */
- DEMANGLE_COMPONENT_PACK_EXPANSION
+ DEMANGLE_COMPONENT_PACK_EXPANSION,
+ /* A cloned function. */
+ DEMANGLE_COMPONENT_CLONE
};
/* Types which are only used internally. */
diff --git a/include/libiberty.h b/include/libiberty.h
index 32eb83a049e..cacde800ea3 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -91,6 +91,10 @@ extern void expandargv PARAMS ((int *, char ***));
extern int writeargv PARAMS ((char **, FILE *));
+/* Return the number of elements in argv. */
+
+extern int countargv (char**);
+
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
diff --git a/include/plugin-api.h b/include/plugin-api.h
index df0039372f3..122424c6cb7 100644
--- a/include/plugin-api.h
+++ b/include/plugin-api.h
@@ -155,7 +155,13 @@ enum ld_plugin_symbol_resolution
LDPR_RESOLVED_EXEC,
/* This symbol was resolved by a definition in a shared object. */
- LDPR_RESOLVED_DYN
+ LDPR_RESOLVED_DYN,
+
+ /* This is the prevailing definition of the symbol, with no
+ references from regular objects. It is only referenced from IR
+ code, but the symbol is exported and may be referenced from
+ a dynamic object (not seen at link time). */
+ LDPR_PREVAILING_DEF_IRONLY_EXP
};
/* The plugin library's "claim file" handler. */
@@ -347,7 +353,8 @@ enum ld_plugin_tag
LDPT_GET_INPUT_SECTION_NAME,
LDPT_GET_INPUT_SECTION_CONTENTS,
LDPT_UPDATE_SECTION_ORDER,
- LDPT_ALLOW_SECTION_ORDERING
+ LDPT_ALLOW_SECTION_ORDERING,
+ LDPT_GET_SYMBOLS_V2
};
/* The plugin transfer vector. */
diff --git a/include/timeval-utils.h b/include/timeval-utils.h
new file mode 100644
index 00000000000..1caf9b36d15
--- /dev/null
+++ b/include/timeval-utils.h
@@ -0,0 +1,40 @@
+/* Basic struct timeval utilities.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#ifndef TIMEVAL_UTILS_H
+#define TIMEVAL_UTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* forward decl */
+struct timeval;
+
+extern void timeval_add (struct timeval *result,
+ const struct timeval *a, const struct timeval *b);
+
+extern void timeval_sub (struct timeval *result,
+ const struct timeval *a, const struct timeval *b);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* TIMEVAL_UTILS_H */
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 2f6973b7a82..a9f771c82ec 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,5 +1,12 @@
+2011-09-28 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx-lib.h: Always restrict doubles to the SF type when
+ 64-bit doubles are not enabled.
+ * config/rx/rx-abi.h: Fix extraneous renaming of the floatsisf
+ and floatunsisf functions.
+
2011-09-13 Paul Brook <paul@codesourcery.com>
-
+
* config.host (tic6x-*-*): Add c6x/t-c6x-elf. Set unwind_header.
* unwind-c.c (PERSONALITY_FUNCTION): Use UNWIND_POINTER_REG.
* unwind-arm-common.inc: New file.
diff --git a/libgcc/config/rx/rx-abi.h b/libgcc/config/rx/rx-abi.h
index 8a0bbdcd82c..6882efc31cb 100644
--- a/libgcc/config/rx/rx-abi.h
+++ b/libgcc/config/rx/rx-abi.h
@@ -80,15 +80,6 @@
#endif
-#ifdef L_si_to_sf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatsisf, CONV32sf)
-#endif
-
-#ifdef L_usi_to_sf
-#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatunsisf, CONV32uf)
-#endif
-
-
#ifdef __RX_64BIT_DOUBLES__
@@ -176,6 +167,14 @@
#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (negdf2, NEGd)
#endif
+#ifdef L_si_to_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatsisf, CONV32sf)
+#endif
+
+#ifdef L_usi_to_sf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatunsisf, CONV32uf)
+#endif
+
/* The 64-bit comparison functions do not have aliases because libgcc2
does not provide them. Instead they have to be supplied in
rx-abi-functions.c. */
diff --git a/libgcc/config/rx/rx-lib.h b/libgcc/config/rx/rx-lib.h
index fb1d14632a6..c83516fd64b 100644
--- a/libgcc/config/rx/rx-lib.h
+++ b/libgcc/config/rx/rx-lib.h
@@ -1,6 +1,5 @@
-#ifdef FLOAT
#ifndef __RX_64BIT_DOUBLES__
#define DF SF
#define FLOAT_ONLY
#endif
-#endif
+
diff --git a/libgo/MERGE b/libgo/MERGE
index f0849cc1a18..41cab710019 100644
--- a/libgo/MERGE
+++ b/libgo/MERGE
@@ -1,4 +1,4 @@
-504f4e9b079c
+fd30c132d1bd
The first line of this file holds the Mercurial revision number of the
last merge done from the master library sources.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 2881c6d7c09..6992ce19e3f 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -636,7 +636,8 @@ go_json_files = \
go/json/encode.go \
go/json/indent.go \
go/json/scanner.go \
- go/json/stream.go
+ go/json/stream.go \
+ go/json/tags.go
go_log_files = \
go/log/log.go
@@ -1760,6 +1761,8 @@ GOTESTFLAGS =
CHECK = \
GC="$(GOC) $(GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
export GC; \
+ GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \
+ export GOLIBS; \
RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
export RUNTESTFLAGS; \
MAKE="$(MAKE)"; \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 41ffe7c7230..cdabd023d1a 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1037,7 +1037,8 @@ go_json_files = \
go/json/encode.go \
go/json/indent.go \
go/json/scanner.go \
- go/json/stream.go
+ go/json/stream.go \
+ go/json/tags.go
go_log_files = \
go/log/log.go
@@ -2076,6 +2077,8 @@ GOTESTFLAGS =
CHECK = \
GC="$(GOC) $(GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
export GC; \
+ GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \
+ export GOLIBS; \
RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
export RUNTESTFLAGS; \
MAKE="$(MAKE)"; \
diff --git a/libgo/go/go/types/testdata/test0.src b/libgo/go/go/types/testdata/test0.src
new file mode 100644
index 00000000000..84a1abe2701
--- /dev/null
+++ b/libgo/go/go/types/testdata/test0.src
@@ -0,0 +1,154 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// type declarations
+
+package test0
+
+import "unsafe"
+
+const pi = 3.1415
+
+type (
+ N undeclared /* ERROR "undeclared" */
+ B bool
+ I int32
+ A [10]P
+ T struct {
+ x, y P
+ }
+ P *T
+ R (*R)
+ F func(A) I
+ Y interface {
+ f(A) I
+ }
+ S [](((P)))
+ M map[I]F
+ C chan<- I
+)
+
+
+type (
+ p1 pi /* ERROR "not a package" */ .foo
+ p2 unsafe.Pointer
+)
+
+
+type (
+ Pi pi /* ERROR "not a type" */
+
+ a /* DISABLED "illegal cycle" */ a
+ a /* ERROR "redeclared" */ int
+
+ // where the cycle error appears depends on the
+ // order in which declarations are processed
+ // (which depends on the order in which a map
+ // is iterated through)
+ b c
+ c /* DISABLED "illegal cycle" */ d
+ d e
+ e b
+
+ t *t
+
+ U V
+ V *W
+ W U
+
+ P1 *S2
+ P2 P1
+
+ S0 struct {
+ }
+ S1 struct {
+ a, b, c int
+ u, v, a /* ERROR "redeclared" */ float32
+ }
+ S2 struct {
+ U // anonymous field
+ // TODO(gri) recognize double-declaration below
+ // U /* ERROR "redeclared" */ int
+ }
+ S3 struct {
+ x S2
+ }
+ S4/* DISABLED "illegal cycle" */ struct {
+ S4
+ }
+ S5 struct {
+ S6
+ }
+ S6 /* DISABLED "illegal cycle" */ struct {
+ field S7
+ }
+ S7 struct {
+ S5
+ }
+
+ L1 []L1
+ L2 []int
+
+ A1 [10]int
+ A2 /* DISABLED "illegal cycle" */ [10]A2
+ A3 /* DISABLED "illegal cycle" */ [10]struct {
+ x A4
+ }
+ A4 [10]A3
+
+ F1 func()
+ F2 func(x, y, z float32)
+ F3 func(x, y, x /* ERROR "redeclared" */ float32)
+ F4 func() (x, y, x /* ERROR "redeclared" */ float32)
+ F5 func(x int) (x /* ERROR "redeclared" */ float32)
+ F6 func(x ...int)
+
+ I1 interface{}
+ I2 interface {
+ m1()
+ }
+ I3 interface {
+ m1()
+ m1 /* ERROR "redeclared" */ ()
+ }
+ I4 interface {
+ m1(x, y, x /* ERROR "redeclared" */ float32)
+ m2() (x, y, x /* ERROR "redeclared" */ float32)
+ m3(x int) (x /* ERROR "redeclared" */ float32)
+ }
+ I5 interface {
+ m1(I5)
+ }
+ I6 interface {
+ S0 /* ERROR "non-interface" */
+ }
+ I7 interface {
+ I1
+ I1
+ }
+ I8 /* DISABLED "illegal cycle" */ interface {
+ I8
+ }
+ I9 /* DISABLED "illegal cycle" */ interface {
+ I10
+ }
+ I10 interface {
+ I11
+ }
+ I11 interface {
+ I9
+ }
+
+ C1 chan int
+ C2 <-chan int
+ C3 chan<- C3
+ C4 chan C5
+ C5 chan C6
+ C6 chan C4
+
+ M1 map[Last]string
+ M2 map[string]M2
+
+ Last int
+)
diff --git a/libgo/go/gob/doc.go b/libgo/go/gob/doc.go
index 35d882afb7a..a9284ced7f9 100644
--- a/libgo/go/gob/doc.go
+++ b/libgo/go/gob/doc.go
@@ -221,6 +221,9 @@ In summary, a gob stream looks like
where * signifies zero or more repetitions and the type id of a value must
be predefined or be defined before the value in the stream.
+
+See "Gobs of data" for a design discussion of the gob wire format:
+http://blog.golang.org/2011/03/gobs-of-data.html
*/
package gob
diff --git a/libgo/go/html/testdata/webkit/adoption01.dat b/libgo/go/html/testdata/webkit/adoption01.dat
new file mode 100644
index 00000000000..787e1b01e19
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/adoption01.dat
@@ -0,0 +1,194 @@
+#data
+<a><p></a></p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <p>
+| <a>
+
+#data
+<a>1<p>2</a>3</p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <p>
+| <a>
+| "2"
+| "3"
+
+#data
+<a>1<button>2</a>3</button>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <button>
+| <a>
+| "2"
+| "3"
+
+#data
+<a>1<b>2</a>3</b>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <b>
+| "2"
+| <b>
+| "3"
+
+#data
+<a>1<div>2<div>3</a>4</div>5</div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <div>
+| <a>
+| "2"
+| <div>
+| <a>
+| "3"
+| "4"
+| "5"
+
+#data
+<table><a>1<p>2</a>3</p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <p>
+| <a>
+| "2"
+| "3"
+| <table>
+
+#data
+<b><b><a><p></a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <b>
+| <b>
+| <a>
+| <p>
+| <a>
+
+#data
+<b><a><b><p></a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <b>
+| <a>
+| <b>
+| <b>
+| <p>
+| <a>
+
+#data
+<a><b><b><p></a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <b>
+| <b>
+| <b>
+| <p>
+| <a>
+
+#data
+<p>1<s id="A">2<b id="B">3</p>4</s>5</b>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| "1"
+| <s>
+| id="A"
+| "2"
+| <b>
+| id="B"
+| "3"
+| <s>
+| id="A"
+| <b>
+| id="B"
+| "4"
+| <b>
+| id="B"
+| "5"
+
+#data
+<table><a>1<td>2</td>3</table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| "1"
+| <a>
+| "3"
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "2"
+
+#data
+<table>A<td>B</td>C</table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "AC"
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "B"
+
+#data
+<a><svg><tr><input></a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <svg svg>
+| <svg tr>
+| <svg input>
diff --git a/libgo/go/html/testdata/webkit/adoption02.dat b/libgo/go/html/testdata/webkit/adoption02.dat
new file mode 100644
index 00000000000..d18151b44f0
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/adoption02.dat
@@ -0,0 +1,31 @@
+#data
+<b>1<i>2<p>3</b>4
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <b>
+| "1"
+| <i>
+| "2"
+| <i>
+| <p>
+| <b>
+| "3"
+| "4"
+
+#data
+<a><div><style></style><address><a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <div>
+| <a>
+| <style>
+| <address>
+| <a>
+| <a>
diff --git a/libgo/go/html/testdata/webkit/html5test-com.dat b/libgo/go/html/testdata/webkit/html5test-com.dat
new file mode 100644
index 00000000000..d7cb71db054
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/html5test-com.dat
@@ -0,0 +1,246 @@
+#data
+<div<div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div<div>
+
+#data
+<div foo<bar=''>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+| foo<bar=""
+
+#data
+<div foo=`bar`>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+| foo="`bar`"
+
+#data
+<div \"foo=''>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+| \"foo=""
+
+#data
+<a href='\nbar'></a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| href="\nbar"
+
+#data
+<!DOCTYPE html>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+
+#data
+&lang;&rang;
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "⟨⟩"
+
+#data
+&apos;
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "'"
+
+#data
+&ImaginaryI;
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "ⅈ"
+
+#data
+&Kopf;
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "𝕂"
+
+#data
+&notinva;
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "∉"
+
+#data
+<?import namespace="foo" implementation="#bar">
+#errors
+#document
+| <!-- ?import namespace="foo" implementation="#bar" -->
+| <html>
+| <head>
+| <body>
+
+#data
+<!--foo--bar-->
+#errors
+#document
+| <!-- foo--bar -->
+| <html>
+| <head>
+| <body>
+
+#data
+<![CDATA[x]]>
+#errors
+#document
+| <!-- [CDATA[x]] -->
+| <html>
+| <head>
+| <body>
+
+#data
+<textarea><!--</textarea>--></textarea>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <textarea>
+| "<!--"
+| "-->"
+
+#data
+<textarea><!--</textarea>-->
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <textarea>
+| "<!--"
+| "-->"
+
+#data
+<style><!--</style>--></style>
+#errors
+#document
+| <html>
+| <head>
+| <style>
+| "<!--"
+| <body>
+| "-->"
+
+#data
+<style><!--</style>-->
+#errors
+#document
+| <html>
+| <head>
+| <style>
+| "<!--"
+| <body>
+| "-->"
+
+#data
+<ul><li>A </li> <li>B</li></ul>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <ul>
+| <li>
+| "A "
+| " "
+| <li>
+| "B"
+
+#data
+<table><form><input type=hidden><input></form><div></div></table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <input>
+| <div>
+| <table>
+| <form>
+| <input>
+| type="hidden"
+
+#data
+<i>A<b>B<p></i>C</b>D
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <i>
+| "A"
+| <b>
+| "B"
+| <b>
+| <p>
+| <b>
+| <i>
+| "C"
+| "D"
+
+#data
+<div></div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+
+#data
+<svg></svg>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+
+#data
+<math></math>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
diff --git a/libgo/go/html/testdata/webkit/inbody01.dat b/libgo/go/html/testdata/webkit/inbody01.dat
new file mode 100644
index 00000000000..3f2bd374c03
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/inbody01.dat
@@ -0,0 +1,43 @@
+#data
+<button>1</foo>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <button>
+| "1"
+
+#data
+<foo>1<p>2</foo>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <foo>
+| "1"
+| <p>
+| "2"
+
+#data
+<dd>1</foo>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <dd>
+| "1"
+
+#data
+<foo>1<dd>2</foo>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <foo>
+| "1"
+| <dd>
+| "2"
diff --git a/libgo/go/html/testdata/webkit/isindex.dat b/libgo/go/html/testdata/webkit/isindex.dat
new file mode 100644
index 00000000000..88325ffe64c
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/isindex.dat
@@ -0,0 +1,40 @@
+#data
+<isindex>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <form>
+| <hr>
+| <label>
+| "This is a searchable index. Enter search keywords: "
+| <input>
+| name="isindex"
+| <hr>
+
+#data
+<isindex name="A" action="B" prompt="C" foo="D">
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <form>
+| action="B"
+| <hr>
+| <label>
+| "C"
+| <input>
+| foo="D"
+| name="isindex"
+| <hr>
+
+#data
+<form><isindex>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <form>
diff --git a/libgo/go/html/testdata/webkit/pending-spec-changes.dat b/libgo/go/html/testdata/webkit/pending-spec-changes.dat
new file mode 100644
index 00000000000..e00ee85d3bf
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/pending-spec-changes.dat
@@ -0,0 +1,28 @@
+#data
+<input type="hidden"><frameset>
+#errors
+21: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
+31: “frameset” start tag seen.
+31: End of file seen and there were open elements.
+#document
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!DOCTYPE html><table><caption><svg>foo</table>bar
+#errors
+47: End tag “table” did not match the name of the current open element (“svg”).
+47: “table” closed but “caption” was still open.
+47: End tag “table” seen, but there were open elements.
+36: Unclosed element “svg”.
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <caption>
+| <svg svg>
+| "foo"
+| "bar"
diff --git a/libgo/go/html/testdata/webkit/plain-text-unsafe.dat b/libgo/go/html/testdata/webkit/plain-text-unsafe.dat
new file mode 100644
index 00000000000..2f40e83babc
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/plain-text-unsafe.dat
@@ -0,0 +1,8 @@
+#data
+FOO&#x000D;ZOO
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "FOO ZOO"
diff --git a/libgo/go/html/testdata/webkit/scripted/adoption01.dat b/libgo/go/html/testdata/webkit/scripted/adoption01.dat
new file mode 100644
index 00000000000..4e08d0e84a0
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/scripted/adoption01.dat
@@ -0,0 +1,15 @@
+#data
+<p><b id="A"><script>document.getElementById("A").id = "B"</script></p>TEXT</b>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <b>
+| id="B"
+| <script>
+| "document.getElementById("A").id = "B""
+| <b>
+| id="A"
+| "TEXT"
diff --git a/libgo/go/html/testdata/webkit/scripted/webkit01.dat b/libgo/go/html/testdata/webkit/scripted/webkit01.dat
new file mode 100644
index 00000000000..ef4a41ca00b
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/scripted/webkit01.dat
@@ -0,0 +1,28 @@
+#data
+1<script>document.write("2")</script>3
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "1"
+| <script>
+| "document.write("2")"
+| "23"
+
+#data
+1<script>document.write("<script>document.write('2')</scr"+ "ipt><script>document.write('3')</scr" + "ipt>")</script>4
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "1"
+| <script>
+| "document.write("<script>document.write('2')</scr"+ "ipt><script>document.write('3')</scr" + "ipt>")"
+| <script>
+| "document.write('2')"
+| "2"
+| <script>
+| "document.write('3')"
+| "34"
diff --git a/libgo/go/html/testdata/webkit/tables01.dat b/libgo/go/html/testdata/webkit/tables01.dat
new file mode 100644
index 00000000000..88ef1fe2ee9
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tables01.dat
@@ -0,0 +1,197 @@
+#data
+<table><th>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <th>
+
+#data
+<table><td>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+
+#data
+<table><col foo='bar'>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <colgroup>
+| <col>
+| foo="bar"
+
+#data
+<table><colgroup></html>foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "foo"
+| <table>
+| <colgroup>
+
+#data
+<table></table><p>foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <p>
+| "foo"
+
+#data
+<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr><td>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+
+#data
+<table><select><option>3</select></table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <select>
+| <option>
+| "3"
+| <table>
+
+#data
+<table><select><table></table></select></table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <select>
+| <table>
+| <table>
+
+#data
+<table><select></table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <select>
+| <table>
+
+#data
+<table><select><option>A<tr><td>B</td></tr></table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <select>
+| <option>
+| "A"
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "B"
+
+#data
+<table><td></body></caption></col></colgroup></html>foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "foo"
+
+#data
+<table><td>A</table>B
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "A"
+| "B"
+
+#data
+<table><tr><caption>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <caption>
+
+#data
+<table><tr></body></caption></col></colgroup></html></td></th><td>foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "foo"
+
+#data
+<table><td><tr>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <tr>
+
+#data
+<table><td><button><td>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <button>
+| <td>
diff --git a/libgo/go/html/testdata/webkit/tests17.dat b/libgo/go/html/testdata/webkit/tests17.dat
new file mode 100644
index 00000000000..7b555f888de
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests17.dat
@@ -0,0 +1,153 @@
+#data
+<!doctype html><table><tbody><select><tr>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><table><tr><select><td>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+
+#data
+<!doctype html><table><tr><td><select><td>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <select>
+| <td>
+
+#data
+<!doctype html><table><tr><th><select><td>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <th>
+| <select>
+| <td>
+
+#data
+<!doctype html><table><caption><select><tr>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <caption>
+| <select>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><select><tr>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><td>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><th>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><tbody>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><thead>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><tfoot>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><select><caption>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><table><tr></table>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| "a"
diff --git a/libgo/go/html/testdata/webkit/tests18.dat b/libgo/go/html/testdata/webkit/tests18.dat
new file mode 100644
index 00000000000..680e1f068a6
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests18.dat
@@ -0,0 +1,269 @@
+#data
+<!doctype html><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <plaintext>
+| "</plaintext>"
+
+#data
+<!doctype html><table><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <plaintext>
+| "</plaintext>"
+| <table>
+
+#data
+<!doctype html><table><tbody><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <plaintext>
+| "</plaintext>"
+| <table>
+| <tbody>
+
+#data
+<!doctype html><table><tbody><tr><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <plaintext>
+| "</plaintext>"
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><table><tbody><tr><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <plaintext>
+| "</plaintext>"
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><table><td><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <plaintext>
+| "</plaintext>"
+
+#data
+<!doctype html><table><caption><plaintext></plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <caption>
+| <plaintext>
+| "</plaintext>"
+
+#data
+<!doctype html><table><tr><style></script></style>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "abc"
+| <table>
+| <tbody>
+| <tr>
+| <style>
+| "</script>"
+
+#data
+<!doctype html><table><tr><script></style></script>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "abc"
+| <table>
+| <tbody>
+| <tr>
+| <script>
+| "</style>"
+
+#data
+<!doctype html><table><caption><style></script></style>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <caption>
+| <style>
+| "</script>"
+| "abc"
+
+#data
+<!doctype html><table><td><style></script></style>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <style>
+| "</script>"
+| "abc"
+
+#data
+<!doctype html><select><script></style></script>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <script>
+| "</style>"
+| "abc"
+
+#data
+<!doctype html><table><select><script></style></script>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <script>
+| "</style>"
+| "abc"
+| <table>
+
+#data
+<!doctype html><table><tr><select><script></style></script>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <script>
+| "</style>"
+| "abc"
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><frameset></frameset><noframes>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <noframes>
+| "abc"
+
+#data
+<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <noframes>
+| "abc"
+| <!-- abc -->
+
+#data
+<!doctype html><frameset></frameset></html><noframes>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <noframes>
+| "abc"
+
+#data
+<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <noframes>
+| "abc"
+| <!-- abc -->
+
+#data
+<!doctype html><table><tr></tbody><tfoot>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <tfoot>
+
+#data
+<!doctype html><table><td><svg></svg>abc<td>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <svg svg>
+| "abc"
+| <td>
diff --git a/libgo/go/html/testdata/webkit/tests19.dat b/libgo/go/html/testdata/webkit/tests19.dat
new file mode 100644
index 00000000000..06222f5b9db
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests19.dat
@@ -0,0 +1,1220 @@
+#data
+<!doctype html><math><mn DefinitionUrl="foo">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math mn>
+| definitionURL="foo"
+
+#data
+<!doctype html><html></p><!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <!-- foo -->
+| <head>
+| <body>
+
+#data
+<!doctype html><head></head></p><!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <!-- foo -->
+| <body>
+
+#data
+<!doctype html><body><p><pre>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <pre>
+
+#data
+<!doctype html><body><p><listing>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <listing>
+
+#data
+<!doctype html><p><plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <plaintext>
+
+#data
+<!doctype html><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <h1>
+
+#data
+<!doctype html><form><isindex>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+
+#data
+<!doctype html><isindex action="POST">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+| action="POST"
+| <hr>
+| <label>
+| "This is a searchable index. Enter search keywords: "
+| <input>
+| name="isindex"
+| <hr>
+
+#data
+<!doctype html><isindex prompt="this is isindex">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+| <hr>
+| <label>
+| "this is isindex"
+| <input>
+| name="isindex"
+| <hr>
+
+#data
+<!doctype html><isindex type="hidden">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+| <hr>
+| <label>
+| "This is a searchable index. Enter search keywords: "
+| <input>
+| name="isindex"
+| type="hidden"
+| <hr>
+
+#data
+<!doctype html><isindex name="foo">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+| <hr>
+| <label>
+| "This is a searchable index. Enter search keywords: "
+| <input>
+| name="isindex"
+| <hr>
+
+#data
+<!doctype html><ruby><p><rp>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <p>
+| <rp>
+
+#data
+<!doctype html><ruby><div><span><rp>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <div>
+| <span>
+| <rp>
+
+#data
+<!doctype html><ruby><div><p><rp>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <div>
+| <p>
+| <rp>
+
+#data
+<!doctype html><ruby><p><rt>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <p>
+| <rt>
+
+#data
+<!doctype html><ruby><div><span><rt>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <div>
+| <span>
+| <rt>
+
+#data
+<!doctype html><ruby><div><p><rt>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <ruby>
+| <div>
+| <p>
+| <rt>
+
+#data
+<!doctype html><math/><foo>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <math math>
+| <foo>
+
+#data
+<!doctype html><svg/><foo>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| <foo>
+
+#data
+<!doctype html><div></body><!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <div>
+| <!-- foo -->
+
+#data
+<!doctype html><h1><div><h3><span></h1>foo
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <h1>
+| <div>
+| <h3>
+| <span>
+| "foo"
+
+#data
+<!doctype html><p></h3>foo
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| "foo"
+
+#data
+<!doctype html><h3><li>abc</h2>foo
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <h3>
+| <li>
+| "abc"
+| "foo"
+
+#data
+<!doctype html><table>abc<!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "abc"
+| <table>
+| <!-- foo -->
+
+#data
+<!doctype html><table> <!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| " "
+| <!-- foo -->
+
+#data
+<!doctype html><table> b <!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| " b "
+| <table>
+| <!-- foo -->
+
+#data
+<!doctype html><select><option><option>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <option>
+| <option>
+
+#data
+<!doctype html><select><option></optgroup>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <option>
+
+#data
+<!doctype html><select><option></optgroup>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+| <option>
+
+#data
+<!doctype html><p><math><mi><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math mi>
+| <p>
+| <h1>
+
+#data
+<!doctype html><p><math><mo><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math mo>
+| <p>
+| <h1>
+
+#data
+<!doctype html><p><math><mn><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math mn>
+| <p>
+| <h1>
+
+#data
+<!doctype html><p><math><ms><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math ms>
+| <p>
+| <h1>
+
+#data
+<!doctype html><p><math><mtext><p><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math mtext>
+| <p>
+| <h1>
+
+#data
+<!doctype html><frameset></noframes>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!doctype html><html c=d><body></html><html a=b>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| a="b"
+| c="d"
+| <head>
+| <body>
+
+#data
+<!doctype html><html c=d><frameset></frameset></html><html a=b>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| a="b"
+| c="d"
+| <head>
+| <frameset>
+
+#data
+<!doctype html><html><frameset></frameset></html><!--foo-->
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <!-- foo -->
+
+#data
+<!doctype html><html><frameset></frameset></html>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| " "
+
+#data
+<!doctype html><html><frameset></frameset></html>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!doctype html><html><frameset></frameset></html><p>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!doctype html><html><frameset></frameset></html></p>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+
+#data
+<html><frameset></frameset></html><!doctype html>
+#errors
+#document
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!doctype html><body><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+
+#data
+<!doctype html><p><frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<!doctype html><p>a<frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| "a"
+
+#data
+<!doctype html><p> <frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<!doctype html><pre><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <pre>
+
+#data
+<!doctype html><listing><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <listing>
+
+#data
+<!doctype html><li><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <li>
+
+#data
+<!doctype html><dd><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <dd>
+
+#data
+<!doctype html><dt><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <dt>
+
+#data
+<!doctype html><button><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <button>
+
+#data
+<!doctype html><applet><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <applet>
+
+#data
+<!doctype html><marquee><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <marquee>
+
+#data
+<!doctype html><object><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <object>
+
+#data
+<!doctype html><table><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+
+#data
+<!doctype html><area><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <area>
+
+#data
+<!doctype html><basefont><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <basefont>
+| <frameset>
+
+#data
+<!doctype html><bgsound><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <bgsound>
+| <frameset>
+
+#data
+<!doctype html><br><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <br>
+
+#data
+<!doctype html><embed><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <embed>
+
+#data
+<!doctype html><img><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <img>
+
+#data
+<!doctype html><input><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <input>
+
+#data
+<!doctype html><keygen><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <keygen>
+
+#data
+<!doctype html><wbr><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <wbr>
+
+#data
+<!doctype html><hr><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <hr>
+
+#data
+<!doctype html><textarea></textarea><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <textarea>
+
+#data
+<!doctype html><xmp></xmp><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <xmp>
+
+#data
+<!doctype html><iframe></iframe><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <iframe>
+
+#data
+<!doctype html><select></select><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <select>
+
+#data
+<!doctype html><svg></svg><frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<!doctype html><math></math><frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<!doctype html><svg><foreignObject><div> <frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<!doctype html><svg>a</svg><frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "a"
+
+#data
+<!doctype html><svg> </svg><frameset><frame>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+| <frame>
+
+#data
+<html>aaa<frameset></frameset>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "aaa"
+
+#data
+<html> a <frameset></frameset>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "a "
+
+#data
+<!doctype html><div><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <frameset>
+
+#data
+<!doctype html><div><body><frameset>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <div>
+
+#data
+<!doctype html><p><math></p>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| "a"
+
+#data
+<!doctype html><p><math><mn><span></p>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <math math>
+| <math mn>
+| <span>
+| <p>
+| "a"
+
+#data
+<!doctype html><math></html>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <math math>
+
+#data
+<!doctype html><meta charset="ascii">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <meta>
+| charset="ascii"
+| <body>
+
+#data
+<!doctype html><meta http-equiv="content-type" content="text/html;charset=ascii">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <meta>
+| content="text/html;charset=ascii"
+| http-equiv="content-type"
+| <body>
+
+#data
+<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset="utf8">
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -->
+| <meta>
+| charset="utf8"
+| <body>
+
+#data
+<!doctype html><html a=b><head></head><html c=d>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| a="b"
+| c="d"
+| <head>
+| <body>
+
+#data
+<!doctype html><image/>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <img>
+
+#data
+<!doctype html>a<i>b<table>c<b>d</i>e</b>f
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "a"
+| <i>
+| "bc"
+| <b>
+| "de"
+| "f"
+| <table>
+
+#data
+<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <i>
+| "a"
+| <b>
+| "b"
+| <b>
+| <div>
+| <b>
+| <i>
+| "c"
+| <a>
+| "d"
+| <a>
+| "e"
+| <a>
+| "f"
+| <table>
+
+#data
+<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <i>
+| "a"
+| <b>
+| "b"
+| <b>
+| <div>
+| <b>
+| <i>
+| "c"
+| <a>
+| "d"
+| <a>
+| "e"
+| <a>
+| "f"
+
+#data
+<!doctype html><table><i>a<b>b<div>c</i>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <i>
+| "a"
+| <b>
+| "b"
+| <b>
+| <div>
+| <i>
+| "c"
+| <table>
+
+#data
+<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <i>
+| "a"
+| <b>
+| "b"
+| <b>
+| <div>
+| <b>
+| <i>
+| "c"
+| <a>
+| "d"
+| <a>
+| "e"
+| <a>
+| "f"
+| <table>
+
+#data
+<!doctype html><table><i>a<div>b<tr>c<b>d</i>e
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <i>
+| "a"
+| <div>
+| "b"
+| <i>
+| "c"
+| <b>
+| "d"
+| <b>
+| "e"
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<!doctype html><table><td><table><i>a<div>b<b>c</i>d
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <i>
+| "a"
+| <div>
+| <i>
+| "b"
+| <b>
+| "c"
+| <b>
+| "d"
+| <table>
+
+#data
+<!doctype html><body><bgsound>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <bgsound>
+
+#data
+<!doctype html><body><basefont>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <basefont>
+
+#data
+<!doctype html><a><b></a><basefont>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <basefont>
+
+#data
+<!doctype html><a><b></a><bgsound>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <bgsound>
+
+#data
+<!doctype html><figcaption><article></figcaption>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <figcaption>
+| <article>
+| "a"
+
+#data
+<!doctype html><summary><article></summary>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <summary>
+| <article>
+| "a"
+
+#data
+<!doctype html><p><a><plaintext>b
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <a>
+| <plaintext>
+| <a>
+| "b"
diff --git a/libgo/go/html/testdata/webkit/tests20.dat b/libgo/go/html/testdata/webkit/tests20.dat
new file mode 100644
index 00000000000..6bd825608f1
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests20.dat
@@ -0,0 +1,455 @@
+#data
+<!doctype html><p><button><button>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <button>
+
+#data
+<!doctype html><p><button><address>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <address>
+
+#data
+<!doctype html><p><button><blockquote>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <blockquote>
+
+#data
+<!doctype html><p><button><menu>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <menu>
+
+#data
+<!doctype html><p><button><p>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <p>
+
+#data
+<!doctype html><p><button><ul>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <ul>
+
+#data
+<!doctype html><p><button><h1>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <h1>
+
+#data
+<!doctype html><p><button><h6>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <h6>
+
+#data
+<!doctype html><p><button><listing>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <listing>
+
+#data
+<!doctype html><p><button><pre>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <pre>
+
+#data
+<!doctype html><p><button><form>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <form>
+
+#data
+<!doctype html><p><button><li>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <li>
+
+#data
+<!doctype html><p><button><dd>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <dd>
+
+#data
+<!doctype html><p><button><dt>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <dt>
+
+#data
+<!doctype html><p><button><plaintext>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <plaintext>
+
+#data
+<!doctype html><p><button><table>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <table>
+
+#data
+<!doctype html><p><button><hr>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <hr>
+
+#data
+<!doctype html><p><button><xmp>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <xmp>
+
+#data
+<!doctype html><p><button></p>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <button>
+| <p>
+
+#data
+<!doctype html><address><button></address>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <address>
+| <button>
+| "a"
+
+#data
+<!doctype html><address><button></address>a
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <address>
+| <button>
+| "a"
+
+#data
+<p><table></p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <p>
+| <table>
+
+#data
+<!doctype html><svg>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <svg svg>
+
+#data
+<!doctype html><p><figcaption>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <figcaption>
+
+#data
+<!doctype html><p><summary>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <p>
+| <summary>
+
+#data
+<!doctype html><form><table><form>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <form>
+| <table>
+
+#data
+<!doctype html><table><form><form>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <form>
+
+#data
+<!doctype html><table><form></table><form>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <table>
+| <form>
+
+#data
+<!doctype html><svg><foreignObject><p>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| <svg foreignObject>
+| <p>
+
+#data
+<!doctype html><svg><title>abc
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| <svg title>
+| "abc"
+
+#data
+<option><span><option>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <option>
+| <span>
+| <option>
+
+#data
+<option><option>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <option>
+| <option>
+
+#data
+<math><annotation-xml><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| <div>
+
+#data
+<math><annotation-xml encoding="application/svg+xml"><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding="application/svg+xml"
+| <div>
+
+#data
+<math><annotation-xml encoding="application/xhtml+xml"><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding="application/xhtml+xml"
+| <div>
+
+#data
+<math><annotation-xml encoding="aPPlication/xhtmL+xMl"><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding="aPPlication/xhtmL+xMl"
+| <div>
+
+#data
+<math><annotation-xml encoding="text/html"><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding="text/html"
+| <div>
+
+#data
+<math><annotation-xml encoding="Text/htmL"><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding="Text/htmL"
+| <div>
+
+#data
+<math><annotation-xml encoding=" text/html "><div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| <math annotation-xml>
+| encoding=" text/html "
+| <div>
diff --git a/libgo/go/html/testdata/webkit/tests21.dat b/libgo/go/html/testdata/webkit/tests21.dat
new file mode 100644
index 00000000000..1260ec03e20
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests21.dat
@@ -0,0 +1,221 @@
+#data
+<svg><![CDATA[foo]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "foo"
+
+#data
+<math><![CDATA[foo]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <math math>
+| "foo"
+
+#data
+<div><![CDATA[foo]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+| <!-- [CDATA[foo]] -->
+
+#data
+<svg><![CDATA[foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "foo"
+
+#data
+<svg><![CDATA[foo
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "foo"
+
+#data
+<svg><![CDATA[
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+
+#data
+<svg><![CDATA[]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+
+#data
+<svg><![CDATA[]] >]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "]] >"
+
+#data
+<svg><![CDATA[]] >]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "]] >"
+
+#data
+<svg><![CDATA[]]
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "]]"
+
+#data
+<svg><![CDATA[]
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "]"
+
+#data
+<svg><![CDATA[]>a
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "]>a"
+
+#data
+<svg><foreignObject><div><![CDATA[foo]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| <svg foreignObject>
+| <div>
+| <!-- [CDATA[foo]] -->
+
+#data
+<svg><![CDATA[<svg>]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>"
+
+#data
+<svg><![CDATA[</svg>a]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "</svg>a"
+
+#data
+<svg><![CDATA[<svg>a
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>a"
+
+#data
+<svg><![CDATA[</svg>a
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "</svg>a"
+
+#data
+<svg><![CDATA[<svg>]]><path>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>"
+| <svg path>
+
+#data
+<svg><![CDATA[<svg>]]></path>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>"
+
+#data
+<svg><![CDATA[<svg>]]><!--path-->
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>"
+| <!-- path -->
+
+#data
+<svg><![CDATA[<svg>]]>path
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<svg>path"
+
+#data
+<svg><![CDATA[<!--svg-->]]>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <svg svg>
+| "<!--svg-->"
diff --git a/libgo/go/html/testdata/webkit/tests22.dat b/libgo/go/html/testdata/webkit/tests22.dat
new file mode 100644
index 00000000000..aab27b2e904
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests22.dat
@@ -0,0 +1,157 @@
+#data
+<a><b><big><em><strong><div>X</a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <big>
+| <em>
+| <strong>
+| <big>
+| <em>
+| <strong>
+| <div>
+| <a>
+| "X"
+
+#data
+<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8>A</a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <b>
+| <div>
+| id="1"
+| <a>
+| <div>
+| id="2"
+| <a>
+| <div>
+| id="3"
+| <a>
+| <div>
+| id="4"
+| <a>
+| <div>
+| id="5"
+| <a>
+| <div>
+| id="6"
+| <a>
+| <div>
+| id="7"
+| <a>
+| <div>
+| id="8"
+| <a>
+| "A"
+
+#data
+<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9>A</a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <b>
+| <div>
+| id="1"
+| <a>
+| <div>
+| id="2"
+| <a>
+| <div>
+| id="3"
+| <a>
+| <div>
+| id="4"
+| <a>
+| <div>
+| id="5"
+| <a>
+| <div>
+| id="6"
+| <a>
+| <div>
+| id="7"
+| <a>
+| <div>
+| id="8"
+| <a>
+| <div>
+| id="9"
+| "A"
+
+#data
+<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9><div id=10>A</a>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <a>
+| <b>
+| <b>
+| <div>
+| id="1"
+| <a>
+| <div>
+| id="2"
+| <a>
+| <div>
+| id="3"
+| <a>
+| <div>
+| id="4"
+| <a>
+| <div>
+| id="5"
+| <a>
+| <div>
+| id="6"
+| <a>
+| <div>
+| id="7"
+| <a>
+| <div>
+| id="8"
+| <a>
+| <div>
+| id="9"
+| <div>
+| id="10"
+| "A"
+
+#data
+<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST
+#errors
+Line: 1 Col: 6 Unexpected start tag (cite). Expected DOCTYPE.
+Line: 1 Col: 46 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
+Line: 1 Col: 50 Expected closing tag. Unexpected end of file.
+#document
+| <html>
+| <head>
+| <body>
+| <cite>
+| <b>
+| <cite>
+| <i>
+| <cite>
+| <i>
+| <cite>
+| <i>
+| <i>
+| <i>
+| <div>
+| <b>
+| "X"
+| "TEST"
diff --git a/libgo/go/html/testdata/webkit/tests23.dat b/libgo/go/html/testdata/webkit/tests23.dat
new file mode 100644
index 00000000000..34d2a73f1c7
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests23.dat
@@ -0,0 +1,155 @@
+#data
+<p><font size=4><font color=red><font size=4><font size=4><font size=4><font size=4><font size=4><font color=red><p>X
+#errors
+3: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
+116: Unclosed elements.
+117: End of file seen and there were open elements.
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <font>
+| size="4"
+| <font>
+| color="red"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| color="red"
+| <p>
+| <font>
+| color="red"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| color="red"
+| "X"
+
+#data
+<p><font size=4><font size=4><font size=4><font size=4><p>X
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <p>
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| "X"
+
+#data
+<p><font size=4><font size=4><font size=4><font size="5"><font size=4><p>X
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="5"
+| <font>
+| size="4"
+| <p>
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="5"
+| <font>
+| size="4"
+| "X"
+
+#data
+<p><font size=4 id=a><font size=4 id=b><font size=4><font size=4><p>X
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <font>
+| id="a"
+| size="4"
+| <font>
+| id="b"
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| <p>
+| <font>
+| id="a"
+| size="4"
+| <font>
+| id="b"
+| size="4"
+| <font>
+| size="4"
+| <font>
+| size="4"
+| "X"
+
+#data
+<p><b id=a><b id=a><b id=a><b><object><b id=a><b id=a>X</object><p>Y
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <b>
+| id="a"
+| <b>
+| id="a"
+| <b>
+| id="a"
+| <b>
+| <object>
+| <b>
+| id="a"
+| <b>
+| id="a"
+| "X"
+| <p>
+| <b>
+| id="a"
+| <b>
+| id="a"
+| <b>
+| id="a"
+| <b>
+| "Y"
diff --git a/libgo/go/html/testdata/webkit/tests24.dat b/libgo/go/html/testdata/webkit/tests24.dat
new file mode 100644
index 00000000000..f6dc7eb48a5
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests24.dat
@@ -0,0 +1,79 @@
+#data
+<!DOCTYPE html>&NotEqualTilde;
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "≂̸"
+
+#data
+<!DOCTYPE html>&NotEqualTilde;A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "≂̸A"
+
+#data
+<!DOCTYPE html>&ThickSpace;
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "  "
+
+#data
+<!DOCTYPE html>&ThickSpace;A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "  A"
+
+#data
+<!DOCTYPE html>&NotSubset;
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "⊂⃒"
+
+#data
+<!DOCTYPE html>&NotSubset;A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "⊂⃒A"
+
+#data
+<!DOCTYPE html>&Gopf;
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "𝔾"
+
+#data
+<!DOCTYPE html>&Gopf;A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "𝔾A"
diff --git a/libgo/go/html/testdata/webkit/tests25.dat b/libgo/go/html/testdata/webkit/tests25.dat
new file mode 100644
index 00000000000..00de7295b71
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests25.dat
@@ -0,0 +1,219 @@
+#data
+<!DOCTYPE html><body><foo>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <foo>
+| "A"
+
+#data
+<!DOCTYPE html><body><area>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <area>
+| "A"
+
+#data
+<!DOCTYPE html><body><base>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <base>
+| "A"
+
+#data
+<!DOCTYPE html><body><basefont>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <basefont>
+| "A"
+
+#data
+<!DOCTYPE html><body><bgsound>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <bgsound>
+| "A"
+
+#data
+<!DOCTYPE html><body><br>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <br>
+| "A"
+
+#data
+<!DOCTYPE html><body><col>A
+#errors
+26: Stray start tag “col”.
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "A"
+
+#data
+<!DOCTYPE html><body><command>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <command>
+| "A"
+
+#data
+<!DOCTYPE html><body><embed>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <embed>
+| "A"
+
+#data
+<!DOCTYPE html><body><frame>A
+#errors
+26: Stray start tag “frame”.
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| "A"
+
+#data
+<!DOCTYPE html><body><hr>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <hr>
+| "A"
+
+#data
+<!DOCTYPE html><body><img>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <img>
+| "A"
+
+#data
+<!DOCTYPE html><body><input>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <input>
+| "A"
+
+#data
+<!DOCTYPE html><body><keygen>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <keygen>
+| "A"
+
+#data
+<!DOCTYPE html><body><link>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <link>
+| "A"
+
+#data
+<!DOCTYPE html><body><meta>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <meta>
+| "A"
+
+#data
+<!DOCTYPE html><body><param>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <param>
+| "A"
+
+#data
+<!DOCTYPE html><body><source>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <source>
+| "A"
+
+#data
+<!DOCTYPE html><body><track>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <track>
+| "A"
+
+#data
+<!DOCTYPE html><body><wbr>A
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <wbr>
+| "A"
diff --git a/libgo/go/html/testdata/webkit/tests26.dat b/libgo/go/html/testdata/webkit/tests26.dat
new file mode 100644
index 00000000000..da128e7794b
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests26.dat
@@ -0,0 +1,195 @@
+#data
+<!DOCTYPE html><body><a href='#1'><nobr>1<nobr></a><br><a href='#2'><nobr>2<nobr></a><br><a href='#3'><nobr>3<nobr></a>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <a>
+| href="#1"
+| <nobr>
+| "1"
+| <nobr>
+| <nobr>
+| <br>
+| <a>
+| href="#2"
+| <a>
+| href="#2"
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| <br>
+| <a>
+| href="#3"
+| <a>
+| href="#3"
+| <nobr>
+| "3"
+| <nobr>
+
+#data
+<!DOCTYPE html><body><b><nobr>1<nobr></b><i><nobr>2<nobr></i>3
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <nobr>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| "3"
+
+#data
+<!DOCTYPE html><body><b><nobr>1<table><nobr></b><i><nobr>2<nobr></i>3
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| "3"
+| <table>
+
+#data
+<!DOCTYPE html><body><b><nobr>1<table><tr><td><nobr></b><i><nobr>2<nobr></i>3
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| "3"
+
+#data
+<!DOCTYPE html><body><b><nobr>1<div><nobr></b><i><nobr>2<nobr></i>3
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <div>
+| <b>
+| <nobr>
+| <nobr>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| "3"
+
+#data
+<!DOCTYPE html><body><b><nobr>1<nobr></b><div><i><nobr>2<nobr></i>3
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <nobr>
+| <div>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
+| <nobr>
+| <nobr>
+| "3"
+
+#data
+<!DOCTYPE html><body><b><nobr>1<nobr><ins></b><i><nobr>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <nobr>
+| <ins>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+
+#data
+<!DOCTYPE html><body><b><nobr>1<ins><nobr></b><i>2
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| <nobr>
+| "1"
+| <ins>
+| <nobr>
+| <nobr>
+| <i>
+| "2"
+
+#data
+<!DOCTYPE html><body><b>1<nobr></b><i><nobr>2</i>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+| <head>
+| <body>
+| <b>
+| "1"
+| <nobr>
+| <nobr>
+| <i>
+| <i>
+| <nobr>
+| "2"
diff --git a/libgo/go/html/testdata/webkit/tests_innerHTML_1.dat b/libgo/go/html/testdata/webkit/tests_innerHTML_1.dat
new file mode 100644
index 00000000000..052fac7d554
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tests_innerHTML_1.dat
@@ -0,0 +1,733 @@
+#data
+<body><span>
+#errors
+#document-fragment
+body
+#document
+| <span>
+
+#data
+<span><body>
+#errors
+#document-fragment
+body
+#document
+| <span>
+
+#data
+<span><body>
+#errors
+#document-fragment
+div
+#document
+| <span>
+
+#data
+<body><span>
+#errors
+#document-fragment
+html
+#document
+| <head>
+| <body>
+| <span>
+
+#data
+<frameset><span>
+#errors
+#document-fragment
+body
+#document
+| <span>
+
+#data
+<span><frameset>
+#errors
+#document-fragment
+body
+#document
+| <span>
+
+#data
+<span><frameset>
+#errors
+#document-fragment
+div
+#document
+| <span>
+
+#data
+<frameset><span>
+#errors
+#document-fragment
+html
+#document
+| <head>
+| <frameset>
+
+#data
+<table><tr>
+#errors
+#document-fragment
+table
+#document
+| <tbody>
+| <tr>
+
+#data
+</table><tr>
+#errors
+#document-fragment
+table
+#document
+| <tbody>
+| <tr>
+
+#data
+<a>
+#errors
+#document-fragment
+table
+#document
+| <a>
+
+#data
+<a>
+#errors
+#document-fragment
+table
+#document
+| <a>
+
+#data
+<a><caption>a
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <caption>
+| "a"
+
+#data
+<a><colgroup><col>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <colgroup>
+| <col>
+
+#data
+<a><tbody><tr>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <tbody>
+| <tr>
+
+#data
+<a><tfoot><tr>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <tfoot>
+| <tr>
+
+#data
+<a><thead><tr>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <thead>
+| <tr>
+
+#data
+<a><tr>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <tbody>
+| <tr>
+
+#data
+<a><th>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <tbody>
+| <tr>
+| <th>
+
+#data
+<a><td>
+#errors
+#document-fragment
+table
+#document
+| <a>
+| <tbody>
+| <tr>
+| <td>
+
+#data
+<table></table><tbody>
+#errors
+#document-fragment
+caption
+#document
+| <table>
+
+#data
+</table><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+
+#data
+<span></table>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+
+#data
+</caption><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+
+#data
+<span></caption><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><caption><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><col><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><colgroup><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><html><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><tbody><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><td><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><tfoot><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><thead><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><th><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span><tr><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+<span></table><span>
+#errors
+#document-fragment
+caption
+#document
+| <span>
+| <span>
+
+#data
+</colgroup><col>
+#errors
+#document-fragment
+colgroup
+#document
+| <col>
+
+#data
+<a><col>
+#errors
+#document-fragment
+colgroup
+#document
+| <col>
+
+#data
+<caption><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<col><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<colgroup><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<tbody><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<tfoot><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<thead><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+</table><a>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+
+#data
+<a><tr>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+| <tr>
+
+#data
+<a><td>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+| <tr>
+| <td>
+
+#data
+<a><td>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+| <tr>
+| <td>
+
+#data
+<a><td>
+#errors
+#document-fragment
+tbody
+#document
+| <a>
+| <tr>
+| <td>
+
+#data
+<td><table><tbody><a><tr>
+#errors
+#document-fragment
+tbody
+#document
+| <tr>
+| <td>
+| <a>
+| <table>
+| <tbody>
+| <tr>
+
+#data
+</tr><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<td><table><a><tr></tr><tr>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+| <a>
+| <table>
+| <tbody>
+| <tr>
+| <tr>
+
+#data
+<caption><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<col><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<colgroup><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<tbody><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<tfoot><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<thead><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<tr><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+</table><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+
+#data
+<td><table></table><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+| <table>
+| <td>
+
+#data
+<td><table></table><td>
+#errors
+#document-fragment
+tr
+#document
+| <td>
+| <table>
+| <td>
+
+#data
+<caption><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<col><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<colgroup><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<tbody><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<tfoot><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<th><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<thead><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<tr><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</table><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</tbody><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</td><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</tfoot><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</thead><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</th><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+</tr><a>
+#errors
+#document-fragment
+td
+#document
+| <a>
+
+#data
+<table><td><td>
+#errors
+#document-fragment
+td
+#document
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| <td>
+
+#data
+</select><option>
+#errors
+#document-fragment
+select
+#document
+| <option>
+
+#data
+<input><option>
+#errors
+#document-fragment
+select
+#document
+| <option>
+
+#data
+<keygen><option>
+#errors
+#document-fragment
+select
+#document
+| <option>
+
+#data
+<textarea><option>
+#errors
+#document-fragment
+select
+#document
+| <option>
+
+#data
+</html><!--abc-->
+#errors
+#document-fragment
+html
+#document
+| <head>
+| <body>
+| <!-- abc -->
+
+#data
+</frameset><frame>
+#errors
+#document-fragment
+frameset
+#document
+| <frame>
diff --git a/libgo/go/html/testdata/webkit/tricky01.dat b/libgo/go/html/testdata/webkit/tricky01.dat
new file mode 100644
index 00000000000..08419924486
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/tricky01.dat
@@ -0,0 +1,261 @@
+#data
+<b><p>Bold </b> Not bold</p>
+Also not bold.
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <b>
+| <p>
+| <b>
+| "Bold "
+| " Not bold"
+| "
+Also not bold."
+
+#data
+<html>
+<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain
+<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>
+<p>Italic and red. </i> Red.</font> I should not be red.</p>
+<b>Bold <i>Bold and italic</b> Only Italic </i> Plain
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <font>
+| color="red"
+| <i>
+| "Italic and Red"
+| <i>
+| <p>
+| <font>
+| color="red"
+| "Italic and Red "
+| " Just italic."
+| " Italic only."
+| " Plain
+"
+| <p>
+| "I should not be red. "
+| <font>
+| color="red"
+| "Red. "
+| <i>
+| "Italic and red."
+| <font>
+| color="red"
+| <i>
+| "
+"
+| <p>
+| <font>
+| color="red"
+| <i>
+| "Italic and red. "
+| " Red."
+| " I should not be red."
+| "
+"
+| <b>
+| "Bold "
+| <i>
+| "Bold and italic"
+| <i>
+| " Only Italic "
+| " Plain"
+
+#data
+<html><body>
+<p><font size="7">First paragraph.</p>
+<p>Second paragraph.</p></font>
+<b><p><i>Bold and Italic</b> Italic</p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "
+"
+| <p>
+| <font>
+| size="7"
+| "First paragraph."
+| <font>
+| size="7"
+| "
+"
+| <p>
+| "Second paragraph."
+| "
+"
+| <b>
+| <p>
+| <b>
+| <i>
+| "Bold and Italic"
+| <i>
+| " Italic"
+
+#data
+<html>
+<dl>
+<dt><b>Boo
+<dd>Goo?
+</dl>
+</html>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <dl>
+| "
+"
+| <dt>
+| <b>
+| "Boo
+"
+| <dd>
+| <b>
+| "Goo?
+"
+| <b>
+| "
+"
+
+#data
+<html><body>
+<label><a><div>Hello<div>World</div></a></label>
+</body></html>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "
+"
+| <label>
+| <a>
+| <div>
+| <a>
+| "Hello"
+| <div>
+| "World"
+| "
+"
+
+#data
+<table><center> <font>a</center> <img> <tr><td> </td> </tr> </table>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <center>
+| " "
+| <font>
+| "a"
+| <font>
+| <img>
+| " "
+| <table>
+| " "
+| <tbody>
+| <tr>
+| <td>
+| " "
+| " "
+| " "
+
+#data
+<table><tr><p><a><p>You should see this text.
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| <a>
+| <p>
+| <a>
+| "You should see this text."
+| <table>
+| <tbody>
+| <tr>
+
+#data
+<TABLE>
+<TR>
+<CENTER><CENTER><TD></TD></TR><TR>
+<FONT>
+<TABLE><tr></tr></TABLE>
+</P>
+<a></font><font></a>
+This page contains an insanely badly-nested tag sequence.
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <center>
+| <center>
+| <font>
+| "
+"
+| <table>
+| "
+"
+| <tbody>
+| <tr>
+| "
+"
+| <td>
+| <tr>
+| "
+"
+| <table>
+| <tbody>
+| <tr>
+| <font>
+| "
+"
+| <p>
+| "
+"
+| <a>
+| <a>
+| <font>
+| <font>
+| "
+This page contains an insanely badly-nested tag sequence."
+
+#data
+<html>
+<body>
+<b><nobr><div>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the
+nobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>
+</body>
+</html>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "
+"
+| <b>
+| <nobr>
+| <div>
+| <b>
+| <nobr>
+| "This text is in a div inside a nobr"
+| "More text that should not be in the nobr, i.e., the
+nobr should have closed the div inside it implicitly. "
+| <pre>
+| "A pre tag outside everything else."
+| "
+
+"
diff --git a/libgo/go/html/testdata/webkit/webkit02.dat b/libgo/go/html/testdata/webkit/webkit02.dat
new file mode 100644
index 00000000000..2218f4298c5
--- /dev/null
+++ b/libgo/go/html/testdata/webkit/webkit02.dat
@@ -0,0 +1,104 @@
+#data
+<foo bar=qux/>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <foo>
+| bar="qux/"
+
+#data
+<p id="status"><noscript><strong>A</strong></noscript><span>B</span></p>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <p>
+| id="status"
+| <noscript>
+| "<strong>A</strong>"
+| <span>
+| "B"
+
+#data
+<div><sarcasm><div></div></sarcasm></div>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <div>
+| <sarcasm>
+| <div>
+
+#data
+<html><body><img src="" border="0" alt="><div>A</div></body></html>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+
+#data
+<table><td></tbody>A
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| "A"
+| <table>
+| <tbody>
+| <tr>
+| <td>
+
+#data
+<table><td></thead>A
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "A"
+
+#data
+<table><td></tfoot>A
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <tbody>
+| <tr>
+| <td>
+| "A"
+
+#data
+<table><thead><td></tbody>A
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <table>
+| <thead>
+| <tr>
+| <td>
+| "A"
+
+#data
+<legend>test</legend>
+#errors
+#document
+| <html>
+| <head>
+| <body>
+| <legend>
+| "test"
diff --git a/libgo/go/http/cgi/host_test.go b/libgo/go/http/cgi/host_test.go
index 1dc3abdbb32..ff46631383b 100644
--- a/libgo/go/http/cgi/host_test.go
+++ b/libgo/go/http/cgi/host_test.go
@@ -374,6 +374,8 @@ func TestCopyError(t *testing.T) {
}
}
+/* This test doesn't work in gccgo's testing environment.
+
func TestDirUnix(t *testing.T) {
if skipTest(t) || runtime.GOOS == "windows" {
return
@@ -402,6 +404,8 @@ func TestDirUnix(t *testing.T) {
runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
}
+*/
+
func TestDirWindows(t *testing.T) {
if skipTest(t) || runtime.GOOS != "windows" {
return
diff --git a/libgo/go/http/cgi/testdata/test.cgi b/libgo/go/http/cgi/testdata/test.cgi
new file mode 100755
index 00000000000..b46b1330f38
--- /dev/null
+++ b/libgo/go/http/cgi/testdata/test.cgi
@@ -0,0 +1,96 @@
+#!/usr/bin/perl
+# Copyright 2011 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+#
+# Test script run as a child process under cgi_test.go
+
+use strict;
+use Cwd;
+
+my $q = MiniCGI->new;
+my $params = $q->Vars;
+
+if ($params->{"loc"}) {
+ print "Location: $params->{loc}\r\n\r\n";
+ exit(0);
+}
+
+my $NL = "\r\n";
+$NL = "\n" if $params->{mode} eq "NL";
+
+my $p = sub {
+ print "$_[0]$NL";
+};
+
+# With carriage returns
+$p->("Content-Type: text/html");
+$p->("X-CGI-Pid: $$");
+$p->("X-Test-Header: X-Test-Value");
+$p->("");
+
+if ($params->{"bigresponse"}) {
+ for (1..1024) {
+ print "A" x 1024, "\n";
+ }
+ exit 0;
+}
+
+print "test=Hello CGI\n";
+
+foreach my $k (sort keys %$params) {
+ print "param-$k=$params->{$k}\n";
+}
+
+foreach my $k (sort keys %ENV) {
+ my $clean_env = $ENV{$k};
+ $clean_env =~ s/[\n\r]//g;
+ print "env-$k=$clean_env\n";
+}
+
+# NOTE: don't call getcwd() for windows.
+# msys return /c/go/src/... not C:\go\...
+my $dir;
+if ($^O eq 'MSWin32' || $^O eq 'msys') {
+ my $cmd = $ENV{'COMSPEC'} || 'c:\\windows\\system32\\cmd.exe';
+ $cmd =~ s!\\!/!g;
+ $dir = `$cmd /c cd`;
+ chomp $dir;
+} else {
+ $dir = getcwd();
+}
+print "cwd=$dir\n";
+
+
+# A minimal version of CGI.pm, for people without the perl-modules
+# package installed. (CGI.pm used to be part of the Perl core, but
+# some distros now bundle perl-base and perl-modules separately...)
+package MiniCGI;
+
+sub new {
+ my $class = shift;
+ return bless {}, $class;
+}
+
+sub Vars {
+ my $self = shift;
+ my $pairs;
+ if ($ENV{CONTENT_LENGTH}) {
+ $pairs = do { local $/; <STDIN> };
+ } else {
+ $pairs = $ENV{QUERY_STRING};
+ }
+ my $vars = {};
+ foreach my $kv (split(/&/, $pairs)) {
+ my ($k, $v) = split(/=/, $kv, 2);
+ $vars->{_urldecode($k)} = _urldecode($v);
+ }
+ return $vars;
+}
+
+sub _urldecode {
+ my $v = shift;
+ $v =~ tr/+/ /;
+ $v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
+ return $v;
+}
diff --git a/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.png b/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.png
new file mode 100644
index 00000000000..b0fc0c1be74
--- /dev/null
+++ b/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.png
Binary files differ
diff --git a/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.sng b/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.sng
new file mode 100644
index 00000000000..78dc367bba3
--- /dev/null
+++ b/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.sng
@@ -0,0 +1,301 @@
+#SNG: from basn3p08-trns.png
+IHDR {
+ width: 32; height: 32; bitdepth: 8;
+ using color palette;
+}
+gAMA {1.0000}
+PLTE {
+ (255, 3, 7) # rgb = (0xff,0x03,0x07)
+ (255, 4, 7) # rgb = (0xff,0x04,0x07)
+ (255, 9, 7) # rgb = (0xff,0x09,0x07)
+ (217, 14, 7) # rgb = (0xd9,0x0e,0x07)
+ (255, 14, 7) # rgb = (0xff,0x0e,0x07)
+ ( 2, 22, 19) # rgb = (0x02,0x16,0x13)
+ (255, 26, 7) # rgb = (0xff,0x1a,0x07)
+ (255, 31, 7) # rgb = (0xff,0x1f,0x07)
+ ( 10, 37, 14) # rgb = (0x0a,0x25,0x0e)
+ (179, 37, 6) # rgb = (0xb3,0x25,0x06)
+ (254, 42, 7) # rgb = (0xfe,0x2a,0x07)
+ (255, 45, 7) # rgb = (0xff,0x2d,0x07)
+ ( 25, 46, 9) # rgb = (0x19,0x2e,0x09)
+ ( 0, 48,254) # rgb = (0x00,0x30,0xfe)
+ ( 0, 48,255) # rgb = (0x00,0x30,0xff)
+ ( 0, 49,255) # rgb = (0x00,0x31,0xff)
+ ( 0, 51,254) # rgb = (0x00,0x33,0xfe)
+ ( 0, 52,255) # rgb = (0x00,0x34,0xff)
+ (255, 53, 7) # rgb = (0xff,0x35,0x07)
+ ( 0, 54,252) # rgb = (0x00,0x36,0xfc)
+ (254, 57, 7) # rgb = (0xfe,0x39,0x07)
+ (251, 57, 7) # rgb = (0xfb,0x39,0x07)
+ (247, 59, 7) # rgb = (0xf7,0x3b,0x07)
+ ( 0, 59, 61) # rgb = (0x00,0x3b,0x3d)
+ ( 0, 62,255) # rgb = (0x00,0x3e,0xff)
+ (142, 63, 5) # rgb = (0x8e,0x3f,0x05)
+ ( 0, 63,250) # rgb = (0x00,0x3f,0xfa)
+ (255, 63, 7) # rgb = (0xff,0x3f,0x07)
+ (253, 68, 7) # rgb = (0xfd,0x44,0x07)
+ ( 0, 73,255) # rgb = (0x00,0x49,0xff)
+ ( 0, 73,246) # rgb = (0x00,0x49,0xf6)
+ (255, 75, 7) # rgb = (0xff,0x4b,0x07)
+ ( 82, 85, 9) # rgb = (0x52,0x55,0x09)
+ (255, 85, 7) # rgb = (0xff,0x55,0x07)
+ ( 0, 89,255) # rgb = (0x00,0x59,0xff)
+ ( 0, 91,237) # rgb = (0x00,0x5b,0xed)
+ (255, 94, 7) # rgb = (0xff,0x5e,0x07)
+ (241,100, 7) # rgb = (0xf1,0x64,0x07)
+ ( 0,101,255) # rgb = (0x00,0x65,0xff)
+ (253,105, 7) # rgb = (0xfd,0x69,0x07)
+ ( 0,107,223) # rgb = (0x00,0x6b,0xdf)
+ (255,106, 7) # rgb = (0xff,0x6a,0x07)
+ ( 1,110, 95) # rgb = (0x01,0x6e,0x5f)
+ (255,115, 7) # rgb = (0xff,0x73,0x07)
+ ( 0,117,255) # rgb = (0x00,0x75,0xff)
+ (255,124, 7) # rgb = (0xff,0x7c,0x07)
+ (118,126, 10) # rgb = (0x76,0x7e,0x0a)
+ ( 0,130,250) # rgb = (0x00,0x82,0xfa)
+ ( 0,132,255) # rgb = (0x00,0x84,0xff)
+ ( 0,134,207) # rgb = (0x00,0x86,0xcf)
+ (255,134, 7) # rgb = (0xff,0x86,0x07)
+ ( 0,136,249) # rgb = (0x00,0x88,0xf9)
+ (219,140, 6) # rgb = (0xdb,0x8c,0x06)
+ ( 0,140,252) # rgb = (0x00,0x8c,0xfc)
+ ( 0,140,255) # rgb = (0x00,0x8c,0xff)
+ ( 1,142,136) # rgb = (0x01,0x8e,0x88)
+ (255,143, 7) # rgb = (0xff,0x8f,0x07)
+ (243,150, 7) # rgb = (0xf3,0x96,0x07)
+ (198,152, 7) # rgb = (0xc6,0x98,0x07)
+ (165,153, 7) # rgb = (0xa5,0x99,0x07)
+ ( 0,157,255) # rgb = (0x00,0x9d,0xff)
+ (255,158, 7) # rgb = (0xff,0x9e,0x07)
+ ( 70,159, 4) # rgb = (0x46,0x9f,0x04)
+ ( 0,160,251) # rgb = (0x00,0xa0,0xfb)
+ (203,163, 6) # rgb = (0xcb,0xa3,0x06)
+ ( 0,163,239) # rgb = (0x00,0xa3,0xef)
+ ( 1,164,178) # rgb = (0x01,0xa4,0xb2)
+ (255,166, 7) # rgb = (0xff,0xa6,0x07)
+ ( 1,169,165) # rgb = (0x01,0xa9,0xa5)
+ ( 1,170,255) # rgb = (0x01,0xaa,0xff)
+ (232,172, 6) # rgb = (0xe8,0xac,0x06)
+ (255,175, 7) # rgb = (0xff,0xaf,0x07)
+ (185,176,131) # rgb = (0xb9,0xb0,0x83)
+ ( 1,179,225) # rgb = (0x01,0xb3,0xe1)
+ (188,179,118) # rgb = (0xbc,0xb3,0x76)
+ (199,180, 6) # rgb = (0xc7,0xb4,0x06)
+ ( 1,182,255) # rgb = (0x01,0xb6,0xff)
+ ( 1,184,249) # rgb = (0x01,0xb8,0xf9)
+ (255,184, 7) # rgb = (0xff,0xb8,0x07)
+ (207,186, 71) # rgb = (0xcf,0xba,0x47)
+ (193,187, 6) # rgb = (0xc1,0xbb,0x06)
+ (253,191, 7) # rgb = (0xfd,0xbf,0x07)
+ (218,193, 48) # rgb = (0xda,0xc1,0x30)
+ ( 1,193,157) # rgb = (0x01,0xc1,0x9d)
+ ( 1,196,244) # rgb = (0x01,0xc4,0xf4)
+ ( 1,196,254) # rgb = (0x01,0xc4,0xfe)
+ ( 48,199, 3) # rgb = (0x30,0xc7,0x03)
+ (164,199, 5) # rgb = (0xa4,0xc7,0x05)
+ (220,202, 6) # rgb = (0xdc,0xca,0x06)
+ (253,203, 7) # rgb = (0xfd,0xcb,0x07)
+ ( 1,204,204) # rgb = (0x01,0xcc,0xcc)
+ (251,209, 7) # rgb = (0xfb,0xd1,0x07)
+ (231,208, 24) # rgb = (0xe7,0xd0,0x18)
+ ( 1,210,254) # rgb = (0x01,0xd2,0xfe)
+ ( 2,211,146) # rgb = (0x02,0xd3,0x92)
+ ( 1,212,156) # rgb = (0x01,0xd4,0x9c)
+ ( 1,213,252) # rgb = (0x01,0xd5,0xfc)
+ (237,219, 15) # rgb = (0xed,0xdb,0x0f)
+ ( 1,218,240) # rgb = (0x01,0xda,0xf0)
+ (165,220, 5) # rgb = (0xa5,0xdc,0x05)
+ ( 1,221,250) # rgb = (0x01,0xdd,0xfa)
+ (249,221, 6) # rgb = (0xf9,0xdd,0x06)
+ (146,222, 4) # rgb = (0x92,0xde,0x04)
+ ( 1,224,184) # rgb = (0x01,0xe0,0xb8)
+ ( 2,224,155) # rgb = (0x02,0xe0,0x9b)
+ (244,225, 10) # rgb = (0xf4,0xe1,0x0a)
+ (249,227, 7) # rgb = (0xf9,0xe3,0x07)
+ ( 2,229,133) # rgb = (0x02,0xe5,0x85)
+ (192,228, 6) # rgb = (0xc0,0xe4,0x06)
+ ( 37,230, 3) # rgb = (0x25,0xe6,0x03)
+ (246,230, 7) # rgb = (0xf6,0xe6,0x07)
+ (143,232, 4) # rgb = (0x8f,0xe8,0x04)
+ (244,233, 8) # rgb = (0xf4,0xe9,0x08)
+ ( 2,236,139) # rgb = (0x02,0xec,0x8b)
+ ( 1,236,227) # rgb = (0x01,0xec,0xe3)
+ ( 1,238,238) # rgb = (0x01,0xee,0xee)
+ (101,241, 4) # rgb = (0x65,0xf1,0x04)
+ ( 1,241,218) # rgb = (0x01,0xf1,0xda)
+ ( 1,240,232) # rgb = (0x01,0xf0,0xe8)
+ (167,240, 5) # rgb = (0xa7,0xf0,0x05)
+ ( 27,243, 2) # rgb = (0x1b,0xf3,0x02)
+ (126,243, 4) # rgb = (0x7e,0xf3,0x04)
+ ( 2,246,113) # rgb = (0x02,0xf6,0x71)
+ (133,248, 5) # rgb = (0x85,0xf8,0x05)
+ ( 22,250, 1) # rgb = (0x16,0xfa,0x01)
+ ( 2,249,219) # rgb = (0x02,0xf9,0xdb)
+ (148,250, 5) # rgb = (0x94,0xfa,0x05)
+ ( 2,250,199) # rgb = (0x02,0xfa,0xc7)
+ (183,252, 5) # rgb = (0xb7,0xfc,0x05)
+ (176,252, 5) # rgb = (0xb0,0xfc,0x05)
+ ( 2,252,211) # rgb = (0x02,0xfc,0xd3)
+ ( 2,252,190) # rgb = (0x02,0xfc,0xbe)
+ (164,251, 5) # rgb = (0xa4,0xfb,0x05)
+ ( 12,254,128) # rgb = (0x0c,0xfe,0x80)
+ (192,253, 5) # rgb = (0xc0,0xfd,0x05)
+ (164,253, 5) # rgb = (0xa4,0xfd,0x05)
+ ( 26,254, 85) # rgb = (0x1a,0xfe,0x55)
+ ( 14,254, 1) # rgb = (0x0e,0xfe,0x01)
+ (133,253, 5) # rgb = (0x85,0xfd,0x05)
+ ( 4,253,180) # rgb = (0x04,0xfd,0xb4)
+ (196,253, 5) # rgb = (0xc4,0xfd,0x05)
+ ( 2,253,198) # rgb = (0x02,0xfd,0xc6)
+ ( 3,255, 91) # rgb = (0x03,0xff,0x5b)
+ ( 3,255, 80) # rgb = (0x03,0xff,0x50)
+ (186,255, 5) # rgb = (0xba,0xff,0x05)
+ ( 9,255, 2) # rgb = (0x09,0xff,0x02)
+ ( 3,255,118) # rgb = (0x03,0xff,0x76)
+ ( 9,255, 3) # rgb = (0x09,0xff,0x03)
+ ( 10,255, 1) # rgb = (0x0a,0xff,0x01)
+ ( 3,255, 76) # rgb = (0x03,0xff,0x4c)
+ ( 3,255, 86) # rgb = (0x03,0xff,0x56)
+ ( 3,255, 82) # rgb = (0x03,0xff,0x52)
+ ( 13,255, 1) # rgb = (0x0d,0xff,0x01)
+ ( 3,255, 49) # rgb = (0x03,0xff,0x31)
+ ( 3,255,101) # rgb = (0x03,0xff,0x65)
+ ( 61,255, 32) # rgb = (0x3d,0xff,0x20)
+ (129,255, 5) # rgb = (0x81,0xff,0x05)
+ (177,255, 5) # rgb = (0xb1,0xff,0x05)
+ ( 3,255, 37) # rgb = (0x03,0xff,0x25)
+ (149,255, 5) # rgb = (0x95,0xff,0x05)
+ ( 7,255, 6) # rgb = (0x07,0xff,0x06)
+ (192,255, 5) # rgb = (0xc0,0xff,0x05)
+ ( 2,255,131) # rgb = (0x02,0xff,0x83)
+ ( 3,255, 98) # rgb = (0x03,0xff,0x62)
+ ( 85,255, 11) # rgb = (0x55,0xff,0x0b)
+ ( 2,255,163) # rgb = (0x02,0xff,0xa3)
+ ( 2,255,149) # rgb = (0x02,0xff,0x95)
+ ( 4,255, 23) # rgb = (0x04,0xff,0x17)
+ ( 6,255, 12) # rgb = (0x06,0xff,0x0c)
+ ( 3,255, 67) # rgb = (0x03,0xff,0x43)
+ (160,255, 5) # rgb = (0xa0,0xff,0x05)
+ (119,255, 6) # rgb = (0x77,0xff,0x06)
+ (102,255, 8) # rgb = (0x66,0xff,0x08)
+ (255,255,255) # rgb = (0xff,0xff,0xff)
+ (254,254,254) # rgb = (0xfe,0xfe,0xfe)
+ (254,254,254) # rgb = (0xfe,0xfe,0xfe)
+ (252,252,252) # rgb = (0xfc,0xfc,0xfc)
+ (252,252,252) # rgb = (0xfc,0xfc,0xfc)
+ (250,250,250) # rgb = (0xfa,0xfa,0xfa)
+ (250,250,250) # rgb = (0xfa,0xfa,0xfa)
+ (248,248,248) # rgb = (0xf8,0xf8,0xf8)
+ (248,248,248) # rgb = (0xf8,0xf8,0xf8)
+ (247,247,247) # rgb = (0xf7,0xf7,0xf7)
+ (245,245,245) # rgb = (0xf5,0xf5,0xf5)
+ (245,245,245) # rgb = (0xf5,0xf5,0xf5)
+ (243,243,243) # rgb = (0xf3,0xf3,0xf3)
+ (243,243,243) # rgb = (0xf3,0xf3,0xf3)
+ (241,241,241) # rgb = (0xf1,0xf1,0xf1)
+ (241,241,241) # rgb = (0xf1,0xf1,0xf1)
+ (239,239,239) # rgb = (0xef,0xef,0xef)
+ (238,238,238) # rgb = (0xee,0xee,0xee)
+ (238,238,238) # rgb = (0xee,0xee,0xee)
+ (236,236,236) # rgb = (0xec,0xec,0xec)
+ (236,236,236) # rgb = (0xec,0xec,0xec)
+ (234,234,234) # rgb = (0xea,0xea,0xea)
+ (234,234,234) # rgb = (0xea,0xea,0xea)
+ (232,232,232) # rgb = (0xe8,0xe8,0xe8)
+ (231,231,231) # rgb = (0xe7,0xe7,0xe7)
+ (231,231,231) # rgb = (0xe7,0xe7,0xe7)
+ (229,229,229) # rgb = (0xe5,0xe5,0xe5)
+ (229,229,229) # rgb = (0xe5,0xe5,0xe5)
+ (227,227,227) # rgb = (0xe3,0xe3,0xe3)
+ (226,226,226) # rgb = (0xe2,0xe2,0xe2)
+ (226,226,226) # rgb = (0xe2,0xe2,0xe2)
+ (224,224,224) # rgb = (0xe0,0xe0,0xe0)
+ (224,224,224) # rgb = (0xe0,0xe0,0xe0)
+ (222,222,222) # rgb = (0xde,0xde,0xde)
+ (222,222,222) # rgb = (0xde,0xde,0xde)
+ (220,220,220) # rgb = (0xdc,0xdc,0xdc)
+ (219,219,219) # rgb = (0xdb,0xdb,0xdb)
+ (219,219,219) # rgb = (0xdb,0xdb,0xdb)
+ (217,217,217) # rgb = (0xd9,0xd9,0xd9)
+ (217,217,217) # rgb = (0xd9,0xd9,0xd9)
+ (215,215,215) # rgb = (0xd7,0xd7,0xd7)
+ (214,214,214) # rgb = (0xd6,0xd6,0xd6)
+ (214,214,214) # rgb = (0xd6,0xd6,0xd6)
+ (212,212,212) # rgb = (0xd4,0xd4,0xd4)
+ (212,212,212) # rgb = (0xd4,0xd4,0xd4)
+ (210,210,210) # rgb = (0xd2,0xd2,0xd2)
+ (209,209,209) # rgb = (0xd1,0xd1,0xd1)
+ (209,209,209) # rgb = (0xd1,0xd1,0xd1)
+ (207,207,207) # rgb = (0xcf,0xcf,0xcf)
+ (205,205,205) # rgb = (0xcd,0xcd,0xcd)
+ (205,205,205) # rgb = (0xcd,0xcd,0xcd)
+ (204,204,204) # rgb = (0xcc,0xcc,0xcc)
+ (204,204,204) # rgb = (0xcc,0xcc,0xcc)
+ (202,202,202) # rgb = (0xca,0xca,0xca)
+ (201,201,201) # rgb = (0xc9,0xc9,0xc9)
+ (201,201,201) # rgb = (0xc9,0xc9,0xc9)
+ (199,199,199) # rgb = (0xc7,0xc7,0xc7)
+ (199,199,199) # rgb = (0xc7,0xc7,0xc7)
+ (197,197,197) # rgb = (0xc5,0xc5,0xc5)
+ (196,196,196) # rgb = (0xc4,0xc4,0xc4)
+ (196,196,196) # rgb = (0xc4,0xc4,0xc4)
+ (194,194,194) # rgb = (0xc2,0xc2,0xc2)
+ (193,193,193) # rgb = (0xc1,0xc1,0xc1)
+ (193,193,193) # rgb = (0xc1,0xc1,0xc1)
+ (191,191,191) # rgb = (0xbf,0xbf,0xbf)
+ (191,191,191) # rgb = (0xbf,0xbf,0xbf)
+ (189,189,189) # rgb = (0xbd,0xbd,0xbd)
+ (188,188,188) # rgb = (0xbc,0xbc,0xbc)
+ (188,188,188) # rgb = (0xbc,0xbc,0xbc)
+ (186,186,186) # rgb = (0xba,0xba,0xba)
+ (185,185,185) # rgb = (0xb9,0xb9,0xb9)
+ (185,185,185) # rgb = (0xb9,0xb9,0xb9)
+ (183,183,183) # rgb = (0xb7,0xb7,0xb7)
+ (182,182,182) # rgb = (0xb6,0xb6,0xb6)
+ (182,182,182) # rgb = (0xb6,0xb6,0xb6)
+ (180,180,180) # rgb = (0xb4,0xb4,0xb4)
+ (178,178,178) # rgb = (0xb2,0xb2,0xb2)
+ (178,178,178) # rgb = (0xb2,0xb2,0xb2)
+ (177,177,177) # rgb = (0xb1,0xb1,0xb1)
+ (177,177,177) # rgb = (0xb1,0xb1,0xb1)
+ (175,175,175) # rgb = (0xaf,0xaf,0xaf)
+ (174,174,174) # rgb = (0xae,0xae,0xae)
+ (174,174,174) # rgb = (0xae,0xae,0xae)
+}
+tRNS {
+ 197 187 190 194 186 4 186 189 4 195 84 191 5 193 175 163 205 150 191 213 88 75 67 8 147 191 220 203 95 151 223 199 8 207 156 227 199 65 163 98 226 204 12 202 167 201 11 65 178 228 205 74 59 87 178 19 201 99 18 14 184 204 184 96 22 61 227 199 22 193 97 197 254 59 253 28 192 102 199 247 58 198 244 30 109 202 188 32 96 196 60 203 239 202 230 41 207 237 119 53 213 209 37 55 45 230 214 233 92 185 223 50 230 57 124 217 43 133 221 95 198 47 233 99 194 221 107 138 152 144 226 140 133 220 172 125 218 196 118 225 161 223 235 238 200 155 147 146 172 236 236 151 183 150 234 216 217 211 151 219 132 185 145 147 217 138 144 137 142 151 217 217 213}
+IMAGE {
+ pixels hex
+0520201616160a0a0a0a0a0a0a0a010101010101010101000000000000000000
+053a3a161616160a0a0a0a0a0a0a0a0a0a06060606060607070707070707071b
+053a3a3a161616161615151c1c1c1c1c1c1c12121212121b1b1b1b1b1b1b1b1b
+053a3a3a3a252525252527272727272727272724242424242424212121212121
+053a3a3a4034343425252727272727393939392d2d2d2d2d2d2d323232323232
+053a3a404034343434343939393939393939394747474343433d3d3d3d3d3d3d
+053a404b4b4b50505046464646464646464659595959595151514e5b5b616161
+053a404b4b4b50505058585858585858588c8c8c595959595b656a6e70707070
+053a4b4b4b4b5050506c5858585858588c8c8c8c8c8c5965656a6a6e70707070
+053b4b4b4b636363506c6c6c6c6c6c8781808c8c8c86a1a1a1906e6e70707070
+053b4b5757636363636c6c6c6c7787878181808c8c86a1a190909d9d9d9daa70
+053b576666666f6363777777777e8787848481808086a19090aaaaaaaa9f9f9f
+053b576666797979797b7b7b7b7b8a8a8a8a848480809c9c9c9c9c9c9c9c9c9c
+053b66747474747474747b7b7b7b8a8a8a8a8a8aacacacacacacacacacaca4a4
+052e7474747474747474747b7b7b8a8a8a6d6d6d6d6d6d6da4a4a4a4a4a4a4a4
+052e7474747474747474a0a0a0a0a0a09393936d6d6d6d787878787878787878
+05207474747474a0a0a0a0a0a0a0a0a093939191949494948989898989898989
+052a2a2a7171717171a7a7a7a7a7a7a7a7a79e9e9e9e9e9e9e9e959595959595
+052a53536871717171717171a9a9a9a9a9a9a9a9a9a9a9a99595959595959595
+053753536871717171717171a3a3a3a3a3a3a3a3979797979a9a9a9a8e8e8e8e
+05445353686871717171717171a5a2a2a2a2a2929292928585857a7a7a7a7a7a
+054453535f68687171717171a5a5a5a5a5a5a6a6a6a6a68b8b8b8b8b8b8b8b6b
+054444535f686767676767677272727f7f8383838383838d8d8d8d8d8d8d8b8b
+054444535f6767675a5a5a627272727275757f7f7f7f5d73737d7d7d82828282
+0544445367675a5a5a5a4d546262727272757575755d5d5d7373737376767676
+054444535349495a5a5a4d4d54626262626275754c5d5d5d5d60646464767676
+054444444949494949494d4d4d5454546262624c4c4c4c4c5555556060646464
+05444444444941414133353f3f3f3f3f3f4d3636363c3c454545454531313131
+05444444442f2f2f2f333535353535352c2c2c2c2c3030303030282828282828
+053744442f2f2f2f2f2f333535351d1d22222222262626262323232323232323
+053737372f2f2f2f2f2f2f331818181818181d1d1d1d1d131a1a1a1a1a1e1e1e
+052a37372f2f2f2f2f2f18111111110f0e0e0e0e0d0d0d0d0d0d0d0d0d0d0d13
+}
diff --git a/libgo/go/json/decode.go b/libgo/go/json/decode.go
index 4f6562bd552..b7129f9846a 100644
--- a/libgo/go/json/decode.go
+++ b/libgo/go/json/decode.go
@@ -140,6 +140,7 @@ type decodeState struct {
scan scanner
nextscan scanner // for calls to nextValue
savedError os.Error
+ tempstr string // scratch space to avoid some allocations
}
// errPhase is used for errors that should not happen unless
@@ -470,6 +471,8 @@ func (d *decodeState) object(v reflect.Value) {
// Figure out field corresponding to key.
var subv reflect.Value
+ destring := false // whether the value is wrapped in a string to be decoded first
+
if mv.IsValid() {
elemType := mv.Type().Elem()
if !mapElem.IsValid() {
@@ -486,7 +489,8 @@ func (d *decodeState) object(v reflect.Value) {
if isValidTag(key) {
for i := 0; i < sv.NumField(); i++ {
f = st.Field(i)
- if f.Tag.Get("json") == key {
+ tagName, _ := parseTag(f.Tag.Get("json"))
+ if tagName == key {
ok = true
break
}
@@ -508,6 +512,8 @@ func (d *decodeState) object(v reflect.Value) {
} else {
subv = sv.FieldByIndex(f.Index)
}
+ _, opts := parseTag(f.Tag.Get("json"))
+ destring = opts.Contains("string")
}
}
@@ -520,8 +526,12 @@ func (d *decodeState) object(v reflect.Value) {
}
// Read value.
- d.value(subv)
-
+ if destring {
+ d.value(reflect.ValueOf(&d.tempstr))
+ d.literalStore([]byte(d.tempstr), subv)
+ } else {
+ d.value(subv)
+ }
// Write value back to map;
// if using struct, subv points into struct already.
if mv.IsValid() {
@@ -550,8 +560,12 @@ func (d *decodeState) literal(v reflect.Value) {
// Scan read one byte too far; back up.
d.off--
d.scan.undo(op)
- item := d.data[start:d.off]
+ d.literalStore(d.data[start:d.off], v)
+}
+
+// literalStore decodes a literal stored in item into v.
+func (d *decodeState) literalStore(item []byte, v reflect.Value) {
// Check for unmarshaler.
wantptr := item[0] == 'n' // null
unmarshaler, pv := d.indirect(v, wantptr)
diff --git a/libgo/go/json/decode_test.go b/libgo/go/json/decode_test.go
index a855d604866..5f6c3f5b8d0 100644
--- a/libgo/go/json/decode_test.go
+++ b/libgo/go/json/decode_test.go
@@ -262,7 +262,10 @@ type All struct {
Float32 float32
Float64 float64
- Foo string `json:"bar"`
+ Foo string `json:"bar"`
+ Foo2 string `json:"bar2,dummyopt"`
+
+ IntStr int64 `json:",string"`
PBool *bool
PInt *int
@@ -331,6 +334,8 @@ var allValue = All{
Float32: 14.1,
Float64: 15.1,
Foo: "foo",
+ Foo2: "foo2",
+ IntStr: 42,
String: "16",
Map: map[string]Small{
"17": {Tag: "tag17"},
@@ -391,6 +396,8 @@ var allValueIndent = `{
"Float32": 14.1,
"Float64": 15.1,
"bar": "foo",
+ "bar2": "foo2",
+ "IntStr": "42",
"PBool": null,
"PInt": null,
"PInt8": null,
@@ -481,6 +488,8 @@ var pallValueIndent = `{
"Float32": 0,
"Float64": 0,
"bar": "",
+ "bar2": "",
+ "IntStr": "0",
"PBool": true,
"PInt": 2,
"PInt8": 3,
diff --git a/libgo/go/json/encode.go b/libgo/go/json/encode.go
index 3e593fec15f..16be5e2af16 100644
--- a/libgo/go/json/encode.go
+++ b/libgo/go/json/encode.go
@@ -4,6 +4,9 @@
// Package json implements encoding and decoding of JSON objects as defined in
// RFC 4627.
+//
+// See "JSON and Go" for an introduction to this package:
+// http://blog.golang.org/2011/01/json-and-go.html
package json
import (
@@ -14,7 +17,6 @@ import (
"runtime"
"sort"
"strconv"
- "strings"
"unicode"
"utf8"
)
@@ -59,6 +61,12 @@ import (
// // Note the leading comma.
// Field int `json:",omitempty"`
//
+// The "string" option signals that a field is stored as JSON inside a
+// JSON-encoded string. This extra level of encoding is sometimes
+// used when communicating with JavaScript programs:
+//
+// Int64String int64 `json:",string"`
+//
// The key name will be used if it's a non-empty string consisting of
// only Unicode letters, digits, dollar signs, hyphens, and underscores.
//
@@ -221,6 +229,12 @@ func isEmptyValue(v reflect.Value) bool {
}
func (e *encodeState) reflectValue(v reflect.Value) {
+ e.reflectValueQuoted(v, false)
+}
+
+// reflectValueQuoted writes the value in v to the output.
+// If quoted is true, the serialization is wrapped in a JSON string.
+func (e *encodeState) reflectValueQuoted(v reflect.Value, quoted bool) {
if !v.IsValid() {
e.WriteString("null")
return
@@ -238,26 +252,39 @@ func (e *encodeState) reflectValue(v reflect.Value) {
return
}
+ writeString := (*encodeState).WriteString
+ if quoted {
+ writeString = (*encodeState).string
+ }
+
switch v.Kind() {
case reflect.Bool:
x := v.Bool()
if x {
- e.WriteString("true")
+ writeString(e, "true")
} else {
- e.WriteString("false")
+ writeString(e, "false")
}
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- e.WriteString(strconv.Itoa64(v.Int()))
+ writeString(e, strconv.Itoa64(v.Int()))
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- e.WriteString(strconv.Uitoa64(v.Uint()))
+ writeString(e, strconv.Uitoa64(v.Uint()))
case reflect.Float32, reflect.Float64:
- e.WriteString(strconv.FtoaN(v.Float(), 'g', -1, v.Type().Bits()))
+ writeString(e, strconv.FtoaN(v.Float(), 'g', -1, v.Type().Bits()))
case reflect.String:
- e.string(v.String())
+ if quoted {
+ sb, err := Marshal(v.String())
+ if err != nil {
+ e.error(err)
+ }
+ e.string(string(sb))
+ } else {
+ e.string(v.String())
+ }
case reflect.Struct:
e.WriteByte('{')
@@ -269,17 +296,14 @@ func (e *encodeState) reflectValue(v reflect.Value) {
if f.PkgPath != "" {
continue
}
- tag, omitEmpty := f.Name, false
+ tag, omitEmpty, quoted := f.Name, false, false
if tv := f.Tag.Get("json"); tv != "" {
- ss := strings.SplitN(tv, ",", 2)
- if isValidTag(ss[0]) {
- tag = ss[0]
- }
- if len(ss) > 1 {
- // Currently the only option is omitempty,
- // so parsing is trivial.
- omitEmpty = ss[1] == "omitempty"
+ name, opts := parseTag(tv)
+ if isValidTag(name) {
+ tag = name
}
+ omitEmpty = opts.Contains("omitempty")
+ quoted = opts.Contains("string")
}
fieldValue := v.Field(i)
if omitEmpty && isEmptyValue(fieldValue) {
@@ -292,7 +316,7 @@ func (e *encodeState) reflectValue(v reflect.Value) {
}
e.string(tag)
e.WriteByte(':')
- e.reflectValue(fieldValue)
+ e.reflectValueQuoted(fieldValue, quoted)
}
e.WriteByte('}')
@@ -380,7 +404,8 @@ func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) }
func (sv stringValues) get(i int) string { return sv[i].String() }
-func (e *encodeState) string(s string) {
+func (e *encodeState) string(s string) (int, os.Error) {
+ len0 := e.Len()
e.WriteByte('"')
start := 0
for i := 0; i < len(s); {
@@ -425,4 +450,5 @@ func (e *encodeState) string(s string) {
e.WriteString(s[start:])
}
e.WriteByte('"')
+ return e.Len() - len0, nil
}
diff --git a/libgo/go/json/encode_test.go b/libgo/go/json/encode_test.go
index 0e4b637703d..012e9f143b4 100644
--- a/libgo/go/json/encode_test.go
+++ b/libgo/go/json/encode_test.go
@@ -5,6 +5,8 @@
package json
import (
+ "bytes"
+ "reflect"
"testing"
)
@@ -42,3 +44,39 @@ func TestOmitEmpty(t *testing.T) {
t.Errorf(" got: %s\nwant: %s\n", got, optionalsExpected)
}
}
+
+type StringTag struct {
+ BoolStr bool `json:",string"`
+ IntStr int64 `json:",string"`
+ StrStr string `json:",string"`
+}
+
+var stringTagExpected = `{
+ "BoolStr": "true",
+ "IntStr": "42",
+ "StrStr": "\"xzbit\""
+}`
+
+func TestStringTag(t *testing.T) {
+ var s StringTag
+ s.BoolStr = true
+ s.IntStr = 42
+ s.StrStr = "xzbit"
+ got, err := MarshalIndent(&s, "", " ")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got := string(got); got != stringTagExpected {
+ t.Fatalf(" got: %s\nwant: %s\n", got, stringTagExpected)
+ }
+
+ // Verify that it round-trips.
+ var s2 StringTag
+ err = NewDecoder(bytes.NewBuffer(got)).Decode(&s2)
+ if err != nil {
+ t.Fatalf("Decode: %v", err)
+ }
+ if !reflect.DeepEqual(s, s2) {
+ t.Fatalf("decode didn't match.\nsource: %#v\nEncoded as:\n%s\ndecode: %#v", s, string(got), s2)
+ }
+}
diff --git a/libgo/go/json/tags.go b/libgo/go/json/tags.go
new file mode 100644
index 00000000000..58cda2027c6
--- /dev/null
+++ b/libgo/go/json/tags.go
@@ -0,0 +1,44 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package json
+
+import (
+ "strings"
+)
+
+// tagOptions is the string following a comma in a struct field's "json"
+// tag, or the empty string. It does not include the leading comma.
+type tagOptions string
+
+// parseTag splits a struct field's json tag into its name and
+// comma-separated options.
+func parseTag(tag string) (string, tagOptions) {
+ if idx := strings.Index(tag, ","); idx != -1 {
+ return tag[:idx], tagOptions(tag[idx+1:])
+ }
+ return tag, tagOptions("")
+}
+
+// Contains returns whether checks that a comma-separated list of options
+// contains a particular substr flag. substr must be surrounded by a
+// string boundary or commas.
+func (o tagOptions) Contains(optionName string) bool {
+ if len(o) == 0 {
+ return false
+ }
+ s := string(o)
+ for s != "" {
+ var next string
+ i := strings.Index(s, ",")
+ if i >= 0 {
+ s, next = s[:i], s[i+1:]
+ }
+ if s == optionName {
+ return true
+ }
+ s = next
+ }
+ return false
+}
diff --git a/libgo/go/json/tags_test.go b/libgo/go/json/tags_test.go
new file mode 100644
index 00000000000..91fb18831e2
--- /dev/null
+++ b/libgo/go/json/tags_test.go
@@ -0,0 +1,28 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package json
+
+import (
+ "testing"
+)
+
+func TestTagParsing(t *testing.T) {
+ name, opts := parseTag("field,foobar,foo")
+ if name != "field" {
+ t.Fatalf("name = %q, want field", name)
+ }
+ for _, tt := range []struct {
+ opt string
+ want bool
+ }{
+ {"foobar", true},
+ {"foo", true},
+ {"bar", false},
+ } {
+ if opts.Contains(tt.opt) != tt.want {
+ t.Errorf("Contains(%q) = %v", tt.opt, !tt.want)
+ }
+ }
+}
diff --git a/libgo/go/reflect/type.go b/libgo/go/reflect/type.go
index b825768568f..6d0f4542431 100644
--- a/libgo/go/reflect/type.go
+++ b/libgo/go/reflect/type.go
@@ -10,6 +10,9 @@
// A call to ValueOf returns a Value representing the run-time data.
// Zero takes a Type and returns a Value representing a zero value
// for that type.
+//
+// See "The Laws of Reflection" for an introduction to reflection in Go:
+// http://blog.golang.org/2011/09/laws-of-reflection.html
package reflect
import (
diff --git a/libgo/merge.sh b/libgo/merge.sh
index 3c520ef3bf9..59e1df2018f 100644..100755
--- a/libgo/merge.sh
+++ b/libgo/merge.sh
@@ -40,7 +40,7 @@ hg clone -r ${old_rev} ${repository} ${OLDDIR}
rm -rf ${NEWDIR}
hg clone -u release ${repository} ${NEWDIR}
-new_rev=`cd ${NEWDIR} && hg log | sed 1q | sed -e 's/.*://'`
+new_rev=`cd ${NEWDIR} && hg log -r release | sed 1q | sed -e 's/.*://'`
merge() {
name=$1
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index edeb3168a8a..f959d640fdc 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -36,13 +36,17 @@ cat > sysinfo.c <<EOF
#include <netinet/in.h>
/* <netinet/tcp.h> needs u_char/u_short, but <sys/bsd_types> is only
included by <netinet/in.h> if _SGIAPI (i.e. _SGI_SOURCE
- && !_XOPEN_SOURCE. */
+ && !_XOPEN_SOURCE.
+ <sys/termios.h> only defines TIOCNOTTY if !_XOPEN_SOURCE, while
+ <sys/ttold.h> does so unconditionally. */
#ifdef __sgi__
#include <sys/bsd_types.h>
+#include <sys/ttold.h>
#endif
#include <netinet/tcp.h>
#include <signal.h>
#include <sys/ioctl.h>
+#include <termios.h>
#if defined(HAVE_SYSCALL_H)
#include <syscall.h>
#endif
@@ -95,6 +99,7 @@ ${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c
echo 'package syscall' > ${OUT}
echo 'import "unsafe"' >> ${OUT}
+echo 'type _ unsafe.Pointer' >> ${OUT}
# Get all the consts and types, skipping ones which could not be
# represented in Go and ones which we need to rewrite. We also skip
@@ -497,6 +502,14 @@ grep '^type _passwd ' gen-sysinfo.go | \
grep '^const _TIOC' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+# ioctl constants. Might fall back to 0 if TIOCNXCL is missing, too, but
+# needs handling in syscalls.exec.go.
+if ! grep '^const _TIOCSCTTY ' gen-sysinfo.go >/dev/null 2>&1; then
+ if grep '^const _TIOCNXCL ' gen-sysinfo.go >/dev/null 2>&1; then
+ echo "const TIOCSCTTY = TIOCNXCL" >> ${OUT}
+ fi
+fi
+
# The nlmsghdr struct.
grep '^type _nlmsghdr ' gen-sysinfo.go | \
sed -e 's/_nlmsghdr/NlMsghdr/' \
diff --git a/libgo/runtime/go-make-slice.c b/libgo/runtime/go-make-slice.c
index cd2d55bd538..d0e8369c1f6 100644
--- a/libgo/runtime/go-make-slice.c
+++ b/libgo/runtime/go-make-slice.c
@@ -35,7 +35,8 @@ __go_make_slice2 (const struct __go_type_descriptor *td, uintptr_t len,
icap = (int) cap;
if (cap < len
|| (uintptr_t) icap != cap
- || cap > (uintptr_t) -1U / std->__element_type->__size)
+ || (std->__element_type->__size > 0
+ && cap > (uintptr_t) -1U / std->__element_type->__size))
__go_panic_msg ("makeslice: cap out of range");
ret.__count = ilen;
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c
index 7a3a7b83d92..9b19ff19df4 100644
--- a/libgo/runtime/go-map-delete.c
+++ b/libgo/runtime/go-map-delete.c
@@ -9,6 +9,7 @@
#include "go-alloc.h"
#include "go-assert.h"
+#include "go-panic.h"
#include "map.h"
/* Delete the entry matching KEY from MAP. */
@@ -25,6 +26,9 @@ __go_map_delete (struct __go_map *map, const void *key)
size_t bucket_index;
void **pentry;
+ if (map == NULL)
+ __go_panic_msg ("assignment to entry in nil map");
+
descriptor = map->__descriptor;
key_descriptor = descriptor->__map_descriptor->__key_type;
diff --git a/libgo/runtime/go-map-index.c b/libgo/runtime/go-map-index.c
index a387c4b98bc..92a806868bc 100644
--- a/libgo/runtime/go-map-index.c
+++ b/libgo/runtime/go-map-index.c
@@ -9,6 +9,7 @@
#include "go-alloc.h"
#include "go-assert.h"
+#include "go-panic.h"
#include "map.h"
/* Rehash MAP to a larger size. */
@@ -85,6 +86,13 @@ __go_map_index (struct __go_map *map, const void *key, _Bool insert)
size_t bucket_index;
char *entry;
+ if (map == NULL)
+ {
+ if (insert)
+ __go_panic_msg ("assignment to entry in nil map");
+ return NULL;
+ }
+
descriptor = map->__descriptor;
key_descriptor = descriptor->__map_descriptor->__key_type;
diff --git a/libgo/runtime/go-new-channel.c b/libgo/runtime/go-new-channel.c
index 0c6f39185de..2f5bf2ea20a 100644
--- a/libgo/runtime/go-new-channel.c
+++ b/libgo/runtime/go-new-channel.c
@@ -33,7 +33,7 @@ __go_new_channel (const struct __go_type_descriptor *channel_type,
ientries = (int) entries;
if (ientries < 0
|| (uintptr_t) ientries != entries
- || entries > (uintptr_t) -1 / element_size)
+ || (element_size > 0 && entries > (uintptr_t) -1 / element_size))
__go_panic_msg ("chan size out of range");
alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);
diff --git a/libgo/runtime/map.goc b/libgo/runtime/map.goc
index d6308cbd308..e19bc96de64 100644
--- a/libgo/runtime/map.goc
+++ b/libgo/runtime/map.goc
@@ -9,17 +9,18 @@ package runtime
typedef unsigned char byte;
typedef _Bool bool;
-typedef struct __go_map hmap;
+typedef struct __go_map_type MapType;
+typedef struct __go_map Hmap;
typedef struct __go_hash_iter hiter;
/* Access a value in a map, returning a value and a presence indicator. */
-func mapaccess2(h *hmap, key *byte, val *byte) (present bool) {
+func mapaccess2(t *MapType, h *Hmap, key *byte, val *byte) (present bool) {
byte *mapval;
size_t valsize;
mapval = __go_map_index(h, key, 0);
- valsize = h->__descriptor->__map_descriptor->__val_type->__size;
+ valsize = t->__val_type->__size;
if (mapval == nil) {
__builtin_memset(val, 0, valsize);
present = 0;
@@ -31,7 +32,7 @@ func mapaccess2(h *hmap, key *byte, val *byte) (present bool) {
/* Optionally assign a value to a map (m[k] = v, p). */
-func mapassign2(h *hmap, key *byte, val *byte, p bool) {
+func mapassign2(h *Hmap, key *byte, val *byte, p bool) {
if (!p) {
__go_map_delete(h, key);
} else {
@@ -46,7 +47,7 @@ func mapassign2(h *hmap, key *byte, val *byte, p bool) {
/* Initialize a range over a map. */
-func mapiterinit(h *hmap, it *hiter) {
+func mapiterinit(h *Hmap, it *hiter) {
__go_mapiterinit(h, it);
}
diff --git a/libgo/syscalls/exec.go b/libgo/syscalls/exec.go
index 04d0ef88f82..8ad45f9aea5 100644
--- a/libgo/syscalls/exec.go
+++ b/libgo/syscalls/exec.go
@@ -231,6 +231,7 @@ var zeroSysProcAttr SysProcAttr
func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
var p [2]int
+ var n Ssize_t
var r1 int
var err1 uintptr
var wstatus WaitStatus
@@ -283,20 +284,14 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
// Kick off child.
pid, err = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1])
if err != 0 {
- error:
- if p[0] >= 0 {
- Close(p[0])
- Close(p[1])
- }
- ForkLock.Unlock()
- return 0, err
+ goto error
}
ForkLock.Unlock()
// Read child error status from pipe.
Close(p[1])
- n := libc_read(p[0], (*byte)(unsafe.Pointer(&err1)),
- Size_t(unsafe.Sizeof(err1)))
+ n = libc_read(p[0], (*byte)(unsafe.Pointer(&err1)),
+ Size_t(unsafe.Sizeof(err1)))
err = 0
if n < 0 {
err = GetErrno()
@@ -321,6 +316,14 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
// Read got EOF, so pipe closed on exec, so exec succeeded.
return pid, 0
+
+error:
+ if p[0] >= 0 {
+ Close(p[0])
+ Close(p[1])
+ }
+ ForkLock.Unlock()
+ return 0, err
}
// Combination of fork and exec, careful to be thread safe.
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 83640782835..69cf8eed06a 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -16,7 +16,7 @@ export LC_CTYPE=C
GC=${GC:-gccgo}
GL=${GL:-${GC-gccgo}}
-GOLIBS=
+GOLIBS=${GOLIBS:-}
export GC GL GOLIBS
NM=${NM:-nm}
@@ -32,7 +32,7 @@ loop=true
keep=false
prefix=
dejagnu=no
-timeout=60
+timeout=240
testname=""
trace=false
while $loop; do
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 844b1ee4745..59460e43f09 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,29 @@
+2011-09-28 Doug Evans <dje@google.com>
+
+ * timeval-utils.c: New file.
+ * Makefile.in (CFILES): Add it.
+ (REQUIRED_OFILES): Add timeval-utils.$(objext).
+ (INSTALLED_HEADERS): Add timeval-utils.h.
+ (timeval-utils.$(objext)): Add rule.
+
+ * argv.c (countargv): New function.
+
+2011-09-23 Cary Coutant <ccoutant@google.com>
+
+ PR 40831
+ * cp-demangle.c (d_make_comp): Add new component type.
+ (cplus_demangle_mangled_name): Check for clone suffixes.
+ (d_parmlist): Don't error out if we see '.'.
+ (d_clone_suffix): New function.
+ (d_print_comp): Print info for clone suffixes.
+ * testsuite/demangle-expected: Add new testcases.
+
+2011-09-23 Ian Lance Taylor <iant@google.com>
+ Pierre Vittet <piervit@pvittet.com>
+
+ * md5.c (md5_process_bytes): Correct handling of unaligned
+ buffer.
+
2011-08-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* aclocal.m4: Include ../config/picflag.m4.
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 8476c8fda9e..ca53f91493d 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -492,6 +492,29 @@ expandargv (int *argcp, char ***argvp)
}
}
+/*
+
+@deftypefn Extension int countargv (char **@var{argv})
+
+Return the number of elements in @var{argv}.
+Returns zero if @var{argv} is NULL.
+
+@end deftypefn
+
+*/
+
+int
+countargv (char **argv)
+{
+ int argc;
+
+ if (argv == NULL)
+ return 0;
+ for (argc = 0; argv[argc] != NULL; argc++)
+ continue;
+ return argc;
+}
+
#ifdef MAIN
/* Simple little test driver. */
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index d67a9e74e65..32318e89fd8 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -417,6 +417,9 @@ static struct demangle_component *d_lambda (struct d_info *);
static struct demangle_component *d_unnamed_type (struct d_info *);
+static struct demangle_component *
+d_clone_suffix (struct d_info *, struct demangle_component *);
+
static int
d_add_substitution (struct d_info *, struct demangle_component *);
@@ -802,6 +805,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_LITERAL_NEG:
case DEMANGLE_COMPONENT_COMPOUND_NAME:
case DEMANGLE_COMPONENT_VECTOR_TYPE:
+ case DEMANGLE_COMPONENT_CLONE:
if (left == NULL || right == NULL)
return NULL;
break;
@@ -1034,7 +1038,7 @@ d_make_sub (struct d_info *di, const char *name, int len)
return p;
}
-/* <mangled-name> ::= _Z <encoding>
+/* <mangled-name> ::= _Z <encoding> [<clone-suffix>]*
TOP_LEVEL is non-zero when called at the top level. */
@@ -1042,6 +1046,8 @@ CP_STATIC_IF_GLIBCPP_V3
struct demangle_component *
cplus_demangle_mangled_name (struct d_info *di, int top_level)
{
+ struct demangle_component *p;
+
if (! d_check_char (di, '_')
/* Allow missing _ if not at toplevel to work around a
bug in G++ abi-version=2 mangling; see the comment in
@@ -1050,7 +1056,18 @@ cplus_demangle_mangled_name (struct d_info *di, int top_level)
return NULL;
if (! d_check_char (di, 'Z'))
return NULL;
- return d_encoding (di, top_level);
+ p = d_encoding (di, top_level);
+
+ /* If at top level and parsing parameters, check for a clone
+ suffix. */
+ if (top_level && (di->options & DMGL_PARAMS) != 0)
+ while (d_peek_char (di) == '.'
+ && (IS_LOWER (d_peek_next_char (di))
+ || d_peek_next_char (di) == '_'
+ || IS_DIGIT (d_peek_next_char (di))))
+ p = d_clone_suffix (di, p);
+
+ return p;
}
/* Return whether a function should have a return type. The argument
@@ -2354,7 +2371,7 @@ d_parmlist (struct d_info *di)
struct demangle_component *type;
char peek = d_peek_char (di);
- if (peek == '\0' || peek == 'E')
+ if (peek == '\0' || peek == 'E' || peek == '.')
break;
type = cplus_demangle_type (di);
if (type == NULL)
@@ -3082,6 +3099,33 @@ d_unnamed_type (struct d_info *di)
return ret;
}
+/* <clone-suffix> ::= [ . <clone-type-identifier> ] [ . <nonnegative number> ]*
+*/
+
+static struct demangle_component *
+d_clone_suffix (struct d_info *di, struct demangle_component *encoding)
+{
+ const char *suffix = d_str (di);
+ const char *pend = suffix;
+ struct demangle_component *n;
+
+ if (*pend == '.' && (IS_LOWER (pend[1]) || pend[1] == '_'))
+ {
+ pend += 2;
+ while (IS_LOWER (*pend) || *pend == '_')
+ ++pend;
+ }
+ while (*pend == '.' && IS_DIGIT (pend[1]))
+ {
+ pend += 2;
+ while (IS_DIGIT (*pend))
+ ++pend;
+ }
+ d_advance (di, pend - suffix);
+ n = d_make_name (di, suffix, pend - suffix);
+ return d_make_comp (di, DEMANGLE_COMPONENT_CLONE, encoding, n);
+}
+
/* Add a new substitution. */
static int
@@ -4463,6 +4507,13 @@ d_print_comp (struct d_print_info *dpi, int options,
d_append_char (dpi, '}');
return;
+ case DEMANGLE_COMPONENT_CLONE:
+ d_print_comp (dpi, options, d_left (dc));
+ d_append_string (dpi, " [clone ");
+ d_print_comp (dpi, options, d_right (dc));
+ d_append_char (dpi, ']');
+ return;
+
default:
d_print_error (dpi);
return;
diff --git a/libiberty/md5.c b/libiberty/md5.c
index 11920e1b555..0db8fc8936f 100644
--- a/libiberty/md5.c
+++ b/libiberty/md5.c
@@ -1,6 +1,6 @@
/* md5.c - Functions to compute MD5 message digest of files or memory blocks
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2011 Free Software Foundation, Inc.
NOTE: This source is derived from an old version taken from the GNU C
Library (glibc).
@@ -245,9 +245,11 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
}
else
#endif
- md5_process_block (buffer, len & ~63, ctx);
- buffer = (const void *) ((const char *) buffer + (len & ~63));
- len &= 63;
+ {
+ md5_process_block (buffer, len & ~63, ctx);
+ buffer = (const void *) ((const char *) buffer + (len & ~63));
+ len &= 63;
+ }
}
/* Move remaining bytes in internal buffer. */
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 3737cfd7bdb..64ccb929680 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4151,3 +4151,50 @@ DFA
--format=auto
_ZN3Psi7VariantIIcPKcEE5visitIIRZN11VariantTest9TestVisit11test_methodEvEUlS2_E0_RZNS6_11test_methodEvEUlcE1_RZNS6_11test_methodEvEUlNS_4NoneEE_EEENS_13VariantDetail19SelectVisitorResultIIDpT_EE4typeEDpOSG_
Psi::VariantDetail::SelectVisitorResult<VariantTest::TestVisit::test_method()::{lambda(char const*)#2}&, VariantTest::TestVisit::test_method()::{lambda(char)#3}&, VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>::type Psi::Variant<char, char const*>::visit<VariantTest::TestVisit::test_method()::{lambda(char const*)#2}&, VariantTest::TestVisit::test_method()::{lambda(char)#3}&, VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&>((VariantTest::TestVisit::test_method()::{lambda(Psi::None)#1}&)...)
+#
+# Clone suffix tests
+#
+--format=gnu-v3 --no-params
+_Z3fo5n.clone.1
+fo5(__int128) [clone .clone.1]
+fo5
+#
+--format=gnu-v3 --no-params
+_Z3fo5n.constprop.2
+fo5(__int128) [clone .constprop.2]
+fo5
+#
+--format=gnu-v3 --no-params
+_Z3fo5n.isra.3
+fo5(__int128) [clone .isra.3]
+fo5
+#
+--format=gnu-v3 --no-params
+_Z3fo5n.part.4
+fo5(__int128) [clone .part.4]
+fo5
+#
+--format=gnu-v3 --no-params
+_Z12to_be_clonediPv.clone.0
+to_be_cloned(int, void*) [clone .clone.0]
+to_be_cloned
+#
+--format=gnu-v3 --no-params
+_Z3fooi.1988
+foo(int) [clone .1988]
+foo
+#
+--format=gnu-v3 --no-params
+_Z3fooi.part.9.165493.constprop.775.31805
+foo(int) [clone .part.9.165493] [clone .constprop.775.31805]
+foo
+#
+--format=gnu-v3 --no-params
+_Z2f1IiEvT_S0_S0_._omp_fn.2
+void f1<int>(int, int, int) [clone ._omp_fn.2]
+f1<int>
+#
+--format=gnu-v3 --no-params
+_Z3fooi._omp_cpyfn.6
+foo(int) [clone ._omp_cpyfn.6]
+foo
diff --git a/libiberty/timeval-utils.c b/libiberty/timeval-utils.c
new file mode 100644
index 00000000000..4c9f6a85ee2
--- /dev/null
+++ b/libiberty/timeval-utils.c
@@ -0,0 +1,87 @@
+/* Basic struct timeval utilities.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "config.h"
+
+/* On some systems (such as WindISS), you must include <sys/types.h>
+ to get the definition of "time_t" before you include <time.h>. */
+#include <sys/types.h>
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# ifdef HAVE_TIME_H
+# include <time.h>
+# endif
+# endif
+#endif
+
+#include "timeval-utils.h"
+
+/*
+
+@deftypefn Extension void timeval_add (struct timeval *@var{a}, @
+ struct timeval *@var{b}, struct timeval *@var{result})
+
+Adds @var{a} to @var{b} and stores the result in @var{result}.
+
+@end deftypefn
+
+*/
+
+void
+timeval_add (struct timeval *result,
+ const struct timeval *a, const struct timeval *b)
+{
+ result->tv_sec = a->tv_sec + b->tv_sec;
+ result->tv_usec = a->tv_usec + b->tv_usec;
+ if (result->tv_usec >= 1000000)
+ {
+ ++result->tv_sec;
+ result->tv_usec -= 1000000;
+ }
+}
+
+/*
+
+@deftypefn Extension void timeval_sub (struct timeval *@var{a}, @
+ struct timeval *@var{b}, struct timeval *@var{result})
+
+Subtracts @var{b} from @var{a} and stores the result in @var{result}.
+
+@end deftypefn
+
+*/
+
+void
+timeval_sub (struct timeval *result,
+ const struct timeval *a, const struct timeval *b)
+{
+ result->tv_sec = a->tv_sec - b->tv_sec;
+ result->tv_usec = a->tv_usec - b->tv_usec;
+ if (result->tv_usec < 0)
+ {
+ --result->tv_sec;
+ result->tv_usec += 1000000;
+ }
+}
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index 75217a47f7b..0ba40b04c35 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-29 Jan Beulich <jbeulich@suse.com>
+
+ * tools/Makefile.am (TOOLS_ZIP): Make writable the copied subtrees
+ asm/ and classes/.
+ * tools/Makefile.in: Re-generate.
+
2010-06-03 Andrew John Hughes <ahughes@redhat.com>
* examples/gnu/classpath/examples/CORBA/NamingService/Demo.java,
diff --git a/libjava/classpath/tools/Makefile.am b/libjava/classpath/tools/Makefile.am
index 44489c89afd..f7ad91c9069 100755
--- a/libjava/classpath/tools/Makefile.am
+++ b/libjava/classpath/tools/Makefile.am
@@ -371,6 +371,7 @@ endif
## BEGIN GCJ LOCAL
cp -pR $(srcdir)/asm .
cp -pR $(srcdir)/classes .
+ find asm classes -type d -exec chmod u+w \{\} \;
if [ -d asm/.svn ]; then \
find asm classes -depth -type d -name .svn -exec rm -rf \{\} \;; \
fi
diff --git a/libjava/classpath/tools/Makefile.in b/libjava/classpath/tools/Makefile.in
index adb8c09b7d6..d82fac6d9ae 100644
--- a/libjava/classpath/tools/Makefile.in
+++ b/libjava/classpath/tools/Makefile.in
@@ -1425,6 +1425,7 @@ $(TOOLS_ZIP): $(ALL_TOOLS_FILES)
done
cp -pR $(srcdir)/asm .
cp -pR $(srcdir)/classes .
+ find asm classes -type d -exec chmod u+w \{\} \;
if [ -d asm/.svn ]; then \
find asm classes -depth -type d -name .svn -exec rm -rf \{\} \;; \
fi
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 7b35cc985d7..fd24f5f400d 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-21 Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile.am (FLAGS_TO_PASS): Define.
+ * Makefile.in: Regenerate.
+
2011-08-01 Jakub Jelinek <jakub@redhat.com>
* math/rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y
diff --git a/libquadmath/Makefile.am b/libquadmath/Makefile.am
index d8dc2c39435..c7be3e55414 100644
--- a/libquadmath/Makefile.am
+++ b/libquadmath/Makefile.am
@@ -107,6 +107,9 @@ AM_MAKEFLAGS = \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
+# Subdir rules rely on $(FLAGS_TO_PASS)
+FLAGS_TO_PASS = $(AM_MAKEFLAGS)
+
MAKEOVERRIDES=
# AM_CONDITIONAL on configure option --generated-files-in-srcdir
diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in
index 6bf7c11388e..6e389cf6af1 100644
--- a/libquadmath/Makefile.in
+++ b/libquadmath/Makefile.in
@@ -385,6 +385,9 @@ AUTOMAKE_OPTIONS = 1.8 foreign
@BUILD_LIBQUADMATH_TRUE@ "RANLIB=$(RANLIB)" \
@BUILD_LIBQUADMATH_TRUE@ "DESTDIR=$(DESTDIR)"
+
+# Subdir rules rely on $(FLAGS_TO_PASS)
+@BUILD_LIBQUADMATH_TRUE@FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_LIBQUADMATH_TRUE@MAKEOVERRIDES =
@BUILD_LIBQUADMATH_TRUE@@GENINSRC_FALSE@STAMP_GENINSRC =
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 98f8b81a482..a03f1afe033 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,112 @@
+2011-10-01 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/debug/vector (vector<>::erase(iterator, iterator): Check
+ iterators equality using normal iterators.
+ * include/debug/deque (deque<>::erase(iterator, iterator): Likewise.
+
+2011-09-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
+ Remove noexcept from declaration too.
+
+2011-09-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/html/*: Regenerate.
+
+ * doc/Makefile.am: Un-nest the ext output directory.
+ * doc/Makefile.in: Regenerate.
+ * spine.xml: Remove authors, add abstract for short
+ contents. Rename to index.html for html output.
+ * manual/spine.xml: Authors here, manual starts with index.html.
+ * api.xml: Update.
+ * faq.xml: Same.
+
+2011-09-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * libsupc++/tinfo.cc (type_info::operator==): Test __name instead
+ of name().
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/50529
+ * include/bits/vector.tcc (vector<>::erase(iterator, iterator)):
+ Fix to do nothing if the range is empty.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/bits/deque.tcc: Likewise.
+ * include/debug/vector: Adjust.
+ * include/debug/deque: Likewise.
+ * testsuite/23_containers/vector/modifiers/erase/50529.cc: New.
+ * testsuite/23_containers/deque/modifiers/erase/50529.cc: Likewise.
+ * testsuite/23_containers/deque/modifiers/erase/3.cc: Adjust.
+
+2011-09-25 Benjamin Kosnik <bkoz@redhat.com>
+ Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/48698
+ * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Set libtool_VERSION here.
+ * configure.ac: Move AC_SUBST of libtool_VERSION past call to
+ GLIBCXX_ENABLE_SYMVERS.
+ * configure: Regenerate.
+ * include/bits/c++config: Use __7 as versioned namespace name.
+ * config/abi/pre/gnu-versioned-namespace.ver: Change mangling as
+ per above.
+ * include/c_global/cwchar: Adjust nested namespaces.
+ * testsuite/20_util/bind/48698.cc: Add test case.
+ * testsuite/ext/profile/mutex_extensions_neg.cc: Change line number.
+
+2011-09-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ Revert (no longer necessary post r179130):
+
+ 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
+
+ * testsuite/util/testsuite_error.h: Add empty default constructor
+ to __gnu_test::test_category and
+ __gnu_test::test_derived_category.
+ * src/future.cc: Add empty default constructor to
+ future_error_category.
+ * src/system_error.cc: Add default ctor to generic_error_category
+ and system_error_category.
+
+2011-09-24 John Salmon <john.salmon@deshaw.com>
+
+ PR libstdc++/50510
+ * include/bits/random.tcc (seed_seq::generate): Fix computation.
+
+2011-09-24 John Salmon <john.salmon@deshaw.com>
+
+ PR libstdc++/50509
+ * include/bits/random.tcc (seed_seq::generate): Fix computation.
+
+2011-09-21 Benjamin Kosnik <bkoz@redhat.com
+
+ * doc/Makefile.am (stamp-epub-docbook): Fix image directory location.
+ * doc/Makefile.in: Regenerate.
+
+2011-09-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * src/limits.cc: Replace everywhere __int128_t -> __int128, and
+ __uint128_t -> unsigned __int128.
+ * include/std/type_traits: Likewise.
+ * include/std/limits: Likewise.
+ * testsuite/18_support/numeric_limits/dr559.cc: Likewise.
+ * testsuite/18_support/numeric_limits/lowest.cc: Likewise.
+ * testsuite/18_support/numeric_limits/40856.cc: Likewise.
+ * testsuite/18_support/numeric_limits/max_digits10.cc: Likewise.
+ * testsuite/util/testsuite_common_types.h: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise.
+ * testsuite/20_util/is_floating_point/value.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise.
+ * testsuite/20_util/is_signed/value.cc: Likewise.
+ * testsuite/20_util/is_unsigned/value.cc: Likewise.
+ * testsuite/20_util/is_integral/value.cc: Likewise.
+ * config/abi/pre/gnu.ver: Likewise.
+ * acinclude.m4: Likewise.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
2011-09-19 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40856
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 543f684f458..1b9d025efc3 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2446,17 +2446,15 @@ template<typename T>
int main()
{
- typename same<long, __int128_t>::type i1;
- typename same<unsigned long, __uint128_t>::type u1;
- typename same<long long, __int128_t>::type i2;
- typename same<unsigned long long, __uint128_t>::type u2;
+ typename same<long, __int128>::type i1;
+ typename same<long long, __int128>::type i2;
}
EOF
- AC_MSG_CHECKING([for __int128_t and __uint128_t])
+ AC_MSG_CHECKING([for __int128])
if AC_TRY_EVAL(ac_compile); then
AC_DEFINE(_GLIBCXX_USE_INT128, 1,
- [Define if __int128_t and __uint128_t types are supported on this host.])
+ [Define if __int128 is supported on this host.])
enable_int128=yes
else
enable_int128=no
@@ -3056,10 +3054,15 @@ dnl
dnl Add version tags to symbols in shared library (or not), additionally
dnl marking other symbols as private/local (or not).
dnl
+dnl Sets libtool_VERSION, and determines shared library SONAME.
+dnl
+dnl This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
+dnl
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
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
@@ -3196,7 +3199,10 @@ changequote([,])dnl
fi
fi
-# Everything parsed; figure out what file to use.
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=6:17:0
+
+# Everything parsed; figure out what files and settings to use.
case $enable_symvers in
no)
SYMVER_FILE=config/abi/pre/none.ver
@@ -3207,6 +3213,7 @@ case $enable_symvers in
[Define to use GNU versioning in the shared library.])
;;
gnu-versioned-namespace)
+ libtool_VERSION=7:0:0
SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
AC_DEFINE(_GLIBCXX_SYMVER_GNU_NAMESPACE, 1,
[Define to use GNU namespace versioning in the shared library.])
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 19a40b8aed4..82470c8cec9 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -816,7 +816,7 @@
/* Define if get_nprocs is available in <sys/sysinfo.h>. */
#undef _GLIBCXX_USE_GET_NPROCS
-/* Define if __int128_t and __uint128_t types are supported on this host. */
+/* Define if __int128 is supported on this host. */
#undef _GLIBCXX_USE_INT128
/* Define if LFS support is available. */
diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
index ab9380c3705..32bcf67d819 100644
--- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
+++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
@@ -20,23 +20,23 @@
## with this library; see the file COPYING3. If not see
## <http://www.gnu.org/licenses/>.
-GLIBCXX_5.0 {
+GLIBCXX_7.0 {
global:
# Names inside the 'extern' block are demangled names.
extern "C++"
{
- std::_6::*;
+ std::__7::*;
std::*
};
# locale
- _ZNSt2_69has_facetINS_*;
+ _ZNSt3__79has_facetINS_*;
# hash
- _ZNSt8__detail2_612__prime_listE;
- _ZNSt3tr18__detail2_612__prime_listE;
+ _ZNSt8__detail3__712__prime_listE;
+ _ZNSt3tr18__detail3__712__prime_listE;
# thread/mutex/condition_variable/future
__once_proxy;
@@ -73,41 +73,41 @@ GLIBCXX_5.0 {
_ZTv0_n*;
# std::__detail::_List_node_base
- _ZNSt8__detail2_615_List_node_base7_M_hook*;
- _ZNSt8__detail2_615_List_node_base9_M_unhookEv;
- _ZNSt8__detail2_615_List_node_base10_M_reverseEv;
- _ZNSt8__detail2_615_List_node_base11_M_transfer*;
- _ZNSt8__detail2_615_List_node_base4swapER*;
+ _ZNSt8__detail3__715_List_node_base7_M_hook*;
+ _ZNSt8__detail3__715_List_node_base9_M_unhookEv;
+ _ZNSt8__detail3__715_List_node_base10_M_reverseEv;
+ _ZNSt8__detail3__715_List_node_base11_M_transfer*;
+ _ZNSt8__detail3__715_List_node_base4swapER*;
# std::__convert_to_v
- _ZNSt2_614__convert_to_v*;
+ _ZNSt3__714__convert_to_v*;
# std::__copy_streambufs
- _ZNSt2_617__copy_streambufsI*;
- _ZNSt2_621__copy_streambufs_eofI*;
+ _ZNSt3__717__copy_streambufsI*;
+ _ZNSt3__721__copy_streambufs_eofI*;
# __gnu_cxx::__atomic_add
# __gnu_cxx::__exchange_and_add
- _ZN9__gnu_cxx2_612__atomic_addEPV[il][il];
- _ZN9__gnu_cxx2_618__exchange_and_addEPV[li][il];
+ _ZN9__gnu_cxx3__712__atomic_addEPV[il][il];
+ _ZN9__gnu_cxx3__718__exchange_and_addEPV[li][il];
# __gnu_cxx::__pool
- _ZN9__gnu_cxx2_66__poolILb[01]EE13_M_initializeEv;
- _ZN9__gnu_cxx2_66__poolILb[01]EE16_M_reserve_blockE[jm][jm];
- _ZN9__gnu_cxx2_66__poolILb[01]EE16_M_reclaim_blockEPc[jm];
- _ZN9__gnu_cxx2_66__poolILb[01]EE10_M_destroyEv;
- _ZN9__gnu_cxx2_66__poolILb1EE16_M_get_thread_idEv;
+ _ZN9__gnu_cxx3__76__poolILb[01]EE13_M_initializeEv;
+ _ZN9__gnu_cxx3__76__poolILb[01]EE16_M_reserve_blockE[jm][jm];
+ _ZN9__gnu_cxx3__76__poolILb[01]EE16_M_reclaim_blockEPc[jm];
+ _ZN9__gnu_cxx3__76__poolILb[01]EE10_M_destroyEv;
+ _ZN9__gnu_cxx3__76__poolILb1EE16_M_get_thread_idEv;
- _ZN9__gnu_cxx2_617__pool_alloc_base9_M_refillE[jm];
- _ZN9__gnu_cxx2_617__pool_alloc_base16_M_get_free_listE[jm];
- _ZN9__gnu_cxx2_617__pool_alloc_base12_M_get_mutexEv;
+ _ZN9__gnu_cxx3__717__pool_alloc_base9_M_refillE[jm];
+ _ZN9__gnu_cxx3__717__pool_alloc_base16_M_get_free_listE[jm];
+ _ZN9__gnu_cxx3__717__pool_alloc_base12_M_get_mutexEv;
- _ZN9__gnu_cxx2_69free_list6_M_getE[jm];
- _ZN9__gnu_cxx2_69free_list8_M_clearEv;
+ _ZN9__gnu_cxx3__79free_list6_M_getE[jm];
+ _ZN9__gnu_cxx3__79free_list8_M_clearEv;
# __gnu_cxx::stdio_sync_filebuf
- _ZTVN9__gnu_cxx2_618stdio_sync_filebufI[cw]St2_611char_traitsI[cw]EEE;
- _ZN9__gnu_cxx2_618stdio_sync_filebufI[cw]NSt2_611char_traitsI[cw]EEE[5-9]*;
+ _ZTVN9__gnu_cxx3__718stdio_sync_filebufI[cw]St3__711char_traitsI[cw]EEE;
+ _ZN9__gnu_cxx3__718stdio_sync_filebufI[cw]NSt3__711char_traitsI[cw]EEE[5-9]*;
# debug mode
_ZN11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;
@@ -212,7 +212,7 @@ CXXABI_2.0 {
_ZSt15_Fnv_hash_bytesPKv*;
# __gnu_cxx::_verbose_terminate_handler()
- _ZN9__gnu_cxx2_627__verbose_terminate_handlerEv;
+ _ZN9__gnu_cxx3__727__verbose_terminate_handlerEv;
# *_type_info classes, ctor and dtor
_ZN10__cxxabiv117__array_type_info*;
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 7409e64f9d5..5e5aa6a5810 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1298,7 +1298,7 @@ GLIBCXX_3.4.17 {
# std::chrono::steady_clock::now()
_ZNSt6chrono12steady_clock3nowEv;
- # std::numeric_limits<__int128_t> and <__uint128_t>
+ # std::numeric_limits<__int128> and <unsigned __int128>
_ZNSt14numeric_limitsInE*;
_ZNSt14numeric_limitsIoE*;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 48b7d1c1ea7..4fcf3d771c4 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -645,6 +645,7 @@ GLIBCXX_LDBL_COMPAT_FALSE
GLIBCXX_LDBL_COMPAT_TRUE
ENABLE_VISIBILITY_FALSE
ENABLE_VISIBILITY_TRUE
+libtool_VERSION
ENABLE_SYMVERS_SOL2_FALSE
ENABLE_SYMVERS_SOL2_TRUE
ENABLE_SYMVERS_SUN_FALSE
@@ -788,7 +789,6 @@ build_vendor
build_cpu
build
multi_basedir
-libtool_VERSION
target_alias
host_alias
build_alias
@@ -2825,10 +2825,6 @@ ac_config_headers="$ac_config_headers config.h"
# 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:17:0
-
-
# Find the rest of the source tree framework.
# Default to --enable-multilib
# Check whether --enable-multilib was given.
@@ -11504,7 +11500,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11507 "configure"
+#line 11503 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11610,7 +11606,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11613 "configure"
+#line 11609 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14968,7 +14964,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 14971 "configure"
+#line 14967 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -15336,7 +15332,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15339 "configure"
+#line 15335 "configure"
int main()
{
typedef bool atomic_type;
@@ -15373,7 +15369,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15376 "configure"
+#line 15372 "configure"
int main()
{
typedef short atomic_type;
@@ -15410,7 +15406,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15413 "configure"
+#line 15409 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15448,7 +15444,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15451 "configure"
+#line 15447 "configure"
int main()
{
typedef long long atomic_type;
@@ -15524,7 +15520,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15527 "configure"
+#line 15523 "configure"
int main()
{
_Decimal32 d1;
@@ -15566,7 +15562,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15554 "configure"
+#line 15565 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -15576,15 +15572,13 @@ template<typename T>
int main()
{
- typename same<long, __int128_t>::type i1;
- typename same<unsigned long, __uint128_t>::type u1;
- typename same<long long, __int128_t>::type i2;
- typename same<unsigned long long, __uint128_t>::type u2;
+ typename same<long, __int128>::type i1;
+ typename same<long long, __int128>::type i2;
}
EOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128_t and __uint128_t" >&5
-$as_echo_n "checking for __int128_t and __uint128_t... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
+$as_echo_n "checking for __int128... " >&6; }
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -15602,7 +15596,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15590 "configure"
+#line 15599 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -63988,7 +63982,6 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
-
# Check whether --enable-linux-futex was given.
if test "${enable_linux_futex+set}" = set; then :
enableval=$enable_linux_futex;
@@ -64514,7 +64507,6 @@ ac_config_commands="$ac_config_commands include/gstdint.h"
-# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU c++filt" >&5
$as_echo_n "checking for GNU c++filt... " >&6; }
@@ -64752,7 +64744,10 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
fi
fi
-# Everything parsed; figure out what file to use.
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=6:17:0
+
+# Everything parsed; figure out what files and settings to use.
case $enable_symvers in
no)
SYMVER_FILE=config/abi/pre/none.ver
@@ -64764,6 +64759,7 @@ $as_echo "#define _GLIBCXX_SYMVER_GNU 1" >>confdefs.h
;;
gnu-versioned-namespace)
+ libtool_VERSION=7:0:0
SYMVER_FILE=config/abi/pre/gnu-versioned-namespace.ver
$as_echo "#define _GLIBCXX_SYMVER_GNU_NAMESPACE 1" >>confdefs.h
@@ -64914,6 +64910,8 @@ fi
$as_echo "$glibcxx_ptrdiff_t_is_i" >&6; }
+
+
# Check whether --enable-visibility was given.
if test "${enable_visibility+set}" = set; then :
enableval=$enable_visibility;
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 8b528baaf97..eb2fe85a7c4 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -11,10 +11,6 @@ AC_CONFIG_HEADER(config.h)
# 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:17:0
-AC_SUBST(libtool_VERSION)
-
# Find the rest of the source tree framework.
AM_ENABLE_MULTILIB(, ..)
@@ -305,13 +301,13 @@ fi
# Check for _Unwind_GetIPInfo.
GCC_CHECK_UNWIND_GETIPINFO
-
GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
GCC_HEADER_STDINT(include/gstdint.h)
-# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
GLIBCXX_ENABLE_SYMVERS([yes])
+AC_SUBST(libtool_VERSION)
+
GLIBCXX_ENABLE_VISIBILITY([yes])
ac_ldbl_compat=no
diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
index 71b6e69f28c..81c05b9ea27 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -396,7 +396,7 @@ xml_image_basic = \
${xml_image_dir}/pbds_tree_node_invariants.png \
${xml_image_dir}/pbds_tree_node_updator_policy_cd.png \
${xml_image_dir}/pbds_trie_node_updator_policy_cd.png \
- ${xml_image_dir}/pbds_update_seq_diagram.png
+ ${xml_image_dir}/pbds_update_seq_diagram.png
xml_image_generated = \
${xml_image_dir}/pbds_binary_priority_queue_int_push_pop.png \
@@ -477,8 +477,9 @@ ${docbook_outdir}/fo:
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
+ mkdir -p ${docbook_outdir}/html/ext
mkdir -p ${docbook_outdir}/html/images
- mkdir -p ${docbook_outdir}/html/manual/ext
+ mkdir -p ${docbook_outdir}/html/manual
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
@@ -488,7 +489,6 @@ ${docbook_outdir}/texinfo:
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
- mkdir -p ${docbook_outdir}/xml/images
# Validate existing XML structure.
XMLLINT = xmllint
@@ -512,9 +512,6 @@ stamp-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml};
$(XMLLINT) $(XMLLINT_FLAGS) \
${top_srcdir}/doc/xml/spine.xml > ${set_xml};
- if [ ! -d "${docbook_outdir}/xml/images" ]; then \
- $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/xml/; \
- fi
$(STAMP) stamp-xml-single-docbook
doc-xml-single-docbook: stamp-xml-single-docbook
@@ -525,7 +522,7 @@ stamp-html-docbook-images: stamp-html-docbook $(xml_images)
$(STAMP) stamp-html-docbook-images
stamp-html-docbook-lwg: stamp-html-docbook $(xml_extra)
- $(INSTALL_DATA) $(xml_extra) ${docbook_outdir}/html/manual/ext
+ $(INSTALL_DATA) $(xml_extra) ${docbook_outdir}/html/ext
$(STAMP) stamp-html-docbook-lwg
stamp-html-docbook-data: stamp-html-docbook-images stamp-html-docbook-lwg
@@ -595,10 +592,14 @@ doc-texinfo-docbook: stamp-texinfo-docbook
doc-info-docbook: stamp-info-docbook
-# EPUB, via dbtoepub + ruby
+# EPUB, via ruby + dbtoepub
+# Can verify document with: epubcheck
manual_epub = ${docbook_outdir}/epub/libstdc++-manual.epub
stamp-epub-docbook: stamp-xml-single-docbook ${docbook_outdir}/epub
@echo "Generating epub files..."
+ if [ ! -d "${docbook_outdir}/images" ]; then \
+ $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/; \
+ fi
${XSL_STYLE_DIR}/epub/bin/dbtoepub -v -d -o ${manual_epub} ${set_xml}
$(STAMP) stamp-epub-docbook
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 7734453e40b..43045671ccd 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -449,7 +449,7 @@ xml_image_basic = \
${xml_image_dir}/pbds_tree_node_invariants.png \
${xml_image_dir}/pbds_tree_node_updator_policy_cd.png \
${xml_image_dir}/pbds_trie_node_updator_policy_cd.png \
- ${xml_image_dir}/pbds_update_seq_diagram.png
+ ${xml_image_dir}/pbds_update_seq_diagram.png
xml_image_generated = \
${xml_image_dir}/pbds_binary_priority_queue_int_push_pop.png \
@@ -549,7 +549,8 @@ DB2TEXI_FLAGS = \
--string-param explicit-node-names=true
-# EPUB, via dbtoepub + ruby
+# EPUB, via ruby + dbtoepub
+# Can verify document with: epubcheck
manual_epub = ${docbook_outdir}/epub/libstdc++-manual.epub
# Performance doc and graph configuration.
@@ -876,8 +877,9 @@ ${docbook_outdir}/fo:
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
+ mkdir -p ${docbook_outdir}/html/ext
mkdir -p ${docbook_outdir}/html/images
- mkdir -p ${docbook_outdir}/html/manual/ext
+ mkdir -p ${docbook_outdir}/html/manual
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
@@ -887,7 +889,6 @@ ${docbook_outdir}/texinfo:
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
- mkdir -p ${docbook_outdir}/xml/images
doc-xml-validate-docbook: $(xml_sources) $(xml_images)
@echo "Generating XML validation log..."
$(XMLLINT) $(XMLLINT_VALID_FLAGS) ${top_srcdir}/doc/xml/spine.xml
@@ -897,9 +898,6 @@ stamp-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml};
$(XMLLINT) $(XMLLINT_FLAGS) \
${top_srcdir}/doc/xml/spine.xml > ${set_xml};
- if [ ! -d "${docbook_outdir}/xml/images" ]; then \
- $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/xml/; \
- fi
$(STAMP) stamp-xml-single-docbook
doc-xml-single-docbook: stamp-xml-single-docbook
@@ -910,7 +908,7 @@ stamp-html-docbook-images: stamp-html-docbook $(xml_images)
$(STAMP) stamp-html-docbook-images
stamp-html-docbook-lwg: stamp-html-docbook $(xml_extra)
- $(INSTALL_DATA) $(xml_extra) ${docbook_outdir}/html/manual/ext
+ $(INSTALL_DATA) $(xml_extra) ${docbook_outdir}/html/ext
$(STAMP) stamp-html-docbook-lwg
stamp-html-docbook-data: stamp-html-docbook-images stamp-html-docbook-lwg
@@ -964,6 +962,9 @@ doc-texinfo-docbook: stamp-texinfo-docbook
doc-info-docbook: stamp-info-docbook
stamp-epub-docbook: stamp-xml-single-docbook ${docbook_outdir}/epub
@echo "Generating epub files..."
+ if [ ! -d "${docbook_outdir}/images" ]; then \
+ $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/; \
+ fi
${XSL_STYLE_DIR}/epub/bin/dbtoepub -v -d -o ${manual_epub} ${set_xml}
$(STAMP) stamp-epub-docbook
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index c70a8dfe731..feb596b299a 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library API Reference</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="spine.html" title="The GNU C++ Library"/><link rel="up" href="bk02.html" title=""/><link rel="prev" href="bk02.html" title=""/><link rel="next" href="bk03.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library API Reference</th></tr><tr><td align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"/><td align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr/></div><div class="article" title="The GNU C++ Library API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="api"/>The GNU C++ Library API Reference</h2></div><div><p class="copyright">Copyright ©
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library API Reference</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="index.html" title="The GNU C++ Library"/><link rel="up" href="bk02.html" title=""/><link rel="prev" href="bk02.html" title=""/><link rel="next" href="bk03.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library API Reference</th></tr><tr><td align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"/><td align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr/></div><div class="article" title="The GNU C++ Library API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="api"/>The GNU C++ Library API Reference</h2></div><div><p class="copyright">Copyright ©
2008
,
2010
<a class="link" href="http://www.fsf.org/">FSF
</a>
- </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id373498"/><p>
- <a class="link" href="manual/license.html" title="License">License
+ </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id548867"/><p>
+ <a class="link" href="manual/license.html" title="License">License
</a>
</p></div></div></div><hr/></div><p>
The GNU C++ library sources have been specially formatted so that
@@ -39,6 +39,9 @@
<a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.5/index.html">for the 4.5 release
</a>
</p></li><li class="listitem"><p>
+ <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.6/index.html">for the 4.6 release
+ </a>
+ </p></li><li class="listitem"><p>
<a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html">"the latest collection"
</a>
(For the main development tree; see the date on the first page.)
@@ -53,4 +56,4 @@
</p><p>
In addition, a rendered set of man pages are available in the same
location specified above. Start with C++Intro(3).
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk02.html">Up</a></td><td align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="spine.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk02.html">Up</a></td><td align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/bk02.html b/libstdc++-v3/doc/html/bk02.html
index 9c2d768c74b..f95372ebd79 100644
--- a/libstdc++-v3/doc/html/bk02.html
+++ b/libstdc++-v3/doc/html/bk02.html
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library"/><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility"/><link rel="next" href="api.html" title="The GNU C++ Library API Reference"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr/></div><div class="book"><div class="titlepage"><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td align="left" valign="top">Backwards Compatibility </td><td align="center"><a accesskey="h" href="spine.html">Home</a></td><td align="right" valign="top"> The GNU C++ Library API Reference</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library"/><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility"/><link rel="next" href="api.html" title="The GNU C++ Library API Reference"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr/></div><div class="book"><div class="titlepage"><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td align="left" valign="top">Backwards Compatibility </td><td align="center"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top"> The GNU C++ Library API Reference</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/bk03.html b/libstdc++-v3/doc/html/bk03.html
index 6d1d2e9aacb..5a73901a9c9 100644
--- a/libstdc++-v3/doc/html/bk03.html
+++ b/libstdc++-v3/doc/html/bk03.html
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library"/><link rel="prev" href="api.html" title="The GNU C++ Library API Reference"/><link rel="next" href="faq.html" title="Frequently Asked Questions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr/></div><div class="book"><div class="titlepage"><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library API Reference </td><td align="center"><a accesskey="h" href="spine.html">Home</a></td><td align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library"/><link rel="prev" href="api.html" title="The GNU C++ Library API Reference"/><link rel="next" href="faq.html" title="Frequently Asked Questions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr/></div><div class="book"><div class="titlepage"><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library API Reference </td><td align="center"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html
index 7667530732a..b4e05ed943f 100644
--- a/libstdc++-v3/doc/html/faq.html
+++ b/libstdc++-v3/doc/html/faq.html
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="spine.html" title="The GNU C++ Library"/><link rel="up" href="bk03.html" title=""/><link rel="prev" href="bk03.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"/><td align="right"> </td></tr></table><hr/></div><div class="article" title="Frequently Asked Questions"><div class="titlepage"><div><div><h1 class="title"><a id="faq"/>Frequently Asked Questions</h1></div><div><p class="copyright">Copyright ©
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="index.html" title="The GNU C++ Library"/><link rel="up" href="bk03.html" title=""/><link rel="prev" href="bk03.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"/><td align="right"> </td></tr></table><hr/></div><div class="article" title="Frequently Asked Questions"><div class="titlepage"><div><div><h1 class="title"><a id="faq"/>Frequently Asked Questions</h1></div><div><p class="copyright">Copyright ©
2008, 2010
<a class="link" href="http://www.fsf.org">FSF</a>
- </p></div></div><hr/></div><div class="qandaset" title="Frequently Asked Questions"><a id="id398779"/><dl><dt/><dd><dl><dt>1.1. <a href="faq.html#faq.what">
+ </p></div></div><hr/></div><div class="qandaset" title="Frequently Asked Questions"><a id="id522425"/><dl><dt/><dd><dl><dt>1.1. <a href="faq.html#faq.what">
What is libstdc++?
</a></dt><dt>1.2. <a href="faq.html#faq.why">
Why should I use libstdc++?
@@ -869,4 +869,4 @@
</p><p>
See <a class="link" href="manual/strings.html#strings.string.shrink" title="Shrink to Fit">Shrink-to-fit
strings</a> for a similar solution for strings.
- </p></td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk03.html">Up</a></td><td align="right"> </td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="spine.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
+ </p></td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk03.html">Up</a></td><td align="right"> </td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="index.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/images/confdeps.png b/libstdc++-v3/doc/html/images/confdeps.png
new file mode 100644
index 00000000000..55c07ba015e
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/confdeps.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_balls_and_bins.png b/libstdc++-v3/doc/html/images/pbds_balls_and_bins.png
new file mode 100644
index 00000000000..529c3ae41bc
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_balls_and_bins.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push.png b/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push.png
new file mode 100644
index 00000000000..601d60fda8c
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push_pop.png b/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push_pop.png
new file mode 100644
index 00000000000..93637b06c85
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_binary_priority_queue_int_push_pop.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_cc_hash_int_find.png b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_find.png
new file mode 100644
index 00000000000..ee3518799d1
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_find.png b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_find.png
new file mode 100644
index 00000000000..6c66291f51d
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_insert.png b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_insert.png
new file mode 100644
index 00000000000..ba8478084bb
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_cc_hash_int_subscript_insert.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_ccgp_hash_int_subscript_insert.png b/libstdc++-v3/doc/html/images/pbds_ccgp_hash_int_subscript_insert.png
new file mode 100644
index 00000000000..d36c47eb418
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_ccgp_hash_int_subscript_insert.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_container_tag_hierarchy.png b/libstdc++-v3/doc/html/images/pbds_container_tag_hierarchy.png
new file mode 100644
index 00000000000..f827f6e0b03
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_container_tag_hierarchy.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_1.png b/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_1.png
new file mode 100644
index 00000000000..adee1263600
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_1.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_2.png b/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_2.png
new file mode 100644
index 00000000000..9d84791fc0d
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_different_underlying_dss_2.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_embedded_lists_1.png b/libstdc++-v3/doc/html/images/pbds_embedded_lists_1.png
new file mode 100644
index 00000000000..9470a65b568
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_embedded_lists_1.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_embedded_lists_2.png b/libstdc++-v3/doc/html/images/pbds_embedded_lists_2.png
new file mode 100644
index 00000000000..d2ac91c1ab0
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_embedded_lists_2.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_embedded_lists_3.png b/libstdc++-v3/doc/html/images/pbds_embedded_lists_3.png
new file mode 100644
index 00000000000..08ecb0ffe16
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_embedded_lists_3.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_exception_hierarchy.png b/libstdc++-v3/doc/html/images/pbds_exception_hierarchy.png
new file mode 100644
index 00000000000..a7c33838253
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_exception_hierarchy.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_gp_hash_int_find.png b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_find.png
new file mode 100644
index 00000000000..66aa0481cdc
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_find.png b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_find.png
new file mode 100644
index 00000000000..d84733fe086
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_insert.png b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_insert.png
new file mode 100644
index 00000000000..27940fcd8be
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_gp_hash_int_subscript_insert.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_int_erase_mem.png b/libstdc++-v3/doc/html/images/pbds_hash_int_erase_mem.png
new file mode 100644
index 00000000000..d26ed8fd543
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_int_erase_mem.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_policy_cd.png b/libstdc++-v3/doc/html/images/pbds_hash_policy_cd.png
new file mode 100644
index 00000000000..f3122a112fc
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_policy_cd.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram.png b/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram.png
new file mode 100644
index 00000000000..5c37407dda6
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram2.png b/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram2.png
new file mode 100644
index 00000000000..87763caacc7
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_range_hashing_seq_diagram2.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_ranged_hash_range_hashing_fns.png b/libstdc++-v3/doc/html/images/pbds_hash_ranged_hash_range_hashing_fns.png
new file mode 100644
index 00000000000..5e0d7f4037b
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_ranged_hash_range_hashing_fns.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_text_find.png b/libstdc++-v3/doc/html/images/pbds_hash_text_find.png
new file mode 100644
index 00000000000..04c7eebb6e6
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_text_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_hash_zlob_int_find.png b/libstdc++-v3/doc/html/images/pbds_hash_zlob_int_find.png
new file mode 100644
index 00000000000..d4dac479c1c
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_hash_zlob_int_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram1.png b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram1.png
new file mode 100644
index 00000000000..f64764ec931
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram1.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram2.png b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram2.png
new file mode 100644
index 00000000000..e4645973eeb
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram2.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram3.png b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram3.png
new file mode 100644
index 00000000000..5535c5fe603
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_insert_resize_sequence_diagram3.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_invalidation_guarantee_erase.png b/libstdc++-v3/doc/html/images/pbds_invalidation_guarantee_erase.png
new file mode 100644
index 00000000000..940a27f7142
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_invalidation_guarantee_erase.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_invalidation_tag_hierarchy.png b/libstdc++-v3/doc/html/images/pbds_invalidation_tag_hierarchy.png
new file mode 100644
index 00000000000..570a70da969
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_invalidation_tag_hierarchy.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_list_update.png b/libstdc++-v3/doc/html/images/pbds_list_update.png
new file mode 100644
index 00000000000..7c96dcaf665
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_list_update.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_hash.png
new file mode 100644
index 00000000000..cb9000fa41c
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_tree.png
new file mode 100644
index 00000000000..12d062dbc05
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_large_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_hash.png
new file mode 100644
index 00000000000..7c387198e2f
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_tree.png
new file mode 100644
index 00000000000..2066376ee58
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_find_small_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_hash.png
new file mode 100644
index 00000000000..09afca29a68
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_tree.png
new file mode 100644
index 00000000000..a063d4b0934
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_large_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_hash.png
new file mode 100644
index 00000000000..01b0884c163
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_tree.png
new file mode 100644
index 00000000000..f88c9b9aa40
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_large_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_hash.png
new file mode 100644
index 00000000000..a5c8cf60293
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_tree.png
new file mode 100644
index 00000000000..88b59ae4c0e
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_mem_small_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_hash.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_hash.png
new file mode 100644
index 00000000000..9cf2a8e8d1a
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_hash.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_tree.png b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_tree.png
new file mode 100644
index 00000000000..b851d21499d
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_multimap_text_insert_small_s2p_tree.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_node_invariants.png b/libstdc++-v3/doc/html/images/pbds_node_invariants.png
new file mode 100644
index 00000000000..b375f5168d7
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_node_invariants.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_down_thin.png b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_down_thin.png
new file mode 100644
index 00000000000..3f56eebb083
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_down_thin.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_up_thin.png b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_up_thin.png
new file mode 100644
index 00000000000..c647e4f5510
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_modify_up_thin.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push.png b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push.png
new file mode 100644
index 00000000000..9f7498a5f3e
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push_pop.png b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push_pop.png
new file mode 100644
index 00000000000..b56a35e17b5
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_pairing_priority_queue_text_push_pop.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_pat_trie.png b/libstdc++-v3/doc/html/images/pbds_pat_trie.png
new file mode 100644
index 00000000000..e7129a1a67b
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_pat_trie.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_point_iterator_hierarchy.png b/libstdc++-v3/doc/html/images/pbds_point_iterator_hierarchy.png
new file mode 100644
index 00000000000..25a69fc6e8b
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_point_iterator_hierarchy.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_1.png b/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_1.png
new file mode 100644
index 00000000000..c5bc8e5d6c0
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_1.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_2.png b/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_2.png
new file mode 100644
index 00000000000..c3f94ee93bc
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_point_iterators_range_ops_2.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_different_underlying_dss.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_different_underlying_dss.png
new file mode 100644
index 00000000000..9d84791fc0d
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_different_underlying_dss.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push.png
new file mode 100644
index 00000000000..fdc53c76258
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push_pop.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push_pop.png
new file mode 100644
index 00000000000..56c841d5ece
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_int_push_pop.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_tag_hierarchy.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_tag_hierarchy.png
new file mode 100644
index 00000000000..3a849d2d741
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_tag_hierarchy.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_join.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_join.png
new file mode 100644
index 00000000000..5c3073d8f46
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_join.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_down.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_down.png
new file mode 100644
index 00000000000..931812d13b0
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_down.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_up.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_up.png
new file mode 100644
index 00000000000..e8e76549e0d
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_modify_up.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_pop_mem.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_pop_mem.png
new file mode 100644
index 00000000000..741aa8b94ef
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_pop_mem.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push.png
new file mode 100644
index 00000000000..0107d473ea7
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push_pop.png b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push_pop.png
new file mode 100644
index 00000000000..5da52c3def3
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_priority_queue_text_push_pop.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_rationale_null_node_updator.png b/libstdc++-v3/doc/html/images/pbds_rationale_null_node_updator.png
new file mode 100644
index 00000000000..43874891517
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_rationale_null_node_updator.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_resize_policy_cd.png b/libstdc++-v3/doc/html/images/pbds_resize_policy_cd.png
new file mode 100644
index 00000000000..338e33c15cc
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_resize_policy_cd.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_restoring_node_invariants.png b/libstdc++-v3/doc/html/images/pbds_restoring_node_invariants.png
new file mode 100644
index 00000000000..33ba84bfe33
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_restoring_node_invariants.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_simple_list.png b/libstdc++-v3/doc/html/images/pbds_simple_list.png
new file mode 100644
index 00000000000..9a05d3f5e4f
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_simple_list.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_int_find.png b/libstdc++-v3/doc/html/images/pbds_tree_int_find.png
new file mode 100644
index 00000000000..31bd80c5d87
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_int_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_node_invalidations.png b/libstdc++-v3/doc/html/images/pbds_tree_node_invalidations.png
new file mode 100644
index 00000000000..bbd91842ba8
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_node_invalidations.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_node_invariants.png b/libstdc++-v3/doc/html/images/pbds_tree_node_invariants.png
new file mode 100644
index 00000000000..b375f5168d7
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_node_invariants.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_node_updator_policy_cd.png b/libstdc++-v3/doc/html/images/pbds_tree_node_updator_policy_cd.png
new file mode 100644
index 00000000000..5cae5781a18
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_node_updator_policy_cd.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_order_statistics.png b/libstdc++-v3/doc/html/images/pbds_tree_order_statistics.png
new file mode 100644
index 00000000000..76177087f3c
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_order_statistics.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_split_join.png b/libstdc++-v3/doc/html/images/pbds_tree_split_join.png
new file mode 100644
index 00000000000..dcbc2dbe0c3
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_split_join.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_text_find.png b/libstdc++-v3/doc/html/images/pbds_tree_text_find.png
new file mode 100644
index 00000000000..ce4e606f756
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_text_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_text_insert_node.png b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_node.png
new file mode 100644
index 00000000000..4ec35d4b709
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_node.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_text_insert_trie.png b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_trie.png
new file mode 100644
index 00000000000..3420298ce48
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_trie.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_text_insert_vector.png b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_vector.png
new file mode 100644
index 00000000000..cdb367ef605
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_text_insert_vector.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_tree_text_lor_find.png b/libstdc++-v3/doc/html/images/pbds_tree_text_lor_find.png
new file mode 100644
index 00000000000..acc4a6f274c
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_tree_text_lor_find.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_trie_node_updator_policy_cd.png b/libstdc++-v3/doc/html/images/pbds_trie_node_updator_policy_cd.png
new file mode 100644
index 00000000000..4376929ec28
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_trie_node_updator_policy_cd.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/images/pbds_update_seq_diagram.png b/libstdc++-v3/doc/html/images/pbds_update_seq_diagram.png
new file mode 100644
index 00000000000..880a50edf8e
--- /dev/null
+++ b/libstdc++-v3/doc/html/images/pbds_update_seq_diagram.png
Binary files differ
diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html
index b3b2ee69d6c..33e5ea69f33 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -1,43 +1,168 @@
-<html>
-
-<head>
-<title>The GNU C++ Library Documentation</title>
-</head>
-
-<body>
-
-<!-- ==================================================================== -->
-
-
-<div>
-<h1>The GNU C++ Library Documentation</h1>
-
-<p>Copyright 2008, 2009 FSF</p>
-
-<p>
- 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 no Invariant Sections, with no
- Front-Cover Texts, and with no Back-Cover Texts.
-</p>
-<p>
- This is the top level of the libstdc++ documentation tree.
- The documentation is contained in three logically separate
- documents, as listed in the following Table of Contents.
-</p>
-</div>
-
-<div>
-<p><b>Table of Contents</b></p>
-<dl>
-<dt><a href="manual/spine.html">Manual</a></dt>
-<dt><a href="faq.html">Frequently Asked Questions</a></dt>
-<dt><a href="api.html">API and Source Documentation</a></dt>
-</dl>
-</div>
-
-</body>
-</html>
-
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="description" content="Short Contents Copyright 2008, 2009, 2011 FSF 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 no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set. The documentation is divided into the following three sections. Manual Frequently Asked Questions API and Source Documentation"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="index.html" title="The GNU C++ Library"/><link rel="next" href="manual/index.html" title="The GNU C++ Library Manual"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td align="left"> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr></table><hr/></div><div class="set" title="The GNU C++ Library" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"/>The GNU C++ Library</h1></div><div><div class="abstract" title="Short Contents"><a id="contents"/><p class="title"><strong>Short Contents</strong></p><p>
+ Copyright 2008, 2009, 2011
+ <a class="link" href="http://www.fsf.org/">FSF
+ </a>
+ </p><p>
+ 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 no Invariant Sections, with no
+ Front-Cover Texts, and with no Back-Cover Texts.
+ </p><p>
+ This is the top level of the libstdc++ documentation set. The
+ documentation is divided into the following three sections.
+ </p><p>
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <a class="link" href="manual/index.html" title="The GNU C++ Library Manual">Manual</a>
+ </p></li><li class="listitem"><p>
+ <a class="link" href="faq.html" title="Frequently Asked Questions">Frequently Asked Questions</a>
+ </p></li><li class="listitem"><p>
+ <a class="link" href="api.html" title="The GNU C++ Library API Reference">API and Source Documentation</a>
+ </p></li></ul></div><p>
+ </p></div></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="book"><a href="manual/index.html">The GNU C++ Library Manual</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
+ Introduction
+
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="manual/status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="manual/status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="section"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt02.html">II.
+ Standard Contents
+ </a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/support.html">4.
+ Support
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="manual/support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="manual/support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="manual/support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="manual/termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="manual/termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="manual/termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/diagnostics.html">5.
+ Diagnostics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/utilities.html">6.
+ Utilities
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="manual/memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="manual/memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="manual/memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="manual/memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
+ Strings
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/localization.html">8.
+ Localization
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="manual/localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="manual/localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="manual/facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="manual/facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="manual/facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
+ Containers
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="manual/containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="manual/associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10.
+ Iterators
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/algorithms.html">11.
+ Algorithms
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="manual/algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="manual/algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/numerics.html">12.
+ Numerics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="manual/numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="manual/numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/io.html">13.
+ Input and Output
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="manual/streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="manual/streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="manual/stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="manual/stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="manual/fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="manual/fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="manual/fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="manual/io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="manual/io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/atomics.html">14.
+ Atomics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/atomics.html#std.atomics.api">API Reference</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/concurrency.html">15.
+ Concurrency
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/extensions.html">III.
+ Extensions
+
+</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="manual/ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+ debug-mode components</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="manual/profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/mt_allocator.html">20. The mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="manual/mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch20s02.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch20s02.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch20s03.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch20s03.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch20s03.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch20s03.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch20s04.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch20s05.html">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bitmap_allocator.html">21. The bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/policy_data_structures.html">22. Policy-Based Data Structures</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.tutorial.configuring">
+ Configuring via Template Parameters
+ </a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.tutorial.traits">
+ Querying Container Attributes
+ </a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.tutorial.point_range_iteration">
+ Point and Range Iteration
+ </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.basic">Intermediate Use</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.query">Querying with <code class="classname">container_traits</code> </a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.container">By Container Method</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.container.hash">Hash-Based</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.container.branch">Branch-Based</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_using.html#pbds.using.examples.container.priority_queue">Priority Queues</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts">Concepts</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts.null_type">Null Policy Classes</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts.associative_semantics">Map and Set Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.associative_semantics.set_vs_map">
+ Distinguishing Between Maps and Sets
+ </a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.associative_semantics.multi">Alternatives to <code class="classname">std::multiset</code> and <code class="classname">std::multimap</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts.iterator_semantics">Iterator Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.iterator_semantics.point_and_range">Point and Range Iterators</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.iterator_semantics.both">Distinguishing Point and Range Iterators</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts.invalidation">Invalidation Guarantees</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.concepts.genericity">Genericity</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.genericity.tag">Tag</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#concepts.genericity.traits">Traits</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container">By Container</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container.hash">hash</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.hash.interface">Interface</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.hash.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container.tree">tree</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.tree.interface">Interface</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.tree.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container.trie">Trie</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.trie.interface">Interface</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.trie.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container.list">List</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.list.interface">Interface</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.list.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_design.html#pbds.design.container.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.priority_queue.interface">Interface</a></span></dt><dt><span class="section"><a href="manual/policy_data_structures_design.html#container.priority_queue.details">Details</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#pbds.test.regression">Regression</a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#pbds.test.performance">Performance</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash">Hash-Based</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.int_find">
+ Integer <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.int_subscript_find">
+ Integer Subscript <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.int_subscript_insert">
+ Integer Subscript <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.zlob_int_find">
+ Integer <code class="function">find</code> with Skewed-Distribution
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.hash.erase_mem">
+ Erase Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch">Branch-Based</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch.text_insert">
+ Text <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch.text_lor_find">
+ Text <code class="function">find</code> with Locality-of-Reference
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch.split_join">
+ <code class="function">split</code> and <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.branch.order_statistics">
+ Order-Statistics
+ </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap">Multimap</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_find_small">
+ Text <code class="function">find</code> with Small Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_find_large">
+ Text <code class="function">find</code> with Large Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_insert_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_insert_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_insert_mem_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.multimap.text_insert_mem_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_push">
+ Text <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_push_pop">
+ Text <code class="function">push</code> and <code class="function">pop</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.int_push">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.int_push_pop">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_pop">
+ Text <code class="function">pop</code> Memory Use
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_join">
+ Text <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_modify_up">
+ Text <code class="function">modify</code> Up
+ </a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
+ Text <code class="function">modify</code> Down
+ </a></span></dt></dl></dd><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="manual/policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/policy_data_structures_biblio.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="manual/policy_data_structures.html#pbds.biblio">
+ Bibliography
+ </a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch23s02.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch30s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch30s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch30s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch30s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt04.html">IV.
+ Appendices
+</a></span></dt><dd><dl><dt><span class="appendix"><a href="manual/appendix_contributing.html">A.
+ Contributing
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="manual/source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="manual/source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="manual/source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="manual/source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="manual/source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/appendix_porting.html">B.
+ Porting and Maintenance
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="manual/documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="manual/documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="manual/documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="manual/documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="manual/test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="manual/test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="manual/test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="manual/test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="manual/test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="manual/test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="manual/test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.exception.safety">
+ Qualifying Exception Safety Guarantees
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="manual/test.html#test.exception.safety.status">
+ Existing tests
+</a></span></dt><dt><span class="section"><a href="manual/test.html#test.exception.safety.containers">
+C++0x Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710603">No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="manual/backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711092">
+ Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
+ extensions
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711664">
+No <code class="code">stream::attach(int fd)</code>
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711732">
+Support for C++98 dialect.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711760">
+Support for C++TR1 dialect.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711804">
+Support for C++0x dialect.
+</a></span></dt><dt><span class="section"><a href="manual/backwards.html#id711882">
+ Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C.
+ Free Software Needs Free Documentation
+
+</a></span></dt><dt><span class="appendix"><a href="manual/appendix_gpl.html">D.
+ <acronym class="acronym">GNU</acronym> General Public License version 3
+ </a></span></dt><dt><span class="appendix"><a href="manual/appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></dd><dt><span class="book"><a href="bk02.html"/></span></dt><dd><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"/></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"> </td><td align="right" valign="top"> The GNU C++ Library Manual</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index 436be2d5e85..dd3e011b0b0 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; , &#10; compatibility&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="test.html" title="Test"/><link rel="next" href="api.html" title="API Evolution and Deprecation History"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; , &#10; compatibility&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="test.html" title="Test"/><link rel="next" href="api.html" title="API Evolution and Deprecation History"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr/></div><div class="section" title="ABI Policy and Guidelines"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.abi"/>ABI Policy and Guidelines</h2></div></div></div><p>
@@ -482,41 +482,51 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="link" href="http://gcc.gnu.org/PR24660">24660: versioning weak symbols in libstdc++</a>
</p><p>
<a class="link" href="http://gcc.gnu.org/PR19664">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a>
-</p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id491668"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
- ABIcheck, a vague idea of checking ABI compatibility
- </em>. </span></p></div><div class="biblioentry"><a id="id491685"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
- C++ ABI Reference
- </em>. </span></p></div><div class="biblioentry"><a id="id491703"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+</p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="ABIcheck"><a id="biblio.abicheck"/><p>[biblio.abicheck] <span class="title"><em>
+ <a class="link" href="http://abicheck.sourceforge.net">
+ ABIcheck
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="C++ ABI Summary"><a id="biblio.cxxabi"/><p>[biblio.cxxabi] <span class="title"><em>
+ <a class="link" href="http://www.codesourcery.com/public/cxx-abi">
+ C++ ABI Summary
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="Intel Compilers for Linux Compatibility with the GNU Compilers"><a id="id708142"/><p><span class="title"><em>
+ <a class="link" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm">
Intel Compilers for Linux Compatibility with the GNU Compilers
- </em>. </span></p></div><div class="biblioentry"><a id="id491720"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="Linker and Libraries Guide (document 819-0690)"><a id="id708158"/><p><span class="title"><em>
+ <a class="link" href="http://download.oracle.com/docs/cd/E19963-01/html/819-0690/index.html">
Linker and Libraries Guide (document 819-0690)
- </em>. </span></p></div><div class="biblioentry"><a id="id491738"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="Sun Studio 11: C++ Migration Guide (document 819-3689)"><a id="id708173"/><p><span class="title"><em>
+ <a class="link" href="http://download.oracle.com/docs/cd/E19422-01/819-3689/index.html">
Sun Studio 11: C++ Migration Guide (document 819-3689)
- </em>. </span></p></div><div class="biblioentry"><a id="id491756"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="How to Write Shared Libraries"><a id="id708189"/><p><span class="title"><em>
+ <a class="link" href="http://www.akkadia.org/drepper/dsohowto.pdf">
How to Write Shared Libraries
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="id491787"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry" title="C++ ABI for the ARM Architecture"><a id="id708217"/><p><span class="title"><em>
+ <a class="link" href="http://www.arm.com/miscPDFs/8033.pdf">
C++ ABI for the ARM Architecture
- </em>. </span></p></div><div class="biblioentry"><a id="id491804"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="Dynamic Shared Objects: Survey and Issues"><a id="id708232"/><p><span class="title"><em>
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html">
Dynamic Shared Objects: Survey and Issues
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
ISO C++ J16/06-0046
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id491834"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Versioning With Namespaces"><a id="id708260"/><p><span class="title"><em>
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html">
Versioning With Namespaces
+ </a>
</em>. </span><span class="subtitle">
ISO C++ J16/06-0083
- . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="id491863"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry" title="Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems"><a id="id708287"/><p><span class="title"><em>
+ <a class="link" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf">
Binary Compatibility of Shared Libraries Implemented in C++
on GNU/Linux Systems
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
SYRCoSE 2009
- . </span><span class="author"><span class="firstname">Pavel</span> <span class="surname">Shved</span>. </span><span class="author"><span class="firstname">Denis</span> <span class="surname">Silakov</span>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="test.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td align="left" valign="top">Test </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> API Evolution and Deprecation History</td></tr></table></div></body></html>
+ . </span><span class="author"><span class="firstname">Pavel</span> <span class="surname">Shved</span>. </span><span class="author"><span class="firstname">Denis</span> <span class="surname">Silakov</span>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="test.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td align="left" valign="top">Test </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> API Evolution and Deprecation History</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/algorithms.html b/libstdc++-v3/doc/html/manual/algorithms.html
index 8cf55cf8651..dfbb967653d 100644
--- a/libstdc++-v3/doc/html/manual/algorithms.html
+++ b/libstdc++-v3/doc/html/manual/algorithms.html
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 11.  Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="iterators.html" title="Chapter 10.  Iterators"/><link rel="next" href="numerics.html" title="Chapter 12.  Numerics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 11.  Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="iterators.html" title="Chapter 10.  Iterators"/><link rel="next" href="numerics.html" title="Chapter 12.  Numerics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. 
Algorithms
</th></tr><tr><td align="left"><a accesskey="p" href="iterators.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 11.  Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="std.algorithms"/>Chapter 11. 
Algorithms
- <a id="id470215" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt></dl></dd></dl></div><p>
+ <a id="id652390" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div><p>
The neatest accomplishment of the algorithms sect1 is that all the
work is done via iterators, not containers directly. This means two
important things:
@@ -55,7 +55,7 @@
</p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="iterators.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 10. 
Iterators
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 12. 
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 12. 
Numerics
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index cd9541d01ba..59ca7bca99f 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="ISO C++, api, evolution, deprecation, history"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="abi.html" title="ABI Policy and Guidelines"/><link rel="next" href="backwards.html" title="Backwards Compatibility"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="ISO C++, api, evolution, deprecation, history"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="abi.html" title="ABI Policy and Guidelines"/><link rel="next" href="backwards.html" title="Backwards Compatibility"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr></table><hr/></div><div class="section" title="API Evolution and Deprecation History"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.api"/>API Evolution and Deprecation History</h2></div></div></div><p>
@@ -75,11 +75,11 @@ _Alloc_traits</code> have been removed.
<span class="type">__alloc</span> to select an underlying allocator that
satisfied memory allocation requests. The selection of this
underlying allocator was not user-configurable.
- </p><div class="table"><a id="id492424"/><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Allocator (3.4)</th><th style="text-align: left">Header (3.4)</th><th style="text-align: left">Allocator (3.[0-3])</th><th style="text-align: left">Header (3.[0-3])</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__new_alloc</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr></tbody></table></div></div><br class="table-break"/><p> Releases after gcc-3.4 have continued to add to the collection
+ </p><div class="table"><a id="id708847"/><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Allocator (3.4)</th><th style="text-align: left">Header (3.4)</th><th style="text-align: left">Allocator (3.[0-3])</th><th style="text-align: left">Header (3.[0-3])</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__new_alloc</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td style="text-align: left"><code class="filename">memory</code></td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr></tbody></table></div></div><br class="table-break"/><p> Releases after gcc-3.4 have continued to add to the collection
of available allocators. All of these new allocators are
standard-style. The following table includes details, along with
the first released version of GCC that included the extension allocator.
- </p><div class="table"><a id="id492654"/><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left">Allocator</th><th style="text-align: left">Include</th><th style="text-align: left">Version</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left">4.0.0</td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left">4.2.0</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id709077"/><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left">Allocator</th><th style="text-align: left">Include</th><th style="text-align: left">Version</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left">4.0.0</td></tr><tr><td style="text-align: left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left">4.2.0</td></tr></tbody></table></div></div><br class="table-break"/><p>
Debug mode first appears.
</p><p>
Precompiled header support <acronym class="acronym">PCH</acronym> support.
@@ -237,4 +237,4 @@ The default behavior for comparing typeinfo names changed, so
in <code class="filename">typeinfo</code>, <code class="literal">__GXX_MERGED_TYPEINFO_NAMES</code>
now defaults to zero.
</p><p> Extensions modified: <code class="filename">ext/throw_allocator.h</code>.
-</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td align="left" valign="top">ABI Policy and Guidelines </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td align="left" valign="top">ABI Policy and Guidelines </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index bbf124164d2..0aefd110331 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
Contributing
</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt04.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix A.  Contributing"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.contrib"/>
Contributing
- <a id="id483220" class="indexterm"/>
+ <a id="id699646" class="indexterm"/>
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
The GNU C++ Library follows an open development model. Active
contributors are assigned maintainer-ship responsibility, and given
@@ -114,4 +114,4 @@
libstdc++ mailing list.
</p></li></ul></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt04.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr><tr><td align="left" valign="top">Part IV. 
Appendices
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Directory Layout and Source Conventions</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Directory Layout and Source Conventions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_free.html b/libstdc++-v3/doc/html/manual/appendix_free.html
index 8449abb6184..7174e48ae93 100644
--- a/libstdc++-v3/doc/html/manual/appendix_free.html
+++ b/libstdc++-v3/doc/html/manual/appendix_free.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="backwards.html" title="Backwards Compatibility"/><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="backwards.html" title="Backwards Compatibility"/><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. 
Free Software Needs Free Documentation
</th></tr><tr><td align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix C.  Free Software Needs Free Documentation"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.free"/>
Free Software Needs Free Documentation
- <a id="id495593" class="indexterm"/>
+ <a id="id712010" class="indexterm"/>
</h1></div></div></div><p>
The biggest deficiency in free operating systems is not in the
software--it is the lack of good free manuals that we can include in
@@ -121,6 +121,6 @@ prefer copylefted manuals to non-copylefted ones.
that lists free books available from other publishers</a>].
</p><p>Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</p><p>Verbatim copying and distribution of this entire article are
permitted worldwide, without royalty, in any medium, provided this
-notice is preserved.</p><p>Report any problems or suggestions to <code class="email">&lt;<a class="email" href="mailto:webmaster@fsf.org">webmaster@fsf.org</a>&gt;</code>.</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr><tr><td align="left" valign="top">Backwards Compatibility </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Appendix D. 
+notice is preserved.</p><p>Report any problems or suggestions to <code class="email">&lt;<a class="email" href="mailto:webmaster@fsf.org">webmaster@fsf.org</a>&gt;</code>.</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr><tr><td align="left" valign="top">Backwards Compatibility </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Appendix D. 
<acronym class="acronym">GNU</acronym> General Public License version 3
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_gfdl.html b/libstdc++-v3/doc/html/manual/appendix_gfdl.html
index 9a46f18d112..dc1088a241f 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gfdl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gfdl.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3"/><link rel="next" href="../bk02.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">Part IV. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3"/><link rel="next" href="../bk02.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix E. GNU Free Documentation License"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.gfdl-1.3"/>GNU Free Documentation License</h1></div></div></div><p>Version 1.3, 3 November 2008</p><p>
Copyright © 2000, 2001, 2002, 2007, 2008
@@ -446,4 +446,4 @@ being LIST, and with the Back-Cover Texts being LIST.</pre><p>
use in free software.
</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr><tr><td align="left" valign="top">Appendix D. 
<acronym class="acronym">GNU</acronym> General Public License version 3
-  </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
+  </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_gpl.html b/libstdc++-v3/doc/html/manual/appendix_gpl.html
index 376ac4ebd30..348d6fad2ca 100644
--- a/libstdc++-v3/doc/html/manual/appendix_gpl.html
+++ b/libstdc++-v3/doc/html/manual/appendix_gpl.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation"/><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation"/><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D. 
<acronym class="acronym">GNU</acronym> General Public License version 3
</th></tr><tr><td align="left"><a accesskey="p" href="appendix_free.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
@@ -78,7 +78,7 @@
</p><p>
The precise terms and conditions for copying, distribution and modification
follow.
- </p><h2><a id="id495933"/>
+ </p><h2><a id="id712349"/>
TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"/>
0. Definitions.
@@ -619,7 +619,7 @@
waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in
return for a fee.
- </p><h2><a id="id496756"/>
+ </p><h2><a id="id713173"/>
END OF TERMS AND CONDITIONS
</h2><h2><a id="HowToApply"/>
How to Apply These Terms to Your New Programs
@@ -680,4 +680,4 @@ under certain conditions; type ‘<code class="literal">show c</code>’ for det
</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="appendix_free.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_gfdl.html">Next</a></td></tr><tr><td align="left" valign="top">Appendix C. 
Free Software Needs Free Documentation
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Appendix E. GNU Free Documentation License</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Appendix E. GNU Free Documentation License</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/appendix_porting.html b/libstdc++-v3/doc/html/manual/appendix_porting.html
index 9fc23776388..b2b0d387314 100644
--- a/libstdc++-v3/doc/html/manual/appendix_porting.html
+++ b/libstdc++-v3/doc/html/manual/appendix_porting.html
@@ -1,14 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix B.  Porting and Maintenance</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="source_design_notes.html" title="Design Notes"/><link rel="next" href="documentation_hacking.html" title="Writing and Generating Documentation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix B.  Porting and Maintenance</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt04.html" title="Part IV.  Appendices"/><link rel="prev" href="source_design_notes.html" title="Design Notes"/><link rel="next" href="documentation_hacking.html" title="Writing and Generating Documentation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. 
Porting and Maintenance
</th></tr><tr><td align="left"><a accesskey="p" href="source_design_notes.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Appendices
</th><td align="right"> <a accesskey="n" href="documentation_hacking.html">Next</a></td></tr></table><hr/></div><div class="appendix" title="Appendix B.  Porting and Maintenance"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.porting"/>
Porting and Maintenance
- <a id="id484338" class="indexterm"/>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></div><div class="section" title="Configure and Build Hacking"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.build_hacking"/>Configure and Build Hacking</h2></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"/>Prerequisites</h3></div></div></div><p>
+ <a id="id700765" class="indexterm"/>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
+ Qualifying Exception Safety Guarantees
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
+ Existing tests
+</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
+C++0x Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+ Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
+ extensions
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+No <code class="code">stream::attach(int fd)</code>
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+Support for C++98 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+Support for C++TR1 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
+Support for C++0x dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
+ Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt></dl></dd></dl></dd></dl></div><div class="section" title="Configure and Build Hacking"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.build_hacking"/>Configure and Build Hacking</h2></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.prereq"/>Prerequisites</h3></div></div></div><p>
As noted <a class="link" href="http://gcc.gnu.org/install/prerequisites.html">previously</a>,
certain other tools are necessary for hacking on files that
control configure (<code class="code">configure.ac</code>,
@@ -19,7 +41,7 @@
in GCC try to stay in sync with each other in terms of versions of
the auto-tools used, so please try to play nicely with the
neighbors.
- </p></div><div class="section" title="Overview: What Comes from Where"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.map"/>Overview: What Comes from Where</h3></div></div></div><div class="figure"><a id="id484470"/><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="/mnt/share/src/gcc.svn-trunk/libstdc++-v3/doc/xml/images/confdeps.png" style="text-align: middle" alt="Dependency Graph for Configure and Build Files"/></div></div></div><br class="figure-break"/><p>
+ </p></div><div class="section" title="Overview: What Comes from Where"><div class="titlepage"><div><div><h3 class="title"><a id="build_hacking.map"/>Overview: What Comes from Where</h3></div></div></div><div class="figure"><a id="id700897"/><p class="title"><strong>Figure B.1. Configure and Build File Dependencies</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/confdeps.png" style="text-align: middle" alt="Dependency Graph for Configure and Build Files"/></div></div></div><br class="figure-break"/><p>
Regenerate all generated files by using the command sequence
<code class="code">"autoreconf"</code> at the top level of the libstdc++ source
directory. The following will also work, but is much more complex:
@@ -227,4 +249,4 @@
argument checking at all is done in this signature. See
GLIBCXX_ENABLE_CXX_FLAGS for an example of handling, and an error
message.
-</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_design_notes.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="documentation_hacking.html">Next</a></td></tr><tr><td align="left" valign="top">Design Notes </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Writing and Generating Documentation</td></tr></table></div></body></html>
+</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_design_notes.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt04.html">Up</a></td><td align="right"> <a accesskey="n" href="documentation_hacking.html">Next</a></td></tr><tr><td align="left" valign="top">Design Notes </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Writing and Generating Documentation</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/associative.html b/libstdc++-v3/doc/html/manual/associative.html
index 351ec9402ee..587b75643b9 100644
--- a/libstdc++-v3/doc/html/manual/associative.html
+++ b/libstdc++-v3/doc/html/manual/associative.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="containers.html" title="Chapter 9.  Containers"/><link rel="prev" href="containers.html" title="Chapter 9.  Containers"/><link rel="next" href="containers_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Associative</th></tr><tr><td align="left"><a accesskey="p" href="containers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="containers.html" title="Chapter 9.  Containers"/><link rel="prev" href="containers.html" title="Chapter 9.  Containers"/><link rel="next" href="containers_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Associative</th></tr><tr><td align="left"><a accesskey="p" href="containers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
Containers
</th><td align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr/></div><div class="section" title="Associative"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers.associative"/>Associative</h2></div></div></div><div class="section" title="Insertion Hints"><div class="titlepage"><div><div><h3 class="title"><a id="containers.associative.insert_hints"/>Insertion Hints</h3></div></div></div><p>
@@ -168,7 +168,7 @@
author would love to hear from you...
</p><p>
Also note that the implementation of bitset used in libstdc++ has
- <a class="link" href="bk01pt03ch21s02.html" title="HP/SGI">some extensions</a>.
+ <a class="link" href="ext_containers.html#manual.ext.containers.sgi" title="Backwards Compatibility">some extensions</a>.
</p></div><div class="section" title="Type String"><div class="titlepage"><div><div><h4 class="title"><a id="associative.bitset.type_string"/>Type String</h4></div></div></div><p>
</p><p>
Bitmasks do not take char* nor const char* arguments in their
@@ -189,4 +189,4 @@
</pre></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="containers.html">Prev</a> </td><td align="center"><a accesskey="u" href="containers.html">Up</a></td><td align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 9. 
Containers
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/atomics.html b/libstdc++-v3/doc/html/manual/atomics.html
index 1a24059a904..d22415ab3cd 100644
--- a/libstdc++-v3/doc/html/manual/atomics.html
+++ b/libstdc++-v3/doc/html/manual/atomics.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 14.  Atomics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; atomic&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="io_and_c.html" title="Interacting with C"/><link rel="next" href="concurrency.html" title="Chapter 15.  Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 14.  Atomics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; atomic&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="io_and_c.html" title="Interacting with C"/><link rel="next" href="concurrency.html" title="Chapter 15.  Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. 
Atomics
</th></tr><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 14.  Atomics"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics"/>Chapter 14. 
Atomics
- <a id="id471867" class="indexterm"/>
+ <a id="id654041" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
Facilities for atomic operations.
</p><div class="section" title="API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics.api"/>API Reference</h2></div></div></div><p>
@@ -25,7 +25,7 @@
<code class="classname">atomic&lt;int&gt;</code>.
</p><p>
Full API details.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 15. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 15. 
Concurrency
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index 2497438a1e9..fa7d92cd311 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Backwards Compatibility</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; backwards&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="api.html" title="API Evolution and Deprecation History"/><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Backwards Compatibility</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; backwards&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="api.html" title="API Evolution and Deprecation History"/><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr></table><hr/></div><div class="section" title="Backwards Compatibility"><div class="titlepage"><div><div><h2 class="title"><a id="manual.appendix.porting.backwards"/>Backwards Compatibility</h2></div></div></div><div class="section" title="First"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.first"/>First</h3></div></div></div><p>The first generation GNU C++ library was called libg++. It was a
@@ -17,8 +17,8 @@ ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
<span class="quote">“<span class="quote">obvious</span>”</span> classes didn't get included.
-</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id494148"/>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
-</p></div><div class="section" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id494180"/>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
+</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id710570"/>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
+</p></div><div class="section" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id710603"/>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
In earlier versions of the standard,
<code class="filename">fstream.h</code>,
<code class="filename">ostream.h</code>
@@ -44,7 +44,7 @@ considered replaced and rewritten.
archived. The code is considered replaced and rewritten.
</p><p>
Portability notes and known implementation limitations are as follows.
-</p><div class="section" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id494283"/>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
+</p><div class="section" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id710706"/>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
Some care is required to support C++ compiler and or library
implementation that do not have the standard library in
<code class="code">namespace std</code>.
@@ -108,7 +108,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi
])
-</pre></div><div class="section" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id494409"/>Illegal iterator usage</h4></div></div></div><p>
+</pre></div><div class="section" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id710832"/>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
@@ -121,7 +121,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</p></li><li class="listitem"><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code>
- </p></li></ul></div></div><div class="section" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id494471"/><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </p></li></ul></div></div><div class="section" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id710893"/><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
</h4></div></div></div><p>
Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros
(isspace, isalpha etc.).
@@ -154,7 +154,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
(<code class="filename">ctype.h</code>) and the
definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>).
-</p></div><div class="section" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id494566"/>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
+</p></div><div class="section" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id710989"/>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
One solution is to add an autoconf-test for this:
</p><pre class="programlisting">
AC_MSG_CHECKING(for container::at)
@@ -180,7 +180,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</pre><p>
If you are using other (non-GNU) compilers it might be a good idea
to check for <code class="code">string::at</code> separately.
-</p></div><div class="section" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id494605"/>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
+</p></div><div class="section" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id711028"/>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
Use some kind of autoconf test, plus this:
</p><pre class="programlisting">
#ifdef HAVE_CHAR_TRAITS
@@ -188,7 +188,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else
#define CPP_EOF EOF
#endif
-</pre></div><div class="section" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id494623"/>No <code class="code">string::clear</code></h4></div></div></div><p>
+</pre></div><div class="section" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id711046"/>No <code class="code">string::clear</code></h4></div></div></div><p>
There are two functions for deleting the contents of a string:
<code class="code">clear</code> and <code class="code">erase</code> (the latter returns the
string).
@@ -206,12 +206,12 @@ erase(size_type __pos = 0, size_type __n = npos)
Unfortunately, <code class="code">clear</code> is not implemented in this
version, so you should use <code class="code">erase</code> (which is probably
faster than <code class="code">operator=(charT*)</code>).
-</p></div><div class="section" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id494669"/>
+</p></div><div class="section" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id711092"/>
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
</h4></div></div></div><p>
These are no longer supported. Please use stringstreams instead.
-</p></div><div class="section" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id494688"/>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
+</p></div><div class="section" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id711111"/>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
Although the ISO standard <code class="code">i/ostringstream</code>-classes are
provided, (<code class="filename">sstream</code>), for
compatibility with older implementations the pre-ISO
@@ -299,14 +299,14 @@ any = temp;
Another example of using stringstreams is in <a class="link" href="strings.html#strings.string.shrink" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in
particular <span class="quote">“<span class="quote">info iostream</span>”</span>.
-</p></div><div class="section" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id494844"/>Little or no wide character support</h4></div></div></div><p>
+</p></div><div class="section" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id711267"/>Little or no wide character support</h4></div></div></div><p>
Classes <code class="classname">wstring</code> and
<code class="classname">char_traits&lt;wchar_t&gt;</code> are
not supported.
- </p></div><div class="section" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id494863"/>No templatized iostreams</h4></div></div></div><p>
+ </p></div><div class="section" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id711285"/>No templatized iostreams</h4></div></div></div><p>
Classes <code class="classname">wfilebuf</code> and
<code class="classname">wstringstream</code> are not supported.
- </p></div><div class="section" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id494881"/>Thread safety issues</h4></div></div></div><p>
+ </p></div><div class="section" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id711304"/>Thread safety issues</h4></div></div></div><p>
Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
@@ -364,7 +364,7 @@ libstdc++-v3.
of the SGI STL (version 3.3), with extensive changes.
</p><p>A more formal description of the V3 goals can be found in the
official <a class="link" href="source_design_notes.html" title="Design Notes">design document</a>.
- </p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id495006"/>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
+ </p><p>Portability notes and known implementation limitations are as follows.</p><div class="section" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id711429"/>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
(<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
@@ -436,7 +436,7 @@ like <code class="filename">vector.h</code> can be replaced with <code class="fi
directive <code class="code">using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
-</p></div><div class="section" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id495090"/>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
+</p></div><div class="section" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id711514"/>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set
@@ -508,7 +508,7 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi
])
-</pre></div><div class="section" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id495193"/>No <code class="code">ios::nocreate/ios::noreplace</code>.
+</pre></div><div class="section" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id711617"/>No <code class="code">ios::nocreate/ios::noreplace</code>.
</h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So
@@ -519,7 +519,7 @@ open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code class="code">app</code>, <code class="code">ate</code>
and <code class="code">trunc</code> (except for <code class="code">app</code> ?).
-</p></div><div class="section" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id495241"/>
+</p></div><div class="section" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id711664"/>
No <code class="code">stream::attach(int fd)</code>
</h4></div></div></div><p>
Phil Edwards writes: It was considered and rejected for the ISO
@@ -542,7 +542,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to
<a class="link" href="http://www.josuttis.com/cppcode/fdstream.html">fdstream example</a>
by Nicolai Josuttis.
-</p></div><div class="section" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id495309"/>
+</p></div><div class="section" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711732"/>
Support for C++98 dialect.
</h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard.
</p><pre class="programlisting">
@@ -610,7 +610,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi
])
-</pre></div><div class="section" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id495337"/>
+</pre></div><div class="section" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711760"/>
Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting">
@@ -687,7 +687,7 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
-</pre></div><div class="section" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id495381"/>
+</pre></div><div class="section" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id711804"/>
Support for C++0x dialect.
</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
</p><pre class="programlisting">
@@ -899,22 +899,25 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
-</pre></div><div class="section" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id495459"/>
+</pre></div><div class="section" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id711882"/>
Container::iterator_type is not necessarily Container::value_type*
</h4></div></div></div><p>
This is a change in behavior from the previous version. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers.
-</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id495489"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+</p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="Migrating to GCC 4.1"><a id="id711913"/><p><span class="title"><em>
+ <a class="link" href="http://www.kegel.com/gcc/gcc4.html">
Migrating to GCC 4.1
- </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="id495515"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry" title="Building the Whole Debian Archive with GCC 4.1: A Summary"><a id="id711936"/><p><span class="title"><em>
+ <a class="link" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html">
Building the Whole Debian Archive with GCC 4.1: A Summary
- </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="id495541"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry" title="Migration guide for GCC-3.2"><a id="id711960"/><p><span class="title"><em>
+ <a class="link" href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html">
Migration guide for GCC-3.2
- </em>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr><tr><td align="left" valign="top">API Evolution and Deprecation History </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Appendix C. 
+ </a>
+ </em>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="api.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr><tr><td align="left" valign="top">API Evolution and Deprecation History </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Appendix C. 
Free Software Needs Free Documentation
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator.html b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
index 9f750e9c0dc..d73a5d1d7fa 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>bitmap_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="ext_allocators.html" title="Chapter 20. Allocators"/><link rel="prev" href="ext_allocators.html" title="Chapter 20. Allocators"/><link rel="next" href="ext_containers.html" title="Chapter 21. Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitmap_allocator</th></tr><tr><td align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><th width="60%" align="center">Chapter 20. Allocators</th><td align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="bitmap_allocator"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"/>bitmap_allocator</h2></div></div></div><p>
-</p><div class="section" title="Design"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.design"/>Design</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 21. The bitmap_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch20s05.html" title="Multiple Thread Example"/><link rel="next" href="bk01pt03ch21s02.html" title="Implementation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. The bitmap_allocator</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s05.html">Prev</a> </td><th width="60%" align="center">Part III. 
+ Extensions
+
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch21s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 21. The bitmap_allocator"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"/>Chapter 21. The bitmap_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></div><p>
+</p><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.bitmap.design"/>Design</h2></div></div></div><p>
As this name suggests, this allocator uses a bit-map to keep track
of the used and unused memory locations for its book-keeping
purposes.
@@ -27,314 +30,4 @@
Mutex Protection around every allocation/deallocation. The state
of the macro is picked up automatically from the gthr abstraction
layer.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.impl"/>Implementation</h3></div></div></div><div class="section" title="Free List Store"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.free_list_store"/>Free List Store</h4></div></div></div><p>
- The Free List Store (referred to as FLS for the remaining part of this
- document) is the Global memory pool that is shared by all instances of
- the bitmapped allocator instantiated for any type. This maintains a
- sorted order of all free memory blocks given back to it by the
- bitmapped allocator, and is also responsible for giving memory to the
- bitmapped allocator when it asks for more.
- </p><p>
- Internally, there is a Free List threshold which indicates the
- Maximum number of free lists that the FLS can hold internally
- (cache). Currently, this value is set at 64. So, if there are
- more than 64 free lists coming in, then some of them will be given
- back to the OS using operator delete so that at any given time the
- Free List's size does not exceed 64 entries. This is done because
- a Binary Search is used to locate an entry in a free list when a
- request for memory comes along. Thus, the run-time complexity of
- the search would go up given an increasing size, for 64 entries
- however, lg(64) == 6 comparisons are enough to locate the correct
- free list if it exists.
- </p><p>
- Suppose the free list size has reached its threshold, then the
- largest block from among those in the list and the new block will
- be selected and given back to the OS. This is done because it
- reduces external fragmentation, and allows the OS to use the
- larger blocks later in an orderly fashion, possibly merging them
- later. Also, on some systems, large blocks are obtained via calls
- to mmap, so giving them back to free system resources becomes most
- important.
- </p><p>
- The function _S_should_i_give decides the policy that determines
- whether the current block of memory should be given to the
- allocator for the request that it has made. That's because we may
- not always have exact fits for the memory size that the allocator
- requests. We do this mainly to prevent external fragmentation at
- the cost of a little internal fragmentation. Now, the value of
- this internal fragmentation has to be decided by this function. I
- can see 3 possibilities right now. Please add more as and when you
- find better strategies.
- </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Equal size check. Return true only when the 2 blocks are of equal
-size.</p></li><li class="listitem"><p>Difference Threshold: Return true only when the _block_size is
-greater than or equal to the _required_size, and if the _BS is &gt; _RS
-by a difference of less than some THRESHOLD value, then return true,
-else return false. </p></li><li class="listitem"><p>Percentage Threshold. Return true only when the _block_size is
-greater than or equal to the _required_size, and if the _BS is &gt; _RS
-by a percentage of less than some THRESHOLD value, then return true,
-else return false.</p></li></ol></div><p>
- Currently, (3) is being used with a value of 36% Maximum wastage per
- Super Block.
- </p></div><div class="section" title="Super Block"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block"/>Super Block</h4></div></div></div><p>
- A super block is the block of memory acquired from the FLS from
- which the bitmap allocator carves out memory for single objects
- and satisfies the user's requests. These super blocks come in
- sizes that are powers of 2 and multiples of 32
- (_Bits_Per_Block). Yes both at the same time! That's because the
- next super block acquired will be 2 times the previous one, and
- also all super blocks have to be multiples of the _Bits_Per_Block
- value.
- </p><p>
- How does it interact with the free list store?
- </p><p>
- The super block is contained in the FLS, and the FLS is responsible for
- getting / returning Super Bocks to and from the OS using operator new
- as defined by the C++ standard.
- </p></div><div class="section" title="Super Block Data Layout"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block_data"/>Super Block Data Layout</h4></div></div></div><p>
- Each Super Block will be of some size that is a multiple of the
- number of Bits Per Block. Typically, this value is chosen as
- Bits_Per_Byte x sizeof(size_t). On an x86 system, this gives the
- figure 8 x 4 = 32. Thus, each Super Block will be of size 32
- x Some_Value. This Some_Value is sizeof(value_type). For now, let
- it be called 'K'. Thus, finally, Super Block size is 32 x K bytes.
- </p><p>
- This value of 32 has been chosen because each size_t has 32-bits
- and Maximum use of these can be made with such a figure.
- </p><p>
- Consider a block of size 64 ints. In memory, it would look like this:
- (assume a 32-bit system where, size_t is a 32-bit entity).
- </p><div class="table"><a id="id481111"/><p class="title"><strong>Table 20.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left">268</td><td style="text-align: left">0</td><td style="text-align: left">4294967295</td><td style="text-align: left">4294967295</td><td style="text-align: left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break"/><p>
- The first Column(268) represents the size of the Block in bytes as
- seen by the Bitmap Allocator. Internally, a global free list is
- used to keep track of the free blocks used and given back by the
- bitmap allocator. It is this Free List Store that is responsible
- for writing and managing this information. Actually the number of
- bytes allocated in this case would be: 4 + 4 + (4x2) + (64x4) =
- 272 bytes, but the first 4 bytes are an addition by the Free List
- Store, so the Bitmap Allocator sees only 268 bytes. These first 4
- bytes about which the bitmapped allocator is not aware hold the
- value 268.
- </p><p>
- What do the remaining values represent?</p><p>
- The 2nd 4 in the expression is the sizeof(size_t) because the
- Bitmapped Allocator maintains a used count for each Super Block,
- which is initially set to 0 (as indicated in the diagram). This is
- incremented every time a block is removed from this super block
- (allocated), and decremented whenever it is given back. So, when
- the used count falls to 0, the whole super block will be given
- back to the Free List Store.
- </p><p>
- The value 4294967295 represents the integer corresponding to the bit
- representation of all bits set: 11111111111111111111111111111111.
- </p><p>
- The 3rd 4x2 is size of the bitmap itself, which is the size of 32-bits
- x 2,
- which is 8-bytes, or 2 x sizeof(size_t).
- </p></div><div class="section" title="Maximum Wasted Percentage"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.max_wasted"/>Maximum Wasted Percentage</h4></div></div></div><p>
- This has nothing to do with the algorithm per-se,
- only with some vales that must be chosen correctly to ensure that the
- allocator performs well in a real word scenario, and maintains a good
- balance between the memory consumption and the allocation/deallocation
- speed.
- </p><p>
- The formula for calculating the maximum wastage as a percentage:
- </p><p>
-(32 x k + 1) / (2 x (32 x k + 1 + 32 x c)) x 100.
- </p><p>
- where k is the constant overhead per node (e.g., for list, it is
- 8 bytes, and for map it is 12 bytes) and c is the size of the
- base type on which the map/list is instantiated. Thus, suppose the
- type1 is int and type2 is double, they are related by the relation
- sizeof(double) == 2*sizeof(int). Thus, all types must have this
- double size relation for this formula to work properly.
- </p><p>
- Plugging-in: For List: k = 8 and c = 4 (int and double), we get:
- 33.376%
- </p><p>
-For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
- </p><p>
- Thus, knowing these values, and based on the sizeof(value_type), we may
- create a function that returns the Max_Wastage_Percentage for us to use.
- </p></div><div class="section" title="allocate"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.allocate"/><code class="function">allocate</code></h4></div></div></div><p>
- The allocate function is specialized for single object allocation
- ONLY. Thus, ONLY if n == 1, will the bitmap_allocator's
- specialized algorithm be used. Otherwise, the request is satisfied
- directly by calling operator new.
- </p><p>
- Suppose n == 1, then the allocator does the following:
- </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
- Checks to see whether a free block exists somewhere in a region
- of memory close to the last satisfied request. If so, then that
- block is marked as allocated in the bit map and given to the
- user. If not, then (2) is executed.
- </p></li><li class="listitem"><p>
- Is there a free block anywhere after the current block right
- up to the end of the memory that we have? If so, that block is
- found, and the same procedure is applied as above, and
- returned to the user. If not, then (3) is executed.
- </p></li><li class="listitem"><p>
- Is there any block in whatever region of memory that we own
- free? This is done by checking
- </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
- The use count for each super block, and if that fails then
- </p></li><li class="listitem"><p>
- The individual bit-maps for each super block.
- </p></li></ul></div><p>
- Note: Here we are never touching any of the memory that the
- user will be given, and we are confining all memory accesses
- to a small region of memory! This helps reduce cache
- misses. If this succeeds then we apply the same procedure on
- that bit-map as (1), and return that block of memory to the
- user. However, if this process fails, then we resort to (4).
- </p></li><li class="listitem"><p>
- This process involves Refilling the internal exponentially
- growing memory pool. The said effect is achieved by calling
- _S_refill_pool which does the following:
- </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
- Gets more memory from the Global Free List of the Required
- size.
- </p></li><li class="listitem"><p>
- Adjusts the size for the next call to itself.
- </p></li><li class="listitem"><p>
- Writes the appropriate headers in the bit-maps.
- </p></li><li class="listitem"><p>
- Sets the use count for that super-block just allocated to 0
- (zero).
- </p></li><li class="listitem"><p>
- All of the above accounts to maintaining the basic invariant
- for the allocator. If the invariant is maintained, we are
- sure that all is well. Now, the same process is applied on
- the newly acquired free blocks, which are dispatched
- accordingly.
- </p></li></ul></div></li></ol></div><p>
-Thus, you can clearly see that the allocate function is nothing but a
-combination of the next-fit and first-fit algorithm optimized ONLY for
-single object allocations.
-</p></div><div class="section" title="deallocate"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.deallocate"/><code class="function">deallocate</code></h4></div></div></div><p>
- The deallocate function again is specialized for single objects ONLY.
- For all n belonging to &gt; 1, the operator delete is called without
- further ado, and the deallocate function returns.
- </p><p>
- However for n == 1, a series of steps are performed:
- </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
- We first need to locate that super-block which holds the memory
- location given to us by the user. For that purpose, we maintain
- a static variable _S_last_dealloc_index, which holds the index
- into the vector of block pairs which indicates the index of the
- last super-block from which memory was freed. We use this
- strategy in the hope that the user will deallocate memory in a
- region close to what he/she deallocated the last time around. If
- the check for belongs_to succeeds, then we determine the bit-map
- for the given pointer, and locate the index into that bit-map,
- and mark that bit as free by setting it.
- </p></li><li class="listitem"><p>
- If the _S_last_dealloc_index does not point to the memory block
- that we're looking for, then we do a linear search on the block
- stored in the vector of Block Pairs. This vector in code is
- called _S_mem_blocks. When the corresponding super-block is
- found, we apply the same procedure as we did for (1) to mark the
- block as free in the bit-map.
- </p></li></ol></div><p>
- Now, whenever a block is freed, the use count of that particular
- super block goes down by 1. When this use count hits 0, we remove
- that super block from the list of all valid super blocks stored in
- the vector. While doing this, we also make sure that the basic
- invariant is maintained by making sure that _S_last_request and
- _S_last_dealloc_index point to valid locations within the vector.
- </p></div><div class="section" title="Questions"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.questions"/>Questions</h4></div></div></div><div class="section" title="1"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.1"/>1</h5></div></div></div><p>
-Q1) The "Data Layout" section is
-cryptic. I have no idea of what you are trying to say. Layout of what?
-The free-list? Each bitmap? The Super Block?
- </p><p>
- The layout of a Super Block of a given
-size. In the example, a super block of size 32 x 1 is taken. The
-general formula for calculating the size of a super block is
-32 x sizeof(value_type) x 2^n, where n ranges from 0 to 32 for 32-bit
-systems.
- </p></div><div class="section" title="2"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.2"/>2</h5></div></div></div><p>
- And since I just mentioned the
-term `each bitmap', what in the world is meant by it? What does each
-bitmap manage? How does it relate to the super block? Is the Super
-Block a bitmap as well?
- </p><p>
- Each bitmap is part of a Super Block which is made up of 3 parts
- as I have mentioned earlier. Re-iterating, 1. The use count,
- 2. The bit-map for that Super Block. 3. The actual memory that
- will be eventually given to the user. Each bitmap is a multiple
- of 32 in size. If there are 32 x (2^3) blocks of single objects
- to be given, there will be '32 x (2^3)' bits present. Each 32
- bits managing the allocated / free status for 32 blocks. Since
- each size_t contains 32-bits, one size_t can manage up to 32
- blocks' status. Each bit-map is made up of a number of size_t,
- whose exact number for a super-block of a given size I have just
- mentioned.
- </p></div><div class="section" title="3"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.3"/>3</h5></div></div></div><p>
- How do the allocate and deallocate functions work in regard to
- bitmaps?
- </p><p>
- The allocate and deallocate functions manipulate the bitmaps and
- have nothing to do with the memory that is given to the user. As
- I have earlier mentioned, a 1 in the bitmap's bit field
- indicates free, while a 0 indicates allocated. This lets us
- check 32 bits at a time to check whether there is at lease one
- free block in those 32 blocks by testing for equality with
- (0). Now, the allocate function will given a memory block find
- the corresponding bit in the bitmap, and will reset it (i.e.,
- make it re-set (0)). And when the deallocate function is called,
- it will again set that bit after locating it to indicate that
- that particular block corresponding to this bit in the bit-map
- is not being used by anyone, and may be used to satisfy future
- requests.
- </p><p>
- e.g.: Consider a bit-map of 64-bits as represented below:
- 1111111111111111111111111111111111111111111111111111111111111111
- </p><p>
- Now, when the first request for allocation of a single object
- comes along, the first block in address order is returned. And
- since the bit-maps in the reverse order to that of the address
- order, the last bit (LSB if the bit-map is considered as a
- binary word of 64-bits) is re-set to 0.
- </p><p>
- The bit-map now looks like this:
- 1111111111111111111111111111111111111111111111111111111111111110
- </p></div></div><div class="section" title="Locality"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.locality"/>Locality</h4></div></div></div><p>
- Another issue would be whether to keep the all bitmaps in a
- separate area in memory, or to keep them near the actual blocks
- that will be given out or allocated for the client. After some
- testing, I've decided to keep these bitmaps close to the actual
- blocks. This will help in 2 ways.
- </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Constant time access for the bitmap themselves, since no kind of
-look up will be needed to find the correct bitmap list or its
-equivalent.</p></li><li class="listitem"><p>And also this would preserve the cache as far as possible.</p></li></ol></div><p>
- So in effect, this kind of an allocator might prove beneficial from a
- purely cache point of view. But this allocator has been made to try and
- roll out the defects of the node_allocator, wherein the nodes get
- skewed about in memory, if they are not returned in the exact reverse
- order or in the same order in which they were allocated. Also, the
- new_allocator's book keeping overhead is too much for small objects and
- single object allocations, though it preserves the locality of blocks
- very well when they are returned back to the allocator.
- </p></div><div class="section" title="Overhead and Grow Policy"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.grow_policy"/>Overhead and Grow Policy</h4></div></div></div><p>
- Expected overhead per block would be 1 bit in memory. Also, once
- the address of the free list has been found, the cost for
- allocation/deallocation would be negligible, and is supposed to be
- constant time. For these very reasons, it is very important to
- minimize the linear time costs, which include finding a free list
- with a free block while allocating, and finding the corresponding
- free list for a block while deallocating. Therefore, I have
- decided that the growth of the internal pool for this allocator
- will be exponential as compared to linear for
- node_allocator. There, linear time works well, because we are
- mainly concerned with speed of allocation/deallocation and memory
- consumption, whereas here, the allocation/deallocation part does
- have some linear/logarithmic complexity components in it. Thus, to
- try and minimize them would be a good thing to do at the cost of a
- little bit of memory.
- </p><p>
- Another thing to be noted is the pool size will double every time
- the internal pool gets exhausted, and all the free blocks have
- been given away. The initial size of the pool would be
- sizeof(size_t) x 8 which is the number of bits in an integer,
- which can fit exactly in a CPU register. Hence, the term given is
- exponential growth of the internal pool.
- </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_allocators.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 20. Allocators </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 21. Containers</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s05.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch21s02.html">Next</a></td></tr><tr><td align="left" valign="top">Multiple Thread Example </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Implementation</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02.html b/libstdc++-v3/doc/html/manual/bk01pt02.html
index 3a0751ab9e7..5c344b16857 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part II.  Standard Contents</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library Manual"/><link rel="prev" href="debug.html" title="Debugging Support"/><link rel="next" href="support.html" title="Chapter 4.  Support"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part II.  Standard Contents</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library Manual"/><link rel="prev" href="debug.html" title="Debugging Support"/><link rel="next" href="support.html" title="Chapter 4.  Support"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part II. 
Standard Contents
</th></tr><tr><td align="left"><a accesskey="p" href="debug.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="support.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part II.  Standard Contents"><div class="titlepage"><div><div><h1 class="title"><a id="manual.std"/>Part II. 
Standard Contents
@@ -13,22 +13,22 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
Utilities
-</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
Strings
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
Localization
-</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
Containers
-</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
+</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
Iterators
</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11.
Algorithms
-</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="numerics.html">12.
+</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="numerics.html">12.
Numerics
</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="io.html">13.
@@ -40,7 +40,7 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></dd><dt><span class="chapter"><a href="concurrency.html">15.
Concurrency
-</a></span></dt><dd><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="debug.html">Prev</a> </td><td align="center"><a accesskey="u" href="spine.html">Up</a></td><td align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td align="left" valign="top">Debugging Support </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 4. 
+</a></span></dt><dd><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="debug.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td align="left" valign="top">Debugging Support </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 4. 
Support
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html b/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
index 6a67bef7c5c..74c468d8800 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02ch05s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Concept Checking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="diagnostics.html" title="Chapter 5.  Diagnostics"/><link rel="prev" href="diagnostics.html" title="Chapter 5.  Diagnostics"/><link rel="next" href="utilities.html" title="Chapter 6.  Utilities"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concept Checking</th></tr><tr><td align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Chapter 5. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Concept Checking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="diagnostics.html" title="Chapter 5.  Diagnostics"/><link rel="prev" href="diagnostics.html" title="Chapter 5.  Diagnostics"/><link rel="next" href="utilities.html" title="Chapter 6.  Utilities"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concept Checking</th></tr><tr><td align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Chapter 5. 
Diagnostics
</th><td align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr></table><hr/></div><div class="section" title="Concept Checking"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics.concept_checking"/>Concept Checking</h2></div></div></div><p>
@@ -44,7 +44,7 @@
</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><td align="center"><a accesskey="u" href="diagnostics.html">Up</a></td><td align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 5. 
Diagnostics
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 6. 
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 6. 
Utilities
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s02.html
index 8fa7981deff..1616ce59358 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="next" href="bk01pt03ch17s03.html" title="Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Semantics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.semantics"/>Semantics</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="next" href="bk01pt03ch17s03.html" title="Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Semantics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.semantics"/>Semantics</h2></div></div></div><p>
</p><p>A program that uses the C++ standard library correctly
will maintain the same semantics under debug mode as it had with
the normal (release) library. All functional and exception-handling
@@ -52,4 +52,4 @@ with the debug-mode checks included, but this is unsupported and not
guaranteed to work. For full debug-mode support you can use the
<code class="code">__gnu_debug::basic_string</code> debugging container directly,
which always works correctly.
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 17. Debug Mode </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Using</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 17. Debug Mode </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
index bff64a3747b..4ad5743ca05 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s03.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="bk01pt03ch17s02.html" title="Semantics"/><link rel="next" href="bk01pt03ch17s04.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.using"/>Using</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="bk01pt03ch17s02.html" title="Semantics"/><link rel="next" href="bk01pt03ch17s04.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.using"/>Using</h2></div></div></div><p>
</p><div class="section" title="Using the Debug Mode"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.mode"/>Using the Debug Mode</h3></div></div></div><p>To use the libstdc++ debug mode, compile your application with the
compiler flag <code class="code">-D_GLIBCXX_DEBUG</code>. Note that this flag
changes the sizes and behavior of standard class templates such
@@ -19,6 +19,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="id472703"/><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::bitset</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="classname">__gnu_debug::bitset</code></td><td style="text-align: left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::deque</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="classname">__gnu_debug::deque</code></td><td style="text-align: left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::list</code></td><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="classname">__gnu_debug::list</code></td><td style="text-align: left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::map</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::map</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multimap</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multiset</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::set</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::set</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::wstring</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::wstring</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::basic_string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::basic_string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::vector</code></td><td style="text-align: left"><code class="filename">vector</code></td><td style="text-align: left"><code class="classname">__gnu_debug::vector</code></td><td style="text-align: left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/><p>In addition, when compiling in C++0x mode, these additional
+</p><div class="table"><a id="id654877"/><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::bitset</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="classname">__gnu_debug::bitset</code></td><td style="text-align: left"><code class="filename">&lt;debug/bitset&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::deque</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="classname">__gnu_debug::deque</code></td><td style="text-align: left"><code class="filename">&lt;debug/deque&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::list</code></td><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="classname">__gnu_debug::list</code></td><td style="text-align: left"><code class="filename">&lt;debug/list&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::map</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::map</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multimap</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::multiset</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::set</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::set</code></td><td style="text-align: left"><code class="filename">&lt;debug/set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::wstring</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::wstring</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::basic_string</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="classname">__gnu_debug::basic_string</code></td><td style="text-align: left"><code class="filename">&lt;debug/string&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::vector</code></td><td style="text-align: left"><code class="filename">vector</code></td><td style="text-align: left"><code class="classname">__gnu_debug::vector</code></td><td style="text-align: left"><code class="filename">&lt;debug/vector&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/><p>In addition, when compiling in C++0x mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="id473077"/><p class="title"><strong>Table 17.2. Debugging Containers C++0x</strong></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_map</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multimap</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_set</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_set</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multiset</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id655252"/><p class="title"><strong>Table 17.2. Debugging Containers C++0x</strong></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Container</th><th style="text-align: left">Header</th><th style="text-align: left">Debug container</th><th style="text-align: left">Debug header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="classname">std::unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_map</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multimap</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_map&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_set</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_set</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr><tr><td style="text-align: left"><code class="classname">std::unordered_multiset</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td><td style="text-align: left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td style="text-align: left"><code class="filename">&lt;debug/unordered_set&gt;</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html b/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
index 3e35af0fac8..a0a85b76dc1 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch17s04.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="bk01pt03ch17s03.html" title="Using"/><link rel="next" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s03.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.design"/>Design</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="debug_mode.html" title="Chapter 17. Debug Mode"/><link rel="prev" href="bk01pt03ch17s03.html" title="Using"/><link rel="next" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s03.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Debug Mode</th><td align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.design"/>Design</h2></div></div></div><p>
</p><div class="section" title="Goals"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.goals"/>Goals</h3></div></div></div><p>
</p><p> The libstdc++ debug mode replaces unsafe (but efficient) standard
containers and iterators with semantically equivalent safe standard
@@ -409,4 +409,4 @@ test02()
a full debug-mode implementation (including debugging for
CodeWarrior extensions) and is easy to use, although it meets only
the "Full recompilation" (1) recompilation
- guarantee.</p></li></ul></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr><tr><td align="left" valign="top">Using </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 18. Parallel Mode</td></tr></table></div></body></html>
+ guarantee.</p></li></ul></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr><tr><td align="left" valign="top">Using </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 18. Parallel Mode</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s02.html
index 7a7419ac51d..2017808229f 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="next" href="bk01pt03ch18s03.html" title="Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Semantics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.semantics"/>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe,
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Semantics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="next" href="bk01pt03ch18s03.html" title="Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Semantics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.semantics"/>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe,
i.e. user-defined functors must not throw exceptions.
Also, the order of execution is not guaranteed for some functions, of course.
Therefore, user-defined functors should not have any concurrent side effects.
@@ -8,4 +8,4 @@ Therefore, user-defined functors should not have any concurrent side effects.
OpenMP parallel regions in concurrent threads,
it is not possible to call parallel STL algorithm in
concurrent threads, either.
-It might work with other compilers, though.</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 18. Parallel Mode </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Using</td></tr></table></div></body></html>
+It might work with other compilers, though.</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 18. Parallel Mode </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
index 564989e02b6..71b3de20a73 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s03.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s02.html" title="Semantics"/><link rel="next" href="bk01pt03ch18s04.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.using"/>Using</h2></div></div></div><div class="section" title="Prerequisite Compiler Flags"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.prereq_flags"/>Prerequisite Compiler Flags</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s02.html" title="Semantics"/><link rel="next" href="bk01pt03ch18s04.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.using"/>Using</h2></div></div></div><div class="section" title="Prerequisite Compiler Flags"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.using.prereq_flags"/>Prerequisite Compiler Flags</h3></div></div></div><p>
Any use of parallel functionality requires additional compiler
and runtime support, in particular support for OpenMP. Adding this support is
not difficult: just compile your application with the compiler
@@ -63,4 +63,4 @@ Then compile this code with the prerequisite compiler flags
flags for atomic operations.)
</p><p> The following table provides the names and headers of all the
parallel algorithms that can be used in a similar manner:
-</p><div class="table"><a id="id474664"/><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Algorithm</th><th style="text-align: left">Header</th><th style="text-align: left">Parallel algorithm</th><th style="text-align: left">Parallel header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="function">std::accumulate</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::accumulate</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_difference</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::inner_product</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::inner_product</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sum</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sum</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::equal</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::equal</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_first_of</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_first_of</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::for_each</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::for_each</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::mismatch</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::mismatch</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::transform</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::transform</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::max_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::max_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::merge</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::merge</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::min_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::min_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::nth_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::nth_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partition</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partition</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::random_shuffle</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::random_shuffle</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_union</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_union</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_intersection</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_intersection</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::stable_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::stable_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::unique_copy</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::unique_copy</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id656839"/><p class="title"><strong>Table 18.1. Parallel Algorithms</strong></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Algorithm</th><th style="text-align: left">Header</th><th style="text-align: left">Parallel algorithm</th><th style="text-align: left">Parallel header</th></tr></thead><tbody><tr><td style="text-align: left"><code class="function">std::accumulate</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::accumulate</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_difference</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::inner_product</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::inner_product</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sum</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sum</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr><tr><td style="text-align: left"><code class="function">std::adjacent_find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::adjacent_find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::count_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::count_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::equal</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::equal</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::find_first_of</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::find_first_of</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::for_each</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::for_each</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::generate_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::generate_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::mismatch</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::mismatch</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::search_n</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::search_n</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::transform</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::transform</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::replace_if</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::replace_if</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::max_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::max_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::merge</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::merge</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::min_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::min_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::nth_element</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::nth_element</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partial_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partial_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::partition</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::partition</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::random_shuffle</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::random_shuffle</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_union</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_union</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_intersection</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_intersection</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::set_difference</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::set_difference</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::stable_sort</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::stable_sort</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr><tr><td style="text-align: left"><code class="function">std::unique_copy</code></td><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="function">__gnu_parallel::unique_copy</code></td><td style="text-align: left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s04.html">Next</a></td></tr><tr><td align="left" valign="top">Semantics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s04.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s04.html
index 91c951d3855..2eef0ee575f 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s04.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s03.html" title="Using"/><link rel="next" href="bk01pt03ch18s05.html" title="Testing"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s03.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s05.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.design"/>Design</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s03.html" title="Using"/><link rel="next" href="bk01pt03ch18s05.html" title="Testing"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s03.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s05.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.design"/>Design</h2></div></div></div><p>
</p><div class="section" title="Interface Basics"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.intro"/>Interface Basics</h3></div></div></div><p>
All parallel algorithms are intended to have signatures that are
equivalent to the ISO C++ algorithms replaced. For instance, the
@@ -210,4 +210,4 @@ __gnu_parallel</code>.
</p><p> More information, and an organized index of types and functions
related to the parallel mode on a per-namespace basis, can be found in
the generated source documentation.
-</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s05.html">Next</a></td></tr><tr><td align="left" valign="top">Using </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Testing</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s05.html">Next</a></td></tr><tr><td align="left" valign="top">Using </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Testing</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch18s05.html b/libstdc++-v3/doc/html/manual/bk01pt03ch18s05.html
index f00a4a2815a..9d27f10f151 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch18s05.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch18s05.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s04.html" title="Design"/><link rel="next" href="profile_mode.html" title="Chapter 19. Profile Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s04.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr/></div><div class="section" title="Testing"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.test"/>Testing</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode"/><link rel="prev" href="bk01pt03ch18s04.html" title="Design"/><link rel="next" href="profile_mode.html" title="Chapter 19. Profile Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s04.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr/></div><div class="section" title="Testing"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.test"/>Testing</h2></div></div></div><p>
Both the normal conformance and regression tests and the
supplemental performance tests work.
</p><p>
@@ -23,4 +23,4 @@
additional software dependencies than the usual bare-boned text
file, and can be generated by using the <code class="code">make
doc-performance</code> rule in the testsuite's Makefile.
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 19. Profile Mode</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 19. Profile Mode</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
index 2f640624c8b..e8cf6a4b05d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s02.html
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="next" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.design"/>Design</h2></div></div></div><p>
-</p><div class="table"><a id="id476788"/><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Code Location</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/std/*</code></td><td style="text-align: left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/*</code></td><td style="text-align: left">Profile extension public headers (map, vector, ...).</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td style="text-align: left">Profile extension internals. Implementation files are
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="next" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.design"/>Design</h2></div></div></div><p>
+</p><div class="table"><a id="id658962"/><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Code Location</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/std/*</code></td><td style="text-align: left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/*</code></td><td style="text-align: left">Profile extension public headers (map, vector, ...).</td></tr><tr><td style="text-align: left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td style="text-align: left">Profile extension internals. Implementation files are
only included from <code class="code">impl/profiler.h</code>, which is the only
file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break"/><p>
</p><div class="section" title="Wrapper Model"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"/>Wrapper Model</h3></div></div></div><p>
@@ -119,4 +119,4 @@ it helps the user focus on the key problems and ignore the uninteresting ones.
We created a <code class="code">profile</code> directory in the test suite.
Each diagnostic must come with at least two tests, one for false positives
and one for false negatives.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 19. Profile Mode </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Extensions for Custom Containers</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 19. Profile Mode </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Extensions for Custom Containers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s03.html
index 37d1ed8e4bb..c3cb96f729d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s03.html
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s02.html" title="Design"/><link rel="next" href="bk01pt03ch19s04.html" title="Empirical Cost Model"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s02.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Extensions for Custom Containers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.api"/>Extensions for Custom Containers</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s02.html" title="Design"/><link rel="next" href="bk01pt03ch19s04.html" title="Empirical Cost Model"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s02.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Extensions for Custom Containers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.api"/>Extensions for Custom Containers</h2></div></div></div><p>
Many large projects use their own data structures instead of the ones in the
standard library. If these data structures are similar in functionality
to the standard library, they can be instrumented with the same hooks
that are used to instrument the standard library.
The instrumentation API is exposed in file
<code class="code">profiler.h</code> (look for "Instrumentation hooks").
- </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s04.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Empirical Cost Model</td></tr></table></div></body></html>
+ </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s04.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Empirical Cost Model</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s04.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s04.html
index 8fc162b7c73..8915bc051ac 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s04.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Empirical Cost Model</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers"/><link rel="next" href="bk01pt03ch19s05.html" title="Implementation Issues"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s03.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s05.html">Next</a></td></tr></table><hr/></div><div class="section" title="Empirical Cost Model"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.cost_model"/>Empirical Cost Model</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Empirical Cost Model</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s03.html" title="Extensions for Custom Containers"/><link rel="next" href="bk01pt03ch19s05.html" title="Implementation Issues"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s03.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s05.html">Next</a></td></tr></table><hr/></div><div class="section" title="Empirical Cost Model"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.cost_model"/>Empirical Cost Model</h2></div></div></div><p>
Currently, the cost model uses formulas with predefined relative weights
for alternative containers or container implementations. For instance,
iterating through a vector is X times faster than iterating through a list.
@@ -15,4 +15,4 @@
filled in either by hand or by an automated training mechanism.
The analysis module will then use this database instead of the built in.
generic parameters.
- </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s05.html">Next</a></td></tr><tr><td align="left" valign="top">Extensions for Custom Containers </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Implementation Issues</td></tr></table></div></body></html>
+ </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s05.html">Next</a></td></tr><tr><td align="left" valign="top">Extensions for Custom Containers </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Implementation Issues</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s05.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s05.html
index 2d072f0b41a..7b74bb86e38 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s05.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s05.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s04.html" title="Empirical Cost Model"/><link rel="next" href="bk01pt03ch19s06.html" title="Developer Information"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s04.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s06.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation Issues"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.implementation"/>Implementation Issues</h2></div></div></div><div class="section" title="Stack Traces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"/>Stack Traces</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s04.html" title="Empirical Cost Model"/><link rel="next" href="bk01pt03ch19s06.html" title="Developer Information"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s04.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s06.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation Issues"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.implementation"/>Implementation Issues</h2></div></div></div><div class="section" title="Stack Traces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"/>Stack Traces</h3></div></div></div><p>
Accurate stack traces are needed during profiling since we group events by
call context and dynamic instance. Without accurate traces, diagnostics
may be hard to interpret. For instance, when giving advice to the user
@@ -48,4 +48,4 @@
However, we cannot do the same at destruction time. The trace is written
by a function registered by <code class="code">atexit</code>, thus invoked by
<code class="code">exit</code>.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s06.html">Next</a></td></tr><tr><td align="left" valign="top">Empirical Cost Model </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Developer Information</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s06.html">Next</a></td></tr><tr><td align="left" valign="top">Empirical Cost Model </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Developer Information</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s06.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s06.html
index ddcc7f5708d..d1e790fa476 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s06.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s06.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Developer Information</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s05.html" title="Implementation Issues"/><link rel="next" href="bk01pt03ch19s07.html" title="Diagnostics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s05.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s07.html">Next</a></td></tr></table><hr/></div><div class="section" title="Developer Information"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.developer"/>Developer Information</h2></div></div></div><div class="section" title="Big Picture"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"/>Big Picture</h3></div></div></div><p>The profile mode headers are included with
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Developer Information</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s05.html" title="Implementation Issues"/><link rel="next" href="bk01pt03ch19s07.html" title="Diagnostics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s05.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s07.html">Next</a></td></tr></table><hr/></div><div class="section" title="Developer Information"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.developer"/>Developer Information</h2></div></div></div><div class="section" title="Big Picture"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"/>Big Picture</h3></div></div></div><p>The profile mode headers are included with
<code class="code">-D_GLIBCXX_PROFILE</code> through preprocessor directives in
<code class="code">include/std/*</code>.
</p><p>Instrumented implementations are provided in
@@ -65,4 +65,4 @@
<code class="code">include/profile/impl/profiler_trace.h</code>. Use
<code class="code">__trace_vector_to_list</code> as an example.
</p><p>Add documentation in file <code class="code">doc/xml/manual/profile_mode.xml</code>.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s05.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s07.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation Issues </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Diagnostics</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s05.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s07.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation Issues </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Diagnostics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
index 33377853d40..6548b8b8c41 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch19s07.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s06.html" title="Developer Information"/><link rel="next" href="ext_allocators.html" title="Chapter 20. Allocators"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s06.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr></table><hr/></div><div class="section" title="Diagnostics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.diagnostics"/>Diagnostics</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode"/><link rel="prev" href="bk01pt03ch19s06.html" title="Developer Information"/><link rel="next" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s06.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Profile Mode</th><td align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr></table><hr/></div><div class="section" title="Diagnostics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.diagnostics"/>Diagnostics</h2></div></div></div><p>
The table below presents all the diagnostics we intend to implement.
Each diagnostic has a corresponding compile time switch
<code class="code">-D_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
@@ -18,7 +18,7 @@
A high accuracy means that the diagnostic is unlikely to be wrong.
These grades are not perfect. They are just meant to guide users with
specific needs or time budgets.
- </p><div class="table"><a id="id477670"/><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left">Group</th><th style="text-align: left">Flag</th><th style="text-align: left">Benefit</th><th style="text-align: left">Cost</th><th style="text-align: left">Freq.</th><th style="text-align: left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers" title="Containers">
+ </p><div class="table"><a id="id659844"/><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left">Group</th><th style="text-align: left">Flag</th><th style="text-align: left">Benefit</th><th style="text-align: left">Cost</th><th style="text-align: left">Freq.</th><th style="text-align: left">Implemented</th><td class="auto-generated"> </td></tr></thead><tbody><tr><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers" title="Containers">
CONTAINERS</a></td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small" title="Hashtable Too Small">
HASHTABLE_TOO_SMALL</a></td><td style="text-align: left">10</td><td style="text-align: left">1</td><td style="text-align: left"> </td><td style="text-align: left">10</td><td style="text-align: left">yes</td></tr><tr><td style="text-align: left"> </td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large" title="Hashtable Too Large">
HASHTABLE_TOO_LARGE</a></td><td style="text-align: left">5</td><td style="text-align: left">1</td><td style="text-align: left"> </td><td style="text-align: left">10</td><td style="text-align: left">yes</td></tr><tr><td style="text-align: left"> </td><td style="text-align: left"><a class="link" href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash" title="Inefficient Hash">
@@ -555,4 +555,4 @@ sharing in multithreaded access at foo.cc:4. Detected N shared cache lines.
This diagnostic will not issue any advice, but it will print statistics for
each container construction site. The statistics will contain the cost
of each operation actually performed on the container.
-</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s06.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr><tr><td align="left" valign="top">Developer Information </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 20. Allocators</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s06.html">Prev</a> </td><td align="center"><a accesskey="u" href="profile_mode.html">Up</a></td><td align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr><tr><td align="left" valign="top">Developer Information </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 20. The mt_allocator</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch20s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch20s02.html
new file mode 100644
index 00000000000..7ec3af13b52
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch20s02.html
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/><link rel="prev" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/><link rel="next" href="bk01pt03ch20s03.html" title="Implementation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td align="right"> <a accesskey="n" href="bk01pt03ch20s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design Issues"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.mt.design_issues"/>Design Issues</h2></div></div></div><div class="section" title="Overview"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"/>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum
+describing the characteristics of the memory pool, a policy class
+containing this pool that links instantiation types to common or
+individual pools, and a class inheriting from the policy class that is
+the actual allocator.
+</p><p>The datum describing pools characteristics is
+</p><pre class="programlisting">
+ template&lt;bool _Thread&gt;
+ class __pool
+</pre><p> This class is parametrized on thread support, and is explicitly
+specialized for both multiple threads (with <code class="code">bool==true</code>)
+and single threads (via <code class="code">bool==false</code>.) It is possible to
+use a custom pool datum instead of the default class that is provided.
+</p><p> There are two distinct policy classes, each of which can be used
+with either type of underlying pool datum.
+</p><pre class="programlisting">
+ template&lt;bool _Thread&gt;
+ struct __common_pool_policy
+
+ template&lt;typename _Tp, bool _Thread&gt;
+ struct __per_type_pool_policy
+</pre><p> The first policy, <code class="code">__common_pool_policy</code>, implements a
+common pool. This means that allocators that are instantiated with
+different types, say <code class="code">char</code> and <code class="code">long</code> will both
+use the same pool. This is the default policy.
+</p><p> The second policy, <code class="code">__per_type_pool_policy</code>, implements
+a separate pool for each instantiating type. Thus, <code class="code">char</code>
+and <code class="code">long</code> will use separate pools. This allows per-type
+tuning, for instance.
+</p><p> Putting this all together, the actual allocator class is
+</p><pre class="programlisting">
+ template&lt;typename _Tp, typename _Poolp = __default_policy&gt;
+ class __mt_alloc : public __mt_alloc_base&lt;_Tp&gt;, _Poolp
+</pre><p> This class has the interface required for standard library allocator
+classes, namely member functions <code class="code">allocate</code> and
+<code class="code">deallocate</code>, plus others.
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><td align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch20s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 20. The mt_allocator </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Implementation</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch20s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch20s03.html
new file mode 100644
index 00000000000..1bff6823ef9
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch20s03.html
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/><link rel="prev" href="bk01pt03ch20s02.html" title="Design Issues"/><link rel="next" href="bk01pt03ch20s04.html" title="Single Thread Example"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s02.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td align="right"> <a accesskey="n" href="bk01pt03ch20s04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.mt.impl"/>Implementation</h2></div></div></div><div class="section" title="Tunable Parameters"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.tune"/>Tunable Parameters</h3></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
+exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all
+these parameters, which include settings for
+</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only
+happen before any allocations take place, when the allocator itself is
+initialized. For instance:
+</p><pre class="programlisting">
+#include &lt;ext/mt_allocator.h&gt;
+
+struct pod
+{
+ int i;
+ int j;
+};
+
+int main()
+{
+ typedef pod value_type;
+ typedef __gnu_cxx::__mt_alloc&lt;value_type&gt; allocator_type;
+ typedef __gnu_cxx::__pool_base::_Tune tune_type;
+
+ tune_type t_default;
+ tune_type t_opt(16, 5120, 32, 5120, 20, 10, false);
+ tune_type t_single(16, 5120, 32, 5120, 1, 10, false);
+
+ tune_type t;
+ t = allocator_type::_M_get_options();
+ allocator_type::_M_set_options(t_opt);
+ t = allocator_type::_M_get_options();
+
+ allocator_type a;
+ allocator_type::pointer p1 = a.allocate(128);
+ allocator_type::pointer p2 = a.allocate(5128);
+
+ a.deallocate(p1, 128);
+ a.deallocate(p2, 5128);
+
+ return 0;
+}
+</pre></div><div class="section" title="Initialization"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.init"/>Initialization</h3></div></div></div><p>
+The static variables (pointers to freelists, tuning parameters etc)
+are initialized as above, or are set to the global defaults.
+</p><p>
+The very first allocate() call will always call the
+_S_initialize_once() function. In order to make sure that this
+function is called exactly once we make use of a __gthread_once call
+in MT applications and check a static bool (_S_init) in ST
+applications.
+</p><p>
+The _S_initialize() function:
+- If the GLIBCXX_FORCE_NEW environment variable is set, it sets the bool
+ _S_force_new to true and then returns. This will cause subsequent calls to
+ allocate() to return memory directly from a new() call, and deallocate will
+ only do a delete() call.
+</p><p>
+- If the GLIBCXX_FORCE_NEW environment variable is not set, both ST and MT
+ applications will:
+ - Calculate the number of bins needed. A bin is a specific power of two size
+ of bytes. I.e., by default the allocator will deal with requests of up to
+ 128 bytes (or whatever the value of _S_max_bytes is when _S_init() is
+ called). This means that there will be bins of the following sizes
+ (in bytes): 1, 2, 4, 8, 16, 32, 64, 128.
+
+ - Create the _S_binmap array. All requests are rounded up to the next
+ "large enough" bin. I.e., a request for 29 bytes will cause a block from
+ the "32 byte bin" to be returned to the application. The purpose of
+ _S_binmap is to speed up the process of finding out which bin to use.
+ I.e., the value of _S_binmap[ 29 ] is initialized to 5 (bin 5 = 32 bytes).
+</p><p>
+ - Create the _S_bin array. This array consists of bin_records. There will be
+ as many bin_records in this array as the number of bins that we calculated
+ earlier. I.e., if _S_max_bytes = 128 there will be 8 entries.
+ Each bin_record is then initialized:
+ - bin_record-&gt;first = An array of pointers to block_records. There will be
+ as many block_records pointers as there are maximum number of threads
+ (in a ST application there is only 1 thread, in a MT application there
+ are _S_max_threads).
+ This holds the pointer to the first free block for each thread in this
+ bin. I.e., if we would like to know where the first free block of size 32
+ for thread number 3 is we would look this up by: _S_bin[ 5 ].first[ 3 ]
+
+ The above created block_record pointers members are now initialized to
+ their initial values. I.e. _S_bin[ n ].first[ n ] = NULL;
+</p><p>
+- Additionally a MT application will:
+ - Create a list of free thread id's. The pointer to the first entry
+ is stored in _S_thread_freelist_first. The reason for this approach is
+ that the __gthread_self() call will not return a value that corresponds to
+ the maximum number of threads allowed but rather a process id number or
+ something else. So what we do is that we create a list of thread_records.
+ This list is _S_max_threads long and each entry holds a size_t thread_id
+ which is initialized to 1, 2, 3, 4, 5 and so on up to _S_max_threads.
+ Each time a thread calls allocate() or deallocate() we call
+ _S_get_thread_id() which looks at the value of _S_thread_key which is a
+ thread local storage pointer. If this is NULL we know that this is a newly
+ created thread and we pop the first entry from this list and saves the
+ pointer to this record in the _S_thread_key variable. The next time
+ we will get the pointer to the thread_record back and we use the
+ thread_record-&gt;thread_id as identification. I.e., the first thread that
+ calls allocate will get the first record in this list and thus be thread
+ number 1 and will then find the pointer to its first free 32 byte block
+ in _S_bin[ 5 ].first[ 1 ]
+ When we create the _S_thread_key we also define a destructor
+ (_S_thread_key_destr) which means that when the thread dies, this
+ thread_record is returned to the front of this list and the thread id
+ can then be reused if a new thread is created.
+ This list is protected by a mutex (_S_thread_freelist_mutex) which is only
+ locked when records are removed or added to the list.
+</p><p>
+ - Initialize the free and used counters of each bin_record:
+ - bin_record-&gt;free = An array of size_t. This keeps track of the number
+ of blocks on a specific thread's freelist in each bin. I.e., if a thread
+ has 12 32-byte blocks on it's freelists and allocates one of these, this
+ counter would be decreased to 11.
+
+ - bin_record-&gt;used = An array of size_t. This keeps track of the number
+ of blocks currently in use of this size by this thread. I.e., if a thread
+ has made 678 requests (and no deallocations...) of 32-byte blocks this
+ counter will read 678.
+
+ The above created arrays are now initialized with their initial values.
+ I.e. _S_bin[ n ].free[ n ] = 0;
+</p><p>
+ - Initialize the mutex of each bin_record: The bin_record-&gt;mutex
+ is used to protect the global freelist. This concept of a global
+ freelist is explained in more detail in the section "A multi
+ threaded example", but basically this mutex is locked whenever a
+ block of memory is retrieved or returned to the global freelist
+ for this specific bin. This only occurs when a number of blocks
+ are grabbed from the global list to a thread specific list or when
+ a thread decides to return some blocks to the global freelist.
+</p></div><div class="section" title="Deallocation Notes"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.deallocation"/>Deallocation Notes</h3></div></div></div><p> Notes about deallocation. This allocator does not explicitly
+release memory. Because of this, memory debugging programs like
+valgrind or purify may notice leaks: sorry about this
+inconvenience. Operating systems will reclaim allocated memory at
+program termination anyway. If sidestepping this kind of noise is
+desired, there are three options: use an allocator, like
+<code class="code">new_allocator</code> that releases memory while debugging, use
+GLIBCXX_FORCE_NEW to bypass the allocator's internal pools, or use a
+custom pool datum that releases resources on destruction.
+</p><p>
+ On systems with the function <code class="code">__cxa_atexit</code>, the
+allocator can be forced to free all memory allocated before program
+termination with the member function
+<code class="code">__pool_type::_M_destroy</code>. However, because this member
+function relies on the precise and exactly-conforming ordering of
+static destructors, including those of a static local
+<code class="code">__pool</code> object, it should not be used, ever, on systems
+that don't have the necessary underlying support. In addition, in
+practice, forcing deallocation can be tricky, as it requires the
+<code class="code">__pool</code> object to be fully-constructed before the object
+that uses it is fully constructed. For most (but not all) STL
+containers, this works, as an instance of the allocator is constructed
+as part of a container's constructor. However, this assumption is
+implementation-specific, and subject to change. For an example of a
+pool that frees memory, see the following
+ <a class="link" href="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup">
+ example.</a>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch20s04.html">Next</a></td></tr><tr><td align="left" valign="top">Design Issues </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Single Thread Example</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch20s04.html b/libstdc++-v3/doc/html/manual/bk01pt03ch20s04.html
new file mode 100644
index 00000000000..faa6b4417d2
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch20s04.html
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Single Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/><link rel="prev" href="bk01pt03ch20s03.html" title="Implementation"/><link rel="next" href="bk01pt03ch20s05.html" title="Multiple Thread Example"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Single Thread Example</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s03.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td align="right"> <a accesskey="n" href="bk01pt03ch20s05.html">Next</a></td></tr></table><hr/></div><div class="section" title="Single Thread Example"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.mt.example_single"/>Single Thread Example</h2></div></div></div><p>
+Let's start by describing how the data on a freelist is laid out in memory.
+This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
+</p><pre class="programlisting">
++----------------+
+| next* ---------|--+ (_S_bin[ 3 ].first[ 3 ] points here)
+| | |
+| | |
+| | |
++----------------+ |
+| thread_id = 3 | |
+| | |
+| | |
+| | |
++----------------+ |
+| DATA | | (A pointer to here is what is returned to the
+| | | the application when needed)
+| | |
+| | |
+| | |
+| | |
+| | |
+| | |
++----------------+ |
++----------------+ |
+| next* |&lt;-+ (If next == NULL it's the last one on the list)
+| |
+| |
+| |
++----------------+
+| thread_id = 3 |
+| |
+| |
+| |
++----------------+
+| DATA |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
++----------------+
+</pre><p>
+With this in mind we simplify things a bit for a while and say that there is
+only one thread (a ST application). In this case all operations are made to
+what is referred to as the global pool - thread id 0 (No thread may be
+assigned this id since they span from 1 to _S_max_threads in a MT application).
+</p><p>
+When the application requests memory (calling allocate()) we first look at the
+requested size and if this is &gt; _S_max_bytes we call new() directly and return.
+</p><p>
+If the requested size is within limits we start by finding out from which
+bin we should serve this request by looking in _S_binmap.
+</p><p>
+A quick look at _S_bin[ bin ].first[ 0 ] tells us if there are any blocks of
+this size on the freelist (0). If this is not NULL - fine, just remove the
+block that _S_bin[ bin ].first[ 0 ] points to from the list,
+update _S_bin[ bin ].first[ 0 ] and return a pointer to that blocks data.
+</p><p>
+If the freelist is empty (the pointer is NULL) we must get memory from the
+system and build us a freelist within this memory. All requests for new memory
+is made in chunks of _S_chunk_size. Knowing the size of a block_record and
+the bytes that this bin stores we then calculate how many blocks we can create
+within this chunk, build the list, remove the first block, update the pointer
+(_S_bin[ bin ].first[ 0 ]) and return a pointer to that blocks data.
+</p><p>
+Deallocation is equally simple; the pointer is casted back to a block_record
+pointer, lookup which bin to use based on the size, add the block to the front
+of the global freelist and update the pointer as needed
+(_S_bin[ bin ].first[ 0 ]).
+</p><p>
+The decision to add deallocated blocks to the front of the freelist was made
+after a set of performance measurements that showed that this is roughly 10%
+faster than maintaining a set of "last pointers" as well.
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch20s05.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Multiple Thread Example</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch20s05.html b/libstdc++-v3/doc/html/manual/bk01pt03ch20s05.html
new file mode 100644
index 00000000000..62870c439a3
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch20s05.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Multiple Thread Example</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator"/><link rel="prev" href="bk01pt03ch20s04.html" title="Single Thread Example"/><link rel="next" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Multiple Thread Example</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s04.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr/></div><div class="section" title="Multiple Thread Example"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.mt.example_multi"/>Multiple Thread Example</h2></div></div></div><p>
+In the ST example we never used the thread_id variable present in each block.
+Let's start by explaining the purpose of this in a MT application.
+</p><p>
+The concept of "ownership" was introduced since many MT applications
+allocate and deallocate memory to shared containers from different
+threads (such as a cache shared amongst all threads). This introduces
+a problem if the allocator only returns memory to the current threads
+freelist (I.e., there might be one thread doing all the allocation and
+thus obtaining ever more memory from the system and another thread
+that is getting a longer and longer freelist - this will in the end
+consume all available memory).
+</p><p>
+Each time a block is moved from the global list (where ownership is
+irrelevant), to a threads freelist (or when a new freelist is built
+from a chunk directly onto a threads freelist or when a deallocation
+occurs on a block which was not allocated by the same thread id as the
+one doing the deallocation) the thread id is set to the current one.
+</p><p>
+What's the use? Well, when a deallocation occurs we can now look at
+the thread id and find out if it was allocated by another thread id
+and decrease the used counter of that thread instead, thus keeping the
+free and used counters correct. And keeping the free and used counters
+corrects is very important since the relationship between these two
+variables decides if memory should be returned to the global pool or
+not when a deallocation occurs.
+</p><p>
+When the application requests memory (calling allocate()) we first
+look at the requested size and if this is &gt;_S_max_bytes we call new()
+directly and return.
+</p><p>
+If the requested size is within limits we start by finding out from which
+bin we should serve this request by looking in _S_binmap.
+</p><p>
+A call to _S_get_thread_id() returns the thread id for the calling thread
+(and if no value has been set in _S_thread_key, a new id is assigned and
+returned).
+</p><p>
+A quick look at _S_bin[ bin ].first[ thread_id ] tells us if there are
+any blocks of this size on the current threads freelist. If this is
+not NULL - fine, just remove the block that _S_bin[ bin ].first[
+thread_id ] points to from the list, update _S_bin[ bin ].first[
+thread_id ], update the free and used counters and return a pointer to
+that blocks data.
+</p><p>
+If the freelist is empty (the pointer is NULL) we start by looking at
+the global freelist (0). If there are blocks available on the global
+freelist we lock this bins mutex and move up to block_count (the
+number of blocks of this bins size that will fit into a _S_chunk_size)
+or until end of list - whatever comes first - to the current threads
+freelist and at the same time change the thread_id ownership and
+update the counters and pointers. When the bins mutex has been
+unlocked, we remove the block that _S_bin[ bin ].first[ thread_id ]
+points to from the list, update _S_bin[ bin ].first[ thread_id ],
+update the free and used counters, and return a pointer to that blocks
+data.
+</p><p>
+The reason that the number of blocks moved to the current threads
+freelist is limited to block_count is to minimize the chance that a
+subsequent deallocate() call will return the excess blocks to the
+global freelist (based on the _S_freelist_headroom calculation, see
+below).
+</p><p>
+However if there isn't any memory on the global pool we need to get
+memory from the system - this is done in exactly the same way as in a
+single threaded application with one major difference; the list built
+in the newly allocated memory (of _S_chunk_size size) is added to the
+current threads freelist instead of to the global.
+</p><p>
+The basic process of a deallocation call is simple: always add the
+block to the front of the current threads freelist and update the
+counters and pointers (as described earlier with the specific check of
+ownership that causes the used counter of the thread that originally
+allocated the block to be decreased instead of the current threads
+counter).
+</p><p>
+And here comes the free and used counters to service. Each time a
+deallocation() call is made, the length of the current threads
+freelist is compared to the amount memory in use by this thread.
+</p><p>
+Let's go back to the example of an application that has one thread
+that does all the allocations and one that deallocates. Both these
+threads use say 516 32-byte blocks that was allocated during thread
+creation for example. Their used counters will both say 516 at this
+point. The allocation thread now grabs 1000 32-byte blocks and puts
+them in a shared container. The used counter for this thread is now
+1516.
+</p><p>
+The deallocation thread now deallocates 500 of these blocks. For each
+deallocation made the used counter of the allocating thread is
+decreased and the freelist of the deallocation thread gets longer and
+longer. But the calculation made in deallocate() will limit the length
+of the freelist in the deallocation thread to _S_freelist_headroom %
+of it's used counter. In this case, when the freelist (given that the
+_S_freelist_headroom is at it's default value of 10%) exceeds 52
+(516/10) blocks will be returned to the global pool where the
+allocating thread may pick them up and reuse them.
+</p><p>
+In order to reduce lock contention (since this requires this bins
+mutex to be locked) this operation is also made in chunks of blocks
+(just like when chunks of blocks are moved from the global freelist to
+a threads freelist mentioned above). The "formula" used can probably
+be improved to further reduce the risk of blocks being "bounced back
+and forth" between freelists.
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch20s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td align="left" valign="top">Single Thread Example </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 21. The bitmap_allocator</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
index eba8cfb31db..5b62d1fbc72 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch21s02.html
@@ -1,43 +1,313 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>HP/SGI</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="ext_containers.html" title="Chapter 21. Containers"/><link rel="prev" href="ext_containers.html" title="Chapter 21. Containers"/><link rel="next" href="bk01pt03ch21s03.html" title="Deprecated HP/SGI"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HP/SGI</th></tr><tr><td align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 21. Containers</th><td align="right"> <a accesskey="n" href="bk01pt03ch21s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="HP/SGI"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.sgi"/>HP/SGI</h2></div></div></div><p>
- </p><p>A few extensions and nods to backwards-compatibility have been made with
- containers. Those dealing with older SGI-style allocators are dealt with
- elsewhere. The remaining ones all deal with bits:
-</p><p>The old pre-standard <code class="code">bit_vector</code> class is present for
- backwards compatibility. It is simply a typedef for the
- <code class="code">vector&lt;bool&gt;</code> specialization.
-</p><p>The <code class="code">bitset</code> class has a number of extensions, described in the
- rest of this item. First, we'll mention that this implementation of
- <code class="code">bitset&lt;N&gt;</code> is specialized for cases where N number of
- bits will fit into a single word of storage. If your choice of N is
- within that range (&lt;=32 on i686-pc-linux-gnu, for example), then all
- of the operations will be faster.
-</p><p>There are
- versions of single-bit test, set, reset, and flip member functions which
- do no range-checking. If we call them member functions of an instantiation
- of "bitset&lt;N&gt;," then their names and signatures are:
-</p><pre class="programlisting">
- bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos);
- bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos, int val);
- bitset&lt;N&gt;&amp; _Unchecked_reset (size_t pos);
- bitset&lt;N&gt;&amp; _Unchecked_flip (size_t pos);
- bool _Unchecked_test (size_t pos);
- </pre><p>Note that these may in fact be removed in the future, although we have
- no present plans to do so (and there doesn't seem to be any immediate
- reason to).
-</p><p>The semantics of member function <code class="code">operator[]</code> are not specified
- in the C++ standard. A long-standing defect report calls for sensible
- obvious semantics, which are already implemented here: <code class="code">op[]</code>
- on a const bitset returns a bool, and for a non-const bitset returns a
- <code class="code">reference</code> (a nested type). However, this implementation does
- no range-checking on the index argument, which is in keeping with other
- containers' <code class="code">op[]</code> requirements. The defect report's proposed
- resolution calls for range-checking to be done. We'll just wait and see...
-</p><p>Finally, two additional searching functions have been added. They return
- the index of the first "on" bit, and the index of the first
- "on" bit that is after <code class="code">prev</code>, respectively:
-</p><pre class="programlisting">
- size_t _Find_first() const;
- size_t _Find_next (size_t prev) const;</pre><p>The same caveat given for the _Unchecked_* functions applies here also.
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch21s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 21. Containers </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Deprecated HP/SGI</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator"/><link rel="prev" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator"/><link rel="next" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 21. The bitmap_allocator</th><td align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.bitmap.impl"/>Implementation</h2></div></div></div><div class="section" title="Free List Store"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.free_list_store"/>Free List Store</h3></div></div></div><p>
+ The Free List Store (referred to as FLS for the remaining part of this
+ document) is the Global memory pool that is shared by all instances of
+ the bitmapped allocator instantiated for any type. This maintains a
+ sorted order of all free memory blocks given back to it by the
+ bitmapped allocator, and is also responsible for giving memory to the
+ bitmapped allocator when it asks for more.
+ </p><p>
+ Internally, there is a Free List threshold which indicates the
+ Maximum number of free lists that the FLS can hold internally
+ (cache). Currently, this value is set at 64. So, if there are
+ more than 64 free lists coming in, then some of them will be given
+ back to the OS using operator delete so that at any given time the
+ Free List's size does not exceed 64 entries. This is done because
+ a Binary Search is used to locate an entry in a free list when a
+ request for memory comes along. Thus, the run-time complexity of
+ the search would go up given an increasing size, for 64 entries
+ however, lg(64) == 6 comparisons are enough to locate the correct
+ free list if it exists.
+ </p><p>
+ Suppose the free list size has reached its threshold, then the
+ largest block from among those in the list and the new block will
+ be selected and given back to the OS. This is done because it
+ reduces external fragmentation, and allows the OS to use the
+ larger blocks later in an orderly fashion, possibly merging them
+ later. Also, on some systems, large blocks are obtained via calls
+ to mmap, so giving them back to free system resources becomes most
+ important.
+ </p><p>
+ The function _S_should_i_give decides the policy that determines
+ whether the current block of memory should be given to the
+ allocator for the request that it has made. That's because we may
+ not always have exact fits for the memory size that the allocator
+ requests. We do this mainly to prevent external fragmentation at
+ the cost of a little internal fragmentation. Now, the value of
+ this internal fragmentation has to be decided by this function. I
+ can see 3 possibilities right now. Please add more as and when you
+ find better strategies.
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Equal size check. Return true only when the 2 blocks are of equal
+size.</p></li><li class="listitem"><p>Difference Threshold: Return true only when the _block_size is
+greater than or equal to the _required_size, and if the _BS is &gt; _RS
+by a difference of less than some THRESHOLD value, then return true,
+else return false. </p></li><li class="listitem"><p>Percentage Threshold. Return true only when the _block_size is
+greater than or equal to the _required_size, and if the _BS is &gt; _RS
+by a percentage of less than some THRESHOLD value, then return true,
+else return false.</p></li></ol></div><p>
+ Currently, (3) is being used with a value of 36% Maximum wastage per
+ Super Block.
+ </p></div><div class="section" title="Super Block"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.super_block"/>Super Block</h3></div></div></div><p>
+ A super block is the block of memory acquired from the FLS from
+ which the bitmap allocator carves out memory for single objects
+ and satisfies the user's requests. These super blocks come in
+ sizes that are powers of 2 and multiples of 32
+ (_Bits_Per_Block). Yes both at the same time! That's because the
+ next super block acquired will be 2 times the previous one, and
+ also all super blocks have to be multiples of the _Bits_Per_Block
+ value.
+ </p><p>
+ How does it interact with the free list store?
+ </p><p>
+ The super block is contained in the FLS, and the FLS is responsible for
+ getting / returning Super Bocks to and from the OS using operator new
+ as defined by the C++ standard.
+ </p></div><div class="section" title="Super Block Data Layout"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.super_block_data"/>Super Block Data Layout</h3></div></div></div><p>
+ Each Super Block will be of some size that is a multiple of the
+ number of Bits Per Block. Typically, this value is chosen as
+ Bits_Per_Byte x sizeof(size_t). On an x86 system, this gives the
+ figure 8 x 4 = 32. Thus, each Super Block will be of size 32
+ x Some_Value. This Some_Value is sizeof(value_type). For now, let
+ it be called 'K'. Thus, finally, Super Block size is 32 x K bytes.
+ </p><p>
+ This value of 32 has been chosen because each size_t has 32-bits
+ and Maximum use of these can be made with such a figure.
+ </p><p>
+ Consider a block of size 64 ints. In memory, it would look like this:
+ (assume a 32-bit system where, size_t is a 32-bit entity).
+ </p><div class="table"><a id="id663274"/><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left">268</td><td style="text-align: left">0</td><td style="text-align: left">4294967295</td><td style="text-align: left">4294967295</td><td style="text-align: left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ The first Column(268) represents the size of the Block in bytes as
+ seen by the Bitmap Allocator. Internally, a global free list is
+ used to keep track of the free blocks used and given back by the
+ bitmap allocator. It is this Free List Store that is responsible
+ for writing and managing this information. Actually the number of
+ bytes allocated in this case would be: 4 + 4 + (4x2) + (64x4) =
+ 272 bytes, but the first 4 bytes are an addition by the Free List
+ Store, so the Bitmap Allocator sees only 268 bytes. These first 4
+ bytes about which the bitmapped allocator is not aware hold the
+ value 268.
+ </p><p>
+ What do the remaining values represent?</p><p>
+ The 2nd 4 in the expression is the sizeof(size_t) because the
+ Bitmapped Allocator maintains a used count for each Super Block,
+ which is initially set to 0 (as indicated in the diagram). This is
+ incremented every time a block is removed from this super block
+ (allocated), and decremented whenever it is given back. So, when
+ the used count falls to 0, the whole super block will be given
+ back to the Free List Store.
+ </p><p>
+ The value 4294967295 represents the integer corresponding to the bit
+ representation of all bits set: 11111111111111111111111111111111.
+ </p><p>
+ The 3rd 4x2 is size of the bitmap itself, which is the size of 32-bits
+ x 2,
+ which is 8-bytes, or 2 x sizeof(size_t).
+ </p></div><div class="section" title="Maximum Wasted Percentage"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.max_wasted"/>Maximum Wasted Percentage</h3></div></div></div><p>
+ This has nothing to do with the algorithm per-se,
+ only with some vales that must be chosen correctly to ensure that the
+ allocator performs well in a real word scenario, and maintains a good
+ balance between the memory consumption and the allocation/deallocation
+ speed.
+ </p><p>
+ The formula for calculating the maximum wastage as a percentage:
+ </p><p>
+(32 x k + 1) / (2 x (32 x k + 1 + 32 x c)) x 100.
+ </p><p>
+ where k is the constant overhead per node (e.g., for list, it is
+ 8 bytes, and for map it is 12 bytes) and c is the size of the
+ base type on which the map/list is instantiated. Thus, suppose the
+ type1 is int and type2 is double, they are related by the relation
+ sizeof(double) == 2*sizeof(int). Thus, all types must have this
+ double size relation for this formula to work properly.
+ </p><p>
+ Plugging-in: For List: k = 8 and c = 4 (int and double), we get:
+ 33.376%
+ </p><p>
+For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
+ </p><p>
+ Thus, knowing these values, and based on the sizeof(value_type), we may
+ create a function that returns the Max_Wastage_Percentage for us to use.
+ </p></div><div class="section" title="allocate"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.allocate"/><code class="function">allocate</code></h3></div></div></div><p>
+ The allocate function is specialized for single object allocation
+ ONLY. Thus, ONLY if n == 1, will the bitmap_allocator's
+ specialized algorithm be used. Otherwise, the request is satisfied
+ directly by calling operator new.
+ </p><p>
+ Suppose n == 1, then the allocator does the following:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Checks to see whether a free block exists somewhere in a region
+ of memory close to the last satisfied request. If so, then that
+ block is marked as allocated in the bit map and given to the
+ user. If not, then (2) is executed.
+ </p></li><li class="listitem"><p>
+ Is there a free block anywhere after the current block right
+ up to the end of the memory that we have? If so, that block is
+ found, and the same procedure is applied as above, and
+ returned to the user. If not, then (3) is executed.
+ </p></li><li class="listitem"><p>
+ Is there any block in whatever region of memory that we own
+ free? This is done by checking
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ The use count for each super block, and if that fails then
+ </p></li><li class="listitem"><p>
+ The individual bit-maps for each super block.
+ </p></li></ul></div><p>
+ Note: Here we are never touching any of the memory that the
+ user will be given, and we are confining all memory accesses
+ to a small region of memory! This helps reduce cache
+ misses. If this succeeds then we apply the same procedure on
+ that bit-map as (1), and return that block of memory to the
+ user. However, if this process fails, then we resort to (4).
+ </p></li><li class="listitem"><p>
+ This process involves Refilling the internal exponentially
+ growing memory pool. The said effect is achieved by calling
+ _S_refill_pool which does the following:
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Gets more memory from the Global Free List of the Required
+ size.
+ </p></li><li class="listitem"><p>
+ Adjusts the size for the next call to itself.
+ </p></li><li class="listitem"><p>
+ Writes the appropriate headers in the bit-maps.
+ </p></li><li class="listitem"><p>
+ Sets the use count for that super-block just allocated to 0
+ (zero).
+ </p></li><li class="listitem"><p>
+ All of the above accounts to maintaining the basic invariant
+ for the allocator. If the invariant is maintained, we are
+ sure that all is well. Now, the same process is applied on
+ the newly acquired free blocks, which are dispatched
+ accordingly.
+ </p></li></ul></div></li></ol></div><p>
+Thus, you can clearly see that the allocate function is nothing but a
+combination of the next-fit and first-fit algorithm optimized ONLY for
+single object allocations.
+</p></div><div class="section" title="deallocate"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.deallocate"/><code class="function">deallocate</code></h3></div></div></div><p>
+ The deallocate function again is specialized for single objects ONLY.
+ For all n belonging to &gt; 1, the operator delete is called without
+ further ado, and the deallocate function returns.
+ </p><p>
+ However for n == 1, a series of steps are performed:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ We first need to locate that super-block which holds the memory
+ location given to us by the user. For that purpose, we maintain
+ a static variable _S_last_dealloc_index, which holds the index
+ into the vector of block pairs which indicates the index of the
+ last super-block from which memory was freed. We use this
+ strategy in the hope that the user will deallocate memory in a
+ region close to what he/she deallocated the last time around. If
+ the check for belongs_to succeeds, then we determine the bit-map
+ for the given pointer, and locate the index into that bit-map,
+ and mark that bit as free by setting it.
+ </p></li><li class="listitem"><p>
+ If the _S_last_dealloc_index does not point to the memory block
+ that we're looking for, then we do a linear search on the block
+ stored in the vector of Block Pairs. This vector in code is
+ called _S_mem_blocks. When the corresponding super-block is
+ found, we apply the same procedure as we did for (1) to mark the
+ block as free in the bit-map.
+ </p></li></ol></div><p>
+ Now, whenever a block is freed, the use count of that particular
+ super block goes down by 1. When this use count hits 0, we remove
+ that super block from the list of all valid super blocks stored in
+ the vector. While doing this, we also make sure that the basic
+ invariant is maintained by making sure that _S_last_request and
+ _S_last_dealloc_index point to valid locations within the vector.
+ </p></div><div class="section" title="Questions"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.questions"/>Questions</h3></div></div></div><div class="section" title="1"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.question.1"/>1</h4></div></div></div><p>
+Q1) The "Data Layout" section is
+cryptic. I have no idea of what you are trying to say. Layout of what?
+The free-list? Each bitmap? The Super Block?
+ </p><p>
+ The layout of a Super Block of a given
+size. In the example, a super block of size 32 x 1 is taken. The
+general formula for calculating the size of a super block is
+32 x sizeof(value_type) x 2^n, where n ranges from 0 to 32 for 32-bit
+systems.
+ </p></div><div class="section" title="2"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.question.2"/>2</h4></div></div></div><p>
+ And since I just mentioned the
+term `each bitmap', what in the world is meant by it? What does each
+bitmap manage? How does it relate to the super block? Is the Super
+Block a bitmap as well?
+ </p><p>
+ Each bitmap is part of a Super Block which is made up of 3 parts
+ as I have mentioned earlier. Re-iterating, 1. The use count,
+ 2. The bit-map for that Super Block. 3. The actual memory that
+ will be eventually given to the user. Each bitmap is a multiple
+ of 32 in size. If there are 32 x (2^3) blocks of single objects
+ to be given, there will be '32 x (2^3)' bits present. Each 32
+ bits managing the allocated / free status for 32 blocks. Since
+ each size_t contains 32-bits, one size_t can manage up to 32
+ blocks' status. Each bit-map is made up of a number of size_t,
+ whose exact number for a super-block of a given size I have just
+ mentioned.
+ </p></div><div class="section" title="3"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.question.3"/>3</h4></div></div></div><p>
+ How do the allocate and deallocate functions work in regard to
+ bitmaps?
+ </p><p>
+ The allocate and deallocate functions manipulate the bitmaps and
+ have nothing to do with the memory that is given to the user. As
+ I have earlier mentioned, a 1 in the bitmap's bit field
+ indicates free, while a 0 indicates allocated. This lets us
+ check 32 bits at a time to check whether there is at lease one
+ free block in those 32 blocks by testing for equality with
+ (0). Now, the allocate function will given a memory block find
+ the corresponding bit in the bitmap, and will reset it (i.e.,
+ make it re-set (0)). And when the deallocate function is called,
+ it will again set that bit after locating it to indicate that
+ that particular block corresponding to this bit in the bit-map
+ is not being used by anyone, and may be used to satisfy future
+ requests.
+ </p><p>
+ e.g.: Consider a bit-map of 64-bits as represented below:
+ 1111111111111111111111111111111111111111111111111111111111111111
+ </p><p>
+ Now, when the first request for allocation of a single object
+ comes along, the first block in address order is returned. And
+ since the bit-maps in the reverse order to that of the address
+ order, the last bit (LSB if the bit-map is considered as a
+ binary word of 64-bits) is re-set to 0.
+ </p><p>
+ The bit-map now looks like this:
+ 1111111111111111111111111111111111111111111111111111111111111110
+ </p></div></div><div class="section" title="Locality"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.locality"/>Locality</h3></div></div></div><p>
+ Another issue would be whether to keep the all bitmaps in a
+ separate area in memory, or to keep them near the actual blocks
+ that will be given out or allocated for the client. After some
+ testing, I've decided to keep these bitmaps close to the actual
+ blocks. This will help in 2 ways.
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Constant time access for the bitmap themselves, since no kind of
+look up will be needed to find the correct bitmap list or its
+equivalent.</p></li><li class="listitem"><p>And also this would preserve the cache as far as possible.</p></li></ol></div><p>
+ So in effect, this kind of an allocator might prove beneficial from a
+ purely cache point of view. But this allocator has been made to try and
+ roll out the defects of the node_allocator, wherein the nodes get
+ skewed about in memory, if they are not returned in the exact reverse
+ order or in the same order in which they were allocated. Also, the
+ new_allocator's book keeping overhead is too much for small objects and
+ single object allocations, though it preserves the locality of blocks
+ very well when they are returned back to the allocator.
+ </p></div><div class="section" title="Overhead and Grow Policy"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.grow_policy"/>Overhead and Grow Policy</h3></div></div></div><p>
+ Expected overhead per block would be 1 bit in memory. Also, once
+ the address of the free list has been found, the cost for
+ allocation/deallocation would be negligible, and is supposed to be
+ constant time. For these very reasons, it is very important to
+ minimize the linear time costs, which include finding a free list
+ with a free block while allocating, and finding the corresponding
+ free list for a block while deallocating. Therefore, I have
+ decided that the growth of the internal pool for this allocator
+ will be exponential as compared to linear for
+ node_allocator. There, linear time works well, because we are
+ mainly concerned with speed of allocation/deallocation and memory
+ consumption, whereas here, the allocation/deallocation part does
+ have some linear/logarithmic complexity components in it. Thus, to
+ try and minimize them would be a good thing to do at the cost of a
+ little bit of memory.
+ </p><p>
+ Another thing to be noted is the pool size will double every time
+ the internal pool gets exhausted, and all the free blocks have
+ been given away. The initial size of the pool would be
+ sizeof(size_t) x 8 which is the number of bits in an integer,
+ which can fit exactly in a CPU register. Hence, the term given is
+ exponential growth of the internal pool.
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td align="center"><a accesskey="u" href="bitmap_allocator.html">Up</a></td><td align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 21. The bitmap_allocator </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 22. Policy-Based Data Structures</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html
new file mode 100644
index 00000000000..29d9f5d1db6
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch23s02.html
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Deprecated</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions"/><link rel="prev" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions"/><link rel="next" href="ext_utilities.html" title="Chapter 24. Utilities"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated</th></tr><tr><td align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 23. HP/SGI Extensions</th><td align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr/></div><div class="section" title="Deprecated"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.deprecated_sgi"/>Deprecated</h2></div></div></div><p>
+ The SGI hashing classes <code class="classname">hash_set</code> and
+ <code class="classname">hash_set</code> have been deprecated by the
+ unordered_set, unordered_multiset, unordered_map,
+ unordered_multimap containers in TR1 and the upcoming C++0x, and
+ may be removed in future releases.
+ </p><p>The SGI headers</p><pre class="programlisting">
+ &lt;hash_map&gt;
+ &lt;hash_set&gt;
+ &lt;rope&gt;
+ &lt;slist&gt;
+ &lt;rb_tree&gt;
+ </pre><p>are all here;
+ <code class="code">&lt;hash_map&gt;</code> and <code class="code">&lt;hash_set&gt;</code>
+ are deprecated but available as backwards-compatible extensions,
+ as discussed further below. <code class="code">&lt;rope&gt;</code> is the
+ SGI specialization for large strings ("rope,"
+ "large strings," get it? Love that geeky humor.)
+ <code class="code">&lt;slist&gt;</code> is a singly-linked list, for when the
+ doubly-linked <code class="code">list&lt;&gt;</code> is too much space
+ overhead, and <code class="code">&lt;rb_tree&gt;</code> exposes the red-black
+ tree classes used in the implementation of the standard maps and
+ sets.
+ </p><p>Each of the associative containers map, multimap, set, and multiset
+ have a counterpart which uses a
+ <a class="link" 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 class="link" 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><p>The hashing classes support all the usual associative container
+ functions, as well as some extra constructors specifying the number
+ of buckets, etc.
+ </p><p>Why would you want to use a hashing class instead of the
+ <span class="quote">“<span class="quote">normal</span>”</span>implementations? Matt Austern writes:
+ </p><div class="blockquote"><blockquote class="blockquote"><p>
+ <span class="emphasis"><em>[W]ith a well chosen hash function, hash tables
+ generally provide much better average-case performance than
+ binary search trees, and much worse worst-case performance. So
+ if your implementation has hash_map, if you don't mind using
+ nonstandard components, and if you aren't scared about the
+ possibility of pathological cases, you'll probably get better
+ performance from hash_map.
+ </em></span>
+ </p></blockquote></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 23. HP/SGI Extensions </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 24. Utilities</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch30s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch30s02.html
new file mode 100644
index 00000000000..7d38a24dc7a
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch30s02.html
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Implementation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency"/><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency"/><link rel="next" href="bk01pt03ch30s03.html" title="Use"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td align="right"> <a accesskey="n" href="bk01pt03ch30s03.html">Next</a></td></tr></table><hr/></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.impl"/>Implementation</h2></div></div></div><div class="section" title="Using Builtin Atomic Functions"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"/>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
+implemented via compiler intrinsics (if the underlying host is
+capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as
+the compiler builtins for atomics are not universally implemented,
+using them directly is problematic, and can result in undefined
+function calls. (An example of an undefined symbol from the use
+of <code class="code">__sync_fetch_and_add</code> on an unsupported host is a
+missing reference to <code class="code">__sync_fetch_and_add_4</code>.)
+</p><p>In addition, on some hosts the compiler intrinsics are enabled
+conditionally, via the <code class="code">-march</code> command line flag. This makes
+usage vary depending on the target hardware and the flags used during
+compile.
+</p><p>
+If builtins are possible for bool-sized integral types,
+<code class="code">_GLIBCXX_ATOMIC_BUILTINS_1</code> will be defined.
+If builtins are possible for int-sized integral types,
+<code class="code">_GLIBCXX_ATOMIC_BUILTINS_4</code> will be defined.
+</p><p>For the following hosts, intrinsics are enabled by default.
+</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>alpha</p></li><li class="listitem"><p>ia64</p></li><li class="listitem"><p>powerpc</p></li><li class="listitem"><p>s390</p></li></ul></div><p>For others, some form of <code class="code">-march</code> may work. On
+non-ancient x86 hardware, <code class="code">-march=native</code> usually does the
+trick.</p><p> For hosts without compiler intrinsics, but with capable
+hardware, hand-crafted assembly is selected. This is the case for the following hosts:
+</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>cris</p></li><li class="listitem"><p>hppa</p></li><li class="listitem"><p>i386</p></li><li class="listitem"><p>i486</p></li><li class="listitem"><p>m48k</p></li><li class="listitem"><p>mips</p></li><li class="listitem"><p>sparc</p></li></ul></div><p>And for the rest, a simulated atomic lock via pthreads.
+</p><p> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html"> documentation</a>.
+</p><p> More details on the library fallbacks from the porting <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">section</a>.
+</p></div><div class="section" title="Thread Abstraction"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.thread"/>Thread Abstraction</h3></div></div></div><p>A thin layer above IEEE 1003.1 (i.e. pthreads) is used to abstract
+the thread interface for GCC. This layer is called "gthread," and is
+comprised of one header file that wraps the host's default thread layer with
+a POSIX-like interface.
+</p><p> The file &lt;gthr-default.h&gt; points to the deduced wrapper for
+the current host. In libstdc++ implementation files,
+&lt;bits/gthr.h&gt; is used to select the proper gthreads file.
+</p><p>Within libstdc++ sources, all calls to underlying thread functionality
+use this layer. More detail as to the specific interface can be found in the source <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00883_source.html">documentation</a>.
+</p><p>By design, the gthread layer is interoperable with the types,
+functions, and usage found in the usual &lt;pthread.h&gt; file,
+including <code class="code">pthread_t</code>, <code class="code">pthread_once_t</code>, <code class="code">pthread_create</code>,
+etc.
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch30s03.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 30. Concurrency </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Use</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch30s03.html b/libstdc++-v3/doc/html/manual/bk01pt03ch30s03.html
new file mode 100644
index 00000000000..81df30435e5
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/bk01pt03ch30s03.html
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Use</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency"/><link rel="prev" href="bk01pt03ch30s02.html" title="Implementation"/><link rel="next" href="bk01pt04.html" title="Part IV.  Appendices"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch30s02.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td align="right"> <a accesskey="n" href="bk01pt04.html">Next</a></td></tr></table><hr/></div><div class="section" title="Use"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.use"/>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
+</p><pre class="programlisting">
+#include &lt;ext/concurrence.h&gt;
+
+namespace
+{
+ __gnu_cxx::__mutex safe_base_mutex;
+} // anonymous namespace
+
+namespace other
+{
+ void
+ foo()
+ {
+ __gnu_cxx::__scoped_lock sentry(safe_base_mutex);
+ for (int i = 0; i &lt; max; ++i)
+ {
+ _Safe_iterator_base* __old = __iter;
+ __iter = __iter-&lt;_M_next;
+ __old-&lt;_M_detach_single();
+ }
+}
+</pre><p>In this sample code, an anonymous namespace is used to keep
+the <code class="code">__mutex</code> private to the compilation unit,
+and <code class="code">__scoped_lock</code> is used to guard access to the critical
+section within the for loop, locking the mutex on creation and freeing
+the mutex as control moves out of this block.
+</p><p>Several exception classes are used to keep track of
+concurrence-related errors. These classes
+are: <code class="code">__concurrence_lock_error</code>, <code class="code">__concurrence_unlock_error</code>, <code class="code">__concurrence_wait_error</code>,
+and <code class="code">__concurrence_broadcast_error</code>.
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch30s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt04.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Part IV. 
+ Appendices
+</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
index 7ca94896fff..7e3eb4ac9dc 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt03pr01.html
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="extensions.html" title="Part III.  Extensions"/><link rel="next" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="extensions.html" title="Part III.  Extensions"/><link rel="next" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"/></tr><tr><td align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr/></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a id="id472170"/></h1></div></div></div><p>
- Here we will make an attempt at describing the non-Standard extensions to
- the library. Some of these are from SGI's STL, some of these are GNU's,
- and some just seemed to appear on the doorstep.
+</th><td align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr/></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a id="id654345"/></h1></div></div></div><p>
+ Here we will make an attempt at describing the non-Standard
+ extensions to the library. Some of these are from older versions of
+ standard library components, namely SGI's STL, and some of these are
+ GNU's.
</p><p><span class="emphasis"><em>Before</em></span> you leap in and use any of these
extensions, be aware of two things:
</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
@@ -23,4 +24,4 @@ extensions, be aware of two things:
</p></li></ol></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr><tr><td align="left" valign="top">Part III. 
Extensions
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 16. Compile Time Checks</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 16. Compile Time Checks</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt04.html b/libstdc++-v3/doc/html/manual/bk01pt04.html
index acdf72acafd..a12cff854f4 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt04.html
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part IV.  Appendices</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library Manual"/><link rel="prev" href="bk01pt03ch28s03.html" title="Use"/><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part IV.  Appendices</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library Manual"/><link rel="prev" href="bk01pt03ch30s03.html" title="Use"/><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IV. 
Appendices
-</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch28s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part IV.  Appendices"><div class="titlepage"><div><div><h1 class="title"><a id="appendix"/>Part IV. 
+</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch30s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part IV.  Appendices"><div class="titlepage"><div><div><h1 class="title"><a id="appendix"/>Part IV. 
Appendices
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="appendix"><a href="appendix_contributing.html">A.
Contributing
@@ -10,12 +10,34 @@
</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B.
Porting and Maintenance
-</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
+</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
+ Qualifying Exception Safety Guarantees
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
+ Existing tests
+</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
+C++0x Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+ Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
+ extensions
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+No <code class="code">stream::attach(int fd)</code>
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+Support for C++98 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+Support for C++TR1 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
+Support for C++0x dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
+ Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
Free Software Needs Free Documentation
</a></span></dt><dt><span class="appendix"><a href="appendix_gpl.html">D.
<acronym class="acronym">GNU</acronym> General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch28s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="spine.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr><tr><td align="left" valign="top">Use </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Appendix A. 
+ </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch30s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr><tr><td align="left" valign="top">Use </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Appendix A. 
Contributing
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index eb6efdcaf5f..a3dcaaf94cf 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Bugs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="status.html" title="Chapter 1. Status"/><link rel="prev" href="license.html" title="License"/><link rel="next" href="setup.html" title="Chapter 2. Setup"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr/></div><div class="section" title="Bugs"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.bugs"/>Bugs</h2></div></div></div><div class="section" title="Implementation Bugs"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"/>Implementation Bugs</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Bugs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="status.html" title="Chapter 1. Status"/><link rel="prev" href="license.html" title="License"/><link rel="next" href="setup.html" title="Chapter 2. Setup"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr/></div><div class="section" title="Bugs"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.bugs"/>Bugs</h2></div></div></div><div class="section" title="Implementation Bugs"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"/>Implementation Bugs</h3></div></div></div><p>
Information on known bugs, details on efforts to fix them, and
fixed bugs are all available as part of the <a class="link" href="http://gcc.gnu.org/bugs/">GCC bug tracking system</a>,
with the category set to <code class="literal">libstdc++</code>.
@@ -349,4 +349,4 @@
<span class="emphasis"><em>More algorithms that throw away information</em></span>
</span></dt><dd><p>The traditional HP / SGI return type and value is blessed
by the resolution of the DR.
- </p></dd></dl></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="license.html">Prev</a> </td><td align="center"><a accesskey="u" href="status.html">Up</a></td><td align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td align="left" valign="top">License </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>
+ </p></dd></dl></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="license.html">Prev</a> </td><td align="center"><a accesskey="u" href="status.html">Up</a></td><td align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td align="left" valign="top">License </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/concurrency.html b/libstdc++-v3/doc/html/manual/concurrency.html
index 5031a3299e5..7294c3ccd8d 100644
--- a/libstdc++-v3/doc/html/manual/concurrency.html
+++ b/libstdc++-v3/doc/html/manual/concurrency.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 15.  Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; mutex&#10; , &#10; thread&#10; , &#10; future&#10; , &#10; condition_variable&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="atomics.html" title="Chapter 14.  Atomics"/><link rel="next" href="extensions.html" title="Part III.  Extensions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 15.  Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; mutex&#10; , &#10; thread&#10; , &#10; future&#10; , &#10; condition_variable&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="atomics.html" title="Chapter 14.  Atomics"/><link rel="next" href="extensions.html" title="Part III.  Extensions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. 
Concurrency
</th></tr><tr><td align="left"><a accesskey="p" href="atomics.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 15.  Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency"/>Chapter 15. 
Concurrency
- <a id="id471987" class="indexterm"/>
+ <a id="id654161" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></div><p>
Facilities for concurrent operation, and control thereof.
</p><div class="section" title="API Reference"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency.api"/>API Reference</h2></div></div></div><p>
@@ -36,7 +36,7 @@
</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="atomics.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 14. 
Atomics
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Part III. 
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Part III. 
Extensions
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 70409d0c42f..92809aa09e9 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Configure</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; configure&#10; , &#10; options&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="setup.html" title="Chapter 2. Setup"/><link rel="prev" href="setup.html" title="Chapter 2. Setup"/><link rel="next" href="make.html" title="Make"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr/></div><div class="section" title="Configure"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.configure"/>Configure</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Configure</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; configure&#10; , &#10; options&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="setup.html" title="Chapter 2. Setup"/><link rel="prev" href="setup.html" title="Chapter 2. Setup"/><link rel="next" href="make.html" title="Make"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr/></div><div class="section" title="Configure"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.configure"/>Configure</h2></div></div></div><p>
When configuring libstdc++, you'll have to configure the entire
<span class="emphasis"><em>gccsrcdir</em></span> directory. Consider using the
toplevel gcc configuration option
@@ -208,4 +208,4 @@
<span class="emphasis"><em>freestanding</em></span> environment, in which only a
minimal set of headers are provided. This option builds such an
environment.
- </p></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td align="center"><a accesskey="u" href="setup.html">Up</a></td><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 2. Setup </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Make</td></tr></table></div></body></html>
+ </p></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td align="center"><a accesskey="u" href="setup.html">Up</a></td><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 2. Setup </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Make</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/containers.html b/libstdc++-v3/doc/html/manual/containers.html
index 14b37374140..b95e4805a52 100644
--- a/libstdc++-v3/doc/html/manual/containers.html
+++ b/libstdc++-v3/doc/html/manual/containers.html
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 9.  Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="facets.html" title="Facets"/><link rel="next" href="associative.html" title="Associative"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 9.  Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="facets.html" title="Facets"/><link rel="next" href="associative.html" title="Associative"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. 
Containers
</th></tr><tr><td align="left"><a accesskey="p" href="facets.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 9.  Containers"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"/>Chapter 9. 
Containers
- <a id="id469034" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section" title="Sequences"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers.sequences"/>Sequences</h2></div></div></div><div class="section" title="list"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"/>list</h3></div></div></div><div class="section" title="list::size() is O(n)"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"/>list::size() is O(n)</h4></div></div></div><p>
+ <a id="id651208" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section" title="Sequences"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers.sequences"/>Sequences</h2></div></div></div><div class="section" title="list"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"/>list</h3></div></div></div><div class="section" title="list::size() is O(n)"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"/>list::size() is O(n)</h4></div></div></div><p>
Yes it is, and that's okay. This is a decision that we preserved
when we imported SGI's STL implementation. The following is
quoted from <a class="link" href="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</a>:
@@ -52,4 +52,4 @@
</p><p>
The first two alpha releases were announced <a class="link" href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00048.html">here</a>
and <a class="link" href="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html">here</a>.
- </p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="facets.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr><tr><td align="left" valign="top">Facets </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Associative</td></tr></table></div></body></html>
+ </p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="facets.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr><tr><td align="left" valign="top">Facets </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Associative</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/containers_and_c.html b/libstdc++-v3/doc/html/manual/containers_and_c.html
index 3e612aa5a50..33ae476501f 100644
--- a/libstdc++-v3/doc/html/manual/containers_and_c.html
+++ b/libstdc++-v3/doc/html/manual/containers_and_c.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="containers.html" title="Chapter 9.  Containers"/><link rel="prev" href="associative.html" title="Associative"/><link rel="next" href="iterators.html" title="Chapter 10.  Iterators"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="containers.html" title="Chapter 9.  Containers"/><link rel="prev" href="associative.html" title="Associative"/><link rel="next" href="iterators.html" title="Chapter 10.  Iterators"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9. 
Containers
</th><td align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr></table><hr/></div><div class="section" title="Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers.c"/>Interacting with C</h2></div></div></div><div class="section" title="Containers vs. Arrays"><div class="titlepage"><div><div><h3 class="title"><a id="containers.c.vs_array"/>Containers vs. Arrays</h3></div></div></div><p>
@@ -84,7 +84,7 @@ template&lt;typename T, unsigned int sz&gt;
inline unsigned int lengthof (T (&amp;)[sz]) { return sz; }
</pre><p>
looks just weird! Hint: unused parameters can be left nameless.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="associative.html">Prev</a> </td><td align="center"><a accesskey="u" href="containers.html">Up</a></td><td align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr><tr><td align="left" valign="top">Associative </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 10. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="associative.html">Prev</a> </td><td align="center"><a accesskey="u" href="containers.html">Up</a></td><td align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr><tr><td align="left" valign="top">Associative </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 10. 
Iterators
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html
index 55b5abf7674..70edbf2a59e 100644
--- a/libstdc++-v3/doc/html/manual/debug.html
+++ b/libstdc++-v3/doc/html/manual/debug.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_exceptions.html" title="Exceptions"/><link rel="next" href="bk01pt02.html" title="Part II.  Standard Contents"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr></table><hr/></div><div class="section" title="Debugging Support"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.debug"/>Debugging Support</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Debugging Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_exceptions.html" title="Exceptions"/><link rel="next" href="bk01pt02.html" title="Part II.  Standard Contents"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr></table><hr/></div><div class="section" title="Debugging Support"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.debug"/>Debugging Support</h2></div></div></div><p>
There are numerous things that can be done to improve the ease with
which C++ binaries are debugged when using the GNU tool chain. Here
are some of them.
@@ -67,7 +67,7 @@
thing of great importance to keep in mind when debugging C++ code
that uses <code class="code">new</code> and <code class="code">delete</code>: there are
different kinds of allocation schemes that can be used by <code class="code">
- std::allocator </code>. For implementation details, see the <a class="link" href="ext_allocators.html#manual.ext.allocator.mt" title="mt_allocator">mt allocator</a> documentation and
+ std::allocator </code>. For implementation details, see the <a class="link" href="mt_allocator.html" title="Chapter 20. The mt_allocator">mt allocator</a> documentation and
look specifically for <code class="code">GLIBCXX_FORCE_NEW</code>.
</p><p>
In a nutshell, the default allocator used by <code class="code">
@@ -226,6 +226,6 @@
</p></div><div class="section" title="Profile-based Performance Analysis"><div class="titlepage"><div><div><h3 class="title"><a id="debug.profile_mode"/>Profile-based Performance Analysis</h3></div></div></div><p> The <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">Profile-based
Performance Analysis</a> Extension has performance checks for many
algorithms.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr><tr><td align="left" valign="top">Exceptions </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Part II. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt02.html">Next</a></td></tr><tr><td align="left" valign="top">Exceptions </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Part II. 
Standard Contents
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/debug_mode.html b/libstdc++-v3/doc/html/manual/debug_mode.html
index f35960b53b7..99a90e5f300 100644
--- a/libstdc++-v3/doc/html/manual/debug_mode.html
+++ b/libstdc++-v3/doc/html/manual/debug_mode.html
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 17. Debug Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks"/><link rel="next" href="bk01pt03ch17s02.html" title="Semantics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Debug Mode</th></tr><tr><td align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 17. Debug Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks"/><link rel="next" href="bk01pt03ch17s02.html" title="Semantics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Debug Mode</th></tr><tr><td align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 17. Debug Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"/>Chapter 17. Debug Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></div><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.intro"/>Intro</h2></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch17s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 17. Debug Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"/>Chapter 17. Debug Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+ debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></div><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode.intro"/>Intro</h2></div></div></div><p>
By default, libstdc++ is built with efficiency in mind, and
therefore performs little or no error checking that is not
required by the C++ standard. This means that programs that
@@ -34,4 +35,4 @@
the same predicate that was passed
to <code class="code">set_intersection</code>; the libstdc++ debug mode will
detect an error if the sequence is not sorted or was sorted by a
- different predicate.</p></li></ul></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s02.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 16. Compile Time Checks </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Semantics</td></tr></table></div></body></html>
+ different predicate.</p></li></ul></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch17s02.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 16. Compile Time Checks </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Semantics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/diagnostics.html b/libstdc++-v3/doc/html/manual/diagnostics.html
index d4fbf34d856..399d7719d07 100644
--- a/libstdc++-v3/doc/html/manual/diagnostics.html
+++ b/libstdc++-v3/doc/html/manual/diagnostics.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 5.  Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="termination.html" title="Termination"/><link rel="next" href="bk01pt02ch05s02.html" title="Concept Checking"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 5.  Diagnostics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="termination.html" title="Termination"/><link rel="next" href="bk01pt02ch05s02.html" title="Concept Checking"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
Diagnostics
</th></tr><tr><td align="left"><a accesskey="p" href="termination.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="bk01pt02ch05s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 5.  Diagnostics"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics"/>Chapter 5. 
Diagnostics
- <a id="id462650" class="indexterm"/>
+ <a id="id632643" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></div><div class="section" title="Exceptions"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics.exceptions"/>Exceptions</h2></div></div></div><div class="section" title="API Reference"><div class="titlepage"><div><div><h3 class="title"><a id="std.diagnostics.exceptions.api"/>API Reference</h3></div></div></div><p>
All exception objects are defined in one of the standard header
files: <code class="filename">exception</code>,
@@ -40,4 +40,4 @@
int e;
DBID id; // some user-defined type
};
- </pre></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="termination.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt02ch05s02.html">Next</a></td></tr><tr><td align="left" valign="top">Termination </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Concept Checking</td></tr></table></div></body></html>
+ </pre></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="termination.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt02ch05s02.html">Next</a></td></tr><tr><td align="left" valign="top">Termination </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Concept Checking</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/documentation_hacking.html b/libstdc++-v3/doc/html/manual/documentation_hacking.html
index 3ad897f1509..293d2a922d7 100644
--- a/libstdc++-v3/doc/html/manual/documentation_hacking.html
+++ b/libstdc++-v3/doc/html/manual/documentation_hacking.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Writing and Generating Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="ISO C++, documentation, style, docbook, doxygen"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="next" href="internals.html" title="Porting to New Hardware or Operating Systems"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing and Generating Documentation</th></tr><tr><td align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Writing and Generating Documentation</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="ISO C++, documentation, style, docbook, doxygen"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="next" href="internals.html" title="Porting to New Hardware or Operating Systems"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing and Generating Documentation</th></tr><tr><td align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr></table><hr/></div><div class="section" title="Writing and Generating Documentation"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.doc"/>Writing and Generating Documentation</h2></div></div></div><div class="section" title="Introduction"><div class="titlepage"><div><div><h3 class="title"><a id="doc.intro"/>Introduction</h3></div></div></div><p>
@@ -117,7 +117,7 @@
supported, and are always aliased to dummy rules. These
unsupported formats are: <span class="emphasis"><em>info</em></span>,
<span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
- </p></div><div class="section" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"/>Doxygen</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id485371"/><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">coreutils</td><td style="text-align: center">8.5</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">bash</td><td style="text-align: center">4.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">doxygen</td><td style="text-align: center">1.7.0</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">graphviz</td><td style="text-align: center">2.26</td><td style="text-align: center">graphical hierarchies</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p></div><div class="section" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"/>Doxygen</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id701803"/><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">coreutils</td><td style="text-align: center">8.5</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">bash</td><td style="text-align: center">4.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">doxygen</td><td style="text-align: center">1.7.0</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">graphviz</td><td style="text-align: center">2.26</td><td style="text-align: center">graphical hierarchies</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr></tbody></table></div></div><br class="table-break"/><p>
Prerequisite tools are Bash 2.0 or later,
<a class="link" href="http://www.doxygen.org/">Doxygen</a>, and
the <a class="link" href="http://www.gnu.org/software/coreutils/">GNU
@@ -263,7 +263,7 @@
writing Doxygen comments. Single and double quotes, and
separators in filenames are two common trouble spots. When in
doubt, consult the following table.
- </p><div class="table"><a id="id485873"/><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Doxygen</th></tr></thead><tbody><tr><td style="text-align: left">\</td><td style="text-align: left">\\</td></tr><tr><td style="text-align: left">"</td><td style="text-align: left">\"</td></tr><tr><td style="text-align: left">'</td><td style="text-align: left">\'</td></tr><tr><td style="text-align: left">&lt;i&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;b&gt;</td><td style="text-align: left">@b word</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">@c word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="section" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"/>Docbook</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id486035"/><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">docbook5-style-xsl</td><td style="text-align: center">1.76.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xsltproc</td><td style="text-align: center">1.1.26</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xmllint</td><td style="text-align: center">2.7.7</td><td style="text-align: center">validation</td></tr><tr><td style="text-align: center">dblatex</td><td style="text-align: center">0.3</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">docbook2X</td><td style="text-align: center">0.8.8</td><td style="text-align: center">info output</td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id702306"/><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Doxygen</th></tr></thead><tbody><tr><td style="text-align: left">\</td><td style="text-align: left">\\</td></tr><tr><td style="text-align: left">"</td><td style="text-align: left">\"</td></tr><tr><td style="text-align: left">'</td><td style="text-align: left">\'</td></tr><tr><td style="text-align: left">&lt;i&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;b&gt;</td><td style="text-align: left">@b word</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">@c word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">@a word</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;em&gt;two words or more&lt;/em&gt;</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="section" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"/>Docbook</h3></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"/>Prerequisites</h4></div></div></div><div class="table"><a id="id702468"/><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col style="text-align: center" class="c1"/><col style="text-align: center" class="c2"/><col style="text-align: center" class="c3"/></colgroup><thead><tr><th style="text-align: center">Tool</th><th style="text-align: center">Version</th><th style="text-align: center">Required By</th></tr></thead><tbody><tr><td style="text-align: center">docbook5-style-xsl</td><td style="text-align: center">1.76.1</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xsltproc</td><td style="text-align: center">1.1.26</td><td style="text-align: center">all</td></tr><tr><td style="text-align: center">xmllint</td><td style="text-align: center">2.7.7</td><td style="text-align: center">validation</td></tr><tr><td style="text-align: center">dblatex</td><td style="text-align: center">0.3</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">pdflatex</td><td style="text-align: center">2007-59</td><td style="text-align: center">pdf output</td></tr><tr><td style="text-align: center">docbook2X</td><td style="text-align: center">0.8.8</td><td style="text-align: center">info output</td></tr></tbody></table></div></div><br class="table-break"/><p>
Editing the DocBook sources requires an XML editor. Many
exist: some notable options
include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
@@ -419,11 +419,11 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
<a class="link" href="http://www.docbook.org/tdg/en/html/part2.html">online</a>.
An incomplete reference for HTML to Docbook conversion is
detailed in the table below.
- </p><div class="table"><a id="id486512"/><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Docbook</th></tr></thead><tbody><tr><td style="text-align: left">&lt;p&gt;</td><td style="text-align: left">&lt;para&gt;</td></tr><tr><td style="text-align: left">&lt;pre&gt;</td><td style="text-align: left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
+ </p><div class="table"><a id="id702945"/><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">HTML</th><th style="text-align: left">Docbook</th></tr></thead><tbody><tr><td style="text-align: left">&lt;p&gt;</td><td style="text-align: left">&lt;para&gt;</td></tr><tr><td style="text-align: left">&lt;pre&gt;</td><td style="text-align: left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
&lt;literallayout&gt;</td></tr><tr><td style="text-align: left">&lt;ul&gt;</td><td style="text-align: left">&lt;itemizedlist&gt;</td></tr><tr><td style="text-align: left">&lt;ol&gt;</td><td style="text-align: left">&lt;orderedlist&gt;</td></tr><tr><td style="text-align: left">&lt;il&gt;</td><td style="text-align: left">&lt;listitem&gt;</td></tr><tr><td style="text-align: left">&lt;dl&gt;</td><td style="text-align: left">&lt;variablelist&gt;</td></tr><tr><td style="text-align: left">&lt;dt&gt;</td><td style="text-align: left">&lt;term&gt;</td></tr><tr><td style="text-align: left">&lt;dd&gt;</td><td style="text-align: left">&lt;listitem&gt;</td></tr><tr><td style="text-align: left">&lt;a href=""&gt;</td><td style="text-align: left">&lt;ulink url=""&gt;</td></tr><tr><td style="text-align: left">&lt;code&gt;</td><td style="text-align: left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td style="text-align: left">&lt;strong&gt;</td><td style="text-align: left">&lt;emphasis&gt;</td></tr><tr><td style="text-align: left">&lt;em&gt;</td><td style="text-align: left">&lt;emphasis&gt;</td></tr><tr><td style="text-align: left">"</td><td style="text-align: left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break"/><p>
And examples of detailed markup for which there are no real HTML
equivalents are listed in the table below.
-</p><div class="table"><a id="id486714"/><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Element</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left">&lt;structname&gt;</td><td style="text-align: left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td style="text-align: left">&lt;classname&gt;</td><td style="text-align: left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td style="text-align: left">&lt;function&gt;</td><td style="text-align: left">
+</p><div class="table"><a id="id703147"/><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Element</th><th style="text-align: left">Use</th></tr></thead><tbody><tr><td style="text-align: left">&lt;structname&gt;</td><td style="text-align: left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td style="text-align: left">&lt;classname&gt;</td><td style="text-align: left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td style="text-align: left">&lt;function&gt;</td><td style="text-align: left">
<p>&lt;function&gt;clear()&lt;/function&gt;</p>
<p>&lt;function&gt;fs.clear()&lt;/function&gt;</p>
</td></tr><tr><td style="text-align: left">&lt;type&gt;</td><td style="text-align: left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td style="text-align: left">&lt;varname&gt;</td><td style="text-align: left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td style="text-align: left">&lt;literal&gt;</td><td style="text-align: left">
@@ -439,4 +439,4 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
</td></tr></tbody></table></div></div><br class="table-break"/></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr><tr><td align="left" valign="top">Appendix B. 
Porting and Maintenance
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Porting to New Hardware or Operating Systems</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Porting to New Hardware or Operating Systems</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/dynamic_memory.html b/libstdc++-v3/doc/html/manual/dynamic_memory.html
index 481347bef07..4303d3fe685 100644
--- a/libstdc++-v3/doc/html/manual/dynamic_memory.html
+++ b/libstdc++-v3/doc/html/manual/dynamic_memory.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Dynamic Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="support.html" title="Chapter 4.  Support"/><link rel="prev" href="support.html" title="Chapter 4.  Support"/><link rel="next" href="termination.html" title="Termination"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Dynamic Memory</th></tr><tr><td align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Dynamic Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="support.html" title="Chapter 4.  Support"/><link rel="prev" href="support.html" title="Chapter 4.  Support"/><link rel="next" href="termination.html" title="Termination"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Dynamic Memory</th></tr><tr><td align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
Support
</th><td align="right"> <a accesskey="n" href="termination.html">Next</a></td></tr></table><hr/></div><div class="section" title="Dynamic Memory"><div class="titlepage"><div><div><h2 class="title"><a id="std.support.memory"/>Dynamic Memory</h2></div></div></div><p>
@@ -69,4 +69,4 @@
</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="support.html">Prev</a> </td><td align="center"><a accesskey="u" href="support.html">Up</a></td><td align="right"> <a accesskey="n" href="termination.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 4. 
Support
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Termination</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Termination</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_algorithms.html b/libstdc++-v3/doc/html/manual/ext_algorithms.html
index 354dd9bbc7c..744829a65f1 100644
--- a/libstdc++-v3/doc/html/manual/ext_algorithms.html
+++ b/libstdc++-v3/doc/html/manual/ext_algorithms.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 23. Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_utilities.html" title="Chapter 22. Utilities"/><link rel="next" href="ext_numerics.html" title="Chapter 24. Numerics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. Algorithms</th></tr><tr><td align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 25. Algorithms</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_utilities.html" title="Chapter 24. Utilities"/><link rel="next" href="ext_numerics.html" title="Chapter 26. Numerics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Algorithms</th></tr><tr><td align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 23. Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"/>Chapter 23. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
+</th><td align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 25. Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"/>Chapter 25. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
and count_if. The standard versions return their results. The
additional signatures return void, but take a final parameter by
reference to which they assign their results, e.g.,
@@ -20,4 +20,4 @@
</p><pre class="programlisting">
lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,
_InputIter2 first2, _InputIter2 last2)</pre><p>which does... what?
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 22. Utilities </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 24. Numerics</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 24. Utilities </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 26. Numerics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_allocators.html b/libstdc++-v3/doc/html/manual/ext_allocators.html
deleted file mode 100644
index bd283b75c40..00000000000
--- a/libstdc++-v3/doc/html/manual/ext_allocators.html
+++ /dev/null
@@ -1,397 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 20. Allocators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch19s07.html" title="Diagnostics"/><link rel="next" href="bitmap_allocator.html" title="bitmap_allocator"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. Allocators</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s07.html">Prev</a> </td><th width="60%" align="center">Part III. 
- Extensions
-
-</th><td align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 20. Allocators"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator"/>Chapter 20. Allocators</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></div><div class="section" title="mt_allocator"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"/>mt_allocator</h2></div></div></div><p>
-</p><div class="section" title="Intro"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.intro"/>Intro</h3></div></div></div><p>
- The mt allocator [hereinafter referred to simply as "the allocator"]
- is a fixed size (power of two) allocator that was initially
- developed specifically to suit the needs of multi threaded
- applications [hereinafter referred to as an MT application]. Over
- time the allocator has evolved and been improved in many ways, in
- particular it now also does a good job in single threaded
- applications [hereinafter referred to as a ST application]. (Note:
- In this document, when referring to single threaded applications
- this also includes applications that are compiled with gcc without
- thread support enabled. This is accomplished using ifdef's on
- __GTHREADS). This allocator is tunable, very flexible, and capable
- of high-performance.
-</p><p>
- The aim of this document is to describe - from an application point of
- view - the "inner workings" of the allocator.
-</p></div><div class="section" title="Design Issues"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.design_issues"/>Design Issues</h3></div></div></div><div class="section" title="Overview"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.overview"/>Overview</h4></div></div></div><p> There are three general components to the allocator: a datum
-describing the characteristics of the memory pool, a policy class
-containing this pool that links instantiation types to common or
-individual pools, and a class inheriting from the policy class that is
-the actual allocator.
-</p><p>The datum describing pools characteristics is
-</p><pre class="programlisting">
- template&lt;bool _Thread&gt;
- class __pool
-</pre><p> This class is parametrized on thread support, and is explicitly
-specialized for both multiple threads (with <code class="code">bool==true</code>)
-and single threads (via <code class="code">bool==false</code>.) It is possible to
-use a custom pool datum instead of the default class that is provided.
-</p><p> There are two distinct policy classes, each of which can be used
-with either type of underlying pool datum.
-</p><pre class="programlisting">
- template&lt;bool _Thread&gt;
- struct __common_pool_policy
-
- template&lt;typename _Tp, bool _Thread&gt;
- struct __per_type_pool_policy
-</pre><p> The first policy, <code class="code">__common_pool_policy</code>, implements a
-common pool. This means that allocators that are instantiated with
-different types, say <code class="code">char</code> and <code class="code">long</code> will both
-use the same pool. This is the default policy.
-</p><p> The second policy, <code class="code">__per_type_pool_policy</code>, implements
-a separate pool for each instantiating type. Thus, <code class="code">char</code>
-and <code class="code">long</code> will use separate pools. This allows per-type
-tuning, for instance.
-</p><p> Putting this all together, the actual allocator class is
-</p><pre class="programlisting">
- template&lt;typename _Tp, typename _Poolp = __default_policy&gt;
- class __mt_alloc : public __mt_alloc_base&lt;_Tp&gt;, _Poolp
-</pre><p> This class has the interface required for standard library allocator
-classes, namely member functions <code class="code">allocate</code> and
-<code class="code">deallocate</code>, plus others.
-</p></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.impl"/>Implementation</h3></div></div></div><div class="section" title="Tunable Parameters"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.tune"/>Tunable Parameters</h4></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
-exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all
-these parameters, which include settings for
-</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only
-happen before any allocations take place, when the allocator itself is
-initialized. For instance:
-</p><pre class="programlisting">
-#include &lt;ext/mt_allocator.h&gt;
-
-struct pod
-{
- int i;
- int j;
-};
-
-int main()
-{
- typedef pod value_type;
- typedef __gnu_cxx::__mt_alloc&lt;value_type&gt; allocator_type;
- typedef __gnu_cxx::__pool_base::_Tune tune_type;
-
- tune_type t_default;
- tune_type t_opt(16, 5120, 32, 5120, 20, 10, false);
- tune_type t_single(16, 5120, 32, 5120, 1, 10, false);
-
- tune_type t;
- t = allocator_type::_M_get_options();
- allocator_type::_M_set_options(t_opt);
- t = allocator_type::_M_get_options();
-
- allocator_type a;
- allocator_type::pointer p1 = a.allocate(128);
- allocator_type::pointer p2 = a.allocate(5128);
-
- a.deallocate(p1, 128);
- a.deallocate(p2, 5128);
-
- return 0;
-}
-</pre></div><div class="section" title="Initialization"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.init"/>Initialization</h4></div></div></div><p>
-The static variables (pointers to freelists, tuning parameters etc)
-are initialized as above, or are set to the global defaults.
-</p><p>
-The very first allocate() call will always call the
-_S_initialize_once() function. In order to make sure that this
-function is called exactly once we make use of a __gthread_once call
-in MT applications and check a static bool (_S_init) in ST
-applications.
-</p><p>
-The _S_initialize() function:
-- If the GLIBCXX_FORCE_NEW environment variable is set, it sets the bool
- _S_force_new to true and then returns. This will cause subsequent calls to
- allocate() to return memory directly from a new() call, and deallocate will
- only do a delete() call.
-</p><p>
-- If the GLIBCXX_FORCE_NEW environment variable is not set, both ST and MT
- applications will:
- - Calculate the number of bins needed. A bin is a specific power of two size
- of bytes. I.e., by default the allocator will deal with requests of up to
- 128 bytes (or whatever the value of _S_max_bytes is when _S_init() is
- called). This means that there will be bins of the following sizes
- (in bytes): 1, 2, 4, 8, 16, 32, 64, 128.
-
- - Create the _S_binmap array. All requests are rounded up to the next
- "large enough" bin. I.e., a request for 29 bytes will cause a block from
- the "32 byte bin" to be returned to the application. The purpose of
- _S_binmap is to speed up the process of finding out which bin to use.
- I.e., the value of _S_binmap[ 29 ] is initialized to 5 (bin 5 = 32 bytes).
-</p><p>
- - Create the _S_bin array. This array consists of bin_records. There will be
- as many bin_records in this array as the number of bins that we calculated
- earlier. I.e., if _S_max_bytes = 128 there will be 8 entries.
- Each bin_record is then initialized:
- - bin_record-&gt;first = An array of pointers to block_records. There will be
- as many block_records pointers as there are maximum number of threads
- (in a ST application there is only 1 thread, in a MT application there
- are _S_max_threads).
- This holds the pointer to the first free block for each thread in this
- bin. I.e., if we would like to know where the first free block of size 32
- for thread number 3 is we would look this up by: _S_bin[ 5 ].first[ 3 ]
-
- The above created block_record pointers members are now initialized to
- their initial values. I.e. _S_bin[ n ].first[ n ] = NULL;
-</p><p>
-- Additionally a MT application will:
- - Create a list of free thread id's. The pointer to the first entry
- is stored in _S_thread_freelist_first. The reason for this approach is
- that the __gthread_self() call will not return a value that corresponds to
- the maximum number of threads allowed but rather a process id number or
- something else. So what we do is that we create a list of thread_records.
- This list is _S_max_threads long and each entry holds a size_t thread_id
- which is initialized to 1, 2, 3, 4, 5 and so on up to _S_max_threads.
- Each time a thread calls allocate() or deallocate() we call
- _S_get_thread_id() which looks at the value of _S_thread_key which is a
- thread local storage pointer. If this is NULL we know that this is a newly
- created thread and we pop the first entry from this list and saves the
- pointer to this record in the _S_thread_key variable. The next time
- we will get the pointer to the thread_record back and we use the
- thread_record-&gt;thread_id as identification. I.e., the first thread that
- calls allocate will get the first record in this list and thus be thread
- number 1 and will then find the pointer to its first free 32 byte block
- in _S_bin[ 5 ].first[ 1 ]
- When we create the _S_thread_key we also define a destructor
- (_S_thread_key_destr) which means that when the thread dies, this
- thread_record is returned to the front of this list and the thread id
- can then be reused if a new thread is created.
- This list is protected by a mutex (_S_thread_freelist_mutex) which is only
- locked when records are removed or added to the list.
-</p><p>
- - Initialize the free and used counters of each bin_record:
- - bin_record-&gt;free = An array of size_t. This keeps track of the number
- of blocks on a specific thread's freelist in each bin. I.e., if a thread
- has 12 32-byte blocks on it's freelists and allocates one of these, this
- counter would be decreased to 11.
-
- - bin_record-&gt;used = An array of size_t. This keeps track of the number
- of blocks currently in use of this size by this thread. I.e., if a thread
- has made 678 requests (and no deallocations...) of 32-byte blocks this
- counter will read 678.
-
- The above created arrays are now initialized with their initial values.
- I.e. _S_bin[ n ].free[ n ] = 0;
-</p><p>
- - Initialize the mutex of each bin_record: The bin_record-&gt;mutex
- is used to protect the global freelist. This concept of a global
- freelist is explained in more detail in the section "A multi
- threaded example", but basically this mutex is locked whenever a
- block of memory is retrieved or returned to the global freelist
- for this specific bin. This only occurs when a number of blocks
- are grabbed from the global list to a thread specific list or when
- a thread decides to return some blocks to the global freelist.
-</p></div><div class="section" title="Deallocation Notes"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.deallocation"/>Deallocation Notes</h4></div></div></div><p> Notes about deallocation. This allocator does not explicitly
-release memory. Because of this, memory debugging programs like
-valgrind or purify may notice leaks: sorry about this
-inconvenience. Operating systems will reclaim allocated memory at
-program termination anyway. If sidestepping this kind of noise is
-desired, there are three options: use an allocator, like
-<code class="code">new_allocator</code> that releases memory while debugging, use
-GLIBCXX_FORCE_NEW to bypass the allocator's internal pools, or use a
-custom pool datum that releases resources on destruction.
-</p><p>
- On systems with the function <code class="code">__cxa_atexit</code>, the
-allocator can be forced to free all memory allocated before program
-termination with the member function
-<code class="code">__pool_type::_M_destroy</code>. However, because this member
-function relies on the precise and exactly-conforming ordering of
-static destructors, including those of a static local
-<code class="code">__pool</code> object, it should not be used, ever, on systems
-that don't have the necessary underlying support. In addition, in
-practice, forcing deallocation can be tricky, as it requires the
-<code class="code">__pool</code> object to be fully-constructed before the object
-that uses it is fully constructed. For most (but not all) STL
-containers, this works, as an instance of the allocator is constructed
-as part of a container's constructor. However, this assumption is
-implementation-specific, and subject to change. For an example of a
-pool that frees memory, see the following
- <a class="link" href="http://gcc.gnu.org/viewcvs/trunk/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup">
- example.</a>
-</p></div></div><div class="section" title="Single Thread Example"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_single"/>Single Thread Example</h3></div></div></div><p>
-Let's start by describing how the data on a freelist is laid out in memory.
-This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
-</p><pre class="programlisting">
-+----------------+
-| next* ---------|--+ (_S_bin[ 3 ].first[ 3 ] points here)
-| | |
-| | |
-| | |
-+----------------+ |
-| thread_id = 3 | |
-| | |
-| | |
-| | |
-+----------------+ |
-| DATA | | (A pointer to here is what is returned to the
-| | | the application when needed)
-| | |
-| | |
-| | |
-| | |
-| | |
-| | |
-+----------------+ |
-+----------------+ |
-| next* |&lt;-+ (If next == NULL it's the last one on the list)
-| |
-| |
-| |
-+----------------+
-| thread_id = 3 |
-| |
-| |
-| |
-+----------------+
-| DATA |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-+----------------+
-</pre><p>
-With this in mind we simplify things a bit for a while and say that there is
-only one thread (a ST application). In this case all operations are made to
-what is referred to as the global pool - thread id 0 (No thread may be
-assigned this id since they span from 1 to _S_max_threads in a MT application).
-</p><p>
-When the application requests memory (calling allocate()) we first look at the
-requested size and if this is &gt; _S_max_bytes we call new() directly and return.
-</p><p>
-If the requested size is within limits we start by finding out from which
-bin we should serve this request by looking in _S_binmap.
-</p><p>
-A quick look at _S_bin[ bin ].first[ 0 ] tells us if there are any blocks of
-this size on the freelist (0). If this is not NULL - fine, just remove the
-block that _S_bin[ bin ].first[ 0 ] points to from the list,
-update _S_bin[ bin ].first[ 0 ] and return a pointer to that blocks data.
-</p><p>
-If the freelist is empty (the pointer is NULL) we must get memory from the
-system and build us a freelist within this memory. All requests for new memory
-is made in chunks of _S_chunk_size. Knowing the size of a block_record and
-the bytes that this bin stores we then calculate how many blocks we can create
-within this chunk, build the list, remove the first block, update the pointer
-(_S_bin[ bin ].first[ 0 ]) and return a pointer to that blocks data.
-</p><p>
-Deallocation is equally simple; the pointer is casted back to a block_record
-pointer, lookup which bin to use based on the size, add the block to the front
-of the global freelist and update the pointer as needed
-(_S_bin[ bin ].first[ 0 ]).
-</p><p>
-The decision to add deallocated blocks to the front of the freelist was made
-after a set of performance measurements that showed that this is roughly 10%
-faster than maintaining a set of "last pointers" as well.
-</p></div><div class="section" title="Multiple Thread Example"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_multi"/>Multiple Thread Example</h3></div></div></div><p>
-In the ST example we never used the thread_id variable present in each block.
-Let's start by explaining the purpose of this in a MT application.
-</p><p>
-The concept of "ownership" was introduced since many MT applications
-allocate and deallocate memory to shared containers from different
-threads (such as a cache shared amongst all threads). This introduces
-a problem if the allocator only returns memory to the current threads
-freelist (I.e., there might be one thread doing all the allocation and
-thus obtaining ever more memory from the system and another thread
-that is getting a longer and longer freelist - this will in the end
-consume all available memory).
-</p><p>
-Each time a block is moved from the global list (where ownership is
-irrelevant), to a threads freelist (or when a new freelist is built
-from a chunk directly onto a threads freelist or when a deallocation
-occurs on a block which was not allocated by the same thread id as the
-one doing the deallocation) the thread id is set to the current one.
-</p><p>
-What's the use? Well, when a deallocation occurs we can now look at
-the thread id and find out if it was allocated by another thread id
-and decrease the used counter of that thread instead, thus keeping the
-free and used counters correct. And keeping the free and used counters
-corrects is very important since the relationship between these two
-variables decides if memory should be returned to the global pool or
-not when a deallocation occurs.
-</p><p>
-When the application requests memory (calling allocate()) we first
-look at the requested size and if this is &gt;_S_max_bytes we call new()
-directly and return.
-</p><p>
-If the requested size is within limits we start by finding out from which
-bin we should serve this request by looking in _S_binmap.
-</p><p>
-A call to _S_get_thread_id() returns the thread id for the calling thread
-(and if no value has been set in _S_thread_key, a new id is assigned and
-returned).
-</p><p>
-A quick look at _S_bin[ bin ].first[ thread_id ] tells us if there are
-any blocks of this size on the current threads freelist. If this is
-not NULL - fine, just remove the block that _S_bin[ bin ].first[
-thread_id ] points to from the list, update _S_bin[ bin ].first[
-thread_id ], update the free and used counters and return a pointer to
-that blocks data.
-</p><p>
-If the freelist is empty (the pointer is NULL) we start by looking at
-the global freelist (0). If there are blocks available on the global
-freelist we lock this bins mutex and move up to block_count (the
-number of blocks of this bins size that will fit into a _S_chunk_size)
-or until end of list - whatever comes first - to the current threads
-freelist and at the same time change the thread_id ownership and
-update the counters and pointers. When the bins mutex has been
-unlocked, we remove the block that _S_bin[ bin ].first[ thread_id ]
-points to from the list, update _S_bin[ bin ].first[ thread_id ],
-update the free and used counters, and return a pointer to that blocks
-data.
-</p><p>
-The reason that the number of blocks moved to the current threads
-freelist is limited to block_count is to minimize the chance that a
-subsequent deallocate() call will return the excess blocks to the
-global freelist (based on the _S_freelist_headroom calculation, see
-below).
-</p><p>
-However if there isn't any memory on the global pool we need to get
-memory from the system - this is done in exactly the same way as in a
-single threaded application with one major difference; the list built
-in the newly allocated memory (of _S_chunk_size size) is added to the
-current threads freelist instead of to the global.
-</p><p>
-The basic process of a deallocation call is simple: always add the
-block to the front of the current threads freelist and update the
-counters and pointers (as described earlier with the specific check of
-ownership that causes the used counter of the thread that originally
-allocated the block to be decreased instead of the current threads
-counter).
-</p><p>
-And here comes the free and used counters to service. Each time a
-deallocation() call is made, the length of the current threads
-freelist is compared to the amount memory in use by this thread.
-</p><p>
-Let's go back to the example of an application that has one thread
-that does all the allocations and one that deallocates. Both these
-threads use say 516 32-byte blocks that was allocated during thread
-creation for example. Their used counters will both say 516 at this
-point. The allocation thread now grabs 1000 32-byte blocks and puts
-them in a shared container. The used counter for this thread is now
-1516.
-</p><p>
-The deallocation thread now deallocates 500 of these blocks. For each
-deallocation made the used counter of the allocating thread is
-decreased and the freelist of the deallocation thread gets longer and
-longer. But the calculation made in deallocate() will limit the length
-of the freelist in the deallocation thread to _S_freelist_headroom %
-of it's used counter. In this case, when the freelist (given that the
-_S_freelist_headroom is at it's default value of 10%) exceeds 52
-(516/10) blocks will be returned to the global pool where the
-allocating thread may pick them up and reuse them.
-</p><p>
-In order to reduce lock contention (since this requires this bins
-mutex to be locked) this operation is also made in chunks of blocks
-(just like when chunks of blocks are moved from the global freelist to
-a threads freelist mentioned above). The "formula" used can probably
-be improved to further reduce the risk of blocks being "bounced back
-and forth" between freelists.
-</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s07.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td align="left" valign="top">Diagnostics </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> bitmap_allocator</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_compile_checks.html b/libstdc++-v3/doc/html/manual/ext_compile_checks.html
index c648797c181..63ffe75723f 100644
--- a/libstdc++-v3/doc/html/manual/ext_compile_checks.html
+++ b/libstdc++-v3/doc/html/manual/ext_compile_checks.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 16. Compile Time Checks</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03pr01.html" title=""/><link rel="next" href="debug_mode.html" title="Chapter 17. Debug Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 16. Compile Time Checks</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03pr01.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 16. Compile Time Checks</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03pr01.html" title=""/><link rel="next" href="debug_mode.html" title="Chapter 17. Debug Mode"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 16. Compile Time Checks</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03pr01.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
</th><td align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 16. Compile Time Checks"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.compile_checks"/>Chapter 16. Compile Time Checks</h2></div></div></div><p>
@@ -37,4 +37,4 @@
support for template parameter constraints based on concepts in the core
language. This will obviate the need for the library-simulated concept
checking described above.
- </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03pr01.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 17. Debug Mode</td></tr></table></div></body></html>
+ </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03pr01.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 17. Debug Mode</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency.html b/libstdc++-v3/doc/html/manual/ext_concurrency.html
index 99718e04f5e..d321c5aa93a 100644
--- a/libstdc++-v3/doc/html/manual/ext_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/ext_concurrency.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 28. Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_demangling.html" title="Chapter 27. Demangling"/><link rel="next" href="bk01pt03ch28s02.html" title="Implementation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Concurrency</th></tr><tr><td align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 30. Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_demangling.html" title="Chapter 29. Demangling"/><link rel="next" href="bk01pt03ch30s02.html" title="Implementation"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Concurrency</th></tr><tr><td align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="bk01pt03ch28s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 28. Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"/>Chapter 28. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s03.html">Use</a></span></dt></dl></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.design"/>Design</h2></div></div></div><div class="section" title="Interface to Locks and Mutexes"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"/>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch30s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 30. Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"/>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s03.html">Use</a></span></dt></dl></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency.design"/>Design</h2></div></div></div><div class="section" title="Interface to Locks and Mutexes"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"/>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer,
the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
</p><p>
@@ -88,4 +88,4 @@ _GLIBCXX_WRITE_MEM_BARRIER
</p><p>
Which expand to the appropriate write and read barrier required by the
host hardware and operating system.
-</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch28s02.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 27. Demangling </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Implementation</td></tr></table></div></body></html>
+</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch30s02.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 29. Demangling </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Implementation</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_containers.html b/libstdc++-v3/doc/html/manual/ext_containers.html
index d07860bbd68..d422675138b 100644
--- a/libstdc++-v3/doc/html/manual/ext_containers.html
+++ b/libstdc++-v3/doc/html/manual/ext_containers.html
@@ -1,9 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 21. Containers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bitmap_allocator.html" title="bitmap_allocator"/><link rel="next" href="bk01pt03ch21s02.html" title="HP/SGI"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. Containers</th></tr><tr><td align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 23. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="policy_data_structures_biblio.html" title="Acknowledgments"/><link rel="next" href="bk01pt03ch23s02.html" title="Deprecated"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. HP/SGI Extensions</th></tr><tr><td align="left"><a accesskey="p" href="policy_data_structures_biblio.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="bk01pt03ch21s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 21. Containers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"/>Chapter 21. Containers</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">HP/SGI</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s03.html">Deprecated HP/SGI</a></span></dt></dl></div><p>
- </p><div class="section" title="Policy Based Data Structures"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.pbds"/>Policy Based Data Structures</h2></div></div></div><p>
- <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html">More details here</a>.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch21s02.html">Next</a></td></tr><tr><td align="left" valign="top">bitmap_allocator </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> HP/SGI</td></tr></table></div></body></html>
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch23s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 23. HP/SGI Extensions"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"/>Chapter 23. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="bk01pt03ch23s02.html">Deprecated</a></span></dt></dl></div><div class="section" title="Backwards Compatibility"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.sgi"/>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have
+ been made with containers. Those dealing with older SGI-style
+ allocators are dealt with elsewhere. The remaining ones all deal
+ with bits:
+ </p><p>The old pre-standard <code class="code">bit_vector</code> class is
+ present for backwards compatibility. It is simply a typedef for
+ the <code class="code">vector&lt;bool&gt;</code> specialization.
+ </p><p>The <code class="code">bitset</code> class has a number of extensions, described in the
+ rest of this item. First, we'll mention that this implementation of
+ <code class="code">bitset&lt;N&gt;</code> is specialized for cases where N number of
+ bits will fit into a single word of storage. If your choice of N is
+ within that range (&lt;=32 on i686-pc-linux-gnu, for example), then all
+ of the operations will be faster.
+</p><p>There are
+ versions of single-bit test, set, reset, and flip member functions which
+ do no range-checking. If we call them member functions of an instantiation
+ of "bitset&lt;N&gt;," then their names and signatures are:
+</p><pre class="programlisting">
+ bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos);
+ bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos, int val);
+ bitset&lt;N&gt;&amp; _Unchecked_reset (size_t pos);
+ bitset&lt;N&gt;&amp; _Unchecked_flip (size_t pos);
+ bool _Unchecked_test (size_t pos);
+ </pre><p>Note that these may in fact be removed in the future, although we have
+ no present plans to do so (and there doesn't seem to be any immediate
+ reason to).
+</p><p>The semantics of member function <code class="code">operator[]</code> are not specified
+ in the C++ standard. A long-standing defect report calls for sensible
+ obvious semantics, which are already implemented here: <code class="code">op[]</code>
+ on a const bitset returns a bool, and for a non-const bitset returns a
+ <code class="code">reference</code> (a nested type). However, this implementation does
+ no range-checking on the index argument, which is in keeping with other
+ containers' <code class="code">op[]</code> requirements. The defect report's proposed
+ resolution calls for range-checking to be done. We'll just wait and see...
+</p><p>Finally, two additional searching functions have been added. They return
+ the index of the first "on" bit, and the index of the first
+ "on" bit that is after <code class="code">prev</code>, respectively:
+</p><pre class="programlisting">
+ size_t _Find_first() const;
+ size_t _Find_next (size_t prev) const;</pre><p>The same caveat given for the _Unchecked_* functions applies here also.
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="policy_data_structures_biblio.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch23s02.html">Next</a></td></tr><tr><td align="left" valign="top">Acknowledgments </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Deprecated</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_demangling.html b/libstdc++-v3/doc/html/manual/ext_demangling.html
index 0120bc2b050..455a705f9c2 100644
--- a/libstdc++-v3/doc/html/manual/ext_demangling.html
+++ b/libstdc++-v3/doc/html/manual/ext_demangling.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 27. Demangling</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_io.html" title="Chapter 26. Input and Output"/><link rel="next" href="ext_concurrency.html" title="Chapter 28. Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Demangling</th></tr><tr><td align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 29. Demangling</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_io.html" title="Chapter 28. Input and Output"/><link rel="next" href="ext_concurrency.html" title="Chapter 30. Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Demangling</th></tr><tr><td align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 27. Demangling"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"/>Chapter 27. Demangling</h2></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 29. Demangling"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"/>Chapter 29. Demangling</h2></div></div></div><p>
Transforming C++ ABI identifiers (like RTTI symbols) into the
original C++ source identifiers is called
<span class="quote">“<span class="quote">demangling.</span>”</span>
@@ -71,4 +71,4 @@ int main()
be writing C++ in order to demangle C++. (That also means we have to
use crummy memory management facilities, so don't forget to free()
the returned char array.)
- </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 26. Input and Output </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 28. Concurrency</td></tr></table></div></body></html>
+ </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 28. Input and Output </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 30. Concurrency</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_io.html b/libstdc++-v3/doc/html/manual/ext_io.html
index aba0fe1d634..84879447684 100644
--- a/libstdc++-v3/doc/html/manual/ext_io.html
+++ b/libstdc++-v3/doc/html/manual/ext_io.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 26. Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_iterators.html" title="Chapter 25. Iterators"/><link rel="next" href="ext_demangling.html" title="Chapter 27. Demangling"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Input and Output</th></tr><tr><td align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 28. Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_iterators.html" title="Chapter 27. Iterators"/><link rel="next" href="ext_demangling.html" title="Chapter 29. Demangling"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Input and Output</th></tr><tr><td align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 26. Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"/>Chapter 26. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
+</th><td align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 28. Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"/>Chapter 28. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
Extensions allowing <code class="code">filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors.
</p><div class="section" title="Derived filebufs"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io.filebuf_derived"/>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct
@@ -47,4 +47,4 @@
call) then you might be interested in Henry Suter's RWLock class.
</p><p>
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 25. Iterators </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 27. Demangling</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 27. Iterators </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 29. Demangling</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_iterators.html b/libstdc++-v3/doc/html/manual/ext_iterators.html
index 8c00985c4dc..5085c6bcc8a 100644
--- a/libstdc++-v3/doc/html/manual/ext_iterators.html
+++ b/libstdc++-v3/doc/html/manual/ext_iterators.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 25. Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_numerics.html" title="Chapter 24. Numerics"/><link rel="next" href="ext_io.html" title="Chapter 26. Input and Output"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Iterators</th></tr><tr><td align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 27. Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_numerics.html" title="Chapter 26. Numerics"/><link rel="next" href="ext_io.html" title="Chapter 28. Input and Output"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Iterators</th></tr><tr><td align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 25. Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"/>Chapter 25. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
+</th><td align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 27. Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"/>Chapter 27. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
original HP STL implementation (the language wasn't rich enough at the
time). For backwards compatibility, base classes are provided which
declare the same nested typedefs:
@@ -11,4 +11,4 @@
two iterators and returns a result. It is extended by another signature
which takes two iterators and a reference to a result. The result is
modified, and the function returns nothing.
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 24. Numerics </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 26. Input and Output</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 26. Numerics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 28. Input and Output</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_numerics.html b/libstdc++-v3/doc/html/manual/ext_numerics.html
index 71d417c3af2..1fbb34aaebe 100644
--- a/libstdc++-v3/doc/html/manual/ext_numerics.html
+++ b/libstdc++-v3/doc/html/manual/ext_numerics.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 24. Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_algorithms.html" title="Chapter 23. Algorithms"/><link rel="next" href="ext_iterators.html" title="Chapter 25. Iterators"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Numerics</th></tr><tr><td align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 26. Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="ext_algorithms.html" title="Chapter 25. Algorithms"/><link rel="next" href="ext_iterators.html" title="Chapter 27. Iterators"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Numerics</th></tr><tr><td align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 24. Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"/>Chapter 24. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
+</th><td align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 26. Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"/>Chapter 26. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
with the following functions:
</p><pre class="programlisting">
power (x, n);
@@ -17,4 +17,4 @@
That is, it assigns value to *first, value + 1 to *(first + 1) and so
on." Quoted from SGI documentation.
</p><pre class="programlisting">
- void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 23. Algorithms </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 25. Iterators</td></tr></table></div></body></html>
+ void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 25. Algorithms </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 27. Iterators</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/ext_utilities.html b/libstdc++-v3/doc/html/manual/ext_utilities.html
index d15057c2778..aba78264765 100644
--- a/libstdc++-v3/doc/html/manual/ext_utilities.html
+++ b/libstdc++-v3/doc/html/manual/ext_utilities.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 22. Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch21s03.html" title="Deprecated HP/SGI"/><link rel="next" href="ext_algorithms.html" title="Chapter 23. Algorithms"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Utilities</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch21s03.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 24. Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch23s02.html" title="Deprecated"/><link rel="next" href="ext_algorithms.html" title="Chapter 25. Algorithms"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Utilities</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch23s02.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 22. Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"/>Chapter 22. Utilities</h2></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 24. Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"/>Chapter 24. Utilities</h2></div></div></div><p>
The &lt;functional&gt; header contains many additional functors
and helper functions, extending section 20.3. They are
implemented in the file stl_function.h:
@@ -38,4 +38,4 @@ get_temporary_buffer(5, (int*)0);
</p><p>
The specialized algorithms of section 20.4.4 are extended with
<code class="code">uninitialized_copy_n</code>. *
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch21s03.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td align="left" valign="top">Deprecated HP/SGI </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 23. Algorithms</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch23s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td align="left" valign="top">Deprecated </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 25. Algorithms</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/extensions.html b/libstdc++-v3/doc/html/manual/extensions.html
index 1b59f2f862c..4e6a01495c3 100644
--- a/libstdc++-v3/doc/html/manual/extensions.html
+++ b/libstdc++-v3/doc/html/manual/extensions.html
@@ -1,9 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part III.  Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library Manual"/><link rel="prev" href="io_and_c.html" title="Interacting with C"/><link rel="next" href="bk01pt03pr01.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part III.  Extensions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library Manual"/><link rel="prev" href="io_and_c.html" title="Interacting with C"/><link rel="next" href="bk01pt03pr01.html" title=""/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III. 
Extensions
</th></tr><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part III.  Extensions"><div class="titlepage"><div><div><h1 class="title"><a id="manual.ext"/>Part III. 
Extensions
- <a id="id472152" class="indexterm"/>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="preface"><a href="bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">20. Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">21. Containers</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">HP/SGI</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">22. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">23. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">24. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">25. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">26. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">27. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">28. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s03.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="spine.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
+ <a id="id654326" class="indexterm"/>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="preface"><a href="bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+ debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="mt_allocator.html">20. The mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s02.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s02.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s03.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s04.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s05.html">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="bitmap_allocator.html">21. The bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="policy_data_structures.html">22. Policy-Based Data Structures</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
+ Configuring via Template Parameters
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.traits">
+ Querying Container Attributes
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.point_range_iteration">
+ Point and Range Iteration
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.basic">Intermediate Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.query">Querying with <code class="classname">container_traits</code> </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container">By Container Method</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.hash">Hash-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.branch">Branch-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.priority_queue">Priority Queues</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts">Concepts</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.null_type">Null Policy Classes</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.associative_semantics">Map and Set Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.set_vs_map">
+ Distinguishing Between Maps and Sets
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.multi">Alternatives to <code class="classname">std::multiset</code> and <code class="classname">std::multimap</code></a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.iterator_semantics">Iterator Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.point_and_range">Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.both">Distinguishing Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.invalidation">Invalidation Guarantees</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.genericity">Genericity</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.tag">Tag</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.traits">Traits</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container">By Container</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.hash">hash</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.tree">tree</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.trie">Trie</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.list">List</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.list.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.list.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.details">Details</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.regression">Regression</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance">Performance</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash">Hash-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_find">
+ Integer <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_find">
+ Integer Subscript <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_insert">
+ Integer Subscript <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.zlob_int_find">
+ Integer <code class="function">find</code> with Skewed-Distribution
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.erase_mem">
+ Erase Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch">Branch-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_insert">
+ Text <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_lor_find">
+ Text <code class="function">find</code> with Locality-of-Reference
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.split_join">
+ <code class="function">split</code> and <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.order_statistics">
+ Order-Statistics
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap">Multimap</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_small">
+ Text <code class="function">find</code> with Small Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_large">
+ Text <code class="function">find</code> with Large Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push">
+ Text <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push_pop">
+ Text <code class="function">push</code> and <code class="function">pop</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push_pop">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_pop">
+ Text <code class="function">pop</code> Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_join">
+ Text <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_up">
+ Text <code class="function">modify</code> Up
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
+ Text <code class="function">modify</code> Down
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_biblio.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">
+ Bibliography
+ </a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="bk01pt03ch23s02.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s03.html">Use</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03pr01.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> </td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/facets.html b/libstdc++-v3/doc/html/manual/facets.html
index 25f0e142573..33350cd5914 100644
--- a/libstdc++-v3/doc/html/manual/facets.html
+++ b/libstdc++-v3/doc/html/manual/facets.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="localization.html" title="Chapter 8.  Localization"/><link rel="prev" href="localization.html" title="Chapter 8.  Localization"/><link rel="next" href="containers.html" title="Chapter 9.  Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Facets</th></tr><tr><td align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Chapter 8. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="localization.html" title="Chapter 8.  Localization"/><link rel="prev" href="localization.html" title="Chapter 8.  Localization"/><link rel="next" href="containers.html" title="Chapter 9.  Containers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Facets</th></tr><tr><td align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Chapter 8. 
Localization
-</th><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.facet"/>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"/>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"/>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id466844"/>Specializations</h5></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="Facets"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.facet"/>Facets</h2></div></div></div><div class="section" title="ctype"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"/>ctype</h3></div></div></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"/>Implementation</h4></div></div></div><div class="section" title="Specializations"><div class="titlepage"><div><div><h5 class="title"><a id="id649036"/>Specializations</h5></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
@@ -50,23 +50,24 @@ characters.
</p></li><li class="listitem"><p>
Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id466969"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id649161"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
- </em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id467008"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id649201"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id467034"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id649227"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id467053"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id649246"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id467072"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id649265"/><p><span class="title"><em>
+ <a class="link" href="http://www.unix.org/version3/ieee_std.html">
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
+ </a>
</em>. </span><span class="copyright">Copyright © 1999
- The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="id467101"/><p><span class="citetitle"><em class="citetitle">
+ The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="id649292"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id467140"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id649330"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
@@ -409,42 +410,46 @@ codecvt usage.
</p></li><li class="listitem"><p>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id467790"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id649980"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id467830"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id650020"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id467855"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id650046"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id467874"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id650065"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id467893"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id650084"/><p><span class="title"><em>
+ <a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </em>. </span><span class="copyright">Copyright © 2008
+ </a>
+ </em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id467923"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id650111"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id467961"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id650149"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id468008"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="A brief description of Normative Addendum 1"><a id="id650196"/><p><span class="title"><em>
+ <a class="link" href="http://www.lysator.liu.se/c/na1.html">
A brief description of Normative Addendum 1
- </em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry"><a id="id468038"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry" title="The Unicode HOWTO"><a id="id650223"/><p><span class="title"><em>
+ <a class="link" href="http://tldp.org/HOWTO/Unicode-HOWTO.html">
The Unicode HOWTO
- </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="id468063"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry" title="UTF-8 and Unicode FAQ for Unix/Linux"><a id="id650247"/><p><span class="title"><em>
+ <a class="link" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html">
UTF-8 and Unicode FAQ for Unix/Linux
- </em>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span></p></div></div></div><div class="section" title="messages"><div class="titlepage"><div><div><h3 class="title"><a id="manual.localization.facet.messages"/>messages</h3></div></div></div><p>
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span></p></div></div></div><div class="section" title="messages"><div class="titlepage"><div><div><h3 class="title"><a id="manual.localization.facet.messages"/>messages</h3></div></div></div><p>
The std::messages facet implements message retrieval functionality
equivalent to Java's java.text.MessageFormat .using either GNU gettext
or IEEE 1003.1-200 functions.
@@ -685,44 +690,47 @@ void test01()
model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext
package.
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id468737"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id650918"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id468777"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id650958"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id468803"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id650984"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id468822"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id651003"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id468841"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id651022"/><p><span class="title"><em>
+ <a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </em>. </span><span class="copyright">Copyright © 2008
+ </a>
+ </em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id468870"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id651049"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id468909"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id651087"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id468956"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="API Specifications, Java Platform"><a id="id651134"/><p><span class="title"><em>
+ <a class="link" href="http://java.sun.com/reference/api/index.html">
API Specifications, Java Platform
+ </a>
</em>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle
- . </span></p></div><div class="biblioentry"><a id="id468978"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry" title="GNU gettext tools, version 0.10.38, Native Language Support Library and Tools."><a id="id651154"/><p><span class="title"><em>
+ <a class="link" href="http://www.gnu.org/software/gettext">
GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
- </em>. </span></p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="localization.html">Prev</a> </td><td align="center"><a accesskey="u" href="localization.html">Up</a></td><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 8. 
+ </a>
+ </em>. </span></p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="localization.html">Prev</a> </td><td align="center"><a accesskey="u" href="localization.html">Up</a></td><td align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 8. 
Localization
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 9. 
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 9. 
Containers
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/fstreams.html b/libstdc++-v3/doc/html/manual/fstreams.html
index 6c03a2bb62a..44f57272804 100644
--- a/libstdc++-v3/doc/html/manual/fstreams.html
+++ b/libstdc++-v3/doc/html/manual/fstreams.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>File Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="stringstreams.html" title="Memory Based Streams"/><link rel="next" href="io_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">File Based Streams</th></tr><tr><td align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>File Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="stringstreams.html" title="Memory Based Streams"/><link rel="next" href="io_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">File Based Streams</th></tr><tr><td align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr></table><hr/></div><div class="section" title="File Based Streams"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.filestreams"/>File Based Streams</h2></div></div></div><div class="section" title="Copying a File"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.filestreams.copying_a_file"/>Copying a File</h3></div></div></div><p>
@@ -147,4 +147,4 @@
between arbitrary programs, or across a network, or from one
invocation of a program to another invocation of the same program
on a different platform, etc.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr><tr><td align="left" valign="top">Memory Based Streams </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr><tr><td align="left" valign="top">Memory Based Streams </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html b/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
index 043cbeb36dd..a203d3e3bfa 100644
--- a/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
+++ b/libstdc++-v3/doc/html/manual/generalized_numeric_operations.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Generalized Operations</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="prev" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="next" href="numerics_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Generalized Operations</th></tr><tr><td align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Generalized Operations</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="prev" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="next" href="numerics_and_c.html" title="Interacting with C"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Generalized Operations</th></tr><tr><td align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
Numerics
</th><td align="right"> <a accesskey="n" href="numerics_and_c.html">Next</a></td></tr></table><hr/></div><div class="section" title="Generalized Operations"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics.generalized_ops"/>Generalized Operations</h2></div></div></div><p>
@@ -29,4 +29,4 @@
</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><td align="center"><a accesskey="u" href="numerics.html">Up</a></td><td align="right"> <a accesskey="n" href="numerics_and_c.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 12. 
Numerics
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Interacting with C</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/index.html b/libstdc++-v3/doc/html/manual/index.html
new file mode 100644
index 00000000000..d2108b00eca
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/index.html
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library Manual</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="../index.html" title="The GNU C++ Library"/><link rel="prev" href="../index.html" title="The GNU C++ Library"/><link rel="next" href="intro.html" title="Part I.  Introduction"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library Manual</th></tr><tr><td align="left"><a accesskey="p" href="../index.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr/></div><div class="book" title="The GNU C++ Library Manual"><div class="titlepage"><div><div><h1 class="title"><a id="manual"/>The GNU C++ Library Manual</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"/> <span class="surname"/></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ <a class="link" href="http://www.fsf.org">FSF</a>
+ </p></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="part"><a href="intro.html">I.
+ Introduction
+
+</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt02.html">II.
+ Standard Contents
+ </a></span></dt><dd><dl><dt><span class="chapter"><a href="support.html">4.
+ Support
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="diagnostics.html">5.
+ Diagnostics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
+ Utilities
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
+ Strings
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
+ Localization
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
+ Containers
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
+ Iterators
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11.
+ Algorithms
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="numerics.html">12.
+ Numerics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="io.html">13.
+ Input and Output
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="atomics.html">14.
+ Atomics
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></dd><dt><span class="chapter"><a href="concurrency.html">15.
+ Concurrency
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="extensions.html">III.
+ Extensions
+
+</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.wrappers">The Wrapper Model</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_iter">Safe Iterators</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.safe_seq">Safe Sequences (Containers)</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.precond">Precondition Checking</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods.coexistence">Release- and debug-mode coexistence</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.compile">Compile-time coexistence of release- and debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.link">Link- and run-time coexistence of release- and
+ debug-mode components</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#methods.coexistence.alt">Alternatives for Coexistence</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="mt_allocator.html">20. The mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s02.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s02.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s03.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s04.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s05.html">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="chapter"><a href="bitmap_allocator.html">21. The bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="policy_data_structures.html">22. Policy-Based Data Structures</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
+ Configuring via Template Parameters
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.traits">
+ Querying Container Attributes
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.point_range_iteration">
+ Point and Range Iteration
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.basic">Intermediate Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.query">Querying with <code class="classname">container_traits</code> </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container">By Container Method</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.hash">Hash-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.branch">Branch-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.priority_queue">Priority Queues</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts">Concepts</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.null_type">Null Policy Classes</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.associative_semantics">Map and Set Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.set_vs_map">
+ Distinguishing Between Maps and Sets
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.multi">Alternatives to <code class="classname">std::multiset</code> and <code class="classname">std::multimap</code></a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.iterator_semantics">Iterator Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.point_and_range">Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.both">Distinguishing Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.invalidation">Invalidation Guarantees</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.genericity">Genericity</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.tag">Tag</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.traits">Traits</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container">By Container</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.hash">hash</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.tree">tree</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.trie">Trie</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.list">List</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.list.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.list.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.details">Details</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.regression">Regression</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance">Performance</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash">Hash-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_find">
+ Integer <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_find">
+ Integer Subscript <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_insert">
+ Integer Subscript <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.zlob_int_find">
+ Integer <code class="function">find</code> with Skewed-Distribution
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.erase_mem">
+ Erase Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch">Branch-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_insert">
+ Text <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_lor_find">
+ Text <code class="function">find</code> with Locality-of-Reference
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.split_join">
+ <code class="function">split</code> and <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.order_statistics">
+ Order-Statistics
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap">Multimap</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_small">
+ Text <code class="function">find</code> with Small Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_large">
+ Text <code class="function">find</code> with Large Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push">
+ Text <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push_pop">
+ Text <code class="function">push</code> and <code class="function">pop</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push_pop">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_pop">
+ Text <code class="function">pop</code> Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_join">
+ Text <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_up">
+ Text <code class="function">modify</code> Up
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
+ Text <code class="function">modify</code> Down
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_biblio.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">
+ Bibliography
+ </a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_containers.html">23. HP/SGI Extensions</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="bk01pt03ch23s02.html">Deprecated</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">24. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">25. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">26. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">27. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">28. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">29. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">30. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch30s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch30s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt04.html">IV.
+ Appendices
+</a></span></dt><dd><dl><dt><span class="appendix"><a href="appendix_contributing.html">A.
+ Contributing
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B.
+ Porting and Maintenance
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization.layout">Directory Layout</a></span></dt><dt><span class="section"><a href="test.html#test.organization.naming">Naming Conventions</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.run.basic">Basic</a></span></dt><dt><span class="section"><a href="test.html#test.run.variations">Variations</a></span></dt><dt><span class="section"><a href="test.html#test.run.permutations">Permutations</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.harness.dejagnu">Dejagnu Harness Details</a></span></dt><dt><span class="section"><a href="test.html#test.harness.utils">Utilities</a></span></dt></dl></dd><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety">
+ Qualifying Exception Safety Guarantees
+
+</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.exception.safety.overview">Overview</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.status">
+ Existing tests
+</a></span></dt><dt><span class="section"><a href="test.html#test.exception.safety.containers">
+C++0x Requirements Test Sequence Descriptions
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.history">History</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710570">No <code class="code">ios_base</code></a></span></dt><dt><span class="section"><a href="backwards.html#id710603">No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id710706">Namespace <code class="code">std::</code> not supported</a></span></dt><dt><span class="section"><a href="backwards.html#id710832">Illegal iterator usage</a></span></dt><dt><span class="section"><a href="backwards.html#id710893"><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </a></span></dt><dt><span class="section"><a href="backwards.html#id710989">No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711028">No <code class="code">std::char_traits&lt;char&gt;::eof</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711046">No <code class="code">string::clear</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711092">
+ Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
+ extensions
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711111">No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></a></span></dt><dt><span class="section"><a href="backwards.html#id711267">Little or no wide character support</a></span></dt><dt><span class="section"><a href="backwards.html#id711285">No templatized iostreams</a></span></dt><dt><span class="section"><a href="backwards.html#id711304">Thread safety issues</a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#id711429">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><span class="section"><a href="backwards.html#id711514">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><span class="section"><a href="backwards.html#id711617">No <code class="code">ios::nocreate/ios::noreplace</code>.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711664">
+No <code class="code">stream::attach(int fd)</code>
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711732">
+Support for C++98 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711760">
+Support for C++TR1 dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711804">
+Support for C++0x dialect.
+</a></span></dt><dt><span class="section"><a href="backwards.html#id711882">
+ Container::iterator_type is not necessarily Container::value_type*
+</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
+ Free Software Needs Free Documentation
+
+</a></span></dt><dt><span class="appendix"><a href="appendix_gpl.html">D.
+ <acronym class="acronym">GNU</acronym> General Public License version 3
+ </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><strong>List of Figures</strong></p><dl><dt>22.1. <a href="policy_data_structures.html#id664217">Node Invariants</a></dt><dt>22.2. <a href="policy_data_structures.html#id664273">Underlying Associative Data Structures</a></dt><dt>22.3. <a href="policy_data_structures.html#id664536">Range Iteration in Different Data Structures</a></dt><dt>22.4. <a href="policy_data_structures.html#id664661">Point Iteration in Hash Data Structures</a></dt><dt>22.5. <a href="policy_data_structures.html#id664738">Effect of erase in different underlying data structures</a></dt><dt>22.6. <a href="policy_data_structures.html#id665301">Underlying Priority Queue Data Structures</a></dt><dt>22.7. <a href="policy_data_structures_using.html#id665824">Exception Hierarchy</a></dt><dt>22.8. <a href="policy_data_structures_design.html#id667445">Non-unique Mapping Standard Containers</a></dt><dt>22.9. <a href="policy_data_structures_design.html#fig.pbds_embedded_lists_2">
+ Effect of embedded lists in
+ <code class="classname">std::multimap</code>
+ </a></dt><dt>22.10. <a href="policy_data_structures_design.html#id667640">Non-unique Mapping Containers</a></dt><dt>22.11. <a href="policy_data_structures_design.html#id667806">Point Iterator Hierarchy</a></dt><dt>22.12. <a href="policy_data_structures_design.html#id667917">Invalidation Guarantee Tags Hierarchy</a></dt><dt>22.13. <a href="policy_data_structures_design.html#id668169">Container Tag Hierarchy</a></dt><dt>22.14. <a href="policy_data_structures_design.html#id668502">Hash functions, ranged-hash functions, and
+ range-hashing functions</a></dt><dt>22.15. <a href="policy_data_structures_design.html#id669038">Insert hash sequence diagram</a></dt><dt>22.16. <a href="policy_data_structures_design.html#id669097">Insert hash sequence diagram with a null policy</a></dt><dt>22.17. <a href="policy_data_structures_design.html#id669237">Hash policy class diagram</a></dt><dt>22.18. <a href="policy_data_structures_design.html#id669396">Balls and bins</a></dt><dt>22.19. <a href="policy_data_structures_design.html#id669652">Insert resize sequence diagram</a></dt><dt>22.20. <a href="policy_data_structures_design.html#id669717">Standard resize policy trigger sequence
+ diagram</a></dt><dt>22.21. <a href="policy_data_structures_design.html#id669752">Standard resize policy size sequence
+ diagram</a></dt><dt>22.22. <a href="policy_data_structures_design.html#id670401">Tree node invariants</a></dt><dt>22.23. <a href="policy_data_structures_design.html#id670480">Tree node invalidation</a></dt><dt>22.24. <a href="policy_data_structures_design.html#id670590">A tree and its update policy</a></dt><dt>22.25. <a href="policy_data_structures_design.html#id670687">Restoring node invariants</a></dt><dt>22.26. <a href="policy_data_structures_design.html#id670755">Insert update sequence</a></dt><dt>22.27. <a href="policy_data_structures_design.html#id670941">Useless update path</a></dt><dt>22.28. <a href="policy_data_structures_design.html#id671313">A PATRICIA trie</a></dt><dt>22.29. <a href="policy_data_structures_design.html#id671400">A trie and its update policy</a></dt><dt>22.30. <a href="policy_data_structures_design.html#id671655">A simple list</a></dt><dt>22.31. <a href="policy_data_structures_design.html#id671702">The counter algorithm</a></dt><dt>22.32. <a href="policy_data_structures_design.html#id672233">Underlying Priority-Queue Data-Structures.</a></dt><dt>22.33. <a href="policy_data_structures_design.html#id672525">Priority-Queue Data-Structure Tags.</a></dt><dt>B.1. <a href="appendix_porting.html#id700897">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#id598677">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id596384">C++ 200x Implementation Status</a></dt><dt>1.3. <a href="status.html#id588207">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id622095">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id626203">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id626432">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id626736">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id626942">C++ 200x Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id627370">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id627620">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id627761">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id627936">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id627982">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id628036">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id628333">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id628456">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id628568">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id654877">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id655252">Debugging Containers C++0x</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id656839">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id658962">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id659844">Profile Diagnostics</a></dt><dt>21.1. <a href="bk01pt03ch21s02.html#id663274">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#id701803">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#id702306">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#id702468">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#id702945">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#id703147">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#id708847">Extension Allocators</a></dt><dt>B.7. <a href="api.html#id709077">Extension Allocators Continued</a></dt></dl></div><div class="list-of-equations"><p><strong>List of Equations</strong></p><dl><dt>22.1. <a href="policy_data_structures_design.html#id668617">Ranged Hash Function</a></dt><dt>22.2. <a href="policy_data_structures_design.html#id668666">Range-Hashing, Division Method</a></dt><dt>22.3. <a href="policy_data_structures_design.html#id668703">Division via Prime Modulo</a></dt><dt>22.4. <a href="policy_data_structures_design.html#id668718">Division via Bit Mask</a></dt><dt>22.5. <a href="policy_data_structures_design.html#id668799">
+ A Standard String Hash Function
+ </a></dt><dt>22.6. <a href="policy_data_structures_design.html#id668850">
+ Only k String DNA Hash
+ </a></dt><dt>22.7. <a href="policy_data_structures_design.html#id669441">
+ Probability of Probe Sequence of Length k
+ </a></dt><dt>22.8. <a href="policy_data_structures_design.html#id669498">
+ Probability Probe Sequence in Some Bin
+ </a></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="../index.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Part I. 
+ Introduction
+
+</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/internals.html b/libstdc++-v3/doc/html/manual/internals.html
index a80fea357b7..48b190b5146 100644
--- a/libstdc++-v3/doc/html/manual/internals.html
+++ b/libstdc++-v3/doc/html/manual/internals.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="documentation_hacking.html" title="Writing and Generating Documentation"/><link rel="next" href="test.html" title="Test"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="documentation_hacking.html" title="Writing and Generating Documentation"/><link rel="next" href="test.html" title="Test"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr/></div><div class="section" title="Porting to New Hardware or Operating Systems"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.porting.internals"/>Porting to New Hardware or Operating Systems</h2></div></div></div><p>
@@ -365,4 +365,4 @@ do this is to build the library using <code class="code">gcc -shared</code>.
<code class="code">ltcf-c.sh</code> in the top-level directory. Find the switch statement
that sets <code class="code">archive_cmds</code>. Here, adjust the setting for your
operating system.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="test.html">Next</a></td></tr><tr><td align="left" valign="top">Writing and Generating Documentation </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Test</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="documentation_hacking.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="test.html">Next</a></td></tr><tr><td align="left" valign="top">Writing and Generating Documentation </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Test</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index a7c6bd2149a..f0bc8ce6ea2 100644
--- a/libstdc++-v3/doc/html/manual/intro.html
+++ b/libstdc++-v3/doc/html/manual/intro.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part I.  Introduction</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="spine.html" title="The GNU C++ Library Manual"/><link rel="prev" href="spine.html" title="The GNU C++ Library Manual"/><link rel="next" href="status.html" title="Chapter 1. Status"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Part I.  Introduction</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="index.html" title="The GNU C++ Library Manual"/><link rel="prev" href="index.html" title="The GNU C++ Library Manual"/><link rel="next" href="status.html" title="Chapter 1. Status"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. 
Introduction
-</th></tr><tr><td align="left"><a accesskey="p" href="spine.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part I.  Introduction"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"/>Part I. 
+</th></tr><tr><td align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library Manual</th><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr></table><hr/></div><div class="part" title="Part I.  Introduction"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"/>Part I. 
Introduction
- <a id="id390414" class="indexterm"/>
-</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td align="center"><a accesskey="u" href="spine.html">Up</a></td><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library Manual </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
+ <a id="id520964" class="indexterm"/>
+</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="index.html">Prev</a> </td><td align="center"><a accesskey="u" href="index.html">Up</a></td><td align="right"> <a accesskey="n" href="status.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library Manual </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/io.html b/libstdc++-v3/doc/html/manual/io.html
index 5591e165d6c..d2544ae1295 100644
--- a/libstdc++-v3/doc/html/manual/io.html
+++ b/libstdc++-v3/doc/html/manual/io.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 13.  Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="numerics_and_c.html" title="Interacting with C"/><link rel="next" href="streambufs.html" title="Stream Buffers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 13.  Input and Output</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="numerics_and_c.html" title="Interacting with C"/><link rel="next" href="streambufs.html" title="Stream Buffers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. 
Input and Output
</th></tr><tr><td align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 13.  Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="std.io"/>Chapter 13. 
Input and Output
- <a id="id470755" class="indexterm"/>
+ <a id="id652930" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="section" title="Iostream Objects"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.objects"/>Iostream Objects</h2></div></div></div><p>To minimize the time you have to wait on the compiler, it's good to
only include the headers you really need. Many people simply include
&lt;iostream&gt; when they don't need to -- and that can <span class="emphasis"><em>penalize
@@ -118,4 +118,4 @@
the standard objects in that source file; you'll pay less startup
time. Only include the header files you need to in general; your
compile times will go down when there's less parsing work to do.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Stream Buffers</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Stream Buffers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/io_and_c.html b/libstdc++-v3/doc/html/manual/io_and_c.html
index 6b4066154f7..425d165148b 100644
--- a/libstdc++-v3/doc/html/manual/io_and_c.html
+++ b/libstdc++-v3/doc/html/manual/io_and_c.html
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="fstreams.html" title="File Based Streams"/><link rel="next" href="atomics.html" title="Chapter 14.  Atomics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="fstreams.html" title="File Based Streams"/><link rel="next" href="atomics.html" title="Chapter 14.  Atomics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr></table><hr/></div><div class="section" title="Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.c"/>Interacting with C</h2></div></div></div><div class="section" title="Using FILE* and file descriptors"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.c.FILE"/>Using FILE* and file descriptors</h3></div></div></div><p>
- See the <a class="link" href="ext_io.html" title="Chapter 26. Input and Output">extensions</a> for using
+ See the <a class="link" href="ext_io.html" title="Chapter 28. Input and Output">extensions</a> for using
<span class="type">FILE</span> and <span class="type">file descriptors</span> with
<code class="classname">ofstream</code> and
<code class="classname">ifstream</code>.
@@ -51,7 +51,7 @@
<code class="code">clog</code>, and their wide-character counterchapters). File stream
objects that you declare yourself have no such requirement and are fully
buffered.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr><tr><td align="left" valign="top">File Based Streams </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 14. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr><tr><td align="left" valign="top">File Based Streams </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 14. 
Atomics
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/iterators.html b/libstdc++-v3/doc/html/manual/iterators.html
index 2ca7cb47360..d47ca9bf0e3 100644
--- a/libstdc++-v3/doc/html/manual/iterators.html
+++ b/libstdc++-v3/doc/html/manual/iterators.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 10.  Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="containers_and_c.html" title="Interacting with C"/><link rel="next" href="algorithms.html" title="Chapter 11.  Algorithms"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 10.  Iterators</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="containers_and_c.html" title="Interacting with C"/><link rel="next" href="algorithms.html" title="Chapter 11.  Algorithms"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. 
Iterators
</th></tr><tr><td align="left"><a accesskey="p" href="containers_and_c.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 10.  Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators"/>Chapter 10. 
Iterators
- <a id="id469921" class="indexterm"/>
+ <a id="id652095" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="section" title="Predefined"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators.predefined"/>Predefined</h2></div></div></div><div class="section" title="Iterators vs. Pointers"><div class="titlepage"><div><div><h3 class="title"><a id="iterators.predefined.vs_pointers"/>Iterators vs. Pointers</h3></div></div></div><p>
The following
FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="7.1.">entry</a> points out that
@@ -124,7 +124,7 @@ classes.
sequences very simple to recognize: if the two endpoints compare
equal, then the {array, sequence, container, whatever} is empty.
</p><p>Just don't dereference <code class="code">end()</code>.
- </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="containers_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 11. 
+ </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="containers_and_c.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr><tr><td align="left" valign="top">Interacting with C </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 11. 
Algorithms
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/license.html b/libstdc++-v3/doc/html/manual/license.html
index da021a9fe79..52a63ff3079 100644
--- a/libstdc++-v3/doc/html/manual/license.html
+++ b/libstdc++-v3/doc/html/manual/license.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="status.html" title="Chapter 1. Status"/><link rel="prev" href="status.html" title="Chapter 1. Status"/><link rel="next" href="bugs.html" title="Bugs"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr/></div><div class="section" title="License"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.license"/>License</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>License</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="status.html" title="Chapter 1. Status"/><link rel="prev" href="status.html" title="Chapter 1. Status"/><link rel="next" href="bugs.html" title="Bugs"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr/></div><div class="section" title="License"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.license"/>License</h2></div></div></div><p>
There are two licenses affecting GNU libstdc++: one for the code,
and one for the documentation.
</p><p>
@@ -102,4 +102,4 @@ requirements of the license of GCC.<br/>
</p><p>
If you plan on making copies of the documentation, please let us know.
We can probably offer suggestions.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="status.html">Prev</a> </td><td align="center"><a accesskey="u" href="status.html">Up</a></td><td align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 1. Status </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Bugs</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="status.html">Prev</a> </td><td align="center"><a accesskey="u" href="status.html">Up</a></td><td align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 1. Status </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Bugs</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/localization.html b/libstdc++-v3/doc/html/manual/localization.html
index e440c5a10cd..a9171a98797 100644
--- a/libstdc++-v3/doc/html/manual/localization.html
+++ b/libstdc++-v3/doc/html/manual/localization.html
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 8.  Localization</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="strings.html" title="Chapter 7.  Strings"/><link rel="next" href="facets.html" title="Facets"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 8.  Localization</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="strings.html" title="Chapter 7.  Strings"/><link rel="next" href="facets.html" title="Facets"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
Localization
</th></tr><tr><td align="left"><a accesskey="p" href="strings.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 8.  Localization"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization"/>Chapter 8. 
Localization
- <a id="id466189" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt></dl></dd></dl></div><div class="section" title="Locales"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.locales"/>Locales</h2></div></div></div><div class="section" title="locale"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"/>locale</h3></div></div></div><p>
+ <a id="id648384" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#id649036">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section" title="Locales"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization.locales"/>Locales</h2></div></div></div><div class="section" title="locale"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"/>locale</h3></div></div></div><p>
Describes the basic locale object, including nested
classes id, facet, and the reference-counted implementation object,
class _Impl.
@@ -403,28 +403,29 @@ global locale" (emphasis Paolo), that is:
What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users
provide specializations?
- </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id466552"/><p><span class="citetitle"><em class="citetitle">
+ </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id648747"/><p><span class="citetitle"><em class="citetitle">
The GNU C Library
</em>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">
Chapters 6 Character Set Handling and 7 Locales and
Internationalization
- . </span></p></div><div class="biblioentry"><a id="id466591"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id648786"/><p><span class="citetitle"><em class="citetitle">
Correspondence
- </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id466617"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id648812"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
- </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id466636"/><p><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id648831"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 9899:1999 Programming languages - C
- </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id466655"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id648850"/><p><span class="title"><em>
+ <a class="link" href="http://www.opengroup.org/austin/">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
- </em>. </span><span class="copyright">Copyright © 2008
+ </a>
+ </em>. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id466684"/><p><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry"><a id="id648877"/><p><span class="citetitle"><em class="citetitle">
The C++ Programming Language, Special Edition
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id466723"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id648916"/><p><span class="citetitle"><em class="citetitle">
Standard C++ IOStreams and Locales
</em>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
@@ -433,4 +434,4 @@ global locale" (emphasis Paolo), that is:
. </span></span></p></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="strings.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 7. 
Strings
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Facets</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Facets</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/make.html b/libstdc++-v3/doc/html/manual/make.html
index 62b1499240f..f032333c69b 100644
--- a/libstdc++-v3/doc/html/manual/make.html
+++ b/libstdc++-v3/doc/html/manual/make.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="setup.html" title="Chapter 2. Setup"/><link rel="prev" href="configure.html" title="Configure"/><link rel="next" href="using.html" title="Chapter 3. Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr/></div><div class="section" title="Make"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.make"/>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="setup.html" title="Chapter 2. Setup"/><link rel="prev" href="configure.html" title="Configure"/><link rel="next" href="using.html" title="Chapter 3. Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr/></div><div class="section" title="Make"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.make"/>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
<a class="link" href="http://gcc.gnu.org/install/">GCC Installation
Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>.
<span class="emphasis"><em>Twice.</em></span>
</p><p>Then type: <span class="command"><strong>make</strong></span>, and congratulations, you've
started to build.
-</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="configure.html">Prev</a> </td><td align="center"><a accesskey="u" href="setup.html">Up</a></td><td align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td align="left" valign="top">Configure </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
+</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="configure.html">Prev</a> </td><td align="center"><a accesskey="u" href="setup.html">Up</a></td><td align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td align="left" valign="top">Configure </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index 69de53d3b95..8a1129bc6af 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="pairs.html" title="Pairs"/><link rel="next" href="traits.html" title="Traits"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory</th></tr><tr><td align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Memory</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="pairs.html" title="Pairs"/><link rel="next" href="traits.html" title="Traits"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory</th></tr><tr><td align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr></table><hr/></div><div class="section" title="Memory"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.memory"/>Memory</h2></div></div></div><p>
@@ -93,7 +93,7 @@
or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"/>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id463369"/>Interface Design</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"/>Implementation</h4></div></div></div><div class="section" title="Interface Design"><div class="titlepage"><div><div><h5 class="title"><a id="id633362"/>Interface Design</h5></div></div></div><p>
The only allocator interface that
is supported is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have
@@ -106,7 +106,7 @@
</p><p>
The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable.
-</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id463399"/>Selecting Default Allocation Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id633392"/>Selecting Default Allocation Policy</h5></div></div></div><p>
It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure
@@ -143,7 +143,7 @@
The current default choice for
<code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>.
- </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id463510"/>Disabling Memory Caching</h5></div></div></div><p>
+ </p></div><div class="section" title="Disabling Memory Caching"><div class="titlepage"><div><div><h5 class="title"><a id="id633502"/>Disabling Memory Caching</h5></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's
@@ -301,36 +301,40 @@
</p><p>
A high-performance fixed-size allocator with
exponentially-increasing allocations. It has its own
- documentation, found <a class="link" href="ext_allocators.html#manual.ext.allocator.mt" title="mt_allocator">here</a>.
+ documentation, found <a class="link" href="mt_allocator.html" title="Chapter 20. The mt_allocator">here</a>.
</p></li><li class="listitem"><p>
<code class="classname">bitmap_allocator</code>
</p><p>
A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own
- documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>.
- </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id463960"/><p><span class="citetitle"><em class="citetitle">
+ documentation, found <a class="link" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator">here</a>.
+ </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id633953"/><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++
</em>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id463975"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry" title="The Standard Librarian: What Are Allocators Good For?"><a id="id633968"/><p><span class="title"><em>
+ <a class="link" href="http://www.drdobbs.com/cpp/184403759">
The Standard Librarian: What Are Allocators Good For?
- </em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry"><a id="id464009"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="The Hoard Memory Allocator"><a id="id633999"/><p><span class="title"><em>
+ <a class="link" href="http://www.cs.umass.edu/~emery/hoard">
The Hoard Memory Allocator
- </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="id464034"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry" title="Reconsidering Custom Memory Allocation"><a id="id634022"/><p><span class="title"><em>
+ <a class="link" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf">
Reconsidering Custom Memory Allocation
- </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry"><a id="id464088"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span></p></div><div class="biblioentry" title="Allocator Types"><a id="id634074"/><p><span class="title"><em>
+ <a class="link" href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html">
Allocator Types
- </em>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
- . </span></span></p></div><div class="biblioentry"><a id="id464130"/><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
+ . </span></span></p></div><div class="biblioentry"><a id="id634113"/><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id464166"/><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"/>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"/>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
+ . </span></span></p></div><div class="biblioentry"><a id="id634150"/><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section" title="auto_ptr"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"/>auto_ptr</h3></div></div></div><div class="section" title="Limitations"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"/>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
happen with misuse of the <code class="classname">auto_ptr</code> class
template (called <acronym class="acronym">AP</acronym> here) would take some
time. Suffice it to say that the use of <acronym class="acronym">AP</acronym>
@@ -446,7 +450,7 @@ drops to zero.
Derived classes override those functions to destroy resources in a context
where the correct dynamic type is known. This is an application of the
technique known as type erasure.
- </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"/>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id464527"/>Class Hierarchy</h5></div></div></div><p>
+ </p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"/>Implementation</h4></div></div></div><div class="section" title="Class Hierarchy"><div class="titlepage"><div><div><h5 class="title"><a id="id634511"/>Class Hierarchy</h5></div></div></div><p>
A <code class="classname">shared_ptr&lt;T&gt;</code> contains a pointer of
type <span class="type">T*</span> and an object of type
<code class="classname">__shared_count</code>. The shared_count contains a
@@ -488,7 +492,7 @@ be forwarded to <span class="type">Tp</span>'s constructor.
Unlike the other <code class="classname">_Sp_counted_*</code> classes, this one is parameterized on the
type of object, not the type of pointer; this is purely a convenience
that simplifies the implementation slightly.
- </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id464706"/>Thread Safety</h5></div></div></div><p>
+ </p></dd></dl></div></div><div class="section" title="Thread Safety"><div class="titlepage"><div><div><h5 class="title"><a id="id634689"/>Thread Safety</h5></div></div></div><p>
C++0x-only features are: rvalue-ref/move support, allocator support,
aliasing constructor, make_shared &amp; allocate_shared. Additionally,
the constructors taking <code class="classname">auto_ptr</code> parameters are
@@ -538,7 +542,7 @@ compiler, standard library, platform etc. For the version of
shared_ptr in libstdc++ the compiler and library are fixed, which
makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
-</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id464775"/>Selecting Lock Policy</h5></div></div></div><p>
+</p></div><div class="section" title="Selecting Lock Policy"><div class="titlepage"><div><div><h5 class="title"><a id="id634759"/>Selecting Lock Policy</h5></div></div></div><p>
</p><p>
There is a single <code class="classname">_Sp_counted_base</code> class,
which is a template parameterized on the enum
@@ -579,7 +583,7 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
<code class="filename">ext/atomicity.h</code>, which detect if the program
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
- </p></div><div class="section" title="Dual C++0x and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id464897"/>Dual C++0x and TR1 Implementation</h5></div></div></div><p>
+ </p></div><div class="section" title="Dual C++0x and TR1 Implementation"><div class="titlepage"><div><div><h5 class="title"><a id="id634881"/>Dual C++0x and TR1 Implementation</h5></div></div></div><p>
The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
with support for rvalue-references and the other features from N2351.
The <code class="classname">_Sp_counted_base</code> base class is implemented in
@@ -596,7 +600,7 @@ change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
duplicate <code class="classname">_Sp_counted_base</code> and only make changes to
the C++0x version.
-</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id464953"/>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+</p></div><div class="section" title="Related functions and classes"><div class="titlepage"><div><div><h5 class="title"><a id="id634937"/>Related functions and classes</h5></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
<code class="code">const_pointer_cast</code></span></dt><dd><p>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
@@ -629,13 +633,13 @@ is called. Users should not try to use this.
As well as the extra constructors, this implementation also needs some
members of _Sp_counted_deleter to be protected where they could otherwise
be private.
- </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"/>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id465102"/>Examples</h5></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="section" title="Use"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"/>Use</h4></div></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h5 class="title"><a id="id635086"/>Examples</h5></div></div></div><p>
Examples of use can be found in the testsuite, under
<code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>,
<code class="filename">testsuite/20_util/shared_ptr</code>
and
<code class="filename">testsuite/20_util/weak_ptr</code>.
- </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id465132"/>Unresolved Issues</h5></div></div></div><p>
+ </p></div><div class="section" title="Unresolved Issues"><div class="titlepage"><div><div><h5 class="title"><a id="id635116"/>Unresolved Issues</h5></div></div></div><p>
The <span class="emphasis"><em><code class="classname">shared_ptr</code> atomic access</em></span>
clause in the C++0x working draft is not implemented in GCC.
</p><p>
@@ -676,24 +680,28 @@ be private.
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
- </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id465226"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"/>Bibliography</h4></div></div></div><div class="biblioentry" title="Improving shared_ptr for C++0x, Revision 2"><a id="id635209"/><p><span class="title"><em>
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm">
Improving shared_ptr for C++0x, Revision 2
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
N2351
- . </span></p></div><div class="biblioentry"><a id="id465247"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry" title="C++ Standard Library Active Issues List"><a id="id635228"/><p><span class="title"><em>
+ <a class="link" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html">
C++ Standard Library Active Issues List
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
N2456
- . </span></p></div><div class="biblioentry"><a id="id465268"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry" title="Working Draft, Standard for Programming Language C++"><a id="id635248"/><p><span class="title"><em>
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf">
Working Draft, Standard for Programming Language C++
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
N2461
- . </span></p></div><div class="biblioentry"><a id="id465290"/><p><span class="biblioid">shared_ptr
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry" title="Boost C++ Libraries documentation, shared_ptr"><a id="id635267"/><p><span class="title"><em>
+ <a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm">
Boost C++ Libraries documentation, shared_ptr
- </em>. </span><span class="subtitle">
+ </a>
+ </em>. </span><span class="subtitle">
N2461
- . </span></p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><td align="center"><a accesskey="u" href="utilities.html">Up</a></td><td align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr><tr><td align="left" valign="top">Pairs </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Traits</td></tr></table></div></body></html>
+ . </span></p></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><td align="center"><a accesskey="u" href="utilities.html">Up</a></td><td align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr><tr><td align="left" valign="top">Pairs </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Traits</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator.html b/libstdc++-v3/doc/html/manual/mt_allocator.html
new file mode 100644
index 00000000000..8b3ad4df090
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/mt_allocator.html
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 20. The mt_allocator</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch19s07.html" title="Diagnostics"/><link rel="next" href="bk01pt03ch20s02.html" title="Design Issues"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. The mt_allocator</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s07.html">Prev</a> </td><th width="60%" align="center">Part III. 
+ Extensions
+
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch20s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 20. The mt_allocator"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"/>Chapter 20. The mt_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s02.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s02.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s03.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s03.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch20s04.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="bk01pt03ch20s05.html">Multiple Thread Example</a></span></dt></dl></div><p>
+</p><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="allocator.mt.intro"/>Intro</h2></div></div></div><p>
+ The mt allocator [hereinafter referred to simply as "the allocator"]
+ is a fixed size (power of two) allocator that was initially
+ developed specifically to suit the needs of multi threaded
+ applications [hereinafter referred to as an MT application]. Over
+ time the allocator has evolved and been improved in many ways, in
+ particular it now also does a good job in single threaded
+ applications [hereinafter referred to as a ST application]. (Note:
+ In this document, when referring to single threaded applications
+ this also includes applications that are compiled with gcc without
+ thread support enabled. This is accomplished using ifdef's on
+ __GTHREADS). This allocator is tunable, very flexible, and capable
+ of high-performance.
+</p><p>
+ The aim of this document is to describe - from an application point of
+ view - the "inner workings" of the allocator.
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch19s07.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch20s02.html">Next</a></td></tr><tr><td align="left" valign="top">Diagnostics </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design Issues</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/numerics.html b/libstdc++-v3/doc/html/manual/numerics.html
index d5ccecef9c3..4fe23e34bb0 100644
--- a/libstdc++-v3/doc/html/manual/numerics.html
+++ b/libstdc++-v3/doc/html/manual/numerics.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 12.  Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="algorithms.html" title="Chapter 11.  Algorithms"/><link rel="next" href="generalized_numeric_operations.html" title="Generalized Operations"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 12.  Numerics</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="algorithms.html" title="Chapter 11.  Algorithms"/><link rel="next" href="generalized_numeric_operations.html" title="Generalized Operations"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. 
Numerics
</th></tr><tr><td align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 12.  Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"/>Chapter 12. 
Numerics
- <a id="id470409" class="indexterm"/>
+ <a id="id652583" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section" title="Complex"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics.complex"/>Complex</h2></div></div></div><p>
</p><div class="section" title="complex Processing"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.complex.processing"/>complex Processing</h3></div></div></div><p>
</p><p>Using <code class="code">complex&lt;&gt;</code> becomes even more comple- er, sorry,
@@ -27,4 +27,4 @@
</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 11. 
Algorithms
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Generalized Operations</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Generalized Operations</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/numerics_and_c.html b/libstdc++-v3/doc/html/manual/numerics_and_c.html
index 3a2fb499e50..b6ee4904595 100644
--- a/libstdc++-v3/doc/html/manual/numerics_and_c.html
+++ b/libstdc++-v3/doc/html/manual/numerics_and_c.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="prev" href="generalized_numeric_operations.html" title="Generalized Operations"/><link rel="next" href="io.html" title="Chapter 13.  Input and Output"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="prev" href="generalized_numeric_operations.html" title="Generalized Operations"/><link rel="next" href="io.html" title="Chapter 13.  Input and Output"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
Numerics
</th><td align="right"> <a accesskey="n" href="io.html">Next</a></td></tr></table><hr/></div><div class="section" title="Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics.c"/>Interacting with C</h2></div></div></div><div class="section" title="Numerics vs. Arrays"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.c.array"/>Numerics vs. Arrays</h3></div></div></div><p>One of the major reasons why FORTRAN can chew through numbers so well
@@ -31,7 +31,7 @@
are supported, as is the <code class="code">lldiv_t</code> typedef. Also supported
are the wide character functions using 'long long', like
<code class="code">wcstoll</code>.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><td align="center"><a accesskey="u" href="numerics.html">Up</a></td><td align="right"> <a accesskey="n" href="io.html">Next</a></td></tr><tr><td align="left" valign="top">Generalized Operations </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 13. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><td align="center"><a accesskey="u" href="numerics.html">Up</a></td><td align="right"> <a accesskey="n" href="io.html">Next</a></td></tr><tr><td align="left" valign="top">Generalized Operations </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 13. 
Input and Output
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/pairs.html b/libstdc++-v3/doc/html/manual/pairs.html
index 8c4dbb7633b..472337b36bf 100644
--- a/libstdc++-v3/doc/html/manual/pairs.html
+++ b/libstdc++-v3/doc/html/manual/pairs.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Pairs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="next" href="memory.html" title="Memory"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Pairs</th></tr><tr><td align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Pairs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="next" href="memory.html" title="Memory"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Pairs</th></tr><tr><td align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td align="right"> <a accesskey="n" href="memory.html">Next</a></td></tr></table><hr/></div><div class="section" title="Pairs"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.pairs"/>Pairs</h2></div></div></div><p>The <code class="code">pair&lt;T1,T2&gt;</code> is a simple and handy way to
@@ -42,4 +42,4 @@
</pre></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><td align="center"><a accesskey="u" href="utilities.html">Up</a></td><td align="right"> <a accesskey="n" href="memory.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 6. 
Utilities
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Memory</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Memory</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index 435f37443c5..b85e408591e 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 18. Parallel Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch17s04.html" title="Design"/><link rel="next" href="bk01pt03ch18s02.html" title="Semantics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Parallel Mode</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s04.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 18. Parallel Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch17s04.html" title="Design"/><link rel="next" href="bk01pt03ch18s02.html" title="Semantics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Parallel Mode</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s04.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 18. Parallel Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"/>Chapter 18. Parallel Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch18s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 18. Parallel Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"/>Chapter 18. Parallel Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.omp">Setting up the OpenMP Environment</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.compile">Compile Time Switches</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning.settings">Run Time Settings and Defaults</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel
implementation of many algorithms the C++ Standard Library.
</p><p>
Several of the standard algorithms, for instance
@@ -13,12 +13,12 @@ explicit source declaration or by compiling existing sources with a
specific compiler flag.
</p><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode.intro"/>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::accumulate</code></p></li><li class="listitem"><p><code class="function">std::adjacent_difference</code></p></li><li class="listitem"><p><code class="function">std::inner_product</code></p></li><li class="listitem"><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
-<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id476333"/><p><span class="citetitle"><em class="citetitle">
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id658507"/><p><span class="citetitle"><em class="citetitle">
Parallelization of Bulk Operations for STL Dictionaries
</em>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
- . </span></span></p></div><div class="biblioentry"><a id="id476375"/><p><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry"><a id="id658549"/><p><span class="citetitle"><em class="citetitle">
The Multi-Core Standard Template Library
</em>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641)
- . </span></span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s02.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Semantics</td></tr></table></div></body></html>
+ . </span></span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch17s04.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch18s02.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Semantics</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html b/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html
new file mode 100644
index 00000000000..ee89d191709
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/policy_based_data_structures_test.html
@@ -0,0 +1,3813 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Testing</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;&#9;ISO C++&#10; , &#10;&#9;policy&#10; , &#10;&#9;container&#10; , &#10;&#9;data&#10; , &#10;&#9;structure&#10; , &#10;&#9;associated&#10; , &#10;&#9;tree&#10; , &#10;&#9;trie&#10; , &#10;&#9;hash&#10; , &#10;&#9;metaprogramming&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/><link rel="prev" href="policy_data_structures_design.html" title="Design"/><link rel="next" href="policy_data_structures_biblio.html" title="Acknowledgments"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td align="right"> <a accesskey="n" href="policy_data_structures_biblio.html">Next</a></td></tr></table><hr/></div><div class="section" title="Testing"><div class="titlepage"><div><div><h2 class="title"><a id="pbds.test"/>Testing</h2></div></div></div><div class="section" title="Regression"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.regression"/>Regression</h3></div></div></div><p>The library contains a single comprehensive regression test.
+ For a given container type in this library, the test creates
+ an object of the container type and an object of the
+ corresponding standard type (e.g., <code class="classname">std::set</code>). It
+ then performs a random sequence of methods with random
+ arguments (e.g., inserts, erases, and so forth) on both
+ objects. At each operation, the test checks the return value of
+ the method, and optionally both compares this library's
+ object with the standard's object as well as performing other
+ consistency checks on this library's object (e.g.,
+ order preservation, when applicable, or node invariants, when
+ applicable).</p><p>Additionally, the test integrally checks exception safety
+ and resource leaks. This is done as follows. A special
+ allocator type, written for the purpose of the test, both
+ randomly throws an exceptions when allocations are performed,
+ and tracks allocations and de-allocations. The exceptions thrown
+ at allocations simulate memory-allocation failures; the
+ tracking mechanism checks for memory-related bugs (e.g.,
+ resource leaks and multiple de-allocations). Both
+ this library's containers and the containers' value-types are
+ configured to use this allocator.</p><p>For granularity, the test is split into the
+ several sources, each checking only some containers.</p><p>For more details, consult the files in
+ <code class="filename">testsuite/ext/pb_ds/regression</code>.</p></div><div class="section" title="Performance"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.performance"/>Performance</h3></div></div></div><div class="section" title="Hash-Based"><div class="titlepage"><div><div><h4 class="title"><a id="performance.hash"/>Hash-Based</h4></div></div></div><p/><div class="section" title="Text find"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.text_find"/>
+ Text <code class="function">find</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.text_find.info"/>
+ Description
+ </h6></div></div></div><p>
+ This test inserts a number of values with keys from an
+ arbitrary text (<a class="xref" href="policy_data_structures.html#biblio.wickland96thirty" title="Thirty Years Among the Dead">[biblio.wickland96thirty]</a>) into a container,
+ then performs a series of finds using
+ <code class="function">find</code> . It measures the average
+ time for <code class="function">find</code> as a function of
+ the number of values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/text_find_timing_test.cc
+ </code>
+ </p><p>
+ And uses the data file:
+ <code class="filename">
+ filethirty_years_among_the_dead_preproc.txt
+ </code>
+ </p><p>The test checks the effect of different range-hashing
+ functions, trigger policies, and cache-hashing policies.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.text_find.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for the native
+ and collision-chaining hash types the the function
+ applied being a text find timing test using
+ <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_text_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_sth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.text_find.observations"/>
+ Observations
+ </h6></div></div></div><p>In this setting, the range-hashing scheme affects performance
+ more than other policies. As the results show, containers using
+ mod-based range-hashing (including the native hash-based container,
+ which is currently hard-wired to this scheme) have lower performance
+ than those using mask-based range-hashing. A modulo-based
+ range-hashing scheme's main benefit is that it takes into account
+ all hash-value bits. Standard string hash-functions are designed to
+ create hash values that are nearly-uniform as is (<a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>).</p><p>Trigger policies, i.e. the load-checks constants, affect
+ performance to a lesser extent.</p><p>Perhaps surprisingly, storing the hash value alongside each
+ entry affects performance only marginally, at least in this
+ library's implementation. (Unfortunately, it was not possible to run
+ the tests with <code class="classname">std::tr1::unordered_map</code> 's
+ <code class="classname">cache_hash_code = true</code> , as it appeared to
+ malfuntion.)</p></div></div><div class="section" title="Integer find"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.int_find"/>
+ Integer <code class="function">find</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_find.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with uniform
+ integer keys into a container, then performs a series of finds
+ using <code class="function">find</code>. It measures the average time
+ for <code class="function">find</code> as a function of the number of values
+ inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/random_int_find_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying
+ hash-tables,
+ range-hashing functions, and trigger policies.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_find.results"/>
+ Results
+ </h6></div></div></div><p>
+ There are two sets of results for this type, one for
+ collision-chaining hashes, and one for general-probe hashes.
+ </p><p>The first graphic below shows the results for the native and
+ collision-chaining hash types. The function applied being a random
+ integer timing test using <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_cc_hash_int_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>
+ </p><p>
+ </p><p>And the second graphic shows the results for the native and
+ general-probe hash types. The function applied being a random
+ integer timing test using <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_gp_hash_int_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mod_quadp_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">gp_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">quadratic_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mask_linp_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ gp_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">linear_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_find.observations"/>
+ Observations
+ </h6></div></div></div><p>In this setting, the choice of underlying hash-table affects
+ performance most, then the range-hashing scheme and, only finally,
+ other policies.</p><p>When comparing probing and chaining containers, it is
+ apparent that the probing containers are less efficient than the
+ collision-chaining containers (
+ <code class="classname">std::tr1::unordered_map</code> uses
+ collision-chaining) in this case.</p><p>Hash-Based Integer Subscript Insert Timing Test shows
+ a different case, where the situation is reversed;
+ </p><p>Within each type of hash-table, the range-hashing scheme
+ affects performance more than other policies; Hash-Based Text
+ <code class="function">find</code> Find Timing Test also shows this. In the
+ above graphics should be noted that
+ <code class="classname">std::tr1::unordered_map</code> are hard-wired
+ currently to mod-based schemes.
+ </p></div></div><div class="section" title="Integer Subscript find"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.int_subscript_find"/>
+ Integer Subscript <code class="function">find</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_find.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with uniform
+ integer keys into a container, then performs a series of finds
+ using <code class="function">operator[]</code>. It measures the average time
+ for <code class="function">operator[]</code> as a function of the number of
+ values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/random_int_subscript_find_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying
+ hash-tables, range-hashing functions, and trigger policies.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_find.results"/>
+ Results
+ </h6></div></div></div><p>
+ There are two sets of results for this type, one for
+ collision-chaining hashes, and one for general-probe hashes.
+ </p><p>The first graphic below shows the results for the native
+ and collision-chaining hash types, using as the function
+ applied an integer subscript timing test with
+ <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_cc_hash_int_subscript_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>
+ </p><p>
+ </p><p>And the second graphic shows the results for the native and
+ general-probe hash types. The function applied being a random
+ integer timing test using <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_gp_hash_int_subscript_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mod_quadp_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">gp_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">quadratic_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mask_linp_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ gp_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">linear_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_find.observations"/>
+ Observations
+ </h6></div></div></div><p>This test shows similar results to Hash-Based
+ Integer <code class="classname">find</code> Find Timing test.</p></div></div><div class="section" title="Integer Subscript insert"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.int_subscript_insert"/>
+ Integer Subscript <code class="function">insert</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_insert.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with uniform i.i.d.
+ integer keys into a container, using
+ <code class="function">operator[]</code>. It measures the average time for
+ <code class="function">operator[]</code> as a function of the number of
+ values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/random_int_subscript_insert_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying
+ hash-tables.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_insert.results"/>
+ Results
+ </h6></div></div></div><p>
+ There are two sets of results for this type, one for
+ collision-chaining hashes, and one for general-probe hashes.
+ </p><p>The first graphic below shows the results for the native
+ and collision-chaining hash types, using as the function
+ applied an integer subscript timing test with
+ <code class="function">insert</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_cc_hash_int_subscript_insert.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>
+ </p><p>
+ </p><p>And the second graphic shows the results for the native and
+ general-probe hash types. The function applied being a random
+ integer timing test using <code class="function">find</code>.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_gp_hash_int_subscript_insert.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mod_quadp_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">gp_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">quadratic_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mask_linp_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ gp_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">linear_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.int_subscript_insert.observations"/>
+ Observations
+ </h6></div></div></div><p>In this setting, as in Hash-Based Text
+ <code class="function">find</code> Find Timing test and Hash-Based
+ Integer <code class="function">find</code> Find Timing test , the choice
+ of underlying hash-table underlying hash-table affects performance
+ most, then the range-hashing scheme, and
+ finally any other policies.</p><p>There are some differences, however:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>In this setting, probing tables function sometimes more
+ efficiently than collision-chaining tables.
+ This is explained shortly.</p></li><li class="listitem"><p>The performance graphs have a "saw-tooth" shape. The
+ average insert time rises and falls. As values are inserted
+ into the container, the load factor grows larger. Eventually,
+ a resize occurs. The reallocations and rehashing are
+ relatively expensive. After this, the load factor is smaller
+ than before.</p></li></ol></div><p>Collision-chaining containers use indirection for greater
+ flexibility; probing containers store values contiguously, in
+ an array (see Figure Motivation::Different
+ underlying data structures A and B, respectively). It
+ follows that for simple data types, probing containers access
+ their allocator less frequently than collision-chaining
+ containers, (although they still have less efficient probing
+ sequences). This explains why some probing containers fare
+ better than collision-chaining containers in this case.</p><p>
+ Within each type of hash-table, the range-hashing scheme affects
+ performance more than other policies. This is similar to the
+ situation in Hash-Based Text
+ <code class="function">find</code> Find Timing Test and Hash-Based
+ Integer <code class="function">find</code> Find Timing Test.
+ Unsurprisingly, however, containers with lower α<sub>max</sub> perform worse in this case,
+ since more re-hashes are performed.</p></div></div><div class="section" title="Integer find with Skewed-Distribution"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.zlob_int_find"/>
+ Integer <code class="function">find</code> with Skewed-Distribution
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.zlob_int_find.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with a markedly
+ non-uniform integer keys into a container, then performs
+ a series of finds using <code class="function">find</code>. It measures the average
+ time for <code class="function">find</code> as a function of the number of values in
+ the containers. The keys are generated as follows. First, a
+ uniform integer is created. Then it is then shifted left 8 bits.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/hash_zlob_random_int_find_timing.cc
+ </code>
+ </p><p>The test checks the effect of different range-hashing
+ functions and trigger policies.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.zlob_int_find.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for the native, collision-chaining, and general-probing hash types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_zlob_int_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mod_quadp_prime_1div2_nsth_map
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">gp_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">quadratic_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.zlob_int_find.observations"/>
+ Observations
+ </h6></div></div></div><p>In this setting, the distribution of keys is so skewed that
+ the underlying hash-table type affects performance marginally.
+ (This is in contrast with Hash-Based Text
+ <code class="function">find</code> Find Timing Test, Hash-Based
+ Integer <code class="function">find</code> Find Timing Test, Hash-Based
+ Integer Subscript Find Timing Test and Hash-Based
+ Integer Subscript Insert Timing Test.)</p><p>The range-hashing scheme affects performance dramatically. A
+ mask-based range-hashing scheme effectively maps all values
+ into the same bucket. Access degenerates into a search within
+ an unordered linked-list. In the graphic above, it should be noted that
+ <code class="classname">std::tr1::unordered_map</code> is hard-wired currently to mod-based and mask-based schemes,
+ respectively.</p><p>When observing the settings of this test, it is apparent
+ that the keys' distribution is far from natural. One might ask
+ if the test is not contrived to show that, in some cases,
+ mod-based range hashing does better than mask-based range
+ hashing. This is, in fact just the case. A
+ more natural case in which mod-based range hashing is better was not encountered.
+ Thus the inescapable conclusion: real-life key distributions are handled better
+ with an appropriate hash function and a mask-based
+ range-hashing function. (<code class="filename">pb_ds/example/hash_shift_mask.cc</code>
+ shows an example of handling this a-priori known skewed
+ distribution with a mask-based range-hashing function). If hash
+ performance is bad, a χ<sup>2</sup> test can be used
+ to check how to transform it into a more uniform
+ distribution.</p><p>For this reason, this library's default range-hashing
+ function is mask-based.</p></div></div><div class="section" title="Erase Memory Use"><div class="titlepage"><div><div><h5 class="title"><a id="performance.hash.erase_mem"/>
+ Erase Memory Use
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="hash.erase_mem.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of uniform integer keys
+ into a container, then erases all keys except one. It measures
+ the final size of the container.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc
+ </code>
+ </p><p>The test checks how containers adjust internally as their
+ logical size decreases.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="hash.erase_mem.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for the native, collision-chaining, and general-probing hash types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_int_erase_mem.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ n_hash_map_ncah
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_map</code>
+ </td><td style="text-align: left">
+ <code class="classname">cache_hash_code</code>
+ </td><td style="text-align: left">
+ <code class="constant">false</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mod_prime_1div1_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mod_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_prime_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/1
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ cc_hash_mask_exp_1div2_nsth_map
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="5" style="text-align: left">
+ gp_hash_mask_linp_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">gp_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Probe_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">linear_probe_fn</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="hash.erase_mem.observations"/>
+ Observations
+ </h6></div></div></div><p>The standard's hash-based containers act very differently than trees in
+ this respect. When erasing numerous keys from an standard
+ associative-container, the resulting memory user varies greatly
+ depending on whether the container is tree-based or hash-based.
+ This is a fundamental consequence of the standard's interface for
+ associative containers, and it is not due to a specific
+ implementation.</p></div></div></div><div class="section" title="Branch-Based"><div class="titlepage"><div><div><h4 class="title"><a id="performance.branch"/>Branch-Based</h4></div></div></div><p/><div class="section" title="Text insert"><div class="titlepage"><div><div><h5 class="title"><a id="performance.branch.text_insert"/>
+ Text <code class="function">insert</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_insert.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an arbitrary
+ text ([ wickland96thirty ]) into a container
+ using <code class="function">insert</code> . It measures the average time
+ for <code class="function">insert</code> as a function of the number of
+ values inserted.</p><p>The test checks the effect of different underlying
+ data structures.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/tree_text_insert_timing.cc
+ </code>
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_insert.results"/>
+ Results
+ </h6></div></div></div><p>The three graphics below show the results for the native
+ tree and this library's node-based trees, the native tree and
+ this library's vector-based trees, and the native tree
+ and this library's PATRICIA-trie, respectively.
+ </p><p>The graphic immediately below shows the results for the
+ native tree type and several node-based tree types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_text_insert_node.png" style="text-align: middle"/></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p></div><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_map
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::map</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ splay_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">splay_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rb_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the
+ native tree type and a vector-based tree type.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_text_insert_vector.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_map
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::map</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ ov_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">ov_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the
+ native tree type and a PATRICIA trie type.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_text_insert_trie.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_map
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::map</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pat_trie_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pat_trie_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_insert.observations"/>
+ Observations
+ </h6></div></div></div><p>Observing the first graphic implies that for this setting, a splay tree
+ (<code class="classname">tree</code> with <code class="classname">Tag
+ </code> = <code class="classname">splay_tree_tag</code>) does not do
+ well. See also the Branch-Based
+ Text <code class="function">find</code> Find Timing Test. The two
+ red-black trees perform better.</p><p>Observing the second graphic, an ordered-vector tree
+ (<code class="classname">tree</code> with <code class="classname">Tag
+ </code> = <code class="classname">ov_tree_tag</code>) performs
+ abysmally. Inserting into this type of tree has linear complexity
+ [ austern00noset].</p><p>Observing the third and last graphic, A PATRICIA trie
+ (<code class="classname">trie</code> with <code class="classname">Tag
+ </code> = <code class="classname">pat_trie_tag</code>) has abysmal
+ performance, as well. This is not that surprising, since a
+ large-fan-out PATRICIA trie works like a hash table with
+ collisions resolved by a sub-trie. Each time a collision is
+ encountered, a new "hash-table" is built A large fan-out PATRICIA
+ trie, however, doe does well in look-ups (see Branch-Based
+ Text <code class="function">find</code> Find Timing Test). It may be
+ beneficial in semi-static settings.</p></div></div><div class="section" title="Text find"><div class="titlepage"><div><div><h5 class="title"><a id="performance.branch.text_find"/>
+ Text <code class="function">find</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_find.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([wickland96thirty]) into
+ a container, then performs a series of finds using
+ <code class="function">find</code>. It measures the average time
+ for <code class="function">find</code> as a function of the number of
+ values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/text_find_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying
+ data structures.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_find.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native tree type and several other tree types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_text_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_map
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::map</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ splay_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">splay_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rb_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ ov_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">ov_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pat_trie_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pat_trie_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_find.observations"/>
+ Observations
+ </h6></div></div></div><p>For this setting, a splay tree (<code class="classname">tree</code>
+ with <code class="classname">Tag
+ </code> = <code class="classname">splay_tree_tag</code>) does not do
+ well. This is possibly due to two reasons:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>A splay tree is not guaranteed to be balanced [motwani95random]. If a
+ splay tree contains n nodes, its average root-leaf
+ path can be m &gt;&gt; log(n).</p></li><li class="listitem"><p>Assume a specific root-leaf search path has length
+ m, and the search-target node has distance m'
+ from the root. A red-black tree will require m + 1
+ comparisons to find the required node; a splay tree will
+ require 2 m' comparisons. A splay tree, consequently,
+ can perform many more comparisons than a red-black tree.</p></li></ol></div><p>An ordered-vector tree (<code class="classname">tree</code>
+ with <code class="classname">Tag</code> = <code class="classname">ov_tree_tag</code>), a red-black
+ tree (<code class="classname">tree</code>
+ with <code class="classname">Tag</code> = <code class="classname">rb_tree_tag</code>), and the
+ native red-black tree all share approximately the same
+ performance.</p><p>An ordered-vector tree is slightly slower than red-black
+ trees, since it requires, in order to find a key, more math
+ operations than they do. Conversely, an ordered-vector tree
+ requires far lower space than the others. ([austern00noset], however,
+ seems to have an implementation that is also faster than a
+ red-black tree).</p><p>A PATRICIA trie (<code class="classname">trie</code>
+ with <code class="classname">Tag</code> = <code class="classname">pat_trie_tag</code>) has good
+ look-up performance, due to its large fan-out in this case. In
+ this setting, a PATRICIA trie has look-up performance comparable
+ to a hash table (see Hash-Based Text
+ <code class="classname">find</code> Timing Test), but it is order
+ preserving. This is not that surprising, since a large-fan-out
+ PATRICIA trie works like a hash table with collisions resolved
+ by a sub-trie. A large-fan-out PATRICIA trie does not do well on
+ modifications (see Tree-Based and Trie-Based
+ Text Insert Timing Test). Therefore, it is possibly beneficial in
+ semi-static settings.</p></div></div><div class="section" title="Text find with Locality-of-Reference"><div class="titlepage"><div><div><h5 class="title"><a id="performance.branch.text_lor_find"/>
+ Text <code class="function">find</code> with Locality-of-Reference
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_lor_find.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ a container, then performs a series of finds using
+ <code class="function">find</code>. It is different than Tree-Based and
+ Trie-Based Text <code class="function">find</code> Find Timing Test in the
+ sequence of finds it performs: this test performs multiple
+ <code class="function">find</code>s on the same key before moving on to the next
+ key. It measures the average time for <code class="function">find</code> as a
+ function of the number of values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/tree_text_lor_find_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying
+ data structures in a locality-of-reference setting.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_lor_find.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native tree type and several other tree types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_text_lor_find.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_map
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::map</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ splay_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">splay_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rb_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ ov_tree_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">ov_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pat_trie_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pat_trie_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="branch.text_lor_find.observations"/>
+ Observations
+ </h6></div></div></div><p>For this setting, an ordered-vector tree
+ (<code class="classname">tree</code> with <code class="classname">Tag</code>
+ = <code class="classname">ov_tree_tag</code>), a red-black tree
+ (<code class="classname">tree</code> with <code class="classname">Tag</code>
+ = <code class="classname">rb_tree_tag</code>), and the native red-black
+ tree all share approximately the same performance.</p><p>A splay tree (<code class="classname">tree</code>
+ with <code class="classname">Tag</code> = <code class="classname">splay_tree_tag</code>) does
+ much better, since each (successful) find "bubbles" the
+ corresponding node to the root of the tree.</p></div></div><div class="section" title="split and join"><div class="titlepage"><div><div><h5 class="title"><a id="performance.branch.split_join"/>
+ <code class="function">split</code> and <code class="function">join</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="branch.split_join.info"/>
+ Description
+ </h6></div></div></div><p>This test a container, inserts into a number of values, splits
+ the container at the median, and joins the two containers. (If the
+ containers are one of this library's trees,
+ it splits and joins with the <code class="function">split</code> and
+ <code class="function">join</code> method; otherwise, it uses the <code class="function">erase</code> and
+ <code class="function">insert</code> methods.) It measures the time for splitting
+ and joining the containers as a function of the number of
+ values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/tree_split_join_timing.cc
+ </code>
+ </p><p>The test checks the performance difference of <code class="function">join</code>
+ as opposed to a sequence of <code class="function">insert</code> operations; by
+ implication, this test checks the most efficient way to erase a
+ sub-sequence from a tree-like-based container, since this can
+ always be performed by a small sequence of splits and joins.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="branch.split_join.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native tree type and several other tree types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_split_join.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_set
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::set</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ splay_tree_set
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">splay_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rb_tree_set
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ ov_tree_set
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">ov_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pat_trie_map
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pat_trie_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="branch.split_join.observations"/>
+ Observations
+ </h6></div></div></div><p>In this test, the native red-black trees must be split and
+ joined externally, through a sequence of <code class="function">erase</code> and
+ <code class="function">insert</code> operations. This is clearly
+ super-linear, and it is not that surprising that the cost is
+ high.</p><p>This library's tree-based containers use in this test the
+ <code class="function">split</code> and <code class="function">join</code> methods,
+ which have lower complexity: the <code class="function">join</code> method
+ of a splay tree (<code class="classname">tree</code>
+ with <code class="classname">Tag </code>
+ = <code class="classname">splay_tree_tag</code>) is quadratic in the
+ length of the longest root-leaf path, and linear in the total
+ number of elements; the <code class="function">join</code> method of a
+ red-black tree (<code class="classname">tree</code>
+ with <code class="classname">Tag </code>
+ = <code class="classname">rb_tree_tag</code>) or an ordered-vector tree
+ (<code class="classname">tree</code> with <code class="classname">Tag </code>
+ = <code class="classname">ov_tree_tag</code>) is linear in the number of
+ elements.</p><p>Asides from orders of growth, this library's trees access their
+ allocator very little in these operations, and some of them do not
+ access it at all. This leads to lower constants in their
+ complexity, and, for some containers, to exception-free splits and
+ joins (which can be determined
+ via <code class="classname">container_traits</code>).</p><p>It is important to note that <code class="function">split</code> and
+ <code class="function">join</code> are not esoteric methods - they are the most
+ efficient means of erasing a contiguous range of values from a
+ tree based container.</p></div></div><div class="section" title="Order-Statistics"><div class="titlepage"><div><div><h5 class="title"><a id="performance.branch.order_statistics"/>
+ Order-Statistics
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="branch.order_statistics.info"/>
+ Description
+ </h6></div></div></div><p>This test creates a container, inserts random integers into the
+ the container, and then checks the order-statistics of the
+ container's values. (If the container is one of this
+ library's trees, it does this with
+ the <code class="function">order_of_key</code> method of
+ <code class="classname">tree_order_statistics_node_update</code>
+ ; otherwise, it uses the <code class="function">find</code> method and
+ <code class="function">std::distance</code>.) It measures the average
+ time for such queries as a function of the number of values
+ inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/tree_order_statistics_timing.cc
+ </code>
+ </p><p>The test checks the performance difference of policies based
+ on node-invariant as opposed to a external functions.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="branch.order_statistics.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native tree type and several other tree types.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_order_statistics.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_set
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::set</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ splay_tree_ost_set
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">splay_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">tree_order_statistics_node_update</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rb_tree_ost_set
+ </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">tree_order_statistics_node_update</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="branch.order_statistics.observations"/>
+ Observations
+ </h6></div></div></div><p>In this test, the native red-black tree can support
+ order-statistics queries only externally, by performing a
+ <code class="classname">find</code> (alternatively, <code class="classname">lower_bound</code> or
+ <code class="classname">upper_bound</code> ) and then using <code class="classname">std::distance</code> .
+ This is clearly linear, and it is not that surprising that the
+ cost is high.</p><p>This library's tree-based containers use in this test the
+ <code class="classname">order_of_key</code> method of <code class="classname">tree_order_statistics_node_update</code>.
+ This method has only linear complexity in the length of the
+ root-node path. Unfortunately, the average path of a splay tree
+ (<code class="classname">tree</code>
+ with <code class="classname">Tag =</code> <code class="classname">splay_tree_tag</code> ) can
+ be higher than logarithmic; the longest path of a red-black
+ tree (<code class="classname">tree</code>
+ with <code class="classname">Tag =</code> <code class="classname">rb_tree_tag</code> ) is
+ logarithmic in the number of elements. Consequently, the splay
+ tree has worse performance than the red-black tree.</p></div></div></div><div class="section" title="Multimap"><div class="titlepage"><div><div><h4 class="title"><a id="performance.multimap"/>Multimap</h4></div></div></div><p/><div class="section" title="Text find with Small Secondary-to-Primary Key Ratios"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_find_small"/>
+ Text <code class="function">find</code> with Small Secondary-to-Primary Key Ratios
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_small.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform i.i.d.integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key (see Motivation::Associative
+ Containers::Alternative to Multiple Equivalent Keys). There
+ are 400 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges from 1 to 5.</p><p>The test measures the average find-time as a function of the
+ number of values inserted. For this library's containers, it
+ finds the secondary key from a container obtained from finding
+ a primary key. For the native multimaps, it searches a range
+ obtained using <code class="classname">std::equal_range</code> on a primary key.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_find_timing_small.cc
+ </code>
+ </p><p>The test checks the find-time scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_small.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_small_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_small_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_small.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div><div class="section" title="Text find with Large Secondary-to-Primary Key Ratios"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_find_large"/>
+ Text <code class="function">find</code> with Large Secondary-to-Primary Key Ratios
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_large.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key. There
+ are 400 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges from 1 to 5.</p><p>The test measures the average find-time as a function of the
+ number of values inserted. For this library's containers, it
+ finds the secondary key from a container obtained from finding
+ a primary key. For the native multimaps, it searches a range
+ obtained using <code class="classname">std::equal_range</code> on a primary key.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_find_timing_large.cc
+ </code>
+ </p><p>The test checks the find-time scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_large.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_large_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_large_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_find_large.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div><div class="section" title="Text insert with Small Secondary-to-Primary Key Ratios"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_insert_small"/>
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_small.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key. There
+ are 400 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges from 1 to 5.</p><p>The test measures the average insert-time as a function of
+ the number of values inserted. For this library's containers,
+ it inserts a primary key into the primary associative
+ container, then a secondary key into the secondary associative
+ container. For the native multimaps, it obtains a range using
+ <code class="classname">std::equal_range</code>, and inserts a value only if it was
+ not contained already.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_insert_timing_small.cc
+ </code>
+ </p><p>The test checks the insert-time scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_small.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_insert_small_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_small_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_small.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div><div class="section" title="Text insert with Small Secondary-to-Primary Key Ratios"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_insert_large"/>
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_large.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key. There
+ are 400 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges from 1 to 5.</p><p>The test measures the average insert-time as a function of
+ the number of values inserted. For this library's containers,
+ it inserts a primary key into the primary associative
+ container, then a secondary key into the secondary associative
+ container. For the native multimaps, it obtains a range using
+ <code class="classname">std::equal_range</code>, and inserts a value only if it was
+ not contained already.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_insert_timing_large.cc
+ </code>
+ </p><p>The test checks the insert-time scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_large.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_insert_large_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_large_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_large.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div><div class="section" title="Text insert with Small Secondary-to-Primary Key Ratios Memory Use"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_insert_mem_small"/>
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_small.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key. There
+ are 100 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges to about 20.</p><p>The test measures the memory use as a function of the number
+ of values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_insert_mem_usage_small.cc
+ </code>
+ </p><p>The test checks the memory scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_small.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_insert_mem_small_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_large_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_small.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div><div class="section" title="Text insert with Small Secondary-to-Primary Key Ratios Memory Use"><div class="titlepage"><div><div><h5 class="title"><a id="performance.multimap.text_insert_mem_large"/>
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_large.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of pairs into a container. The
+ first item of each pair is a string from an arbitrary text
+ [wickland96thirty], and
+ the second is a uniform integer. The container is a
+ "multimap" - it considers the first member of each pair as a
+ primary key, and the second member of each pair as a secondary
+ key. There
+ are 100 distinct primary keys, and the ratio of secondary keys
+ to primary keys ranges to about 20.</p><p>The test measures the memory use as a function of the number
+ of values inserted.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/multimap_text_insert_mem_usage_large.cc
+ </code>
+ </p><p>The test checks the memory scalability of different
+ "multimap" designs.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_large.results"/>
+ Results
+ </h6></div></div></div><p>The graphic below show the results for "multimaps" which
+ use a tree-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_insert_mem_large_s2p_tree.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="5" style="text-align: left" valign="top">
+ <code class="classname">tree</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rb_tree_tag</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Node_Update</code>
+ </td><td style="text-align: left">
+ <code class="classname">null_node_update</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div><p>The graphic below show the results for "multimaps" which
+ use a hash-based container for primary keys.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_multimap_text_find_large_s2p_hash.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/><col style="text-align: left" class="c7"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ n_hash_mmap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::tr1::unordered_multimap</code>
+ </td><td colspan="6" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_lu_mtf_set
+ </td></tr><tr><td rowspan="4" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ <code class="classname">Mapped</code>
+ </td><td style="text-align: left">
+ <code class="classname">list_update</code>
+ </td><td style="text-align: left">
+ <code class="classname">Update_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">lu_move_to_front_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td colspan="7" style="text-align: left">
+ rb_tree_mmap_cc_hash_mask_exp_1div2_nsth_set
+ </td></tr><tr><td rowspan="6" style="text-align: left" valign="top">
+ <code class="classname">
+ cc_hash_table
+ </code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="4" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">Mapped</code>
+ </td><td rowspan="3" style="text-align: left" valign="top">
+ <code class="classname">cc_hash_table</code>
+ </td><td style="text-align: left">
+ <code class="classname">Comb_Hash_Fn</code>
+ </td><td style="text-align: left">
+ <code class="classname">direct_mask_range_hashing</code>
+ </td><td colspan="2" style="text-align: left"> </td></tr><tr><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">Resize_Policy</code>
+ </td><td rowspan="2" style="text-align: left" valign="top">
+ <code class="classname">hash_standard_resize_policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">Size_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_exponential_size_policy</code>
+ </td></tr><tr><td style="text-align: left" valign="top">
+ <code class="classname">Trigger_Policy</code>
+ </td><td style="text-align: left">
+ <code class="classname">hash_load_check_resize_trigger</code> with
+ α<sub>min</sub> = 1/8 and α<sub>max</sub> = 1/2
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="multimap.text_insert_mem_large.observations"/>
+ Observations
+ </h6></div></div></div><p>See Observations::Mapping-Semantics
+ Considerations.</p></div></div></div><div class="section" title="Priority Queue"><div class="titlepage"><div><div><h4 class="title"><a id="performance.priority_queue"/>Priority Queue</h4></div></div></div><div class="section" title="Text push"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_push"/>
+ Text <code class="function">push</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ a container using <code class="function">push</code>. It measures the average time
+ for <code class="function">push</code> as a function of the number of values
+ pushed.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_push_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push.results"/>
+ Results
+ </h6></div></div></div><p>The two graphics below show the results for the native
+ priority_queues and this library's priority_queues.
+ </p><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_push.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the binary-heap
+ based native priority queues and this library's pairing-heap
+ priority_queue data structures.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pairing_priority_queue_text_push.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push.observations"/>
+ Observations
+ </h6></div></div></div><p>Pairing heaps (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">pairing_heap_tag</code>)
+ are the most suited for sequences of <code class="function">push</code> and
+ <code class="function">pop</code> operations of non-primitive types (e.g.
+ <code class="classname">std::string</code>s). (See Priority Queue
+ Text <code class="function">push</code> and <code class="function">pop</code> Timing Test.) They are
+ less constrained than binomial heaps, e.g., and since
+ they are node-based, they outperform binary heaps. (See
+ Priority
+ Queue Random Integer <code class="function">push</code> Timing Test for the case
+ of primitive types.)</p><p>The standard's priority queues do not seem to perform well in
+ this case: the <code class="classname">std::vector</code> implementation needs to
+ perform a logarithmic sequence of string operations for each
+ operation, and the deque implementation is possibly hampered by
+ its need to manipulate a relatively-complex type (deques
+ support a O(1) <code class="function">push_front</code>, even though it is
+ not used by <code class="classname">std::priority_queue</code>.)</p></div></div><div class="section" title="Text push and pop"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_push_pop"/>
+ Text <code class="function">push</code> and <code class="function">pop</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push_pop.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ a container using <code class="classname">push</code> , then removes them using
+ <code class="classname">pop</code> . It measures the average time for <code class="classname">push</code>
+ as a function of the number of values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_push_pop_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push_pop.results"/>
+ Results
+ </h6></div></div></div><p>The two graphics below show the results for the native
+ priority_queues and this library's priority_queues.
+ </p><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_push_pop.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the native priority
+ queues and this library's pairing-heap priority_queue data
+ structures.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pairing_priority_queue_text_push_pop.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code> adapting <code class="classname">std::vector</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_push_pop.observations"/>
+ Observations
+ </h6></div></div></div><p>These results are very similar to Priority Queue Text
+ <code class="function">push</code> Timing Test. As stated there, pairing heaps
+ (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code>
+ = <code class="classname">pairing_heap_tag</code>) are most suited
+ for <code class="function">push</code> and <code class="function">pop</code>
+ sequences of non-primitive types such as strings. Observing these
+ two tests, one can note that a pairing heap outperforms the others
+ in terms of <code class="function">push</code> operations, but equals
+ binary heaps (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code>
+ = <code class="classname">binary_heap_tag</code>) if the number
+ of <code class="function">push</code> and <code class="function">pop</code>
+ operations is equal. As the number of <code class="function">pop</code>
+ operations is at most equal to the number
+ of <code class="function">push</code> operations, pairing heaps are better
+ in this case. See Priority Queue Random
+ Integer <code class="function">push</code> and <code class="function">pop</code>
+ Timing Test for a case which is different.</p></div></div><div class="section" title="Integer push"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.int_push"/>
+ Integer <code class="function">push</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with integer keys
+ into a container using <code class="function">push</code>. It
+ measures the average time for <code class="function">push</code> as a
+ function of the number of values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_random_int_push_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push.results"/>
+ Results
+ </h6></div></div></div><p>The two graphics below show the results for the native
+ priority_queues and this library's priority_queues.
+ </p><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_int_push.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the binary-heap
+ based native priority queues and this library's
+ priority_queue data structures.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_binary_priority_queue_int_push.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code> adapting <code class="classname">std::vector</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push.observations"/>
+ Observations
+ </h6></div></div></div><p>Binary heaps are the most suited for sequences of
+ <code class="function">push</code> and <code class="function">pop</code> operations of primitive types
+ (e.g. <span class="type">int</span>s). They are less constrained
+ than any other type, and since it is very efficient to store
+ such types in arrays, they outperform even pairing heaps. (See
+ Priority
+ Queue Text <code class="function">push</code> Timing Test for the case of
+ non-primitive types.)</p></div></div><div class="section" title="Integer push"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.int_push_pop"/>
+ Integer <code class="function">push</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push_pop.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with integer keys
+ into a container using <code class="function">push</code> , then removes them
+ using <code class="function">pop</code> . It measures the average time for
+ <code class="function">push</code> and <code class="function">pop</code> as a function
+ of the number of values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_random_int_push_pop_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push_pop.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_int_push_pop.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.int_push_pop.observations"/>
+ Observations
+ </h6></div></div></div><p>Binary heaps are the most suited for sequences of
+ <code class="function">push</code> and <code class="function">pop</code> operations of primitive types
+ (e.g. <span class="type">int</span>s). This is explained in
+ Priority
+ Queue Random Int <code class="function">push</code> Timing Test. (See Priority Queue
+ Text <code class="function">push</code> Timing Test for the case of primitive
+ types.)</p><p>At first glance it seems that the standard's vector-based
+ priority queue is approximately on par with this
+ library's corresponding priority queue. There are two
+ differences however:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>The standard's priority queue does not downsize the underlying
+ vector (or deque) as the priority queue becomes smaller
+ (see Priority Queue
+ Text <code class="function">pop</code> Memory Use Test). It is therefore
+ gaining some speed at the expense of space.</p></li><li class="listitem"><p>From Priority Queue Random
+ Integer <code class="function">push</code> and <code class="function">pop</code>
+ Timing Test, it seems that the standard's priority queue is
+ slower in terms of <code class="function">push</code> operations. Since
+ the number of
+ <code class="function">pop</code> operations is at most that of <code class="function">push</code>
+ operations, the test here is the "best" for the standard's
+ priority queue.</p></li></ol></div></div></div><div class="section" title="Text pop Memory Use"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_pop"/>
+ Text <code class="function">pop</code> Memory Use
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_pop.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ a container, then pops them until only one is left in the
+ container. It measures the memory use as a function of the
+ number of values pushed to the container.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_pop_mem_usage.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_pop.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_pop_mem.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_pop.observations"/>
+ Observations
+ </h6></div></div></div><p>The priority queue implementations (excluding the standard's) use
+ memory proportionally to the number of values they hold:
+ node-based implementations (e.g., a pairing heap) do so
+ naturally; this library's binary heap de-allocates memory when
+ a certain lower threshold is exceeded.</p><p>Note from Priority Queue Text <code class="function">push</code>
+ and <code class="function">pop</code> Timing Test and Priority Queue
+ Random Integer <code class="function">push</code>
+ and <code class="function">pop</code> Timing Test that this does not
+ impede performance compared to the standard's priority
+ queues.</p><p>See Hash-Based Erase
+ Memory Use Test for a similar phenomenon regarding priority
+ queues.</p></div></div><div class="section" title="Text join"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_join"/>
+ Text <code class="function">join</code>
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_join.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ two containers, then merges the containers. It uses
+ <code class="function">join</code> for this library's priority queues; for
+ the standard's priority queues, it successively pops values from
+ one container and pushes them into the other. The test measures
+ the average time as a function of the number of values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_join_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures.
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_join.results"/>
+ Results
+ </h6></div></div></div><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_join.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_join.observations"/>
+ Observations
+ </h6></div></div></div><p>In this test the node-based heaps perform <code class="function">join</code> in
+ either logarithmic or constant time. The binary heap requires
+ linear time, since the well-known heapify algorithm [clrs2001] is linear.</p><p>It would be possible to apply the heapify algorithm to the
+ standard containers, if they would support iteration (which they
+ don't). Barring iterators, it is still somehow possible to perform
+ linear-time merge on a <code class="classname">std::vector</code>-based
+ standard priority queue, using <code class="function">top()</code>
+ and <code class="function">size()</code> (since they are enough to expose
+ the underlying array), but this is impossible for
+ a <code class="classname">std::deque</code>-based standard priority queue.
+ Without heapify, the cost is super-linear.</p></div></div><div class="section" title="Text modify Up"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_modify_up"/>
+ Text <code class="function">modify</code> Up
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_up.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ into a container then modifies each one "up" (i.e., it
+ makes it larger). It uses <code class="function">modify</code> for this library's
+ priority queues; for the standard's priority queues, it pops values
+ from a container until it reaches the value that should be
+ modified, then pushes values back in. It measures the average
+ time for <code class="function">modify</code> as a function of the number of
+ values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_modify_up_timing.cc
+ </code>
+ </p><p>The test checks the effect of different underlying data
+ structures for graph algorithms settings. Note that making an
+ arbitrary value larger (in the sense of the priority queue's
+ comparison functor) corresponds to decrease-key in standard graph
+ algorithms [clrs2001].
+ </p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_up.results"/>
+ Results
+ </h6></div></div></div><p>The two graphics below show the results for the native
+ priority_queues and this library's priority_queues.
+ </p><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_modify_up.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the
+ native priority queues and this library's pairing and thin heap
+ priority_queue data structures.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pairing_priority_queue_text_modify_up_thin.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_up.observations"/>
+ Observations
+ </h6></div></div></div><p>As noted above, increasing an arbitrary value (in the sense of
+ the priority queue's comparison functor) is very common in
+ graph-related algorithms. In this case, a thin heap
+ (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">thin_heap_tag</code>)
+ outperforms a pairing heap (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">pairing_heap_tag</code>).
+ Conversely, Priority Queue Text
+ <code class="function">push</code> Timing Test, Priority Queue
+ Text <code class="function">push</code> and <code class="function">pop</code> Timing Test, Priority
+ Queue Random Integer <code class="function">push</code> Timing Test, and
+ Priority
+ Queue Random Integer <code class="function">push</code> and <code class="function">pop</code> Timing
+ Test show that the situation is reversed for other
+ operations. It is not clear when to prefer one of these two
+ different types.</p><p>In this test this library's binary heaps
+ effectively perform modify in linear time. As explained in
+ Priority Queue Design::Traits, given a valid point-type iterator,
+ a binary heap can perform
+ <code class="function">modify</code> logarithmically. The problem is that binary
+ heaps invalidate their find iterators with each modifying
+ operation, and so the only way to obtain a valid point-type
+ iterator is to iterate using a range-type iterator until
+ finding the appropriate value, then use the range-type iterator
+ for the <code class="function">modify</code> operation.</p><p>The explanation for the standard's priority queues' performance
+ is similar to that in Priority Queue Text
+ <code class="function">join</code> Timing Test.</p></div></div><div class="section" title="Text modify Down"><div class="titlepage"><div><div><h5 class="title"><a id="performance.priority_queue.text_modify_down"/>
+ Text <code class="function">modify</code> Down
+ </h5></div></div></div><p/><div class="section" title="Description"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_down.info"/>
+ Description
+ </h6></div></div></div><p>This test inserts a number of values with keys from an
+ arbitrary text ([ wickland96thirty ]) into
+ into a container then modifies each one "down" (i.e., it
+ makes it smaller). It uses <code class="function">modify</code> for this library's
+ priority queues; for the standard's priority queues, it pops values
+ from a container until it reaches the value that should be
+ modified, then pushes values back in. It measures the average
+ time for <code class="function">modify</code> as a function of the number of
+ values.</p><p>
+ It uses the test file:
+ <code class="filename">
+ performance/ext/pb_ds/priority_queue_text_modify_down_timing.cc
+ </code>
+ </p><p>The main purpose of this test is to contrast Priority Queue
+ Text <code class="classname">modify</code> Up Timing Test.</p></div><div class="section" title="Results"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_down.results"/>
+ Results
+ </h6></div></div></div><p>The two graphics below show the results for the native
+ priority_queues and this library's priority_queues.
+ </p><p>The graphic immediately below shows the results for the
+ native priority_queue type instantiated with different underlying
+ container types versus several different versions of library's
+ priority_queues.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_text_modify_down.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_vector
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::vector</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ n_pq_deque
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Sequence</code>
+ </td><td style="text-align: left">
+ <code class="classname">std::deque</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binary_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binary_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ rc_binomial_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">rc_binomial_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div><p>The graphic below shows the results for the
+ native priority queues and this library's pairing and thin heap
+ priority_queue data structures.
+ </p><div class="informalfigure"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pairing_priority_queue_text_modify_down_thin.png" style="text-align: middle"/></div></div><p>
+ The abbreviated names in the legend of the graphic above are
+ instantiated with the types in the following table.
+ </p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/></colgroup><thead><tr><th style="text-align: left"><span class="emphasis"><em>Name/Instantiating Type</em></span></th><th style="text-align: left"><span class="emphasis"><em>Parameter</em></span></th><th style="text-align: left"><span class="emphasis"><em>Details</em></span></th></tr></thead><tbody><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ thin_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">thin_heap_tag</code>
+ </td></tr><tr style="background-color: #B0B0B0"><td colspan="3" style="text-align: left">
+ pairing_heap
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ </td><td style="text-align: left">
+ <code class="classname">Tag</code>
+ </td><td style="text-align: left">
+ <code class="classname">pairing_heap_tag</code>
+ </td></tr></tbody></table></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h6 class="title"><a id="priority_queue.text_modify_down.observations"/>
+ Observations
+ </h6></div></div></div><p>Most points in these results are similar to Priority Queue
+ Text <code class="function">modify</code> Up Timing Test.</p><p>It is interesting to note, however, that as opposed to that
+ test, a thin heap (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">thin_heap_tag</code>) is
+ outperformed by a pairing heap (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">pairing_heap_tag</code>).
+ In this case, both heaps essentially perform an <code class="function">erase</code>
+ operation followed by a <code class="function">push</code> operation. As the other
+ tests show, a pairing heap is usually far more efficient than a
+ thin heap, so this is not surprising.</p><p>Most algorithms that involve priority queues increase values
+ (in the sense of the priority queue's comparison functor), and
+ so Priority Queue
+ Text <code class="classname">modify</code> Up Timing Test - is more interesting
+ than this test.</p></div></div></div><div class="section" title="Observations"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.test.performance.observations"/>Observations</h4></div></div></div><div class="section" title="Associative"><div class="titlepage"><div><div><h5 class="title"><a id="observations.associative"/>Associative</h5></div></div></div><div class="section" title="Underlying Data-Structure Families"><div class="titlepage"><div><div><h6 class="title"><a id="observations.associative.underlying"/>
+ Underlying Data-Structure Families
+ </h6></div></div></div><p>In general, hash-based containers have better timing performance
+ than containers based on different underlying-data structures. The
+ main reason to choose a tree-based or trie-based container is if a
+ byproduct of the tree-like structure is required: either
+ order-preservation, or the ability to utilize node invariants. If
+ memory-use is the major factor, an ordered-vector tree gives
+ optimal results (albeit with high modificiation costs), and a
+ list-based container gives reasonable results.</p></div><div class="section" title="Hash-Based Containers"><div class="titlepage"><div><div><h6 class="title"><a id="observations.associative.hash"/>
+ Hash-Based Containers
+ </h6></div></div></div><p>Hash-based containers are typically either collision
+ chaining or probing. Collision-chaining
+ containers are more flexible internally, and so offer better
+ timing performance. Probing containers, if used for simple
+ value-types, manage memory more efficiently (they perform far
+ fewer allocation-related calls). In general, therefore, a
+ collision-chaining table should be used. A probing container,
+ conversely, might be used efficiently for operations such as
+ eliminating duplicates in a sequence, or counting the number of
+ occurrences within a sequence. Probing containers might be more
+ useful also in multithreaded applications where each thread
+ manipulates a hash-based container: in the standard, allocators have
+ class-wise semantics (see [meyers96more] - Item 10); a
+ probing container might incur less contention in this case.</p></div><div class="section" title="Hash Policies"><div class="titlepage"><div><div><h6 class="title"><a id="observations.associative.hash_policies"/>
+ Hash Policies
+ </h6></div></div></div><p>In hash-based containers, the range-hashing scheme seems to
+ affect performance more than other considerations. In most
+ settings, a mask-based scheme works well (or can be made to
+ work well). If the key-distribution can be estimated a-priori,
+ a simple hash function can produce nearly uniform hash-value
+ distribution. In many other cases (e.g., text hashing,
+ floating-point hashing), the hash function is powerful enough
+ to generate hash values with good uniformity properties
+ [knuth98sorting];
+ a modulo-based scheme, taking into account all bits of the hash
+ value, appears to overlap the hash function in its effort.</p><p>The range-hashing scheme determines many of the other
+ policies. A mask-based scheme works
+ well with an exponential-size policy; for
+ probing-based containers, it goes well with a linear-probe
+ function.</p><p>An orthogonal consideration is the trigger policy. This
+ presents difficult tradeoffs. E.g., different load
+ factors in a load-check trigger policy yield a
+ space/amortized-cost tradeoff.</p></div><div class="section" title="Branch-Based Containers"><div class="titlepage"><div><div><h6 class="title"><a id="observations.associative.branch"/>
+ Branch-Based Containers
+ </h6></div></div></div><p>In general, there are several families of tree-based
+ underlying data structures: balanced node-based trees
+ (e.g., red-black or AVL trees), high-probability
+ balanced node-based trees (e.g., random treaps or
+ skip-lists), competitive node-based trees (e.g., splay
+ trees), vector-based "trees", and tries. (Additionally, there
+ are disk-residing or network-residing trees, such as B-Trees
+ and their numerous variants. An interface for this would have
+ to deal with the execution model and ACID guarantees; this is
+ out of the scope of this library.) Following are some
+ observations on their application to different settings.</p><p>Of the balanced node-based trees, this library includes a
+ red-black tree, as does standard (in
+ practice). This type of tree is the "workhorse" of tree-based
+ containers: it offers both reasonable modification and
+ reasonable lookup time. Unfortunately, this data structure
+ stores a huge amount of metadata. Each node must contain,
+ besides a value, three pointers and a boolean. This type might
+ be avoided if space is at a premium [austern00noset].</p><p>High-probability balanced node-based trees suffer the
+ drawbacks of deterministic balanced trees. Although they are
+ fascinating data structures, preliminary tests with them showed
+ their performance was worse than red-black trees. The library
+ does not contain any such trees, therefore.</p><p>Competitive node-based trees have two drawbacks. They are
+ usually somewhat unbalanced, and they perform a large number of
+ comparisons. Balanced trees perform one comparison per each
+ node they encounter on a search path; a splay tree performs two
+ comparisons. If the keys are complex objects, e.g.,
+ <code class="classname">std::string</code>, this can increase the running time.
+ Conversely, such trees do well when there is much locality of
+ reference. It is difficult to determine in which case to prefer
+ such trees over balanced trees. This library includes a splay
+ tree.</p><p>Ordered-vector trees use very little space
+ [austern00noset].
+ They do not have any other advantages (at least in this
+ implementation).</p><p>Large-fan-out PATRICIA tries have excellent lookup
+ performance, but they do so through maintaining, for each node,
+ a miniature "hash-table". Their space efficiency is low, and
+ their modification performance is bad. These tries might be
+ used for semi-static settings, where order preservation is
+ important. Alternatively, red-black trees cross-referenced with
+ hash tables can be used. [okasaki98mereable]
+ discusses small-fan-out PATRICIA tries for integers, but the
+ cited results seem to indicate that the amortized cost of
+ maintaining such trees is higher than that of balanced trees.
+ Moderate-fan-out trees might be useful for sequences where each
+ element has a limited number of choices, e.g., DNA
+ strings.</p></div><div class="section" title="Mapping-Semantics"><div class="titlepage"><div><div><h6 class="title"><a id="observations.associative.mapping_semantics"/>
+ Mapping-Semantics
+ </h6></div></div></div><p>Different mapping semantics were discussed in the introduction and design sections.Here
+ the focus will be on the case where a keys can be composed into
+ primary keys and secondary keys. (In the case where some keys
+ are completely identical, it is trivial that one should use an
+ associative container mapping values to size types.) In this
+ case there are (at least) five possibilities:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Use an associative container that allows equivalent-key
+ values (such as <code class="classname">std::multimap</code>)</p></li><li class="listitem"><p>Use a unique-key value associative container that maps
+ each primary key to some complex associative container of
+ secondary keys, say a tree-based or hash-based container.
+ </p></li><li class="listitem"><p>Use a unique-key value associative container that maps
+ each primary key to some simple associative container of
+ secondary keys, say a list-based container.</p></li><li class="listitem"><p>Use a unique-key value associative container that maps
+ each primary key to some non-associative container
+ (e.g., <code class="classname">std::vector</code>)</p></li><li class="listitem"><p>Use a unique-key value associative container that takes
+ into account both primary and secondary keys.</p></li></ol></div><p>Stated simply: there is a simple answer for this. (Excluding
+ option 1, which should be avoided in all cases).</p><p>If the expected ratio of secondary keys to primary keys is
+ small, then 3 and 4 seem reasonable. Both types of secondary
+ containers are relatively lightweight (in terms of memory use
+ and construction time), and so creating an entire container
+ object for each primary key is not too expensive. Option 4
+ might be preferable to option 3 if changing the secondary key
+ of some primary key is frequent - one cannot modify an
+ associative container's key, and the only possibility,
+ therefore, is erasing the secondary key and inserting another
+ one instead; a non-associative container, conversely, can
+ support in-place modification. The actual cost of erasing a
+ secondary key and inserting another one depends also on the
+ allocator used for secondary associative-containers (The tests
+ above used the standard allocator, but in practice one might
+ choose to use, e.g., [boost_pool]). Option 2 is
+ definitely an overkill in this case. Option 1 loses out either
+ immediately (when there is one secondary key per primary key)
+ or almost immediately after that. Option 5 has the same
+ drawbacks as option 2, but it has the additional drawback that
+ finding all values whose primary key is equivalent to some key,
+ might be linear in the total number of values stored (for
+ example, if using a hash-based container).</p><p>If the expected ratio of secondary keys to primary keys is
+ large, then the answer is more complicated. It depends on the
+ distribution of secondary keys to primary keys, the
+ distribution of accesses according to primary keys, and the
+ types of operations most frequent.</p><p>To be more precise, assume there are m primary keys,
+ primary key i is mapped to n<sub>i</sub>
+ secondary keys, and each primary key is mapped, on average, to
+ n secondary keys (i.e.,
+ E(n<sub>i</sub>) = n).</p><p>Suppose one wants to find a specific pair of primary and
+ secondary keys. Using 1 with a tree based container
+ (<code class="classname">std::multimap</code>), the expected cost is
+ E(Θ(log(m) + n<sub>i</sub>)) = Θ(log(m) +
+ n); using 1 with a hash-based container
+ (<code class="classname">std::tr1::unordered_multimap</code>), the expected cost is
+ Θ(n). Using 2 with a primary hash-based container
+ and secondary hash-based containers, the expected cost is
+ O(1); using 2 with a primary tree-based container and
+ secondary tree-based containers, the expected cost is (using
+ the Jensen inequality [motwani95random])
+ E(O(log(m) + log(n<sub>i</sub>)) = O(log(m)) +
+ E(O(log(n<sub>i</sub>)) = O(log(m)) + O(log(n)),
+ assuming that primary keys are accessed equiprobably. 3 and 4
+ are similar to 1, but with lower constants. Using 5 with a
+ hash-based container, the expected cost is O(1); using 5
+ with a tree based container, the cost is
+ E(Θ(log(mn))) = Θ(log(m) +
+ log(n)).</p><p>Suppose one needs the values whose primary key matches some
+ given key. Using 1 with a hash-based container, the expected
+ cost is Θ(n), but the values will not be ordered
+ by secondary keys (which may or may not be required); using 1
+ with a tree-based container, the expected cost is
+ Θ(log(m) + n), but with high constants; again the
+ values will not be ordered by secondary keys. 2, 3, and 4 are
+ similar to 1, but typically with lower constants (and,
+ additionally, if one uses a tree-based container for secondary
+ keys, they will be ordered). Using 5 with a hash-based
+ container, the cost is Θ(mn).</p><p>Suppose one wants to assign to a primary key all secondary
+ keys assigned to a different primary key. Using 1 with a
+ hash-based container, the expected cost is Θ(n),
+ but with very high constants; using 1 with a tree-based
+ container, the cost is Θ(nlog(mn)). Using 2, 3,
+ and 4, the expected cost is Θ(n), but typically
+ with far lower costs than 1. 5 is similar to 1.</p></div></div><div class="section" title="Priority_Queue"><div class="titlepage"><div><div><h5 class="title"><a id="observations.priority_queue"/>Priority_Queue</h5></div></div></div><div class="section" title="Complexity"><div class="titlepage"><div><div><h6 class="title"><a id="observations.priority_queue.complexity"/>Complexity</h6></div></div></div><p>The following table shows the complexities of the different
+ underlying data structures in terms of orders of growth. It is
+ interesting to note that this table implies something about the
+ constants of the operations as well (see Amortized <code class="function">push</code>
+ and <code class="function">pop</code> operations).</p><div class="informaltable"><table border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/><col style="text-align: left" class="c6"/></colgroup><thead><tr><th style="text-align: left"> </th><th style="text-align: left"><span class="emphasis"><em><code class="function">push</code></em></span></th><th style="text-align: left"><span class="emphasis"><em><code class="function">pop</code></em></span></th><th style="text-align: left"><span class="emphasis"><em><code class="function">modify</code></em></span></th><th style="text-align: left"><span class="emphasis"><em><code class="function">erase</code></em></span></th><th style="text-align: left"><span class="emphasis"><em><code class="function">join</code></em></span></th></tr></thead><tbody><tr><td style="text-align: left">
+ <code class="classname">std::priority_queue</code>
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(log(n)) Worst
+ </td><td style="text-align: left">
+ Θ(n log(n)) Worst
+ <sub>[std note 1]</sub>
+ </td><td style="text-align: left">
+ Θ(n log(n))
+ <sub>[std note 2]</sub>
+ </td><td style="text-align: left">
+ Θ(n log(n))
+ <sub>[std note 1]</sub>
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ &lt;<code class="classname">Tag</code> =
+ <code class="classname">pairing_heap_tag</code>&gt;
+ </td><td style="text-align: left">
+ O(1)
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ O(1)
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ &lt;<code class="classname">Tag</code> =
+ <code class="classname">binary_heap_tag</code>&gt;
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(n)
+ </td><td style="text-align: left">
+ Θ(n)
+ </td><td style="text-align: left">
+ Θ(n)
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ &lt;<code class="classname">Tag</code> =
+ <code class="classname">binomial_heap_tag</code>&gt;
+ </td><td style="text-align: left">
+ Θ(log(n)) worst
+ O(1) amortized
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>
+ &lt;<code class="classname">Tag</code> =
+ <code class="classname">rc_binomial_heap_tag</code>&gt;
+ </td><td style="text-align: left">
+ O(1)
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td><td style="text-align: left">
+ Θ(log(n))
+ </td></tr><tr><td style="text-align: left">
+ <code class="classname">priority_queue</code>&lt;<code class="classname">Tag</code> =
+ <code class="classname">thin_heap_tag</code>&gt;
+ </td><td style="text-align: left">
+ O(1)
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(log(n)) worst
+ O(1) amortized,
+ or Θ(log(n)) amortized
+ <sub>[thin_heap_note]</sub>
+ </td><td style="text-align: left">
+ Θ(n) worst
+ Θ(log(n)) amortized
+ </td><td style="text-align: left">
+ Θ(n)
+ </td></tr></tbody></table></div><p>[std note 1] This
+ is not a property of the algorithm, but rather due to the fact
+ that the standard's priority queue implementation does not support
+ iterators (and consequently the ability to access a specific
+ value inside it). If the priority queue is adapting an
+ <code class="classname">std::vector</code>, then it is still possible to reduce this
+ to Θ(n) by adapting over the standard's adapter and
+ using the fact that <code class="function">top</code> returns a reference to the
+ first value; if, however, it is adapting an
+ <code class="classname">std::deque</code>, then this is impossible.</p><p>[std note 2] As
+ with [std note 1], this is not a
+ property of the algorithm, but rather the standard's implementation.
+ Again, if the priority queue is adapting an
+ <code class="classname">std::vector</code> then it is possible to reduce this to
+ Θ(n), but with a very high constant (one must call
+ <code class="function">std::make_heap</code> which is an expensive linear
+ operation); if the priority queue is adapting an
+ <code class="classname">std::deque</code>, then this is impossible.</p><p>[thin_heap_note] A thin heap has
+ Θ(log(n)) worst case <code class="function">modify</code> time
+ always, but the amortized time depends on the nature of the
+ operation: I) if the operation increases the key (in the sense
+ of the priority queue's comparison functor), then the amortized
+ time is O(1), but if II) it decreases it, then the
+ amortized time is the same as the worst case time. Note that
+ for most algorithms, I) is important and II) is not.</p></div><div class="section" title="Amortized push and pop operations"><div class="titlepage"><div><div><h6 class="title"><a id="observations.priority_queue.amortized_ops"/>
+ Amortized <code class="function">push</code>
+ and <code class="function">pop</code> operations
+ </h6></div></div></div><p>In many cases, a priority queue is needed primarily for
+ sequences of <code class="function">push</code> and <code class="function">pop</code> operations. All of
+ the underlying data structures have the same amortized
+ logarithmic complexity, but they differ in terms of
+ constants.</p><p>The table above shows that the different data structures are
+ "constrained" in some respects. In general, if a data structure
+ has lower worst-case complexity than another, then it will
+ perform slower in the amortized sense. Thus, for example a
+ redundant-counter binomial heap (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">rc_binomial_heap_tag</code>)
+ has lower worst-case <code class="function">push</code> performance than a binomial
+ heap (<code class="classname">priority_queue</code>
+ with <code class="classname">Tag</code> = <code class="classname">binomial_heap_tag</code>),
+ and so its amortized <code class="function">push</code> performance is slower in
+ terms of constants.</p><p>As the table shows, the "least constrained" underlying
+ data structures are binary heaps and pairing heaps.
+ Consequently, it is not surprising that they perform best in
+ terms of amortized constants.</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Pairing heaps seem to perform best for non-primitive
+ types (e.g., <code class="classname">std::string</code>s), as shown by
+ Priority
+ Queue Text <code class="function">push</code> Timing Test and Priority
+ Queue Text <code class="function">push</code> and <code class="function">pop</code> Timing
+ Test</p></li><li class="listitem"><p>binary heaps seem to perform best for primitive types
+ (e.g., <span class="type">int</span>s), as shown by Priority
+ Queue Random Integer <code class="function">push</code> Timing Test and
+ Priority
+ Queue Random Integer <code class="function">push</code> and <code class="function">pop</code> Timing
+ Test.</p></li></ol></div></div><div class="section" title="Graph Algorithms"><div class="titlepage"><div><div><h6 class="title"><a id="observations.priority_queue.graphs"/>
+ Graph Algorithms
+ </h6></div></div></div><p>In some graph algorithms, a decrease-key operation is
+ required [clrs2001];
+ this operation is identical to <code class="function">modify</code> if a value is
+ increased (in the sense of the priority queue's comparison
+ functor). The table above and Priority Queue
+ Text <code class="function">modify</code> Up Timing Test show that a thin heap
+ (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">thin_heap_tag</code>)
+ outperforms a pairing heap (<code class="classname">priority_queue</code> with
+ <code class="classname">Tag</code> = <code class="classname">Tag</code> = <code class="classname">pairing_heap_tag</code>),
+ but the rest of the tests show otherwise.</p><p>This makes it difficult to decide which implementation to use in
+ this case. Dijkstra's shortest-path algorithm, for example, requires
+ Θ(n) <code class="function">push</code> and <code class="function">pop</code> operations
+ (in the number of vertices), but O(n<sup>2</sup>)
+ <code class="function">modify</code> operations, which can be in practice Θ(n)
+ as well. It is difficult to find an a-priori characterization of
+ graphs in which the actual number of <code class="function">modify</code>
+ operations will dwarf the number of <code class="function">push</code> and
+ <code class="function">pop</code> operations.</p></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><td align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td align="right"> <a accesskey="n" href="policy_data_structures_biblio.html">Next</a></td></tr><tr><td align="left" valign="top">Design </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Acknowledgments</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures.html b/libstdc++-v3/doc/html/manual/policy_data_structures.html
new file mode 100644
index 00000000000..c6c32943f72
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures.html
@@ -0,0 +1,1312 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 22. Policy-Based Data Structures</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;&#9;ISO C++&#10; , &#10;&#9;policy&#10; , &#10;&#9;container&#10; , &#10;&#9;data&#10; , &#10;&#9;structure&#10; , &#10;&#9;associated&#10; , &#10;&#9;tree&#10; , &#10;&#9;trie&#10; , &#10;&#9;hash&#10; , &#10;&#9;metaprogramming&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch21s02.html" title="Implementation"/><link rel="next" href="policy_data_structures_using.html" title="Using"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Policy-Based Data Structures</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch21s02.html">Prev</a> </td><th width="60%" align="center">Part III. 
+ Extensions
+
+</th><td align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 22. Policy-Based Data Structures"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers.pbds"/>Chapter 22. Policy-Based Data Structures</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues">Performance Issues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.issues.priority_queue">Priority Que</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation">Goals</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.associative">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.iterators">Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.associative.functions">Functional</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures.html#pbds.intro.motivation.priority_queue">Priority Queues</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.policy">Policy Choices</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.underlying">Underlying Data Structures</a></span></dt><dt><span class="section"><a href="policy_data_structures.html#motivation.priority_queue.binary_heap">Binary Heaps</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.organization">Organization</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.basic">Basic Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.configuring">
+ Configuring via Template Parameters
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.traits">
+ Querying Container Attributes
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.tutorial.point_range_iteration">
+ Point and Range Iteration
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.basic">Intermediate Use</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.query">Querying with <code class="classname">container_traits</code> </a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container">By Container Method</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.hash">Hash-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.branch">Branch-Based</a></span></dt><dt><span class="section"><a href="policy_data_structures_using.html#pbds.using.examples.container.priority_queue">Priority Queues</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts">Concepts</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.null_type">Null Policy Classes</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.associative_semantics">Map and Set Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.set_vs_map">
+ Distinguishing Between Maps and Sets
+ </a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.associative_semantics.multi">Alternatives to <code class="classname">std::multiset</code> and <code class="classname">std::multimap</code></a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.iterator_semantics">Iterator Semantics</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.point_and_range">Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.iterator_semantics.both">Distinguishing Point and Range Iterators</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.invalidation">Invalidation Guarantees</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.concepts.genericity">Genericity</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.tag">Tag</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#concepts.genericity.traits">Traits</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container">By Container</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.hash">hash</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.hash.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.tree">tree</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.tree.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.trie">Trie</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.trie.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.list">List</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.list.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.list.details">Details</a></span></dt></dl></dd><dt><span class="section"><a href="policy_data_structures_design.html#pbds.design.container.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.interface">Interface</a></span></dt><dt><span class="section"><a href="policy_data_structures_design.html#container.priority_queue.details">Details</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html">Testing</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.regression">Regression</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance">Performance</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash">Hash-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_find">
+ Integer <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_find">
+ Integer Subscript <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.int_subscript_insert">
+ Integer Subscript <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.zlob_int_find">
+ Integer <code class="function">find</code> with Skewed-Distribution
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.hash.erase_mem">
+ Erase Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch">Branch-Based</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_insert">
+ Text <code class="function">insert</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_find">
+ Text <code class="function">find</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.text_lor_find">
+ Text <code class="function">find</code> with Locality-of-Reference
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.split_join">
+ <code class="function">split</code> and <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.branch.order_statistics">
+ Order-Statistics
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap">Multimap</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_small">
+ Text <code class="function">find</code> with Small Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_find_large">
+ Text <code class="function">find</code> with Large Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_small">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.multimap.text_insert_mem_large">
+ Text <code class="function">insert</code> with Small
+ Secondary-to-Primary Key Ratios Memory Use
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue">Priority Queue</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push">
+ Text <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_push_pop">
+ Text <code class="function">push</code> and <code class="function">pop</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.int_push_pop">
+ Integer <code class="function">push</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_pop">
+ Text <code class="function">pop</code> Memory Use
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_join">
+ Text <code class="function">join</code>
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_up">
+ Text <code class="function">modify</code> Up
+ </a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#performance.priority_queue.text_modify_down">
+ Text <code class="function">modify</code> Down
+ </a></span></dt></dl></dd><dt><span class="section"><a href="policy_based_data_structures_test.html#pbds.test.performance.observations">Observations</a></span></dt><dd><dl><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.associative">Associative</a></span></dt><dt><span class="section"><a href="policy_based_data_structures_test.html#observations.priority_queue">Priority_Queue</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="section"><a href="policy_data_structures_biblio.html">Acknowledgments</a></span></dt><dt><span class="bibliography"><a href="policy_data_structures.html#pbds.biblio">
+ Bibliography
+ </a></span></dt></dl></div><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="pbds.intro"/>Intro</h2></div></div></div><p>
+ This is a library of policy-based elementary data structures:
+ associative containers and priority queues. It is designed for
+ high-performance, flexibility, semantic safety, and conformance to
+ the corresponding containers in <code class="literal">std</code> and
+ <code class="literal">std::tr1</code> (except for some points where it differs
+ by design).
+ </p><p>
+ </p><div class="section" title="Performance Issues"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.intro.issues"/>Performance Issues</h3></div></div></div><p>
+ </p><p>
+ An attempt is made to categorize the wide variety of possible
+ container designs in terms of performance-impacting factors. These
+ performance factors are translated into design policies and
+ incorporated into container design.
+ </p><p>
+ There is tension between unravelling factors into a coherent set of
+ policies. Every attempt is made to make a minimal set of
+ factors. However, in many cases multiple factors make for long
+ template names. Every attempt is made to alias and use typedefs in
+ the source files, but the generated names for external symbols can
+ be large for binary files or debuggers.
+ </p><p>
+ In many cases, the longer names allow capabilities and behaviours
+ controlled by macros to also be unamibiguously emitted as distinct
+ generated names.
+ </p><p>
+ Specific issues found while unraveling performance factors in the
+ design of associative containers and priority queues follow.
+ </p><div class="section" title="Associative"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.intro.issues.associative"/>Associative</h4></div></div></div><p>
+ Associative containers depend on their composite policies to a very
+ large extent. Implicitly hard-wiring policies can hamper their
+ performance and limit their functionality. An efficient hash-based
+ container, for example, requires policies for testing key
+ equivalence, hashing keys, translating hash values into positions
+ within the hash table, and determining when and how to resize the
+ table internally. A tree-based container can efficiently support
+ order statistics, i.e. the ability to query what is the order of
+ each key within the sequence of keys in the container, but only if
+ the container is supplied with a policy to internally update
+ meta-data. There are many other such examples.
+ </p><p>
+ Ideally, all associative containers would share the same
+ interface. Unfortunately, underlying data structures and mapping
+ semantics differentiate between different containers. For example,
+ suppose one writes a generic function manipulating an associative
+ container.
+ </p><pre class="programlisting">
+ template&lt;typename Cntnr&gt;
+ void
+ some_op_sequence(Cntnr&amp; r_cnt)
+ {
+ ...
+ }
+ </pre><p>
+ Given this, then what can one assume about the instantiating
+ container? The answer varies according to its underlying data
+ structure. If the underlying data structure of
+ <code class="literal">Cntnr</code> is based on a tree or trie, then the order
+ of elements is well defined; otherwise, it is not, in general. If
+ the underlying data structure of <code class="literal">Cntnr</code> is based
+ on a collision-chaining hash table, then modifying
+ r_<code class="literal">Cntnr</code> will not invalidate its iterators' order;
+ if the underlying data structure is a probing hash table, then this
+ is not the case. If the underlying data structure is based on a tree
+ or trie, then a reference to the container can efficiently be split;
+ otherwise, it cannot, in general. If the underlying data structure
+ is a red-black tree, then splitting a reference to the container is
+ exception-free; if it is an ordered-vector tree, exceptions can be
+ thrown.
+ </p></div><div class="section" title="Priority Que"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.intro.issues.priority_queue"/>Priority Que</h4></div></div></div><p>
+ Priority queues are useful when one needs to efficiently access a
+ minimum (or maximum) value as the set of values changes.
+ </p><p>
+ Most useful data structures for priority queues have a relatively
+ simple structure, as they are geared toward relatively simple
+ requirements. Unfortunately, these structures do not support access
+ to an arbitrary value, which turns out to be necessary in many
+ algorithms. Say, decreasing an arbitrary value in a graph
+ algorithm. Therefore, some extra mechanism is necessary and must be
+ invented for accessing arbitrary values. There are at least two
+ alternatives: embedding an associative container in a priority
+ queue, or allowing cross-referencing through iterators. The first
+ solution adds significant overhead; the second solution requires a
+ precise definition of iterator invalidation. Which is the next
+ point...
+ </p><p>
+ Priority queues, like hash-based containers, store values in an
+ order that is meaningless and undefined externally. For example, a
+ <code class="code">push</code> operation can internally reorganize the
+ values. Because of this characteristic, describing a priority
+ queues' iterator is difficult: on one hand, the values to which
+ iterators point can remain valid, but on the other, the logical
+ order of iterators can change unpredictably.
+ </p><p>
+ Roughly speaking, any element that is both inserted to a priority
+ queue (e.g. through <code class="code">push</code>) and removed
+ from it (e.g., through <code class="code">pop</code>), incurs a
+ logarithmic overhead (in the amortized sense). Different underlying
+ data structures place the actual cost differently: some are
+ optimized for amortized complexity, whereas others guarantee that
+ specific operations only have a constant cost. One underlying data
+ structure might be chosen if modifying a value is frequent
+ (Dijkstra's shortest-path algorithm), whereas a different one might
+ be chosen otherwise. Unfortunately, an array-based binary heap - an
+ underlying data structure that optimizes (in the amortized sense)
+ <code class="code">push</code> and <code class="code">pop</code> operations, differs from the
+ others in terms of its invalidation guarantees. Other design
+ decisions also impact the cost and placement of the overhead, at the
+ expense of more difference in the the kinds of operations that the
+ underlying data structure can support. These differences pose a
+ challenge when creating a uniform interface for priority queues.
+ </p></div></div><div class="section" title="Goals"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.intro.motivation"/>Goals</h3></div></div></div><p>
+ Many fine associative-container libraries were already written,
+ most notably, the C++ standard's associative containers. Why
+ then write another library? This section shows some possible
+ advantages of this library, when considering the challenges in
+ the introduction. Many of these points stem from the fact that
+ the ISO C++ process introduced associative-containers in a
+ two-step process (first standardizing tree-based containers,
+ only then adding hash-based containers, which are fundamentally
+ different), did not standardize priority queues as containers,
+ and (in our opinion) overloads the iterator concept.
+ </p><div class="section" title="Associative"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.intro.motivation.associative"/>Associative</h4></div></div></div><p>
+ </p><div class="section" title="Policy Choices"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.policy"/>Policy Choices</h5></div></div></div><p>
+ Associative containers require a relatively large number of
+ policies to function efficiently in various settings. In some
+ cases this is needed for making their common operations more
+ efficient, and in other cases this allows them to support a
+ larger set of operations
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Hash-based containers, for example, support look-up and
+ insertion methods (<code class="function">find</code> and
+ <code class="function">insert</code>). In order to locate elements
+ quickly, they are supplied a hash functor, which instruct
+ how to transform a key object into some size type; a hash
+ functor might transform <code class="constant">"hello"</code>
+ into <code class="constant">1123002298</code>. A hash table, though,
+ requires transforming each key object into some size-type
+ type in some specific domain; a hash table with a 128-long
+ table might transform <code class="constant">"hello"</code> into
+ position <code class="constant">63</code>. The policy by which the
+ hash value is transformed into a position within the table
+ can dramatically affect performance. Hash-based containers
+ also do not resize naturally (as opposed to tree-based
+ containers, for example). The appropriate resize policy is
+ unfortunately intertwined with the policy that transforms
+ hash value into a position within the table.
+ </p></li><li class="listitem"><p>
+ Tree-based containers, for example, also support look-up and
+ insertion methods, and are primarily useful when maintaining
+ order between elements is important. In some cases, though,
+ one can utilize their balancing algorithms for completely
+ different purposes.
+ </p><p>
+ Figure A shows a tree whose each node contains two entries:
+ a floating-point key, and some size-type
+ <span class="emphasis"><em>metadata</em></span> (in bold beneath it) that is
+ the number of nodes in the sub-tree. (The root has key 0.99,
+ and has 5 nodes (including itself) in its sub-tree.) A
+ container based on this data structure can obviously answer
+ efficiently whether 0.3 is in the container object, but it
+ can also answer what is the order of 0.3 among all those in
+ the container object: see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>.
+
+ </p><p>
+ As another example, Figure B shows a tree whose each node
+ contains two entries: a half-open geometric line interval,
+ and a number <span class="emphasis"><em>metadata</em></span> (in bold beneath
+ it) that is the largest endpoint of all intervals in its
+ sub-tree. (The root describes the interval <code class="constant">[20,
+ 36)</code>, and the largest endpoint in its sub-tree is
+ 99.) A container based on this data structure can obviously
+ answer efficiently whether <code class="constant">[3, 41)</code> is
+ in the container object, but it can also answer efficiently
+ whether the container object has intervals that intersect
+ <code class="constant">[3, 41)</code>. These types of queries are
+ very useful in geometric algorithms and lease-management
+ algorithms.
+ </p><p>
+ It is important to note, however, that as the trees are
+ modified, their internal structure changes. To maintain
+ these invariants, one must supply some policy that is aware
+ of these changes. Without this, it would be better to use a
+ linked list (in itself very efficient for these purposes).
+ </p></li></ol></div><div class="figure"><a id="id664217"/><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_node_invariants.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/></div><div class="section" title="Underlying Data Structures"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"/>Underlying Data Structures</h5></div></div></div><p>
+ The standard C++ library contains associative containers based on
+ red-black trees and collision-chaining hash tables. These are
+ very useful, but they are not ideal for all types of
+ settings.
+ </p><p>
+ The figure below shows the different underlying data structures
+ currently supported in this library.
+ </p><div class="figure"><a id="id664273"/><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_1.png" style="text-align: middle" alt="Underlying Associative Data Structures"/></div></div></div><br class="figure-break"/><p>
+ A shows a collision-chaining hash-table, B shows a probing
+ hash-table, C shows a red-black tree, D shows a splay tree, E shows
+ a tree based on an ordered vector(implicit in the order of the
+ elements), F shows a PATRICIA trie, and G shows a list-based
+ container with update policies.
+ </p><p>
+ Each of these data structures has some performance benefits, in
+ terms of speed, size or both. For now, note that vector-based trees
+ and probing hash tables manipulate memory more efficiently than
+ red-black trees and collision-chaining hash tables, and that
+ list-based associative containers are very useful for constructing
+ "multimaps".
+ </p><p>
+ Now consider a function manipulating a generic associative
+ container,
+ </p><pre class="programlisting">
+ template&lt;class Cntnr&gt;
+ int
+ some_op_sequence(Cntnr &amp;r_cnt)
+ {
+ ...
+ }
+ </pre><p>
+ Ideally, the underlying data structure
+ of <code class="classname">Cntnr</code> would not affect what can be
+ done with <code class="varname">r_cnt</code>. Unfortunately, this is not
+ the case.
+ </p><p>
+ For example, if <code class="classname">Cntnr</code>
+ is <code class="classname">std::map</code>, then the function can
+ use
+ </p><pre class="programlisting">
+ std::for_each(r_cnt.find(foo), r_cnt.find(bar), foobar)
+ </pre><p>
+ in order to apply <code class="classname">foobar</code> to all
+ elements between <code class="classname">foo</code> and
+ <code class="classname">bar</code>. If
+ <code class="classname">Cntnr</code> is a hash-based container,
+ then this call's results are undefined.
+ </p><p>
+ Also, if <code class="classname">Cntnr</code> is tree-based, the type
+ and object of the comparison functor can be
+ accessed. If <code class="classname">Cntnr</code> is hash based, these
+ queries are nonsensical.
+ </p><p>
+ There are various other differences based on the container's
+ underlying data structure. For one, they can be constructed by,
+ and queried for, different policies. Furthermore:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Containers based on C, D, E and F store elements in a
+ meaningful order; the others store elements in a meaningless
+ (and probably time-varying) order. By implication, only
+ containers based on C, D, E and F can
+ support <code class="function">erase</code> operations taking an
+ iterator and returning an iterator to the following element
+ without performance loss.
+ </p></li><li class="listitem"><p>
+ Containers based on C, D, E, and F can be split and joined
+ efficiently, while the others cannot. Containers based on C
+ and D, furthermore, can guarantee that this is exception-free;
+ containers based on E cannot guarantee this.
+ </p></li><li class="listitem"><p>
+ Containers based on all but E can guarantee that
+ erasing an element is exception free; containers based on E
+ cannot guarantee this. Containers based on all but B and E
+ can guarantee that modifying an object of their type does
+ not invalidate iterators or references to their elements,
+ while containers based on B and E cannot. Containers based
+ on C, D, and E can furthermore make a stronger guarantee,
+ namely that modifying an object of their type does not
+ affect the order of iterators.
+ </p></li></ol></div><p>
+ A unified tag and traits system (as used for the C++ standard
+ library iterators, for example) can ease generic manipulation of
+ associative containers based on different underlying data
+ structures.
+ </p></div><div class="section" title="Iterators"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.iterators"/>Iterators</h5></div></div></div><p>
+ Iterators are centric to the design of the standard library
+ containers, because of the container/algorithm/iterator
+ decomposition that allows an algorithm to operate on a range
+ through iterators of some sequence. Iterators, then, are useful
+ because they allow going over a
+ specific <span class="emphasis"><em>sequence</em></span>. The standard library
+ also uses iterators for accessing a
+ specific <span class="emphasis"><em>element</em></span>: when an associative
+ container returns one through <code class="function">find</code>. The
+ standard library consistently uses the same types of iterators
+ for both purposes: going over a range, and accessing a specific
+ found element. Before the introduction of hash-based containers
+ to the standard library, this made sense (with the exception of
+ priority queues, which are discussed later).
+ </p><p>
+ Using the standard associative containers together with
+ non-order-preserving associative containers (and also because of
+ priority-queues container), there is a possible need for
+ different types of iterators for self-organizing containers:
+ the iterator concept seems overloaded to mean two different
+ things (in some cases). <em><span class="remark"> XXX
+ "ds_gen.html#find_range"&gt;Design::Associative
+ Containers::Data-Structure Genericity::Point-Type and Range-Type
+ Methods</span></em>.
+ </p><div class="section" title="Using Point Iterators for Range Operations"><div class="titlepage"><div><div><h6 class="title"><a id="associative.iterators.using"/>Using Point Iterators for Range Operations</h6></div></div></div><p>
+ Suppose <code class="classname">cntnr</code> is some associative
+ container, and say <code class="varname">c</code> is an object of
+ type <code class="classname">cntnr</code>. Then what will be the outcome
+ of
+ </p><pre class="programlisting">
+ std::for_each(c.find(1), c.find(5), foo);
+ </pre><p>
+ If <code class="classname">cntnr</code> is a tree-based container
+ object, then an in-order walk will
+ apply <code class="classname">foo</code> to the relevant elements,
+ as in the graphic below, label A. If <code class="varname">c</code> is
+ a hash-based container, then the order of elements between any
+ two elements is undefined (and probably time-varying); there is
+ no guarantee that the elements traversed will coincide with the
+ <span class="emphasis"><em>logical</em></span> elements between 1 and 5, as in
+ label B.
+ </p><div class="figure"><a id="id664536"/><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_1.png" style="text-align: middle" alt="Node Invariants"/></div></div></div><br class="figure-break"/><p>
+ In our opinion, this problem is not caused just because
+ red-black trees are order preserving while
+ collision-chaining hash tables are (generally) not - it
+ is more fundamental. Most of the standard's containers
+ order sequences in a well-defined manner that is
+ determined by their <span class="emphasis"><em>interface</em></span>:
+ calling <code class="function">insert</code> on a tree-based
+ container modifies its sequence in a predictable way, as
+ does calling <code class="function">push_back</code> on a list or
+ a vector. Conversely, collision-chaining hash tables,
+ probing hash tables, priority queues, and list-based
+ containers (which are very useful for "multimaps") are
+ self-organizing data structures; the effect of each
+ operation modifies their sequences in a manner that is
+ (practically) determined by their
+ <span class="emphasis"><em>implementation</em></span>.
+ </p><p>
+ Consequently, applying an algorithm to a sequence obtained from most
+ containers may or may not make sense, but applying it to a
+ sub-sequence of a self-organizing container does not.
+ </p></div><div class="section" title="Cost to Point Iterators to Enable Range Operations"><div class="titlepage"><div><div><h6 class="title"><a id="associative.iterators.cost"/>Cost to Point Iterators to Enable Range Operations</h6></div></div></div><p>
+ Suppose <code class="varname">c</code> is some collision-chaining
+ hash-based container object, and one calls
+ </p><pre class="programlisting">c.find(3)</pre><p>
+ Then what composes the returned iterator?
+ </p><p>
+ In the graphic below, label A shows the simplest (and
+ most efficient) implementation of a collision-chaining
+ hash table. The little box marked
+ <code class="classname">point_iterator</code> shows an object
+ that contains a pointer to the element's node. Note that
+ this "iterator" has no way to move to the next element (
+ it cannot support
+ <code class="function">operator++</code>). Conversely, the little
+ box marked <code class="classname">iterator</code> stores both a
+ pointer to the element, as well as some other
+ information (the bucket number of the element). the
+ second iterator, then, is "heavier" than the first one-
+ it requires more time and space. If we were to use a
+ different container to cross-reference into this
+ hash-table using these iterators - it would take much
+ more space. As noted above, nothing much can be done by
+ incrementing these iterators, so why is this extra
+ information needed?
+ </p><p>
+ Alternatively, one might create a collision-chaining hash-table
+ where the lists might be linked, forming a monolithic total-element
+ list, as in the graphic below, label B. Here the iterators are as
+ light as can be, but the hash-table's operations are more
+ complicated.
+ </p><div class="figure"><a id="id664661"/><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterators_range_ops_2.png" style="text-align: middle" alt="Point Iteration in Hash Data Structures"/></div></div></div><br class="figure-break"/><p>
+ It should be noted that containers based on collision-chaining
+ hash-tables are not the only ones with this type of behavior;
+ many other self-organizing data structures display it as well.
+ </p></div><div class="section" title="Invalidation Guarantees"><div class="titlepage"><div><div><h6 class="title"><a id="associative.iterators.invalidation"/>Invalidation Guarantees</h6></div></div></div><p>Consider the following snippet:</p><pre class="programlisting">
+ it = c.find(3);
+ c.erase(5);
+ </pre><p>
+ Following the call to <code class="classname">erase</code>, what is the
+ validity of <code class="classname">it</code>: can it be de-referenced?
+ can it be incremented?
+ </p><p>
+ The answer depends on the underlying data structure of the
+ container. The graphic below shows three cases: A1 and A2 show
+ a red-black tree; B1 and B2 show a probing hash-table; C1 and C2
+ show a collision-chaining hash table.
+ </p><div class="figure"><a id="id664738"/><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_guarantee_erase.png" style="text-align: middle" alt="Effect of erase in different underlying data structures"/></div></div></div><br class="figure-break"/><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Erasing 5 from A1 yields A2. Clearly, an iterator to 3 can
+ be de-referenced and incremented. The sequence of iterators
+ changed, but in a way that is well-defined by the interface.
+ </p></li><li class="listitem"><p>
+ Erasing 5 from B1 yields B2. Clearly, an iterator to 3 is
+ not valid at all - it cannot be de-referenced or
+ incremented; the order of iterators changed in a way that is
+ (practically) determined by the implementation and not by
+ the interface.
+ </p></li><li class="listitem"><p>
+ Erasing 5 from C1 yields C2. Here the situation is more
+ complicated. On the one hand, there is no problem in
+ de-referencing <code class="classname">it</code>. On the other hand,
+ the order of iterators changed in a way that is
+ (practically) determined by the implementation and not by
+ the interface.
+ </p></li></ol></div><p>
+ So in the standard library containers, it is not always possible
+ to express whether <code class="varname">it</code> is valid or not. This
+ is true also for <code class="function">insert</code>. Again, the
+ iterator concept seems overloaded.
+ </p></div></div><div class="section" title="Functional"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.functions"/>Functional</h5></div></div></div><p>
+ </p><p>
+ The design of the functional overlay to the underlying data
+ structures differs slightly from some of the conventions used in
+ the C++ standard. A strict public interface of methods that
+ comprise only operations which depend on the class's internal
+ structure; other operations are best designed as external
+ functions. (See <a class="xref" href="policy_data_structures.html#biblio.meyers02both" title="Class Template, Member Template - or Both?">[biblio.meyers02both]</a>).With this
+ rubric, the standard associative containers lack some useful
+ methods, and provide other methods which would be better
+ removed.
+ </p><div class="section" title="erase"><div class="titlepage"><div><div><h6 class="title"><a id="motivation.associative.functions.erase"/><code class="function">erase</code></h6></div></div></div><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Order-preserving standard associative containers provide the
+ method
+ </p><pre class="programlisting">
+ iterator
+ erase(iterator it)
+ </pre><p>
+ which takes an iterator, erases the corresponding
+ element, and returns an iterator to the following
+ element. Also standardd hash-based associative
+ containers provide this method. This seemingly
+ increasesgenericity between associative containers,
+ since it is possible to use
+ </p><pre class="programlisting">
+ typename C::iterator it = c.begin();
+ typename C::iterator e_it = c.end();
+
+ while(it != e_it)
+ it = pred(*it)? c.erase(it) : ++it;
+ </pre><p>
+ in order to erase from a container object <code class="varname">
+ c</code> all element which match a
+ predicate <code class="classname">pred</code>. However, in a
+ different sense this actually decreases genericity: an
+ integral implication of this method is that tree-based
+ associative containers' memory use is linear in the total
+ number of elements they store, while hash-based
+ containers' memory use is unbounded in the total number of
+ elements they store. Assume a hash-based container is
+ allowed to decrease its size when an element is
+ erased. Then the elements might be rehashed, which means
+ that there is no "next" element - it is simply
+ undefined. Consequently, it is possible to infer from the
+ fact that the standard library's hash-based containers
+ provide this method that they cannot downsize when
+ elements are erased. As a consequence, different code is
+ needed to manipulate different containers, assuming that
+ memory should be conserved. Therefor, this library's
+ non-order preserving associative containers omit this
+ method.
+ </p></li><li class="listitem"><p>
+ All associative containers include a conditional-erase method
+ </p><pre class="programlisting">
+ template&lt;
+ class Pred&gt;
+ size_type
+ erase_if
+ (Pred pred)
+ </pre><p>
+ which erases all elements matching a predicate. This is probably the
+ only way to ensure linear-time multiple-item erase which can
+ actually downsize a container.
+ </p></li><li class="listitem"><p>
+ The standard associative containers provide methods for
+ multiple-item erase of the form
+ </p><pre class="programlisting">
+ size_type
+ erase(It b, It e)
+ </pre><p>
+ erasing a range of elements given by a pair of
+ iterators. For tree-based or trie-based containers, this can
+ implemented more efficiently as a (small) sequence of split
+ and join operations. For other, unordered, containers, this
+ method isn't much better than an external loop. Moreover,
+ if <code class="varname">c</code> is a hash-based container,
+ then
+ </p><pre class="programlisting">
+ c.erase(c.find(2), c.find(5))
+ </pre><p>
+ is almost certain to do something
+ different than erasing all elements whose keys are between 2
+ and 5, and is likely to produce other undefined behavior.
+ </p></li></ol></div></div><div class="section" title="split and join"><div class="titlepage"><div><div><h6 class="title"><a id="motivation.associative.functions.split"/>
+ <code class="function">split</code> and <code class="function">join</code>
+ </h6></div></div></div><p>
+ It is well-known that tree-based and trie-based container
+ objects can be efficiently split or joined (See
+ <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>). Externally splitting or
+ joining trees is super-linear, and, furthermore, can throw
+ exceptions. Split and join methods, consequently, seem good
+ choices for tree-based container methods, especially, since as
+ noted just before, they are efficient replacements for erasing
+ sub-sequences.
+ </p></div><div class="section" title="insert"><div class="titlepage"><div><div><h6 class="title"><a id="motivation.associative.functions.insert"/>
+ <code class="function">insert</code>
+ </h6></div></div></div><p>
+ The standard associative containers provide methods of the form
+ </p><pre class="programlisting">
+ template&lt;class It&gt;
+ size_type
+ insert(It b, It e);
+ </pre><p>
+ for inserting a range of elements given by a pair of
+ iterators. At best, this can be implemented as an external loop,
+ or, even more efficiently, as a join operation (for the case of
+ tree-based or trie-based containers). Moreover, these methods seem
+ similar to constructors taking a range given by a pair of
+ iterators; the constructors, however, are transactional, whereas
+ the insert methods are not; this is possibly confusing.
+ </p></div><div class="section" title="operator== and operator&lt;="><div class="titlepage"><div><div><h6 class="title"><a id="motivation.associative.functions.compare"/>
+ <code class="function">operator==</code> and <code class="function">operator&lt;=</code>
+ </h6></div></div></div><p>
+ Associative containers are parametrized by policies allowing to
+ test key equivalence: a hash-based container can do this through
+ its equivalence functor, and a tree-based container can do this
+ through its comparison functor. In addition, some standard
+ associative containers have global function operators, like
+ <code class="function">operator==</code> and <code class="function">operator&lt;=</code>,
+ that allow comparing entire associative containers.
+ </p><p>
+ In our opinion, these functions are better left out. To begin
+ with, they do not significantly improve over an external
+ loop. More importantly, however, they are possibly misleading -
+ <code class="function">operator==</code>, for example, usually checks for
+ equivalence, or interchangeability, but the associative
+ container cannot check for values' equivalence, only keys'
+ equivalence; also, are two containers considered equivalent if
+ they store the same values in different order? this is an
+ arbitrary decision.
+ </p></div></div></div><div class="section" title="Priority Queues"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.intro.motivation.priority_queue"/>Priority Queues</h4></div></div></div><div class="section" title="Policy Choices"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.priority_queue.policy"/>Policy Choices</h5></div></div></div><p>
+ Priority queues are containers that allow efficiently inserting
+ values and accessing the maximal value (in the sense of the
+ container's comparison functor). Their interface
+ supports <code class="function">push</code>
+ and <code class="function">pop</code>. The standard
+ container <code class="classname">std::priorityqueue</code> indeed support
+ these methods, but little else. For algorithmic and
+ software-engineering purposes, other methods are needed:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Many graph algorithms (see
+ <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>) require increasing a
+ value in a priority queue (again, in the sense of the
+ container's comparison functor), or joining two
+ priority-queue objects.
+ </p></li><li class="listitem"><p>The return type of <code class="classname">priority_queue</code>'s
+ <code class="function">push</code> method is a point-type iterator, which can
+ be used for modifying or erasing arbitrary values. For
+ example:</p><pre class="programlisting">
+ priority_queue&lt;int&gt; p;
+ priority_queue&lt;int&gt;::point_iterator it = p.push(3);
+ p.modify(it, 4);
+ </pre><p>These types of cross-referencing operations are necessary
+ for making priority queues useful for different applications,
+ especially graph applications.</p></li><li class="listitem"><p>
+ It is sometimes necessary to erase an arbitrary value in a
+ priority queue. For example, consider
+ the <code class="function">select</code> function for monitoring
+ file descriptors:
+ </p><pre class="programlisting">
+ int
+ select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds,
+ struct timeval *timeout);
+ </pre><p>
+ then, as the select documentation states:
+ </p><p>
+ <span class="quote">“<span class="quote">
+ The nfds argument specifies the range of file
+ descriptors to be tested. The select() function tests file
+ descriptors in the range of 0 to nfds-1.</span>”</span>
+ </p><p>
+ It stands to reason, therefore, that we might wish to
+ maintain a minimal value for <code class="varname">nfds</code>, and
+ priority queues immediately come to mind. Note, though, that
+ when a socket is closed, the minimal file description might
+ change; in the absence of an efficient means to erase an
+ arbitrary value from a priority queue, we might as well
+ avoid its use altogether.
+ </p><p>
+ The standard containers typically support iterators. It is
+ somewhat unusual
+ for <code class="classname">std::priority_queue</code> to omit them
+ (See <a class="xref" href="policy_data_structures.html#biblio.meyers01stl" title="Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library">[biblio.meyers01stl]</a>). One might
+ ask why do priority queues need to support iterators, since
+ they are self-organizing containers with a different purpose
+ than abstracting sequences. There are several reasons:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Iterators (even in self-organizing containers) are
+ useful for many purposes: cross-referencing
+ containers, serialization, and debugging code that uses
+ these containers.
+ </p></li><li class="listitem"><p>
+ The standard library's hash-based containers support
+ iterators, even though they too are self-organizing
+ containers with a different purpose than abstracting
+ sequences.
+ </p></li><li class="listitem"><p>
+ In standard-library-like containers, it is natural to specify the
+ interface of operations for modifying a value or erasing
+ a value (discussed previously) in terms of a iterators.
+ It should be noted that the standard
+ containers also use iterators for accessing and
+ manipulating a specific value. In hash-based
+ containers, one checks the existence of a key by
+ comparing the iterator returned by <code class="function">find</code> to the
+ iterator returned by <code class="function">end</code>, and not by comparing a
+ pointer returned by <code class="function">find</code> to <span class="type">NULL</span>.
+ </p></li></ol></div></li></ol></div></div><div class="section" title="Underlying Data Structures"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.priority_queue.underlying"/>Underlying Data Structures</h5></div></div></div><p>
+ There are three main implementations of priority queues: the
+ first employs a binary heap, typically one which uses a
+ sequence; the second uses a tree (or forest of trees), which is
+ typically less structured than an associative container's tree;
+ the third simply uses an associative container. These are
+ shown in the figure below with labels A1 and A2, B, and C.
+ </p><div class="figure"><a id="id665301"/><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_different_underlying_dss_2.png" style="text-align: middle" alt="Underlying Priority Queue Data Structures"/></div></div></div><br class="figure-break"/><p>
+ No single implementation can completely replace any of the
+ others. Some have better <code class="function">push</code>
+ and <code class="function">pop</code> amortized performance, some have
+ better bounded (worst case) response time than others, some
+ optimize a single method at the expense of others, etc. In
+ general the "best" implementation is dictated by the specific
+ problem.
+ </p><p>
+ As with associative containers, the more implementations
+ co-exist, the more necessary a traits mechanism is for handling
+ generic containers safely and efficiently. This is especially
+ important for priority queues, since the invalidation guarantees
+ of one of the most useful data structures - binary heaps - is
+ markedly different than those of most of the others.
+ </p></div><div class="section" title="Binary Heaps"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.priority_queue.binary_heap"/>Binary Heaps</h5></div></div></div><p>
+ Binary heaps are one of the most useful underlying
+ data structures for priority queues. They are very efficient in
+ terms of memory (since they don't require per-value structure
+ metadata), and have the best amortized <code class="function">push</code> and
+ <code class="function">pop</code> performance for primitive types like
+ <span class="type">int</span>.
+ </p><p>
+ The standard library's <code class="classname">priority_queue</code>
+ implements this data structure as an adapter over a sequence,
+ typically
+ <code class="classname">std::vector</code>
+ or <code class="classname">std::deque</code>, which correspond to labels
+ A1 and A2 respectively in the graphic above.
+ </p><p>
+ This is indeed an elegant example of the adapter concept and
+ the algorithm/container/iterator decomposition. (See <a class="xref" href="policy_data_structures.html#biblio.nelson96stlpq" title="Priority Queues and the STL">[biblio.nelson96stlpq]</a>). There are
+ several reasons why a binary-heap priority queue
+ may be better implemented as a container instead of a
+ sequence adapter:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ <code class="classname">std::priority_queue</code> cannot erase values
+ from its adapted sequence (irrespective of the sequence
+ type). This means that the memory use of
+ an <code class="classname">std::priority_queue</code> object is always
+ proportional to the maximal number of values it ever contained,
+ and not to the number of values that it currently
+ contains. (See <code class="filename">performance/priority_queue_text_pop_mem_usage.cc</code>.)
+ This implementation of binary heaps acts very differently than
+ other underlying data structures (See also pairing heaps).
+ </p></li><li class="listitem"><p>
+ Some combinations of adapted sequences and value types
+ are very inefficient or just don't make sense. If one uses
+ <code class="classname">std::priority_queue&lt;std::vector&lt;std::string&gt;
+ &gt; &gt;</code>, for example, then not only will each
+ operation perform a logarithmic number of
+ <code class="classname">std::string</code> assignments, but, furthermore, any
+ operation (including <code class="function">pop</code>) can render the container
+ useless due to exceptions. Conversely, if one uses
+ <code class="classname">std::priority_queue&lt;std::deque&lt;int&gt; &gt;
+ &gt;</code>, then each operation uses incurs a logarithmic
+ number of indirect accesses (through pointers) unnecessarily.
+ It might be better to let the container make a conservative
+ deduction whether to use the structure in the graphic above, labels A1 or A2.
+ </p></li><li class="listitem"><p>
+ There does not seem to be a systematic way to determine
+ what exactly can be done with the priority queue.
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ If <code class="classname">p</code> is a priority queue adapting an
+ <code class="classname">std::vector</code>, then it is possible to iterate over
+ all values by using <code class="function">&amp;p.top()</code> and
+ <code class="function">&amp;p.top() + p.size()</code>, but this will not work
+ if <code class="varname">p</code> is adapting an <code class="classname">std::deque</code>; in any
+ case, one cannot use <code class="classname">p.begin()</code> and
+ <code class="classname">p.end()</code>. If a different sequence is adapted, it
+ is even more difficult to determine what can be
+ done.
+ </p></li><li class="listitem"><p>
+ If <code class="varname">p</code> is a priority queue adapting an
+ <code class="classname">std::deque</code>, then the reference return by
+ </p><pre class="programlisting">
+ p.top()
+ </pre><p>
+ will remain valid until it is popped,
+ but if <code class="varname">p</code> adapts an <code class="classname">std::vector</code>, the
+ next <code class="function">push</code> will invalidate it. If a different
+ sequence is adapted, it is even more difficult to
+ determine what can be done.
+ </p></li></ol></div></li><li class="listitem"><p>
+ Sequence-based binary heaps can still implement
+ linear-time <code class="function">erase</code> and <code class="function">modify</code> operations.
+ This means that if one needs to erase a small
+ (say logarithmic) number of values, then one might still
+ choose this underlying data structure. Using
+ <code class="classname">std::priority_queue</code>, however, this will generally
+ change the order of growth of the entire sequence of
+ operations.
+ </p></li></ol></div></div></div></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="pbds.biblio"/>
+ Bibliography
+ </h2></div></div></div><div class="biblioentry" title="STL Exception Handling Contract"><a id="biblio.abrahams97exception"/><p>[biblio.abrahams97exception] <span class="title"><em>
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1075.pdf">
+ STL Exception Handling Contract
+ </a>
+ </em>. </span><span class="date">1997. </span><span class="author"><span class="firstname">
+ Dave
+ </span> <span class="surname">
+ Abrahams
+ </span>. </span><span class="publisher"><span class="publishername">
+ ISO SC22/WG21
+ . </span></span></p></div><div class="biblioentry" title="Modern C++ Design: Generic Programming and Design Patterns Applied"><a id="biblio.alexandrescu01modern"/><p>[biblio.alexandrescu01modern] <span class="title"><em>
+ Modern C++ Design: Generic Programming and Design Patterns Applied
+ </em>. </span><span class="date">
+ 2001
+ . </span><span class="author"><span class="firstname">
+ Andrei
+ </span> <span class="surname">
+ Alexandrescu
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="MTF, Bit, and COMB: A Guide to Deterministic and Randomized Algorithms for the List Update Problem"><a id="biblio.andrew04mtf"/><p>[biblio.andrew04mtf] <span class="title"><em>
+ MTF, Bit, and COMB: A Guide to Deterministic and Randomized
+ Algorithms for the List Update Problem
+ </em>. </span><span class="authorgroup"><span class="firstname">
+ K.
+ </span> <span class="surname">
+ Andrew
+ </span> and <span class="firstname">
+ D.
+ </span> <span class="surname">
+ Gleich
+ </span>. </span></p></div><div class="biblioentry" title="Why You Shouldn't Use set - and What You Should Use Instead"><a id="biblio.austern00noset"/><p>[biblio.austern00noset] <span class="title"><em>
+ Why You Shouldn't Use set - and What You Should Use Instead
+ </em>. </span><span class="date">
+ April, 2000
+ . </span><span class="author"><span class="firstname">
+ Matthew
+ </span> <span class="surname">
+ Austern
+ </span>. </span><span class="publisher"><span class="publishername">
+ C++ Report
+ . </span></span></p></div><div class="biblioentry" title="A Proposal to Add Hashtables to the Standard Library"><a id="biblio.austern01htprop"/><p>[biblio.austern01htprop] <span class="title"><em>
+ <a class="link" href="http://www.open-std.org/JTC1/sc22/wg21/docs/papers/2001/n1326.html">
+ A Proposal to Add Hashtables to the Standard Library
+ </a>
+ </em>. </span><span class="date">
+ 2001
+ . </span><span class="author"><span class="firstname">
+ Matthew
+ </span> <span class="surname">
+ Austern
+ </span>. </span><span class="publisher"><span class="publishername">
+ ISO SC22/WG21
+ . </span></span></p></div><div class="biblioentry" title="Segmented iterators and hierarchical algorithms"><a id="biblio.austern98segmentedit"/><p>[biblio.austern98segmentedit] <span class="title"><em>
+ Segmented iterators and hierarchical algorithms
+ </em>. </span><span class="date">
+ April, 1998
+ . </span><span class="author"><span class="firstname">
+ Matthew
+ </span> <span class="surname">
+ Austern
+ </span>. </span><span class="publisher"><span class="publishername">
+ Generic Programming
+ . </span></span></p></div><div class="biblioentry" title="Boost Timer Library"><a id="biblio.dawestimer"/><p>[biblio.dawestimer] <span class="title"><em>
+ <a class="link" href="www.boost.org/doc/libs/release/libs/timer/">
+ Boost Timer Library
+ </a>
+ </em>. </span><span class="author"><span class="firstname">
+ Beeman
+ </span> <span class="surname">
+ Dawes
+ </span>. </span><span class="publisher"><span class="publishername">
+ Boost
+ . </span></span></p></div><div class="biblioentry" title="Boost Pool Library"><a id="biblio.clearypool"/><p>[biblio.clearypool] <span class="title"><em>
+ <a class="link" href="www.boost.org/doc/libs/release/libs/pool/">
+ Boost Pool Library
+ </a>
+ </em>. </span><span class="author"><span class="firstname">
+ Stephen
+ </span> <span class="surname">
+ Cleary
+ </span>. </span><span class="publisher"><span class="publishername">
+ Boost
+ . </span></span></p></div><div class="biblioentry" title="Boost Type Traits Library"><a id="biblio.maddocktraits"/><p>[biblio.maddocktraits] <span class="title"><em>
+ <a class="link" href="www.boost.org/doc/libs/release/libs/type_traits/">
+ Boost Type Traits Library
+ </a>
+ </em>. </span><span class="authorgroup"><span class="firstname">
+ Maddock
+ </span> <span class="surname">
+ John
+ </span> and <span class="firstname">
+ Stephen
+ </span> <span class="surname">
+ Cleary
+ </span>. </span><span class="publisher"><span class="publishername">
+ Boost
+ . </span></span></p></div><div class="biblioentry" title="Worst-case efficient priority queues"><a id="biblio.brodal96priority"/><p>[biblio.brodal96priority] <span class="title"><em>
+ <a class="link" href="http://portal.acm.org/citation.cfm?id=313883">
+ Worst-case efficient priority queues
+ </a>
+ </em>. </span><span class="author"><span class="firstname">
+ Gerth
+ </span> <span class="surname">
+ Stolting Brodal
+ </span>. </span></p></div><div class="biblioentry" title="Efficient C++ Programming Techniques"><a id="biblio.bulkamayheweff"/><p>[biblio.bulkamayheweff] <span class="title"><em>
+ Efficient C++ Programming Techniques
+ </em>. </span><span class="date">
+ 1997
+ . </span><span class="authorgroup"><span class="firstname">
+ D.
+ </span> <span class="surname">
+ Bulka
+ </span> and <span class="firstname">
+ D.
+ </span> <span class="surname">
+ Mayhew
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Introduction to Algorithms, 2nd edition"><a id="biblio.clrs2001"/><p>[biblio.clrs2001] <span class="title"><em>
+ Introduction to Algorithms, 2nd edition
+ </em>. </span><span class="date">
+ 2001
+ . </span><span class="authorgroup"><span class="firstname">
+ T. H.
+ </span> <span class="surname">
+ Cormen
+ </span>, <span class="firstname">
+ C. E.
+ </span> <span class="surname">
+ Leiserson
+ </span>, <span class="firstname">
+ R. L.
+ </span> <span class="surname">
+ Rivest
+ </span>, and <span class="firstname">
+ C.
+ </span> <span class="surname">
+ Stein
+ </span>. </span><span class="publisher"><span class="publishername">
+ MIT Press
+ . </span></span></p></div><div class="biblioentry" title="Balls and bins: A study in negative dependence"><a id="biblio.dubhashi98neg"/><p>[biblio.dubhashi98neg] <span class="title"><em>
+ Balls and bins: A study in negative dependence
+ </em>. </span><span class="date">
+ 1998
+ . </span><span class="authorgroup"><span class="firstname">
+ D.
+ </span> <span class="surname">
+ Dubashi
+ </span> and <span class="firstname">
+ D.
+ </span> <span class="surname">
+ Ranjan
+ </span>. </span><span class="publisher"><span class="publishername">
+ Random Structures and Algorithms 13
+ . </span></span></p></div><div class="biblioentry" title="Extendible hashing - a fast access method for dynamic files"><a id="biblio.fagin79extendible"/><p>[biblio.fagin79extendible] <span class="title"><em>
+ Extendible hashing - a fast access method for dynamic files
+ </em>. </span><span class="date">
+ 1979
+ . </span><span class="authorgroup"><span class="firstname">
+ R.
+ </span> <span class="surname">
+ Fagin
+ </span>, <span class="firstname">
+ J.
+ </span> <span class="surname">
+ Nievergelt
+ </span>, <span class="firstname">
+ N.
+ </span> <span class="surname">
+ Pippenger
+ </span>, and <span class="firstname">
+ H. R.
+ </span> <span class="surname">
+ Strong
+ </span>. </span><span class="publisher"><span class="publishername">
+ ACM Trans. Database Syst. 4
+ . </span></span></p></div><div class="biblioentry" title="Ptset: Sets of integers implemented as Patricia trees"><a id="biblio.filliatre2000ptset"/><p>[biblio.filliatre2000ptset] <span class="title"><em>
+ <a class="link" href="http://cristal.inria.fr/~frisch/icfp06_contest/advtr/applyOmatic/ptset.ml">
+ Ptset: Sets of integers implemented as Patricia trees
+ </a>
+ </em>. </span><span class="date">
+ 2000
+ . </span><span class="author"><span class="firstname">
+ Jean-Christophe
+ </span> <span class="surname">
+ Filliatre
+ </span>. </span></p></div><div class="biblioentry" title="The pairing heap: a new form of self-adjusting heap"><a id="biblio.fredman86pairing"/><p>[biblio.fredman86pairing] <span class="title"><em>
+ <a class="link" href="http://www.cs.cmu.edu/~sleator/papers/pairing-heaps.pdf">
+ The pairing heap: a new form of self-adjusting heap
+ </a>
+ </em>. </span><span class="date">
+ 1986
+ . </span><span class="authorgroup"><span class="firstname">
+ M. L.
+ </span> <span class="surname">
+ Fredman
+ </span>, <span class="firstname">
+ R.
+ </span> <span class="surname">
+ Sedgewick
+ </span>, <span class="firstname">
+ D. D.
+ </span> <span class="surname">
+ Sleator
+ </span>, and <span class="firstname">
+ R. E.
+ </span> <span class="surname">
+ Tarjan
+ </span>. </span></p></div><div class="biblioentry" title="Design Patterns - Elements of Reusable Object-Oriented Software"><a id="biblio.gof"/><p>[biblio.gof] <span class="title"><em>
+ Design Patterns - Elements of Reusable Object-Oriented Software
+ </em>. </span><span class="date">
+ 1995
+ . </span><span class="authorgroup"><span class="firstname">
+ E.
+ </span> <span class="surname">
+ Gamma
+ </span>, <span class="firstname">
+ R.
+ </span> <span class="surname">
+ Helm
+ </span>, <span class="firstname">
+ R.
+ </span> <span class="surname">
+ Johnson
+ </span>, and <span class="firstname">
+ J.
+ </span> <span class="surname">
+ Vlissides
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Order-preserving key transformations"><a id="biblio.garg86order"/><p>[biblio.garg86order] <span class="title"><em>
+ Order-preserving key transformations
+ </em>. </span><span class="date">
+ 1986
+ . </span><span class="authorgroup"><span class="firstname">
+ A. K.
+ </span> <span class="surname">
+ Garg
+ </span> and <span class="firstname">
+ C. C.
+ </span> <span class="surname">
+ Gotlieb
+ </span>. </span><span class="publisher"><span class="publishername">
+ Trans. Database Syst. 11
+ . </span></span></p></div><div class="biblioentry" title="Making a real hash of things"><a id="biblio.hyslop02making"/><p>[biblio.hyslop02making] <span class="title"><em>
+ Making a real hash of things
+ </em>. </span><span class="date">
+ May 2002
+ . </span><span class="authorgroup"><span class="firstname">
+ J.
+ </span> <span class="surname">
+ Hyslop
+ </span> and <span class="firstname">
+ Herb
+ </span> <span class="surname">
+ Sutter
+ </span>. </span><span class="publisher"><span class="publishername">
+ C++ Report
+ . </span></span></p></div><div class="biblioentry" title="The C++ Standard Library - A Tutorial and Reference"><a id="biblio.jossutis01stl"/><p>[biblio.jossutis01stl] <span class="title"><em>
+ The C++ Standard Library - A Tutorial and Reference
+ </em>. </span><span class="date">
+ 2001
+ . </span><span class="author"><span class="firstname">
+ N. M.
+ </span> <span class="surname">
+ Jossutis
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="New Heap Data Structures"><a id="biblio.kt99fat_heaps"/><p>[biblio.kt99fat_heaps] <span class="title"><em>
+ <a class="link" href="http://www.cs.princeton.edu/research/techreps/TR-597-99">
+ New Heap Data Structures
+ </a>
+ </em>. </span><span class="date">
+ 1999
+ . </span><span class="authorgroup"><span class="firstname">
+ Haim
+ </span> <span class="surname">
+ Kaplan
+ </span> and <span class="firstname">
+ Robert E.
+ </span> <span class="surname">
+ Tarjan
+ </span>. </span></p></div><div class="biblioentry" title="Are Set Iterators Mutable or Immutable?"><a id="biblio.kleft00sets"/><p>[biblio.kleft00sets] <span class="title"><em>
+ Are Set Iterators Mutable or Immutable?
+ </em>. </span><span class="date">
+ October 2000
+ . </span><span class="authorgroup"><span class="firstname">
+ Angelika
+ </span> <span class="surname">
+ Langer
+ </span> and <span class="firstname">
+ Klaus
+ </span> <span class="surname">
+ Kleft
+ </span>. </span><span class="publisher"><span class="publishername">
+ C/C++ Users Jornal
+ . </span></span></p></div><div class="biblioentry" title="The Art of Computer Programming - Sorting and Searching"><a id="biblio.knuth98sorting"/><p>[biblio.knuth98sorting] <span class="title"><em>
+ The Art of Computer Programming - Sorting and Searching
+ </em>. </span><span class="date">
+ 1998
+ . </span><span class="author"><span class="firstname">
+ D. E.
+ </span> <span class="surname">
+ Knuth
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Data abstraction and hierarchy"><a id="biblio.liskov98data"/><p>[biblio.liskov98data] <span class="title"><em>
+ Data abstraction and hierarchy
+ </em>. </span><span class="date">
+ May 1998
+ . </span><span class="author"><span class="firstname">
+ B.
+ </span> <span class="surname">
+ Liskov
+ </span>. </span><span class="publisher"><span class="publishername">
+ SIGPLAN Notices 23
+ . </span></span></p></div><div class="biblioentry" title="Linear hashing: A new tool for file and table addressing"><a id="biblio.litwin80lh"/><p>[biblio.litwin80lh] <span class="title"><em>
+ Linear hashing: A new tool for file and table addressing
+ </em>. </span><span class="date">
+ June 1980
+ . </span><span class="author"><span class="firstname">
+ W.
+ </span> <span class="surname">
+ Litwin
+ </span>. </span><span class="publisher"><span class="publishername">
+ Proceedings of International Conference on Very Large Data Bases
+ . </span></span></p></div><div class="biblioentry" title="Deamortization - Part 2: Binomial Heaps"><a id="biblio.maverik_lowerbounds"/><p>[biblio.maverik_lowerbounds] <span class="title"><em>
+ <a class="link" href="http://magic.aladdin.cs.cmu.edu/2005/08/01/deamortization-part-2-binomial-heaps">
+ Deamortization - Part 2: Binomial Heaps
+ </a>
+ </em>. </span><span class="date">
+ 2005
+ . </span><span class="author"><span class="firstname">
+ Maverik
+ </span> <span class="surname">
+ Woo
+ </span>. </span></p></div><div class="biblioentry" title="More Effective C++: 35 New Ways to Improve Your Programs and Designs"><a id="biblio.meyers96more"/><p>[biblio.meyers96more] <span class="title"><em>
+ More Effective C++: 35 New Ways to Improve Your Programs and Designs
+ </em>. </span><span class="date">
+ 1996
+ . </span><span class="author"><span class="firstname">
+ Scott
+ </span> <span class="surname">
+ Meyers
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="How Non-Member Functions Improve Encapsulation"><a id="biblio.meyers00nonmember"/><p>[biblio.meyers00nonmember] <span class="title"><em>
+ How Non-Member Functions Improve Encapsulation
+ </em>. </span><span class="date">
+ 2000
+ . </span><span class="author"><span class="firstname">
+ Scott
+ </span> <span class="surname">
+ Meyers
+ </span>. </span><span class="publisher"><span class="publishername">
+ C/C++ Users Journal
+ . </span></span></p></div><div class="biblioentry" title="Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library"><a id="biblio.meyers01stl"/><p>[biblio.meyers01stl] <span class="title"><em>
+ Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
+ </em>. </span><span class="date">
+ 2001
+ . </span><span class="author"><span class="firstname">
+ Scott
+ </span> <span class="surname">
+ Meyers
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Class Template, Member Template - or Both?"><a id="biblio.meyers02both"/><p>[biblio.meyers02both] <span class="title"><em>
+ Class Template, Member Template - or Both?
+ </em>. </span><span class="date">
+ 2003
+ . </span><span class="author"><span class="firstname">
+ Scott
+ </span> <span class="surname">
+ Meyers
+ </span>. </span><span class="publisher"><span class="publishername">
+ C/C++ Users Journal
+ . </span></span></p></div><div class="biblioentry" title="Randomized Algorithms"><a id="biblio.motwani95random"/><p>[biblio.motwani95random] <span class="title"><em>
+ Randomized Algorithms
+ </em>. </span><span class="date">
+ 2003
+ . </span><span class="authorgroup"><span class="firstname">
+ R.
+ </span> <span class="surname">
+ Motwani
+ </span> and <span class="firstname">
+ P.
+ </span> <span class="surname">
+ Raghavan
+ </span>. </span><span class="publisher"><span class="publishername">
+ Cambridge University Press
+ . </span></span></p></div><div class="biblioentry" title="COM: Component Model Object Technologies"><a id="biblio.mscom"/><p>[biblio.mscom] <span class="title"><em>
+ <a class="link" href="http://www.microsoft.com/com">
+ COM: Component Model Object Technologies
+ </a>
+ </em>. </span><span class="publisher"><span class="publishername">
+ Microsoft
+ . </span></span></p></div><div class="biblioentry" title="Rationale for Adding Hash Tables to the C++ Standard Template Library"><a id="biblio.musser95rationale"/><p>[biblio.musser95rationale] <span class="title"><em>
+ Rationale for Adding Hash Tables to the C++ Standard Template Library
+ </em>. </span><span class="date">
+ 1995
+ . </span><span class="author"><span class="firstname">
+ David R.
+ </span> <span class="surname">
+ Musser
+ </span>. </span></p></div><div class="biblioentry" title="STL Tutorial and Reference Guide"><a id="biblio.musser96stltutorial"/><p>[biblio.musser96stltutorial] <span class="title"><em>
+ STL Tutorial and Reference Guide
+ </em>. </span><span class="date">
+ 1996
+ . </span><span class="authorgroup"><span class="firstname">
+ David R.
+ </span> <span class="surname">
+ Musser
+ </span> and <span class="firstname">
+ A.
+ </span> <span class="surname">
+ Saini
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Priority Queues and the STL"><a id="biblio.nelson96stlpq"/><p>[biblio.nelson96stlpq] <span class="title"><em>
+ <a class="link" href="http://www.dogma.net/markn/articles/pq_stl/priority.htm">Priority Queues and the STL
+ </a>
+ </em>. </span><span class="date">
+ January 1996
+ . </span><span class="author"><span class="firstname">
+ Mark
+ </span> <span class="surname">
+ Nelson
+ </span>. </span><span class="publisher"><span class="publishername">
+ Dr. Dobbs Journal
+ . </span></span></p></div><div class="biblioentry" title="Fast mergeable integer maps"><a id="biblio.okasaki98mereable"/><p>[biblio.okasaki98mereable] <span class="title"><em>
+ Fast mergeable integer maps
+ </em>. </span><span class="date">
+ September 1998
+ . </span><span class="authorgroup"><span class="firstname">
+ C.
+ </span> <span class="surname">
+ Okasaki
+ </span> and <span class="firstname">
+ A.
+ </span> <span class="surname">
+ Gill
+ </span>. </span><span class="publisher"><span class="publishername">
+ In Workshop on ML
+ . </span></span></p></div><div class="biblioentry" title="Standard Template Library Programmer's Guide"><a id="biblio.sgi_stl"/><p>[biblio.sgi_stl] <span class="title"><em>
+ <a class="link" href="http://www.sgi.com/tech/stl">
+ Standard Template Library Programmer's Guide
+ </a>
+ </em>. </span><span class="author"><span class="firstname">
+ Matt
+ </span> <span class="surname">
+ Austern
+ </span>. </span><span class="publisher"><span class="publishername">
+ SGI
+ . </span></span></p></div><div class="biblioentry" title="select"><a id="biblio.select_man"/><p>[biblio.select_man] <span class="title"><em>
+ <a class="link" href="http://www.scit.wlv.ac.uk/cgi-bin/mansec?3C+select">
+ select
+ </a>
+ </em>. </span></p></div><div class="biblioentry" title="Amortized Efficiency of List Update Problems"><a id="biblio.sleator84amortized"/><p>[biblio.sleator84amortized] <span class="title"><em>
+ Amortized Efficiency of List Update Problems
+ </em>. </span><span class="date">
+ 1984
+ . </span><span class="authorgroup"><span class="firstname">
+ D. D.
+ </span> <span class="surname">
+ Sleator
+ </span> and <span class="firstname">
+ R. E.
+ </span> <span class="surname">
+ Tarjan
+ </span>. </span><span class="publisher"><span class="publishername">
+ ACM Symposium on Theory of Computing
+ . </span></span></p></div><div class="biblioentry" title="Self-Adjusting Binary Search Trees"><a id="biblio.sleator85self"/><p>[biblio.sleator85self] <span class="title"><em>
+ Self-Adjusting Binary Search Trees
+ </em>. </span><span class="date">
+ 1985
+ . </span><span class="authorgroup"><span class="firstname">
+ D. D.
+ </span> <span class="surname">
+ Sleator
+ </span> and <span class="firstname">
+ R. E.
+ </span> <span class="surname">
+ Tarjan
+ </span>. </span><span class="publisher"><span class="publishername">
+ ACM Symposium on Theory of Computing
+ . </span></span></p></div><div class="biblioentry" title="The Standard Template Library"><a id="biblio.stepanov94standard"/><p>[biblio.stepanov94standard] <span class="title"><em>
+ The Standard Template Library
+ </em>. </span><span class="date">
+ 1984
+ . </span><span class="authorgroup"><span class="firstname">
+ A. A.
+ </span> <span class="surname">
+ Stepanov
+ </span> and <span class="firstname">
+ M.
+ </span> <span class="surname">
+ Lee
+ </span>. </span></p></div><div class="biblioentry" title="The C++ Programming Langugage"><a id="biblio.stroustrup97cpp"/><p>[biblio.stroustrup97cpp] <span class="title"><em>
+ The C++ Programming Langugage
+ </em>. </span><span class="date">
+ 1997
+ . </span><span class="author"><span class="firstname">
+ Bjarne
+ </span> <span class="surname">
+ Stroustrup
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="C++ Templates: The Complete Guide"><a id="biblio.vandevoorde2002cpptemplates"/><p>[biblio.vandevoorde2002cpptemplates] <span class="title"><em>
+ C++ Templates: The Complete Guide
+ </em>. </span><span class="date">
+ 2002
+ . </span><span class="authorgroup"><span class="firstname">
+ D.
+ </span> <span class="surname">
+ Vandevoorde
+ </span> and <span class="firstname">
+ N. M.
+ </span> <span class="surname">
+ Josuttis
+ </span>. </span><span class="publisher"><span class="publishername">
+ Addison-Wesley Publishing Company
+ . </span></span></p></div><div class="biblioentry" title="Thirty Years Among the Dead"><a id="biblio.wickland96thirty"/><p>[biblio.wickland96thirty] <span class="title"><em>
+ <a class="link" href="http://myweb.wvnet.edu/~gsa00121/books/amongdead30.zip">
+ Thirty Years Among the Dead
+ </a>
+ </em>. </span><span class="date">
+ 1996
+ . </span><span class="author"><span class="firstname">
+ C. A.
+ </span> <span class="surname">
+ Wickland
+ </span>. </span><span class="publisher"><span class="publishername">
+ National Psychological Institute
+ . </span></span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch21s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr><tr><td align="left" valign="top">Implementation </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_biblio.html b/libstdc++-v3/doc/html/manual/policy_data_structures_biblio.html
new file mode 100644
index 00000000000..aaaef164fb1
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_biblio.html
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Acknowledgments</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;&#9;ISO C++&#10; , &#10;&#9;policy&#10; , &#10;&#9;container&#10; , &#10;&#9;data&#10; , &#10;&#9;structure&#10; , &#10;&#9;associated&#10; , &#10;&#9;tree&#10; , &#10;&#9;trie&#10; , &#10;&#9;hash&#10; , &#10;&#9;metaprogramming&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/><link rel="prev" href="policy_based_data_structures_test.html" title="Testing"/><link rel="next" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Acknowledgments</th></tr><tr><td align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr/></div><div class="section" title="Acknowledgments"><div class="titlepage"><div><div><h2 class="title"><a id="pbds.ack"/>Acknowledgments</h2></div></div></div><p>
+ Written by Ami Tavory and Vladimir Dreizin (IBM Haifa Research
+ Laboratories), and Benjamin Kosnik (Red Hat).
+ </p><p>
+ This library was partially written at
+ <a class="link" href="http://www.haifa.il.ibm.com/">IBM's Haifa Research Labs</a>.
+ It is based heavily on policy-based design and uses many useful
+ techniques from Modern C++ Design: Generic Programming and Design
+ Patterns Applied by Andrei Alexandrescu.
+ </p><p>
+ Two ideas are borrowed from the SGI-STL implementation:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ The prime-based resize policies use a list of primes taken from
+ the SGI-STL implementation.
+ </p></li><li class="listitem"><p>
+ The red-black trees contain both a root node and a header node
+ (containing metadata), connected in a way that forward and
+ reverse iteration can be performed efficiently.
+ </p></li></ol></div><p>
+ Some test utilities borrow ideas from
+ <a class="link" href="http://www.boost.org/doc/libs/release/libs/timer/index.html">boost::timer</a>.
+ </p><p>
+ We would like to thank Scott Meyers for useful comments (without
+ attributing to him any flaws in the design or implementation of the
+ library).
+ </p><p>We would like to thank Matt Austern for the suggestion to
+ include tries.</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><td align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td align="left" valign="top">Testing </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 23. HP/SGI Extensions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_design.html b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
new file mode 100644
index 00000000000..71e80a993eb
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_design.html
@@ -0,0 +1,1430 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;&#9;ISO C++&#10; , &#10;&#9;policy&#10; , &#10;&#9;container&#10; , &#10;&#9;data&#10; , &#10;&#9;structure&#10; , &#10;&#9;associated&#10; , &#10;&#9;tree&#10; , &#10;&#9;trie&#10; , &#10;&#9;hash&#10; , &#10;&#9;metaprogramming&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/><link rel="prev" href="policy_data_structures_using.html" title="Using"/><link rel="next" href="policy_based_data_structures_test.html" title="Testing"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td align="left"><a accesskey="p" href="policy_data_structures_using.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td align="right"> <a accesskey="n" href="policy_based_data_structures_test.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design"><div class="titlepage"><div><div><h2 class="title"><a id="containers.pbds.design"/>Design</h2></div></div></div><p/><div class="section" title="Concepts"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.design.concepts"/>Concepts</h3></div></div></div><div class="section" title="Null Policy Classes"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.null_type"/>Null Policy Classes</h4></div></div></div><p>
+ Associative containers are typically parametrized by various
+ policies. For example, a hash-based associative container is
+ parametrized by a hash-functor, transforming each key into an
+ non-negative numerical type. Each such value is then further mapped
+ into a position within the table. The mapping of a key into a
+ position within the table is therefore a two-step process.
+ </p><p>
+ In some cases, instantiations are redundant. For example, when the
+ keys are integers, it is possible to use a redundant hash policy,
+ which transforms each key into its value.
+ </p><p>
+ In some other cases, these policies are irrelevant. For example, a
+ hash-based associative container might transform keys into positions
+ within a table by a different method than the two-step method
+ described above. In such a case, the hash functor is simply
+ irrelevant.
+ </p><p>
+ When a policy is either redundant or irrelevant, it can be replaced
+ by <code class="classname">null_type</code>.
+ </p><p>
+ For example, a <span class="emphasis"><em>set</em></span> is an associative
+ container with one of its template parameters (the one for the
+ mapped type) replaced with <code class="classname">null_type</code>. Other
+ places simplifications are made possible with this technique
+ include node updates in tree and trie data structures, and hash
+ and probe functions for hash data structures.
+ </p></div><div class="section" title="Map and Set Semantics"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.associative_semantics"/>Map and Set Semantics</h4></div></div></div><div class="section" title="Distinguishing Between Maps and Sets"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.associative_semantics.set_vs_map"/>
+ Distinguishing Between Maps and Sets
+ </h5></div></div></div><p>
+ Anyone familiar with the standard knows that there are four kinds
+ of associative containers: maps, sets, multimaps, and
+ multisets. The map datatype associates each key to
+ some data.
+ </p><p>
+ Sets are associative containers that simply store keys -
+ they do not map them to anything. In the standard, each map class
+ has a corresponding set class. E.g.,
+ <code class="classname">std::map&lt;int, char&gt;</code> maps each
+ <code class="classname">int</code> to a <code class="classname">char</code>, but
+ <code class="classname">std::set&lt;int, char&gt;</code> simply stores
+ <code class="classname">int</code>s. In this library, however, there are no
+ distinct classes for maps and sets. Instead, an associative
+ container's <code class="classname">Mapped</code> template parameter is a policy: if
+ it is instantiated by <code class="classname">null_type</code>, then it
+ is a "set"; otherwise, it is a "map". E.g.,
+ </p><pre class="programlisting">
+ cc_hash_table&lt;int, char&gt;
+ </pre><p>
+ is a "map" mapping each <span class="type">int</span> value to a <span class="type">
+ char</span>, but
+ </p><pre class="programlisting">
+ cc_hash_table&lt;int, null_type&gt;
+ </pre><p>
+ is a type that uniquely stores <span class="type">int</span> values.
+ </p><p>Once the <code class="classname">Mapped</code> template parameter is instantiated
+ by <code class="classname">null_type</code>, then
+ the "set" acts very similarly to the standard's sets - it does not
+ map each key to a distinct <code class="classname">null_type</code> object. Also,
+ , the container's <span class="type">value_type</span> is essentially
+ its <span class="type">key_type</span> - just as with the standard's sets
+ .</p><p>
+ The standard's multimaps and multisets allow, respectively,
+ non-uniquely mapping keys and non-uniquely storing keys. As
+ discussed, the
+ reasons why this might be necessary are 1) that a key might be
+ decomposed into a primary key and a secondary key, 2) that a
+ key might appear more than once, or 3) any arbitrary
+ combination of 1)s and 2)s. Correspondingly,
+ one should use 1) "maps" mapping primary keys to secondary
+ keys, 2) "maps" mapping keys to size types, or 3) any arbitrary
+ combination of 1)s and 2)s. Thus, for example, an
+ <code class="classname">std::multiset&lt;int&gt;</code> might be used to store
+ multiple instances of integers, but using this library's
+ containers, one might use
+ </p><pre class="programlisting">
+ tree&lt;int, size_t&gt;
+ </pre><p>
+ i.e., a <code class="classname">map</code> of <span class="type">int</span>s to
+ <span class="type">size_t</span>s.
+ </p><p>
+ These "multimaps" and "multisets" might be confusing to
+ anyone familiar with the standard's <code class="classname">std::multimap</code> and
+ <code class="classname">std::multiset</code>, because there is no clear
+ correspondence between the two. For example, in some cases
+ where one uses <code class="classname">std::multiset</code> in the standard, one might use
+ in this library a "multimap" of "multisets" - i.e., a
+ container that maps primary keys each to an associative
+ container that maps each secondary key to the number of times
+ it occurs.
+ </p><p>
+ When one uses a "multimap," one should choose with care the
+ type of container used for secondary keys.
+ </p></div><div class="section" title="Alternatives to std::multiset and std::multimap"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.associative_semantics.multi"/>Alternatives to <code class="classname">std::multiset</code> and <code class="classname">std::multimap</code></h5></div></div></div><p>
+ Brace onself: this library does not contain containers like
+ <code class="classname">std::multimap</code> or
+ <code class="classname">std::multiset</code>. Instead, these data
+ structures can be synthesized via manipulation of the
+ <code class="classname">Mapped</code> template parameter.
+ </p><p>
+ One maps the unique part of a key - the primary key, into an
+ associative-container of the (originally) non-unique parts of
+ the key - the secondary key. A primary associative-container
+ is an associative container of primary keys; a secondary
+ associative-container is an associative container of
+ secondary keys.
+ </p><p>
+ Stepping back a bit, and starting in from the beginning.
+ </p><p>
+ Maps (or sets) allow mapping (or storing) unique-key values.
+ The standard library also supplies associative containers which
+ map (or store) multiple values with equivalent keys:
+ <code class="classname">std::multimap</code>, <code class="classname">std::multiset</code>,
+ <code class="classname">std::tr1::unordered_multimap</code>, and
+ <code class="classname">unordered_multiset</code>. We first discuss how these might
+ be used, then why we think it is best to avoid them.
+ </p><p>
+ Suppose one builds a simple bank-account application that
+ records for each client (identified by an <code class="classname">std::string</code>)
+ and account-id (marked by an <span class="type">unsigned long</span>) -
+ the balance in the account (described by a
+ <span class="type">float</span>). Suppose further that ordering this
+ information is not useful, so a hash-based container is
+ preferable to a tree based container. Then one can use
+ </p><pre class="programlisting">
+ std::tr1::unordered_map&lt;std::pair&lt;std::string, unsigned long&gt;, float, ...&gt;
+ </pre><p>
+ which hashes every combination of client and account-id. This
+ might work well, except for the fact that it is now impossible
+ to efficiently list all of the accounts of a specific client
+ (this would practically require iterating over all
+ entries). Instead, one can use
+ </p><pre class="programlisting">
+ std::tr1::unordered_multimap&lt;std::pair&lt;std::string, unsigned long&gt;, float, ...&gt;
+ </pre><p>
+ which hashes every client, and decides equivalence based on
+ client only. This will ensure that all accounts belonging to a
+ specific user are stored consecutively.
+ </p><p>
+ Also, suppose one wants an integers' priority queue
+ (a container that supports <code class="function">push</code>,
+ <code class="function">pop</code>, and <code class="function">top</code> operations, the last of which
+ returns the largest <span class="type">int</span>) that also supports
+ operations such as <code class="function">find</code> and <code class="function">lower_bound</code>. A
+ reasonable solution is to build an adapter over
+ <code class="classname">std::set&lt;int&gt;</code>. In this adapter,
+ <code class="function">push</code> will just call the tree-based
+ associative container's <code class="function">insert</code> method; <code class="function">pop</code>
+ will call its <code class="function">end</code> method, and use it to return the
+ preceding element (which must be the largest). Then this might
+ work well, except that the container object cannot hold
+ multiple instances of the same integer (<code class="function">push(4)</code>,
+ will be a no-op if <code class="constant">4</code> is already in the
+ container object). If multiple keys are necessary, then one
+ might build the adapter over an
+ <code class="classname">std::multiset&lt;int&gt;</code>.
+ </p><p>
+ The standard library's non-unique-mapping containers are useful
+ when (1) a key can be decomposed in to a primary key and a
+ secondary key, (2) a key is needed multiple times, or (3) any
+ combination of (1) and (2).
+ </p><p>
+ The graphic below shows how the standard library's container
+ design works internally; in this figure nodes shaded equally
+ represent equivalent-key values. Equivalent keys are stored
+ consecutively using the properties of the underlying data
+ structure: binary search trees (label A) store equivalent-key
+ values consecutively (in the sense of an in-order walk)
+ naturally; collision-chaining hash tables (label B) store
+ equivalent-key values in the same bucket, the bucket can be
+ arranged so that equivalent-key values are consecutive.
+ </p><div class="figure"><a id="id667445"/><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_1.png" style="text-align: middle" alt="Non-unique Mapping Standard Containers"/></div></div></div><br class="figure-break"/><p>
+ Put differently, the standards' non-unique mapping
+ associative-containers are associative containers that map
+ primary keys to linked lists that are embedded into the
+ container. The graphic below shows again the two
+ containers from the first graphic above, this time with
+ the embedded linked lists of the grayed nodes marked
+ explicitly.
+ </p><div class="figure"><a id="fig.pbds_embedded_lists_2"/><p class="title"><strong>Figure 22.9. 
+ Effect of embedded lists in
+ <code class="classname">std::multimap</code>
+ </strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_2.png" style="text-align: middle" alt="Effect of embedded lists in std::multimap"/></div></div></div><br class="figure-break"/><p>
+ These embedded linked lists have several disadvantages.
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ The underlying data structure embeds the linked lists
+ according to its own consideration, which means that the
+ search path for a value might include several different
+ equivalent-key values. For example, the search path for the
+ the black node in either of the first graphic, labels A or B,
+ includes more than a single gray node.
+ </p></li><li class="listitem"><p>
+ The links of the linked lists are the underlying data
+ structures' nodes, which typically are quite structured. In
+ the case of tree-based containers (the grapic above, label
+ B), each "link" is actually a node with three pointers (one
+ to a parent and two to children), and a
+ relatively-complicated iteration algorithm. The linked
+ lists, therefore, can take up quite a lot of memory, and
+ iterating over all values equal to a given key (through the
+ return value of the standard
+ library's <code class="function">equal_range</code>) can be
+ expensive.
+ </p></li><li class="listitem"><p>
+ The primary key is stored multiply; this uses more memory.
+ </p></li><li class="listitem"><p>
+ Finally, the interface of this design excludes several
+ useful underlying data structures. Of all the unordered
+ self-organizing data structures, practically only
+ collision-chaining hash tables can (efficiently) guarantee
+ that equivalent-key values are stored consecutively.
+ </p></li></ol></div><p>
+ The above reasons hold even when the ratio of secondary keys to
+ primary keys (or average number of identical keys) is small, but
+ when it is large, there are more severe problems:
+ </p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ The underlying data structures order the links inside each
+ embedded linked-lists according to their internal
+ considerations, which effectively means that each of the
+ links is unordered. Irrespective of the underlying data
+ structure, searching for a specific value can degrade to
+ linear complexity.
+ </p></li><li class="listitem"><p>
+ Similarly to the above point, it is impossible to apply
+ to the secondary keys considerations that apply to primary
+ keys. For example, it is not possible to maintain secondary
+ keys by sorted order.
+ </p></li><li class="listitem"><p>
+ While the interface "understands" that all equivalent-key
+ values constitute a distinct list (through
+ <code class="function">equal_range</code>), the underlying data
+ structure typically does not. This means that operations such
+ as erasing from a tree-based container all values whose keys
+ are equivalent to a a given key can be super-linear in the
+ size of the tree; this is also true also for several other
+ operations that target a specific list.
+ </p></li></ol></div><p>
+ In this library, all associative containers map
+ (or store) unique-key values. One can (1) map primary keys to
+ secondary associative-containers (containers of
+ secondary keys) or non-associative containers (2) map identical
+ keys to a size-type representing the number of times they
+ occur, or (3) any combination of (1) and (2). Instead of
+ allowing multiple equivalent-key values, this library
+ supplies associative containers based on underlying
+ data structures that are suitable as secondary
+ associative-containers.
+ </p><p>
+ In the figure below, labels A and B show the equivalent
+ underlying data structures in this library, as mapped to the
+ first graphic above. Labels A and B, respectively. Each shaded
+ box represents some size-type or secondary
+ associative-container.
+ </p><div class="figure"><a id="id667640"/><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_embedded_lists_3.png" style="text-align: middle" alt="Non-unique Mapping Containers"/></div></div></div><br class="figure-break"/><p>
+ In the first example above, then, one would use an associative
+ container mapping each user to an associative container which
+ maps each application id to a start time (see
+ <code class="filename">example/basic_multimap.cc</code>); in the second
+ example, one would use an associative container mapping
+ each <code class="classname">int</code> to some size-type indicating the
+ number of times it logically occurs
+ (see <code class="filename">example/basic_multiset.cc</code>.
+ </p><p>
+ See the discussion in list-based container types for containers
+ especially suited as secondary associative-containers.
+ </p></div></div><div class="section" title="Iterator Semantics"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.iterator_semantics"/>Iterator Semantics</h4></div></div></div><div class="section" title="Point and Range Iterators"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.iterator_semantics.point_and_range"/>Point and Range Iterators</h5></div></div></div><p>
+ Iterator concepts are bifurcated in this design, and are
+ comprised of point-type and range-type iteration.
+ </p><p>
+ A point-type iterator is an iterator that refers to a specific
+ element as returned through an
+ associative-container's <code class="function">find</code> method.
+ </p><p>
+ A range-type iterator is an iterator that is used to go over a
+ sequence of elements, as returned by a container's
+ <code class="function">find</code> method.
+ </p><p>
+ A point-type method is a method that
+ returns a point-type iterator; a range-type method is a method
+ that returns a range-type iterator.
+ </p><p>For most containers, these types are synonymous; for
+ self-organizing containers, such as hash-based containers or
+ priority queues, these are inherently different (in any
+ implementation, including that of C++ standard library
+ components), but in this design, it is made explicit. They are
+ distinct types.
+ </p></div><div class="section" title="Distinguishing Point and Range Iterators"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.iterator_semantics.both"/>Distinguishing Point and Range Iterators</h5></div></div></div><p>When using this library, is necessary to differentiate
+ between two types of methods and iterators: point-type methods and
+ iterators, and range-type methods and iterators. Each associative
+ container's interface includes the methods:</p><pre class="programlisting">
+ point_const_iterator
+ find(const_key_reference r_key) const;
+
+ point_iterator
+ find(const_key_reference r_key);
+
+ std::pair&lt;point_iterator,bool&gt;
+ insert(const_reference r_val);
+ </pre><p>The relationship between these iterator types varies between
+ container types. The figure below
+ shows the most general invariant between point-type and
+ range-type iterators: In <span class="emphasis"><em>A</em></span> <code class="literal">iterator</code>, can
+ always be converted to <code class="literal">point_iterator</code>. In <span class="emphasis"><em>B</em></span>
+ shows invariants for order-preserving containers: point-type
+ iterators are synonymous with range-type iterators.
+ Orthogonally, <span class="emphasis"><em>C</em></span>shows invariants for "set"
+ containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="id667806"/><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_point_iterator_hierarchy.png" style="text-align: middle" alt="Point Iterator Hierarchy"/></div></div></div><br class="figure-break"/><p>Note that point-type iterators in self-organizing containers
+ (hash-based associative containers) lack movement
+ operators, such as <code class="literal">operator++</code> - in fact, this
+ is the reason why this library differentiates from the standard C++ librarys
+ design on this point.</p><p>Typically, one can determine an iterator's movement
+ capabilities using
+ <code class="literal">std::iterator_traits&lt;It&gt;iterator_category</code>,
+ which is a <code class="literal">struct</code> indicating the iterator's
+ movement capabilities. Unfortunately, none of the standard predefined
+ categories reflect a pointer's <span class="emphasis"><em>not</em></span> having any
+ movement capabilities whatsoever. Consequently,
+ <code class="literal">pb_ds</code> adds a type
+ <code class="literal">trivial_iterator_tag</code> (whose name is taken from
+ a concept in C++ standardese, which is the category of iterators
+ with no movement capabilities.) All other standard C++ library
+ tags, such as <code class="literal">forward_iterator_tag</code> retain their
+ common use.</p></div><div class="section" title="Invalidation Guarantees"><div class="titlepage"><div><div><h5 class="title"><a id="pbds.design.concepts.invalidation"/>Invalidation Guarantees</h5></div></div></div><p>
+ If one manipulates a container object, then iterators previously
+ obtained from it can be invalidated. In some cases a
+ previously-obtained iterator cannot be de-referenced; in other cases,
+ the iterator's next or previous element might have changed
+ unpredictably. This corresponds exactly to the question whether a
+ point-type or range-type iterator (see previous concept) is valid or
+ not. In this design, one can query a container (in compile time) about
+ its invalidation guarantees.
+ </p><p>
+ Given three different types of associative containers, a modifying
+ operation (in that example, <code class="function">erase</code>) invalidated
+ iterators in three different ways: the iterator of one container
+ remained completely valid - it could be de-referenced and
+ incremented; the iterator of a different container could not even be
+ de-referenced; the iterator of the third container could be
+ de-referenced, but its "next" iterator changed unpredictably.
+ </p><p>
+ Distinguishing between find and range types allows fine-grained
+ invalidation guarantees, because these questions correspond exactly
+ to the question of whether point-type iterators and range-type
+ iterators are valid. The graphic below shows tags corresponding to
+ different types of invalidation guarantees.
+ </p><div class="figure"><a id="id667917"/><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_invalidation_tag_hierarchy.png" style="text-align: middle" alt="Invalidation Guarantee Tags Hierarchy"/></div></div></div><br class="figure-break"/><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <code class="classname">basic_invalidation_guarantee</code>
+ corresponds to a basic guarantee that a point-type iterator,
+ a found pointer, or a found reference, remains valid as long
+ as the container object is not modified.
+ </p></li><li class="listitem"><p>
+ <code class="classname">point_invalidation_guarantee</code>
+ corresponds to a guarantee that a point-type iterator, a
+ found pointer, or a found reference, remains valid even if
+ the container object is modified.
+ </p></li><li class="listitem"><p>
+ <code class="classname">range_invalidation_guarantee</code>
+ corresponds to a guarantee that a range-type iterator remains
+ valid even if the container object is modified.
+ </p></li></ul></div><p>To find the invalidation guarantee of a
+ container, one can use</p><pre class="programlisting">
+ typename container_traits&lt;Cntnr&gt;::invalidation_guarantee
+ </pre><p>Note that this hierarchy corresponds to the logic it
+ represents: if a container has range-invalidation guarantees,
+ then it must also have find invalidation guarantees;
+ correspondingly, its invalidation guarantee (in this case
+ <code class="classname">range_invalidation_guarantee</code>)
+ can be cast to its base class (in this case <code class="classname">point_invalidation_guarantee</code>).
+ This means that this this hierarchy can be used easily using
+ standard metaprogramming techniques, by specializing on the
+ type of <code class="literal">invalidation_guarantee</code>.</p><p>
+ These types of problems were addressed, in a more general
+ setting, in <a class="xref" href="policy_data_structures.html#biblio.meyers96more" title="More Effective C++: 35 New Ways to Improve Your Programs and Designs">[biblio.meyers96more]</a> - Item 2. In
+ our opinion, an invalidation-guarantee hierarchy would solve
+ these problems in all container types - not just associative
+ containers.
+ </p></div></div><div class="section" title="Genericity"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.concepts.genericity"/>Genericity</h4></div></div></div><p>
+ The design attempts to address the following problem of
+ data-structure genericity. When writing a function manipulating
+ a generic container object, what is the behavior of the object?
+ Suppose one writes
+ </p><pre class="programlisting">
+ template&lt;typename Cntnr&gt;
+ void
+ some_op_sequence(Cntnr &amp;r_container)
+ {
+ ...
+ }
+ </pre><p>
+ then one needs to address the following questions in the body
+ of <code class="function">some_op_sequence</code>:
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Which types and methods does <code class="literal">Cntnr</code> support?
+ Containers based on hash tables can be queries for the
+ hash-functor type and object; this is meaningless for tree-based
+ containers. Containers based on trees can be split, joined, or
+ can erase iterators and return the following iterator; this
+ cannot be done by hash-based containers.
+ </p></li><li class="listitem"><p>
+ What are the exception and invalidation guarantees
+ of <code class="literal">Cntnr</code>? A container based on a probing
+ hash-table invalidates all iterators when it is modified; this
+ is not the case for containers based on node-based
+ trees. Containers based on a node-based tree can be split or
+ joined without exceptions; this is not the case for containers
+ based on vector-based trees.
+ </p></li><li class="listitem"><p>
+ How does the container maintain its elements? Tree-based and
+ Trie-based containers store elements by key order; others,
+ typically, do not. A container based on a splay trees or lists
+ with update policies "cache" "frequently accessed" elements;
+ containers based on most other underlying data structures do
+ not.
+ </p></li><li class="listitem"><p>
+ How does one query a container about characteristics and
+ capabilities? What is the relationship between two different
+ data structures, if anything?
+ </p></li></ul></div><p>The remainder of this section explains these issues in
+ detail.</p><div class="section" title="Tag"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.genericity.tag"/>Tag</h5></div></div></div><p>
+ Tags are very useful for manipulating generic types. For example, if
+ <code class="literal">It</code> is an iterator class, then <code class="literal">typename
+ It::iterator_category</code> or <code class="literal">typename
+ std::iterator_traits&lt;It&gt;::iterator_category</code> will
+ yield its category, and <code class="literal">typename
+ std::iterator_traits&lt;It&gt;::value_type</code> will yield its
+ value type.
+ </p><p>
+ This library contains a container tag hierarchy corresponding to the
+ diagram below.
+ </p><div class="figure"><a id="id668169"/><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_container_tag_hierarchy.png" style="text-align: middle" alt="Container Tag Hierarchy"/></div></div></div><br class="figure-break"/><p>
+ Given any container <span class="type">Cntnr</span>, the tag of
+ the underlying data structure can be found via <code class="literal">typename
+ Cntnr::container_category</code>.
+ </p></div><div class="section" title="Traits"><div class="titlepage"><div><div><h5 class="title"><a id="concepts.genericity.traits"/>Traits</h5></div></div></div><p/><p>Additionally, a traits mechanism can be used to query a
+ container type for its attributes. Given any container
+ <code class="literal">Cntnr</code>, then <code class="literal">&lt;Cntnr&gt;</code>
+ is a traits class identifying the properties of the
+ container.</p><p>To find if a container can throw when a key is erased (which
+ is true for vector-based trees, for example), one can
+ use
+ </p><pre class="programlisting">container_traits&lt;Cntnr&gt;::erase_can_throw</pre><p>
+ Some of the definitions in <code class="classname">container_traits</code>
+ are dependent on other
+ definitions. If <code class="classname">container_traits&lt;Cntnr&gt;::order_preserving</code>
+ is <code class="constant">true</code> (which is the case for containers
+ based on trees and tries), then the container can be split or
+ joined; in this
+ case, <code class="classname">container_traits&lt;Cntnr&gt;::split_join_can_throw</code>
+ indicates whether splits or joins can throw exceptions (which is
+ true for vector-based trees);
+ otherwise <code class="classname">container_traits&lt;Cntnr&gt;::split_join_can_throw</code>
+ will yield a compilation error. (This is somewhat similar to a
+ compile-time version of the COM model).
+ </p></div></div></div><div class="section" title="By Container"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.design.container"/>By Container</h3></div></div></div><div class="section" title="hash"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.container.hash"/>hash</h4></div></div></div><div class="section" title="Interface"><div class="titlepage"><div><div><h5 class="title"><a id="container.hash.interface"/>Interface</h5></div></div></div><p>
+ The collision-chaining hash-based container has the
+ following declaration.</p><pre class="programlisting">
+ template&lt;
+ typename Key,
+ typename Mapped,
+ typename Hash_Fn = std::hash&lt;Key&gt;,
+ typename Eq_Fn = std::equal_to&lt;Key&gt;,
+ typename Comb_Hash_Fn = direct_mask_range_hashing&lt;&gt;
+ typename Resize_Policy = default explained below.
+ bool Store_Hash = false,
+ typename Allocator = std::allocator&lt;char&gt; &gt;
+ class cc_hash_table;
+ </pre><p>The parameters have the following meaning:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Key</code> is the key type.</p></li><li class="listitem"><p><code class="classname">Mapped</code> is the mapped-policy.</p></li><li class="listitem"><p><code class="classname">Hash_Fn</code> is a key hashing functor.</p></li><li class="listitem"><p><code class="classname">Eq_Fn</code> is a key equivalence functor.</p></li><li class="listitem"><p><code class="classname">Comb_Hash_Fn</code> is a range-hashing_functor;
+ it describes how to translate hash values into positions
+ within the table. </p></li><li class="listitem"><p><code class="classname">Resize_Policy</code> describes how a container object
+ should change its internal size. </p></li><li class="listitem"><p><code class="classname">Store_Hash</code> indicates whether the hash value
+ should be stored with each entry. </p></li><li class="listitem"><p><code class="classname">Allocator</code> is an allocator
+ type.</p></li></ol></div><p>The probing hash-based container has the following
+ declaration.</p><pre class="programlisting">
+ template&lt;
+ typename Key,
+ typename Mapped,
+ typename Hash_Fn = std::hash&lt;Key&gt;,
+ typename Eq_Fn = std::equal_to&lt;Key&gt;,
+ typename Comb_Probe_Fn = direct_mask_range_hashing&lt;&gt;
+ typename Probe_Fn = default explained below.
+ typename Resize_Policy = default explained below.
+ bool Store_Hash = false,
+ typename Allocator = std::allocator&lt;char&gt; &gt;
+ class gp_hash_table;
+ </pre><p>The parameters are identical to those of the
+ collision-chaining container, except for the following.</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Comb_Probe_Fn</code> describes how to transform a probe
+ sequence into a sequence of positions within the table.</p></li><li class="listitem"><p><code class="classname">Probe_Fn</code> describes a probe sequence policy.</p></li></ol></div><p>Some of the default template values depend on the values of
+ other parameters, and are explained below.</p></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.hash.details"/>Details</h5></div></div></div><div class="section" title="Hash Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.hash_policies"/>Hash Policies</h6></div></div></div><div class="section" title="General"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.general"/>General</h6></div></div></div><p>Following is an explanation of some functions which hashing
+ involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="id668502"/><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
+ range-hashing functions</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_ranged_hash_range_hashing_fns.png" style="text-align: middle" alt="Hash functions, ranged-hash functions, and range-hashing functions"/></div></div></div><br class="figure-break"/><p>Let U be a domain (e.g., the integers, or the
+ strings of 3 characters). A hash-table algorithm needs to map
+ elements of U "uniformly" into the range [0,..., m -
+ 1] (where m is a non-negative integral value, and
+ is, in general, time varying). I.e., the algorithm needs
+ a ranged-hash function</p><p>
+ f : U × Z<sub>+</sub> → Z<sub>+</sub>
+ </p><p>such that for any u in U ,</p><p>0 ≤ f(u, m) ≤ m - 1</p><p>and which has "good uniformity" properties (say
+ <a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>.)
+ One
+ common solution is to use the composition of the hash
+ function</p><p>h : U → Z<sub>+</sub> ,</p><p>which maps elements of U into the non-negative
+ integrals, and</p><p>g : Z<sub>+</sub> × Z<sub>+</sub> →
+ Z<sub>+</sub>,</p><p>which maps a non-negative hash value, and a non-negative
+ range upper-bound into a non-negative integral in the range
+ between 0 (inclusive) and the range upper bound (exclusive),
+ i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="id668617"/><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
+ f(u , m) = g(h(u), m)
+ </span></div></div><br class="equation-break"/><p>From the above, it is obvious that given g and
+ h, f can always be composed (however the converse
+ is not true). The standard's hash-based containers allow specifying
+ a hash function, and use a hard-wired range-hashing function;
+ the ranged-hash function is implicitly composed.</p><p>The above describes the case where a key is to be mapped
+ into a single position within a hash table, e.g.,
+ in a collision-chaining table. In other cases, a key is to be
+ mapped into a sequence of positions within a table,
+ e.g., in a probing table. Similar terms apply in this
+ case: the table requires a ranged probe function,
+ mapping a key into a sequence of positions withing the table.
+ This is typically achieved by composing a hash function
+ mapping the key into a non-negative integral type, a
+ probe function transforming the hash value into a
+ sequence of hash values, and a range-hashing function
+ transforming the sequence of hash values into a sequence of
+ positions.</p></div><div class="section" title="Range Hashing"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.range"/>Range Hashing</h6></div></div></div><p>Some common choices for range-hashing functions are the
+ division, multiplication, and middle-square methods (<a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>), defined
+ as</p><div class="equation"><a id="id668666"/><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
+ g(r, m) = r mod m
+ </span></div></div><br class="equation-break"/><p>g(r, m) = ⌈ u/v ( a r mod v ) ⌉</p><p>and</p><p>g(r, m) = ⌈ u/v ( r<sup>2</sup> mod v ) ⌉</p><p>respectively, for some positive integrals u and
+ v (typically powers of 2), and some a. Each of
+ these range-hashing functions works best for some different
+ setting.</p><p>The division method (see above) is a
+ very common choice. However, even this single method can be
+ implemented in two very different ways. It is possible to
+ implement using the low
+ level % (modulo) operation (for any m), or the
+ low level &amp; (bit-mask) operation (for the case where
+ m is a power of 2), i.e.,</p><div class="equation"><a id="id668703"/><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
+ g(r, m) = r % m
+ </span></div></div><br class="equation-break"/><p>and</p><div class="equation"><a id="id668718"/><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
+ g(r, m) = r &amp; m - 1, (with m =
+ 2<sup>k</sup> for some k)
+ </span></div></div><br class="equation-break"/><p>respectively.</p><p>The % (modulo) implementation has the advantage that for
+ m a prime far from a power of 2, g(r, m) is
+ affected by all the bits of r (minimizing the chance of
+ collision). It has the disadvantage of using the costly modulo
+ operation. This method is hard-wired into SGI's implementation
+ .</p><p>The &amp; (bit-mask) implementation has the advantage of
+ relying on the fast bit-wise and operation. It has the
+ disadvantage that for g(r, m) is affected only by the
+ low order bits of r. This method is hard-wired into
+ Dinkumware's implementation.</p></div><div class="section" title="Ranged Hash"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.ranged"/>Ranged Hash</h6></div></div></div><p>In cases it is beneficial to allow the
+ client to directly specify a ranged-hash hash function. It is
+ true, that the writer of the ranged-hash function cannot rely
+ on the values of m having specific numerical properties
+ suitable for hashing (in the sense used in <a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>), since
+ the values of m are determined by a resize policy with
+ possibly orthogonal considerations.</p><p>There are two cases where a ranged-hash function can be
+ superior. The firs is when using perfect hashing: the
+ second is when the values of m can be used to estimate
+ the "general" number of distinct values required. This is
+ described in the following.</p><p>Let</p><p>
+ s = [ s<sub>0</sub>,..., s<sub>t - 1</sub>]
+ </p><p>be a string of t characters, each of which is from
+ domain S. Consider the following ranged-hash
+ function:</p><div class="equation"><a id="id668799"/><p class="title"><strong>Equation 22.5. 
+ A Standard String Hash Function
+ </strong></p><div class="equation-contents"><span class="mathphrase">
+ f<sub>1</sub>(s, m) = ∑ <sub>i =
+ 0</sub><sup>t - 1</sup> s<sub>i</sub> a<sup>i</sup> mod m
+ </span></div></div><br class="equation-break"/><p>where a is some non-negative integral value. This is
+ the standard string-hashing function used in SGI's
+ implementation (with a = 5). Its advantage is that
+ it takes into account all of the characters of the string.</p><p>Now assume that s is the string representation of a
+ of a long DNA sequence (and so S = {'A', 'C', 'G',
+ 'T'}). In this case, scanning the entire string might be
+ prohibitively expensive. A possible alternative might be to use
+ only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="id668850"/><p class="title"><strong>Equation 22.6. 
+ Only k String DNA Hash
+ </strong></p><div class="equation-contents"><span class="mathphrase">
+ f<sub>2</sub>(s, m) = ∑ <sub>i
+ = 0</sub><sup>k - 1</sup> s<sub>i</sub> a<sup>i</sup> mod m
+ </span></div></div><br class="equation-break"/><p>requiring scanning over only</p><p>k = log<sub>4</sub>( m )</p><p>characters.</p><p>Other more elaborate hash-functions might scan k
+ characters starting at a random position (determined at each
+ resize), or scanning k random positions (determined at
+ each resize), i.e., using</p><p>f<sub>3</sub>(s, m) = ∑ <sub>i =
+ r</sub>0<sup>r<sub>0</sub> + k - 1</sup> s<sub>i</sub>
+ a<sup>i</sup> mod m ,</p><p>or</p><p>f<sub>4</sub>(s, m) = ∑ <sub>i = 0</sub><sup>k -
+ 1</sup> s<sub>r</sub>i a<sup>r<sub>i</sub></sup> mod
+ m ,</p><p>respectively, for r<sub>0</sub>,..., r<sub>k-1</sub>
+ each in the (inclusive) range [0,...,t-1].</p><p>It should be noted that the above functions cannot be
+ decomposed as per a ranged hash composed of hash and range hashing.</p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.implementation"/>Implementation</h6></div></div></div><p>This sub-subsection describes the implementation of
+ the above in this library. It first explains range-hashing
+ functions in collision-chaining tables, then ranged-hash
+ functions in collision-chaining tables, then probing-based
+ tables, and finally lists the relevant classes in this
+ library.</p><div class="section" title="Range-Hashing and Ranged-Hashes in Collision-Chaining Tables"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.collision-chaining"/>
+ Range-Hashing and Ranged-Hashes in Collision-Chaining Tables
+ </h6></div></div></div><p><code class="classname">cc_hash_table</code> is
+ parametrized by <code class="classname">Hash_Fn</code> and <code class="classname">Comb_Hash_Fn</code>, a
+ hash functor and a combining hash functor, respectively.</p><p>In general, <code class="classname">Comb_Hash_Fn</code> is considered a
+ range-hashing functor. <code class="classname">cc_hash_table</code>
+ synthesizes a ranged-hash function from <code class="classname">Hash_Fn</code> and
+ <code class="classname">Comb_Hash_Fn</code>. The figure below shows an <code class="classname">insert</code> sequence
+ diagram for this case. The user inserts an element (point A),
+ the container transforms the key into a non-negative integral
+ using the hash functor (points B and C), and transforms the
+ result into a position using the combining functor (points D
+ and E).</p><div class="figure"><a id="id669038"/><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" style="text-align: middle" alt="Insert hash sequence diagram"/></div></div></div><br class="figure-break"/><p>If <code class="classname">cc_hash_table</code>'s
+ hash-functor, <code class="classname">Hash_Fn</code> is instantiated by <code class="classname">null_type</code> , then <code class="classname">Comb_Hash_Fn</code> is taken to be
+ a ranged-hash function. The graphic below shows an <code class="function">insert</code> sequence
+ diagram. The user inserts an element (point A), the container
+ transforms the key into a position using the combining functor
+ (points B and C).</p><div class="figure"><a id="id669097"/><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" style="text-align: middle" alt="Insert hash sequence diagram with a null policy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Probing tables"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"/>
+ Probing tables
+ </h6></div></div></div><p><code class="classname">gp_hash_table</code> is parametrized by
+ <code class="classname">Hash_Fn</code>, <code class="classname">Probe_Fn</code>,
+ and <code class="classname">Comb_Probe_Fn</code>. As before, if
+ <code class="classname">Hash_Fn</code> and <code class="classname">Probe_Fn</code>
+ are both <code class="classname">null_type</code>, then
+ <code class="classname">Comb_Probe_Fn</code> is a ranged-probe
+ functor. Otherwise, <code class="classname">Hash_Fn</code> is a hash
+ functor, <code class="classname">Probe_Fn</code> is a functor for offsets
+ from a hash value, and <code class="classname">Comb_Probe_Fn</code>
+ transforms a probe sequence into a sequence of positions within
+ the table.</p></div><div class="section" title="Pre-Defined Policies"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.predefined"/>
+ Pre-Defined Policies
+ </h6></div></div></div><p>This library contains some pre-defined classes
+ implementing range-hashing and probing functions:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">direct_mask_range_hashing</code>
+ and <code class="classname">direct_mod_range_hashing</code>
+ are range-hashing functions based on a bit-mask and a modulo
+ operation, respectively.</p></li><li class="listitem"><p><code class="classname">linear_probe_fn</code>, and
+ <code class="classname">quadratic_probe_fn</code> are
+ a linear probe and a quadratic probe function,
+ respectively.</p></li></ol></div><p>
+ The graphic below shows the relationships.
+ </p><div class="figure"><a id="id669237"/><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_hash_policy_cd.png" style="text-align: middle" alt="Hash policy class diagram"/></div></div></div><br class="figure-break"/></div></div></div><div class="section" title="Resize Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"/>Resize Policies</h6></div></div></div><div class="section" title="General"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"/>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
+ shrink. It is necessary to specify policies to determine how
+ and when a hash table should change its size. Usually, resize
+ policies can be decomposed into orthogonal policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>A size policy indicating how a hash table
+ should grow (e.g., it should multiply by powers of
+ 2).</p></li><li class="listitem"><p>A trigger policy indicating when a hash
+ table should grow (e.g., a load factor is
+ exceeded).</p></li></ol></div></div><div class="section" title="Size Policies"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.size"/>Size Policies</h6></div></div></div><p>Size policies determine how a hash table changes size. These
+ policies are simple, and there are relatively few sensible
+ options. An exponential-size policy (with the initial size and
+ growth factors both powers of 2) works well with a mask-based
+ range-hashing function, and is the
+ hard-wired policy used by Dinkumware. A
+ prime-list based policy works well with a modulo-prime range
+ hashing function and is the hard-wired policy used by SGI's
+ implementation.</p></div><div class="section" title="Trigger Policies"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.trigger"/>Trigger Policies</h6></div></div></div><p>Trigger policies determine when a hash table changes size.
+ Following is a description of two policies: load-check
+ policies, and collision-check policies.</p><p>Load-check policies are straightforward. The user specifies
+ two factors, Α<sub>min</sub> and
+ Α<sub>max</sub>, and the hash table maintains the
+ invariant that</p><p>Α<sub>min</sub> ≤ (number of
+ stored elements) / (hash-table size) ≤
+ Α<sub>max</sub><em><span class="remark">load factor min max</span></em></p><p>Collision-check policies work in the opposite direction of
+ load-check policies. They focus on keeping the number of
+ collisions moderate and hoping that the size of the table will
+ not grow very large, instead of keeping a moderate load-factor
+ and hoping that the number of collisions will be small. A
+ maximal collision-check policy resizes when the longest
+ probe-sequence grows too large.</p><p>Consider the graphic below. Let the size of the hash table
+ be denoted by m, the length of a probe sequence be denoted by k,
+ and some load factor be denoted by Α. We would like to
+ calculate the minimal length of k, such that if there were Α
+ m elements in the hash table, a probe sequence of length k would
+ be found with probability at most 1/m.</p><div class="figure"><a id="id669396"/><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_balls_and_bins.png" style="text-align: middle" alt="Balls and bins"/></div></div></div><br class="figure-break"/><p>Denote the probability that a probe sequence of length
+ k appears in bin i by p<sub>i</sub>, the
+ length of the probe sequence of bin i by
+ l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="id669441"/><p class="title"><strong>Equation 22.7. 
+ Probability of Probe Sequence of Length k
+ </strong></p><div class="equation-contents"><span class="mathphrase">
+ p<sub>1</sub> =
+ </span></div></div><br class="equation-break"/><p>P(l<sub>1</sub> ≥ k) =</p><p>
+ P(l<sub>1</sub> ≥ α ( 1 + k / α - 1) ≤ (a)
+ </p><p>
+ e ^ ( - ( α ( k / α - 1 )<sup>2</sup> ) /2)
+ </p><p>where (a) follows from the Chernoff bound (<a class="xref" href="policy_data_structures.html#biblio.motwani95random" title="Randomized Algorithms">[biblio.motwani95random]</a>). To
+ calculate the probability that some bin contains a probe
+ sequence greater than k, we note that the
+ l<sub>i</sub> are negatively-dependent
+ (<a class="xref" href="policy_data_structures.html#biblio.dubhashi98neg" title="Balls and bins: A study in negative dependence">[biblio.dubhashi98neg]</a>)
+ . Let
+ I(.) denote the indicator function. Then</p><div class="equation"><a id="id669498"/><p class="title"><strong>Equation 22.8. 
+ Probability Probe Sequence in Some Bin
+ </strong></p><div class="equation-contents"><span class="mathphrase">
+ P( exists<sub>i</sub> l<sub>i</sub> ≥ k ) =
+ </span></div></div><br class="equation-break"/><p>P ( ∑ <sub>i = 1</sub><sup>m</sup>
+ I(l<sub>i</sub> ≥ k) ≥ 1 ) =</p><p>P ( ∑ <sub>i = 1</sub><sup>m</sup> I (
+ l<sub>i</sub> ≥ k ) ≥ m p<sub>1</sub> ( 1 + 1 / (m
+ p<sub>1</sub>) - 1 ) ) ≤ (a)</p><p>e ^ ( ( - m p<sub>1</sub> ( 1 / (m p<sub>1</sub>)
+ - 1 ) <sup>2</sup> ) / 2 ) ,</p><p>where (a) follows from the fact that the Chernoff bound can
+ be applied to negatively-dependent variables (<a class="xref" href="policy_data_structures.html#biblio.dubhashi98neg" title="Balls and bins: A study in negative dependence">[biblio.dubhashi98neg]</a>). Inserting the first probability
+ equation into the second one, and equating with 1/m, we
+ obtain</p><p>k ~ √ ( 2 α ln 2 m ln(m) )
+ ) .</p></div><div class="section" title="Implementation"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl"/>Implementation</h6></div></div></div><p>This sub-subsection describes the implementation of the
+ above in this library. It first describes resize policies and
+ their decomposition into trigger and size policies, then
+ describes pre-defined classes, and finally discusses controlled
+ access the policies' internals.</p><div class="section" title="Decomposition"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.decomposition"/>Decomposition</h6></div></div></div><p>Each hash-based container is parametrized by a
+ <code class="classname">Resize_Policy</code> parameter; the container derives
+ <code class="classname">public</code>ly from <code class="classname">Resize_Policy</code>. For
+ example:</p><pre class="programlisting">
+ cc_hash_table&lt;typename Key,
+ typename Mapped,
+ ...
+ typename Resize_Policy
+ ...&gt; : public Resize_Policy
+ </pre><p>As a container object is modified, it continuously notifies
+ its <code class="classname">Resize_Policy</code> base of internal changes
+ (e.g., collisions encountered and elements being
+ inserted). It queries its <code class="classname">Resize_Policy</code> base whether
+ it needs to be resized, and if so, to what size.</p><p>The graphic below shows a (possible) sequence diagram
+ of an insert operation. The user inserts an element; the hash
+ table notifies its resize policy that a search has started
+ (point A); in this case, a single collision is encountered -
+ the table notifies its resize policy of this (point B); the
+ container finally notifies its resize policy that the search
+ has ended (point C); it then queries its resize policy whether
+ a resize is needed, and if so, what is the new size (points D
+ to G); following the resize, it notifies the policy that a
+ resize has completed (point H); finally, the element is
+ inserted, and the policy notified (point I).</p><div class="figure"><a id="id669652"/><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" style="text-align: middle" alt="Insert resize sequence diagram"/></div></div></div><br class="figure-break"/><p>In practice, a resize policy can be usually orthogonally
+ decomposed to a size policy and a trigger policy. Consequently,
+ the library contains a single class for instantiating a resize
+ policy: <code class="classname">hash_standard_resize_policy</code>
+ is parametrized by <code class="classname">Size_Policy</code> and
+ <code class="classname">Trigger_Policy</code>, derives <code class="classname">public</code>ly from
+ both, and acts as a standard delegate (<a class="xref" href="policy_data_structures.html#biblio.gof" title="Design Patterns - Elements of Reusable Object-Oriented Software">[biblio.gof]</a>)
+ to these policies.</p><p>The two graphics immediately below show sequence diagrams
+ illustrating the interaction between the standard resize policy
+ and its trigger and size policies, respectively.</p><div class="figure"><a id="id669717"/><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
+ diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" style="text-align: middle" alt="Standard resize policy trigger sequence diagram"/></div></div></div><br class="figure-break"/><div class="figure"><a id="id669752"/><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
+ diagram</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_insert_resize_sequence_diagram3.png" style="text-align: middle" alt="Standard resize policy size sequence diagram"/></div></div></div><br class="figure-break"/></div><div class="section" title="Predefined Policies"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.predefined"/>Predefined Policies</h6></div></div></div><p>The library includes the following
+ instantiations of size and trigger policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">hash_load_check_resize_trigger</code>
+ implements a load check trigger policy.</p></li><li class="listitem"><p><code class="classname">cc_hash_max_collision_check_resize_trigger</code>
+ implements a collision check trigger policy.</p></li><li class="listitem"><p><code class="classname">hash_exponential_size_policy</code>
+ implements an exponential-size policy (which should be used
+ with mask range hashing).</p></li><li class="listitem"><p><code class="classname">hash_prime_size_policy</code>
+ implementing a size policy based on a sequence of primes
+ (which should
+ be used with mod range hashing</p></li></ol></div><p>The graphic below gives an overall picture of the resize-related
+ classes. <code class="classname">basic_hash_table</code>
+ is parametrized by <code class="classname">Resize_Policy</code>, which it subclasses
+ publicly. This class is currently instantiated only by <code class="classname">hash_standard_resize_policy</code>.
+ <code class="classname">hash_standard_resize_policy</code>
+ itself is parametrized by <code class="classname">Trigger_Policy</code> and
+ <code class="classname">Size_Policy</code>. Currently, <code class="classname">Trigger_Policy</code> is
+ instantiated by <code class="classname">hash_load_check_resize_trigger</code>,
+ or <code class="classname">cc_hash_max_collision_check_resize_trigger</code>;
+ <code class="classname">Size_Policy</code> is instantiated by <code class="classname">hash_exponential_size_policy</code>,
+ or <code class="classname">hash_prime_size_policy</code>.</p></div><div class="section" title="Controling Access to Internals"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.internals"/>Controling Access to Internals</h6></div></div></div><p>There are cases where (controlled) access to resize
+ policies' internals is beneficial. E.g., it is sometimes
+ useful to query a hash-table for the table's actual size (as
+ opposed to its <code class="function">size()</code> - the number of values it
+ currently holds); it is sometimes useful to set a table's
+ initial size, externally resize it, or change load factors.</p><p>Clearly, supporting such methods both decreases the
+ encapsulation of hash-based containers, and increases the
+ diversity between different associative-containers' interfaces.
+ Conversely, omitting such methods can decrease containers'
+ flexibility.</p><p>In order to avoid, to the extent possible, the above
+ conflict, the hash-based containers themselves do not address
+ any of these questions; this is deferred to the resize policies,
+ which are easier to change or replace. Thus, for example,
+ neither <code class="classname">cc_hash_table</code> nor
+ <code class="classname">gp_hash_table</code>
+ contain methods for querying the actual size of the table; this
+ is deferred to <code class="classname">hash_standard_resize_policy</code>.</p><p>Furthermore, the policies themselves are parametrized by
+ template arguments that determine the methods they support
+ (
+ <a class="xref" href="policy_data_structures.html#biblio.alexandrescu01modern" title="Modern C++ Design: Generic Programming and Design Patterns Applied">[biblio.alexandrescu01modern]</a>
+ shows techniques for doing so). <code class="classname">hash_standard_resize_policy</code>
+ is parametrized by <code class="classname">External_Size_Access</code> that
+ determines whether it supports methods for querying the actual
+ size of the table or resizing it. <code class="classname">hash_load_check_resize_trigger</code>
+ is parametrized by <code class="classname">External_Load_Access</code> that
+ determines whether it supports methods for querying or
+ modifying the loads. <code class="classname">cc_hash_max_collision_check_resize_trigger</code>
+ is parametrized by <code class="classname">External_Load_Access</code> that
+ determines whether it supports methods for querying the
+ load.</p><p>Some operations, for example, resizing a container at
+ run time, or changing the load factors of a load-check trigger
+ policy, require the container itself to resize. As mentioned
+ above, the hash-based containers themselves do not contain
+ these types of methods, only their resize policies.
+ Consequently, there must be some mechanism for a resize policy
+ to manipulate the hash-based container. As the hash-based
+ container is a subclass of the resize policy, this is done
+ through virtual methods. Each hash-based container has a
+ <code class="classname">private</code> <code class="classname">virtual</code> method:</p><pre class="programlisting">
+ virtual void
+ do_resize
+ (size_type new_size);
+ </pre><p>which resizes the container. Implementations of
+ <code class="classname">Resize_Policy</code> can export public methods for resizing
+ the container externally; these methods internally call
+ <code class="classname">do_resize</code> to resize the table.</p></div></div></div><div class="section" title="Policy Interactions"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.policy_interaction"/>Policy Interactions</h6></div></div></div><p>
+ </p><p>Hash-tables are unfortunately especially susceptible to
+ choice of policies. One of the more complicated aspects of this
+ is that poor combinations of good policies can form a poor
+ container. Following are some considerations.</p><div class="section" title="probe/size/trigger"><div class="titlepage"><div><div><h6 class="title"><a id="policy_interaction.probesizetrigger"/>probe/size/trigger</h6></div></div></div><p>Some combinations do not work well for probing containers.
+ For example, combining a quadratic probe policy with an
+ exponential size policy can yield a poor container: when an
+ element is inserted, a trigger policy might decide that there
+ is no need to resize, as the table still contains unused
+ entries; the probe sequence, however, might never reach any of
+ the unused entries.</p><p>Unfortunately, this library cannot detect such problems at
+ compilation (they are halting reducible). It therefore defines
+ an exception class <code class="classname">insert_error</code> to throw an
+ exception in this case.</p></div><div class="section" title="hash/trigger"><div class="titlepage"><div><div><h6 class="title"><a id="policy_interaction.hashtrigger"/>hash/trigger</h6></div></div></div><p>Some trigger policies are especially susceptible to poor
+ hash functions. Suppose, as an extreme case, that the hash
+ function transforms each key to the same hash value. After some
+ inserts, a collision detecting policy will always indicate that
+ the container needs to grow.</p><p>The library, therefore, by design, limits each operation to
+ one resize. For each <code class="classname">insert</code>, for example, it queries
+ only once whether a resize is needed.</p></div><div class="section" title="equivalence functors/storing hash values/hash"><div class="titlepage"><div><div><h6 class="title"><a id="policy_interaction.eqstorehash"/>equivalence functors/storing hash values/hash</h6></div></div></div><p><code class="classname">cc_hash_table</code> and
+ <code class="classname">gp_hash_table</code> are
+ parametrized by an equivalence functor and by a
+ <code class="classname">Store_Hash</code> parameter. If the latter parameter is
+ <code class="classname">true</code>, then the container stores with each entry
+ a hash value, and uses this value in case of collisions to
+ determine whether to apply a hash value. This can lower the
+ cost of collision for some types, but increase the cost of
+ collisions for other types.</p><p>If a ranged-hash function or ranged probe function is
+ directly supplied, however, then it makes no sense to store the
+ hash value with each entry. This library's container will
+ fail at compilation, by design, if this is attempted.</p></div><div class="section" title="size/load-check trigger"><div class="titlepage"><div><div><h6 class="title"><a id="policy_interaction.sizeloadtrigger"/>size/load-check trigger</h6></div></div></div><p>Assume a size policy issues an increasing sequence of sizes
+ a, a q, a q<sup>1</sup>, a q<sup>2</sup>, ... For
+ example, an exponential size policy might issue the sequence of
+ sizes 8, 16, 32, 64, ...</p><p>If a load-check trigger policy is used, with loads
+ α<sub>min</sub> and α<sub>max</sub>,
+ respectively, then it is a good idea to have:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>α<sub>max</sub> ~ 1 / q</p></li><li class="listitem"><p>α<sub>min</sub> &lt; 1 / (2 q)</p></li></ol></div><p>This will ensure that the amortized hash cost of each
+ modifying operation is at most approximately 3.</p><p>α<sub>min</sub> ~ α<sub>max</sub> is, in
+ any case, a bad choice, and α<sub>min</sub> &gt;
+ α <sub>max</sub> is horrendous.</p></div></div></div></div><div class="section" title="tree"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.container.tree"/>tree</h4></div></div></div><div class="section" title="Interface"><div class="titlepage"><div><div><h5 class="title"><a id="container.tree.interface"/>Interface</h5></div></div></div><p>The tree-based container has the following declaration:</p><pre class="programlisting">
+ template&lt;
+ typename Key,
+ typename Mapped,
+ typename Cmp_Fn = std::less&lt;Key&gt;,
+ typename Tag = rb_tree_tag,
+ template&lt;
+ typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename Cmp_Fn_,
+ typename Allocator_&gt;
+ class Node_Update = null_node_update,
+ typename Allocator = std::allocator&lt;char&gt; &gt;
+ class tree;
+ </pre><p>The parameters have the following meaning:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Key</code> is the key type.</p></li><li class="listitem"><p><code class="classname">Mapped</code> is the mapped-policy.</p></li><li class="listitem"><p><code class="classname">Cmp_Fn</code> is a key comparison functor</p></li><li class="listitem"><p><code class="classname">Tag</code> specifies which underlying data structure
+ to use.</p></li><li class="listitem"><p><code class="classname">Node_Update</code> is a policy for updating node
+ invariants.</p></li><li class="listitem"><p><code class="classname">Allocator</code> is an allocator
+ type.</p></li></ol></div><p>The <code class="classname">Tag</code> parameter specifies which underlying
+ data structure to use. Instantiating it by <code class="classname">rb_tree_tag</code>, <code class="classname">splay_tree_tag</code>, or
+ <code class="classname">ov_tree_tag</code>,
+ specifies an underlying red-black tree, splay tree, or
+ ordered-vector tree, respectively; any other tag is illegal.
+ Note that containers based on the former two contain more types
+ and methods than the latter (e.g.,
+ <code class="classname">reverse_iterator</code> and <code class="classname">rbegin</code>), and different
+ exception and invalidation guarantees.</p></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.tree.details"/>Details</h5></div></div></div><div class="section" title="Node Invariants"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node"/>Node Invariants</h6></div></div></div><p>Consider the two trees in the graphic below, labels A and B. The first
+ is a tree of floats; the second is a tree of pairs, each
+ signifying a geometric line interval. Each element in a tree is refered to as a node of the tree. Of course, each of
+ these trees can support the usual queries: the first can easily
+ search for <code class="classname">0.4</code>; the second can easily search for
+ <code class="classname">std::make_pair(10, 41)</code>.</p><p>Each of these trees can efficiently support other queries.
+ The first can efficiently determine that the 2rd key in the
+ tree is <code class="constant">0.3</code>; the second can efficiently determine
+ whether any of its intervals overlaps
+ </p><pre class="programlisting">std::make_pair(29,42)</pre><p> (useful in geometric
+ applications or distributed file systems with leases, for
+ example). It should be noted that an <code class="classname">std::set</code> can
+ only solve these types of problems with linear complexity.</p><p>In order to do so, each tree stores some metadata in
+ each node, and maintains node invariants (see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>.) The first stores in
+ each node the size of the sub-tree rooted at the node; the
+ second stores at each node the maximal endpoint of the
+ intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="id670401"/><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invariants.png" style="text-align: middle" alt="Tree node invariants"/></div></div></div><br class="figure-break"/><p>Supporting such trees is difficult for a number of
+ reasons:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>There must be a way to specify what a node's metadata
+ should be (if any).</p></li><li class="listitem"><p>Various operations can invalidate node
+ invariants. The graphic below shows how a right rotation,
+ performed on A, results in B, with nodes x and y having
+ corrupted invariants (the grayed nodes in C). The graphic shows
+ how an insert, performed on D, results in E, with nodes x and y
+ having corrupted invariants (the grayed nodes in F). It is not
+ feasible to know outside the tree the effect of an operation on
+ the nodes of the tree.</p></li><li class="listitem"><p>The search paths of standard associative containers are
+ defined by comparisons between keys, and not through
+ metadata.</p></li><li class="listitem"><p>It is not feasible to know in advance which methods trees
+ can support. Besides the usual <code class="classname">find</code> method, the
+ first tree can support a <code class="classname">find_by_order</code> method, while
+ the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="id670480"/><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_invalidations.png" style="text-align: middle" alt="Tree node invalidation"/></div></div></div><br class="figure-break"/><p>These problems are solved by a combination of two means:
+ node iterators, and template-template node updater
+ parameters.</p><div class="section" title="Node Iterators"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node.iterators"/>Node Iterators</h6></div></div></div><p>Each tree-based container defines two additional iterator
+ types, <code class="classname">const_node_iterator</code>
+ and <code class="classname">node_iterator</code>.
+ These iterators allow descending from a node to one of its
+ children. Node iterator allow search paths different than those
+ determined by the comparison functor. The <code class="classname">tree</code>
+ supports the methods:</p><pre class="programlisting">
+ const_node_iterator
+ node_begin() const;
+
+ node_iterator
+ node_begin();
+
+ const_node_iterator
+ node_end() const;
+
+ node_iterator
+ node_end();
+ </pre><p>The first pairs return node iterators corresponding to the
+ root node of the tree; the latter pair returns node iterators
+ corresponding to a just-after-leaf node.</p></div><div class="section" title="Node Updator"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node.updator"/>Node Updator</h6></div></div></div><p>The tree-based containers are parametrized by a
+ <code class="classname">Node_Update</code> template-template parameter. A
+ tree-based container instantiates
+ <code class="classname">Node_Update</code> to some
+ <code class="classname">node_update</code> class, and publicly subclasses
+ <code class="classname">node_update</code>. The graphic below shows this
+ scheme, as well as some predefined policies (which are explained
+ below).</p><div class="figure"><a id="id670590"/><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_tree_node_updator_policy_cd.png" style="text-align: middle" alt="A tree and its update policy"/></div></div></div><br class="figure-break"/><p><code class="classname">node_update</code> (an instantiation of
+ <code class="classname">Node_Update</code>) must define <code class="classname">metadata_type</code> as
+ the type of metadata it requires. For order statistics,
+ e.g., <code class="classname">metadata_type</code> might be <code class="classname">size_t</code>.
+ The tree defines within each node a <code class="classname">metadata_type</code>
+ object.</p><p><code class="classname">node_update</code> must also define the following method
+ for restoring node invariants:</p><pre class="programlisting">
+ void
+ operator()(node_iterator nd_it, const_node_iterator end_nd_it)
+ </pre><p>In this method, <code class="varname">nd_it</code> is a
+ <code class="classname">node_iterator</code> corresponding to a node whose
+ A) all descendants have valid invariants, and B) its own
+ invariants might be violated; <code class="classname">end_nd_it</code> is
+ a <code class="classname">const_node_iterator</code> corresponding to a
+ just-after-leaf node. This method should correct the node
+ invariants of the node pointed to by
+ <code class="classname">nd_it</code>. For example, say node x in the
+ graphic below label A has an invalid invariant, but its' children,
+ y and z have valid invariants. After the invocation, all three
+ nodes should have valid invariants, as in label B.</p><div class="figure"><a id="id670687"/><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_restoring_node_invariants.png" style="text-align: middle" alt="Restoring node invariants"/></div></div></div><br class="figure-break"/><p>When a tree operation might invalidate some node invariant,
+ it invokes this method in its <code class="classname">node_update</code> base to
+ restore the invariant. For example, the graphic below shows
+ an <code class="function">insert</code> operation (point A); the tree performs some
+ operations, and calls the update functor three times (points B,
+ C, and D). (It is well known that any <code class="function">insert</code>,
+ <code class="function">erase</code>, <code class="function">split</code> or <code class="function">join</code>, can restore
+ all node invariants by a small number of node invariant updates (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>)
+ .</p><div class="figure"><a id="id670755"/><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_update_seq_diagram.png" style="text-align: middle" alt="Insert update sequence"/></div></div></div><br class="figure-break"/><p>To complete the description of the scheme, three questions
+ need to be answered:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>How can a tree which supports order statistics define a
+ method such as <code class="classname">find_by_order</code>?</p></li><li class="listitem"><p>How can the node updater base access methods of the
+ tree?</p></li><li class="listitem"><p>How can the following cyclic dependency be resolved?
+ <code class="classname">node_update</code> is a base class of the tree, yet it
+ uses node iterators defined in the tree (its child).</p></li></ol></div><p>The first two questions are answered by the fact that
+ <code class="classname">node_update</code> (an instantiation of
+ <code class="classname">Node_Update</code>) is a <span class="emphasis"><em>public</em></span> base class
+ of the tree. Consequently:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Any public methods of
+ <code class="classname">node_update</code> are automatically methods of
+ the tree (<a class="xref" href="policy_data_structures.html#biblio.alexandrescu01modern" title="Modern C++ Design: Generic Programming and Design Patterns Applied">[biblio.alexandrescu01modern]</a>).
+ Thus an order-statistics node updater,
+ <code class="classname">tree_order_statistics_node_update</code> defines
+ the <code class="function">find_by_order</code> method; any tree
+ instantiated by this policy consequently supports this method as
+ well.</p></li><li class="listitem"><p>In C++, if a base class declares a method as
+ <code class="literal">virtual</code>, it is
+ <code class="literal">virtual</code> in its subclasses. If
+ <code class="classname">node_update</code> needs to access one of the
+ tree's methods, say the member function
+ <code class="function">end</code>, it simply declares that method as
+ <code class="literal">virtual</code> abstract.</p></li></ol></div><p>The cyclic dependency is solved through template-template
+ parameters. <code class="classname">Node_Update</code> is parametrized by
+ the tree's node iterators, its comparison functor, and its
+ allocator type. Thus, instantiations of
+ <code class="classname">Node_Update</code> have all information
+ required.</p><p>This library assumes that constructing a metadata object and
+ modifying it are exception free. Suppose that during some method,
+ say <code class="classname">insert</code>, a metadata-related operation
+ (e.g., changing the value of a metadata) throws an exception. Ack!
+ Rolling back the method is unusually complex.</p><p>Previously, a distinction was made between redundant
+ policies and null policies. Node invariants show a
+ case where null policies are required.</p><p>Assume a regular tree is required, one which need not
+ support order statistics or interval overlap queries.
+ Seemingly, in this case a redundant policy - a policy which
+ doesn't affect nodes' contents would suffice. This, would lead
+ to the following drawbacks:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>Each node would carry a useless metadata object, wasting
+ space.</p></li><li class="listitem"><p>The tree cannot know if its
+ <code class="classname">Node_Update</code> policy actually modifies a
+ node's metadata (this is halting reducible). In the graphic
+ below, assume the shaded node is inserted. The tree would have
+ to traverse the useless path shown to the root, applying
+ redundant updates all the way.</p></li></ol></div><div class="figure"><a id="id670941"/><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_rationale_null_node_updator.png" style="text-align: middle" alt="Useless update path"/></div></div></div><br class="figure-break"/><p>A null policy class, <code class="classname">null_node_update</code>
+ solves both these problems. The tree detects that node
+ invariants are irrelevant, and defines all accordingly.</p></div></div><div class="section" title="Split and Join"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.details.split"/>Split and Join</h6></div></div></div><p>Tree-based containers support split and join methods.
+ It is possible to split a tree so that it passes
+ all nodes with keys larger than a given key to a different
+ tree. These methods have the following advantages over the
+ alternative of externally inserting to the destination
+ tree and erasing from the source tree:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>These methods are efficient - red-black trees are split
+ and joined in poly-logarithmic complexity; ordered-vector
+ trees are split and joined at linear complexity. The
+ alternatives have super-linear complexity.</p></li><li class="listitem"><p>Aside from orders of growth, these operations perform
+ few allocations and de-allocations. For red-black trees, allocations are not performed,
+ and the methods are exception-free. </p></li></ol></div></div></div></div><div class="section" title="Trie"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.container.trie"/>Trie</h4></div></div></div><div class="section" title="Interface"><div class="titlepage"><div><div><h5 class="title"><a id="container.trie.interface"/>Interface</h5></div></div></div><p>The trie-based container has the following declaration:</p><pre class="programlisting">
+ template&lt;typename Key,
+ typename Mapped,
+ typename Cmp_Fn = std::less&lt;Key&gt;,
+ typename Tag = pat_trie_tag,
+ template&lt;typename Const_Node_Iterator,
+ typename Node_Iterator,
+ typename E_Access_Traits_,
+ typename Allocator_&gt;
+ class Node_Update = null_node_update,
+ typename Allocator = std::allocator&lt;char&gt; &gt;
+ class trie;
+ </pre><p>The parameters have the following meaning:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Key</code> is the key type.</p></li><li class="listitem"><p><code class="classname">Mapped</code> is the mapped-policy.</p></li><li class="listitem"><p><code class="classname">E_Access_Traits</code> is described in below.</p></li><li class="listitem"><p><code class="classname">Tag</code> specifies which underlying data structure
+ to use, and is described shortly.</p></li><li class="listitem"><p><code class="classname">Node_Update</code> is a policy for updating node
+ invariants. This is described below.</p></li><li class="listitem"><p><code class="classname">Allocator</code> is an allocator
+ type.</p></li></ol></div><p>The <code class="classname">Tag</code> parameter specifies which underlying
+ data structure to use. Instantiating it by <code class="classname">pat_trie_tag</code>, specifies an
+ underlying PATRICIA trie (explained shortly); any other tag is
+ currently illegal.</p><p>Following is a description of a (PATRICIA) trie
+ (this implementation follows <a class="xref" href="policy_data_structures.html#biblio.okasaki98mereable" title="Fast mergeable integer maps">[biblio.okasaki98mereable]</a> and
+ <a class="xref" href="policy_data_structures.html#biblio.filliatre2000ptset" title="Ptset: Sets of integers implemented as Patricia trees">[biblio.filliatre2000ptset]</a>).
+ </p><p>A (PATRICIA) trie is similar to a tree, but with the
+ following differences:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>It explicitly views keys as a sequence of elements.
+ E.g., a trie can view a string as a sequence of
+ characters; a trie can view a number as a sequence of
+ bits.</p></li><li class="listitem"><p>It is not (necessarily) binary. Each node has fan-out n
+ + 1, where n is the number of distinct
+ elements.</p></li><li class="listitem"><p>It stores values only at leaf nodes.</p></li><li class="listitem"><p>Internal nodes have the properties that A) each has at
+ least two children, and B) each shares the same prefix with
+ any of its descendant.</p></li></ol></div><p>A (PATRICIA) trie has some useful properties:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>It can be configured to use large node fan-out, giving it
+ very efficient find performance (albeit at insertion
+ complexity and size).</p></li><li class="listitem"><p>It works well for common-prefix keys.</p></li><li class="listitem"><p>It can support efficiently queries such as which
+ keys match a certain prefix. This is sometimes useful in file
+ systems and routers, and for "type-ahead" aka predictive text matching
+ on mobile devices.</p></li></ol></div></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.trie.details"/>Details</h5></div></div></div><div class="section" title="Element Access Traits"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.etraits"/>Element Access Traits</h6></div></div></div><p>A trie inherently views its keys as sequences of elements.
+ For example, a trie can view a string as a sequence of
+ characters. A trie needs to map each of n elements to a
+ number in {0, n - 1}. For example, a trie can map a
+ character <code class="varname">c</code> to
+ </p><pre class="programlisting">static_cast&lt;size_t&gt;(c)</pre><p>.</p><p>Seemingly, then, a trie can assume that its keys support
+ (const) iterators, and that the <code class="classname">value_type</code> of this
+ iterator can be cast to a <code class="classname">size_t</code>. There are several
+ reasons, though, to decouple the mechanism by which the trie
+ accesses its keys' elements from the trie:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>In some cases, the numerical value of an element is
+ inappropriate. Consider a trie storing DNA strings. It is
+ logical to use a trie with a fan-out of 5 = 1 + |{'A', 'C',
+ 'G', 'T'}|. This requires mapping 'T' to 3, though.</p></li><li class="listitem"><p>In some cases the keys' iterators are different than what
+ is needed. For example, a trie can be used to search for
+ common suffixes, by using strings'
+ <code class="classname">reverse_iterator</code>. As another example, a trie mapping
+ UNICODE strings would have a huge fan-out if each node would
+ branch on a UNICODE character; instead, one can define an
+ iterator iterating over 8-bit (or less) groups.</p></li></ol></div><p>trie is,
+ consequently, parametrized by <code class="classname">E_Access_Traits</code> -
+ traits which instruct how to access sequences' elements.
+ <code class="classname">string_trie_e_access_traits</code>
+ is a traits class for strings. Each such traits define some
+ types, like:</p><pre class="programlisting">
+ typename E_Access_Traits::const_iterator
+ </pre><p>is a const iterator iterating over a key's elements. The
+ traits class must also define methods for obtaining an iterator
+ to the first and last element of a key.</p><p>The graphic below shows a
+ (PATRICIA) trie resulting from inserting the words: "I wish
+ that I could ever see a poem lovely as a trie" (which,
+ unfortunately, does not rhyme).</p><p>The leaf nodes contain values; each internal node contains
+ two <code class="classname">typename E_Access_Traits::const_iterator</code>
+ objects, indicating the maximal common prefix of all keys in
+ the sub-tree. For example, the shaded internal node roots a
+ sub-tree with leafs "a" and "as". The maximal common prefix is
+ "a". The internal node contains, consequently, to const
+ iterators, one pointing to <code class="varname">'a'</code>, and the other to
+ <code class="varname">'s'</code>.</p><div class="figure"><a id="id671313"/><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_pat_trie.png" style="text-align: middle" alt="A PATRICIA trie"/></div></div></div><br class="figure-break"/></div><div class="section" title="Node Invariants"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"/>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
+ tree-based containers. There are two minor
+ differences, though, which, unfortunately, thwart sharing them
+ sharing the same node-updating policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>A trie's <code class="classname">Node_Update</code> template-template
+ parameter is parametrized by <code class="classname">E_Access_Traits</code>, while
+ a tree's <code class="classname">Node_Update</code> template-template parameter is
+ parametrized by <code class="classname">Cmp_Fn</code>.</p></li><li class="listitem"><p>Tree-based containers store values in all nodes, while
+ trie-based containers (at least in this implementation) store
+ values in leafs.</p></li></ol></div><p>The graphic below shows the scheme, as well as some predefined
+ policies (which are explained below).</p><div class="figure"><a id="id671400"/><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_trie_node_updator_policy_cd.png" style="text-align: middle" alt="A trie and its update policy"/></div></div></div><br class="figure-break"/><p>This library offers the following pre-defined trie node
+ updating policies:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ <code class="classname">trie_order_statistics_node_update</code>
+ supports order statistics.
+ </p></li><li class="listitem"><p><code class="classname">trie_prefix_search_node_update</code>
+ supports searching for ranges that match a given prefix.</p></li><li class="listitem"><p><code class="classname">null_node_update</code>
+ is the null node updater.</p></li></ol></div></div><div class="section" title="Split and Join"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.split"/>Split and Join</h6></div></div></div><p>Trie-based containers support split and join methods; the
+ rationale is equal to that of tree-based containers supporting
+ these methods.</p></div></div></div><div class="section" title="List"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.container.list"/>List</h4></div></div></div><div class="section" title="Interface"><div class="titlepage"><div><div><h5 class="title"><a id="container.list.interface"/>Interface</h5></div></div></div><p>The list-based container has the following declaration:</p><pre class="programlisting">
+ template&lt;typename Key,
+ typename Mapped,
+ typename Eq_Fn = std::equal_to&lt;Key&gt;,
+ typename Update_Policy = move_to_front_lu_policy&lt;&gt;,
+ typename Allocator = std::allocator&lt;char&gt; &gt;
+ class list_update;
+ </pre><p>The parameters have the following meaning:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ <code class="classname">Key</code> is the key type.
+ </p></li><li class="listitem"><p>
+ <code class="classname">Mapped</code> is the mapped-policy.
+ </p></li><li class="listitem"><p>
+ <code class="classname">Eq_Fn</code> is a key equivalence functor.
+ </p></li><li class="listitem"><p>
+ <code class="classname">Update_Policy</code> is a policy updating positions in
+ the list based on access patterns. It is described in the
+ following subsection.
+ </p></li><li class="listitem"><p>
+ <code class="classname">Allocator</code> is an allocator type.
+ </p></li></ol></div><p>A list-based associative container is a container that
+ stores elements in a linked-list. It does not order the elements
+ by any particular order related to the keys. List-based
+ containers are primarily useful for creating "multimaps". In fact,
+ list-based containers are designed in this library expressly for
+ this purpose.</p><p>List-based containers might also be useful for some rare
+ cases, where a key is encapsulated to the extent that only
+ key-equivalence can be tested. Hash-based containers need to know
+ how to transform a key into a size type, and tree-based containers
+ need to know if some key is larger than another. List-based
+ associative containers, conversely, only need to know if two keys
+ are equivalent.</p><p>Since a list-based associative container does not order
+ elements by keys, is it possible to order the list in some
+ useful manner? Remarkably, many on-line competitive
+ algorithms exist for reordering lists to reflect access
+ prediction. (See <a class="xref" href="policy_data_structures.html#biblio.motwani95random" title="Randomized Algorithms">[biblio.motwani95random]</a> and <a class="xref" href="policy_data_structures.html#biblio.andrew04mtf" title="MTF, Bit, and COMB: A Guide to Deterministic and Randomized Algorithms for the List Update Problem">[biblio.andrew04mtf]</a>).
+ </p></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.list.details"/>Details</h5></div></div></div><p>
+ </p><div class="section" title="Underlying Data Structure"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.ds"/>Underlying Data Structure</h6></div></div></div><p>The graphic below shows a
+ simple list of integer keys. If we search for the integer 6, we
+ are paying an overhead: the link with key 6 is only the fifth
+ link; if it were the first link, it could be accessed
+ faster.</p><div class="figure"><a id="id671655"/><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_simple_list.png" style="text-align: middle" alt="A simple list"/></div></div></div><br class="figure-break"/><p>List-update algorithms reorder lists as elements are
+ accessed. They try to determine, by the access history, which
+ keys to move to the front of the list. Some of these algorithms
+ require adding some metadata alongside each entry.</p><p>For example, in the graphic below label A shows the counter
+ algorithm. Each node contains both a key and a count metadata
+ (shown in bold). When an element is accessed (e.g. 6) its count is
+ incremented, as shown in label B. If the count reaches some
+ predetermined value, say 10, as shown in label C, the count is set
+ to 0 and the node is moved to the front of the list, as in label
+ D.
+ </p><div class="figure"><a id="id671702"/><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_list_update.png" style="text-align: middle" alt="The counter algorithm"/></div></div></div><br class="figure-break"/></div><div class="section" title="Policies"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"/>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
+ implementing any algorithm moving nodes to the front of the
+ list (policies implementing algorithms interchanging nodes are
+ unsupported).</p><p>Associative containers based on lists are parametrized by a
+ <code class="classname">Update_Policy</code> parameter. This parameter defines the
+ type of metadata each node contains, how to create the
+ metadata, and how to decide, using this metadata, whether to
+ move a node to the front of the list. A list-based associative
+ container object derives (publicly) from its update policy.
+ </p><p>An instantiation of <code class="classname">Update_Policy</code> must define
+ internally <code class="classname">update_metadata</code> as the metadata it
+ requires. Internally, each node of the list contains, besides
+ the usual key and data, an instance of <code class="classname">typename
+ Update_Policy::update_metadata</code>.</p><p>An instantiation of <code class="classname">Update_Policy</code> must define
+ internally two operators:</p><pre class="programlisting">
+ update_metadata
+ operator()();
+
+ bool
+ operator()(update_metadata &amp;);
+ </pre><p>The first is called by the container object, when creating a
+ new node, to create the node's metadata. The second is called
+ by the container object, when a node is accessed (
+ when a find operation's key is equivalent to the key of the
+ node), to determine whether to move the node to the front of
+ the list.
+ </p><p>The library contains two predefined implementations of
+ list-update policies. The first
+ is <code class="classname">lu_counter_policy</code>, which implements the
+ counter algorithm described above. The second is
+ <code class="classname">lu_move_to_front_policy</code>,
+ which unconditionally move an accessed element to the front of
+ the list. The latter type is very useful in this library,
+ since there is no need to associate metadata with each element.
+ (See <a class="xref" href="policy_data_structures.html#biblio.andrew04mtf" title="MTF, Bit, and COMB: A Guide to Deterministic and Randomized Algorithms for the List Update Problem">[biblio.andrew04mtf]</a>
+ </p></div><div class="section" title="Use in Multimaps"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.mapped"/>Use in Multimaps</h6></div></div></div><p>In this library, there are no equivalents for the standard's
+ multimaps and multisets; instead one uses an associative
+ container mapping primary keys to secondary keys.</p><p>List-based containers are especially useful as associative
+ containers for secondary keys. In fact, they are implemented
+ here expressly for this purpose.</p><p>To begin with, these containers use very little per-entry
+ structure memory overhead, since they can be implemented as
+ singly-linked lists. (Arrays use even lower per-entry memory
+ overhead, but they are less flexible in moving around entries,
+ and have weaker invalidation guarantees).</p><p>More importantly, though, list-based containers use very
+ little per-container memory overhead. The memory overhead of an
+ empty list-based container is practically that of a pointer.
+ This is important for when they are used as secondary
+ associative-containers in situations where the average ratio of
+ secondary keys to primary keys is low (or even 1).</p><p>In order to reduce the per-container memory overhead as much
+ as possible, they are implemented as closely as possible to
+ singly-linked lists.</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ List-based containers do not store internally the number
+ of values that they hold. This means that their <code class="function">size</code>
+ method has linear complexity (just like <code class="classname">std::list</code>).
+ Note that finding the number of equivalent-key values in a
+ standard multimap also has linear complexity (because it must be
+ done, via <code class="function">std::distance</code> of the
+ multimap's <code class="function">equal_range</code> method), but usually with
+ higher constants.
+ </p></li><li class="listitem"><p>
+ Most associative-container objects each hold a policy
+ object (a hash-based container object holds a
+ hash functor). List-based containers, conversely, only have
+ class-wide policy objects.
+ </p></li></ol></div></div></div></div><div class="section" title="Priority Queue"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.design.container.priority_queue"/>Priority Queue</h4></div></div></div><div class="section" title="Interface"><div class="titlepage"><div><div><h5 class="title"><a id="container.priority_queue.interface"/>Interface</h5></div></div></div><p>The priority queue container has the following
+ declaration:
+ </p><pre class="programlisting">
+ template&lt;typename Value_Type,
+ typename Cmp_Fn = std::less&lt;Value_Type&gt;,
+ typename Tag = pairing_heap_tag,
+ typename Allocator = std::allocator&lt;char &gt; &gt;
+ class priority_queue;
+ </pre><p>The parameters have the following meaning:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p><code class="classname">Value_Type</code> is the value type.</p></li><li class="listitem"><p><code class="classname">Cmp_Fn</code> is a value comparison functor</p></li><li class="listitem"><p><code class="classname">Tag</code> specifies which underlying data structure
+ to use.</p></li><li class="listitem"><p><code class="classname">Allocator</code> is an allocator
+ type.</p></li></ol></div><p>The <code class="classname">Tag</code> parameter specifies which underlying
+ data structure to use. Instantiating it by<code class="classname">pairing_heap_tag</code>,<code class="classname">binary_heap_tag</code>,
+ <code class="classname">binomial_heap_tag</code>,
+ <code class="classname">rc_binomial_heap_tag</code>,
+ or <code class="classname">thin_heap_tag</code>,
+ specifies, respectively,
+ an underlying pairing heap (<a class="xref" href="policy_data_structures.html#biblio.fredman86pairing" title="The pairing heap: a new form of self-adjusting heap">[biblio.fredman86pairing]</a>),
+ binary heap (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>),
+ binomial heap (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>),
+ a binomial heap with a redundant binary counter (<a class="xref" href="policy_data_structures.html#biblio.maverik_lowerbounds" title="Deamortization - Part 2: Binomial Heaps">[biblio.maverik_lowerbounds]</a>),
+ or a thin heap (<a class="xref" href="policy_data_structures.html#biblio.kt99fat_heaps" title="New Heap Data Structures">[biblio.kt99fat_heaps]</a>).
+ </p><p>
+ As mentioned in the tutorial,
+ <code class="classname">__gnu_pbds::priority_queue</code> shares most of the
+ same interface with <code class="classname">std::priority_queue</code>.
+ E.g. if <code class="varname">q</code> is a priority queue of type
+ <code class="classname">Q</code>, then <code class="function">q.top()</code> will
+ return the "largest" value in the container (according to
+ <code class="classname">typename
+ Q::cmp_fn</code>). <code class="classname">__gnu_pbds::priority_queue</code>
+ has a larger (and very slightly different) interface than
+ <code class="classname">std::priority_queue</code>, however, since typically
+ <code class="classname">push</code> and <code class="classname">pop</code> are deemed
+ insufficient for manipulating priority-queues. </p><p>Different settings require different priority-queue
+ implementations which are described in later; see traits
+ discusses ways to differentiate between the different traits of
+ different implementations.</p></div><div class="section" title="Details"><div class="titlepage"><div><div><h5 class="title"><a id="container.priority_queue.details"/>Details</h5></div></div></div><div class="section" title="Iterators"><div class="titlepage"><div><div><h6 class="title"><a id="container.priority_queue.details.iterators"/>Iterators</h6></div></div></div><p>There are many different underlying-data structures for
+ implementing priority queues. Unfortunately, most such
+ structures are oriented towards making <code class="function">push</code> and
+ <code class="function">top</code> efficient, and consequently don't allow efficient
+ access of other elements: for instance, they cannot support an efficient
+ <code class="function">find</code> method. In the use case where it
+ is important to both access and "do something with" an
+ arbitrary value, one would be out of luck. For example, many graph algorithms require
+ modifying a value (typically increasing it in the sense of the
+ priority queue's comparison functor).</p><p>In order to access and manipulate an arbitrary value in a
+ priority queue, one needs to reference the internals of the
+ priority queue from some form of an associative container -
+ this is unavoidable. Of course, in order to maintain the
+ encapsulation of the priority queue, this needs to be done in a
+ way that minimizes exposure to implementation internals.</p><p>In this library the priority queue's <code class="function">insert</code>
+ method returns an iterator, which if valid can be used for subsequent <code class="function">modify</code> and
+ <code class="function">erase</code> operations. This both preserves the priority
+ queue's encapsulation, and allows accessing arbitrary values (since the
+ returned iterators from the <code class="function">push</code> operation can be
+ stored in some form of associative container).</p><p>Priority queues' iterators present a problem regarding their
+ invalidation guarantees. One assumes that calling
+ <code class="function">operator++</code> on an iterator will associate it
+ with the "next" value. Priority-queues are
+ self-organizing: each operation changes what the "next" value
+ means. Consequently, it does not make sense that <code class="function">push</code>
+ will return an iterator that can be incremented - this can have
+ no possible use. Also, as in the case of hash-based containers,
+ it is awkward to define if a subsequent <code class="function">push</code> operation
+ invalidates a prior returned iterator: it invalidates it in the
+ sense that its "next" value is not related to what it
+ previously considered to be its "next" value. However, it might not
+ invalidate it, in the sense that it can be
+ de-referenced and used for <code class="function">modify</code> and <code class="function">erase</code>
+ operations.</p><p>Similarly to the case of the other unordered associative
+ containers, this library uses a distinction between
+ point-type and range type iterators. A priority queue's <code class="classname">iterator</code> can always be
+ converted to a <code class="classname">point_iterator</code>, and a
+ <code class="classname">const_iterator</code> can always be converted to a
+ <code class="classname">point_const_iterator</code>.</p><p>The following snippet demonstrates manipulating an arbitrary
+ value:</p><pre class="programlisting">
+ // A priority queue of integers.
+ priority_queue&lt;int &gt; p;
+
+ // Insert some values into the priority queue.
+ priority_queue&lt;int &gt;::point_iterator it = p.push(0);
+
+ p.push(1);
+ p.push(2);
+
+ // Now modify a value.
+ p.modify(it, 3);
+
+ assert(p.top() == 3);
+ </pre><p>It should be noted that an alternative design could embed an
+ associative container in a priority queue. Could, but most
+ probably should not. To begin with, it should be noted that one
+ could always encapsulate a priority queue and an associative
+ container mapping values to priority queue iterators with no
+ performance loss. One cannot, however, "un-encapsulate" a priority
+ queue embedding an associative container, which might lead to
+ performance loss. Assume, that one needs to associate each value
+ with some data unrelated to priority queues. Then using
+ this library's design, one could use an
+ associative container mapping each value to a pair consisting of
+ this data and a priority queue's iterator. Using the embedded
+ method would need to use two associative containers. Similar
+ problems might arise in cases where a value can reside
+ simultaneously in many priority queues.</p></div><div class="section" title="Underlying Data Structure"><div class="titlepage"><div><div><h6 class="title"><a id="container.priority_queue.details.d"/>Underlying Data Structure</h6></div></div></div><p>There are three main implementations of priority queues: the
+ first employs a binary heap, typically one which uses a
+ sequence; the second uses a tree (or forest of trees), which is
+ typically less structured than an associative container's tree;
+ the third simply uses an associative container. These are
+ shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="id672233"/><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" style="text-align: middle" alt="Underlying Priority-Queue Data-Structures."/></div></div></div><br class="figure-break"/><p>Roughly speaking, any value that is both pushed and popped
+ from a priority queue must incur a logarithmic expense (in the
+ amortized sense). Any priority queue implementation that would
+ avoid this, would violate known bounds on comparison-based
+ sorting (see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a> and <a class="xref" href="policy_data_structures.html#biblio.brodal96priority" title="Worst-case efficient priority queues">[biblio.brodal96priority]</a>).
+ </p><p>Most implementations do
+ not differ in the asymptotic amortized complexity of
+ <code class="function">push</code> and <code class="function">pop</code> operations, but they differ in
+ the constants involved, in the complexity of other operations
+ (e.g., <code class="function">modify</code>), and in the worst-case
+ complexity of single operations. In general, the more
+ "structured" an implementation (i.e., the more internal
+ invariants it possesses) - the higher its amortized complexity
+ of <code class="function">push</code> and <code class="function">pop</code> operations.</p><p>This library implements different algorithms using a
+ single class: <code class="classname">priority_queue</code>.
+ Instantiating the <code class="classname">Tag</code> template parameter, "selects"
+ the implementation:</p><div class="orderedlist"><ol class="orderedlist"><li class="listitem"><p>
+ Instantiating <code class="classname">Tag = binary_heap_tag</code> creates
+ a binary heap of the form in represented in the graphic with labels A1 or A2. The former is internally
+ selected by priority_queue
+ if <code class="classname">Value_Type</code> is instantiated by a primitive type
+ (e.g., an <span class="type">int</span>); the latter is
+ internally selected for all other types (e.g.,
+ <code class="classname">std::string</code>). This implementations is relatively
+ unstructured, and so has good <code class="classname">push</code> and <code class="classname">pop</code>
+ performance; it is the "best-in-kind" for primitive
+ types, e.g., <span class="type">int</span>s. Conversely, it has
+ high worst-case performance, and can support only linear-time
+ <code class="function">modify</code> and <code class="function">erase</code> operations.</p></li><li class="listitem"><p>Instantiating <code class="classname">Tag =
+ pairing_heap_tag</code> creates a pairing heap of the form
+ in represented by label B in the graphic above. This
+ implementations too is relatively unstructured, and so has good
+ <code class="function">push</code> and <code class="function">pop</code>
+ performance; it is the "best-in-kind" for non-primitive types,
+ e.g., <code class="classname">std:string</code>s. It also has very good
+ worst-case <code class="function">push</code> and
+ <code class="function">join</code> performance (O(1)), but has high
+ worst-case <code class="function">pop</code>
+ complexity.</p></li><li class="listitem"><p>Instantiating <code class="classname">Tag =
+ binomial_heap_tag</code> creates a binomial heap of the
+ form repsented by label B in the graphic above. This
+ implementations is more structured than a pairing heap, and so
+ has worse <code class="function">push</code> and <code class="function">pop</code>
+ performance. Conversely, it has sub-linear worst-case bounds for
+ <code class="function">pop</code>, e.g., and so it might be preferred in
+ cases where responsiveness is important.</p></li><li class="listitem"><p>Instantiating <code class="classname">Tag =
+ rc_binomial_heap_tag</code> creates a binomial heap of the
+ form represented in label B above, accompanied by a redundant
+ counter which governs the trees. This implementations is
+ therefore more structured than a binomial heap, and so has worse
+ <code class="function">push</code> and <code class="function">pop</code>
+ performance. Conversely, it guarantees O(1)
+ <code class="function">push</code> complexity, and so it might be
+ preferred in cases where the responsiveness of a binomial heap
+ is insufficient.</p></li><li class="listitem"><p>Instantiating <code class="classname">Tag =
+ thin_heap_tag</code> creates a thin heap of the form
+ represented by the label B in the graphic above. This
+ implementations too is more structured than a pairing heap, and
+ so has worse <code class="function">push</code> and
+ <code class="function">pop</code> performance. Conversely, it has better
+ worst-case and identical amortized complexities than a Fibonacci
+ heap, and so might be more appropriate for some graph
+ algorithms.</p></li></ol></div><p>Of course, one can use any order-preserving associative
+ container as a priority queue, as in the graphic above label C, possibly by creating an adapter class
+ over the associative container (much as
+ <code class="classname">std::priority_queue</code> can adapt <code class="classname">std::vector</code>).
+ This has the advantage that no cross-referencing is necessary
+ at all; the priority queue itself is an associative container.
+ Most associative containers are too structured to compete with
+ priority queues in terms of <code class="function">push</code> and <code class="function">pop</code>
+ performance.</p></div><div class="section" title="Traits"><div class="titlepage"><div><div><h6 class="title"><a id="container.priority_queue.details.traits"/>Traits</h6></div></div></div><p>It would be nice if all priority queues could
+ share exactly the same behavior regardless of implementation. Sadly, this is not possible. Just one for instance is in join operations: joining
+ two binary heaps might throw an exception (not corrupt
+ any of the heaps on which it operates), but joining two pairing
+ heaps is exception free.</p><p>Tags and traits are very useful for manipulating generic
+ types. <code class="classname">__gnu_pbds::priority_queue</code>
+ publicly defines <code class="classname">container_category</code> as one of the tags. Given any
+ container <code class="classname">Cntnr</code>, the tag of the underlying
+ data structure can be found via <code class="classname">typename
+ Cntnr::container_category</code>; this is one of the possible tags shown in the graphic below.
+ </p><div class="figure"><a id="id672525"/><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" style="text-align: middle" alt="Priority-Queue Data-Structure Tags."/></div></div></div><br class="figure-break"/><p>Additionally, a traits mechanism can be used to query a
+ container type for its attributes. Given any container
+ <code class="classname">Cntnr</code>, then </p><pre class="programlisting">__gnu_pbds::container_traits&lt;Cntnr&gt;</pre><p>
+ is a traits class identifying the properties of the
+ container.</p><p>To find if a container might throw if two of its objects are
+ joined, one can use
+ </p><pre class="programlisting">
+ container_traits&lt;Cntnr&gt;::split_join_can_throw
+ </pre><p>
+ </p><p>
+ Different priority-queue implementations have different invalidation guarantees. This is
+ especially important, since there is no way to access an arbitrary
+ value of priority queues except for iterators. Similarly to
+ associative containers, one can use
+ </p><pre class="programlisting">
+ container_traits&lt;Cntnr&gt;::invalidation_guarantee
+ </pre><p>
+ to get the invalidation guarantee type of a priority queue.</p><p>It is easy to understand from the graphic above, what <code class="classname">container_traits&lt;Cntnr&gt;::invalidation_guarantee</code>
+ will be for different implementations. All implementations of
+ type represented by label B have <code class="classname">point_invalidation_guarantee</code>:
+ the container can freely internally reorganize the nodes -
+ range-type iterators are invalidated, but point-type iterators
+ are always valid. Implementations of type represented by labels A1 and A2 have <code class="classname">basic_invalidation_guarantee</code>:
+ the container can freely internally reallocate the array - both
+ point-type and range-type iterators might be invalidated.</p><p>
+ This has major implications, and constitutes a good reason to avoid
+ using binary heaps. A binary heap can perform <code class="function">modify</code>
+ or <code class="function">erase</code> efficiently given a valid point-type
+ iterator. However, in order to supply it with a valid point-type
+ iterator, one needs to iterate (linearly) over all
+ values, then supply the relevant iterator (recall that a
+ range-type iterator can always be converted to a point-type
+ iterator). This means that if the number of <code class="function">modify</code> or
+ <code class="function">erase</code> operations is non-negligible (say
+ super-logarithmic in the total sequence of operations) - binary
+ heaps will perform badly.
+ </p></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="policy_data_structures_using.html">Prev</a> </td><td align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td align="right"> <a accesskey="n" href="policy_based_data_structures_test.html">Next</a></td></tr><tr><td align="left" valign="top">Using </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Testing</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures_using.html b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
new file mode 100644
index 00000000000..0e2fdb3d1c4
--- /dev/null
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures_using.html
@@ -0,0 +1,483 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;&#9;ISO C++&#10; , &#10;&#9;policy&#10; , &#10;&#9;container&#10; , &#10;&#9;data&#10; , &#10;&#9;structure&#10; , &#10;&#9;associated&#10; , &#10;&#9;tree&#10; , &#10;&#9;trie&#10; , &#10;&#9;hash&#10; , &#10;&#9;metaprogramming&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/><link rel="prev" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures"/><link rel="next" href="policy_data_structures_design.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr></table><hr/></div><div class="section" title="Using"><div class="titlepage"><div><div><h2 class="title"><a id="containers.pbds.using"/>Using</h2></div></div></div><div class="section" title="Prerequisites"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.prereq"/>Prerequisites</h3></div></div></div><p>The library contains only header files, and does not require any
+ other libraries except the standard C++ library . All classes are
+ defined in namespace <code class="code">__gnu_pbds</code>. The library internally
+ uses macros beginning with <code class="code">PB_DS</code>, but
+ <code class="code">#undef</code>s anything it <code class="code">#define</code>s (except for
+ header guards). Compiling the library in an environment where macros
+ beginning in <code class="code">PB_DS</code> are defined, may yield unpredictable
+ results in compilation, execution, or both.</p><p>
+ Further dependencies are necessary to create the visual output
+ for the performance tests. To create these graphs, an
+ additional package is needed: <span class="command"><strong>pychart</strong></span>.
+ </p></div><div class="section" title="Organization"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.organization"/>Organization</h3></div></div></div><p>
+ The various data structures are organized as follows.
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Branch-Based
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <code class="classname">basic_branch</code>
+ is an abstract base class for branched-based
+ associative-containers
+ </p></li><li class="listitem"><p>
+ <code class="classname">tree</code>
+ is a concrete base class for tree-based
+ associative-containers
+ </p></li><li class="listitem"><p>
+ <code class="classname">trie</code>
+ is a concrete base class trie-based
+ associative-containers
+ </p></li></ul></div></li><li class="listitem"><p>
+ Hash-Based
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <code class="classname">basic_hash_table</code>
+ is an abstract base class for hash-based
+ associative-containers
+ </p></li><li class="listitem"><p>
+ <code class="classname">cc_hash_table</code>
+ is a concrete collision-chaining hash-based
+ associative-containers
+ </p></li><li class="listitem"><p>
+ <code class="classname">gp_hash_table</code>
+ is a concrete (general) probing hash-based
+ associative-containers
+ </p></li></ul></div></li><li class="listitem"><p>
+ List-Based
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <code class="classname">list_update</code>
+ list-based update-policy associative container
+ </p></li></ul></div></li><li class="listitem"><p>
+ Heap-Based
+ </p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ <code class="classname">priority_queue</code>
+ A priority queue.
+ </p></li></ul></div></li></ul></div><p>
+ The hierarchy is composed naturally so that commonality is
+ captured by base classes. Thus <code class="function">operator[]</code>
+ is defined at the base of any hierarchy, since all derived
+ containers support it. Conversely <code class="function">split</code> is
+ defined in <code class="classname">basic_branch</code>, since only
+ tree-like containers support it.
+ </p><p>
+ In addition, there are the following diagnostics classes,
+ used to report errors specific to this library's data
+ structures.
+ </p><div class="figure"><a id="id665824"/><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" style="text-align: center"><img src="../images/pbds_exception_hierarchy.png" style="text-align: middle" alt="Exception Hierarchy"/></div></div></div><br class="figure-break"/></div><div class="section" title="Tutorial"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"/>Tutorial</h3></div></div></div><div class="section" title="Basic Use"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"/>Basic Use</h4></div></div></div><p>
+ For the most part, the policy-based containers containers in
+ namespace <code class="literal">__gnu_pbds</code> have the same interface as
+ the equivalent containers in the standard C++ library, except for
+ the names used for the container classes themselves. For example,
+ this shows basic operations on a collision-chaining hash-based
+ container:
+ </p><pre class="programlisting">
+ #include &lt;ext/pb_ds/assoc_container.h&gt;
+
+ int main()
+ {
+ __gnu_pbds::cc_hash_table&lt;int, char&gt; c;
+ c[2] = 'b';
+ assert(c.find(1) == c.end());
+ };
+ </pre><p>
+ The container is called
+ <code class="classname">__gnu_pbds::cc_hash_table</code> instead of
+ <code class="classname">std::unordered_map</code>, since <span class="quote">“<span class="quote">unordered
+ map</span>”</span> does not necessarily mean a hash-based map as implied by
+ the C++ library (C++0x or TR1). For example, list-based associative
+ containers, which are very useful for the construction of
+ "multimaps," are also unordered.
+ </p><p>This snippet shows a red-black tree based container:</p><pre class="programlisting">
+ #include &lt;ext/pb_ds/assoc_container.h&gt;
+
+ int main()
+ {
+ __gnu_pbds::tree&lt;int, char&gt; c;
+ c[2] = 'b';
+ assert(c.find(2) != c.end());
+ };
+ </pre><p>The container is called <code class="classname">tree</code> instead of
+ <code class="classname">map</code> since the underlying data structures are
+ being named with specificity.
+ </p><p>
+ The member function naming convention is to strive to be the same as
+ the equivalent member functions in other C++ standard library
+ containers. The familiar methods are unchanged:
+ <code class="function">begin</code>, <code class="function">end</code>,
+ <code class="function">size</code>, <code class="function">empty</code>, and
+ <code class="function">clear</code>.
+ </p><p>
+ This isn't to say that things are exactly as one would expect, given
+ the container requirments and interfaces in the C++ standard.
+ </p><p>
+ The names of containers' policies and policy accessors are
+ different then the usual. For example, if <span class="type">hash_type</span> is
+ some type of hash-based container, then</p><pre class="programlisting">
+ hash_type::hash_fn
+ </pre><p>
+ gives the type of its hash functor, and if <code class="varname">obj</code> is
+ some hash-based container object, then
+ </p><pre class="programlisting">
+ obj.get_hash_fn()
+ </pre><p>will return a reference to its hash-functor object.</p><p>
+ Similarly, if <span class="type">tree_type</span> is some type of tree-based
+ container, then
+ </p><pre class="programlisting">
+ tree_type::cmp_fn
+ </pre><p>
+ gives the type of its comparison functor, and if
+ <code class="varname">obj</code> is some tree-based container object,
+ then
+ </p><pre class="programlisting">
+ obj.get_cmp_fn()
+ </pre><p>will return a reference to its comparison-functor object.</p><p>
+ It would be nice to give names consistent with those in the existing
+ C++ standard (inclusive of TR1). Unfortunately, these standard
+ containers don't consistently name types and methods. For example,
+ <code class="classname">std::tr1::unordered_map</code> uses
+ <span class="type">hasher</span> for the hash functor, but
+ <code class="classname">std::map</code> uses <span class="type">key_compare</span> for
+ the comparison functor. Also, we could not find an accessor for
+ <code class="classname">std::tr1::unordered_map</code>'s hash functor, but
+ <code class="classname">std::map</code> uses <code class="classname">compare</code>
+ for accessing the comparison functor.
+ </p><p>
+ Instead, <code class="literal">__gnu_pbds</code> attempts to be internally
+ consistent, and uses standard-derived terminology if possible.
+ </p><p>
+ Another source of difference is in scope:
+ <code class="literal">__gnu_pbds</code> contains more types of associative
+ containers than the standard C++ library, and more opportunities
+ to configure these new containers, since different types of
+ associative containers are useful in different settings.
+ </p><p>
+ Namespace <code class="literal">__gnu_pbds</code> contains different classes for
+ hash-based containers, tree-based containers, trie-based containers,
+ and list-based containers.
+ </p><p>
+ Since associative containers share parts of their interface, they
+ are organized as a class hierarchy.
+ </p><p>Each type or method is defined in the most-common ancestor
+ in which it makes sense.
+ </p><p>For example, all associative containers support iteration
+ expressed in the following form:
+ </p><pre class="programlisting">
+ const_iterator
+ begin() const;
+
+ iterator
+ begin();
+
+ const_iterator
+ end() const;
+
+ iterator
+ end();
+ </pre><p>
+ But not all containers contain or use hash functors. Yet, both
+ collision-chaining and (general) probing hash-based associative
+ containers have a hash functor, so
+ <code class="classname">basic_hash_table</code> contains the interface:
+ </p><pre class="programlisting">
+ const hash_fn&amp;
+ get_hash_fn() const;
+
+ hash_fn&amp;
+ get_hash_fn();
+ </pre><p>
+ so all hash-based associative containers inherit the same
+ hash-functor accessor methods.
+ </p></div><div class="section" title="Configuring via Template Parameters"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.configuring"/>
+ Configuring via Template Parameters
+ </h4></div></div></div><p>
+ In general, each of this library's containers is
+ parametrized by more policies than those of the standard library. For
+ example, the standard hash-based container is parametrized as
+ follows:
+ </p><pre class="programlisting">
+ template&lt;typename Key, typename Mapped, typename Hash,
+ typename Pred, typename Allocator, bool Cache_Hashe_Code&gt;
+ class unordered_map;
+ </pre><p>
+ and so can be configured by key type, mapped type, a functor
+ that translates keys to unsigned integral types, an equivalence
+ predicate, an allocator, and an indicator whether to store hash
+ values with each entry. this library's collision-chaining
+ hash-based container is parametrized as
+ </p><pre class="programlisting">
+ template&lt;typename Key, typename Mapped, typename Hash_Fn,
+ typename Eq_Fn, typename Comb_Hash_Fn,
+ typename Resize_Policy, bool Store_Hash
+ typename Allocator&gt;
+ class cc_hash_table;
+ </pre><p>
+ and so can be configured by the first four types of
+ <code class="classname">std::tr1::unordered_map</code>, then a
+ policy for translating the key-hash result into a position
+ within the table, then a policy by which the table resizes,
+ an indicator whether to store hash values with each entry,
+ and an allocator (which is typically the last template
+ parameter in standard containers).
+ </p><p>
+ Nearly all policy parameters have default values, so this
+ need not be considered for casual use. It is important to
+ note, however, that hash-based containers' policies can
+ dramatically alter their performance in different settings,
+ and that tree-based containers' policies can make them
+ useful for other purposes than just look-up.
+ </p><p>As opposed to associative containers, priority queues have
+ relatively few configuration options. The priority queue is
+ parametrized as follows:</p><pre class="programlisting">
+ template&lt;typename Value_Type, typename Cmp_Fn,typename Tag,
+ typename Allocator&gt;
+ class priority_queue;
+ </pre><p>The <code class="classname">Value_Type</code>, <code class="classname">Cmp_Fn</code>, and
+ <code class="classname">Allocator</code> parameters are the container's value type,
+ comparison-functor type, and allocator type, respectively;
+ these are very similar to the standard's priority queue. The
+ <code class="classname">Tag</code> parameter is different: there are a number of
+ pre-defined tag types corresponding to binary heaps, binomial
+ heaps, etc., and <code class="classname">Tag</code> should be instantiated
+ by one of them.</p><p>Note that as opposed to the
+ <code class="classname">std::priority_queue</code>,
+ <code class="classname">__gnu_pbds::priority_queue</code> is not a
+ sequence-adapter; it is a regular container.</p></div><div class="section" title="Querying Container Attributes"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.traits"/>
+ Querying Container Attributes
+ </h4></div></div></div><p/><p>A containers underlying data structure
+ affect their performance; Unfortunately, they can also affect
+ their interface. When manipulating generically associative
+ containers, it is often useful to be able to statically
+ determine what they can support and what the cannot.
+ </p><p>Happily, the standard provides a good solution to a similar
+ problem - that of the different behavior of iterators. If
+ <code class="classname">It</code> is an iterator, then
+ </p><pre class="programlisting">
+ typename std::iterator_traits&lt;It&gt;::iterator_category
+ </pre><p>is one of a small number of pre-defined tag classes, and
+ </p><pre class="programlisting">
+ typename std::iterator_traits&lt;It&gt;::value_type
+ </pre><p>is the value type to which the iterator "points".</p><p>
+ Similarly, in this library, if <span class="type">C</span> is a
+ container, then <code class="classname">container_traits</code> is a
+ trait class that stores information about the kind of
+ container that is implemented.
+ </p><pre class="programlisting">
+ typename container_traits&lt;C&gt;::container_category
+ </pre><p>
+ is one of a small number of predefined tag structures that
+ uniquely identifies the type of underlying data structure.
+ </p><p>In most cases, however, the exact underlying data
+ structure is not really important, but what is important is
+ one of its other attributes: whether it guarantees storing
+ elements by key order, for example. For this one can
+ use</p><pre class="programlisting">
+ typename container_traits&lt;C&gt;::order_preserving
+ </pre><p>
+ Also,
+ </p><pre class="programlisting">
+ typename container_traits&lt;C&gt;::invalidation_guarantee
+ </pre><p>is the container's invalidation guarantee. Invalidation
+ guarantees are especially important regarding priority queues,
+ since in this library's design, iterators are practically the
+ only way to manipulate them.</p></div><div class="section" title="Point and Range Iteration"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.point_range_iteration"/>
+ Point and Range Iteration
+ </h4></div></div></div><p/><p>This library differentiates between two types of methods
+ and iterators: point-type, and range-type. For example,
+ <code class="function">find</code> and <code class="function">insert</code> are point-type methods, since
+ they each deal with a specific element; their returned
+ iterators are point-type iterators. <code class="function">begin</code> and
+ <code class="function">end</code> are range-type methods, since they are not used to
+ find a specific element, but rather to go over all elements in
+ a container object; their returned iterators are range-type
+ iterators.
+ </p><p>Most containers store elements in an order that is
+ determined by their interface. Correspondingly, it is fine that
+ their point-type iterators are synonymous with their range-type
+ iterators. For example, in the following snippet
+ </p><pre class="programlisting">
+ std::for_each(c.find(1), c.find(5), foo);
+ </pre><p>
+ two point-type iterators (returned by <code class="function">find</code>) are used
+ for a range-type purpose - going over all elements whose key is
+ between 1 and 5.
+ </p><p>
+ Conversely, the above snippet makes no sense for
+ self-organizing containers - ones that order (and reorder)
+ their elements by implementation. It would be nice to have a
+ uniform iterator system that would allow the above snippet to
+ compile only if it made sense.
+ </p><p>
+ This could trivially be done by specializing
+ <code class="function">std::for_each</code> for the case of iterators returned by
+ <code class="classname">std::tr1::unordered_map</code>, but this would only solve the
+ problem for one algorithm and one container. Fundamentally, the
+ problem is that one can loop using a self-organizing
+ container's point-type iterators.
+ </p><p>
+ This library's containers define two families of
+ iterators: <span class="type">point_const_iterator</span> and
+ <span class="type">point_iterator</span> are the iterator types returned by
+ point-type methods; <span class="type">const_iterator</span> and
+ <span class="type">iterator</span> are the iterator types returned by range-type
+ methods.
+ </p><pre class="programlisting">
+ class &lt;- some container -&gt;
+ {
+ public:
+ ...
+
+ typedef &lt;- something -&gt; const_iterator;
+
+ typedef &lt;- something -&gt; iterator;
+
+ typedef &lt;- something -&gt; point_const_iterator;
+
+ typedef &lt;- something -&gt; point_iterator;
+
+ ...
+
+ public:
+ ...
+
+ const_iterator begin () const;
+
+ iterator begin();
+
+ point_const_iterator find(...) const;
+
+ point_iterator find(...);
+ };
+ </pre><p>For
+ containers whose interface defines sequence order , it
+ is very simple: point-type and range-type iterators are exactly
+ the same, which means that the above snippet will compile if it
+ is used for an order-preserving associative container.
+ </p><p>
+ For self-organizing containers, however, (hash-based
+ containers as a special example), the preceding snippet will
+ not compile, because their point-type iterators do not support
+ <code class="function">operator++</code>.
+ </p><p>In any case, both for order-preserving and self-organizing
+ containers, the following snippet will compile:
+ </p><pre class="programlisting">
+ typename Cntnr::point_iterator it = c.find(2);
+ </pre><p>
+ because a range-type iterator can always be converted to a
+ point-type iterator.
+ </p><p>Distingushing between iterator types also
+ raises the point that a container's iterators might have
+ different invalidation rules concerning their de-referencing
+ abilities and movement abilities. This now corresponds exactly
+ to the question of whether point-type and range-type iterators
+ are valid. As explained above, <code class="classname">container_traits</code> allows
+ querying a container for its data structure attributes. The
+ iterator-invalidation guarantees are certainly a property of
+ the underlying data structure, and so
+ </p><pre class="programlisting">
+ container_traits&lt;C&gt;::invalidation_guarantee
+ </pre><p>
+ gives one of three pre-determined types that answer this
+ query.
+ </p></div></div><div class="section" title="Examples"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.examples"/>Examples</h3></div></div></div><p>
+ Additional code examples are provided in the source
+ distribution, as part of the regression and performance
+ testsuite.
+ </p><div class="section" title="Intermediate Use"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.examples.basic"/>Intermediate Use</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Basic use of maps:
+ <code class="filename">basic_map.cc</code>
+ </p></li><li class="listitem"><p>
+ Basic use of sets:
+ <code class="filename">basic_set.cc</code>
+ </p></li><li class="listitem"><p>
+ Conditionally erasing values from an associative container object:
+ <code class="filename">erase_if.cc</code>
+ </p></li><li class="listitem"><p>
+ Basic use of multimaps:
+ <code class="filename">basic_multimap.cc</code>
+ </p></li><li class="listitem"><p>
+ Basic use of multisets:
+ <code class="filename">basic_multiset.cc</code>
+ </p></li><li class="listitem"><p>
+ Basic use of priority queues:
+ <code class="filename">basic_priority_queue.cc</code>
+ </p></li><li class="listitem"><p>
+ Splitting and joining priority queues:
+ <code class="filename">priority_queue_split_join.cc</code>
+ </p></li><li class="listitem"><p>
+ Conditionally erasing values from a priority queue:
+ <code class="filename">priority_queue_erase_if.cc</code>
+ </p></li></ul></div></div><div class="section" title="Querying with container_traits"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.examples.query"/>Querying with <code class="classname">container_traits</code> </h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Using <code class="classname">container_traits</code> to query
+ about underlying data structure behavior:
+ <code class="filename">assoc_container_traits.cc</code>
+ </p></li><li class="listitem"><p>
+ A non-compiling example showing wrong use of finding keys in
+ hash-based containers: <code class="filename">hash_find_neg.cc</code>
+ </p></li><li class="listitem"><p>
+ Using <code class="classname">container_traits</code>
+ to query about underlying data structure behavior:
+ <code class="filename">priority_queue_container_traits.cc</code>
+ </p></li></ul></div></div><div class="section" title="By Container Method"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.examples.container"/>By Container Method</h4></div></div></div><p/><div class="section" title="Hash-Based"><div class="titlepage"><div><div><h5 class="title"><a id="pbds.using.examples.container.hash"/>Hash-Based</h5></div></div></div><div class="section" title="size Related"><div class="titlepage"><div><div><h6 class="title"><a id="pbds.using.examples.container.hash.resize"/>size Related</h6></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Setting the initial size of a hash-based container
+ object:
+ <code class="filename">hash_initial_size.cc</code>
+ </p></li><li class="listitem"><p>
+ A non-compiling example showing how not to resize a
+ hash-based container object:
+ <code class="filename">hash_resize_neg.cc</code>
+ </p></li><li class="listitem"><p>
+ Resizing the size of a hash-based container object:
+ <code class="filename">hash_resize.cc</code>
+ </p></li><li class="listitem"><p>
+ Showing an illegal resize of a hash-based container
+ object:
+ <code class="filename">hash_illegal_resize.cc</code>
+ </p></li><li class="listitem"><p>
+ Changing the load factors of a hash-based container
+ object: <code class="filename">hash_load_set_change.cc</code>
+ </p></li></ul></div></div><div class="section" title="Hashing Function Related"><div class="titlepage"><div><div><h6 class="title"><a id="pbds.using.examples.container.hash.hashor"/>Hashing Function Related</h6></div></div></div><p/><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Using a modulo range-hashing function for the case of an
+ unknown skewed key distribution:
+ <code class="filename">hash_mod.cc</code>
+ </p></li><li class="listitem"><p>
+ Writing a range-hashing functor for the case of a known
+ skewed key distribution:
+ <code class="filename">shift_mask.cc</code>
+ </p></li><li class="listitem"><p>
+ Storing the hash value along with each key:
+ <code class="filename">store_hash.cc</code>
+ </p></li><li class="listitem"><p>
+ Writing a ranged-hash functor:
+ <code class="filename">ranged_hash.cc</code>
+ </p></li></ul></div></div></div><div class="section" title="Branch-Based"><div class="titlepage"><div><div><h5 class="title"><a id="pbds.using.examples.container.branch"/>Branch-Based</h5></div></div></div><div class="section" title="split or join Related"><div class="titlepage"><div><div><h6 class="title"><a id="pbds.using.examples.container.branch.split"/>split or join Related</h6></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Joining two tree-based container objects:
+ <code class="filename">tree_join.cc</code>
+ </p></li><li class="listitem"><p>
+ Splitting a PATRICIA trie container object:
+ <code class="filename">trie_split.cc</code>
+ </p></li><li class="listitem"><p>
+ Order statistics while joining two tree-based container
+ objects:
+ <code class="filename">tree_order_statistics_join.cc</code>
+ </p></li></ul></div></div><div class="section" title="Node Invariants"><div class="titlepage"><div><div><h6 class="title"><a id="pbds.using.examples.container.branch.invariants"/>Node Invariants</h6></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Using trees for order statistics:
+ <code class="filename">tree_order_statistics.cc</code>
+ </p></li><li class="listitem"><p>
+ Augmenting trees to support operations on line
+ intervals:
+ <code class="filename">tree_intervals.cc</code>
+ </p></li></ul></div></div><div class="section" title="trie"><div class="titlepage"><div><div><h6 class="title"><a id="pbds.using.examples.container.branch.trie"/>trie</h6></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Using a PATRICIA trie for DNA strings:
+ <code class="filename">trie_dna.cc</code>
+ </p></li><li class="listitem"><p>
+ Using a PATRICIA
+ trie for finding all entries whose key matches a given prefix:
+ <code class="filename">trie_prefix_search.cc</code>
+ </p></li></ul></div></div></div><div class="section" title="Priority Queues"><div class="titlepage"><div><div><h5 class="title"><a id="pbds.using.examples.container.priority_queue"/>Priority Queues</h5></div></div></div><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>
+ Cross referencing an associative container and a priority
+ queue: <code class="filename">priority_queue_xref.cc</code>
+ </p></li><li class="listitem"><p>
+ Cross referencing a vector and a priority queue using a
+ very simple version of Dijkstra's shortest path
+ algorithm:
+ <code class="filename">priority_queue_dijkstra.cc</code>
+ </p></li></ul></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><td align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 22. Policy-Based Data Structures </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html
index 1c1c5990249..2543fdb0c86 100644
--- a/libstdc++-v3/doc/html/manual/profile_mode.html
+++ b/libstdc++-v3/doc/html/manual/profile_mode.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 19. Profile Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch18s05.html" title="Testing"/><link rel="next" href="bk01pt03ch19s02.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Profile Mode</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s05.html">Prev</a> </td><th width="60%" align="center">Part III. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 19. Profile Mode</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="extensions.html" title="Part III.  Extensions"/><link rel="prev" href="bk01pt03ch18s05.html" title="Testing"/><link rel="next" href="bk01pt03ch19s02.html" title="Design"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Profile Mode</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s05.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions
-</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 19. Profile Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode"/>Chapter 19. Profile Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></div><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.intro"/>Intro</h2></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="bk01pt03ch19s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 19. Profile Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode"/>Chapter 19. Profile Mode</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_small">Hashtable Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_too_large">Hashtable Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.inefficient_hash">Inefficient Hash</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_small">Vector Too Small</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_too_large">Vector Too Large</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_hashtable">Vector to Hashtable</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.hashtable_to_vector">Hashtable to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.vector_to_list">Vector to List</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_vector">List to Vector</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.list_to_slist">List to Forward List (Slist)</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.assoc_ord_to_unord">Ordered to Unordered Associative Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms.sort">Sort Algorithm Performance</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.sw_prefetch">Need Software Prefetch</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality.linked">Linked Structure Locality</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.ddtest">Data Dependence Violations at Container Level</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread.false_share">False Sharing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></div><div class="section" title="Intro"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.profile_mode.intro"/>Intro</h2></div></div></div><p>
<span class="emphasis"><em>Goal: </em></span>Give performance improvement advice based on
recognition of suboptimal usage patterns of the standard library.
</p><p>
@@ -138,9 +138,9 @@ vector-size: improvement = 3: call stack = 0x804842c ...
call context.
(Environment variable not supported.)
</p></li></ul></div><p>
- </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id480224"/><p><span class="citetitle"><em class="citetitle">
+ </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"/>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id662399"/><p><span class="citetitle"><em class="citetitle">
Perflint: A Context Sensitive Performance Advisor for C++ Programs
</em>. </span><span class="author"><span class="firstname">Lixia</span> <span class="surname">Liu</span>. </span><span class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span>. </span><span class="copyright">Copyright © 2009 . </span><span class="publisher"><span class="publishername">
Proceedings of the 2009 International Symposium on Code Generation
and Optimization
- . </span></span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s05.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s02.html">Next</a></td></tr><tr><td align="left" valign="top">Testing </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
+ . </span></span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt03ch18s05.html">Prev</a> </td><td align="center"><a accesskey="u" href="extensions.html">Up</a></td><td align="right"> <a accesskey="n" href="bk01pt03ch19s02.html">Next</a></td></tr><tr><td align="left" valign="top">Testing </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/setup.html b/libstdc++-v3/doc/html/manual/setup.html
index e0b5caee6e0..6615390b526 100644
--- a/libstdc++-v3/doc/html/manual/setup.html
+++ b/libstdc++-v3/doc/html/manual/setup.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="bugs.html" title="Bugs"/><link rel="next" href="configure.html" title="Configure"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="bugs.html" title="Bugs"/><link rel="next" href="configure.html" title="Configure"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
</th><td align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 2. Setup"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"/>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></div><p>To transform libstdc++ sources into installed include files
@@ -99,4 +99,4 @@ zh_TW BIG5
</p></li></ul></div></li><li class="listitem"><p>install just the necessary locales</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>with Debian Linux:</p><p> Add the above list, as shown, to the file
<code class="code">/etc/locale.gen</code> </p><p> run <code class="code">/usr/sbin/locale-gen</code> </p></li><li class="listitem"><p>on most Unix-like operating systems:</p><p><code class="code"> localedef -i de_DE -f ISO-8859-1 de_DE </code></p><p>(repeat for each entry in the above list) </p></li><li class="listitem"><p>
Instructions for other operating systems solicited.
- </p></li></ul></div></li></ul></div></dd></dl></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr><tr><td align="left" valign="top">Bugs </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Configure</td></tr></table></div></body></html>
+ </p></li></ul></div></li></ul></div></dd></dl></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr><tr><td align="left" valign="top">Bugs </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Configure</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/source_code_style.html b/libstdc++-v3/doc/html/manual/source_code_style.html
index ff4b4db2f39..3de6bb2de61 100644
--- a/libstdc++-v3/doc/html/manual/source_code_style.html
+++ b/libstdc++-v3/doc/html/manual/source_code_style.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Coding Style</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="source_organization.html" title="Directory Layout and Source Conventions"/><link rel="next" href="source_design_notes.html" title="Design Notes"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Coding Style</th></tr><tr><td align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Coding Style</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="source_organization.html" title="Directory Layout and Source Conventions"/><link rel="next" href="source_design_notes.html" title="Design Notes"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Coding Style</th></tr><tr><td align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr></table><hr/></div><div class="section" title="Coding Style"><div class="titlepage"><div><div><h2 class="title"><a id="contrib.coding_style"/>Coding Style</h2></div></div></div><p>
@@ -617,4 +617,4 @@
        }<br/>
      } // namespace std<br/>
      </code><br/>
-    </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr><tr><td align="left" valign="top">Directory Layout and Source Conventions </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Design Notes</td></tr></table></div></body></html>
+    </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_organization.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr><tr><td align="left" valign="top">Directory Layout and Source Conventions </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Design Notes</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/source_design_notes.html b/libstdc++-v3/doc/html/manual/source_design_notes.html
index fab57a64792..8f9b0bef5e0 100644
--- a/libstdc++-v3/doc/html/manual/source_design_notes.html
+++ b/libstdc++-v3/doc/html/manual/source_design_notes.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design Notes</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="source_code_style.html" title="Coding Style"/><link rel="next" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Notes</th></tr><tr><td align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Design Notes</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="source_code_style.html" title="Coding Style"/><link rel="next" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Notes</th></tr><tr><td align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td align="right"> <a accesskey="n" href="appendix_porting.html">Next</a></td></tr></table><hr/></div><div class="section" title="Design Notes"><div class="titlepage"><div><div><h2 class="title"><a id="contrib.design_notes"/>Design Notes</h2></div></div></div><p>
@@ -857,7 +857,7 @@
    subdirectories ext/ and backward/. (Note that it is better to<br/>
    include them via "&lt;backward/hash_map.h&gt;" or "&lt;ext/hash_map&gt;" than<br/>
    to search the subdirectory itself via a "-I" directive.<br/>
-  </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_porting.html">Next</a></td></tr><tr><td align="left" valign="top">Coding Style </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Appendix B. 
+  </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td align="right"> <a accesskey="n" href="appendix_porting.html">Next</a></td></tr><tr><td align="left" valign="top">Coding Style </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Appendix B. 
Porting and Maintenance
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/source_organization.html b/libstdc++-v3/doc/html/manual/source_organization.html
index 3e17c8b48b4..b7329bb88ec 100644
--- a/libstdc++-v3/doc/html/manual/source_organization.html
+++ b/libstdc++-v3/doc/html/manual/source_organization.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Directory Layout and Source Conventions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="next" href="source_code_style.html" title="Coding Style"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Directory Layout and Source Conventions</th></tr><tr><td align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Directory Layout and Source Conventions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="prev" href="appendix_contributing.html" title="Appendix A.  Contributing"/><link rel="next" href="source_code_style.html" title="Coding Style"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Directory Layout and Source Conventions</th></tr><tr><td align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing
</th><td align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr></table><hr/></div><div class="section" title="Directory Layout and Source Conventions"><div class="titlepage"><div><div><h2 class="title"><a id="contrib.organization"/>Directory Layout and Source Conventions</h2></div></div></div><p>
@@ -94,4 +94,4 @@ indicate a place that may require attention for multi-thread safety.<br
  </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr><tr><td align="left" valign="top">Appendix A. 
Contributing
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Coding Style</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Coding Style</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/spine.html b/libstdc++-v3/doc/html/manual/spine.html
deleted file mode 100644
index 688d0625510..00000000000
--- a/libstdc++-v3/doc/html/manual/spine.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library Manual</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="../spine.html" title="The GNU C++ Library"/><link rel="prev" href="../spine.html" title="The GNU C++ Library"/><link rel="next" href="intro.html" title="Part I.  Introduction"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library Manual</th></tr><tr><td align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr/></div><div class="book" title="The GNU C++ Library Manual"><div class="titlepage"><div><div><h1 class="title"><a id="manual-index"/>The GNU C++ Library Manual</h1></div><div><p class="copyright">Copyright © 2009, 2010
- <a class="link" href="http://www.fsf.org">FSF</a>
- </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id402308"/><p>
- <a class="link" href="license.html" title="License">License</a>
- </p></div></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="part"><a href="intro.html">I.
- Introduction
-
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt02.html">II.
- Standard Contents
- </a></span></dt><dd><dl><dt><span class="chapter"><a href="support.html">4.
- Support
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="diagnostics.html">5.
- Diagnostics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
- Utilities
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
- Strings
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
- Localization
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
- Containers
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
- Iterators
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11.
- Algorithms
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="numerics.html">12.
- Numerics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="io.html">13.
- Input and Output
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="atomics.html">14.
- Atomics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></dd><dt><span class="chapter"><a href="concurrency.html">15.
- Concurrency
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="extensions.html">III.
- Extensions
-
-</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="section"><a href="bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="section"><a href="bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="section"><a href="bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_allocators.html">20. Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="section"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ext_containers.html">21. Containers</a></span></dt><dd><dl><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s02.html">HP/SGI</a></span></dt><dt><span class="section"><a href="bk01pt03ch21s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_utilities.html">22. Utilities</a></span></dt><dt><span class="chapter"><a href="ext_algorithms.html">23. Algorithms</a></span></dt><dt><span class="chapter"><a href="ext_numerics.html">24. Numerics</a></span></dt><dt><span class="chapter"><a href="ext_iterators.html">25. Iterators</a></span></dt><dt><span class="chapter"><a href="ext_io.html">26. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="ext_demangling.html">27. Demangling</a></span></dt><dt><span class="chapter"><a href="ext_concurrency.html">28. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="bk01pt03ch28s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="bk01pt03ch28s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="bk01pt04.html">IV.
- Appendices
-</a></span></dt><dd><dl><dt><span class="appendix"><a href="appendix_contributing.html">A.
- Contributing
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B.
- Porting and Maintenance
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dt><span class="section"><a href="documentation_hacking.html#doc.docbook">Docbook</a></span></dt></dl></dd><dt><span class="section"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="section"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="section"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt><dt><span class="section"><a href="test.html#test.special">Special Topics</a></span></dt></dl></dd><dt><span class="section"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="section"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="section"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C.
- Free Software Needs Free Documentation
-
-</a></span></dt><dt><span class="appendix"><a href="appendix_gpl.html">D.
- <acronym class="acronym">GNU</acronym> General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><strong>List of Figures</strong></p><dl><dt>B.1. <a href="appendix_porting.html#id484470">Configure and Build File Dependencies</a></dt></dl></div><div class="list-of-tables"><p><strong>List of Tables</strong></p><dl><dt>1.1. <a href="status.html#id390604">C++ 1998/2003 Implementation Status</a></dt><dt>1.2. <a href="status.html#id404363">C++ 200x Implementation Status</a></dt><dt>1.3. <a href="status.html#id446479">C++ TR1 Implementation Status</a></dt><dt>1.4. <a href="status.html#id452050">C++ TR 24733 Implementation Status</a></dt><dt>3.1. <a href="using.html#id456194">C++ Command Options</a></dt><dt>3.2. <a href="using_headers.html#id456423">C++ 1998 Library Headers</a></dt><dt>3.3. <a href="using_headers.html#id456727">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.4. <a href="using_headers.html#id456933">C++ 200x Library Headers</a></dt><dt>3.5. <a href="using_headers.html#id457362">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.6. <a href="using_headers.html#id457611">C++ TR 1 Library Headers</a></dt><dt>3.7. <a href="using_headers.html#id457752">C++ TR 1 Library Headers for C Library Facilities</a></dt><dt>3.8. <a href="using_headers.html#id457928">C++ TR 24733 Decimal Floating-Point Header</a></dt><dt>3.9. <a href="using_headers.html#id457974">C++ ABI Headers</a></dt><dt>3.10. <a href="using_headers.html#id458027">Extension Headers</a></dt><dt>3.11. <a href="using_headers.html#id458325">Extension Debug Headers</a></dt><dt>3.12. <a href="using_headers.html#id458448">Extension Profile Headers</a></dt><dt>3.13. <a href="using_headers.html#id458559">Extension Parallel Headers</a></dt><dt>17.1. <a href="bk01pt03ch17s03.html#id472703">Debugging Containers</a></dt><dt>17.2. <a href="bk01pt03ch17s03.html#id473077">Debugging Containers C++0x</a></dt><dt>18.1. <a href="bk01pt03ch18s03.html#id474664">Parallel Algorithms</a></dt><dt>19.1. <a href="bk01pt03ch19s02.html#id476788">Profile Code Location</a></dt><dt>19.2. <a href="bk01pt03ch19s07.html#id477670">Profile Diagnostics</a></dt><dt>20.1. <a href="bitmap_allocator.html#id481111">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="documentation_hacking.html#id485371">Doxygen Prerequisites</a></dt><dt>B.2. <a href="documentation_hacking.html#id485873">HTML to Doxygen Markup Comparison</a></dt><dt>B.3. <a href="documentation_hacking.html#id486035">Docbook Prerequisites</a></dt><dt>B.4. <a href="documentation_hacking.html#id486512">HTML to Docbook XML Markup Comparison</a></dt><dt>B.5. <a href="documentation_hacking.html#id486714">Docbook XML Element Use</a></dt><dt>B.6. <a href="api.html#id492424">Extension Allocators</a></dt><dt>B.7. <a href="api.html#id492654">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td align="left" valign="top">The GNU C++ Library </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Part I. 
- Introduction
-
-</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index f7fdb486604..8e68bb29fc5 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 1. Status</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="intro.html" title="Part I.  Introduction"/><link rel="next" href="license.html" title="License"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 1. Status</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="intro.html" title="Part I.  Introduction"/><link rel="next" href="license.html" title="License"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Status</th></tr><tr><td align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 1. Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"/>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.iso"/>Implementation Status</h2></div></div></div><div class="section" title="C++ 1998/2003"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"/>C++ 1998/2003</h3></div></div></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"/>Implementation Status</h4></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="license.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 1. Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status"/>Chapter 1. Status</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dd><dl><dt><span class="section"><a href="status.html#iso.1998.status">Implementation Status</a></span></dt><dt><span class="section"><a href="status.html#iso.1998.specific">Implementation Specific Behavior</a></span></dt></dl></dd><dt><span class="section"><a href="status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.status.iso"/>Implementation Status</h2></div></div></div><div class="section" title="C++ 1998/2003"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.1998"/>C++ 1998/2003</h3></div></div></div><div class="section" title="Implementation Status"><div class="titlepage"><div><div><h4 class="title"><a id="iso.1998.status"/>Implementation Status</h4></div></div></div><p>
This status table is based on the table of contents of ISO/IEC 14882:2003.
</p><p>
This page describes the C++ support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id390604"/><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id598677"/><p class="title"><strong>Table 1.1. C++ 1998/2003 Implementation Status</strong></p><div class="table-contents"><table summary="C++ 1998/2003 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Language support</em></span>
@@ -90,7 +90,7 @@ particular release.
class. But they are the <span class="emphasis"><em>mangled</em></span> names; you will need to call
<code class="code">c++filt</code> and pass the names as command-line parameters to
demangle them, or call a
- <a class="link" href="ext_demangling.html" title="Chapter 27. Demangling">runtime demangler function</a>.
+ <a class="link" href="ext_demangling.html" title="Chapter 29. Demangling">runtime demangler function</a>.
(The classes in <code class="code">&lt;stdexcept&gt;</code> have constructors which
require an argument to use later for <code class="code">what()</code> calls, so the
problem of <code class="code">what()</code>'s value does not arise in most
@@ -157,7 +157,7 @@ presence of the required flag.
</p><p>
This page describes the C++0x support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id404363"/><p class="title"><strong>Table 1.2. C++ 200x Implementation Status</strong></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id596384"/><p class="title"><strong>Table 1.2. C++ 200x Implementation Status</strong></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>18</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Language support</em></span>
@@ -169,7 +169,7 @@ particular release.
<span class="emphasis"><em>20</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>General utilities</em></span>
- </td></tr><tr><td style="text-align: left">20.1</td><td style="text-align: left">General</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2</td><td style="text-align: left">Utility components</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.1</td><td style="text-align: left">Operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.2</td><td style="text-align: left">Swap</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.3</td><td style="text-align: left"><code class="code">forward</code> and <code class="code">move</code> helpers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.4</td><td style="text-align: left">Function template <code class="code">declval</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3</td><td style="text-align: left">Pairs</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.2</td><td style="text-align: left">Class template <code class="code">pair</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.3</td><td style="text-align: left">Specialized algorithms</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.4</td><td style="text-align: left">Tuple-like access to <code class="code">pair</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.5</td><td style="text-align: left">Piecewise construction</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4</td><td style="text-align: left">Tuples</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2</td><td style="text-align: left">Class template <code class="code">tuple</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.1</td><td style="text-align: left">Construction</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.2</td><td style="text-align: left">Assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.3</td><td style="text-align: left">Swap</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.4.2.4</td><td style="text-align: left">Tuple creation functions</td><td style="text-align: left">Partial</td><td style="text-align: left"><code class="code">tuple_cat</code> should be a single variadic signature (DR 1385)</td></tr><tr><td style="text-align: left">20.4.2.5</td><td style="text-align: left">Tuple helper classes</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.6</td><td style="text-align: left">Element access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.7</td><td style="text-align: left">Relational operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.8</td><td style="text-align: left">Tuple traits</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.9</td><td style="text-align: left">Tuple specialized algorithms</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5</td><td style="text-align: left">Class template <code class="code">bitset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.1</td><td style="text-align: left"><code class="code">bitset</code> constructors</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.2</td><td style="text-align: left"><code class="code">bitset</code> members</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.3</td><td style="text-align: left"><code class="code">bitset</code> hash support</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.4</td><td style="text-align: left"><code class="code">bitset</code> operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6</td><td style="text-align: left">Memory</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.2</td><td style="text-align: left">Header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.3</td><td style="text-align: left">Pointer traits</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing rebind</td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.4</td><td style="text-align: left">Pointer safety</td><td style="text-align: left">Partial</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.6.5</td><td style="text-align: left">Align</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.6</td><td style="text-align: left">Allocator argument tag</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.7</td><td style="text-align: left"><code class="code">uses_allocator</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.8</td><td style="text-align: left">Allocator traits</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing rebind_alloc and rebind_traits</td></tr><tr><td style="text-align: left">20.6.9</td><td style="text-align: left">The default allocator</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.10</td><td style="text-align: left">Raw storage iterator</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.11</td><td style="text-align: left">Temporary buffers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12</td><td style="text-align: left">Specialized algorithms</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.1</td><td style="text-align: left"><code class="code">addressof</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.2</td><td style="text-align: left"><code class="code">uninitialized_copy</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.3</td><td style="text-align: left"><code class="code">uninitialized_fill</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.4</td><td style="text-align: left"><code class="code">uninitialized_fill_n</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.13</td><td style="text-align: left">C library</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.1</td><td style="text-align: left">Class template <code class="code">unique_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2</td><td style="text-align: left">Shared-ownership pointers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2.1</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2.2</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left">
+ </td></tr><tr><td style="text-align: left">20.1</td><td style="text-align: left">General</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2</td><td style="text-align: left">Utility components</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.1</td><td style="text-align: left">Operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.2</td><td style="text-align: left">Swap</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.3</td><td style="text-align: left"><code class="code">forward</code> and <code class="code">move</code> helpers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.2.4</td><td style="text-align: left">Function template <code class="code">declval</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3</td><td style="text-align: left">Pairs</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.2</td><td style="text-align: left">Class template <code class="code">pair</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.3</td><td style="text-align: left">Specialized algorithms</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.4</td><td style="text-align: left">Tuple-like access to <code class="code">pair</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.3.5</td><td style="text-align: left">Piecewise construction</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4</td><td style="text-align: left">Tuples</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2</td><td style="text-align: left">Class template <code class="code">tuple</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.1</td><td style="text-align: left">Construction</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.2</td><td style="text-align: left">Assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.3</td><td style="text-align: left">Swap</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.4</td><td style="text-align: left">Tuple creation functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.5</td><td style="text-align: left">Tuple helper classes</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.6</td><td style="text-align: left">Element access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.7</td><td style="text-align: left">Relational operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.8</td><td style="text-align: left">Tuple traits</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.4.2.9</td><td style="text-align: left">Tuple specialized algorithms</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5</td><td style="text-align: left">Class template <code class="code">bitset</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.1</td><td style="text-align: left"><code class="code">bitset</code> constructors</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.2</td><td style="text-align: left"><code class="code">bitset</code> members</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.3</td><td style="text-align: left"><code class="code">bitset</code> hash support</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.5.4</td><td style="text-align: left"><code class="code">bitset</code> operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6</td><td style="text-align: left">Memory</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.2</td><td style="text-align: left">Header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.3</td><td style="text-align: left">Pointer traits</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing rebind</td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.4</td><td style="text-align: left">Pointer safety</td><td style="text-align: left">Partial</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.6.5</td><td style="text-align: left">Align</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.6</td><td style="text-align: left">Allocator argument tag</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.7</td><td style="text-align: left"><code class="code">uses_allocator</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.6.8</td><td style="text-align: left">Allocator traits</td><td style="text-align: left">Partial</td><td style="text-align: left">Missing rebind_alloc and rebind_traits</td></tr><tr><td style="text-align: left">20.6.9</td><td style="text-align: left">The default allocator</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.10</td><td style="text-align: left">Raw storage iterator</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.11</td><td style="text-align: left">Temporary buffers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12</td><td style="text-align: left">Specialized algorithms</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.1</td><td style="text-align: left"><code class="code">addressof</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.2</td><td style="text-align: left"><code class="code">uninitialized_copy</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.3</td><td style="text-align: left"><code class="code">uninitialized_fill</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.12.4</td><td style="text-align: left"><code class="code">uninitialized_fill_n</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.6.13</td><td style="text-align: left">C library</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.1</td><td style="text-align: left">Class template <code class="code">unique_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2</td><td style="text-align: left">Shared-ownership pointers</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2.1</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.7.2.2</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left">
<p>
Uses code from
<a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</a>.
@@ -184,7 +184,7 @@ particular release.
is_nothrow_assignable,
is_nothrow_copy_assignable, is_nothrow_move_assignable,
is_nothrow_destructible
- </td></tr><tr><td style="text-align: left">20.9.5</td><td style="text-align: left">Type property queries</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.6</td><td style="text-align: left">Relationships between types</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7</td><td style="text-align: left">Transformations between types</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.1</td><td style="text-align: left">Const-volatile modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.2</td><td style="text-align: left">Reference modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.3</td><td style="text-align: left">Sign modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.4</td><td style="text-align: left">Array modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.5</td><td style="text-align: left">Pointer modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.6</td><td style="text-align: left">Other transformations</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10</td><td style="text-align: left">Compile-time rational arithmetic</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.2</td><td style="text-align: left">Header <code class="code">&lt;ratio&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.3</td><td style="text-align: left">Class template <code class="code">ratio</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.4</td><td style="text-align: left">Arithmetic on <code class="code">ratio</code>s</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.5</td><td style="text-align: left">Comparison of <code class="code">ratio</code>s</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.6</td><td style="text-align: left">SI types for <code class="code">ratio</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11</td><td style="text-align: left">Time utilities</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.3</td><td style="text-align: left">Clock requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4</td><td style="text-align: left">Time-related traits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.1</td><td style="text-align: left"><code class="code">treat_as_floating_point</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.2</td><td style="text-align: left"><code class="code">duration_values</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.3</td><td style="text-align: left">Specializations of <code class="code">common_type</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.11.5</td><td style="text-align: left">Class template <code class="code">duration</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr for non-member arithmetic operations</td></tr><tr><td style="text-align: left">20.11.6</td><td style="text-align: left">Class template <code class="code">time_point</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.7</td><td style="text-align: left">Clocks</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.7.1</td><td style="text-align: left">Class <code class="code">system_clock</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.11.7.2</td><td style="text-align: left">Class <code class="code">steady_clock</code></td><td style="text-align: left">N</td><td style="text-align: left">Support old <code class="code">monotonic_clock</code> spec instead</td></tr><tr><td style="text-align: left">20.11.7.3</td><td style="text-align: left">Class <code class="code">high_resolution_clock</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.8</td><td style="text-align: left">Date and time functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12</td><td style="text-align: left">Scoped allocator adaptor</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12.1</td><td style="text-align: left">Header <code class="code">&lt;scoped_allocator&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12.2</td><td style="text-align: left">Scoped allocator adaptor member types</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12.3</td><td style="text-align: left">Scoped allocator adaptor constructors</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12.4</td><td style="text-align: left">Scoped allocator adaptor members</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.12.5</td><td style="text-align: left">Scoped allocator operators</td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.13</td><td style="text-align: left">Class <code class="code">type_index</code></td><td style="text-align: left">N</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">
+ </td></tr><tr><td style="text-align: left">20.9.5</td><td style="text-align: left">Type property queries</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.6</td><td style="text-align: left">Relationships between types</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7</td><td style="text-align: left">Transformations between types</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.1</td><td style="text-align: left">Const-volatile modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.2</td><td style="text-align: left">Reference modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.3</td><td style="text-align: left">Sign modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.4</td><td style="text-align: left">Array modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.5</td><td style="text-align: left">Pointer modifications</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.9.7.6</td><td style="text-align: left">Other transformations</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10</td><td style="text-align: left">Compile-time rational arithmetic</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.1</td><td style="text-align: left">In general</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.2</td><td style="text-align: left">Header <code class="code">&lt;ratio&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.3</td><td style="text-align: left">Class template <code class="code">ratio</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.4</td><td style="text-align: left">Arithmetic on <code class="code">ratio</code>s</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.5</td><td style="text-align: left">Comparison of <code class="code">ratio</code>s</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.10.6</td><td style="text-align: left">SI types for <code class="code">ratio</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11</td><td style="text-align: left">Time utilities</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.3</td><td style="text-align: left">Clock requirements</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4</td><td style="text-align: left">Time-related traits</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.1</td><td style="text-align: left"><code class="code">treat_as_floating_point</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.2</td><td style="text-align: left"><code class="code">duration_values</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.4.3</td><td style="text-align: left">Specializations of <code class="code">common_type</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.11.5</td><td style="text-align: left">Class template <code class="code">duration</code></td><td style="text-align: left">Partial</td><td style="text-align: left">Missing constexpr for non-member arithmetic operations</td></tr><tr><td style="text-align: left">20.11.6</td><td style="text-align: left">Class template <code class="code">time_point</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.7</td><td style="text-align: left">Clocks</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.7.1</td><td style="text-align: left">Class <code class="code">system_clock</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #C8B0B0"><td style="text-align: left">20.11.7.2</td><td style="text-align: left">Class <code class="code">steady_clock</code></td><td style="text-align: left">N</td><td style="text-align: left">Support old <code class="code">monotonic_clock</code> spec instead</td></tr><tr><td style="text-align: left">20.11.7.3</td><td style="text-align: left">Class <code class="code">high_resolution_clock</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.11.8</td><td style="text-align: left">Date and time functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.12</td><td style="text-align: left">Scoped allocator adaptor</td><td style="text-align: left">Partial</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.12.1</td><td style="text-align: left">Header <code class="code">&lt;scoped_allocator&gt;</code> synopsis</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.12.2</td><td style="text-align: left">Scoped allocator adaptor member types</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.12.3</td><td style="text-align: left">Scoped allocator adaptor constructors</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr style="background-color: #B0B0B0"><td style="text-align: left">20.12.4</td><td style="text-align: left">Scoped allocator adaptor members</td><td style="text-align: left">Partial</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.12.5</td><td style="text-align: left">Scoped allocator operators</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">20.13</td><td style="text-align: left">Class <code class="code">type_index</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">
<span class="emphasis"><em>21</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Strings</em></span>
@@ -245,7 +245,7 @@ In this implementation the header names are prefixed by
</p><p>
This page describes the TR1 support in mainline GCC SVN, not in any particular
release.
-</p><div class="table"><a id="id446479"/><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left"><span class="emphasis"><em>2</em></span></td><td colspan="3" style="text-align: left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td style="text-align: left">2.1</td><td style="text-align: left">Reference wrappers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.1</td><td style="text-align: left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2</td><td style="text-align: left">Class template <code class="code">reference_wrapper</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.1</td><td style="text-align: left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.2</td><td style="text-align: left"><code class="code">reference_wrapper</code> assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.3</td><td style="text-align: left"><code class="code">reference_wrapper</code> access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.4</td><td style="text-align: left"><code class="code">reference_wrapper</code> invocation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.5</td><td style="text-align: left"><code class="code">reference_wrapper</code> helper functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.1</td><td style="text-align: left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.2</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.3</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left"> </td><td style="text-align: left">
+</p><div class="table"><a id="id588207"/><p class="title"><strong>Table 1.3. C++ TR1 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left"><span class="emphasis"><em>2</em></span></td><td colspan="3" style="text-align: left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td style="text-align: left">2.1</td><td style="text-align: left">Reference wrappers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.1</td><td style="text-align: left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2</td><td style="text-align: left">Class template <code class="code">reference_wrapper</code></td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.1</td><td style="text-align: left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.2</td><td style="text-align: left"><code class="code">reference_wrapper</code> assignment</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.3</td><td style="text-align: left"><code class="code">reference_wrapper</code> access</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.4</td><td style="text-align: left"><code class="code">reference_wrapper</code> invocation</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.1.2.5</td><td style="text-align: left"><code class="code">reference_wrapper</code> helper functions</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2</td><td style="text-align: left">Smart pointers</td><td style="text-align: left"> </td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.1</td><td style="text-align: left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.2</td><td style="text-align: left">Class <code class="code">bad_weak_ptr</code></td><td style="text-align: left">Y</td><td style="text-align: left"> </td></tr><tr><td style="text-align: left">2.2.3</td><td style="text-align: left">Class template <code class="code">shared_ptr</code></td><td style="text-align: left"> </td><td style="text-align: left">
<p>
Uses code from
<a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">boost::shared_ptr</a>.
@@ -258,7 +258,7 @@ decimal floating-point arithmetic
</p><p>
This page describes the TR 24733 support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id452050"/><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
+</p><div class="table"><a id="id622095"/><p class="title"><strong>Table 1.4. C++ TR 24733 Implementation Status</strong></p><div class="table-contents"><table summary="C++ TR 24733 Implementation Status" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><thead><tr><th style="text-align: left">Section</th><th style="text-align: left">Description</th><th style="text-align: left">Status</th><th style="text-align: left">Comments</th></tr></thead><tbody><tr><td style="text-align: left">
<span class="emphasis"><em>0</em></span>
</td><td colspan="3" style="text-align: left">
<span class="emphasis"><em>Introduction</em></span>
@@ -281,4 +281,4 @@ particular release.
</td></tr></tbody></table></div></div><br class="table-break"/></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="license.html">Next</a></td></tr><tr><td align="left" valign="top">Part I. 
Introduction
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> License</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> License</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/streambufs.html b/libstdc++-v3/doc/html/manual/streambufs.html
index 92c148dfcde..12d9ee698ea 100644
--- a/libstdc++-v3/doc/html/manual/streambufs.html
+++ b/libstdc++-v3/doc/html/manual/streambufs.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Stream Buffers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="io.html" title="Chapter 13.  Input and Output"/><link rel="next" href="stringstreams.html" title="Memory Based Streams"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Stream Buffers</th></tr><tr><td align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Stream Buffers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="io.html" title="Chapter 13.  Input and Output"/><link rel="next" href="stringstreams.html" title="Memory Based Streams"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Stream Buffers</th></tr><tr><td align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td align="right"> <a accesskey="n" href="stringstreams.html">Next</a></td></tr></table><hr/></div><div class="section" title="Stream Buffers"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.streambufs"/>Stream Buffers</h2></div></div></div><div class="section" title="Derived streambuf Classes"><div class="titlepage"><div><div><h3 class="title"><a id="io.streambuf.derived"/>Derived streambuf Classes</h3></div></div></div><p>
@@ -134,4 +134,4 @@
</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="io.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="stringstreams.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 13. 
Input and Output
- </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Memory Based Streams</td></tr></table></div></body></html>
+ </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Memory Based Streams</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index fd13422585d..6e4adf23d7c 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 7.  Strings</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="traits.html" title="Traits"/><link rel="next" href="localization.html" title="Chapter 8.  Localization"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 7.  Strings</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="traits.html" title="Traits"/><link rel="next" href="localization.html" title="Chapter 8.  Localization"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. 
Strings
</th></tr><tr><td align="left"><a accesskey="p" href="traits.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 7.  Strings"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings"/>Chapter 7. 
Strings
- <a id="id465369" class="indexterm"/>
+ <a id="id647564" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="section" title="String Classes"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings.string"/>String Classes</h2></div></div></div><div class="section" title="Simple Transformations"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.simple"/>Simple Transformations</h3></div></div></div><p>
Here are Standard, simple, and portable ways to perform common
transformations on a <code class="code">string</code> instance, such as
@@ -360,7 +360,7 @@ stringtok(Container &amp;container, string const &amp;in,
libstdc++ string, the SGI string, and the SGI rope, and this
is all before any allocator or traits customizations! (More
choices than you can shake a stick at -- want fries with that?)
- </p></li></ul></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="traits.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr><tr><td align="left" valign="top">Traits </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 8. 
+ </p></li></ul></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="traits.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr><tr><td align="left" valign="top">Traits </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 8. 
Localization
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/stringstreams.html b/libstdc++-v3/doc/html/manual/stringstreams.html
index 1107d61b1b3..e267e6b3c7b 100644
--- a/libstdc++-v3/doc/html/manual/stringstreams.html
+++ b/libstdc++-v3/doc/html/manual/stringstreams.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Memory Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="streambufs.html" title="Stream Buffers"/><link rel="next" href="fstreams.html" title="File Based Streams"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory Based Streams</th></tr><tr><td align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Memory Based Streams</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="io.html" title="Chapter 13.  Input and Output"/><link rel="prev" href="streambufs.html" title="Stream Buffers"/><link rel="next" href="fstreams.html" title="File Based Streams"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory Based Streams</th></tr><tr><td align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 13. 
Input and Output
</th><td align="right"> <a accesskey="n" href="fstreams.html">Next</a></td></tr></table><hr/></div><div class="section" title="Memory Based Streams"><div class="titlepage"><div><div><h2 class="title"><a id="std.io.memstreams"/>Memory Based Streams</h2></div></div></div><div class="section" title="Compatibility With strstream"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.memstreams.compat"/>Compatibility With strstream</h3></div></div></div><p>
@@ -34,4 +34,4 @@
memory yourself. The strstreams have been officially deprecated,
which means that 1) future revisions of the C++ Standard won't
support them, and 2) if you use them, people will laugh at you.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="fstreams.html">Next</a></td></tr><tr><td align="left" valign="top">Stream Buffers </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> File Based Streams</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><td align="center"><a accesskey="u" href="io.html">Up</a></td><td align="right"> <a accesskey="n" href="fstreams.html">Next</a></td></tr><tr><td align="left" valign="top">Stream Buffers </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> File Based Streams</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html
index 842eb11d924..7a978473fb7 100644
--- a/libstdc++-v3/doc/html/manual/support.html
+++ b/libstdc++-v3/doc/html/manual/support.html
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 4.  Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="next" href="dynamic_memory.html" title="Dynamic Memory"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 4.  Support</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="next" href="dynamic_memory.html" title="Dynamic Memory"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
Support
</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt02.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 4.  Support"><div class="titlepage"><div><div><h2 class="title"><a id="std.support"/>Chapter 4. 
Support
- <a id="id461901" class="indexterm"/>
+ <a id="id631894" class="indexterm"/>
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div><p>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
@@ -127,4 +127,4 @@
Effective C++ CD example</a>
</p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt02.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr><tr><td align="left" valign="top">Part II. 
Standard Contents
-  </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Dynamic Memory</td></tr></table></div></body></html>
+  </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Dynamic Memory</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/termination.html b/libstdc++-v3/doc/html/manual/termination.html
index cc523594354..9fe47502eeb 100644
--- a/libstdc++-v3/doc/html/manual/termination.html
+++ b/libstdc++-v3/doc/html/manual/termination.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Termination</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="support.html" title="Chapter 4.  Support"/><link rel="prev" href="dynamic_memory.html" title="Dynamic Memory"/><link rel="next" href="diagnostics.html" title="Chapter 5.  Diagnostics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Termination</th></tr><tr><td align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Termination</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="support.html" title="Chapter 4.  Support"/><link rel="prev" href="dynamic_memory.html" title="Dynamic Memory"/><link rel="next" href="diagnostics.html" title="Chapter 5.  Diagnostics"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Termination</th></tr><tr><td align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
Support
</th><td align="right"> <a accesskey="n" href="diagnostics.html">Next</a></td></tr></table><hr/></div><div class="section" title="Termination"><div class="titlepage"><div><div><h2 class="title"><a id="std.support.termination"/>Termination</h2></div></div></div><div class="section" title="Termination Handlers"><div class="titlepage"><div><div><h3 class="title"><a id="support.termination.handlers"/>Termination Handlers</h3></div></div></div><p>
@@ -118,7 +118,7 @@ int main(int argc)
inappropriate location,
<code class="function">__verbose_terminate_handler</code> will behave in
an unspecified manner.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><td align="center"><a accesskey="u" href="support.html">Up</a></td><td align="right"> <a accesskey="n" href="diagnostics.html">Next</a></td></tr><tr><td align="left" valign="top">Dynamic Memory </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 5. 
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="dynamic_memory.html">Prev</a> </td><td align="center"><a accesskey="u" href="support.html">Up</a></td><td align="right"> <a accesskey="n" href="diagnostics.html">Next</a></td></tr><tr><td align="left" valign="top">Dynamic Memory </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 5. 
Diagnostics
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index f6523c09359..802d4159a07 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Test</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; , &#10; performance&#10; , &#10; conformance&#10; , &#10; ABI&#10; , &#10; exception safety&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems"/><link rel="next" href="abi.html" title="ABI Policy and Guidelines"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Test</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; , &#10; performance&#10; , &#10; conformance&#10; , &#10; ABI&#10; , &#10; exception safety&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"/><link rel="prev" href="internals.html" title="Porting to New Hardware or Operating Systems"/><link rel="next" href="abi.html" title="ABI Policy and Guidelines"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td align="left"><a accesskey="p" href="internals.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance
</th><td align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr></table><hr/></div><div class="section" title="Test"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.test"/>Test</h2></div></div></div><p>
@@ -493,7 +493,7 @@ only default variables.
reporting functions including:
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>time_counter</p></li><li class="listitem"><p>resource_counter</p></li><li class="listitem"><p>report_performance</p></li></ul></div></li></ul></div></div></div><div class="section" title="Special Topics"><div class="titlepage"><div><div><h3 class="title"><a id="test.special"/>Special Topics</h3></div></div></div><div class="section" title="Qualifying Exception Safety Guarantees"><div class="titlepage"><div><div><h4 class="title"><a id="test.exception.safety"/>
Qualifying Exception Safety Guarantees
- <a id="id488969" class="indexterm"/>
+ <a id="id705405" class="indexterm"/>
</h4></div></div></div><div class="section" title="Overview"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.overview"/>Overview</h5></div></div></div><p>
Testing is composed of running a particular test sequence,
and looking at what happens to the surrounding code when
@@ -636,4 +636,4 @@ C++0x Requirements Test Sequence Descriptions
The general form demonstrated in
<code class="filename">testsuite/23_containers/list/requirements/exception/propagation_coherent.cc
</code>. The instantiating test object is <code class="classname">__gnu_test::propagation_coherent</code> and is detailed in <code class="filename">testsuite/util/exception/safety.h</code>.
- </p></li></ul></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="internals.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr><tr><td align="left" valign="top">Porting to New Hardware or Operating Systems </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> ABI Policy and Guidelines</td></tr></table></div></body></html>
+ </p></li></ul></div></div></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="internals.html">Prev</a> </td><td align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td align="right"> <a accesskey="n" href="abi.html">Next</a></td></tr><tr><td align="left" valign="top">Porting to New Hardware or Operating Systems </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> ABI Policy and Guidelines</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/traits.html b/libstdc++-v3/doc/html/manual/traits.html
index 4c04c7b15c3..93610f607f2 100644
--- a/libstdc++-v3/doc/html/manual/traits.html
+++ b/libstdc++-v3/doc/html/manual/traits.html
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Traits</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="memory.html" title="Memory"/><link rel="next" href="strings.html" title="Chapter 7.  Strings"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Traits</th></tr><tr><td align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Traits</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="utilities.html" title="Chapter 6.  Utilities"/><link rel="prev" href="memory.html" title="Memory"/><link rel="next" href="strings.html" title="Chapter 7.  Strings"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Traits</th></tr><tr><td align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 6. 
Utilities
</th><td align="right"> <a accesskey="n" href="strings.html">Next</a></td></tr></table><hr/></div><div class="section" title="Traits"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.traits"/>Traits</h2></div></div></div><p>
- </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="memory.html">Prev</a> </td><td align="center"><a accesskey="u" href="utilities.html">Up</a></td><td align="right"> <a accesskey="n" href="strings.html">Next</a></td></tr><tr><td align="left" valign="top">Memory </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 7. 
+ </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="memory.html">Prev</a> </td><td align="center"><a accesskey="u" href="utilities.html">Up</a></td><td align="right"> <a accesskey="n" href="strings.html">Next</a></td></tr><tr><td align="left" valign="top">Memory </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Chapter 7. 
Strings
</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index a425e022371..529577e5eb6 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 3. Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="make.html" title="Make"/><link rel="next" href="using_headers.html" title="Headers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Part I. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 3. Using</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="intro.html" title="Part I.  Introduction"/><link rel="prev" href="make.html" title="Make"/><link rel="next" href="using_headers.html" title="Headers"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Using</th></tr><tr><td align="left"><a accesskey="p" href="make.html">Prev</a> </td><th width="60%" align="center">Part I. 
Introduction
-</th><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 3. Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"/>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section" title="Command Options"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.flags"/>Command Options</h2></div></div></div><p>
+</th><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 3. Using"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using"/>Chapter 3. Using</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dd><dl><dt><span class="section"><a href="using_concurrency.html#concurrency.io.structure">Structure</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.defaults">Defaults</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.future">Future</a></span></dt><dt><span class="section"><a href="using_concurrency.html#concurrency.io.alt">Alternatives</a></span></dt></dl></dd><dt><span class="section"><a href="using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.c">With <code class="literal">C</code></a></span></dt><dt><span class="section"><a href="using_exceptions.html#using.exception.compat.posix">With <code class="literal">POSIX</code> thread cancellation</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></div><div class="section" title="Command Options"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.flags"/>Command Options</h2></div></div></div><p>
The set of features available in the GNU C++ library is shaped
by
several <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2//gcc/Invoking-GCC.html">GCC
@@ -11,5 +11,5 @@
enumerated and detailed in the table below.
</p><p>
By default, <span class="command"><strong>g++</strong></span> is equivalent to <span class="command"><strong>g++ -std=gnu++98</strong></span>. The standard library also defaults to this dialect.
- </p><div class="table"><a id="id456194"/><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Option Flags</th><th style="text-align: left">Description</th></tr></thead><tbody><tr><td style="text-align: left"><code class="literal">-std=c++98</code></td><td style="text-align: left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++98</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-std=c++0x</code></td><td style="text-align: left">Use the working draft of the upcoming ISO C++0x standard.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++0x</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-fexceptions</code></td><td style="text-align: left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td style="text-align: left"><code class="literal">-frtti</code></td><td style="text-align: left">As above, but RTTI-free dialect.</td></tr><tr><td style="text-align: left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td style="text-align: left">For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
- &lt;mutex&gt;, or &lt;condition_variable&gt;.</td></tr><tr><td style="text-align: left"><code class="literal">-fopenmp</code></td><td style="text-align: left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="make.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td align="left" valign="top">Make </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Headers</td></tr></table></div></body></html>
+ </p><div class="table"><a id="id626203"/><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><thead><tr><th style="text-align: left">Option Flags</th><th style="text-align: left">Description</th></tr></thead><tbody><tr><td style="text-align: left"><code class="literal">-std=c++98</code></td><td style="text-align: left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++98</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-std=c++0x</code></td><td style="text-align: left">Use the working draft of the upcoming ISO C++0x standard.</td></tr><tr><td style="text-align: left"><code class="literal">-std=gnu++0x</code></td><td style="text-align: left">As directly above, with GNU extensions.</td></tr><tr><td style="text-align: left"><code class="literal">-fexceptions</code></td><td style="text-align: left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td style="text-align: left"><code class="literal">-frtti</code></td><td style="text-align: left">As above, but RTTI-free dialect.</td></tr><tr><td style="text-align: left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td style="text-align: left">For ISO C++0x &lt;thread&gt;, &lt;future&gt;,
+ &lt;mutex&gt;, or &lt;condition_variable&gt;.</td></tr><tr><td style="text-align: left"><code class="literal">-fopenmp</code></td><td style="text-align: left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="make.html">Prev</a> </td><td align="center"><a accesskey="u" href="intro.html">Up</a></td><td align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td align="left" valign="top">Make </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Headers</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_concurrency.html b/libstdc++-v3/doc/html/manual/using_concurrency.html
index a0ca2a651af..671ebdd3a4b 100644
--- a/libstdc++-v3/doc/html/manual/using_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/using_concurrency.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_dynamic_or_shared.html" title="Linking"/><link rel="next" href="using_exceptions.html" title="Exceptions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concurrency</th></tr><tr><td align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr></table><hr/></div><div class="section" title="Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.concurrency"/>Concurrency</h2></div></div></div><p>This section discusses issues surrounding the proper compilation
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Concurrency</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_dynamic_or_shared.html" title="Linking"/><link rel="next" href="using_exceptions.html" title="Exceptions"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Concurrency</th></tr><tr><td align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr></table><hr/></div><div class="section" title="Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.concurrency"/>Concurrency</h2></div></div></div><p>This section discusses issues surrounding the proper compilation
of multithreaded applications which use the Standard C++
library. This information is GCC-specific since the C++
standard does not address matters of multithreaded applications.
@@ -202,4 +202,4 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
useful are details
on <a class="link" href="memory.html#std.util.memory.allocator" title="Allocators">allocator</a>
options and capabilities.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr><tr><td align="left" valign="top">Linking </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Exceptions</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_dynamic_or_shared.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_exceptions.html">Next</a></td></tr><tr><td align="left" valign="top">Linking </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Exceptions</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
index 6ca06caa713..9796e4e8a60 100644
--- a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
+++ b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_namespaces.html" title="Namespaces"/><link rel="next" href="using_concurrency.html" title="Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Linking</th></tr><tr><td align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr></table><hr/></div><div class="section" title="Linking"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.linkage"/>Linking</h2></div></div></div><div class="section" title="Almost Nothing"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.linkage.freestanding"/>Almost Nothing</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linking</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_namespaces.html" title="Namespaces"/><link rel="next" href="using_concurrency.html" title="Concurrency"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Linking</th></tr><tr><td align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr></table><hr/></div><div class="section" title="Linking"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.linkage"/>Linking</h2></div></div></div><div class="section" title="Almost Nothing"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.linkage.freestanding"/>Almost Nothing</h3></div></div></div><p>
Or as close as it gets: freestanding. This is a minimal
configuration, with only partial support for the standard
library. Assume only the following header files can be used:
@@ -106,4 +106,4 @@ A quick read of the relevant part of the GCC
also installed, for use with Libtool. If you use Libtool to
create your executables, these details are taken care of for
you.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Namespaces </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Concurrency</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr><tr><td align="left" valign="top">Namespaces </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Concurrency</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index a0adc01d1af..19c72cdb113 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Exceptions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; exception&#10; , &#10; error&#10; , &#10; exception neutrality&#10; , &#10; exception safety&#10; , &#10; exception propagation&#10; , &#10; -fno-exceptions&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_concurrency.html" title="Concurrency"/><link rel="next" href="debug.html" title="Debugging Support"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr/></div><div class="section" title="Exceptions"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.exceptions"/>Exceptions</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Exceptions</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; C++&#10; , &#10; exception&#10; , &#10; error&#10; , &#10; exception neutrality&#10; , &#10; exception safety&#10; , &#10; exception propagation&#10; , &#10; -fno-exceptions&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_concurrency.html" title="Concurrency"/><link rel="next" href="debug.html" title="Debugging Support"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Exceptions</th></tr><tr><td align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr/></div><div class="section" title="Exceptions"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.exceptions"/>Exceptions</h2></div></div></div><p>
The C++ language provides language support for stack unwinding
with <code class="literal">try</code> and <code class="literal">catch</code> blocks and
the <code class="literal">throw</code> keyword.
@@ -266,42 +266,49 @@ is called.
}
catch(...)
{ this-&gt;_M_setstate(ios_base::badbit); }
-</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id461043"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+</pre></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"/>Bibliography</h3></div></div></div><div class="biblioentry" title="System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)"><a id="id631052"/><p><span class="title"><em>
+ <a class="link" href="http://www.opengroup.org/austin">
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
+ </a>
</em>. </span><span class="pagenums">
2.9.5 Thread Cancellation
. </span><span class="copyright">Copyright © 2008
The Open Group/The Institute of Electrical and Electronics
Engineers, Inc.
- . </span></p></div><div class="biblioentry"><a id="id461076"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></p></div><div class="biblioentry" title="Error and Exception Handling"><a id="id631082"/><p><span class="title"><em>
+ <a class="link" href="http://www.boost.org/community/error_handling.html">
Error and Exception Handling
+ </a>
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams </span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry"><a id="id461109"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="Exception-Safety in Generic Components"><a id="id631113"/><p><span class="title"><em>
+ <a class="link" href="http://www.boost.org/community/exception_safety.html">
Exception-Safety in Generic Components
+ </a>
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams</span>. </span><span class="publisher"><span class="publishername">
Boost
- . </span></span></p></div><div class="biblioentry"><a id="id461142"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="Standard Library Exception Policy"><a id="id631144"/><p><span class="title"><em>
+ <a class="link" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf">
Standard Library Exception Policy
+ </a>
</em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
WG21 N1077
- . </span></span></p></div><div class="biblioentry"><a id="id461175"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="ia64 c++ abi exception handling"><a id="id631175"/><p><span class="title"><em>
+ <a class="link" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html">
ia64 c++ abi exception handling
+ </a>
</em>. </span><span class="author"><span class="firstname">Richard</span> <span class="surname">Henderson</span>. </span><span class="publisher"><span class="publishername">
GNU
- . </span></span></p></div><div class="biblioentry"><a id="id461209"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span></span></p></div><div class="biblioentry" title="Appendix E: Standard-Library Exception Safety"><a id="id631206"/><p><span class="title"><em>
+ <a class="link" href="http://www.research.att.com/~bs/3rd_safe.pdf">
Appendix E: Standard-Library Exception Safety
- </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="id461234"/><p><span class="citetitle"><em class="citetitle">
+ </a>
+ </em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="id631229"/><p><span class="citetitle"><em class="citetitle">
Exceptional C++
</em>. </span><span class="pagenums">
Exception-Safety Issues and Techniques
- . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="id461254"/><p><span class="biblioid">
- . </span><span class="citetitle"><em class="citetitle">
+ . </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry" title="GCC Bug 25191: exception_defines.h #defines try/catch"><a id="id631249"/><p><span class="title"><em>
+ <a class="link" href="http://gcc.gnu.org/PR25191">
GCC Bug 25191: exception_defines.h #defines try/catch
- </em>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td align="left" valign="top">Concurrency </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Debugging Support</td></tr></table></div></body></html>
+ </a>
+ </em>. </span></p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_concurrency.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr><tr><td align="left" valign="top">Concurrency </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Debugging Support</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_headers.html b/libstdc++-v3/doc/html/manual/using_headers.html
index 073070960b8..71fee7de525 100644
--- a/libstdc++-v3/doc/html/manual/using_headers.html
+++ b/libstdc++-v3/doc/html/manual/using_headers.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using.html" title="Chapter 3. Using"/><link rel="next" href="using_macros.html" title="Macros"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Headers</th></tr><tr><td align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr></table><hr/></div><div class="section" title="Headers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.headers"/>Headers</h2></div></div></div><div class="section" title="Header Files"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.all"/>Header Files</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Headers</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using.html" title="Chapter 3. Using"/><link rel="next" href="using_macros.html" title="Macros"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Headers</th></tr><tr><td align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr></table><hr/></div><div class="section" title="Headers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.headers"/>Headers</h2></div></div></div><div class="section" title="Header Files"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.all"/>Header Files</h3></div></div></div><p>
The C++ standard specifies the entire set of header files that
must be available to all hosted implementations. Actually, the
word "files" is a misnomer, since the contents of the
@@ -20,19 +20,19 @@
upcoming 200x standard.
</p><p>
C++98/03 include files. These are available in the default compilation mode, i.e. <code class="code">-std=c++98</code> or <code class="code">-std=gnu++98</code>.
- </p><div class="table"><a id="id456423"/><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">complex</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td></tr><tr><td style="text-align: left"><code class="filename">fstream</code></td><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td><td style="text-align: left"><code class="filename">iosfwd</code></td></tr><tr><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td><td style="text-align: left"><code class="filename">list</code></td></tr><tr><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td></tr><tr><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td></tr><tr><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-align: left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id456727"/><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">ciso646</code></td></tr><tr><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td></tr><tr><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p>
+ </p><div class="table"><a id="id626432"/><p class="title"><strong>Table 3.2. C++ 1998 Library Headers</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">complex</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td></tr><tr><td style="text-align: left"><code class="filename">fstream</code></td><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td><td style="text-align: left"><code class="filename">iosfwd</code></td></tr><tr><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td><td style="text-align: left"><code class="filename">list</code></td></tr><tr><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td></tr><tr><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td></tr><tr><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-align: left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id626736"/><p class="title"><strong>Table 3.3. C++ 1998 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">ciso646</code></td></tr><tr><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td></tr><tr><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p>
C++0x include files. These are only available in C++0x compilation
mode, i.e. <code class="literal">-std=c++0x</code> or <code class="literal">-std=gnu++0x</code>.
-</p><p/><div class="table"><a id="id456933"/><p class="title"><strong>Table 3.4. C++ 200x Library Headers</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">array</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">chrono</code></td><td style="text-align: left"><code class="filename">complex</code></td></tr><tr><td style="text-align: left"><code class="filename">condition_variable</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td><td style="text-align: left"><code class="filename">forward_list</code></td><td style="text-align: left"><code class="filename">fstream</code></td></tr><tr><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">future</code></td><td style="text-align: left"><code class="filename">initalizer_list</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td></tr><tr><td style="text-align: left"><code class="filename">iosfwd</code></td><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td></tr><tr><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">mutex</code></td></tr><tr><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">random</code></td></tr><tr><td style="text-align: left"><code class="filename">ratio</code></td><td style="text-align: left"><code class="filename">regex</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">system_error</code></td><td style="text-align: left"><code class="filename">thread</code></td></tr><tr><td style="text-align: left"><code class="filename">tuple</code></td><td style="text-align: left"><code class="filename">type_traits</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-align: left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id457362"/><p class="title"><strong>Table 3.5. C++ 200x Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">ccomplex</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cfenv</code></td></tr><tr><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">cinttypes</code></td><td style="text-align: left"><code class="filename">ciso646</code></td><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td></tr><tr><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstdbool</code></td></tr><tr><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdint</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctgmath</code></td><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cuchar</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
+</p><p/><div class="table"><a id="id626942"/><p class="title"><strong>Table 3.4. C++ 200x Library Headers</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">algorithm</code></td><td style="text-align: left"><code class="filename">array</code></td><td style="text-align: left"><code class="filename">bitset</code></td><td style="text-align: left"><code class="filename">chrono</code></td><td style="text-align: left"><code class="filename">complex</code></td></tr><tr><td style="text-align: left"><code class="filename">condition_variable</code></td><td style="text-align: left"><code class="filename">deque</code></td><td style="text-align: left"><code class="filename">exception</code></td><td style="text-align: left"><code class="filename">forward_list</code></td><td style="text-align: left"><code class="filename">fstream</code></td></tr><tr><td style="text-align: left"><code class="filename">functional</code></td><td style="text-align: left"><code class="filename">future</code></td><td style="text-align: left"><code class="filename">initalizer_list</code></td><td style="text-align: left"><code class="filename">iomanip</code></td><td style="text-align: left"><code class="filename">ios</code></td></tr><tr><td style="text-align: left"><code class="filename">iosfwd</code></td><td style="text-align: left"><code class="filename">iostream</code></td><td style="text-align: left"><code class="filename">istream</code></td><td style="text-align: left"><code class="filename">iterator</code></td><td style="text-align: left"><code class="filename">limits</code></td></tr><tr><td style="text-align: left"><code class="filename">list</code></td><td style="text-align: left"><code class="filename">locale</code></td><td style="text-align: left"><code class="filename">map</code></td><td style="text-align: left"><code class="filename">memory</code></td><td style="text-align: left"><code class="filename">mutex</code></td></tr><tr><td style="text-align: left"><code class="filename">new</code></td><td style="text-align: left"><code class="filename">numeric</code></td><td style="text-align: left"><code class="filename">ostream</code></td><td style="text-align: left"><code class="filename">queue</code></td><td style="text-align: left"><code class="filename">random</code></td></tr><tr><td style="text-align: left"><code class="filename">ratio</code></td><td style="text-align: left"><code class="filename">regex</code></td><td style="text-align: left"><code class="filename">set</code></td><td style="text-align: left"><code class="filename">sstream</code></td><td style="text-align: left"><code class="filename">stack</code></td></tr><tr><td style="text-align: left"><code class="filename">stdexcept</code></td><td style="text-align: left"><code class="filename">streambuf</code></td><td style="text-align: left"><code class="filename">string</code></td><td style="text-align: left"><code class="filename">system_error</code></td><td style="text-align: left"><code class="filename">thread</code></td></tr><tr><td style="text-align: left"><code class="filename">tuple</code></td><td style="text-align: left"><code class="filename">type_traits</code></td><td style="text-align: left"><code class="filename">typeinfo</code></td><td style="text-align: left"><code class="filename">unordered_map</code></td><td style="text-align: left"><code class="filename">unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">utility</code></td><td style="text-align: left"><code class="filename">valarray</code></td><td style="text-align: left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id627370"/><p class="title"><strong>Table 3.5. C++ 200x Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cassert</code></td><td style="text-align: left"><code class="filename">ccomplex</code></td><td style="text-align: left"><code class="filename">cctype</code></td><td style="text-align: left"><code class="filename">cerrno</code></td><td style="text-align: left"><code class="filename">cfenv</code></td></tr><tr><td style="text-align: left"><code class="filename">cfloat</code></td><td style="text-align: left"><code class="filename">cinttypes</code></td><td style="text-align: left"><code class="filename">ciso646</code></td><td style="text-align: left"><code class="filename">climits</code></td><td style="text-align: left"><code class="filename">clocale</code></td></tr><tr><td style="text-align: left"><code class="filename">cmath</code></td><td style="text-align: left"><code class="filename">csetjmp</code></td><td style="text-align: left"><code class="filename">csignal</code></td><td style="text-align: left"><code class="filename">cstdarg</code></td><td style="text-align: left"><code class="filename">cstdbool</code></td></tr><tr><td style="text-align: left"><code class="filename">cstddef</code></td><td style="text-align: left"><code class="filename">cstdint</code></td><td style="text-align: left"><code class="filename">cstdlib</code></td><td style="text-align: left"><code class="filename">cstdio</code></td><td style="text-align: left"><code class="filename">cstring</code></td></tr><tr><td style="text-align: left"><code class="filename">ctgmath</code></td><td style="text-align: left"><code class="filename">ctime</code></td><td style="text-align: left"><code class="filename">cuchar</code></td><td style="text-align: left"><code class="filename">cwchar</code></td><td style="text-align: left"><code class="filename">cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="id457611"/><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/array</code></td><td style="text-align: left"><code class="filename">tr1/complex</code></td><td style="text-align: left"><code class="filename">tr1/memory</code></td><td style="text-align: left"><code class="filename">tr1/functional</code></td><td style="text-align: left"><code class="filename">tr1/random</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/regex</code></td><td style="text-align: left"><code class="filename">tr1/tuple</code></td><td style="text-align: left"><code class="filename">tr1/type_traits</code></td><td style="text-align: left"><code class="filename">tr1/unordered_map</code></td><td style="text-align: left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id457752"/><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/ccomplex</code></td><td style="text-align: left"><code class="filename">tr1/cfenv</code></td><td style="text-align: left"><code class="filename">tr1/cfloat</code></td><td style="text-align: left"><code class="filename">tr1/cmath</code></td><td style="text-align: left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/climits</code></td><td style="text-align: left"><code class="filename">tr1/cstdarg</code></td><td style="text-align: left"><code class="filename">tr1/cstdbool</code></td><td style="text-align: left"><code class="filename">tr1/cstdint</code></td><td style="text-align: left"><code class="filename">tr1/cstdio</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/cstdlib</code></td><td style="text-align: left"><code class="filename">tr1/ctgmath</code></td><td style="text-align: left"><code class="filename">tr1/ctime</code></td><td style="text-align: left"><code class="filename">tr1/cwchar</code></td><td style="text-align: left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>Decimal floating-point arithmetic is available if the C++
+</p><div class="table"><a id="id627620"/><p class="title"><strong>Table 3.6. C++ TR 1 Library Headers</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/array</code></td><td style="text-align: left"><code class="filename">tr1/complex</code></td><td style="text-align: left"><code class="filename">tr1/memory</code></td><td style="text-align: left"><code class="filename">tr1/functional</code></td><td style="text-align: left"><code class="filename">tr1/random</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/regex</code></td><td style="text-align: left"><code class="filename">tr1/tuple</code></td><td style="text-align: left"><code class="filename">tr1/type_traits</code></td><td style="text-align: left"><code class="filename">tr1/unordered_map</code></td><td style="text-align: left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/utility</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id627761"/><p class="title"><strong>Table 3.7. C++ TR 1 Library Headers for C Library Facilities</strong></p><div class="table-contents"><table summary="C++ TR 1 Library Headers for C Library Facilities" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">tr1/ccomplex</code></td><td style="text-align: left"><code class="filename">tr1/cfenv</code></td><td style="text-align: left"><code class="filename">tr1/cfloat</code></td><td style="text-align: left"><code class="filename">tr1/cmath</code></td><td style="text-align: left"><code class="filename">tr1/cinttypes</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/climits</code></td><td style="text-align: left"><code class="filename">tr1/cstdarg</code></td><td style="text-align: left"><code class="filename">tr1/cstdbool</code></td><td style="text-align: left"><code class="filename">tr1/cstdint</code></td><td style="text-align: left"><code class="filename">tr1/cstdio</code></td></tr><tr><td style="text-align: left"><code class="filename">tr1/cstdlib</code></td><td style="text-align: left"><code class="filename">tr1/ctgmath</code></td><td style="text-align: left"><code class="filename">tr1/ctime</code></td><td style="text-align: left"><code class="filename">tr1/cwchar</code></td><td style="text-align: left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break"/><p>Decimal floating-point arithmetic is available if the C++
compiler supports scalar decimal floating-point types defined via
<code class="code">__attribute__((mode(SD|DD|LD)))</code>.
-</p><div class="table"><a id="id457928"/><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col style="text-align: left" class="c1"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
+</p><div class="table"><a id="id627936"/><p class="title"><strong>Table 3.8. C++ TR 24733 Decimal Floating-Point Header</strong></p><div class="table-contents"><table summary="C++ TR 24733 Decimal Floating-Point Header" border="1"><colgroup><col style="text-align: left" class="c1"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">decimal/decimal</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
Also included are files for the C++ ABI interface:
-</p><div class="table"><a id="id457974"/><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cxxabi.h</code></td><td style="text-align: left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
+</p><div class="table"><a id="id627982"/><p class="title"><strong>Table 3.9. C++ ABI Headers</strong></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">cxxabi.h</code></td><td style="text-align: left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break"/><p>
And a large variety of extensions.
-</p><div class="table"><a id="id458027"/><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">ext/algorithm</code></td><td style="text-align: left"><code class="filename">ext/atomicity.h</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/cast.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/codecvt_specializations.h</code></td><td style="text-align: left"><code class="filename">ext/concurrence.h</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/enc_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/functional</code></td><td style="text-align: left"><code class="filename">ext/iterator</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/memory</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/numeric</code></td><td style="text-align: left"><code class="filename">ext/numeric_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/pod_char_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/rb_tree</code></td><td style="text-align: left"><code class="filename">ext/rope</code></td><td style="text-align: left"><code class="filename">ext/slist</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/stdio_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/typelist.h</code></td><td style="text-align: left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id458325"/><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">debug/bitset</code></td><td style="text-align: left"><code class="filename">debug/deque</code></td><td style="text-align: left"><code class="filename">debug/list</code></td><td style="text-align: left"><code class="filename">debug/map</code></td><td style="text-align: left"><code class="filename">debug/set</code></td></tr><tr><td style="text-align: left"><code class="filename">debug/string</code></td><td style="text-align: left"><code class="filename">debug/unordered_map</code></td><td style="text-align: left"><code class="filename">debug/unordered_set</code></td><td style="text-align: left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id458448"/><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">profile/bitset</code></td><td style="text-align: left"><code class="filename">profile/deque</code></td><td style="text-align: left"><code class="filename">profile/list</code></td><td style="text-align: left"><code class="filename">profile/map</code></td></tr><tr><td style="text-align: left"><code class="filename">profile/set</code></td><td style="text-align: left"><code class="filename">profile/unordered_map</code></td><td style="text-align: left"><code class="filename">profile/unordered_set</code></td><td style="text-align: left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id458559"/><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">parallel/algorithm</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break"/></div><div class="section" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"/>Mixing Headers</h3></div></div></div><p> A few simple rules.
+</p><div class="table"><a id="id628036"/><p class="title"><strong>Table 3.10. Extension Headers</strong></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">ext/algorithm</code></td><td style="text-align: left"><code class="filename">ext/atomicity.h</code></td><td style="text-align: left"><code class="filename">ext/array_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/bitmap_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/cast.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/codecvt_specializations.h</code></td><td style="text-align: left"><code class="filename">ext/concurrence.h</code></td><td style="text-align: left"><code class="filename">ext/debug_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/enc_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/extptr_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/functional</code></td><td style="text-align: left"><code class="filename">ext/iterator</code></td><td style="text-align: left"><code class="filename">ext/malloc_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/memory</code></td><td style="text-align: left"><code class="filename">ext/mt_allocator.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/new_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/numeric</code></td><td style="text-align: left"><code class="filename">ext/numeric_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td style="text-align: left"><code class="filename">ext/pb_ds/priority_queue.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/pod_char_traits.h</code></td><td style="text-align: left"><code class="filename">ext/pool_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/rb_tree</code></td><td style="text-align: left"><code class="filename">ext/rope</code></td><td style="text-align: left"><code class="filename">ext/slist</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/stdio_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/stdio_sync_filebuf.h</code></td><td style="text-align: left"><code class="filename">ext/throw_allocator.h</code></td><td style="text-align: left"><code class="filename">ext/typelist.h</code></td><td style="text-align: left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td style="text-align: left"><code class="filename">ext/vstring.h</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id628333"/><p class="title"><strong>Table 3.11. Extension Debug Headers</strong></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/><col style="text-align: left" class="c5"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">debug/bitset</code></td><td style="text-align: left"><code class="filename">debug/deque</code></td><td style="text-align: left"><code class="filename">debug/list</code></td><td style="text-align: left"><code class="filename">debug/map</code></td><td style="text-align: left"><code class="filename">debug/set</code></td></tr><tr><td style="text-align: left"><code class="filename">debug/string</code></td><td style="text-align: left"><code class="filename">debug/unordered_map</code></td><td style="text-align: left"><code class="filename">debug/unordered_set</code></td><td style="text-align: left"><code class="filename">debug/vector</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id628456"/><p class="title"><strong>Table 3.12. Extension Profile Headers</strong></p><div class="table-contents"><table summary="Extension Profile Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/><col style="text-align: left" class="c3"/><col style="text-align: left" class="c4"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">profile/bitset</code></td><td style="text-align: left"><code class="filename">profile/deque</code></td><td style="text-align: left"><code class="filename">profile/list</code></td><td style="text-align: left"><code class="filename">profile/map</code></td></tr><tr><td style="text-align: left"><code class="filename">profile/set</code></td><td style="text-align: left"><code class="filename">profile/unordered_map</code></td><td style="text-align: left"><code class="filename">profile/unordered_set</code></td><td style="text-align: left"><code class="filename">profile/vector</code></td></tr></tbody></table></div></div><br class="table-break"/><p/><div class="table"><a id="id628568"/><p class="title"><strong>Table 3.13. Extension Parallel Headers</strong></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col style="text-align: left" class="c1"/><col style="text-align: left" class="c2"/></colgroup><tbody><tr><td style="text-align: left"><code class="filename">parallel/algorithm</code></td><td style="text-align: left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break"/></div><div class="section" title="Mixing Headers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"/>Mixing Headers</h3></div></div></div><p> A few simple rules.
</p><p>First, mixing different dialects of the standard headers is not
possible. It's an all-or-nothing affair. Thus, code like
</p><pre class="programlisting">
@@ -101,4 +101,4 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
. /mnt/share/bld/H-x86-gcc.20071201/include/c++/4.3.0/iostream
. /mnt/share/bld/H-x86-gcc.20071201include/c++/4.3.0/string
</pre><p>The exclamation point to the left of the <code class="code">stdc++.h.gch</code> listing means that the generated PCH file was used, and thus the </p><p/><p> Detailed information about creating precompiled header files can be found in the GCC <a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html">documentation</a>.
-</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 3. Using </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Macros</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_macros.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 3. Using </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Macros</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html
index 3e124e90984..6fdd4bd8af0 100644
--- a/libstdc++-v3/doc/html/manual/using_macros.html
+++ b/libstdc++-v3/doc/html/manual/using_macros.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Macros</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_headers.html" title="Headers"/><link rel="next" href="using_namespaces.html" title="Namespaces"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Macros</th></tr><tr><td align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr></table><hr/></div><div class="section" title="Macros"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.macros"/>Macros</h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Macros</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_headers.html" title="Headers"/><link rel="next" href="using_namespaces.html" title="Namespaces"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Macros</th></tr><tr><td align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr></table><hr/></div><div class="section" title="Macros"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.macros"/>Macros</h2></div></div></div><p>
All library macros begin with <code class="code">_GLIBCXX_</code>.
</p><p>
Furthermore, all pre-processor macros, switches, and
@@ -74,4 +74,4 @@
</p></dd><dt><span class="term"><code class="code">_GLIBCXX_PROFILE</code></span></dt><dd><p>Undefined by default. When defined, compiles user code
using the <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">profile
mode</a>.
- </p></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr><tr><td align="left" valign="top">Headers </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Namespaces</td></tr></table></div></body></html>
+ </p></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_headers.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_namespaces.html">Next</a></td></tr><tr><td align="left" valign="top">Headers </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Namespaces</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/using_namespaces.html b/libstdc++-v3/doc/html/manual/using_namespaces.html
index ffd6c6f6376..17aeea322ad 100644
--- a/libstdc++-v3/doc/html/manual/using_namespaces.html
+++ b/libstdc++-v3/doc/html/manual/using_namespaces.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Namespaces</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_macros.html" title="Macros"/><link rel="next" href="using_dynamic_or_shared.html" title="Linking"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Namespaces</th></tr><tr><td align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr></table><hr/></div><div class="section" title="Namespaces"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.namespaces"/>Namespaces</h2></div></div></div><div class="section" title="Available Namespaces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.namespaces.all"/>Available Namespaces</h3></div></div></div><p> There are three main namespaces.
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Namespaces</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="using.html" title="Chapter 3. Using"/><link rel="prev" href="using_macros.html" title="Macros"/><link rel="next" href="using_dynamic_or_shared.html" title="Linking"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Namespaces</th></tr><tr><td align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr></table><hr/></div><div class="section" title="Namespaces"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.using.namespaces"/>Namespaces</h2></div></div></div><div class="section" title="Available Namespaces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.namespaces.all"/>Available Namespaces</h3></div></div></div><p> There are three main namespaces.
</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"><p>std</p><p>The ISO C++ standards specify that "all library entities are defined
within namespace std." This includes namespaces nested
within <code class="code">namespace std</code>, such as <code class="code">namespace
@@ -58,4 +58,4 @@ namespace gtk
std::string;</code> (depending on whether the system has
libstdc++ in <code class="code">std::</code> or not). (ideas from
Llewelly and Karl Nelson)
-</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr><tr><td align="left" valign="top">Macros </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Linking</td></tr></table></div></body></html>
+</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="using_macros.html">Prev</a> </td><td align="center"><a accesskey="u" href="using.html">Up</a></td><td align="right"> <a accesskey="n" href="using_dynamic_or_shared.html">Next</a></td></tr><tr><td align="left" valign="top">Macros </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Linking</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/utilities.html b/libstdc++-v3/doc/html/manual/utilities.html
index 61dc2c8c862..8b718138812 100644
--- a/libstdc++-v3/doc/html/manual/utilities.html
+++ b/libstdc++-v3/doc/html/manual/utilities.html
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 6.  Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="bk01pt02ch05s02.html" title="Concept Checking"/><link rel="next" href="pairs.html" title="Pairs"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. 
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 6.  Utilities</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; "/><meta name="keywords" content="&#10; ISO C++&#10; , &#10; runtime&#10; , &#10; library&#10; "/><link rel="home" href="../index.html" title="The GNU C++ Library"/><link rel="up" href="bk01pt02.html" title="Part II.  Standard Contents"/><link rel="prev" href="bk01pt02ch05s02.html" title="Concept Checking"/><link rel="next" href="pairs.html" title="Pairs"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. 
Utilities
</th></tr><tr><td align="left"><a accesskey="p" href="bk01pt02ch05s02.html">Prev</a> </td><th width="60%" align="center">Part II. 
Standard Contents
</th><td align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr/></div><div class="chapter" title="Chapter 6.  Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="std.util"/>Chapter 6. 
Utilities
- <a id="id462878" class="indexterm"/>
-</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section" title="Functors"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.functors"/>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
+ <a id="id632871" class="indexterm"/>
+</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id633362">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#id633392">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#id633502">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id634511">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#id634689">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#id634759">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#id634881">Dual C++0x and TR1 Implementation</a></span></dt><dt><span class="section"><a href="memory.html#id634937">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#id635086">Examples</a></span></dt><dt><span class="section"><a href="memory.html#id635116">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section" title="Functors"><div class="titlepage"><div><div><h2 class="title"><a id="std.util.functors"/>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as chapter of their STL, in
<a class="link" href="http://www.sgi.com/tech/stl/functors.html">their
http://www.sgi.com/tech/stl/functors.html</a>.
- </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt02ch05s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr><tr><td align="left" valign="top">Concept Checking </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Pairs</td></tr></table></div></body></html>
+ </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="bk01pt02ch05s02.html">Prev</a> </td><td align="center"><a accesskey="u" href="bk01pt02.html">Up</a></td><td align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr><tr><td align="left" valign="top">Concept Checking </td><td align="center"><a accesskey="h" href="../index.html">Home</a></td><td align="right" valign="top"> Pairs</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/spine.html b/libstdc++-v3/doc/html/spine.html
deleted file mode 100644
index e3522b7daaf..00000000000
--- a/libstdc++-v3/doc/html/spine.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="spine.html" title="The GNU C++ Library"/><link rel="next" href="manual/spine.html" title="The GNU C++ Library Manual"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td align="left"> </td><th width="60%" align="center"> </th><td align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr></table><hr/></div><div class="set" title="The GNU C++ Library" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"/>The GNU C++ Library</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname"/> <span class="surname"/></h3></div><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- <a class="link" href="http://www.fsf.org">FSF</a>
- </p></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="book"><a href="manual/spine.html">The GNU C++ Library Manual</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I.
- Introduction
-
-</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/status.html">1. Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#manual.intro.status.iso">Implementation Status</a></span></dt><dd><dl><dt><span class="section"><a href="manual/status.html#status.iso.1998">C++ 1998/2003</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.200x">C++ 200x</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr1">C++ TR1</a></span></dt><dt><span class="section"><a href="manual/status.html#status.iso.tr24733">C++ TR 24733</a></span></dt></dl></dd><dt><span class="section"><a href="manual/license.html">License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="section"><a href="manual/license.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bugs.html">Bugs</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="section"><a href="manual/bugs.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/setup.html">2. Setup</a></span></dt><dd><dl><dt><span class="section"><a href="manual/setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="section"><a href="manual/make.html">Make</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using.html#manual.intro.using.flags">Command Options</a></span></dt><dt><span class="section"><a href="manual/using_headers.html">Headers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="section"><a href="manual/using_headers.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_macros.html">Macros</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html">Namespaces</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="section"><a href="manual/using_namespaces.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_dynamic_or_shared.html">Linking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.freestanding">Almost Nothing</a></span></dt><dt><span class="section"><a href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">Finding Dynamic or Shared Libraries</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_concurrency.html">Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="section"><a href="manual/using_concurrency.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="section"><a href="manual/using_exceptions.html">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.propagating">Exception Neutrality</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.no">Doing without</a></span></dt><dt><span class="section"><a href="manual/using_exceptions.html#intro.using.exception.compat">Compatibility</a></span></dt></dl></dd><dt><span class="section"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.races">Data Race Hunting</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt><dt><span class="section"><a href="manual/debug.html#debug.profile_mode">Profile-based Performance Analysis</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt02.html">II.
- Standard Contents
- </a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/support.html">4.
- Support
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="manual/support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="manual/support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="manual/support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="manual/dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="manual/termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="manual/termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="manual/termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/diagnostics.html">5.
- Diagnostics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="manual/diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt02ch05s02.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/utilities.html">6.
- Utilities
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="manual/pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="manual/memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="manual/memory.html#std.util.memory.allocator">Allocators</a></span></dt><dt><span class="section"><a href="manual/memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dt><span class="section"><a href="manual/memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt></dl></dd><dt><span class="section"><a href="manual/traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/strings.html">7.
- Strings
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="manual/strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="manual/strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/localization.html">8.
- Localization
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="manual/localization.html#std.localization.locales.locale">locale</a></span></dt></dl></dd><dt><span class="section"><a href="manual/facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="manual/facets.html#std.localization.facet.ctype">ctype</a></span></dt><dt><span class="section"><a href="manual/facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dt><span class="section"><a href="manual/facets.html#manual.localization.facet.messages">messages</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/containers.html">9.
- Containers
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers.html#containers.sequences.list">list</a></span></dt><dt><span class="section"><a href="manual/containers.html#containers.sequences.vector">vector</a></span></dt></dl></dd><dt><span class="section"><a href="manual/associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="manual/associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="manual/associative.html#containers.associative.bitset">bitset</a></span></dt></dl></dd><dt><span class="section"><a href="manual/containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/iterators.html">10.
- Iterators
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="manual/iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/algorithms.html">11.
- Algorithms
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="manual/algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/numerics.html">12.
- Numerics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="manual/numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="manual/numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/io.html">13.
- Input and Output
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="manual/streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="manual/streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="manual/stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="manual/stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="manual/fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="manual/fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="manual/fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="manual/io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="manual/io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="manual/io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/atomics.html">14.
- Atomics
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/atomics.html#std.atomics.api">API Reference</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/concurrency.html">15.
- Concurrency
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/extensions.html">III.
- Extensions
-
-</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt03pr01.html"/></span></dt><dt><span class="chapter"><a href="manual/ext_compile_checks.html">16. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">17. Debug Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s02.html">Semantics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch17s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch17s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">18. Parallel Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s02.html">Semantics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html">Using</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch18s04.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch18s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch18s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/profile_mode.html">19. Profile Mode</a></span></dt><dd><dl><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.intro">Intro</a></span></dt><dd><dl><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.using">Using the Profile Mode</a></span></dt><dt><span class="section"><a href="manual/profile_mode.html#manual.ext.profile_mode.tuning">Tuning the Profile Mode</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s02.html">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.wrapper">Wrapper Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.instrumentation">Instrumentation</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.rtlib">Run Time Behavior</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.analysis">Analysis and Diagnostics</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.cost-model">Cost Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.reports">Reports</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s02.html#manual.ext.profile_mode.design.testing">Testing</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s03.html">Extensions for Custom Containers</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s04.html">Empirical Cost Model</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html">Implementation Issues</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stack">Stack Traces</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.symbols">Symbolization of Instruction Addresses</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.concurrency">Concurrency</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.stdlib-in-proflib">Using the Standard Library in the Instrumentation Implementation</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.malloc-hooks">Malloc Hooks</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s05.html#manual.ext.profile_mode.implementation.construction-destruction">Construction and Destruction of Global Objects</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s06.html">Developer Information</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s06.html#manual.ext.profile_mode.developer.bigpic">Big Picture</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s06.html#manual.ext.profile_mode.developer.howto">How To Add A Diagnostic</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch19s07.html">Diagnostics</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.template">Diagnostic Template</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.containers">Containers</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.algorithms">Algorithms</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.locality">Data Locality</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.mthread">Multithreaded Data Access</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch19s07.html#manual.ext.profile_mode.analysis.statistics">Statistics</a></span></dt></dl></dd><dt><span class="bibliography"><a href="manual/profile_mode.html#profile_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_allocators.html">20. Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="manual/ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="manual/ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="section"><a href="manual/ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="manual/bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/ext_containers.html">21. Containers</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s02.html">HP/SGI</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch21s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_utilities.html">22. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/ext_algorithms.html">23. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/ext_numerics.html">24. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/ext_iterators.html">25. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/ext_io.html">26. Input and Output</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/ext_demangling.html">27. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/ext_concurrency.html">28. Concurrency</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="manual/ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch28s02.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01pt03ch28s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="section"><a href="manual/bk01pt03ch28s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01pt03ch28s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/bk01pt04.html">IV.
- Appendices
-</a></span></dt><dd><dl><dt><span class="appendix"><a href="manual/appendix_contributing.html">A.
- Contributing
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="manual/appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="manual/source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="manual/source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="manual/source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="manual/source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="manual/source_design_notes.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/appendix_porting.html">B.
- Porting and Maintenance
-
-</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="section"><a href="manual/appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="section"><a href="manual/documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><span class="section"><a href="manual/documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dt><span class="section"><a href="manual/documentation_hacking.html#doc.docbook">Docbook</a></span></dt></dl></dd><dt><span class="section"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="section"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="section"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="section"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="section"><a href="manual/test.html#test.organization">Organization</a></span></dt><dt><span class="section"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="section"><a href="manual/test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="section"><a href="manual/test.html#test.harness">Test Harness and Utilities</a></span></dt><dt><span class="section"><a href="manual/test.html#test.special">Special Topics</a></span></dt></dl></dd><dt><span class="section"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="section"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dt><span class="section"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="section"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="section"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_440"><code class="constant">4.4</code></a></span></dt><dt><span class="section"><a href="manual/api.html#api.rel_450"><code class="constant">4.5</code></a></span></dt></dl></dd><dt><span class="section"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="section"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dt><span class="section"><a href="manual/backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C.
- Free Software Needs Free Documentation
-
-</a></span></dt><dt><span class="appendix"><a href="manual/appendix_gpl.html">D.
- <acronym class="acronym">GNU</acronym> General Public License version 3
- </a></span></dt><dt><span class="appendix"><a href="manual/appendix_gfdl.html">E. GNU Free Documentation License</a></span></dt></dl></dd></dl></dd><dt><span class="book"><a href="bk02.html"/></span></dt><dd><dl><dt><span class="article"><a href="api.html">The GNU C++ Library API Reference</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"/></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"> </td><td align="center"> </td><td align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr><tr><td align="left" valign="top"> </td><td align="center"> </td><td align="right" valign="top"> The GNU C++ Library Manual</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/xml/api.xml b/libstdc++-v3/doc/xml/api.xml
index dcd88d7e360..7c02dffc841 100644
--- a/libstdc++-v3/doc/xml/api.xml
+++ b/libstdc++-v3/doc/xml/api.xml
@@ -20,12 +20,12 @@
</copyright>
<legalnotice>
<para>
- <link linkend="manual.intro.status.license">License
+ <link linkend="manual.intro.status.license">License
</link>
</para>
</legalnotice>
</info>
-
+
<para>
The GNU C++ library sources have been specially formatted so that
with the proper invocation of another tool (Doxygen), a set of
@@ -79,6 +79,12 @@
</listitem>
<listitem>
<para>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.6/index.html">for the 4.6 release
+ </link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html">"the latest collection"
</link>
(For the main development tree; see the date on the first page.)
diff --git a/libstdc++-v3/doc/xml/manual/spine.xml b/libstdc++-v3/doc/xml/manual/spine.xml
index fd4b6fd910a..806f4ec118d 100644
--- a/libstdc++-v3/doc/xml/manual/spine.xml
+++ b/libstdc++-v3/doc/xml/manual/spine.xml
@@ -1,11 +1,21 @@
-<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="manual-index">
+<book xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="manual" xreflabel="Manual">
<?dbhtml dir="manual"?>
-<?dbhtml filename="spine.html"?>
+<?dbhtml filename="index.html"?>
<title>The GNU C++ Library Manual</title>
<info>
<copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <year>2002</year>
+ <year>2003</year>
+ <year>2004</year>
+ <year>2005</year>
+ <year>2006</year>
+ <year>2007</year>
+ <year>2008</year>
<year>2009</year>
<year>2010</year>
<year>2011</year>
@@ -13,11 +23,128 @@
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">FSF</link>
</holder>
</copyright>
- <legalnotice>
- <para>
- <link linkend="manual.intro.status.license">License</link>
- </para>
- </legalnotice>
+
+<authorgroup version="5.0">
+
+<!--
+ <author>
+ <firstname>Benjamin</firstname>
+ <surname>Kosnik</surname>
+
+ <affiliation>
+ <shortaffil>Red Hat</shortaffil>
+ <orgname>Red Hat, Inc.</orgname>
+ <address>
+ <email>libstdc++@gcc.gnu.org</email>
+ </address>
+ </affiliation>
+
+ <authorblurb>
+ <para>
+ </para>
+ </authorblurb>
+ </author>
+-->
+
+ <author><personname><firstname/><surname/></personname><personblurb>
+ <para>
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Paolo</firstname><surname>Carlini</surname></personname><personblurb>
+ <para>
+ TR1, LWG Active, Closed, Defects lists.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Phil</firstname><surname>Edwards</surname></personname><personblurb>
+ <para>
+ Originating author, started HOWTO and FAQ, worked on sections
+ Demangling, Macros, Strings, Iterators, Backwards
+ Compatibility, SGI Extensions, Configure, Build, Install.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Doug</firstname><surname>Gregor</surname></personname><personblurb>
+ <para>
+ Debug Mode, TR1 function objects
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname><personblurb>
+ <para>
+ Allocators, ABI, API evolution and deprecation history,
+ Backwards Compatibility, Thread, Debug Support, Locales,
+ Facets, Parallel Mode, Headers, Namespaces, Construction and
+ Structure, Using Exceptions, DocBook conversion and layout.
+ </para>
+ </personblurb></author>
+
+
+ <author><personname><firstname>Dhruv</firstname><surname>Matani</surname></personname><personblurb>
+ <para>
+ bitmap_allocator
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Jason</firstname><surname>Merrill</surname></personname><personblurb>
+ <para>
+ License, __verbose_terminate_handler
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Mark</firstname><surname>Mitchell</surname></personname><personblurb>
+ <para>
+ Porting
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Nathan</firstname><surname>Myers</surname></personname><personblurb>
+ <para>
+ Referenced counted string, C++1998 implementation status.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Felix</firstname><surname>Natter</surname></personname><personblurb>
+ <para>
+ Namespace composition, Backwards Compatibility.
+ </para>
+ </personblurb></author>
+
+
+ <author><personname><firstname>Stefan</firstname><surname>Olsson</surname></personname><personblurb>
+ <para>
+ mt_allocator
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
+ <para>
+ Profile mode
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
+ <para>
+ Parallel mode
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Ami</firstname><surname>Tavory</surname></personname><personblurb>
+ <para>
+ Policy Based Data Structures, Associative Containers, Unordered
+ Containers.
+ </para>
+ </personblurb></author>
+
+ <author><personname><firstname>Jonathan</firstname><surname>Wakely</surname></personname><personblurb>
+ <para>
+ shared_ptr, markup editing and styling
+ </para>
+ </personblurb></author>
+
+</authorgroup>
+
</info>
<!-- Part 01 : Intro -->
diff --git a/libstdc++-v3/doc/xml/spine.xml b/libstdc++-v3/doc/xml/spine.xml
index 5b12d48547d..5fd913e94d4 100644
--- a/libstdc++-v3/doc/xml/spine.xml
+++ b/libstdc++-v3/doc/xml/spine.xml
@@ -1,150 +1,68 @@
-<set xmlns="http://docbook.org/ns/docbook" version="5.0"
- xml:id="set-index"
+<set xmlns="http://docbook.org/ns/docbook" version="5.0"
+ xml:id="set-index"
xreflabel="The GNU C++ Library">
-<?dbhtml filename="spine.html"?>
-
- <title>The GNU C++ Library</title>
+<title>The GNU C++ Library</title>
+<?dbhtml filename="index.html"?>
<info>
- <copyright>
- <year>2000</year>
- <year>2001</year>
- <year>2002</year>
- <year>2003</year>
- <year>2004</year>
- <year>2005</year>
- <year>2006</year>
- <year>2007</year>
- <year>2008</year>
- <year>2009</year>
- <year>2010</year>
- <year>2011</year>
- <holder>
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org">FSF</link>
- </holder>
- </copyright>
-
-<authorgroup version="5.0">
-
-<!--
- <author>
- <firstname>Benjamin</firstname>
- <surname>Kosnik</surname>
-
- <affiliation>
- <shortaffil>Red Hat</shortaffil>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>libstdc++@gcc.gnu.org</email>
- </address>
- </affiliation>
-
- <authorblurb>
- <para>
- </para>
- </authorblurb>
- </author>
--->
-
- <author><personname><firstname/><surname/></personname><personblurb>
- <para>
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Paolo</firstname><surname>Carlini</surname></personname><personblurb>
- <para>
- TR1, LWG Active, Closed, Defects lists.
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Phil</firstname><surname>Edwards</surname></personname><personblurb>
- <para>
- Originating author, started HOWTO and FAQ, worked on sections
- Demangling, Macros, Strings, Iterators, Backwards
- Compatibility, SGI Extensions, Configure, Build, Install.
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Doug</firstname><surname>Gregor</surname></personname><personblurb>
- <para>
- Debug Mode, TR1 function objects
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Benjamin</firstname><surname>Kosnik</surname></personname><personblurb>
- <para>
- Allocators, ABI, API evolution and deprecation history,
- Backwards Compatibility, Thread, Debug Support, Locales,
- Facets, Parallel Mode, Headers, Namespaces, Construction and
- Structure, Using Exceptions, DocBook conversion and layout.
- </para>
- </personblurb></author>
-
-
- <author><personname><firstname>Dhruv</firstname><surname>Matani</surname></personname><personblurb>
- <para>
- bitmap_allocator
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Jason</firstname><surname>Merrill</surname></personname><personblurb>
- <para>
- License, __verbose_terminate_handler
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Mark</firstname><surname>Mitchell</surname></personname><personblurb>
- <para>
- Porting
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Nathan</firstname><surname>Myers</surname></personname><personblurb>
- <para>
- Referenced counted string, C++1998 implementation status.
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Felix</firstname><surname>Natter</surname></personname><personblurb>
- <para>
- Namespace composition, Backwards Compatibility.
- </para>
- </personblurb></author>
-
-
- <author><personname><firstname>Stefan</firstname><surname>Olsson</surname></personname><personblurb>
- <para>
- mt_allocator
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
- <para>
- Profile mode
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
- <para>
- Parallel mode
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Ami</firstname><surname>Tavory</surname></personname><personblurb>
- <para>
- Policy Based Data Structures, Associative Containers, Unordered
- Containers.
- </para>
- </personblurb></author>
-
- <author><personname><firstname>Jonathan</firstname><surname>Wakely</surname></personname><personblurb>
- <para>
- shared_ptr, markup editing and styling
- </para>
- </personblurb></author>
-
-</authorgroup>
-
+ <keywordset>
+ <keyword>
+ ISO C++
+ </keyword>
+ <keyword>
+ runtime
+ </keyword>
+ <keyword>
+ library
+ </keyword>
+ </keywordset>
+ <abstract xml:id="contents">
+ <title>Short Contents</title>
+
+ <para>
+ Copyright 2008, 2009, 2011
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.fsf.org/">FSF
+ </link>
+ </para>
+
+ <para>
+ 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 no Invariant Sections, with no
+ Front-Cover Texts, and with no Back-Cover Texts.
+ </para>
+
+ <para>
+ This is the top level of the libstdc++ documentation set. The
+ documentation is divided into the following three sections.
+ </para>
+
+ <para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <link linkend="manual">Manual</link>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <link linkend="faq">Frequently Asked Questions</link>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <link linkend="api">API and Source Documentation</link>
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+
+ </abstract>
</info>
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index e8a2946dcc3..8c61de311d4 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -176,41 +176,42 @@ namespace std
// Defined if inline namespaces are used for versioning.
-#define _GLIBCXX_INLINE_VERSION
+#define _GLIBCXX_INLINE_VERSION
// Inline namespace for symbol versioning.
#if _GLIBCXX_INLINE_VERSION
+
namespace std
{
- inline namespace _6 { }
+ inline namespace __7 { }
- namespace rel_ops { inline namespace _6 { } }
+ namespace rel_ops { inline namespace __7 { } }
namespace tr1
{
- inline namespace _6 { }
- namespace placeholders { inline namespace _6 { } }
- namespace regex_constants { inline namespace _6 { } }
- namespace __detail { inline namespace _6 { } }
+ inline namespace __7 { }
+ namespace placeholders { inline namespace __7 { } }
+ namespace regex_constants { inline namespace __7 { } }
+ namespace __detail { inline namespace __7 { } }
}
- namespace decimal { inline namespace _6 { } }
+ namespace decimal { inline namespace __7 { } }
- namespace chrono { inline namespace _6 { } }
- namespace placeholders { inline namespace _6 { } }
- namespace regex_constants { inline namespace _6 { } }
- namespace this_thread { inline namespace _6 { } }
+ namespace chrono { inline namespace __7 { } }
+ namespace placeholders { inline namespace __7 { } }
+ namespace regex_constants { inline namespace __7 { } }
+ namespace this_thread { inline namespace __7 { } }
- namespace __detail { inline namespace _6 { } }
- namespace __regex { inline namespace _6 { } }
+ namespace __detail { inline namespace __7 { } }
+ namespace __regex { inline namespace __7 { } }
}
namespace __gnu_cxx
{
- inline namespace _6 { }
- namespace __detail { inline namespace _6 { } }
+ inline namespace __7 { }
+ namespace __detail { inline namespace __7 { } }
}
-# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace _6 {
+# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __7 {
# define _GLIBCXX_END_NAMESPACE_VERSION }
#else
# define _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -227,7 +228,7 @@ namespace std
namespace __cxx1998
{
#if _GLIBCXX_INLINE_VERSION
- inline namespace _6 { }
+ inline namespace __7 { }
#endif
}
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index fab79157cdb..5b56875b493 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -218,7 +218,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
deque<_Tp, _Alloc>::
erase(iterator __first, iterator __last)
{
- if (__first == begin() && __last == end())
+ if (__first == __last)
+ return __first;
+ else if (__first == begin() && __last == end())
{
clear();
return end();
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index 5c740668b69..a125f3eb80a 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -213,10 +213,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Hashtable(const _Hashtable&);
- _Hashtable(_Hashtable&&)
- noexcept(__and_<is_nothrow_copy_constructible<_Equal>,
- is_nothrow_copy_constructible<_H1>>::value);
-
+ _Hashtable(_Hashtable&&);
+
_Hashtable&
operator=(const _Hashtable& __ht)
{
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 01ee5824cd9..0e74848ff3c 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -2768,7 +2768,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Type __arg = (__begin[__k % __n]
^ __begin[(__k + __p) % __n]
^ __begin[(__k - 1) % __n]);
- _Type __r1 = __arg ^ (__arg << 27);
+ _Type __r1 = __arg ^ (__arg >> 27);
__r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
1664525u, 0u>(__r1);
_Type __r2 = __r1;
@@ -2790,14 +2790,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Type __arg = (__begin[__k % __n]
+ __begin[(__k + __p) % __n]
+ __begin[(__k - 1) % __n]);
- _Type __r3 = __arg ^ (__arg << 27);
+ _Type __r3 = __arg ^ (__arg >> 27);
__r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value,
1566083941u, 0u>(__r3);
_Type __r4 = __r3 - __k % __n;
__r4 = __detail::__mod<_Type,
__detail::_Shift<_Type, 32>::__value>(__r4);
- __begin[(__k + __p) % __n] ^= __r4;
- __begin[(__k + __q) % __n] ^= __r3;
+ __begin[(__k + __p) % __n] ^= __r3;
+ __begin[(__k + __q) % __n] ^= __r4;
__begin[__k % __n] = __r4;
}
}
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 22443f4a4c1..bddecb0d4c5 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -838,7 +838,8 @@ template<typename _Alloc>
iterator
erase(iterator __first, iterator __last)
{
- _M_erase_at_end(std::copy(__last, end(), __first));
+ if (__first != __last)
+ _M_erase_at_end(std::copy(__last, end(), __first));
return __first;
}
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 1bc1013a78e..25b4b47418b 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -147,9 +147,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
vector<_Tp, _Alloc>::
erase(iterator __first, iterator __last)
{
- if (__last != end())
- _GLIBCXX_MOVE3(__last, end(), __first);
- _M_erase_at_end(__first.base() + (end() - __last));
+ if (__first != __last)
+ {
+ if (__last != end())
+ _GLIBCXX_MOVE3(__last, end(), __first);
+ _M_erase_at_end(__first.base() + (end() - __last));
+ }
return __first;
}
diff --git a/libstdc++-v3/include/c_global/cwchar b/libstdc++-v3/include/c_global/cwchar
index 5a33965777e..a2b1168f9a0 100644
--- a/libstdc++-v3/include/c_global/cwchar
+++ b/libstdc++-v3/include/c_global/cwchar
@@ -136,6 +136,8 @@ namespace std
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
using ::wint_t;
using ::btowc;
@@ -207,8 +209,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
using ::wcsstr;
using ::wmemchr;
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
inline wchar_t*
wcschr(wchar_t* __p, wchar_t __c)
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 08c1cdfd0b4..07b332b0191 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -464,7 +464,11 @@ namespace __debug
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
- if (__first.base() == _Base::begin() || __last.base() == _Base::end())
+
+ if (__first.base() == __last.base())
+ return __first;
+ else if (__first.base() == _Base::begin()
+ || __last.base() == _Base::end())
{
this->_M_detach_singular();
for (_Base_iterator __position = __first.base();
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 9d68d007c12..0f252a059dc 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -499,11 +499,16 @@ namespace __debug
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
- difference_type __offset = __first.base() - _Base::begin();
- _Base_iterator __res = _Base::erase(__first.base(),
- __last.base());
- this->_M_invalidate_after_nth(__offset);
- return iterator(__res, this);
+ if (__first.base() != __last.base())
+ {
+ difference_type __offset = __first.base() - _Base::begin();
+ _Base_iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_after_nth(__offset);
+ return iterator(__res, this);
+ }
+ else
+ return __first;
}
void
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits
index fe6ee3da6ee..67a5af4d804 100644
--- a/libstdc++-v3/include/std/limits
+++ b/libstdc++-v3/include/std/limits
@@ -1400,27 +1400,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
- /// numeric_limits<__int128_t> specialization.
+ /// numeric_limits<__int128> specialization.
template<>
- struct numeric_limits<__int128_t>
+ struct numeric_limits<__int128>
{
static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
- static _GLIBCXX_CONSTEXPR __int128_t
- min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (__int128_t); }
+ static _GLIBCXX_CONSTEXPR __int128
+ min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (__int128); }
- static _GLIBCXX_CONSTEXPR __int128_t
- max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (__int128_t); }
+ static _GLIBCXX_CONSTEXPR __int128
+ max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (__int128); }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
- static constexpr __int128_t
+ static constexpr __int128
lowest() noexcept { return min(); }
#endif
static _GLIBCXX_USE_CONSTEXPR int digits
- = __glibcxx_digits (__int128_t);
+ = __glibcxx_digits (__int128);
static _GLIBCXX_USE_CONSTEXPR int digits10
- = __glibcxx_digits10 (__int128_t);
+ = __glibcxx_digits10 (__int128);
#ifdef __GXX_EXPERIMENTAL_CXX0X__
static constexpr int max_digits10 = 0;
#endif
@@ -1429,10 +1429,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
static _GLIBCXX_USE_CONSTEXPR int radix = 2;
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
@@ -1447,21 +1447,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= denorm_absent;
static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
infinity() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__int128_t>(0); }
+ { return static_cast<__int128>(0); }
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
quiet_NaN() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__int128_t>(0); }
+ { return static_cast<__int128>(0); }
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
signaling_NaN() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__int128_t>(0); }
+ { return static_cast<__int128>(0); }
- static _GLIBCXX_CONSTEXPR __int128_t
+ static _GLIBCXX_CONSTEXPR __int128
denorm_min() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__int128_t>(0); }
+ { return static_cast<__int128>(0); }
static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
@@ -1474,27 +1474,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= round_toward_zero;
};
- /// numeric_limits<__uint128_t> specialization.
+ /// numeric_limits<unsigned __int128> specialization.
template<>
- struct numeric_limits<__uint128_t>
+ struct numeric_limits<unsigned __int128>
{
static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
- static _GLIBCXX_CONSTEXPR __uint128_t
- max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (__uint128_t); }
+ static _GLIBCXX_CONSTEXPR unsigned __int128
+ max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (unsigned __int128); }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
- static constexpr __uint128_t
+ static constexpr unsigned __int128
lowest() noexcept { return min(); }
#endif
static _GLIBCXX_USE_CONSTEXPR int digits
- = __glibcxx_digits (__uint128_t);
+ = __glibcxx_digits (unsigned __int128);
static _GLIBCXX_USE_CONSTEXPR int digits10
- = __glibcxx_digits10 (__uint128_t);
+ = __glibcxx_digits10 (unsigned __int128);
#ifdef __GXX_EXPERIMENTAL_CXX0X__
static constexpr int max_digits10 = 0;
#endif
@@ -1503,10 +1503,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
static _GLIBCXX_USE_CONSTEXPR int radix = 2;
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
@@ -1521,21 +1521,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= denorm_absent;
static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
infinity() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__uint128_t>(0); }
+ { return static_cast<unsigned __int128>(0); }
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
quiet_NaN() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__uint128_t>(0); }
+ { return static_cast<unsigned __int128>(0); }
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
signaling_NaN() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__uint128_t>(0); }
+ { return static_cast<unsigned __int128>(0); }
- static _GLIBCXX_CONSTEXPR __uint128_t
+ static _GLIBCXX_CONSTEXPR unsigned __int128
denorm_min() _GLIBCXX_USE_NOEXCEPT
- { return static_cast<__uint128_t>(0); }
+ { return static_cast<unsigned __int128>(0); }
static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index a03fb34e26e..a0208590bb5 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -215,11 +215,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
template<>
- struct __is_integral_helper<__int128_t>
+ struct __is_integral_helper<__int128>
: public true_type { };
template<>
- struct __is_integral_helper<__uint128_t>
+ struct __is_integral_helper<unsigned __int128>
: public true_type { };
#endif
@@ -1416,8 +1416,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
template<>
- struct __make_unsigned<__int128_t>
- { typedef __uint128_t __type; };
+ struct __make_unsigned<__int128>
+ { typedef unsigned __int128 __type; };
#endif
// Select between integral and enum: not possible to be both.
@@ -1498,8 +1498,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
template<>
- struct __make_signed<__uint128_t>
- { typedef __int128_t __type; };
+ struct __make_signed<unsigned __int128>
+ { typedef __int128 __type; };
#endif
// Select between integral and enum: not possible to be both.
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index d939a3fdab7..eba74dbdada 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -41,8 +41,11 @@ operator== (const std::type_info& arg) const
#if __GXX_MERGED_TYPEINFO_NAMES
return name () == arg.name ();
#else
+ /* The name() method will strip any leading '*' prefix. Therefore
+ take care to look at __name rather than name() when looking for
+ the "pointer" prefix. */
return (&arg == this)
- || (name ()[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
+ || (__name[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0));
#endif
}
diff --git a/libstdc++-v3/src/future.cc b/libstdc++-v3/src/future.cc
index 94ae6f170d5..8569bf0af3b 100644
--- a/libstdc++-v3/src/future.cc
+++ b/libstdc++-v3/src/future.cc
@@ -28,8 +28,6 @@ namespace
{
struct future_error_category : public std::error_category
{
- future_error_category() noexcept {}
-
virtual const char*
name() const noexcept
{ return "future"; }
diff --git a/libstdc++-v3/src/limits.cc b/libstdc++-v3/src/limits.cc
index a2fe468eca9..cc6acc21ea7 100644
--- a/libstdc++-v3/src/limits.cc
+++ b/libstdc++-v3/src/limits.cc
@@ -390,53 +390,53 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const float_round_style numeric_limits<unsigned long long>::round_style;
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
- const bool numeric_limits<__int128_t>::is_specialized;
- const int numeric_limits<__int128_t>::digits;
- const int numeric_limits<__int128_t>::digits10;
- const int numeric_limits<__int128_t>::max_digits10;
- const bool numeric_limits<__int128_t>::is_signed;
- const bool numeric_limits<__int128_t>::is_integer;
- const bool numeric_limits<__int128_t>::is_exact;
- const int numeric_limits<__int128_t>::radix;
- const int numeric_limits<__int128_t>::min_exponent;
- const int numeric_limits<__int128_t>::min_exponent10;
- const int numeric_limits<__int128_t>::max_exponent;
- const int numeric_limits<__int128_t>::max_exponent10;
- const bool numeric_limits<__int128_t>::has_infinity;
- const bool numeric_limits<__int128_t>::has_quiet_NaN;
- const bool numeric_limits<__int128_t>::has_signaling_NaN;
- const float_denorm_style numeric_limits<__int128_t>::has_denorm;
- const bool numeric_limits<__int128_t>::has_denorm_loss;
- const bool numeric_limits<__int128_t>::is_iec559;
- const bool numeric_limits<__int128_t>::is_bounded;
- const bool numeric_limits<__int128_t>::is_modulo;
- const bool numeric_limits<__int128_t>::traps;
- const bool numeric_limits<__int128_t>::tinyness_before;
- const float_round_style numeric_limits<__int128_t>::round_style;
-
- const bool numeric_limits<__uint128_t>::is_specialized;
- const int numeric_limits<__uint128_t>::digits;
- const int numeric_limits<__uint128_t>::digits10;
- const int numeric_limits<__uint128_t>::max_digits10;
- const bool numeric_limits<__uint128_t>::is_signed;
- const bool numeric_limits<__uint128_t>::is_integer;
- const bool numeric_limits<__uint128_t>::is_exact;
- const int numeric_limits<__uint128_t>::radix;
- const int numeric_limits<__uint128_t>::min_exponent;
- const int numeric_limits<__uint128_t>::min_exponent10;
- const int numeric_limits<__uint128_t>::max_exponent;
- const int numeric_limits<__uint128_t>::max_exponent10;
- const bool numeric_limits<__uint128_t>::has_infinity;
- const bool numeric_limits<__uint128_t>::has_quiet_NaN;
- const bool numeric_limits<__uint128_t>::has_signaling_NaN;
- const float_denorm_style numeric_limits<__uint128_t>::has_denorm;
- const bool numeric_limits<__uint128_t>::has_denorm_loss;
- const bool numeric_limits<__uint128_t>::is_iec559;
- const bool numeric_limits<__uint128_t>::is_bounded;
- const bool numeric_limits<__uint128_t>::is_modulo;
- const bool numeric_limits<__uint128_t>::traps;
- const bool numeric_limits<__uint128_t>::tinyness_before;
- const float_round_style numeric_limits<__uint128_t>::round_style;
+ const bool numeric_limits<__int128>::is_specialized;
+ const int numeric_limits<__int128>::digits;
+ const int numeric_limits<__int128>::digits10;
+ const int numeric_limits<__int128>::max_digits10;
+ const bool numeric_limits<__int128>::is_signed;
+ const bool numeric_limits<__int128>::is_integer;
+ const bool numeric_limits<__int128>::is_exact;
+ const int numeric_limits<__int128>::radix;
+ const int numeric_limits<__int128>::min_exponent;
+ const int numeric_limits<__int128>::min_exponent10;
+ const int numeric_limits<__int128>::max_exponent;
+ const int numeric_limits<__int128>::max_exponent10;
+ const bool numeric_limits<__int128>::has_infinity;
+ const bool numeric_limits<__int128>::has_quiet_NaN;
+ const bool numeric_limits<__int128>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<__int128>::has_denorm;
+ const bool numeric_limits<__int128>::has_denorm_loss;
+ const bool numeric_limits<__int128>::is_iec559;
+ const bool numeric_limits<__int128>::is_bounded;
+ const bool numeric_limits<__int128>::is_modulo;
+ const bool numeric_limits<__int128>::traps;
+ const bool numeric_limits<__int128>::tinyness_before;
+ const float_round_style numeric_limits<__int128>::round_style;
+
+ const bool numeric_limits<unsigned __int128>::is_specialized;
+ const int numeric_limits<unsigned __int128>::digits;
+ const int numeric_limits<unsigned __int128>::digits10;
+ const int numeric_limits<unsigned __int128>::max_digits10;
+ const bool numeric_limits<unsigned __int128>::is_signed;
+ const bool numeric_limits<unsigned __int128>::is_integer;
+ const bool numeric_limits<unsigned __int128>::is_exact;
+ const int numeric_limits<unsigned __int128>::radix;
+ const int numeric_limits<unsigned __int128>::min_exponent;
+ const int numeric_limits<unsigned __int128>::min_exponent10;
+ const int numeric_limits<unsigned __int128>::max_exponent;
+ const int numeric_limits<unsigned __int128>::max_exponent10;
+ const bool numeric_limits<unsigned __int128>::has_infinity;
+ const bool numeric_limits<unsigned __int128>::has_quiet_NaN;
+ const bool numeric_limits<unsigned __int128>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned __int128>::has_denorm;
+ const bool numeric_limits<unsigned __int128>::has_denorm_loss;
+ const bool numeric_limits<unsigned __int128>::is_iec559;
+ const bool numeric_limits<unsigned __int128>::is_bounded;
+ const bool numeric_limits<unsigned __int128>::is_modulo;
+ const bool numeric_limits<unsigned __int128>::traps;
+ const bool numeric_limits<unsigned __int128>::tinyness_before;
+ const float_round_style numeric_limits<unsigned __int128>::round_style;
#endif
// float
diff --git a/libstdc++-v3/src/system_error.cc b/libstdc++-v3/src/system_error.cc
index 818619942e4..3ee1d9b0b0a 100644
--- a/libstdc++-v3/src/system_error.cc
+++ b/libstdc++-v3/src/system_error.cc
@@ -34,8 +34,6 @@ namespace
struct generic_error_category : public std::error_category
{
- generic_error_category() {}
-
virtual const char*
name() const noexcept
{ return "generic"; }
@@ -51,8 +49,6 @@ namespace
struct system_error_category : public std::error_category
{
- system_error_category() {}
-
virtual const char*
name() const noexcept
{ return "system"; }
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc
index b39456bc9e4..d4dff3a14a8 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc
@@ -22,6 +22,7 @@
// libstdc++/40856
#ifdef _GLIBCXX_USE_INT128
-static_assert(std::numeric_limits<__int128_t>::is_specialized == true, "");
-static_assert(std::numeric_limits<__uint128_t>::is_specialized == true, "");
+static_assert(std::numeric_limits<__int128>::is_specialized == true, "");
+static_assert(std::numeric_limits<unsigned __int128>::is_specialized == true,
+ "");
#endif
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc
index d6b78d52c90..05e4e173d1a 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc
@@ -97,8 +97,8 @@ int main()
do_test<unsigned long long>();
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- do_test<__int128_t>();
- do_test<__uint128_t>();
+ do_test<__int128>();
+ do_test<unsigned __int128>();
#endif
do_test<float>();
do_test<double>();
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
index ab964ef98b9..0b410b55fe0 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
@@ -74,8 +74,8 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- do_test<__int128_t>();
- do_test<__uint128_t>();
+ do_test<__int128>();
+ do_test<unsigned __int128>();
#endif
do_test<float>();
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
index 571b4032b00..d4858244ee7 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
@@ -49,8 +49,8 @@ test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- VERIFY( std::numeric_limits<__int128_t>::max_digits10 == 0 );
- VERIFY( std::numeric_limits<__uint128_t>::max_digits10 == 0 );
+ VERIFY( std::numeric_limits<__int128>::max_digits10 == 0 );
+ VERIFY( std::numeric_limits<unsigned __int128>::max_digits10 == 0 );
#endif
const int f_max_digits10 = (2 + std::numeric_limits<float>::digits
diff --git a/libstdc++-v3/testsuite/20_util/bind/48698.cc b/libstdc++-v3/testsuite/20_util/bind/48698.cc
new file mode 100644
index 00000000000..a623735f3eb
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/bind/48698.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 20.7.11 Function template bind
+
+#include <functional>
+
+int f(int i);
+
+// Don't want placeholders to interfere with a possibly-versioned namespace.
+int g()
+{
+ std::bind(f, std::placeholders::_6);
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc
index 8f11924ae25..df9cfcaa5bc 100644
--- a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc
@@ -53,8 +53,8 @@ void test01()
#endif
#ifdef _GLIBCXX_USE_INT128
- VERIFY( (test_category<is_floating_point, __int128_t>(false)) );
- VERIFY( (test_category<is_floating_point, __uint128_t>(false)) );
+ VERIFY( (test_category<is_floating_point, __int128>(false)) );
+ VERIFY( (test_category<is_floating_point, unsigned __int128>(false)) );
#endif
// Sanity check.
diff --git a/libstdc++-v3/testsuite/20_util/is_integral/value.cc b/libstdc++-v3/testsuite/20_util/is_integral/value.cc
index 04a91091ad0..d085f92358f 100644
--- a/libstdc++-v3/testsuite/20_util/is_integral/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_integral/value.cc
@@ -53,8 +53,8 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- VERIFY( (test_category<is_integral, __int128_t>(true)) );
- VERIFY( (test_category<is_integral, __uint128_t>(true)) );
+ VERIFY( (test_category<is_integral, __int128>(true)) );
+ VERIFY( (test_category<is_integral, unsigned __int128>(true)) );
#endif
#ifdef _GLIBCXX_USE_FLOAT128
diff --git a/libstdc++-v3/testsuite/20_util/is_signed/value.cc b/libstdc++-v3/testsuite/20_util/is_signed/value.cc
index f407b42a9a9..d6394ff5037 100644
--- a/libstdc++-v3/testsuite/20_util/is_signed/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_signed/value.cc
@@ -51,8 +51,8 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- VERIFY( (test_category<is_signed, __int128_t>(true)) );
- VERIFY( (test_category<is_signed, __uint128_t>(false)) );
+ VERIFY( (test_category<is_signed, __int128>(true)) );
+ VERIFY( (test_category<is_signed, unsigned __int128>(false)) );
#endif
#ifdef _GLIBCXX_USE_FLOAT128
diff --git a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
index 7628c993653..41e05871a7b 100644
--- a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc
@@ -51,8 +51,8 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- VERIFY( (test_category<is_unsigned, __uint128_t>(true)) );
- VERIFY( (test_category<is_unsigned, __int128_t>(false)) );
+ VERIFY( (test_category<is_unsigned, unsigned __int128>(true)) );
+ VERIFY( (test_category<is_unsigned, __int128>(false)) );
#endif
#ifdef _GLIBCXX_USE_FLOAT128
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
index 28d17af8ad3..73cfddccb3c 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
@@ -59,11 +59,11 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- typedef make_signed<__uint128_t>::type test25_type;
- VERIFY( (is_same<test25_type, __int128_t>::value) );
+ typedef make_signed<unsigned __int128>::type test25_type;
+ VERIFY( (is_same<test25_type, __int128>::value) );
- typedef make_signed<__int128_t>::type test26_type;
- VERIFY( (is_same<test26_type, __int128_t>::value) );
+ typedef make_signed<__int128>::type test26_type;
+ VERIFY( (is_same<test26_type, __int128>::value) );
#endif
}
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
index 209ea61013c..adf3af4abd8 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
@@ -58,11 +58,11 @@ void test01()
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- typedef make_signed<__uint128_t>::type test25_type;
- VERIFY( (is_same<test25_type, __int128_t>::value) );
+ typedef make_signed<unsigned __int128>::type test25_type;
+ VERIFY( (is_same<test25_type, __int128>::value) );
- typedef make_signed<__int128_t>::type test26_type;
- VERIFY( (is_same<test26_type, __int128_t>::value) );
+ typedef make_signed<__int128>::type test26_type;
+ VERIFY( (is_same<test26_type, __int128>::value) );
#endif
}
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
index 021ac7e2f4f..44399851a19 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
@@ -54,17 +54,17 @@ void test01()
// Chapter 48, chapter 20. Smallest rank such that new unsigned type
// same size.
- typedef make_unsigned<test_enum>::type test24_type;
+ typedef make_unsigned<test_enum>::type test24_type;
VERIFY( is_unsigned<test24_type>::value );
VERIFY( sizeof(test24_type) == sizeof(test_enum) );
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- typedef make_unsigned<__uint128_t>::type test25_type;
- VERIFY( (is_same<test25_type, __uint128_t>::value) );
+ typedef make_unsigned<unsigned __int128>::type test25_type;
+ VERIFY( (is_same<test25_type, unsigned __int128>::value) );
- typedef make_unsigned<__int128_t>::type test26_type;
- VERIFY( (is_same<test26_type, __uint128_t>::value) );
+ typedef make_unsigned<__int128>::type test26_type;
+ VERIFY( (is_same<test26_type, unsigned __int128>::value) );
#endif
}
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
index da572624135..a1465d39fb2 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
@@ -53,16 +53,16 @@ void test01()
VERIFY( (is_same<test23_type, volatile wchar_t>::value) );
#endif
- typedef make_unsigned<test_enum>::type test24_type;
+ typedef make_unsigned<test_enum>::type test24_type;
VERIFY( (is_same<test24_type, unsigned short>::value) );
// GNU Extensions.
#ifdef _GLIBCXX_USE_INT128
- typedef make_unsigned<__uint128_t>::type test25_type;
- VERIFY( (is_same<test25_type, __uint128_t>::value) );
+ typedef make_unsigned<unsigned __int128>::type test25_type;
+ VERIFY( (is_same<test25_type, unsigned __int128>::value) );
- typedef make_unsigned<__int128_t>::type test26_type;
- VERIFY( (is_same<test26_type, __uint128_t>::value) );
+ typedef make_unsigned<__int128>::type test26_type;
+ VERIFY( (is_same<test26_type, unsigned __int128>::value) );
#endif
}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc
index 34d0f74f12a..79a046ed75e 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -31,7 +31,9 @@ void erase(size_t num_elm, size_t elm_strt, size_t elm_end)
x.erase(x.begin() + elm_strt, x.begin() + elm_end);
- const size_t min_num_cpy = std::min(elm_strt, num_elm - elm_end);
+ const size_t min_num_cpy
+ = elm_strt == elm_end ? 0 : std::min(elm_strt, num_elm - elm_end);
+
VERIFY( assignment_operator::count() == min_num_cpy );
}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc
new file mode 100644
index 00000000000..f534758a9d1
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/50529.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <deque>
+#include <testsuite_rvalref.h>
+
+// libstdc++/50529
+void test01()
+{
+ std::deque<__gnu_test::rvalstruct> d(10);
+
+ for (auto it = d.begin(); it != d.end(); ++it)
+ d.erase(it, it);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc
new file mode 100644
index 00000000000..d76bed53cef
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_rvalref.h>
+
+// libstdc++/50529
+void test01()
+{
+ std::vector<__gnu_test::rvalstruct> v(10);
+
+ for (auto it = v.begin(); it != v.end(); ++it)
+ v.erase(it, it);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
index eb77fb4837e..ba515b7fb6b 100644
--- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
@@ -25,4 +25,4 @@
#include <vector>
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 255 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 256 }
diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h
index 68c3252472b..03be0acac25 100644
--- a/libstdc++-v3/testsuite/util/testsuite_common_types.h
+++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h
@@ -305,8 +305,8 @@ namespace __gnu_test
typedef char16_t a14;
typedef char32_t a15;
# if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
- typedef __int128_t a16;
- typedef __uint128_t a17;
+ typedef __int128 a16;
+ typedef unsigned __int128 a17;
typedef node<_GLIBCXX_TYPELIST_CHAIN17(a1, a2, a3, a4, a5, a6, a7, a8, a9,
a10, a11, a12, a13, a14, a15,
@@ -317,8 +317,8 @@ namespace __gnu_test
# endif
#else
# if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
- typedef __int128_t a14;
- typedef __uint128_t a15;
+ typedef __int128 a14;
+ typedef unsigned __int128 a15;
typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9,
a10, a11, a12, a13, a14, a15)> type;
diff --git a/libstdc++-v3/testsuite/util/testsuite_error.h b/libstdc++-v3/testsuite/util/testsuite_error.h
index bb9ddd7cdea..69a90fbecfc 100644
--- a/libstdc++-v3/testsuite/util/testsuite_error.h
+++ b/libstdc++-v3/testsuite/util/testsuite_error.h
@@ -29,8 +29,6 @@ namespace __gnu_test
{
struct test_category : public std::error_category
{
- test_category() {}
-
virtual const char*
name() const noexcept
{
@@ -45,8 +43,6 @@ namespace __gnu_test
struct test_derived_category : public test_category
{
- test_derived_category() {}
-
virtual const char*
name() const noexcept
{
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 3fb20a9c0af..bf149e4b880 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,20 @@
+2011-10-02 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47247
+ * lto-plugin.c (get_symbols_v2): New variable.
+ (write_resolution): Use V2 API when available.
+ (onload): Handle LDPT_GET_SYMBOLS_V2.
+
+2011-09-30 H.J. Lu <hongjiu.lu@intel.com>
+ Andi Kleen <ak@linux.intel.com>
+
+ PR lto/50568
+ * lto-plugin.c (sym_aux): Change id to unsigned long long.
+ (plugin_symtab): Likewise.
+ (dump_symtab): Likewise.
+ (resolve_conflicts): Likewise.
+ (process_symtab): Likewise.
+
2011-08-10 Richard Guenther <rguenther@suse.de>
PR bootstrap/49907
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 4b5828b3912..d7a78136827 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -80,12 +80,13 @@ along with this program; see the file COPYING3. If not see
/* The part of the symbol table the plugin has to keep track of. Note that we
must keep SYMS until all_symbols_read is called to give the linker time to
- copy the symbol information. */
+ copy the symbol information.
+ The id must be 64bit to minimze collisions. */
struct sym_aux
{
uint32_t slot;
- unsigned id;
+ unsigned long long id;
unsigned next_conflict;
};
@@ -94,7 +95,7 @@ struct plugin_symtab
int nsyms;
struct sym_aux *aux;
struct ld_plugin_symbol *syms;
- unsigned id;
+ unsigned long long id;
};
/* Encapsulates object file data during symbol scan. */
@@ -129,7 +130,7 @@ enum symbol_style
static char *arguments_file_name;
static ld_plugin_register_claim_file register_claim_file;
static ld_plugin_register_all_symbols_read register_all_symbols_read;
-static ld_plugin_get_symbols get_symbols;
+static ld_plugin_get_symbols get_symbols, get_symbols_v2;
static ld_plugin_register_cleanup register_cleanup;
static ld_plugin_add_input_file add_input_file;
static ld_plugin_add_input_library add_input_library;
@@ -359,7 +360,8 @@ dump_symtab (FILE *f, struct plugin_symtab *symtab)
assert (resolution != LDPR_UNKNOWN);
- fprintf (f, "%u %x %s %s\n", (unsigned int) slot, symtab->aux[j].id,
+ fprintf (f, "%u %llx %s %s\n",
+ (unsigned int) slot, symtab->aux[j].id,
lto_resolution_str[resolution],
symtab->syms[j].name);
}
@@ -441,7 +443,12 @@ write_resolution (void)
struct plugin_symtab *symtab = &info->symtab;
struct ld_plugin_symbol *syms = symtab->syms;
- get_symbols (info->handle, symtab->nsyms, syms);
+ /* Version 2 of API supports IRONLY_EXP resolution that is
+ accepted by GCC-4.7 and newer. */
+ if (get_symbols_v2)
+ get_symbols_v2 (info->handle, symtab->nsyms, syms);
+ else
+ get_symbols (info->handle, symtab->nsyms, syms);
finish_conflict_resolution (symtab, &info->conflicts);
@@ -759,7 +766,7 @@ resolve_conflicts (struct plugin_symtab *t, struct plugin_symtab *conflicts)
{
SWAP (struct ld_plugin_symbol, *orig, *s);
SWAP (uint32_t, orig_aux->slot, aux->slot);
- SWAP (unsigned, orig_aux->id, aux->id);
+ SWAP (unsigned long long, orig_aux->id, aux->id);
/* Don't swap conflict chain pointer */
}
@@ -809,7 +816,7 @@ process_symtab (void *data, const char *name, off_t offset, off_t length)
s = strrchr (name, '.');
if (s)
- sscanf (s, ".%x", &obj->out->id);
+ sscanf (s, ".%llx", &obj->out->id);
secdata = xmalloc (length);
offset += obj->file->offset;
if (offset != lseek (obj->file->fd, offset, SEEK_SET)
@@ -986,6 +993,9 @@ onload (struct ld_plugin_tv *tv)
case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
register_all_symbols_read = p->tv_u.tv_register_all_symbols_read;
break;
+ case LDPT_GET_SYMBOLS_V2:
+ get_symbols_v2 = p->tv_u.tv_get_symbols;
+ break;
case LDPT_GET_SYMBOLS:
get_symbols = p->tv_u.tv_get_symbols;
break;