summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-22 20:53:05 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-22 20:53:05 +0000
commit63ef589f2f7692495607b3b753a7da2ef902676b (patch)
tree3f471e68277cbec114b5fe4a5f275c72e0e4c85c
parent66154889e7b55a7f3e0e0926b2c43a3bbf2d9d0c (diff)
downloadgcc-63ef589f2f7692495607b3b753a7da2ef902676b.tar.gz
Merged r157428 through r157652 into branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ifunc@157653 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog41
-rw-r--r--MAINTAINERS31
-rw-r--r--boehm-gc/ChangeLog57
-rw-r--r--boehm-gc/dyn_load.c21
-rw-r--r--boehm-gc/include/private/gc_priv.h14
-rw-r--r--boehm-gc/include/private/gcconfig.h2
-rw-r--r--boehm-gc/mark_rts.c26
-rw-r--r--boehm-gc/os_dep.c26
-rw-r--r--boehm-gc/ptr_chck.c2
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac4
-rw-r--r--contrib/ChangeLog6
-rwxr-xr-xcontrib/dg-extract-results.sh2
-rw-r--r--fixincludes/ChangeLog4
-rw-r--r--fixincludes/inclhack.def4
-rw-r--r--gcc/ChangeLog547
-rw-r--r--gcc/ChangeLog.graphite66
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in6
-rw-r--r--gcc/attribs.c4
-rw-r--r--gcc/builtins.c25
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/c-pretty-print.c7
-rw-r--r--gcc/cfgcleanup.c4
-rw-r--r--gcc/cfgexpand.c3
-rw-r--r--gcc/cgraph.h2
-rw-r--r--gcc/cgraphunit.c123
-rw-r--r--gcc/combine.c12
-rw-r--r--gcc/common.opt2
-rw-r--r--gcc/config/arm/arm.c115
-rw-r--r--gcc/config/i386/darwin.h2
-rw-r--r--gcc/config/i386/gmon-sol2.c2
-rw-r--r--gcc/config/i386/i386.c8
-rw-r--r--gcc/config/i386/i386.h2
-rw-r--r--gcc/config/i386/libgcc-glibc.ver6
-rw-r--r--gcc/config/pa/pa.md4
-rw-r--r--gcc/config/rs6000/dfp.md97
-rw-r--r--gcc/config/rs6000/linux64.h6
-rw-r--r--gcc/config/rs6000/linux64.opt4
-rw-r--r--gcc/config/rs6000/rs6000.c63
-rw-r--r--gcc/config/rs6000/rs6000.md106
-rw-r--r--gcc/config/sparc/sparc.c114
-rw-r--r--gcc/config/spu/spu.c10
-rw-r--r--gcc/cp/ChangeLog34
-rw-r--r--gcc/cp/decl2.c12
-rw-r--r--gcc/cp/method.c9
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/pt.c26
-rw-r--r--gcc/cp/tree.c7
-rw-r--r--gcc/cselib.c90
-rw-r--r--gcc/cselib.h9
-rw-r--r--gcc/doc/configfiles.texi6
-rw-r--r--gcc/doc/extend.texi3
-rw-r--r--gcc/doc/gimple.texi13
-rw-r--r--gcc/doc/invoke.texi38
-rw-r--r--gcc/doc/makefile.texi17
-rw-r--r--gcc/doc/sourcebuild.texi1242
-rw-r--r--gcc/dse.c5
-rw-r--r--gcc/dwarf2out.c17
-rw-r--r--gcc/fortran/ChangeLog54
-rw-r--r--gcc/fortran/decl.c12
-rw-r--r--gcc/fortran/expr.c10
-rw-r--r--gcc/fortran/ioparm.def2
-rw-r--r--gcc/fortran/lang.opt4
-rw-r--r--gcc/fortran/resolve.c18
-rw-r--r--gcc/fortran/trans-array.c14
-rw-r--r--gcc/fortran/trans-decl.c21
-rw-r--r--gcc/fortran/trans-expr.c5
-rw-r--r--gcc/fortran/trans-types.c4
-rw-r--r--gcc/gcse.c4
-rw-r--r--gcc/graphite-clast-to-gimple.c18
-rw-r--r--gcc/graphite-sese-to-poly.c159
-rw-r--r--gcc/graphite-sese-to-poly.h2
-rw-r--r--gcc/graphite.c2
-rw-r--r--gcc/ipa-struct-reorg.c1
-rw-r--r--gcc/ipa.c2
-rw-r--r--gcc/ira-lives.c18
-rw-r--r--gcc/lambda-code.c8
-rw-r--r--gcc/loop-invariant.c18
-rw-r--r--gcc/optabs.c5
-rw-r--r--gcc/params.def14
-rw-r--r--gcc/postreload.c6
-rw-r--r--gcc/recog.c8
-rw-r--r--gcc/regrename.c146
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/sched-deps.c4
-rw-r--r--gcc/simplify-rtx.c26
-rw-r--r--gcc/testsuite/ChangeLog226
-rwxr-xr-xgcc/testsuite/ada/acats/run_all.sh4
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle42.C14
-rw-r--r--gcc/testsuite/g++.dg/abi/packed1.C2
-rw-r--r--gcc/testsuite/g++.dg/conversion/simd3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto18.C6
-rw-r--r--gcc/testsuite/g++.dg/eh/pr43365.C30
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-17.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_pod.C1
-rw-r--r--gcc/testsuite/g++.dg/ext/is_pod_98.C16
-rw-r--r--gcc/testsuite/g++.dg/ext/vector9.C2
-rw-r--r--gcc/testsuite/g++.dg/graphite/pr43026.C2
-rw-r--r--gcc/testsuite/g++.dg/other/error23.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr43116.C9
-rw-r--r--gcc/testsuite/g++.dg/parse/crash56.C17
-rw-r--r--gcc/testsuite/g++.dg/torture/pr42450.C112
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43367.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr43415.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr43438.c23
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr43306.c9
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr43051-1.c57
-rw-r--r--gcc/testsuite/gcc.dg/pr18809-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr36997.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr42427.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr42917.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr43058.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr43211.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr43300.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr43305.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr43317.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr43379.c11
-rw-r--r--gcc/testsuite/gcc.dg/pr43402.c58
-rw-r--r--gcc/testsuite/gcc.dg/pr43419.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr43360.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb-andsi.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb1-mul-moves.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/push-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c1
-rw-r--r--gcc/testsuite/gfortran.dg/assign-debug.f908
-rw-r--r--gcc/testsuite/gfortran.dg/cray_pointers_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-pr43354.f18
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr43349.f35
-rw-r--r--gcc/testsuite/gfortran.dg/impure_constructor_1.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/inquire_size.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_27.f908
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_28.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr43475.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/read_empty_file.f7
-rw-r--r--gcc/testsuite/gfortran.dg/read_eof_all.f9071
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_15.f9032
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f909
-rw-r--r--gcc/testsuite/gnat.dg/case_optimization2.adb14
-rw-r--r--gcc/testsuite/gnat.dg/case_optimization_pkg2.adb23
-rw-r--r--gcc/testsuite/gnat.dg/case_optimization_pkg2.ads23
-rw-r--r--gcc/testsuite/gnat.dg/socket1.adb2
-rw-r--r--gcc/tree-cfg.c28
-rw-r--r--gcc/tree-cfgcleanup.c16
-rw-r--r--gcc/tree-chrec.c12
-rw-r--r--gcc/tree-eh.c20
-rw-r--r--gcc/tree-inline.c1
-rw-r--r--gcc/tree-outof-ssa.c39
-rw-r--r--gcc/tree-sra.c29
-rw-r--r--gcc/tree-ssa-pre.c68
-rw-r--r--gcc/tree-vect-stmts.c8
-rw-r--r--gcc/tree.h1
-rw-r--r--gcc/var-tracking.c765
-rw-r--r--gcc/varasm.c36
-rw-r--r--libffi/ChangeLog8
-rwxr-xr-xlibffi/configure23
-rw-r--r--libffi/configure.ac15
-rw-r--r--libffi/fficonfig.h.in3
-rw-r--r--libffi/src/x86/unix64.S4
-rw-r--r--libgcc/ChangeLog10
-rw-r--r--libgcc/config/i386/t-sol210
-rw-r--r--libgfortran/ChangeLog35
-rw-r--r--libgfortran/io/inquire.c11
-rw-r--r--libgfortran/io/io.h5
-rw-r--r--libgfortran/io/read.c13
-rw-r--r--libgfortran/io/transfer.c101
-rw-r--r--libgfortran/io/unix.c16
-rw-r--r--libgfortran/io/unix.h3
-rw-r--r--libgomp/ChangeLog10
-rw-r--r--libgomp/env.c17
-rw-r--r--libgomp/testsuite/libgomp.c/pr42942.c61
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/cp-demangle.c4
-rw-r--r--libiberty/testsuite/demangle-expected4
-rw-r--r--libjava/ChangeLog30
-rw-r--r--libjava/Makefile.am23
-rw-r--r--libjava/Makefile.in28
-rwxr-xr-xlibjava/configure107
-rw-r--r--libjava/configure.ac8
-rw-r--r--libjava/configure.host8
-rw-r--r--libjava/gcj/Makefile.in2
-rw-r--r--libjava/include/Makefile.in2
-rw-r--r--libjava/jvmti.cc1
-rw-r--r--libjava/libgcj-noncore-dummy.def7
-rw-r--r--libjava/testsuite/Makefile.in2
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libmudflap/testsuite/libmudflap.c/pass54-frag.c1
-rw-r--r--libstdc++-v3/ChangeLog323
-rw-r--r--libstdc++-v3/doc/xml/manual/debug_mode.xml30
-rw-r--r--libstdc++-v3/include/backward/auto_ptr.h6
-rw-r--r--libstdc++-v3/include/backward/binders.h6
-rw-r--r--libstdc++-v3/include/backward/hash_fun.h7
-rw-r--r--libstdc++-v3/include/backward/hash_map7
-rw-r--r--libstdc++-v3/include/backward/hash_set7
-rw-r--r--libstdc++-v3/include/backward/hashtable.h6
-rw-r--r--libstdc++-v3/include/backward/strstream7
-rw-r--r--libstdc++-v3/include/bits/algorithmfwd.h16
-rw-r--r--libstdc++-v3/include/bits/forward_list.h259
-rw-r--r--libstdc++-v3/include/bits/forward_list.tcc212
-rw-r--r--libstdc++-v3/include/bits/hashtable_policy.h35
-rw-r--r--libstdc++-v3/include/bits/random.h765
-rw-r--r--libstdc++-v3/include/bits/random.tcc54
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h3
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h8
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h173
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h125
-rw-r--r--libstdc++-v3/include/parallel/algo.h30
-rw-r--r--libstdc++-v3/include/parallel/algobase.h10
-rw-r--r--libstdc++-v3/include/parallel/algorithmfwd.h9
-rw-r--r--libstdc++-v3/include/parallel/base.h81
-rw-r--r--libstdc++-v3/include/parallel/compatibility.h8
-rw-r--r--libstdc++-v3/include/parallel/numeric11
-rw-r--r--libstdc++-v3/include/parallel/partial_sum.h3
-rw-r--r--libstdc++-v3/include/std/functional52
-rw-r--r--libstdc++-v3/include/tr1/hashtable_policy.h35
-rw-r--r--libstdc++-v3/testsuite/17_intro/freestanding.cc10
-rw-r--r--libstdc++-v3/testsuite/20_util/function/43397.cc78
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/creation/dr925.cc90
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/1.cc98
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/1.cc75
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/2.cc160
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/3.cc100
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/1.cc115
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/2.cc56
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/3.cc52
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/4.cc85
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/5.cc52
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/6.cc88
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/7.cc57
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/1.cc72
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc66
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/shuffle/1.cc67
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/2.cc (renamed from libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/1.cc)23
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/pod.cc (renamed from libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/3.cc)24
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/equal.cc (renamed from libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/4.cc)37
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/inequal.cc (renamed from libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/5.cc)37
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/inequal.cc51
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/equal.cc44
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/inequal.cc44
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/inequal.cc49
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/inequal.cc45
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/inequal.cc52
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/equal.cc44
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/inequal.cc44
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/equal.cc47
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/inequal.cc47
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/equal.cc47
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/inequal.cc47
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/inequal.cc51
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/inequal.cc48
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/inequal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/equal.cc43
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/inequal.cc43
-rw-r--r--lto-plugin/ChangeLog5
-rw-r--r--lto-plugin/lto-plugin.c7
289 files changed, 9196 insertions, 3013 deletions
diff --git a/ChangeLog b/ChangeLog
index 4af9c1ea90c..fb37e0e07d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2010-03-19 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR ada/42554
+ * configure.ac: Only pass -c to ranlib for darwin9 and earlier.
+ * configure: Regenerate.
+
+2010-03-18 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * MAINTAINERS: Update my email address.
+
+2010-03-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * MAINTAINERS (dwarak.rajagopal@amd.com): Removed.
+ (ghassan.shobaki@amd.com): Removed.
+
+2010-03-17 Alan Modra <amodra@gmail.com>
+
+ * MAINTAINERS: Update my email address.
+
+2010-03-16 Diego Novillo <dnovillo@google.com>
+
+ * MAINTAINERS: Remove Dan Hipschman, William Maddox and Chris
+ Matthews.
+
+2010-03-16 Joseph Myers <joseph@codesourcery.com>
+
+ * MAINTAINERS (Write After Approval): Remove Jim Blandy, Daniel
+ Gutson, Jeffrey D. Oldham and Mark Shinwell.
+
+2010-03-16 Joseph Myers <joseph@codesourcery.com>
+
+ * MAINTAINERS: Update my email address.
+
+2010-03-16 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * MAINTAINERS: Update my email address.
+
+2010-03-15 Bernd Schmidt <bernds@codesourcery.com>
+
+ * MAINTAINERS: Update my email address.
+
2010-03-09 Jie Zhang <jie@codesourcery.com>
* MAINTAINERS: Update my email address.
diff --git a/MAINTAINERS b/MAINTAINERS
index 8ed7af28ffd..caf163673d8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -30,7 +30,7 @@ Jason Merrill jason@redhat.com
David S. Miller davem@redhat.com
Mark Mitchell mark@codesourcery.com
Diego Novillo dnovillo@google.com
-Bernd Schmidt bernd.schmidt@analog.com
+Bernd Schmidt bernds@codesourcery.com
Ian Lance Taylor ian@airs.com
Jim Wilson wilson@codesourcery.com
@@ -47,7 +47,7 @@ arm port Paul Brook paul@codesourcery.com
avr port Denis Chertykov chertykov@gmail.com
avr port Anatoly Sokolov aesok@post.ru
avr port Eric Weddington eric.weddington@atmel.com
-bfin port Bernd Schmidt bernd.schmidt@analog.com
+bfin port Bernd Schmidt bernds@codesourcery.com
bfin port Jie Zhang jie@codesourcery.com
cris port Hans-Peter Nilsson hp@axis.com
crx port Pompapathi V Gadad Pompapathi.V.Gadad@nsc.com
@@ -128,7 +128,7 @@ windows, cygwin, mingw Dave Korn dave.korn.cygwin@gmail.com
Language Front Ends Maintainers
-C front end/ISO C99 Joseph Myers jsm@polyomino.org.uk
+C front end/ISO C99 Joseph Myers joseph@codesourcery.com
C front end/ISO C99 Richard Henderson rth@redhat.com
Ada front end Geert Bosch bosch@gnat.com
Ada front end Robert Dewar dewar@gnat.com
@@ -161,7 +161,7 @@ libffi testsuite Andreas Tobler andreast@gcc.gnu.org
libobjc Nicola Pero nicola.pero@meta-innovation.com
libobjc Andrew Pinski pinskia@gmail.com
loop discovery Michael Hayes m.hayes@elec.canterbury.ac.nz
-soft-fp Joseph Myers jsm@polyomino.org.uk
+soft-fp Joseph Myers joseph@codesourcery.com
scheduler (+ haifa) Jim Wilson wilson@codesourcery.com
scheduler (+ haifa) Michael Meissner gnu@the-meissners.org
scheduler (+ haifa) Jeff Law law@redhat.com
@@ -191,14 +191,14 @@ build status lists Janis Johnson janis187@us.ibm.com
config.sub/config.guess Ben Elliston config-patches@gnu.org
basic block reordering Jason Eckhardt jle@rice.edu
i18n Philipp Thomas pth@suse.de
-i18n Joseph Myers jsm@polyomino.org.uk
+i18n Joseph Myers joseph@codesourcery.com
diagnostic messages Gabriel Dos Reis gdr@integrable-solutions.net
build machinery (*.in) Paolo Bonzini bonzini@gnu.org
build machinery (*.in) DJ Delorie dj@redhat.com
build machinery (*.in) Nathanael Nerode neroden@gcc.gnu.org
build machinery (*.in) Alexandre Oliva aoliva@redhat.com
docs co-maintainer Gerald Pfeifer gerald@pfeifer.com
-docs co-maintainer Joseph Myers jsm@polyomino.org.uk
+docs co-maintainer Joseph Myers joseph@codesourcery.com
predict.def Jan Hubicka jh@suse.cz
contrib/regression Geoff Keating geoffk@geoffk.org
gcov Jan Hubicka jh@suse.cz
@@ -223,7 +223,7 @@ profile feedback Jan Hubicka jh@suse.cz
type-safe vectors Nathan Sidwell nathan@codesourcery.com
alias analysis Daniel Berlin dberlin@dberlin.org
reload Ulrich Weigand uweigand@de.ibm.com
-reload Bernd Schmidt bernd.schmidt@analog.com
+reload Bernd Schmidt bernds@codesourcery.com
dfp.c, related Ben Elliston bje@gnu.org
RTL optimizers Eric Botcazou ebotcazou@libertysurf.fr
auto-vectorizer Richard Guenther rguenther@suse.de
@@ -250,7 +250,7 @@ outside of the parts of the compiler they maintain.
dataflow Paolo Bonzini bonzini@gnu.org
dataflow Seongbae Park seongbae.park@gmail.com
dataflow Kenneth Zadeck zadeck@naturalbridge.com
-driver Joseph Myers jsm@polyomino.org.uk
+driver Joseph Myers joseph@codesourcery.com
Fortran Janne Blomqvist jb@gcc.gnu.org
Fortran Tobias Burnus burnus@net-b.de
Fortran Jerry DeLisle jvdelisle@gcc.gnu.org
@@ -298,7 +298,6 @@ David Billinghurst David.Billinghurst@riotinto.com
Tomas Bily tbily@suse.cz
Laurynas Biveinis laurynas.biveinis@gmail.com
Eric Blake ericb@gcc.gnu.org
-Jim Blandy jimb@codesourcery.com
Phil Blundell pb@futuretv.com
Hans Boehm hboehm@gcc.gnu.org
Segher Boessenkool segher@kernel.crashing.org
@@ -350,7 +349,6 @@ Jon Grimm jgrimm2@us.ibm.com
Laurent Guerby laurent@guerby.net
Xuepeng Guo xuepeng.guo@intel.com
Wei Guozhi carrot@google.com
-Daniel Gutson dgutson@codesourcery.com
Mostafa Hagog hagog@gcc.gnu.org
Olivier Hainque hainque@act-europe.fr
Stuart Hastings stuart@apple.com
@@ -359,13 +357,12 @@ Mark Heffernan meheff@google.com
George Helffrich george@gcc.gnu.org
Fergus Henderson fjh@cs.mu.oz.au
Matthew Hiller hiller@redhat.com
-Dan Hipschman dsh@google.com
Manfred Hollstein mh@suse.com
Falk Hueffner falk@debian.org
Andrew John Hughes gnu_andrew@member.fsf.org
Andy Hutchinson hutchinsonandy@aim.com
Bernardo Innocenti bernie@develer.com
-Daniel Jacobowitz dan@debian.org
+Daniel Jacobowitz dan@codesourcery.com
Andreas Jaeger aj@suse.de
Harsha Jagasia harsha.jagasia@amd.com
Fariborz Jahanian fjahanian@apple.com
@@ -404,18 +401,16 @@ Martin v. Löwis loewis@informatik.hu-berlin.de
H.J. Lu hjl.tools@gmail.com
Xinliang David Li davidxl@google.com
Luis Machado luisgpm@br.ibm.com
-William Maddox maddox@google.com
Ziga Mahkovec ziga.mahkovec@klika.si
Simon Martin simartin@users.sourceforge.net
Ranjit Mathew rmathew@hotmail.com
-Chris Matthews chrismatthews@google.com
Michael Matz matz@suse.de
Greg McGary gkm@gnu.org
Adam Megacz adam@xwt.org
Bingfeng Mei bmei@broadcom.com
Martin Michlmayr tbm@cyrius.com
Lee Millward lee.millward@gmail.com
-Alan Modra amodra@bigpond.net.au
+Alan Modra amodra@gmail.com
Alexander Monakov amonakov@ispras.ru
Catherine Moore clm@codesourcery.com
James A. Morrison phython@gcc.gnu.org
@@ -428,7 +423,6 @@ Dorit Nuzman dorit@il.ibm.com
David O'Brien obrien@FreeBSD.org
Carlos O'Donell carlos@codesourcery.com
Peter O'Gorman pogma@thewrittenword.com
-Jeffrey D. Oldham oldham@codesourcery.com
Andrea Ornstein andrea.ornstein@st.com
Seongbae Park seongbae.park@gmail.com
Devang Patel dpatel@apple.com
@@ -437,8 +431,7 @@ Nicolas Pitre nico@cam.org
Antoniu Pop antoniu.pop@gmail.com
Vladimir Prus vladimir@codesourcery.com
Jerry Quinn jlquinn@optonline.net
-Dwarakanath Rajagopal dwarak.rajagopal@amd.com
-Ramana Radhakrishnan ramana.r@gmail.com
+Ramana Radhakrishnan ramana.radhakrishnan@arm.com
Rolf Rasmussen rolfwr@gcc.gnu.org
Volker Reichelt v.reichelt@netcologne.de
Joern Rennecke amylaar@spamcop.net
@@ -456,8 +449,6 @@ Duncan Sands baldrick@gcc.gnu.org
Dodji Seketeli dseketel@redhat.com
Svein Seldal svein@dev.seldal.com
Thiemo Seufer ths@networkno.de
-Mark Shinwell shinwell@codesourcery.com
-Ghassan Shobaki ghassan.shobaki@amd.com
Johannes Singler singler@kit.edu
Franz Sirl franz.sirl-kernel@lauterbach.com
Jan Sjodin jan.sjodin@amd.com
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 542ddc1e0b6..0591dd6068a 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,60 @@
+2010-03-21 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR target/42811 (prerequisite)
+ * include/private/gc_priv.h (struct roots) [CYGWIN32]: Don't
+ declare r_next member on Cygwin as on other windows hosts.
+ (LOG_RT_SIZE) [CYGWIN32]: Don't define likewise.
+ (RT_SIZE) [CYGWIN32]: Likewise.
+ (struct _GC_arrays) [CYGWIN32]: Do declare _heap_bases[] member
+ likewise.
+ (GC_heap_bases) [CYGWIN32]: Do define likewise.
+ (struct _SYSTEM_INFO) [CYGWIN32]: Do forward-declare likewise.
+ (GC_sysinfo) [CYGWIN32]: Do declare extern likewise.
+ (GC_n_heap_bases) [CYGWIN32]: Likewise.
+ (GC_is_tmp_root) [CYGWIN32]: Do prototype likewise.
+ * include/private/gcconfig.h (GC_win32_get_mem) [CYGWIN32]: Likewise.
+ (GET_MEM) [CYGWIN32]: Do define likewise.
+ * boehm-gc/ptr_chck.c (GC_is_visible) [CYGWIN32]: Do handle dynamic
+ registration likewise.
+ * boehm-gc/os_dep.c (GC_setpagesize) [CYGWIN32]: Do define likewise.
+ (GC_no_win32_dlls) [CYGWIN32]: Define as constant false, unlike
+ other windows hosts.
+ (GC_sysinfo) [CYGWIN32]: Define as on other windows hosts.
+ (GC_n_heap_bases) [CYGWIN32]: Likewise.
+ (GLOBAL_ALLOC_TEST) [CYGWIN32]: Likewise.
+ (GC_win32_get_mem) [CYGWIN32]: Likewise, but wrapping GC_unix_get_mem
+ rather than GlobalAlloc/VirtualAlloc.
+ (GC_win32_free_heap) [CYGWIN32]: Likewise, but wrapping free instead
+ of GlobalFree (even though the function body is optimised away).
+ * boehm-gc/mark_rts.c (add_roots_to_index) [CYGWIN32]: Define as on
+ other windows hosts.
+ (GC_add_roots_inner) [CYGWIN32]: Avoid overlapping or adjacent
+ intervals likewise.
+ (GC_clear_roots) [CYGWIN32]: Clear GC_root_index[] likewise.
+ (GC_rebuild_root_index) [CYGWIN32]: Define as on other windows hosts.
+ (GC_remove_tmp_roots) [CYGWIN32]: Call it likewise.
+ (GC_remove_roots) [CYGWIN32]: Don't define, as on other windows hosts.
+ (GC_is_tmp_root) [CYGWIN32]: Define, as on other windows hosts.
+ (GC_cond_register_dynamic_libraries) [CYGWIN32]: Handle temporary
+ roots and dynamic registration likewise.
+ * boehm-gc/dyn_load.c (GC_has_static_roots) [CYGWIN32]: Define as on
+ other windows hosts.
+ (GC_register_has_static_roots_callback) [CYGWIN32]: Likewise.
+ (GC_cond_add_roots) [CYGWIN32]: Likewise.
+ (GC_register_main_static_data) [CYGWIN32]: Define to always return
+ false, as on MSWINCE
+ (HAVE_REGISTER_MAIN_STATIC_DATA) [CYGWIN32]: Define as on other
+ windows hosts.
+ (GC_warn_fb) [CYGWIN32]: Likewise.
+ (GC_disallow_ignore_fb) [CYGWIN32]: Likewise.
+ (GC_ignore_fb_mb) [CYGWIN32]: Likewise.
+ (GC_ignore_fb) [CYGWIN32]: Likewise.
+ (is_frame_buffer) [CYGWIN32]: Likewise.
+ (GC_dump_meminfo) [CYGWIN32]: Likewise.
+ (GC_wnt) [CYGWIN32]: Define to constant true.
+ (GC_register_dynamic_libraries) [CYGWIN32]: Define as on other
+ windows hosts.
+
2009-12-09 Matthias Klose <doko@ubuntu.com>
* include/private/gc_locks.h: For __ARM_EABI__ define
diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c
index 200abde7810..5bebc1c155d 100644
--- a/boehm-gc/dyn_load.c
+++ b/boehm-gc/dyn_load.c
@@ -49,10 +49,13 @@
# undef GC_must_restore_redefined_dlopen
# endif
-#if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE)) \
+#if (defined(DYNAMIC_LOADING) \
+ || defined(MSWIN32) \
+ || defined(MSWINCE) \
+ || defined(CYGWIN32)) \
&& !defined(PCR)
#if !defined(SUNOS4) && !defined(SUNOS5DL) && !defined(IRIX5) && \
- !defined(MSWIN32) && !defined(MSWINCE) && \
+ !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) && \
!(defined(ALPHA) && defined(OSF1)) && \
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
@@ -717,7 +720,7 @@ void GC_register_dynamic_libraries()
# endif /* USE_PROC || IRIX5 */
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
# define WIN32_LEAN_AND_MEAN
# define NOSERVICE
@@ -761,7 +764,7 @@ void GC_register_dynamic_libraries()
}
# endif
-# ifdef MSWINCE
+# if defined(MSWINCE) || defined(CYGWIN32)
/* Do we need to separately register the main static data segment? */
GC_bool GC_register_main_static_data()
{
@@ -868,8 +871,12 @@ void GC_register_dynamic_libraries()
}
# endif /* DEBUG_VIRTUALQUERY */
- extern GC_bool GC_wnt; /* Is Windows NT derivative. */
- /* Defined and set in os_dep.c. */
+# ifdef CYGWIN32
+# define GC_wnt (TRUE)
+# else
+ extern GC_bool GC_wnt; /* Is Windows NT derivative. */
+ /* Defined and set in os_dep.c. */
+# endif
void GC_register_dynamic_libraries()
{
@@ -934,7 +941,7 @@ void GC_register_dynamic_libraries()
GC_cond_add_roots(base, limit);
}
-#endif /* MSWIN32 || MSWINCE */
+#endif /* MSWIN32 || MSWINCE || CYGWIN32 */
#if defined(ALPHA) && defined(OSF1)
diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h
index fdebe3688a5..4dbfa7d1fed 100644
--- a/boehm-gc/include/private/gc_priv.h
+++ b/boehm-gc/include/private/gc_priv.h
@@ -833,14 +833,14 @@ struct exclusion {
struct roots {
ptr_t r_start;
ptr_t r_end;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
struct roots * r_next;
# endif
GC_bool r_tmp;
/* Delete before registering new dynamic libraries */
};
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
/* Size of hash table index to roots. */
# define LOG_RT_SIZE 6
# define RT_SIZE (1 << LOG_RT_SIZE) /* Power of 2, may be != MAX_ROOT_SETS */
@@ -1024,7 +1024,7 @@ struct _GC_arrays {
struct HeapSect {
ptr_t hs_start; word hs_bytes;
} _heap_sects[MAX_HEAP_SECTS];
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
ptr_t _heap_bases[MAX_HEAP_SECTS];
/* Start address of memory regions obtained from kernel. */
# endif
@@ -1033,7 +1033,7 @@ struct _GC_arrays {
/* Commited lengths of memory regions obtained from kernel. */
# endif
struct roots _static_roots[MAX_ROOT_SETS];
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
struct roots * _root_index[RT_SIZE];
# endif
struct exclusion _excl_table[MAX_EXCLUSIONS];
@@ -1091,7 +1091,7 @@ GC_API GC_FAR struct _GC_arrays GC_arrays;
# ifdef USE_MUNMAP
# define GC_unmapped_bytes GC_arrays._unmapped_bytes
# endif
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined (CYGWIN32)
# define GC_heap_bases GC_arrays._heap_bases
# endif
# ifdef MSWINCE
@@ -1187,7 +1187,7 @@ extern word GC_n_heap_sects; /* Number of separately added heap */
extern word GC_page_size;
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
struct _SYSTEM_INFO;
extern struct _SYSTEM_INFO GC_sysinfo;
extern word GC_n_heap_bases; /* See GC_heap_bases. */
@@ -1479,7 +1479,7 @@ void GC_remove_roots_inner GC_PROTO((char * b, char * e));
GC_bool GC_is_static_root GC_PROTO((ptr_t p));
/* Is the address p in one of the registered static */
/* root sections? */
-# if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION)
+# if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION) || defined(CYGWIN32)
GC_bool GC_is_tmp_root GC_PROTO((ptr_t p));
/* Is the address p in one of the temporary static */
/* root sections? */
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index 56e483c8d95..c729130cb26 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -2375,7 +2375,7 @@
calloc(1, (size_t)bytes + GC_page_size) \
+ GC_page_size-1)
# else
-# ifdef MSWIN32
+# if defined(MSWIN32) || defined(CYGWIN32)
extern ptr_t GC_win32_get_mem();
# define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
# else
diff --git a/boehm-gc/mark_rts.c b/boehm-gc/mark_rts.c
index 7a9fb8f2b72..94eb0ddb37f 100644
--- a/boehm-gc/mark_rts.c
+++ b/boehm-gc/mark_rts.c
@@ -22,7 +22,7 @@
struct roots {
ptr_t r_start;
ptr_t r_end;
- # if !defined(MSWIN32) && !defined(MSWINCE)
+ # if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
struct roots * r_next;
# endif
GC_bool r_tmp;
@@ -87,7 +87,7 @@ ptr_t p;
return(FALSE);
}
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
/*
# define LOG_RT_SIZE 6
# define RT_SIZE (1 << LOG_RT_SIZE) -- Power of 2, may be != MAX_ROOT_SETS
@@ -139,7 +139,7 @@ struct roots *p;
GC_root_index[h] = p;
}
-# else /* MSWIN32 || MSWINCE */
+# else /* MSWIN32 || MSWINCE || CYGWIN32 */
# define add_roots_to_index(p)
@@ -175,7 +175,7 @@ GC_bool tmp;
{
struct roots * old;
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
/* Spend the time to ensure that there are no overlapping */
/* or adjacent intervals. */
/* This could be done faster with e.g. a */
@@ -244,7 +244,7 @@ GC_bool tmp;
GC_static_roots[n_root_sets].r_start = (ptr_t)b;
GC_static_roots[n_root_sets].r_end = (ptr_t)e;
GC_static_roots[n_root_sets].r_tmp = tmp;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
GC_static_roots[n_root_sets].r_next = 0;
# endif
add_roots_to_index(GC_static_roots + n_root_sets);
@@ -263,7 +263,7 @@ void GC_clear_roots GC_PROTO((void))
roots_were_cleared = TRUE;
n_root_sets = 0;
GC_root_size = 0;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
{
register int i;
@@ -285,7 +285,7 @@ int i;
n_root_sets--;
}
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
static void GC_rebuild_root_index()
{
register int i;
@@ -308,12 +308,12 @@ void GC_remove_tmp_roots()
i++;
}
}
- #if !defined(MSWIN32) && !defined(MSWINCE)
+ #if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
GC_rebuild_root_index();
#endif
}
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
void GC_remove_roots(b, e)
char * b; char * e;
{
@@ -340,9 +340,9 @@ char * b; char * e;
}
GC_rebuild_root_index();
}
-#endif /* !defined(MSWIN32) && !defined(MSWINCE) */
+#endif /* !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) */
-#if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION)
+#if defined(MSWIN32) || defined(_WIN32_WCE_EMULATION) || defined(CYGWIN32)
/* Workaround for the OS mapping and unmapping behind our back: */
/* Is the address p in one of the temporary static root sections? */
GC_bool GC_is_tmp_root(p)
@@ -364,7 +364,7 @@ ptr_t p;
}
return(FALSE);
}
-#endif /* MSWIN32 || _WIN32_WCE_EMULATION */
+#endif /* MSWIN32 || _WIN32_WCE_EMULATION || defined(CYGWIN32) */
ptr_t GC_approx_sp()
{
@@ -557,7 +557,7 @@ void GC_push_gc_structures GC_PROTO((void))
void GC_cond_register_dynamic_libraries()
{
# if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \
- || defined(PCR)) && !defined(SRC_M3)
+ || defined(CYGWIN32) || defined(PCR)) && !defined(SRC_M3)
GC_remove_tmp_roots();
if (!GC_no_dls) GC_register_dynamic_libraries();
# else
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 6f1e81abc16..ca8be1a8236 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -107,7 +107,7 @@
# undef GC_AMIGA_DEF
#endif
-#if defined(MSWIN32) || defined(MSWINCE)
+#if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
# define WIN32_LEAN_AND_MEAN
# define NOSERVICE
# include <windows.h>
@@ -584,7 +584,7 @@ void GC_enable_signals()
/* Find the page size */
word GC_page_size;
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined (CYGWIN32)
void GC_setpagesize()
{
GetSystemInfo(&GC_sysinfo);
@@ -1169,7 +1169,11 @@ void GC_register_data_segments()
# else /* !OS2 */
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined (CYGWIN32)
+
+# ifdef CYGWIN32
+# define GC_no_win32_dlls (FALSE)
+# endif
# ifdef MSWIN32
/* Unfortunately, we have to handle win32s very differently from NT, */
@@ -1664,11 +1668,13 @@ void * os2_alloc(size_t bytes)
# endif /* OS2 */
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
SYSTEM_INFO GC_sysinfo;
# endif
-# ifdef MSWIN32
+# if defined(MSWIN32) || defined(CYGWIN32)
+
+word GC_n_heap_bases = 0;
# ifdef USE_GLOBAL_ALLOC
# define GLOBAL_ALLOC_TEST 1
@@ -1676,13 +1682,14 @@ SYSTEM_INFO GC_sysinfo;
# define GLOBAL_ALLOC_TEST GC_no_win32_dlls
# endif
-word GC_n_heap_bases = 0;
-
ptr_t GC_win32_get_mem(bytes)
word bytes;
{
ptr_t result;
+# ifdef CYGWIN32
+ result = GC_unix_get_mem (bytes);
+# else
if (GLOBAL_ALLOC_TEST) {
/* VirtualAlloc doesn't like PAGE_EXECUTE_READWRITE. */
/* There are also unconfirmed rumors of other */
@@ -1702,6 +1709,7 @@ word bytes;
MEM_COMMIT | MEM_RESERVE,
PAGE_EXECUTE_READWRITE);
}
+#endif
if (HBLKDISPL(result) != 0) ABORT("Bad VirtualAlloc result");
/* If I read the documentation correctly, this can */
/* only happen if HBLKSIZE > 64k or not a power of 2. */
@@ -1714,7 +1722,11 @@ void GC_win32_free_heap ()
{
if (GC_no_win32_dlls) {
while (GC_n_heap_bases > 0) {
+# ifdef CYGWIN32
+ free (GC_heap_bases[--GC_n_heap_bases]);
+# else
GlobalFree (GC_heap_bases[--GC_n_heap_bases]);
+# endif
GC_heap_bases[GC_n_heap_bases] = 0;
}
}
diff --git a/boehm-gc/ptr_chck.c b/boehm-gc/ptr_chck.c
index d83d730d343..09c86cb599d 100644
--- a/boehm-gc/ptr_chck.c
+++ b/boehm-gc/ptr_chck.c
@@ -247,7 +247,7 @@ ptr_t p;
if (GC_is_static_root(p)) return(p);
/* Else do it again correctly: */
# if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || \
- defined(MSWINCE) || defined(PCR)) \
+ defined(MSWINCE) || defined (CYGWIN32) || defined(PCR)) \
&& !defined(SRC_M3)
DISABLE_SIGNALS();
GC_register_dynamic_libraries();
diff --git a/configure b/configure
index f3212128d00..508d958960b 100755
--- a/configure
+++ b/configure
@@ -7292,8 +7292,8 @@ case "${target}" in
extra_arflags_for_target=" -X32_64"
extra_nmflags_for_target=" -B -X32_64"
;;
- *-*-darwin*)
- # ranlib from Darwin requires the -c flag to look at common symbols.
+ *-*-darwin[3-9]*)
+ # ranlib before Darwin10 requires the -c flag to look at common symbols.
extra_ranlibflags_for_target=" -c"
;;
mips*-*-pe | sh*-*-pe | *arm-wince-pe)
diff --git a/configure.ac b/configure.ac
index 92f3a9062c2..a5d75ee71d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2405,8 +2405,8 @@ case "${target}" in
extra_arflags_for_target=" -X32_64"
extra_nmflags_for_target=" -B -X32_64"
;;
- *-*-darwin*)
- # ranlib from Darwin requires the -c flag to look at common symbols.
+ *-*-darwin[[3-9]]*)
+ # ranlib before Darwin10 requires the -c flag to look at common symbols.
extra_ranlibflags_for_target=" -c"
;;
mips*-*-pe | sh*-*-pe | *arm-wince-pe)
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 94145594bed..383f164aebd 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-22 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix *.log tests output containing "===".
+ * dg-extract-results.sh (/\===/): Rename to ...
+ (/^\t\t=== .* ===$/): ... this pattern.
+
2010-03-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* dg-extract-results.sh: Fix result order to match sequential case.
diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
index 9d3c756d555..0ad85cb7aa2 100755
--- a/contrib/dg-extract-results.sh
+++ b/contrib/dg-extract-results.sh
@@ -299,7 +299,7 @@ BEGIN {
next
}
}
-/\===/ { curvar = ""; next }
+/^\t\t=== .* ===$/ { curvar = ""; next }
/^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|WARNING|ERROR|UNSUPPORTED|UNTESTED|KFAIL):/ {
testname=\$2
# Ugly hack for gfortran.dg/dg.exp
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index a392c7e00cd..fc917b0c6fa 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-19 Bruce Korb <bkorb@gnu.org>
+
+ * inclhack.def: remove vestiges of inadvertently committed changes
+
2010-02-10 Bruce Korb <bkorb@gnu.org>
* README: fix up references to old gcc/fixinc directory
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index a759b4050be..e34e3902fda 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -3339,7 +3339,7 @@ fix = {
fix = {
hackname = solaris_math_8;
- select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+ select = '@\(#\)math_c99\.h' "[ \t]+1\\.[0-9]+[ \t]+[0-9/]+ SMI";
bypass = "__GNUC__";
files = iso/math_c99.h;
c_fix = format;
@@ -3352,7 +3352,7 @@ fix = {
test_text = <<- _EOText_
#ident "@(#)math_c99.h 1.9 04/11/01 SMI"
#undef signbit
- #define signbit(x) __builtin_signbit(x);
+ #define signbit(x) __builtin_signbit(x)
_EOText_;
};
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f56c1e707de..f8515cdc554 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,530 @@
+2010-03-22 Jason Merrill <jason@redhat.com>
+
+ * c-pretty-print.c (pp_c_specifier_qualifier_list) [VECTOR_TYPE]:
+ Use () rather than [], and move before the element type.
+
+2010-03-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/configfiles.texi (Configuration Files): Removed
+ fixinc/Makefile*, intl/Makefile.*.
+ * doc/makefile.texi: Fixed markup.
+ Abstract from version control system used.
+ (Makefile): Removed obsolete gcc/java/parse.y example.
+ * doc/sourcebuild.texi: Likewise.
+ (Top Level): Added config, gnattools, libdecnumber, libgcc,
+ libgomp, libssp.
+ Removed fastjar.
+ (Miscellaneous Docs): Clarify location.
+ Added COPYING3, COPYING3.LIB.
+ (Front End Directory): Moved Make-lang.in entry to new
+ subsubsection.
+
+2010-03-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/38085
+ * config/i386/i386.c (x86_function_profiler)
+ [!NO_PROFILE_COUNTERS]: Fix typo.
+ * config/i386/gmon-sol2.c (_mcleanup) [__x86_64__]: Use call
+ instead of callq.
+
+2010-03-22 Janis Johnson <janis187@us.ibm.com>
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Test Directives): Split into six
+ subsections, with most of the current text in new subsections
+ Directives, Selectors, and Final Actions.
+ (Directives): Split list of test directives into multiple
+ subsubsections.
+ (Selectors): Describe use and syntax of selectors.
+ (Effective-Target Keywords): Describe all existing keywords.
+ (Add Options): Describe features for dg-add-options.
+ (Require Support): Describe variants of dg-require-support.
+ (Final Actions): Describe commands to use in dg-final.
+
+2010-03-22 Michael Matz <matz@suse.de>
+
+ PR middle-end/43475
+ * recog.c (validate_replace_rtx_group): Replace also in
+ REG_EQUAL and REG_EQUIV notes.
+
+2010-03-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43390
+ * tree-vect-stmts.c (get_vectype_for_scalar_type): Make
+ sure vector extracts are type correct.
+
+2010-03-22 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/40106
+ * builtins.c (expand_builtin_pow): Expand pow (x, 1.5) as
+ x * sqrt (x) even when optimizing for size if the target
+ has native support for sqrt.
+
+2010-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ * varasm.c (make_decl_rtl_for_debug): Also clear
+ flag_mudflap for the duration of make_decl_rtl call.
+
+ PR debug/43443
+ * var-tracking.c (add_cselib_value_chains): Remove ASM_OPERANDS
+ locs from preserved VALUEs.
+
+2010-03-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR middle-end/42718
+ * pa.md (movmemsi): Set align to one if zero.
+ (movmemdi): Likewise.
+
+2010-03-21 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/42321
+ * arm.c (arm_output_epilogue): Correctly match VFP pop instructions
+ with their corresponding prologue pushes.
+
+2010-03-20 Andrew Pinski <pinskia@gmail.com>
+
+ PR target/43156
+ * config/spu/spu.c (spu_expand_prologue): Don't emit NOTE_INSN_DELETED
+ at the begining or end.
+ (spu_expand_epilogue): Likewise.
+
+2010-03-20 Richard Guenther <rguenther@suse.de>
+
+ PR rtl-optimization/43438
+ * combine.c (make_extraction): Properly zero-/sign-extend an
+ extraction of the low part of a CONST_INT. Also handle
+ CONST_DOUBLE.
+
+2010-03-19 Mike Stump <mikestump@comcast.net>
+
+ * config/i386/darwin.h (SUBTARGET32_DEFAULT_CPU): Add.
+ * config/i386/i386.c (SUBTARGET32_DEFAULT_CPU): Add.
+ (override_options): Use SUBTARGET32_DEFAULT_CPU.
+
+2010-03-19 Andrew Pinski <andrew_pinski@caviumnetworks.com>
+
+ PR C/43211
+ * c-decl.c (grokparms): Set arg_types to NULL_TREE if there was an error.
+
+2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com>
+
+ PR rtl-optimization/42258
+ * ira-lives.c (check_and_make_def_conflict): Ignore conflict for a
+ use that may match DEF.
+
+ PR target/40697
+ * optabs.c (avoid_expensive_constant): Use rtx_cost to find out
+ the cost of loading the constant rather than assuming
+ COSTS_N_INSNS (1).
+ * config/arm/arm.c (thumb1_rtx_costs) <case CONST_INT>: If the
+ outer code is AND, do the same tests as the andsi3 expander and
+ return COSTS_N_INSNS (1) if and is cheap.
+
+ * optabs.c (avoid_expensive_constant): Fix formatting.
+
+2010-03-19 Michael Matz <matz@suse.de>
+
+ PR c++/43116
+ * attribs.c (decl_attributes): When rebuilding a function pointer
+ type use the same qualifiers as the original pointer type.
+
+2010-03-19 Martin Jambor <mjambor@suse.cz>
+
+ * doc/gimple.texi (Logical Operators): Describe is_gimple_ip_invariant
+ and is_gimple_ip_invariant_address.
+
+2010-03-19 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ Revert
+ 2009-10-01 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm.c (arm_override_options): Turn off
+ flag_dwarf2_cfi_asm for AAPCS variants.
+
+2010-03-19 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR target/43399
+ * config/arm/arm.c (emit_multi_reg_push): Update comments.
+ Use PRE_MODIFY instead of PRE_DEC.
+ (emit_sfm): Use PRE_MODIFY instead of PRE_DEC.
+ (vfp_emit_fstmd): Likewise.
+
+2010-03-19 Michael Matz <matz@suse.de>
+
+ PR target/43305
+ * builtins.c (expand_builtin_interclass_mathfn,
+ expand_builtin_signbit): Use maybe_emit_unop_insn, emit libcalls
+ if that fails.
+
+2010-03-19 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43415
+ * tree-ssa-pre.c (phi_translate): Split out worker to ...
+ (phi_translate_1): ... this.
+ (phi_translate): Move all caching here. Cache all NARY
+ and REFERENCE translations.
+
+2010-03-19 David S. Miller <davem@davemloft.net>
+
+ With help from Eric Botcazou.
+ * config/sparc/sparc.c: Include dwarf2out.h.
+ (emit_pic_helper): Delete.
+ (pic_helper_symbol_name): Delete.
+ (pic_helper_emitted_p): Delete.
+ (pic_helper_needed): New.
+ (USE_HIDDEN_LINKONCE): Define to '1' if HAVE_GAS_HIDDEN else '0'.
+ (get_pc_thunk_name): New.
+ (load_pic_register): Remove 'delay_pic_helper' arg. Use
+ get_thunk_pc_name and ggc_strdup to generate PIC thunk symbol.
+ Set pic_helper_needed to true. Don't call emit_pic_helper.
+ (sparc_expand_prologue): Update load_pic_register call.
+ (sparc_output_mi_thunk): Likewise.
+ (sparc_file_end): Emit a hidden comdat symbol for the PIC
+ thunk if possible. Output CFI information as needed.
+
+2010-03-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/36399
+ * config/i386/i386.h: Fix ABI on darwin x86-32.
+
+2010-03-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * tree.h: Declare make_decl_rtl_for_debug.
+ * varasm.c (make_decl_rtl_for_debug): New.
+ * dwarf2out.c (rtl_for_decl_location): Call it.
+ * cfgexpand.c (expand_debug_expr): Call it.
+
+2010-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/43399
+ * var-tracking.c (adjust_mems) <case POST_MODIFY>: Allow BLKmode
+ mem_mode.
+
+ PR bootstrap/43403
+ * var-tracking.c (vt_init_cfa_base): Do nothing if
+ cfa_base_rtx would be hard_frame_pointer_rtx or non-fixed
+ register.
+
+2010-03-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/42873
+ * var-tracking.c (canonicalize_vars_star): New.
+ (dataflow_post_merge_adjust): Use it.
+
+2010-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43058
+ * var-tracking.c (non_suitable_const): New function.
+ (add_uses): For DEBUG_INSNs with constants, don't record any
+ value, instead just the constant value itself.
+ (compute_bb_dataflow) <case MO_VAL_LOC>: If PAT_VAR_LOCATION_LOC
+ is not VAR_LOC_UNKNOWN_P, set var to the constant.
+ (emit_notes_in_bb): Likewise.
+ (emit_note_insn_var_location): For onepart variables if
+ cur_loc is a VOIDmode constant, use DECL_MODE.
+
+2010-03-18 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/42450
+ * cgraph.h (cgraph_redirect_edge_call_stmt_to_callee): Declare.
+ * cgraphunit.c (cgraph_materialize_all_clones): Update calls in
+ all non-clones. Moved call redirection...
+ (cgraph_redirect_edge_call_stmt_to_callee): ...to this new
+ function.
+ (cgraph_materialize_all_clones): Dispose of all
+ combined_args_to_skip bitmaps.
+ (verify_cgraph_node): Do not check for edges pointing to wrong
+ nodes in inline clones.
+ * tree-inline.c (copy_bb): Call
+ cgraph_redirect_edge_call_stmt_to_callee.
+ * ipa.c (cgraph_remove_unreachable_nodes): Call
+ cgraph_node_remove_callees even when there are used clones.
+
+2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/libgcc-glibc.ver: Make GCC_4.5.0 inherit GCC_4.4.0.
+
+2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/43383
+ * config/i386/libgcc-glibc.ver: Add __extendxftf2 to GCC_4.5.0
+ for 32bit.
+
+2010-03-18 Michael Matz <matz@suse.de>
+
+ PR middle-end/43419
+ * builtins.c (expand_builtin_pow): Don't transform pow(x, 0.5)
+ into sqrt(x) if we need to preserve signed zeros.
+
+2010-03-18 Steven Bosscher <steven@gcc.gnu.org>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/43360
+ * loop-invariant.c (move_invariant_reg): Remove the REG_EQUAL
+ note if we don't know its invariant status.
+
+2010-03-18 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/43402
+ * tree-cfgcleanup.c (cleanup_control_expr_graph): Don't follow
+ PHI chains of ssa names registered for update.
+
+2010-03-17 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR target/42427
+ * config/rs6000/rs6000.c (rs6000_split_multireg_move): Add support for
+ non-offsettable and pre_modify update addressing.
+ * config/rs6000/dfp.md (*movdd_hardfloat32): Make the "0", "1"
+ and "2" alternatives "#".
+ (*movdd_softfloat32): Make all alternatives "#";
+ * config/rs6000/rs6000.md (DIFD): New define_mode_iterator.
+ (*movdf_hardfloat32): Make the "0", "1" and "2" alternatives "#".
+ (*movdf_softfloat32): Make all alternatives "#";
+ (movdi): Use the new DIFD mode iterator to create a common splitter
+ for movdi, movdf and movdd patterns.
+
+2010-03-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * common.opt (dumpdir): Remove redundant tab.
+
+2010-03-17 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/43347
+ * tree-sra.c (create_access_replacement): Set TREE_NO_WARNING when the
+ original base is DECL_ARTIFICIAL or DECL_IGNORED_P.
+
+2010-03-17 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ PR rtl-optimization/42216
+ * regrename.c (create_new_chain): New function, broken out from...
+ (scan_rtx_reg): ... here. Call it. Handle the case where we are
+ appending a use to an empty chain.
+ (build_def_use): Remove previous changes that convert OP_INOUT to
+ OP_OUT operands; instead detect the case where an OP_INOUT operand
+ uses a previously untracked register and create an empty chain for
+ it.
+
+2010-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/extend.texi (Function Attributes): Rewrite unfinished
+ sentence in ms_abi documentation.
+
+2010-03-17 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/linux64.opt (mprofile-kernel): Use profile_kernel var.
+ * config/rs6000/linux64.h (TARGET_PROFILE_KERNEL): Define.
+ (SUBSUBTARGET_OVERRIDE_OPTIONS): Don't use SET_PROFILE_KERNEL.
+ * config/rs6000/rs6000.c (SET_PROFILE_KERNEL): Don't define.
+
+2010-03-16 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/43365
+ * tree-eh.c (replace_goto_queue): Also replace in the eh_seq.
+ (lower_try_finally): Save and restore eh_seq around the expansion
+ of the try-finally.
+
+2010-03-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * graphite-sese-to-poly.c (split_reduction_stmt): Skip debug
+ statements before splitting block.
+
+2010-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Testsuites): Fix markup.
+ Use pathnames relative to gcc/testsuite.
+ (Test Directives): Move description of how timeout is determined.
+ (Ada Tests): Favor gnat.exp over ada/acats/tests/gcc.
+ (C Tests): Correct gcc.misc-tests directory.
+ Framework tests now live in gcc.test-framework.
+
+2010-03-16 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/43379
+ * tree-cfg.c (gimple_merge_blocks): When propagating virtual
+ PHI operands make sure to merge SSA_NAME_OCCURS_IN_ABNORMAL_PHI
+ properly.
+
+2010-03-16 Aldy Hernandez <aldyh@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/42917
+ * lambda-code.c (remove_iv): Skip debug statements.
+ (lambda_loopnest_to_gcc_loopnest): Likewise.
+ (not_interesting_stmt): Debug statements are not interesting.
+
+2010-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43051
+ PR debug/43092
+ * cselib.c (cselib_preserve_constants,
+ cfa_base_preserved_val): New static variables.
+ (preserve_only_constants): New function.
+ (cselib_reset_table): If cfa_base_preserved_val is non-NULL, don't
+ clear its REG_VALUES. If cselib_preserve_constants, don't
+ empty the whole hash table, but preserve there VALUEs with constants,
+ cfa_base_preserved_val and cfa_base_preserved_val plus constant.
+ (cselib_preserve_cfa_base_value): New function.
+ (cselib_invalidate_regno): Don't invalidate cfa_base_preserved_val.
+ (cselib_init): Change argument to int bitfield. Set
+ cselib_preserve_constants to whether CSELIB_PRESERVE_CONSTANTS
+ is in it.
+ (cselib_finish): Clear cselib_preserve_constants and
+ cfa_base_preserved_val.
+ * cselib.h (enum cselib_record_what): New enum.
+ (cselib_init): Change argument to int.
+ (cselib_preserve_cfa_base_value): New prototype.
+ * postreload.c (reload_cse_regs_1): Adjust cselib_init caller.
+ * dse.c (dse_step1): Likewise.
+ * cfgcleanup.c (thread_jump): Likewise.
+ * sched-deps.c (sched_analyze): Likewise.
+ * gcse.c (local_cprop_pass): Likewise.
+ * simplify-rtx.c (simplify_replace_fn_rtx): Add argument to callback.
+ If FN is non-NULL, call the callback always and whenever it returns
+ non-NULL just return that. Only do rtx_equal_p if FN is NULL.
+ * rtl.h (simplify_replace_fn_rtx): Add argument to callback.
+ * combine.c (propagate_for_debug_subst): Add old_rtx argument,
+ compare from with old_rtx and if it isn't rtx_equal_p, return NULL.
+ * Makefile.in (var-tracking.o): Depend on $(RECOG_H).
+ * var-tracking.c: Include recog.h.
+ (bb_stack_adjust_offset): Remove.
+ (vt_stack_adjustments): Don't call it, instead just gather the
+ adjustments using insn_stack_adjust_offset_pre_post on each bb insn.
+ (adjust_stack_reference): Remove.
+ (compute_cfa_pointer): New function.
+ (hard_frame_pointer_adjustment, cfa_base_rtx): New static variables.
+ (struct adjust_mem_data): New type.
+ (adjust_mems, adjust_mem_uses, adjust_mem_stores, adjust_insn): New
+ functions.
+ (get_address_mode): New function.
+ (replace_expr_with_values): Use it.
+ (use_type): Don't do cselib_lookup for VAR_LOC_UNKNOWN_P.
+ Use get_address_mode. For cfa_base_rtx return MO_CLOBBER.
+ (adjust_sets): Remove.
+ (add_uses): Don't add extra MO_VAL_USE for cfa_base_rtx plus constant.
+ Use get_address_mode.
+ (get_adjusted_src): Remove.
+ (add_stores): Don't call it. Never reuse expr SET. Don't add extra
+ MO_VAL_USE for cfa_base_rtx plus constant. Use get_address_mode.
+ (add_with_sets): Don't call adjust_sets.
+ (fp_setter, vt_init_cfa_base): New functions.
+ (vt_initialize): Change return type to bool. Move most of pool etc.
+ initialization to the beginning of the function from end. Pass
+ CSELIB_RECORD_MEMORY | CSELIB_PRESERVE_CONSTANTS to cselib_init.
+ If !frame_pointer_needed, call vt_stack_adjustment before mos
+ vector is filled, call vt_init_cfa_base if argp/framep has been
+ eliminated to sp. If frame_pointer_needed and argp/framep has
+ been eliminated to hard frame pointer, set
+ hard_frame_pointer_adjustment and call vt_init_cfa_base after
+ encountering fp setter in the prologue. For MO_ADJUST, call
+ log_op_type before pusing the op into mos vector, not afterwards.
+ Call adjust_insn before cselib_process_insn/add_with_sets,
+ call cancel_changes (0) afterwards.
+ (variable_tracking_main_1): Adjust for vt_initialize calling
+ vt_stack_adjustments and returning whether it succeeded or not.
+
+2010-03-15 Aldy Hernandez <aldyh@redhat.com>
+
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Skip
+ debug statements.
+
+2010-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (dwarf2out_frame_debug): Don't assert drap_reg
+ has been set.
+ (based_loc_descr): Use DW_OP_fbreg for vdrap_reg even when
+ drap_reg has not been set.
+
+2010-03-15 Michael Matz <matz@suse.de>
+
+ PR middle-end/43300
+ * tree-outof-ssa.c (emit_partition_copy): New argument sizeexp,
+ use it to expand block copies.
+ (insert_partition_copy_on_edge, insert_rtx_to_part_on_edge,
+ insert_part_to_rtx_on_edge): Adjust callers of emit_partition_copy.
+ (insert_value_copy_on_edge): Use store_expr for BLKmode values.
+
+2010-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43367
+ * tree-cfg.c (gimple_can_merge_blocks_p): Simplify PHI
+ elimination check.
+
+2010-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43317
+ * ipa-struct-reorg.c (create_new_general_access): Update stmt.
+
+2010-03-15 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/43141
+ * tree-sra.c (create_abstract_origin): New function.
+ (modify_function): Call create_abstract_origin.
+
+2010-03-15 Chris Demetriou <cgd@google.com>
+
+ * Makefile.in (stmp-int-hdrs): Don't chmod include/stdint.h if it
+ wasn't copied.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43354
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
+ call insert_out_of_ssa_copy for default definitions.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (my_long_long): Defined.
+ (gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
+ * graphite-sese-to-poly.c (my_long_long): Defined.
+ (scop_ivs_can_be_represented): Use it.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
+ graphite-max-bbs-per-function, and loop-block-tile-size.
+ * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
+ with "maximum".
+ (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
+ forward declaration.
+ * graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
+ (add_upper_bounds_from_estimated_nit): New.
+ (build_loop_iteration_domains): Use it.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43306
+ * tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
+ should be an INTEGER_CST. Also handle CASE_CONVERT.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite.c (graphite_initialize): To bound the number of bbs per
+ function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
+ * params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
+ * doc/invoke.texi: Document it.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
+ * graphite-sese-to-poly.h (build_poly_scop): Same.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Limit scops following
+ the number of parameters in the scop. Use as an upper bound
+ PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
+ * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
+ * doc/invoke.texi: Document it.
+
2010-03-13 Jerry Quinn <jlquinn@optonline.net>
* Makefile.in (TEXI_GCCINT_FILES): Remove c-tree.texi.
@@ -57,7 +584,8 @@
2010-03-11 David S. Miller <davem@davemloft.net>
- * configure.ac (gcc_cv_as_cfi_advance_working): Skip a multiple of four.
+ * configure.ac (gcc_cv_as_cfi_advance_working): Skip a multiple
+ of four.
* configure: Rebuild.
2010-03-11 Martin Jambor <mjambor@suse.cz>
@@ -84,8 +612,8 @@
2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR tree-optimization/43280
- * tree-ssa-math-opts.c (find_bswap_1): Modify symbolic number generation.
- Move calculation of size out of the if branch.
+ * tree-ssa-math-opts.c (find_bswap_1): Modify symbolic number
+ generation. Move calculation of size out of the if branch.
(find_bswap): Modify compare number generation.
2010-03-11 Richard Guenther <rguenther@suse.de>
@@ -222,8 +750,7 @@
* graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
handle conversions from pointer to integers.
(gcc_type_for_cloog_iv): Choose the smalles signed integer as an
- induction variable, to be able to work with code generated by
- CLooG.
+ induction variable, to be able to work with code generated by CLooG.
* graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
(build_poly_scop): Bail out if we cannot codegen a loop.
@@ -236,13 +763,14 @@
* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
Call fold_convert on all the returned values.
- (expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
- the type of the resulting expression.
+ (expand_scalar_variables_expr): Pass to
+ expand_scalar_variables_ssa_name the type of the resulting expression.
2010-03-08 Sebastian Pop <sebastian.pop@amd.com>
* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
- ppl_min_for_le_pointset. Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
+ ppl_min_for_le_pointset.
+ Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
2010-03-08 Sebastian Pop <sebastian.pop@amd.com>
@@ -389,8 +917,7 @@
check_changed_vars_3 on each changed var.
(emit_notes_for_differences_1): Clear cur_loc_changed and
in_changed_variables. Recompute cur_loc of new_var.
- (emit_notes_for_differences_2): Clear cur_loc if new variable
- appears.
+ (emit_notes_for_differences_2): Clear cur_loc if new variable appears.
(vt_emit_notes): Initialize and destroy emitted_notes.
2010-03-07 Bernd Schmidt <bernd.schmidt@analog.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 9dcdcdab99b..1659de6c1bb 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,69 @@
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43354
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
+ call insert_out_of_ssa_copy for default definitions.
+ * gfortran.dg/graphite/id-pr43354.f: New.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43349
+ * gfortran.dg/graphite/pr43349.f: New.
+
+2010-03-11 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (my_long_long): Defined.
+ (gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
+ * graphite-sese-to-poly.c (my_long_long): Defined.
+ (scop_ivs_can_be_represented): Use it.
+
+2010-03-10 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
+ graphite-max-bbs-per-function, and loop-block-tile-size.
+ * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
+ with "maximum".
+ (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.
+
+2010-03-10 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
+ forward declaration.
+ * graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
+ (add_upper_bounds_from_estimated_nit): New.
+ (build_loop_iteration_domains): Use it.
+
+2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
+
+2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43306
+ * tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
+ should be an INTEGER_CST. Also handle CASE_CONVERT.
+ * gcc.dg/graphite/pr43306.c: New.
+
+2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite.c (graphite_initialize): To bound the number of bbs per
+ function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
+ * params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
+ * doc/invoke.texi: Document it.
+
+2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
+ * graphite-sese-to-poly.h (build_poly_scop): Same.
+
+2010-03-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Limit scops following
+ the number of parameters in the scop. Use as an upper bound
+ PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
+ * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
+ * doc/invoke.texi: Document it.
+
2010-03-05 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (add_param_constraints): Use
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 6d5881080e6..3312e28eae0 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20100313
+20100322
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index fd61169a6e2..448050576e5 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3032,7 +3032,8 @@ var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \
$(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H) \
$(REGS_H) $(EXPR_H) $(TIMEVAR_H) $(TREE_PASS_H) $(TREE_FLOW_H) \
- cselib.h $(TARGET_H) $(TOPLEV_H) $(PARAMS_H) $(DIAGNOSTIC_H) pointer-set.h
+ cselib.h $(TARGET_H) $(TOPLEV_H) $(PARAMS_H) $(DIAGNOSTIC_H) pointer-set.h \
+ $(RECOG_H)
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) \
$(TOPLEV_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
@@ -3842,10 +3843,11 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) $(UNWIND_H) fixinc_list
cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \
chmod a+r include/stdint-gcc.h; \
cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
+ chmod a+r include/stdint.h; \
elif [ $(USE_GCC_STDINT) = provide ]; then \
cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \
+ chmod a+r include/stdint.h; \
fi
- chmod a+r include/stdint.h
set -e; for ml in `cat fixinc_list`; do \
sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 9f2f50bdfd9..9d76a0c30db 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -286,6 +286,7 @@ decl_attributes (tree *node, tree attributes, int flags)
tree *anode = node;
const struct attribute_spec *spec = lookup_attribute_spec (name);
bool no_add_attrs = 0;
+ int fn_ptr_quals = 0;
tree fn_ptr_tmp = NULL_TREE;
if (spec == NULL)
@@ -353,6 +354,7 @@ decl_attributes (tree *node, tree attributes, int flags)
This would all be simpler if attributes were part of the
declarator, grumble grumble. */
fn_ptr_tmp = TREE_TYPE (*anode);
+ fn_ptr_quals = TYPE_QUALS (*anode);
anode = &fn_ptr_tmp;
flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
}
@@ -449,6 +451,8 @@ decl_attributes (tree *node, tree attributes, int flags)
/* Rebuild the function pointer type and put it in the
appropriate place. */
fn_ptr_tmp = build_pointer_type (fn_ptr_tmp);
+ if (fn_ptr_quals)
+ fn_ptr_tmp = build_qualified_type (fn_ptr_tmp, fn_ptr_quals);
if (DECL_P (*node))
TREE_TYPE (*node) = fn_ptr_tmp;
else
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1e089ef99c4..7787f695ac8 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -2312,6 +2312,8 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget)
if (icode != CODE_FOR_nothing)
{
+ rtx last = get_last_insn ();
+ tree orig_arg = arg;
/* Make a suitable register to place result in. */
if (!target
|| GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
@@ -2332,8 +2334,10 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget)
/* Compute into TARGET.
Set TARGET to wherever the result comes back. */
- emit_unop_insn (icode, target, op0, UNKNOWN);
- return target;
+ if (maybe_emit_unop_insn (icode, target, op0, UNKNOWN))
+ return target;
+ delete_insns_since (last);
+ CALL_EXPR_ARG (exp, 0) = orig_arg;
}
return NULL_RTX;
@@ -2980,7 +2984,16 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
&& ((flag_unsafe_math_optimizations
&& optimize_insn_for_speed_p ()
&& powi_cost (n/2) <= POWI_MAX_MULTS)
- || n == 1))
+ /* Even the c == 0.5 case cannot be done unconditionally
+ when we need to preserve signed zeros, as
+ pow (-0, 0.5) is +0, while sqrt(-0) is -0. */
+ || (!HONOR_SIGNED_ZEROS (mode) && n == 1)
+ /* For c == 1.5 we can assume that x * sqrt (x) is always
+ smaller than pow (x, 1.5) if sqrt will not be expanded
+ as a call. */
+ || (n == 3
+ && (optab_handler (sqrt_optab, mode)->insn_code
+ != CODE_FOR_nothing))))
{
tree call_expr = build_call_nofold (fn, 1, narg0);
/* Use expand_expr in case the newly built call expression
@@ -5194,9 +5207,11 @@ expand_builtin_signbit (tree exp, rtx target)
icode = signbit_optab->handlers [(int) fmode].insn_code;
if (icode != CODE_FOR_nothing)
{
+ rtx last = get_last_insn ();
target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));
- emit_unop_insn (icode, target, temp, UNKNOWN);
- return target;
+ if (maybe_emit_unop_insn (icode, target, temp, UNKNOWN))
+ return target;
+ delete_insns_since (last);
}
/* For floating point formats without a sign bit, implement signbit
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 14f93c27e7e..9ab168dfd5d 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6135,6 +6135,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
TREE_VALUE (typelt) = error_mark_node;
TREE_TYPE (parm) = error_mark_node;
+ arg_types = NULL_TREE;
}
else if (VOID_TYPE_P (type))
{
@@ -6155,6 +6156,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
error (errmsg);
TREE_VALUE (typelt) = error_mark_node;
TREE_TYPE (parm) = error_mark_node;
+ arg_types = NULL_TREE;
}
if (DECL_NAME (parm) && TREE_USED (parm))
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 2972a26a96a..e1aabca1b24 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -454,16 +454,17 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
case VECTOR_TYPE:
case COMPLEX_TYPE:
- pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
if (code == COMPLEX_TYPE)
pp_c_ws_string (pp, flag_isoc99 ? "_Complex" : "__complex__");
else if (code == VECTOR_TYPE)
{
pp_c_ws_string (pp, "__vector");
- pp_c_left_bracket (pp);
+ pp_c_left_paren (pp);
pp_wide_integer (pp, TYPE_VECTOR_SUBPARTS (t));
- pp_c_right_bracket (pp);
+ pp_c_right_paren (pp);
+ pp_c_whitespace (pp);
}
+ pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
break;
default:
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index ffe36e45a9e..01b165a701a 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1,6 +1,6 @@
/* Control flow optimization code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -337,7 +337,7 @@ thread_jump (edge e, basic_block b)
return NULL;
}
- cselib_init (false);
+ cselib_init (0);
/* First process all values computed in the source basic block. */
for (insn = NEXT_INSN (BB_HEAD (e->src));
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index ee145993404..fcae897a392 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2339,8 +2339,7 @@ expand_debug_expr (tree exp)
|| mode == VOIDmode)
return NULL;
- op0 = DECL_RTL (exp);
- SET_DECL_RTL (exp, NULL);
+ op0 = make_decl_rtl_for_debug (exp);
if (!MEM_P (op0)
|| GET_CODE (XEXP (op0, 0)) != SYMBOL_REF
|| SYMBOL_REF_DECL (XEXP (op0, 0)) != exp)
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index f8d52ebc560..4f0c333a3f4 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -534,7 +534,7 @@ void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *);
struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_hook, void *);
void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
void cgraph_materialize_all_clones (void);
-
+gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *);
/* In cgraphbuild.c */
unsigned int rebuild_cgraph_edges (void);
void reset_inline_failed (struct cgraph_node *);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 23de53cc61e..842b5be71bd 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -767,8 +767,9 @@ verify_cgraph_node (struct cgraph_node *node)
debug_tree (e->callee->decl);
error_found = true;
}
- else if (!clone_of_p (cgraph_node (decl), e->callee)
- && !e->callee->global.inlined_to)
+ else if (!node->global.inlined_to
+ && !e->callee->global.inlined_to
+ && !clone_of_p (cgraph_node (decl), e->callee))
{
error ("edge points to wrong declaration:");
debug_tree (e->callee->decl);
@@ -2238,11 +2239,60 @@ cgraph_materialize_clone (struct cgraph_node *node)
bitmap_obstack_release (NULL);
}
+/* If necessary, change the function declaration in the call statement
+ associated with E so that it corresponds to the edge callee. */
+
+gimple
+cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
+{
+ tree decl = gimple_call_fndecl (e->call_stmt);
+ gimple new_stmt;
+ gimple_stmt_iterator gsi;
+
+ if (!decl || decl == e->callee->decl
+ /* Don't update call from same body alias to the real function. */
+ || cgraph_get_node (decl) == cgraph_get_node (e->callee->decl))
+ return e->call_stmt;
+
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, "updating call of %s/%i -> %s/%i: ",
+ cgraph_node_name (e->caller), e->caller->uid,
+ cgraph_node_name (e->callee), e->callee->uid);
+ print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
+ }
+
+ if (e->callee->clone.combined_args_to_skip)
+ new_stmt = gimple_call_copy_skip_args (e->call_stmt,
+ e->callee->clone.combined_args_to_skip);
+ else
+ new_stmt = e->call_stmt;
+ if (gimple_vdef (new_stmt)
+ && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
+ SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
+ gimple_call_set_fndecl (new_stmt, e->callee->decl);
+
+ gsi = gsi_for_stmt (e->call_stmt);
+ gsi_replace (&gsi, new_stmt, true);
+
+ /* Update EH information too, just in case. */
+ maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt);
+
+ cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt);
+
+ if (cgraph_dump_file)
+ {
+ fprintf (cgraph_dump_file, " updated to:");
+ print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
+ }
+ return new_stmt;
+}
+
/* Once all functions from compilation unit are in memory, produce all clones
- and update all calls.
- We might also do this on demand if we don't want to bring all functions to
- memory prior compilation, but current WHOPR implementation does that and it is
- is bit easier to keep everything right in this order. */
+ and update all calls. We might also do this on demand if we don't want to
+ bring all functions to memory prior compilation, but current WHOPR
+ implementation does that and it is is bit easier to keep everything right in
+ this order. */
void
cgraph_materialize_all_clones (void)
{
@@ -2318,69 +2368,28 @@ cgraph_materialize_all_clones (void)
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Updating call sites\n");
for (node = cgraph_nodes; node; node = node->next)
- if (node->analyzed && gimple_has_body_p (node->decl)
- && (!node->clone_of || node->clone_of->decl != node->decl))
+ if (node->analyzed && !node->clone_of
+ && gimple_has_body_p (node->decl))
{
struct cgraph_edge *e;
current_function_decl = node->decl;
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
for (e = node->callees; e; e = e->next_callee)
- {
- tree decl = gimple_call_fndecl (e->call_stmt);
- /* When function gets inlined, indirect inlining might've invented
- new edge for orginally indirect stmt. Since we are not
- preserving clones in the original form, we must not update here
- since other inline clones don't need to contain call to the same
- call. Inliner will do the substitution for us later. */
- if (decl && decl != e->callee->decl)
- {
- gimple new_stmt;
- gimple_stmt_iterator gsi;
-
- if (cgraph_get_node (decl) == cgraph_get_node (e->callee->decl))
- /* Don't update call from same body alias to the real function. */
- continue;
-
- if (cgraph_dump_file)
- {
- fprintf (cgraph_dump_file, "updating call of %s in %s:",
- cgraph_node_name (node),
- cgraph_node_name (e->callee));
- print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
- }
-
- if (e->callee->clone.combined_args_to_skip)
- new_stmt = gimple_call_copy_skip_args (e->call_stmt,
- e->callee->clone.combined_args_to_skip);
- else
- new_stmt = e->call_stmt;
- if (gimple_vdef (new_stmt)
- && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
- SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
- gimple_call_set_fndecl (new_stmt, e->callee->decl);
-
- gsi = gsi_for_stmt (e->call_stmt);
- gsi_replace (&gsi, new_stmt, true);
-
- /* Update EH information too, just in case. */
- maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt);
-
- cgraph_set_call_stmt_including_clones (node, e->call_stmt, new_stmt);
-
- if (cgraph_dump_file)
- {
- fprintf (cgraph_dump_file, " updated to:");
- print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
- }
- }
- }
+ cgraph_redirect_edge_call_stmt_to_callee (e);
pop_cfun ();
current_function_decl = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph_node (node);
#endif
}
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, "Materialization Call site updates done.\n");
+ /* All changes to parameters have been performed. In order not to
+ incorrectly repeat them, we simply dispose of the bitmaps that drive the
+ changes. */
+ for (node = cgraph_nodes; node; node = node->next)
+ node->clone.combined_args_to_skip = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
diff --git a/gcc/combine.c b/gcc/combine.c
index e5d4c5aafc2..a5240c99e97 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1,6 +1,6 @@
/* Optimize by combining instructions for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2286,10 +2286,12 @@ struct rtx_subst_pair
substituted. */
static rtx
-propagate_for_debug_subst (rtx from ATTRIBUTE_UNUSED, void *data)
+propagate_for_debug_subst (rtx from, const_rtx old_rtx, void *data)
{
struct rtx_subst_pair *pair = (struct rtx_subst_pair *)data;
+ if (!rtx_equal_p (from, old_rtx))
+ return NULL_RTX;
if (!pair->adjusted)
{
pair->adjusted = true;
@@ -6791,8 +6793,10 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
if (mode == tmode)
return new_rtx;
- if (CONST_INT_P (new_rtx))
- return gen_int_mode (INTVAL (new_rtx), mode);
+ if (CONST_INT_P (new_rtx)
+ || GET_CODE (new_rtx) == CONST_DOUBLE)
+ return simplify_unary_operation (unsignedp ? ZERO_EXTEND : SIGN_EXTEND,
+ mode, new_rtx, tmode);
/* If we know that no extraneous bits are set, and that the high
bit is not set, convert the extraction to the cheaper of
diff --git a/gcc/common.opt b/gcc/common.opt
index 633ab47a76c..cdb4e085d51 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -255,7 +255,7 @@ Common Separate
dumpdir
Common Separate
--dumpdir <dir> Set the directory name to be used for dumps
+-dumpdir <dir> Set the directory name to be used for dumps
; The version of the C++ ABI in use. The following values are allowed:
;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 466981a7e7b..6f42dd00a09 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1877,13 +1877,6 @@ arm_override_options (void)
flag_reorder_blocks = 1;
}
- /* Ideally we would want to use CFI directives to generate
- debug info. However this also creates the .eh_frame
- section, so disable them until GAS can handle
- this properly. See PR40521. */
- if (TARGET_AAPCS_BASED)
- flag_dwarf2_cfi_asm = 0;
-
/* Register global variables with the garbage collector. */
arm_add_gc_roots ();
}
@@ -6235,6 +6228,15 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
else if ((outer == IOR || outer == XOR || outer == AND)
&& INTVAL (x) < 256 && INTVAL (x) >= -256)
return COSTS_N_INSNS (1);
+ else if (outer == AND)
+ {
+ int i;
+ /* This duplicates the tests in the andsi3 expander. */
+ for (i = 9; i <= 31; i++)
+ if ((((HOST_WIDE_INT) 1) << i) - 1 == INTVAL (x)
+ || (((HOST_WIDE_INT) 1) << i) - 1 == ~INTVAL (x))
+ return COSTS_N_INSNS (2);
+ }
else if (outer == ASHIFT || outer == ASHIFTRT
|| outer == LSHIFTRT)
return 0;
@@ -11655,9 +11657,14 @@ vfp_emit_fstmd (int base_reg, int count)
XVECEXP (par, 0, 0)
= gen_rtx_SET (VOIDmode,
- gen_frame_mem (BLKmode,
- gen_rtx_PRE_DEC (BLKmode,
- stack_pointer_rtx)),
+ gen_frame_mem
+ (BLKmode,
+ gen_rtx_PRE_MODIFY (Pmode,
+ stack_pointer_rtx,
+ plus_constant
+ (stack_pointer_rtx,
+ - (count * 8)))
+ ),
gen_rtx_UNSPEC (BLKmode,
gen_rtvec (1, reg),
UNSPEC_PUSH_MULT));
@@ -13724,24 +13731,29 @@ arm_output_epilogue (rtx sibling)
if (TARGET_HARD_FLOAT && TARGET_VFP)
{
- start_reg = FIRST_VFP_REGNUM;
- for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ int end_reg = LAST_VFP_REGNUM + 1;
+
+ /* Scan the registers in reverse order. We need to match
+ any groupings made in the prologue and generate matching
+ pop operations. */
+ for (reg = LAST_VFP_REGNUM - 1; reg >= FIRST_VFP_REGNUM; reg -= 2)
{
if ((!df_regs_ever_live_p (reg) || call_used_regs[reg])
- && (!df_regs_ever_live_p (reg + 1) || call_used_regs[reg + 1]))
+ && (!df_regs_ever_live_p (reg + 1)
+ || call_used_regs[reg + 1]))
{
- if (start_reg != reg)
+ if (end_reg > reg + 2)
vfp_output_fldmd (f, SP_REGNUM,
- (start_reg - FIRST_VFP_REGNUM) / 2,
- (reg - start_reg) / 2);
- start_reg = reg + 2;
+ (reg + 2 - FIRST_VFP_REGNUM) / 2,
+ (end_reg - (reg + 2)) / 2);
+ end_reg = reg;
}
}
- if (start_reg != reg)
- vfp_output_fldmd (f, SP_REGNUM,
- (start_reg - FIRST_VFP_REGNUM) / 2,
- (reg - start_reg) / 2);
+ if (end_reg > reg + 2)
+ vfp_output_fldmd (f, SP_REGNUM, 0,
+ (end_reg - (reg + 2)) / 2);
}
+
if (TARGET_IWMMXT)
for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
if (df_regs_ever_live_p (reg) && !call_used_regs[reg])
@@ -13910,16 +13922,17 @@ emit_multi_reg_push (unsigned long mask)
/* For the body of the insn we are going to generate an UNSPEC in
parallel with several USEs. This allows the insn to be recognized
- by the push_multi pattern in the arm.md file. The insn looks
- something like this:
+ by the push_multi pattern in the arm.md file.
+
+ The body of the insn looks something like this:
(parallel [
- (set (mem:BLK (pre_dec:BLK (reg:SI sp)))
+ (set (mem:BLK (pre_modify:SI (reg:SI sp)
+ (const_int:SI <num>)))
(unspec:BLK [(reg:SI r4)] UNSPEC_PUSH_MULT))
- (use (reg:SI 11 fp))
- (use (reg:SI 12 ip))
- (use (reg:SI 14 lr))
- (use (reg:SI 15 pc))
+ (use (reg:SI XX))
+ (use (reg:SI YY))
+ ...
])
For the frame note however, we try to be more explicit and actually
@@ -13932,13 +13945,20 @@ emit_multi_reg_push (unsigned long mask)
(sequence [
(set (reg:SI sp) (plus:SI (reg:SI sp) (const_int -20)))
(set (mem:SI (reg:SI sp)) (reg:SI r4))
- (set (mem:SI (plus:SI (reg:SI sp) (const_int 4))) (reg:SI fp))
- (set (mem:SI (plus:SI (reg:SI sp) (const_int 8))) (reg:SI ip))
- (set (mem:SI (plus:SI (reg:SI sp) (const_int 12))) (reg:SI lr))
+ (set (mem:SI (plus:SI (reg:SI sp) (const_int 4))) (reg:SI XX))
+ (set (mem:SI (plus:SI (reg:SI sp) (const_int 8))) (reg:SI YY))
+ ...
])
- This sequence is used both by the code to support stack unwinding for
- exceptions handlers and the code to generate dwarf2 frame debugging. */
+ FIXME:: In an ideal world the PRE_MODIFY would not exist and
+ instead we'd have a parallel expression detailing all
+ the stores to the various memory addresses so that debug
+ information is more up-to-date. Remember however while writing
+ this to take care of the constraints with the push instruction.
+
+ Note also that this has to be taken care of for the VFP registers.
+
+ For more see PR43399. */
par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num_regs));
dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (num_dwarf_regs + 1));
@@ -13952,9 +13972,14 @@ emit_multi_reg_push (unsigned long mask)
XVECEXP (par, 0, 0)
= gen_rtx_SET (VOIDmode,
- gen_frame_mem (BLKmode,
- gen_rtx_PRE_DEC (BLKmode,
- stack_pointer_rtx)),
+ gen_frame_mem
+ (BLKmode,
+ gen_rtx_PRE_MODIFY (Pmode,
+ stack_pointer_rtx,
+ plus_constant
+ (stack_pointer_rtx,
+ -4 * num_regs))
+ ),
gen_rtx_UNSPEC (BLKmode,
gen_rtvec (1, reg),
UNSPEC_PUSH_MULT));
@@ -13985,9 +14010,10 @@ emit_multi_reg_push (unsigned long mask)
{
tmp
= gen_rtx_SET (VOIDmode,
- gen_frame_mem (SImode,
- plus_constant (stack_pointer_rtx,
- 4 * j)),
+ gen_frame_mem
+ (SImode,
+ plus_constant (stack_pointer_rtx,
+ 4 * j)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
XVECEXP (dwarf, 0, dwarf_par_index++) = tmp;
@@ -14039,9 +14065,14 @@ emit_sfm (int base_reg, int count)
XVECEXP (par, 0, 0)
= gen_rtx_SET (VOIDmode,
- gen_frame_mem (BLKmode,
- gen_rtx_PRE_DEC (BLKmode,
- stack_pointer_rtx)),
+ gen_frame_mem
+ (BLKmode,
+ gen_rtx_PRE_MODIFY (Pmode,
+ stack_pointer_rtx,
+ plus_constant
+ (stack_pointer_rtx,
+ -12 * count))
+ ),
gen_rtx_UNSPEC (BLKmode,
gen_rtvec (1, reg),
UNSPEC_PUSH_MULT));
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 49863a6bab7..21ffbc190c7 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -298,3 +298,5 @@ extern void darwin_x86_file_end (void);
used in Mach-O. */
#undef MACHO_SYMBOL_FLAG_VARIABLE
#define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3)
+
+#define SUBTARGET32_DEFAULT_CPU "i686"
diff --git a/gcc/config/i386/gmon-sol2.c b/gcc/config/i386/gmon-sol2.c
index d20762156a6..e0923a0770f 100644
--- a/gcc/config/i386/gmon-sol2.c
+++ b/gcc/config/i386/gmon-sol2.c
@@ -268,7 +268,7 @@ asm(".globl _mcount\n"
FROMPCINDEX (via the frame pointer. */
"\tmovq\t0x38(%rsp),%rdi\n"
"\tmovq\t0x8(%rbp),%rsi\n"
- "\tcallq\tinternal_mcount\n"
+ "\tcall\tinternal_mcount\n"
/* Restore the saved registers. */
"\tmovq\t0x30(%rsp),%r9\n"
"\tmovq\t0x28(%rsp),%r8\n"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 5f560c47a8b..56207657ba1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1912,6 +1912,10 @@ static unsigned int ix86_minimum_incoming_stack_boundary (bool);
static enum calling_abi ix86_function_abi (const_tree);
+#ifndef SUBTARGET32_DEFAULT_CPU
+#define SUBTARGET32_DEFAULT_CPU "i386"
+#endif
+
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
#ifndef DEFAULT_PCC_STRUCT_RETURN
@@ -2878,7 +2882,7 @@ override_options (bool main_args_p)
}
if (!ix86_arch_string)
- ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386";
+ ix86_arch_string = TARGET_64BIT ? "x86-64" : SUBTARGET32_DEFAULT_CPU;
else
ix86_arch_specified = 1;
@@ -26365,7 +26369,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
if (TARGET_64BIT)
{
#ifndef NO_PROFILE_COUNTERS
- fprintf (file, "\tleaq\t" LPREFIX "P%d@(%%rip),%%r11\n", labelno);
+ fprintf (file, "\tleaq\t" LPREFIX "P%d(%%rip),%%r11\n", labelno);
#endif
if (DEFAULT_ABI == SYSV_ABI && flag_pic)
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 962a14c8005..fa94091930e 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1810,7 +1810,7 @@ typedef struct ix86_args {
#define X86_64_SSE_REGPARM_MAX 8
#define X86_64_MS_SSE_REGPARM_MAX 4
-#define X86_32_SSE_REGPARM_MAX (TARGET_SSE ? 3 : 0)
+#define X86_32_SSE_REGPARM_MAX (TARGET_SSE ? (TARGET_MACHO ? 4 : 3) : 0)
#define SSE_REGPARM_MAX \
(TARGET_64BIT ? (TARGET_64BIT_MS_ABI ? X86_64_MS_SSE_REGPARM_MAX \
diff --git a/gcc/config/i386/libgcc-glibc.ver b/gcc/config/i386/libgcc-glibc.ver
index 5565fe31893..2a2ddcd1df8 100644
--- a/gcc/config/i386/libgcc-glibc.ver
+++ b/gcc/config/i386/libgcc-glibc.ver
@@ -180,4 +180,10 @@ GCC_4.4.0 {
__trunctfxf2
__unordtf2
}
+# It is OK to have a duplicate of %inherit in libgcc-std.ver since
+# mkmap-symver.awk always takes the last %inherit statement.
+%inherit GCC_4.5.0 GCC_4.4.0
+GCC_4.5.0 {
+ __extendxftf2
+}
%endif
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index d10a40d55e1..b620193e546 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -3097,7 +3097,7 @@
size = INTVAL (operands[2]);
align = INTVAL (operands[3]);
- align = align > 4 ? 4 : align;
+ align = align > 4 ? 4 : (align ? align : 1);
/* If size/alignment is large, then use the library routines. */
if (size / align > 16)
@@ -3285,7 +3285,7 @@
size = INTVAL (operands[2]);
align = INTVAL (operands[3]);
- align = align > 8 ? 8 : align;
+ align = align > 8 ? 8 : (align ? align : 1);
/* If size/alignment is large, then use the library routines. */
if (size / align > 16)
diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md
index 96da57c319c..8326d6be0a6 100644
--- a/gcc/config/rs6000/dfp.md
+++ b/gcc/config/rs6000/dfp.md
@@ -293,71 +293,9 @@
default:
gcc_unreachable ();
case 0:
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register
- of operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mr %L0,%L1\;mr %0,%1\";
- else
- return \"mr %0,%1\;mr %L0,%L1\";
case 1:
- if (rs6000_offsettable_memref_p (operands[1])
- || (GET_CODE (operands[1]) == MEM
- && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
- || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)))
- {
- /* If the low-address word is used in the address, we must load
- it last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is
- known to be dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands[1], 0))
- return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
- else
- return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
- }
- else
- {
- rtx addreg;
-
- addreg = find_addr_reg (XEXP (operands[1], 0));
- if (refers_to_regno_p (REGNO (operands[0]),
- REGNO (operands[0]) + 1,
- operands[1], 0))
- {
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"{lx|lwzx} %0,%1\";
- }
- else
- {
- output_asm_insn (\"{lx|lwzx} %0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"\";
- }
- }
case 2:
- if (rs6000_offsettable_memref_p (operands[0])
- || (GET_CODE (operands[0]) == MEM
- && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
- || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)))
- return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
- else
- {
- rtx addreg;
-
- addreg = find_addr_reg (XEXP (operands[0], 0));
- output_asm_insn (\"{stx|stwx} %1,%0\", operands);
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{stx|stwx} %L1,%0\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"\";
- }
+ return \"#\";
case 3:
return \"fmr %0,%1\";
case 4:
@@ -379,38 +317,7 @@
"! TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
&& (gpc_reg_operand (operands[0], DDmode)
|| gpc_reg_operand (operands[1], DDmode))"
- "*
-{
- switch (which_alternative)
- {
- default:
- gcc_unreachable ();
- case 0:
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register of
- operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mr %L0,%L1\;mr %0,%1\";
- else
- return \"mr %0,%1\;mr %L0,%L1\";
- case 1:
- /* If the low-address word is used in the address, we must load
- it last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is
- known to be dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands[1], 0))
- return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
- else
- return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
- case 2:
- return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
- case 3:
- case 4:
- case 5:
- return \"#\";
- }
-}"
+ "#"
[(set_attr "type" "two,load,store,*,*,*")
(set_attr "length" "8,8,8,8,12,16")])
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 37148c6aec6..da7bca3037c 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler,
for 64 bit PowerPC linux.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -61,6 +61,8 @@ extern int dot_symbols;
#define DOT_SYMBOLS dot_symbols
#endif
+#define TARGET_PROFILE_KERNEL profile_kernel
+
#undef PROCESSOR_DEFAULT
#define PROCESSOR_DEFAULT PROCESSOR_POWER6
#undef PROCESSOR_DEFAULT64
@@ -119,7 +121,7 @@ extern int dot_symbols;
error (INVALID_32BIT, "32"); \
if (TARGET_PROFILE_KERNEL) \
{ \
- SET_PROFILE_KERNEL (0); \
+ TARGET_PROFILE_KERNEL = 0; \
error (INVALID_32BIT, "profile-kernel"); \
} \
} \
diff --git a/gcc/config/rs6000/linux64.opt b/gcc/config/rs6000/linux64.opt
index 1eac7382aa0..0d52820691c 100644
--- a/gcc/config/rs6000/linux64.opt
+++ b/gcc/config/rs6000/linux64.opt
@@ -1,6 +1,6 @@
; Options for 64-bit PowerPC Linux.
;
-; Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
;
; This file is part of GCC.
@@ -20,5 +20,5 @@
; <http://www.gnu.org/licenses/>.
mprofile-kernel
-Target Report Var(TARGET_PROFILE_KERNEL)
+Target Report Var(profile_kernel)
Call mcount for profiling before a function prologue
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ce38a8a9d9a..dea0271b91a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1269,9 +1269,6 @@ static const struct attribute_spec rs6000_attribute_table[] =
#endif
#ifndef TARGET_PROFILE_KERNEL
#define TARGET_PROFILE_KERNEL 0
-#define SET_PROFILE_KERNEL(N)
-#else
-#define SET_PROFILE_KERNEL(N) TARGET_PROFILE_KERNEL = (N)
#endif
/* The VRSAVE bitmask puts bit %v0 as the most significant bit. */
@@ -16727,6 +16724,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
int i;
int j = -1;
bool used_update = false;
+ rtx restore_basereg = NULL_RTX;
if (MEM_P (src) && INT_REGNO_P (reg))
{
@@ -16745,10 +16743,27 @@ rs6000_split_multireg_move (rtx dst, rtx src)
}
else if (! rs6000_offsettable_memref_p (src))
{
- rtx basereg;
- basereg = gen_rtx_REG (Pmode, reg);
- emit_insn (gen_rtx_SET (VOIDmode, basereg, XEXP (src, 0)));
- src = replace_equiv_address (src, basereg);
+ if (GET_CODE (XEXP (src, 0)) == PRE_MODIFY)
+ {
+ rtx basereg = XEXP (XEXP (src, 0), 0);
+ if (TARGET_UPDATE)
+ {
+ rtx ndst = simplify_gen_subreg (reg_mode, dst, mode, 0);
+ emit_insn (gen_rtx_SET (VOIDmode, ndst,
+ gen_rtx_MEM (reg_mode, XEXP (src, 0))));
+ used_update = true;
+ }
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, basereg,
+ XEXP (XEXP (src, 0), 1)));
+ src = replace_equiv_address (src, basereg);
+ }
+ else
+ {
+ rtx basereg = gen_rtx_REG (Pmode, reg);
+ emit_insn (gen_rtx_SET (VOIDmode, basereg, XEXP (src, 0)));
+ src = replace_equiv_address (src, basereg);
+ }
}
breg = XEXP (src, 0);
@@ -16762,8 +16777,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
&& REGNO (breg) < REGNO (dst) + nregs)
j = REGNO (breg) - REGNO (dst);
}
-
- if (GET_CODE (dst) == MEM && INT_REGNO_P (reg))
+ else if (MEM_P (dst) && INT_REGNO_P (reg))
{
rtx breg;
@@ -16793,7 +16807,34 @@ rs6000_split_multireg_move (rtx dst, rtx src)
emit_insn (gen_add3_insn (breg, breg, delta_rtx));
dst = replace_equiv_address (dst, breg);
}
- else
+ else if (!rs6000_offsettable_memref_p (dst)
+ && GET_CODE (XEXP (dst, 0)) != LO_SUM)
+ {
+ if (GET_CODE (XEXP (dst, 0)) == PRE_MODIFY)
+ {
+ rtx basereg = XEXP (XEXP (dst, 0), 0);
+ if (TARGET_UPDATE)
+ {
+ rtx nsrc = simplify_gen_subreg (reg_mode, src, mode, 0);
+ emit_insn (gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (reg_mode, XEXP (dst, 0)), nsrc));
+ used_update = true;
+ }
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, basereg,
+ XEXP (XEXP (dst, 0), 1)));
+ dst = replace_equiv_address (dst, basereg);
+ }
+ else
+ {
+ rtx basereg = XEXP (XEXP (dst, 0), 0);
+ rtx offsetreg = XEXP (XEXP (dst, 0), 1);
+ emit_insn (gen_add3_insn (basereg, basereg, offsetreg));
+ restore_basereg = gen_sub3_insn (basereg, basereg, offsetreg);
+ dst = replace_equiv_address (dst, basereg);
+ }
+ }
+ else if (GET_CODE (XEXP (dst, 0)) != LO_SUM)
gcc_assert (rs6000_offsettable_memref_p (dst));
}
@@ -16815,6 +16856,8 @@ rs6000_split_multireg_move (rtx dst, rtx src)
simplify_gen_subreg (reg_mode, src, mode,
j * reg_mode_size)));
}
+ if (restore_basereg != NULL_RTX)
+ emit_insn (restore_basereg);
}
}
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 08475b65e54..50c4d618053 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -217,6 +217,9 @@
(DD "TARGET_DFP")
(TD "TARGET_DFP")])
+; These modes do not fit in integer registers in 32-bit mode.
+(define_mode_iterator DIFD [DI DF DD])
+
; Various instructions that come in SI and DI forms.
; A generic w/d attribute, for things like cmpw/cmpd.
(define_mode_attr wd [(QI "b") (HI "h") (SI "w") (DI "d")])
@@ -9148,73 +9151,9 @@
default:
gcc_unreachable ();
case 0:
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register
- of operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mr %L0,%L1\;mr %0,%1\";
- else
- return \"mr %0,%1\;mr %L0,%L1\";
case 1:
- if (rs6000_offsettable_memref_p (operands[1])
- || (GET_CODE (operands[1]) == MEM
- && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
- || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC
- || GET_CODE (XEXP (operands[1], 0)) == PRE_MODIFY)))
- {
- /* If the low-address word is used in the address, we must load
- it last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is
- known to be dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands[1], 0))
- return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
- else
- return \"{l%U1%X1|lwz%U1%X1} %0,%1\;{l|lwz} %L0,%L1\";
- }
- else
- {
- rtx addreg;
-
- addreg = find_addr_reg (XEXP (operands[1], 0));
- if (refers_to_regno_p (REGNO (operands[0]),
- REGNO (operands[0]) + 1,
- operands[1], 0))
- {
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{l%X1|lwz%X1} %L0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"{l%X1|lwz%X1} %0,%1\";
- }
- else
- {
- output_asm_insn (\"{l%X1|lwz%X1} %0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{l%X1|lwz%X1} %L0,%1\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"\";
- }
- }
case 2:
- if (rs6000_offsettable_memref_p (operands[0])
- || (GET_CODE (operands[0]) == MEM
- && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
- || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC
- || GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY)))
- return \"{st%U0%X0|stw%U0%X0} %1,%0\;{st|stw} %L1,%L0\";
- else
- {
- rtx addreg;
-
- addreg = find_addr_reg (XEXP (operands[0], 0));
- output_asm_insn (\"{st%X0|stw%X0} %1,%0\", operands);
- output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
- output_asm_insn (\"{st%X0|stw%X0} %L1,%0\", operands);
- output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
- return \"\";
- }
+ return \"#\";
case 3:
case 4:
return \"xxlor %x0,%x1,%x1\";
@@ -9249,38 +9188,7 @@
|| TARGET_SOFT_FLOAT || TARGET_E500_SINGLE)
&& (gpc_reg_operand (operands[0], DFmode)
|| gpc_reg_operand (operands[1], DFmode))"
- "*
-{
- switch (which_alternative)
- {
- default:
- gcc_unreachable ();
- case 0:
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register of
- operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"mr %L0,%L1\;mr %0,%1\";
- else
- return \"mr %0,%1\;mr %L0,%L1\";
- case 1:
- /* If the low-address word is used in the address, we must load
- it last. Otherwise, load it first. Note that we cannot have
- auto-increment in that case since the address register is
- known to be dead. */
- if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
- operands[1], 0))
- return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
- else
- return \"{l%U1%X1|lwz%U1%X1} %0,%1\;{l|lwz} %L0,%L1\";
- case 2:
- return \"{st%U0%X0|stw%U0%X0} %1,%0\;{st|stw} %L1,%L0\";
- case 3:
- case 4:
- case 5:
- return \"#\";
- }
-}"
+ "#"
[(set_attr "type" "two,load,store,*,*,*")
(set_attr "length" "8,8,8,8,12,16")])
@@ -9729,8 +9637,8 @@
}")
(define_split
- [(set (match_operand:DI 0 "rs6000_nonimmediate_operand" "")
- (match_operand:DI 1 "input_operand" ""))]
+ [(set (match_operand:DIFD 0 "rs6000_nonimmediate_operand" "")
+ (match_operand:DIFD 1 "input_operand" ""))]
"reload_completed && !TARGET_POWERPC64
&& gpr_or_gpr_p (operands[0], operands[1])"
[(pc)]
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index e4ef862c96d..38711d3d72e 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "params.h"
#include "df.h"
+#include "dwarf2out.h"
/* Processor costs */
static const
@@ -362,8 +363,7 @@ static rtx sparc_builtin_saveregs (void);
static int epilogue_renumber (rtx *, int);
static bool sparc_assemble_integer (rtx, unsigned int, int);
static int set_extends (rtx);
-static void emit_pic_helper (void);
-static void load_pic_register (bool);
+static void load_pic_register (void);
static int save_or_restore_regs (int, int, rtx, int, int);
static void emit_save_or_restore_regs (int);
static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT);
@@ -2908,9 +2908,8 @@ sparc_cannot_force_const_mem (rtx x)
}
/* PIC support. */
-static GTY(()) char pic_helper_symbol_name[256];
+static GTY(()) bool pic_helper_needed = false;
static GTY(()) rtx pic_helper_symbol;
-static GTY(()) bool pic_helper_emitted_p = false;
static GTY(()) rtx global_offset_table;
/* Ensure that we are not using patterns that are not OK with PIC. */
@@ -3521,34 +3520,31 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return x;
}
-/* Emit the special PIC helper function. */
+#ifdef HAVE_GAS_HIDDEN
+# define USE_HIDDEN_LINKONCE 1
+#else
+# define USE_HIDDEN_LINKONCE 0
+#endif
static void
-emit_pic_helper (void)
+get_pc_thunk_name (char name[32], unsigned int regno)
{
- const char *pic_name = reg_names[REGNO (pic_offset_table_rtx)];
- int align;
+ const char *pic_name = reg_names[regno];
- switch_to_section (text_section);
+ /* Skip the leading '%' as that cannot be used in a
+ symbol name. */
+ pic_name += 1;
- align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
- if (align > 0)
- ASM_OUTPUT_ALIGN (asm_out_file, align);
- ASM_OUTPUT_LABEL (asm_out_file, pic_helper_symbol_name);
- if (flag_delayed_branch)
- fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n",
- pic_name, pic_name);
+ if (USE_HIDDEN_LINKONCE)
+ sprintf (name, "__sparc_get_pc_thunk.%s", pic_name);
else
- fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n",
- pic_name, pic_name);
-
- pic_helper_emitted_p = true;
+ ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", regno);
}
/* Emit code to load the PIC register. */
static void
-load_pic_register (bool delay_pic_helper)
+load_pic_register (void)
{
int orig_flag_pic = flag_pic;
@@ -3560,18 +3556,18 @@ load_pic_register (bool delay_pic_helper)
}
/* If we haven't initialized the special PIC symbols, do so now. */
- if (!pic_helper_symbol_name[0])
+ if (!pic_helper_needed)
{
- ASM_GENERATE_INTERNAL_LABEL (pic_helper_symbol_name, "LADDPC", 0);
- pic_helper_symbol = gen_rtx_SYMBOL_REF (Pmode, pic_helper_symbol_name);
+ char name[32];
+
+ pic_helper_needed = true;
+
+ get_pc_thunk_name (name, REGNO (pic_offset_table_rtx));
+ pic_helper_symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
+
global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
}
- /* If we haven't emitted the special PIC helper function, do so now unless
- we are requested to delay it. */
- if (!delay_pic_helper && !pic_helper_emitted_p)
- emit_pic_helper ();
-
flag_pic = 0;
if (TARGET_ARCH64)
emit_insn (gen_load_pcrel_symdi (pic_offset_table_rtx, global_offset_table,
@@ -4221,7 +4217,7 @@ sparc_expand_prologue (void)
/* Load the PIC register if needed. */
if (flag_pic && crtl->uses_pic_offset_table)
- load_pic_register (false);
+ load_pic_register ();
}
/* This function generates the assembly code for function entry, which boils
@@ -8882,7 +8878,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
start_sequence ();
/* Delay emitting the PIC helper function because it needs to
change the section and we are emitting assembly code. */
- load_pic_register (true); /* clobbers %o7 */
+ load_pic_register (); /* clobbers %o7 */
scratch = legitimize_pic_address (funexp, scratch);
seq = get_insns ();
end_sequence ();
@@ -9037,9 +9033,59 @@ sparc_output_dwarf_dtprel (FILE *file, int size, rtx x)
static void
sparc_file_end (void)
{
- /* If we haven't emitted the special PIC helper function, do so now. */
- if (pic_helper_symbol_name[0] && !pic_helper_emitted_p)
- emit_pic_helper ();
+ /* If need to emit the special PIC helper function, do so now. */
+ if (pic_helper_needed)
+ {
+ unsigned int regno = REGNO (pic_offset_table_rtx);
+ const char *pic_name = reg_names[regno];
+ char name[32];
+#ifdef DWARF2_UNWIND_INFO
+ bool do_cfi;
+#endif
+
+ get_pc_thunk_name (name, regno);
+ if (USE_HIDDEN_LINKONCE)
+ {
+ tree decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
+ get_identifier (name),
+ build_function_type (void_type_node,
+ void_list_node));
+ DECL_RESULT (decl) = build_decl (BUILTINS_LOCATION, RESULT_DECL,
+ NULL_TREE, void_type_node);
+ TREE_STATIC (decl) = 1;
+ make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl));
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (decl) = 1;
+ allocate_struct_function (decl, true);
+ current_function_decl = decl;
+ init_varasm_status ();
+ assemble_start_function (decl, name);
+ }
+ else
+ {
+ const int align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
+ switch_to_section (text_section);
+ if (align > 0)
+ ASM_OUTPUT_ALIGN (asm_out_file, align);
+ ASM_OUTPUT_LABEL (asm_out_file, name);
+ }
+
+#ifdef DWARF2_UNWIND_INFO
+ do_cfi = dwarf2out_do_cfi_asm ();
+ if (do_cfi)
+ fprintf (asm_out_file, "\t.cfi_startproc\n");
+#endif
+ if (flag_delayed_branch)
+ fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n",
+ pic_name, pic_name);
+ else
+ fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n",
+ pic_name, pic_name);
+#ifdef DWARF2_UNWIND_INFO
+ if (do_cfi)
+ fprintf (asm_out_file, "\t.cfi_endproc\n");
+#endif
+ }
if (NEED_INDICATE_EXEC_STACK)
file_end_indicate_exec_stack ();
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 3e04c17d790..f2c1be69035 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -1957,10 +1957,6 @@ spu_expand_prologue (void)
rtx scratch_reg_0, scratch_reg_1;
rtx insn, real;
- /* A NOTE_INSN_DELETED is supposed to be at the start and end of
- the "toplevel" insn chain. */
- emit_note (NOTE_INSN_DELETED);
-
if (flag_pic && optimize == 0)
crtl->uses_pic_offset_table = 1;
@@ -2066,7 +2062,6 @@ spu_expand_prologue (void)
}
}
- emit_note (NOTE_INSN_DELETED);
}
void
@@ -2077,10 +2072,6 @@ spu_expand_epilogue (bool sibcall_p)
rtx sp_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
rtx jump, scratch_reg_0;
- /* A NOTE_INSN_DELETED is supposed to be at the start and end of
- the "toplevel" insn chain. */
- emit_note (NOTE_INSN_DELETED);
-
if (spu_naked_function_p (current_function_decl))
return;
@@ -2125,7 +2116,6 @@ spu_expand_epilogue (bool sibcall_p)
emit_barrier_after (jump);
}
- emit_note (NOTE_INSN_DELETED);
}
rtx
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 214f36f2405..0e10b5bb203 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,32 @@
+2010-03-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/43333
+ * tree.c (pod_type_p): Use old meaning in C++98 mode.
+
+ PR c++/43281
+ * pt.c (contains_auto_r): New fn.
+ (do_auto_deduction): Use it.
+ (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
+
+2010-03-20 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/43081:
+ * decl2.c (grokfield): Handle invalid initializers for member
+ functions.
+
+2010-03-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/43375
+ * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
+ is NULL.
+ * decl2.c (vague_linkage_p): Likewise.
+
+2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/43418
+ * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
+ false, in the cp_parser_expression_statement call.
+
2010-03-05 Jason Merrill <jason@redhat.com>
* mangle.c (mangle_decl): Give name collision error even without
@@ -11,6 +40,11 @@
2010-03-03 Jason Merrill <jason@redhat.com>
PR c++/12909
+ * mangle.c (mangle_decl): Handle VAR_DECL, too.
+
+2010-03-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/12909
* mangle.c: Include cgraph.h.
(mangle_decl): If the mangled name will change in a later
ABI version, make the later mangled name an alias.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 81d7ee3212f..9da69e61595 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -908,8 +908,13 @@ grokfield (const cp_declarator *declarator,
}
else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
{
- gcc_assert (error_operand_p (init) || integer_zerop (init));
- DECL_PURE_VIRTUAL_P (value) = 1;
+ if (integer_zerop (init))
+ DECL_PURE_VIRTUAL_P (value) = 1;
+ else if (error_operand_p (init))
+ ; /* An error has already been reported. */
+ else
+ error ("invalid initializer for member function %qD",
+ value);
}
else
{
@@ -1655,7 +1660,8 @@ vague_linkage_p (tree decl)
return (DECL_COMDAT (decl)
|| (((TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl))
- || DECL_TEMPLATE_INSTANTIATION (decl))
+ || (DECL_LANG_SPECIFIC (decl)
+ && DECL_TEMPLATE_INSTANTIATION (decl)))
&& TREE_PUBLIC (decl)));
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index a93ad068e52..5ed98bc93bd 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -221,12 +221,15 @@ make_alias_for (tree target, tree newid)
TREE_THIS_VOLATILE (alias) = TREE_THIS_VOLATILE (target);
TREE_PUBLIC (alias) = 0;
DECL_INTERFACE_KNOWN (alias) = 1;
- DECL_NOT_REALLY_EXTERN (alias) = 1;
+ if (DECL_LANG_SPECIFIC (alias))
+ {
+ DECL_NOT_REALLY_EXTERN (alias) = 1;
+ DECL_USE_TEMPLATE (alias) = 0;
+ DECL_TEMPLATE_INFO (alias) = NULL;
+ }
DECL_EXTERNAL (alias) = 0;
DECL_ARTIFICIAL (alias) = 1;
- DECL_USE_TEMPLATE (alias) = 0;
DECL_TEMPLATE_INSTANTIATED (alias) = 0;
- DECL_TEMPLATE_INFO (alias) = NULL;
if (TREE_CODE (alias) == FUNCTION_DECL)
{
DECL_SAVED_FUNCTION_DATA (alias) = NULL;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 55d05174eee..d27d12254ca 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8352,7 +8352,7 @@ cp_parser_for_init_statement (cp_parser* parser)
return;
}
- cp_parser_expression_statement (parser, false);
+ cp_parser_expression_statement (parser, NULL_TREE);
}
/* Parse a jump-statement.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 66e7d735ef7..f5d68f83127 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9921,6 +9921,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (type
&& TREE_CODE (t) != TYPENAME_TYPE
+ && TREE_CODE (t) != TEMPLATE_TYPE_PARM
&& TREE_CODE (t) != IDENTIFIER_NODE
&& TREE_CODE (t) != FUNCTION_TYPE
&& TREE_CODE (t) != METHOD_TYPE)
@@ -18240,6 +18241,20 @@ listify_autos (tree type, tree auto_node)
return tsubst (type, argvec, tf_warning_or_error, NULL_TREE);
}
+/* walk_tree helper for do_auto_deduction. */
+
+static tree
+contains_auto_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *type)
+{
+ /* Is this a variable with the type we're looking for? */
+ if (DECL_P (*tp)
+ && TREE_TYPE (*tp) == type)
+ return *tp;
+ else
+ return NULL_TREE;
+}
+
/* Replace occurrences of 'auto' in TYPE with the appropriate type deduced
from INIT. AUTO_NODE is the TEMPLATE_TYPE_PARM used for 'auto' in TYPE. */
@@ -18248,8 +18263,19 @@ do_auto_deduction (tree type, tree init, tree auto_node)
{
tree parms, tparms, targs;
tree args[1];
+ tree decl;
int val;
+ /* The name of the object being declared shall not appear in the
+ initializer expression. */
+ decl = cp_walk_tree_without_duplicates (&init, contains_auto_r, type);
+ if (decl)
+ {
+ error ("variable %q#D with %<auto%> type used in its own "
+ "initializer", decl);
+ return error_mark_node;
+ }
+
/* [dcl.spec.auto]: Obtain P from T by replacing the occurrences of auto
with either a new invented type template parameter U or, if the
initializer is a braced-init-list (8.5.4), with
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 9867d2efb66..35b0da62ea5 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2390,7 +2390,9 @@ pod_type_p (const_tree t)
argument unmodified and we assign it to a const_tree. */
t = strip_array_types (CONST_CAST_TREE(t));
- if (CLASS_TYPE_P (t))
+ if (!CLASS_TYPE_P (t))
+ return scalarish_type_p (t);
+ else if (cxx_dialect > cxx98)
/* [class]/10: A POD struct is a class that is both a trivial class and a
standard-layout class, and has no non-static data members of type
non-POD struct, non-POD union (or array of such types).
@@ -2399,7 +2401,8 @@ pod_type_p (const_tree t)
non-std-layout or non-trivial, the class will be too. */
return (std_layout_type_p (t) && trivial_type_p (t));
else
- return scalarish_type_p (t);
+ /* The C++98 definition of POD is different. */
+ return !CLASSTYPE_NON_LAYOUT_POD_P (t);
}
/* Returns true iff T is POD for the purpose of layout, as defined in the
diff --git a/gcc/cselib.c b/gcc/cselib.c
index f63ea3f5f1c..9073b9928be 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
static bool cselib_record_memory;
+static bool cselib_preserve_constants;
static int entry_and_rtx_equal_p (const void *, const void *);
static hashval_t get_value_hash (const void *);
static struct elt_list *new_elt_list (struct elt_list *, cselib_val *);
@@ -135,6 +136,11 @@ static int values_became_useless;
presence in the list by checking the next pointer. */
static cselib_val dummy_val;
+/* If non-NULL, value of the eliminated arg_pointer_rtx or frame_pointer_rtx
+ that is constant through the whole function and should never be
+ eliminated. */
+static cselib_val *cfa_base_preserved_val;
+
/* Used to list all values that contain memory reference.
May or may not contain the useless values - the list is compacted
each time memory is invalidated. */
@@ -229,6 +235,35 @@ cselib_clear_table (void)
cselib_reset_table (1);
}
+/* Remove from hash table all VALUEs except constants. */
+
+static int
+preserve_only_constants (void **x, void *info ATTRIBUTE_UNUSED)
+{
+ cselib_val *v = (cselib_val *)*x;
+
+ if (v->locs != NULL
+ && v->locs->next == NULL)
+ {
+ if (CONSTANT_P (v->locs->loc)
+ && (GET_CODE (v->locs->loc) != CONST
+ || !references_value_p (v->locs->loc, 0)))
+ return 1;
+ if (cfa_base_preserved_val)
+ {
+ if (v == cfa_base_preserved_val)
+ return 1;
+ if (GET_CODE (v->locs->loc) == PLUS
+ && CONST_INT_P (XEXP (v->locs->loc, 1))
+ && XEXP (v->locs->loc, 0) == cfa_base_preserved_val->val_rtx)
+ return 1;
+ }
+ }
+
+ htab_clear_slot (cselib_hash_table, x);
+ return 1;
+}
+
/* Remove all entries from the hash table, arranging for the next
value to be numbered NUM. */
@@ -237,15 +272,37 @@ cselib_reset_table (unsigned int num)
{
unsigned int i;
- for (i = 0; i < n_used_regs; i++)
- REG_VALUES (used_regs[i]) = 0;
-
max_value_regs = 0;
- n_used_regs = 0;
+ if (cfa_base_preserved_val)
+ {
+ unsigned int regno = REGNO (cfa_base_preserved_val->locs->loc);
+ unsigned int new_used_regs = 0;
+ for (i = 0; i < n_used_regs; i++)
+ if (used_regs[i] == regno)
+ {
+ new_used_regs = 1;
+ continue;
+ }
+ else
+ REG_VALUES (used_regs[i]) = 0;
+ gcc_assert (new_used_regs == 1);
+ n_used_regs = new_used_regs;
+ used_regs[0] = regno;
+ max_value_regs
+ = hard_regno_nregs[regno][GET_MODE (cfa_base_preserved_val->locs->loc)];
+ }
+ else
+ {
+ for (i = 0; i < n_used_regs; i++)
+ REG_VALUES (used_regs[i]) = 0;
+ n_used_regs = 0;
+ }
- /* ??? Preserve constants? */
- htab_empty (cselib_hash_table);
+ if (cselib_preserve_constants)
+ htab_traverse (cselib_hash_table, preserve_only_constants, NULL);
+ else
+ htab_empty (cselib_hash_table);
n_useless_values = 0;
@@ -434,6 +491,18 @@ cselib_preserved_value_p (cselib_val *v)
return PRESERVED_VALUE_P (v->val_rtx);
}
+/* Arrange for a REG value to be assumed constant through the whole function,
+ never invalidated and preserved across cselib_reset_table calls. */
+
+void
+cselib_preserve_cfa_base_value (cselib_val *v)
+{
+ if (cselib_preserve_constants
+ && v->locs
+ && REG_P (v->locs->loc))
+ cfa_base_preserved_val = v;
+}
+
/* Clean all non-constant expressions in the hash table, but retain
their values. */
@@ -1600,7 +1669,7 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode)
if (i < FIRST_PSEUDO_REGISTER && v != NULL)
this_last = end_hard_regno (GET_MODE (v->val_rtx), i) - 1;
- if (this_last < regno || v == NULL)
+ if (this_last < regno || v == NULL || v == cfa_base_preserved_val)
{
l = &(*l)->next;
continue;
@@ -2018,7 +2087,7 @@ cselib_process_insn (rtx insn)
init_alias_analysis. */
void
-cselib_init (bool record_memory)
+cselib_init (int record_what)
{
elt_list_pool = create_alloc_pool ("elt_list",
sizeof (struct elt_list), 10);
@@ -2027,7 +2096,8 @@ cselib_init (bool record_memory)
cselib_val_pool = create_alloc_pool ("cselib_val_list",
sizeof (cselib_val), 10);
value_pool = create_alloc_pool ("value", RTX_CODE_SIZE (VALUE), 100);
- cselib_record_memory = record_memory;
+ cselib_record_memory = record_what & CSELIB_RECORD_MEMORY;
+ cselib_preserve_constants = record_what & CSELIB_PRESERVE_CONSTANTS;
/* (mem:BLK (scratch)) is a special mechanism to conflict with everything,
see canon_true_dependence. This is only created once. */
@@ -2061,6 +2131,8 @@ void
cselib_finish (void)
{
cselib_discard_hook = NULL;
+ cselib_preserve_constants = false;
+ cfa_base_preserved_val = NULL;
free_alloc_pool (elt_list_pool);
free_alloc_pool (elt_loc_list_pool);
free_alloc_pool (cselib_val_pool);
diff --git a/gcc/cselib.h b/gcc/cselib.h
index 67e59920254..015d628bf9e 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -66,12 +66,18 @@ struct cselib_set
cselib_val *dest_addr_elt;
};
+enum cselib_record_what
+{
+ CSELIB_RECORD_MEMORY = 1,
+ CSELIB_PRESERVE_CONSTANTS = 2
+};
+
extern void (*cselib_discard_hook) (cselib_val *);
extern void (*cselib_record_sets_hook) (rtx insn, struct cselib_set *sets,
int n_sets);
extern cselib_val *cselib_lookup (rtx, enum machine_mode, int);
-extern void cselib_init (bool record_memory);
+extern void cselib_init (int);
extern void cselib_clear_table (void);
extern void cselib_finish (void);
extern void cselib_process_insn (rtx);
@@ -92,5 +98,6 @@ extern unsigned int cselib_get_next_uid (void);
extern void cselib_preserve_value (cselib_val *);
extern bool cselib_preserved_value_p (cselib_val *);
extern void cselib_preserve_only_values (void);
+extern void cselib_preserve_cfa_base_value (cselib_val *);
extern void dump_cselib_table (FILE *);
diff --git a/gcc/doc/configfiles.texi b/gcc/doc/configfiles.texi
index 726a76a5104..3650179cc87 100644
--- a/gcc/doc/configfiles.texi
+++ b/gcc/doc/configfiles.texi
@@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2002, 2010 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -33,13 +33,9 @@ used.
@item
@file{cstamp-h} is used as a timestamp.
@item
-@file{fixinc/Makefile} is constructed from @file{fixinc/Makefile.in}.
-@item
@file{gccbug}, a script for reporting bugs in GCC, is constructed from
@file{gccbug.in}.
@item
-@file{intl/Makefile} is constructed from @file{intl/Makefile.in}.
-@item
If a language @file{config-lang.in} file (@pxref{Front End Config, ,
The Front End @file{config-lang.in} File}) sets @code{outputs}, then
the files listed in @code{outputs} there are also generated.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 58f193fac9c..c0c202f0b7f 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2730,7 +2730,8 @@ attribute tells the compiler to use the Microsoft ABI, while the
GNU/Linux and other systems. The default is to use the Microsoft ABI
when targeting Windows. On all other systems, the default is the AMD ABI.
-Note, This feature is currently sorried out for Windows targets trying to
+Note, the @code{ms_abi} attribute for Windows targets currently requires
+the @option{-maccumulate-outgoing-args} option.
@item ms_hook_prologue
@cindex @code{ms_hook_prologue} attribute
diff --git a/gcc/doc/gimple.texi b/gcc/doc/gimple.texi
index 76cc269aefe..4f2c09f8ee8 100644
--- a/gcc/doc/gimple.texi
+++ b/gcc/doc/gimple.texi
@@ -679,8 +679,19 @@ the address of a function local variable).
@end deftypefn
@deftypefn {GIMPLE function} is_gimple_min_invariant_address (tree t)
+Return true if t is an @code{ADDR_EXPR} that does not change once a
+function is running.
+@end deftypefn
+
+@deftypefn {GIMPLE function} is_gimple_ip_invariant (tree t)
+Return true if t is an interprocedural invariant. This means that t
+is a valid invariant in all functions (e.g. it can be an address of a
+global variable but not of a local one).
+@end deftypefn
+
+@deftypefn {GIMPLE function} is_gimple_ip_invariant_address (tree t)
Return true if t is an @code{ADDR_EXPR} that does not change once the
-program is running.
+program is running (and which is valid in all functions).
@end deftypefn
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 060be884e0c..23a0f4af9dc 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6675,7 +6675,9 @@ Graphite loop transformation infrastructure.
Perform loop strip mining transformations on loops. Strip mining
splits a loop into two nested loops. The outer loop has strides
equal to the strip size and the inner loop has strides of the
-original loop within a strip. For example, given a loop like:
+original loop within a strip. The strip length can be changed
+using the @option{loop-block-tile-size} parameter. For example,
+given a loop like:
@smallexample
DO I = 1, N
A(I) = A(I) + C
@@ -6683,8 +6685,8 @@ ENDDO
@end smallexample
loop strip mining will transform the loop as if the user had written:
@smallexample
-DO II = 1, N, 4
- DO I = II, min (II + 3, N)
+DO II = 1, N, 51
+ DO I = II, min (II + 50, N)
A(I) = A(I) + C
ENDDO
ENDDO
@@ -6697,7 +6699,9 @@ enable the Graphite loop transformation infrastructure.
@item -floop-block
Perform loop blocking transformations on loops. Blocking strip mines
each loop in the loop nest such that the memory accesses of the
-element loops fit inside caches. For example, given a loop like:
+element loops fit inside caches. The strip length can be changed
+using the @option{loop-block-tile-size} parameter. For example, given
+a loop like:
@smallexample
DO I = 1, N
DO J = 1, M
@@ -6707,10 +6711,10 @@ ENDDO
@end smallexample
loop blocking will transform the loop as if the user had written:
@smallexample
-DO II = 1, N, 64
- DO JJ = 1, M, 64
- DO I = II, min (II + 63, N)
- DO J = JJ, min (JJ + 63, M)
+DO II = 1, N, 51
+ DO JJ = 1, M, 51
+ DO I = II, min (II + 50, N)
+ DO J = JJ, min (JJ + 50, M)
A(J, I) = B(I) + C(J)
ENDDO
ENDDO
@@ -8492,6 +8496,24 @@ parameters only when their cumulative size is less or equal to
@option{ipa-sra-ptr-growth-factor} times the size of the original
pointer parameter.
+@item graphite-max-nb-scop-params
+To avoid exponential effects in the Graphite loop transforms, the
+number of parameters in a Static Control Part (SCoP) is bounded. The
+default value is 10 parameters. A variable whose value is unknown at
+compile time and defined outside a SCoP is a parameter of the SCoP.
+
+@item graphite-max-bbs-per-function
+To avoid exponential effects in the detection of SCoPs, the size of
+the functions analyzed by Graphite is bounded. The default value is
+100 basic blocks.
+
+@item loop-block-tile-size
+Loop blocking or strip mining transforms, enabled with
+@option{-floop-block} or @option{-floop-strip-mine}, strip mine each
+loop in the loop nest by a given number of iterations. The strip
+length can be changed using the @option{loop-block-tile-size}
+parameter. The default value is 51 iterations.
+
@end table
@end table
diff --git a/gcc/doc/makefile.texi b/gcc/doc/makefile.texi
index 4c8d9ae46d4..80fa89d8894 100644
--- a/gcc/doc/makefile.texi
+++ b/gcc/doc/makefile.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008
+@c Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2010
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -46,12 +46,11 @@ That, and all the files created by @command{configure}.
@item maintainer-clean
Distclean plus any file that can be generated from other files. Note
that additional tools may be required beyond what is normally needed to
-build gcc.
+build GCC.
@item srcextra
-Generates files in the source directory that do not exist in CVS but
-should go into a release tarball. One example is @file{gcc/java/parse.c}
-which is generated from the CVS source file @file{gcc/java/parse.y}.
+Generates files in the source directory that are not version-controlled but
+should go into a release tarball.
@item srcinfo
@itemx srcman
@@ -59,16 +58,16 @@ Copies the info-formatted and manpage documentation into the source
directory usually for the purpose of generating a release tarball.
@item install
-Installs gcc.
+Installs GCC.
@item uninstall
-Deletes installed files.
+Deletes installed files, though this is not supported.
@item check
Run the testsuite. This creates a @file{testsuite} subdirectory that
has various @file{.sum} and @file{.log} files containing the results of
the testing. You can run subsets with, for example, @samp{make check-gcc}.
-You can specify specific tests by setting RUNTESTFLAGS to be the name
+You can specify specific tests by setting @env{RUNTESTFLAGS} to be the name
of the @file{.exp} file, optionally followed by (for some tests) an equals
and a file wildcard, like:
@@ -77,7 +76,7 @@ make check-gcc RUNTESTFLAGS="execute.exp=19980413-*"
@end smallexample
Note that running the testsuite may require additional tools be
-installed, such as TCL or dejagnu.
+installed, such as Tcl or DejaGnu.
@end table
The toplevel tree from which you start GCC compilation is not
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index ee5545850ea..a3455db2e2c 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
+@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -32,15 +32,14 @@ subdirectories that contain parts of GCC and its runtime libraries:
The Boehm conservative garbage collector, used as part of the Java
runtime library.
+@item config
+Autoconf macros and Makefile fragments used throught the tree.
+
@item contrib
Contributed scripts that may be found useful in conjunction with GCC@.
One of these, @file{contrib/texi2pod.pl}, is used to generate man
pages from Texinfo manuals as part of the GCC build process.
-@item fastjar
-An implementation of the @command{jar} command, used with the Java
-front end.
-
@item fixincludes
The support for fixing system headers to work with GCC@. See
@file{fixincludes/README} for more information. The headers fixed by
@@ -54,12 +53,15 @@ including optimizers, support for different target architectures,
language front ends, and testsuites. @xref{gcc Directory, , The
@file{gcc} Subdirectory}, for details.
+@item gnattools
+Support tools for GNAT.
+
@item include
Headers for the @code{libiberty} library.
@item intl
GNU @code{libintl}, from GNU @code{gettext}, for systems which do not
-include it in libc.
+include it in @code{libc}.
@item libada
The Ada runtime library.
@@ -67,12 +69,21 @@ The Ada runtime library.
@item libcpp
The C preprocessor library.
-@item libgfortran
-The Fortran runtime library.
+@item libdecnumber
+The Decimal Float support library.
@item libffi
The @code{libffi} library, used as part of the Java runtime library.
+@item libgcc
+The GCC runtime library.
+
+@item libgfortran
+The Fortran runtime library.
+
+@item libgomp
+The GNU OpenMP runtime library.
+
@item libiberty
The @code{libiberty} library, used for portability and for some
generally useful data structures and algorithms. @xref{Top, ,
@@ -89,6 +100,9 @@ dereferencing operations.
@item libobjc
The Objective-C and Objective-C++ runtime library.
+@item libssp
+The Stack protector runtime library.
+
@item libstdc++-v3
The C++ runtime library.
@@ -312,7 +326,7 @@ GCC can also install @code{<tgmath.h>}. It will do this when
The main GCC documentation is in the form of manuals in Texinfo
format. These are installed in Info format; DVI versions may be
generated by @samp{make dvi}, PDF versions by @samp{make pdf}, and
-HTML versions by @command{make html}. In addition, some man pages are
+HTML versions by @samp{make html}. In addition, some man pages are
generated from the Texinfo manuals, there are some other text files
with miscellaneous documentation, and runtime libraries have their own
documentation outside the @file{gcc} directory. FIXME: document the
@@ -351,7 +365,7 @@ DVI-formatted manuals are generated by @samp{make dvi}, which uses
@command{texi2dvi} (via the Makefile macro @code{$(TEXI2DVI)}).
PDF-formatted manuals are generated by @samp{make pdf}, which uses
@command{texi2pdf} (via the Makefile macro @code{$(TEXI2PDF)}). HTML
-formatted manuals are generated by @command{make html}. Info
+formatted manuals are generated by @samp{make html}. Info
manuals are generated by @samp{make info} (which is run as part of
a bootstrap); this generates the manuals in the source directory,
using @command{makeinfo} via the Makefile macro @code{$(MAKEINFO)},
@@ -371,7 +385,7 @@ directory or in @file{doc/include}. HTML manuals will be generated by
@samp{makeinfo --html}, PostScript manuals by @command{texi2dvi}
and @command{dvips}, and PDF manuals by @command{texi2pdf}.
All Texinfo files that are parts of manuals must
-be checked into SVN, even if they are generated files, for the
+be version-controlled, even if they are generated files, for the
generation of online manuals to work.
The installation manual, @file{doc/install.texi}, is also provided on
@@ -425,7 +439,8 @@ comments in more detail.
@subsubsection Miscellaneous Documentation
In addition to the formal documentation that is installed by GCC,
-there are several other text files with miscellaneous documentation:
+there are several other text files in the @file{gcc} subdirectory
+with miscellaneous documentation:
@table @file
@item ABOUT-GCC-NLS
@@ -434,9 +449,11 @@ this manual rather than a separate file.
@item ABOUT-NLS
Notes on the Free Translation Project.
@item COPYING
-The GNU General Public License.
+@itemx COPYING3
+The GNU General Public License, Versions 2 and 3.
@item COPYING.LIB
-The GNU Lesser General Public License.
+@itemx COPYING3.LIB
+The GNU Lesser General Public License, Versions 2.1 and 3.
@item *ChangeLog*
@itemx */ChangeLog*
Change log files for various parts of GCC@.
@@ -504,8 +521,9 @@ directory. FIXME: document this further.
Details of the directories of any runtime libraries in
@file{gcc/doc/sourcebuild.texi}.
@item
-Check targets in Makefile.def for the top-level Makefile to check just
-the compiler or the compiler and runtime library for the language.
+Check targets in @file{Makefile.def} for the top-level @file{Makefile}
+to check just the compiler or the compiler and runtime library for the
+language.
@end itemize
If the front end is added to the official GCC source repository, the
@@ -551,6 +569,7 @@ updated accordingly.
@menu
* Front End Directory:: The front end @file{@var{language}} directory.
* Front End Config:: The front end @file{config-lang.in} file.
+* Front End Makefile:: The front end @file{Make-lang.in} file.
@end menu
@node Front End Directory
@@ -559,7 +578,7 @@ updated accordingly.
A front end @file{@var{language}} directory contains the source files
of that front end (but not of any runtime libraries, which should be
outside the @file{gcc} directory). This includes documentation, and
-possibly some subsidiary programs build alongside the front end.
+possibly some subsidiary programs built alongside the front end.
Certain files are special and other parts of the compiler depend on
their names:
@@ -569,7 +588,84 @@ This file is required in all language subdirectories. @xref{Front End
Config, , The Front End @file{config-lang.in} File}, for details of
its contents
@item Make-lang.in
-This file is required in all language subdirectories. It contains
+This file is required in all language subdirectories. @xref{Front End
+Makefile, , The Front End @file{Make-lang.in} File}, for details of its
+contents.
+@item lang.opt
+This file registers the set of switches that the front end accepts on
+the command line, and their @option{--help} text. @xref{Options}.
+@item lang-specs.h
+This file provides entries for @code{default_compilers} in
+@file{gcc.c} which override the default of giving an error that a
+compiler for that language is not installed.
+@item @var{language}-tree.def
+This file, which need not exist, defines any language-specific tree
+codes.
+@end table
+
+@node Front End Config
+@subsubsection The Front End @file{config-lang.in} File
+
+Each language subdirectory contains a @file{config-lang.in} file. In
+addition the main directory contains @file{c-config-lang.in}, which
+contains limited information for the C language. This file is a shell
+script that may define some variables describing the language:
+
+@table @code
+@item language
+This definition must be present, and gives the name of the language
+for some purposes such as arguments to @option{--enable-languages}.
+@item lang_requires
+If defined, this variable lists (space-separated) language front ends
+other than C that this front end requires to be enabled (with the
+names given being their @code{language} settings). For example, the
+Java front end depends on the C++ front end, so sets
+@samp{lang_requires=c++}.
+@item subdir_requires
+If defined, this variable lists (space-separated) front end directories
+other than C that this front end requires to be present. For example,
+the Objective-C++ front end uses source files from the C++ and
+Objective-C front ends, so sets @samp{subdir_requires="cp objc"}.
+@item target_libs
+If defined, this variable lists (space-separated) targets in the top
+level @file{Makefile} to build the runtime libraries for this
+language, such as @code{target-libobjc}.
+@item lang_dirs
+If defined, this variable lists (space-separated) top level
+directories (parallel to @file{gcc}), apart from the runtime libraries,
+that should not be configured if this front end is not built.
+@item build_by_default
+If defined to @samp{no}, this language front end is not built unless
+enabled in a @option{--enable-languages} argument. Otherwise, front
+ends are built by default, subject to any special logic in
+@file{configure.ac} (as is present to disable the Ada front end if the
+Ada compiler is not already installed).
+@item boot_language
+If defined to @samp{yes}, this front end is built in stage1 of the
+bootstrap. This is only relevant to front ends written in their own
+languages.
+@item compilers
+If defined, a space-separated list of compiler executables that will
+be run by the driver. The names here will each end
+with @samp{\$(exeext)}.
+@item outputs
+If defined, a space-separated list of files that should be generated
+by @file{configure} substituting values in them. This mechanism can
+be used to create a file @file{@var{language}/Makefile} from
+@file{@var{language}/Makefile.in}, but this is deprecated, building
+everything from the single @file{gcc/Makefile} is preferred.
+@item gtfiles
+If defined, a space-separated list of files that should be scanned by
+@file{gengtype.c} to generate the garbage collection tables and routines for
+this language. This excludes the files that are common to all front
+ends. @xref{Type Information}.
+
+@end table
+
+@node Front End Makefile
+@subsubsection The Front End @file{Make-lang.in} File
+
+Each language subdirectory contains a @file{Make-lang.in} file. It contains
targets @code{@var{lang}.@var{hook}} (where @code{@var{lang}} is the
setting of @code{language} in @file{config-lang.in}) for the following
values of @code{@var{hook}}, and any other Makefile rules required to
@@ -624,7 +720,7 @@ Install headers needed for plugins.
@item srcextra
Copies its dependencies into the source directory. This generally should
be used for generated files such as Bison output files which are not
-present in CVS, but should be included in any release tarballs. This
+version-controlled, but should be included in any release tarballs. This
target will be executed during a bootstrap if
@samp{--enable-generated-files-in-srcdir} was specified as a
@file{configure} option.
@@ -645,84 +741,13 @@ The language parts of the standard GNU
@samp{*clean} targets. @xref{Standard Targets, , Standard Targets for
Users, standards, GNU Coding Standards}, for details of the standard
targets. For GCC, @code{maintainer-clean} should delete
-all generated files in the source directory that are not checked into
-CVS, but should not delete anything checked into CVS@.
+all generated files in the source directory that are not version-controlled,
+but should not delete anything that is.
@end table
@file{Make-lang.in} must also define a variable @code{@var{lang}_OBJS}
to a list of host object files that are used by that language.
-@item lang.opt
-This file registers the set of switches that the front end accepts on
-the command line, and their @option{--help} text. @xref{Options}.
-@item lang-specs.h
-This file provides entries for @code{default_compilers} in
-@file{gcc.c} which override the default of giving an error that a
-compiler for that language is not installed.
-@item @var{language}-tree.def
-This file, which need not exist, defines any language-specific tree
-codes.
-@end table
-
-@node Front End Config
-@subsubsection The Front End @file{config-lang.in} File
-
-Each language subdirectory contains a @file{config-lang.in} file. In
-addition the main directory contains @file{c-config-lang.in}, which
-contains limited information for the C language. This file is a shell
-script that may define some variables describing the language:
-
-@table @code
-@item language
-This definition must be present, and gives the name of the language
-for some purposes such as arguments to @option{--enable-languages}.
-@item lang_requires
-If defined, this variable lists (space-separated) language front ends
-other than C that this front end requires to be enabled (with the
-names given being their @code{language} settings). For example, the
-Java front end depends on the C++ front end, so sets
-@samp{lang_requires=c++}.
-@item subdir_requires
-If defined, this variable lists (space-separated) front end directories
-other than C that this front end requires to be present. For example,
-the Objective-C++ front end uses source files from the C++ and
-Objective-C front ends, so sets @samp{subdir_requires="cp objc"}.
-@item target_libs
-If defined, this variable lists (space-separated) targets in the top
-level @file{Makefile} to build the runtime libraries for this
-language, such as @code{target-libobjc}.
-@item lang_dirs
-If defined, this variable lists (space-separated) top level
-directories (parallel to @file{gcc}), apart from the runtime libraries,
-that should not be configured if this front end is not built.
-@item build_by_default
-If defined to @samp{no}, this language front end is not built unless
-enabled in a @option{--enable-languages} argument. Otherwise, front
-ends are built by default, subject to any special logic in
-@file{configure.ac} (as is present to disable the Ada front end if the
-Ada compiler is not already installed).
-@item boot_language
-If defined to @samp{yes}, this front end is built in stage 1 of the
-bootstrap. This is only relevant to front ends written in their own
-languages.
-@item compilers
-If defined, a space-separated list of compiler executables that will
-be run by the driver. The names here will each end
-with @samp{\$(exeext)}.
-@item outputs
-If defined, a space-separated list of files that should be generated
-by @file{configure} substituting values in them. This mechanism can
-be used to create a file @file{@var{language}/Makefile} from
-@file{@var{language}/Makefile.in}, but this is deprecated, building
-everything from the single @file{gcc/Makefile} is preferred.
-@item gtfiles
-If defined, a space-separated list of files that should be scanned by
-gengtype.c to generate the garbage collection tables and routines for
-this language. This excludes the files that are common to all front
-ends. @xref{Type Information}.
-
-@end table
-
@node Back End
@subsection Anatomy of a Target Back End
@@ -786,7 +811,7 @@ notes about installation for this target, or saying that there are no
special notes if there are none.
@item
Possibly other support outside the @file{gcc} directory for runtime
-libraries. FIXME: reference docs for this. The libstdc++ porting
+libraries. FIXME: reference docs for this. The @code{libstdc++} porting
manual needs to be installed as info for this to work, or to be a
chapter of this manual.
@end itemize
@@ -914,6 +939,18 @@ FIXME: discuss non-C testsuites here.
@node Test Directives
@section Directives used within DejaGnu tests
+@menu
+* Directives:: Syntax and descriptions of test directives.
+* Selectors:: Selecting targets to which a test applies.
+* Effective-Target Keywords:: Keywords describing target attributes.
+* Add Options:: Features for @code{dg-add-options}
+* Require Support:: Variants of @code{dg-require-@var{support}}
+* Final Actions:: Commands for use in @code{dg-final}
+@end menu
+
+@node Directives
+@subsection Syntax and Descriptions of test directives
+
Test directives appear within comments in a test source file and begin
with @code{dg-}. Some of these are defined within DejaGnu and others
are local to the GCC testsuite.
@@ -923,27 +960,10 @@ directives local to GCC sometimes override information used by the
DejaGnu directives, which know nothing about the GCC directives, so the
DejaGnu directives must precede GCC directives.
-Several test directives include selectors which are usually preceded by
-the keyword @code{target} or @code{xfail}. A selector is: one or more
-target triplets, possibly including wildcard characters; a single
-effective-target keyword; or a logical expression. Depending on the
-context, the selector specifies whether a test is skipped and reported
-as unsupported or is expected to fail. Use @samp{*-*-*} to match any
-target.
-Effective-target keywords are defined in @file{target-supports.exp} in
-the GCC testsuite.
+Several test directives include selectors (@pxref{Selectors, , })
+which are usually preceded by the keyword @code{target} or @code{xfail}.
-A selector expression appears within curly braces and uses a single
-logical operator: one of @samp{!}, @samp{&&}, or @samp{||}. An
-operand is another selector expression, an effective-target keyword,
-a single target triplet, or a list of target triplets within quotes or
-curly braces. For example:
-
-@smallexample
-@{ target @{ ! "hppa*-*-* ia64*-*-*" @} @}
-@{ target @{ powerpc*-*-* && lp64 @} @}
-@{ xfail @{ lp64 || vect_no_align @} @}
-@end smallexample
+@subsubsection Specify how to build the test
@table @code
@item @{ dg-do @var{do-what-keyword} [@{ target/xfail @var{selector} @}] @}
@@ -969,15 +989,19 @@ tests by redefining @code{dg-do-what-default} within the @code{.exp}
file for those tests.
If the directive includes the optional @samp{@{ target @var{selector} @}}
-then the test is skipped unless the target system is included in the
-list of target triplets or matches the effective-target keyword.
+then the test is skipped unless the target system matches the
+@var{selector}.
-If @samp{do-what-keyword} is @code{run} and the directive includes
+If @var{do-what-keyword} is @code{run} and the directive includes
the optional @samp{@{ xfail @var{selector} @}} and the selector is met
then the test is expected to fail. The @code{xfail} clause is ignored
-for other values of @samp{do-what-keyword}; those tests can use
+for other values of @var{do-what-keyword}; those tests can use
directive @code{dg-xfail-if}.
+@end table
+@subsubsection Specify additional compiler options
+
+@table @code
@item @{ dg-options @var{options} [@{ target @var{selector} @}] @}
This DejaGnu directive provides a list of compiler options, to be used
if the target system matches @var{selector}, that replace the default
@@ -988,25 +1012,13 @@ Add any compiler options that are needed to access certain features.
This directive does nothing on targets that enable the features by
default, or that don't provide them at all. It must come after
all @code{dg-options} directives.
-
-The supported values of @var{feature} are:
-@table @code
-@item c99_runtime
-The target's C99 runtime (both headers and libraries).
-
-@item mips16_attribute
-@code{mips16} function attributes. Only MIPS targets support this feature,
-and only then in certain modes.
+For supported values of @var{feature} see @ref{Add Options, ,}.
@end table
-@item @{ dg-timeout @var{n} [@{target @var{selector} @}] @}
-Set the time limit for the compilation and for the execution of the test
-to the specified number of seconds.
+@subsubsection Modify the test timeout value
-@item @{ dg-timeout-factor @var{x} [@{ target @var{selector} @}] @}
-Multiply the normal time limit for compilation and execution of the test
-by the specified floating-point factor. The normal timeout limit, in
-seconds, is found by searching the following in order:
+The normal timeout limit, in seconds, is found by searching the
+following in order:
@itemize @bullet
@item the value defined by an earlier @code{dg-timeout} directive in
@@ -1019,6 +1031,19 @@ the test
@item 300
@end itemize
+@table @code
+@item @{ dg-timeout @var{n} [@{target @var{selector} @}] @}
+Set the time limit for the compilation and for the execution of the test
+to the specified number of seconds.
+
+@item @{ dg-timeout-factor @var{x} [@{ target @var{selector} @}] @}
+Multiply the normal time limit for compilation and execution of the test
+by the specified floating-point factor.
+@end table
+
+@subsubsection Skip a test for some targets
+
+@table @code
@item @{ dg-skip-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
Arguments @var{include-opts} and @var{exclude-opts} are lists in which
each element is a string of zero or more GCC options.
@@ -1056,7 +1081,7 @@ To skip a test if either @code{-O2} or @code{-O3} is present:
/* @{ dg-skip-if "" @{ *-*-* @} @{ "-O2" "-O3" @} @{ "" @} @} */
@end smallexample
-To skip a test unless option @code{-OS} is present:
+To skip a test unless option @code{-Os} is present:
@smallexample
/* @{ dg-skip-if "" @{ *-*-* @} @{ "*" @} @{ "-Os" @} @} */
@@ -1069,39 +1094,52 @@ but not if @code{-fpic} is also present:
/* @{ dg-skip-if "" @{ *-*-* @} @{ "-O2 -g" "-O3 -g" @} @{ "-fpic" @} @} */
@end smallexample
-@item @{ dg-xfail-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
-Expect the test to fail if the conditions (which are the same as for
-@code{dg-skip-if}) are met. This does not affect the execute step.
-
-@item @{ dg-xfail-run-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
-Expect the execute step of a test to fail if the conditions (which are
-the same as for @code{dg-skip-if}) and @code{dg-xfail-if}) are met.
+@item @{ dg-require-effective-target @var{keyword} @}
+Skip the test if the test target, including current multilib flags,
+is not covered by the effective-target keyword.
+This directive must appear after any @code{dg-do} directive in the test
+and before any @code{dg-additional-sources} directive.
+@xref{Effective-Target Keywords, , }.
@item @{ dg-require-@var{support} args @}
-Skip the test if the target does not provide the required support;
-see @file{gcc-dg.exp} in the GCC testsuite for the actual directives.
+Skip the test if the target does not provide the required support.
These directives must appear after any @code{dg-do} directive in the test
and before any @code{dg-additional-sources} directive.
They require at least one argument, which can be an empty string if the
specific procedure does not examine the argument.
+@xref{Require Support, , }, for a complete list of these directives.
+@end table
-@item @{ dg-require-effective-target @var{keyword} @}
-Skip the test if the test target, including current multilib flags,
-is not covered by the effective-target keyword.
-This directive must appear after any @code{dg-do} directive in the test
-and before any @code{dg-additional-sources} directive.
+@subsubsection Expect a test to fail for some targets
+
+@table @code
+@item @{ dg-xfail-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
+Expect the test to fail if the conditions (which are the same as for
+@code{dg-skip-if}) are met. This does not affect the execute step.
+
+@item @{ dg-xfail-run-if @var{comment} @{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]] @}
+Expect the execute step of a test to fail if the conditions (which are
+the same as for @code{dg-skip-if}) are met.
+@end table
+
+@subsubsection Expect the test executable to fail
+@table @code
@item @{ dg-shouldfail @var{comment} [@{ @var{selector} @} [@{ @var{include-opts} @} [@{ @var{exclude-opts} @}]]] @}
Expect the test executable to return a nonzero exit status if the
conditions (which are the same as for @code{dg-skip-if}) are met.
+@end table
+@subsubsection Verify compiler messages
+
+@table @code
@item @{ dg-error @var{regexp} [@var{comment} [@{ target/xfail @var{selector} @} [@var{line}] @}]] @}
This DejaGnu directive appears on a source line that is expected to get
an error message, or else specifies the source line associated with the
message. If there is no message for that line or if the text of that
message is not matched by @var{regexp} then the check fails and
@var{comment} is included in the @code{FAIL} message. The check does
-not look for the string @samp{"error"} unless it is part of @var{regexp}.
+not look for the string @samp{error} unless it is part of @var{regexp}.
@item @{ dg-warning @var{regexp} [@var{comment} [@{ target/xfail @var{selector} @} [@var{line}] @}]] @}
This DejaGnu directive appears on a source line that is expected to get
@@ -1109,7 +1147,7 @@ a warning message, or else specifies the source line associated with the
message. If there is no message for that line or if the text of that
message is not matched by @var{regexp} then the check fails and
@var{comment} is included in the @code{FAIL} message. The check does
-not look for the string @samp{"warning"} unless it is part of @var{regexp}.
+not look for the string @samp{warning} unless it is part of @var{regexp}.
@item @{ dg-message @var{regexp} [@var{comment} [@{ target/xfail @var{selector} @} [@var{line}] @}]] @}
The line is expected to get a message other than an error or warning.
@@ -1130,13 +1168,21 @@ to compiler messages that are not handled by @samp{dg-error},
@samp{dg-warning} or @samp{dg-bogus}. For this directive @samp{xfail}
has the same effect as @samp{target}.
+@item @{ dg-prune-output @var{regexp} @}
+Prune messages matching @var{regexp} from the test output.
+@end table
+
+@subsubsection Verify output of the test executable
+
+@table @code
@item @{ dg-output @var{regexp} [@{ target/xfail @var{selector} @}] @}
This DejaGnu directive compares @var{regexp} to the combined output
that the test executable writes to @file{stdout} and @file{stderr}.
+@end table
-@item @{ dg-prune-output @var{regexp} @}
-Prune messages matching @var{regexp} from test output.
+@subsubsection Specify additional files for a test
+@table @code
@item @{ dg-additional-files "@var{filelist}" @}
Specify additional files, other than source files, that must be copied
to the system where the compiler runs.
@@ -1144,57 +1190,778 @@ to the system where the compiler runs.
@item @{ dg-additional-sources "@var{filelist}" @}
Specify additional source files to appear in the compile line
following the main test file.
+@end table
+
+@subsubsection Add checks at the end of a test
+@table @code
@item @{ dg-final @{ @var{local-directive} @} @}
This DejaGnu directive is placed within a comment anywhere in the
source file and is processed after the test has been compiled and run.
Multiple @samp{dg-final} commands are processed in the order in which
-they appear in the source file.
+they appear in the source file. @xref{Final Actions, , }, for a list
+of directives that can be used within @code{dg-final}.
+@end table
-The GCC testsuite defines the following directives to be used within
-@code{dg-final}.
+@node Selectors
+@subsection Selecting targets to which a test applies
+
+Several test directives include @var{selector}s to limit the targets
+for which a test is run or to declare that a test is expected to fail
+on particular targets.
+
+A selector is:
+@itemize @bullet
+@item one or more target triplets, possibly including wildcard characters
+@item a single effective-target keyword (@pxref{Effective-Target Keywords})
+@item a logical expression
+@end itemize
+
+Depending on the
+context, the selector specifies whether a test is skipped and reported
+as unsupported or is expected to fail. Use @samp{*-*-*} to match any
+target.
+
+A selector expression appears within curly braces and uses a single
+logical operator: one of @samp{!}, @samp{&&}, or @samp{||}. An
+operand is another selector expression, an effective-target keyword,
+a single target triplet, or a list of target triplets within quotes or
+curly braces. For example:
+
+@smallexample
+@{ target @{ ! "hppa*-*-* ia64*-*-*" @} @}
+@{ target @{ powerpc*-*-* && lp64 @} @}
+@{ xfail @{ lp64 || vect_no_align @} @}
+@end smallexample
+
+@node Effective-Target Keywords
+@subsection Keywords describing target attributes
+
+Effective-target keywords identify sets of targets that support
+particular functionality. They are used to limit tests to be run only
+for particular targets, or to specify that particular sets of targets
+are expected to fail some tests.
+
+Effective-target keywords are defined in @file{lib/target-supports.exp} in
+the GCC testsuite, with the exception of those that are documented as
+being local to a particular test directory.
+
+The @samp{effective target} takes into account all of the compiler options
+with which the test will be compiled, including the multilib options.
+By convention, keywords ending in @code{_nocache} can also include options
+specified for the particular test in an earlier @code{dg-options} or
+@code{dg-add-options} directive.
+
+@subsubsection Data type sizes
@table @code
-@item cleanup-coverage-files
-Removes coverage data files generated for this test.
+@item ilp32
+Target has 32-bit @code{int}, @code{long}, and pointers.
-@item cleanup-repo-files
-Removes files generated for this test for @option{-frepo}.
+@item lp64
+Target has 32-bit @code{int}, 64-bit @code{long} and pointers.
-@item cleanup-rtl-dump @var{suffix}
-Removes RTL dump files generated for this test.
+@item llp64
+Target has 32-bit @code{int} and @code{long}, 64-bit @code{long long}
+and pointers.
-@item cleanup-tree-dump @var{suffix}
-Removes tree dump files matching @var{suffix} which were generated for
-this test.
+@item double64
+Target has 64-bit @code{double}.
-@item cleanup-saved-temps
-Removes files for the current test which were kept for @option{--save-temps}.
+@item double64plus
+Target has @code{double} that is 64 bits or longer.
+
+@item int32plus
+Target has @code{int} that is at 32 bits or longer.
+
+@item int16
+Target has @code{int} that is 16 bits or shorter.
+
+@item large_double
+Target supports @code{double} that is longer than @code{float}.
+
+@item large_long_double
+Target supports @code{long double} that is longer than @code{double}.
+
+@item ptr32plus
+Target has pointers that are 32 bits or longer.
+
+@item size32plus
+Target supports array and structure sizes that are 32 bits or longer.
+
+@item 4byte_wchar_t
+Target has @code{wchar_t} that is at least 4 bytes.
+@end table
+
+@subsubsection Fortran-specific attributes
+
+@table @code
+@item fortran_integer_16
+Target supports Fortran @code{integer} that is 16 bytes or longer.
+
+@item fortran_large_int
+Target supports Fortran @code{integer} kinds larger than @code{integer(8)}.
+
+@item fortran_large_real
+Target supports Fortran @code{real} kinds larger than @code{real(8)}.
+@end table
+
+@subsubsection Vector-specific attributes
+
+@table @code
+@item vect_condition
+Target supports vector conditional operations.
+@item vect_double
+Target supports hardware vectors of @code{double}.
+
+@item vect_float
+Target supports hardware vectors of @code{float}.
+
+@item vect_int
+Target supports hardware vectors of @code{int}.
+
+@item vect_int_mult
+Target supports a vector widening multiplication of @code{short} operands
+into an @code{int} result, or supports promotion (unpacking) from
+@code{short} to @code{int} and a non-widening multiplication of @code{int}.
+
+@item vect_long
+Target supports hardware vectors of @code{long}.
+
+@item vect_long_long
+Target supports hardware vectors of @code{long long}.
+
+@item vect_aligned_arrays
+Target aligns arrays to vector alignment boundary.
+
+@item vect_hw_misalign
+Target supports a vector misalign access.
+
+@item vect_no_align
+Target does not support a vector alignment mechanism.
+
+@item vect_no_int_max
+Target does not support a vector max instruction on @code{int}.
+
+@item vect_no_int_add
+Target does not support a vector add instruction on @code{int}.
+
+@item vect_no_bitwise
+Target does not support vector bitwise instructions.
+
+@item vect_char_mult
+Target supports @code{vector char} multiplication.
+
+@item vect_short_mult
+Target supports @code{vector short} multiplication.
+
+@item vect_int_mult
+Target supports @code{vector int} multiplication.
+
+@item vect_extract_even_odd
+Target supports vector even/odd element extraction.
+
+@item vect_extract_even_odd_wide
+Target supports vector even/odd element extraction of vectors with elements
+@code{SImode} or larger.
+
+@item vect_interleave
+Target supports vector interleaving.
+
+@item vect_strided
+Target supports vector interleaving and extract even/odd.
+
+@item vect_strided_wide
+Target supports vector interleaving and extract even/odd for wide
+element types.
+
+@item vect_perm
+Target supports vector permutation.
+
+@item vect_shift
+Target supports a hardware vector shift operation.
+
+@item vect_widen_sum_hi_to_si
+Target supports a vector widening summation of @code{short} operands
+into @code{int} results, or can promote (unpack) from @code{short}
+to @code{int}.
+
+@item vect_widen_sum_qi_to_hi
+Target supports a vector widening summation of @code{char} operands
+into @code{short} results, or can promote (unpack) from @code{char}
+to @code{short}.
+
+@item vect_widen_sum_qi_to_si
+Target supports a vector widening summation of @code{char} operands
+into @code{int} results.
+
+@item vect_widen_mult_qi_to_hi
+Target supports a vector widening multiplication of @code{char} operands
+into @code{short} results, or can promote (unpack) from @code{char} to
+@code{short} and perform non-widening multiplication of @code{short}.
+
+@item vect_widen_mult_hi_to_si
+Target supports a vector widening multiplication of @code{short} operands
+into @code{int} results, or can promote (unpack) from @code{short} to
+@code{int} and perform non-widening multiplication of @code{int}.
+
+@item vect_sdot_qi
+Target supports a vector dot-product of @code{signed char}.
+
+@item vect_udot_qi
+Target supports a vector dot-product of @code{unsigned char}.
+
+@item vect_sdot_hi
+Target supports a vector dot-product of @code{signed short}.
+
+@item vect_udot_hi
+Target supports a vector dot-product of @code{unsigned short}.
+
+@item vect_pack_trunc
+Target supports a vector demotion (packing) of @code{short} to @code{char}
+and from @code{int} to @code{short} using modulo arithmetic.
+
+@item vect_unpack
+Target supports a vector promotion (unpacking) of @code{char} to @code{short}
+and from @code{char} to @code{int}.
+
+@item vect_intfloat_cvt
+Target supports conversion from @code{signed int} to @code{float}.
+
+@item vect_uintfloat_cvt
+Target supports conversion from @code{unsigned int} to @code{float}.
+
+@item vect_floatint_cvt
+Target supports conversion from @code{float} to @code{signed int}.
+
+@item vect_floatuint_cvt
+Target supports conversion from @code{float} to @code{unsigned int}.
+@end table
+
+@subsubsection Thread Local Storage attributes
+
+@table @code
+@item tls
+Target supports thread-local storage.
+
+@item tls_native
+Target supports native (rather than emulated) thread-local storage.
+
+@item tls_runtime
+Test system supports executing TLS executables.
+@end table
+
+@subsubsection Decimal floating point attributes
+
+@table @code
+@item dfp
+Targets supports compiling decimal floating point extension to C.
+
+@item dfp_nocache
+Including the options used to compile this particular test, the
+target supports compiling decimal floating point extension to C.
+
+@item dfprt
+Test system can execute decimal floating point tests.
+
+@item dfprt_nocache
+Including the options used to compile this particular test, the
+test system can execute decimal floating point tests.
+
+@item hard_dfp
+Target generates decimal floating point instructions with current options.
+@end table
+
+@subsubsection ARM-specific attributes
+
+@table @code
+@item arm32
+ARM target generates 32-bit code.
+
+@item arm_eabi
+ARM target adheres to the ABI for the ARM Architecture.
+
+@item arm_hard_vfp_ok
+ARM target supports @code{-mfpu=vfp -mfloat-abi=hard}.
+Some multilibs may be incompatible with these options.
+
+@item arm_iwmmxt_ok
+ARM target supports @code{-mcpu=iwmmxt}.
+Some multilibs may be incompatible with this option.
+
+@item arm_neon
+ARM target supports generating NEON instructions.
+
+@item arm_neon_hw
+Test system supports executing NEON instructions.
+
+@item arm_neon_ok
+ARM Target supports @code{-mfpu=neon -mfloat-abi=softfp}.
+Some multilibs may be incompatible with these options.
+
+@item arm_thumb1_ok
+ARM target generates Thumb-1 code for @code{-mthumb}.
+
+@item arm_thumb2_ok
+ARM target generates Thumb-2 code for @code{-mthumb}.
+
+@item arm_vfp_ok
+ARM target supports @code{-mfpu=vfp -mfloat-abi=softfp}.
+Some multilibs may be incompatible with these options.
+@end table
+
+@subsubsection MIPS-specific attributes
+
+@table @code
+@item mips64
+MIPS target supports 64-bit instructions.
+
+@item nomips16
+MIPS target does not produce MIPS16 code.
+
+@item mips16_attribute
+MIPS target can generate MIPS16 code.
+
+@item mips_loongson
+MIPS target is a Loongson-2E or -2F target using an ABI that supports
+the Loongson vector modes.
+
+@item mips_newabi_large_long_double
+MIPS target supports @code{long double} larger than @code{double}
+when using the new ABI.
+
+@item mpaired_single
+MIPS target supports @code{-mpaired-single}.
+@end table
+
+@subsubsection PowerPC-specific attributes
+
+@table @code
+@item powerpc64
+Test system supports executing 64-bit instructions.
+
+@item powerpc_altivec
+PowerPC target supports AltiVec.
+
+@item powerpc_altivec_ok
+PowerPC target supports @code{-maltivec}.
+
+@item powerpc_fprs
+PowerPC target supports floating-point registers.
+
+@item powerpc_hard_double
+PowerPC target supports hardware double-precision floating-point.
+
+@item powerpc_ppu_ok
+PowerPC target supports @code{-mcpu=cell}.
+
+@item powerpc_spe
+PowerPC target supports PowerPC SPE.
+
+@item powerpc_spe_nocache
+Including the options used to compile this particular test, the
+PowerPC target supports PowerPC SPE.
+
+@item powerpc_spu
+PowerPC target supports PowerPC SPU.
+
+@item spu_auto_overlay
+SPU target has toolchain that supports automatic overlay generation.
+
+@item powerpc_vsx_ok
+PowerPC target supports @code{-mvsx}.
+
+@item powerpc_405_nocache
+Including the options used to compile this particular test, the
+PowerPC target supports PowerPC 405.
+
+@item vmx_hw
+PowerPC target supports executing AltiVec instructions.
+@end table
+
+@subsubsection Other hardware attributes
+
+@table @code
+@item avx
+Target supports compiling AVX instructions.
+
+@item cell_hw
+Test system can execute AltiVec and Cell PPU instructions.
+
+@item coldfire_fpu
+Target uses a ColdFire FPU.
+
+@item hard_float
+Target supports FPU instructions.
+
+@item sync_char_short
+Target supports atomic operations on @code{char} and @code{short}.
+
+@item sync_int_long
+Target supports atomic operations on @code{int} and @code{long}.
+
+@item ultrasparc_hw
+Test environment appears to run executables on a simulator that
+accepts only @code{EM_SPARC} executables and chokes on @code{EM_SPARC32PLUS}
+or @code{EM_SPARCV9} executables.
+
+@item vect_cmdline_needed
+Target requires a command line argument to enable a SIMD instruction set.
+@end table
+
+@subsubsection Environment attributes
+
+@table @code
+@item c
+The language for the compiler under test is C.
+
+@item c++
+The language for the compiler under test is C++.
+
+@item c99_runtime
+Target provides a full C99 runtime.
+
+@item correct_iso_cpp_string_wchar_protos
+Target @code{string.h} and @code{wchar.h} headers provide C++ required
+overloads for @code{strchr} etc. functions.
+
+@item dummy_wcsftime
+Target uses a dummy @code{wcsftime} function that always returns zero.
+
+@item fd_truncate
+Target can truncate a file from a file descriptor, as used by
+@file{libgfortran/io/unix.c:fd_truncate}; i.e. @code{ftruncate} or
+@code{chsize}.
+
+@item freestanding
+Target is @samp{freestanding} as defined in section 4 of the C99 standard.
+Effectively, it is a target which supports no extra headers or libraries
+other than what is considered essential.
+
+@item init_priority
+Target supports constructors with initialization priority arguments.
+
+@item inttypes_types
+Target has the basic signed and unsigned types in @code{inttypes.h}.
+This is for tests that GCC's notions of these types agree with those
+in the header, as some systems have only @code{inttypes.h}.
+
+@item lax_strtofp
+Target might have errors of a few ULP in string to floating-point
+conversion functions and overflow is not always detected correctly by
+those functions.
+
+@item newlib
+Target supports Newlib.
+
+@item pow10
+Target provides @code{pow10} function.
+
+@item pthread
+Target can compile using @code{pthread.h} with no errors or warnings.
+
+@item pthread_h
+Target has @code{pthread.h}.
+
+@item simulator
+Test system runs executables on a simulator (i.e. slowly) rather than
+hardware (i.e. fast).
+
+@item stdint_types
+Target has the basic signed and unsigned C types in @code{stdint.h}.
+This will be obsolete when GCC ensures a working @code{stdint.h} for
+all targets.
+
+@item trampolines
+Target supports trampolines.
+
+@item uclibc
+Target supports uClibc.
+
+@item unwrapped
+Target does not use a status wrapper.
+
+@item vxworks_kernel
+Target is a VxWorks kernel.
+
+@item vxworks_rtp
+Target is a VxWorks RTP.
+
+@item wchar
+Target supports wide characters.
+@end table
+
+@subsubsection Other attributes
+
+@table @code
+@item automatic_stack_alignment
+Target supports automatic stack alignment.
+
+@item cxa_atexit
+Target uses @code{__cxa_atexit}.
+
+@item default_packed
+Target has packed layout of structure members by default.
+
+@item fgraphite
+Target supports Graphite optimizations.
+
+@item fixed_point
+Target supports fixed-point extension to C.
+
+@item fopenmp
+Target supports OpenMP via @option{-fopenmp}.
+
+@item fpic
+Target supports @option{-fpic} and @option{-fPIC}.
+
+@item freorder
+Target supports @option{-freorder-blocks-and-partition}.
+
+@item fstack_protector
+Target supports @option{-fstack-protector}.
+
+@item gc_sections
+Target supports @option{--gc-sections}.
+
+@item keeps_null_pointer_checks
+Target keeps null pointer checks, either due to the use of
+@option{-fno-delete-null-pointer-checks} or hardwired into the target.
+
+@item lto
+Compiler has been configured to support link-time optimization (LTO).
+
+@item named_sections
+Target supports named sections.
+
+@item natural_alignment_32
+Target uses natural alignment (aligned to type size) for types of
+32 bits or less.
+
+@item target_natural_alignment_64
+Target uses natural alignment (aligned to type size) for types of
+64 bits or less.
+
+@item nonpic
+Target does not generate PIC by default.
+
+@item pcc_bitfield_type_matters
+Target defines @code{PCC_BITFIELD_TYPE_MATTERS}.
+
+@item pe_aligned_commons
+Target supports @option{-mpe-aligned-commons}.
+
+@item section_anchors
+Target supports section anchors.
+
+@item short_enums
+Target defaults to short enums.
+
+@item static
+Target supports @option{-static}.
+
+@item static_libgfortran
+Target supports statically linking @samp{libgfortran}.
+
+@item string_merging
+Target supports merging string constants at link time.
+
+@item ucn
+Target supports compiling and assembling UCN.
+
+@item ucn_nocache
+Including the options used to compile this particular test, the
+target supports compiling and assembling UCN.
+
+@item unaligned_stack
+Target does not guarantee that its @code{STACK_BOUNDARY} is greater than
+or equal to the required vector alignment.
+
+@item vector_alignment_reachable
+Vector alignment is reachable for types of 32 bits or less.
+
+@item vector_alignment_reachable_for_64bit
+Vector alignment is reachable for types of 64 bits or less.
+
+@item wchar_t_char16_t_compatible
+Target supports @code{wchar_t} that is compatible with @code{char16_t}.
+
+@item wchar_t_char32_t_compatible
+Target supports @code{wchar_t} that is compatible with @code{char32_t}.
+@end table
+
+@subsubsection Local to tests in @code{gcc.target/i386}
+
+@table @code
+@item aes
+Target supports compiling @code{aes} instructions.
+
+@item fma4
+Target supports compiling @code{fma4} instructions.
+
+@item ms_hook_prologue
+Target supports attribute @code{ms_hook_prologue}.
+
+@item pclmul
+Target supports compiling @code{pclmul} instructions.
+
+@item sse4
+Target supports compiling @code{sse4} instructions.
+
+@item sse4a
+Target supports compiling @code{sse4a} instructions.
+
+@item ssse3
+Target supports compiling @code{ssse3} instructions.
+
+@item vaes
+Target supports compiling @code{vaes} instructions.
+
+@item vpclmul
+Target supports compiling @code{vpclmul} instructions.
+
+@item xop
+Target supports compiling @code{xop} instructions.
+@end table
+
+@subsubsection Local to tests in @code{gcc.target/spu/ea}
+
+@table @code
+@item ealib
+Target @code{__ea} library functions are available.
+@end table
+
+@subsubsection Local to tests in @code{gcc.test-framework}
+
+@table @code
+@item no
+Always returns 0.
+
+@item yes
+Always returns 1.
+@end table
+
+@node Add Options
+@subsection Features for @code{dg-add-options}
+
+The supported values of @var{feature} for directive @code{dg-add-options}
+are:
+
+@table @code
+@item bind_pic_locally
+Add the target-specific flags needed to enable functions to bind
+locally when using pic/PIC passes in the testsuite.
+
+@item c99_runtime
+Add the target-specific flags needed to access the C99 runtime.
+
+@item ieee
+Add the target-specific flags needed to enable full IEEE
+compliance mode.
+
+@item mips16_attribute
+@code{mips16} function attributes.
+Only MIPS targets support this feature, and only then in certain modes.
+@end table
+
+@node Require Support
+@subsection Variants of @code{dg-require-@var{support}}
+
+A few of the @code{dg-require} directives take arguments.
+
+@table @code
+@item dg-require-iconv @var{codeset}
+Skip the test if the target does not support iconv. @var{codeset} is
+the codeset to convert to.
+
+@item dg-require-profiling @var{profopt}
+Skip the test if the target does not support profiling with option
+@var{profopt}.
+
+@item dg-require-visibility @var{vis}
+Skip the test if the target does not support the @code{visibility} attribute.
+If @var{vis} is @code{""}, support for @code{visibility("hidden")} is
+checked, for @code{visibility("@var{vis}")} otherwise.
+@end table
+
+The original @code{dg-require} directives were defined before there
+was support for effective-target keywords. The directives that do not
+take arguments could be replaced with effective-target keywords.
+
+@table @code
+@item dg-require-alias ""
+Skip the test if the target does not support the @samp{alias} attribute.
+
+@item dg-require-compat-dfp ""
+Skip this test unless both compilers in a @file{compat} testsuite
+support decimal floating point.
+
+@item dg-require-cxa-atexit ""
+Skip the test if the target does not support @code{__cxa_atexit}.
+This is equivalent to @code{dg-require-effective-target cxa_atexit}.
+
+@item dg-require-dll ""
+Skip the test if the target does not support DLL attributes.
+
+@item dg-require-fork ""
+Skip the test if the target does not support @code{fork}.
+
+@item dg-require-gc-sections ""
+Skip the test if the target's linker does not support the
+@code{--gc-sections} flags.
+This is equivalent to @code{dg-require-effective-target gc-sections}.
+
+@item dg-require-host-local ""
+Skip the test if the host is remote, rather than the same as the build
+system. Some tests are incompatible with DejaGnu's handling of remote
+hosts, which involves copying the source file to the host and compiling
+it with a relative path and "@code{-o a.out}".
+
+@item dg-require-mkfifo ""
+Skip the test if the target does not support @code{mkfifo}.
+
+@item dg-require-named-sections ""
+Skip the test is the target does not support named sections.
+This is equivalent to @code{dg-require-effective-target named_sections}.
+
+@item dg-require-weak ""
+Skip the test if the target does not support weak symbols.
+
+@item dg-require-weak-override ""
+Skip the test if the target does not support overriding weak symbols.
+@end table
+
+@node Final Actions
+@subsection Commands for use in @code{dg-final}
+
+The GCC testsuite defines the following directives to be used within
+@code{dg-final}.
+
+@subsubsection Scan a particular file
+
+@table @code
@item scan-file @var{filename} @var{regexp} [@{ target/xfail @var{selector} @}]
Passes if @var{regexp} matches text in @var{filename}.
-
@item scan-file-not @var{filename} @var{regexp} [@{ target/xfail @var{selector} @}]
Passes if @var{regexp} does not match text in @var{filename}.
+@item scan-module @var{module} @var{regexp} [@{ target/xfail @var{selector} @}]
+Passes if @var{regexp} matches in Fortran module @var{module}.
+@end table
-@item scan-hidden @var{symbol} [@{ target/xfail @var{selector} @}]
-Passes if @var{symbol} is defined as a hidden symbol in the test's
-assembly output.
-
-@item scan-not-hidden @var{symbol} [@{ target/xfail @var{selector} @}]
-Passes if @var{symbol} is not defined as a hidden symbol in the test's
-assembly output.
-
-@item scan-assembler-times @var{regex} @var{num} [@{ target/xfail @var{selector} @}]
-Passes if @var{regex} is matched exactly @var{num} times in the test's
-assembler output.
+@subsubsection Scan the assembly output
+@table @code
@item scan-assembler @var{regex} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} matches text in the test's assembler output.
@item scan-assembler-not @var{regex} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} does not match text in the test's assembler output.
+@item scan-assembler-times @var{regex} @var{num} [@{ target/xfail @var{selector} @}]
+Passes if @var{regex} is matched exactly @var{num} times in the test's
+assembler output.
+
@item scan-assembler-dem @var{regex} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} matches text in the test's demangled assembler output.
@@ -1202,31 +1969,61 @@ Passes if @var{regex} matches text in the test's demangled assembler output.
Passes if @var{regex} does not match text in the test's demangled assembler
output.
-@item scan-tree-dump-times @var{regex} @var{num} @var{suffix} [@{ target/xfail @var{selector} @}]
-Passes if @var{regex} is found exactly @var{num} times in the dump file
-with suffix @var{suffix}.
+@item scan-hidden @var{symbol} [@{ target/xfail @var{selector} @}]
+Passes if @var{symbol} is defined as a hidden symbol in the test's
+assembly output.
+
+@item scan-not-hidden @var{symbol} [@{ target/xfail @var{selector} @}]
+Passes if @var{symbol} is not defined as a hidden symbol in the test's
+assembly output.
+@end table
+
+@subsubsection Scan optimization dump files
-@item scan-tree-dump @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
+These commands are available for @var{kind} of @code{tree}, @code{rtl},
+and @code{ipa}.
+
+@table @code
+@item scan-@var{kind}-dump @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} matches text in the dump file with suffix @var{suffix}.
-@item scan-tree-dump-not @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
+@item scan-@var{kind}-dump-not @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} does not match text in the dump file with suffix
@var{suffix}.
-@item scan-tree-dump-dem @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
+@item scan-@var{kind}-dump-times @var{regex} @var{num} @var{suffix} [@{ target/xfail @var{selector} @}]
+Passes if @var{regex} is found exactly @var{num} times in the dump file
+with suffix @var{suffix}.
+
+@item scan-@var{kind}-dump-dem @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} matches demangled text in the dump file with
suffix @var{suffix}.
-@item scan-tree-dump-dem-not @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
+@item scan-@var{kind}-dump-dem-not @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
Passes if @var{regex} does not match demangled text in the dump file with
suffix @var{suffix}.
+@end table
+
+@subsubsection Verify that an output files exists or not
+@table @code
@item output-exists [@{ target/xfail @var{selector} @}]
Passes if compiler output file exists.
@item output-exists-not [@{ target/xfail @var{selector} @}]
Passes if compiler output file does not exist.
+@end table
+@subsubsection Check for LTO tests
+
+@table @code
+@item scan-symbol @var{regexp} [@{ target/xfail @var{selector} @}]
+Passes if the pattern is present in the final executable.
+@end table
+
+@subsubsection Checks for @command{gcov} tests
+
+@table @code
@item run-gcov @var{sourcefile}
Check line counts in @command{gcov} tests.
@@ -1234,6 +2031,34 @@ Check line counts in @command{gcov} tests.
Check branch and/or call counts, in addition to line counts, in
@command{gcov} tests.
@end table
+
+@subsubsection Clean up generated test files
+
+@table @code
+@item cleanup-coverage-files
+Removes coverage data files generated for this test.
+
+@item cleanup-ipa-dump @var{suffix}
+Removes IPA dump files generated for this test.
+
+@item cleanup-modules
+Removes Fortran module files generated for this test.
+
+@item cleanup-profile-file
+Removes profiling files generated for this test.
+
+@item cleanup-repo-files
+Removes files generated for this test for @option{-frepo}.
+
+@item cleanup-rtl-dump @var{suffix}
+Removes RTL dump files generated for this test.
+
+@item cleanup-saved-temps
+Removes files for the current test which were kept for @option{-save-temps}.
+
+@item cleanup-tree-dump @var{suffix}
+Removes tree dump files matching @var{suffix} which were generated for
+this test.
@end table
@node Ada Tests
@@ -1241,10 +2066,10 @@ Check branch and/or call counts, in addition to line counts, in
The Ada testsuite includes executable tests from the ACATS 2.5
testsuite, publicly available at
-@uref{http://www.adaic.org/compilers/acats/2.5}
+@uref{http://www.adaic.org/compilers/acats/2.5}.
These tests are integrated in the GCC testsuite in the
-@file{gcc/testsuite/ada/acats} directory, and
+@file{ada/acats} directory, and
enabled automatically when running @code{make check}, assuming
the Ada language has been enabled when configuring GCC@.
@@ -1257,11 +2082,12 @@ $ make check-ada CHAPTERS="c3 c9"
@end smallexample
The tests are organized by directory, each directory corresponding to
-a chapter of the Ada Reference Manual. So for example, c9 corresponds
+a chapter of the Ada Reference Manual. So for example, @file{c9} corresponds
to chapter 9, which deals with tasking features of the language.
There is also an extra chapter called @file{gcc} containing a template for
-creating new executable tests.
+creating new executable tests, although this is deprecated in favor of
+the @file{gnat.dg} testsuite.
The tests are run using two @command{sh} scripts: @file{run_acats} and
@file{run_all.sh}. To run the tests using a simulator or a cross
@@ -1291,7 +2117,7 @@ unless other options are given in the test. Except as noted below they
are not run with multiple optimization options.
@item gcc.dg/compat
This subdirectory contains tests for binary compatibility using
-@file{compat.exp}, which in turn uses the language-independent support
+@file{lib/compat.exp}, which in turn uses the language-independent support
(@pxref{compat Testing, , Support for testing binary compatibility}).
@item gcc.dg/cpp
This subdirectory contains tests of the preprocessor.
@@ -1341,21 +2167,19 @@ This contains tests which are specific to IEEE floating point.
FIXME: describe this.
This directory should probably not be used for new tests.
-@item gcc.c-torture/misc-tests
+@item gcc.misc-tests
This directory contains C tests that require special handling. Some
of these tests have individual expect files, and others share
special-purpose expect files:
@table @file
@item @code{bprob*.c}
-Test @option{-fbranch-probabilities} using @file{bprob.exp}, which
+Test @option{-fbranch-probabilities} using
+@file{gcc.misc-tests/bprob.exp}, which
in turn uses the generic, language-independent framework
(@pxref{profopt Testing, , Support for testing profile-directed
optimizations}).
-@item @code{dg-*.c}
-Test the testsuite itself using @file{dg-test.exp}.
-
@item @code{gcov*.c}
Test @command{gcov} output using @file{gcov.exp}, which in turn uses the
language-independent support (@pxref{gcov Testing, , Support for testing gcov}).
@@ -1364,6 +2188,12 @@ language-independent support (@pxref{gcov Testing, , Support for testing gcov}).
Test i386-specific support for data prefetch using @file{i386-prefetch.exp}.
@end table
+@item gcc.test-framework
+@table @file
+@item @code{dg-*.c}
+Test the testsuite itself using @file{gcc.test-framework/test-framework.exp}.
+@end table
+
@end table
FIXME: merge in @file{testsuite/README.gcc} and discuss the format of
@@ -1426,6 +2256,12 @@ Unlike @code{dg-do}, @code{dg-lto-do} does not support an optional
This directive provides a list of one or more sets of compiler options
to override @var{LTO_OPTIONS}. Each test will be compiled and run with
each of these sets of options.
+
+@item @{ dg-extra-ld-options @var{options} @}
+This directive adds @var{options} to the linker options used.
+
+@item @{ dg-suppress-ld-options @var{options} @}
+This directive removes @var{options} from the set of linker options used.
@end table
@node gcov Testing
@@ -1433,8 +2269,8 @@ each of these sets of options.
Language-independent support for testing @command{gcov}, and for checking
that branch profiling produces expected values, is provided by the
-expect file @file{gcov.exp}. @command{gcov} tests also rely on procedures
-in @file{gcc.dg.exp} to compile and run the test program. A typical
+expect file @file{lib/gcov.exp}. @command{gcov} tests also rely on procedures
+in @file{lib/gcc-dg.exp} to compile and run the test program. A typical
@command{gcov} test contains the following DejaGnu commands within comments:
@smallexample
@@ -1531,6 +2367,14 @@ suffix of profile data files
@item PROFOPT_OPTIONS
list of options with which to run each test, similar to the lists for
torture tests
+
+@item @{ dg-final-generate @{ @var{local-directive} @} @}
+This directive is similar to @code{dg-final}, but the
+@var{local-directive} is run after the generation of profile data.
+
+@item @{ dg-final-use @{ @var{local-directive} @} @}
+The @var{local-directive} is run after the profile data have been
+used.
@end table
@node compat Testing
@@ -1607,7 +2451,7 @@ following from @file{@var{objdir}/gcc}:
rm site.exp
make -k \
ALT_CXX_UNDER_TEST=$@{alt_prefix@}/bin/g++ \
- COMPAT_OPTIONS="lists as shown above" \
+ COMPAT_OPTIONS="@var{lists as shown above}" \
check-c++ \
RUNTESTFLAGS="compat.exp"
@end smallexample
@@ -1646,7 +2490,7 @@ targets.
Throughout the compiler testsuite there are several directories whose
tests are run multiple times, each with a different set of options.
These are known as torture tests.
-@file{gcc/testsuite/lib/torture-options.exp} defines procedures to
+@file{lib/torture-options.exp} defines procedures to
set up these lists:
@table @code
diff --git a/gcc/dse.c b/gcc/dse.c
index 239d0fbe1ab..2be8a942c75 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1,5 +1,6 @@
/* RTL dead store elimination.
- Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Richard Sandiford <rsandifor@codesourcery.com>
and Kenneth Zadeck <zadeck@naturalbridge.com>
@@ -2616,7 +2617,7 @@ dse_step1 (void)
basic_block bb;
bitmap regs_live = BITMAP_ALLOC (NULL);
- cselib_init (false);
+ cselib_init (0);
all_blocks = BITMAP_ALLOC (NULL);
bitmap_set_bit (all_blocks, ENTRY_BLOCK);
bitmap_set_bit (all_blocks, EXIT_BLOCK);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index c76d54f39c2..540d75fd9f9 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2760,11 +2760,12 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
if (REG_P (n))
{
dw_fde_ref fde = current_fde ();
- gcc_assert (fde
- && fde->drap_reg != INVALID_REGNUM
- && fde->vdrap_reg == INVALID_REGNUM);
- if (REG_P (n))
- fde->vdrap_reg = REGNO (n);
+ if (fde)
+ {
+ gcc_assert (fde->vdrap_reg == INVALID_REGNUM);
+ if (REG_P (n))
+ fde->vdrap_reg = REGNO (n);
+ }
}
handled_one = true;
break;
@@ -12726,7 +12727,6 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
}
else if (!optimize
&& fde
- && fde->drap_reg != INVALID_REGNUM
&& (fde->drap_reg == REGNO (reg)
|| fde->vdrap_reg == REGNO (reg)))
{
@@ -15770,10 +15770,7 @@ rtl_for_decl_location (tree decl)
&& !DECL_HARD_REGISTER (decl)
&& DECL_MODE (decl) != VOIDmode)
{
- rtl = DECL_RTL (decl);
- /* Reset DECL_RTL back, as various parts of the compiler expects
- DECL_RTL set meaning it is actually going to be output. */
- SET_DECL_RTL (decl, NULL);
+ rtl = make_decl_rtl_for_debug (decl);
if (!MEM_P (rtl)
|| GET_CODE (XEXP (rtl, 0)) != SYMBOL_REF
|| SYMBOL_REF_DECL (XEXP (rtl, 0)) != decl)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9fd831dbd7c..03eb8fef97f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,57 @@
+2010-03-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/43450
+ * trans-decl.c (gfc_create_module_variable): With -fwhole-file
+ do not assert the context of derived types.
+
+2010-03-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/43409
+ * ioparm.def: Change inquire size variable to type pointer to
+ GFC_IO_INT type.
+
+2010-03-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/43039
+ * trans-expr.c (conv_parent_component_references): Ensure that
+ 'dt' has a backend_decl.
+
+ PR fortran/43043
+ * trans-expr.c (gfc_conv_structure): Ensure that the derived
+ type has a backend_decl.
+
+ PR fortran/43044
+ * resolve.c (resolve_global_procedure): Check that the 'cl'
+ structure is not NULL.
+
+2010-03-18 Shujing Zhao <pearly.zhao@oracle.com>
+
+ * lang.opt (-ffixed-line-length-, ffree-line-length-): Remove
+ redundant tab.
+
+2010-03-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43331
+ * trans-array.c (gfc_conv_array_index_offset,gfc_conv_array_ref,
+ gfc_conv_ss_startstride): Remove no-longer-needed cp_was_assumed
+ check.
+ * decl.c (gfc_match_derived_decl): Don't mark assumed-size Cray
+ pointees as having explizit size.
+ * expr.c (gfc_check_assign): Remove now unreachable Cray pointee
+ check.
+ * trans-types.c (gfc_is_nodesc_array): Add cp_was_assumed to assert.
+ (gfc_sym_type): Don't mark Cray pointees as restricted pointers.
+ * resolve.c (resolve_symbol): Handle cp_was_assumed.
+ * trans-decl.c (gfc_trans_deferred_vars): Ditto.
+ (gfc_finish_var_decl): Don't mark Cray pointees as restricted
+ pointers.
+
+2010-03-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43362
+ * resolve.c (resolve_structure_cons): Add missing PURE constraint.
+ (resolve_ordinary_assign): Add check to avoid segfault.
+
2010-03-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/43291
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 04669061bf8..692078a11d4 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6969,22 +6969,14 @@ gfc_match_derived_decl (void)
/* Cray Pointees can be declared as:
- pointer (ipt, a (n,m,...,*))
- By default, this is treated as an AS_ASSUMED_SIZE array. We'll
- cheat and set a constant bound of 1 for the last dimension, if this
- is the case. Since there is no bounds-checking for Cray Pointees,
- this will be okay. */
+ pointer (ipt, a (n,m,...,*)) */
match
gfc_mod_pointee_as (gfc_array_spec *as)
{
as->cray_pointee = true; /* This will be useful to know later. */
if (as->type == AS_ASSUMED_SIZE)
- {
- as->type = AS_EXPLICIT;
- as->upper[as->rank - 1] = gfc_int_expr (1);
- as->cp_was_assumed = true;
- }
+ as->cp_was_assumed = true;
else if (as->type == AS_ASSUMED_SHAPE)
{
gfc_error ("Cray Pointee at %C cannot be assumed shape array");
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 6d3ca8476b8..58c906375ea 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3010,16 +3010,6 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
}
}
- if (sym->attr.cray_pointee
- && lvalue->ref != NULL
- && lvalue->ref->u.ar.type == AR_FULL
- && lvalue->ref->u.ar.as->cp_was_assumed)
- {
- gfc_error ("Vector assignment to assumed-size Cray Pointee at %L "
- "is illegal", &lvalue->where);
- return FAILURE;
- }
-
/* This is possibly a typo: x = f() instead of x => f(). */
if (gfc_option.warn_surprising
&& rvalue->expr_type == EXPR_FUNCTION
diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def
index 7de7a5101dc..ba1ba232b44 100644
--- a/gcc/fortran/ioparm.def
+++ b/gcc/fortran/ioparm.def
@@ -85,7 +85,7 @@ IOPARM (inquire, encoding, 1 << 2, char1)
IOPARM (inquire, round, 1 << 3, char2)
IOPARM (inquire, sign, 1 << 4, char1)
IOPARM (inquire, pending, 1 << 5, pint4)
-IOPARM (inquire, size, 1 << 6, pint4)
+IOPARM (inquire, size, 1 << 6, pintio)
IOPARM (inquire, id, 1 << 7, pint4)
IOPARM (wait, common, 0, common)
IOPARM (wait, id, 1 << 7, pint4)
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index a52e643c9b3..7ea06c2838f 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -246,7 +246,7 @@ Allow arbitrary character line width in fixed mode
ffixed-line-length-
Fortran RejectNegative Joined UInteger
--ffixed-line-length-<n> Use n as character line width in fixed mode
+-ffixed-line-length-<n> Use n as character line width in fixed mode
ffpe-trap=
Fortran RejectNegative JoinedOrMissing
@@ -262,7 +262,7 @@ Allow arbitrary character line width in free mode
ffree-line-length-
Fortran RejectNegative Joined UInteger
--ffree-line-length-<n> Use n as character line width in free mode
+-ffree-line-length-<n> Use n as character line width in free mode
fimplicit-none
Fortran
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9a95d3405a0..24ec7a8a1de 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -921,6 +921,16 @@ resolve_structure_cons (gfc_expr *expr)
"for pointer component '%s' should be a POINTER or "
"a TARGET", &cons->expr->where, comp->name);
}
+
+ /* F2003, C1272 (3). */
+ if (gfc_pure (NULL) && cons->expr->expr_type == EXPR_VARIABLE
+ && gfc_impure_variable (cons->expr->symtree->n.sym))
+ {
+ t = FAILURE;
+ gfc_error ("Invalid expression in the derived type constructor for pointer "
+ "component '%s' at %L in PURE procedure", comp->name,
+ &cons->expr->where);
+ }
}
return t;
@@ -1841,12 +1851,13 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
/* Non-assumed length character functions. */
if (sym->attr.function && sym->ts.type == BT_CHARACTER
- && gsym->ns->proc_name->ts.u.cl->length != NULL)
+ && gsym->ns->proc_name->ts.u.cl != NULL
+ && gsym->ns->proc_name->ts.u.cl->length != NULL)
{
gfc_charlen *cl = sym->ts.u.cl;
if (!sym->attr.entry_master && sym->attr.if_source == IFSRC_UNKNOWN
- && cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
+ && cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
{
gfc_error ("Nonconstant character-length function '%s' at %L "
"must have an explicit interface", sym->name,
@@ -7947,6 +7958,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
if (lhs->ts.type == BT_DERIVED
&& lhs->expr_type == EXPR_VARIABLE
&& lhs->ts.u.derived->attr.pointer_comp
+ && rhs->expr_type == EXPR_VARIABLE
&& gfc_impure_variable (rhs->symtree->n.sym))
{
gfc_error ("The impure variable at %L is assigned to "
@@ -10999,7 +11011,7 @@ resolve_symbol (gfc_symbol *sym)
arguments. */
if (sym->as != NULL
- && (sym->as->type == AS_ASSUMED_SIZE
+ && ((sym->as->type == AS_ASSUMED_SIZE && !sym->as->cp_was_assumed)
|| sym->as->type == AS_ASSUMED_SHAPE)
&& sym->attr.dummy == 0)
{
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 8eea3aca716..5eeead831c4 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2404,8 +2404,8 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
index = gfc_trans_array_bound_check (se, info->descriptor,
index, dim, &ar->where,
- (ar->as->type != AS_ASSUMED_SIZE
- && !ar->as->cp_was_assumed) || dim < ar->dimen - 1);
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_VECTOR:
@@ -2431,8 +2431,8 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i,
/* Do any bounds checking on the final info->descriptor index. */
index = gfc_trans_array_bound_check (se, info->descriptor,
index, dim, &ar->where,
- (ar->as->type != AS_ASSUMED_SIZE
- && !ar->as->cp_was_assumed) || dim < ar->dimen - 1);
+ ar->as->type != AS_ASSUMED_SIZE
+ || dim < ar->dimen - 1);
break;
case DIMEN_RANGE:
@@ -2581,8 +2581,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
/* Upper bound, but not for the last dimension of assumed-size
arrays. */
- if (n < ar->dimen - 1
- || (ar->as->type != AS_ASSUMED_SIZE && !ar->as->cp_was_assumed))
+ if (n < ar->dimen - 1 || ar->as->type != AS_ASSUMED_SIZE)
{
tmp = gfc_conv_array_ubound (se->expr, n);
if (sym->attr.temporary)
@@ -3207,8 +3206,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
continue;
if (dim == info->ref->u.ar.dimen - 1
- && (info->ref->u.ar.as->type == AS_ASSUMED_SIZE
- || info->ref->u.ar.as->cp_was_assumed))
+ && info->ref->u.ar.as->type == AS_ASSUMED_SIZE)
check_upper = false;
else
check_upper = true;
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 34e153ae77b..3dc070cdc6b 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -598,6 +598,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
if (!sym->attr.target
&& !sym->attr.pointer
+ && !sym->attr.cray_pointee
&& !sym->attr.proc_pointer)
DECL_RESTRICTED_P (decl) = 1;
}
@@ -3159,10 +3160,11 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
case AS_ASSUMED_SIZE:
/* Must be a dummy parameter. */
- gcc_assert (sym->attr.dummy);
+ gcc_assert (sym->attr.dummy || sym->as->cp_was_assumed);
/* We should always pass assumed size arrays the g77 way. */
- fnbody = gfc_trans_g77_array (sym, fnbody);
+ if (sym->attr.dummy)
+ fnbody = gfc_trans_g77_array (sym, fnbody);
break;
case AS_ASSUMED_SHAPE:
@@ -3380,11 +3382,16 @@ gfc_create_module_variable (gfc_symbol * sym)
{
decl = sym->backend_decl;
gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
- gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
- || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
- gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
- || DECL_CONTEXT (TYPE_STUB_DECL (decl))
- == sym->ns->proc_name->backend_decl);
+
+ /* -fwhole-file mixes up the contexts so these asserts are unnecessary. */
+ if (!(gfc_option.flag_whole_file && sym->attr.use_assoc))
+ {
+ gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
+ || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
+ gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
+ || DECL_CONTEXT (TYPE_STUB_DECL (decl))
+ == sym->ns->proc_name->backend_decl);
+ }
TYPE_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
DECL_CONTEXT (TYPE_STUB_DECL (decl)) = sym->ns->proc_name->backend_decl;
gfc_module_add_decl (cur_module, TYPE_STUB_DECL (decl));
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index abc2a24318a..b9ea5579ac8 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -507,6 +507,9 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
parent.u.c.sym = dt;
parent.u.c.component = dt->components;
+ if (dt->backend_decl == NULL)
+ gfc_get_derived_type (dt);
+
if (dt->attr.extension && dt->components)
{
if (dt->attr.is_class)
@@ -4454,6 +4457,8 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
{
gfc_component *data;
data = gfc_find_component (cm->ts.u.derived, "$data", true, true);
+ if (!data->backend_decl)
+ gfc_get_derived_type (cm->ts.u.derived);
val = gfc_conv_initializer (c->expr, &cm->ts,
TREE_TYPE (data->backend_decl),
data->attr.dimension,
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 278ae27a458..ebe4c2f832b 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1193,7 +1193,7 @@ gfc_is_nodesc_array (gfc_symbol * sym)
if (sym->attr.result || sym->attr.function)
return 0;
- gcc_assert (sym->as->type == AS_EXPLICIT);
+ gcc_assert (sym->as->type == AS_EXPLICIT || sym->as->cp_was_assumed);
return 1;
}
@@ -1775,7 +1775,7 @@ gfc_sym_type (gfc_symbol * sym)
byref = 0;
restricted = !sym->attr.target && !sym->attr.pointer
- && !sym->attr.proc_pointer;
+ && !sym->attr.proc_pointer && !sym->attr.cray_pointee;
if (sym->attr.dimension)
{
if (gfc_is_nodesc_array (sym))
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 432e34d478e..8e31ee11a58 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1,7 +1,7 @@
/* Global common subexpression elimination/Partial redundancy elimination
and global constant/copy propagation for GNU compiler.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -2724,7 +2724,7 @@ local_cprop_pass (void)
struct reg_use *reg_used;
bool changed = false;
- cselib_init (false);
+ cselib_init (0);
FOR_EACH_BB (bb)
{
FOR_BB_INSNS (bb, insn)
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 64ddbb8ed91..f99a158ac42 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -547,6 +547,9 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
gcc_unreachable ();
}
+/* Java does not initialize long_long_integer_type_node. */
+#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
+
/* Given a CLOOG_IV, return the type that CLOOG_IV should have in GCC
land. The selected type is big enough to include the original loop
iteration variable, but signed to work with the subtractions CLooG
@@ -581,8 +584,8 @@ gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
if (type_precision <= TYPE_PRECISION (long_integer_type_node))
return long_integer_type_node;
- if (type_precision <= TYPE_PRECISION (long_long_integer_type_node))
- return long_long_integer_type_node;
+ if (type_precision <= TYPE_PRECISION (my_long_long))
+ return my_long_long;
gcc_unreachable ();
}
@@ -593,17 +596,19 @@ gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
if (type_precision < TYPE_PRECISION (long_integer_type_node))
return long_integer_type_node;
- if (type_precision < TYPE_PRECISION (long_long_integer_type_node))
- return long_long_integer_type_node;
+ if (type_precision < TYPE_PRECISION (my_long_long))
+ return my_long_long;
/* There is no signed type available, that is large enough to hold the
original value. */
gcc_unreachable ();
}
- return long_long_integer_type_node;
+ return my_long_long;
}
+#undef my_long_long
+
/* Returns the induction variable for the loop that gets translated to
STMT. */
@@ -823,9 +828,6 @@ translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
return next_e;
}
-static tree gcc_type_for_iv_of_clast_loop (struct clast_for *);
-
-
/* Creates a new if region protecting the loop to be executed, if the execution
count is zero (lb > ub). */
static edge
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 11bddf85fd9..83eff2a341c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -180,7 +180,7 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
if (simple_copy_phi_p (phi))
{
- /* FIXME: PRE introduces phi nodes like these, for an example,
+ /* PRE introduces phi nodes like these, for an example,
see id-5.f in the fortran graphite testsuite:
# prephitmp.85_265 = PHI <prephitmp.85_258(33), prephitmp.85_265(18)>
@@ -1038,6 +1038,74 @@ gbb_from_bb (basic_block bb)
return (gimple_bb_p) bb->aux;
}
+/* Insert in the SCOP context constraints from the estimation of the
+ number of iterations. UB_EXPR is a linear expression describing
+ the number of iterations in a loop. This expression is bounded by
+ the estimation NIT. */
+
+static void
+add_upper_bounds_from_estimated_nit (scop_p scop, double_int nit,
+ ppl_dimension_type dim,
+ ppl_Linear_Expression_t ub_expr)
+{
+ Value val;
+ ppl_Linear_Expression_t nb_iters_le;
+ ppl_Polyhedron_t pol;
+ ppl_Coefficient_t coef;
+ ppl_Constraint_t ub;
+
+ ppl_new_Linear_Expression_with_dimension (&ub_expr, dim);
+ ppl_new_C_Polyhedron_from_space_dimension (&pol, dim, 0);
+ ppl_new_Linear_Expression_from_Linear_Expression (&nb_iters_le,
+ ub_expr);
+
+ /* Construct the negated number of last iteration in VAL. */
+ value_init (val);
+ mpz_set_double_int (val, nit, false);
+ value_sub_int (val, val, 1);
+ value_oppose (val, val);
+
+ /* NB_ITERS_LE holds the number of last iteration in
+ parametrical form. Subtract estimated number of last
+ iteration and assert that result is not positive. */
+ ppl_new_Coefficient_from_mpz_t (&coef, val);
+ ppl_Linear_Expression_add_to_inhomogeneous (nb_iters_le, coef);
+ ppl_delete_Coefficient (coef);
+ ppl_new_Constraint (&ub, nb_iters_le,
+ PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
+ ppl_Polyhedron_add_constraint (pol, ub);
+
+ /* Remove all but last GDIM dimensions from POL to obtain
+ only the constraints on the parameters. */
+ {
+ graphite_dim_t gdim = scop_nb_params (scop);
+ ppl_dimension_type *dims = XNEWVEC (ppl_dimension_type, dim - gdim);
+ graphite_dim_t i;
+
+ for (i = 0; i < dim - gdim; i++)
+ dims[i] = i;
+
+ ppl_Polyhedron_remove_space_dimensions (pol, dims, dim - gdim);
+ XDELETEVEC (dims);
+ }
+
+ /* Add the constraints on the parameters to the SCoP context. */
+ {
+ ppl_Pointset_Powerset_C_Polyhedron_t constraints_ps;
+
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
+ (&constraints_ps, pol);
+ ppl_Pointset_Powerset_C_Polyhedron_intersection_assign
+ (SCOP_CONTEXT (scop), constraints_ps);
+ ppl_delete_Pointset_Powerset_C_Polyhedron (constraints_ps);
+ }
+
+ ppl_delete_Polyhedron (pol);
+ ppl_delete_Linear_Expression (nb_iters_le);
+ ppl_delete_Constraint (ub);
+ value_clear (val);
+}
+
/* Builds the constraint polyhedra for LOOP in SCOP. OUTER_PH gives
the constraints for the surrounding loops. */
@@ -1113,64 +1181,8 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
scan_tree_for_params (SCOP_REGION (scop), nb_iters, ub_expr, one);
value_clear (one);
- /* N <= estimated_nb_iters
-
- FIXME: This is a workaround that should go away once we will
- have the PIP algorithm. */
if (estimated_loop_iterations (loop, true, &nit))
- {
- Value val;
- ppl_Linear_Expression_t nb_iters_le;
- ppl_Polyhedron_t pol;
- graphite_dim_t n = scop_nb_params (scop);
- ppl_Coefficient_t coef;
-
- ppl_new_C_Polyhedron_from_space_dimension (&pol, dim, 0);
- ppl_new_Linear_Expression_from_Linear_Expression (&nb_iters_le,
- ub_expr);
-
- /* Construct the negated number of last iteration in VAL. */
- value_init (val);
- mpz_set_double_int (val, nit, false);
- value_sub_int (val, val, 1);
- value_oppose (val, val);
-
- /* NB_ITERS_LE holds number of last iteration in parametrical form.
- Subtract estimated number of last iteration and assert that result
- is not positive. */
- ppl_new_Coefficient_from_mpz_t (&coef, val);
- ppl_Linear_Expression_add_to_inhomogeneous (nb_iters_le, coef);
- ppl_delete_Coefficient (coef);
- ppl_new_Constraint (&ub, nb_iters_le,
- PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
- ppl_Polyhedron_add_constraint (pol, ub);
-
- /* Remove all but last N dimensions from POL to obtain constraints
- on parameters. */
- {
- ppl_dimension_type *dims = XNEWVEC (ppl_dimension_type, dim - n);
- graphite_dim_t i;
- for (i = 0; i < dim - n; i++)
- dims[i] = i;
- ppl_Polyhedron_remove_space_dimensions (pol, dims, dim - n);
- XDELETEVEC (dims);
- }
-
- /* Add constraints on parameters to SCoP context. */
- {
- ppl_Pointset_Powerset_C_Polyhedron_t constraints_ps;
- ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
- (&constraints_ps, pol);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign
- (SCOP_CONTEXT (scop), constraints_ps);
- ppl_delete_Pointset_Powerset_C_Polyhedron (constraints_ps);
- }
-
- ppl_delete_Polyhedron (pol);
- ppl_delete_Linear_Expression (nb_iters_le);
- ppl_delete_Constraint (ub);
- value_clear (val);
- }
+ add_upper_bounds_from_estimated_nit (scop, nit, dim, ub_expr);
/* loop_i <= expr_nb_iters */
ppl_set_coef (ub_expr, nb, -1);
@@ -2188,7 +2200,8 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
gimple stmt = gimple_build_assign (res, zero_dim_array);
tree arg = gimple_phi_arg_def (phi, 0);
- if (TREE_CODE (arg) == SSA_NAME)
+ if (TREE_CODE (arg) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (arg))
insert_out_of_ssa_copy (zero_dim_array, arg);
else
insert_out_of_ssa_copy_on_edge (single_pred_edge (gimple_bb (phi)),
@@ -2353,7 +2366,8 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
if (def_bb != gimple_bb (use_stmt)
- && gimple_code (use_stmt) != GIMPLE_PHI)
+ && gimple_code (use_stmt) != GIMPLE_PHI
+ && !is_gimple_debug (use_stmt))
{
if (!zero_dim_array)
{
@@ -2452,7 +2466,7 @@ split_reduction_stmt (gimple stmt)
split_block (bb, stmt);
- if (gsi_one_before_end_p (gsi_start_bb (bb)))
+ if (gsi_one_before_end_p (gsi_start_nondebug_bb (bb)))
return bb;
gsi = gsi_last_bb (bb);
@@ -2898,6 +2912,9 @@ scop_canonicalize_loops (scop_p scop)
graphite_loop_normal_form (loop);
}
+/* Java does not initialize long_long_integer_type_node. */
+#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
+
/* Can all ivs be represented by a signed integer?
As CLooG might generate negative values in its expressions, signed loop ivs
are required in the backend. */
@@ -2922,21 +2939,23 @@ scop_ivs_can_be_represented (scop_p scop)
precision = TYPE_PRECISION (type);
if (TYPE_UNSIGNED (type)
- && precision >= TYPE_PRECISION (long_long_integer_type_node))
+ && precision >= TYPE_PRECISION (my_long_long))
return false;
}
return true;
}
+#undef my_long_long
/* Builds the polyhedral representation for a SESE region. */
-bool
+void
build_poly_scop (scop_p scop)
{
sese region = SCOP_REGION (scop);
sbitmap reductions = sbitmap_alloc (last_basic_block * 2);
+ graphite_dim_t max_dim;
sbitmap_zero (reductions);
rewrite_commutative_reductions_out_of_ssa (region, reductions);
@@ -2949,17 +2968,20 @@ build_poly_scop (scop_p scop)
sense to optimize a scop containing only PBBs that do not belong
to any loops. */
if (nb_pbbs_in_loops (scop) == 0)
- return false;
+ return;
scop_canonicalize_loops (scop);
-
if (!scop_ivs_can_be_represented (scop))
- return false;
+ return;
build_sese_loop_nests (region);
build_sese_conditions (region);
find_scop_parameters (scop);
+ max_dim = PARAM_VALUE (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS);
+ if (scop_nb_params (scop) > max_dim)
+ return;
+
build_scop_iteration_domain (scop);
build_scop_context (scop);
@@ -2967,9 +2989,10 @@ build_poly_scop (scop_p scop)
scop_to_lst (scop);
build_scop_scattering (scop);
build_scop_drs (scop);
- POLY_SCOP_P (scop) = true;
- return true;
+ /* This SCoP has been translated to the polyhedral
+ representation. */
+ POLY_SCOP_P (scop) = true;
}
/* Always return false. Exercise the scop_to_clast function. */
diff --git a/gcc/graphite-sese-to-poly.h b/gcc/graphite-sese-to-poly.h
index 0737c49bd94..3213471eb25 100644
--- a/gcc/graphite-sese-to-poly.h
+++ b/gcc/graphite-sese-to-poly.h
@@ -28,7 +28,7 @@ struct base_alias_pair
int *alias_set;
};
-bool build_poly_scop (scop_p);
+void build_poly_scop (scop_p);
void check_poly_representation (scop_p);
#endif
diff --git a/gcc/graphite.c b/gcc/graphite.c
index ba05cc74361..a244b870e8c 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -202,7 +202,7 @@ graphite_initialize (void)
if (number_of_loops () <= 1
/* FIXME: This limit on the number of basic blocks of a function
should be removed when the SCOP detection is faster. */
- || n_basic_blocks > 100)
+ || n_basic_blocks > PARAM_VALUE (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION))
{
if (dump_file && (dump_flags & TDF_DETAILS))
print_global_statistics (dump_file);
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index e0336aa1a13..24b42e3ed03 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -1389,6 +1389,7 @@ create_new_general_access (struct access_site *acc, d_str str)
for now just reset all debug stmts referencing objects that have
been peeled. */
gimple_debug_bind_reset_value (stmt);
+ update_stmt (stmt);
break;
default:
diff --git a/gcc/ipa.c b/gcc/ipa.c
index f81d41a4a28..c789a29372d 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -262,10 +262,10 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (!clone)
{
cgraph_release_function_body (node);
- cgraph_node_remove_callees (node);
node->analyzed = false;
node->local.inlinable = false;
}
+ cgraph_node_remove_callees (node);
if (node->prev_sibling_clone)
node->prev_sibling_clone->next_sibling_clone = node->next_sibling_clone;
else if (node->clone_of)
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index ac69e229b06..b88082a304b 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -499,6 +499,8 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
for (use = 0; use < recog_data.n_operands; use++)
{
+ int alt1;
+
if (use == def || recog_data.operand_type[use] == OP_OUT)
continue;
@@ -507,6 +509,22 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl)
else
use_cl = recog_op_alt[use][alt].cl;
+ /* If there's any alternative that allows USE to match DEF, do not
+ record a conflict. If that causes us to create an invalid
+ instruction due to the earlyclobber, reload must fix it up. */
+ for (alt1 = 0; alt1 < recog_data.n_alternatives; alt1++)
+ if (recog_op_alt[use][alt1].matches == def
+ || (use < recog_data.n_operands - 1
+ && recog_data.constraints[use][0] == '%'
+ && recog_op_alt[use + 1][alt1].matches == def)
+ || (use >= 1
+ && recog_data.constraints[use - 1][0] == '%'
+ && recog_op_alt[use - 1][alt1].matches == def))
+ break;
+
+ if (alt1 < recog_data.n_alternatives)
+ continue;
+
advance_p = check_and_make_def_use_conflict (dreg, def_cl, use,
use_cl, advance_p);
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index e5fe6299f28..50f7d475665 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1657,7 +1657,7 @@ remove_iv (gimple iv_stmt)
continue;
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg)
- if (stmt != iv_stmt)
+ if (stmt != iv_stmt && !is_gimple_debug (stmt))
used = true;
if (!used)
@@ -1839,6 +1839,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
gimple_seq stmts;
lambda_body_vector lbv, newlbv;
+ if (is_gimple_debug (stmt))
+ continue;
+
/* Compute the new expression for the induction
variable. */
depth = VEC_length (tree, new_ivs);
@@ -1885,7 +1888,8 @@ not_interesting_stmt (gimple stmt)
loop, we would have already failed the number of exits tests. */
if (gimple_code (stmt) == GIMPLE_LABEL
|| gimple_code (stmt) == GIMPLE_GOTO
- || gimple_code (stmt) == GIMPLE_COND)
+ || gimple_code (stmt) == GIMPLE_COND
+ || is_gimple_debug (stmt))
return true;
return false;
}
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 03f0a13baa0..57973c19523 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1423,14 +1423,16 @@ move_invariant_reg (struct loop *loop, unsigned invno)
emit_insn_after (gen_move_insn (dest, reg), inv->insn);
reorder_insns (inv->insn, inv->insn, BB_END (preheader));
- /* If there is a REG_EQUAL note on the insn we just moved, and
- insn is in a basic block that is not always executed, the note
- may no longer be valid after we move the insn.
- Note that uses in REG_EQUAL notes are taken into account in
- the computation of invariants. Hence it is safe to retain the
- note even if the note contains register references. */
- if (! inv->always_executed
- && (note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX)))
+ /* If there is a REG_EQUAL note on the insn we just moved, and the
+ insn is in a basic block that is not always executed or the note
+ contains something for which we don't know the invariant status,
+ the note may no longer be valid after we move the insn. Note that
+ uses in REG_EQUAL notes are taken into account in the computation
+ of invariants, so it is safe to retain the note even if it contains
+ register references for which we know the invariant status. */
+ if ((note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX))
+ && (!inv->always_executed
+ || !check_maybe_invariant (XEXP (note, 0))))
remove_note (inv->insn, note);
}
else
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 747166b18d3..555e2562a45 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1389,11 +1389,12 @@ static rtx
avoid_expensive_constant (enum machine_mode mode, optab binoptab,
rtx x, bool unsignedp)
{
+ bool speed = optimize_insn_for_speed_p ();
+
if (mode != VOIDmode
&& optimize
&& CONSTANT_P (x)
- && rtx_cost (x, binoptab->code, optimize_insn_for_speed_p ())
- > COSTS_N_INSNS (1))
+ && rtx_cost (x, binoptab->code, speed) > rtx_cost (x, SET, speed))
{
if (CONST_INT_P (x))
{
diff --git a/gcc/params.def b/gcc/params.def
index 07bfb901f0b..435a788307b 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -745,6 +745,20 @@ DEFPARAM (PARAM_LOOP_BLOCK_TILE_SIZE,
"size of tiles for loop blocking",
51, 0, 0)
+/* Maximal number of parameters that we allow in a SCoP. */
+
+DEFPARAM (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS,
+ "graphite-max-nb-scop-params",
+ "maximum number of parameters in a SCoP",
+ 10, 0, 0)
+
+/* Maximal number of basic blocks in the functions analyzed by Graphite. */
+
+DEFPARAM (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION,
+ "graphite-max-bbs-per-function",
+ "maximum number of basic blocks per function to be analyzed by Graphite",
+ 100, 0, 0)
+
/* Avoid doing loop invariant motion on very large loops. */
DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
diff --git a/gcc/postreload.c b/gcc/postreload.c
index f8785821f63..8b622a7365a 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1,7 +1,7 @@
/* Perform simple optimizations to clean up the result of reload.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -198,7 +198,7 @@ reload_cse_regs_1 (rtx first)
rtx insn;
rtx testreg = gen_rtx_REG (VOIDmode, -1);
- cselib_init (true);
+ cselib_init (CSELIB_RECORD_MEMORY);
init_alias_analysis ();
for (insn = first; insn; insn = NEXT_INSN (insn))
diff --git a/gcc/recog.c b/gcc/recog.c
index 810270625a2..bc0b2782d38 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -787,12 +787,18 @@ validate_replace_rtx_part_nosimplify (rtx from, rtx to, rtx *where,
}
-/* Try replacing every occurrence of FROM in INSN with TO. */
+/* Try replacing every occurrence of FROM in INSN with TO. This also
+ will replace in REG_EQUAL and REG_EQUIV notes. */
void
validate_replace_rtx_group (rtx from, rtx to, rtx insn)
{
+ rtx note;
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn, true);
+ for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+ if (REG_NOTE_KIND (note) == REG_EQUAL
+ || REG_NOTE_KIND (note) == REG_EQUIV)
+ validate_replace_rtx_1 (&XEXP (note, 0), from, to, insn, true);
}
/* Function called by note_uses to replace used subexpressions. */
diff --git a/gcc/regrename.c b/gcc/regrename.c
index f7891d1b017..d6063a83a52 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -509,6 +509,72 @@ note_sets_clobbers (rtx x, const_rtx set, void *data)
add_to_hard_reg_set (&chain->hard_conflicts, GET_MODE (x), REGNO (x));
}
+/* Create a new chain for THIS_NREGS registers starting at THIS_REGNO,
+ and record its occurrence in *LOC, which is being written to in INSN.
+ This access requires a register of class CL. */
+
+static void
+create_new_chain (unsigned this_regno, unsigned this_nregs, rtx *loc,
+ rtx insn, enum reg_class cl)
+{
+ struct du_head *head = XOBNEW (&rename_obstack, struct du_head);
+ struct du_chain *this_du;
+ int nregs;
+
+ head->next_chain = open_chains;
+ open_chains = head;
+ head->regno = this_regno;
+ head->nregs = this_nregs;
+ head->need_caller_save_reg = 0;
+ head->cannot_rename = 0;
+ head->terminated = 0;
+
+ VEC_safe_push (du_head_p, heap, id_to_chain, head);
+ head->id = current_id++;
+
+ bitmap_initialize (&head->conflicts, &bitmap_default_obstack);
+ bitmap_copy (&head->conflicts, &open_chains_set);
+ mark_conflict (open_chains, head->id);
+
+ /* Since we're tracking this as a chain now, remove it from the
+ list of conflicting live hard registers and track it in
+ live_in_chains instead. */
+ nregs = head->nregs;
+ while (nregs-- > 0)
+ {
+ SET_HARD_REG_BIT (live_in_chains, head->regno + nregs);
+ CLEAR_HARD_REG_BIT (live_hard_regs, head->regno + nregs);
+ }
+
+ COPY_HARD_REG_SET (head->hard_conflicts, live_hard_regs);
+ bitmap_set_bit (&open_chains_set, head->id);
+
+ open_chains = head;
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Creating chain %s (%d)",
+ reg_names[head->regno], head->id);
+ if (insn != NULL_RTX)
+ fprintf (dump_file, " at insn %d", INSN_UID (insn));
+ fprintf (dump_file, "\n");
+ }
+
+ if (insn == NULL_RTX)
+ {
+ head->first = head->last = NULL;
+ return;
+ }
+
+ this_du = XOBNEW (&rename_obstack, struct du_chain);
+ head->first = head->last = this_du;
+
+ this_du->next_use = 0;
+ this_du->loc = loc;
+ this_du->insn = insn;
+ this_du->cl = cl;
+}
+
static void
scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, enum scan_actions action,
enum op_type type)
@@ -522,53 +588,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, enum scan_actions action,
if (action == mark_write)
{
if (type == OP_OUT)
- {
- struct du_head *head = XOBNEW (&rename_obstack, struct du_head);
- struct du_chain *this_du = XOBNEW (&rename_obstack, struct du_chain);
- int nregs;
-
- head->next_chain = open_chains;
- open_chains = head;
- head->first = head->last = this_du;
- head->regno = this_regno;
- head->nregs = this_nregs;
- head->need_caller_save_reg = 0;
- head->cannot_rename = 0;
- head->terminated = 0;
-
- VEC_safe_push (du_head_p, heap, id_to_chain, head);
- head->id = current_id++;
-
- bitmap_initialize (&head->conflicts, &bitmap_default_obstack);
- bitmap_copy (&head->conflicts, &open_chains_set);
- mark_conflict (open_chains, head->id);
-
- /* Since we're tracking this as a chain now, remove it from the
- list of conflicting live hard registers and track it in
- live_in_chains instead. */
- nregs = head->nregs;
- while (nregs-- > 0)
- {
- SET_HARD_REG_BIT (live_in_chains, head->regno + nregs);
- CLEAR_HARD_REG_BIT (live_hard_regs, head->regno + nregs);
- }
-
- COPY_HARD_REG_SET (head->hard_conflicts, live_hard_regs);
- bitmap_set_bit (&open_chains_set, head->id);
-
- open_chains = head;
-
- this_du->next_use = 0;
- this_du->loc = loc;
- this_du->insn = insn;
- this_du->cl = cl;
-
- if (dump_file)
- fprintf (dump_file,
- "Creating chain %s (%d) at insn %d (%s)\n",
- reg_names[head->regno], head->id, INSN_UID (insn),
- scan_actions_name[(int) action]);
- }
+ create_new_chain (this_regno, this_nregs, loc, insn, cl);
return;
}
@@ -636,7 +656,10 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl, enum scan_actions action,
this_du->loc = loc;
this_du->insn = insn;
this_du->cl = cl;
- head->last->next_use = this_du;
+ if (head->first == NULL)
+ head->first = this_du;
+ else
+ head->last->next_use = this_du;
head->last = this_du;
}
@@ -1069,7 +1092,6 @@ build_def_use (basic_block bb)
int n_ops;
rtx note;
rtx old_operands[MAX_RECOG_OPERANDS];
- bool has_dup[MAX_RECOG_OPERANDS];
rtx old_dups[MAX_DUP_OPERANDS];
int i;
int alt;
@@ -1108,10 +1130,6 @@ build_def_use (basic_block bb)
n_ops = recog_data.n_operands;
untracked_operands = 0;
- memset (has_dup, 0, sizeof has_dup);
- for (i = 0; i < recog_data.n_dups; i++)
- has_dup[(int)recog_data.dup_num[i]] = true;
-
/* Simplify the code below by rewriting things to reflect
matching constraints. Also promote OP_OUT to OP_INOUT in
predicated instructions, but only for register operands
@@ -1121,14 +1139,13 @@ build_def_use (basic_block bb)
predicated = GET_CODE (PATTERN (insn)) == COND_EXEC;
for (i = 0; i < n_ops; ++i)
{
+ rtx op = recog_data.operand[i];
int matches = recog_op_alt[i][alt].matches;
if (matches >= 0)
recog_op_alt[i][alt].cl = recog_op_alt[matches][alt].cl;
if (matches >= 0 || recog_op_alt[i][alt].matched >= 0
- || (predicated && recog_data.operand_type[i] == OP_OUT
- && verify_reg_tracked (recog_data.operand[i])))
+ || (predicated && recog_data.operand_type[i] == OP_OUT))
{
- rtx op = recog_data.operand[i];
recog_data.operand_type[i] = OP_INOUT;
/* A special case to deal with instruction patterns that
have matching operands with different modes. If we're
@@ -1145,18 +1162,17 @@ build_def_use (basic_block bb)
}
}
/* If there's an in-out operand with a register that is not
- being tracked at all yet, convert it to an earlyclobber
- output operand.
- This only works if the operand isn't duplicated, i.e. for
- a ZERO_EXTRACT in a SET_DEST. */
+ being tracked at all yet, open a chain. */
if (recog_data.operand_type[i] == OP_INOUT
&& !(untracked_operands & (1 << i))
- && !verify_reg_tracked (recog_data.operand[i]))
+ && REG_P (op)
+ && !verify_reg_tracked (op))
{
- if (has_dup[i])
- fail_current_block = true;
- recog_data.operand_type[i] = OP_OUT;
- recog_op_alt[i][alt].earlyclobber = 1;
+ enum machine_mode mode = GET_MODE (op);
+ unsigned this_regno = REGNO (op);
+ unsigned this_nregs = hard_regno_nregs[this_regno][mode];
+ create_new_chain (this_regno, this_nregs, NULL, NULL_RTX,
+ NO_REGS);
}
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 1748e738527..b8563b33d16 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1778,7 +1778,7 @@ extern rtx simplify_subreg (enum machine_mode, rtx, enum machine_mode,
extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode,
unsigned int);
extern rtx simplify_replace_fn_rtx (rtx, const_rtx,
- rtx (*fn) (rtx, void *), void *);
+ rtx (*fn) (rtx, const_rtx, void *), void *);
extern rtx simplify_replace_rtx (rtx, const_rtx, rtx);
extern rtx simplify_rtx (const_rtx);
extern rtx avoid_constant_pool_reference (rtx);
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 02de5f8e820..40ebc5654de 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1,7 +1,7 @@
/* Instruction scheduling pass. This file computes dependencies between
instructions.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
@@ -3383,7 +3383,7 @@ sched_analyze (struct deps *deps, rtx head, rtx tail)
rtx insn;
if (sched_deps_info->use_cselib)
- cselib_init (true);
+ cselib_init (CSELIB_RECORD_MEMORY);
deps_start_bb (deps, head);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 5ad5b1aceb9..d189d7066f2 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -350,15 +350,14 @@ simplify_gen_relational (enum rtx_code code, enum machine_mode mode,
return gen_rtx_fmt_ee (code, mode, op0, op1);
}
-/* Replace all occurrences of OLD_RTX in X with FN (X', DATA), where X'
- is an expression in X that is equal to OLD_RTX. Canonicalize and
- simplify the result.
-
- If FN is null, assume FN (X', DATA) == copy_rtx (DATA). */
+/* If FN is NULL, replace all occurrences of OLD_RTX in X with copy_rtx (DATA)
+ and simplify the result. If FN is non-NULL, call this callback on each
+ X, if it returns non-NULL, replace X with its return value and simplify the
+ result. */
rtx
simplify_replace_fn_rtx (rtx x, const_rtx old_rtx,
- rtx (*fn) (rtx, void *), void *data)
+ rtx (*fn) (rtx, const_rtx, void *), void *data)
{
enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x);
@@ -368,17 +367,14 @@ simplify_replace_fn_rtx (rtx x, const_rtx old_rtx,
rtvec vec, newvec;
int i, j;
- /* If X is OLD_RTX, return FN (X, DATA), with a null FN. Otherwise,
- if this is an expression, try to build a new expression, substituting
- recursively. If we can't do anything, return our input. */
-
- if (rtx_equal_p (x, old_rtx))
+ if (__builtin_expect (fn != NULL, 0))
{
- if (fn)
- return fn (x, data);
- else
- return copy_rtx ((rtx) data);
+ newx = fn (x, old_rtx, data);
+ if (newx)
+ return newx;
}
+ else if (rtx_equal_p (x, old_rtx))
+ return copy_rtx ((rtx) data);
switch (GET_RTX_CLASS (code))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3f5e88ba6d4..e01b7ad5a1f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,224 @@
+2010-03-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/43333
+ * g++.dg/ext/is_pod.C: Pass -std=c++0x.
+ * g++.dg/ext/is_pod_98.C: New.
+
+ PR c++/43281
+ * g++.dg/cpp0x/auto18.C: New.
+
+ * gcc.dg/pr36997.c: Adjust error message.
+ * g++.dg/ext/vector9.C: Likewise.
+ * g++.dg/conversion/simd3.C: Likewise.
+ * g++.dg/other/error23.C: Likewise.
+
+2010-03-22 Michael Matz <matz@suse.de>
+
+ PR middle-end/43475
+ * gfortran.dg/pr43475.f90: New testcase.
+
+2010-03-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43390
+ * gfortran.fortran-torture/execute/pr43390.f90: New testcase.
+
+2010-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.target/powerpc/ppc-sdata-1.c: Require nonpic.
+ * gcc.target/powerpc/ppc-sdata-2.c: Likewise.
+
+2010-03-20 Simon Martin <simartin@users.sourceforge.net>
+ Michael Matz <matz@suse.de>
+
+ PR c++/43081
+ * g++.dg/parse/crash56.C: New test.
+
+2010-03-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/43450
+ * gfortran.dg/whole_file_15.f90 : New test.
+
+2010-03-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/43409
+ * gfortran.dg/inquire_size.f90: New test.
+
+2010-03-20 Richard Guenther <rguenther@suse.de>
+
+ PR rtl-optimization/43438
+ * gcc.c-torture/execute/pr43438.c: New testcase.
+
+2010-03-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/43375
+ * g++.dg/abi/mangle42.C: New test.
+
+2010-03-19 Andrew Pinski <andrew_pinski@caviumnetworks.com>
+
+ PR C/43211
+ * gcc.dg/pr43211.c: New test.
+ * gcc.dg/pr18809-1.c: Don't expect an error when calling foo.
+
+2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com>
+
+ PR rtl-optimization/42258
+ * gcc.target/arm/thumb1-mul-moves.c: New test.
+
+ PR target/40697
+ * gcc.target/arm/thumb-andsi.c: New test.
+
+ * gcc.target/arm/thumb-andsi.c: Correct dg-options and add
+ dg-require-effective-target.
+
+2010-03-19 Michael Matz <matz@suse.de>
+
+ PR c++/43116
+ * g++.dg/other/pr43116.C: New testcase.
+
+2010-03-19 Michael Matz <matz@suse.de>
+
+ PR target/43305
+ * gcc.dg/pr43305.c: New testcase.
+
+2010-03-19 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43415
+ * gcc.c-torture/compile/pr43415.c: New testcase.
+
+2010-03-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/43106
+ * gnat.dg/case_optimization2.adb: New test.
+ * gnat.dg/case_optimization_pkg2.ad[sb]: New helper.
+
+2010-03-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/36399
+ * gcc.target/i386/push-1.c: Don't xfail
+ scan-assembler-not "movups" on darwin.
+
+2010-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43058
+ * gcc.dg/pr43058.c: New test.
+
+2010-03-18 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/42450
+ * g++.dg/torture/pr42450.C: New test.
+
+2010-03-18 Michael Matz <matz@suse.de>
+
+ PR middle-end/43419
+ * gcc.dg/pr43419.c: New testcase.
+
+2010-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/43360
+ * gcc.dg/torture/pr43360.c: New.
+
+2010-03-18 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/43402
+ * gcc.dg/pr43402.c: New testcase.
+
+2010-03-17 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR target/42427
+ * gcc.dg/pr42427.c: New test.
+
+2010-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/43265
+ * gfortran.dg/read_empty_file.f: New test.
+ * gfortran.dg/read_eof_all.f90: New test.
+ * gfortran.dg/namelist_27.f90: Eliminate infinite loop posibility.
+ * gfortran.dg/namelist_28.f90: Eliminate infinite loop posibility.
+
+2010-03-17 Michael Matz <matz@suse.de>
+
+ * gcc.dg/pr43300.c: Add -w.
+
+2010-03-17 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/pr43379.c: Add -w.
+
+2010-03-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43331
+ * gfortran.dg/cray_pointers_1.f90: Update dg-error message.
+
+2010-03-16 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/graphite/block-3.c: Add dg-timeout-factor.
+
+2010-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * ada/acats/run_all.sh: Log start and end times.
+
+2010-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gnat.dg/socket1.adb: Disable on *-*-solaris2*.
+
+2010-03-16 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/43379
+ * gcc.dg/pr43379.c: New testcase.
+
+2010-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/43051
+ * gcc.dg/guality/pr43051-1.c: New test.
+
+2010-03-15 Janis Johnson <janis187@us.ibm.com>
+
+ PR testsuite/43363
+ * g++.dg/ext/altivec-17.C: Handle changes to error message.
+
+2010-03-15 Michael Matz <matz@suse.de>
+
+ PR middle-end/43300
+ * gcc.dg/pr43300.c: New testcase.
+
+2010-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43367
+ * gcc.c-torture/compile/pr43367.c: New testcase.
+
+2010-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43317
+ * gcc.dg/pr43317.c: New testcase.
+
+2010-03-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * g++.dg/abi/packed1.C: Expect warning on the alpha*-*-*.
+
+2010-03-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * g++.dg/graphite/pr43026.C (dg-options): Remove -m32.
+
+2010-03-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/43362
+ * gfortran.dg/impure_constructor_1.f90: New test.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43354
+ * gfortran.dg/graphite/id-pr43354.f: New.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43349
+ * gfortran.dg/graphite/pr43349.f: New.
+
+2010-03-13 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43306
+ * gcc.dg/graphite/pr43306.c: New.
+
2010-03-12 David S. Miller <davem@davemloft.net>
* gcc.dg/lto/20090313_0.c: Add -mcpu=v9 to dg-lto-options on
@@ -200,6 +421,11 @@
2010-03-03 Jason Merrill <jason@redhat.com>
+ PR c++/12909
+ * g++.dg/abi/mangle40.C: Updated.
+
+2010-03-03 Jason Merrill <jason@redhat.com>
+
* g++.dg/abi/mangle19-1.C: Adjust for default -Wabi.
* g++.dg/abi/mangle23.C: Likewise.
* g++.dg/eh/simd-2.C: Likewise.
diff --git a/gcc/testsuite/ada/acats/run_all.sh b/gcc/testsuite/ada/acats/run_all.sh
index edc76f4371d..eb30fbc3356 100755
--- a/gcc/testsuite/ada/acats/run_all.sh
+++ b/gcc/testsuite/ada/acats/run_all.sh
@@ -76,6 +76,8 @@ EXTERNAL_OBJECTS=""
rm -f $dir/acats.sum $dir/acats.log
+display "Test Run By $USER on `date`"
+
display " === acats configuration ==="
target=`$GCC -dumpmachine`
@@ -312,4 +314,6 @@ if [ $glob_countok -ne $glob_countn ]; then
display "*** FAILURES: $failed"
fi
+display "$0 completed at `date`"
+
exit 0
diff --git a/gcc/testsuite/g++.dg/abi/mangle42.C b/gcc/testsuite/g++.dg/abi/mangle42.C
new file mode 100644
index 00000000000..730781b300b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle42.C
@@ -0,0 +1,14 @@
+// Origin: PR c++/43375
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-msse2 -std=gnu++0x" }
+
+typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+typedef int __v4si __attribute__ ((__vector_size__ (16)));
+__v4sf my_asin(__v4sf x)
+{
+ static const __v4si g_Mask{0x7fffffff,
+ 0x00000000,
+ 0x7fffffff,
+ 0x7fffffff };
+ return __builtin_ia32_andnps ((__v4sf) g_Mask, x);
+}
diff --git a/gcc/testsuite/g++.dg/abi/packed1.C b/gcc/testsuite/g++.dg/abi/packed1.C
index 7874d4c4f1d..071fa8b12d8 100644
--- a/gcc/testsuite/g++.dg/abi/packed1.C
+++ b/gcc/testsuite/g++.dg/abi/packed1.C
@@ -4,7 +4,7 @@
extern "C" void abort ();
-struct INNER { // { dg-warning "inefficient.*vptr" "" { target ia64-*-* hppa*-*-* sparc*-*-* sh*-*-* } }
+struct INNER { // { dg-warning "inefficient.*vptr" "" { target alpha*-*-* ia64-*-* hppa*-*-* sparc*-*-* sh*-*-* } }
virtual int foo() const { return 1; }
} __attribute__ ((packed));
diff --git a/gcc/testsuite/g++.dg/conversion/simd3.C b/gcc/testsuite/g++.dg/conversion/simd3.C
index dd0a68a06ad..8d9626449b7 100644
--- a/gcc/testsuite/g++.dg/conversion/simd3.C
+++ b/gcc/testsuite/g++.dg/conversion/simd3.C
@@ -10,6 +10,6 @@ unsigned int __attribute__((vector_size(16))) e;
void foo()
{
b + d; /* { dg-error "invalid operands to binary" } */
- d += e; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert 'unsigned int __vector.4.' to 'int __vector.4.' in assignment" } */
+ d += e; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert '__vector.4. unsigned int' to '__vector.4. int' in assignment" } */
d2 += d;
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto18.C b/gcc/testsuite/g++.dg/cpp0x/auto18.C
new file mode 100644
index 00000000000..17f7f995955
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/auto18.C
@@ -0,0 +1,6 @@
+// { dg-options "-std=c++0x" }
+
+void f()
+{
+ auto val = val; // { dg-error "auto. type used in its own initializer" }
+}
diff --git a/gcc/testsuite/g++.dg/eh/pr43365.C b/gcc/testsuite/g++.dg/eh/pr43365.C
new file mode 100644
index 00000000000..32346d5018c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/pr43365.C
@@ -0,0 +1,30 @@
+extern "C" void abort();
+
+class Counter
+{
+public:
+ static int count;
+ ~Counter() { count += 1; }
+};
+
+int Counter::count = 0;
+
+void func()
+{
+ Counter c;
+
+ try {
+ throw 1;
+ }
+ catch (const int&) {
+ return;
+ }
+}
+
+int main()
+{
+ func();
+ if (Counter::count != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/altivec-17.C b/gcc/testsuite/g++.dg/ext/altivec-17.C
index 7db10e502b1..20c6935ecbb 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-17.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-17.C
@@ -12,5 +12,5 @@ typedef vector__ bool__ int bool_simd_type;
void Foo (bool_simd_type const &a)
{
- simd_type const &v = a; // { dg-error "'const unsigned int __vector__&' from expression of type 'const __bool int __vector__'" }
+ simd_type const &v = a; // { dg-error "'const unsigned int __vector\\\[4\\\]&' from expression of type 'const __bool int __vector\\\[4\\\]'" }
}
diff --git a/gcc/testsuite/g++.dg/ext/is_pod.C b/gcc/testsuite/g++.dg/ext/is_pod.C
index c984283a0e9..570d23565f1 100644
--- a/gcc/testsuite/g++.dg/ext/is_pod.C
+++ b/gcc/testsuite/g++.dg/ext/is_pod.C
@@ -1,3 +1,4 @@
+// { dg-options "-std=c++0x" }
// { dg-do "run" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/ext/is_pod_98.C b/gcc/testsuite/g++.dg/ext/is_pod_98.C
new file mode 100644
index 00000000000..80a87c825c4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/is_pod_98.C
@@ -0,0 +1,16 @@
+// PR c++/43333
+// { dg-options "-std=c++98" }
+// { dg-do run }
+
+struct strPOD
+{
+ const char *const foo;
+ const char *const bar;
+};
+extern "C" void abort (void);
+int main ()
+{
+ if (!__is_pod (strPOD))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/vector9.C b/gcc/testsuite/g++.dg/ext/vector9.C
index 0b3a9074cf6..32e13b494f0 100644
--- a/gcc/testsuite/g++.dg/ext/vector9.C
+++ b/gcc/testsuite/g++.dg/ext/vector9.C
@@ -6,5 +6,5 @@ typedef int v4i __attribute__((vector_size(8)));
void foo()
{
v4f v;
- !(v4i)v; // { dg-error "int __vector.2|argument" }
+ !(v4i)v; // { dg-error "__vector.2. int|argument" }
}
diff --git a/gcc/testsuite/g++.dg/graphite/pr43026.C b/gcc/testsuite/g++.dg/graphite/pr43026.C
index 0e33f1097c2..c880197035f 100644
--- a/gcc/testsuite/g++.dg/graphite/pr43026.C
+++ b/gcc/testsuite/g++.dg/graphite/pr43026.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fgraphite-identity -m32" } */
+/* { dg-options "-O2 -fgraphite-identity" } */
template<typename Tp > class vector { };
diff --git a/gcc/testsuite/g++.dg/other/error23.C b/gcc/testsuite/g++.dg/other/error23.C
index 749345d35b7..0ff1915cf2c 100644
--- a/gcc/testsuite/g++.dg/other/error23.C
+++ b/gcc/testsuite/g++.dg/other/error23.C
@@ -2,4 +2,4 @@
// { dg-do compile }
int v __attribute ((vector_size (8)));
-bool b = !(v - v); // { dg-error "could not convert .\\(int __vector.2.\\)\\{0, 0\\}. to .bool.|in argument to unary" }
+bool b = !(v - v); // { dg-error "could not convert .\\(__vector.2. int\\)\\{0, 0\\}. to .bool.|in argument to unary" }
diff --git a/gcc/testsuite/g++.dg/other/pr43116.C b/gcc/testsuite/g++.dg/other/pr43116.C
new file mode 100644
index 00000000000..f0d9d01e4a8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr43116.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+extern "C" int rpl_open (const char *filename, int flags, ...) __attribute__
+((__nonnull__ (1)));
+
+namespace gnulib
+{
+ int (*const open) (const char *filename, int flags, ...) __attribute__
+ ((__nonnull__ (1))) = rpl_open;
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash56.C b/gcc/testsuite/g++.dg/parse/crash56.C
new file mode 100644
index 00000000000..a554babe99f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash56.C
@@ -0,0 +1,17 @@
+/* PR c++/43081 */
+/* { dg-do "compile" } */
+/* { dg-options "-std=c++0x" } */
+
+struct A
+{
+ typedef void (F)();
+ F f = []{}; /* { dg-error "invalid initializer" } */
+};
+
+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" } */
+};
diff --git a/gcc/testsuite/g++.dg/torture/pr42450.C b/gcc/testsuite/g++.dg/torture/pr42450.C
new file mode 100644
index 00000000000..f630fa2b7e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr42450.C
@@ -0,0 +1,112 @@
+/* { dg-do compile } */
+
+template < typename > class basic_stringstream;
+
+struct basic_string {
+ basic_string();
+};
+
+struct ios_base {
+ virtual ~ios_base();
+};
+
+class ostream:ios_base {};
+class istream:virtual ios_base {};
+
+template < typename > struct basic_iostream:public istream, ostream {
+ ~basic_iostream () {}
+};
+extern template class basic_iostream < char >;
+
+template < typename > struct basic_stringstream:public basic_iostream < char > {
+ basic_string _M_stringbuf;
+ ~basic_stringstream () {}
+};
+extern template class basic_stringstream < char >;
+
+template < typename > struct AnyMatrixBase;
+template < typename, int _Rows, int _Cols, int = _Rows, int = _Cols > class Matrix;
+template < typename > class CwiseNullaryOp;
+
+template < typename Derived > struct MatrixBase:public AnyMatrixBase < Derived > {
+ typedef CwiseNullaryOp < Derived > ConstantReturnType;
+ ConstantReturnType Constant ();
+ template < typename > Derived cast ();
+ static CwiseNullaryOp < Derived > Random (int);
+};
+
+template < typename Derived > struct AnyMatrixBase {
+ Derived derived () {}
+ Derived & derived () const {}
+};
+
+template < typename, int > struct ei_matrix_storage {};
+
+template < typename _Scalar, int, int, int _MaxRows, int _MaxCols > struct Matrix:MatrixBase < Matrix < _Scalar, _MaxRows, _MaxCols > > {
+ typedef MatrixBase < Matrix > Base;
+ ei_matrix_storage < int, _MaxCols > m_storage;
+ Matrix operator= (const Matrix other) {
+ _resize_to_match (other);
+ lazyAssign (other.derived ());
+ }
+ template < typename OtherDerived > Matrix lazyAssign (MatrixBase < OtherDerived > other) {
+ _resize_to_match (other);
+ return Base (other.derived ());
+ }
+ Matrix ();
+ template < typename OtherDerived > Matrix (const MatrixBase < OtherDerived > &other) {
+ *this = other;
+ }
+ template < typename OtherDerived > void _resize_to_match (const MatrixBase < OtherDerived > &) {
+ throw 1;
+ }
+};
+
+template < typename MatrixType > class CwiseNullaryOp:
+public MatrixBase < CwiseNullaryOp < MatrixType > > {};
+
+int f()
+{
+ bool align_cols;
+ if (align_cols) {
+ basic_stringstream<char> sstr;
+ f();
+ }
+}
+
+template < typename > struct AutoDiffScalar;
+template < typename Functor > struct AutoDiffJacobian:Functor {
+ AutoDiffJacobian (Functor);
+ typedef typename Functor::InputType InputType;
+ typedef typename Functor::ValueType ValueType;
+ typedef Matrix < int, Functor::InputsAtCompileTime, 1 > DerivativeType;
+ typedef AutoDiffScalar < DerivativeType > ActiveScalar;
+ typedef Matrix < ActiveScalar, Functor::InputsAtCompileTime, 1 > ActiveInput;
+ void operator () (InputType x, ValueType *) {
+ ActiveInput ax = x.template cast < ActiveScalar > ();
+ }
+};
+
+template < int NX, int NY > struct TestFunc1 {
+ enum {
+ InputsAtCompileTime = NX
+ };
+ typedef Matrix < float, NX, 1 > InputType;
+ typedef Matrix < float, NY, 1 > ValueType;
+ typedef Matrix < float, NY, NX > JacobianType;
+ int inputs ();
+};
+
+template < typename Func > void forward_jacobian (Func f) {
+ typename Func::InputType x = Func::InputType::Random (f.inputs ());
+ typename Func::ValueType y;
+ typename Func::JacobianType jref = jref.Constant ();
+ AutoDiffJacobian < Func > autoj (f);
+ autoj (x, &y);
+}
+
+void test_autodiff_scalar ()
+{
+ forward_jacobian (TestFunc1 < 2, 2 > ());
+ forward_jacobian (TestFunc1 < 3, 2 > ());
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43367.c b/gcc/testsuite/gcc.c-torture/compile/pr43367.c
new file mode 100644
index 00000000000..5c620c13c90
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43367.c
@@ -0,0 +1,30 @@
+unsigned char g_17;
+
+const unsigned char func_39 (unsigned char p_40, unsigned char * p_41)
+{
+ return 0;
+}
+
+void int327 (const unsigned char p_48, unsigned char p_49)
+{
+ unsigned l_52;
+ unsigned char l_58[2];
+ int i, j;
+ if (func_39 (l_52, &p_49), p_48) {
+ unsigned char *l_60;
+ unsigned char *l = &l_58[1];
+ for (j; j; j++) {
+lbl_59:
+ break;
+ }
+ for (l = 0; 1; l += 1) {
+ for (p_49 = 1; p_49; p_49 += 0) {
+ unsigned char **l_61[1][6];
+ for (j = 0; j < 1; j++)
+ l_61[i][j] = &l_60;
+ goto lbl_59;
+ }
+ }
+ }
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43415.c b/gcc/testsuite/gcc.c-torture/compile/pr43415.c
new file mode 100644
index 00000000000..c00e1c41ce9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr43415.c
@@ -0,0 +1,36 @@
+int main()
+{
+ unsigned long long table[256];
+ unsigned int i;
+ for (i=0; i<256; ++i) {
+ unsigned long long j;
+ unsigned char x=i;
+ for (j=0; j<5; ++j) {
+ x += x<<1;
+ x ^= x>>1;
+ }
+ for (j=0; j<5; ++j) {
+ x += x<<1;
+ x ^= x>>1;
+ }
+ for (j=0; j<5; ++j) {
+ x += x<<1;
+ x ^= x>>1;
+ }
+ for (j=0; j<5; ++j) {
+ x += x<<1;
+ x ^= x>>1;
+ }
+ for (j=0; j<5; ++j) {
+ x += x<<1;
+ x ^= x>>1;
+ }
+ table[i] ^= (((unsigned long long)x)<<16);
+ }
+ for (i=0; i<256; ++i) {
+ if ((table[i]&0xff)==i)
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43438.c b/gcc/testsuite/gcc.c-torture/execute/pr43438.c
new file mode 100644
index 00000000000..aa901ce0f90
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr43438.c
@@ -0,0 +1,23 @@
+extern void abort (void);
+
+static unsigned char g_2 = 1;
+static int g_9;
+static int *l_8 = &g_9;
+
+static void func_12(int p_13)
+{
+ int * l_17 = &g_9;
+ *l_17 &= 0 < p_13;
+}
+
+int main(void)
+{
+ unsigned char l_11 = 254;
+ *l_8 |= g_2;
+ l_11 |= *l_8;
+ func_12(l_11);
+ if (g_9 != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/graphite/block-3.c b/gcc/testsuite/gcc.dg/graphite/block-3.c
index efa14599ed7..322ed8d7f89 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-3.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-3.c
@@ -1,4 +1,5 @@
/* { dg-require-effective-target size32plus } */
+/* { dg-timeout-factor 4.0 } */
#define DEBUG 0
#if DEBUG
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43306.c b/gcc/testsuite/gcc.dg/graphite/pr43306.c
new file mode 100644
index 00000000000..43195e48916
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43306.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O1 -fstrict-overflow -fgraphite-identity" } */
+
+void foo(int x[])
+{
+ int i, j;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ x[i] = x[i*j];
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr43051-1.c b/gcc/testsuite/gcc.dg/guality/pr43051-1.c
new file mode 100644
index 00000000000..77325c97e26
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr43051-1.c
@@ -0,0 +1,57 @@
+/* PR debug/43051 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+extern void abort (void);
+
+static void __attribute__ ((noinline))
+foo (const char *x, long long y, int z)
+{
+ asm volatile ("" : : "r" (x), "r" ((int) y), "r" (z) : "memory");
+}
+
+struct S
+{
+ struct S *n;
+ int v;
+};
+
+struct S a[10];
+
+struct S * __attribute__ ((noinline))
+bar (struct S *c, int v, struct S *e)
+{
+#ifdef __i386__
+ register int si asm ("esi"), di asm ("edi"), bx
+# if !defined (__pic__) && !defined (__APPLE__)
+ asm ("ebx")
+# endif
+ ;
+ asm volatile ("" : "=r" (si), "=r" (di), "=r" (bx));
+#endif
+ while (c < e)
+ {
+ foo ("c", (__UINTPTR_TYPE__) c, 0); /* { dg-final { gdb-test 34 "c" "\&a\[0\]" } } */
+ foo ("v", v, 1); /* { dg-final { gdb-test 35 "v" "1" } } */
+ foo ("e", (__UINTPTR_TYPE__) e, 2); /* { dg-final { gdb-test 36 "e" "\&a\[1\]" } } */
+ if (c->v == v)
+ return c;
+ foo ("c", (__UINTPTR_TYPE__) c, 3); /* { dg-final { gdb-test 39 "c" "\&a\[0\]" } } */
+ foo ("v", v, 4); /* { dg-final { gdb-test 40 "v" "1" } } */
+ foo ("e", (__UINTPTR_TYPE__) e, 5); /* { dg-final { gdb-test 41 "e" "\&a\[1\]" } } */
+ c++;
+ }
+#ifdef __i386__
+ asm volatile ("" : : "r" (si), "r" (di), "r" (bx));
+#endif
+ return 0;
+}
+
+int
+main ()
+{
+ asm volatile ("" : : "r" (&a[0]) : "memory");
+ if (bar (&a[a[0].v], a[0].v + 1, &a[a[0].v + 1]))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr18809-1.c b/gcc/testsuite/gcc.dg/pr18809-1.c
index 27f2be9ef04..3b6e8cc1852 100644
--- a/gcc/testsuite/gcc.dg/pr18809-1.c
+++ b/gcc/testsuite/gcc.dg/pr18809-1.c
@@ -7,4 +7,4 @@ void foo(enum E e) {} /* { dg-error "forward ref" "forward" } */
/* { dg-warning "declared" "declared" { target *-*-* } 6 } */
/* { dg-warning "scope" "scope" { target *-*-* } 6 } */
/* { dg-error "incomplete" "incomplete" { target *-*-* } 6 } */
-void bar() { foo(0); } /* { dg-error "formal" } */
+void bar() { foo(0); }
diff --git a/gcc/testsuite/gcc.dg/pr36997.c b/gcc/testsuite/gcc.dg/pr36997.c
index 2bed93323c3..13461b8a134 100644
--- a/gcc/testsuite/gcc.dg/pr36997.c
+++ b/gcc/testsuite/gcc.dg/pr36997.c
@@ -5,5 +5,5 @@ typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
{
return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
- /* { dg-message "note: expected 'long long int __vector.1.' but argument is of type 'long long int'" "" { target *-*-* } 7 } */
+ /* { dg-message "note: expected '__vector.1. long long int' but argument is of type 'long long int'" "" { target *-*-* } 7 } */
}
diff --git a/gcc/testsuite/gcc.dg/pr42427.c b/gcc/testsuite/gcc.dg/pr42427.c
new file mode 100644
index 00000000000..1961313bc5f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42427.c
@@ -0,0 +1,21 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fpeel-loops" } */
+/* { dg-require-effective-target ilp32 } */
+
+#include <complex.h>
+
+extern double myabs (complex double);
+
+void
+test (double *help, complex double *wm, long nz)
+{
+ long k;
+ double znew;
+ double zold;
+ for (k = 0; k < nz; k++)
+ {
+ znew = myabs (wm[k]);
+ zold = help[k];
+ help[k] = znew;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr42917.c b/gcc/testsuite/gcc.dg/pr42917.c
new file mode 100644
index 00000000000..d8db32ea2da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42917.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-linear -fcompare-debug -fdump-tree-ltrans" } */
+
+extern int A[];
+
+void
+foo ()
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 255; j >= 0; j--)
+ A[j] = 0;
+}
+
+/* { dg-final { scan-tree-dump "Successfully transformed loop" "ltrans" } } */
+/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
new file mode 100644
index 00000000000..50d8a63bb8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -0,0 +1,20 @@
+/* PR debug/43058 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+extern void *f1 (void *, void *, void *);
+extern void *f2 (const char *, int, int, int, void *(*) ());
+extern void *f3 (const char *);
+extern void *f4 (void *s);
+extern void *f5 (void *);
+
+void test (void)
+{
+#define X1 f1 (f2 ("a", 1, 0, 0, f5), \
+ f4 (({ const char *a = "b"; f3 (a); })), \
+ ({ const char *a = "c"; f3 (a); }));
+#define X2 X1 X1 X1 X1 X1 X1 X1 X1 X1 X1
+#define X3 X2 X2 X2 X2 X2 X2 X2 X2 X2 X2
+#define X4 X3 X3 X3 X3 X3 X3 X3 X3 X3 X3
+ X4 X4
+}
diff --git a/gcc/testsuite/gcc.dg/pr43211.c b/gcc/testsuite/gcc.dg/pr43211.c
new file mode 100644
index 00000000000..1549619ed16
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43211.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct T;
+
+struct S {
+ void (*bar)(struct S);
+};
+
+void bar(struct T t) {} /* { dg-error "" } */
+
+void foo(struct S *s)
+{
+ s->bar = bar;
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr43300.c b/gcc/testsuite/gcc.dg/pr43300.c
new file mode 100644
index 00000000000..df71dbed789
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43300.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -w" } */
+typedef float V2SF __attribute__ ((vector_size (128)));
+
+V2SF
+foo (int x, V2SF a)
+{
+ V2SF b;
+ if (x & 42)
+ b = a;
+ else
+ b = a + (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f};
+ while (x--)
+ a += b;
+
+ return a;
+}
diff --git a/gcc/testsuite/gcc.dg/pr43305.c b/gcc/testsuite/gcc.dg/pr43305.c
new file mode 100644
index 00000000000..c8aeaf23ccc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43305.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -ffast-math" } */
+extern int ilogbl(long double);
+extern int printf(const char *format, ...);
+
+__attribute__((noinline, noclone))
+int foo(long double x)
+{
+ return ilogbl(x);
+}
+
+int main()
+{
+ printf("%d\n", foo(100));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr43317.c b/gcc/testsuite/gcc.dg/pr43317.c
new file mode 100644
index 00000000000..3ee3ed54931
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43317.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-type-escape -g" } */
+
+extern void *malloc(__SIZE_TYPE__);
+
+struct S {
+ int i;
+};
+
+int main(int argc, char *argv[])
+{
+ int i = argc;
+ struct S *p = malloc(sizeof (struct S));
+ return p[i].i;
+}
diff --git a/gcc/testsuite/gcc.dg/pr43379.c b/gcc/testsuite/gcc.dg/pr43379.c
new file mode 100644
index 00000000000..da4e6ba67ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43379.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -w" } */
+
+void *foo(int i, int *p)
+{
+lab:
+ if (p) *p = i;
+ goto *p;
+ return &&lab;
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr43402.c b/gcc/testsuite/gcc.dg/pr43402.c
new file mode 100644
index 00000000000..82234c74a85
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43402.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-inline" } */
+extern void abort (void);
+
+static int something;
+
+static int * converterData[2]={
+ &something, &something,
+};
+
+static struct {
+ const char *name;
+ int type;
+} const cnvNameType[] = {
+ { "bocu1", 1 },
+ { "utf7", 1 },
+ { "utf8", 1 }
+};
+
+
+const int * getAlgorithmicTypeFromName(const char *realName);
+const int *
+getAlgorithmicTypeFromName(const char *realName)
+{
+ unsigned mid, start, limit;
+ unsigned lastMid;
+ int result;
+ start = 0;
+ limit = sizeof(cnvNameType)/sizeof(cnvNameType[0]);
+ mid = limit;
+ lastMid = 0xffffffff;
+
+ for (;;) {
+ mid = (start + limit) / 2;
+ if (lastMid == mid) { /* Have we moved? */
+ break; /* We haven't moved, and it wasn't found. */
+ }
+ lastMid = mid;
+ result = __builtin_strcmp(realName, cnvNameType[mid].name);
+
+ if (result < 0) {
+ limit = mid;
+ } else if (result > 0) {
+ start = mid;
+ } else {
+ return converterData[cnvNameType[mid].type];
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ if (!getAlgorithmicTypeFromName ("utf8"))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr43419.c b/gcc/testsuite/gcc.dg/pr43419.c
new file mode 100644
index 00000000000..a4306f04855
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43419.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+/* { dg-add-options ieee } */
+#include <math.h>
+
+extern void abort (void);
+void __attribute__((noinline)) f (double x)
+{
+ double pluszero = pow (x, 0.5);
+ double minuszero = sqrt (x);
+ if (signbit (pluszero) == signbit (minuszero))
+ abort ();
+}
+
+int main(void)
+{
+ f (-0.0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr43360.c b/gcc/testsuite/gcc.dg/torture/pr43360.c
new file mode 100644
index 00000000000..9ed9872db26
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr43360.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+int l_5_5_2 = 4;
+int g_3[1][1];
+
+void func_1 (void)
+{
+ for (g_3[0][0] = 1; g_3[0][0] < 8; g_3[0][0] += 7) {
+ int *l_6 = &g_3[0][0];
+ *l_6 = l_5_5_2;
+ }
+}
+
+int main (void)
+{
+ func_1 ();
+ if (g_3[0][0] != 11)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/thumb-andsi.c b/gcc/testsuite/gcc.target/arm/thumb-andsi.c
new file mode 100644
index 00000000000..992d437c524
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb-andsi.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+unsigned get_least_bits(unsigned value)
+{
+ return value << 9 >> 9;
+}
+
+/* { dg-final { scan-assembler "lsl" } } */
+/* { dg-final { scan-assembler "lsr" } } */
diff --git a/gcc/testsuite/gcc.target/arm/thumb1-mul-moves.c b/gcc/testsuite/gcc.target/arm/thumb1-mul-moves.c
new file mode 100644
index 00000000000..6235774fe24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb1-mul-moves.c
@@ -0,0 +1,11 @@
+/* Check for unnecessary register moves. */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+
+int f(int x)
+{
+ return x*42;
+}
+
+/* { dg-final { scan-assembler-not "mov\[\\t \]*r0," } } */
+
diff --git a/gcc/testsuite/gcc.target/i386/push-1.c b/gcc/testsuite/gcc.target/i386/push-1.c
index da9b39ec9b5..09464bf9229 100644
--- a/gcc/testsuite/gcc.target/i386/push-1.c
+++ b/gcc/testsuite/gcc.target/i386/push-1.c
@@ -12,4 +12,4 @@ bar (void)
foo (x, x, x, x, 5);
}
-/* { dg-final { scan-assembler-not "movups" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "movups" { xfail { ! *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
index 8ec39b45a86..5f39d86362a 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */
/* { dg-options "-O2 -fno-common -G 8 -meabi -msdata=eabi" } */
+/* { dg-require-effective-target nonpic } */
/* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */
/* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata2," } } */
/* { dg-final { scan-assembler "sdat@sda21\\((13|0)\\)" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
index 9b577df520a..f102b1d1fe5 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */
/* { dg-options "-O2 -fno-common -G 8 -msdata=sysv" } */
+/* { dg-require-effective-target nonpic } */
/* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */
/* { dg-final { scan-assembler-not "\\.section\[ \t\]\\.sdata2," } } */
/* { dg-final { scan-assembler "sdat@sdarel\\(13\\)" } } */
diff --git a/gcc/testsuite/gfortran.dg/assign-debug.f90 b/gcc/testsuite/gfortran.dg/assign-debug.f90
new file mode 100644
index 00000000000..bd441211242
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/assign-debug.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! { dg-options "-fcompare-debug -O2" }
+ program test
+ integer i
+ common i
+ assign 2000 to i ! { dg-warning "Deleted feature: ASSIGN statement" }
+2000 continue
+ end
diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_1.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_1.f90
index b23a300feac..87ace6848bd 100644
--- a/gcc/testsuite/gfortran.dg/cray_pointers_1.f90
+++ b/gcc/testsuite/gfortran.dg/cray_pointers_1.f90
@@ -21,7 +21,7 @@ subroutine err3
real array(*)
pointer (ipt, array)
ipt = loc (target)
- array = 0 ! { dg-error "Vector assignment" }
+ array = 0 ! { dg-error "upper bound in the last dimension" }
end subroutine err3
subroutine err4
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f b/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f
new file mode 100644
index 00000000000..e614f912bdd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f
@@ -0,0 +1,18 @@
+ SUBROUTINE POFUN2(DIM,GRDENT,FPART,FPARTL)
+ DOUBLE PRECISION GRDENT(*)
+ DOUBLE COMPLEX FPART(*)
+ DOUBLE COMPLEX FPARTL(*)
+ INTEGER REFLCT,XRIREF
+ IF (DIM.GT.1) THEN
+ ABCS3=XRCELL(1)
+ IF (ABCS2.EQ.ABCS3) THEN
+ END IF
+ ELSE
+ DO REFLCT=1,XRIREF,1
+ FPARTL(REFLCT)=FPART(REFLCT)
+ END DO
+ END IF
+ IF (ABCS2.EQ.ABCS3) THEN
+ GRDENT(1)=GRDENT(3)
+ END IF
+ END
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr43349.f b/gcc/testsuite/gfortran.dg/graphite/pr43349.f
new file mode 100644
index 00000000000..86e408f9b80
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr43349.f
@@ -0,0 +1,35 @@
+! { dg-options "-O2 -floop-interchange" }
+
+ SUBROUTINE BUG(A,B,X,Y,Z,N)
+ IMPLICIT NONE
+ DOUBLE PRECISION A(*),B(*),X(*),Y(*),Z(*)
+ INTEGER N,J,K
+ K = 0
+ DO J = 1,N
+ K = K+1
+ X(K) = B(J+N*7)
+ Y(K) = B(J+N*8)
+ Z(K) = B(J+N*2) + A(J+N*2)
+ K = K+1
+ X(K) = B(J+N*3) + A(J+N*3)
+ Y(K) = B(J+N*9) + A(J)
+ Z(K) = B(J+N*15)
+ K = K+1
+ X(K) = B(J+N*4) + A(J+N*4)
+ Y(K) = B(J+N*15)
+ Z(K) = B(J+N*10) + A(J)
+ K = K+1
+ X(K) = B(J+N*11) + A(J+N)
+ Y(K) = B(J+N*5) + A(J+N*5)
+ Z(K) = B(J+N*16)
+ K = K+1
+ X(K) = B(J+N*16)
+ Y(K) = B(J+N*6) + A(J+N*6)
+ Z(K) = B(J+N*12) + A(J+N)
+ K = K+1
+ X(K) = B(J+N*13) + A(J+N*2)
+ Y(K) = B(J+N*17)
+ Z(K) = B(J+N*7) + A(J+N*7)
+ ENDDO
+ RETURN
+ END
diff --git a/gcc/testsuite/gfortran.dg/impure_constructor_1.f90 b/gcc/testsuite/gfortran.dg/impure_constructor_1.f90
new file mode 100644
index 00000000000..6657213d78a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/impure_constructor_1.f90
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR fortran/43362
+!
+module m
+ implicit none
+ type t
+ integer, pointer :: a
+ end type t
+ type t2
+ type(t) :: b
+ end type t2
+ type t3
+ type(t), pointer :: b
+ end type t3
+contains
+ pure subroutine foo(x)
+ type(t), target, intent(in) :: x
+ type(t2) :: y
+ type(t3) :: z
+
+ ! The following gave an ICE but is valid:
+ y = t2(x) ! Note: F2003, C1272 (3) and (4) do not apply
+
+ ! Variant which is invalid as C1272 (3) applies
+ z = t3(x) ! { dg-error "Invalid expression in the derived type constructor" }
+ end subroutine foo
+end module m
+
+
diff --git a/gcc/testsuite/gfortran.dg/inquire_size.f90 b/gcc/testsuite/gfortran.dg/inquire_size.f90
new file mode 100644
index 00000000000..568c3d6a0f3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inquire_size.f90
@@ -0,0 +1,28 @@
+! { dg-do run }
+! PR43409 I/O: INQUIRE for SIZE does not work.
+integer :: i
+character(30) :: aname = "noname"
+logical :: is_named
+
+open(25, file="testfile", status="replace", access="stream", form="unformatted")
+do i=1,100
+ write(25) i, "abcdefghijklmnopqrstuvwxyz"
+enddo
+flush(25)
+
+inquire(unit=25, named=is_named, name=aname, size=i)
+if (.not.is_named) call abort
+if (aname /= "testfile") call abort
+if (i /= 3000) call abort
+
+inquire(file="testfile", size=i)
+if (.not.is_named) call abort
+if (aname /= "testfile") call abort
+if (i /= 3000) call abort
+
+close(25, status="delete")
+inquire(file="testfile", size=i)
+if (i /= -1) call abort
+end
+
+
diff --git a/gcc/testsuite/gfortran.dg/namelist_27.f90 b/gcc/testsuite/gfortran.dg/namelist_27.f90
index 35fe032a62c..06381b11634 100644
--- a/gcc/testsuite/gfortran.dg/namelist_27.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_27.f90
@@ -41,14 +41,14 @@ contains
character(len=*), intent(in) :: name
character(len=255) :: line
- integer :: ios, idx
+ integer :: ios, idx, k
logical :: first
first = .true.
status = 0
ios = 0
line = ""
- do
+ do k=1,10
read (unit,'(a)',iostat=ios) line
if (first) then
first = .false.
@@ -74,7 +74,7 @@ contains
subroutine read_report (unit, status)
integer :: unit, status
- integer :: iuse, ios
+ integer :: iuse, ios, k
!------------------
! Namelist 'REPORT'
!------------------
@@ -85,7 +85,7 @@ contains
! Loop to read namelist multiple times
!-------------------------------------
iuse = 0
- do
+ do k=1,5
!----------------------------------------
! Preset namelist variables with defaults
!----------------------------------------
diff --git a/gcc/testsuite/gfortran.dg/namelist_28.f90 b/gcc/testsuite/gfortran.dg/namelist_28.f90
index 53b1f0ff002..22bddf66239 100644
--- a/gcc/testsuite/gfortran.dg/namelist_28.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_28.f90
@@ -27,12 +27,12 @@ contains
character(len=*), intent(in) :: name
character(len=255) :: line
- integer :: ios, idx
+ integer :: ios, idx, k
logical :: first
first = .true.
status = 0
- do
+ do k=1,25
line = ""
read (unit,'(a)',iostat=ios) line
if (ios < 0) then
@@ -51,12 +51,13 @@ contains
return
end if
end do
+ if (k.gt.10) call abort
end subroutine position_nml
subroutine read_report (unit, status)
integer :: unit, status
- integer :: iuse, ios
+ integer :: iuse, ios, k
!------------------
! Namelist 'REPORT'
!------------------
@@ -66,7 +67,7 @@ contains
! Loop to read namelist multiple times
!-------------------------------------
iuse = 0
- do
+ do k=1,25
!----------------------------------------
! Preset namelist variables with defaults
!----------------------------------------
@@ -84,6 +85,7 @@ contains
if (ios /= 0) exit
iuse = iuse + 1
end do
+ if (k.gt.10) call abort
status = ios
end subroutine read_report
diff --git a/gcc/testsuite/gfortran.dg/pr43475.f90 b/gcc/testsuite/gfortran.dg/pr43475.f90
new file mode 100644
index 00000000000..72c0d18348b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr43475.f90
@@ -0,0 +1,14 @@
+! PR middle-end/43475
+! { dg-do compile }
+! { dg-options "-O2" }
+subroutine ss(w)
+ implicit none
+ integer :: w(:)
+ integer :: b,c,d
+ b = w(8)
+ c = 5
+ d = 3
+ call s1(c)
+ call s2(b+c)
+ call s3(w(b))
+end subroutine ss
diff --git a/gcc/testsuite/gfortran.dg/read_empty_file.f b/gcc/testsuite/gfortran.dg/read_empty_file.f
new file mode 100644
index 00000000000..d4077481bda
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_empty_file.f
@@ -0,0 +1,7 @@
+! { dg-do run }
+! PR43320 Missing EOF on read from empty file.
+ open(8,status='scratch',form='formatted') ! Create empty file
+ read(8,'(a80)', end=123) ! Reading from an empty file should be an EOF
+ call abort
+123 continue
+ end
diff --git a/gcc/testsuite/gfortran.dg/read_eof_all.f90 b/gcc/testsuite/gfortran.dg/read_eof_all.f90
new file mode 100644
index 00000000000..db6def48716
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_eof_all.f90
@@ -0,0 +1,71 @@
+! { dg-do run }
+! PR43265 Followup patch for miscellaneous EOF conditions.
+! Eaxamples from Tobius Burnus
+ use iso_fortran_env
+ character(len=2) :: str, str2(2)
+ integer :: a, b, c, ios
+ str = ''
+ str2 = ''
+
+ open(99,file='test.dat',access='stream',form='unformatted', status='replace')
+ write(99) ' '
+ close(99)
+
+ open(99,file='test.dat')
+ read(99, '(T7,i2)') i
+ close(99, status="delete")
+ if (i /= 0) call abort
+
+ read(str(1:0), '(T7,i1)') i
+ if (i /= 0) call abort
+
+ read(str,'(i2,/,i2)',end=111) a, b
+ call abort !stop 'ERROR: Expected EOF error (1)'
+ 111 continue
+
+ read(str2,'(i2,/,i2)',end=112) a, b
+
+ read(str2,'(i2,/,i2,/,i2)',end=113) a, b, c
+ call abort !stop 'ERROR: Expected EOF error (2)'
+
+ 112 call abort !stop 'ERROR: Unexpected EOF (3)'
+
+ 113 continue
+ read(str,'(i2,/,i2)',end=121,pad='no') a, b
+ call abort !stop 'ERROR: Expected EOF error (1)'
+ 121 continue
+
+ read(str2(:),'(i2,/,i2)', end=122, pad='no') a, b
+ goto 125
+ 122 call abort !stop 'ERROR: Expected no EOF error (2)'
+ 125 continue
+
+ read(str2(:),'(i2,/,i2,/,i2)',end=123,pad='no') a, b, c
+ call abort !stop 'ERROR: Expected EOF error (3)'
+ 123 continue
+
+ read(str(2:1),'(i2,/,i2)',end=131, pad='no') a, b
+ call abort !stop 'ERROR: Expected EOF error (1)'
+ 131 continue
+
+ read(str2(:)(2:1),'(i2,/,i2)',end=132, pad='no') a, b
+ call abort !stop 'ERROR: Expected EOF error (2)'
+ 132 continue
+
+ read(str2(:)(2:1),'(i2,/,i2,/,i2)',end=133,pad='no') a, b, c
+ call abort !stop 'ERROR: Expected EOF error (3)'
+ 133 continue
+
+ read(str(2:1),'(i2,/,i2)',iostat=ios, pad='no') a, b
+ if (ios /= IOSTAT_END) call abort !stop 'ERROR: expected iostat /= 0 (1)'
+
+ read(str2(:)(2:1),'(i2,/,i2)',iostat=ios, pad='no') a, b
+ if (ios /= IOSTAT_END) call abort !stop 'ERROR: expected iostat /= 0 (2)'
+
+ read(str2(:)(2:1),'(i2,/,i2,/,i2)',iostat=ios,pad='no') a, b, c
+ if (ios /= IOSTAT_END) call abort !stop 'ERROR: expected iostat /= 0 (2)'
+
+ ! print *, "success"
+ end
+
+
diff --git a/gcc/testsuite/gfortran.dg/whole_file_15.f90 b/gcc/testsuite/gfortran.dg/whole_file_15.f90
new file mode 100644
index 00000000000..08d6120445b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_15.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+! { dg-options "-fwhole-file" }
+! Test the fix for PR43450 in which the use of 'replica_env_type'
+! caused an ICE in ep_types
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+MODULE replica_types
+ TYPE replica_env_type
+ END TYPE replica_env_type
+CONTAINS
+ SUBROUTINE rep_env_create(rep_env, para_env, input, nrep, prep,&
+ sync_v,keep_wf_history,row_force)
+ END SUBROUTINE rep_env_create
+ SUBROUTINE rep_envs_add_rep_env(rep_env)
+ TYPE(replica_env_type), POINTER :: rep_env
+ END SUBROUTINE rep_envs_add_rep_env
+END MODULE replica_types
+MODULE ep_types
+ USE replica_types
+ TYPE ep_env_type
+ TYPE(replica_env_type), POINTER :: mol_envs
+ END TYPE ep_env_type
+ TYPE ep_env_p_type
+ TYPE(ep_env_type), POINTER :: ep_env
+ END TYPE ep_env_p_type
+ TYPE(ep_env_p_type), DIMENSION(:), POINTER :: ep_envs
+CONTAINS
+ SUBROUTINE ep_force_release()
+ END SUBROUTINE ep_force_release
+END MODULE ep_types
+! { dg-final { cleanup-modules "replica_types ep_types" } }
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90
new file mode 100644
index 00000000000..b54eef99f24
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90
@@ -0,0 +1,9 @@
+ logical :: l1(4)
+ logical :: l2(4)
+ l1 = (/.TRUE.,.FALSE.,.TRUE.,.FALSE./)
+ l2 = (/.FALSE.,.TRUE.,.FALSE.,.TRUE./)
+ if (dot_product (l1, l2)) call abort ()
+ l2 = .TRUE.
+ if (.not.dot_product (l1, l2)) call abort ()
+end
+
diff --git a/gcc/testsuite/gnat.dg/case_optimization2.adb b/gcc/testsuite/gnat.dg/case_optimization2.adb
new file mode 100644
index 00000000000..f548a848801
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/case_optimization2.adb
@@ -0,0 +1,14 @@
+-- PR ada/43106
+-- Testcase by Bill Neven <neven@hitt.nl>
+
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Case_Optimization_Pkg2; use Case_Optimization_Pkg2;
+
+procedure Case_Optimization2 is
+ Radar : Radar_T;
+begin
+ Radar.Sensor_Type := radcmb;
+ Initialize (Radar);
+end;
diff --git a/gcc/testsuite/gnat.dg/case_optimization_pkg2.adb b/gcc/testsuite/gnat.dg/case_optimization_pkg2.adb
new file mode 100644
index 00000000000..57f9224e5e7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/case_optimization_pkg2.adb
@@ -0,0 +1,23 @@
+package body Case_Optimization_Pkg2 is
+
+ procedure Initialize (Radar : in Radar_T) is
+ Antenna1 : Antenna_Type_T;
+ Antenna2 : Antenna_Type_T;
+ begin
+ case Radar.Sensor_Type is
+ when radpr | radssr =>
+ Antenna1 := Radar.Sensor_Type;
+ Antenna2 := Radar.Sensor_Type;
+ when radcmb =>
+ Antenna1 := radpr;
+ Antenna2 := radssr;
+ when others =>
+ Antenna1 := radpr;
+ Antenna2 := radssr;
+ end case;
+ if Antenna1 /= radpr or Antenna2 /= radssr then
+ raise Program_Error;
+ end if;
+ end Initialize;
+
+end Case_Optimization_Pkg2;
diff --git a/gcc/testsuite/gnat.dg/case_optimization_pkg2.ads b/gcc/testsuite/gnat.dg/case_optimization_pkg2.ads
new file mode 100644
index 00000000000..c41a05c2605
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/case_optimization_pkg2.ads
@@ -0,0 +1,23 @@
+package Case_Optimization_Pkg2 is
+
+ type Unsigned_64 is mod 2 ** 64;
+
+ type Associated_Report_T is (miss, radpr, radssr, radcmb);
+
+ -- sensor type : primary, secondary, co-rotating (combined)
+ subtype Sensor_Type_T is Associated_Report_T; -- range radpr .. radcmb;
+ subtype Antenna_Type_T is Sensor_Type_T range radpr .. radssr;
+
+ type Filtering_Level_T is (none, pr_in_clutter, ssr_plots, pr_plots);
+ type Filtering_Levels_T is array (Filtering_Level_T) of boolean;
+
+ type Radar_T is record
+ External_Sensor_ID : Unsigned_64;
+ Dual_Radar_Index : Integer;
+ Compatible_Filtering_Levels : Filtering_Levels_T;
+ Sensor_Type : Sensor_Type_T;
+ end record;
+
+ procedure Initialize (Radar : in Radar_T);
+
+end Case_Optimization_Pkg2;
diff --git a/gcc/testsuite/gnat.dg/socket1.adb b/gcc/testsuite/gnat.dg/socket1.adb
index f1adf7a1f2c..a6bdade304b 100644
--- a/gcc/testsuite/gnat.dg/socket1.adb
+++ b/gcc/testsuite/gnat.dg/socket1.adb
@@ -1,4 +1,4 @@
--- { dg-do run }
+-- { dg-do run { target { ! "*-*-solaris2*" } } }
with GNAT.Sockets; use GNAT.Sockets;
procedure socket1 is
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 33aa3fb6813..7b759e88d1e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1438,27 +1438,12 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
return false;
/* It must be possible to eliminate all phi nodes in B. If ssa form
- is not up-to-date, we cannot eliminate any phis; however, if only
- some symbols as whole are marked for renaming, this is not a problem,
- as phi nodes for those symbols are irrelevant in updating anyway. */
+ is not up-to-date and a name-mapping is registered, we cannot eliminate
+ any phis. Symbols marked for renaming are never a problem though. */
phis = phi_nodes (b);
- if (!gimple_seq_empty_p (phis))
- {
- gimple_stmt_iterator i;
-
- if (name_mappings_registered_p ())
- return false;
-
- for (i = gsi_start (phis); !gsi_end_p (i); gsi_next (&i))
- {
- gimple phi = gsi_stmt (i);
-
- if (!is_gimple_reg (gimple_phi_result (phi))
- && !may_propagate_copy (gimple_phi_result (phi),
- gimple_phi_arg_def (phi, 0)))
- return false;
- }
- }
+ if (!gimple_seq_empty_p (phis)
+ && name_mappings_registered_p ())
+ return false;
return true;
}
@@ -1632,6 +1617,9 @@ gimple_merge_blocks (basic_block a, basic_block b)
FOR_EACH_IMM_USE_STMT (stmt, iter, def)
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, use);
+
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (use) = 1;
}
else
replace_uses_by (def, use);
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index eae0c84cef5..326bf80ec9a 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -103,20 +103,28 @@ cleanup_control_expr_graph (basic_block bb, gimple_stmt_iterator gsi)
/* For conditions try harder and lookup single-argument
PHI nodes. Only do so from the same basic-block though
as other basic-blocks may be dead already. */
- if (TREE_CODE (lhs) == SSA_NAME)
+ if (TREE_CODE (lhs) == SSA_NAME
+ && !name_registered_for_update_p (lhs))
{
gimple def_stmt = SSA_NAME_DEF_STMT (lhs);
if (gimple_code (def_stmt) == GIMPLE_PHI
&& gimple_phi_num_args (def_stmt) == 1
- && gimple_bb (def_stmt) == gimple_bb (stmt))
+ && gimple_bb (def_stmt) == gimple_bb (stmt)
+ && (TREE_CODE (PHI_ARG_DEF (def_stmt, 0)) != SSA_NAME
+ || !name_registered_for_update_p (PHI_ARG_DEF (def_stmt,
+ 0))))
lhs = PHI_ARG_DEF (def_stmt, 0);
}
- if (TREE_CODE (rhs) == SSA_NAME)
+ if (TREE_CODE (rhs) == SSA_NAME
+ && !name_registered_for_update_p (rhs))
{
gimple def_stmt = SSA_NAME_DEF_STMT (rhs);
if (gimple_code (def_stmt) == GIMPLE_PHI
&& gimple_phi_num_args (def_stmt) == 1
- && gimple_bb (def_stmt) == gimple_bb (stmt))
+ && gimple_bb (def_stmt) == gimple_bb (stmt)
+ && (TREE_CODE (PHI_ARG_DEF (def_stmt, 0)) != SSA_NAME
+ || !name_registered_for_update_p (PHI_ARG_DEF (def_stmt,
+ 0))))
rhs = PHI_ARG_DEF (def_stmt, 0);
}
val = fold_binary_loc (loc, gimple_cond_code (stmt),
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index c945f93190e..929bbc08e02 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1529,14 +1529,12 @@ evolution_function_right_is_integer_cst (const_tree chrec)
return true;
case POLYNOMIAL_CHREC:
- if (!evolution_function_right_is_integer_cst (CHREC_RIGHT (chrec)))
- return false;
-
- if (TREE_CODE (CHREC_LEFT (chrec)) == POLYNOMIAL_CHREC
- && !evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)))
- return false;
+ return TREE_CODE (CHREC_RIGHT (chrec)) == INTEGER_CST
+ && (TREE_CODE (CHREC_LEFT (chrec)) != POLYNOMIAL_CHREC
+ || evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)));
- return true;
+ CASE_CONVERT:
+ return evolution_function_right_is_integer_cst (TREE_OPERAND (chrec, 0));
default:
return false;
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 5ae47f0c10f..a1aca981d6f 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -564,6 +564,7 @@ replace_goto_queue (struct leh_tf_state *tf)
if (tf->goto_queue_active == 0)
return;
replace_goto_queue_stmt_list (tf->top_p_seq, tf);
+ replace_goto_queue_stmt_list (eh_seq, tf);
}
/* Add a new record to the goto queue contained in TF. NEW_STMT is the
@@ -644,7 +645,6 @@ record_in_goto_queue_label (struct leh_tf_state *tf, treemple stmt, tree label)
labels. */
new_stmt = stmt;
record_in_goto_queue (tf, new_stmt, index, true);
-
}
/* For any GIMPLE_GOTO or GIMPLE_RETURN, decide whether it leaves a try_finally
@@ -1531,6 +1531,7 @@ lower_try_finally (struct leh_state *state, gimple tp)
struct leh_tf_state this_tf;
struct leh_state this_state;
int ndests;
+ gimple_seq old_eh_seq;
/* Process the try block. */
@@ -1547,6 +1548,9 @@ lower_try_finally (struct leh_state *state, gimple tp)
this_state.ehp_region = state->ehp_region;
this_state.tf = &this_tf;
+ old_eh_seq = eh_seq;
+ eh_seq = NULL;
+
lower_eh_constructs_1 (&this_state, gimple_try_eval(tp));
/* Determine if the try block is escaped through the bottom. */
@@ -1602,6 +1606,20 @@ lower_try_finally (struct leh_state *state, gimple tp)
if (this_tf.goto_queue_map)
pointer_map_destroy (this_tf.goto_queue_map);
+ /* If there was an old (aka outer) eh_seq, append the current eh_seq.
+ If there was no old eh_seq, then the append is trivially already done. */
+ if (old_eh_seq)
+ {
+ if (eh_seq == NULL)
+ eh_seq = old_eh_seq;
+ else
+ {
+ gimple_seq new_eh_seq = eh_seq;
+ eh_seq = old_eh_seq;
+ gimple_seq_add_seq(&eh_seq, new_eh_seq);
+ }
+ }
+
return this_tf.top_p_seq;
}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index f3c420475df..e0928b9fe03 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1650,6 +1650,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
bb->frequency,
copy_basic_block->frequency);
}
+ stmt = cgraph_redirect_edge_call_stmt_to_callee (edge);
}
break;
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 32aa464948b..ac1641fc8e8 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -140,10 +140,12 @@ set_location_for_edge (edge e)
}
}
-/* Emit insns to copy SRC into DEST converting SRC if necessary. */
+/* Emit insns to copy SRC into DEST converting SRC if necessary. As
+ SRC/DEST might be BLKmode memory locations SIZEEXP is a tree from
+ which we deduce the size to copy in that case. */
static inline rtx
-emit_partition_copy (rtx dest, rtx src, int unsignedsrcp)
+emit_partition_copy (rtx dest, rtx src, int unsignedsrcp, tree sizeexp)
{
rtx seq;
@@ -151,7 +153,13 @@ emit_partition_copy (rtx dest, rtx src, int unsignedsrcp)
if (GET_MODE (src) != VOIDmode && GET_MODE (src) != GET_MODE (dest))
src = convert_to_mode (GET_MODE (dest), src, unsignedsrcp);
- emit_move_insn (dest, src);
+ if (GET_MODE (src) == BLKmode)
+ {
+ gcc_assert (GET_MODE (dest) == BLKmode);
+ emit_block_move (dest, src, expr_size (sizeexp), BLOCK_OP_NORMAL);
+ }
+ else
+ emit_move_insn (dest, src);
seq = get_insns ();
end_sequence ();
@@ -164,6 +172,7 @@ emit_partition_copy (rtx dest, rtx src, int unsignedsrcp)
static void
insert_partition_copy_on_edge (edge e, int dest, int src, source_location locus)
{
+ tree var;
rtx seq;
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -183,10 +192,11 @@ insert_partition_copy_on_edge (edge e, int dest, int src, source_location locus)
if (locus)
set_curr_insn_source_location (locus);
+ var = partition_to_var (SA.map, src);
seq = emit_partition_copy (SA.partition_to_pseudo[dest],
SA.partition_to_pseudo[src],
- TYPE_UNSIGNED (TREE_TYPE (
- partition_to_var (SA.map, src))));
+ TYPE_UNSIGNED (TREE_TYPE (var)),
+ var);
insert_insn_on_edge (seq, e);
}
@@ -232,6 +242,11 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
x = expand_expr (src, NULL, src_mode, EXPAND_NORMAL);
x = convert_modes (dest_mode, src_mode, x, unsignedp);
}
+ else if (src_mode == BLKmode)
+ {
+ x = SA.partition_to_pseudo[dest];
+ store_expr (src, x, 0, false);
+ }
else
x = expand_expr (src, SA.partition_to_pseudo[dest],
dest_mode, EXPAND_NORMAL);
@@ -269,9 +284,13 @@ insert_rtx_to_part_on_edge (edge e, int dest, rtx src, int unsignedsrcp,
if (locus)
set_curr_insn_source_location (locus);
+ /* We give the destination as sizeexp in case src/dest are BLKmode
+ mems. Usually we give the source. As we result from SSA names
+ the left and right size should be the same (and no WITH_SIZE_EXPR
+ involved), so it doesn't matter. */
seq = emit_partition_copy (SA.partition_to_pseudo[dest],
- src,
- unsignedsrcp);
+ src, unsignedsrcp,
+ partition_to_var (SA.map, dest));
insert_insn_on_edge (seq, e);
}
@@ -282,6 +301,7 @@ insert_rtx_to_part_on_edge (edge e, int dest, rtx src, int unsignedsrcp,
static void
insert_part_to_rtx_on_edge (edge e, rtx dest, int src, source_location locus)
{
+ tree var;
rtx seq;
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -300,10 +320,11 @@ insert_part_to_rtx_on_edge (edge e, rtx dest, int src, source_location locus)
if (locus)
set_curr_insn_source_location (locus);
+ var = partition_to_var (SA.map, src);
seq = emit_partition_copy (dest,
SA.partition_to_pseudo[src],
- TYPE_UNSIGNED (TREE_TYPE (
- partition_to_var (SA.map, src))));
+ TYPE_UNSIGNED (TREE_TYPE (var)),
+ var);
insert_insn_on_edge (seq, e);
}
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index d32ef387d19..e1dd0d777e3 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1664,6 +1664,7 @@ create_access_replacement (struct access *access)
DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base);
DECL_ARTIFICIAL (repl) = 1;
+ DECL_IGNORED_P (repl) = DECL_IGNORED_P (access->base);
if (DECL_NAME (access->base)
&& !DECL_IGNORED_P (access->base)
@@ -1676,11 +1677,10 @@ create_access_replacement (struct access *access)
SET_DECL_DEBUG_EXPR (repl, access->expr);
DECL_DEBUG_EXPR_IS_FROM (repl) = 1;
- DECL_IGNORED_P (repl) = 0;
+ TREE_NO_WARNING (repl) = TREE_NO_WARNING (access->base);
}
-
- DECL_IGNORED_P (repl) = DECL_IGNORED_P (access->base);
- TREE_NO_WARNING (repl) = TREE_NO_WARNING (access->base);
+ else
+ TREE_NO_WARNING (repl) = 1;
if (dump_file)
{
@@ -4048,6 +4048,26 @@ convert_callers (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
return;
}
+/* Create an abstract origin declaration for OLD_DECL and make it an abstract
+ origin of the provided decl so that there are preserved parameters for debug
+ information. */
+
+static void
+create_abstract_origin (tree old_decl)
+{
+ if (!DECL_ABSTRACT_ORIGIN (old_decl))
+ {
+ tree new_decl = copy_node (old_decl);
+
+ DECL_ABSTRACT (new_decl) = 1;
+ SET_DECL_ASSEMBLER_NAME (new_decl, NULL_TREE);
+ SET_DECL_RTL (new_decl, NULL);
+ DECL_STRUCT_FUNCTION (new_decl) = NULL;
+ DECL_ARTIFICIAL (old_decl) = 1;
+ DECL_ABSTRACT_ORIGIN (old_decl) = new_decl;
+ }
+}
+
/* Perform all the modification required in IPA-SRA for NODE to have parameters
as given in ADJUSTMENTS. */
@@ -4059,6 +4079,7 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
ipa_modify_formal_parameters (alias->decl, adjustments, "ISRA");
/* current_function_decl must be handled last, after same_body aliases,
as following functions will use what it computed. */
+ create_abstract_origin (current_function_decl);
ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
scan_function (sra_ipa_modify_expr, sra_ipa_modify_assign,
replace_removed_params_ssa_names, false, adjustments);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 684484fb0ca..ecade3dd795 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1471,32 +1471,18 @@ get_representative_for (const pre_expr e)
+static pre_expr
+phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
+ basic_block pred, basic_block phiblock);
/* Translate EXPR using phis in PHIBLOCK, so that it has the values of
the phis in PRED. Return NULL if we can't find a leader for each part
of the translated expression. */
static pre_expr
-phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
- basic_block pred, basic_block phiblock)
+phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
+ basic_block pred, basic_block phiblock)
{
- pre_expr oldexpr = expr;
- pre_expr phitrans;
-
- if (!expr)
- return NULL;
-
- /* Constants contain no values that need translation. */
- if (expr->kind == CONSTANT)
- return expr;
-
- if (value_id_constant_p (get_expr_value_id (expr)))
- return expr;
-
- phitrans = phi_trans_lookup (expr, pred);
- if (phitrans)
- return phitrans;
-
switch (expr->kind)
{
case NARY:
@@ -1584,7 +1570,6 @@ phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
}
add_to_value (new_val_id, expr);
}
- phi_trans_add (oldexpr, expr, pred);
return expr;
}
break;
@@ -1765,7 +1750,6 @@ phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
add_to_value (new_val_id, expr);
}
VEC_free (vn_reference_op_s, heap, newoperands);
- phi_trans_add (oldexpr, expr, pred);
return expr;
}
break;
@@ -1811,6 +1795,44 @@ phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
}
}
+/* Wrapper around phi_translate_1 providing caching functionality. */
+
+static pre_expr
+phi_translate (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
+ basic_block pred, basic_block phiblock)
+{
+ pre_expr phitrans;
+
+ if (!expr)
+ return NULL;
+
+ /* Constants contain no values that need translation. */
+ if (expr->kind == CONSTANT)
+ return expr;
+
+ if (value_id_constant_p (get_expr_value_id (expr)))
+ return expr;
+
+ if (expr->kind != NAME)
+ {
+ phitrans = phi_trans_lookup (expr, pred);
+ if (phitrans)
+ return phitrans;
+ }
+
+ /* Translate. */
+ phitrans = phi_translate_1 (expr, set1, set2, pred, phiblock);
+
+ /* Don't add empty translations to the cache. Neither add
+ translations of NAMEs as those are cheap to translate. */
+ if (phitrans
+ && expr->kind != NAME)
+ phi_trans_add (expr, phitrans, pred);
+
+ return phitrans;
+}
+
+
/* For each expression in SET, translate the values through phi nodes
in PHIBLOCK using edge PHIBLOCK->PRED, and store the resulting
expressions in DEST. */
@@ -1834,13 +1856,9 @@ phi_translate_set (bitmap_set_t dest, bitmap_set_t set, basic_block pred,
{
pre_expr translated;
translated = phi_translate (expr, set, NULL, pred, phiblock);
-
- /* Don't add empty translations to the cache */
if (!translated)
continue;
- phi_trans_add (expr, translated, pred);
-
/* We might end up with multiple expressions from SET being
translated to the same value. In this case we do not want
to retain the NARY or REFERENCE expression but prefer a NAME
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index ce604b3dea6..4bce61afd97 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -4417,6 +4417,14 @@ get_vectype_for_scalar_type (tree scalar_type)
if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
return NULL_TREE;
+ /* If we'd build a vector type of elements whose mode precision doesn't
+ match their types precision we'll get mismatched types on vector
+ extracts via BIT_FIELD_REFs. This effectively means we disable
+ vectorization of bool and/or enum types in some languages. */
+ if (INTEGRAL_TYPE_P (scalar_type)
+ && GET_MODE_BITSIZE (inner_mode) != TYPE_PRECISION (scalar_type))
+ return NULL_TREE;
+
/* FORNOW: Only a single vector size per mode (UNITS_PER_SIMD_WORD)
is expected. */
nunits = UNITS_PER_SIMD_WORD (inner_mode) / nbytes;
diff --git a/gcc/tree.h b/gcc/tree.h
index 41b9afb734a..eff5caee578 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5136,6 +5136,7 @@ extern unsigned int update_alignment_for_field (record_layout_info, tree,
unsigned int);
/* varasm.c */
extern void make_decl_rtl (tree);
+extern rtx make_decl_rtl_for_debug (tree);
extern void make_decl_one_only (tree, tree);
extern int supports_one_only (void);
extern void resolve_unique_section (tree, int, int);
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 430e16830a8..cec6c3442df 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -113,6 +113,7 @@
#include "params.h"
#include "diagnostic.h"
#include "pointer-set.h"
+#include "recog.h"
/* var-tracking.c assumes that tree code with the same value as VALUE rtx code
has no chance to appear in REG_EXPR/MEM_EXPRs and isn't a decl.
@@ -405,9 +406,8 @@ static void stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *,
HOST_WIDE_INT *);
static void insn_stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *,
HOST_WIDE_INT *);
-static void bb_stack_adjust_offset (basic_block);
static bool vt_stack_adjustments (void);
-static rtx adjust_stack_reference (rtx, HOST_WIDE_INT);
+static rtx compute_cfa_pointer (HOST_WIDE_INT);
static hashval_t variable_htab_hash (const void *);
static int variable_htab_eq (const void *, const void *);
static void variable_htab_free (void *);
@@ -490,7 +490,7 @@ static void vt_emit_notes (void);
static bool vt_get_decl_and_offset (rtx, tree *, HOST_WIDE_INT *);
static void vt_add_function_parameters (void);
-static void vt_initialize (void);
+static bool vt_initialize (void);
static void vt_finalize (void);
/* Given a SET, calculate the amount of stack adjustment it contains
@@ -617,29 +617,6 @@ insn_stack_adjust_offset_pre_post (rtx insn, HOST_WIDE_INT *pre,
}
}
-/* Compute stack adjustment in basic block BB. */
-
-static void
-bb_stack_adjust_offset (basic_block bb)
-{
- HOST_WIDE_INT offset;
- unsigned int i;
- micro_operation *mo;
-
- offset = VTI (bb)->in.stack_adjust;
- for (i = 0; VEC_iterate (micro_operation, VTI (bb)->mos, i, mo); i++)
- {
- if (mo->type == MO_ADJUST)
- offset += mo->u.adjust;
- else if (mo->type != MO_CALL)
- {
- if (MEM_P (mo->u.loc))
- mo->u.loc = adjust_stack_reference (mo->u.loc, -offset);
- }
- }
- VTI (bb)->out.stack_adjust = offset;
-}
-
/* Compute stack adjustments for all blocks by traversing DFS tree.
Return true when the adjustments on all incoming edges are consistent.
Heavily borrowed from pre_and_rev_post_order_compute. */
@@ -652,6 +629,7 @@ vt_stack_adjustments (void)
/* Initialize entry block. */
VTI (ENTRY_BLOCK_PTR)->visited = true;
+ VTI (ENTRY_BLOCK_PTR)->in.stack_adjust = INCOMING_FRAME_SP_OFFSET;
VTI (ENTRY_BLOCK_PTR)->out.stack_adjust = INCOMING_FRAME_SP_OFFSET;
/* Allocate stack for back-tracking up CFG. */
@@ -675,9 +653,22 @@ vt_stack_adjustments (void)
/* Check if the edge destination has been visited yet. */
if (!VTI (dest)->visited)
{
+ rtx insn;
+ HOST_WIDE_INT pre, post, offset;
VTI (dest)->visited = true;
- VTI (dest)->in.stack_adjust = VTI (src)->out.stack_adjust;
- bb_stack_adjust_offset (dest);
+ VTI (dest)->in.stack_adjust = offset = VTI (src)->out.stack_adjust;
+
+ if (dest != EXIT_BLOCK_PTR)
+ for (insn = BB_HEAD (dest);
+ insn != NEXT_INSN (BB_END (dest));
+ insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ {
+ insn_stack_adjust_offset_pre_post (insn, &pre, &post);
+ offset += pre + post;
+ }
+
+ VTI (dest)->out.stack_adjust = offset;
if (EDGE_COUNT (dest->succs) > 0)
/* Since the DEST node has been visited for the first
@@ -706,13 +697,12 @@ vt_stack_adjustments (void)
return true;
}
-/* Adjust stack reference MEM by ADJUSTMENT bytes and make it relative
- to the argument pointer. Return the new rtx. */
+/* Compute a CFA-based value for the stack pointer. */
static rtx
-adjust_stack_reference (rtx mem, HOST_WIDE_INT adjustment)
+compute_cfa_pointer (HOST_WIDE_INT adjustment)
{
- rtx addr, cfa, tmp;
+ rtx cfa;
#ifdef FRAME_POINTER_CFA_OFFSET
adjustment -= FRAME_POINTER_CFA_OFFSET (current_function_decl);
@@ -722,12 +712,216 @@ adjust_stack_reference (rtx mem, HOST_WIDE_INT adjustment)
cfa = plus_constant (arg_pointer_rtx, adjustment);
#endif
- addr = replace_rtx (copy_rtx (XEXP (mem, 0)), stack_pointer_rtx, cfa);
- tmp = simplify_rtx (addr);
- if (tmp)
- addr = tmp;
+ return cfa;
+}
- return replace_equiv_address_nv (mem, addr);
+/* Adjustment for hard_frame_pointer_rtx to cfa base reg,
+ or -1 if the replacement shouldn't be done. */
+static HOST_WIDE_INT hard_frame_pointer_adjustment = -1;
+
+/* Data for adjust_mems callback. */
+
+struct adjust_mem_data
+{
+ bool store;
+ enum machine_mode mem_mode;
+ HOST_WIDE_INT stack_adjust;
+ rtx side_effects;
+};
+
+/* Helper function for adjusting used MEMs. */
+
+static rtx
+adjust_mems (rtx loc, const_rtx old_rtx, void *data)
+{
+ struct adjust_mem_data *amd = (struct adjust_mem_data *) data;
+ rtx mem, addr = loc, tem;
+ enum machine_mode mem_mode_save;
+ bool store_save;
+ switch (GET_CODE (loc))
+ {
+ case REG:
+ /* Don't do any sp or fp replacements outside of MEM addresses. */
+ if (amd->mem_mode == VOIDmode)
+ return loc;
+ if (loc == stack_pointer_rtx
+ && !frame_pointer_needed)
+ return compute_cfa_pointer (amd->stack_adjust);
+ else if (loc == hard_frame_pointer_rtx
+ && frame_pointer_needed
+ && hard_frame_pointer_adjustment != -1)
+ return compute_cfa_pointer (hard_frame_pointer_adjustment);
+ return loc;
+ case MEM:
+ mem = loc;
+ if (!amd->store)
+ {
+ mem = targetm.delegitimize_address (mem);
+ if (mem != loc && !MEM_P (mem))
+ return simplify_replace_fn_rtx (mem, old_rtx, adjust_mems, data);
+ }
+
+ addr = XEXP (mem, 0);
+ mem_mode_save = amd->mem_mode;
+ amd->mem_mode = GET_MODE (mem);
+ store_save = amd->store;
+ amd->store = false;
+ addr = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data);
+ amd->store = store_save;
+ amd->mem_mode = mem_mode_save;
+ if (mem == loc)
+ addr = targetm.delegitimize_address (addr);
+ if (addr != XEXP (mem, 0))
+ mem = replace_equiv_address_nv (mem, addr);
+ if (!amd->store)
+ mem = avoid_constant_pool_reference (mem);
+ return mem;
+ case PRE_INC:
+ case PRE_DEC:
+ addr = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0),
+ GEN_INT (GET_CODE (loc) == PRE_INC
+ ? GET_MODE_SIZE (amd->mem_mode)
+ : -GET_MODE_SIZE (amd->mem_mode)));
+ case POST_INC:
+ case POST_DEC:
+ if (addr == loc)
+ addr = XEXP (loc, 0);
+ gcc_assert (amd->mem_mode != VOIDmode && amd->mem_mode != BLKmode);
+ addr = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data);
+ tem = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0),
+ GEN_INT ((GET_CODE (loc) == PRE_INC
+ || GET_CODE (loc) == POST_INC)
+ ? GET_MODE_SIZE (amd->mem_mode)
+ : -GET_MODE_SIZE (amd->mem_mode)));
+ amd->side_effects = alloc_EXPR_LIST (0,
+ gen_rtx_SET (VOIDmode,
+ XEXP (loc, 0),
+ tem),
+ amd->side_effects);
+ return addr;
+ case PRE_MODIFY:
+ addr = XEXP (loc, 1);
+ case POST_MODIFY:
+ if (addr == loc)
+ addr = XEXP (loc, 0);
+ gcc_assert (amd->mem_mode != VOIDmode);
+ addr = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data);
+ amd->side_effects = alloc_EXPR_LIST (0,
+ gen_rtx_SET (VOIDmode,
+ XEXP (loc, 0),
+ XEXP (loc, 1)),
+ amd->side_effects);
+ return addr;
+ case SUBREG:
+ /* First try without delegitimization of whole MEMs and
+ avoid_constant_pool_reference, which is more likely to succeed. */
+ store_save = amd->store;
+ amd->store = true;
+ addr = simplify_replace_fn_rtx (SUBREG_REG (loc), old_rtx, adjust_mems,
+ data);
+ amd->store = store_save;
+ mem = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data);
+ if (mem == SUBREG_REG (loc))
+ return loc;
+ tem = simplify_gen_subreg (GET_MODE (loc), mem,
+ GET_MODE (SUBREG_REG (loc)),
+ SUBREG_BYTE (loc));
+ if (tem)
+ return tem;
+ tem = simplify_gen_subreg (GET_MODE (loc), addr,
+ GET_MODE (SUBREG_REG (loc)),
+ SUBREG_BYTE (loc));
+ if (tem)
+ return tem;
+ return gen_rtx_raw_SUBREG (GET_MODE (loc), addr, SUBREG_BYTE (loc));
+ default:
+ break;
+ }
+ return NULL_RTX;
+}
+
+/* Helper function for replacement of uses. */
+
+static void
+adjust_mem_uses (rtx *x, void *data)
+{
+ rtx new_x = simplify_replace_fn_rtx (*x, NULL_RTX, adjust_mems, data);
+ if (new_x != *x)
+ validate_change (NULL_RTX, x, new_x, true);
+}
+
+/* Helper function for replacement of stores. */
+
+static void
+adjust_mem_stores (rtx loc, const_rtx expr, void *data)
+{
+ if (MEM_P (loc))
+ {
+ rtx new_dest = simplify_replace_fn_rtx (SET_DEST (expr), NULL_RTX,
+ adjust_mems, data);
+ if (new_dest != SET_DEST (expr))
+ {
+ rtx xexpr = CONST_CAST_RTX (expr);
+ validate_change (NULL_RTX, &SET_DEST (xexpr), new_dest, true);
+ }
+ }
+}
+
+/* Simplify INSN. Remove all {PRE,POST}_{INC,DEC,MODIFY} rtxes,
+ replace them with their value in the insn and add the side-effects
+ as other sets to the insn. */
+
+static void
+adjust_insn (basic_block bb, rtx insn)
+{
+ struct adjust_mem_data amd;
+ rtx set;
+ amd.mem_mode = VOIDmode;
+ amd.stack_adjust = -VTI (bb)->out.stack_adjust;
+ amd.side_effects = NULL_RTX;
+
+ amd.store = true;
+ note_stores (PATTERN (insn), adjust_mem_stores, &amd);
+
+ amd.store = false;
+ note_uses (&PATTERN (insn), adjust_mem_uses, &amd);
+
+ /* For read-only MEMs containing some constant, prefer those
+ constants. */
+ set = single_set (insn);
+ if (set && MEM_P (SET_SRC (set)) && MEM_READONLY_P (SET_SRC (set)))
+ {
+ rtx note = find_reg_equal_equiv_note (insn);
+
+ if (note && CONSTANT_P (XEXP (note, 0)))
+ validate_change (NULL_RTX, &SET_SRC (set), XEXP (note, 0), true);
+ }
+
+ if (amd.side_effects)
+ {
+ rtx *pat, new_pat, s;
+ int i, oldn, newn;
+
+ pat = &PATTERN (insn);
+ if (GET_CODE (*pat) == COND_EXEC)
+ pat = &COND_EXEC_CODE (*pat);
+ if (GET_CODE (*pat) == PARALLEL)
+ oldn = XVECLEN (*pat, 0);
+ else
+ oldn = 1;
+ for (s = amd.side_effects, newn = 0; s; newn++)
+ s = XEXP (s, 1);
+ new_pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (oldn + newn));
+ if (GET_CODE (*pat) == PARALLEL)
+ for (i = 0; i < oldn; i++)
+ XVECEXP (new_pat, 0, i) = XVECEXP (*pat, 0, i);
+ else
+ XVECEXP (new_pat, 0, 0) = *pat;
+ for (s = amd.side_effects, i = oldn; i < oldn + newn; i++, s = XEXP (s, 1))
+ XVECEXP (new_pat, 0, i) = XEXP (s, 0);
+ free_EXPR_LIST_list (&amd.side_effects);
+ validate_change (NULL_RTX, pat, new_pat, true);
+ }
}
/* Return true if a decl_or_value DV is a DECL or NULL. */
@@ -2597,15 +2791,23 @@ add_value_chains (decl_or_value dv, rtx loc)
}
/* If CSELIB_VAL_PTR of value DV refer to VALUEs, add backlinks from those
- VALUEs to DV. */
+ VALUEs to DV. Add the same time get rid of ASM_OPERANDS from locs list,
+ that is something we never can express in .debug_info and can prevent
+ reverse ops from being used. */
static void
add_cselib_value_chains (decl_or_value dv)
{
- struct elt_loc_list *l;
+ struct elt_loc_list **l;
- for (l = CSELIB_VAL_PTR (dv_as_value (dv))->locs; l; l = l->next)
- for_each_rtx (&l->loc, add_value_chain, dv_as_opaque (dv));
+ for (l = &CSELIB_VAL_PTR (dv_as_value (dv))->locs; *l;)
+ if (GET_CODE ((*l)->loc) == ASM_OPERANDS)
+ *l = (*l)->next;
+ else
+ {
+ for_each_rtx (&(*l)->loc, add_value_chain, dv_as_opaque (dv));
+ l = &(*l)->next;
+ }
}
/* If decl or value DVP refers to VALUE from *LOC, remove backlinks
@@ -2974,6 +3176,67 @@ canonicalize_values_star (void **slot, void *data)
return 1;
}
+/* Bind one-part variables to the canonical value in an equivalence
+ set. Not doing this causes dataflow convergence failure in rare
+ circumstances, see PR42873. Unfortunately we can't do this
+ efficiently as part of canonicalize_values_star, since we may not
+ have determined or even seen the canonical value of a set when we
+ get to a variable that references another member of the set. */
+
+static int
+canonicalize_vars_star (void **slot, void *data)
+{
+ dataflow_set *set = (dataflow_set *)data;
+ variable var = (variable) *slot;
+ decl_or_value dv = var->dv;
+ location_chain node;
+ rtx cval;
+ decl_or_value cdv;
+ void **cslot;
+ variable cvar;
+ location_chain cnode;
+
+ if (!dv_onepart_p (dv) || dv_is_value_p (dv))
+ return 1;
+
+ gcc_assert (var->n_var_parts == 1);
+
+ node = var->var_part[0].loc_chain;
+
+ if (GET_CODE (node->loc) != VALUE)
+ return 1;
+
+ gcc_assert (!node->next);
+ cval = node->loc;
+
+ /* Push values to the canonical one. */
+ cdv = dv_from_value (cval);
+ cslot = shared_hash_find_slot_noinsert (set->vars, cdv);
+ if (!cslot)
+ return 1;
+ cvar = (variable)*cslot;
+ gcc_assert (cvar->n_var_parts == 1);
+
+ cnode = cvar->var_part[0].loc_chain;
+
+ /* CVAL is canonical if its value list contains non-VALUEs or VALUEs
+ that are not “more canonical†than it. */
+ if (GET_CODE (cnode->loc) != VALUE
+ || !canon_value_cmp (cnode->loc, cval))
+ return 1;
+
+ /* CVAL was found to be non-canonical. Change the variable to point
+ to the canonical VALUE. */
+ gcc_assert (!cnode->next);
+ cval = cnode->loc;
+
+ slot = set_slot_part (set, cval, slot, dv, 0,
+ node->init, node->set_src);
+ slot = clobber_slot_part (set, cval, slot, 0, node->set_src);
+
+ return 1;
+}
+
/* Combine variable or value in *S1SLOT (in DSM->cur) with the
corresponding entry in DSM->src. Multi-part variables are combined
with variable_union, whereas onepart dvs are combined with
@@ -3636,6 +3899,7 @@ dataflow_post_merge_adjust (dataflow_set *set, dataflow_set **permp)
htab_traverse (shared_hash_htab ((*permp)->vars),
variable_post_merge_perm_vals, &dfpm);
htab_traverse (shared_hash_htab (set->vars), canonicalize_values_star, set);
+ htab_traverse (shared_hash_htab (set->vars), canonicalize_vars_star, set);
}
/* Return a node whose loc is a MEM that refers to EXPR in the
@@ -4326,6 +4590,10 @@ var_lowpart (enum machine_mode mode, rtx loc)
return gen_rtx_REG_offset (loc, mode, regno, offset);
}
+/* arg_pointer_rtx resp. frame_pointer_rtx if stack_pointer_rtx or
+ hard_frame_pointer_rtx is being mapped to it. */
+static rtx cfa_base_rtx;
+
/* Carry information about uses and stores while walking rtx. */
struct count_use_info
@@ -4371,6 +4639,17 @@ find_use_val (rtx x, enum machine_mode mode, struct count_use_info *cui)
return NULL;
}
+/* Helper function to get mode of MEM's address. */
+
+static inline enum machine_mode
+get_address_mode (rtx mem)
+{
+ enum machine_mode mode = GET_MODE (XEXP (mem, 0));
+ if (mode != VOIDmode)
+ return mode;
+ return targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem));
+}
+
/* Replace all registers and addresses in an expression with VALUE
expressions that map back to them, unless the expression is a
register. If no mapping is or can be performed, returns NULL. */
@@ -4382,9 +4661,8 @@ replace_expr_with_values (rtx loc)
return NULL;
else if (MEM_P (loc))
{
- enum machine_mode address_mode
- = targetm.addr_space.address_mode (MEM_ADDR_SPACE (loc));
- cselib_val *addr = cselib_lookup (XEXP (loc, 0), address_mode, 0);
+ cselib_val *addr = cselib_lookup (XEXP (loc, 0),
+ get_address_mode (loc), 0);
if (addr)
return replace_equiv_address_nv (loc, addr->val_rtx);
else
@@ -4409,12 +4687,15 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
if (track_expr_p (PAT_VAR_LOCATION_DECL (loc), false))
{
rtx ploc = PAT_VAR_LOCATION_LOC (loc);
- cselib_val *val = cselib_lookup (ploc, GET_MODE (loc), 1);
+ if (! VAR_LOC_UNKNOWN_P (ploc))
+ {
+ cselib_val *val = cselib_lookup (ploc, GET_MODE (loc), 1);
- /* ??? flag_float_store and volatile mems are never
- given values, but we could in theory use them for
- locations. */
- gcc_assert (val || 1);
+ /* ??? flag_float_store and volatile mems are never
+ given values, but we could in theory use them for
+ locations. */
+ gcc_assert (val || 1);
+ }
return MO_VAL_LOC;
}
else
@@ -4429,7 +4710,8 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
{
if (REG_P (loc)
|| (find_use_val (loc, GET_MODE (loc), cui)
- && cselib_lookup (XEXP (loc, 0), GET_MODE (loc), 0)))
+ && cselib_lookup (XEXP (loc, 0),
+ get_address_mode (loc), 0)))
return MO_VAL_SET;
}
else
@@ -4446,6 +4728,8 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
{
gcc_assert (REGNO (loc) < FIRST_PSEUDO_REGISTER);
+ if (loc == cfa_base_rtx)
+ return MO_CLOBBER;
expr = REG_EXPR (loc);
if (!expr)
@@ -4490,30 +4774,6 @@ log_op_type (rtx x, basic_block bb, rtx insn,
fputc ('\n', out);
}
-/* Adjust sets if needed. Currently this optimizes read-only MEM loads
- if REG_EQUAL/REG_EQUIV note is present. */
-
-static void
-adjust_sets (rtx insn, struct cselib_set *sets, int n_sets)
-{
- if (n_sets == 1 && MEM_P (sets[0].src) && MEM_READONLY_P (sets[0].src))
- {
- /* For read-only MEMs containing some constant, prefer those
- constants. */
- rtx note = find_reg_equal_equiv_note (insn), src;
-
- if (note && CONSTANT_P (XEXP (note, 0)))
- {
- sets[0].src = src = XEXP (note, 0);
- if (GET_CODE (PATTERN (insn)) == COND_EXEC)
- src = gen_rtx_IF_THEN_ELSE (GET_MODE (sets[0].dest),
- COND_EXEC_TEST (PATTERN (insn)),
- src, sets[0].dest);
- sets[0].src_elt = cselib_lookup (src, GET_MODE (sets[0].dest), 1);
- }
- }
-}
-
/* Tell whether the CONCAT used to holds a VALUE and its location
needs value resolution, i.e., an attempt of mapping the location
back to other incoming values. */
@@ -4548,6 +4808,33 @@ preserve_value (cselib_val *val)
VEC_safe_push (rtx, heap, preserved_values, val->val_rtx);
}
+/* Helper function for MO_VAL_LOC handling. Return non-zero if
+ any rtxes not suitable for CONST use not replaced by VALUEs
+ are discovered. */
+
+static int
+non_suitable_const (rtx *x, void *data ATTRIBUTE_UNUSED)
+{
+ if (*x == NULL_RTX)
+ return 0;
+
+ switch (GET_CODE (*x))
+ {
+ case REG:
+ case DEBUG_EXPR:
+ case PC:
+ case SCRATCH:
+ case CC0:
+ case ASM_INPUT:
+ case ASM_OPERANDS:
+ return 1;
+ case MEM:
+ return !MEM_READONLY_P (*x);
+ default:
+ return 0;
+ }
+}
+
/* Add uses (register and memory references) LOC which will be tracked
to VTI (bb)->mos. INSN is instruction which the LOC is part of. */
@@ -4577,11 +4864,14 @@ add_uses (rtx *ploc, void *data)
gcc_assert (cui->sets);
if (MEM_P (vloc)
- && !REG_P (XEXP (vloc, 0)) && !MEM_P (XEXP (vloc, 0)))
+ && !REG_P (XEXP (vloc, 0))
+ && !MEM_P (XEXP (vloc, 0))
+ && (GET_CODE (XEXP (vloc, 0)) != PLUS
+ || XEXP (XEXP (vloc, 0), 0) != cfa_base_rtx
+ || !CONST_INT_P (XEXP (XEXP (vloc, 0), 1))))
{
rtx mloc = vloc;
- enum machine_mode address_mode
- = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
+ enum machine_mode address_mode = get_address_mode (mloc);
cselib_val *val
= cselib_lookup (XEXP (mloc, 0), address_mode, 0);
@@ -4601,8 +4891,12 @@ add_uses (rtx *ploc, void *data)
}
}
- if (!VAR_LOC_UNKNOWN_P (vloc)
- && (val = find_use_val (vloc, GET_MODE (oloc), cui)))
+ if (CONSTANT_P (vloc)
+ && (GET_CODE (vloc) != CONST
+ || for_each_rtx (&vloc, non_suitable_const, NULL)))
+ /* For constants don't look up any value. */;
+ else if (!VAR_LOC_UNKNOWN_P (vloc)
+ && (val = find_use_val (vloc, GET_MODE (oloc), cui)))
{
enum machine_mode mode2;
enum micro_operation_type type2;
@@ -4646,11 +4940,14 @@ add_uses (rtx *ploc, void *data)
gcc_assert (cui->sets);
if (MEM_P (oloc)
- && !REG_P (XEXP (oloc, 0)) && !MEM_P (XEXP (oloc, 0)))
+ && !REG_P (XEXP (oloc, 0))
+ && !MEM_P (XEXP (oloc, 0))
+ && (GET_CODE (XEXP (oloc, 0)) != PLUS
+ || XEXP (XEXP (oloc, 0), 0) != cfa_base_rtx
+ || !CONST_INT_P (XEXP (XEXP (oloc, 0), 1))))
{
rtx mloc = oloc;
- enum machine_mode address_mode
- = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
+ enum machine_mode address_mode = get_address_mode (mloc);
cselib_val *val
= cselib_lookup (XEXP (mloc, 0), address_mode, 0);
@@ -4814,21 +5111,6 @@ reverse_op (rtx val, const_rtx expr)
return gen_rtx_CONCAT (GET_MODE (v->val_rtx), v->val_rtx, ret);
}
-/* Return SRC, or, if it is a read-only MEM for which adjust_sets
- replated it with a constant from REG_EQUIV/REG_EQUAL note,
- that constant. */
-
-static inline rtx
-get_adjusted_src (struct count_use_info *cui, rtx src)
-{
- if (cui->n_sets == 1
- && MEM_P (src)
- && MEM_READONLY_P (src)
- && CONSTANT_P (cui->sets[0].src))
- return cui->sets[0].src;
- return src;
-}
-
/* Add stores (register and memory references) LOC which will be tracked
to VTI (bb)->mos. EXPR is the RTL expression containing the store.
CUIP->insn is instruction which the LOC is part of. */
@@ -4854,6 +5136,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
if (REG_P (loc))
{
+ gcc_assert (loc != cfa_base_rtx);
if ((GET_CODE (expr) == CLOBBER && type != MO_VAL_SET)
|| !(track_p = use_type (loc, NULL, &mode2) == MO_USE)
|| GET_CODE (expr) == CLOBBER)
@@ -4864,10 +5147,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
else
{
if (GET_CODE (expr) == SET && SET_DEST (expr) == loc)
- {
- src = get_adjusted_src (cui, SET_SRC (expr));
- src = var_lowpart (mode2, src);
- }
+ src = var_lowpart (mode2, SET_SRC (expr));
loc = var_lowpart (mode2, loc);
if (src == NULL)
@@ -4877,10 +5157,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
}
else
{
- rtx xexpr = CONST_CAST_RTX (expr);
-
- if (SET_SRC (expr) != src)
- xexpr = gen_rtx_SET (VOIDmode, loc, src);
+ rtx xexpr = gen_rtx_SET (VOIDmode, loc, src);
if (same_variable_part_p (src, REG_EXPR (loc), REG_OFFSET (loc)))
mo.type = MO_COPY;
else
@@ -4895,12 +5172,16 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
|| cui->sets))
{
if (MEM_P (loc) && type == MO_VAL_SET
- && !REG_P (XEXP (loc, 0)) && !MEM_P (XEXP (loc, 0)))
+ && !REG_P (XEXP (loc, 0))
+ && !MEM_P (XEXP (loc, 0))
+ && (GET_CODE (XEXP (loc, 0)) != PLUS
+ || XEXP (XEXP (loc, 0), 0) != cfa_base_rtx
+ || !CONST_INT_P (XEXP (XEXP (loc, 0), 1))))
{
rtx mloc = loc;
- enum machine_mode address_mode
- = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mloc));
- cselib_val *val = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
+ enum machine_mode address_mode = get_address_mode (mloc);
+ cselib_val *val = cselib_lookup (XEXP (mloc, 0),
+ address_mode, 0);
if (val && !cselib_preserved_value_p (val))
{
@@ -4924,10 +5205,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
else
{
if (GET_CODE (expr) == SET && SET_DEST (expr) == loc)
- {
- src = get_adjusted_src (cui, SET_SRC (expr));
- src = var_lowpart (mode2, src);
- }
+ src = var_lowpart (mode2, SET_SRC (expr));
loc = var_lowpart (mode2, loc);
if (src == NULL)
@@ -4937,10 +5215,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
}
else
{
- rtx xexpr = CONST_CAST_RTX (expr);
-
- if (SET_SRC (expr) != src)
- xexpr = gen_rtx_SET (VOIDmode, loc, src);
+ rtx xexpr = gen_rtx_SET (VOIDmode, loc, src);
if (same_variable_part_p (SET_SRC (xexpr),
MEM_EXPR (loc),
INT_MEM_OFFSET (loc)))
@@ -4997,13 +5272,12 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
}
else if (resolve && GET_CODE (mo.u.loc) == SET)
{
- src = get_adjusted_src (cui, SET_SRC (expr));
- nloc = replace_expr_with_values (src);
+ nloc = replace_expr_with_values (SET_SRC (expr));
/* Avoid the mode mismatch between oexpr and expr. */
if (!nloc && mode != mode2)
{
- nloc = src;
+ nloc = SET_SRC (expr);
gcc_assert (oloc == SET_DEST (expr));
}
@@ -5102,8 +5376,6 @@ add_with_sets (rtx insn, struct cselib_set *sets, int n_sets)
cselib_hook_called = true;
- adjust_sets (insn, sets, n_sets);
-
cui.insn = insn;
cui.bb = bb;
cui.sets = sets;
@@ -5337,6 +5609,11 @@ compute_bb_dataflow (basic_block bb)
VAR_INIT_STATUS_INITIALIZED, NULL_RTX,
INSERT);
}
+ else if (!VAR_LOC_UNKNOWN_P (PAT_VAR_LOCATION_LOC (vloc)))
+ set_variable_part (out, PAT_VAR_LOCATION_LOC (vloc),
+ dv_from_decl (var), 0,
+ VAR_INIT_STATUS_INITIALIZED, NULL_RTX,
+ INSERT);
}
break;
@@ -6690,7 +6967,7 @@ emit_note_insn_var_location (void **varp, void *data)
complete = true;
last_limit = 0;
n_var_parts = 0;
- if (!MAY_HAVE_DEBUG_STMTS)
+ if (!MAY_HAVE_DEBUG_INSNS)
{
for (i = 0; i < var->n_var_parts; i++)
if (var->var_part[i].cur_loc == NULL && var->var_part[i].loc_chain)
@@ -6731,6 +7008,8 @@ emit_note_insn_var_location (void **varp, void *data)
}
loc[n_var_parts] = loc2;
mode = GET_MODE (var->var_part[i].cur_loc);
+ if (mode == VOIDmode && dv_onepart_p (var->dv))
+ mode = DECL_MODE (decl);
for (lc = var->var_part[i].loc_chain; lc; lc = lc->next)
if (var->var_part[i].cur_loc == lc->loc)
{
@@ -7252,6 +7531,11 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set)
VAR_INIT_STATUS_INITIALIZED, NULL_RTX,
INSERT);
}
+ else if (!VAR_LOC_UNKNOWN_P (PAT_VAR_LOCATION_LOC (vloc)))
+ set_variable_part (set, PAT_VAR_LOCATION_LOC (vloc),
+ dv_from_decl (var), 0,
+ VAR_INIT_STATUS_INITIALIZED, NULL_RTX,
+ INSERT);
emit_notes_for_changes (insn, EMIT_NOTE_AFTER_INSN, set->vars);
}
@@ -7688,19 +7972,115 @@ vt_add_function_parameters (void)
}
+/* Return true if INSN in the prologue initializes hard_frame_pointer_rtx. */
+
+static bool
+fp_setter (rtx insn)
+{
+ rtx pat = PATTERN (insn);
+ if (RTX_FRAME_RELATED_P (insn))
+ {
+ rtx expr = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
+ if (expr)
+ pat = XEXP (expr, 0);
+ }
+ if (GET_CODE (pat) == SET)
+ return SET_DEST (pat) == hard_frame_pointer_rtx;
+ else if (GET_CODE (pat) == PARALLEL)
+ {
+ int i;
+ for (i = XVECLEN (pat, 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (pat, 0, i)) == SET
+ && SET_DEST (XVECEXP (pat, 0, i)) == hard_frame_pointer_rtx)
+ return true;
+ }
+ return false;
+}
+
+/* Initialize cfa_base_rtx, create a preserved VALUE for it and
+ ensure it isn't flushed during cselib_reset_table.
+ Can be called only if frame_pointer_rtx resp. arg_pointer_rtx
+ has been eliminated. */
+
+static void
+vt_init_cfa_base (void)
+{
+ cselib_val *val;
+
+#ifdef FRAME_POINTER_CFA_OFFSET
+ cfa_base_rtx = frame_pointer_rtx;
+#else
+ cfa_base_rtx = arg_pointer_rtx;
+#endif
+ if (cfa_base_rtx == hard_frame_pointer_rtx
+ || !fixed_regs[REGNO (cfa_base_rtx)])
+ {
+ cfa_base_rtx = NULL_RTX;
+ return;
+ }
+ if (!MAY_HAVE_DEBUG_INSNS)
+ return;
+
+ val = cselib_lookup (cfa_base_rtx, GET_MODE (cfa_base_rtx), 1);
+ preserve_value (val);
+ cselib_preserve_cfa_base_value (val);
+ val->locs->setting_insn = get_insns ();
+ var_reg_decl_set (&VTI (ENTRY_BLOCK_PTR)->out, cfa_base_rtx,
+ VAR_INIT_STATUS_INITIALIZED, dv_from_value (val->val_rtx),
+ 0, NULL_RTX, INSERT);
+}
+
/* Allocate and initialize the data structures for variable tracking
and parse the RTL to get the micro operations. */
-static void
+static bool
vt_initialize (void)
{
- basic_block bb;
+ basic_block bb, prologue_bb = NULL;
+ HOST_WIDE_INT fp_cfa_offset = -1;
alloc_aux_for_blocks (sizeof (struct variable_tracking_info_def));
+ attrs_pool = create_alloc_pool ("attrs_def pool",
+ sizeof (struct attrs_def), 1024);
+ var_pool = create_alloc_pool ("variable_def pool",
+ sizeof (struct variable_def)
+ + (MAX_VAR_PARTS - 1)
+ * sizeof (((variable)NULL)->var_part[0]), 64);
+ loc_chain_pool = create_alloc_pool ("location_chain_def pool",
+ sizeof (struct location_chain_def),
+ 1024);
+ shared_hash_pool = create_alloc_pool ("shared_hash_def pool",
+ sizeof (struct shared_hash_def), 256);
+ empty_shared_hash = (shared_hash) pool_alloc (shared_hash_pool);
+ empty_shared_hash->refcount = 1;
+ empty_shared_hash->htab
+ = htab_create (1, variable_htab_hash, variable_htab_eq,
+ variable_htab_free);
+ changed_variables = htab_create (10, variable_htab_hash, variable_htab_eq,
+ variable_htab_free);
+ if (MAY_HAVE_DEBUG_INSNS)
+ {
+ value_chain_pool = create_alloc_pool ("value_chain_def pool",
+ sizeof (struct value_chain_def),
+ 1024);
+ value_chains = htab_create (32, value_chain_htab_hash,
+ value_chain_htab_eq, NULL);
+ }
+
+ /* Init the IN and OUT sets. */
+ FOR_ALL_BB (bb)
+ {
+ VTI (bb)->visited = false;
+ VTI (bb)->flooded = false;
+ dataflow_set_init (&VTI (bb)->in);
+ dataflow_set_init (&VTI (bb)->out);
+ VTI (bb)->permp = NULL;
+ }
+
if (MAY_HAVE_DEBUG_INSNS)
{
- cselib_init (true);
+ cselib_init (CSELIB_RECORD_MEMORY | CSELIB_PRESERVE_CONSTANTS);
scratch_regs = BITMAP_ALLOC (NULL);
valvar_pool = create_alloc_pool ("small variable_def pool",
sizeof (struct variable_def), 256);
@@ -7712,6 +8092,55 @@ vt_initialize (void)
valvar_pool = NULL;
}
+ if (!frame_pointer_needed)
+ {
+ rtx reg, elim;
+
+ if (!vt_stack_adjustments ())
+ return false;
+
+#ifdef FRAME_POINTER_CFA_OFFSET
+ reg = frame_pointer_rtx;
+#else
+ reg = arg_pointer_rtx;
+#endif
+ elim = eliminate_regs (reg, VOIDmode, NULL_RTX);
+ if (elim != reg)
+ {
+ if (GET_CODE (elim) == PLUS)
+ elim = XEXP (elim, 0);
+ if (elim == stack_pointer_rtx)
+ vt_init_cfa_base ();
+ }
+ }
+ else if (!crtl->stack_realign_tried)
+ {
+ rtx reg, elim;
+
+#ifdef FRAME_POINTER_CFA_OFFSET
+ reg = frame_pointer_rtx;
+ fp_cfa_offset = FRAME_POINTER_CFA_OFFSET (current_function_decl);
+#else
+ reg = arg_pointer_rtx;
+ fp_cfa_offset = ARG_POINTER_CFA_OFFSET (current_function_decl);
+#endif
+ elim = eliminate_regs (reg, VOIDmode, NULL_RTX);
+ if (elim != reg)
+ {
+ if (GET_CODE (elim) == PLUS)
+ {
+ fp_cfa_offset -= INTVAL (XEXP (elim, 1));
+ elim = XEXP (elim, 0);
+ }
+ if (elim != hard_frame_pointer_rtx)
+ fp_cfa_offset = -1;
+ else
+ prologue_bb = single_succ (ENTRY_BLOCK_PTR);
+ }
+ }
+
+ hard_frame_pointer_adjustment = -1;
+
FOR_EACH_BB (bb)
{
rtx insn;
@@ -7743,6 +8172,8 @@ vt_initialize (void)
/* Add the micro-operations to the vector. */
FOR_BB_BETWEEN (bb, first_bb, last_bb->next_bb, next_bb)
{
+ HOST_WIDE_INT offset = VTI (bb)->out.stack_adjust;
+ VTI (bb)->out.stack_adjust = VTI (bb)->in.stack_adjust;
for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
@@ -7757,16 +8188,17 @@ vt_initialize (void)
mo.type = MO_ADJUST;
mo.u.adjust = pre;
mo.insn = insn;
- VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
- &mo);
-
if (dump_file && (dump_flags & TDF_DETAILS))
log_op_type (PATTERN (insn), bb, insn,
MO_ADJUST, dump_file);
+ VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
+ &mo);
+ VTI (bb)->out.stack_adjust += pre;
}
}
cselib_hook_called = false;
+ adjust_insn (bb, insn);
if (MAY_HAVE_DEBUG_INSNS)
{
cselib_process_insn (insn);
@@ -7778,6 +8210,7 @@ vt_initialize (void)
}
if (!cselib_hook_called)
add_with_sets (insn, 0, 0);
+ cancel_changes (0);
if (!frame_pointer_needed && post)
{
@@ -7785,15 +8218,25 @@ vt_initialize (void)
mo.type = MO_ADJUST;
mo.u.adjust = post;
mo.insn = insn;
- VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
- &mo);
-
if (dump_file && (dump_flags & TDF_DETAILS))
log_op_type (PATTERN (insn), bb, insn,
MO_ADJUST, dump_file);
+ VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
+ &mo);
+ VTI (bb)->out.stack_adjust += post;
+ }
+
+ if (bb == prologue_bb
+ && hard_frame_pointer_adjustment == -1
+ && RTX_FRAME_RELATED_P (insn)
+ && fp_setter (insn))
+ {
+ vt_init_cfa_base ();
+ hard_frame_pointer_adjustment = fp_cfa_offset;
}
}
}
+ gcc_assert (offset == VTI (bb)->out.stack_adjust);
}
bb = last_bb;
@@ -7806,45 +8249,11 @@ vt_initialize (void)
}
}
- attrs_pool = create_alloc_pool ("attrs_def pool",
- sizeof (struct attrs_def), 1024);
- var_pool = create_alloc_pool ("variable_def pool",
- sizeof (struct variable_def)
- + (MAX_VAR_PARTS - 1)
- * sizeof (((variable)NULL)->var_part[0]), 64);
- loc_chain_pool = create_alloc_pool ("location_chain_def pool",
- sizeof (struct location_chain_def),
- 1024);
- shared_hash_pool = create_alloc_pool ("shared_hash_def pool",
- sizeof (struct shared_hash_def), 256);
- empty_shared_hash = (shared_hash) pool_alloc (shared_hash_pool);
- empty_shared_hash->refcount = 1;
- empty_shared_hash->htab
- = htab_create (1, variable_htab_hash, variable_htab_eq,
- variable_htab_free);
- changed_variables = htab_create (10, variable_htab_hash, variable_htab_eq,
- variable_htab_free);
- if (MAY_HAVE_DEBUG_INSNS)
- {
- value_chain_pool = create_alloc_pool ("value_chain_def pool",
- sizeof (struct value_chain_def),
- 1024);
- value_chains = htab_create (32, value_chain_htab_hash,
- value_chain_htab_eq, NULL);
- }
-
- /* Init the IN and OUT sets. */
- FOR_ALL_BB (bb)
- {
- VTI (bb)->visited = false;
- VTI (bb)->flooded = false;
- dataflow_set_init (&VTI (bb)->in);
- dataflow_set_init (&VTI (bb)->out);
- VTI (bb)->permp = NULL;
- }
-
+ hard_frame_pointer_adjustment = -1;
VTI (ENTRY_BLOCK_PTR)->flooded = true;
vt_add_function_parameters ();
+ cfa_base_rtx = NULL_RTX;
+ return true;
}
/* Get rid of all debug insns from the insn stream. */
@@ -7946,15 +8355,11 @@ variable_tracking_main_1 (void)
}
mark_dfs_back_edges ();
- vt_initialize ();
- if (!frame_pointer_needed)
+ if (!vt_initialize ())
{
- if (!vt_stack_adjustments ())
- {
- vt_finalize ();
- vt_debug_insns_local (true);
- return 0;
- }
+ vt_finalize ();
+ vt_debug_insns_local (true);
+ return 0;
}
success = vt_find_locations ();
@@ -7968,10 +8373,8 @@ variable_tracking_main_1 (void)
/* This is later restored by our caller. */
flag_var_tracking_assignments = 0;
- vt_initialize ();
-
- if (!frame_pointer_needed && !vt_stack_adjustments ())
- gcc_unreachable ();
+ success = vt_initialize ();
+ gcc_assert (success);
success = vt_find_locations ();
}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8a5e4f9606c..fe5e7994a99 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1476,6 +1476,42 @@ make_decl_rtl (tree decl)
if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
mudflap_enqueue_decl (decl);
}
+
+/* Like make_decl_rtl, but inhibit creation of new alias sets when
+ calling make_decl_rtl. Also, reset DECL_RTL before returning the
+ rtl. */
+
+rtx
+make_decl_rtl_for_debug (tree decl)
+{
+ unsigned int save_aliasing_flag, save_mudflap_flag;
+ rtx rtl;
+
+ if (DECL_RTL_SET_P (decl))
+ return DECL_RTL (decl);
+
+ /* Kludge alert! Somewhere down the call chain, make_decl_rtl will
+ call new_alias_set. If running with -fcompare-debug, sometimes
+ we do not want to create alias sets that will throw the alias
+ numbers off in the comparison dumps. So... clearing
+ flag_strict_aliasing will keep new_alias_set() from creating a
+ new set. It is undesirable to register decl with mudflap
+ in this case as well. */
+ save_aliasing_flag = flag_strict_aliasing;
+ flag_strict_aliasing = 0;
+ save_mudflap_flag = flag_mudflap;
+ flag_mudflap = 0;
+
+ rtl = DECL_RTL (decl);
+ /* Reset DECL_RTL back, as various parts of the compiler expects
+ DECL_RTL set meaning it is actually going to be output. */
+ SET_DECL_RTL (decl, NULL);
+
+ flag_strict_aliasing = save_aliasing_flag;
+ flag_mudflap = save_mudflap_flag;
+
+ return rtl;
+}
/* Output a string of literal assembler code
for an `asm' keyword used between functions. */
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 85e255d1d27..200f5252d03 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * libffi/src/x86/unix64.S (.eh_frame)
+ [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.
+
2010-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* doc/libffi.texi (The Closure API): Fix typo.
diff --git a/libffi/configure b/libffi/configure
index 43fc0ec6e42..5555e51289d 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -12419,6 +12419,29 @@ $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
;;
esac
+if test x$TARGET = xX86_64; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports unwind section type" >&5
+$as_echo_n "checking assembler supports unwind section type... " >&6; }
+if test "${libffi_cv_as_x86_64_unwind_section_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ libffi_cv_as_x86_64_unwind_section_type=yes
+ echo '.section .eh_frame,"a",@unwind' > conftest.s
+ if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+ libffi_cv_as_x86_64_unwind_section_type=no
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5
+$as_echo "$libffi_cv_as_x86_64_unwind_section_type" >&6; }
+ if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
+
+$as_echo "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h
+
+ fi
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
if test "${libffi_cv_ro_eh_frame+set}" = set; then :
diff --git a/libffi/configure.ac b/libffi/configure.ac
index c0e0da16507..1b484f94bde 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -284,6 +284,21 @@ case "$target" in
;;
esac
+if test x$TARGET = xX86_64; then
+ AC_CACHE_CHECK([assembler supports unwind section type],
+ libffi_cv_as_x86_64_unwind_section_type, [
+ libffi_cv_as_x86_64_unwind_section_type=yes
+ echo '.section .eh_frame,"a",@unwind' > conftest.s
+ if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+ libffi_cv_as_x86_64_unwind_section_type=no
+ fi
+ ])
+ if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
+ AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
+ [Define if your assembler supports unwind section type.])
+ fi
+fi
+
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
libffi_cv_ro_eh_frame, [
libffi_cv_ro_eh_frame=no
diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in
index e03bbf90b27..7231cc5ead3 100644
--- a/libffi/fficonfig.h.in
+++ b/libffi/fficonfig.h.in
@@ -43,6 +43,9 @@
*/
#undef HAVE_AS_SPARC_UA_PCREL
+/* Define if your assembler supports unwind section type. */
+#undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
+
/* Define if your assembler supports PC relative relocs. */
#undef HAVE_AS_X86_PCREL
diff --git a/libffi/src/x86/unix64.S b/libffi/src/x86/unix64.S
index fe3f4fd6223..7a6619a5486 100644
--- a/libffi/src/x86/unix64.S
+++ b/libffi/src/x86/unix64.S
@@ -324,7 +324,11 @@ ffi_closure_unix64:
.LUW9:
.size ffi_closure_unix64,.-ffi_closure_unix64
+#ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
+ .section .eh_frame,"a",@unwind
+#else
.section .eh_frame,"a",@progbits
+#endif
.Lframe1:
.long .LECIE1-.LSCIE1 /* CIE Length */
.LSCIE1:
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index ec9d8d2dc3c..db348ba349c 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/38085
+ * config/i386/t-sol2 ($(T)gmon.o): Use CFLAGS instead of
+ MULTILIB_CFLAGS.
+ ($(T)gcrt1.o): Likewise.
+ ($(T)crt1.o): Likewise.
+ ($(T)crti.o): Likewise.
+ ($(T)crtn.o): Likewise.
+
2010-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR other/42980
diff --git a/libgcc/config/i386/t-sol2 b/libgcc/config/i386/t-sol2
index 24b7c7c10f4..351d7fb90e7 100644
--- a/libgcc/config/i386/t-sol2
+++ b/libgcc/config/i386/t-sol2
@@ -1,6 +1,6 @@
# gmon build rule:
$(T)gmon.o: $(gcc_srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CFLAGS) \
-c $(gcc_srcdir)/config/i386/gmon-sol2.c -o $(T)gmon.o
# Assemble startup files.
@@ -9,16 +9,16 @@ $(T)gmon.o: $(gcc_srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H)
# the comments with sed. This bug may only be in the Early Access releases.
$(T)gcrt1.o: $(gcc_srcdir)/config/i386/sol2-gc1.asm $(GCC_PASSES)
sed -e '/^!/d' <$(gcc_srcdir)/config/i386/sol2-gc1.asm >gcrt1.s
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1.o gcrt1.s
+ $(GCC_FOR_TARGET) $(CFLAGS) -c -o $(T)gcrt1.o gcrt1.s
$(T)crt1.o: $(gcc_srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES)
sed -e '/^!/d' <$(gcc_srcdir)/config/i386/sol2-c1.asm >crt1.s
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o crt1.s
+ $(GCC_FOR_TARGET) $(CFLAGS) -c -o $(T)crt1.o crt1.s
$(T)crti.o: $(gcc_srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
sed -e '/^!/d' <$(gcc_srcdir)/config/i386/sol2-ci.asm >crti.s
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o crti.s
+ $(GCC_FOR_TARGET) $(CFLAGS) -c -o $(T)crti.o crti.s
$(T)crtn.o: $(gcc_srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
sed -e '/^!/d' <$(gcc_srcdir)/config/i386/sol2-cn.asm >crtn.s
- $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o crtn.s
+ $(GCC_FOR_TARGET) $(CFLAGS) -c -o $(T)crtn.o crtn.s
# We need to use -fPIC when we are using gcc to compile the routines in
# crtstuff.c. This is only really needed when we are going to use gcc/g++
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 8162fa0fcc8..d4d6b9f1703 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,38 @@
+2010-03-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/43409
+ * io/io.h: Fix type of size in st_parameter_inquire structure.
+
+2010-03-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/43409
+ * io/unix.h: Add prototype for new function to return file size.
+ * io/unix.c (file_size): New function.
+ * io/inquire.c (inquire_via_unit): Use new function.
+ (inquire_via_filename): Use new function.
+
+2010-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * io/transfer.c (read_sf_internal): Remove stray function declaration
+ used during debugging.
+
+2010-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/43265
+ * io/io.h: Delete prototype for read_sf, making it static.
+ * io/read.c (read_x): Modify to call hit_eof if PAD="no".
+ * io/transfer.c (read_sf_internal): New static function extracted from
+ read_sf for use on internal units only. Handle empty string case.
+ (read_sf): New factoring of this function, make it static. Add special
+ conditions for EOF based on ADVANCE="no", PAD="no", and whether any
+ bytes have been previously read from the record.
+ (read_block_form): Modify to call read_sf or read_sf_internal.
+ (next_record_r): Add a done flag similar to next_record_w. Call hit_eof
+ if internal array unit next record returns finished, meaning an EOF was
+ found and not done, ie not the last record expected. For external
+ units call hit_eof if item_count is 1 or there are no pending spaces.
+ (next_record): Update call to next_record_r.
+
2010-03-12 Kai Tietz <kai.tietz@onevision.com>
PR/42950
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index c36b9e5fa69..cd44c04251e 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -371,6 +371,14 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
cf_strcpy (iqp->round, iqp->round_len, p);
}
+
+ if ((cf2 & IOPARM_INQUIRE_HAS_SIZE) != 0)
+ {
+ if (u == NULL)
+ *iqp->size = -1;
+ else
+ *iqp->size = file_size (u->file, (gfc_charlen_type) u->file_len);
+ }
}
if ((cf & IOPARM_INQUIRE_HAS_POSITION) != 0)
@@ -601,6 +609,9 @@ inquire_via_filename (st_parameter_inquire *iqp)
if ((cf2 & IOPARM_INQUIRE_HAS_ENCODING) != 0)
cf_strcpy (iqp->encoding, iqp->encoding_len, undefined);
+
+ if ((cf2 & IOPARM_INQUIRE_HAS_SIZE) != 0)
+ *iqp->size = file_size (iqp->file, iqp->file_len);
}
if ((cf & IOPARM_INQUIRE_HAS_POSITION) != 0)
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 8f482e63191..a73d5d12882 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -331,7 +331,7 @@ typedef struct
CHARACTER2 (round);
CHARACTER1 (sign);
GFC_INTEGER_4 *pending;
- GFC_INTEGER_4 *size;
+ GFC_IO_INT *size;
GFC_INTEGER_4 *id;
}
st_parameter_inquire;
@@ -642,9 +642,6 @@ internal_proto(type_name);
extern void * read_block_form (st_parameter_dt *, int *);
internal_proto(read_block_form);
-extern char *read_sf (st_parameter_dt *, int *);
-internal_proto(read_sf);
-
extern void *write_block (st_parameter_dt *, int);
internal_proto(write_block);
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index a4c4a58b7bf..078c6e25fc8 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -1047,11 +1047,22 @@ read_x (st_parameter_dt *dtp, int n)
}
p = fbuf_read (dtp->u.p.current_unit, &length);
- if (p == NULL || (length == 0 && dtp->u.p.item_count == 1))
+ if (p == NULL)
{
hit_eof (dtp);
return;
}
+
+ if (length == 0 && dtp->u.p.item_count == 1)
+ {
+ if (dtp->u.p.current_unit->pad_status == PAD_NO)
+ {
+ hit_eof (dtp);
+ return;
+ }
+ else
+ return;
+ }
n = 0;
while (n < length)
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 958ef656b73..7f6750d2156 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -175,9 +175,7 @@ current_mode (st_parameter_dt *dtp)
}
-/* Mid level data transfer statements. These subroutines do reading
- and writing in the style of salloc_r()/salloc_w() within the
- current record. */
+/* Mid level data transfer statements. */
/* When reading sequential formatted records we have a problem. We
don't know how long the line is until we read the trailing newline,
@@ -190,13 +188,20 @@ current_mode (st_parameter_dt *dtp)
we hit the newline. For small allocations, we use a static buffer.
For larger allocations, we are forced to allocate memory on the
heap. Hopefully this won't happen very often. */
+
+/* Read sequential file - internal unit */
-char *
-read_sf (st_parameter_dt *dtp, int * length)
+static char *
+read_sf_internal (st_parameter_dt *dtp, int * length)
{
static char *empty_string[0];
- char *base, *p, q;
- int n, lorig, memread, seen_comma;
+ char *base;
+ int lorig;
+
+ /* Zero size array gives internal unit len of 0. Nothing to read. */
+ if (dtp->internal_unit_len == 0
+ && dtp->u.p.current_unit->pad_status == PAD_NO)
+ hit_eof (dtp);
/* If we have seen an eor previously, return a length of 0. The
caller is responsible for correctly padding the input field. */
@@ -208,17 +213,40 @@ read_sf (st_parameter_dt *dtp, int * length)
return (char*) empty_string;
}
- if (is_internal_unit (dtp))
+ lorig = *length;
+ base = mem_alloc_r (dtp->u.p.current_unit->s, length);
+ if (unlikely (lorig > *length))
{
- memread = *length;
- base = mem_alloc_r (dtp->u.p.current_unit->s, length);
- if (unlikely (memread > *length))
- {
- hit_eof (dtp);
- return NULL;
- }
- n = *length;
- goto done;
+ hit_eof (dtp);
+ return NULL;
+ }
+
+ dtp->u.p.current_unit->bytes_left -= *length;
+
+ if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0)
+ dtp->u.p.size_used += (GFC_IO_INT) *length;
+
+ return base;
+
+}
+
+/* Read sequential file - external unit */
+
+static char *
+read_sf (st_parameter_dt *dtp, int * length)
+{
+ static char *empty_string[0];
+ char *base, *p, q;
+ int n, lorig, seen_comma;
+
+ /* If we have seen an eor previously, return a length of 0. The
+ caller is responsible for correctly padding the input field. */
+ if (dtp->u.p.sf_seen_eor)
+ {
+ *length = 0;
+ /* Just return something that isn't a NULL pointer, otherwise the
+ caller thinks an error occured. */
+ return (char*) empty_string;
}
n = seen_comma = 0;
@@ -307,11 +335,14 @@ read_sf (st_parameter_dt *dtp, int * length)
else
dtp->u.p.at_eof = 1;
}
- else
- {
- hit_eof (dtp);
- return NULL;
- }
+ else if (dtp->u.p.advance_status == ADVANCE_NO
+ || dtp->u.p.current_unit->pad_status == PAD_NO
+ || dtp->u.p.current_unit->bytes_left
+ == dtp->u.p.current_unit->recl)
+ {
+ hit_eof (dtp);
+ return NULL;
+ }
}
done:
@@ -352,7 +383,8 @@ read_block_form (st_parameter_dt *dtp, int * nbytes)
dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;
else
{
- if (unlikely (dtp->u.p.current_unit->pad_status == PAD_NO))
+ if (unlikely (dtp->u.p.current_unit->pad_status == PAD_NO)
+ && !is_internal_unit (dtp))
{
/* Not enough data left. */
generate_error (&dtp->common, LIBERROR_EOR, NULL);
@@ -360,9 +392,10 @@ read_block_form (st_parameter_dt *dtp, int * nbytes)
}
}
- if (unlikely (dtp->u.p.current_unit->bytes_left == 0))
+ if (unlikely (dtp->u.p.current_unit->bytes_left == 0
+ && !is_internal_unit(dtp)))
{
- hit_eof (dtp);
+ hit_eof (dtp);
return NULL;
}
@@ -374,7 +407,11 @@ read_block_form (st_parameter_dt *dtp, int * nbytes)
(dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL ||
dtp->u.p.current_unit->flags.access == ACCESS_STREAM))
{
- source = read_sf (dtp, nbytes);
+ if (is_internal_unit (dtp))
+ source = read_sf_internal (dtp, nbytes);
+ else
+ source = read_sf (dtp, nbytes);
+
dtp->u.p.current_unit->strm_pos +=
(gfc_offset) (*nbytes + dtp->u.p.sf_seen_eor);
return source;
@@ -2731,7 +2768,7 @@ min_off (gfc_offset a, gfc_offset b)
/* Space to the next record for read mode. */
static void
-next_record_r (st_parameter_dt *dtp)
+next_record_r (st_parameter_dt *dtp, int done)
{
gfc_offset record;
int bytes_left;
@@ -2758,10 +2795,9 @@ next_record_r (st_parameter_dt *dtp)
case FORMATTED_SEQUENTIAL:
/* read_sf has already terminated input because of an '\n', or
we have hit EOF. */
- if (dtp->u.p.sf_seen_eor || dtp->u.p.at_eof)
+ if (dtp->u.p.sf_seen_eor)
{
dtp->u.p.sf_seen_eor = 0;
- dtp->u.p.at_eof = 0;
break;
}
@@ -2773,6 +2809,8 @@ next_record_r (st_parameter_dt *dtp)
record = next_array_record (dtp, dtp->u.p.current_unit->ls,
&finished);
+ if (!done && finished)
+ hit_eof (dtp);
/* Now seek to this record. */
record = record * dtp->u.p.current_unit->recl;
@@ -2810,7 +2848,8 @@ next_record_r (st_parameter_dt *dtp)
{
if (errno != 0)
generate_error (&dtp->common, LIBERROR_OS, NULL);
- else if (dtp->u.p.item_count == 1)
+ else if (dtp->u.p.item_count == 1
+ || dtp->u.p.pending_spaces == 0)
hit_eof (dtp);
break;
}
@@ -3151,7 +3190,7 @@ next_record (st_parameter_dt *dtp, int done)
dtp->u.p.current_unit->read_bad = 0;
if (dtp->u.p.mode == READING)
- next_record_r (dtp);
+ next_record_r (dtp, done);
else
next_record_w (dtp, done);
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index bd2b6594d52..4435674b46d 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1475,6 +1475,22 @@ file_exists (const char *file, gfc_charlen_type file_len)
}
+/* file_size()-- Returns the size of the file. */
+
+GFC_IO_INT
+file_size (const char *file, gfc_charlen_type file_len)
+{
+ char path[PATH_MAX + 1];
+ gfstat_t statbuf;
+
+ if (unpack_filename (path, file, file_len))
+ return -1;
+
+ if (stat (path, &statbuf) < 0)
+ return -1;
+
+ return (GFC_IO_INT) statbuf.st_size;
+}
static const char yes[] = "YES", no[] = "NO", unknown[] = "UNKNOWN";
diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h
index e691982e505..e567fdfe205 100644
--- a/libgfortran/io/unix.h
+++ b/libgfortran/io/unix.h
@@ -121,6 +121,9 @@ internal_proto(delete_file);
extern int file_exists (const char *file, gfc_charlen_type file_len);
internal_proto(file_exists);
+extern GFC_IO_INT file_size (const char *file, gfc_charlen_type file_len);
+internal_proto(file_size);
+
extern const char *inquire_sequential (const char *, int);
internal_proto(inquire_sequential);
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 420f354c51a..b9f4a8a883e 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/42942
+ * env.c (parse_unsigned_long): Add ALLOW_ZERO argument.
+ (initialize_env): Adjust callers.
+ (omp_set_max_active_levels): Set gomp_max_active_levels_var even
+ when the argument is 0.
+
+ * testsuite/libgomp.c/pr42942.c: New test.
+
2010-03-08 Tobias Grosser <grosser@fim.uni-passau.de>
PR middle-end/42644
diff --git a/libgomp/env.c b/libgomp/env.c
index c870433f332..3eb51e8a7d6 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
@@ -145,7 +146,7 @@ parse_schedule (void)
present and it was successfully parsed. */
static bool
-parse_unsigned_long (const char *name, unsigned long *pvalue)
+parse_unsigned_long (const char *name, unsigned long *pvalue, bool allow_zero)
{
char *env, *end;
unsigned long value;
@@ -161,7 +162,7 @@ parse_unsigned_long (const char *name, unsigned long *pvalue)
errno = 0;
value = strtoul (env, &end, 10);
- if (errno || (long) value <= 0)
+ if (errno || (long) value <= 0 - allow_zero)
goto invalid;
while (isspace ((unsigned char) *end))
@@ -481,8 +482,9 @@ initialize_env (void)
parse_schedule ();
parse_boolean ("OMP_DYNAMIC", &gomp_global_icv.dyn_var);
parse_boolean ("OMP_NESTED", &gomp_global_icv.nest_var);
- parse_unsigned_long ("OMP_MAX_ACTIVE_LEVELS", &gomp_max_active_levels_var);
- parse_unsigned_long ("OMP_THREAD_LIMIT", &gomp_thread_limit_var);
+ parse_unsigned_long ("OMP_MAX_ACTIVE_LEVELS", &gomp_max_active_levels_var,
+ true);
+ parse_unsigned_long ("OMP_THREAD_LIMIT", &gomp_thread_limit_var, false);
if (gomp_thread_limit_var != ULONG_MAX)
gomp_remaining_threads_count = gomp_thread_limit_var - 1;
#ifndef HAVE_SYNC_BUILTINS
@@ -490,7 +492,8 @@ initialize_env (void)
#endif
gomp_init_num_threads ();
gomp_available_cpus = gomp_global_icv.nthreads_var;
- if (!parse_unsigned_long ("OMP_NUM_THREADS", &gomp_global_icv.nthreads_var))
+ if (!parse_unsigned_long ("OMP_NUM_THREADS", &gomp_global_icv.nthreads_var,
+ false))
gomp_global_icv.nthreads_var = gomp_available_cpus;
if (parse_affinity ())
gomp_init_affinity ();
@@ -632,7 +635,7 @@ omp_get_thread_limit (void)
void
omp_set_max_active_levels (int max_levels)
{
- if (max_levels > 0)
+ if (max_levels >= 0)
gomp_max_active_levels_var = max_levels;
}
diff --git a/libgomp/testsuite/libgomp.c/pr42942.c b/libgomp/testsuite/libgomp.c/pr42942.c
new file mode 100644
index 00000000000..5d57852450a
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr42942.c
@@ -0,0 +1,61 @@
+/* PR libgomp/42942 */
+/* { dg-do run } */
+
+#include <omp.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ int e = 0;
+ omp_set_dynamic (0);
+ omp_set_nested (1);
+ omp_set_max_active_levels (1);
+ if (omp_get_max_active_levels () != 1)
+ abort ();
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (!omp_in_parallel ()
+ || omp_get_num_threads () != 2)
+ e = 1;
+ else
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (!omp_in_parallel ()
+ || omp_get_num_threads () != 1)
+ e = 1;
+ if (e)
+ abort ();
+ omp_set_max_active_levels (0);
+ if (omp_get_max_active_levels () != 0)
+ abort ();
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (omp_in_parallel ()
+ || omp_get_num_threads () != 1)
+ e = 1;
+ else
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (omp_in_parallel ()
+ || omp_get_num_threads () != 1)
+ e = 1;
+ if (e)
+ abort ();
+ omp_set_max_active_levels (2);
+ if (omp_get_max_active_levels () != 2)
+ abort ();
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (!omp_in_parallel ()
+ || omp_get_num_threads () != 2)
+ e = 1;
+ else
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (!omp_in_parallel ()
+ || omp_get_num_threads () != 2)
+ e = 1;
+ else
+#pragma omp parallel num_threads(2) reduction(|:e)
+ if (!omp_in_parallel ()
+ || omp_get_num_threads () != 1)
+ e = 1;
+ if (e)
+ abort ();
+ return 0;
+}
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index cf80e38b3c2..176dd4daf7b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-22 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (d_print_mod): Use () rather than [] for vectors.
+
2010-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in (all): Do not use exec.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index b1319cf3b46..98c64db552f 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -4506,9 +4506,9 @@ d_print_mod (struct d_print_info *dpi,
d_print_comp (dpi, d_left (mod));
return;
case DEMANGLE_COMPONENT_VECTOR_TYPE:
- d_append_string (dpi, " vector[");
+ d_append_string (dpi, " __vector(");
d_print_comp (dpi, d_left (mod));
- d_append_char (dpi, ']');
+ d_append_char (dpi, ')');
return;
default:
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 010faec475e..672f35216fe 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3928,10 +3928,10 @@ _Z1fN1SUt_E
f(S::{unnamed type#1})
--format=gnu-v3
_Z1fDv32_f
-f(float vector[32])
+f(float __vector(32))
--format=gnu-v3
_Z1fIfLi4EEvDv_T0__T_
-void f<float, 4>(float vector[4])
+void f<float, 4>(float __vector(4))
--format=gnu-v3
_Z1fI1AEDTclonplfp_fp_EET_
decltype ((operator+)({parm#1}, {parm#1})) f<A>(A)
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d803ad9227e..365968a3ebe 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,33 @@
+2010-03-21 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR target/42811
+ * libjava/configure.ac (DLLTOOL): Call AC_CHECK_TOOL.
+ (libgcj_sublib_core_extra_deps): New host-dependent configure var.
+ (LIBGCJ_SUBLIB_CORE_EXTRA_DEPS): AC_SUBST it.
+ * libjava/configure.host (libgcj_sublib_core_extra_deps): Define
+ appropriately on Cygwin and MinGW.
+ (libgcj_sublib_core_extra_deps): Add libgcj-noncore-dummy import
+ stub library on Cygwin and MinGW.
+ * libjava/Makefile.am (LIBJAVA_CORE_EXTRA): Import AC_SUBST'd
+ LIBGCJ_SUBLIB_CORE_EXTRA_DEPS if building sublibs, else define empty.
+ (libgcj_la_DEPENDENCIES): Use it.
+ (DLL_VERSION): New makefile macro.
+ (libgcj-noncore-dummy.dll.a): New build rule for dummy import stub
+ library.
+ (libgcj_noncore_la_LIBADD): Trim superfluous convenience libs.
+ (AM_MAKEFLAGS): Add DLLTOOL recursive propagation.
+ * libjava/libgcj-noncore-dummy.def: New file.
+ * libjava/Makefile.in: Regenerate.
+ * libjava/include/Makefile.in: Likewise.
+ * libjava/testsuite/Makefile.in: Likewise.
+ * libjava/configure: Likewise.
+ * libjava/gcj/Makefile.in: Likewise.
+
+2010-03-21 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR target/42811 (prerequisite)
+ * jvmti.cc (_Jv_GetJVMTIEnv): Avoid use of uninitialised memory.
+
2010-03-13 Matthias Klose <doko@ubuntu.com>
PR libgcj/42676
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 11c60dfe09f..190c686e65e 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -202,11 +202,13 @@ toolexeclib_LTLIBRARIES += libgcj-noncore.la
libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO)
libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
LIBJAVA_LDFLAGS_NOUNDEF = $(LIBGCJ_SUBLIB_LTFLAGS)
+LIBJAVA_CORE_EXTRA = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
else
# If not building sublibraries, everything goes in libgcj,
# and it cannot be usefully built shared on PE platforms.
libgcj_la_LIBADD_SUBOBJECTS = $(ALL_PACKAGE_SOURCE_FILES_LO)
LIBJAVA_LDFLAGS_NOUNDEF =
+LIBJAVA_CORE_EXTRA =
endif
if USE_LIBGCJ_BC
@@ -460,7 +462,8 @@ libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
java/lang/Class.lo \
java/process-$(PLATFORM).lo \
$(ALL_PACKAGE_SOURCE_FILES_LO) \
- $(LIBLTDL) $(libgcj_la_LIBADD)
+ $(LIBLTDL) $(libgcj_la_LIBADD) \
+ $(LIBJAVA_CORE_EXTRA)
if ANONVERSCRIPT
libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
endif
@@ -472,17 +475,28 @@ libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
if BUILD_SUBLIBS
+## This extra target is invoked on windows hosts only by adding it
+## to LIBGCJ_SUBLIB_CORE_EXTRA_SRCS in configure.host, which causes
+## it to be linked in to the core DLL and generate a circular import
+## dependency loop between the two DLLs. This is required to fix
+## PR42811 by ensuring that any application that links against
+## either always loads both at runtime.
+DLL_VERSION=`expr \`grep -v '^\#' $(srcdir)/libtool-version | sed -e 's/\(.*\):\(.*\):.*/\1 + \2/'\``
+libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def
+ $(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll
+
+## These are the libtool definitions for the noncore library.
libgcj_noncore_la_SOURCES =
libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
-libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \
- $(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la
+libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) libgcj.la
libgcj_noncore_la_DEPENDENCIES = libgcj-$(gcc_version).jar $(LIBLTDL) \
$(libgcj_noncore_la_LIBADD) libgcj.la
if ANONVERSCRIPT
libgcj_noncore_la_DEPENDENCIES += $(srcdir)/libgcj.ver
endif
libgcj_noncore_la_LINK = $(libgcj_la_LINK)
-endif
+
+endif # BUILD_SUBLIBS
# We compile libgcj_tools with -findirect-dispatch so that they can
# depend on external classes: in particular, gjdoc uses antlr. In
@@ -1513,6 +1527,7 @@ AM_MAKEFLAGS = \
"gxx_include_dir=$(gxx_include_dir)" \
"AR=$(AR)" \
"AS=$(AS)" \
+ "DLLTOOL=$(DLLTOOL)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"NM=$(NM)" \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 23461147ef2..34ddeae7b6b 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -184,14 +184,13 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt_xlib_la-natClip.lo \
am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
@XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
-am__DEPENDENCIES_1 =
am_libgcj_noncore_la_OBJECTS =
libgcj_noncore_la_OBJECTS = $(am_libgcj_noncore_la_OBJECTS)
@BUILD_SUBLIBS_TRUE@am_libgcj_noncore_la_rpath = -rpath \
@BUILD_SUBLIBS_TRUE@ $(toolexeclibdir)
am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo
libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
-@INTERPRETER_TRUE@am__DEPENDENCIES_2 = gnu/classpath/jdwp.lo \
+@INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/event.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/event/filters.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/exception.lo \
@@ -200,7 +199,7 @@ libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
@INTERPRETER_TRUE@ gnu/classpath/jdwp/transport.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/util.lo \
@INTERPRETER_TRUE@ gnu/classpath/jdwp/value.lo gnu/gcj/jvmti.lo
-am__DEPENDENCIES_3 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
+am__DEPENDENCIES_2 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
gnu/classpath/debug.lo gnu/classpath/toolkit.lo gnu/gcj.lo \
gnu/gcj/convert.lo gnu/gcj/io.lo gnu/gcj/runtime.lo \
gnu/gcj/util.lo gnu/java/awt.lo gnu/java/awt/color.lo \
@@ -317,12 +316,13 @@ am__DEPENDENCIES_3 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
javax/swing/undo.lo javax/tools.lo javax/transaction.lo \
javax/transaction/xa.lo org/ietf/jgss.lo sun/awt.lo \
sun/misc.lo sun/reflect.lo sun/reflect/annotation.lo \
- sun/reflect/misc.lo $(am__DEPENDENCIES_2)
-am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(propertyo_files) \
+ sun/reflect/misc.lo $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) $(propertyo_files) \
$(bc_objects)
-@BUILD_SUBLIBS_FALSE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_4)
-@BUILD_SUBLIBS_TRUE@am__DEPENDENCIES_5 = \
+@BUILD_SUBLIBS_FALSE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3)
+@BUILD_SUBLIBS_TRUE@am__DEPENDENCIES_4 = \
@BUILD_SUBLIBS_TRUE@ $(CORE_PACKAGE_SOURCE_FILES_LO)
+am__DEPENDENCIES_5 =
am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc \
stacktrace.cc link.cc defineclass.cc verify.cc jvmti.cc \
interpret.cc gnu/classpath/jdwp/natVMFrame.cc \
@@ -660,6 +660,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -727,6 +728,7 @@ LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
LIBGCJ_LD_SYMBOLIC_FUNCTIONS = @LIBGCJ_LD_SYMBOLIC_FUNCTIONS@
LIBGCJ_SPEC = @LIBGCJ_SPEC@
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
LIBGCJ_SUBLIB_LTFLAGS = @LIBGCJ_SUBLIB_LTFLAGS@
LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
@@ -1047,6 +1049,8 @@ CORE_PACKAGE_SOURCE_FILES_LO = $(filter-out $(LOWER_PACKAGE_FILES_LO),$(ALL_PACK
@BUILD_SUBLIBS_TRUE@libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
@BUILD_SUBLIBS_FALSE@LIBJAVA_LDFLAGS_NOUNDEF =
@BUILD_SUBLIBS_TRUE@LIBJAVA_LDFLAGS_NOUNDEF = $(LIBGCJ_SUBLIB_LTFLAGS)
+@BUILD_SUBLIBS_FALSE@LIBJAVA_CORE_EXTRA =
+@BUILD_SUBLIBS_TRUE@LIBJAVA_CORE_EXTRA = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
dbexec_LTLIBRARIES = libjvm.la
pkgconfigdir = $(libdir)/pkgconfig
jardir = $(datadir)/java
@@ -1158,14 +1162,13 @@ libgcj_la_LIBADD = \
libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar java/lang/Object.lo \
java/lang/Class.lo java/process-$(PLATFORM).lo \
$(ALL_PACKAGE_SOURCE_FILES_LO) $(LIBLTDL) $(libgcj_la_LIBADD) \
- $(am__append_20)
+ $(LIBJAVA_CORE_EXTRA) $(am__append_20)
libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS)
EXTRA_libgcj_la_SOURCES = java/lang/Object.java
+@BUILD_SUBLIBS_TRUE@DLL_VERSION = `expr \`grep -v '^\#' $(srcdir)/libtool-version | sed -e 's/\(.*\):\(.*\):.*/\1 + \2/'\``
@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_SOURCES =
@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
-@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \
-@BUILD_SUBLIBS_TRUE@ $(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la
-
+@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) libgcj.la
@BUILD_SUBLIBS_TRUE@libgcj_noncore_la_DEPENDENCIES = \
@BUILD_SUBLIBS_TRUE@ libgcj-$(gcc_version).jar $(LIBLTDL) \
@BUILD_SUBLIBS_TRUE@ $(libgcj_noncore_la_LIBADD) libgcj.la \
@@ -8770,6 +8773,7 @@ AM_MAKEFLAGS = \
"gxx_include_dir=$(gxx_include_dir)" \
"AR=$(AR)" \
"AS=$(AS)" \
+ "DLLTOOL=$(DLLTOOL)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"NM=$(NM)" \
@@ -10787,6 +10791,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
interpret.lo: AM_CXXFLAGS += -fwrapv
+@BUILD_SUBLIBS_TRUE@libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def
+@BUILD_SUBLIBS_TRUE@ $(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll
$(db_name): gcj-dbtool$(EXEEXT)
@rm -f $(db_name)
diff --git a/libjava/configure b/libjava/configure
index 605225b19a0..0d2fb703ece 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -778,6 +778,7 @@ BUILD_SUBLIBS_FALSE
BUILD_SUBLIBS_TRUE
LIBGCJ_LD_SYMBOLIC_FUNCTIONS
LIBGCJ_LD_SYMBOLIC
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS
LIBGCJ_SUBLIB_LTFLAGS
LIBGCJ_JAVAFLAGS
LIBGCJ_CXXFLAGS
@@ -788,6 +789,7 @@ MAINTAINER_MODE_TRUE
UNZIP
ZIP
JAR
+DLLTOOL
RANLIB
AR
LD
@@ -5567,6 +5569,98 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -5789,13 +5883,16 @@ fi
# libgcj_cxxflags - host specific C++ compiler flags
# libgcj_javaflags - host specific Java compiler flags
# libgcj_sublib_ltflags - host specific Libtool flags
-# (only used when building sublibs)
+# libgcj_sublib_core_extra_deps - host specific extra
+# dependencies for core sublib
+# (these last two only used when building sublibs)
# and a number of others; see the list at the start of the file.
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
libgcj_sublib_ltflags=
+libgcj_sublib_core_extra_deps=
. ${srcdir}/configure.host
@@ -5846,6 +5943,7 @@ LIBGCJ_CFLAGS="${libgcj_cflags}"
LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
LIBGCJ_SUBLIB_LTFLAGS="${libgcj_sublib_ltflags}"
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS="${libgcj_sublib_core_extra_deps}"
LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
@@ -5855,6 +5953,7 @@ LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
+
# Only use libltdl for non-newlib builds.
if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
@@ -13238,7 +13337,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13241 "configure"
+#line 13340 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13344,7 +13443,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 13347 "configure"
+#line 13446 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19209,7 +19308,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
enableval=$enable_sjlj_exceptions; :
else
cat > conftest.$ac_ext << EOF
-#line 19212 "configure"
+#line 19311 "configure"
struct S { ~S(); };
void bar();
void foo()
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 3721e1c34ed..255fb64595e 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -157,6 +157,7 @@ AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(DLLTOOL, dlltool, :)
AC_PROG_AWK
AC_CHECK_PROGS([JAR], [jar fastjar gjar], no)
AC_PATH_PROG([ZIP], [zip], no)
@@ -194,13 +195,16 @@ AC_EXEEXT
# libgcj_cxxflags - host specific C++ compiler flags
# libgcj_javaflags - host specific Java compiler flags
# libgcj_sublib_ltflags - host specific Libtool flags
-# (only used when building sublibs)
+# libgcj_sublib_core_extra_deps - host specific extra
+# dependencies for core sublib
+# (these last two only used when building sublibs)
# and a number of others; see the list at the start of the file.
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
libgcj_sublib_ltflags=
+libgcj_sublib_core_extra_deps=
. ${srcdir}/configure.host
@@ -214,12 +218,14 @@ LIBGCJ_CFLAGS="${libgcj_cflags}"
LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
LIBGCJ_SUBLIB_LTFLAGS="${libgcj_sublib_ltflags}"
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS="${libgcj_sublib_core_extra_deps}"
LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
AC_SUBST(LIBGCJ_CFLAGS)
AC_SUBST(LIBGCJ_CXXFLAGS)
AC_SUBST(LIBGCJ_JAVAFLAGS)
AC_SUBST(LIBGCJ_SUBLIB_LTFLAGS)
+AC_SUBST(LIBGCJ_SUBLIB_CORE_EXTRA_DEPS)
AC_SUBST(LIBGCJ_LD_SYMBOLIC)
AC_SUBST(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
diff --git a/libjava/configure.host b/libjava/configure.host
index 36039b5fc4a..460ef2fab07 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -18,7 +18,8 @@
# libgcj_cflags Special CFLAGS to use when building
# libgcj_cxxflags Special CXXFLAGS to use when building
# libgcj_javaflags Special JAVAFLAGS to use when building
-# libgcj_sublib_ltflags Special Libtool flags to use when building.
+# libgcj_sublib_ltflags Special Libtool flags to use when building sublibs
+# libgcj_sublib_core_extra_deps Extra dependencies to add to core sublib
# libgcj_interpreter If the bytecode interpreter supports this platform.
# enable_java_net_default If java.net native code should be enabled by
# default.
@@ -43,6 +44,7 @@ libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
libgcj_sublib_ltflags=
+libgcj_sublib_core_extra_deps=
libgcj_interpreter=
enable_java_net_default=yes
enable_hash_synchronization_default=no
@@ -351,7 +353,9 @@ case "${host}" in
BACKTRACESPEC=
# Win32 DLLs are limited to 64k exported symbols each.
enable_libgcj_sublibs_default=yes
- libgcj_sublib_ltflags='-no-undefined -bindir $(bindir)'
+ libgcj_sublib_ltflags='-no-undefined -bindir $(bindir) \
+ -Wl,-u,__ZN3org4ietf4jgss10GSSManagerC1Ev,-L..,-lgcj-noncore-dummy'
+ libgcj_sublib_core_extra_deps=libgcj-noncore-dummy.dll.a
;;
esac
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index 55524392d98..e73ef0e7140 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -124,6 +124,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -191,6 +192,7 @@ LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
LIBGCJ_LD_SYMBOLIC_FUNCTIONS = @LIBGCJ_LD_SYMBOLIC_FUNCTIONS@
LIBGCJ_SPEC = @LIBGCJ_SPEC@
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
LIBGCJ_SUBLIB_LTFLAGS = @LIBGCJ_SUBLIB_LTFLAGS@
LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 539dd01f188..5e5a4b3d5bf 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -124,6 +124,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -191,6 +192,7 @@ LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
LIBGCJ_LD_SYMBOLIC_FUNCTIONS = @LIBGCJ_LD_SYMBOLIC_FUNCTIONS@
LIBGCJ_SPEC = @LIBGCJ_SPEC@
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
LIBGCJ_SUBLIB_LTFLAGS = @LIBGCJ_SUBLIB_LTFLAGS@
LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
diff --git a/libjava/jvmti.cc b/libjava/jvmti.cc
index d9bcc806074..3ac6365b2cc 100644
--- a/libjava/jvmti.cc
+++ b/libjava/jvmti.cc
@@ -2210,6 +2210,7 @@ _Jv_GetJVMTIEnv (void)
{
_Jv_JVMTIEnv *env
= (_Jv_JVMTIEnv *) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv));
+ memset (env, 0, sizeof (_Jv_JVMTIEnv));
env->p = &_Jv_JVMTI_Interface;
struct jvmti_env_list *element
= (struct jvmti_env_list *) _Jv_MallocUnchecked (sizeof (struct jvmti_env_list));
diff --git a/libjava/libgcj-noncore-dummy.def b/libjava/libgcj-noncore-dummy.def
new file mode 100644
index 00000000000..e56f9f6eb29
--- /dev/null
+++ b/libjava/libgcj-noncore-dummy.def
@@ -0,0 +1,7 @@
+
+LIBRARY cyggcj-noncore-11.dll
+
+EXPORTS
+
+ _ZN3org4ietf4jgss10GSSManagerC1Ev
+
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index 5086016cfaf..86862ce8690 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -99,6 +99,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -166,6 +167,7 @@ LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@
LIBGCJ_LD_SYMBOLIC_FUNCTIONS = @LIBGCJ_LD_SYMBOLIC_FUNCTIONS@
LIBGCJ_SPEC = @LIBGCJ_SPEC@
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@
LIBGCJ_SUBLIB_LTFLAGS = @LIBGCJ_SUBLIB_LTFLAGS@
LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index 679f8f25495..f5dc7480ca8 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-15 David S. Miller <davem@davemloft.net>
+
+ * testsuite/libmudflap.c/pass54-frag.c: Add explicit return from
+ main.
+
2010-01-09 Jakub Jelinek <jakub@redhat.com>
* mf-runtime.c (__mf_usage): Update copyright notice dates.
diff --git a/libmudflap/testsuite/libmudflap.c/pass54-frag.c b/libmudflap/testsuite/libmudflap.c/pass54-frag.c
index 59cf2fa6258..5eebb4515fc 100644
--- a/libmudflap/testsuite/libmudflap.c/pass54-frag.c
+++ b/libmudflap/testsuite/libmudflap.c/pass54-frag.c
@@ -30,4 +30,5 @@ int main ()
foo ();
bar ();
__mf_set_options ("-mode-check");
+ return 0;
}
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 2b2d0634b9f..36e44c3e746 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,326 @@
+2010-03-22 Johannes Singler <singler@kit.edu>
+
+ * include/parallel/numeric (inner_product, partial_sum):
+ Precede subsequent call with _GLIBCXX_STD_P:: to avoid ambiguity
+ between __gnu_parallel:: and std::
+ * include/parallel/algobase.h (equal): Likewise.
+ * include/parallel/algo.h (find_first_of, search_n, merge, nth_element,
+ partial_sort, max_element, min_element): Likewise.
+ * include/parallel/partial_sum.h (__parallel_partial_sum_linear):
+ Qualify accumulate call with __gnu_parallel::.
+
+2010-03-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/base.h (_PseudoSequence): Do not forward declare.
+ (_VoidFunctor): Remove, unused.
+ (__median_of_three_iterators): Take __comp by value.
+ (_PseudoSequenceIterator<>::operator++(int)): Do not const qualify
+ the return type.
+ (_PseudoSequenceIterator<>::operator!=): Fix return type to bool.
+
+2010-03-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/parallel/base.h (_Less): Use std::less.
+ (_Plus): Likewise use std::plus.
+ (_Multiplies): Likewise use std::multiplies.
+ * include/parallel/numeric: Adjust.
+
+2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/17_intro/freestanding.cc: Avoid -Wall warnings.
+
+2010-03-19 Rodolfo Lima <rodolfo@rodsoft.org>
+
+ * include/bits/shared_ptr.h (shared_ptr(unique_ptr&&),
+ shared_ptr(auto_ptr&&)): Remove explicit specifier (as per DR 925).
+ * include/bits/shared_ptr_base.h: Likewise.
+ * testsuite/20_util/shared_ptr/creation/dr925.cc: New.
+
+2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/random.tcc: Minor formatting changes.
+
+2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_algo.h (shuffle): Fix typo in signature.
+ * include/bits/algorithmfwd.h: Adjust.
+ * testsuite/25_algorithms/shuffle/requirements/
+ explicit_instantiation/2.cc: Likewise.
+ * testsuite/25_algorithms/shuffle/requirements/
+ explicit_instantiation/pod.cc: Likewise.
+
+2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_algo.h (shuffle): Add, per D3056.
+ (random_shuffle): Fix signature in C++0x mode.
+ (lower_bound, __lg): Move...
+ * include/bits/stl_algobase.h: ... here.
+ * include/bits/algorithmfwd.h: Adjust.
+ * include/parallel/algorithmfwd.h: Likewise.
+ * include/parallel/algo.h: Likewise.
+ * include/bits/hashtable_policy.h (__lower_bound): Remove,
+ adjust callers.
+ * include/tr1/hashtable_policy.h (__lower_bound): Likewise.
+ * include/bits/random.tcc (__detail::__transform): Add,
+ adjust std::transform callers; don't include <algorithm>.
+ * testsuite/25_algorithms/shuffle/1.cc: Add.
+ * testsuite/25_algorithms/shuffle/requirements/
+ explicit_instantiation/2.cc: Likewise.
+ * testsuite/25_algorithms/shuffle/requirements/
+ explicit_instantiation/pod.cc: Likewise.
+
+ * include/bits/random.h: Add comments.
+
+2010-03-17 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/debug_mode.xml: Correct debug headers.
+
+2010-03-17 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/43397
+ * include/std/functional (_Mem_fn): Use perfect forwarding.
+ * testsuite/20_util/function/43397.cc: New.
+
+2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/43394
+ * include/parallel/compatibility.h: Add __k8 and __core2 among the
+ i386 targets supporting atomic operations.
+
+2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/backward/hash_map: Use consistently the _BACKWARD_*
+ prefix for the include guard.
+ * include/backward/hash_fun.h: Likewise.
+ * include/backward/hashtable.h: Likewise.
+ * include/backward/auto_ptr.h: Likewise.
+ * include/backward/strstream: Likewise.
+ * include/backward/binders.h: Likewise.
+ * include/backward/hash_set: Likewise.
+
+2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/random.h (operator==(const uniform_int_distribution<>&,
+ const uniform_int_distribution<>&), operator==(const
+ uniform_real_distribution<>&, const uniform_real_distribution<>&),
+ operator==(const lognormal_distribution<>&,
+ const lognormal_distribution<>&), operator==(const
+ chi_squared_distribution<>&, const chi_squared_distribution<>&),
+ operator==(const cauchy_distribution<>&, const cauchy_distribution<>&),
+ operator==(const fisher_distribution<>&, const fisher_distribution<>&),
+ operator==(const student_t_distribution<>&,
+ const student_t_distribution<>&), operator==(const
+ bernoulli_distribution<>&, const bernoulli_distribution<>&),
+ operator==(const binomial_distribution<>&, const
+ binomial_distribution<>&), operator==(const geometric_distribution<>&,
+ const geometric_distribution<>&), operator==(const
+ negative_binomial_distribution<>&, const
+ negative_binomial_distribution<>&), operator==(const
+ poisson_distribution<>&, const poisson_distribution<>&),
+ operator==(const exponential_distribution<>&,
+ const exponential_distribution<>&), operator==(const
+ gamma_distribution<>&, const gamma_distribution<>&), operator==(const
+ weibull_distribution<>&, const weibull_distribution<>&),
+ operator==(const extreme_value_distribution<>&,
+ const extreme_value_distribution<>&), operator==(const
+ discrete_distribution<>&, const discrete_distribution<>&),
+ operator==(const piecewise_constant_distribution<>&,
+ const piecewise_constant_distribution<>&), operator==(const
+ piecewise_linear_distribution<>&, const
+ piecewise_linear_distribution<>&)): Add, likewise for operator!=.
+ (operator!=(const independent_bits_engine<>&, const
+ independent_bits_engine<>&), operator!=(const
+ subtract_with_carry_engine<>&, const subtract_with_carry_engine<>&),
+ operator!=(const discard_block_engine<>&, const
+ discard_block_engine<>&), operator!=(const mersenne_twister_engine<>&,
+ const mersenne_twister_engine<>&), operator!=(const
+ linear_congruential_engine<>&, const linear_congruential_engine<>&),
+ operator!=(const shuffle_order_engine<>&, const
+ shuffle_order_engine<>&): Add.
+ * include/bits/random.tcc (operator==(const normal_distribution<>&,
+ const normal_distribution<>&)): Add.
+ * testsuite/26_numerics/random/uniform_real_distribution/operators/
+ inequal.cc: New.
+ * testsuite/26_numerics/random/uniform_real_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/piecewise_constant_distribution/
+ operators/inequal.cc: Likewise.
+ * testsuite/26_numerics/random/piecewise_constant_distribution/
+ operators/equal.cc: Likewise.
+ * testsuite/26_numerics/random/chi_squared_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/chi_squared_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/normal_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/normal_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/uniform_int_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/uniform_int_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/poisson_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/poisson_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/bernoulli_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/bernoulli_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/discrete_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/discrete_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/weibull_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/weibull_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/independent_bits_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/subtract_with_carry_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/discard_block_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/cauchy_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/cauchy_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/negative_binomial_distribution/
+ operators/inequal.cc: Likewise.
+ * testsuite/26_numerics/random/negative_binomial_distribution/
+ operators/equal.cc: Likewise.
+ * testsuite/26_numerics/random/gamma_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/gamma_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/mersenne_twister_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/fisher_f_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/fisher_f_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/exponential_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/exponential_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/binomial_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/binomial_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/lognormal_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/lognormal_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/extreme_value_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/extreme_value_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/piecewise_linear_distribution/
+ operators/inequal.cc: Likewise.
+ * testsuite/26_numerics/random/piecewise_linear_distribution/
+ operators/equal.cc: Likewise.
+ * testsuite/26_numerics/random/student_t_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/student_t_distribution/operators/
+ equal.cc: Likewise.
+ * testsuite/26_numerics/random/linear_congruential_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/shuffle_order_engine/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/geometric_distribution/operators/
+ inequal.cc: Likewise.
+ * testsuite/26_numerics/random/geometric_distribution/operators/
+ equal.cc: Likewise.
+
+2010-03-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/forward_list.tcc (_Fwd_list_node_base::
+ _M_transfer_after): Return _Fwd_list_node_base*.
+ (forward_list<>::_M_splice_after): Add.
+ (forward_list<>::insert_after(const_iterator, size_type, const _Tp&),
+ insert_after(const_iterator, _InputIterator, _InputIterator),
+ insert_after(const_iterator, initializer_list<>)): Use the above,
+ implement DR 1278 ([Ready] in Pittsburgh).
+ * include/bits/forward_list.h (insert_after(const_iterator,
+ size_type, const _Tp&), insert_after(const_iterator, _InputIterator,
+ _InputIterator), insert_after(const_iterator, initializer_list<>)):
+ Only declare.
+ * testsuite/23_containers/forward_list/modifiers/2.cc: Adjust.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ assign_neg.cc: Adjust dg-error line number.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+
+2010-03-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ assign_neg.cc: Adjust dg-error line number.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/requirements/dr438/
+ insert_neg.cc: Likewise.
+ * testsuite/23_containers/forward_list/capacity/1.cc: Adjust.
+
+ Revert:
+ 2008-11-11 Bob Walters <bob.s.walters@gmail.com>
+
+ * include/bits/forward_list.h: Support non-standard pointer types
+ (_Fwd_list_node_base): Add _Alloc template parameter.
+ (_Fwd_list_node<>): Likewise.
+ (_Fwd_list_iterator<>): Likewise.
+ (_Fwd_list_const_iterator<>): Likewise.
+ (_Fwd_list_node_base::_M_next, _M_transfer_after, _M_reverse_after):
+ Use _Alloc<_Tp>::pointer.
+ (_Fwd_list_iterator<>::_M_node): Use _Node_base::_Pointer.
+ (_Fwd_list_base<>::_M_get_node, _M_create_node, _M_create_node,
+ _M_insert_after, _M_put_node, _M_erase_after): Likewise.
+ (_Fwd_list_const_iterator<>::_M_node): use _Node_base::_Const_pointer.
+ (forward_list<>): Use __static_pointer_cast in place of static_cast,
+ and __const_pointer_cast in place of const_cast.
+ * include/bits/forward_list.tcc
+ (_Fwd_list_node<>::_M_sort_after): Using _Pointer typedefs in place
+ of standard pointers, __static_pointer_cast in place of static_cast.
+ (_Fwd_list_base<>::_Fwd_list_base, _M_insert_after, _M_erase_after):
+ Likewise.
+ (forward_list<>::_M_initialize_dispatch, _M_fill_initialize,
+ splice_after, remove, remove_if, merge): Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/modifiers/1.cc: New.
+ * testsuite/23_containers/forward_list/ext_pointer/modifiers/2.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/modifiers/3.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/modifiers/4.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/modifiers/5.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/1.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/2.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/3.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/4.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/5.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/6.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/operations/7.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/requirements/1.cc:
+ Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/requirements/
+ explicit_instantiation/1.cc: Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/requirements/
+ explicit_instantiation/3.cc: Likewise.
+ * testsuite/23_containers/forward_list/ext_pointer/1.cc: Likewise.
+
2010-03-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/tr1_impl/array (swap(array<>&, array<>&)): Use member swap.
diff --git a/libstdc++-v3/doc/xml/manual/debug_mode.xml b/libstdc++-v3/doc/xml/manual/debug_mode.xml
index 400bb553fa5..c3b3b57859d 100644
--- a/libstdc++-v3/doc/xml/manual/debug_mode.xml
+++ b/libstdc++-v3/doc/xml/manual/debug_mode.xml
@@ -204,67 +204,67 @@ which always works correctly.
<entry><classname>std::bitset</classname></entry>
<entry><filename class="headerfile">bitset</filename></entry>
<entry><classname>__gnu_debug::bitset</classname></entry>
- <entry><filename class="headerfile">bitset</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/bitset&gt;</filename></entry>
</row>
<row>
<entry><classname>std::deque</classname></entry>
<entry><filename class="headerfile">deque</filename></entry>
<entry><classname>__gnu_debug::deque</classname></entry>
- <entry><filename class="headerfile">deque</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/deque&gt;</filename></entry>
</row>
<row>
<entry><classname>std::list</classname></entry>
<entry><filename class="headerfile">list</filename></entry>
<entry><classname>__gnu_debug::list</classname></entry>
- <entry><filename class="headerfile">list</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/list&gt;</filename></entry>
</row>
<row>
<entry><classname>std::map</classname></entry>
<entry><filename class="headerfile">map</filename></entry>
<entry><classname>__gnu_debug::map</classname></entry>
- <entry><filename class="headerfile">map</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/map&gt;</filename></entry>
</row>
<row>
<entry><classname>std::multimap</classname></entry>
<entry><filename class="headerfile">map</filename></entry>
<entry><classname>__gnu_debug::multimap</classname></entry>
- <entry><filename class="headerfile">map</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/map&gt;</filename></entry>
</row>
<row>
<entry><classname>std::multiset</classname></entry>
<entry><filename class="headerfile">set</filename></entry>
<entry><classname>__gnu_debug::multiset</classname></entry>
- <entry><filename class="headerfile">set</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/set&gt;</filename></entry>
</row>
<row>
<entry><classname>std::set</classname></entry>
<entry><filename class="headerfile">set</filename></entry>
<entry><classname>__gnu_debug::set</classname></entry>
- <entry><filename class="headerfile">set</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/set&gt;</filename></entry>
</row>
<row>
<entry><classname>std::string</classname></entry>
<entry><filename class="headerfile">string</filename></entry>
<entry><classname>__gnu_debug::string</classname></entry>
- <entry><filename class="headerfile">string</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/string&gt;</filename></entry>
</row>
<row>
<entry><classname>std::wstring</classname></entry>
<entry><filename class="headerfile">string</filename></entry>
<entry><classname>__gnu_debug::wstring</classname></entry>
- <entry><filename class="headerfile">string</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/string&gt;</filename></entry>
</row>
<row>
<entry><classname>std::basic_string</classname></entry>
<entry><filename class="headerfile">string</filename></entry>
<entry><classname>__gnu_debug::basic_string</classname></entry>
- <entry><filename class="headerfile">string</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/string&gt;</filename></entry>
</row>
<row>
<entry><classname>std::vector</classname></entry>
<entry><filename class="headerfile">vector</filename></entry>
<entry><classname>__gnu_debug::vector</classname></entry>
- <entry><filename class="headerfile">vector</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/vector&gt;</filename></entry>
</row>
</tbody>
</tgroup>
@@ -295,25 +295,25 @@ containers have additional debug capability.
<entry><classname>std::unordered_map</classname></entry>
<entry><filename class="headerfile">unordered_map</filename></entry>
<entry><classname>__gnu_debug::unordered_map</classname></entry>
- <entry><filename class="headerfile">unordered_map</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/unordered_map&gt;</filename></entry>
</row>
<row>
<entry><classname>std::unordered_multimap</classname></entry>
<entry><filename class="headerfile">unordered_map</filename></entry>
<entry><classname>__gnu_debug::unordered_multimap</classname></entry>
- <entry><filename class="headerfile">unordered_map</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/unordered_map&gt;</filename></entry>
</row>
<row>
<entry><classname>std::unordered_set</classname></entry>
<entry><filename class="headerfile">unordered_set</filename></entry>
<entry><classname>__gnu_debug::unordered_set</classname></entry>
- <entry><filename class="headerfile">unordered_set</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/unordered_set&gt;</filename></entry>
</row>
<row>
<entry><classname>std::unordered_multiset</classname></entry>
<entry><filename class="headerfile">unordered_set</filename></entry>
<entry><classname>__gnu_debug::unordered_multiset</classname></entry>
- <entry><filename class="headerfile">unordered_set</filename></entry>
+ <entry><filename class="headerfile">&lt;debug/unordered_set&gt;</filename></entry>
</row>
</tbody>
</tgroup>
diff --git a/libstdc++-v3/include/backward/auto_ptr.h b/libstdc++-v3/include/backward/auto_ptr.h
index aa3213d6373..d60bad3d088 100644
--- a/libstdc++-v3/include/backward/auto_ptr.h
+++ b/libstdc++-v3/include/backward/auto_ptr.h
@@ -27,8 +27,8 @@
* You should not attempt to use it directly.
*/
-#ifndef _STL_AUTO_PTR_H
-#define _STL_AUTO_PTR_H 1
+#ifndef _BACKWARD_AUTO_PTR_H
+#define _BACKWARD_AUTO_PTR_H 1
#include <bits/c++config.h>
#include <debug/debug.h>
@@ -289,4 +289,4 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
-#endif /* _STL_AUTO_PTR_H */
+#endif /* _BACKWARD_AUTO_PTR_H */
diff --git a/libstdc++-v3/include/backward/binders.h b/libstdc++-v3/include/backward/binders.h
index 5145860c52a..a65eb8a75d2 100644
--- a/libstdc++-v3/include/backward/binders.h
+++ b/libstdc++-v3/include/backward/binders.h
@@ -54,8 +54,8 @@
* You should not attempt to use it directly.
*/
-#ifndef _GLIBCXX_BINDERS_H
-#define _GLIBCXX_BINDERS_H 1
+#ifndef _BACKWARD_BINDERS_H
+#define _BACKWARD_BINDERS_H 1
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -166,4 +166,4 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
-#endif /* _GLIBCXX_BINDERS_H */
+#endif /* _BACKWARD_BINDERS_H */
diff --git a/libstdc++-v3/include/backward/hash_fun.h b/libstdc++-v3/include/backward/hash_fun.h
index 8cc7a4229b5..b7b14a1e418 100644
--- a/libstdc++-v3/include/backward/hash_fun.h
+++ b/libstdc++-v3/include/backward/hash_fun.h
@@ -1,6 +1,7 @@
// 'struct hash' from SGI -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,8 +54,8 @@
* containing extensions from the HP/SGI STL subset).
*/
-#ifndef _HASH_FUN_H
-#define _HASH_FUN_H 1
+#ifndef _BACKWARD_HASH_FUN_H
+#define _BACKWARD_HASH_FUN_H 1
#include <cstddef>
diff --git a/libstdc++-v3/include/backward/hash_map b/libstdc++-v3/include/backward/hash_map
index 469429ccc24..813ec472860 100644
--- a/libstdc++-v3/include/backward/hash_map
+++ b/libstdc++-v3/include/backward/hash_map
@@ -1,6 +1,7 @@
// Hashing map implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009, 2010
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,8 +54,8 @@
* containing extensions from the HP/SGI STL subset).
*/
-#ifndef _HASH_MAP
-#define _HASH_MAP 1
+#ifndef _BACKWARD_HASH_MAP
+#define _BACKWARD_HASH_MAP 1
#include "backward_warning.h"
#include <bits/c++config.h>
diff --git a/libstdc++-v3/include/backward/hash_set b/libstdc++-v3/include/backward/hash_set
index 32fa2205eea..5a2ade78214 100644
--- a/libstdc++-v3/include/backward/hash_set
+++ b/libstdc++-v3/include/backward/hash_set
@@ -1,6 +1,7 @@
// Hashing set implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2004, 2005, 2006, 2009, 2010
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -53,8 +54,8 @@
* containing extensions from the HP/SGI STL subset).
*/
-#ifndef _HASH_SET
-#define _HASH_SET 1
+#ifndef _BACKWARD_HASH_SET
+#define _BACKWARD_HASH_SET 1
#include "backward_warning.h"
#include <bits/c++config.h>
diff --git a/libstdc++-v3/include/backward/hashtable.h b/libstdc++-v3/include/backward/hashtable.h
index ca04c76fd37..55c1d99bf5d 100644
--- a/libstdc++-v3/include/backward/hashtable.h
+++ b/libstdc++-v3/include/backward/hashtable.h
@@ -1,6 +1,6 @@
// Hashtable implementation used by containers -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -54,8 +54,8 @@
* containing extensions from the HP/SGI STL subset).
*/
-#ifndef _HASHTABLE_H
-#define _HASHTABLE_H 1
+#ifndef _BACKWARD_HASHTABLE_H
+#define _BACKWARD_HASHTABLE_H 1
// Hashtable class, used to implement the hashed associative containers
// hash_set, hash_map, hash_multiset, and hash_multimap.
diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream
index 0ffbb81ea97..3221ba93d40 100644
--- a/libstdc++-v3/include/backward/strstream
+++ b/libstdc++-v3/include/backward/strstream
@@ -1,6 +1,7 @@
// Backward-compat support -*- C++ -*-
-// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2004, 2005, 2009, 2010
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -40,8 +41,8 @@
// MAY BE REMOVED in a future standard revision. One should use the
// header <sstream> instead.
-#ifndef _GLIBCXX_STRSTREAM
-#define _GLIBCXX_STRSTREAM
+#ifndef _BACKWARD_STRSTREAM
+#define _BACKWARD_STRSTREAM
#include "backward_warning.h"
#include <iosfwd>
diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index 7625ee4af51..645d8830fd8 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -1,6 +1,6 @@
// <algorithm> declarations -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -111,6 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
set_intersection
set_symmetric_difference
set_union
+ shuffle (C++0x)
sort
sort_heap
stable_partition
@@ -517,6 +518,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// set_symmetric_difference
// set_union
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+ template<typename _RAIter, typename _UGenerator>
+ void
+ shuffle(_RAIter, _RAIter, _UGenerator&);
+#endif
+
template<typename _RAIter>
void
sort_heap(_RAIter, _RAIter);
@@ -684,7 +691,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
template<typename _RAIter, typename _Generator>
void
- random_shuffle(_RAIter, _RAIter, _Generator&);
+ random_shuffle(_RAIter, _RAIter,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _Generator&&);
+#else
+ _Generator&);
+#endif
template<typename _FIter, typename _Tp>
void
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index 277e3790ebc..57b7836a324 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -33,59 +33,77 @@
#include <memory>
#include <initializer_list>
-#include <ext/cast.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
- using __gnu_cxx::__static_pointer_cast;
- using __gnu_cxx::__const_pointer_cast;
-
/**
* @brief A helper basic node class for %forward_list.
* This is just a linked list with nothing inside it.
* There are purely list shuffling utility methods here.
*/
- template<typename _Alloc>
- struct _Fwd_list_node_base
- {
- // The type allocated by _Alloc cannot be this type, so we rebind
- typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
- ::other::pointer _Pointer;
- typedef typename _Alloc::template rebind<_Fwd_list_node_base<_Alloc> >
- ::other::const_pointer _Const_pointer;
-
- _Pointer _M_next;
+ struct _Fwd_list_node_base
+ {
+ _Fwd_list_node_base() : _M_next(0) { }
- _Fwd_list_node_base() : _M_next(0) { }
+ _Fwd_list_node_base* _M_next;
- static void
- swap(_Fwd_list_node_base& __x, _Fwd_list_node_base& __y)
- { std::swap(__x._M_next, __y._M_next); }
-
- void
- _M_transfer_after(_Pointer __bbegin);
+ static void
+ swap(_Fwd_list_node_base& __x, _Fwd_list_node_base& __y)
+ { std::swap(__x._M_next, __y._M_next); }
- void
- _M_transfer_after(_Pointer __bbegin, _Pointer __bend);
-
- void
- _M_reverse_after();
- };
+ _Fwd_list_node_base*
+ _M_transfer_after(_Fwd_list_node_base* __begin)
+ {
+ _Fwd_list_node_base* __end = __begin;
+ while (__end && __end->_M_next)
+ __end = __end->_M_next;
+ return _M_transfer_after(__begin, __end);
+ }
+
+ _Fwd_list_node_base*
+ _M_transfer_after(_Fwd_list_node_base* __begin,
+ _Fwd_list_node_base* __end)
+ {
+ _Fwd_list_node_base* __keep = __begin->_M_next;
+ if (__end)
+ {
+ __begin->_M_next = __end->_M_next;
+ __end->_M_next = _M_next;
+ }
+ else
+ __begin->_M_next = 0;
+ _M_next = __keep;
+ return __end;
+ }
+
+ void
+ _M_reverse_after()
+ {
+ _Fwd_list_node_base* __tail = _M_next;
+ if (!__tail)
+ return;
+ while (_Fwd_list_node_base* __temp = __tail->_M_next)
+ {
+ _Fwd_list_node_base* __keep = _M_next;
+ _M_next = __temp;
+ __tail->_M_next = __temp->_M_next;
+ _M_next->_M_next = __keep;
+ }
+ }
+ };
/**
* @brief A helper node class for %forward_list.
* This is just a linked list with a data value in each node.
* There is a sorting utility method.
*/
- template<typename _Tp, typename _Alloc>
- struct _Fwd_list_node : public _Fwd_list_node_base<_Alloc>
+ template<typename _Tp>
+ struct _Fwd_list_node
+ : public _Fwd_list_node_base
{
- typedef typename _Alloc::template rebind<_Fwd_list_node<_Tp, _Alloc> >
- ::other::pointer _Pointer;
-
template<typename... _Args>
_Fwd_list_node(_Args&&... __args)
- : _Fwd_list_node_base<_Alloc>(),
+ : _Fwd_list_node_base(),
_M_value(std::forward<_Args>(__args)...) { }
_Tp _M_value;
@@ -96,32 +114,32 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* All the functions are op overloads.
*/
- template<typename _Tp, typename _Alloc>
+ template<typename _Tp>
struct _Fwd_list_iterator
{
- typedef _Fwd_list_iterator<_Tp, _Alloc> _Self;
- typedef _Fwd_list_node<_Tp, _Alloc> _Node;
- typedef _Fwd_list_node_base<_Alloc> _Node_base;
+ typedef _Fwd_list_iterator<_Tp> _Self;
+ typedef _Fwd_list_node<_Tp> _Node;
- typedef _Tp value_type;
- typedef typename _Alloc::pointer pointer;
- typedef typename _Alloc::reference reference;
- typedef typename _Alloc::difference_type difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+ typedef ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
- _Fwd_list_iterator() : _M_node() { }
+ _Fwd_list_iterator()
+ : _M_node() { }
explicit
- _Fwd_list_iterator(typename _Node_base::_Pointer __n)
+ _Fwd_list_iterator(_Fwd_list_node_base* __n)
: _M_node(__n) { }
reference
operator*() const
- { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+ { return static_cast<_Node*>(this->_M_node)->_M_value; }
pointer
operator->() const
- { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+ { return &static_cast<_Node*>(this->_M_node)->_M_value; }
_Self&
operator++()
@@ -155,7 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return _Fwd_list_iterator(0);
}
- typename _Node_base::_Pointer _M_node;
+ _Fwd_list_node_base* _M_node;
};
/**
@@ -163,24 +181,24 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*
* All the functions are op overloads.
*/
- template<typename _Tp, typename _Alloc>
+ template<typename _Tp>
struct _Fwd_list_const_iterator
{
- typedef _Fwd_list_const_iterator<_Tp, _Alloc> _Self;
- typedef const _Fwd_list_node<_Tp, _Alloc> _Node;
- typedef const _Fwd_list_node_base<_Alloc> _Node_base;
- typedef _Fwd_list_iterator<_Tp, _Alloc> iterator;
+ typedef _Fwd_list_const_iterator<_Tp> _Self;
+ typedef const _Fwd_list_node<_Tp> _Node;
+ typedef _Fwd_list_iterator<_Tp> iterator;
- typedef _Tp value_type;
- typedef typename _Alloc::const_pointer pointer;
- typedef typename _Alloc::const_reference reference;
- typedef typename _Alloc::difference_type difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+ typedef ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
- _Fwd_list_const_iterator() : _M_node() { }
+ _Fwd_list_const_iterator()
+ : _M_node() { }
explicit
- _Fwd_list_const_iterator(typename _Node_base::_Const_pointer __n)
+ _Fwd_list_const_iterator(const _Fwd_list_node_base* __n)
: _M_node(__n) { }
_Fwd_list_const_iterator(const iterator& __iter)
@@ -188,11 +206,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
reference
operator*() const
- { return __static_pointer_cast<_Node*>(_M_node)->_M_value; }
+ { return static_cast<_Node*>(this->_M_node)->_M_value; }
pointer
operator->() const
- { return &__static_pointer_cast<_Node*>(_M_node)->_M_value; }
+ { return &static_cast<_Node*>(this->_M_node)->_M_value; }
_Self&
operator++()
@@ -226,25 +244,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return _Fwd_list_const_iterator(0);
}
- typename _Node_base::_Const_pointer _M_node;
+ const _Fwd_list_node_base* _M_node;
};
/**
* @brief Forward list iterator equality comparison.
*/
- template<typename _Tp, typename _Alloc>
+ template<typename _Tp>
inline bool
- operator==(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
- const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ operator==(const _Fwd_list_iterator<_Tp>& __x,
+ const _Fwd_list_const_iterator<_Tp>& __y)
{ return __x._M_node == __y._M_node; }
/**
* @brief Forward list iterator inequality comparison.
*/
- template<typename _Tp, typename _Alloc>
+ template<typename _Tp>
inline bool
- operator!=(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
- const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
+ operator!=(const _Fwd_list_iterator<_Tp>& __x,
+ const _Fwd_list_const_iterator<_Tp>& __y)
{ return __x._M_node != __y._M_node; }
/**
@@ -257,12 +275,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
typedef typename _Alloc::template
- rebind<_Fwd_list_node<_Tp, _Tp_alloc_type>>::other _Node_alloc_type;
+ rebind<_Fwd_list_node<_Tp>>::other _Node_alloc_type;
struct _Fwd_list_impl
: public _Node_alloc_type
{
- _Fwd_list_node_base<_Tp_alloc_type> _M_head;
+ _Fwd_list_node_base _M_head;
_Fwd_list_impl()
: _Node_alloc_type(), _M_head()
@@ -276,11 +294,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_Fwd_list_impl _M_impl;
public:
- typedef _Fwd_list_iterator<_Tp, _Tp_alloc_type> iterator;
- typedef _Fwd_list_const_iterator<_Tp, _Tp_alloc_type> const_iterator;
-
- typedef _Fwd_list_node<_Tp, _Tp_alloc_type> _Node;
- typedef _Fwd_list_node_base<_Tp_alloc_type> _Node_base;
+ typedef _Fwd_list_iterator<_Tp> iterator;
+ typedef _Fwd_list_const_iterator<_Tp> const_iterator;
+ typedef _Fwd_list_node<_Tp> _Node;
_Node_alloc_type&
_M_get_Node_allocator()
@@ -302,28 +318,28 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_Fwd_list_base(_Fwd_list_base&& __lst, const _Alloc& __a)
: _M_impl(__a)
- { _Node_base::swap(this->_M_impl._M_head,
- __lst._M_impl._M_head); }
+ { _Fwd_list_node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
_Fwd_list_base(_Fwd_list_base&& __lst)
: _M_impl(__lst._M_get_Node_allocator())
- { _Node_base::swap(this->_M_impl._M_head,
- __lst._M_impl._M_head); }
+ { _Fwd_list_node_base::swap(this->_M_impl._M_head,
+ __lst._M_impl._M_head); }
~_Fwd_list_base()
{ _M_erase_after(&_M_impl._M_head, 0); }
protected:
- typename _Node::_Pointer
+ _Node*
_M_get_node()
{ return _M_get_Node_allocator().allocate(1); }
template<typename... _Args>
- typename _Node::_Pointer
+ _Node*
_M_create_node(_Args&&... __args)
{
- typename _Node::_Pointer __node = this->_M_get_node();
+ _Node* __node = this->_M_get_node();
__try
{
_M_get_Node_allocator().construct(__node,
@@ -339,19 +355,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
template<typename... _Args>
- typename _Node_base::_Pointer
+ _Fwd_list_node_base*
_M_insert_after(const_iterator __pos, _Args&&... __args);
void
- _M_put_node(typename _Node::_Pointer __p)
+ _M_put_node(_Node* __p)
{ _M_get_Node_allocator().deallocate(__p, 1); }
void
- _M_erase_after(typename _Node_base::_Pointer __pos);
+ _M_erase_after(_Fwd_list_node_base* __pos);
void
- _M_erase_after(typename _Node_base::_Pointer __pos,
- typename _Node_base::_Pointer __last);
+ _M_erase_after(_Fwd_list_node_base* __pos,
+ _Fwd_list_node_base* __last);
};
/**
@@ -390,8 +406,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
private:
typedef _Fwd_list_base<_Tp, _Alloc> _Base;
- typedef typename _Base::_Node _Node;
- typedef typename _Base::_Node_base _Node_base;
+ typedef _Fwd_list_node<_Tp> _Node;
+ typedef _Fwd_list_node_base _Node_base;
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
public:
@@ -402,8 +418,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename _Tp_alloc_type::reference reference;
typedef typename _Tp_alloc_type::const_reference const_reference;
- typedef typename _Base::iterator iterator;
- typedef typename _Base::const_iterator const_iterator;
+ typedef _Fwd_list_iterator<_Tp> iterator;
+ typedef _Fwd_list_const_iterator<_Tp> const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef _Alloc allocator_type;
@@ -731,8 +747,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
reference
front()
{
- _Node* __front =
- __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ _Node* __front = static_cast<_Node*>(this->_M_impl._M_head._M_next);
return __front->_M_value;
}
@@ -743,8 +758,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const_reference
front() const
{
- _Node* __front =
- __static_pointer_cast<_Node*>(this->_M_impl._M_head._M_next);
+ _Node* __front = static_cast<_Node*>(this->_M_impl._M_head._M_next);
return __front->_M_value;
}
@@ -852,7 +866,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* @param pos An iterator into the %forward_list.
* @param n Number of elements to be inserted.
* @param val Data to be inserted.
- * @return pos.
+ * @return An iterator pointing to the last inserted copy of
+ * @a val or @a pos if @a n == 0.
*
* This function will insert a specified number of copies of the
* given data after the location specified by @a pos.
@@ -861,20 +876,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* does not invalidate iterators and references.
*/
iterator
- insert_after(const_iterator __pos, size_type __n, const _Tp& __val)
- {
- forward_list __tmp(__n, __val, this->_M_get_Node_allocator());
- splice_after(__pos, std::move(__tmp));
- return iterator(__const_pointer_cast<typename _Node_base::_Pointer>
- (__pos._M_node));
- }
+ insert_after(const_iterator __pos, size_type __n, const _Tp& __val);
/**
* @brief Inserts a range into the %forward_list.
* @param position An iterator into the %forward_list.
* @param first An input iterator.
* @param last An input iterator.
- * @return pos.
+ * @return An iterator pointing to the last inserted element or
+ * @a pos if @a first == @a last.
*
* This function will insert copies of the data in the range [@a
* first,@a last) into the %forward_list after the location specified
@@ -886,20 +896,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _InputIterator>
iterator
insert_after(const_iterator __pos,
- _InputIterator __first, _InputIterator __last)
- {
- forward_list __tmp(__first, __last, this->_M_get_Node_allocator());
- splice_after(__pos, std::move(__tmp));
- return iterator(__const_pointer_cast<typename _Node_base::_Pointer>
- (__pos._M_node));
- }
+ _InputIterator __first, _InputIterator __last);
/**
* @brief Inserts the contents of an initializer_list into
* %forward_list after the specified iterator.
* @param pos An iterator into the %forward_list.
* @param il An initializer_list of value_type.
- * @return pos.
+ * @return An iterator pointing to the last inserted element
+ * or @a pos if @a il is empty.
*
* This function will insert copies of the data in the
* initializer_list @a il into the %forward_list before the location
@@ -909,13 +914,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* does not invalidate iterators and references.
*/
iterator
- insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
- {
- forward_list __tmp(__il, this->_M_get_Node_allocator());
- splice_after(__pos, std::move(__tmp));
- return iterator(__const_pointer_cast<typename _Node_base::_Pointer>
- (__pos._M_node));
- }
+ insert_after(const_iterator __pos, std::initializer_list<_Tp> __il);
/**
* @brief Removes the element pointed to by the iterator following
@@ -934,10 +933,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
void
erase_after(const_iterator __pos)
- {
- _Node_base* __tmp = __const_pointer_cast<_Node_base*>(__pos._M_node);
- this->_M_erase_after(__tmp);
- }
+ { this->_M_erase_after(const_cast<_Node_base*>(__pos._M_node)); }
/**
* @brief Remove a range of elements.
@@ -958,11 +954,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
*/
void
erase_after(const_iterator __pos, const_iterator __last)
- {
- _Node_base* __tmpp = __const_pointer_cast<_Node_base*>(__pos._M_node);
- _Node_base* __tmpl = __const_pointer_cast<_Node_base*>(__last._M_node);
- this->_M_erase_after(__tmpp, __tmpl);
- }
+ { this->_M_erase_after(const_cast<_Node_base*>(__pos._M_node),
+ const_cast<_Node_base*>(__last._M_node)); }
/**
* @brief Swaps data with another %forward_list.
@@ -1033,7 +1026,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* Requires this != @a x.
*/
void
- splice_after(const_iterator __pos, forward_list&& __list);
+ splice_after(const_iterator __pos, forward_list&& __list)
+ {
+ if (!__list.empty())
+ _M_splice_after(__pos, std::move(__list));
+ }
/**
* @brief Insert element from another %forward_list.
@@ -1206,6 +1203,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// turns out to be the same thing.
void
_M_fill_initialize(size_type __n, const value_type& __value);
+
+ // Called by splice_after and insert_after.
+ iterator
+ _M_splice_after(const_iterator __pos, forward_list&& __list);
};
/**
diff --git a/libstdc++-v3/include/bits/forward_list.tcc b/libstdc++-v3/include/bits/forward_list.tcc
index 685e533c385..7468a90d1af 100644
--- a/libstdc++-v3/include/bits/forward_list.tcc
+++ b/libstdc++-v3/include/bits/forward_list.tcc
@@ -31,94 +31,43 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
- template<typename _Alloc>
- void
- _Fwd_list_node_base<_Alloc>::
- _M_transfer_after(_Pointer __bbegin)
- {
- _Pointer __bend = __bbegin;
- while (__bend && __bend->_M_next)
- __bend = __bend->_M_next;
- _M_transfer_after(__bbegin, __bend);
- }
-
- template<typename _Alloc>
- void
- _Fwd_list_node_base<_Alloc>::
- _M_transfer_after(_Pointer __bbegin, _Pointer __bend)
- {
- _Pointer __keep = __bbegin->_M_next;
- if (__bend)
- {
- __bbegin->_M_next = __bend->_M_next;
- __bend->_M_next = _M_next;
- }
- else
- __bbegin->_M_next = 0;
- _M_next = __keep;
- }
-
- template<typename _Alloc>
- void
- _Fwd_list_node_base<_Alloc>::
- _M_reverse_after()
- {
- _Pointer __tail = _M_next;
- if (!__tail)
- return;
- while (_Pointer __temp = __tail->_M_next)
- {
- _Pointer __keep = _M_next;
- _M_next = __temp;
- __tail->_M_next = __temp->_M_next;
- _M_next->_M_next = __keep;
- }
- }
-
template<typename _Tp, typename _Alloc>
_Fwd_list_base<_Tp, _Alloc>::
_Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a)
: _M_impl(__a)
{
this->_M_impl._M_head._M_next = 0;
- typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
- typename _Node::_Pointer __curr
- = __static_pointer_cast<typename _Node::_Pointer>
- (__lst._M_impl._M_head._M_next);
+ _Fwd_list_node_base* __to = &this->_M_impl._M_head;
+ _Node* __curr = static_cast<_Node*>(__lst._M_impl._M_head._M_next);
+
while (__curr)
{
__to->_M_next = _M_create_node(__curr->_M_value);
__to = __to->_M_next;
- __curr = __static_pointer_cast<typename _Node::_Pointer>
- (__curr->_M_next);
+ __curr = static_cast<_Node*>(__curr->_M_next);
}
}
template<typename _Tp, typename _Alloc>
template<typename... _Args>
- typename _Fwd_list_base<_Tp, _Alloc>::_Node_base::_Pointer
+ _Fwd_list_node_base*
_Fwd_list_base<_Tp, _Alloc>::
_M_insert_after(const_iterator __pos, _Args&&... __args)
{
- typename _Node_base::_Pointer __to
- = __const_pointer_cast<typename _Node_base::_Pointer>
- (__pos._M_node);
- typename _Node::_Pointer __thing
- = __static_pointer_cast<typename _Node::_Pointer>(
- _M_create_node(std::forward<_Args>(__args)...) );
+ _Fwd_list_node_base* __to
+ = const_cast<_Fwd_list_node_base*>(__pos._M_node);
+ _Node* __thing = _M_create_node(std::forward<_Args>(__args)...);
__thing->_M_next = __to->_M_next;
__to->_M_next = __thing;
- return __static_pointer_cast<typename _Node_base::_Pointer>
- (__to->_M_next);
+ return __to->_M_next;
}
template<typename _Tp, typename _Alloc>
void
_Fwd_list_base<_Tp, _Alloc>::
- _M_erase_after(typename _Node_base::_Pointer __pos)
+ _M_erase_after(_Fwd_list_node_base* __pos)
{
- typename _Node::_Pointer __curr
- = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ _Node* __curr = static_cast<_Node*>(__pos->_M_next);
__pos->_M_next = __curr->_M_next;
_M_get_Node_allocator().destroy(__curr);
_M_put_node(__curr);
@@ -127,16 +76,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _Tp, typename _Alloc>
void
_Fwd_list_base<_Tp, _Alloc>::
- _M_erase_after(typename _Node_base::_Pointer __pos,
- typename _Node_base::_Pointer __last)
+ _M_erase_after(_Fwd_list_node_base* __pos,
+ _Fwd_list_node_base* __last)
{
- typename _Node::_Pointer __curr
- = __static_pointer_cast<typename _Node::_Pointer>(__pos->_M_next);
+ _Node* __curr = static_cast<_Node*>(__pos->_M_next);
while (__curr != __last)
{
- typename _Node::_Pointer __temp = __curr;
- __curr = __static_pointer_cast<typename _Node::_Pointer>
- (__curr->_M_next);
+ _Node* __temp = __curr;
+ __curr = static_cast<_Node*>(__curr->_M_next);
_M_get_Node_allocator().destroy(__temp);
_M_put_node(__temp);
}
@@ -151,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{
- typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ _Node_base* __to = &this->_M_impl._M_head;
for (; __first != __last; ++__first)
{
__to->_M_next = this->_M_create_node(*__first);
@@ -166,7 +113,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>::
_M_fill_initialize(size_type __n, const value_type& __value)
{
- typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ _Node_base* __to = &this->_M_impl._M_head;
for (; __n > 0; --__n)
{
__to->_M_next = this->_M_create_node(__value);
@@ -179,7 +126,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list(size_type __n)
: _Base()
{
- typename _Node_base::_Pointer __to = &this->_M_impl._M_head;
+ _Node_base* __to = &this->_M_impl._M_head;
for (; __n > 0; --__n)
{
__to->_M_next = this->_M_create_node();
@@ -256,36 +203,66 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
template<typename _Tp, typename _Alloc>
- void
+ typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::
- splice_after(const_iterator __pos, forward_list&& __list)
+ _M_splice_after(const_iterator __pos, forward_list&& __list)
{
- if (!__list.empty() && &__list != this)
- {
- typename _Node_base::_Pointer __tmp
- = __const_pointer_cast<typename _Node_base::_Pointer>
- (__pos._M_node);
- const_iterator __before = __list.cbefore_begin();
- __tmp->_M_transfer_after(__const_pointer_cast
- <typename _Node_base::_Pointer>
- (__before._M_node));
- }
+ _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node);
+ iterator __before = __list.before_begin();
+ return iterator(__tmp->_M_transfer_after(__before._M_node));
}
template<typename _Tp, typename _Alloc>
void
forward_list<_Tp, _Alloc>::
- splice_after(const_iterator __pos, forward_list&& __list,
+ splice_after(const_iterator __pos, forward_list&&,
const_iterator __before, const_iterator __last)
{
- typename _Node_base::_Pointer __tmp
- = __const_pointer_cast<typename _Node_base::_Pointer>(__pos._M_node);
- __tmp->_M_transfer_after(__const_pointer_cast
- <typename _Node_base::_Pointer>
- (__before._M_node),
- __const_pointer_cast
- <typename _Node_base::_Pointer>
- (__last._M_node));
+ _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node);
+ __tmp->_M_transfer_after(const_cast<_Node_base*>(__before._M_node),
+ const_cast<_Node_base*>(__last._M_node));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename forward_list<_Tp, _Alloc>::iterator
+ forward_list<_Tp, _Alloc>::
+ insert_after(const_iterator __pos, size_type __n, const _Tp& __val)
+ {
+ if (__n)
+ {
+ forward_list __tmp(__n, __val, this->_M_get_Node_allocator());
+ return _M_splice_after(__pos, std::move(__tmp));
+ }
+ else
+ return iterator(const_cast<_Node_base*>(__pos._M_node));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename _InputIterator>
+ typename forward_list<_Tp, _Alloc>::iterator
+ forward_list<_Tp, _Alloc>::
+ insert_after(const_iterator __pos,
+ _InputIterator __first, _InputIterator __last)
+ {
+ forward_list __tmp(__first, __last, this->_M_get_Node_allocator());
+ if (!__tmp.empty())
+ return _M_splice_after(__pos, std::move(__tmp));
+ else
+ return iterator(const_cast<_Node_base*>(__pos._M_node));
+ }
+
+ template<typename _Tp, typename _Alloc>
+ typename forward_list<_Tp, _Alloc>::iterator
+ forward_list<_Tp, _Alloc>::
+ insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
+ {
+ if (__il.size())
+ {
+ forward_list __tmp(__il, this->_M_get_Node_allocator());
+ return _M_splice_after(__pos, std::move(__tmp));
+ }
+ else
+ return iterator(const_cast<_Node_base*>(__pos._M_node));
}
template<typename _Tp, typename _Alloc>
@@ -293,17 +270,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>::
remove(const _Tp& __val)
{
- typename _Node::_Pointer __curr
- = __static_pointer_cast<typename _Node::_Pointer>
- (&this->_M_impl._M_head);
- while (typename _Node::_Pointer __temp =
- __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ _Node* __curr = static_cast<_Node*>(&this->_M_impl._M_head);
+ while (_Node* __temp = static_cast<_Node*>(__curr->_M_next))
{
if (__temp->_M_value == __val)
this->_M_erase_after(__curr);
else
- __curr = __static_pointer_cast<typename _Node::_Pointer>
- (__curr->_M_next);
+ __curr = static_cast<_Node*>(__curr->_M_next);
}
}
@@ -313,17 +286,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>::
remove_if(_Pred __pred)
{
- typename _Node::_Pointer __curr
- = __static_pointer_cast<typename _Node::_Pointer>
- (&this->_M_impl._M_head);
- while (typename _Node::_Pointer __temp =
- __static_pointer_cast<typename _Node::_Pointer>(__curr->_M_next))
+ _Node* __curr = static_cast<_Node*>(&this->_M_impl._M_head);
+ while (_Node* __temp = static_cast<_Node*>(__curr->_M_next))
{
if (__pred(__temp->_M_value))
this->_M_erase_after(__curr);
else
- __curr = __static_pointer_cast<typename _Node::_Pointer>
- (__curr->_M_next);
+ __curr = static_cast<_Node*>(__curr->_M_next);
}
}
@@ -354,12 +323,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>::
merge(forward_list&& __list, _Comp __comp)
{
- typename _Node_base::_Pointer __node = &this->_M_impl._M_head;
+ _Node_base* __node = &this->_M_impl._M_head;
while (__node->_M_next && __list._M_impl._M_head._M_next)
{
- if (__comp(__static_pointer_cast<typename _Node::_Pointer>
+ if (__comp(static_cast<_Node*>
(__list._M_impl._M_head._M_next)->_M_value,
- __static_pointer_cast<typename _Node::_Pointer>
+ static_cast<_Node*>
(__node->_M_next)->_M_value))
__node->_M_transfer_after(&__list._M_impl._M_head,
__list._M_impl._M_head._M_next);
@@ -400,11 +369,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
forward_list<_Tp, _Alloc>::
sort(_Comp __comp)
{
- typedef typename _Node::_Pointer _Pointer;
-
// If `next' is 0, return immediately.
- _Pointer __list =
- __static_pointer_cast<_Pointer>(this->_M_impl._M_head._M_next);
+ _Node* __list = static_cast<_Node*>(this->_M_impl._M_head._M_next);
if (!__list)
return;
@@ -412,9 +378,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
while (1)
{
- _Pointer __p = __list;
+ _Node* __p = __list;
__list = 0;
- _Pointer __tail = 0;
+ _Node* __tail = 0;
// Count number of merges we do in this pass.
unsigned long __nmerges = 0;
@@ -424,12 +390,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
++__nmerges;
// There exists a merge to be done.
// Step `insize' places along from p.
- _Pointer __q = __p;
+ _Node* __q = __p;
unsigned long __psize = 0;
for (unsigned long __i = 0; __i < __insize; ++__i)
{
++__psize;
- __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ __q = static_cast<_Node*>(__q->_M_next);
if (!__q)
break;
}
@@ -441,33 +407,33 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
while (__psize > 0 || (__qsize > 0 && __q))
{
// Decide whether next node of merge comes from p or q.
- _Pointer __e;
+ _Node* __e;
if (__psize == 0)
{
// p is empty; e must come from q.
__e = __q;
- __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ __q = static_cast<_Node*>(__q->_M_next);
--__qsize;
}
else if (__qsize == 0 || !__q)
{
// q is empty; e must come from p.
__e = __p;
- __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ __p = static_cast<_Node*>(__p->_M_next);
--__psize;
}
else if (__comp(__p->_M_value, __q->_M_value))
{
// First node of p is lower; e must come from p.
__e = __p;
- __p = __static_pointer_cast<_Pointer>(__p->_M_next);
+ __p = static_cast<_Node*>(__p->_M_next);
--__psize;
}
else
{
// First node of q is lower; e must come from q.
__e = __q;
- __q = __static_pointer_cast<_Pointer>(__q->_M_next);
+ __q = static_cast<_Node*>(__q->_M_next);
--__qsize;
}
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index 8471dfbf4ea..142c57fd9a6 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -56,29 +56,6 @@ namespace __detail
return __distance_fw(__first, __last, _Tag());
}
- template<typename _RAIter, typename _Tp>
- _RAIter
- __lower_bound(_RAIter __first, _RAIter __last, const _Tp& __val)
- {
- typedef typename std::iterator_traits<_RAIter>::difference_type _DType;
-
- _DType __len = __last - __first;
- while (__len > 0)
- {
- _DType __half = __len >> 1;
- _RAIter __middle = __first + __half;
- if (*__middle < __val)
- {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
- }
-
// Auxiliary types used for all instantiations of _Hashtable: nodes
// and iterators.
@@ -447,8 +424,8 @@ namespace __detail
_Prime_rehash_policy::
_M_next_bkt(std::size_t __n) const
{
- const unsigned long* __p = __lower_bound(__prime_list, __prime_list
- + _S_n_primes, __n);
+ const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __n);
_M_next_resize =
static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
return *__p;
@@ -461,8 +438,8 @@ namespace __detail
_M_bkt_for_elements(std::size_t __n) const
{
const float __min_bkts = __n / _M_max_load_factor;
- const unsigned long* __p = __lower_bound(__prime_list, __prime_list
- + _S_n_primes, __min_bkts);
+ const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __min_bkts);
_M_next_resize =
static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
return *__p;
@@ -490,8 +467,8 @@ namespace __detail
{
__min_bkts = std::max(__min_bkts, _M_growth_factor * __n_bkt);
const unsigned long* __p =
- __lower_bound(__prime_list, __prime_list + _S_n_primes,
- __min_bkts);
+ std::lower_bound(__prime_list, __prime_list + _S_n_primes,
+ __min_bkts);
_M_next_resize = static_cast<std::size_t>
(__builtin_ceil(*__p * _M_max_load_factor));
return std::make_pair(true, *__p);
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 159724c89ee..cc950f03ae2 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -268,7 +268,8 @@ namespace std
* @param __rhs Another linear congruential random number generator
* object.
*
- * @returns true if the two objects are equal, false otherwise.
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
*/
friend bool
operator==(const linear_congruential_engine& __lhs,
@@ -314,6 +315,25 @@ namespace std
_UIntType _M_x;
};
+ /**
+ * @brief Compares two linear congruential random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A linear congruential random number generator object.
+ * @param __rhs Another linear congruential random number generator
+ * object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
+ inline bool
+ operator!=(const std::linear_congruential_engine<_UIntType, __a,
+ __c, __m>& __lhs,
+ const std::linear_congruential_engine<_UIntType, __a,
+ __c, __m>& __rhs)
+ { return !(__lhs == __rhs); }
+
/**
* A generalized feedback shift register discrete random number generator.
@@ -461,7 +481,8 @@ namespace std
* @param __rhs Another % mersenne_twister_engine random number
* generator object.
*
- * @returns true if the two objects are equal, false otherwise.
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
*/
friend bool
operator==(const mersenne_twister_engine& __lhs,
@@ -526,6 +547,31 @@ namespace std
};
/**
+ * @brief Compares two % mersenne_twister_engine random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A % mersenne_twister_engine random number generator
+ * object.
+ * @param __rhs Another % mersenne_twister_engine random number
+ * generator object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _UIntType, size_t __w,
+ size_t __n, size_t __m, size_t __r,
+ _UIntType __a, size_t __u, _UIntType __d, size_t __s,
+ _UIntType __b, size_t __t,
+ _UIntType __c, size_t __l, _UIntType __f>
+ inline bool
+ operator!=(const std::mersenne_twister_engine<_UIntType, __w, __n, __m,
+ __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
+ const std::mersenne_twister_engine<_UIntType, __w, __n, __m,
+ __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
* @brief The Marsaglia-Zaman generator.
*
* This is a model of a Generalized Fibonacci discrete random number
@@ -655,8 +701,9 @@ namespace std
* @param __rhs Another % subtract_with_carry_engine random number
* generator object.
*
- * @returns true if the two objects are equal, false otherwise.
- */
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
+ */
friend bool
operator==(const subtract_with_carry_engine& __lhs,
const subtract_with_carry_engine& __rhs)
@@ -707,6 +754,27 @@ namespace std
};
/**
+ * @brief Compares two % subtract_with_carry_engine random number
+ * generator objects of the same type for inequality.
+ *
+ * @param __lhs A % subtract_with_carry_engine random number generator
+ * object.
+ * @param __rhs Another % subtract_with_carry_engine random number
+ * generator object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _UIntType, size_t __w, size_t __s, size_t __r>
+ inline bool
+ operator!=(const std::subtract_with_carry_engine<_UIntType, __w,
+ __s, __r>& __lhs,
+ const std::subtract_with_carry_engine<_UIntType, __w,
+ __s, __r>& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
* Produces random numbers from some base engine by discarding blocks of
* data.
*
@@ -865,12 +933,13 @@ namespace std
* @param __rhs Another %discard_block_engine random number generator
* object.
*
- * @returns true if the two objects are equal, false otherwise.
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
*/
friend bool
operator==(const discard_block_engine& __lhs,
const discard_block_engine& __rhs)
- { return (__lhs._M_b == __rhs._M_b) && (__lhs._M_n == __rhs._M_n); }
+ { return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
/**
* @brief Inserts the current state of a %discard_block_engine random
@@ -914,6 +983,26 @@ namespace std
};
/**
+ * @brief Compares two %discard_block_engine random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A %discard_block_engine random number generator object.
+ * @param __rhs Another %discard_block_engine random number generator
+ * object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _RandomNumberEngine, size_t __p, size_t __r>
+ inline bool
+ operator!=(const std::discard_block_engine<_RandomNumberEngine, __p,
+ __r>& __lhs,
+ const std::discard_block_engine<_RandomNumberEngine, __p,
+ __r>& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
* Produces random numbers by combining random numbers from some base
* engine to produce random numbers with a specifies number of bits @p __w.
*/
@@ -1060,7 +1149,8 @@ namespace std
* @param __rhs Another %independent_bits_engine random number generator
* object.
*
- * @returns true if the two objects are equal, false otherwise.
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
*/
friend bool
operator==(const independent_bits_engine& __lhs,
@@ -1094,6 +1184,26 @@ namespace std
};
/**
+ * @brief Compares two %independent_bits_engine random number generator
+ * objects of the same type for inequality.
+ *
+ * @param __lhs A %independent_bits_engine random number generator
+ * object.
+ * @param __rhs Another %independent_bits_engine random number generator
+ * object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
+ inline bool
+ operator!=(const std::independent_bits_engine<_RandomNumberEngine, __w,
+ _UIntType>& __lhs,
+ const std::independent_bits_engine<_RandomNumberEngine, __w,
+ _UIntType>& __rhs)
+ { return !(__lhs == __rhs); }
+
+ /**
* @brief Inserts the current state of a %independent_bits_engine random
* number generator engine @p __x into the output stream @p __os.
*
@@ -1114,6 +1224,7 @@ namespace std
return __os;
}
+
/**
* @brief Produces random numbers by combining random numbers from some
* base engine to produce random numbers with a specifies number of bits
@@ -1273,8 +1384,9 @@ namespace std
* @param __rhs Another %shuffle_order_engine random number generator
* object.
*
- * @returns true if the two objects are equal, false otherwise.
- */
+ * @returns true if the infinite sequences of generated values
+ * would be equal, false otherwise.
+ */
friend bool
operator==(const shuffle_order_engine& __lhs,
const shuffle_order_engine& __rhs)
@@ -1329,6 +1441,26 @@ namespace std
};
/**
+ * Compares two %shuffle_order_engine random number generator objects
+ * of the same type for inequality.
+ *
+ * @param __lhs A %shuffle_order_engine random number generator object.
+ * @param __rhs Another %shuffle_order_engine random number generator
+ * object.
+ *
+ * @returns true if the infinite sequences of generated values
+ * would be different, false otherwise.
+ */
+ template<typename _RandomNumberEngine, size_t __k>
+ inline bool
+ operator!=(const std::shuffle_order_engine<_RandomNumberEngine,
+ __k>& __lhs,
+ const std::shuffle_order_engine<_RandomNumberEngine,
+ __k>& __rhs)
+ { return !(__lhs == __rhs); }
+
+
+ /**
* The classic Minimum Standard rand0 of Lewis, Goodman, and Miller.
*/
typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
@@ -1522,6 +1654,10 @@ namespace std
b() const
{ return _M_b; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
private:
_IntType _M_a;
_IntType _M_b;
@@ -1559,20 +1695,6 @@ namespace std
{ return _M_param.b(); }
/**
- * @brief Returns the inclusive lower bound of the distribution range.
- */
- result_type
- min() const
- { return this->a(); }
-
- /**
- * @brief Returns the inclusive upper bound of the distribution range.
- */
- result_type
- max() const
- { return this->b(); }
-
- /**
* @brief Returns the parameter set of the distribution.
*/
param_type
@@ -1588,19 +1710,27 @@ namespace std
{ _M_param = __param; }
/**
- * Gets a uniformly distributed random number in the range
- * @f$(min, max)@f$.
+ * @brief Returns the inclusive lower bound of the distribution range.
+ */
+ result_type
+ min() const
+ { return this->a(); }
+
+ /**
+ * @brief Returns the inclusive upper bound of the distribution range.
+ */
+ result_type
+ max() const
+ { return this->b(); }
+
+ /**
+ * @brief Generating functions.
*/
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
{ return this->operator()(__urng, this->param()); }
- /**
- * Gets a uniform random number in the range @f$[0, n)@f$.
- *
- * This function is aimed at use with std::random_shuffle.
- */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng,
@@ -1610,6 +1740,26 @@ namespace std
};
/**
+ * @brief Return true if two uniform integer distributions have
+ * the same parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator==(const std::uniform_int_distribution<_IntType>& __d1,
+ const std::uniform_int_distribution<_IntType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two uniform integer distributions have
+ * different parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::uniform_int_distribution<_IntType>& __d1,
+ const std::uniform_int_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %uniform_int_distribution random number
* distribution @p __x into the output stream @p os.
*
@@ -1676,6 +1826,10 @@ namespace std
b() const
{ return _M_b; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
private:
_RealType _M_a;
_RealType _M_b;
@@ -1716,6 +1870,21 @@ namespace std
{ return _M_param.b(); }
/**
+ * @brief Returns the parameter set of the distribution.
+ */
+ param_type
+ param() const
+ { return _M_param; }
+
+ /**
+ * @brief Sets the parameter set of the distribution.
+ * @param __param The new parameter set of the distribution.
+ */
+ void
+ param(const param_type& __param)
+ { _M_param = __param; }
+
+ /**
* @brief Returns the inclusive lower bound of the distribution range.
*/
result_type
@@ -1730,20 +1899,8 @@ namespace std
{ return this->b(); }
/**
- * @brief Returns the parameter set of the distribution.
- */
- param_type
- param() const
- { return _M_param; }
-
- /**
- * @brief Sets the parameter set of the distribution.
- * @param __param The new parameter set of the distribution.
+ * @brief Generating functions.
*/
- void
- param(const param_type& __param)
- { _M_param = __param; }
-
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -1764,6 +1921,26 @@ namespace std
};
/**
+ * @brief Return true if two uniform real distributions have
+ * the same parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator==(const std::uniform_real_distribution<_IntType>& __d1,
+ const std::uniform_real_distribution<_IntType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two uniform real distributions have
+ * different parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::uniform_real_distribution<_IntType>& __d1,
+ const std::uniform_real_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %uniform_real_distribution random number
* distribution @p __x into the output stream @p __os.
*
@@ -1839,6 +2016,11 @@ namespace std
stddev() const
{ return _M_stddev; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return (__p1._M_mean == __p2._M_mean
+ && __p1._M_stddev == __p2._M_stddev); }
+
private:
_RealType _M_mean;
_RealType _M_stddev;
@@ -1910,6 +2092,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -1921,6 +2106,16 @@ namespace std
const param_type& __p);
/**
+ * @brief Return true if two normal distributions have
+ * the same parameters and the sequences that would
+ * be generated are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::normal_distribution<_RealType1>& __d1,
+ const std::normal_distribution<_RealType1>& __d2);
+
+ /**
* @brief Inserts a %normal_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -1956,6 +2151,15 @@ namespace std
bool _M_saved_available;
};
+ /**
+ * @brief Return true if two normal distributions are different.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::normal_distribution<_RealType>& __d1,
+ const std::normal_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A lognormal_distribution random number distribution.
@@ -1994,6 +2198,10 @@ namespace std
s() const
{ return _M_s; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
+
private:
_RealType _M_m;
_RealType _M_s;
@@ -2057,6 +2265,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2069,6 +2280,18 @@ namespace std
{ return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
/**
+ * @brief Return true if two lognormal distributions have
+ * the same parameters and the sequences that would
+ * be generated are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::lognormal_distribution<_RealType1>& __d1,
+ const std::lognormal_distribution<_RealType1>& __d2)
+ { return (__d1.param() == __d2.param()
+ && __d1._M_nd == __d2._M_nd); }
+
+ /**
* @brief Inserts a %lognormal_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2104,7 +2327,16 @@ namespace std
std::normal_distribution<result_type> _M_nd;
};
-
+ /**
+ * @brief Return true if two lognormal distributions are different.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::lognormal_distribution<_RealType>& __d1,
+ const std::lognormal_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
+
/**
* @brief A gamma continuous distribution for random numbers.
*
@@ -2146,6 +2378,11 @@ namespace std
beta() const
{ return _M_beta; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return (__p1._M_alpha == __p2._M_alpha
+ && __p1._M_beta == __p2._M_beta); }
+
private:
void
_M_initialize();
@@ -2222,6 +2459,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2233,6 +2473,18 @@ namespace std
const param_type& __p);
/**
+ * @brief Return true if two gamma distributions have the same
+ * parameters and the sequences that would be generated
+ * are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::gamma_distribution<_RealType1>& __d1,
+ const std::gamma_distribution<_RealType1>& __d2)
+ { return (__d1.param() == __d2.param()
+ && __d1._M_nd == __d2._M_nd); }
+
+ /**
* @brief Inserts a %gamma_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2267,6 +2519,15 @@ namespace std
std::normal_distribution<result_type> _M_nd;
};
+ /**
+ * @brief Return true if two gamma distributions are different.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::gamma_distribution<_RealType>& __d1,
+ const std::gamma_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A chi_squared_distribution random number distribution.
@@ -2297,6 +2558,10 @@ namespace std
n() const
{ return _M_n; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_n == __p2._M_n; }
+
private:
_RealType _M_n;
};
@@ -2354,6 +2619,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2370,6 +2638,17 @@ namespace std
}
/**
+ * @brief Return true if two Chi-squared distributions have
+ * the same parameters and the sequences that would be
+ * generated are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::chi_squared_distribution<_RealType1>& __d1,
+ const std::chi_squared_distribution<_RealType1>& __d2)
+ { return __d1.param() == __d2.param() && __d1._M_gd == __d2._M_gd; }
+
+ /**
* @brief Inserts a %chi_squared_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2405,6 +2684,15 @@ namespace std
std::gamma_distribution<result_type> _M_gd;
};
+ /**
+ * @brief Return true if two Chi-squared distributions are different.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::chi_squared_distribution<_RealType>& __d1,
+ const std::chi_squared_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A cauchy_distribution random number distribution.
@@ -2440,6 +2728,10 @@ namespace std
b() const
{ return _M_b; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
private:
_RealType _M_a;
_RealType _M_b;
@@ -2503,6 +2795,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2518,6 +2813,26 @@ namespace std
};
/**
+ * @brief Return true if two Cauchy distributions have
+ * the same parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::cauchy_distribution<_RealType>& __d1,
+ const std::cauchy_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two Cauchy distributions have
+ * different parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::cauchy_distribution<_RealType>& __d1,
+ const std::cauchy_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %cauchy_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2586,6 +2901,10 @@ namespace std
n() const
{ return _M_n; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
+
private:
_RealType _M_m;
_RealType _M_n;
@@ -2652,6 +2971,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2669,6 +2991,19 @@ namespace std
}
/**
+ * @brief Return true if two Fisher f distributions have
+ * the same parameters and the sequences that would
+ * be generated are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::fisher_f_distribution<_RealType1>& __d1,
+ const std::fisher_f_distribution<_RealType1>& __d2)
+ { return (__d1.param() == __d2.param()
+ && __d1._M_gd_x == __d2._M_gd_x
+ && __d1._M_gd_y == __d2._M_gd_y); }
+
+ /**
* @brief Inserts a %fisher_f_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2704,6 +3039,14 @@ namespace std
std::gamma_distribution<result_type> _M_gd_x, _M_gd_y;
};
+ /**
+ * @brief Return true if two Fisher f distributions are diferent.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::fisher_f_distribution<_RealType>& __d1,
+ const std::fisher_f_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
/**
* @brief A student_t_distribution random number distribution.
@@ -2737,6 +3080,10 @@ namespace std
n() const
{ return _M_n; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_n == __p2._M_n; }
+
private:
_RealType _M_n;
};
@@ -2797,6 +3144,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -2815,6 +3165,18 @@ namespace std
}
/**
+ * @brief Return true if two Student t distributions have
+ * the same parameters and the sequences that would
+ * be generated are equal.
+ */
+ template<typename _RealType1>
+ friend bool
+ operator==(const std::student_t_distribution<_RealType1>& __d1,
+ const std::student_t_distribution<_RealType1>& __d2)
+ { return (__d1.param() == __d2.param()
+ && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
+
+ /**
* @brief Inserts a %student_t_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -2851,6 +3213,16 @@ namespace std
std::gamma_distribution<result_type> _M_gd;
};
+ /**
+ * @brief Return true if two Student t distributions are different.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::student_t_distribution<_RealType>& __d1,
+ const std::student_t_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
+
/* @} */ // group random_distributions_normal
/**
@@ -2886,6 +3258,10 @@ namespace std
p() const
{ return _M_p; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_p == __p2._M_p; }
+
private:
double _M_p;
};
@@ -2952,7 +3328,7 @@ namespace std
{ return std::numeric_limits<result_type>::max(); }
/**
- * @brief Returns the next value in the Bernoullian sequence.
+ * @brief Generating functions.
*/
template<typename _UniformRandomNumberGenerator>
result_type
@@ -2977,6 +3353,24 @@ namespace std
};
/**
+ * @brief Return true if two Bernoulli distributions have
+ * the same parameters.
+ */
+ inline bool
+ operator==(const std::bernoulli_distribution& __d1,
+ const std::bernoulli_distribution& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two Bernoulli distributions have
+ * different parameters.
+ */
+ inline bool
+ operator!=(const std::bernoulli_distribution& __d1,
+ const std::bernoulli_distribution& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %bernoulli_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -3052,6 +3446,10 @@ namespace std
p() const
{ return _M_p; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
+
private:
void
_M_initialize();
@@ -3129,6 +3527,9 @@ namespace std
max() const
{ return _M_param.t(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -3140,6 +3541,21 @@ namespace std
const param_type& __p);
/**
+ * @brief Return true if two binomial distributions have
+ * the same parameters and the sequences that would
+ * be generated are equal.
+ */
+ template<typename _IntType1>
+ friend bool
+ operator==(const std::binomial_distribution<_IntType1>& __d1,
+ const std::binomial_distribution<_IntType1>& __d2)
+#ifdef _GLIBCXX_USE_C99_MATH_TR1
+ { return __d1.param() == __d2.param() && __d1._M_nd == __d2._M_nd; }
+#else
+ { return __d1.param() == __d2.param(); }
+#endif
+
+ /**
* @brief Inserts a %binomial_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -3182,6 +3598,15 @@ namespace std
std::normal_distribution<double> _M_nd;
};
+ /**
+ * @brief Return true if two binomial distributions are different.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::binomial_distribution<_IntType>& __d1,
+ const std::binomial_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A discrete geometric random number distribution.
@@ -3218,6 +3643,10 @@ namespace std
p() const
{ return _M_p; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_p == __p2._M_p; }
+
private:
void
_M_initialize()
@@ -3283,6 +3712,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -3298,6 +3730,26 @@ namespace std
};
/**
+ * @brief Return true if two geometric distributions have
+ * the same parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator==(const std::geometric_distribution<_IntType>& __d1,
+ const std::geometric_distribution<_IntType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two geometric distributions have
+ * different parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::geometric_distribution<_IntType>& __d1,
+ const std::geometric_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %geometric_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -3363,6 +3815,10 @@ namespace std
p() const
{ return _M_p; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
+
private:
_IntType _M_k;
double _M_p;
@@ -3428,6 +3884,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng);
@@ -3438,6 +3897,17 @@ namespace std
const param_type& __p);
/**
+ * @brief Return true if two negative binomial distributions have
+ * the same parameters and the sequences that would be
+ * generated are equal.
+ */
+ template<typename _IntType1>
+ friend bool
+ operator==(const std::negative_binomial_distribution<_IntType1>& __d1,
+ const std::negative_binomial_distribution<_IntType1>& __d2)
+ { return __d1.param() == __d2.param() && __d1._M_gd == __d2._M_gd; }
+
+ /**
* @brief Inserts a %negative_binomial_distribution random
* number distribution @p __x into the output stream @p __os.
*
@@ -3474,6 +3944,16 @@ namespace std
std::gamma_distribution<double> _M_gd;
};
+ /**
+ * @brief Return true if two negative binomial distributions are different.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::negative_binomial_distribution<_IntType>& __d1,
+ const std::negative_binomial_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
+
/* @} */ // group random_distributions_bernoulli
/**
@@ -3516,6 +3996,10 @@ namespace std
mean() const
{ return _M_mean; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_mean == __p2._M_mean; }
+
private:
// Hosts either log(mean) or the threshold of the simple method.
void
@@ -3583,6 +4067,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -3593,6 +4080,21 @@ namespace std
operator()(_UniformRandomNumberGenerator& __urng,
const param_type& __p);
+ /**
+ * @brief Return true if two Poisson distributions have the same
+ * parameters and the sequences that would be generated
+ * are equal.
+ */
+ template<typename _IntType1>
+ friend bool
+ operator==(const std::poisson_distribution<_IntType1>& __d1,
+ const std::poisson_distribution<_IntType1>& __d2)
+#ifdef _GLIBCXX_USE_C99_MATH_TR1
+ { return __d1.param() == __d2.param() && __d1._M_nd == __d2._M_nd; }
+#else
+ { return __d1.param() == __d2.param(); }
+#endif
+
/**
* @brief Inserts a %poisson_distribution random number distribution
* @p __x into the output stream @p __os.
@@ -3631,6 +4133,16 @@ namespace std
};
/**
+ * @brief Return true if two Poisson distributions are different.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::poisson_distribution<_IntType>& __d1,
+ const std::poisson_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
+
+ /**
* @brief An exponential continuous distribution for random numbers.
*
* The formula for the exponential probability density function is
@@ -3670,6 +4182,10 @@ namespace std
lambda() const
{ return _M_lambda; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_lambda == __p2._M_lambda; }
+
private:
_RealType _M_lambda;
};
@@ -3733,6 +4249,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -3753,6 +4272,26 @@ namespace std
};
/**
+ * @brief Return true if two exponential distributions have the same
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::exponential_distribution<_RealType>& __d1,
+ const std::exponential_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two exponential distributions have different
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::exponential_distribution<_RealType>& __d1,
+ const std::exponential_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %exponential_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -3820,6 +4359,10 @@ namespace std
b() const
{ return _M_b; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
private:
_RealType _M_a;
_RealType _M_b;
@@ -3886,6 +4429,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -3900,6 +4446,26 @@ namespace std
param_type _M_param;
};
+ /**
+ * @brief Return true if two Weibull distributions have the same
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::weibull_distribution<_RealType>& __d1,
+ const std::weibull_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two Weibull distributions have different
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::weibull_distribution<_RealType>& __d1,
+ const std::weibull_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief Inserts a %weibull_distribution random number distribution
* @p __x into the output stream @p __os.
@@ -3968,6 +4534,10 @@ namespace std
b() const
{ return _M_b; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
private:
_RealType _M_a;
_RealType _M_b;
@@ -4034,6 +4604,9 @@ namespace std
max() const
{ return std::numeric_limits<result_type>::max(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -4049,6 +4622,26 @@ namespace std
};
/**
+ * @brief Return true if two extreme value distributions have the same
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::extreme_value_distribution<_RealType>& __d1,
+ const std::extreme_value_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two extreme value distributions have different
+ * parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::extreme_value_distribution<_RealType>& __d1,
+ const std::extreme_value_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
+ /**
* @brief Inserts a %extreme_value_distribution random number distribution
* @p __x into the output stream @p __os.
*
@@ -4122,6 +4715,10 @@ namespace std
probabilities() const
{ return _M_prob; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_prob == __p2._M_prob; }
+
private:
void
_M_initialize();
@@ -4198,6 +4795,9 @@ namespace std
max() const
{ return this->_M_param._M_prob.size() - 1; }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -4243,6 +4843,26 @@ namespace std
param_type _M_param;
};
+ /**
+ * @brief Return true if two discrete distributions have the same
+ * parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator==(const std::discrete_distribution<_IntType>& __d1,
+ const std::discrete_distribution<_IntType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two discrete distributions have different
+ * parameters.
+ */
+ template<typename _IntType>
+ inline bool
+ operator!=(const std::discrete_distribution<_IntType>& __d1,
+ const std::discrete_distribution<_IntType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A piecewise_constant_distribution random number distribution.
@@ -4289,6 +4909,10 @@ namespace std
densities() const
{ return _M_den; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
+
private:
void
_M_initialize();
@@ -4378,6 +5002,9 @@ namespace std
max() const
{ return this->_M_param._M_int.back(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -4424,6 +5051,26 @@ namespace std
param_type _M_param;
};
+ /**
+ * @brief Return true if two piecewise constant distributions have the
+ * same parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::piecewise_constant_distribution<_RealType>& __d1,
+ const std::piecewise_constant_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two piecewise constant distributions have
+ * different parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::piecewise_constant_distribution<_RealType>& __d1,
+ const std::piecewise_constant_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/**
* @brief A piecewise_linear_distribution random number distribution.
@@ -4470,6 +5117,11 @@ namespace std
densities() const
{ return _M_den; }
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return (__p1._M_int == __p2._M_int
+ && __p1._M_den == __p2._M_den); }
+
private:
void
_M_initialize();
@@ -4561,6 +5213,9 @@ namespace std
max() const
{ return this->_M_param._M_int.back(); }
+ /**
+ * @brief Generating functions.
+ */
template<typename _UniformRandomNumberGenerator>
result_type
operator()(_UniformRandomNumberGenerator& __urng)
@@ -4607,6 +5262,26 @@ namespace std
param_type _M_param;
};
+ /**
+ * @brief Return true if two piecewise linear distributions have the
+ * same parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator==(const std::piecewise_linear_distribution<_RealType>& __d1,
+ const std::piecewise_linear_distribution<_RealType>& __d2)
+ { return __d1.param() == __d2.param(); }
+
+ /**
+ * @brief Return true if two piecewise linear distributions have
+ * different parameters.
+ */
+ template<typename _RealType>
+ inline bool
+ operator!=(const std::piecewise_linear_distribution<_RealType>& __d1,
+ const std::piecewise_linear_distribution<_RealType>& __d2)
+ { return !(__d1 == __d2); }
+
/* @} */ // group random_distributions_poisson
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 0bc18e64132..5a66bd6b2e2 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -27,8 +27,7 @@
* You should not attempt to use it directly.
*/
-#include <numeric>
-#include <algorithm>
+#include <numeric> // std::accumulate and std::partial_sum
namespace std
{
@@ -87,6 +86,17 @@ namespace std
__calc(_Tp __x)
{ return __a * __x + __c; }
};
+
+ template<typename _InputIterator, typename _OutputIterator,
+ typename _UnaryOperation>
+ _OutputIterator
+ __transform(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op)
+ {
+ for (; __first != __last; ++__first, ++__result)
+ *__result = __unary_op(*__first);
+ return __result;
+ }
} // namespace __detail
@@ -1627,6 +1637,26 @@ namespace std
return __ret;
}
+ template<typename _RealType>
+ bool
+ operator==(const std::normal_distribution<_RealType>& __d1,
+ const std::normal_distribution<_RealType>& __d2)
+ {
+ if (__d1._M_param == __d2._M_param
+ && __d1._M_saved_available == __d2._M_saved_available)
+ {
+ if (__d1._M_saved_available
+ && __d1._M_saved == __d2._M_saved)
+ return true;
+ else if(!__d1._M_saved_available)
+ return true;
+ else
+ return false;
+ }
+ else
+ return false;
+ }
+
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
@@ -2157,8 +2187,8 @@ namespace std
const double __sum = std::accumulate(_M_prob.begin(),
_M_prob.end(), 0.0);
// Now normalize the probabilites.
- std::transform(_M_prob.begin(), _M_prob.end(), _M_prob.begin(),
- std::bind2nd(std::divides<double>(), __sum));
+ __detail::__transform(_M_prob.begin(), _M_prob.end(), _M_prob.begin(),
+ std::bind2nd(std::divides<double>(), __sum));
// Accumulate partial sums.
_M_cp.reserve(_M_prob.size());
std::partial_sum(_M_prob.begin(), _M_prob.end(),
@@ -2279,8 +2309,8 @@ namespace std
const double __sum = std::accumulate(_M_den.begin(),
_M_den.end(), 0.0);
- std::transform(_M_den.begin(), _M_den.end(), _M_den.begin(),
- std::bind2nd(std::divides<double>(), __sum));
+ __detail::__transform(_M_den.begin(), _M_den.end(), _M_den.begin(),
+ std::bind2nd(std::divides<double>(), __sum));
_M_cp.reserve(_M_den.size());
std::partial_sum(_M_den.begin(), _M_den.end(),
@@ -2479,14 +2509,14 @@ namespace std
}
// Now normalize the densities...
- std::transform(_M_den.begin(), _M_den.end(), _M_den.begin(),
- std::bind2nd(std::divides<double>(), __sum));
+ __detail::__transform(_M_den.begin(), _M_den.end(), _M_den.begin(),
+ std::bind2nd(std::divides<double>(), __sum));
// ... and partial sums...
- std::transform(_M_cp.begin(), _M_cp.end(), _M_cp.begin(),
- std::bind2nd(std::divides<double>(), __sum));
+ __detail::__transform(_M_cp.begin(), _M_cp.end(), _M_cp.begin(),
+ std::bind2nd(std::divides<double>(), __sum));
// ... and slopes.
- std::transform(_M_m.begin(), _M_m.end(), _M_m.begin(),
- std::bind2nd(std::divides<double>(), __sum));
+ __detail::__transform(_M_m.begin(), _M_m.end(), _M_m.begin(),
+ std::bind2nd(std::divides<double>(), __sum));
// Make sure the last cumulative probablility is one.
_M_cp[_M_cp.size() - 1] = 1.0;
}
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index b204699db20..5e1960012c9 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -204,13 +204,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if _GLIBCXX_DEPRECATED
template<typename _Tp1>
- explicit
shared_ptr(std::auto_ptr<_Tp1>&& __r)
: __shared_ptr<_Tp>(std::move(__r)) { }
#endif
template<typename _Tp1, typename _Del>
- explicit shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
: __shared_ptr<_Tp>(std::move(__r)) { }
template<typename _Tp1>
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 9d36faf7cc7..1999f36023b 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -316,14 +316,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if _GLIBCXX_DEPRECATED
// Special case for auto_ptr<_Tp> to provide the strong guarantee.
template<typename _Tp>
- explicit __shared_count(std::auto_ptr<_Tp>&& __r)
+ __shared_count(std::auto_ptr<_Tp>&& __r)
: _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
{ __r.release(); }
#endif
// Special case for unique_ptr<_Tp,_Del> to provide the strong guarantee.
template<typename _Tp, typename _Del>
- explicit __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
+ __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
: _M_pi(_S_create_from_up(std::move(__r)))
{ __r.release(); }
@@ -608,7 +608,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// If an exception is thrown this constructor has no effect.
template<typename _Tp1, typename _Del>
- explicit __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
+ __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
: _M_ptr(__r.get()), _M_refcount()
{
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
@@ -620,7 +620,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if _GLIBCXX_DEPRECATED
// Postcondition: use_count() == 1 and __r.get() == 0
template<typename _Tp1>
- explicit __shared_ptr(std::auto_ptr<_Tp1>&& __r)
+ __shared_ptr(std::auto_ptr<_Tp1>&& __r)
: _M_ptr(__r.get()), _M_refcount()
{
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 560ac1bb07b..126305a00f8 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -62,6 +62,10 @@
#include <bits/stl_heap.h>
#include <bits/stl_tempbuf.h> // for _Temporary_buffer
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <random> // for std::uniform_int_distribution
+#endif
+
// See concept_check.h for the __glibcxx_*_requires macros.
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -2301,29 +2305,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
}
- /// This is a helper function for the sort routines. Precondition: __n > 0.
- template<typename _Size>
- inline _Size
- __lg(_Size __n)
- {
- _Size __k;
- for (__k = 0; __n != 0; __n >>= 1)
- ++__k;
- return __k - 1;
- }
-
- inline int
- __lg(int __n)
- { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
-
- inline long
- __lg(long __n)
- { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
-
- inline long long
- __lg(long long __n)
- { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
-
// sort
template<typename _RandomAccessIterator, typename _Size>
@@ -2386,106 +2367,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// nth_element
- /**
- * @brief Finds the first position in which @a val could be inserted
- * without changing the ordering.
- * @param first An iterator.
- * @param last Another iterator.
- * @param val The search term.
- * @return An iterator pointing to the first element <em>not less
- * than</em> @a val, or end() if every element is less than
- * @a val.
- * @ingroup binary_search_algorithms
- */
- template<typename _ForwardIterator, typename _Tp>
- _ForwardIterator
- lower_bound(_ForwardIterator __first, _ForwardIterator __last,
- const _Tp& __val)
- {
- typedef typename iterator_traits<_ForwardIterator>::value_type
- _ValueType;
- typedef typename iterator_traits<_ForwardIterator>::difference_type
- _DistanceType;
-
- // concept requirements
- __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
- __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
- __glibcxx_requires_partitioned_lower(__first, __last, __val);
-
- _DistanceType __len = std::distance(__first, __last);
- _DistanceType __half;
- _ForwardIterator __middle;
-
- while (__len > 0)
- {
- __half = __len >> 1;
- __middle = __first;
- std::advance(__middle, __half);
- if (*__middle < __val)
- {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
- }
-
- /**
- * @brief Finds the first position in which @a val could be inserted
- * without changing the ordering.
- * @ingroup binary_search_algorithms
- * @param first An iterator.
- * @param last Another iterator.
- * @param val The search term.
- * @param comp A functor to use for comparisons.
- * @return An iterator pointing to the first element <em>not less
- * than</em> @a val, or end() if every element is less
- * than @a val.
- * @ingroup binary_search_algorithms
- *
- * The comparison function should have the same effects on ordering as
- * the function used for the initial sort.
- */
- template<typename _ForwardIterator, typename _Tp, typename _Compare>
- _ForwardIterator
- lower_bound(_ForwardIterator __first, _ForwardIterator __last,
- const _Tp& __val, _Compare __comp)
- {
- typedef typename iterator_traits<_ForwardIterator>::value_type
- _ValueType;
- typedef typename iterator_traits<_ForwardIterator>::difference_type
- _DistanceType;
-
- // concept requirements
- __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
- __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
- _ValueType, _Tp>)
- __glibcxx_requires_partitioned_lower_pred(__first, __last,
- __val, __comp);
-
- _DistanceType __len = std::distance(__first, __last);
- _DistanceType __half;
- _ForwardIterator __middle;
-
- while (__len > 0)
- {
- __half = __len >> 1;
- __middle = __first;
- std::advance(__middle, __half);
- if (__comp(*__middle, __val))
- {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
- }
+ // lower_bound moved to stl_algobase.h
/**
* @brief Finds the last position in which @a val could be inserted
@@ -4179,6 +4061,47 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
std::minmax_element(__l.begin(), __l.end(), __comp);
return std::make_pair(*__p.first, *__p.second);
}
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+ /**
+ * @brief Shuffle the elements of a sequence using a uniform random
+ * number generator.
+ * @ingroup mutating_algorithms
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param g A UniformRandomNumberGenerator (26.5.1.3).
+ * @return Nothing.
+ *
+ * Reorders the elements in the range @p [first,last) using @p g to
+ * provide random numbers.
+ */
+ template<typename _RandomAccessIterator,
+ typename _UniformRandomNumberGenerator>
+ void
+ shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _UniformRandomNumberGenerator& __g)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+
+ if (__first == __last)
+ return;
+
+ typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+ typedef typename std::make_unsigned<_DistanceType>::type __ud_type;
+ typedef typename std::uniform_int_distribution<__ud_type> __distr_type;
+ typedef typename __distr_type::param_type __p_type;
+ __distr_type __d;
+
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + __d(__g, __p_type(0, __i - __first)));
+ }
+#endif
+
#endif // __GXX_EXPERIMENTAL_CXX0X__
_GLIBCXX_END_NAMESPACE
@@ -4996,7 +4919,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
void
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _RandomNumberGenerator&& __rand)
+#else
_RandomNumberGenerator& __rand)
+#endif
{
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 3575279226b..1756966a5a1 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -938,6 +938,131 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__first2, __last2);
}
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @return An iterator pointing to the first element <em>not less
+ * than</em> @a val, or end() if every element is less than
+ * @a val.
+ * @ingroup binary_search_algorithms
+ */
+ template<typename _ForwardIterator, typename _Tp>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower(__first, __last, __val);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (*__middle < __val)
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /**
+ * @brief Finds the first position in which @a val could be inserted
+ * without changing the ordering.
+ * @ingroup binary_search_algorithms
+ * @param first An iterator.
+ * @param last Another iterator.
+ * @param val The search term.
+ * @param comp A functor to use for comparisons.
+ * @return An iterator pointing to the first element <em>not less
+ * than</em> @a val, or end() if every element is less
+ * than @a val.
+ * @ingroup binary_search_algorithms
+ *
+ * The comparison function should have the same effects on ordering as
+ * the function used for the initial sort.
+ */
+ template<typename _ForwardIterator, typename _Tp, typename _Compare>
+ _ForwardIterator
+ lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __val, _Compare __comp)
+ {
+ typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+ typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+ // concept requirements
+ __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
+ _ValueType, _Tp>)
+ __glibcxx_requires_partitioned_lower_pred(__first, __last,
+ __val, __comp);
+
+ _DistanceType __len = std::distance(__first, __last);
+ _DistanceType __half;
+ _ForwardIterator __middle;
+
+ while (__len > 0)
+ {
+ __half = __len >> 1;
+ __middle = __first;
+ std::advance(__middle, __half);
+ if (__comp(*__middle, __val))
+ {
+ __first = __middle;
+ ++__first;
+ __len = __len - __half - 1;
+ }
+ else
+ __len = __half;
+ }
+ return __first;
+ }
+
+ /// This is a helper function for the sort routines and for random.tcc.
+ // Precondition: __n > 0.
+ template<typename _Size>
+ inline _Size
+ __lg(_Size __n)
+ {
+ _Size __k;
+ for (__k = 0; __n != 0; __n >>= 1)
+ ++__k;
+ return __k - 1;
+ }
+
+ inline int
+ __lg(int __n)
+ { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
+
+ inline long
+ __lg(long __n)
+ { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
+
+ inline long long
+ __lg(long long __n)
+ { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
+
_GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P)
diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h
index 43f0826d360..cc2fc679bcf 100644
--- a/libstdc++-v3/include/parallel/algo.h
+++ b/libstdc++-v3/include/parallel/algo.h
@@ -292,8 +292,8 @@ namespace __parallel
typedef typename _IIterTraits::value_type _IValueType;
typedef typename iteratorf_traits::value_type _FValueType;
- return find_first_of(__begin1, __end1, __begin2, __end2, __gnu_parallel::
- _EqualTo<_IValueType, _FValueType>());
+ return _GLIBCXX_STD_P::find_first_of(__begin1, __end1, __begin2, __end2,
+ __gnu_parallel::_EqualTo<_IValueType, _FValueType>());
}
// Sequential fallback
@@ -1160,7 +1160,7 @@ namespace __parallel
const _Tp& __val)
{
typedef typename iterator_traits<_FIterator>::value_type _ValueType;
- return search_n(__begin, __end, __count, __val,
+ return _GLIBCXX_STD_P::search_n(__begin, __end, __count, __val,
__gnu_parallel::_EqualTo<_ValueType, _Tp>());
}
@@ -1645,7 +1645,7 @@ namespace __parallel
// Sequential fallback.
template<typename _RAIter, typename _RandomNumberGenerator>
inline void
- random_shuffle(_RAIter __begin, _RAIter __end,
+ random_shuffle(_RAIter __begin, _RAIter __end,
_RandomNumberGenerator& __rand,
__gnu_parallel::sequential_tag)
{ _GLIBCXX_STD_P::random_shuffle(__begin, __end, __rand); }
@@ -1673,8 +1673,12 @@ namespace __parallel
// Parallel algorithm for random access iterators.
template<typename _RAIter, typename _RandomNumberGenerator>
void
- random_shuffle(_RAIter __begin, _RAIter __end,
+ random_shuffle(_RAIter __begin, _RAIter __end,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _RandomNumberGenerator&& __rand)
+#else
_RandomNumberGenerator& __rand)
+#endif
{
if (__begin == __end)
return;
@@ -2082,8 +2086,8 @@ namespace __parallel
typedef typename _Iterator1Traits::value_type _ValueType1;
typedef typename _Iterator2Traits::value_type _ValueType2;
- return merge(__begin1, __end1, __begin2, __end2, __result,
- __gnu_parallel::_Less<_ValueType1, _ValueType2>());
+ return _GLIBCXX_STD_P::merge(__begin1, __end1, __begin2, __end2,
+ __result, __gnu_parallel::_Less<_ValueType1, _ValueType2>());
}
// Sequential fallback
@@ -2124,7 +2128,8 @@ namespace __parallel
{
typedef iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
- nth_element(__begin, __nth, __end, std::less<_ValueType>());
+ _GLIBCXX_STD_P::nth_element(__begin, __nth, __end,
+ std::less<_ValueType>());
}
// Sequential fallback
@@ -2166,7 +2171,8 @@ namespace __parallel
{
typedef iterator_traits<_RAIter> _TraitsType;
typedef typename _TraitsType::value_type _ValueType;
- partial_sort(__begin, __middle, __end, std::less<_ValueType>());
+ _GLIBCXX_STD_P::partial_sort(__begin, __middle, __end,
+ std::less<_ValueType>());
}
// Sequential fallback
@@ -2235,7 +2241,8 @@ namespace __parallel
max_element(_FIterator __begin, _FIterator __end)
{
typedef typename iterator_traits<_FIterator>::value_type _ValueType;
- return max_element(__begin, __end, std::less<_ValueType>());
+ return _GLIBCXX_STD_P::max_element(__begin, __end,
+ std::less<_ValueType>());
}
// Public interface
@@ -2326,7 +2333,8 @@ namespace __parallel
min_element(_FIterator __begin, _FIterator __end)
{
typedef typename iterator_traits<_FIterator>::value_type _ValueType;
- return min_element(__begin, __end, std::less<_ValueType>());
+ return _GLIBCXX_STD_P::min_element(__begin, __end,
+ std::less<_ValueType>());
}
// Public interface
diff --git a/libstdc++-v3/include/parallel/algobase.h b/libstdc++-v3/include/parallel/algobase.h
index df1c58bedb6..9cc81bd2aaa 100644
--- a/libstdc++-v3/include/parallel/algobase.h
+++ b/libstdc++-v3/include/parallel/algobase.h
@@ -141,14 +141,20 @@ namespace __parallel
template<typename _IIter1, typename _IIter2>
inline bool
equal(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2)
- { return mismatch(__begin1, __end1, __begin2).first == __end1; }
+ {
+ return _GLIBCXX_STD_P::mismatch(__begin1, __end1, __begin2).first
+ == __end1;
+ }
// Public interface
template<typename _IIter1, typename _IIter2, typename _Predicate>
inline bool
equal(_IIter1 __begin1, _IIter1 __end1, _IIter2 __begin2,
_Predicate __pred)
- { return mismatch(__begin1, __end1, __begin2, __pred).first == __end1; }
+ {
+ return _GLIBCXX_STD_P::mismatch(__begin1, __end1, __begin2, __pred).first
+ == __end1;
+ }
// Sequential fallback
template<typename _IIter1, typename _IIter2>
diff --git a/libstdc++-v3/include/parallel/algorithmfwd.h b/libstdc++-v3/include/parallel/algorithmfwd.h
index 5c93615da26..f2749b89eb1 100644
--- a/libstdc++-v3/include/parallel/algorithmfwd.h
+++ b/libstdc++-v3/include/parallel/algorithmfwd.h
@@ -1,6 +1,6 @@
// <algorithm> parallel extensions -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -690,7 +690,12 @@ namespace __parallel
template<typename _RAIter, typename _RandomNumberGenerator>
void
- random_shuffle(_RAIter, _RAIter, _RandomNumberGenerator&);
+ random_shuffle(_RAIter, _RAIter,
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ _RandomNumberGenerator&&);
+#else
+ _RandomNumberGenerator&);
+#endif
template<typename _IIter1, typename _IIter2, typename _OIter>
_OIter
diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h
index 76c3fe6a840..1a8c3cb60a8 100644
--- a/libstdc++-v3/include/parallel/base.h
+++ b/libstdc++-v3/include/parallel/base.h
@@ -262,66 +262,40 @@ namespace __gnu_parallel
// Partial specialization for one type. Same as std::less.
template<typename _Tp>
- struct _Less<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, bool>
- {
- bool
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x < __y; }
- };
-
+ struct _Less<_Tp, _Tp>
+ : public std::less<_Tp> { };
/** @brief Similar to std::plus, but allows two different types. */
- template<typename _Tp1, typename _Tp2>
- struct _Plus : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ template<typename _Tp1, typename _Tp2, typename _Result
+ = __typeof__(*static_cast<_Tp1*>(NULL)
+ + *static_cast<_Tp2*>(NULL))>
+ struct _Plus : public std::binary_function<_Tp1, _Tp2, _Result>
{
- typedef __typeof__(*static_cast<_Tp1*>(NULL)
- + *static_cast<_Tp2*>(NULL)) __result;
-
- __result
+ _Result
operator()(const _Tp1& __x, const _Tp2& __y) const
{ return __x + __y; }
};
// Partial specialization for one type. Same as std::plus.
template<typename _Tp>
- struct _Plus<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
- {
- typedef __typeof__(*static_cast<_Tp*>(NULL)
- + *static_cast<_Tp*>(NULL)) __result;
-
- __result
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x + __y; }
- };
-
+ struct _Plus<_Tp, _Tp, _Tp>
+ : public std::plus<_Tp> { };
/** @brief Similar to std::multiplies, but allows two different types. */
- template<typename _Tp1, typename _Tp2>
- struct _Multiplies : public std::binary_function<_Tp1, _Tp2, _Tp1>
+ template<typename _Tp1, typename _Tp2, typename _Result
+ = __typeof__(*static_cast<_Tp1*>(NULL)
+ * *static_cast<_Tp2*>(NULL))>
+ struct _Multiplies : public std::binary_function<_Tp1, _Tp2, _Result>
{
- typedef __typeof__(*static_cast<_Tp1*>(NULL)
- * *static_cast<_Tp2*>(NULL)) __result;
-
- __result
+ _Result
operator()(const _Tp1& __x, const _Tp2& __y) const
{ return __x * __y; }
};
// Partial specialization for one type. Same as std::multiplies.
template<typename _Tp>
- struct _Multiplies<_Tp, _Tp> : public std::binary_function<_Tp, _Tp, _Tp>
- {
- typedef __typeof__(*static_cast<_Tp*>(NULL)
- * *static_cast<_Tp*>(NULL)) __result;
-
- __result
- operator()(const _Tp& __x, const _Tp& __y) const
- { return __x * __y; }
- };
-
-
- template<typename _Tp, typename _DifferenceTp>
- class _PseudoSequence;
+ struct _Multiplies<_Tp, _Tp, _Tp>
+ : public std::multiplies<_Tp> { };
/** @brief _Iterator associated with __gnu_parallel::_PseudoSequence.
* If features the usual random-access iterator functionality.
@@ -334,11 +308,6 @@ namespace __gnu_parallel
public:
typedef _DifferenceTp _DifferenceType;
- private:
- const _Tp& _M_val;
- _DifferenceType _M_pos;
-
- public:
_PseudoSequenceIterator(const _Tp& __val, _DifferenceType __pos)
: _M_val(__val), _M_pos(__pos) { }
@@ -351,7 +320,7 @@ namespace __gnu_parallel
}
// Post-increment operator.
- const _PseudoSequenceIterator
+ _PseudoSequenceIterator
operator++(int)
{ return _PseudoSequenceIterator(_M_pos++); }
@@ -367,13 +336,17 @@ namespace __gnu_parallel
operator==(const _PseudoSequenceIterator& __i2)
{ return _M_pos == __i2._M_pos; }
- _DifferenceType
+ bool
operator!=(const _PseudoSequenceIterator& __i2)
{ return _M_pos != __i2._M_pos; }
_DifferenceType
operator-(const _PseudoSequenceIterator& __i2)
{ return _M_pos - __i2._M_pos; }
+
+ private:
+ const _Tp& _M_val;
+ _DifferenceType _M_pos;
};
/** @brief Sequence that conceptually consists of multiple copies of
@@ -413,14 +386,6 @@ namespace __gnu_parallel
_DifferenceType _M_count;
};
- /** @brief Functor that does nothing */
- template<typename _ValueTp>
- class _VoidFunctor
- {
- inline void
- operator()(const _ValueTp& __v) const { }
- };
-
/** @brief Compute the median of three referenced elements,
according to @c __comp.
* @param __a First iterator.
@@ -431,7 +396,7 @@ namespace __gnu_parallel
template<typename _RAIter, typename _Compare>
_RAIter
__median_of_three_iterators(_RAIter __a, _RAIter __b,
- _RAIter __c, _Compare& __comp)
+ _RAIter __c, _Compare __comp)
{
if (__comp(*__a, *__b))
if (__comp(*__b, *__c))
diff --git a/libstdc++-v3/include/parallel/compatibility.h b/libstdc++-v3/include/parallel/compatibility.h
index 688a7cf348f..9fffd8e012c 100644
--- a/libstdc++-v3/include/parallel/compatibility.h
+++ b/libstdc++-v3/include/parallel/compatibility.h
@@ -1,6 +1,6 @@
// -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -147,7 +147,8 @@ namespace __gnu_parallel
#elif defined(__GNUC__) && defined(__x86_64)
return __sync_fetch_and_add(__ptr, __addend);
#elif defined(__GNUC__) && defined(__i386) && \
- (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ (defined(__i686) || defined(__pentium4) || defined(__athlon) \
+ || defined(__k8) || defined(__core2))
return __sync_fetch_and_add(__ptr, __addend);
#elif defined(__SUNPRO_CC) && defined(__sparc)
volatile int64_t __before, __after;
@@ -299,7 +300,8 @@ namespace __gnu_parallel
#elif defined(__GNUC__) && defined(__x86_64)
return __sync_bool_compare_and_swap(__ptr, __comparand, __replacement);
#elif defined(__GNUC__) && defined(__i386) && \
- (defined(__i686) || defined(__pentium4) || defined(__athlon))
+ (defined(__i686) || defined(__pentium4) || defined(__athlon) \
+ || defined(__k8) || defined(__core2))
return __sync_bool_compare_and_swap(__ptr, __comparand, __replacement);
#elif defined(__SUNPRO_CC) && defined(__sparc)
return atomic_cas_64((volatile unsigned long long*)__ptr,
diff --git a/libstdc++-v3/include/parallel/numeric b/libstdc++-v3/include/parallel/numeric
index eff597ea70a..7ba44d21e33 100644
--- a/libstdc++-v3/include/parallel/numeric
+++ b/libstdc++-v3/include/parallel/numeric
@@ -281,9 +281,9 @@ namespace __parallel
typedef typename _TraitsType2::value_type _ValueType2;
typedef typename
- __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::__result
+ __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::result_type
_MultipliesResultType;
- return inner_product(__first1, __last1, __first2, __init,
+ return _GLIBCXX_STD_P::inner_product(__first1, __last1, __first2, __init,
__gnu_parallel::_Plus<_Tp, _MultipliesResultType>(),
__gnu_parallel::
_Multiplies<_ValueType1, _ValueType2>(),
@@ -301,9 +301,9 @@ namespace __parallel
typedef typename _TraitsType2::value_type _ValueType2;
typedef typename
- __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::__result
+ __gnu_parallel::_Multiplies<_ValueType1, _ValueType2>::result_type
_MultipliesResultType;
- return inner_product(__first1, __last1, __first2, __init,
+ return _GLIBCXX_STD_P::inner_product(__first1, __last1, __first2, __init,
__gnu_parallel::_Plus<_Tp, _MultipliesResultType>(),
__gnu_parallel::
_Multiplies<_ValueType1, _ValueType2>());
@@ -359,7 +359,8 @@ namespace __parallel
partial_sum(_IIter __begin, _IIter __end, _OutputIterator __result)
{
typedef typename iterator_traits<_IIter>::value_type _ValueType;
- return partial_sum(__begin, __end, __result, std::plus<_ValueType>());
+ return _GLIBCXX_STD_P::partial_sum(__begin, __end,
+ __result, std::plus<_ValueType>());
}
// Public interface
diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h
index 487fd6dd666..966d9db0572 100644
--- a/libstdc++-v3/include/parallel/partial_sum.h
+++ b/libstdc++-v3/include/parallel/partial_sum.h
@@ -158,7 +158,8 @@ namespace __gnu_parallel
else
{
::new(&(__sums[__iam]))
- _ValueType(std::accumulate(__begin + __borders[__iam] + 1,
+ _ValueType(__gnu_parallel::accumulate(
+ __begin + __borders[__iam] + 1,
__begin + __borders[__iam + 1],
*(__begin + __borders[__iam]),
__bin_op,
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 7922a7d319b..2ba7243837a 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -500,12 +500,12 @@ namespace std
_Res
_M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp>
_Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
- { return ((*__ptr).*__pmf)(__args...); }
+ { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public:
typedef _Res result_type;
@@ -515,18 +515,21 @@ namespace std
// Handle objects
_Res
operator()(_Class& __object, _ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle pointers
_Res
operator()(_Class* __object, _ArgTypes... __args) const
- { return (__object->*__pmf)(__args...); }
+ { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle smart pointers, references and pointers to derived
template<typename _Tp>
_Res
operator()(_Tp& __object, _ArgTypes... __args) const
- { return _M_call(__object, &__object, __args...); }
+ {
+ return _M_call(__object, &__object,
+ std::forward<_ArgTypes>(__args)...);
+ }
private:
_Functor __pmf;
@@ -544,12 +547,12 @@ namespace std
_Res
_M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp>
_Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
- { return ((*__ptr).*__pmf)(__args...); }
+ { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public:
typedef _Res result_type;
@@ -559,17 +562,20 @@ namespace std
// Handle objects
_Res
operator()(const _Class& __object, _ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle pointers
_Res
operator()(const _Class* __object, _ArgTypes... __args) const
- { return (__object->*__pmf)(__args...); }
+ { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle smart pointers, references and pointers to derived
template<typename _Tp>
_Res operator()(_Tp& __object, _ArgTypes... __args) const
- { return _M_call(__object, &__object, __args...); }
+ {
+ return _M_call(__object, &__object,
+ std::forward<_ArgTypes>(__args)...);
+ }
private:
_Functor __pmf;
@@ -587,12 +593,12 @@ namespace std
_Res
_M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp>
_Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
- { return ((*__ptr).*__pmf)(__args...); }
+ { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public:
typedef _Res result_type;
@@ -602,18 +608,21 @@ namespace std
// Handle objects
_Res
operator()(volatile _Class& __object, _ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle pointers
_Res
operator()(volatile _Class* __object, _ArgTypes... __args) const
- { return (__object->*__pmf)(__args...); }
+ { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle smart pointers, references and pointers to derived
template<typename _Tp>
_Res
operator()(_Tp& __object, _ArgTypes... __args) const
- { return _M_call(__object, &__object, __args...); }
+ {
+ return _M_call(__object, &__object,
+ std::forward<_ArgTypes>(__args)...);
+ }
private:
_Functor __pmf;
@@ -631,12 +640,12 @@ namespace std
_Res
_M_call(_Tp& __object, const volatile _Class *,
_ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
template<typename _Tp>
_Res
_M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
- { return ((*__ptr).*__pmf)(__args...); }
+ { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
public:
typedef _Res result_type;
@@ -646,17 +655,20 @@ namespace std
// Handle objects
_Res
operator()(const volatile _Class& __object, _ArgTypes... __args) const
- { return (__object.*__pmf)(__args...); }
+ { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle pointers
_Res
operator()(const volatile _Class* __object, _ArgTypes... __args) const
- { return (__object->*__pmf)(__args...); }
+ { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
// Handle smart pointers, references and pointers to derived
template<typename _Tp>
_Res operator()(_Tp& __object, _ArgTypes... __args) const
- { return _M_call(__object, &__object, __args...); }
+ {
+ return _M_call(__object, &__object,
+ std::forward<_ArgTypes>(__args)...);
+ }
private:
_Functor __pmf;
diff --git a/libstdc++-v3/include/tr1/hashtable_policy.h b/libstdc++-v3/include/tr1/hashtable_policy.h
index 60a4e644999..2a0e0ed4e1a 100644
--- a/libstdc++-v3/include/tr1/hashtable_policy.h
+++ b/libstdc++-v3/include/tr1/hashtable_policy.h
@@ -55,29 +55,6 @@ namespace __detail
return __distance_fw(__first, __last, _Tag());
}
- template<typename _RAIter, typename _Tp>
- _RAIter
- __lower_bound(_RAIter __first, _RAIter __last, const _Tp& __val)
- {
- typedef typename std::iterator_traits<_RAIter>::difference_type _DType;
-
- _DType __len = __last - __first;
- while (__len > 0)
- {
- _DType __half = __len >> 1;
- _RAIter __middle = __first + __half;
- if (*__middle < __val)
- {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
- }
-
// Auxiliary types used for all instantiations of _Hashtable: nodes
// and iterators.
@@ -440,8 +417,8 @@ namespace __detail
_Prime_rehash_policy::
_M_next_bkt(std::size_t __n) const
{
- const unsigned long* __p = __lower_bound(__prime_list, __prime_list
- + _S_n_primes, __n);
+ const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __n);
_M_next_resize =
static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
return *__p;
@@ -454,8 +431,8 @@ namespace __detail
_M_bkt_for_elements(std::size_t __n) const
{
const float __min_bkts = __n / _M_max_load_factor;
- const unsigned long* __p = __lower_bound(__prime_list, __prime_list
- + _S_n_primes, __min_bkts);
+ const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
+ + _S_n_primes, __min_bkts);
_M_next_resize =
static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
return *__p;
@@ -483,8 +460,8 @@ namespace __detail
{
__min_bkts = std::max(__min_bkts, _M_growth_factor * __n_bkt);
const unsigned long* __p =
- __lower_bound(__prime_list, __prime_list + _S_n_primes,
- __min_bkts);
+ std::lower_bound(__prime_list, __prime_list + _S_n_primes,
+ __min_bkts);
_M_next_resize = static_cast<std::size_t>
(__builtin_ceil(*__p * _M_max_load_factor));
return std::make_pair(true, *__p);
diff --git a/libstdc++-v3/testsuite/17_intro/freestanding.cc b/libstdc++-v3/testsuite/17_intro/freestanding.cc
index 9c5ec311a21..52aa965f9ca 100644
--- a/libstdc++-v3/testsuite/17_intro/freestanding.cc
+++ b/libstdc++-v3/testsuite/17_intro/freestanding.cc
@@ -33,18 +33,18 @@ int main()
{
std::exception e;
- const char* str = typeid(e).name();
+ const char* str __attribute__((unused)) = typeid(e).name();
typedef std::numeric_limits<long> limit_type;
- limit_type limit_l;
- int r = limit_type::radix;
+ limit_type limit_l __attribute__((unused));
+ int r __attribute__((unused)) = limit_type::radix;
const char* cp = new char;
delete cp;
- bool b = std::is_integral<int>::value;
+ bool b __attribute__((unused)) = std::is_integral<int>::value;
- std::initializer_list<int> ilisti;
+ std::initializer_list<int> ilisti __attribute__((unused));
return 0;
}
diff --git a/libstdc++-v3/testsuite/20_util/function/43397.cc b/libstdc++-v3/testsuite/20_util/function/43397.cc
new file mode 100644
index 00000000000..d76a27f3404
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function/43397.cc
@@ -0,0 +1,78 @@
+// { dg-options "-std=gnu++0x" }
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.8.15 polymorphic function object wrapper
+
+#include <functional>
+#include <testsuite_hooks.h>
+
+struct Foo
+{
+ Foo() { }
+ short operator() ( int && ) { return 1; }
+ short operator() ( int && ) const { return 2; }
+ short operator() ( int && ) volatile { return 3; }
+ short operator() ( int && ) const volatile { return 4; }
+ short func( int && ) { return 5; }
+ short func_c( int && ) const { return 6; }
+ short func_v( int && ) volatile { return 7; }
+ short func_cv( int && ) const volatile { return 8; }
+};
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ using std::function;
+ using std::ref;
+
+ Foo foo;
+ Foo const foo_c;
+ Foo volatile foo_v;
+ Foo const volatile foo_cv;
+
+ std::function< int ( int && ) > f1( ref(foo) );
+ VERIFY( f1(0) == 1 );
+
+ std::function< int ( int && ) > f2( ref(foo_c) );
+ VERIFY( f2(0) == 2 );
+
+ std::function< int ( int && ) > f3( ref(foo_v) );
+ VERIFY( f3(0) == 3 );
+
+ std::function< int ( int && ) > f4( ref(foo_cv) );
+ VERIFY( f4(0) == 4 );
+
+ std::function< int ( Foo &, int && ) > f5( &Foo::func ) ;
+ VERIFY( f5(foo, 0) == 5 );
+
+ std::function< int ( Foo const &, int && ) > f6( &Foo::func_c ) ;
+ VERIFY( f6(foo_c, 0) == 6 );
+
+ std::function< int ( Foo volatile &, int && ) > f7( &Foo::func_v ) ;
+ VERIFY( f7(foo_v, 0) == 7 );
+
+ std::function< int ( Foo const volatile &, int && ) > f8( &Foo::func_cv ) ;
+ VERIFY( f8(foo_cv, 0) == 8 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/dr925.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/dr925.cc
new file mode 100644
index 00000000000..db176650e0b
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/dr925.cc
@@ -0,0 +1,90 @@
+// { dg-options "-std=gnu++0x -Wno-deprecated" }
+
+// Copyright (C) 2010 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 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.9.11.2 Template class shared_ptr [util.smartptr.shared]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+};
+
+std::unique_ptr<A>
+create_unique_ptr()
+{
+ return std::unique_ptr<A>(new A());
+}
+
+std::auto_ptr<A>
+create_auto_ptr()
+{
+ return std::auto_ptr<A>(new A());
+}
+
+void
+process(std::shared_ptr<A> a)
+{
+ bool test __attribute__((unused)) = true;
+
+ VERIFY( a.get() != 0 );
+ VERIFY( a.use_count() == 1 );
+}
+
+// 20.9.11.2.1 shared_ptr creation [util.smartptr.shared.const]
+
+// Implicit conversion of auto_ptr to shared_ptr is allowed
+
+void
+test01()
+{
+ process(create_auto_ptr());
+}
+
+void
+test02()
+{
+ std::auto_ptr<A> a = create_auto_ptr();
+ process(std::move(a));
+}
+
+// Implicit conversion of unique_ptr to shared_ptr is allowed
+
+void
+test03()
+{
+ process(create_unique_ptr());
+}
+
+void
+test04()
+{
+ std::unique_ptr<A> a = create_unique_ptr();
+ process(std::move(a));
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc
index 97355824404..b9a2ff20b56 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/capacity/1.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -39,8 +39,7 @@ test01()
VERIFY(fld.empty() == true);
VERIFY( (fld.max_size()
- == std::allocator<std::_Fwd_list_node<double,
- std::allocator<double> > >().max_size()) );
+ == std::allocator<std::_Fwd_list_node<double> >().max_size()) );
}
int
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/1.cc
deleted file mode 100644
index b530e2ff0ae..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/1.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list capacity [lib.forward_list.capacity]
-
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-#include <testsuite_hooks.h>
-
-bool test __attribute__((unused)) = true;
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-// This test verifies the following.
-//
-void
-test01()
-{
- std::forward_list<double, _ExtPtr_allocator<double> > fld;
-
- VERIFY(fld.empty() == true);
- fld.push_front(1.0);
- VERIFY(fld.empty() == false);
- fld.resize(0);
- VERIFY(fld.empty() == true);
-}
-
-void
-test02()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > a, b;
- a.push_front(1);
-
- b = std::move(a);
- VERIFY(b.empty() == false);
- VERIFY(*b.begin() == 1);
- VERIFY(a.empty() == true);
-
- std::forward_list<int, _ExtPtr_allocator<int> > c(std::move(b));
- VERIFY(c.empty() == false);
- (*c.begin() == 1 );
- VERIFY( b.empty() == true );
-}
-
-// Test various constrcutors
-void
-test03()
-{
- const int ni = 10;
- int i[ni] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
- _ExtPtr_allocator<int> alloc;
-
- std::forward_list<int, _ExtPtr_allocator<int> > flccin(i, i+ni);
- std::forward_list<int, _ExtPtr_allocator<int> > flc(flccin);
- std::forward_list<int, _ExtPtr_allocator<int> > flm(std::move(flccin));
- std::forward_list<int, _ExtPtr_allocator<int> > flcc(flccin, alloc );
- std::forward_list<int, _ExtPtr_allocator<int> > flmc(
- std::forward_list<int, _ExtPtr_allocator<int> >(i, i+ni), alloc);
- std::forward_list<double, _ExtPtr_allocator<double> > flil(
- {1.0, 2.0, 3.0, 4.0, 5.0});
-}
-
-// Test constrcutors
-// Construction from given number of default item
-// Construction from given number of given item
-void
-test04()
-{
- std::forward_list<double, _ExtPtr_allocator<double> > flvd(10);
- std::forward_list<float, _ExtPtr_allocator<float> > flv(10, 5.0F);
-}
-
-int
-main()
-{
- test01();
- test02();
- test03();
- test04();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/1.cc
deleted file mode 100644
index 8ea83f1d8a6..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/1.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-#include <testsuite_hooks.h>
-
-#include <array>
-
-bool test __attribute__((unused)) = true;
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-class PathPoint
-{
-public:
- PathPoint(char t, std::array<double, 3> & c)
- : type(t), coord(c) { }
- char getType() const { return type; }
-private:
- char type;
- std::array<double, 3> coord;
-};
-
-// This test verifies the following.
-// emplace_front
-// pop_front
-// emplace_after
-void
-test01()
-{
- std::forward_list<PathPoint, _ExtPtr_allocator<PathPoint> > path;
- std::array<double, 3> coord1 = { { 0.0, 1.0, 2.0 } };
- path.emplace_front('a', coord1);
-
- std::forward_list<PathPoint, _ExtPtr_allocator<PathPoint> >::const_iterator pos = path.cbegin();
-
- std::array<double, 3> coord2 = { { 3.0, 4.0, 5.0 } };
- path.emplace_after(pos, 'b', coord2);
-
- VERIFY(path.front().getType() == 'a');
-
- path.pop_front();
-
- VERIFY(path.front().getType() == 'b');
-
- path.pop_front();
-
- VERIFY(path.empty() == true);
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/2.cc
deleted file mode 100644
index d9a437e09e0..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/2.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-#include <testsuite_hooks.h>
-
-#include <string>
-
-bool test __attribute__((unused)) = true;
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-// This test verifies the following:
-// insert_after single item
-// before_begin iterator
-void
-test01()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::iterator ret
- = fl.insert_after(fl.before_begin(), 42);
- VERIFY(ret == fl.begin());
- VERIFY(fl.front() == 42);
-}
-
-// This test verifies the following:
-void
-test02()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator pos
- = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == 1);
-
- // Note: Calling l.insert_after(pos, 5, 42); without the long five
- // gets resolved to the iterator range version and fails to compile!
- std::forward_list<int, _ExtPtr_allocator<int> >::iterator ret
- = fl.insert_after(pos, 5, 42);
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
-
- ++pos;
- VERIFY(*pos == 42);
- ++pos;
- ++pos;
- ++pos;
- ++pos;
- VERIFY(*pos == 42);
-}
-
-// This test verifies the following:
-void
-test03()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator pos
- = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == 1);
-
- int i[3] = {666, 777, 888};
- std::forward_list<int, _ExtPtr_allocator<int> >::iterator ret
- = fl.insert_after(pos, i, i + 3);
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
-
- ++pos;
- ++pos;
- ++pos;
- VERIFY(*pos == 888);
- ++pos;
- VERIFY(*pos == 2);
-}
-
-// This test verifies the following:
-void
-test04()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator
- pos = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == 1);
-
- std::forward_list<int, _ExtPtr_allocator<int> >::iterator ret
- = fl.insert_after(pos, {-1, -2, -3, -4, -5});
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
-
- ++pos;
- ++pos;
- ++pos;
- VERIFY(*pos == -3);
-}
-
-// This test verifies the following:
-void
-test05()
-{
- std::forward_list<std::string, _ExtPtr_allocator<std::string> > fl(
- {"AAA", "BBB", "CCC"});
-
- std::forward_list<std::string, _ExtPtr_allocator<std::string> >::
- const_iterator pos = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == "BBB");
-
- std::string x( "XXX" );
- std::forward_list<std::string, _ExtPtr_allocator<std::string> >::iterator ret
- = fl.insert_after(pos, std::move(x));
- VERIFY(*pos == "BBB");
- ++pos;
- VERIFY(ret == pos);
- VERIFY(*pos == "XXX");
- ++pos;
- VERIFY(*pos == "CCC");
-}
-
-int
-main()
-{
- test01();
- test02();
- test03();
- test04();
- test05();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/3.cc
deleted file mode 100644
index 5b43bbb95f9..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/3.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-#include <testsuite_hooks.h>
-
-bool test __attribute__((unused)) = true;
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-// This test verifies the following:
-// cbegin
-// erase_after one iterator
-// pos is useable and points to current element
-void
-test01()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator
- pos = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == 1);
-
- fl.erase_after(pos);
-
- VERIFY(*pos == 1);
- ++pos;
- VERIFY(*pos == 3);
-}
-
-// This test verifies the following:
-// cbegin
-// erase_after iterator range
-// pos is useable and points to current element
-void
-test02()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator
- pos = fl.cbegin();
-
- ++pos;
- VERIFY(*pos == 1);
-
- std::forward_list<int, _ExtPtr_allocator<int> >::iterator
- stop = fl.begin();
-
- ++stop;
- ++stop;
- ++stop;
- ++stop;
- VERIFY(*stop == 4);
-
- fl.erase_after(pos, stop);
-
- VERIFY(*pos == 1);
- ++pos;
- VERIFY(*pos == 4);
- VERIFY(std::distance(fl.begin(), fl.end()) == 8);
-
- fl.erase_after(pos, fl.end());
- VERIFY(++pos == fl.end());
- VERIFY(std::distance(fl.begin(), fl.end()) == 3);
-
- fl.erase_after(fl.before_begin(), pos);
- VERIFY(std::distance(fl.begin(), fl.end()) == 0);
- VERIFY(fl.empty());
-}
-
-int
-main()
-{
- test01();
- test02();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/1.cc
deleted file mode 100644
index 8b5afdd980b..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/1.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-//
-void
-test01()
-{
- typedef std::forward_list<double, _ExtPtr_allocator<double> > fwd_list_type;
-
- fwd_list_type a = {0.0, 1.0, 2.0, 3.0, 4.0};
- fwd_list_type::const_iterator posa = a.cbefore_begin();
-
- fwd_list_type x = {666.0, 777.0, 888.0};
-
- a.splice_after(posa, std::move(x));
-
- ++posa;
- VERIFY(*posa == 666.0);
-
- VERIFY(x.empty() == true);
-}
-
-// This test verifies the following:
-//
-void
-test02()
-{
- typedef std::forward_list<double, _ExtPtr_allocator<double> > fwd_list_type;
-
- fwd_list_type a = {0.0, 1.0, 2.0, 3.0, 4.0};
- fwd_list_type::const_iterator posa = a.cbefore_begin();
- ++posa;
- VERIFY(*posa == 0.0);
-
- fwd_list_type y = {10.0, 11.0, 12.0, 13.0, 14.0, 15.0};
- fwd_list_type::const_iterator befy = y.cbefore_begin();
- ++befy;
- VERIFY(*befy == 10.0);
- fwd_list_type::const_iterator endy = befy;
- ++endy;
- ++endy;
- ++endy;
- ++endy;
- VERIFY(*endy == 14.0);
-
- a.splice_after(posa, std::move(y), befy, endy);
- VERIFY(*posa == 0.0);
-
- VERIFY(*befy == 10.0);
- ++befy;
- VERIFY(*befy == 15.0);
-}
-
-// This test verifies the following:
-//
-void
-test03()
-{
- typedef std::forward_list<double, _ExtPtr_allocator<double> > fwd_list_type;
-
- fwd_list_type a = {0.0, 1.0, 2.0, 3.0, 4.0};
- fwd_list_type::const_iterator posa = a.cbefore_begin();
- ++posa;
- ++posa;
- VERIFY(*posa == 1.0);
-
- fwd_list_type z = {42.0, 43.0, 44.0};
- fwd_list_type::const_iterator posz = z.begin();
- VERIFY(*posz == 42.0);
-
- a.splice_after(posa, std::move(z), posz);
- VERIFY(*posa == 1.0);
- ++posa;
- VERIFY(*posa == 43.0);
-
- VERIFY(*posz == 42.0);
- ++posz;
- VERIFY(*posz == 44.0);
-}
-
-int
-main()
-{
- test01();
- test02();
- test03();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/2.cc
deleted file mode 100644
index 637923fbba0..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/2.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-// remove
-void
-test01()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl =
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
- fl.remove(7);
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator
- pos = fl.cbefore_begin();
-
- for (std::size_t i = 0; i < 7; ++i)
- ++pos;
- VERIFY(*pos == 6);
-
- ++pos;
- VERIFY(*pos == 8);
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/3.cc
deleted file mode 100644
index 95a89d01eea..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/3.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-#include <algorithm>
-
-bool test __attribute__((unused)) = true;
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-// This test verifies the following:
-// remove_if
-void
-test01()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl =
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
- fl.remove_if(std::bind2nd(std::less<int>(),5));
-
- std::forward_list<int, _ExtPtr_allocator<int> >::const_iterator
- pos = fl.cbegin();
- VERIFY(*pos == 5);
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/4.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/4.cc
deleted file mode 100644
index 5b2e0344889..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/4.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-// unique
-void
-test01()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl =
- {99, 5, 99, 6, -5, 666, 777, 888, 42, 42, 42, 42, 42, 7, 0, 0, 0, 9, 9, 9};
-
- fl.unique();
-
- std::forward_list<int, _ExtPtr_allocator<int> > fl2 =
- {99, 5, 99, 6, -5, 666, 777, 888, 42, 7, 0, 9};
-
- VERIFY(fl == fl2);
-}
-
-// Test comparison predicate.
-template<typename Num>
- class Mod
- {
- public:
- Mod(const Num & mod)
- {
- m = mod;
- }
- bool operator()(const Num i, const Num j)
- {
- return i%m == j%m;
- }
- private:
- Num m;
- };
-
-// This test verifies the following:
-// unique with predicate
-void
-test02()
-{
- std::forward_list<int, _ExtPtr_allocator<int> > fl =
- {99, 5, 99, 6, -5, 666, 777, 888, 42, 7, 0, 9};
-
- fl.unique(Mod<int>(111));
-
- std::forward_list<int, _ExtPtr_allocator<int> > fl2 =
- {99, 5, 99, 6, -5, 666, 42, 7, 0, 9};
-
- VERIFY(fl == fl2);
-}
-
-int
-main()
-{
- test01();
- test02();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/5.cc
deleted file mode 100644
index 13d15b39d12..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/5.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-//
-void
-test01()
-{
- typedef std::forward_list<double, _ExtPtr_allocator<double> > fwd_list_type;
-
- fwd_list_type a = {0.0, 1.0, 2.0, 3.0, 4.0};
- fwd_list_type b = {1.0, 2.0, 3.0, 4.0, 4.0, 5.0};
-
- a.merge(std::move(b));
-
- fwd_list_type r = {0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 4.0, 5.0};
-
- VERIFY(a == r);
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/6.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/6.cc
deleted file mode 100644
index 06eec7d784f..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/6.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// Comparison functor.
-template<typename Num>
- class Comp
- {
- public:
- Comp(const Num & num)
- {
- n = num;
- }
- bool operator()(const Num i, const Num j)
- {
- return (n * i) < (n * j);
- }
- private:
- Num n;
- };
-
-// This test verifies the following:
-//
-void
-test01()
-{
- typedef std::forward_list<int, _ExtPtr_allocator<int> > fwd_list_type;
-
- const unsigned int n = 13;
- int order[][n] = {
- { 0,1,2,3,4,5,6,7,8,9,10,11,12 },
- { 6,2,8,4,11,1,12,7,3,9,5,0,10 },
- { 12,11,10,9,8,7,6,5,4,3,2,1,0 },
- };
- fwd_list_type sorted(order[0], order[0] + n);
-
- for (unsigned int i = 0; i < sizeof(order)/sizeof(*order); ++i)
- {
- fwd_list_type head(order[i], order[i] + n);
-
- head.sort();
-
- VERIFY(head == sorted);
- }
-
- fwd_list_type reversed(order[2], order[2] + n);
- for (unsigned int i = 0; i < sizeof(order)/sizeof(*order); ++i)
- {
- fwd_list_type head(order[i], order[i] + n);
-
- Comp<int> comp(-1);
- head.sort( comp );
-
- VERIFY(head == reversed);
- }
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/7.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/7.cc
deleted file mode 100644
index abbbec1b7bc..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/operations/7.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <testsuite_hooks.h>
-#include <ext/extptr_allocator.h>
-
-#include <algorithm>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-//
-void
-test01()
-{
- const unsigned int n = 13;
- int order[n] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
-
- std::forward_list<int, _ExtPtr_allocator<int> > fl(order, order + n);
-
- std::forward_list<int, _ExtPtr_allocator<int> > fl2;
- for (std::size_t i = 0; i < n; ++i)
- fl2.push_front(order[i]);
-
- fl.reverse();
-
- VERIFY(std::lexicographical_compare(fl.begin(), fl.end(),
- fl2.begin(), fl2.end()) == false);
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/1.cc
deleted file mode 100644
index f4e9e7205ff..00000000000
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/1.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can 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 Pred the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
-
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-#include <testsuite_hooks.h>
-
-using __gnu_cxx::_ExtPtr_allocator;
-
-bool test __attribute__((unused)) = true;
-
-// A nontrivial type.
-template<typename T>
- struct A { };
-
-// Another nontrivial type
-struct B { };
-
-// A nontrivial type convertible from an int
-struct C
-{
- C(int i) : i_(i) { }
- bool operator==(const C& rhs) { return i_ == rhs.i_; }
- int i_;
-};
-
-// This test verifies the following.
-//
-void
-test01()
-{
- std::forward_list< A<B>, _ExtPtr_allocator<A<B> > > lst;
- VERIFY(lst.begin() == lst.end());
- VERIFY(std::distance(lst.begin(), lst.end()) == 0);
-
- // check type definitions -- will fail compile if missing
- typedef std::forward_list< A<B> >::reference reference;
- typedef std::forward_list< A<B> >::const_reference const_reference;
- typedef std::forward_list< A<B> >::iterator iterator;
- typedef std::forward_list< A<B> >::const_iterator const_iterator;
- typedef std::forward_list< A<B> >::size_type size_type;
- typedef std::forward_list< A<B> >::difference_type difference_type;
- typedef std::forward_list< A<B> >::value_type value_type;
- typedef std::forward_list< A<B> >::allocator_type allocator_type;
- typedef std::forward_list< A<B> >::pointer pointer;
- typedef std::forward_list< A<B> >::const_pointer const_pointer;
-}
-
-int
-main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc
index 92678f39d69..b6ae3f3795c 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/modifiers/2.cc
@@ -36,8 +36,8 @@ test01()
std::forward_list<int>::iterator ret = fl.insert_after(fl.before_begin(),
42);
- VERIFY(ret == fl.begin());
- VERIFY(fl.front() == 42);
+ VERIFY( ret == fl.begin() );
+ VERIFY( fl.front() == 42 );
}
// This test verifies the following:
@@ -48,21 +48,24 @@ test02()
std::forward_list<int>::const_iterator pos = fl.cbegin();
++pos;
- VERIFY(*pos == 1);
+ VERIFY( *pos == 1 );
- // Note: Calling l.insert_after(pos, 5, 42); without the long five
- // gets resolved to the iterator range version and fails to compile!
- std::forward_list<int>::iterator ret = fl.insert_after(pos, 5, 42);
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, 0, 42);
+ VERIFY( ret == pos );
+ ret = fl.insert_after(pos, 5, 42);
+ VERIFY( *pos == 1 );
+
+ ++pos;
+ VERIFY( *pos == 42 );
++pos;
- VERIFY(*pos == 42);
++pos;
++pos;
++pos;
+ VERIFY( *pos == 42 );
+ VERIFY( ret == pos );
++pos;
- VERIFY(*pos == 42);
+ VERIFY( *pos == 2 );
}
// This test verifies the following:
@@ -73,19 +76,22 @@ test03()
std::forward_list<int>::const_iterator pos = fl.cbegin();
++pos;
- VERIFY(*pos == 1);
+ VERIFY( *pos == 1 );
int i[3] = {666, 777, 888};
- std::forward_list<int>::iterator ret = fl.insert_after(pos, i, i + 3);
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, i, i);
+ VERIFY( ret == pos );
+
+ ret = fl.insert_after(pos, i, i + 3);
+ VERIFY( *pos == 1 );
++pos;
++pos;
++pos;
- VERIFY(*pos == 888);
+ VERIFY( *pos == 888 );
+ VERIFY( ret == pos );
++pos;
- VERIFY(*pos == 2);
+ VERIFY( *pos == 2 );
}
// This test verifies the following:
@@ -96,17 +102,23 @@ test04()
std::forward_list<int>::const_iterator pos = fl.cbegin();
++pos;
- VERIFY(*pos == 1);
+ VERIFY( *pos == 1 );
+
+ std::forward_list<int>::iterator ret = fl.insert_after(pos, { });
+ VERIFY( ret == pos);
- std::forward_list<int>::iterator ret
- = fl.insert_after(pos, {-1, -2, -3, -4, -5});
- VERIFY(ret == pos);
- VERIFY(*pos == 1);
+ ret = fl.insert_after(pos, {-1, -2, -3, -4, -5});
+ VERIFY( *pos == 1);
++pos;
++pos;
++pos;
- VERIFY(*pos == -3);
+ VERIFY( *pos == -3 );
+ ++pos;
+ ++pos;
+ VERIFY( ret == pos );
+ ++pos;
+ VERIFY( *pos == 2 );
}
// This test verifies the following:
@@ -117,17 +129,17 @@ test05()
std::forward_list<std::string>::const_iterator pos = fl.cbegin();
++pos;
- VERIFY(*pos == "BBB");
+ VERIFY( *pos == "BBB" );
std::string x( "XXX" );
std::forward_list<std::string>::iterator ret
= fl.insert_after(pos, std::move(x));
- VERIFY(*pos == "BBB");
+ VERIFY( *pos == "BBB" );
++pos;
- VERIFY(ret == pos);
- VERIFY(*pos == "XXX");
+ VERIFY( ret == pos );
+ VERIFY( *pos == "XXX" );
++pos;
- VERIFY(*pos == "CCC");
+ VERIFY( *pos == "CCC" );
}
int
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
index f4bc4cbc9e8..8d72db59c8b 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1194 }
// { dg-excess-errors "" }
// Copyright (C) 2009, 2010 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
index 8a591dbbb17..5f5ac2c7713 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1194 }
// { dg-excess-errors "" }
// Copyright (C) 2009, 2010 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
index 9db92f2c64b..340a6be65e3 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1194 }
// { dg-excess-errors "" }
// Copyright (C) 2009, 2010 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
index 804f10b5c60..1173dc1b697 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1194 }
// { dg-excess-errors "" }
// Copyright (C) 2009, 2010 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/25_algorithms/shuffle/1.cc b/libstdc++-v3/testsuite/25_algorithms/shuffle/1.cc
new file mode 100644
index 00000000000..b0e3574b4e0
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/shuffle/1.cc
@@ -0,0 +1,67 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <algorithm>
+#include <random>
+#include <vector>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ for (unsigned size = 0; size < 50; ++size)
+ {
+ std::vector<int> vref(size);
+ std::iota(vref.begin(), vref.end(), 0);
+ std::vector<int> v1(vref), v2(vref);
+
+ std::ranlux48_base g1(size), g2(size + 1);
+ std::shuffle(v1.begin(), v1.end(), g1);
+ std::shuffle(v2.begin(), v2.end(), g2);
+
+ if (size >= 10)
+ {
+ VERIFY( !std::equal(v1.begin(), v1.end(), vref.begin()) );
+ VERIFY( !std::equal(v2.begin(), v2.end(), vref.begin()) );
+ VERIFY( !std::equal(v1.begin(), v1.end(), v2.begin()) );
+ }
+
+ for (unsigned ind = 0; ind < size; ++ind)
+ {
+ auto it1 = std::find(v1.begin(), v1.end(), vref[ind]);
+ auto it2 = std::find(v2.begin(), v2.end(), vref[ind]);
+ VERIFY( it1 != v1.end() );
+ VERIFY( it2 != v2.end() );
+ v1.erase(it1);
+ v2.erase(it2);
+ }
+ VERIFY( v1.empty() );
+ VERIFY( v2.empty() );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/2.cc
index d34cccd503e..6941bd08779 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/2.cc
@@ -1,5 +1,10 @@
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// { dg-require-cstdint "" }
+
+// 2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -17,11 +22,17 @@
// <http://www.gnu.org/licenses/>.
-// This file tests explicit instantiation of library containers
+#include <algorithm>
+#include <random>
+#include <testsuite_api.h>
-#include <forward_list>
-#include <ext/extptr_allocator.h>
+namespace std
+{
+ using __gnu_test::NonDefaultConstructible;
-// { dg-do compile }
+ typedef NonDefaultConstructible value_type;
+ typedef value_type* iterator_type;
+ typedef std::mt19937_64 ugenerator_type;
-template class std::forward_list<int, __gnu_cxx::_ExtPtr_allocator<int> >;
+ template void shuffle(iterator_type, iterator_type, ugenerator_type&);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/pod.cc
index 4db7031db9f..a33ddd46bf9 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/shuffle/requirements/explicit_instantiation/pod.cc
@@ -1,6 +1,10 @@
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2010-03-19 Paolo Carlini <paolo.carlini@oracle.com>
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -17,13 +21,17 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+#include <algorithm>
+#include <random>
+#include <testsuite_character.h>
-// This file tests explicit instantiation of library containers
+namespace std
+{
+ using __gnu_test::pod_int;
-#include <forward_list>
-#include <ext/extptr_allocator.h>
-
-// { dg-do compile }
+ typedef pod_int value_type;
+ typedef value_type* iterator_type;
+ typedef std::mt19937_64 ugenerator_type;
-// libstdc++/21770
-template class std::forward_list<int, __gnu_cxx::_ExtPtr_allocator<char> >;
+ template void shuffle(iterator_type, iterator_type, ugenerator_type&);
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/equal.cc
new file mode 100644
index 00000000000..b3e8b9702f6
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::bernoulli_distribution u(0.75), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..6ed72faa1a9
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::bernoulli_distribution u(0.75), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/equal.cc
new file mode 100644
index 00000000000..9002614d418
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::binomial_distribution<int> u(3, 0.75), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..fb05a0daa1d
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::binomial_distribution<int> u(3, 0.75), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/4.cc b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/equal.cc
index 051ac71ec89..068c8ca049d 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/4.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/equal.cc
@@ -1,47 +1,42 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can 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 Pred the implied warranty of
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General 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/>.
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+// 26.5.8.4.4 class template cauchy_distribution [rand.dist.norm.cauchy]
-#include <forward_list>
-#include <ext/extptr_allocator.h>
+#include <random>
#include <testsuite_hooks.h>
-bool test __attribute__((unused)) = true;
-
-
-// This test verifies the following:
-// swap
void
test01()
{
- std::forward_list<int> fl1({0, 1, 2, 3, 4, 5});
- std::forward_list<int> fl2({666, 777, 888});
+ bool test __attribute__((unused)) = true;
- fl1.swap(fl2);
+ std::cauchy_distribution<double> u(5.0, 2.0), v, w;
- VERIFY(fl1.front() == 666);
- VERIFY(fl2.front() == 0);
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
}
-int
-main()
+int main()
{
test01();
return 0;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/5.cc b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/inequal.cc
index 5ddbfe75639..de1e6f63c1d 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/ext_pointer/modifiers/5.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/operators/inequal.cc
@@ -1,47 +1,42 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can 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 Pred the implied warranty of
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General 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/>.
-// 23.2.3.n forward_list xxx [lib.forward_list.xxx]
+// 26.5.8.4.4 class template cauchy_distribution [rand.dist.norm.cauchy]
-#include <forward_list>
-#include <ext/extptr_allocator.h>
+#include <random>
#include <testsuite_hooks.h>
-bool test __attribute__((unused)) = true;
-
-// This test verifies the following:
-// clear
void
test01()
{
- std::forward_list<int, __gnu_cxx::_ExtPtr_allocator<int> > fl(
- {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
-
- VERIFY(fl.empty() == false);
+ bool test __attribute__((unused)) = true;
- fl.clear();
+ std::cauchy_distribution<double> u(5.0, 2.0), v, w;
- VERIFY(fl.empty() == true);
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
}
-int
-main()
+int main()
{
test01();
return 0;
diff --git a/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/equal.cc
new file mode 100644
index 00000000000..e84e1046f59
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::chi_squared_distribution<double> u(1.5), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..eb95739ef93
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::chi_squared_distribution<double> u(1.5), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/inequal.cc
new file mode 100644
index 00000000000..fff369b1b32
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/inequal.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.4.1 class template discard_block_engine [rand.adapt.disc]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::discard_block_engine
+ <
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
+ 389, 24
+ > u, v;
+
+ VERIFY( !(u != v) );
+
+ u.discard(100);
+ v.discard(100);
+
+ VERIFY( !(u != v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/equal.cc
new file mode 100644
index 00000000000..6ef26c9c643
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/equal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
+ std::discrete_distribution<int> u(wt.begin(), wt.end()), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..2215a7008f9
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/operators/inequal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
+ std::discrete_distribution<int> u(wt.begin(), wt.end()), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/equal.cc
new file mode 100644
index 00000000000..e4a30bba69c
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::exponential_distribution<double> u(0.5), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..a3fbc2fbcae
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::exponential_distribution<double> u(0.5), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/equal.cc
new file mode 100644
index 00000000000..85e78a60c45
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::extreme_value_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..dbc65f837f7
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::extreme_value_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/equal.cc
new file mode 100644
index 00000000000..bedb79e71d3
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::fisher_f_distribution<double> u(2.0, 3.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..ae19853a0fa
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::fisher_f_distribution<double> u(2.0, 3.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/equal.cc
new file mode 100644
index 00000000000..131132f0416
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::gamma_distribution<double> u(1.5, 3.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..1fe8057dada
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::gamma_distribution<double> u(1.5, 3.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/equal.cc
new file mode 100644
index 00000000000..bd20f9262d8
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::geometric_distribution<int> u(0.75), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..19031ccf33f
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.3 Class template geometric_distribution [rand.dist.bern.geom]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::geometric_distribution<int> u(0.75), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/inequal.cc
new file mode 100644
index 00000000000..a1e05a715fc
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/inequal.cc
@@ -0,0 +1,49 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.4.2 class template independent_bits_engine [rand.adapt.bits]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::independent_bits_engine
+ <std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
+ 48, uint_fast64_t> u, v;
+
+ VERIFY( !(u != v) );
+
+ u.discard(100);
+ v.discard(100);
+
+ VERIFY( !(u != v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/inequal.cc
new file mode 100644
index 00000000000..768837a3086
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/inequal.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.3.1 class template linear_congruential_engine [rand.eng.lcong]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::minstd_rand0 a;
+ std::minstd_rand0 b;
+ std::minstd_rand0 c(120);
+
+ VERIFY( a != c );
+ VERIFY( !(a != b) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/equal.cc
new file mode 100644
index 00000000000..684c0ca93bf
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::lognormal_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..ce427e573ad
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::lognormal_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/inequal.cc
new file mode 100644
index 00000000000..94ccb76f7c1
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/inequal.cc
@@ -0,0 +1,52 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.3.2 Class template mersenne_twister_engine [rand.eng.mers]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::mersenne_twister_engine<
+ unsigned long, 32, 624, 397, 31,
+ 0x9908b0dful, 11,
+ 0xfffffffful, 7,
+ 0x9d2c5680ul, 15,
+ 0xefc60000ul, 18, 1812433253ul> u, v;
+
+ VERIFY( !(u != v) );
+
+ u.discard(100);
+ v.discard(100);
+
+ VERIFY( !(u != v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/equal.cc
new file mode 100644
index 00000000000..08ec8938f9e
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/equal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.4 Class template negative_binomial_distribution
+// [rand.dist.bern.negbin]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::negative_binomial_distribution<int> u(3, 0.75), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..86d23e77095
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/operators/inequal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.2.4 Class template negative_binomial_distribution
+// [rand.dist.bern.negbin]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::negative_binomial_distribution<int> u(3, 0.75), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/equal.cc
new file mode 100644
index 00000000000..6dac4b38631
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.1 Class template normal_distribution [rand.dist.norm.normal]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::normal_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..e3a31f68e18
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.1 Class template normal_distribution [rand.dist.norm.normal]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::normal_distribution<double> u(5.0, 2.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/equal.cc
new file mode 100644
index 00000000000..fc74cf11a69
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/equal.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.2 Class template piecewise_constant_distribution
+// [rand.dist.samp.pconst]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
+ std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
+ std::piecewise_constant_distribution<double>
+ u(x.begin(), x.end(), wt.begin()), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..dec264d1c32
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/operators/inequal.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.2 Class template piecewise_constant_distribution
+// [rand.dist.samp.pconst]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
+ std::vector<double> wt = { 0.5, 1.0, 2.5, 1.5, 0.5 };
+ std::piecewise_constant_distribution<double>
+ u(x.begin(), x.end(), wt.begin()), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/equal.cc
new file mode 100644
index 00000000000..c3510b9cc13
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/equal.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.3 Class template piecewise_linear_distribution
+// [rand.dist.samp.plinear]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
+ std::vector<double> wt = { 0.0, 1.0, 2.5, 1.5, 0.5, 0.0 };
+ std::piecewise_linear_distribution<double>
+ u(x.begin(), x.end(), wt.begin()), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..bbb96dc0ed3
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/operators/inequal.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.5.3 Class template piecewise_linear_distribution
+// [rand.dist.samp.plinear]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<double> x = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 };
+ std::vector<double> wt = { 0.0, 1.0, 2.5, 1.5, 0.5, 0.0 };
+ std::piecewise_linear_distribution<double>
+ u(x.begin(), x.end(), wt.begin()), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/equal.cc
new file mode 100644
index 00000000000..3ded153fe27
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.1 Class template poisson_distribution [rand.dist.pois.poisson]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::poisson_distribution<int> u(5.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..a996dc15433
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.1 Class template poisson_distribution [rand.dist.pois.poisson]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::poisson_distribution<int> u(5.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/inequal.cc
new file mode 100644
index 00000000000..43fc99fbbad
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/inequal.cc
@@ -0,0 +1,51 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.4.1 class template discard_block_engine [rand.adapt.disc]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::shuffle_order_engine
+ <
+ std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
+ 256
+ > u, v;
+
+ VERIFY( !(u != v) );
+
+ u.discard(100);
+ v.discard(100);
+
+ VERIFY( !(u != v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/equal.cc
new file mode 100644
index 00000000000..5117729b1c3
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.6 Class template student_t_distribution [rand.dist.norm.t]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::student_t_distribution<double> u(1.5), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..edead19d6b7
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.4.6 Class template student_t_distribution [rand.dist.norm.t]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::student_t_distribution<double> u(1.5), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/inequal.cc
new file mode 100644
index 00000000000..aa7ec24208a
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/inequal.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24> u;
+ std::subtract_with_carry_engine<unsigned long, 24, 10, 24> v;
+
+ VERIFY( !(u != v) );
+
+ u.discard(100);
+ v.discard(100);
+
+ VERIFY( !(u != v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/equal.cc
new file mode 100644
index 00000000000..288cc0d6665
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.1.1 Class template uniform_int_distribution [rand.dist_uni]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::uniform_int_distribution<int> u(1, 20), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..48875c36aa6
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.1.1 Class template uniform_int_distribution [rand.dist_uni]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::uniform_int_distribution<int> u(1, 20), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/equal.cc
new file mode 100644
index 00000000000..df27f6cf48c
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.1.2 Class template uniform_real_distribution [rand.dist.uni.real]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::uniform_real_distribution<double> u(-5.0, 5.0), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..a93a4fde511
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.1.2 Class template uniform_real_distribution [rand.dist.uni.real]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::uniform_real_distribution<double> u(-5.0, 5.0), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/equal.cc
new file mode 100644
index 00000000000..be4201a4f12
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/equal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.4 Class template weibull_distribution [rand.dist.pois.weibull]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::weibull_distribution<double> u(2.0, 3.5), v, w;
+
+ VERIFY( v == w );
+ VERIFY( !(u == v) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/inequal.cc
new file mode 100644
index 00000000000..44dc1d3d13c
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/operators/inequal.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 26.5.8.3.4 Class template weibull_distribution [rand.dist.pois.weibull]
+
+#include <random>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::weibull_distribution<double> u(2.0, 3.5), v, w;
+
+ VERIFY( u != v );
+ VERIFY( !(v != w) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 9336ac92555..ccb61654e7c 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-16 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
+
+ PR lto/43336
+ * lto-plugin.c (cleanup_handler): Delete temporary output files.
+
2010-01-11 Richard Guenther <rguenther@suse.de>
PR lto/41569
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 2fb4f2a7782..97b7c0fdfec 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -524,6 +524,7 @@ all_symbols_read_handler (void)
static enum ld_plugin_status
cleanup_handler (void)
{
+ unsigned int i;
int t;
if (debug)
@@ -541,6 +542,12 @@ cleanup_handler (void)
check (t == 0, LDPL_FATAL, "could not unlink resolution file");
}
+ for (i = 0; i < num_output_files; i++)
+ {
+ t = unlink (output_files[i]);
+ check (t == 0, LDPL_FATAL, "could not unlink output file");
+ }
+
free_2 ();
return LDPS_OK;
}