summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@chromium.org>2013-06-21 12:05:49 -0700
committerCaroline Tice <cmtice@chromium.org>2013-06-21 12:05:49 -0700
commit9c1705845241cdea5cf61574218edef282901fbd (patch)
tree021da661f8a821bc7eea277521fa13f2043879a0
parent9bdedf4df4166718fa0a44811c643214c6880471 (diff)
parent8a46ed36b0449c870d0a938c1010ad610ebcf4f7 (diff)
downloadgcc-9c1705845241cdea5cf61574218edef282901fbd.tar.gz
Merge branch 'master' into vtv
Conflicts: gcc/ChangeLog gcc/cp/ChangeLog gcc/cp/decl2.c gcc/varasm.c libstdc++-v3/ChangeLog
-rw-r--r--ChangeLog8
-rw-r--r--MAINTAINERS2
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac4
-rw-r--r--contrib/ChangeLog5
-rwxr-xr-xcontrib/testsuite-management/validate_failures.py29
-rw-r--r--gcc/ChangeLog.vtv36
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h4
-rw-r--r--gcc/ada/gcc-interface/decl.c29
-rw-r--r--gcc/ada/gcc-interface/gigi.h12
-rw-r--r--gcc/ada/gcc-interface/trans.c23
-rw-r--r--gcc/ada/gcc-interface/utils.c27
-rw-r--r--gcc/ada/targparm.ads2
-rw-r--r--gcc/alias.c42
-rw-r--r--gcc/basic-block.h1
-rw-r--r--gcc/bb-reorder.c49
-rw-r--r--gcc/bb-reorder.h2
-rw-r--r--gcc/c-family/ChangeLog30
-rw-r--r--gcc/c-family/array-notation-common.c488
-rw-r--r--gcc/c-family/c-common.c8
-rw-r--r--gcc/c-family/c-common.h24
-rw-r--r--gcc/c-family/c-pragma.c7
-rw-r--r--gcc/c/ChangeLog60
-rw-r--r--gcc/c/c-array-notation.c554
-rw-r--r--gcc/c/c-parser.c19
-rw-r--r--gcc/c/c-tree.h3
-rw-r--r--gcc/c/c-typeck.c55
-rw-r--r--gcc/cfgcleanup.c2
-rw-r--r--gcc/cfgrtl.c212
-rw-r--r--gcc/cgraph.c51
-rw-r--r--gcc/cgraph.h60
-rw-r--r--gcc/cgraphunit.c261
-rw-r--r--gcc/collect2.c7
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/common/config/rx/rx-common.c5
-rw-r--r--gcc/config.gcc48
-rw-r--r--gcc/config.in8
-rw-r--r--gcc/config/aarch64/aarch64-protos.h8
-rw-r--r--gcc/config/aarch64/aarch64-simd.md132
-rw-r--r--gcc/config/aarch64/aarch64.c346
-rw-r--r--gcc/config/aarch64/aarch64.md42
-rw-r--r--gcc/config/aarch64/constraints.md5
-rw-r--r--gcc/config/aarch64/iterators.md3
-rw-r--r--gcc/config/alpha/alpha.c15
-rw-r--r--gcc/config/arm/arm-fixed.md38
-rw-r--r--gcc/config/arm/arm-ldmstm.ml7
-rw-r--r--gcc/config/arm/arm.c57
-rw-r--r--gcc/config/arm/arm.md161
-rw-r--r--gcc/config/arm/arm.opt4
-rw-r--r--gcc/config/arm/constraints.md12
-rw-r--r--gcc/config/arm/ldmstm.md72
-rw-r--r--gcc/config/arm/neon.md42
-rw-r--r--gcc/config/arm/predicates.md33
-rw-r--r--gcc/config/arm/sync.md30
-rw-r--r--gcc/config/c6x/c6x.h2
-rw-r--r--gcc/config/i386/i386-protos.h2
-rw-r--r--gcc/config/i386/i386.c394
-rw-r--r--gcc/config/i386/i386.h16
-rw-r--r--gcc/config/i386/i386.md26
-rw-r--r--gcc/config/mips/mips-cpus.def1
-rw-r--r--gcc/config/mips/mips-dsp.md9
-rw-r--r--gcc/config/mips/mips-ps-3d.md4
-rw-r--r--gcc/config/mips/mips-tables.opt288
-rw-r--r--gcc/config/mips/mips.c24
-rw-r--r--gcc/config/mips/mips.h33
-rw-r--r--gcc/config/mips/mips.md326
-rw-r--r--gcc/config/mips/mips.opt4
-rw-r--r--gcc/config/mmix/mmix.c2
-rw-r--r--gcc/config/mmix/mmix.h2
-rw-r--r--gcc/config/rl78/rl78.c19
-rw-r--r--gcc/config/rl78/rl78.md70
-rw-r--r--gcc/config/rs6000/altivec.h16
-rw-r--r--gcc/config/rs6000/altivec.md66
-rw-r--r--gcc/config/rs6000/driver-rs6000.c2
-rw-r--r--gcc/config/rs6000/linux64.h7
-rw-r--r--gcc/config/rs6000/predicates.md11
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def52
-rw-r--r--gcc/config/rs6000/rs6000-c.c436
-rw-r--r--gcc/config/rs6000/rs6000-opts.h22
-rw-r--r--gcc/config/rs6000/rs6000-protos.h3
-rw-r--r--gcc/config/rs6000/rs6000.c1176
-rw-r--r--gcc/config/rs6000/rs6000.h13
-rw-r--r--gcc/config/rs6000/rs6000.md473
-rw-r--r--gcc/config/rs6000/spe.md8
-rw-r--r--gcc/config/rs6000/sync.md166
-rw-r--r--gcc/config/rs6000/t-linux2
-rw-r--r--gcc/config/rs6000/vector.md56
-rw-r--r--gcc/config/rs6000/vsx.md543
-rw-r--r--gcc/config/s390/s390.c34
-rw-r--r--gcc/config/s390/s390.h2
-rw-r--r--gcc/config/s390/s390.md13
-rw-r--r--gcc/config/s390/s390.opt4
-rwxr-xr-xgcc/configure64
-rw-r--r--gcc/configure.ac1
-rw-r--r--gcc/cp/ChangeLog.vtv37
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/cp/class.c48
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/decl.c25
-rw-r--r--gcc/cp/decl2.c50
-rw-r--r--gcc/cp/g++spec.c57
-rw-r--r--gcc/cp/name-lookup.c4
-rw-r--r--gcc/cp/parser.c20
-rw-r--r--gcc/cp/pt.c18
-rw-r--r--gcc/cp/rtti.c15
-rw-r--r--gcc/cp/semantics.c29
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/cp/vtable-class-hierarchy.c128
-rw-r--r--gcc/cse.c4
-rw-r--r--gcc/cselib.c4
-rw-r--r--gcc/data-streamer-out.c91
-rw-r--r--gcc/data-streamer.h23
-rw-r--r--gcc/doc/extend.texi138
-rw-r--r--gcc/doc/invoke.texi29
-rw-r--r--gcc/doc/md.texi10
-rw-r--r--gcc/doc/tm.texi9
-rw-r--r--gcc/doc/tm.texi.in9
-rw-r--r--gcc/dumpfile.c2
-rw-r--r--gcc/dwarf2out.c17
-rw-r--r--gcc/emit-rtl.c1
-rw-r--r--gcc/expmed.c12
-rw-r--r--gcc/expr.c51
-rw-r--r--gcc/final.c2
-rw-r--r--gcc/fold-const.c66
-rw-r--r--gcc/fortran/ChangeLog125
-rw-r--r--gcc/fortran/array.c2
-rw-r--r--gcc/fortran/decl.c28
-rw-r--r--gcc/fortran/dependency.c4
-rw-r--r--gcc/fortran/error.c44
-rw-r--r--gcc/fortran/gfortran.h1
-rw-r--r--gcc/fortran/interface.c106
-rw-r--r--gcc/fortran/match.c8
-rw-r--r--gcc/fortran/match.h2
-rw-r--r--gcc/fortran/misc.c9
-rw-r--r--gcc/fortran/parse.c20
-rw-r--r--gcc/fortran/resolve.c4
-rw-r--r--gcc/fortran/simplify.c2
-rw-r--r--gcc/fortran/trans-array.c43
-rw-r--r--gcc/fortran/trans-array.h4
-rw-r--r--gcc/fortran/trans-decl.c114
-rw-r--r--gcc/fortran/trans-expr.c43
-rw-r--r--gcc/fortran/trans-intrinsic.c9
-rw-r--r--gcc/fortran/trans-openmp.c5
-rw-r--r--gcc/fortran/trans-stmt.c5
-rw-r--r--gcc/fortran/trans.c351
-rw-r--r--gcc/fortran/trans.h3
-rw-r--r--gcc/function.c16
-rw-r--r--gcc/gcc.c10
-rw-r--r--gcc/gdbinit.in1
-rw-r--r--gcc/genautomata.c4
-rw-r--r--gcc/gensupport.c15
-rw-r--r--gcc/gimple-fold.c5
-rw-r--r--gcc/gimple-low.c12
-rw-r--r--gcc/gimple.h3
-rw-r--r--gcc/go/gofrontend/expressions.cc36
-rw-r--r--gcc/go/gofrontend/expressions.h12
-rw-r--r--gcc/go/gofrontend/go.cc9
-rw-r--r--gcc/go/gofrontend/statements.cc146
-rw-r--r--gcc/go/gofrontend/statements.h23
-rw-r--r--gcc/go/gofrontend/types.cc1
-rw-r--r--gcc/ifcvt.c7
-rw-r--r--gcc/ipa-cp.c6
-rw-r--r--gcc/ipa-inline.c7
-rw-r--r--gcc/ipa-prop.c5
-rw-r--r--gcc/ipa-pure-const.c2
-rw-r--r--gcc/ipa.c113
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/class.c2
-rw-r--r--gcc/lra-constraints.c13
-rw-r--r--gcc/lra.c6
-rw-r--r--gcc/lto-cgraph.c89
-rw-r--r--gcc/lto-streamer.h25
-rw-r--r--gcc/lto-symtab.c113
-rw-r--r--gcc/lto/ChangeLog31
-rw-r--r--gcc/lto/lto-partition.c22
-rw-r--r--gcc/lto/lto.c67
-rw-r--r--gcc/passes.c13
-rw-r--r--gcc/rtl.def5
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/rtlanal.c4
-rw-r--r--gcc/sched-deps.c11
-rw-r--r--gcc/simplify-rtx.c5
-rw-r--r--gcc/symtab.c215
-rw-r--r--gcc/testsuite/ChangeLog669
-rw-r--r--gcc/testsuite/ada/acats/floatstore.lst1
-rwxr-xr-xgcc/testsuite/ada/acats/run_all.sh4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c18
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c18
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c23
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c6
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c21
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c6
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c3
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c17
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c176
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c56
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c2
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c39
-rwxr-xr-xgcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c14
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c7
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c17
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c20
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c17
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c6
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c4
-rw-r--r--gcc/testsuite/g++.dg/abi/abi-tag5.C6
-rw-r--r--gcc/testsuite/g++.dg/abi/forced.C3
-rw-r--r--gcc/testsuite/g++.dg/abi/guard2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype54.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted13.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted26.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/dyncast1.C31
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/error1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit11.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist47.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept15.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr52440.C27
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae46.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/union4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/vla7.C12
-rw-r--r--gcc/testsuite/g++.dg/eh/sighandle.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/builtin-offsetof1.C9
-rw-r--r--gcc/testsuite/g++.dg/ext/cleanup-10.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/cleanup-11.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/cleanup-8.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/cleanup-9.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/pr57548.C25
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/anon6.C8
-rw-r--r--gcc/testsuite/g++.dg/init/array26.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/const5.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/life1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr39496.C2
-rw-r--r--gcc/testsuite/g++.dg/other/vararg-4.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/error53.C3
-rw-r--r--gcc/testsuite/g++.dg/rtti/dyncast6.C59
-rw-r--r--gcc/testsuite/g++.dg/template/crash108.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash41.C2
-rw-r--r--gcc/testsuite/g++.dg/template/error2.C5
-rw-r--r--gcc/testsuite/g++.dg/template/instantiate3.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr54684.C1
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/partition2.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/partition3.C2
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr50413.cc2
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr50819.cc2
-rw-r--r--gcc/testsuite/g++.dg/vect/slp-pr56812.cc2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-var-20.C19
-rw-r--r--gcc/testsuite/g++.dg/warn/anonymous-namespace-5.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/aggregates.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/align.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/bitfields.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/local.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/weak.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/asm1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb76.C1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030125-1.x5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/990127-2.x1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr57568.c12
-rw-r--r--gcc/testsuite/gcc.dg/20041106-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20050503-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-isr-nosave_low_regs.c28
-rw-r--r--gcc/testsuite/gcc.dg/attr-isr-trap_exit.c23
-rw-r--r--gcc/testsuite/gcc.dg/attr-isr-trapa.c17
-rw-r--r--gcc/testsuite/gcc.dg/builtin-object-size-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-11.c2
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/complex-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c6
-rw-r--r--gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c2
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pr35739.c2
-rw-r--r--gcc/testsuite/gcc.dg/fdata-sections-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/fold-minus-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/fshort-wchar.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-1_0.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-2_0.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr30360.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr37303.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr39323-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr39323-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr39323-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr45416.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr57134.c29
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr-nosave_low_regs.c20
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr-trap_exit.c17
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr-trapa.c17
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr-trapa2.c24
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr.c17
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr2.c16
-rw-r--r--gcc/testsuite/gcc.dg/setjmp-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/shrink-wrap-alloca.c4
-rw-r--r--gcc/testsuite/gcc.dg/split-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/split-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/split-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-12g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-14g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-14gf.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-16g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-17g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-18g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-1f.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-22g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-2f.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-4g.c2
-rw-r--r--gcc/testsuite/gcc.dg/strlenopt-4gf.c2
-rw-r--r--gcc/testsuite/gcc.dg/struct-ret-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57425-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57425-2.c31
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57425-3.c31
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57478.c21
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57569.c37
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/20041218-1.c119
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c166
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/pr45354.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/pr50907.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/pr52027.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c145
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c195
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c40
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr42585.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr43491.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr57361.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-11.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-13.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-14.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-16.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-18.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-19.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-20.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-21.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-22.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-23.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-24.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-25.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-26.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-27.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-28.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-29.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-30.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-31.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-8a.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-8b.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp4
-rw-r--r--gcc/testsuite/gcc.target/aarch64/movi_1.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/vect_smlal_1.c325
-rw-r--r--gcc/testsuite/gcc.target/arm/iordi3-opt.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/pr56184.C2
-rw-r--r--gcc/testsuite/gcc.target/arm/unaligned-memcpy-3.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/unaligned-memcpy-4.c4
-rw-r--r--gcc/testsuite/gcc.target/arm/xordi3-opt.c9
-rw-r--r--gcc/testsuite/gcc.target/h8300/h8300.exp82
-rw-r--r--gcc/testsuite/gcc.target/h8300/pragma-isr.c40
-rw-r--r--gcc/testsuite/gcc.target/h8300/pragma-isr2.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/20000724-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/align-main-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/cleanup-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/inline-mcpy.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/memcpy-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32268.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36613.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39013-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39013-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39496.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr40906-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46084.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56564-1.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56564-2.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56564-3.c29
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56564-4.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/pr57459.c60
-rw-r--r--gcc/testsuite/gcc.target/i386/vect-sizes-1.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/memcpy-1.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/mips.exp1
-rw-r--r--gcc/testsuite/gcc.target/mips/umips-branch-1.c10
-rw-r--r--gcc/testsuite/gcc.target/mips/umips-branch-2.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/atomic-p7.c207
-rw-r--r--gcc/testsuite/gcc.target/powerpc/atomic-p8.c237
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bool.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-double1.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-double2.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-float1.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-float2.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-long1.c15
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-long2.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/direct-move.h183
-rw-r--r--gcc/testsuite/gcc.target/powerpc/e500-ord-1.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/e500-ord-2.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/e500-unord-1.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/e500-unord-2.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-1.c65
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-2.c204
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-3.c104
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-4.c249
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-5.c105
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-6.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-builtin-7.c32
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-1.c200
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-2.c30
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-3.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-4.c69
-rw-r--r--gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-5.c87
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr55033.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/pr57559.c24
-rw-r--r--gcc/testsuite/gcc.target/sh/attr-isr-nosave_low_regs.c32
-rw-r--r--gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c31
-rw-r--r--gcc/testsuite/gcc.target/sh/attr-isr-trapa.c18
-rw-r--r--gcc/testsuite/gcc.target/sh/pr6526.c64
-rw-r--r--gcc/testsuite/gcc.target/sh/pragma-isr-nosave_low_regs.c23
-rw-r--r--gcc/testsuite/gcc.target/sh/pragma-isr-trap-exit.c24
-rw-r--r--gcc/testsuite/gcc.target/sh/pragma-isr-trapa.c19
-rw-r--r--gcc/testsuite/gcc.target/sh/pragma-isr-trapa2.c24
-rw-r--r--gcc/testsuite/gcc.target/sh/torture/pragma-isr.c20
-rw-r--r--gcc/testsuite/gcc.target/sh/torture/pragma-isr2.c21
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f906
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f907
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_scalar_9.f903
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_48.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_type_14.f032
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_type_15.f032
-rw-r--r--gcc/testsuite/gfortran.dg/assumed_type_7.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/auto_dealloc_2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_check_7.f902
-rw-r--r--gcc/testsuite/gfortran.dg/class_19.f032
-rw-r--r--gcc/testsuite/gfortran.dg/class_array_17.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/class_array_18.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_lib_alloc_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_lib_alloc_2.f901
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_poly_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/default_initialization_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/deferred_type_param_9.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/defined_assignment_7.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/dummy_procedure_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/extends_14.f033
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_10.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_12.f90175
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_13.f90161
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_14.f90220
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_15.f90238
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_16.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/g77/f77-edit-s-out.f2
-rw-r--r--gcc/testsuite/gfortran.dg/g77/f77-edit-t-out.f4
-rw-r--r--gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f2
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_11.f902
-rw-r--r--gcc/testsuite/gfortran.dg/interface_26.f904
-rw-r--r--gcc/testsuite/gfortran.dg/io_real_boz_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/io_real_boz_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/io_real_boz_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/move_alloc_4.f903
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_print_1.f2
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_11.f906
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_15.f909
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f908
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_33.f904
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_result_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/read_x_eor.f902
-rw-r--r--gcc/testsuite/gfortran.dg/repeat_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/spread_bounds_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/storage_size_4.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/string_length_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/transpose_2.f903
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_assignment_5.f0344
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_assignment_6.f0343
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_override_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_override_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_override_5.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_override_6.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_override_7.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_27.f032
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_6.f034
-rw-r--r--gcc/testsuite/lib/target-supports.exp62
-rw-r--r--gcc/trans-mem.c17
-rw-r--r--gcc/tree-emutls.c8
-rw-r--r--gcc/tree-flow.h2
-rw-r--r--gcc/tree-into-ssa.c2
-rw-r--r--gcc/tree-object-size.c2
-rw-r--r--gcc/tree-ssa-coalesce.c50
-rw-r--r--gcc/tree-ssa-dse.c7
-rw-r--r--gcc/tree-ssa-forwprop.c60
-rw-r--r--gcc/tree-ssa-live.c8
-rw-r--r--gcc/tree-ssa-math-opts.c4
-rw-r--r--gcc/tree-ssa-structalias.c2
-rw-r--r--gcc/tree-ssa-uncprop.c14
-rw-r--r--gcc/tree-streamer-out.c5
-rw-r--r--gcc/tree-streamer.c1
-rw-r--r--gcc/tree-vect-loop.c2
-rw-r--r--gcc/tree-vect-patterns.c5
-rw-r--r--gcc/tree-vect-slp.c5
-rw-r--r--gcc/tree-vectorizer.c8
-rw-r--r--gcc/tree.c15
-rw-r--r--gcc/tree.h1
-rw-r--r--gcc/tsan.c2
-rw-r--r--gcc/value-prof.c2
-rw-r--r--gcc/varasm.c262
-rw-r--r--gcc/varpool.c92
-rw-r--r--gcc/vtable-verify.c3
-rw-r--r--libgcc/ChangeLog35
-rw-r--r--libgcc/config.host22
-rw-r--r--libgcc/config/i386/cpuinfo.c4
-rw-r--r--libgcc/config/mips/lib2funcs.c44
-rw-r--r--libgcc/config/mips/t-mips2
-rw-r--r--libgcc/config/rs6000/ibm-ldouble.c6
-rw-r--r--libgcc/config/sh/lib1funcs.S225
-rw-r--r--libgcc/config/tilepro/atomic.c1
-rw-r--r--libgcc/config/tilepro/atomic.h32
-rw-r--r--libgcc/vtv_end.c6
-rw-r--r--libgcc/vtv_start.c6
-rw-r--r--libgfortran/ChangeLog40
-rw-r--r--libgfortran/io/write_float.def36
-rw-r--r--libgomp/ChangeLog14
-rw-r--r--libgomp/config/posix/ptrlock.h5
-rw-r--r--libgomp/configure.tgt5
-rw-r--r--libgomp/testsuite/libgomp.c/icv-2.c2
-rw-r--r--libgomp/testsuite/libgomp.c/lock-3.c2
-rw-r--r--libgomp/testsuite/libgomp.c/pr48591.c2
-rw-r--r--libiberty/ChangeLog12
-rw-r--r--libiberty/Makefile.in24
-rwxr-xr-xlibiberty/configure56
-rw-r--r--libiberty/configure.ac46
-rw-r--r--libitm/ChangeLog12
-rw-r--r--libitm/local_atomic27
-rw-r--r--libsanitizer/ChangeLog5
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_linux.cc4
-rw-r--r--libstdc++-v3/ChangeLog.vtv44
-rw-r--r--libstdc++-v3/Makefile.in2
-rw-r--r--libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt28
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver30
-rw-r--r--libstdc++-v3/configure.host2
-rw-r--r--libstdc++-v3/doc/Makefile.in2
-rw-r--r--libstdc++-v3/fragment.am2
-rw-r--r--libstdc++-v3/include/Makefile.am3
-rw-r--r--libstdc++-v3/include/Makefile.in5
-rw-r--r--libstdc++-v3/include/bits/alloc_traits.h2
-rw-r--r--libstdc++-v3/include/bits/basic_string.h34
-rw-r--r--libstdc++-v3/include/bits/c++14_warning.h37
-rw-r--r--libstdc++-v3/include/bits/c++config6
-rw-r--r--libstdc++-v3/include/bits/forward_list.h11
-rw-r--r--libstdc++-v3/include/bits/hashtable.h16
-rw-r--r--libstdc++-v3/include/bits/move.h2
-rw-r--r--libstdc++-v3/include/bits/parse_numbers.h417
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h134
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h241
-rw-r--r--libstdc++-v3/include/bits/stl_map.h3
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h1
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h2
-rw-r--r--libstdc++-v3/include/bits/stl_set.h2
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h29
-rw-r--r--libstdc++-v3/include/bits/unordered_map.h8
-rw-r--r--libstdc++-v3/include/c_global/cstddef13
-rw-r--r--libstdc++-v3/include/c_std/cstddef8
-rw-r--r--libstdc++-v3/include/std/chrono131
-rw-r--r--libstdc++-v3/include/std/complex4
-rw-r--r--libstdc++-v3/include/std/iomanip155
-rw-r--r--libstdc++-v3/include/std/mutex2
-rw-r--r--libstdc++-v3/include/std/shared_mutex437
-rw-r--r--libstdc++-v3/include/std/tuple8
-rw-r--r--libstdc++-v3/include/std/type_traits165
-rw-r--r--libstdc++-v3/include/tr1/modified_bessel_func.tcc15
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am11
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in37
-rw-r--r--libstdc++-v3/libsupc++/vtv_fail.cc233
-rw-r--r--libstdc++-v3/libsupc++/vtv_fail.h5
-rw-r--r--libstdc++-v3/libsupc++/vtv_rts.cc125
-rw-r--r--libstdc++-v3/po/Makefile.in2
-rw-r--r--libstdc++-v3/python/Makefile.in2
-rwxr-xr-xlibstdc++-v3/scripts/testsuite_flags.in2
-rw-r--r--libstdc++-v3/src/Makefile.am22
-rw-r--r--libstdc++-v3/src/Makefile.in17
-rw-r--r--libstdc++-v3/src/c++11/Makefile.am16
-rw-r--r--libstdc++-v3/src/c++11/Makefile.in18
-rw-r--r--libstdc++-v3/src/c++98/Makefile.am16
-rw-r--r--libstdc++-v3/src/c++98/Makefile.in18
-rw-r--r--libstdc++-v3/testsuite/17_intro/freestanding.cc2
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc2
-rw-r--r--libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c2
-rw-r--r--libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc23
-rw-r--r--libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc24
-rw-r--r--libstdc++-v3/testsuite/18_support/pthread_guard.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc5
-rw-r--r--libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc7
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/literals/types.cc70
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/literals/values.cc65
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/integral_constant/call_operator.cc36
-rw-r--r--libstdc++-v3/testsuite/20_util/is_assignable/value.cc12
-rw-r--r--libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc50
-rw-r--r--libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_function/value.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc8
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc43
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc46
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/allocator/ext_ptr.cc46
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/pthread1.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/pthread5.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc (renamed from libstdc++-v3/testsuite/23_containers/map/dr130.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/pthread6.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc (renamed from libstdc++-v3/testsuite/23_containers/multimap/dr130.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc35
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc (renamed from libstdc++-v3/testsuite/23_containers/multiset/dr130.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc (renamed from libstdc++-v3/testsuite/23_containers/set/dr130.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C51
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C51
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/allocator/ext_ptr.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/allocator/ext_ptr.cc44
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc4
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/equal/1.cc12
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/equal/2.cc193
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/equal/check_type2.cc48
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc115
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/is_permutation/check_type2.cc46
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/mismatch/1.cc2
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/mismatch/2.cc175
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/mismatch/check_type2.cc51
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/manipulators/standard/char/quoted.cc88
-rw-r--r--libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/quoted.cc88
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/42819.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/49668.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/54297.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/any.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/async.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/launch.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/async/sync.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/call_once/39909.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/call_once/49668.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/cons/move.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/45133.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/get.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/get2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/share.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/valid.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/wait.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/lock/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/lock/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc26
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/move.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/members/swap.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/1.cc53
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/2.cc54
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/3.cc54
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/4.cc54
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/5.cc58
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/cons/6.cc58
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/locking/1.cc61
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/locking/2.cc106
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/locking/3.cc67
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/locking/4.cc69
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/1.cc68
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/2.cc68
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/requirements/explicit_instantiation.cc31
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_lock/requirements/typedefs.cc33
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/cons/1.cc49
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/cons/assign_neg.cc35
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/cons/copy_neg.cc34
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/requirements/standard_layout.cc31
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/1.cc52
-rw-r--r--libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/2.cc67
-rw-r--r--libstdc++-v3/testsuite/30_threads/this_thread/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/this_thread/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/this_thread/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/this_thread/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/5.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/6.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/7.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/8.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/9.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/5.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/native_handle/cancel.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/swap/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/try_lock/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/try_lock/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/try_lock/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/try_lock/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc4
-rw-r--r--libstdc++-v3/testsuite/Makefile.in2
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mh.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc4
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp6
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc2
-rw-r--r--libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc4
-rw-r--r--libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc4
-rw-r--r--libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc34
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_allocator.h31
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_containers.h52
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_iterators.h10
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_performance.h2
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_shared.cc58
898 files changed, 20603 insertions, 4966 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c36f005a82..62eac0699a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-14 Vidya Praveen <vidyapraveen@arm.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2013-06-01 Dinar Temirbulatov <dinar@kugelworks.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2013-05-17 David Malcolm <dmalcolm@redhat.com>
* MAINTAINERS (Write After Approval): Add myself.
diff --git a/MAINTAINERS b/MAINTAINERS
index 50672c9c0d4..ff82d932ecf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -487,6 +487,7 @@ Nicolas Pitre nico@cam.org
Paul Pluzhnikov ppluzhnikov@google.com
Marek Polacek polacek@redhat.com
Antoniu Pop antoniu.pop@gmail.com
+Vidya Praveen vidyapraveen@arm.com
Vladimir Prus vladimir@codesourcery.com
Yao Qi yao@codesourcery.com
Jerry Quinn jlquinn@optonline.net
@@ -530,6 +531,7 @@ Gabriele Svelto gabriele.svelto@st.com
Sriraman Tallam tmsriram@google.com
Chung-Lin Tang cltang@codesourcery.com
Samuel Tardieu sam@rfc1149.net
+Dinar Temirbulatov dinar@kugelworks.com
Kresten Krab Thorup krab@gcc.gnu.org
Caroline Tice ctice@apple.com
Kyrylo Tkachov kyrylo.tkachov@arm.com
diff --git a/configure b/configure
index e161cada19e..9ecf7d08ad6 100755
--- a/configure
+++ b/configure
@@ -13743,7 +13743,7 @@ else
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
- CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+ CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
@@ -13788,7 +13788,7 @@ else
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
- RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+ RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
elif expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
diff --git a/configure.ac b/configure.ac
index bec489fc395..ca11392fb50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3159,10 +3159,10 @@ GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
- [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
+ [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
c++)
GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
- [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
+ [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
c++)
GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 6fbdfe2e310..1233e6acaea 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-06 Brooks Moses <bmoses@google.com>
+
+ * testsuite-management/validate_failures.py: Fix handling of
+ summary lines with "|" characters or empty description fields.
+
2013-05-24 Chung-Ju Wu <jasonwucj@gmail.com>
* download_prerequisites: Download isl and cloog conditionally.
diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index e9e5292f17b..2779050468d 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -119,20 +119,15 @@ class TestResult(object):
def __init__(self, summary_line, ordinal=-1):
try:
- self.attrs = ''
- if '|' in summary_line:
- (self.attrs, summary_line) = summary_line.split('|', 1)
+ (self.attrs, summary_line) = SplitAttributesFromSummaryLine(summary_line)
try:
(self.state,
self.name,
- self.description) = re.match(r' *([A-Z]+):\s*(\S+)\s+(.*)',
+ self.description) = re.match(r'([A-Z]+):\s*(\S+)\s*(.*)',
summary_line).groups()
except:
print 'Failed to parse summary line: "%s"' % summary_line
raise
- self.attrs = self.attrs.strip()
- self.state = self.state.strip()
- self.description = self.description.strip()
self.ordinal = ordinal
except ValueError:
Error('Cannot parse summary line "%s"' % summary_line)
@@ -208,11 +203,20 @@ def IsComment(line):
return line.startswith('#')
+def SplitAttributesFromSummaryLine(line):
+ """Splits off attributes from a summary line, if present."""
+ if '|' in line and not _VALID_TEST_RESULTS_REX.match(line):
+ (attrs, line) = line.split('|', 1)
+ attrs = attrs.strip()
+ else:
+ attrs = ''
+ line = line.strip()
+ return (attrs, line)
+
+
def IsInterestingResult(line):
"""Return True if line is one of the summary lines we care about."""
- if '|' in line:
- (_, line) = line.split('|', 1)
- line = line.strip()
+ (_, line) = SplitAttributesFromSummaryLine(line)
return bool(_VALID_TEST_RESULTS_REX.match(line))
@@ -416,8 +420,9 @@ def PerformComparison(expected, actual, ignore_missing_failures):
if not ignore_missing_failures and len(expected_vs_actual) > 0:
PrintSummary('Expected results not present in this build (fixed tests)'
'\n\nNOTE: This is not a failure. It just means that these '
- 'tests were expected\nto fail, but they worked in this '
- 'configuration.\n', expected_vs_actual)
+ 'tests were expected\nto fail, but either they worked in '
+ 'this configuration or they were not\npresent at all.\n',
+ expected_vs_actual)
if tests_ok:
print '\nSUCCESS: No unexpected failures.'
diff --git a/gcc/ChangeLog.vtv b/gcc/ChangeLog.vtv
new file mode 100644
index 00000000000..88eb062e5c9
--- /dev/null
+++ b/gcc/ChangeLog.vtv
@@ -0,0 +1,36 @@
+2013-06-16 Caroline Tice <cmtice@google.com>
+
+ * configure (CXX_FOR_TARGET): Add libstdc++-v3/libsupc++/.libs to the
+ library search path.
+ * ligbcc/config.host (extra_parts): Add vtv_start.o and vtv_end.o to
+ the list.
+ * libgcc/Makefile.in: Add definitin for gcc_srcdir; add rules for
+ building vtv_start.o and vtv_end.o.
+ * passes.c (init_optimization_pass): Add pass_vtable_verify.
+ * vtv_start.c: New file.
+ * tree-pass.h (pass_vtable_verify): Declare new pass.
+ * vtable-verify.c: New file, contains vtable verification tree
+ pass.
+ * vtable-verify.h: New file.
+ * common.opt: (fvtable-verify=): New option. Also define vtv_priority
+ values for the option.
+ * timevar.def (TV_VTABLE_VERIFICATION): Declare new time var.
+ * config/gnu-user.h: Add vtv_start.o to STARTFILE_SPEC if
+ fvtable-verify is present; Add vtv_end.o to ENDFILE_SPEC if
+ fvtable-verify is present.
+ * tree.h: Add extern function declaration for save_vtable_map_decl.
+ * vtv_end.c: New file.
+ * flag-types.h (vtv_priority): New enum, for values for new
+ '-fvtable-verify=' option.
+ * Makefile.in (OBJS): Add vtable-verify.o to list of object
+ files.
+ (vtable-verify.o): Add rule for building object file.
+ (GTFILES): Add vtable-verify.c to list of files that use GCC's
+ garbage collector.
+ * varasm.c (assemble_variable): Add code for handling variables that
+ go into the ".vtable_map_vars" section.
+ (assemble_vtv_perinit_initializer): New function.
+ (default_section_type_flags): Add SECTION_LINKONCE to
+ ".vtable_map_vars" section items.
+ * output.h (assemble_vtv_preinit_initializer): External function decl.
+
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index fb37041a578..218924640da 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130530
+20130616
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 6664305fb10..d841e6f53ca 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -848,7 +848,7 @@ EXCEPT_H = except.h $(HASHTAB_H)
TARGET_DEF = target.def target-hooks-macros.h
C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
-TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h
+TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
@@ -3162,7 +3162,7 @@ cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
$(FUNCTION_H) $(EXCEPT_H) $(TM_P_H) $(INSN_ATTR_H) \
insn-config.h $(EXPR_H) \
$(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
- $(TREE_PASS_H) $(DF_H) $(GGC_H) $(COMMON_TARGET_H) gt-cfgrtl.h
+ $(TREE_PASS_H) $(DF_H) $(GGC_H) $(COMMON_TARGET_H) gt-cfgrtl.h bb-reorder.h
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(BASIC_BLOCK_H) \
$(TIMEVAR_H) sbitmap.h $(BITMAP_H)
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1a37786243a..4122896c915 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2013-06-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): Delete.
+ * gcc-interface/gigi.h (annotate_object): Adjust prototype.
+ (convert_vms_descriptor): Likewise.
+ * gcc-interface/decl.c (gnat_to_gnu_param): Do not pass fat pointer
+ types by double dereference.
+ (annotate_object): Remove BY_DOUBLE_REF parameter and adjust.
+ (gnat_to_gnu_entity): Adjust calls to annotate_object.
+ * gcc-interface/trans.c (Identifier_to_gnu): Do not deal with double
+ dereference.
+ (Call_to_gnu): Likewise.
+ (build_function_stub): Adjust call to convert_vms_descriptor.
+ (Subprogram_Body_to_gnu): Adjust call to annotate_object.
+ * gcc-interface/utils.c (convert_vms_descriptor): Remove BY_REF
+ parameter and adjust.
+
2013-05-30 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Makefile.in (arm% androideabi): Robustify.
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 15d1cdd1e82..c1b45effcdb 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -360,10 +360,6 @@ do { \
constant CONSTRUCTOR. */
#define DECL_CONST_ADDRESS_P(NODE) DECL_LANG_FLAG_0 (CONST_DECL_CHECK (NODE))
-/* Nonzero in a PARM_DECL if it is always used by double reference, i.e. a
- pair of INDIRECT_REFs is needed to access the object. */
-#define DECL_BY_DOUBLE_REF_P(NODE) DECL_LANG_FLAG_0 (PARM_DECL_CHECK (NODE))
-
/* Nonzero in a FIELD_DECL if it is declared as aliased. */
#define DECL_ALIASED_P(NODE) DECL_LANG_FLAG_0 (FIELD_DECL_CHECK (NODE))
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 31bdf5b13f8..f632a3164e7 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1025,7 +1025,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
save_gnu_tree (gnat_entity, gnu_decl, true);
saved = true;
annotate_object (gnat_entity, gnu_type, NULL_TREE,
- false, false);
+ false);
/* This assertion will fail if the renamed object
isn't aligned enough as to make it possible to
honor the alignment set on the renaming. */
@@ -1604,7 +1604,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
type of the object and not on the object directly, and makes it
possible to support all confirming representation clauses. */
annotate_object (gnat_entity, TREE_TYPE (gnu_decl), gnu_object_size,
- used_by_ref, false);
+ used_by_ref);
}
break;
@@ -5650,7 +5650,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
/* The parameter can be indirectly modified if its address is taken. */
bool ro_param = in_param && !Address_Taken (gnat_param);
bool by_return = false, by_component_ptr = false;
- bool by_ref = false, by_double_ref = false;
+ bool by_ref = false;
tree gnu_param;
/* Copy-return is used only for the first parameter of a valued procedure.
@@ -5775,19 +5775,6 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
gnu_param_type
= build_qualified_type (gnu_param_type, TYPE_QUAL_RESTRICT);
by_ref = true;
-
- /* In some ABIs, e.g. SPARC 32-bit, fat pointer types are themselves
- passed by reference. Pass them by explicit reference, this will
- generate more debuggable code at -O0. */
- if (TYPE_IS_FAT_POINTER_P (gnu_param_type)
- && targetm.calls.pass_by_reference (pack_cumulative_args (NULL),
- TYPE_MODE (gnu_param_type),
- gnu_param_type,
- true))
- {
- gnu_param_type = build_reference_type (gnu_param_type);
- by_double_ref = true;
- }
}
/* Pass In Out or Out parameters using copy-in copy-out mechanism. */
@@ -5830,7 +5817,6 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
gnu_param = create_param_decl (gnu_param_name, gnu_param_type,
ro_param || by_ref || by_component_ptr);
DECL_BY_REF_P (gnu_param) = by_ref;
- DECL_BY_DOUBLE_REF_P (gnu_param) = by_double_ref;
DECL_BY_COMPONENT_PTR_P (gnu_param) = by_component_ptr;
DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor ||
mech == By_Short_Descriptor);
@@ -7554,18 +7540,13 @@ annotate_value (tree gnu_size)
/* Given GNAT_ENTITY, an object (constant, variable, parameter, exception)
and GNU_TYPE, its corresponding GCC type, set Esize and Alignment to the
size and alignment used by Gigi. Prefer SIZE over TYPE_SIZE if non-null.
- BY_REF is true if the object is used by reference and BY_DOUBLE_REF is
- true if the object is used by double reference. */
+ BY_REF is true if the object is used by reference. */
void
-annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref,
- bool by_double_ref)
+annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
{
if (by_ref)
{
- if (by_double_ref)
- gnu_type = TREE_TYPE (gnu_type);
-
if (TYPE_IS_FAT_POINTER_P (gnu_type))
gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type);
else
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 799f61db264..8ee666059a9 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -178,10 +178,9 @@ extern tree choices_to_gnu (tree operand, Node_Id choices);
/* Given GNAT_ENTITY, an object (constant, variable, parameter, exception)
and GNU_TYPE, its corresponding GCC type, set Esize and Alignment to the
size and alignment used by Gigi. Prefer SIZE over TYPE_SIZE if non-null.
- BY_REF is true if the object is used by reference and BY_DOUBLE_REF is
- true if the object is used by double reference. */
+ BY_REF is true if the object is used by reference. */
extern void annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size,
- bool by_ref, bool by_double_ref);
+ bool by_ref);
/* Return the variant part of RECORD_TYPE, if any. Otherwise return NULL. */
extern tree get_variant_part (tree record_type);
@@ -953,11 +952,10 @@ extern tree fill_vms_descriptor (tree gnu_type, tree gnu_expr,
/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
pointer or fat pointer type. GNU_EXPR_ALT_TYPE is the alternate (32-bit)
- pointer type of GNU_EXPR. BY_REF is true if the result is to be used by
- reference. GNAT_SUBPROG is the subprogram to which the VMS descriptor is
- passed. */
+ pointer type of GNU_EXPR. GNAT_SUBPROG is the subprogram to which the
+ descriptor is passed. */
extern tree convert_vms_descriptor (tree gnu_type, tree gnu_expr,
- tree gnu_expr_alt_type, bool by_ref,
+ tree gnu_expr_alt_type,
Entity_Id gnat_subprog);
/* Indicate that we need to take the address of T and that it therefore
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 4b71568b8ba..4b224abb398 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1082,19 +1082,6 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
{
const bool read_only = DECL_POINTS_TO_READONLY_P (gnu_result);
- /* First do the first dereference if needed. */
- if (TREE_CODE (gnu_result) == PARM_DECL
- && DECL_BY_DOUBLE_REF_P (gnu_result))
- {
- gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
- if (TREE_CODE (gnu_result) == INDIRECT_REF)
- TREE_THIS_NOTRAP (gnu_result) = 1;
-
- /* The first reference, in case of a double reference, always points
- to read-only, see gnat_to_gnu_param for the rationale. */
- TREE_READONLY (gnu_result) = 1;
- }
-
/* If it's a PARM_DECL to foreign convention subprogram, convert it. */
if (TREE_CODE (gnu_result) == PARM_DECL
&& DECL_BY_COMPONENT_PTR_P (gnu_result))
@@ -3375,7 +3362,6 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
= convert_vms_descriptor (TREE_TYPE (gnu_subprog_param),
gnu_stub_param,
DECL_PARM_ALT_TYPE (gnu_stub_param),
- DECL_BY_DOUBLE_REF_P (gnu_subprog_param),
gnat_subprog);
}
else
@@ -3670,8 +3656,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
bool is_var_decl = (TREE_CODE (gnu_param) == VAR_DECL);
annotate_object (gnat_param, TREE_TYPE (gnu_param), NULL_TREE,
- DECL_BY_REF_P (gnu_param),
- !is_var_decl && DECL_BY_DOUBLE_REF_P (gnu_param));
+ DECL_BY_REF_P (gnu_param));
if (is_var_decl)
save_gnu_tree (gnat_param, NULL_TREE, false);
@@ -4133,12 +4118,6 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* The symmetry of the paths to the type of an entity is broken here
since arguments don't know that they will be passed by ref. */
gnu_formal_type = TREE_TYPE (gnu_formal);
-
- if (DECL_BY_DOUBLE_REF_P (gnu_formal))
- gnu_actual
- = build_unary_op (ADDR_EXPR, TREE_TYPE (gnu_formal_type),
- gnu_actual);
-
gnu_actual = build_unary_op (ADDR_EXPR, gnu_formal_type, gnu_actual);
}
else if (is_true_formal_parm && DECL_BY_COMPONENT_PTR_P (gnu_formal))
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 857905e2c1b..409c0dee94f 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -4096,33 +4096,25 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
pointer or fat pointer type. GNU_EXPR_ALT_TYPE is the alternate (32-bit)
- pointer type of GNU_EXPR. BY_REF is true if the result is to be used by
- reference. GNAT_SUBPROG is the subprogram to which the VMS descriptor is
- passed. */
+ pointer type of GNU_EXPR. GNAT_SUBPROG is the subprogram to which the
+ descriptor is passed. */
tree
convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
- bool by_ref, Entity_Id gnat_subprog)
+ Entity_Id gnat_subprog)
{
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
tree mbo = TYPE_FIELDS (desc_type);
const char *mbostr = IDENTIFIER_POINTER (DECL_NAME (mbo));
tree mbmo = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (mbo)));
- tree real_type, is64bit, gnu_expr32, gnu_expr64;
-
- if (by_ref)
- real_type = TREE_TYPE (gnu_type);
- else
- real_type = gnu_type;
+ tree is64bit, gnu_expr32, gnu_expr64;
/* If the field name is not MBO, it must be 32-bit and no alternate.
Otherwise primary must be 64-bit and alternate 32-bit. */
if (strcmp (mbostr, "MBO") != 0)
{
- tree ret = convert_vms_descriptor32 (real_type, gnu_expr, gnat_subprog);
- if (by_ref)
- ret = build_unary_op (ADDR_EXPR, gnu_type, ret);
+ tree ret = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
return ret;
}
@@ -4139,14 +4131,9 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
integer_minus_one_node));
/* Build the 2 possible end results. */
- gnu_expr64 = convert_vms_descriptor64 (real_type, gnu_expr, gnat_subprog);
- if (by_ref)
- gnu_expr64 = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr64);
+ gnu_expr64 = convert_vms_descriptor64 (gnu_type, gnu_expr, gnat_subprog);
gnu_expr = fold_convert (gnu_expr_alt_type, gnu_expr);
- gnu_expr32 = convert_vms_descriptor32 (real_type, gnu_expr, gnat_subprog);
- if (by_ref)
- gnu_expr32 = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr32);
-
+ gnu_expr32 = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
return build3 (COND_EXPR, gnu_type, is64bit, gnu_expr64, gnu_expr32);
}
diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads
index 094c340fbeb..17c934a0ab1 100644
--- a/gcc/ada/targparm.ads
+++ b/gcc/ada/targparm.ads
@@ -439,7 +439,7 @@ package Targparm is
-- the source program may not contain explicit 64-bit shifts. In addition,
-- the code generated for packed arrays will avoid the use of long shifts.
- Support_Nondefault_SSO_On_Target : Boolean := False;
+ Support_Nondefault_SSO_On_Target : Boolean := True;
-- If True, the back end supports the non-default Scalar_Storage_Order
-- (i.e. allows non-confirming Scalar_Storage_Order attribute definition
-- clauses).
diff --git a/gcc/alias.c b/gcc/alias.c
index ef11c6a2b9c..902ed334769 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -156,7 +156,8 @@ static int insert_subset_children (splay_tree_node, void*);
static alias_set_entry get_alias_set_entry (alias_set_type);
static bool nonoverlapping_component_refs_p (const_rtx, const_rtx);
static tree decl_for_component_ref (tree);
-static int write_dependence_p (const_rtx, const_rtx, int);
+static int write_dependence_p (const_rtx, enum machine_mode, rtx, const_rtx,
+ bool, bool);
static void memory_modified_1 (rtx, const_rtx, void *);
@@ -2553,15 +2554,22 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
}
/* Returns nonzero if a write to X might alias a previous read from
- (or, if WRITEP is nonzero, a write to) MEM. */
+ (or, if WRITEP is true, a write to) MEM.
+ If MEM_CANONCALIZED is nonzero, CANON_MEM_ADDR is the canonicalized
+ address of MEM, and MEM_MODE the mode for that access. */
static int
-write_dependence_p (const_rtx mem, const_rtx x, int writep)
+write_dependence_p (const_rtx mem, enum machine_mode mem_mode,
+ rtx canon_mem_addr, const_rtx x,
+ bool mem_canonicalized, bool writep)
{
rtx x_addr, mem_addr;
rtx base;
int ret;
+ gcc_checking_assert (mem_canonicalized ? (canon_mem_addr != NULL_RTX)
+ : (canon_mem_addr == NULL_RTX && mem_mode == VOIDmode));
+
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
@@ -2612,9 +2620,15 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep)
return 0;
x_addr = canon_rtx (x_addr);
- mem_addr = canon_rtx (mem_addr);
+ if (mem_canonicalized)
+ mem_addr = canon_mem_addr;
+ else
+ {
+ mem_addr = canon_rtx (mem_addr);
+ mem_mode = GET_MODE (mem);
+ }
- if ((ret = memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr,
+ if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
SIZE_FOR_MODE (x), x_addr, 0)) != -1)
return ret;
@@ -2629,7 +2643,20 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep)
int
anti_dependence (const_rtx mem, const_rtx x)
{
- return write_dependence_p (mem, x, /*writep=*/0);
+ return write_dependence_p (mem, VOIDmode, NULL_RTX, x,
+ /*mem_canonicalized=*/false, /*writep=*/false);
+}
+
+/* Likewise, but we already have a canonicalized MEM_ADDR for MEM.
+ Also, consider MEM in MEM_MODE (which might be from an enclosing
+ STRICT_LOW_PART / ZERO_EXTRACT). */
+
+int
+canon_anti_dependence (const_rtx mem, enum machine_mode mem_mode,
+ rtx mem_addr, const_rtx x)
+{
+ return write_dependence_p (mem, mem_mode, mem_addr, x,
+ /*mem_canonicalized=*/true, /*writep=*/false);
}
/* Output dependence: X is written after store in MEM takes place. */
@@ -2637,7 +2664,8 @@ anti_dependence (const_rtx mem, const_rtx x)
int
output_dependence (const_rtx mem, const_rtx x)
{
- return write_dependence_p (mem, x, /*writep=*/1);
+ return write_dependence_p (mem, VOIDmode, NULL_RTX, x,
+ /*mem_canonicalized=*/false, /*writep=*/true);
}
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index eed320c9ea0..154dc7a2c31 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -796,6 +796,7 @@ extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
extern bool contains_no_active_insn_p (const_basic_block);
extern bool forwarder_block_p (const_basic_block);
extern bool can_fallthru (basic_block, basic_block);
+extern void emit_barrier_after_bb (basic_block bb);
/* In cfgbuild.c. */
extern void find_many_sub_basic_blocks (sbitmap);
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 0a1f42a0424..d3bc4f92741 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1380,15 +1380,6 @@ get_uncond_jump_length (void)
return length;
}
-/* Emit a barrier into the footer of BB. */
-
-static void
-emit_barrier_after_bb (basic_block bb)
-{
- rtx barrier = emit_barrier_after (BB_END (bb));
- BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier);
-}
-
/* The landing pad OLD_LP, in block OLD_BB, has edges from both partitions.
Duplicate the landing pad and split the edges so that no EH edge
crosses partitions. */
@@ -1720,8 +1711,7 @@ fix_up_fall_thru_edges (void)
(i.e. fix it so the fall through does not cross and
the cond jump does). */
- if (!cond_jump_crosses
- && cur_bb->aux == cond_jump->dest)
+ if (!cond_jump_crosses)
{
/* Find label in fall_thru block. We've already added
any missing labels, so there must be one. */
@@ -1765,10 +1755,10 @@ fix_up_fall_thru_edges (void)
new_bb->aux = cur_bb->aux;
cur_bb->aux = new_bb;
- /* Make sure new fall-through bb is in same
- partition as bb it's falling through from. */
+ /* This is done by force_nonfallthru_and_redirect. */
+ gcc_assert (BB_PARTITION (new_bb)
+ == BB_PARTITION (cur_bb));
- BB_COPY_PARTITION (new_bb, cur_bb);
single_succ_edge (new_bb)->flags |= EDGE_CROSSING;
}
else
@@ -2064,7 +2054,10 @@ add_reg_crossing_jump_notes (void)
FOR_EACH_BB (bb)
FOR_EACH_EDGE (e, ei, bb->succs)
if ((e->flags & EDGE_CROSSING)
- && JUMP_P (BB_END (e->src)))
+ && JUMP_P (BB_END (e->src))
+ /* Some notes were added during fix_up_fall_thru_edges, via
+ force_nonfallthru_and_redirect. */
+ && !find_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX))
add_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX);
}
@@ -2133,23 +2126,26 @@ reorder_basic_blocks (void)
encountering this note will make the compiler switch between the
hot and cold text sections. */
-static void
+void
insert_section_boundary_note (void)
{
basic_block bb;
- int first_partition = 0;
+ bool switched_sections = false;
+ int current_partition = 0;
- if (!flag_reorder_blocks_and_partition)
+ if (!crtl->has_bb_partition)
return;
FOR_EACH_BB (bb)
{
- if (!first_partition)
- first_partition = BB_PARTITION (bb);
- if (BB_PARTITION (bb) != first_partition)
+ if (!current_partition)
+ current_partition = BB_PARTITION (bb);
+ if (BB_PARTITION (bb) != current_partition)
{
- emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS, BB_HEAD (bb));
- break;
+ gcc_assert (!switched_sections);
+ switched_sections = true;
+ emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS, BB_HEAD (bb));
+ current_partition = BB_PARTITION (bb);
}
}
}
@@ -2180,8 +2176,6 @@ rest_of_handle_reorder_blocks (void)
bb->aux = bb->next_bb;
cfg_layout_finalize ();
- /* Add NOTE_INSN_SWITCH_TEXT_SECTIONS notes. */
- insert_section_boundary_note ();
return 0;
}
@@ -2315,6 +2309,11 @@ duplicate_computed_gotos (void)
if (!bitmap_bit_p (candidates, single_succ (bb)->index))
continue;
+ /* Don't duplicate a partition crossing edge, which requires difficult
+ fixup. */
+ if (find_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX))
+ continue;
+
new_bb = duplicate_block (single_succ (bb), single_succ_edge (bb), bb);
new_bb->aux = bb->aux;
bb->aux = new_bb;
diff --git a/gcc/bb-reorder.h b/gcc/bb-reorder.h
index 5c68e3d8de1..025300ca481 100644
--- a/gcc/bb-reorder.h
+++ b/gcc/bb-reorder.h
@@ -35,4 +35,6 @@ extern struct target_bb_reorder *this_target_bb_reorder;
extern int get_uncond_jump_length (void);
+extern void insert_section_boundary_note (void);
+
#endif
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d434a2f8ad6..3d8f68f7d31 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,33 @@
+2013-06-11 Jan Hubicka <jh@suse.cz>
+
+ * c-common.c (handle_alias_ifunc_attribute): Do not set
+ DECL_EXTERNAL for weakref variables.
+ * c-pragma.c (handle_pragma_weak): Make sure aliases
+ are not declared as external.
+
+2013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * array-notation-common.c (length_mismatch_in_expr_p): Moved this
+ function from c/c-array-notation.c.
+ (is_cilkplus_reduce_builtin): Likewise.
+ (find_rank): Likewise.
+ (extract_array_notation_exprs): Likewise.
+ (replace_array_notations): Likewise.
+ (find_inv_trees): Likewise.
+ (replace_inv_trees): Likewise.
+ (contains_array_notation_expr): Likewise.
+ (find_correct_array_notation_type): Likewise.
+ * c-common.h (struct inv_list): Moved this struct from the file
+ c/c-array-notation.c and added a new field called additional tcodes.
+ (length_mismatch_in_expr_p): New prototype.
+ (is_cilkplus_reduce_builtin): Likewise.
+ (find_rank): Likewise.
+ (extract_array_notation_exprs): Likewise.
+ (replace_array_notation): Likewise.
+ (find_inv_trees): Likewise.
+ (replace_inv_trees): Likewise.
+ (find_correct_array_notation_type): Likewise.
+
2013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-common.c (c_define_builtins): When cilkplus is enabled, the
diff --git a/gcc/c-family/array-notation-common.c b/gcc/c-family/array-notation-common.c
index 1d288464eee..489b67cafb9 100644
--- a/gcc/c-family/array-notation-common.c
+++ b/gcc/c-family/array-notation-common.c
@@ -27,9 +27,9 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "langhooks.h"
#include "tree-iterator.h"
+#include "c-family/c-common.h"
#include "diagnostic-core.h"
-
/* Returns true if the function call in FNDECL is __sec_implicit_index. */
bool
@@ -74,3 +74,489 @@ extract_sec_implicit_index_arg (location_t location, tree fn)
}
return return_int;
}
+
+/* Returns true if there is length mismatch among expressions
+ on the same dimension and on the same side of the equal sign. The
+ expressions (or ARRAY_NOTATION lengths) are passed in through 2-D array
+ **LIST where X and Y indicate first and second dimension sizes of LIST,
+ respectively. */
+
+bool
+length_mismatch_in_expr_p (location_t loc, tree **list, size_t x, size_t y)
+{
+ size_t ii, jj;
+ tree start = NULL_TREE;
+ HOST_WIDE_INT l_start, l_node;
+ for (jj = 0; jj < y; jj++)
+ {
+ start = NULL_TREE;
+ for (ii = 0; ii < x; ii++)
+ {
+ if (!start)
+ start = list[ii][jj];
+ else if (TREE_CODE (start) == INTEGER_CST)
+ {
+ /* If start is a INTEGER, and list[ii][jj] is an integer then
+ check if they are equal. If they are not equal then return
+ true. */
+ if (TREE_CODE (list[ii][jj]) == INTEGER_CST)
+ {
+ l_node = int_cst_value (list[ii][jj]);
+ l_start = int_cst_value (start);
+ if (absu_hwi (l_start) != absu_hwi (l_node))
+ {
+ error_at (loc, "length mismatch in expression");
+ return true;
+ }
+ }
+ }
+ else
+ /* We set the start node as the current node just in case it turns
+ out to be an integer. */
+ start = list[ii][jj];
+ }
+ }
+ return false;
+}
+
+/* Given an FNDECL of type FUNCTION_DECL or ADDR_EXPR, return the corresponding
+ BUILT_IN_CILKPLUS_SEC_REDUCE_* being called. If none, return
+ BUILT_IN_NONE. */
+
+enum built_in_function
+is_cilkplus_reduce_builtin (tree fndecl)
+{
+ if (!fndecl)
+ return BUILT_IN_NONE;
+ if (TREE_CODE (fndecl) == ADDR_EXPR)
+ fndecl = TREE_OPERAND (fndecl, 0);
+
+ if (TREE_CODE (fndecl) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE:
+ case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
+ return DECL_FUNCTION_CODE (fndecl);
+ default:
+ break;
+ }
+
+ return BUILT_IN_NONE;
+}
+
+/* This function will recurse into EXPR finding any
+ ARRAY_NOTATION_EXPRs and calculate the overall rank of EXPR,
+ storing it in *RANK. LOC is the location of the original expression.
+
+ ORIG_EXPR is the original expression used to display if any rank
+ mismatch errors are found.
+
+ Upon entry, *RANK must be either 0, or the rank of a parent
+ expression that must have the same rank as the one being
+ calculated. It is illegal to have multiple array notation with different
+ rank in the same expression (see examples below for clarification).
+
+ If there were any rank mismatches while calculating the rank, an
+ error will be issued, and FALSE will be returned. Otherwise, TRUE
+ is returned.
+
+ If IGNORE_BUILTIN_FN is TRUE, ignore array notation specific
+ built-in functions (__sec_reduce_*, etc).
+
+ Here are some examples of array notations and their rank:
+
+ Expression RANK
+ 5 0
+ X (a variable) 0
+ *Y (a pointer) 0
+ A[5] 0
+ B[5][10] 0
+ A[:] 1
+ B[0:10] 1
+ C[0:10:2] 1
+ D[5][0:10:2] 1 (since D[5] is considered "scalar")
+ D[5][:][10] 1
+ E[:] + 5 1
+ F[:][:][:] + 5 + X 3
+ F[:][:][:] + E[:] + 5 + X RANKMISMATCH-ERROR since rank (E[:]) = 1 and
+ rank (F[:][:][:]) = 3. They must be equal
+ or have a rank of zero.
+ F[:][5][10] + E[:] * 5 + *Y 1
+
+ int func (int);
+ func (A[:]) 1
+ func (B[:][:][:][:]) 4
+
+ int func2 (int, int)
+ func2 (A[:], B[:][:][:][:]) RANKMISMATCH-ERROR -- Since Rank (A[:]) = 1
+ and Rank (B[:][:][:][:]) = 4
+
+ A[:] + func (B[:][:][:][:]) RANKMISMATCH-ERROR
+ func2 (A[:], B[:]) + func (A) 1
+
+ */
+
+bool
+find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn,
+ size_t *rank)
+{
+ tree ii_tree;
+ size_t ii = 0, current_rank = 0;
+
+ if (TREE_CODE (expr) == ARRAY_NOTATION_REF)
+ {
+ ii_tree = expr;
+ while (ii_tree)
+ {
+ if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
+ {
+ current_rank++;
+ ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
+ }
+ else if (TREE_CODE (ii_tree) == ARRAY_REF)
+ ii_tree = TREE_OPERAND (ii_tree, 0);
+ else if (TREE_CODE (ii_tree) == PARM_DECL
+ || TREE_CODE (ii_tree) == VAR_DECL)
+ break;
+ }
+ if (*rank == 0)
+ /* In this case, all the expressions this function has encountered thus
+ far have been scalars or expressions with zero rank. Please see
+ header comment for examples of such expression. */
+ *rank = current_rank;
+ else if (*rank != current_rank)
+ {
+ /* In this case, find rank is being recursed through a set of
+ expression of the form A <OPERATION> B, where A and B both have
+ array notations in them and the rank of A is not equal to rank of
+ B.
+ A simple example of such case is the following: X[:] + Y[:][:] */
+ *rank = current_rank;
+ return false;
+ }
+ }
+ else if (TREE_CODE (expr) == STATEMENT_LIST)
+ {
+ tree_stmt_iterator ii_tsi;
+ for (ii_tsi = tsi_start (expr); !tsi_end_p (ii_tsi);
+ tsi_next (&ii_tsi))
+ if (!find_rank (loc, orig_expr, *tsi_stmt_ptr (ii_tsi),
+ ignore_builtin_fn, rank))
+ return false;
+ }
+ else
+ {
+ if (TREE_CODE (expr) == CALL_EXPR)
+ {
+ tree func_name = CALL_EXPR_FN (expr);
+ tree prev_arg = NULL_TREE, arg;
+ call_expr_arg_iterator iter;
+ size_t prev_rank = 0;
+ if (TREE_CODE (func_name) == ADDR_EXPR)
+ if (!ignore_builtin_fn)
+ if (is_cilkplus_reduce_builtin (func_name))
+ /* If it is a built-in function, then we know it returns a
+ scalar. */
+ return true;
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, expr)
+ {
+ if (!find_rank (loc, orig_expr, arg, ignore_builtin_fn, rank))
+ {
+ if (prev_arg && EXPR_HAS_LOCATION (prev_arg)
+ && prev_rank != *rank)
+ error_at (EXPR_LOCATION (prev_arg),
+ "rank mismatch between %qE and %qE", prev_arg,
+ arg);
+ else if (prev_arg && prev_rank != *rank)
+ /* Here the original expression is printed as a "heads-up"
+ to the programmer. This is because since there is no
+ location information for the offending argument, the
+ error could be in some internally generated code that is
+ not visible for the programmer. Thus, the correct fix
+ may lie in the original expression. */
+ error_at (loc, "rank mismatch in expression %qE",
+ orig_expr);
+ return false;
+ }
+ prev_arg = arg;
+ prev_rank = *rank;
+ }
+ }
+ else
+ {
+ tree prev_arg = NULL_TREE;
+ for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (expr)); ii++)
+ {
+ if (TREE_OPERAND (expr, ii)
+ && !find_rank (loc, orig_expr, TREE_OPERAND (expr, ii),
+ ignore_builtin_fn, rank))
+ {
+ if (prev_arg && EXPR_HAS_LOCATION (prev_arg))
+ error_at (EXPR_LOCATION (prev_arg),
+ "rank mismatch between %qE and %qE", prev_arg,
+ TREE_OPERAND (expr, ii));
+ return false;
+ }
+ prev_arg = TREE_OPERAND (expr, ii);
+ }
+ }
+ }
+ return true;
+}
+
+/* Extracts all array notations in NODE and stores them in ARRAY_LIST. If
+ IGNORE_BUILTIN_FN is set, then array notations inside array notation
+ specific built-in functions are ignored. The NODE can be constants,
+ VAR_DECL, PARM_DECLS, STATEMENT_LISTS or full expressions. */
+
+void
+extract_array_notation_exprs (tree node, bool ignore_builtin_fn,
+ vec<tree, va_gc> **array_list)
+{
+ size_t ii = 0;
+ if (TREE_CODE (node) == ARRAY_NOTATION_REF)
+ {
+ vec_safe_push (*array_list, node);
+ return;
+ }
+ else if (TREE_CODE (node) == STATEMENT_LIST)
+ {
+ tree_stmt_iterator ii_tsi;
+ for (ii_tsi = tsi_start (node); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
+ extract_array_notation_exprs (*tsi_stmt_ptr (ii_tsi),
+ ignore_builtin_fn, array_list);
+ }
+ else if (TREE_CODE (node) == CALL_EXPR)
+ {
+ tree arg;
+ call_expr_arg_iterator iter;
+ if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (node)))
+ {
+ if (ignore_builtin_fn)
+ return;
+ else
+ {
+ vec_safe_push (*array_list, node);
+ return;
+ }
+ }
+ if (is_sec_implicit_index_fn (CALL_EXPR_FN (node)))
+ {
+ vec_safe_push (*array_list, node);
+ return;
+ }
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
+ extract_array_notation_exprs (arg, ignore_builtin_fn, array_list);
+ }
+ else
+ for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (node)); ii++)
+ if (TREE_OPERAND (node, ii))
+ extract_array_notation_exprs (TREE_OPERAND (node, ii),
+ ignore_builtin_fn, array_list);
+ return;
+}
+
+/* LIST contains all the array notations found in *ORIG and ARRAY_OPERAND
+ contains the expanded ARRAY_REF. E.g., if LIST[<some_index>] contains
+ an array_notation expression, then ARRAY_OPERAND[<some_index>] contains its
+ expansion. If *ORIG matches LIST[<some_index>] then *ORIG is set to
+ ARRAY_OPERAND[<some_index>]. This function recursively steps through
+ all the sub-trees of *ORIG, if it is larger than a single
+ ARRAY_NOTATION_REF. */
+
+void
+replace_array_notations (tree *orig, bool ignore_builtin_fn,
+ vec<tree, va_gc> *list,
+ vec<tree, va_gc> *array_operand)
+{
+ size_t ii = 0;
+ extern tree build_c_cast (location_t, tree, tree);
+ tree node = NULL_TREE, node_replacement = NULL_TREE;
+
+ if (vec_safe_length (list) == 0)
+ return;
+
+ if (TREE_CODE (*orig) == ARRAY_NOTATION_REF)
+ {
+ for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
+ if (*orig == node)
+ {
+ node_replacement = (*array_operand)[ii];
+ *orig = node_replacement;
+ }
+ }
+ else if (TREE_CODE (*orig) == STATEMENT_LIST)
+ {
+ tree_stmt_iterator ii_tsi;
+ for (ii_tsi = tsi_start (*orig); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
+ replace_array_notations (tsi_stmt_ptr (ii_tsi), ignore_builtin_fn, list,
+ array_operand);
+ }
+ else if (TREE_CODE (*orig) == CALL_EXPR)
+ {
+ tree arg;
+ call_expr_arg_iterator iter;
+ if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (*orig)))
+ {
+ if (!ignore_builtin_fn)
+ {
+ for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
+ if (*orig == node)
+ {
+ node_replacement = (*array_operand)[ii];
+ *orig = node_replacement;
+ }
+ }
+ return;
+ }
+ if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig)))
+ {
+ for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
+ if (*orig == node)
+ {
+ node_replacement = (*array_operand)[ii];
+ *orig = build_c_cast (EXPR_LOCATION (*orig),
+ TREE_TYPE (*orig), node_replacement);
+ }
+ return;
+ }
+ ii = 0;
+ FOR_EACH_CALL_EXPR_ARG (arg, iter, *orig)
+ {
+ replace_array_notations (&arg, ignore_builtin_fn, list,
+ array_operand);
+ CALL_EXPR_ARG (*orig, ii) = arg;
+ ii++;
+ }
+ }
+ else
+ {
+ for (ii = 0; ii < (size_t) TREE_CODE_LENGTH (TREE_CODE (*orig)); ii++)
+ if (TREE_OPERAND (*orig, ii))
+ replace_array_notations (&TREE_OPERAND (*orig, ii), ignore_builtin_fn,
+ list, array_operand);
+ }
+ return;
+}
+
+/* Callback for walk_tree. Find all the scalar expressions in *TP and push
+ them in DATA struct, typecasted to (void *). If *WALK_SUBTREES is set to 0
+ then do not go into the *TP's subtrees. Since this function steps through
+ all the subtrees, *TP and TP can be NULL_TREE and NULL, respectively. The
+ function returns NULL_TREE unconditionally. */
+
+tree
+find_inv_trees (tree *tp, int *walk_subtrees, void *data)
+{
+ struct inv_list *i_list = (struct inv_list *) data;
+ unsigned int ii = 0;
+
+ if (!tp || !*tp)
+ return NULL_TREE;
+ if (TREE_CONSTANT (*tp))
+ return NULL_TREE; /* No need to save constant to a variable. */
+ if (TREE_CODE (*tp) != COMPOUND_EXPR && !contains_array_notation_expr (*tp))
+ {
+ vec_safe_push (i_list->list_values, *tp);
+ *walk_subtrees = 0;
+ }
+ else if (TREE_CODE (*tp) == ARRAY_NOTATION_REF
+ || TREE_CODE (*tp) == ARRAY_REF
+ || TREE_CODE (*tp) == CALL_EXPR)
+ /* No need to step through the internals of array notation. */
+ *walk_subtrees = 0;
+ else
+ {
+ *walk_subtrees = 1;
+
+ /* This function is used by C and C++ front-ends. In C++, additional
+ tree codes such as TARGET_EXPR must be eliminated. These codes are
+ passed into additional_tcodes and are walked through and checked. */
+ for (ii = 0; ii < vec_safe_length (i_list->additional_tcodes); ii++)
+ if (TREE_CODE (*tp) == (enum rid)(*(i_list->additional_tcodes))[ii])
+ *walk_subtrees = 0;
+ }
+ return NULL_TREE;
+}
+
+/* Callback for walk_tree. Replace all the scalar expressions in *TP with the
+ appropriate replacement stored in the struct *DATA (typecasted to void*).
+ The subtrees are not touched if *WALK_SUBTREES is set to zero. */
+
+tree
+replace_inv_trees (tree *tp, int *walk_subtrees, void *data)
+{
+ size_t ii = 0;
+ tree t, r;
+ struct inv_list *i_list = (struct inv_list *) data;
+
+ if (vec_safe_length (i_list->list_values))
+ {
+ for (ii = 0; vec_safe_iterate (i_list->list_values, ii, &t); ii++)
+ if (simple_cst_equal (*tp, t) == 1)
+ {
+ vec_safe_iterate (i_list->replacement, ii, &r);
+ gcc_assert (r != NULL_TREE);
+ *tp = r;
+ *walk_subtrees = 0;
+ }
+ }
+ else
+ *walk_subtrees = 0;
+ return NULL_TREE;
+}
+
+/* Returns true if EXPR or any of its subtrees contain ARRAY_NOTATION_EXPR
+ node. */
+
+bool
+contains_array_notation_expr (tree expr)
+{
+ vec<tree, va_gc> *array_list = NULL;
+
+ if (!expr)
+ return false;
+ if (TREE_CODE (expr) == FUNCTION_DECL)
+ if (is_cilkplus_reduce_builtin (expr))
+ return true;
+
+ extract_array_notation_exprs (expr, false, &array_list);
+ if (vec_safe_length (array_list) == 0)
+ return false;
+ else
+ return true;
+}
+
+/* This function will check if OP is a CALL_EXPR that is a built-in array
+ notation function. If so, then we will return its type to be the type of
+ the array notation inside. */
+
+tree
+find_correct_array_notation_type (tree op)
+{
+ tree fn_arg, return_type = NULL_TREE;
+
+ if (op)
+ {
+ return_type = TREE_TYPE (op); /* This is the default case. */
+ if (TREE_CODE (op) == CALL_EXPR)
+ if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (op)))
+ {
+ fn_arg = CALL_EXPR_ARG (op, 0);
+ if (fn_arg)
+ return_type = TREE_TYPE (fn_arg);
+ }
+ }
+ return return_type;
+}
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index dec887fb4c0..7cb87345a80 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7576,13 +7576,7 @@ handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name, tree args,
if (TREE_CODE (decl) == FUNCTION_DECL)
DECL_INITIAL (decl) = error_mark_node;
else
- {
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
- DECL_EXTERNAL (decl) = 1;
- else
- DECL_EXTERNAL (decl) = 0;
- TREE_STATIC (decl) = 1;
- }
+ TREE_STATIC (decl) = 1;
if (!is_alias)
/* ifuncs are also aliases, so set that attribute too. */
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index d89982174bb..8eaf54fe502 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -541,7 +541,6 @@ extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
extern tree build_array_notation_expr (location_t, tree, tree, enum tree_code,
location_t, tree, tree);
extern tree build_array_notation_ref (location_t, tree, tree, tree, tree, tree);
-extern bool find_rank (location_t, tree, tree, bool, size_t *);
extern tree build_indirect_ref (location_t, tree, ref_operator);
extern int field_decl_cmp (const void *, const void *);
@@ -1150,7 +1149,19 @@ extern enum stv_conv scalar_to_vector (location_t loc, enum tree_code code,
#define ARRAY_NOTATION_STRIDE(NODE) \
TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 3)
-extern int extract_sec_implicit_index_arg (location_t, tree);
+/* This structure holds all the scalar values and its appropriate variable
+ replacment. It is mainly used by the function that pulls all the invariant
+ parts that should be executed only once, which comes with array notation
+ expressions. */
+struct inv_list
+{
+ vec<tree, va_gc> *list_values;
+ vec<tree, va_gc> *replacement;
+ vec<enum rid, va_gc> *additional_tcodes;
+};
+
+/* In array-notation-common.c. */
+extern HOST_WIDE_INT extract_sec_implicit_index_arg (location_t, tree);
extern bool is_sec_implicit_index_fn (tree);
extern void array_notation_init_builtins (void);
extern struct c_expr fix_array_notation_expr (location_t, enum tree_code,
@@ -1159,4 +1170,13 @@ extern bool contains_array_notation_expr (tree);
extern tree expand_array_notation_exprs (tree);
extern tree fix_conditional_array_notations (tree);
extern tree find_correct_array_notation_type (tree);
+extern bool length_mismatch_in_expr_p (location_t, tree **, size_t, size_t);
+extern enum built_in_function is_cilkplus_reduce_builtin (tree);
+extern bool find_rank (location_t, tree, tree, bool, size_t *);
+extern void extract_array_notation_exprs (tree, bool, vec<tree, va_gc> **);
+extern void replace_array_notations (tree *, bool, vec<tree, va_gc> *,
+ vec<tree, va_gc> *);
+extern tree find_inv_trees (tree *, int *, void *);
+extern tree replace_inv_trees (tree *, int *, void *);
+extern tree find_correct_array_notation_type (tree op);
#endif /* ! GCC_C_COMMON_H */
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index d63cbd209e1..309859fc8ec 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -367,7 +367,12 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
{
apply_pragma_weak (decl, value);
if (value)
- assemble_alias (decl, value);
+ {
+ DECL_EXTERNAL (decl) = 0;
+ if (TREE_CODE (decl) == VAR_DECL)
+ TREE_STATIC (decl) = 1;
+ assemble_alias (decl, value);
+ }
}
else
{
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index d33fa2b96b3..6179c3bb546 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,63 @@
+2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-array-notation.c (build_array_notation_expr): Reject array notation
+ mismatch between LHS and RHS even inside a call_expr. Also, removed
+ a couple while statements that were dead code.
+
+2013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
+ excessive precision expressions in function parameters. Also removed
+ couple unwanted while statements.
+
+2013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-array-notation.c (expand_array_notation_exprs): Added
+ ARRAY_NOTATION_REF case.
+
+2013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-array-notation.c (length_mismatch_in_expr_p): Moved this
+ function to c-family/array-notation-common.c.
+ (is_cilkplus_reduce_builtin): Likewise.
+ (find_rank): Likewise.
+ (extract_array_notation_exprs): Likewise.
+ (replace_array_notations): Likewise.
+ (find_inv_trees): Likewise.
+ (replace_inv_trees): Likewise.
+ (contains_array_notation_expr): Likewise.
+ (find_correct_array_notation_type): Likewise.
+ (replace_invariant_exprs): Initialized additional_tcodes to NULL.
+ (struct inv_list): Moved this to c-family/array-notation-common.c.
+ * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
+
+2013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
+ reduction functions outside the for-loop. Added a check if the fundecl
+ is non-NULL. Finally, removed an unwanted if-statement, and made the
+ body unconditional.
+
+2013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
+ condition of the if-statement matches the rank of else-block and then-
+ block when array notations are used.
+ * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
+ expression after the entire function body is parsed.
+ (c_parser_expr_no_commas): Delayed creating array notation expressions
+ to the end of function parsing.
+ * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
+ whole if-statement instead of just the condition.
+ (expand_array_notation_exprs): Added MODIFY_EXPR case.
+
+2013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR c/57474
+ * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
+ array to NULL_TREE if they are unused. Also added a check for the
+ field to be NULL before its fields are used in future.
+
2013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR bootstrap/57450
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index bf139a855f2..03b66b9cf79 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -74,452 +74,6 @@
#include "opts.h"
#include "c-family/c-common.h"
-static void replace_array_notations (tree *, bool, vec<tree, va_gc> *,
- vec<tree, va_gc> *);
-static void extract_array_notation_exprs (tree, bool, vec<tree, va_gc> **);
-
-/* This structure holds all the scalar values and its appropriate variable
- replacment. It is mainly used by the function that pulls all the invariant
- parts that should be executed only once, which comes with array notation
- expressions. */
-struct inv_list
-{
- vec<tree, va_gc> *list_values;
- vec<tree, va_gc> *replacement;
-};
-
-/* Returns true if there is length mismatch among expressions
- on the same dimension and on the same side of the equal sign. The
- expressions (or ARRAY_NOTATION lengths) are passed in through 2-D array
- **LIST where X and Y indicate first and second dimension sizes of LIST,
- respectively. */
-
-static bool
-length_mismatch_in_expr_p (location_t loc, tree **list, size_t x, size_t y)
-{
- size_t ii, jj;
- tree start = NULL_TREE;
- HOST_WIDE_INT l_start, l_node;
- for (jj = 0; jj < y; jj++)
- {
- start = NULL_TREE;
- for (ii = 0; ii < x; ii++)
- {
- if (!start)
- start = list[ii][jj];
- else if (TREE_CODE (start) == INTEGER_CST)
- {
- /* If start is a INTEGER, and list[ii][jj] is an integer then
- check if they are equal. If they are not equal then return
- true. */
- if (TREE_CODE (list[ii][jj]) == INTEGER_CST)
- {
- l_node = int_cst_value (list[ii][jj]);
- l_start = int_cst_value (start);
- if (absu_hwi (l_start) != absu_hwi (l_node))
- {
- error_at (loc, "length mismatch in expression");
- return true;
- }
- }
- }
- else
- /* We set the start node as the current node just in case it turns
- out to be an integer. */
- start = list[ii][jj];
- }
- }
- return false;
-}
-
-
-/* Given an FNDECL of type FUNCTION_DECL or ADDR_EXPR, return the corresponding
- BUILT_IN_CILKPLUS_SEC_REDUCE_* being called. If none, return
- BUILT_IN_NONE. */
-
-enum built_in_function
-is_cilkplus_reduce_builtin (tree fndecl)
-{
- if (TREE_CODE (fndecl) == ADDR_EXPR)
- fndecl = TREE_OPERAND (fndecl, 0);
-
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
- switch (DECL_FUNCTION_CODE (fndecl))
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- return DECL_FUNCTION_CODE (fndecl);
- default:
- break;
- }
-
- return BUILT_IN_NONE;
-}
-
-/* This function will recurse into EXPR finding any
- ARRAY_NOTATION_EXPRs and calculate the overall rank of EXPR,
- storing it in *RANK. LOC is the location of the original expression.
-
- ORIG_EXPR is the original expression used to display if any rank
- mismatch errors are found.
-
- Upon entry, *RANK must be either 0, or the rank of a parent
- expression that must have the same rank as the one being
- calculated. It is illegal to have multiple array notation with different
- rank in the same expression (see examples below for clarification).
-
- If there were any rank mismatches while calculating the rank, an
- error will be issued, and FALSE will be returned. Otherwise, TRUE
- is returned.
-
- If IGNORE_BUILTIN_FN is TRUE, ignore array notation specific
- built-in functions (__sec_reduce_*, etc).
-
- Here are some examples of array notations and their rank:
-
- Expression RANK
- 5 0
- X (a variable) 0
- *Y (a pointer) 0
- A[5] 0
- B[5][10] 0
- A[:] 1
- B[0:10] 1
- C[0:10:2] 1
- D[5][0:10:2] 1 (since D[5] is considered "scalar")
- D[5][:][10] 1
- E[:] + 5 1
- F[:][:][:] + 5 + X 3
- F[:][:][:] + E[:] + 5 + X RANKMISMATCH-ERROR since rank (E[:]) = 1 and
- rank (F[:][:][:]) = 3. They must be equal
- or have a rank of zero.
- F[:][5][10] + E[:] * 5 + *Y 1
-
- int func (int);
- func (A[:]) 1
- func (B[:][:][:][:]) 4
-
- int func2 (int, int)
- func2 (A[:], B[:][:][:][:]) RANKMISMATCH-ERROR -- Since Rank (A[:]) = 1
- and Rank (B[:][:][:][:]) = 4
-
- A[:] + func (B[:][:][:][:]) RANKMISMATCH-ERROR
- func2 (A[:], B[:]) + func (A) 1
-
- */
-
-bool
-find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn,
- size_t *rank)
-{
- tree ii_tree;
- size_t ii = 0, current_rank = 0;
-
- if (TREE_CODE (expr) == ARRAY_NOTATION_REF)
- {
- ii_tree = expr;
- while (ii_tree)
- {
- if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
- {
- current_rank++;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
- }
- else if (TREE_CODE (ii_tree) == ARRAY_REF)
- ii_tree = TREE_OPERAND (ii_tree, 0);
- else if (TREE_CODE (ii_tree) == PARM_DECL
- || TREE_CODE (ii_tree) == VAR_DECL)
- break;
- }
- if (*rank == 0)
- /* In this case, all the expressions this function has encountered thus
- far have been scalars or expressions with zero rank. Please see
- header comment for examples of such expression. */
- *rank = current_rank;
- else if (*rank != current_rank)
- {
- /* In this case, find rank is being recursed through a set of
- expression of the form A <OPERATION> B, where A and B both have
- array notations in them and the rank of A is not equal to rank of
- B.
- A simple example of such case is the following: X[:] + Y[:][:] */
- *rank = current_rank;
- return false;
- }
- }
- else if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (expr); !tsi_end_p (ii_tsi);
- tsi_next (&ii_tsi))
- if (!find_rank (loc, orig_expr, *tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, rank))
- return false;
- }
- else
- {
- if (TREE_CODE (expr) == CALL_EXPR)
- {
- tree func_name = CALL_EXPR_FN (expr);
- tree prev_arg = NULL_TREE, arg;
- call_expr_arg_iterator iter;
- size_t prev_rank = 0;
- if (TREE_CODE (func_name) == ADDR_EXPR)
- if (!ignore_builtin_fn)
- if (is_cilkplus_reduce_builtin (func_name))
- /* If it is a built-in function, then we know it returns a
- scalar. */
- return true;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, expr)
- {
- if (!find_rank (loc, orig_expr, arg, ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg)
- && prev_rank != *rank)
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- arg);
- else if (prev_arg && prev_rank != *rank)
- /* Here the original expression is printed as a "heads-up"
- to the programmer. This is because since there is no
- location information for the offending argument, the
- error could be in some internally generated code that is
- not visible for the programmer. Thus, the correct fix
- may lie in the original expression. */
- error_at (loc, "rank mismatch in expression %qE",
- orig_expr);
- return false;
- }
- prev_arg = arg;
- prev_rank = *rank;
- }
- }
- else
- {
- tree prev_arg = NULL_TREE;
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (expr)); ii++)
- {
- if (TREE_OPERAND (expr, ii)
- && !find_rank (loc, orig_expr, TREE_OPERAND (expr, ii),
- ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg))
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- TREE_OPERAND (expr, ii));
- else if (prev_arg)
- error_at (loc, "rank mismatch in expression %qE",
- orig_expr);
- return false;
- }
- prev_arg = TREE_OPERAND (expr, ii);
- }
- }
- }
- return true;
-}
-
-/* Extracts all array notations in NODE and stores them in ARRAY_LIST. If
- IGNORE_BUILTIN_FN is set, then array notations inside array notation
- specific built-in functions are ignored. The NODE can be constants,
- VAR_DECL, PARM_DECLS, STATEMENT_LISTS or full expressions. */
-
-static void
-extract_array_notation_exprs (tree node, bool ignore_builtin_fn,
- vec<tree, va_gc> **array_list)
-{
- size_t ii = 0;
- if (TREE_CODE (node) == ARRAY_NOTATION_REF)
- {
- vec_safe_push (*array_list, node);
- return;
- }
- else if (TREE_CODE (node) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (node); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- extract_array_notation_exprs (*tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, array_list);
- }
- else if (TREE_CODE (node) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (node)))
- {
- if (ignore_builtin_fn)
- return;
- else
- {
- vec_safe_push (*array_list, node);
- return;
- }
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (node)))
- {
- vec_safe_push (*array_list, node);
- return;
- }
- FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
- extract_array_notation_exprs (arg, ignore_builtin_fn, array_list);
- }
- else
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (node)); ii++)
- if (TREE_OPERAND (node, ii))
- extract_array_notation_exprs (TREE_OPERAND (node, ii),
- ignore_builtin_fn, array_list);
- return;
-}
-
-/* LIST contains all the array notations found in *ORIG and ARRAY_OPERAND
- contains the expanded ARRAY_REF. E.g., if LIST[<some_index>] contains
- an array_notation expression, then ARRAY_OPERAND[<some_index>] contains its
- expansion. If *ORIG matches LIST[<some_index>] then *ORIG is set to
- ARRAY_OPERAND[<some_index>]. This function recursively steps through
- all the sub-trees of *ORIG, if it is larger than a single
- ARRAY_NOTATION_REF. */
-
-static void
-replace_array_notations (tree *orig, bool ignore_builtin_fn,
- vec<tree, va_gc> *list,
- vec<tree, va_gc> *array_operand)
-{
- size_t ii = 0;
- tree node = NULL_TREE, node_replacement = NULL_TREE;
-
- if (vec_safe_length (list) == 0)
- return;
-
- if (TREE_CODE (*orig) == ARRAY_NOTATION_REF)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- else if (TREE_CODE (*orig) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (*orig); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- replace_array_notations (tsi_stmt_ptr (ii_tsi), ignore_builtin_fn, list,
- array_operand);
- }
- else if (TREE_CODE (*orig) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (*orig)))
- {
- if (!ignore_builtin_fn)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- return;
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig)))
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- return;
- }
- ii = 0;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, *orig)
- {
- replace_array_notations (&arg, ignore_builtin_fn, list,
- array_operand);
- CALL_EXPR_ARG (*orig, ii) = arg;
- ii++;
- }
- }
- else
- {
- for (ii = 0; ii < (size_t) TREE_CODE_LENGTH (TREE_CODE (*orig)); ii++)
- if (TREE_OPERAND (*orig, ii))
- replace_array_notations (&TREE_OPERAND (*orig, ii), ignore_builtin_fn,
- list, array_operand);
- }
- return;
-}
-
-/* Callback for walk_tree. Find all the scalar expressions in *TP and push
- them in DATA struct, typecasted to (void *). If *WALK_SUBTREES is set to 0
- then do not go into the *TP's subtrees. Since this function steps through
- all the subtrees, *TP and TP can be NULL_TREE and NULL, respectively. The
- function returns NULL_TREE unconditionally. */
-
-static tree
-find_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- struct inv_list *i_list = (struct inv_list *) data;
-
- if (!tp || !*tp)
- return NULL_TREE;
- if (TREE_CONSTANT (*tp))
- return NULL_TREE; /* No need to save constant to a variable. */
- if (TREE_CODE (*tp) != COMPOUND_EXPR && !contains_array_notation_expr (*tp))
- {
- vec_safe_push (i_list->list_values, *tp);
- *walk_subtrees = 0;
- }
- else if (TREE_CODE (*tp) == ARRAY_NOTATION_REF
- || TREE_CODE (*tp) == ARRAY_REF
- || TREE_CODE (*tp) == CALL_EXPR)
- /* No need to step through the internals of array notation. */
- *walk_subtrees = 0;
- else
- *walk_subtrees = 1;
- return NULL_TREE;
-}
-
-/* Callback for walk_tree. Replace all the scalar expressions in *TP with the
- appropriate replacement stored in the struct *DATA (typecasted to void*).
- The subtrees are not touched if *WALK_SUBTREES is set to zero. */
-
-static tree
-replace_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- size_t ii = 0;
- tree t, r;
- struct inv_list *i_list = (struct inv_list *) data;
-
- if (vec_safe_length (i_list->list_values))
- {
- for (ii = 0; vec_safe_iterate (i_list->list_values, ii, &t); ii++)
- if (simple_cst_equal (*tp, t) == 1)
- {
- vec_safe_iterate (i_list->replacement, ii, &r);
- gcc_assert (r != NULL_TREE);
- *tp = r;
- *walk_subtrees = 0;
- }
- }
- else
- *walk_subtrees = 0;
- return NULL_TREE;
-}
-
/* Replaces all the scalar expressions in *NODE. Returns a STATEMENT_LIST that
holds the NODE along with variables that holds the results of the invariant
expressions. */
@@ -534,6 +88,7 @@ replace_invariant_exprs (tree *node)
data.list_values = NULL;
data.replacement = NULL;
+ data.additional_tcodes = NULL;
walk_tree (node, find_inv_trees, (void *)&data, NULL);
if (vec_safe_length (data.list_values))
@@ -588,25 +143,18 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
|| an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
{
call_fn = CALL_EXPR_ARG (an_builtin_fn, 2);
- while (TREE_CODE (call_fn) == CONVERT_EXPR
- || TREE_CODE (call_fn) == NOP_EXPR)
+ if (TREE_CODE (call_fn) == ADDR_EXPR)
call_fn = TREE_OPERAND (call_fn, 0);
- call_fn = TREE_OPERAND (call_fn, 0);
-
identity_value = CALL_EXPR_ARG (an_builtin_fn, 0);
- while (TREE_CODE (identity_value) == CONVERT_EXPR
- || TREE_CODE (identity_value) == NOP_EXPR)
- identity_value = TREE_OPERAND (identity_value, 0);
func_parm = CALL_EXPR_ARG (an_builtin_fn, 1);
}
else
func_parm = CALL_EXPR_ARG (an_builtin_fn, 0);
- while (TREE_CODE (func_parm) == CONVERT_EXPR
- || TREE_CODE (func_parm) == EXCESS_PRECISION_EXPR
- || TREE_CODE (func_parm) == NOP_EXPR)
- func_parm = TREE_OPERAND (func_parm, 0);
-
+ /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function
+ parameter. */
+ func_parm = c_fully_fold (func_parm, false, NULL);
+
location = EXPR_LOCATION (an_builtin_fn);
if (!find_rank (location, an_builtin_fn, an_builtin_fn, true, &rank))
@@ -1233,7 +781,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
rhs_list_size = vec_safe_length (rhs_list);
lhs_list_size = vec_safe_length (lhs_list);
- if (lhs_rank == 0 && rhs_rank != 0 && TREE_CODE (rhs) != CALL_EXPR)
+ if (lhs_rank == 0 && rhs_rank != 0)
{
tree rhs_base = rhs;
if (TREE_CODE (rhs_base) == ARRAY_NOTATION_REF)
@@ -1254,17 +802,6 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
}
if (lhs_rank != 0 && rhs_rank != 0 && lhs_rank != rhs_rank)
{
- tree lhs_base = lhs;
- tree rhs_base = rhs;
-
- for (ii = 0; ii < lhs_rank; ii++)
- lhs_base = ARRAY_NOTATION_ARRAY (lhs_base);
-
- while (rhs_base && TREE_CODE (rhs_base) != ARRAY_NOTATION_REF)
- rhs_base = TREE_OPERAND (rhs_base, 0);
- for (ii = 0; ii < rhs_rank; ii++)
- rhs_base = ARRAY_NOTATION_ARRAY (rhs_base);
-
error_at (location, "rank mismatch between %qE and %qE", lhs, rhs);
pop_stmt_list (an_init);
return error_mark_node;
@@ -1541,7 +1078,10 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
}
else
for (jj = 0; jj < rhs_rank; jj++)
- rhs_vector[ii][jj] = false;
+ {
+ rhs_vector[ii][jj] = false;
+ rhs_length[ii][jj] = NULL_TREE;
+ }
}
if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_length,
@@ -1555,6 +1095,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
if (lhs_list_size > 0 && rhs_list_size > 0 && lhs_rank > 0 && rhs_rank > 0
&& TREE_CODE (lhs_length[0][0]) == INTEGER_CST
+ && rhs_length[0][0]
&& TREE_CODE (rhs_length[0][0]) == INTEGER_CST)
{
HOST_WIDE_INT l_length = int_cst_value (lhs_length[0][0]);
@@ -1875,7 +1416,7 @@ fix_conditional_array_notations_1 (tree stmt)
if (!find_rank (location, cond, cond, false, &rank))
return error_mark_node;
- extract_array_notation_exprs (cond, false, &array_list);
+ extract_array_notation_exprs (stmt, false, &array_list);
loop_init = push_stmt_list ();
for (ii = 0; ii < vec_safe_length (array_list); ii++)
{
@@ -1895,12 +1436,12 @@ fix_conditional_array_notations_1 (tree stmt)
vec_safe_push (sub_list, array_node);
vec_safe_push (new_var_list, new_var);
add_stmt (builtin_loop);
- replace_array_notations (&cond, false, sub_list, new_var_list);
+ replace_array_notations (&stmt, false, sub_list, new_var_list);
}
}
}
- if (!find_rank (location, cond, cond, true, &rank))
+ if (!find_rank (location, stmt, stmt, true, &rank))
{
pop_stmt_list (loop_init);
return error_mark_node;
@@ -1911,7 +1452,7 @@ fix_conditional_array_notations_1 (tree stmt)
pop_stmt_list (loop_init);
return loop_init;
}
- extract_array_notation_exprs (cond, true, &array_list);
+ extract_array_notation_exprs (stmt, true, &array_list);
if (vec_safe_length (array_list) == 0)
return stmt;
@@ -2401,27 +1942,6 @@ fix_array_notation_expr (location_t location, enum tree_code code,
return arg;
}
-/* Returns true if EXPR or any of its subtrees contain ARRAY_NOTATION_EXPR
- node. */
-
-bool
-contains_array_notation_expr (tree expr)
-{
- vec<tree, va_gc> *array_list = NULL;
-
- if (!expr)
- return false;
- if (TREE_CODE (expr) == FUNCTION_DECL)
- if (is_cilkplus_reduce_builtin (expr))
- return true;
-
- extract_array_notation_exprs (expr, false, &array_list);
- if (vec_safe_length (array_list) == 0)
- return false;
- else
- return true;
-}
-
/* Replaces array notations in a void function call arguments in ARG and returns
a STATEMENT_LIST. */
@@ -2761,12 +2281,32 @@ expand_array_notation_exprs (tree t)
expand_array_notation_exprs (*tsi_stmt_ptr (ii_tsi));
}
return t;
+ case MODIFY_EXPR:
+ {
+ location_t loc = EXPR_HAS_LOCATION (t) ? EXPR_LOCATION (t) :
+ UNKNOWN_LOCATION;
+ tree lhs = TREE_OPERAND (t, 0);
+ tree rhs = TREE_OPERAND (t, 1);
+ location_t rhs_loc = EXPR_HAS_LOCATION (rhs) ? EXPR_LOCATION (rhs) :
+ UNKNOWN_LOCATION;
+ t = build_array_notation_expr (loc, lhs, TREE_TYPE (lhs), NOP_EXPR,
+ rhs_loc, rhs, TREE_TYPE (rhs));
+ return t;
+ }
case CALL_EXPR:
t = fix_array_notation_call_expr (t);
return t;
case RETURN_EXPR:
if (contains_array_notation_expr (t))
t = fix_return_expr (t);
+ return t;
+ case ARRAY_NOTATION_REF:
+ /* IF we are here, then we are dealing with cases like this:
+ A[:];
+ A[x:y:z];
+ A[x:y];
+ Replace those with just void zero node. */
+ t = void_zero_node;
default:
return t;
}
@@ -2851,25 +2391,3 @@ build_array_notation_ref (location_t loc, tree array, tree start_index,
return array_ntn_tree;
}
-/* This function will check if OP is a CALL_EXPR that is a built-in array
- notation function. If so, then we will return its type to be the type of
- the array notation inside. */
-
-tree
-find_correct_array_notation_type (tree op)
-{
- tree fn_arg, return_type = NULL_TREE;
-
- if (op)
- {
- return_type = TREE_TYPE (op); /* This is the default case. */
- if (TREE_CODE (op) == CALL_EXPR)
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (op)))
- {
- fn_arg = CALL_EXPR_ARG (op, 0);
- if (fn_arg)
- return_type = TREE_TYPE (fn_arg);
- }
- }
- return return_type;
-}
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index b89d8c1ff17..d6a500e72b3 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1756,6 +1756,8 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus
= c_parser_peek_token (parser)->location;
fnbody = c_parser_compound_statement (parser);
+ if (flag_enable_cilkplus && contains_array_notation_expr (fnbody))
+ fnbody = expand_array_notation_exprs (fnbody);
if (nested)
{
tree decl = current_function_decl;
@@ -5445,20 +5447,9 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after)
rhs = c_parser_expr_no_commas (parser, NULL);
rhs = default_function_array_read_conversion (exp_location, rhs);
- /* The line below is where the statement has the form:
- A = B, where A and B contain array notation exprs. So this is where
- we handle those. */
- if (flag_enable_cilkplus
- && (contains_array_notation_expr (lhs.value)
- || contains_array_notation_expr (rhs.value)))
- ret.value = build_array_notation_expr (op_location, lhs.value,
- lhs.original_type, code,
- exp_location, rhs.value,
- rhs.original_type);
- else
- ret.value = build_modify_expr (op_location, lhs.value, lhs.original_type,
- code, exp_location, rhs.value,
- rhs.original_type);
+ ret.value = build_modify_expr (op_location, lhs.value, lhs.original_type,
+ code, exp_location, rhs.value,
+ rhs.original_type);
if (code == NOP_EXPR)
ret.original_code = MODIFY_EXPR;
else
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index c8f673710e6..d1a871daa68 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -668,7 +668,4 @@ extern void c_write_global_declarations (void);
extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
-/* In c-array-notation.c */
-enum built_in_function is_cilkplus_reduce_builtin (tree);
-
#endif /* ! GCC_C_TREE_H */
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 749c8e2b8e9..3a923111429 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -2942,6 +2942,8 @@ convert_arguments (tree typelist, vec<tree, va_gc> *values,
break;
}
}
+ if (flag_enable_cilkplus && fundecl && is_cilkplus_reduce_builtin (fundecl))
+ return vec_safe_length (values);
/* Scan the given expressions and types, producing individual
converted arguments. */
@@ -2959,17 +2961,6 @@ convert_arguments (tree typelist, vec<tree, va_gc> *values,
bool npc;
tree parmval;
- // FIXME: I assume this code is here to handle the overloaded
- // behavior of the __sec_reduce* builtins, and avoid giving
- // argument mismatch warnings/errors. We should probably handle
- // this with the resolve_overloaded_builtin infrastructure.
- /* If the function call is a builtin function call, then we do not
- worry about it since we break them up into its equivalent later and
- we do the appropriate checks there. */
- if (flag_enable_cilkplus
- && is_cilkplus_reduce_builtin (fundecl))
- continue;
-
if (type == void_type_node)
{
if (selector)
@@ -3207,16 +3198,10 @@ convert_arguments (tree typelist, vec<tree, va_gc> *values,
if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
{
- /* If array notation is used and Cilk Plus is enabled, then we do not
- worry about this error now. We will handle them in a later place. */
- if (!flag_enable_cilkplus
- || !is_cilkplus_reduce_builtin (fundecl))
- {
- error_at (input_location,
- "too few arguments to function %qE", function);
- inform_declaration (fundecl);
- return -1;
- }
+ error_at (input_location,
+ "too few arguments to function %qE", function);
+ inform_declaration (fundecl);
+ return -1;
}
return error_args ? -1 : (int) parmnum;
@@ -8983,6 +8968,34 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
{
tree stmt;
+ /* If the condition has array notations, then the rank of the then_block and
+ else_block must be either 0 or be equal to the rank of the condition. If
+ the condition does not have array notations then break them up as it is
+ broken up in a normal expression. */
+ if (flag_enable_cilkplus && contains_array_notation_expr (cond))
+ {
+ size_t then_rank = 0, cond_rank = 0, else_rank = 0;
+ if (!find_rank (if_locus, cond, cond, true, &cond_rank))
+ return;
+ if (then_block
+ && !find_rank (if_locus, then_block, then_block, true, &then_rank))
+ return;
+ if (else_block
+ && !find_rank (if_locus, else_block, else_block, true, &else_rank))
+ return;
+ if (cond_rank != then_rank && then_rank != 0)
+ {
+ error_at (if_locus, "rank-mismatch between if-statement%'s condition"
+ " and the then-block");
+ return;
+ }
+ else if (cond_rank != else_rank && else_rank != 0)
+ {
+ error_at (if_locus, "rank-mismatch between if-statement%'s condition"
+ " and the else-block");
+ return;
+ }
+ }
/* Diagnose an ambiguous else if if-then-else is nested inside if-then. */
if (warn_parentheses && nested_if && else_block == NULL)
{
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 1379cf76156..99e0baa756e 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -456,7 +456,7 @@ try_forward_edges (int mode, basic_block b)
if (first != EXIT_BLOCK_PTR
&& find_reg_note (BB_END (first), REG_CROSSING_JUMP, NULL_RTX))
- return false;
+ return changed;
while (counter < n_basic_blocks)
{
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 0ea297e4c60..36438b8409b 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "hard-reg-set.h"
#include "basic-block.h"
+#include "bb-reorder.h"
#include "regs.h"
#include "flags.h"
#include "function.h"
@@ -451,6 +452,9 @@ rest_of_pass_free_cfg (void)
}
#endif
+ if (crtl->has_bb_partition)
+ insert_section_boundary_note ();
+
free_bb_for_insn ();
return 0;
}
@@ -981,8 +985,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */
- if (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX)
- || BB_PARTITION (src) != BB_PARTITION (target))
+ if (BB_PARTITION (src) != BB_PARTITION (target))
return NULL;
/* We can replace or remove a complex jump only when we have exactly
@@ -1291,6 +1294,53 @@ redirect_branch_edge (edge e, basic_block target)
return e;
}
+/* Called when edge E has been redirected to a new destination,
+ in order to update the region crossing flag on the edge and
+ jump. */
+
+static void
+fixup_partition_crossing (edge e)
+{
+ rtx note;
+
+ if (e->src == ENTRY_BLOCK_PTR || e->dest == EXIT_BLOCK_PTR)
+ return;
+ /* If we redirected an existing edge, it may already be marked
+ crossing, even though the new src is missing a reg crossing note.
+ But make sure reg crossing note doesn't already exist before
+ inserting. */
+ if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
+ {
+ e->flags |= EDGE_CROSSING;
+ note = find_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX);
+ if (JUMP_P (BB_END (e->src))
+ && !note)
+ add_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX);
+ }
+ else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
+ {
+ e->flags &= ~EDGE_CROSSING;
+ /* Remove the section crossing note from jump at end of
+ src if it exists, and if no other successors are
+ still crossing. */
+ note = find_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX);
+ if (note)
+ {
+ bool has_crossing_succ = false;
+ edge e2;
+ edge_iterator ei;
+ FOR_EACH_EDGE (e2, ei, e->src->succs)
+ {
+ has_crossing_succ |= (e2->flags & EDGE_CROSSING);
+ if (has_crossing_succ)
+ break;
+ }
+ if (!has_crossing_succ)
+ remove_note (BB_END (e->src), note);
+ }
+ }
+}
+
/* Attempt to change code to redirect edge E to TARGET. Don't do that on
expense of adding new instructions or reordering basic blocks.
@@ -1307,16 +1357,18 @@ rtl_redirect_edge_and_branch (edge e, basic_block target)
{
edge ret;
basic_block src = e->src;
+ basic_block dest = e->dest;
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
return NULL;
- if (e->dest == target)
+ if (dest == target)
return e;
if ((ret = try_redirect_by_replacing_jump (e, target, false)) != NULL)
{
df_set_bb_dirty (src);
+ fixup_partition_crossing (ret);
return ret;
}
@@ -1325,9 +1377,22 @@ rtl_redirect_edge_and_branch (edge e, basic_block target)
return NULL;
df_set_bb_dirty (src);
+ fixup_partition_crossing (ret);
return ret;
}
+/* Emit a barrier after BB, into the footer if we are in CFGLAYOUT mode. */
+
+void
+emit_barrier_after_bb (basic_block bb)
+{
+ rtx barrier = emit_barrier_after (BB_END (bb));
+ gcc_assert (current_ir_type() == IR_RTL_CFGRTL
+ || current_ir_type () == IR_RTL_CFGLAYOUT);
+ if (current_ir_type () == IR_RTL_CFGLAYOUT)
+ BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier);
+}
+
/* Like force_nonfallthru below, but additionally performs redirection
Used by redirect_edge_and_branch_force. JUMP_LABEL is used only
when redirecting to the EXIT_BLOCK, it is either ret_rtx or
@@ -1492,12 +1557,6 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
/* Make sure new block ends up in correct hot/cold section. */
BB_COPY_PARTITION (jump_block, e->src);
- if (flag_reorder_blocks_and_partition
- && targetm_common.have_named_sections
- && JUMP_P (BB_END (jump_block))
- && !any_condjump_p (BB_END (jump_block))
- && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING))
- add_reg_note (BB_END (jump_block), REG_CROSSING_JUMP, NULL_RTX);
/* Wire edge in. */
new_edge = make_edge (e->src, jump_block, EDGE_FALLTHRU);
@@ -1508,6 +1567,10 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
redirect_edge_pred (e, jump_block);
e->probability = REG_BR_PROB_BASE;
+ /* If e->src was previously region crossing, it no longer is
+ and the reg crossing note should be removed. */
+ fixup_partition_crossing (new_edge);
+
/* If asm goto has any label refs to target's label,
add also edge from asm goto bb to target. */
if (asm_goto_edge)
@@ -1559,13 +1622,16 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
LABEL_NUSES (label)++;
}
- emit_barrier_after (BB_END (jump_block));
+ /* We might be in cfg layout mode, and if so, the following routine will
+ insert the barrier correctly. */
+ emit_barrier_after_bb (jump_block);
redirect_edge_succ_nodup (e, target);
if (abnormal_edge_flags)
make_edge (src, target, abnormal_edge_flags);
df_mark_solutions_dirty ();
+ fixup_partition_crossing (e);
return new_bb;
}
@@ -1654,6 +1720,21 @@ rtl_move_block_after (basic_block bb ATTRIBUTE_UNUSED,
return false;
}
+/* Locate the last bb in the same partition as START_BB. */
+
+static basic_block
+last_bb_in_partition (basic_block start_bb)
+{
+ basic_block bb;
+ FOR_BB_BETWEEN (bb, start_bb, EXIT_BLOCK_PTR, next_bb)
+ {
+ if (BB_PARTITION (start_bb) != BB_PARTITION (bb->next_bb))
+ return bb;
+ }
+ /* Return bb before EXIT_BLOCK_PTR. */
+ return bb->prev_bb;
+}
+
/* Split a (typically critical) edge. Return the new block.
The edge must not be abnormal.
@@ -1664,7 +1745,7 @@ rtl_move_block_after (basic_block bb ATTRIBUTE_UNUSED,
static basic_block
rtl_split_edge (edge edge_in)
{
- basic_block bb;
+ basic_block bb, new_bb;
rtx before;
/* Abnormal edges cannot be split. */
@@ -1696,13 +1777,50 @@ rtl_split_edge (edge edge_in)
}
else
{
- bb = create_basic_block (before, NULL, edge_in->dest->prev_bb);
- /* ??? Why not edge_in->dest->prev_bb here? */
- BB_COPY_PARTITION (bb, edge_in->dest);
+ if (edge_in->src == ENTRY_BLOCK_PTR)
+ {
+ bb = create_basic_block (before, NULL, edge_in->dest->prev_bb);
+ BB_COPY_PARTITION (bb, edge_in->dest);
+ }
+ else
+ {
+ basic_block after = edge_in->dest->prev_bb;
+ /* If this is post-bb reordering, and the edge crosses a partition
+ boundary, the new block needs to be inserted in the bb chain
+ at the end of the src partition (since we put the new bb into
+ that partition, see below). Otherwise we may end up creating
+ an extra partition crossing in the chain, which is illegal.
+ It can't go after the src, because src may have a fall-through
+ to a different block. */
+ if (crtl->bb_reorder_complete
+ && (edge_in->flags & EDGE_CROSSING))
+ {
+ after = last_bb_in_partition (edge_in->src);
+ before = NEXT_INSN (BB_END (after));
+ /* The instruction following the last bb in partition should
+ be a barrier, since it cannot end in a fall-through. */
+ gcc_checking_assert (BARRIER_P (before));
+ before = NEXT_INSN (before);
+ }
+ bb = create_basic_block (before, NULL, after);
+ /* Put the split bb into the src partition, to avoid creating
+ a situation where a cold bb dominates a hot bb, in the case
+ where src is cold and dest is hot. The src will dominate
+ the new bb (whereas it might not have dominated dest). */
+ BB_COPY_PARTITION (bb, edge_in->src);
+ }
}
make_single_succ_edge (bb, edge_in->dest, EDGE_FALLTHRU);
+ /* Can't allow a region crossing edge to be fallthrough. */
+ if (BB_PARTITION (bb) != BB_PARTITION (edge_in->dest)
+ && edge_in->dest != EXIT_BLOCK_PTR)
+ {
+ new_bb = force_nonfallthru (single_succ_edge (bb));
+ gcc_assert (!new_bb);
+ }
+
/* For non-fallthru edges, we must adjust the predecessor's
jump instruction to target our new block. */
if ((edge_in->flags & EDGE_FALLTHRU) == 0)
@@ -1815,17 +1933,13 @@ commit_one_edge_insertion (edge e)
else
{
bb = split_edge (e);
- after = BB_END (bb);
-
- if (flag_reorder_blocks_and_partition
- && targetm_common.have_named_sections
- && e->src != ENTRY_BLOCK_PTR
- && BB_PARTITION (e->src) == BB_COLD_PARTITION
- && !(e->flags & EDGE_CROSSING)
- && JUMP_P (after)
- && !any_condjump_p (after)
- && (single_succ_edge (bb)->flags & EDGE_CROSSING))
- add_reg_note (after, REG_CROSSING_JUMP, NULL_RTX);
+
+ /* If E crossed a partition boundary, we needed to make bb end in
+ a region-crossing jump, even though it was originally fallthru. */
+ if (JUMP_P (BB_END (bb)))
+ before = BB_END (bb);
+ else
+ after = BB_END (bb);
}
/* Now that we've found the spot, do the insertion. */
@@ -2071,7 +2185,11 @@ verify_hot_cold_block_grouping (void)
bool switched_sections = false;
int current_partition = BB_UNPARTITIONED;
- if (!crtl->bb_reorder_complete)
+ /* Even after bb reordering is complete, we go into cfglayout mode
+ again (in compgoto). Ensure we don't call this before going back
+ into linearized RTL when any layout fixes would have been committed. */
+ if (!crtl->bb_reorder_complete
+ || current_ir_type() != IR_RTL_CFGRTL)
return err;
FOR_EACH_BB (bb)
@@ -2116,6 +2234,7 @@ rtl_verify_edges (void)
edge e, fallthru = NULL;
edge_iterator ei;
rtx note;
+ bool has_crossing_edge = false;
if (JUMP_P (BB_END (bb))
&& (note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX))
@@ -2141,6 +2260,7 @@ rtl_verify_edges (void)
is_crossing = (BB_PARTITION (e->src) != BB_PARTITION (e->dest)
&& e->src != ENTRY_BLOCK_PTR
&& e->dest != EXIT_BLOCK_PTR);
+ has_crossing_edge |= is_crossing;
if (e->flags & EDGE_CROSSING)
{
if (!is_crossing)
@@ -2160,6 +2280,13 @@ rtl_verify_edges (void)
e->src->index);
err = 1;
}
+ if (JUMP_P (BB_END (bb))
+ && !find_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX))
+ {
+ error ("No region crossing jump at section boundary in bb %i",
+ bb->index);
+ err = 1;
+ }
}
else if (is_crossing)
{
@@ -2188,6 +2315,15 @@ rtl_verify_edges (void)
n_abnormal++;
}
+ if (!has_crossing_edge
+ && find_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX))
+ {
+ print_rtl_with_bb (stderr, get_insns (), TDF_RTL | TDF_BLOCKS | TDF_DETAILS);
+ error ("Region crossing jump across same section in bb %i",
+ bb->index);
+ err = 1;
+ }
+
if (n_eh && !find_reg_note (BB_END (bb), REG_EH_REGION, NULL_RTX))
{
error ("missing REG_EH_REGION note at the end of bb %i", bb->index);
@@ -2395,8 +2531,6 @@ rtl_verify_flow_info_1 (void)
err |= rtl_verify_edges ();
- err |= verify_hot_cold_block_grouping();
-
return err;
}
@@ -2642,6 +2776,8 @@ rtl_verify_flow_info (void)
err |= rtl_verify_bb_layout ();
+ err |= verify_hot_cold_block_grouping ();
+
return err;
}
@@ -3343,7 +3479,7 @@ fixup_reorder_chain (void)
edge e_fall, e_taken, e;
rtx bb_end_insn;
rtx ret_label = NULL_RTX;
- basic_block nb, src_bb;
+ basic_block nb;
edge_iterator ei;
if (EDGE_COUNT (bb->succs) == 0)
@@ -3478,7 +3614,6 @@ fixup_reorder_chain (void)
/* We got here if we need to add a new jump insn.
Note force_nonfallthru can delete E_FALL and thus we have to
save E_FALL->src prior to the call to force_nonfallthru. */
- src_bb = e_fall->src;
nb = force_nonfallthru_and_redirect (e_fall, e_fall->dest, ret_label);
if (nb)
{
@@ -3486,17 +3621,6 @@ fixup_reorder_chain (void)
bb->aux = nb;
/* Don't process this new block. */
bb = nb;
-
- /* Make sure new bb is tagged for correct section (same as
- fall-thru source, since you cannot fall-thru across
- section boundaries). */
- BB_COPY_PARTITION (src_bb, single_pred (bb));
- if (flag_reorder_blocks_and_partition
- && targetm_common.have_named_sections
- && JUMP_P (BB_END (bb))
- && !any_condjump_p (BB_END (bb))
- && (EDGE_SUCC (bb, 0)->flags & EDGE_CROSSING))
- add_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX);
}
}
@@ -3796,10 +3920,11 @@ duplicate_insn_chain (rtx from, rtx to)
case NOTE_INSN_FUNCTION_BEG:
/* There is always just single entry to function. */
case NOTE_INSN_BASIC_BLOCK:
+ /* We should only switch text sections once. */
+ case NOTE_INSN_SWITCH_TEXT_SECTIONS:
break;
case NOTE_INSN_EPILOGUE_BEG:
- case NOTE_INSN_SWITCH_TEXT_SECTIONS:
emit_note_copy (insn);
break;
@@ -4611,8 +4736,7 @@ rtl_can_remove_branch_p (const_edge e)
if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))
return false;
- if (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX)
- || BB_PARTITION (src) != BB_PARTITION (target))
+ if (BB_PARTITION (src) != BB_PARTITION (target))
return false;
if (!onlyjump_p (insn)
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 735f48a8891..a2ec60221e9 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -129,7 +129,7 @@ static GTY(()) struct cgraph_node *free_nodes;
static GTY(()) struct cgraph_edge *free_edges;
/* Did procss_same_body_aliases run? */
-bool same_body_aliases_done;
+bool cpp_implicit_aliases_done;
/* Map a cgraph_node to cgraph_function_version_info using this htab.
The cgraph_function_version_info has a THIS_NODE field that is the
@@ -556,17 +556,20 @@ cgraph_get_create_node (tree decl)
the function body is associated with (not necessarily cgraph_node (DECL). */
struct cgraph_node *
-cgraph_create_function_alias (tree alias, tree decl)
+cgraph_create_function_alias (tree alias, tree target)
{
struct cgraph_node *alias_node;
- gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+ gcc_assert (TREE_CODE (target) == FUNCTION_DECL
+ || TREE_CODE (target) == IDENTIFIER_NODE);
gcc_assert (TREE_CODE (alias) == FUNCTION_DECL);
alias_node = cgraph_get_create_node (alias);
gcc_assert (!alias_node->symbol.definition);
- alias_node->thunk.alias = decl;
+ alias_node->symbol.alias_target = target;
alias_node->symbol.definition = true;
alias_node->symbol.alias = true;
+ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (alias)) != NULL)
+ alias_node->symbol.weakref = true;
return alias_node;
}
@@ -589,10 +592,10 @@ cgraph_same_body_alias (struct cgraph_node *decl_node ATTRIBUTE_UNUSED, tree ali
return NULL;
n = cgraph_create_function_alias (alias, decl);
- n->same_body_alias = true;
- if (same_body_aliases_done)
- ipa_record_reference ((symtab_node)n, (symtab_node)cgraph_get_node (decl),
- IPA_REF_ALIAS, NULL);
+ n->symbol.cpp_implicit_alias = true;
+ if (cpp_implicit_aliases_done)
+ symtab_resolve_alias ((symtab_node)n,
+ (symtab_node)cgraph_get_node (decl));
return n;
}
@@ -815,7 +818,8 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
pop_cfun ();
if (call_stmt
&& callee && callee->symbol.decl
- && !gimple_check_call_matching_types (call_stmt, callee->symbol.decl))
+ && !gimple_check_call_matching_types (call_stmt, callee->symbol.decl,
+ false))
edge->call_stmt_cannot_inline_p = true;
else
edge->call_stmt_cannot_inline_p = false;
@@ -1015,7 +1019,8 @@ cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee)
if (edge->call_stmt)
edge->call_stmt_cannot_inline_p
- = !gimple_check_call_matching_types (edge->call_stmt, callee->symbol.decl);
+ = !gimple_check_call_matching_types (edge->call_stmt, callee->symbol.decl,
+ false);
/* We need to re-determine the inlining status of the edge. */
initialize_inline_failed (edge);
@@ -1325,6 +1330,7 @@ cgraph_remove_node (struct cgraph_node *node)
/* Incremental inlining access removed nodes stored in the postorder list.
*/
node->symbol.force_output = false;
+ node->symbol.forced_by_abi = false;
for (n = node->nested; n; n = n->next_nested)
n->origin = NULL;
node->nested = NULL;
@@ -1545,10 +1551,13 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
if (node->thunk.thunk_p)
{
- fprintf (f, " Thunk of %s (asm: %s) fixed offset %i virtual value %i has "
+ fprintf (f, " Thunk");
+ if (node->thunk.alias)
+ fprintf (f, " of %s (asm: %s)",
+ lang_hooks.decl_printable_name (node->thunk.alias, 2),
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->thunk.alias)));
+ fprintf (f, " fixed offset %i virtual value %i has "
"virtual offset %i)\n",
- lang_hooks.decl_printable_name (node->thunk.alias, 2),
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->thunk.alias)),
(int)node->thunk.fixed_offset,
(int)node->thunk.virtual_value,
(int)node->thunk.virtual_offset_p);
@@ -1708,6 +1717,8 @@ cgraph_node_cannot_be_local_p_1 (struct cgraph_node *node,
{
return !(!node->symbol.force_output
&& ((DECL_COMDAT (node->symbol.decl)
+ && !node->symbol.forced_by_abi
+ && !symtab_used_from_object_file_p ((symtab_node) node)
&& !node->symbol.same_comdat_group)
|| !node->symbol.externally_visible));
}
@@ -1800,6 +1811,7 @@ cgraph_make_node_local_1 (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
symtab_make_decl_local (node->symbol.decl);
node->symbol.externally_visible = false;
+ node->symbol.forced_by_abi = false;
node->local.local = true;
node->symbol.unique_name = (node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
|| node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP);
@@ -2081,6 +2093,7 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node)
/* Only COMDAT functions can be removed if externally visible. */
if (node->symbol.externally_visible
&& (!DECL_COMDAT (node->symbol.decl)
+ || node->symbol.forced_by_abi
|| symtab_used_from_object_file_p ((symtab_node) node)))
return false;
return true;
@@ -2280,6 +2293,8 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl)
if (!decl || e->callee->global.inlined_to)
return false;
+ if (cgraph_state == CGRAPH_LTO_STREAMING)
+ return false;
node = cgraph_get_node (decl);
/* We do not know if a node from a different partition is an alias or what it
@@ -2288,17 +2303,11 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl)
return false;
node = cgraph_function_or_thunk_node (node, NULL);
- if ((e->callee->former_clone_of != node->symbol.decl
- && (!node->same_body_alias
- || e->callee->former_clone_of != node->thunk.alias))
+ if (e->callee->former_clone_of != node->symbol.decl
/* IPA-CP sometimes redirect edge to clone and then back to the former
function. This ping-pong has to go, eventually. */
&& (node != cgraph_function_or_thunk_node (e->callee, NULL))
- && !clone_of_p (node, e->callee)
- /* If decl is a same body alias of some other decl, allow e->callee to be
- a clone of a clone of that other decl too. */
- && (!node->same_body_alias
- || !clone_of_p (cgraph_get_node (node->thunk.alias), e->callee)))
+ && !clone_of_p (cgraph_function_or_thunk_node (node, NULL), e->callee))
return true;
else
return false;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 0dcc1a691df..62591890182 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -56,6 +56,15 @@ struct GTY(()) symtab_node_base
/* True when symbol is an alias.
Set by assemble_alias. */
unsigned alias : 1;
+ /* True when alias is a weakref. */
+ unsigned weakref : 1;
+ /* C++ frontend produce same body aliases and extra name aliases for
+ virutal functions and vtables that are obviously equivalent.
+ Those aliases are bit special, especially because C++ frontend
+ visibility code is so ugly it can not get them right at first time
+ and their visibility needs to be copied from their "masters" at
+ the end of parsing. */
+ unsigned cpp_implicit_alias : 1;
/* Set once the definition was analyzed. The list of references and
other properties are built during analysis. */
unsigned analyzed : 1;
@@ -65,9 +74,13 @@ struct GTY(()) symtab_node_base
/* Set when function is visible by other units. */
unsigned externally_visible : 1;
- /* Needed variables might become dead by optimization. This flag
- forces the variable to be output even if it appears dead otherwise. */
+ /* The symbol will be assumed to be used in an invisiable way (like
+ by an toplevel asm statement). */
unsigned force_output : 1;
+ /* Like FORCE_OUTPUT, but in the case it is ABI requiring the symbol to be
+ exported. Unlike FORCE_OUTPUT this flag gets cleared to symbols promoted
+ to static and it does not inhibit optimization. */
+ unsigned forced_by_abi : 1;
/* True when the name is known to be unique and thus it does not need mangling. */
unsigned unique_name : 1;
@@ -119,6 +132,11 @@ struct GTY(()) symtab_node_base
/* Vectors of referring and referenced entities. */
struct ipa_ref_list ref_list;
+ /* Alias target. May be either DECL pointer or ASSEMBLER_NAME pointer
+ depending to what was known to frontend on the creation time.
+ Once alias is resolved, this pointer become NULL. */
+ tree alias_target;
+
/* File stream where this node is being written to. */
struct lto_file_decl_data * lto_file_data;
@@ -291,8 +309,6 @@ struct GTY(()) cgraph_node {
/* Set once the function has been instantiated and its callee
lists created. */
unsigned process : 1;
- /* Set for aliases created as C++ same body aliases. */
- unsigned same_body_alias : 1;
/* How commonly executed the node is. Initialized during branch
probabilities pass. */
ENUM_BITFIELD (node_frequency) frequency : 2;
@@ -478,12 +494,9 @@ typedef struct cgraph_edge *cgraph_edge_p;
struct GTY(()) varpool_node {
struct symtab_node_base symbol;
- /* For aliases points to declaration DECL is alias of. */
- tree alias_of;
/* Set when variable is scheduled to be assembled. */
unsigned output : 1;
- unsigned extra_name_alias : 1;
};
/* Every top level asm statement is put into a asm_node. */
@@ -538,6 +551,8 @@ enum cgraph_state
CGRAPH_STATE_PARSING,
/* Callgraph is being constructed. It is safe to add new functions. */
CGRAPH_STATE_CONSTRUCTION,
+ /* Callgraph is being at LTO time. */
+ CGRAPH_LTO_STREAMING,
/* Callgraph is built and IPA passes are being run. */
CGRAPH_STATE_IPA,
/* Callgraph is built and all functions are transformed to SSA form. */
@@ -553,7 +568,7 @@ extern cgraph_node_set cgraph_new_nodes;
extern GTY(()) struct asm_node *asm_nodes;
extern GTY(()) int symtab_order;
-extern bool same_body_aliases_done;
+extern bool cpp_implicit_aliases_done;
/* In symtab.c */
void symtab_register_node (symtab_node);
@@ -576,7 +591,10 @@ void verify_symtab_node (symtab_node);
bool verify_symtab_base (symtab_node);
bool symtab_used_from_object_file_p (symtab_node);
void symtab_make_decl_local (tree);
-symtab_node symtab_alias_ultimate_target (symtab_node, enum availability *);
+symtab_node symtab_alias_ultimate_target (symtab_node,
+ enum availability *avail = NULL);
+bool symtab_resolve_alias (symtab_node node, symtab_node target);
+void fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target);
/* In cgraph.c */
void dump_cgraph (FILE *);
@@ -672,7 +690,8 @@ struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_ho
void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *);
bool cgraph_propagate_frequency (struct cgraph_node *node);
-struct cgraph_node * cgraph_function_node (struct cgraph_node *, enum availability *);
+struct cgraph_node * cgraph_function_node (struct cgraph_node *,
+ enum availability *avail = NULL);
/* In cgraphunit.c */
struct asm_node *add_asm_node (tree);
@@ -756,6 +775,7 @@ bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
bool cgraph_optimize_for_size_p (struct cgraph_node *);
/* In varpool.c */
+struct varpool_node *varpool_create_empty_node (void);
struct varpool_node *varpool_node_for_decl (tree);
struct varpool_node *varpool_node_for_asm (tree asmname);
void varpool_mark_needed_node (struct varpool_node *);
@@ -764,7 +784,6 @@ void dump_varpool (FILE *);
void dump_varpool_node (FILE *, struct varpool_node *);
void varpool_finalize_decl (tree);
-bool decide_is_variable_needed (struct varpool_node *, tree);
enum availability cgraph_variable_initializer_availability (struct varpool_node *);
void cgraph_make_node_local (struct cgraph_node *);
bool cgraph_node_can_be_local_p (struct cgraph_node *);
@@ -822,7 +841,7 @@ varpool_get_node (const_tree decl)
/* Return asm name of cgraph node. */
static inline const char *
-cgraph_node_asm_name(struct cgraph_node *node)
+cgraph_node_asm_name (struct cgraph_node *node)
{
return symtab_node_asm_name ((symtab_node)node);
}
@@ -1205,6 +1224,7 @@ varpool_can_remove_if_no_refs (struct varpool_node *node)
return true;
return (!node->symbol.force_output && !node->symbol.used_from_other_partition
&& ((DECL_COMDAT (node->symbol.decl)
+ && !node->symbol.forced_by_abi
&& !symtab_used_from_object_file_p ((symtab_node) node))
|| !node->symbol.externally_visible
|| DECL_HAS_VALUE_EXPR_P (node->symbol.decl)));
@@ -1258,12 +1278,14 @@ varpool_alias_target (struct varpool_node *n)
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
static inline struct cgraph_node *
-cgraph_function_or_thunk_node (struct cgraph_node *node, enum availability *availability)
+cgraph_function_or_thunk_node (struct cgraph_node *node,
+ enum availability *availability = NULL)
{
struct cgraph_node *n;
- n = dyn_cast <cgraph_node> (symtab_alias_ultimate_target ((symtab_node)node, availability));
- if (!n)
+ n = dyn_cast <cgraph_node> (symtab_alias_ultimate_target ((symtab_node)node,
+ availability));
+ if (!n && availability)
*availability = AVAIL_NOT_AVAILABLE;
return n;
}
@@ -1272,12 +1294,14 @@ cgraph_function_or_thunk_node (struct cgraph_node *node, enum availability *avai
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
static inline struct varpool_node *
-varpool_variable_node (struct varpool_node *node, enum availability *availability)
+varpool_variable_node (struct varpool_node *node,
+ enum availability *availability = NULL)
{
struct varpool_node *n;
- n = dyn_cast <varpool_node> (symtab_alias_ultimate_target ((symtab_node)node, availability));
- if (!n)
+ n = dyn_cast <varpool_node> (symtab_alias_ultimate_target ((symtab_node)node,
+ availability));
+ if (!n && availability)
*availability = AVAIL_NOT_AVAILABLE;
return n;
}
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index ca314a68476..016a6e43fa9 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -216,37 +216,45 @@ static GTY(()) struct asm_node *asm_last_node;
/* Used for vtable lookup in thunk adjusting. */
static GTY (()) tree vtable_entry_type;
-/* Determine if function DECL is trivially needed and should stay in the
- compilation unit. This is used at the symbol table construction time
- and differs from later logic removing unnecessary functions that can
- take into account results of analysis, whole program info etc. */
-
-static bool
-cgraph_decide_is_function_needed (struct cgraph_node *node, tree decl)
+/* Determine if symbol DECL is needed. That is, visible to something
+ either outside this translation unit, something magic in the system
+ configury */
+bool
+decide_is_symbol_needed (symtab_node node)
{
- /* If the user told us it is used, then it must be so. */
- if (node->symbol.force_output)
- return true;
+ tree decl = node->symbol.decl;
/* Double check that no one output the function into assembly file
early. */
gcc_checking_assert (!DECL_ASSEMBLER_NAME_SET_P (decl)
- || (node->thunk.thunk_p || node->same_body_alias)
- || !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)));
+ || !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)));
+
+ if (!node->symbol.definition)
+ return false;
+ /* Devirtualization may access these. */
+ if (DECL_VIRTUAL_P (decl) && optimize)
+ return true;
- /* Keep constructors, destructors and virtual functions. */
- if (DECL_STATIC_CONSTRUCTOR (decl)
- || DECL_STATIC_DESTRUCTOR (decl)
- || (DECL_VIRTUAL_P (decl)
- && optimize && (DECL_COMDAT (decl) || DECL_EXTERNAL (decl))))
- return true;
+ if (DECL_EXTERNAL (decl))
+ return false;
- /* Externally visible functions must be output. The exception is
- COMDAT functions that must be output only when they are needed. */
+ /* If the user told us it is used, then it must be so. */
+ if (node->symbol.force_output)
+ return true;
- if (TREE_PUBLIC (decl)
- && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
+ /* ABI forced symbols are needed when they are external. */
+ if (node->symbol.forced_by_abi && TREE_PUBLIC (decl))
+ return true;
+
+ /* Keep constructors, destructors and virtual functions. */
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl)))
+ return true;
+
+ /* Externally visible variables must be output. The exception is
+ COMDAT variables that must be output only when they are needed. */
+ if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
return true;
return false;
@@ -370,6 +378,9 @@ cgraph_reset_node (struct cgraph_node *node)
memset (&node->rtl, 0, sizeof (node->rtl));
node->symbol.analyzed = false;
node->symbol.definition = false;
+ node->symbol.alias = false;
+ node->symbol.weakref = false;
+ node->symbol.cpp_implicit_alias = false;
cgraph_node_remove_callees (node);
ipa_remove_all_references (&node->symbol.ref_list);
@@ -426,7 +437,7 @@ cgraph_finalize_function (tree decl, bool nested)
in the original implementation and it is unclear whether we want
to change the behavior here. */
if ((!optimize
- && !node->same_body_alias
+ && !node->symbol.cpp_implicit_alias
&& !DECL_DISREGARD_INLINE_LIMITS (decl)
&& !DECL_DECLARED_INLINE_P (decl)
&& !(DECL_CONTEXT (decl)
@@ -446,7 +457,7 @@ cgraph_finalize_function (tree decl, bool nested)
ggc_collect ();
if (cgraph_state == CGRAPH_STATE_CONSTRUCTION
- && (cgraph_decide_is_function_needed (node, decl)
+ && (decide_is_symbol_needed ((symtab_node) node)
|| referred_to_p ((symtab_node)node)))
enqueue_node ((symtab_node)node);
}
@@ -573,22 +584,6 @@ output_asm_statements (void)
asm_nodes = NULL;
}
-/* C++ FE sometimes change linkage flags after producing same body aliases. */
-void
-fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target, tree alias)
-{
- DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (alias);
- if (TREE_PUBLIC (node->symbol.decl))
- {
- DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (alias);
- DECL_COMDAT (node->symbol.decl) = DECL_COMDAT (alias);
- DECL_COMDAT_GROUP (node->symbol.decl) = DECL_COMDAT_GROUP (alias);
- if (DECL_ONE_ONLY (alias)
- && !node->symbol.same_comdat_group)
- symtab_add_to_same_comdat_group ((symtab_node)node, (symtab_node)target);
- }
-}
-
/* Analyze the function scheduled to be output. */
static void
analyze_function (struct cgraph_node *node)
@@ -597,39 +592,14 @@ analyze_function (struct cgraph_node *node)
location_t saved_loc = input_location;
input_location = DECL_SOURCE_LOCATION (decl);
- if (node->symbol.alias && node->thunk.alias)
- {
- struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
- struct cgraph_node *n;
-
- for (n = tgt; n && n->symbol.alias;
- n = n->symbol.analyzed ? cgraph_alias_target (n) : NULL)
- if (n == node)
- {
- error ("function %q+D part of alias cycle", node->symbol.decl);
- node->symbol.alias = false;
- input_location = saved_loc;
- return;
- }
- if (!vec_safe_length (node->symbol.ref_list.references))
- ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
- IPA_REF_ALIAS, NULL);
- if (node->same_body_alias)
- {
- DECL_DECLARED_INLINE_P (node->symbol.decl)
- = DECL_DECLARED_INLINE_P (node->thunk.alias);
- DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl)
- = DECL_DISREGARD_INLINE_LIMITS (node->thunk.alias);
- fixup_same_cpp_alias_visibility ((symtab_node) node, (symtab_node) tgt, node->thunk.alias);
- }
-
- if (node->symbol.address_taken)
- cgraph_mark_address_taken_node (cgraph_alias_target (node));
- }
+ if (node->symbol.alias)
+ symtab_resolve_alias
+ ((symtab_node) node, (symtab_node) cgraph_get_node (node->symbol.alias_target));
else if (node->thunk.thunk_p)
{
cgraph_create_edge (node, cgraph_get_node (node->thunk.alias),
NULL, 0, CGRAPH_FREQ_BASE);
+ node->thunk.alias = NULL;
}
else if (node->dispatcher_function)
{
@@ -693,16 +663,15 @@ analyze_function (struct cgraph_node *node)
void
cgraph_process_same_body_aliases (void)
{
- struct cgraph_node *node;
- FOR_EACH_FUNCTION (node)
- if (node->same_body_alias
- && !vec_safe_length (node->symbol.ref_list.references))
- {
- struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
- ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
- IPA_REF_ALIAS, NULL);
- }
- same_body_aliases_done = true;
+ symtab_node node;
+ FOR_EACH_SYMBOL (node)
+ if (node->symbol.cpp_implicit_alias && !node->symbol.analyzed)
+ symtab_resolve_alias
+ (node,
+ TREE_CODE (node->symbol.alias_target) == VAR_DECL
+ ? (symtab_node)varpool_node_for_decl (node->symbol.alias_target)
+ : (symtab_node)cgraph_get_create_node (node->symbol.alias_target));
+ cpp_implicit_aliases_done = true;
}
/* Process attributes common for vars and functions. */
@@ -842,7 +811,7 @@ varpool_finalize_decl (tree decl)
node->symbol.force_output = true;
if (cgraph_state == CGRAPH_STATE_CONSTRUCTION
- && (decide_is_variable_needed (node, decl)
+ && (decide_is_symbol_needed ((symtab_node) node)
|| referred_to_p ((symtab_node)node)))
enqueue_node ((symtab_node)node);
if (cgraph_state >= CGRAPH_STATE_IPA_SSA)
@@ -854,21 +823,6 @@ varpool_finalize_decl (tree decl)
}
-/* Determine if a symbol NODE is finalized and needed. */
-
-inline static bool
-symbol_defined_and_needed (symtab_node node)
-{
- if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
- return cnode->symbol.definition
- && cgraph_decide_is_function_needed (cnode, cnode->symbol.decl);
- if (varpool_node *vnode = dyn_cast <varpool_node> (node))
- return vnode->symbol.definition
- && !DECL_EXTERNAL (vnode->symbol.decl)
- && decide_is_variable_needed (vnode, vnode->symbol.decl);
- return false;
-}
-
/* Discover all functions and variables that are trivially needed, analyze
them as well as all functions and variables referred by them */
@@ -890,6 +844,13 @@ analyze_functions (void)
bitmap_obstack_initialize (NULL);
cgraph_state = CGRAPH_STATE_CONSTRUCTION;
+ /* Ugly, but the fixup can not happen at a time same body alias is created;
+ C++ FE is confused about the COMDAT groups being right. */
+ if (cpp_implicit_aliases_done)
+ FOR_EACH_SYMBOL (node)
+ if (node->symbol.cpp_implicit_alias)
+ fixup_same_cpp_alias_visibility (node, symtab_alias_target (node));
+
/* Analysis adds static variables that in turn adds references to new functions.
So we need to iterate the process until it stabilize. */
while (changed)
@@ -903,7 +864,7 @@ analyze_functions (void)
node != (symtab_node)first_analyzed
&& node != (symtab_node)first_analyzed_var; node = node->symbol.next)
{
- if (symbol_defined_and_needed (node))
+ if (decide_is_symbol_needed (node))
{
enqueue_node (node);
if (!changed && cgraph_dump_file)
@@ -940,7 +901,7 @@ analyze_functions (void)
and later using weak alias attribute to kill its body.
See gcc.c-torture/compile/20011119-1.c */
if (!DECL_STRUCT_FUNCTION (decl)
- && (!cnode->symbol.alias || !cnode->thunk.alias)
+ && !cnode->symbol.alias
&& !cnode->thunk.thunk_p
&& !cnode->dispatcher_function)
{
@@ -970,7 +931,7 @@ analyze_functions (void)
else
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
- if (vnode && vnode->symbol.definition)
+ if (vnode && vnode->symbol.definition && !vnode->symbol.analyzed)
varpool_analyze_node (vnode);
}
@@ -1016,7 +977,7 @@ analyze_functions (void)
tree decl = node->symbol.decl;
if (cnode->symbol.definition && !gimple_has_body_p (decl)
- && (!cnode->symbol.alias || !cnode->thunk.alias)
+ && !cnode->symbol.alias
&& !cnode->thunk.thunk_p)
cgraph_reset_node (cnode);
@@ -1057,19 +1018,13 @@ handle_alias_pairs (void)
to later output the weakref pseudo op into asm file. */
if (!target_node && lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL)
{
- if (TREE_CODE (p->decl) == FUNCTION_DECL)
- {
- struct cgraph_node *anode = cgraph_get_create_node (p->decl);
- anode->symbol.alias = true;
- anode->thunk.alias = p->target;
- }
- else
+ symtab_node node = symtab_get_node (p->decl);
+ if (node)
{
- struct varpool_node *anode = varpool_get_node (p->decl);
- anode->symbol.alias = true;
- anode->alias_of = p->target;
+ node->symbol.alias_target = p->target;
+ node->symbol.weakref = true;
+ node->symbol.alias = true;
}
- DECL_EXTERNAL (p->decl) = 1;
alias_pairs->unordered_remove (i);
continue;
}
@@ -1080,16 +1035,6 @@ handle_alias_pairs (void)
continue;
}
- /* Normally EXTERNAL flag is used to mark external inlines,
- however for aliases it seems to be allowed to use it w/o
- any meaning. See gcc.dg/attr-alias-3.c
- However for weakref we insist on EXTERNAL flag being set.
- See gcc.dg/attr-alias-5.c */
- if (DECL_EXTERNAL (p->decl))
- DECL_EXTERNAL (p->decl)
- = lookup_attribute ("weakref",
- DECL_ATTRIBUTES (p->decl)) != NULL;
-
if (DECL_EXTERNAL (target_node->symbol.decl)
/* We use local aliases for C++ thunks to force the tailcall
to bind locally. This is a hack - to keep it working do
@@ -1380,7 +1325,7 @@ assemble_thunk (struct cgraph_node *node)
HOST_WIDE_INT fixed_offset = node->thunk.fixed_offset;
HOST_WIDE_INT virtual_value = node->thunk.virtual_value;
tree virtual_offset = NULL;
- tree alias = node->thunk.alias;
+ tree alias = node->callees->callee->symbol.decl;
tree thunk_fndecl = node->symbol.decl;
tree a = DECL_ARGUMENTS (thunk_fndecl);
@@ -1581,15 +1526,15 @@ assemble_thunks_and_aliases (struct cgraph_node *node)
if (ref->use == IPA_REF_ALIAS)
{
struct cgraph_node *alias = ipa_ref_referring_node (ref);
- bool saved_written = TREE_ASM_WRITTEN (alias->thunk.alias);
+ bool saved_written = TREE_ASM_WRITTEN (node->symbol.decl);
/* Force assemble_alias to really output the alias this time instead
of buffering it in same alias pairs. */
- TREE_ASM_WRITTEN (alias->thunk.alias) = 1;
+ TREE_ASM_WRITTEN (node->symbol.decl) = 1;
do_assemble_alias (alias->symbol.decl,
- DECL_ASSEMBLER_NAME (alias->thunk.alias));
+ DECL_ASSEMBLER_NAME (node->symbol.decl));
assemble_thunks_and_aliases (alias);
- TREE_ASM_WRITTEN (alias->thunk.alias) = saved_written;
+ TREE_ASM_WRITTEN (node->symbol.decl) = saved_written;
}
}
@@ -1929,22 +1874,32 @@ get_alias_symbol (tree decl)
static void
output_weakrefs (void)
{
- struct cgraph_node *node;
- struct varpool_node *vnode;
- FOR_EACH_FUNCTION (node)
- if (node->symbol.alias && DECL_EXTERNAL (node->symbol.decl)
+ symtab_node node;
+ FOR_EACH_SYMBOL (node)
+ if (node->symbol.alias
&& !TREE_ASM_WRITTEN (node->symbol.decl)
- && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
- do_assemble_alias (node->symbol.decl,
- node->thunk.alias && DECL_P (node->thunk.alias) ? DECL_ASSEMBLER_NAME (node->thunk.alias)
- : get_alias_symbol (node->symbol.decl));
- FOR_EACH_VARIABLE (vnode)
- if (vnode->symbol.alias && DECL_EXTERNAL (vnode->symbol.decl)
- && !TREE_ASM_WRITTEN (vnode->symbol.decl)
- && lookup_attribute ("weakref", DECL_ATTRIBUTES (vnode->symbol.decl)))
- do_assemble_alias (vnode->symbol.decl,
- vnode->alias_of && DECL_P (vnode->alias_of) ? DECL_ASSEMBLER_NAME (vnode->alias_of)
- : get_alias_symbol (vnode->symbol.decl));
+ && node->symbol.weakref)
+ {
+ tree target;
+
+ /* Weakrefs are special by not requiring target definition in current
+ compilation unit. It is thus bit hard to work out what we want to
+ alias.
+ When alias target is defined, we need to fetch it from symtab reference,
+ otherwise it is pointed to by alias_target. */
+ if (node->symbol.alias_target)
+ target = (DECL_P (node->symbol.alias_target)
+ ? DECL_ASSEMBLER_NAME (node->symbol.alias_target)
+ : node->symbol.alias_target);
+ else if (node->symbol.analyzed)
+ target = DECL_ASSEMBLER_NAME (symtab_alias_target (node)->symbol.decl);
+ else
+ {
+ gcc_unreachable ();
+ target = get_alias_symbol (node->symbol.decl);
+ }
+ do_assemble_alias (node->symbol.decl, target);
+ }
}
/* Initialize callgraph dump file. */
@@ -2029,6 +1984,32 @@ compile (void)
bitmap_obstack_release (NULL);
mark_functions_to_output ();
+ /* When weakref support is missing, we autmatically translate all
+ references to NODE to references to its ultimate alias target.
+ The renaming mechanizm uses flag IDENTIFIER_TRANSPARENT_ALIAS and
+ TREE_CHAIN.
+
+ Set up this mapping before we output any assembler but once we are sure
+ that all symbol renaming is done.
+
+ FIXME: All this uglyness can go away if we just do renaming at gimple
+ level by physically rewritting the IL. At the moment we can only redirect
+ calls, so we need infrastructure for renaming references as well. */
+#ifndef ASM_OUTPUT_WEAKREF
+ symtab_node node;
+
+ FOR_EACH_SYMBOL (node)
+ if (node->symbol.alias
+ && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ {
+ IDENTIFIER_TRANSPARENT_ALIAS
+ (DECL_ASSEMBLER_NAME (node->symbol.decl)) = 1;
+ TREE_CHAIN (DECL_ASSEMBLER_NAME (node->symbol.decl))
+ = (node->symbol.alias_target ? node->symbol.alias_target
+ : DECL_ASSEMBLER_NAME (symtab_alias_target (node)->symbol.decl));
+ }
+#endif
+
cgraph_state = CGRAPH_STATE_EXPANSION;
if (!flag_toplevel_reorder)
output_in_order ();
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 99dd41dc1c5..d3119b02249 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1189,8 +1189,11 @@ main (int argc, char **argv)
#ifdef COLLECT_EXPORT_LIST
export_file = make_temp_file (".x");
#endif
- ldout = make_temp_file (".ld");
- lderrout = make_temp_file (".le");
+ if (!debug)
+ {
+ ldout = make_temp_file (".ld");
+ lderrout = make_temp_file (".le");
+ }
*c_ptr++ = c_file_name;
*c_ptr++ = "-x";
*c_ptr++ = "c";
diff --git a/gcc/common.opt b/gcc/common.opt
index 43a97bdc5bc..90822801551 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2331,6 +2331,10 @@ fvtv-counts
Common Var(flag_vtv_counts)
Output vtable verification counters.
+fvtv-debug
+Common Var(flag_vtv_debug)
+Output vtable verification pointer sets information.
+
fvpt
Common Report Var(flag_value_profile_transformations) Optimization
Use expression value profiles in optimizations
diff --git a/gcc/common/config/rx/rx-common.c b/gcc/common/config/rx/rx-common.c
index 946c93a499b..4186148318e 100644
--- a/gcc/common/config/rx/rx-common.c
+++ b/gcc/common/config/rx/rx-common.c
@@ -51,13 +51,16 @@ rx_handle_option (struct gcc_options *opts,
return value >= 0 && value <= 4;
case OPT_mcpu_:
- if ((enum rx_cpu_types) value == RX200)
+ if ((enum rx_cpu_types) value == RX200 ||
+ (enum rx_cpu_types) value == RX100)
opts->x_target_flags |= MASK_NO_USE_FPU;
break;
case OPT_fpu:
if (opts->x_rx_cpu_type == RX200)
error_at (loc, "the RX200 cpu does not have FPU hardware");
+ else if (opts->x_rx_cpu_type == RX100)
+ error_at (loc, "the RX100 cpu does not have FPU hardware");
break;
default:
diff --git a/gcc/config.gcc b/gcc/config.gcc
index a3dc2a9c781..0ad7217aca6 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1813,7 +1813,6 @@ mips*-mti-linux*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
gnu_ld=yes
gas=yes
- test x$with_llsc != x || with_llsc=yes
;;
mips64*-*-linux* | mipsisa64*-*-linux*)
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
@@ -1834,7 +1833,6 @@ mips64*-*-linux* | mipsisa64*-*-linux*)
esac
gnu_ld=yes
gas=yes
- test x$with_llsc != x || with_llsc=yes
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
@@ -1850,7 +1848,6 @@ mips*-*-linux*) # Linux MIPS, either endian.
mipsisa32*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
esac
- test x$with_llsc != x || with_llsc=yes
;;
mips*-mti-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h mips/mti-elf.h"
@@ -1928,23 +1925,25 @@ mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
mipsisa64sr71k-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
tmake_file=mips/t-sr71k
- target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
tmake_file="mips/t-elf mips/t-sb1"
- target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
;;
-mips-*-elf* | mipsel-*-elf*)
+mips-*-elf* | mipsel-*-elf* | mipsr5900-*-elf* | mipsr5900el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
tmake_file="mips/t-elf"
;;
+mips64r5900-*-elf* | mips64r5900el-*-elf*)
+ tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
+ tmake_file="mips/t-elf"
+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
+ ;;
mips64-*-elf* | mips64el-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
tmake_file="mips/t-elf"
- target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
;;
mips64vr-*-elf* | mips64vrel-*-elf*)
@@ -1955,7 +1954,6 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
mips64orion-*-elf* | mips64orionel-*-elf*)
tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
tmake_file="mips/t-elf"
- target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
;;
mips*-*-rtems*)
@@ -2981,9 +2979,6 @@ if test x$with_cpu = x ; then
;;
esac
;;
- mips*-*-vxworks)
- with_arch=mips2
- ;;
powerpc*-*-*spe*)
if test x$enable_e500_double = xyes; then
with_cpu=8548
@@ -3044,6 +3039,12 @@ if test x$with_arch = x ; then
x86_64-*-*)
with_arch=$arch
;;
+ mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+ with_arch=r5900
+ ;;
+ mips*-*-vxworks)
+ with_arch=mips2
+ ;;
esac
# Avoid overriding --with-arch-32 and --with-arch-64 values.
@@ -3078,6 +3079,17 @@ if test x$with_arch = x ; then
esac
fi
+# Infer a default setting for --with-float.
+if test x$with_float = x; then
+ case ${target} in
+ mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+ # The R5900 doesn't support 64-bit float. 32-bit float doesn't
+ # comply with IEEE 754.
+ with_float=soft
+ ;;
+ esac
+fi
+
# Support --with-fpmath.
if test x$with_fpmath != x; then
case ${target} in
@@ -3112,6 +3124,20 @@ if test x$with_schedule = x; then
esac
fi
+# Infer a default setting for --with-llsc.
+if test x$with_llsc = x; then
+ case ${target} in
+ mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+ # The R5900 doesn't support LL(D) and SC(D).
+ with_llsc=no
+ ;;
+ mips*-*-linux*)
+ # The kernel emulates LL and SC where necessary.
+ with_llsc=yes
+ ;;
+ esac
+fi
+
# Validate and mark as valid any --with options supported
# by this target. In order to use a particular --with option
# you must list it in supported_defaults; validating the value
diff --git a/gcc/config.in b/gcc/config.in
index f122d48579e..288c11f9377 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -199,6 +199,12 @@
#endif
+/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
+#ifndef USED_FOR_TARGET
+#undef GWINSZ_IN_SYS_IOCTL
+#endif
+
+
/* mcontext_t fields start with __ */
#ifndef USED_FOR_TARGET
#undef HAS_MCONTEXT_T_UNDERSCORES
@@ -1247,7 +1253,7 @@
#endif
-/* Define if your AIX linker supports a large TOC. */
+/* Define if your PowerPC64 linker supports a large TOC. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_LARGE_TOC
#endif
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index bdb6b040578..12f3c3a6fe6 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -149,6 +149,8 @@ bool aarch64_legitimate_pic_operand_p (rtx);
bool aarch64_move_imm (HOST_WIDE_INT, enum machine_mode);
bool aarch64_mov_operand_p (rtx, enum aarch64_symbol_context,
enum machine_mode);
+char *aarch64_output_scalar_simd_mov_immediate (rtx, enum machine_mode);
+char *aarch64_output_simd_mov_immediate (rtx, enum machine_mode, unsigned);
bool aarch64_pad_arg_upward (enum machine_mode, const_tree);
bool aarch64_pad_reg_upward (enum machine_mode, const_tree, bool);
bool aarch64_regno_ok_for_base_p (int, bool);
@@ -157,6 +159,8 @@ bool aarch64_simd_imm_scalar_p (rtx x, enum machine_mode mode);
bool aarch64_simd_imm_zero_p (rtx, enum machine_mode);
bool aarch64_simd_scalar_immediate_valid_for_move (rtx, enum machine_mode);
bool aarch64_simd_shift_imm_p (rtx, enum machine_mode, bool);
+bool aarch64_simd_valid_immediate (rtx, enum machine_mode, bool,
+ struct simd_immediate_info *);
bool aarch64_symbolic_address_p (rtx);
bool aarch64_symbolic_constant_p (rtx, enum aarch64_symbol_context,
enum aarch64_symbol_type *);
@@ -222,6 +226,8 @@ void aarch64_split_128bit_move (rtx, rtx);
bool aarch64_split_128bit_move_p (rtx, rtx);
+void aarch64_split_simd_combine (rtx, rtx, rtx);
+
void aarch64_split_simd_move (rtx, rtx);
/* Check for a legitimate floating point constant for FMOV. */
@@ -257,6 +263,4 @@ extern void aarch64_split_combinev16qi (rtx operands[3]);
extern void aarch64_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
extern bool
aarch64_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
-
-char* aarch64_output_simd_mov_immediate (rtx *, enum machine_mode, unsigned);
#endif /* GCC_AARCH64_PROTOS_H */
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index 04fbdbd5837..02037f3f2cb 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -409,7 +409,7 @@
case 4: return "ins\t%0.d[0], %1";
case 5: return "mov\t%0, %1";
case 6:
- return aarch64_output_simd_mov_immediate (&operands[1],
+ return aarch64_output_simd_mov_immediate (operands[1],
<MODE>mode, 64);
default: gcc_unreachable ();
}
@@ -440,7 +440,7 @@
case 5:
return "#";
case 6:
- return aarch64_output_simd_mov_immediate (&operands[1], <MODE>mode, 128);
+ return aarch64_output_simd_mov_immediate (operands[1], <MODE>mode, 128);
default:
gcc_unreachable ();
}
@@ -1058,9 +1058,9 @@
(vec_duplicate:<VHALF> (const_int 0))))]
"TARGET_SIMD"
"@
- mov\\t%d0, %d1
- fmov\t%d0, %1
- dup\t%d0, %1"
+ dup\\t%d0, %1.d[0]
+ fmov\\t%d0, %1
+ dup\\t%d0, %1"
[(set_attr "v8type" "*,fmov,*")
(set_attr "simd_type" "simd_dup,*,simd_dup")
(set_attr "simd_mode" "<MODE>")
@@ -1190,6 +1190,104 @@
;; Widening arithmetic.
+(define_insn "*aarch64_<su>mlal_lo<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (plus:<VWIDE>
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 2 "register_operand" "w")
+ (match_operand:VQW 3 "vect_par_cnst_lo_half" "")))
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 4 "register_operand" "w")
+ (match_dup 3))))
+ (match_operand:<VWIDE> 1 "register_operand" "0")))]
+ "TARGET_SIMD"
+ "<su>mlal\t%0.<Vwtype>, %2.<Vhalftype>, %4.<Vhalftype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
+(define_insn "*aarch64_<su>mlal_hi<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (plus:<VWIDE>
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 2 "register_operand" "w")
+ (match_operand:VQW 3 "vect_par_cnst_hi_half" "")))
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 4 "register_operand" "w")
+ (match_dup 3))))
+ (match_operand:<VWIDE> 1 "register_operand" "0")))]
+ "TARGET_SIMD"
+ "<su>mlal2\t%0.<Vwtype>, %2.<Vtype>, %4.<Vtype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
+(define_insn "*aarch64_<su>mlsl_lo<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (minus:<VWIDE>
+ (match_operand:<VWIDE> 1 "register_operand" "0")
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 2 "register_operand" "w")
+ (match_operand:VQW 3 "vect_par_cnst_lo_half" "")))
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 4 "register_operand" "w")
+ (match_dup 3))))))]
+ "TARGET_SIMD"
+ "<su>mlsl\t%0.<Vwtype>, %2.<Vhalftype>, %4.<Vhalftype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
+(define_insn "*aarch64_<su>mlsl_hi<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (minus:<VWIDE>
+ (match_operand:<VWIDE> 1 "register_operand" "0")
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 2 "register_operand" "w")
+ (match_operand:VQW 3 "vect_par_cnst_hi_half" "")))
+ (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
+ (match_operand:VQW 4 "register_operand" "w")
+ (match_dup 3))))))]
+ "TARGET_SIMD"
+ "<su>mlsl2\t%0.<Vwtype>, %2.<Vtype>, %4.<Vtype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
+(define_insn "*aarch64_<su>mlal<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (plus:<VWIDE>
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE>
+ (match_operand:VDW 1 "register_operand" "w"))
+ (ANY_EXTEND:<VWIDE>
+ (match_operand:VDW 2 "register_operand" "w")))
+ (match_operand:<VWIDE> 3 "register_operand" "0")))]
+ "TARGET_SIMD"
+ "<su>mlal\t%0.<Vwtype>, %1.<Vtype>, %2.<Vtype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
+(define_insn "*aarch64_<su>mlsl<mode>"
+ [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
+ (minus:<VWIDE>
+ (match_operand:<VWIDE> 1 "register_operand" "0")
+ (mult:<VWIDE>
+ (ANY_EXTEND:<VWIDE>
+ (match_operand:VDW 2 "register_operand" "w"))
+ (ANY_EXTEND:<VWIDE>
+ (match_operand:VDW 3 "register_operand" "w")))))]
+ "TARGET_SIMD"
+ "<su>mlsl\t%0.<Vwtype>, %2.<Vtype>, %3.<Vtype>"
+ [(set_attr "simd_type" "simd_mlal")
+ (set_attr "simd_mode" "<MODE>")]
+)
+
(define_insn "aarch64_simd_vec_<su>mult_lo_<mode>"
[(set (match_operand:<VWIDE> 0 "register_operand" "=w")
(mult:<VWIDE> (ANY_EXTEND:<VWIDE> (vec_select:<VHALF>
@@ -2218,15 +2316,29 @@
(set_attr "simd_mode" "<MODE>")]
)
-(define_insn "aarch64_combine<mode>"
+(define_insn_and_split "aarch64_combine<mode>"
[(set (match_operand:<VDBL> 0 "register_operand" "=&w")
(vec_concat:<VDBL> (match_operand:VDC 1 "register_operand" "w")
(match_operand:VDC 2 "register_operand" "w")))]
"TARGET_SIMD"
- "mov\\t%0.d[0], %1.d[0]\;ins\\t%0.d[1], %2.d[0]"
- [(set_attr "simd_type" "simd_ins")
- (set_attr "simd_mode" "<MODE>")]
-)
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ aarch64_split_simd_combine (operands[0], operands[1], operands[2]);
+ DONE;
+})
+
+(define_expand "aarch64_simd_combine<mode>"
+ [(set (match_operand:<VDBL> 0 "register_operand" "=&w")
+ (vec_concat:<VDBL> (match_operand:VDC 1 "register_operand" "w")
+ (match_operand:VDC 2 "register_operand" "w")))]
+ "TARGET_SIMD"
+ {
+ emit_insn (gen_move_lo_quad_<Vdbl> (operands[0], operands[1]));
+ emit_insn (gen_move_hi_quad_<Vdbl> (operands[0], operands[2]));
+ DONE;
+ })
;; <su><addsub>l<q>.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 9c77888157d..527b00dbcaa 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -87,6 +87,14 @@ struct aarch64_address_info {
enum aarch64_symbol_type symbol_type;
};
+struct simd_immediate_info
+{
+ rtx value;
+ int shift;
+ int element_width;
+ bool mvn;
+};
+
/* The current code model. */
enum aarch64_code_model aarch64_cmodel;
@@ -103,8 +111,6 @@ static bool aarch64_vfp_is_call_or_return_candidate (enum machine_mode,
static void aarch64_elf_asm_constructor (rtx, int) ATTRIBUTE_UNUSED;
static void aarch64_elf_asm_destructor (rtx, int) ATTRIBUTE_UNUSED;
static void aarch64_override_options_after_change (void);
-static int aarch64_simd_valid_immediate (rtx, enum machine_mode, int, rtx *,
- int *, unsigned char *, int *, int *);
static bool aarch64_vector_mode_supported_p (enum machine_mode);
static unsigned bit_count (unsigned HOST_WIDE_INT);
static bool aarch64_const_vec_all_same_int_p (rtx,
@@ -532,9 +538,7 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
{
rtx tmp_reg = dest;
if (can_create_pseudo_p ())
- {
- tmp_reg = gen_reg_rtx (Pmode);
- }
+ tmp_reg = gen_reg_rtx (Pmode);
emit_move_insn (tmp_reg, gen_rtx_HIGH (Pmode, imm));
emit_insn (gen_ldr_got_small (dest, tmp_reg, imm));
return;
@@ -696,6 +700,49 @@ aarch64_split_128bit_move_p (rtx dst, rtx src)
|| ! (FP_REGNUM_P (REGNO (dst)) && FP_REGNUM_P (REGNO (src))));
}
+/* Split a complex SIMD combine. */
+
+void
+aarch64_split_simd_combine (rtx dst, rtx src1, rtx src2)
+{
+ enum machine_mode src_mode = GET_MODE (src1);
+ enum machine_mode dst_mode = GET_MODE (dst);
+
+ gcc_assert (VECTOR_MODE_P (dst_mode));
+
+ if (REG_P (dst) && REG_P (src1) && REG_P (src2))
+ {
+ rtx (*gen) (rtx, rtx, rtx);
+
+ switch (src_mode)
+ {
+ case V8QImode:
+ gen = gen_aarch64_simd_combinev8qi;
+ break;
+ case V4HImode:
+ gen = gen_aarch64_simd_combinev4hi;
+ break;
+ case V2SImode:
+ gen = gen_aarch64_simd_combinev2si;
+ break;
+ case V2SFmode:
+ gen = gen_aarch64_simd_combinev2sf;
+ break;
+ case DImode:
+ gen = gen_aarch64_simd_combinedi;
+ break;
+ case DFmode:
+ gen = gen_aarch64_simd_combinedf;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ emit_insn (gen (dst, src1, src2));
+ return;
+ }
+}
+
/* Split a complex SIMD move. */
void
@@ -5068,6 +5115,10 @@ aarch64_classify_symbol (rtx x,
return SYMBOL_SMALL_ABSOLUTE;
case AARCH64_CMODEL_TINY_PIC:
+ if (!aarch64_symbol_binds_local_p (x))
+ return SYMBOL_SMALL_GOT;
+ return SYMBOL_TINY_ABSOLUTE;
+
case AARCH64_CMODEL_SMALL_PIC:
if (!aarch64_symbol_binds_local_p (x))
return SYMBOL_SMALL_GOT;
@@ -5150,8 +5201,7 @@ aarch64_legitimate_constant_p (enum machine_mode mode, rtx x)
/* This could probably go away because
we now decompose CONST_INTs according to expand_mov_immediate. */
if ((GET_CODE (x) == CONST_VECTOR
- && aarch64_simd_valid_immediate (x, mode, false,
- NULL, NULL, NULL, NULL, NULL) != -1)
+ && aarch64_simd_valid_immediate (x, mode, false, NULL))
|| CONST_INT_P (x) || aarch64_valid_floating_const (mode, x))
return !targetm.cannot_force_const_mem (mode, x);
@@ -5982,32 +6032,57 @@ aarch64_vector_mode_supported_p (enum machine_mode mode)
return false;
}
-/* Return quad mode as the preferred SIMD mode. */
+/* Return appropriate SIMD container
+ for MODE within a vector of WIDTH bits. */
static enum machine_mode
-aarch64_preferred_simd_mode (enum machine_mode mode)
+aarch64_simd_container_mode (enum machine_mode mode, unsigned width)
{
+ gcc_assert (width == 64 || width == 128);
if (TARGET_SIMD)
- switch (mode)
- {
- case DFmode:
- return V2DFmode;
- case SFmode:
- return V4SFmode;
- case SImode:
- return V4SImode;
- case HImode:
- return V8HImode;
- case QImode:
- return V16QImode;
- case DImode:
- return V2DImode;
- break;
-
- default:;
- }
+ {
+ if (width == 128)
+ switch (mode)
+ {
+ case DFmode:
+ return V2DFmode;
+ case SFmode:
+ return V4SFmode;
+ case SImode:
+ return V4SImode;
+ case HImode:
+ return V8HImode;
+ case QImode:
+ return V16QImode;
+ case DImode:
+ return V2DImode;
+ default:
+ break;
+ }
+ else
+ switch (mode)
+ {
+ case SFmode:
+ return V2SFmode;
+ case SImode:
+ return V2SImode;
+ case HImode:
+ return V4HImode;
+ case QImode:
+ return V8QImode;
+ default:
+ break;
+ }
+ }
return word_mode;
}
+/* Return 128-bit container as the preferred SIMD mode for MODE. */
+static enum machine_mode
+aarch64_preferred_simd_mode (enum machine_mode mode)
+{
+ return aarch64_simd_container_mode (mode, 128);
+}
+
/* Return the bitmask of possible vector sizes for the vectorizer
to iterate over. */
static unsigned int
@@ -6095,7 +6170,7 @@ aarch64_mangle_type (const_tree type)
}
/* Return the equivalent letter for size. */
-static unsigned char
+static char
sizetochar (int size)
{
switch (size)
@@ -6142,15 +6217,10 @@ aarch64_vect_float_const_representable_p (rtx x)
return aarch64_float_const_representable_p (x0);
}
-/* TODO: This function returns values similar to those
- returned by neon_valid_immediate in gcc/config/arm/arm.c
- but the API here is different enough that these magic numbers
- are not used. It should be sufficient to return true or false. */
-static int
-aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, int inverse,
- rtx *modconst, int *elementwidth,
- unsigned char *elementchar,
- int *mvn, int *shift)
+/* Return true for valid and false for invalid. */
+bool
+aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, bool inverse,
+ struct simd_immediate_info *info)
{
#define CHECK(STRIDE, ELSIZE, CLASS, TEST, SHIFT, NEG) \
matches = 1; \
@@ -6161,7 +6231,6 @@ aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, int inverse,
{ \
immtype = (CLASS); \
elsize = (ELSIZE); \
- elchar = sizetochar (elsize); \
eshift = (SHIFT); \
emvn = (NEG); \
break; \
@@ -6170,36 +6239,25 @@ aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, int inverse,
unsigned int i, elsize = 0, idx = 0, n_elts = CONST_VECTOR_NUNITS (op);
unsigned int innersize = GET_MODE_SIZE (GET_MODE_INNER (mode));
unsigned char bytes[16];
- unsigned char elchar = 0;
int immtype = -1, matches;
unsigned int invmask = inverse ? 0xff : 0;
int eshift, emvn;
if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
{
- bool simd_imm_zero = aarch64_simd_imm_zero_p (op, mode);
- int elem_width = GET_MODE_BITSIZE (GET_MODE (CONST_VECTOR_ELT (op, 0)));
-
- if (!(simd_imm_zero
- || aarch64_vect_float_const_representable_p (op)))
- return -1;
-
- if (modconst)
- *modconst = CONST_VECTOR_ELT (op, 0);
-
- if (elementwidth)
- *elementwidth = elem_width;
-
- if (elementchar)
- *elementchar = sizetochar (elem_width);
+ if (! (aarch64_simd_imm_zero_p (op, mode)
+ || aarch64_vect_float_const_representable_p (op)))
+ return false;
- if (shift)
- *shift = 0;
+ if (info)
+ {
+ info->value = CONST_VECTOR_ELT (op, 0);
+ info->element_width = GET_MODE_BITSIZE (GET_MODE (info->value));
+ info->mvn = false;
+ info->shift = 0;
+ }
- if (simd_imm_zero)
- return 19;
- else
- return 18;
+ return true;
}
/* Splat vector constant out into a byte vector. */
@@ -6297,23 +6355,14 @@ aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, int inverse,
if (immtype == -1
|| (immtype >= 12 && immtype <= 15)
|| immtype == 18)
- return -1;
-
-
- if (elementwidth)
- *elementwidth = elsize;
-
- if (elementchar)
- *elementchar = elchar;
-
- if (mvn)
- *mvn = emvn;
-
- if (shift)
- *shift = eshift;
+ return false;
- if (modconst)
+ if (info)
{
+ info->element_width = elsize;
+ info->mvn = emvn != 0;
+ info->shift = eshift;
+
unsigned HOST_WIDE_INT imm = 0;
/* Un-invert bytes of recognized vector, if necessary. */
@@ -6330,68 +6379,27 @@ aarch64_simd_valid_immediate (rtx op, enum machine_mode mode, int inverse,
imm |= (unsigned HOST_WIDE_INT) (bytes[i] ? 0xff : 0)
<< (i * BITS_PER_UNIT);
- *modconst = GEN_INT (imm);
- }
- else
- {
- unsigned HOST_WIDE_INT imm = 0;
- for (i = 0; i < elsize / BITS_PER_UNIT; i++)
- imm |= (unsigned HOST_WIDE_INT) bytes[i] << (i * BITS_PER_UNIT);
+ info->value = GEN_INT (imm);
+ }
+ else
+ {
+ for (i = 0; i < elsize / BITS_PER_UNIT; i++)
+ imm |= (unsigned HOST_WIDE_INT) bytes[i] << (i * BITS_PER_UNIT);
/* Construct 'abcdefgh' because the assembler cannot handle
- generic constants. */
- gcc_assert (shift != NULL && mvn != NULL);
- if (*mvn)
+ generic constants. */
+ if (info->mvn)
imm = ~imm;
- imm = (imm >> *shift) & 0xff;
- *modconst = GEN_INT (imm);
- }
+ imm = (imm >> info->shift) & 0xff;
+ info->value = GEN_INT (imm);
+ }
}
- return immtype;
+ return true;
#undef CHECK
}
-/* Return TRUE if rtx X is legal for use as either a AdvSIMD MOVI instruction
- (or, implicitly, MVNI) immediate. Write back width per element
- to *ELEMENTWIDTH, and a modified constant (whatever should be output
- for a MOVI instruction) in *MODCONST. */
-int
-aarch64_simd_immediate_valid_for_move (rtx op, enum machine_mode mode,
- rtx *modconst, int *elementwidth,
- unsigned char *elementchar,
- int *mvn, int *shift)
-{
- rtx tmpconst;
- int tmpwidth;
- unsigned char tmpwidthc;
- int tmpmvn = 0, tmpshift = 0;
- int retval = aarch64_simd_valid_immediate (op, mode, 0, &tmpconst,
- &tmpwidth, &tmpwidthc,
- &tmpmvn, &tmpshift);
-
- if (retval == -1)
- return 0;
-
- if (modconst)
- *modconst = tmpconst;
-
- if (elementwidth)
- *elementwidth = tmpwidth;
-
- if (elementchar)
- *elementchar = tmpwidthc;
-
- if (mvn)
- *mvn = tmpmvn;
-
- if (shift)
- *shift = tmpshift;
-
- return 1;
-}
-
static bool
aarch64_const_vec_all_same_int_p (rtx x,
HOST_WIDE_INT minval,
@@ -6496,9 +6504,7 @@ aarch64_simd_scalar_immediate_valid_for_move (rtx op, enum machine_mode mode)
gcc_assert (!VECTOR_MODE_P (mode));
vmode = aarch64_preferred_simd_mode (mode);
rtx op_v = aarch64_simd_gen_const_vector_dup (vmode, INTVAL (op));
- int retval = aarch64_simd_immediate_valid_for_move (op_v, vmode, 0,
- NULL, NULL, NULL, NULL);
- return retval;
+ return aarch64_simd_valid_immediate (op_v, vmode, false, NULL);
}
/* Construct and return a PARALLEL RTX vector. */
@@ -6726,8 +6732,7 @@ aarch64_simd_make_constant (rtx vals)
gcc_unreachable ();
if (const_vec != NULL_RTX
- && aarch64_simd_immediate_valid_for_move (const_vec, mode, NULL, NULL,
- NULL, NULL, NULL))
+ && aarch64_simd_valid_immediate (const_vec, mode, false, NULL))
/* Load using MOVI/MVNI. */
return const_vec;
else if ((const_dup = aarch64_simd_dup_constant (vals)) != NULL_RTX)
@@ -7285,49 +7290,78 @@ aarch64_float_const_representable_p (rtx x)
}
char*
-aarch64_output_simd_mov_immediate (rtx *const_vector,
+aarch64_output_simd_mov_immediate (rtx const_vector,
enum machine_mode mode,
unsigned width)
{
- int is_valid;
- unsigned char widthc;
- int lane_width_bits;
+ bool is_valid;
static char templ[40];
- int shift = 0, mvn = 0;
const char *mnemonic;
unsigned int lane_count = 0;
+ char element_char;
- is_valid =
- aarch64_simd_immediate_valid_for_move (*const_vector, mode,
- const_vector, &lane_width_bits,
- &widthc, &mvn, &shift);
+ struct simd_immediate_info info;
+
+ /* This will return true to show const_vector is legal for use as either
+ a AdvSIMD MOVI instruction (or, implicitly, MVNI) immediate. It will
+ also update INFO to show how the immediate should be generated. */
+ is_valid = aarch64_simd_valid_immediate (const_vector, mode, false, &info);
gcc_assert (is_valid);
+ element_char = sizetochar (info.element_width);
+ lane_count = width / info.element_width;
+
mode = GET_MODE_INNER (mode);
if (mode == SFmode || mode == DFmode)
{
- bool zero_p =
- aarch64_float_const_zero_rtx_p (*const_vector);
- gcc_assert (shift == 0);
- mnemonic = zero_p ? "movi" : "fmov";
+ gcc_assert (info.shift == 0 && ! info.mvn);
+ if (aarch64_float_const_zero_rtx_p (info.value))
+ info.value = GEN_INT (0);
+ else
+ {
+#define buf_size 20
+ REAL_VALUE_TYPE r;
+ REAL_VALUE_FROM_CONST_DOUBLE (r, info.value);
+ char float_buf[buf_size] = {'\0'};
+ real_to_decimal_for_mode (float_buf, &r, buf_size, buf_size, 1, mode);
+#undef buf_size
+
+ if (lane_count == 1)
+ snprintf (templ, sizeof (templ), "fmov\t%%d0, %s", float_buf);
+ else
+ snprintf (templ, sizeof (templ), "fmov\t%%0.%d%c, %s",
+ lane_count, element_char, float_buf);
+ return templ;
+ }
}
- else
- mnemonic = mvn ? "mvni" : "movi";
- gcc_assert (lane_width_bits != 0);
- lane_count = width / lane_width_bits;
+ mnemonic = info.mvn ? "mvni" : "movi";
if (lane_count == 1)
- snprintf (templ, sizeof (templ), "%s\t%%d0, %%1", mnemonic);
- else if (shift)
- snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, %%1, lsl %d",
- mnemonic, lane_count, widthc, shift);
+ snprintf (templ, sizeof (templ), "%s\t%%d0, " HOST_WIDE_INT_PRINT_HEX,
+ mnemonic, UINTVAL (info.value));
+ else if (info.shift)
+ snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, " HOST_WIDE_INT_PRINT_HEX
+ ", lsl %d", mnemonic, lane_count, element_char,
+ UINTVAL (info.value), info.shift);
else
- snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, %%1",
- mnemonic, lane_count, widthc);
+ snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, " HOST_WIDE_INT_PRINT_HEX,
+ mnemonic, lane_count, element_char, UINTVAL (info.value));
return templ;
}
+char*
+aarch64_output_scalar_simd_mov_immediate (rtx immediate,
+ enum machine_mode mode)
+{
+ enum machine_mode vmode;
+
+ gcc_assert (!VECTOR_MODE_P (mode));
+ vmode = aarch64_simd_container_mode (mode, 64);
+ rtx v_op = aarch64_simd_gen_const_vector_dup (vmode, INTVAL (immediate));
+ return aarch64_output_simd_mov_immediate (v_op, vmode, 64);
+}
+
/* Split operands into moves from op[1] + op[2] into op[0]. */
void
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 89db09254eb..e88e5be894e 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -774,17 +774,34 @@
(match_operand:SHORT 1 "general_operand" " r,M,D<hq>,m, m,rZ,*w,*w, r,*w"))]
"(register_operand (operands[0], <MODE>mode)
|| aarch64_reg_or_zero (operands[1], <MODE>mode))"
- "@
- mov\\t%w0, %w1
- mov\\t%w0, %1
- movi\\t%0.<Vallxd>, %1
- ldr<size>\\t%w0, %1
- ldr\\t%<size>0, %1
- str<size>\\t%w1, %0
- str\\t%<size>1, %0
- umov\\t%w0, %1.<v>[0]
- dup\\t%0.<Vallxd>, %w1
- dup\\t%0, %1.<v>[0]"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "mov\t%w0, %w1";
+ case 1:
+ return "mov\t%w0, %1";
+ case 2:
+ return aarch64_output_scalar_simd_mov_immediate (operands[1],
+ <MODE>mode);
+ case 3:
+ return "ldr<size>\t%w0, %1";
+ case 4:
+ return "ldr\t%<size>0, %1";
+ case 5:
+ return "str<size>\t%w1, %0";
+ case 6:
+ return "str\t%<size>1, %0";
+ case 7:
+ return "umov\t%w0, %1.<v>[0]";
+ case 8:
+ return "dup\t%0.<Vallxd>, %w1";
+ case 9:
+ return "dup\t%0, %1.<v>[0]";
+ default:
+ gcc_unreachable ();
+ }
+}
[(set_attr "v8type" "move,alu,alu,load1,load1,store1,store1,*,*,*")
(set_attr "simd_type" "*,*,simd_move_imm,*,*,*,*,simd_movgp,simd_dupgp,simd_dup")
(set_attr "simd" "*,*,yes,*,*,*,*,yes,yes,yes")
@@ -850,7 +867,8 @@
movi\\t%d0, %1"
[(set_attr "v8type" "move,move,move,alu,load1,load1,store1,store1,adr,adr,fmov,fmov,fmov,fmov")
(set_attr "mode" "DI")
- (set_attr "fp" "*,*,*,*,*,yes,*,yes,*,*,yes,yes,yes,yes")]
+ (set_attr "fp" "*,*,*,*,*,yes,*,yes,*,*,yes,yes,yes,*")
+ (set_attr "simd" "*,*,*,*,*,*,*,*,*,*,*,*,*,yes")]
)
(define_insn "insv_imm<mode>"
diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md
index d9c18e692ea..7cafc08fdd9 100644
--- a/gcc/config/aarch64/constraints.md
+++ b/gcc/config/aarch64/constraints.md
@@ -143,9 +143,8 @@
"@internal
A constraint that matches vector of immediates."
(and (match_code "const_vector")
- (match_test "aarch64_simd_immediate_valid_for_move (op, GET_MODE (op),
- NULL, NULL, NULL,
- NULL, NULL) != 0")))
+ (match_test "aarch64_simd_valid_immediate (op, GET_MODE (op),
+ false, NULL)")))
(define_constraint "Dh"
"@internal
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md
index 860d4d9a187..8e40c5de5d4 100644
--- a/gcc/config/aarch64/iterators.md
+++ b/gcc/config/aarch64/iterators.md
@@ -385,7 +385,8 @@
;; Double modes of vector modes (lower case).
(define_mode_attr Vdbl [(V8QI "v16qi") (V4HI "v8hi")
(V2SI "v4si") (V2SF "v4sf")
- (SI "v2si") (DI "v2di")])
+ (SI "v2si") (DI "v2di")
+ (DF "v2df")])
;; Narrowed modes for VDN.
(define_mode_attr VNARROWD [(V4HI "V8QI") (V2SI "V4HI")
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 096ef3b1f56..5f5b33e347b 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2700,12 +2700,12 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
break;
case GE: case GT: case GEU: case GTU:
- /* These must be swapped. */
- if (op1 != CONST0_RTX (cmp_mode))
- {
- code = swap_condition (code);
- tem = op0, op0 = op1, op1 = tem;
- }
+ /* These normally need swapping, but for integer zero we have
+ special patterns that recognize swapped operands. */
+ if (cmp_mode == DImode && op1 == const0_rtx)
+ break;
+ code = swap_condition (code);
+ tem = op0, op0 = op1, op1 = tem;
break;
default:
@@ -3068,7 +3068,8 @@ alpha_emit_xfloating_compare (enum rtx_code *pcode, rtx op0, rtx op1)
out = gen_reg_rtx (DImode);
/* What's actually returned is -1,0,1, not a proper boolean value. */
- note = gen_rtx_UNSPEC (DImode, gen_rtvec (2, op0, op1), UNSPEC_XFLT_COMPARE);
+ note = gen_rtx_fmt_ee (cmp_code, VOIDmode, op0, op1);
+ note = gen_rtx_UNSPEC (DImode, gen_rtvec (1, note), UNSPEC_XFLT_COMPARE);
alpha_emit_xfloating_libcall (func, out, operands, 2, note);
return out;
diff --git a/gcc/config/arm/arm-fixed.md b/gcc/config/arm/arm-fixed.md
index 10da396ab66..12bbbaf9083 100644
--- a/gcc/config/arm/arm-fixed.md
+++ b/gcc/config/arm/arm-fixed.md
@@ -19,12 +19,13 @@
;; This file contains ARM instructions that support fixed-point operations.
(define_insn "add<mode>3"
- [(set (match_operand:FIXED 0 "s_register_operand" "=r")
- (plus:FIXED (match_operand:FIXED 1 "s_register_operand" "r")
- (match_operand:FIXED 2 "s_register_operand" "r")))]
+ [(set (match_operand:FIXED 0 "s_register_operand" "=l,r")
+ (plus:FIXED (match_operand:FIXED 1 "s_register_operand" "l,r")
+ (match_operand:FIXED 2 "s_register_operand" "l,r")))]
"TARGET_32BIT"
"add%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "yes,no")])
(define_insn "add<mode>3"
[(set (match_operand:ADDSUB 0 "s_register_operand" "=r")
@@ -32,7 +33,8 @@
(match_operand:ADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"sadd<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "usadd<mode>3"
[(set (match_operand:UQADDSUB 0 "s_register_operand" "=r")
@@ -40,7 +42,8 @@
(match_operand:UQADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"uqadd<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "ssadd<mode>3"
[(set (match_operand:QADDSUB 0 "s_register_operand" "=r")
@@ -48,15 +51,17 @@
(match_operand:QADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"qadd<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "sub<mode>3"
- [(set (match_operand:FIXED 0 "s_register_operand" "=r")
- (minus:FIXED (match_operand:FIXED 1 "s_register_operand" "r")
- (match_operand:FIXED 2 "s_register_operand" "r")))]
+ [(set (match_operand:FIXED 0 "s_register_operand" "=l,r")
+ (minus:FIXED (match_operand:FIXED 1 "s_register_operand" "l,r")
+ (match_operand:FIXED 2 "s_register_operand" "l,r")))]
"TARGET_32BIT"
"sub%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "yes,no")])
(define_insn "sub<mode>3"
[(set (match_operand:ADDSUB 0 "s_register_operand" "=r")
@@ -64,7 +69,8 @@
(match_operand:ADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"ssub<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "ussub<mode>3"
[(set (match_operand:UQADDSUB 0 "s_register_operand" "=r")
@@ -73,7 +79,8 @@
(match_operand:UQADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"uqsub<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "sssub<mode>3"
[(set (match_operand:QADDSUB 0 "s_register_operand" "=r")
@@ -81,7 +88,8 @@
(match_operand:QADDSUB 2 "s_register_operand" "r")))]
"TARGET_INT_SIMD"
"qsub<qaddsub_suf>%?\\t%0, %1, %2"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
;; Fractional multiplies.
@@ -374,6 +382,7 @@
"TARGET_32BIT && arm_arch6"
"ssat%?\\t%0, #16, %2%S1"
[(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")
(set_attr "insn" "sat")
(set_attr "shift" "1")
(set_attr "type" "alu_shift")])
@@ -384,4 +393,5 @@
"TARGET_INT_SIMD"
"usat%?\\t%0, #16, %1"
[(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")
(set_attr "insn" "sat")])
diff --git a/gcc/config/arm/arm-ldmstm.ml b/gcc/config/arm/arm-ldmstm.ml
index 2bc9702bee2..e615437b125 100644
--- a/gcc/config/arm/arm-ldmstm.ml
+++ b/gcc/config/arm/arm-ldmstm.ml
@@ -146,12 +146,15 @@ let can_thumb addrmode update is_store =
| IA, true, true -> true
| _ -> false
+exception InvalidAddrMode of string;;
+
let target addrmode thumb =
match addrmode, thumb with
IA, true -> "TARGET_THUMB1"
| IA, false -> "TARGET_32BIT"
| DB, false -> "TARGET_32BIT"
| _, false -> "TARGET_ARM"
+ | _, _ -> raise (InvalidAddrMode "ERROR: Invalid Addressing mode for Thumb1.")
let write_pattern_1 name ls addrmode nregs write_set_fn update thumb =
let astr = string_of_addrmode addrmode in
@@ -181,8 +184,10 @@ let write_pattern_1 name ls addrmode nregs write_set_fn update thumb =
done;
Printf.printf "}\"\n";
Printf.printf " [(set_attr \"type\" \"%s%d\")" ls nregs;
- begin if not thumb then
+ if not thumb then begin
Printf.printf "\n (set_attr \"predicable\" \"yes\")";
+ if addrmode == IA || addrmode == DB then
+ Printf.printf "\n (set_attr \"predicable_short_it\" \"no\")";
end;
Printf.printf "])\n\n"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 55a512349cc..6fc307e7709 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -662,6 +662,10 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_ASAN_SHADOW_OFFSET
#define TARGET_ASAN_SHADOW_OFFSET arm_asan_shadow_offset
+#undef MAX_INSN_PER_IT_BLOCK
+#define MAX_INSN_PER_IT_BLOCK (arm_restrict_it ? 1 : 4)
+
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Obstack for minipool constant handling. */
@@ -1871,6 +1875,11 @@ arm_option_override (void)
arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
+ if (arm_restrict_it == 2)
+ arm_restrict_it = arm_arch8 && TARGET_THUMB2;
+
+ if (!TARGET_THUMB2)
+ arm_restrict_it = 0;
/* If we are not using the default (ARM mode) section anchor offset
ranges, then set the correct ranges now. */
@@ -2677,6 +2686,8 @@ const_ok_for_dimode_op (HOST_WIDE_INT i, enum rtx_code code)
switch (code)
{
case AND:
+ case IOR:
+ case XOR:
return (const_ok_for_op (hi_val, code) || hi_val == 0xFFFFFFFF)
&& (const_ok_for_op (lo_val, code) || lo_val == 0xFFFFFFFF);
case PLUS:
@@ -16168,25 +16179,34 @@ arm_compute_save_reg0_reg12_mask (void)
return save_reg_mask;
}
+/* Return true if r3 is live at the start of the function. */
+
+static bool
+arm_r3_live_at_start_p (void)
+{
+ /* Just look at cfg info, which is still close enough to correct at this
+ point. This gives false positives for broken functions that might use
+ uninitialized data that happens to be allocated in r3, but who cares? */
+ return REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR), 3);
+}
/* Compute the number of bytes used to store the static chain register on the
- stack, above the stack frame. We need to know this accurately to get the
- alignment of the rest of the stack frame correct. */
+ stack, above the stack frame. We need to know this accurately to get the
+ alignment of the rest of the stack frame correct. */
-static int arm_compute_static_chain_stack_bytes (void)
+static int
+arm_compute_static_chain_stack_bytes (void)
{
- unsigned long func_type = arm_current_func_type ();
- int static_chain_stack_bytes = 0;
-
- if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM &&
- IS_NESTED (func_type) &&
- df_regs_ever_live_p (3) && crtl->args.pretend_args_size == 0)
- static_chain_stack_bytes = 4;
+ /* See the defining assertion in arm_expand_prologue. */
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM
+ && IS_NESTED (arm_current_func_type ())
+ && arm_r3_live_at_start_p ()
+ && crtl->args.pretend_args_size == 0)
+ return 4;
- return static_chain_stack_bytes;
+ return 0;
}
-
/* Compute a bit mask of which registers need to be
saved on the stack for the current function.
This is used by arm_get_frame_offsets, which may add extra registers. */
@@ -18141,16 +18161,16 @@ arm_expand_prologue (void)
}
else if (IS_NESTED (func_type))
{
- /* The Static chain register is the same as the IP register
+ /* The static chain register is the same as the IP register
used as a scratch register during stack frame creation.
To get around this need to find somewhere to store IP
whilst the frame is being created. We try the following
places in order:
- 1. The last argument register.
+ 1. The last argument register r3.
2. A slot on the stack above the frame. (This only
works if the function is not a varargs function).
- 3. Register r3, after pushing the argument registers
+ 3. Register r3 again, after pushing the argument registers
onto the stack.
Note - we only need to tell the dwarf2 backend about the SP
@@ -18158,7 +18178,7 @@ arm_expand_prologue (void)
doesn't need to be unwound, as it doesn't contain a value
inherited from the caller. */
- if (df_regs_ever_live_p (3) == false)
+ if (!arm_r3_live_at_start_p ())
insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx);
else if (args_to_push == 0)
{
@@ -18299,8 +18319,7 @@ arm_expand_prologue (void)
if (IS_NESTED (func_type))
{
/* Recover the static chain register. */
- if (!df_regs_ever_live_p (3)
- || saved_pretend_args)
+ if (!arm_r3_live_at_start_p () || saved_pretend_args)
insn = gen_rtx_REG (SImode, 3);
else /* if (crtl->args.pretend_args_size == 0) */
{
@@ -19592,7 +19611,7 @@ thumb2_final_prescan_insn (rtx insn)
break;
/* Allow up to 4 conditionally executed instructions in a block. */
n = get_attr_ce_count (insn);
- if (arm_condexec_masklen + n > 4)
+ if (arm_condexec_masklen + n > MAX_INSN_PER_IT_BLOCK)
break;
predicate = COND_EXEC_TEST (body);
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index b7db3616cdf..3f0e021f3ed 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -93,6 +93,15 @@
; IS_THUMB1 is set to 'yes' iff we are generating Thumb-1 code.
(define_attr "is_thumb1" "no,yes" (const (symbol_ref "thumb1_code")))
+; We use this attribute to disable alternatives that can produce 32-bit
+; instructions inside an IT-block in Thumb2 state. ARMv8 deprecates IT blocks
+; that contain 32-bit instructions.
+(define_attr "enabled_for_depr_it" "no,yes" (const_string "yes"))
+
+; This attribute is used to disable a predicated alternative when we have
+; arm_restrict_it.
+(define_attr "predicable_short_it" "no,yes" (const_string "yes"))
+
;; Operand number of an input operand that is shifted. Zero if the
;; given instruction does not shift one of its input operands.
(define_attr "shift" "" (const_int 0))
@@ -103,6 +112,8 @@
(define_attr "fpu" "none,vfp"
(const (symbol_ref "arm_fpu_attr")))
+(define_attr "predicated" "yes,no" (const_string "no"))
+
; LENGTH of an instruction (in bytes)
(define_attr "length" ""
(const_int 4))
@@ -190,6 +201,15 @@
(cond [(eq_attr "insn_enabled" "no")
(const_string "no")
+ (and (eq_attr "predicable_short_it" "no")
+ (and (eq_attr "predicated" "yes")
+ (match_test "arm_restrict_it")))
+ (const_string "no")
+
+ (and (eq_attr "enabled_for_depr_it" "no")
+ (match_test "arm_restrict_it"))
+ (const_string "no")
+
(eq_attr "arch_enabled" "no")
(const_string "no")
@@ -2163,29 +2183,28 @@
)
(define_insn_and_split "*anddi3_insn"
- [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r,&r,w,w ,?&r,?&r,?w,?w")
- (and:DI (match_operand:DI 1 "s_register_operand" "%0 ,r ,0,r ,w,0 ,0 ,r ,w ,0")
- (match_operand:DI 2 "arm_anddi_operand_neon" "r ,r ,De,De,w,DL,r ,r ,w ,DL")))]
+ [(set (match_operand:DI 0 "s_register_operand" "=w,w ,&r,&r,&r,&r,?w,?w")
+ (and:DI (match_operand:DI 1 "s_register_operand" "%w,0 ,0 ,r ,0 ,r ,w ,0")
+ (match_operand:DI 2 "arm_anddi_operand_neon" "w ,DL,r ,r ,De,De,w ,DL")))]
"TARGET_32BIT && !TARGET_IWMMXT"
{
switch (which_alternative)
{
- case 0:
- case 1:
+ case 0: /* fall through */
+ case 6: return "vand\t%P0, %P1, %P2";
+ case 1: /* fall through */
+ case 7: return neon_output_logic_immediate ("vand", &operands[2],
+ DImode, 1, VALID_NEON_QREG_MODE (DImode));
case 2:
- case 3: /* fall through */
- return "#";
- case 4: /* fall through */
- case 8: return "vand\t%P0, %P1, %P2";
+ case 3:
+ case 4:
case 5: /* fall through */
- case 9: return neon_output_logic_immediate ("vand", &operands[2],
- DImode, 1, VALID_NEON_QREG_MODE (DImode));
- case 6: return "#";
- case 7: return "#";
+ return "#";
default: gcc_unreachable ();
}
}
- "TARGET_32BIT && !TARGET_IWMMXT"
+ "TARGET_32BIT && !TARGET_IWMMXT && reload_completed
+ && !(IS_VFP_REGNUM (REGNO (operands[0])))"
[(set (match_dup 3) (match_dup 4))
(set (match_dup 5) (match_dup 6))]
"
@@ -2201,19 +2220,11 @@
gen_highpart_mode (SImode, DImode, operands[2]));
}"
- [(set_attr "neon_type" "*,*,*,*,neon_int_1,neon_int_1,*,*,neon_int_1,neon_int_1")
- (set_attr "arch" "*,*,*,*,neon_for_64bits,neon_for_64bits,*,*,
+ [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*,*,*,neon_int_1,neon_int_1")
+ (set_attr "arch" "neon_for_64bits,neon_for_64bits,*,*,*,*,
avoid_neon_for_64bits,avoid_neon_for_64bits")
- (set_attr "length" "8,8,8,8,*,*,8,8,*,*")
- (set (attr "insn_enabled") (if_then_else
- (lt (symbol_ref "which_alternative")
- (const_int 4))
- (if_then_else (match_test "!TARGET_NEON")
- (const_string "yes")
- (const_string "no"))
- (if_then_else (match_test "TARGET_NEON")
- (const_string "yes")
- (const_string "no"))))]
+ (set_attr "length" "*,*,8,8,8,8,*,*")
+ ]
)
(define_insn_and_split "*anddi_zesidi_di"
@@ -2997,14 +3008,47 @@
""
)
-(define_insn "*iordi3_insn"
- [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
- (ior:DI (match_operand:DI 1 "s_register_operand" "%0,r")
- (match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_32BIT && !TARGET_IWMMXT && !TARGET_NEON"
- "#"
- [(set_attr "length" "8")
- (set_attr "predicable" "yes")]
+(define_insn_and_split "*iordi3_insn"
+ [(set (match_operand:DI 0 "s_register_operand" "=w,w ,&r,&r,&r,&r,?w,?w")
+ (ior:DI (match_operand:DI 1 "s_register_operand" "%w,0 ,0 ,r ,0 ,r ,w ,0")
+ (match_operand:DI 2 "arm_iordi_operand_neon" "w ,Dl,r ,r ,Df,Df,w ,Dl")))]
+ "TARGET_32BIT && !TARGET_IWMMXT"
+ {
+ switch (which_alternative)
+ {
+ case 0: /* fall through */
+ case 6: return "vorr\t%P0, %P1, %P2";
+ case 1: /* fall through */
+ case 7: return neon_output_logic_immediate ("vorr", &operands[2],
+ DImode, 0, VALID_NEON_QREG_MODE (DImode));
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ return "#";
+ default: gcc_unreachable ();
+ }
+ }
+ "TARGET_32BIT && !TARGET_IWMMXT && reload_completed
+ && !(IS_VFP_REGNUM (REGNO (operands[0])))"
+ [(set (match_dup 3) (match_dup 4))
+ (set (match_dup 5) (match_dup 6))]
+ "
+ {
+ operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_highpart (SImode, operands[0]);
+
+ operands[4] = simplify_gen_binary (IOR, SImode,
+ gen_lowpart (SImode, operands[1]),
+ gen_lowpart (SImode, operands[2]));
+ operands[6] = simplify_gen_binary (IOR, SImode,
+ gen_highpart (SImode, operands[1]),
+ gen_highpart_mode (SImode, DImode, operands[2]));
+
+ }"
+ [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*,*,*,neon_int_1,neon_int_1")
+ (set_attr "length" "*,*,8,8,8,8,*,*")
+ (set_attr "arch" "neon_for_64bits,neon_for_64bits,*,*,*,*,avoid_neon_for_64bits,avoid_neon_for_64bits")]
)
(define_insn "*iordi_zesidi_di"
@@ -3137,19 +3181,49 @@
(define_expand "xordi3"
[(set (match_operand:DI 0 "s_register_operand" "")
(xor:DI (match_operand:DI 1 "s_register_operand" "")
- (match_operand:DI 2 "s_register_operand" "")))]
+ (match_operand:DI 2 "arm_xordi_operand" "")))]
"TARGET_32BIT"
""
)
-(define_insn "*xordi3_insn"
- [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
- (xor:DI (match_operand:DI 1 "s_register_operand" "%0,r")
- (match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_32BIT && !TARGET_IWMMXT && !TARGET_NEON"
- "#"
- [(set_attr "length" "8")
- (set_attr "predicable" "yes")]
+(define_insn_and_split "*xordi3_insn"
+ [(set (match_operand:DI 0 "s_register_operand" "=w,&r,&r,&r,&r,?w")
+ (xor:DI (match_operand:DI 1 "s_register_operand" "w ,%0,r ,0 ,r ,w")
+ (match_operand:DI 2 "arm_xordi_operand" "w ,r ,r ,Dg,Dg,w")))]
+ "TARGET_32BIT && !TARGET_IWMMXT"
+{
+ switch (which_alternative)
+ {
+ case 1:
+ case 2:
+ case 3:
+ case 4: /* fall through */
+ return "#";
+ case 0: /* fall through */
+ case 5: return "veor\t%P0, %P1, %P2";
+ default: gcc_unreachable ();
+ }
+}
+ "TARGET_32BIT && !TARGET_IWMMXT && reload_completed
+ && !(IS_VFP_REGNUM (REGNO (operands[0])))"
+ [(set (match_dup 3) (match_dup 4))
+ (set (match_dup 5) (match_dup 6))]
+ "
+ {
+ operands[3] = gen_lowpart (SImode, operands[0]);
+ operands[5] = gen_highpart (SImode, operands[0]);
+
+ operands[4] = simplify_gen_binary (XOR, SImode,
+ gen_lowpart (SImode, operands[1]),
+ gen_lowpart (SImode, operands[2]));
+ operands[6] = simplify_gen_binary (XOR, SImode,
+ gen_highpart (SImode, operands[1]),
+ gen_highpart_mode (SImode, DImode, operands[2]));
+
+ }"
+ [(set_attr "length" "*,8,8,8,8,*")
+ (set_attr "neon_type" "neon_int_1,*,*,*,*,neon_int_1")
+ (set_attr "arch" "neon_for_64bits,*,*,*,*,avoid_neon_for_64bits")]
)
(define_insn "*xordi_zesidi_di"
@@ -12097,6 +12171,7 @@
(const_int 0)])]
"TARGET_32BIT"
""
+[(set_attr "predicated" "yes")]
)
(define_insn "force_register_use"
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index afb42421c06..b9ae2b09682 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -239,6 +239,10 @@ mword-relocations
Target Report Var(target_word_relocations) Init(TARGET_DEFAULT_WORD_RELOCATIONS)
Only generate absolute relocations on word sized values.
+mrestrict-it
+Target Report Var(arm_restrict_it) Init(2)
+Generate IT blocks appropriate for ARMv8.
+
mfix-cortex-m3-ldrd
Target Report Var(fix_cm3_ldrd) Init(2)
Avoid overlapping destination and address registers on LDRD instructions
diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
index 7e7b3e69e0a..7cd8e31c97f 100644
--- a/gcc/config/arm/constraints.md
+++ b/gcc/config/arm/constraints.md
@@ -260,6 +260,18 @@
(and (match_code "const_int")
(match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, AND)")))
+(define_constraint "Df"
+ "@internal
+ In ARM/Thumb-2 state a const_int that can be used by insn iordi."
+ (and (match_code "const_int")
+ (match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, IOR)")))
+
+(define_constraint "Dg"
+ "@internal
+ In ARM/Thumb-2 state a const_int that can be used by insn xordi."
+ (and (match_code "const_int")
+ (match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, XOR)")))
+
(define_constraint "Di"
"@internal
In ARM/Thumb-2 state a const_int or const_double where both the high
diff --git a/gcc/config/arm/ldmstm.md b/gcc/config/arm/ldmstm.md
index 8ebdfc81761..ad137d492e4 100644
--- a/gcc/config/arm/ldmstm.md
+++ b/gcc/config/arm/ldmstm.md
@@ -37,7 +37,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"ldm%(ia%)\t%5, {%1, %2, %3, %4}"
[(set_attr "type" "load4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm4_ia"
[(match_parallel 0 "load_multiple_operation"
@@ -74,7 +75,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 5"
"ldm%(ia%)\t%5!, {%1, %2, %3, %4}"
[(set_attr "type" "load4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm4_ia_update"
[(match_parallel 0 "load_multiple_operation"
@@ -108,7 +110,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"stm%(ia%)\t%5, {%1, %2, %3, %4}"
[(set_attr "type" "store4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm4_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -125,7 +128,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 5"
"stm%(ia%)\t%5!, {%1, %2, %3, %4}"
[(set_attr "type" "store4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_stm4_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -302,7 +306,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"ldm%(db%)\t%5, {%1, %2, %3, %4}"
[(set_attr "type" "load4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*ldm4_db_update"
[(match_parallel 0 "load_multiple_operation"
@@ -323,7 +328,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 5"
"ldm%(db%)\t%5!, {%1, %2, %3, %4}"
[(set_attr "type" "load4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm4_db"
[(match_parallel 0 "store_multiple_operation"
@@ -338,7 +344,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"stm%(db%)\t%5, {%1, %2, %3, %4}"
[(set_attr "type" "store4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm4_db_update"
[(match_parallel 0 "store_multiple_operation"
@@ -355,7 +362,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 5"
"stm%(db%)\t%5!, {%1, %2, %3, %4}"
[(set_attr "type" "store4")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_peephole2
[(set (match_operand:SI 0 "s_register_operand" "")
@@ -477,7 +485,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"ldm%(ia%)\t%4, {%1, %2, %3}"
[(set_attr "type" "load3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm3_ia"
[(match_parallel 0 "load_multiple_operation"
@@ -508,7 +517,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"ldm%(ia%)\t%4!, {%1, %2, %3}"
[(set_attr "type" "load3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm3_ia_update"
[(match_parallel 0 "load_multiple_operation"
@@ -537,7 +547,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"stm%(ia%)\t%4, {%1, %2, %3}"
[(set_attr "type" "store3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm3_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -552,7 +563,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"stm%(ia%)\t%4!, {%1, %2, %3}"
[(set_attr "type" "store3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_stm3_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -704,7 +716,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"ldm%(db%)\t%4, {%1, %2, %3}"
[(set_attr "type" "load3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*ldm3_db_update"
[(match_parallel 0 "load_multiple_operation"
@@ -722,7 +735,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"ldm%(db%)\t%4!, {%1, %2, %3}"
[(set_attr "type" "load3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm3_db"
[(match_parallel 0 "store_multiple_operation"
@@ -735,7 +749,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"stm%(db%)\t%4, {%1, %2, %3}"
[(set_attr "type" "store3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm3_db_update"
[(match_parallel 0 "store_multiple_operation"
@@ -750,7 +765,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 4"
"stm%(db%)\t%4!, {%1, %2, %3}"
[(set_attr "type" "store3")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_peephole2
[(set (match_operand:SI 0 "s_register_operand" "")
@@ -855,7 +871,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 2"
"ldm%(ia%)\t%3, {%1, %2}"
[(set_attr "type" "load2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm2_ia"
[(match_parallel 0 "load_multiple_operation"
@@ -880,7 +897,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"ldm%(ia%)\t%3!, {%1, %2}"
[(set_attr "type" "load2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_ldm2_ia_update"
[(match_parallel 0 "load_multiple_operation"
@@ -904,7 +922,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 2"
"stm%(ia%)\t%3, {%1, %2}"
[(set_attr "type" "store2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm2_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -917,7 +936,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"stm%(ia%)\t%3!, {%1, %2}"
[(set_attr "type" "store2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*thumb_stm2_ia_update"
[(match_parallel 0 "store_multiple_operation"
@@ -1044,7 +1064,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 2"
"ldm%(db%)\t%3, {%1, %2}"
[(set_attr "type" "load2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*ldm2_db_update"
[(match_parallel 0 "load_multiple_operation"
@@ -1059,7 +1080,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"ldm%(db%)\t%3!, {%1, %2}"
[(set_attr "type" "load2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm2_db"
[(match_parallel 0 "store_multiple_operation"
@@ -1070,7 +1092,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 2"
"stm%(db%)\t%3, {%1, %2}"
[(set_attr "type" "store2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "*stm2_db_update"
[(match_parallel 0 "store_multiple_operation"
@@ -1083,7 +1106,8 @@
"TARGET_32BIT && XVECLEN (operands[0], 0) == 3"
"stm%(db%)\t%3!, {%1, %2}"
[(set_attr "type" "store2")
- (set_attr "predicable" "yes")])
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_peephole2
[(set (match_operand:SI 0 "s_register_operand" "")
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index f91a6f7d08b..e814df0d264 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -679,29 +679,6 @@
[(set_attr "neon_type" "neon_int_1")]
)
-(define_insn "iordi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r,?w,?w")
- (ior:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r,w,0")
- (match_operand:DI 2 "neon_logic_op2" "w,Dl,r,r,w,Dl")))]
- "TARGET_NEON"
-{
- switch (which_alternative)
- {
- case 0: /* fall through */
- case 4: return "vorr\t%P0, %P1, %P2";
- case 1: /* fall through */
- case 5: return neon_output_logic_immediate ("vorr", &operands[2],
- DImode, 0, VALID_NEON_QREG_MODE (DImode));
- case 2: return "#";
- case 3: return "#";
- default: gcc_unreachable ();
- }
-}
- [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*,neon_int_1,neon_int_1")
- (set_attr "length" "*,*,8,8,*,*")
- (set_attr "arch" "neon_for_64bits,neon_for_64bits,*,*,avoid_neon_for_64bits,avoid_neon_for_64bits")]
-)
-
;; The concrete forms of the Neon immediate-logic instructions are vbic and
;; vorr. We support the pseudo-instruction vand instead, because that
;; corresponds to the canonical form the middle-end expects to use for
@@ -805,21 +782,6 @@
[(set_attr "neon_type" "neon_int_1")]
)
-(define_insn "xordi3_neon"
- [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r,?w")
- (xor:DI (match_operand:DI 1 "s_register_operand" "%w,0,r,w")
- (match_operand:DI 2 "s_register_operand" "w,r,r,w")))]
- "TARGET_NEON"
- "@
- veor\t%P0, %P1, %P2
- #
- #
- veor\t%P0, %P1, %P2"
- [(set_attr "neon_type" "neon_int_1,*,*,neon_int_1")
- (set_attr "length" "*,8,8,*")
- (set_attr "arch" "neon_for_64bits,*,*,avoid_neon_for_64bits")]
-)
-
(define_insn "one_cmpl<mode>2"
[(set (match_operand:VDQ 0 "s_register_operand" "=w")
(not:VDQ (match_operand:VDQ 1 "s_register_operand" "w")))]
@@ -5617,7 +5579,7 @@
(match_operand:SI 3 "immediate_operand" "")]
"TARGET_NEON"
{
- emit_insn (gen_ior<mode>3<V_suf64> (operands[0], operands[1], operands[2]));
+ emit_insn (gen_ior<mode>3 (operands[0], operands[1], operands[2]));
DONE;
})
@@ -5628,7 +5590,7 @@
(match_operand:SI 3 "immediate_operand" "")]
"TARGET_NEON"
{
- emit_insn (gen_xor<mode>3<V_suf64> (operands[0], operands[1], operands[2]));
+ emit_insn (gen_xor<mode>3 (operands[0], operands[1], operands[2]));
DONE;
})
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index 92de9fe8bd9..d169cb27035 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -42,6 +42,17 @@
(ior (match_operand 0 "imm_for_neon_inv_logic_operand")
(match_operand 0 "s_register_operand")))
+(define_predicate "imm_for_neon_logic_operand"
+ (match_code "const_vector")
+{
+ return (TARGET_NEON
+ && neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
+})
+
+(define_predicate "neon_logic_op2"
+ (ior (match_operand 0 "imm_for_neon_logic_operand")
+ (match_operand 0 "s_register_operand")))
+
;; Any hard register.
(define_predicate "arm_hard_register_operand"
(match_code "reg")
@@ -162,6 +173,17 @@
(match_test "const_ok_for_dimode_op (INTVAL (op), AND)"))
(match_operand 0 "neon_inv_logic_op2")))
+(define_predicate "arm_iordi_operand_neon"
+ (ior (match_operand 0 "s_register_operand")
+ (and (match_code "const_int")
+ (match_test "const_ok_for_dimode_op (INTVAL (op), IOR)"))
+ (match_operand 0 "neon_logic_op2")))
+
+(define_predicate "arm_xordi_operand"
+ (ior (match_operand 0 "s_register_operand")
+ (and (match_code "const_int")
+ (match_test "const_ok_for_dimode_op (INTVAL (op), XOR)"))))
+
(define_predicate "arm_adddi_operand"
(ior (match_operand 0 "s_register_operand")
(and (match_code "const_int")
@@ -535,17 +557,6 @@
(ior (match_operand 0 "s_register_operand")
(match_operand 0 "imm_for_neon_rshift_operand")))
-(define_predicate "imm_for_neon_logic_operand"
- (match_code "const_vector")
-{
- return (TARGET_NEON
- && neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
-})
-
-(define_predicate "neon_logic_op2"
- (ior (match_operand 0 "imm_for_neon_logic_operand")
- (match_operand 0 "s_register_operand")))
-
;; Predicates for named expanders that overlap multiple ISAs.
(define_predicate "cmpdi_operand"
diff --git a/gcc/config/arm/sync.md b/gcc/config/arm/sync.md
index 980234836c9..8f7bd71c317 100644
--- a/gcc/config/arm/sync.md
+++ b/gcc/config/arm/sync.md
@@ -124,7 +124,8 @@
UNSPEC_LL))]
"TARGET_HAVE_LDREXD && ARM_DOUBLEWORD_ALIGN"
"ldrexd%?\t%0, %H0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_expand "atomic_compare_and_swap<mode>"
[(match_operand:SI 0 "s_register_operand" "") ;; bool out
@@ -361,7 +362,8 @@
VUNSPEC_LL)))]
"TARGET_HAVE_LDREXBH"
"ldrex<sync_sfx>%?\t%0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_load_acquire_exclusive<mode>"
[(set (match_operand:SI 0 "s_register_operand" "=r")
@@ -371,7 +373,8 @@
VUNSPEC_LAX)))]
"TARGET_HAVE_LDACQ"
"ldaex<sync_sfx>%?\\t%0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_load_exclusivesi"
[(set (match_operand:SI 0 "s_register_operand" "=r")
@@ -380,7 +383,8 @@
VUNSPEC_LL))]
"TARGET_HAVE_LDREX"
"ldrex%?\t%0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_load_acquire_exclusivesi"
[(set (match_operand:SI 0 "s_register_operand" "=r")
@@ -389,7 +393,8 @@
VUNSPEC_LAX))]
"TARGET_HAVE_LDACQ"
"ldaex%?\t%0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_load_exclusivedi"
[(set (match_operand:DI 0 "s_register_operand" "=r")
@@ -398,7 +403,8 @@
VUNSPEC_LL))]
"TARGET_HAVE_LDREXD"
"ldrexd%?\t%0, %H0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_load_acquire_exclusivedi"
[(set (match_operand:DI 0 "s_register_operand" "=r")
@@ -407,7 +413,8 @@
VUNSPEC_LAX))]
"TARGET_HAVE_LDACQ && ARM_DOUBLEWORD_ALIGN"
"ldaexd%?\t%0, %H0, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_store_exclusive<mode>"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
@@ -431,7 +438,8 @@
}
return "strex<sync_sfx>%?\t%0, %2, %C1";
}
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_store_release_exclusivedi"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
@@ -448,7 +456,8 @@
operands[3] = gen_rtx_REG (SImode, REGNO (value) + 1);
return "stlexd%?\t%0, %2, %3, %C1";
}
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
(define_insn "arm_store_release_exclusive<mode>"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
@@ -459,4 +468,5 @@
VUNSPEC_SLX))]
"TARGET_HAVE_LDACQ"
"stlex<sync_sfx>%?\t%0, %2, %C1"
- [(set_attr "predicable" "yes")])
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
diff --git a/gcc/config/c6x/c6x.h b/gcc/config/c6x/c6x.h
index ce331cbe363..c30a9718e76 100644
--- a/gcc/config/c6x/c6x.h
+++ b/gcc/config/c6x/c6x.h
@@ -134,7 +134,7 @@ extern c6x_cpu_t c6x_arch;
Really only externally visible arrays must be aligned this way, as
only those are directly visible from another compilation unit. But
we don't have that information available here. */
-#define DATA_ALIGNMENT(TYPE, ALIGN) \
+#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) \
(((ALIGN) < BITS_PER_UNIT * 8 && TREE_CODE (TYPE) == ARRAY_TYPE) \
? BITS_PER_UNIT * 8 : (ALIGN))
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index ef4dc761d5a..f228e87a2e4 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -207,7 +207,7 @@ extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern int ix86_data_alignment (tree, int);
+extern int ix86_data_alignment (tree, int, bool);
extern unsigned int ix86_local_alignment (tree, enum machine_mode,
unsigned int);
extern unsigned int ix86_minimum_alignment (tree, enum machine_mode,
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e8f47c9d417..45e88996ad2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2108,7 +2108,12 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
/* X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE: Try to avoid memory operands for
a conditional move. */
- m_ATOM
+ m_ATOM,
+
+ /* X86_TUNE_SPLIT_MEM_OPND_FOR_FP_CONVERTS: Try to split memory operand for
+ fp converts to destination register. */
+ m_SLM
+
};
/* Feature tests against the various architecture variations. */
@@ -17392,10 +17397,24 @@ distance_agu_use (unsigned int regno0, rtx insn)
static bool
ix86_lea_outperforms (rtx insn, unsigned int regno0, unsigned int regno1,
- unsigned int regno2, int split_cost)
+ unsigned int regno2, int split_cost, bool has_scale)
{
int dist_define, dist_use;
+ /* For Silvermont if using a 2-source or 3-source LEA for
+ non-destructive destination purposes, or due to wanting
+ ability to use SCALE, the use of LEA is justified. */
+ if (ix86_tune == PROCESSOR_SLM)
+ {
+ if (has_scale)
+ return true;
+ if (split_cost < 1)
+ return false;
+ if (regno0 == regno1 || regno0 == regno2)
+ return false;
+ return true;
+ }
+
dist_define = distance_non_agu_define (regno1, regno2, insn);
dist_use = distance_agu_use (regno0, insn);
@@ -17484,7 +17503,7 @@ ix86_avoid_lea_for_add (rtx insn, rtx operands[])
if (regno0 == regno1 || regno0 == regno2)
return false;
else
- return !ix86_lea_outperforms (insn, regno0, regno1, regno2, 1);
+ return !ix86_lea_outperforms (insn, regno0, regno1, regno2, 1, false);
}
/* Return true if we should emit lea instruction instead of mov
@@ -17506,7 +17525,7 @@ ix86_use_lea_for_mov (rtx insn, rtx operands[])
regno0 = true_regnum (operands[0]);
regno1 = true_regnum (operands[1]);
- return ix86_lea_outperforms (insn, regno0, regno1, INVALID_REGNUM, 0);
+ return ix86_lea_outperforms (insn, regno0, regno1, INVALID_REGNUM, 0, false);
}
/* Return true if we need to split lea into a sequence of
@@ -17585,7 +17604,8 @@ ix86_avoid_lea_for_addr (rtx insn, rtx operands[])
split_cost -= 1;
}
- return !ix86_lea_outperforms (insn, regno0, regno1, regno2, split_cost);
+ return !ix86_lea_outperforms (insn, regno0, regno1, regno2, split_cost,
+ parts.scale > 1);
}
/* Emit x86 binary operand CODE in mode MODE, where the first operand
@@ -17770,7 +17790,7 @@ ix86_lea_for_add_ok (rtx insn, rtx operands[])
if (!TARGET_OPT_AGU || optimize_function_for_size_p (cfun))
return false;
- return ix86_lea_outperforms (insn, regno0, regno1, regno2, 0);
+ return ix86_lea_outperforms (insn, regno0, regno1, regno2, 0, false);
}
/* Return true if destination reg of SET_BODY is shift count of
@@ -24368,6 +24388,73 @@ ix86_agi_dependent (rtx set_insn, rtx use_insn)
return false;
}
+/* Helper function for exact_store_load_dependency.
+ Return true if addr is found in insn. */
+static bool
+exact_dependency_1 (rtx addr, rtx insn)
+{
+ enum rtx_code code;
+ const char *format_ptr;
+ int i, j;
+
+ code = GET_CODE (insn);
+ switch (code)
+ {
+ case MEM:
+ if (rtx_equal_p (addr, insn))
+ return true;
+ break;
+ case REG:
+ CASE_CONST_ANY:
+ case SYMBOL_REF:
+ case CODE_LABEL:
+ case PC:
+ case CC0:
+ case EXPR_LIST:
+ return false;
+ default:
+ break;
+ }
+
+ format_ptr = GET_RTX_FORMAT (code);
+ for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ {
+ switch (*format_ptr++)
+ {
+ case 'e':
+ if (exact_dependency_1 (addr, XEXP (insn, i)))
+ return true;
+ break;
+ case 'E':
+ for (j = 0; j < XVECLEN (insn, i); j++)
+ if (exact_dependency_1 (addr, XVECEXP (insn, i, j)))
+ return true;
+ break;
+ }
+ }
+ return false;
+}
+
+/* Return true if there exists exact dependency for store & load, i.e.
+ the same memory address is used in them. */
+static bool
+exact_store_load_dependency (rtx store, rtx load)
+{
+ rtx set1, set2;
+
+ set1 = single_set (store);
+ if (!set1)
+ return false;
+ if (!MEM_P (SET_DEST (set1)))
+ return false;
+ set2 = single_set (load);
+ if (!set2)
+ return false;
+ if (exact_dependency_1 (SET_DEST (set1), SET_SRC (set2)))
+ return true;
+ return false;
+}
+
static int
ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
@@ -24519,6 +24606,39 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
else
cost = 0;
}
+ break;
+
+ case PROCESSOR_SLM:
+ if (!reload_completed)
+ return cost;
+
+ /* Increase cost of integer loads. */
+ memory = get_attr_memory (dep_insn);
+ if (memory == MEMORY_LOAD || memory == MEMORY_BOTH)
+ {
+ enum attr_unit unit = get_attr_unit (dep_insn);
+ if (unit == UNIT_INTEGER && cost == 1)
+ {
+ if (memory == MEMORY_LOAD)
+ cost = 3;
+ else
+ {
+ /* Increase cost of ld/st for short int types only
+ because of store forwarding issue. */
+ rtx set = single_set (dep_insn);
+ if (set && (GET_MODE (SET_DEST (set)) == QImode
+ || GET_MODE (SET_DEST (set)) == HImode))
+ {
+ /* Increase cost of store/load insn if exact
+ dependence exists and it is load insn. */
+ enum attr_memory insn_memory = get_attr_memory (insn);
+ if (insn_memory == MEMORY_LOAD
+ && exact_store_load_dependency (dep_insn, insn))
+ cost = 3;
+ }
+ }
+ }
+ }
default:
break;
@@ -24565,110 +24685,204 @@ ia32_multipass_dfa_lookahead (void)
execution. It is applied if
(1) IMUL instruction is on the top of list;
(2) There exists the only producer of independent IMUL instruction in
- ready list;
- (3) Put found producer on the top of ready list.
- Returns issue rate. */
-
+ ready list.
+ Return index of IMUL producer if it was found and -1 otherwise. */
static int
-ix86_sched_reorder(FILE *dump, int sched_verbose, rtx *ready, int *pn_ready,
- int clock_var ATTRIBUTE_UNUSED)
+do_reorder_for_imul (rtx *ready, int n_ready)
{
- static int issue_rate = -1;
- int n_ready = *pn_ready;
- rtx insn, insn1, insn2;
- int i;
+ rtx insn, set, insn1, insn2;
sd_iterator_def sd_it;
dep_t dep;
int index = -1;
+ int i;
- /* Set up issue rate. */
- issue_rate = ix86_issue_rate();
-
- /* Do reodering for Atom only. */
if (ix86_tune != PROCESSOR_ATOM)
- return issue_rate;
- /* Do not perform ready list reodering for pre-reload schedule pass. */
- if (!reload_completed)
- return issue_rate;
- /* Nothing to do if ready list contains only 1 instruction. */
- if (n_ready <= 1)
- return issue_rate;
+ return index;
/* Check that IMUL instruction is on the top of ready list. */
insn = ready[n_ready - 1];
- if (!NONDEBUG_INSN_P (insn))
- return issue_rate;
- insn = PATTERN (insn);
- if (GET_CODE (insn) == PARALLEL)
- insn = XVECEXP (insn, 0, 0);
- if (GET_CODE (insn) != SET)
- return issue_rate;
- if (!(GET_CODE (SET_SRC (insn)) == MULT
- && GET_MODE (SET_SRC (insn)) == SImode))
- return issue_rate;
+ set = single_set (insn);
+ if (!set)
+ return index;
+ if (!(GET_CODE (SET_SRC (set)) == MULT
+ && GET_MODE (SET_SRC (set)) == SImode))
+ return index;
/* Search for producer of independent IMUL instruction. */
- for (i = n_ready - 2; i>= 0; i--)
+ for (i = n_ready - 2; i >= 0; i--)
{
insn = ready[i];
if (!NONDEBUG_INSN_P (insn))
- continue;
+ continue;
/* Skip IMUL instruction. */
insn2 = PATTERN (insn);
if (GET_CODE (insn2) == PARALLEL)
- insn2 = XVECEXP (insn2, 0, 0);
+ insn2 = XVECEXP (insn2, 0, 0);
if (GET_CODE (insn2) == SET
- && GET_CODE (SET_SRC (insn2)) == MULT
- && GET_MODE (SET_SRC (insn2)) == SImode)
- continue;
+ && GET_CODE (SET_SRC (insn2)) == MULT
+ && GET_MODE (SET_SRC (insn2)) == SImode)
+ continue;
FOR_EACH_DEP (insn, SD_LIST_FORW, sd_it, dep)
- {
- rtx con;
+ {
+ rtx con;
con = DEP_CON (dep);
if (!NONDEBUG_INSN_P (con))
continue;
- insn1 = PATTERN (con);
- if (GET_CODE (insn1) == PARALLEL)
- insn1 = XVECEXP (insn1, 0, 0);
-
- if (GET_CODE (insn1) == SET
- && GET_CODE (SET_SRC (insn1)) == MULT
- && GET_MODE (SET_SRC (insn1)) == SImode)
- {
- sd_iterator_def sd_it1;
- dep_t dep1;
- /* Check if there is no other dependee for IMUL. */
- index = i;
- FOR_EACH_DEP (con, SD_LIST_BACK, sd_it1, dep1)
- {
- rtx pro;
- pro = DEP_PRO (dep1);
+ insn1 = PATTERN (con);
+ if (GET_CODE (insn1) == PARALLEL)
+ insn1 = XVECEXP (insn1, 0, 0);
+
+ if (GET_CODE (insn1) == SET
+ && GET_CODE (SET_SRC (insn1)) == MULT
+ && GET_MODE (SET_SRC (insn1)) == SImode)
+ {
+ sd_iterator_def sd_it1;
+ dep_t dep1;
+ /* Check if there is no other dependee for IMUL. */
+ index = i;
+ FOR_EACH_DEP (con, SD_LIST_BACK, sd_it1, dep1)
+ {
+ rtx pro;
+ pro = DEP_PRO (dep1);
if (!NONDEBUG_INSN_P (pro))
continue;
- if (pro != insn)
- index = -1;
- }
- if (index >= 0)
- break;
- }
- }
+ if (pro != insn)
+ index = -1;
+ }
+ if (index >= 0)
+ break;
+ }
+ }
if (index >= 0)
- break;
+ break;
}
- if (index < 0)
- return issue_rate; /* Didn't find IMUL producer. */
+ return index;
+}
- if (sched_verbose > 1)
- fprintf(dump, ";;\tatom sched_reorder: swap %d and %d insns\n",
- INSN_UID (ready[index]), INSN_UID (ready[n_ready - 1]));
+/* Try to find the best candidate on the top of ready list if two insns
+ have the same priority - candidate is best if its dependees were
+ scheduled earlier. Applied for Silvermont only.
+ Return true if top 2 insns must be interchanged. */
+static bool
+swap_top_of_ready_list (rtx *ready, int n_ready)
+{
+ rtx top = ready[n_ready - 1];
+ rtx next = ready[n_ready - 2];
+ rtx set;
+ sd_iterator_def sd_it;
+ dep_t dep;
+ int clock1 = -1;
+ int clock2 = -1;
+ #define INSN_TICK(INSN) (HID (INSN)->tick)
- /* Put IMUL producer (ready[index]) at the top of ready list. */
- insn1= ready[index];
- for (i = index; i < n_ready - 1; i++)
- ready[i] = ready[i + 1];
- ready[n_ready - 1] = insn1;
+ if (ix86_tune != PROCESSOR_SLM)
+ return false;
+
+ if (!NONDEBUG_INSN_P (top))
+ return false;
+ if (!NONJUMP_INSN_P (top))
+ return false;
+ if (!NONDEBUG_INSN_P (next))
+ return false;
+ if (!NONJUMP_INSN_P (next))
+ return false;
+ set = single_set (top);
+ if (!set)
+ return false;
+ set = single_set (next);
+ if (!set)
+ return false;
+ if (INSN_PRIORITY_KNOWN (top) && INSN_PRIORITY_KNOWN (next))
+ {
+ if (INSN_PRIORITY (top) != INSN_PRIORITY (next))
+ return false;
+ /* Determine winner more precise. */
+ FOR_EACH_DEP (top, SD_LIST_RES_BACK, sd_it, dep)
+ {
+ rtx pro;
+ pro = DEP_PRO (dep);
+ if (!NONDEBUG_INSN_P (pro))
+ continue;
+ if (INSN_TICK (pro) > clock1)
+ clock1 = INSN_TICK (pro);
+ }
+ FOR_EACH_DEP (next, SD_LIST_RES_BACK, sd_it, dep)
+ {
+ rtx pro;
+ pro = DEP_PRO (dep);
+ if (!NONDEBUG_INSN_P (pro))
+ continue;
+ if (INSN_TICK (pro) > clock2)
+ clock2 = INSN_TICK (pro);
+ }
+
+ if (clock1 == clock2)
+ {
+ /* Determine winner - load must win. */
+ enum attr_memory memory1, memory2;
+ memory1 = get_attr_memory (top);
+ memory2 = get_attr_memory (next);
+ if (memory2 == MEMORY_LOAD && memory1 != MEMORY_LOAD)
+ return true;
+ }
+ return (bool) (clock2 < clock1);
+ }
+ return false;
+ #undef INSN_TICK
+}
+
+/* Perform possible reodering of ready list for Atom/Silvermont only.
+ Return issue rate. */
+static int
+ix86_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, int *pn_ready,
+ int clock_var)
+{
+ int issue_rate = -1;
+ int n_ready = *pn_ready;
+ int i;
+ rtx insn;
+ int index = -1;
+
+ /* Set up issue rate. */
+ issue_rate = ix86_issue_rate ();
+
+ /* Do reodering for Atom/SLM only. */
+ if (ix86_tune != PROCESSOR_ATOM && ix86_tune != PROCESSOR_SLM)
+ return issue_rate;
+
+ /* Nothing to do if ready list contains only 1 instruction. */
+ if (n_ready <= 1)
+ return issue_rate;
+
+ /* Do reodering for post-reload scheduler only. */
+ if (!reload_completed)
+ return issue_rate;
+
+ if ((index = do_reorder_for_imul (ready, n_ready)) >= 0)
+ {
+ if (sched_verbose > 1)
+ fprintf (dump, ";;\tatom sched_reorder: put %d insn on top\n",
+ INSN_UID (ready[index]));
+
+ /* Put IMUL producer (ready[index]) at the top of ready list. */
+ insn = ready[index];
+ for (i = index; i < n_ready - 1; i++)
+ ready[i] = ready[i + 1];
+ ready[n_ready - 1] = insn;
+ return issue_rate;
+ }
+ if (clock_var != 0 && swap_top_of_ready_list (ready, n_ready))
+ {
+ if (sched_verbose > 1)
+ fprintf (dump, ";;\tslm sched_reorder: swap %d and %d insns\n",
+ INSN_UID (ready[n_ready - 1]), INSN_UID (ready[n_ready - 2]));
+ /* Swap 2 top elements of ready list. */
+ insn = ready[n_ready - 1];
+ ready[n_ready - 1] = ready[n_ready - 2];
+ ready[n_ready - 2] = insn;
+ }
return issue_rate;
}
@@ -25161,11 +25375,12 @@ ix86_constant_alignment (tree exp, int align)
instead of that alignment to align the object. */
int
-ix86_data_alignment (tree type, int align)
+ix86_data_alignment (tree type, int align, bool opt)
{
int max_align = optimize_size ? BITS_PER_WORD : MIN (256, MAX_OFILE_ALIGNMENT);
- if (AGGREGATE_TYPE_P (type)
+ if (opt
+ && AGGREGATE_TYPE_P (type)
&& TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= (unsigned) max_align
@@ -25177,14 +25392,17 @@ ix86_data_alignment (tree type, int align)
to 16byte boundary. */
if (TARGET_64BIT)
{
- if (AGGREGATE_TYPE_P (type)
- && TYPE_SIZE (type)
- && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128
- || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
+ if ((opt ? AGGREGATE_TYPE_P (type) : TREE_CODE (type) == ARRAY_TYPE)
+ && TYPE_SIZE (type)
+ && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+ && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128
+ || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
return 128;
}
+ if (!opt)
+ return align;
+
if (TREE_CODE (type) == ARRAY_TYPE)
{
if (TYPE_MODE (TREE_TYPE (type)) == DFmode && align < 64)
@@ -29834,11 +30052,11 @@ fold_builtin_cpu (tree fndecl, tree *args)
M_AMD,
M_CPU_TYPE_START,
M_INTEL_ATOM,
- M_INTEL_SLM,
M_INTEL_CORE2,
M_INTEL_COREI7,
M_AMDFAM10H,
M_AMDFAM15H,
+ M_INTEL_SLM,
M_CPU_SUBTYPE_START,
M_INTEL_COREI7_NEHALEM,
M_INTEL_COREI7_WESTMERE,
@@ -33737,6 +33955,8 @@ static inline bool
inline_secondary_memory_needed (enum reg_class class1, enum reg_class class2,
enum machine_mode mode, int strict)
{
+ if (lra_in_progress && (class1 == NO_REGS || class2 == NO_REGS))
+ return false;
if (MAYBE_FLOAT_CLASS_P (class1) != FLOAT_CLASS_P (class1)
|| MAYBE_FLOAT_CLASS_P (class2) != FLOAT_CLASS_P (class2)
|| MAYBE_SSE_CLASS_P (class1) != SSE_CLASS_P (class1)
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 776582a66de..7d940f98804 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -333,6 +333,7 @@ enum ix86_tune_indices {
X86_TUNE_REASSOC_FP_TO_PARALLEL,
X86_TUNE_GENERAL_REGS_SSE_SPILL,
X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE,
+ X86_TUNE_SPLIT_MEM_OPND_FOR_FP_CONVERTS,
X86_TUNE_LAST
};
@@ -443,6 +444,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
ix86_tune_features[X86_TUNE_GENERAL_REGS_SSE_SPILL]
#define TARGET_AVOID_MEM_OPND_FOR_CMOVE \
ix86_tune_features[X86_TUNE_AVOID_MEM_OPND_FOR_CMOVE]
+#define TARGET_SPLIT_MEM_OPND_FOR_FP_CONVERTS \
+ ix86_tune_features[X86_TUNE_SPLIT_MEM_OPND_FOR_FP_CONVERTS]
/* Feature tests against the various architecture variations. */
enum ix86_arch_indices {
@@ -856,7 +859,18 @@ enum target_cpu_default
cause character arrays to be word-aligned so that `strcpy' calls
that copy constants to character arrays can be done inline. */
-#define DATA_ALIGNMENT(TYPE, ALIGN) ix86_data_alignment ((TYPE), (ALIGN))
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+ ix86_data_alignment ((TYPE), (ALIGN), true)
+
+/* Similar to DATA_ALIGNMENT, but for the cases where the ABI mandates
+ some alignment increase, instead of optimization only purposes. E.g.
+ AMD x86-64 psABI says that variables with array type larger than 15 bytes
+ must be aligned to 16 byte boundaries.
+
+ If this macro is not defined, then ALIGN is used. */
+
+#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) \
+ ix86_data_alignment ((TYPE), (ALIGN), false)
/* If defined, a C expression to compute the alignment for a local
variable. TYPE is the data type, and ALIGN is the alignment that
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 28b0c78093a..e97a4570501 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3625,6 +3625,18 @@
CONST0_RTX (V4SFmode), operands[1]));
})
+;; It's more profitable to split and then extend in the same register.
+(define_peephole2
+ [(set (match_operand:DF 0 "register_operand")
+ (float_extend:DF
+ (match_operand:SF 1 "memory_operand")))]
+ "TARGET_SPLIT_MEM_OPND_FOR_FP_CONVERTS
+ && optimize_insn_for_speed_p ()
+ && SSE_REG_P (operands[0])"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 0) (float_extend:DF (match_dup 2)))]
+ "operands[2] = gen_rtx_REG (SFmode, REGNO (operands[0]));")
+
(define_insn "*extendsfdf2_mixed"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f,m,x")
(float_extend:DF
@@ -3766,6 +3778,18 @@
CONST0_RTX (V2DFmode), operands[1]));
})
+;; It's more profitable to split and then extend in the same register.
+(define_peephole2
+ [(set (match_operand:SF 0 "register_operand")
+ (float_truncate:SF
+ (match_operand:DF 1 "memory_operand")))]
+ "TARGET_SPLIT_MEM_OPND_FOR_FP_CONVERTS
+ && optimize_insn_for_speed_p ()
+ && SSE_REG_P (operands[0])"
+ [(set (match_dup 2) (match_dup 1))
+ (set (match_dup 0) (float_truncate:SF (match_dup 2)))]
+ "operands[2] = gen_rtx_REG (DFmode, REGNO (operands[0]));")
+
(define_expand "truncdfsf2_with_temp"
[(parallel [(set (match_operand:SF 0)
(float_truncate:SF (match_operand:DF 1)))
@@ -16567,6 +16591,7 @@
"(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
&& peep2_reg_dead_p (4, operands[0])
&& !reg_overlap_mentioned_p (operands[0], operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[2])
&& (<MODE>mode != QImode
|| immediate_operand (operands[2], QImode)
|| q_regs_operand (operands[2], QImode))
@@ -16631,6 +16656,7 @@
|| immediate_operand (operands[2], SImode)
|| q_regs_operand (operands[2], SImode))
&& !reg_overlap_mentioned_p (operands[0], operands[1])
+ && !reg_overlap_mentioned_p (operands[0], operands[2])
&& ix86_match_ccmode (peep2_next_insn (3),
(GET_CODE (operands[3]) == PLUS
|| GET_CODE (operands[3]) == MINUS)
diff --git a/gcc/config/mips/mips-cpus.def b/gcc/config/mips/mips-cpus.def
index f08fad6778d..d7db0ba96d6 100644
--- a/gcc/config/mips/mips-cpus.def
+++ b/gcc/config/mips/mips-cpus.def
@@ -68,6 +68,7 @@ MIPS_CPU ("r4600", PROCESSOR_R4600, 3, 0)
MIPS_CPU ("orion", PROCESSOR_R4600, 3, 0)
MIPS_CPU ("r4650", PROCESSOR_R4650, 3, 0)
MIPS_CPU ("r4700", PROCESSOR_R4700, 3, 0)
+MIPS_CPU ("r5900", PROCESSOR_R5900, 3, 0)
/* ST Loongson 2E/2F processors. */
MIPS_CPU ("loongson2e", PROCESSOR_LOONGSON_2E, 3, PTF_AVOID_BRANCHLIKELY)
MIPS_CPU ("loongson2f", PROCESSOR_LOONGSON_2F, 3, PTF_AVOID_BRANCHLIKELY)
diff --git a/gcc/config/mips/mips-dsp.md b/gcc/config/mips/mips-dsp.md
index 002c9992001..49a08689638 100644
--- a/gcc/config/mips/mips-dsp.md
+++ b/gcc/config/mips/mips-dsp.md
@@ -1131,8 +1131,7 @@
"ISA_HAS_L<SHORT:SIZE><U>X"
"l<SHORT:size><u>x\t%0,%2(%1)"
[(set_attr "type" "load")
- (set_attr "mode" "<GPR:MODE>")
- (set_attr "length" "4")])
+ (set_attr "mode" "<GPR:MODE>")])
(define_expand "mips_lhx"
[(match_operand:SI 0 "register_operand")
@@ -1165,8 +1164,7 @@
"ISA_HAS_L<GPR:SIZE>X"
"l<GPR:size>x\t%0,%2(%1)"
[(set_attr "type" "load")
- (set_attr "mode" "<GPR:MODE>")
- (set_attr "length" "4")])
+ (set_attr "mode" "<GPR:MODE>")])
(define_insn "*mips_lw<u>x_<P:mode>_ext"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -1176,8 +1174,7 @@
"ISA_HAS_LW<U>X && TARGET_64BIT"
"lw<u>x\t%0,%2(%1)"
[(set_attr "type" "load")
- (set_attr "mode" "DI")
- (set_attr "length" "4")])
+ (set_attr "mode" "DI")])
;; Table 2-8. MIPS DSP ASE Instructions: Branch
;; BPOSGE32
diff --git a/gcc/config/mips/mips-ps-3d.md b/gcc/config/mips/mips-ps-3d.md
index 9c70cc4324f..a22c7829b77 100644
--- a/gcc/config/mips/mips-ps-3d.md
+++ b/gcc/config/mips/mips-ps-3d.md
@@ -481,7 +481,7 @@
operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8);
}
[(set_attr "type" "fcmp")
- (set_attr "length" "8")
+ (set_attr "insn_count" "2")
(set_attr "mode" "FPSW")])
(define_insn_and_split "mips_cabs_cond_4s"
@@ -510,7 +510,7 @@
operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8);
}
[(set_attr "type" "fcmp")
- (set_attr "length" "8")
+ (set_attr "insn_count" "2")
(set_attr "mode" "FPSW")])
diff --git a/gcc/config/mips/mips-tables.opt b/gcc/config/mips/mips-tables.opt
index 0d7fa26510d..8ed412cc15e 100644
--- a/gcc/config/mips/mips-tables.opt
+++ b/gcc/config/mips/mips-tables.opt
@@ -208,425 +208,431 @@ EnumValue
Enum(mips_arch_opt_value) String(4700) Value(22)
EnumValue
-Enum(mips_arch_opt_value) String(loongson2e) Value(23) Canonical
+Enum(mips_arch_opt_value) String(r5900) Value(23) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(loongson2f) Value(24) Canonical
+Enum(mips_arch_opt_value) String(5900) Value(23)
EnumValue
-Enum(mips_arch_opt_value) String(r8000) Value(25) Canonical
+Enum(mips_arch_opt_value) String(loongson2e) Value(24) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r8k) Value(25)
+Enum(mips_arch_opt_value) String(loongson2f) Value(25) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(8000) Value(25)
+Enum(mips_arch_opt_value) String(r8000) Value(26) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(8k) Value(25)
+Enum(mips_arch_opt_value) String(r8k) Value(26)
EnumValue
-Enum(mips_arch_opt_value) String(r10000) Value(26) Canonical
+Enum(mips_arch_opt_value) String(8000) Value(26)
EnumValue
-Enum(mips_arch_opt_value) String(r10k) Value(26)
+Enum(mips_arch_opt_value) String(8k) Value(26)
EnumValue
-Enum(mips_arch_opt_value) String(10000) Value(26)
+Enum(mips_arch_opt_value) String(r10000) Value(27) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(10k) Value(26)
+Enum(mips_arch_opt_value) String(r10k) Value(27)
EnumValue
-Enum(mips_arch_opt_value) String(r12000) Value(27) Canonical
+Enum(mips_arch_opt_value) String(10000) Value(27)
EnumValue
-Enum(mips_arch_opt_value) String(r12k) Value(27)
+Enum(mips_arch_opt_value) String(10k) Value(27)
EnumValue
-Enum(mips_arch_opt_value) String(12000) Value(27)
+Enum(mips_arch_opt_value) String(r12000) Value(28) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(12k) Value(27)
+Enum(mips_arch_opt_value) String(r12k) Value(28)
EnumValue
-Enum(mips_arch_opt_value) String(r14000) Value(28) Canonical
+Enum(mips_arch_opt_value) String(12000) Value(28)
EnumValue
-Enum(mips_arch_opt_value) String(r14k) Value(28)
+Enum(mips_arch_opt_value) String(12k) Value(28)
EnumValue
-Enum(mips_arch_opt_value) String(14000) Value(28)
+Enum(mips_arch_opt_value) String(r14000) Value(29) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(14k) Value(28)
+Enum(mips_arch_opt_value) String(r14k) Value(29)
EnumValue
-Enum(mips_arch_opt_value) String(r16000) Value(29) Canonical
+Enum(mips_arch_opt_value) String(14000) Value(29)
EnumValue
-Enum(mips_arch_opt_value) String(r16k) Value(29)
+Enum(mips_arch_opt_value) String(14k) Value(29)
EnumValue
-Enum(mips_arch_opt_value) String(16000) Value(29)
+Enum(mips_arch_opt_value) String(r16000) Value(30) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(16k) Value(29)
+Enum(mips_arch_opt_value) String(r16k) Value(30)
EnumValue
-Enum(mips_arch_opt_value) String(vr5000) Value(30) Canonical
+Enum(mips_arch_opt_value) String(16000) Value(30)
EnumValue
-Enum(mips_arch_opt_value) String(vr5k) Value(30)
+Enum(mips_arch_opt_value) String(16k) Value(30)
EnumValue
-Enum(mips_arch_opt_value) String(5000) Value(30)
+Enum(mips_arch_opt_value) String(vr5000) Value(31) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(5k) Value(30)
+Enum(mips_arch_opt_value) String(vr5k) Value(31)
EnumValue
-Enum(mips_arch_opt_value) String(r5000) Value(30)
+Enum(mips_arch_opt_value) String(5000) Value(31)
EnumValue
-Enum(mips_arch_opt_value) String(r5k) Value(30)
+Enum(mips_arch_opt_value) String(5k) Value(31)
EnumValue
-Enum(mips_arch_opt_value) String(vr5400) Value(31) Canonical
+Enum(mips_arch_opt_value) String(r5000) Value(31)
EnumValue
-Enum(mips_arch_opt_value) String(5400) Value(31)
+Enum(mips_arch_opt_value) String(r5k) Value(31)
EnumValue
-Enum(mips_arch_opt_value) String(r5400) Value(31)
+Enum(mips_arch_opt_value) String(vr5400) Value(32) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(vr5500) Value(32) Canonical
+Enum(mips_arch_opt_value) String(5400) Value(32)
EnumValue
-Enum(mips_arch_opt_value) String(5500) Value(32)
+Enum(mips_arch_opt_value) String(r5400) Value(32)
EnumValue
-Enum(mips_arch_opt_value) String(r5500) Value(32)
+Enum(mips_arch_opt_value) String(vr5500) Value(33) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(rm7000) Value(33) Canonical
+Enum(mips_arch_opt_value) String(5500) Value(33)
EnumValue
-Enum(mips_arch_opt_value) String(rm7k) Value(33)
+Enum(mips_arch_opt_value) String(r5500) Value(33)
EnumValue
-Enum(mips_arch_opt_value) String(7000) Value(33)
+Enum(mips_arch_opt_value) String(rm7000) Value(34) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(7k) Value(33)
+Enum(mips_arch_opt_value) String(rm7k) Value(34)
EnumValue
-Enum(mips_arch_opt_value) String(r7000) Value(33)
+Enum(mips_arch_opt_value) String(7000) Value(34)
EnumValue
-Enum(mips_arch_opt_value) String(r7k) Value(33)
+Enum(mips_arch_opt_value) String(7k) Value(34)
EnumValue
-Enum(mips_arch_opt_value) String(rm9000) Value(34) Canonical
+Enum(mips_arch_opt_value) String(r7000) Value(34)
EnumValue
-Enum(mips_arch_opt_value) String(rm9k) Value(34)
+Enum(mips_arch_opt_value) String(r7k) Value(34)
EnumValue
-Enum(mips_arch_opt_value) String(9000) Value(34)
+Enum(mips_arch_opt_value) String(rm9000) Value(35) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(9k) Value(34)
+Enum(mips_arch_opt_value) String(rm9k) Value(35)
EnumValue
-Enum(mips_arch_opt_value) String(r9000) Value(34)
+Enum(mips_arch_opt_value) String(9000) Value(35)
EnumValue
-Enum(mips_arch_opt_value) String(r9k) Value(34)
+Enum(mips_arch_opt_value) String(9k) Value(35)
EnumValue
-Enum(mips_arch_opt_value) String(4kc) Value(35) Canonical
+Enum(mips_arch_opt_value) String(r9000) Value(35)
EnumValue
-Enum(mips_arch_opt_value) String(r4kc) Value(35)
+Enum(mips_arch_opt_value) String(r9k) Value(35)
EnumValue
-Enum(mips_arch_opt_value) String(4km) Value(36) Canonical
+Enum(mips_arch_opt_value) String(4kc) Value(36) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4km) Value(36)
+Enum(mips_arch_opt_value) String(r4kc) Value(36)
EnumValue
-Enum(mips_arch_opt_value) String(4kp) Value(37) Canonical
+Enum(mips_arch_opt_value) String(4km) Value(37) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4kp) Value(37)
+Enum(mips_arch_opt_value) String(r4km) Value(37)
EnumValue
-Enum(mips_arch_opt_value) String(4ksc) Value(38) Canonical
+Enum(mips_arch_opt_value) String(4kp) Value(38) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4ksc) Value(38)
+Enum(mips_arch_opt_value) String(r4kp) Value(38)
EnumValue
-Enum(mips_arch_opt_value) String(m4k) Value(39) Canonical
+Enum(mips_arch_opt_value) String(4ksc) Value(39) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(m14kc) Value(40) Canonical
+Enum(mips_arch_opt_value) String(r4ksc) Value(39)
EnumValue
-Enum(mips_arch_opt_value) String(m14k) Value(41) Canonical
+Enum(mips_arch_opt_value) String(m4k) Value(40) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(4kec) Value(42) Canonical
+Enum(mips_arch_opt_value) String(m14kc) Value(41) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4kec) Value(42)
+Enum(mips_arch_opt_value) String(m14k) Value(42) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(4kem) Value(43) Canonical
+Enum(mips_arch_opt_value) String(4kec) Value(43) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4kem) Value(43)
+Enum(mips_arch_opt_value) String(r4kec) Value(43)
EnumValue
-Enum(mips_arch_opt_value) String(4kep) Value(44) Canonical
+Enum(mips_arch_opt_value) String(4kem) Value(44) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4kep) Value(44)
+Enum(mips_arch_opt_value) String(r4kem) Value(44)
EnumValue
-Enum(mips_arch_opt_value) String(4ksd) Value(45) Canonical
+Enum(mips_arch_opt_value) String(4kep) Value(45) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r4ksd) Value(45)
+Enum(mips_arch_opt_value) String(r4kep) Value(45)
EnumValue
-Enum(mips_arch_opt_value) String(24kc) Value(46) Canonical
+Enum(mips_arch_opt_value) String(4ksd) Value(46) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kc) Value(46)
+Enum(mips_arch_opt_value) String(r4ksd) Value(46)
EnumValue
-Enum(mips_arch_opt_value) String(24kf2_1) Value(47) Canonical
+Enum(mips_arch_opt_value) String(24kc) Value(47) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kf2_1) Value(47)
+Enum(mips_arch_opt_value) String(r24kc) Value(47)
EnumValue
-Enum(mips_arch_opt_value) String(24kf) Value(48) Canonical
+Enum(mips_arch_opt_value) String(24kf2_1) Value(48) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kf) Value(48)
+Enum(mips_arch_opt_value) String(r24kf2_1) Value(48)
EnumValue
-Enum(mips_arch_opt_value) String(24kf1_1) Value(49) Canonical
+Enum(mips_arch_opt_value) String(24kf) Value(49) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kf1_1) Value(49)
+Enum(mips_arch_opt_value) String(r24kf) Value(49)
EnumValue
-Enum(mips_arch_opt_value) String(24kfx) Value(50) Canonical
+Enum(mips_arch_opt_value) String(24kf1_1) Value(50) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kfx) Value(50)
+Enum(mips_arch_opt_value) String(r24kf1_1) Value(50)
EnumValue
-Enum(mips_arch_opt_value) String(24kx) Value(51) Canonical
+Enum(mips_arch_opt_value) String(24kfx) Value(51) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kx) Value(51)
+Enum(mips_arch_opt_value) String(r24kfx) Value(51)
EnumValue
-Enum(mips_arch_opt_value) String(24kec) Value(52) Canonical
+Enum(mips_arch_opt_value) String(24kx) Value(52) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kec) Value(52)
+Enum(mips_arch_opt_value) String(r24kx) Value(52)
EnumValue
-Enum(mips_arch_opt_value) String(24kef2_1) Value(53) Canonical
+Enum(mips_arch_opt_value) String(24kec) Value(53) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kef2_1) Value(53)
+Enum(mips_arch_opt_value) String(r24kec) Value(53)
EnumValue
-Enum(mips_arch_opt_value) String(24kef) Value(54) Canonical
+Enum(mips_arch_opt_value) String(24kef2_1) Value(54) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kef) Value(54)
+Enum(mips_arch_opt_value) String(r24kef2_1) Value(54)
EnumValue
-Enum(mips_arch_opt_value) String(24kef1_1) Value(55) Canonical
+Enum(mips_arch_opt_value) String(24kef) Value(55) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kef1_1) Value(55)
+Enum(mips_arch_opt_value) String(r24kef) Value(55)
EnumValue
-Enum(mips_arch_opt_value) String(24kefx) Value(56) Canonical
+Enum(mips_arch_opt_value) String(24kef1_1) Value(56) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kefx) Value(56)
+Enum(mips_arch_opt_value) String(r24kef1_1) Value(56)
EnumValue
-Enum(mips_arch_opt_value) String(24kex) Value(57) Canonical
+Enum(mips_arch_opt_value) String(24kefx) Value(57) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r24kex) Value(57)
+Enum(mips_arch_opt_value) String(r24kefx) Value(57)
EnumValue
-Enum(mips_arch_opt_value) String(34kc) Value(58) Canonical
+Enum(mips_arch_opt_value) String(24kex) Value(58) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kc) Value(58)
+Enum(mips_arch_opt_value) String(r24kex) Value(58)
EnumValue
-Enum(mips_arch_opt_value) String(34kf2_1) Value(59) Canonical
+Enum(mips_arch_opt_value) String(34kc) Value(59) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kf2_1) Value(59)
+Enum(mips_arch_opt_value) String(r34kc) Value(59)
EnumValue
-Enum(mips_arch_opt_value) String(34kf) Value(60) Canonical
+Enum(mips_arch_opt_value) String(34kf2_1) Value(60) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kf) Value(60)
+Enum(mips_arch_opt_value) String(r34kf2_1) Value(60)
EnumValue
-Enum(mips_arch_opt_value) String(34kf1_1) Value(61) Canonical
+Enum(mips_arch_opt_value) String(34kf) Value(61) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kf1_1) Value(61)
+Enum(mips_arch_opt_value) String(r34kf) Value(61)
EnumValue
-Enum(mips_arch_opt_value) String(34kfx) Value(62) Canonical
+Enum(mips_arch_opt_value) String(34kf1_1) Value(62) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kfx) Value(62)
+Enum(mips_arch_opt_value) String(r34kf1_1) Value(62)
EnumValue
-Enum(mips_arch_opt_value) String(34kx) Value(63) Canonical
+Enum(mips_arch_opt_value) String(34kfx) Value(63) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kx) Value(63)
+Enum(mips_arch_opt_value) String(r34kfx) Value(63)
EnumValue
-Enum(mips_arch_opt_value) String(34kn) Value(64) Canonical
+Enum(mips_arch_opt_value) String(34kx) Value(64) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r34kn) Value(64)
+Enum(mips_arch_opt_value) String(r34kx) Value(64)
EnumValue
-Enum(mips_arch_opt_value) String(74kc) Value(65) Canonical
+Enum(mips_arch_opt_value) String(34kn) Value(65) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kc) Value(65)
+Enum(mips_arch_opt_value) String(r34kn) Value(65)
EnumValue
-Enum(mips_arch_opt_value) String(74kf2_1) Value(66) Canonical
+Enum(mips_arch_opt_value) String(74kc) Value(66) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kf2_1) Value(66)
+Enum(mips_arch_opt_value) String(r74kc) Value(66)
EnumValue
-Enum(mips_arch_opt_value) String(74kf) Value(67) Canonical
+Enum(mips_arch_opt_value) String(74kf2_1) Value(67) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kf) Value(67)
+Enum(mips_arch_opt_value) String(r74kf2_1) Value(67)
EnumValue
-Enum(mips_arch_opt_value) String(74kf1_1) Value(68) Canonical
+Enum(mips_arch_opt_value) String(74kf) Value(68) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kf1_1) Value(68)
+Enum(mips_arch_opt_value) String(r74kf) Value(68)
EnumValue
-Enum(mips_arch_opt_value) String(74kfx) Value(69) Canonical
+Enum(mips_arch_opt_value) String(74kf1_1) Value(69) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kfx) Value(69)
+Enum(mips_arch_opt_value) String(r74kf1_1) Value(69)
EnumValue
-Enum(mips_arch_opt_value) String(74kx) Value(70) Canonical
+Enum(mips_arch_opt_value) String(74kfx) Value(70) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kx) Value(70)
+Enum(mips_arch_opt_value) String(r74kfx) Value(70)
EnumValue
-Enum(mips_arch_opt_value) String(74kf3_2) Value(71) Canonical
+Enum(mips_arch_opt_value) String(74kx) Value(71) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r74kf3_2) Value(71)
+Enum(mips_arch_opt_value) String(r74kx) Value(71)
EnumValue
-Enum(mips_arch_opt_value) String(1004kc) Value(72) Canonical
+Enum(mips_arch_opt_value) String(74kf3_2) Value(72) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r1004kc) Value(72)
+Enum(mips_arch_opt_value) String(r74kf3_2) Value(72)
EnumValue
-Enum(mips_arch_opt_value) String(1004kf2_1) Value(73) Canonical
+Enum(mips_arch_opt_value) String(1004kc) Value(73) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r1004kf2_1) Value(73)
+Enum(mips_arch_opt_value) String(r1004kc) Value(73)
EnumValue
-Enum(mips_arch_opt_value) String(1004kf) Value(74) Canonical
+Enum(mips_arch_opt_value) String(1004kf2_1) Value(74) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r1004kf) Value(74)
+Enum(mips_arch_opt_value) String(r1004kf2_1) Value(74)
EnumValue
-Enum(mips_arch_opt_value) String(1004kf1_1) Value(75) Canonical
+Enum(mips_arch_opt_value) String(1004kf) Value(75) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r1004kf1_1) Value(75)
+Enum(mips_arch_opt_value) String(r1004kf) Value(75)
EnumValue
-Enum(mips_arch_opt_value) String(5kc) Value(76) Canonical
+Enum(mips_arch_opt_value) String(1004kf1_1) Value(76) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r5kc) Value(76)
+Enum(mips_arch_opt_value) String(r1004kf1_1) Value(76)
EnumValue
-Enum(mips_arch_opt_value) String(5kf) Value(77) Canonical
+Enum(mips_arch_opt_value) String(5kc) Value(77) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r5kf) Value(77)
+Enum(mips_arch_opt_value) String(r5kc) Value(77)
EnumValue
-Enum(mips_arch_opt_value) String(20kc) Value(78) Canonical
+Enum(mips_arch_opt_value) String(5kf) Value(78) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(r20kc) Value(78)
+Enum(mips_arch_opt_value) String(r5kf) Value(78)
EnumValue
-Enum(mips_arch_opt_value) String(sb1) Value(79) Canonical
+Enum(mips_arch_opt_value) String(20kc) Value(79) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(sb1a) Value(80) Canonical
+Enum(mips_arch_opt_value) String(r20kc) Value(79)
EnumValue
-Enum(mips_arch_opt_value) String(sr71000) Value(81) Canonical
+Enum(mips_arch_opt_value) String(sb1) Value(80) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(sr71k) Value(81)
+Enum(mips_arch_opt_value) String(sb1a) Value(81) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(xlr) Value(82) Canonical
+Enum(mips_arch_opt_value) String(sr71000) Value(82) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(loongson3a) Value(83) Canonical
+Enum(mips_arch_opt_value) String(sr71k) Value(82)
EnumValue
-Enum(mips_arch_opt_value) String(octeon) Value(84) Canonical
+Enum(mips_arch_opt_value) String(xlr) Value(83) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(octeon+) Value(85) Canonical
+Enum(mips_arch_opt_value) String(loongson3a) Value(84) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(octeon2) Value(86) Canonical
+Enum(mips_arch_opt_value) String(octeon) Value(85) Canonical
EnumValue
-Enum(mips_arch_opt_value) String(xlp) Value(87) Canonical
+Enum(mips_arch_opt_value) String(octeon+) Value(86) Canonical
+
+EnumValue
+Enum(mips_arch_opt_value) String(octeon2) Value(87) Canonical
+
+EnumValue
+Enum(mips_arch_opt_value) String(xlp) Value(88) Canonical
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 222c768b9b9..bd1d10b0e4e 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1029,6 +1029,19 @@ static const struct mips_rtx_cost_data
1, /* branch_cost */
4 /* memory_latency */
},
+ { /* R5900 */
+ COSTS_N_INSNS (4), /* fp_add */
+ COSTS_N_INSNS (4), /* fp_mult_sf */
+ COSTS_N_INSNS (256), /* fp_mult_df */
+ COSTS_N_INSNS (8), /* fp_div_sf */
+ COSTS_N_INSNS (256), /* fp_div_df */
+ COSTS_N_INSNS (4), /* int_mult_si */
+ COSTS_N_INSNS (256), /* int_mult_di */
+ COSTS_N_INSNS (37), /* int_div_si */
+ COSTS_N_INSNS (256), /* int_div_di */
+ 1, /* branch_cost */
+ 4 /* memory_latency */
+ },
{ /* R7000 */
/* The only costs that are changed here are
integer multiplication. */
@@ -12450,7 +12463,10 @@ mips_start_ll_sc_sync_block (void)
if (!ISA_HAS_LL_SC)
{
output_asm_insn (".set\tpush", 0);
- output_asm_insn (".set\tmips2", 0);
+ if (TARGET_64BIT)
+ output_asm_insn (".set\tmips3", 0);
+ else
+ output_asm_insn (".set\tmips2", 0);
}
}
@@ -13005,6 +13021,7 @@ mips_issue_rate (void)
case PROCESSOR_R4130:
case PROCESSOR_R5400:
case PROCESSOR_R5500:
+ case PROCESSOR_R5900:
case PROCESSOR_R7000:
case PROCESSOR_R9000:
case PROCESSOR_OCTEON:
@@ -16025,8 +16042,9 @@ mips_reorg_process_insns (void)
cfun->machine->all_noreorder_p = false;
/* Code compiled with -mfix-vr4120 or -mfix-24k can't be all noreorder
- because we rely on the assembler to work around some errata. */
- if (TARGET_FIX_VR4120 || TARGET_FIX_24K)
+ because we rely on the assembler to work around some errata.
+ The r5900 too has several bugs. */
+ if (TARGET_FIX_VR4120 || TARGET_FIX_24K || TARGET_MIPS5900)
cfun->machine->all_noreorder_p = false;
/* The same is true for -mfix-vr4130 if we might generate MFLO or
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index a8cf1dbedc7..ff631c1a30b 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -222,6 +222,7 @@ struct mips_cpu_info {
#define TARGET_MIPS4130 (mips_arch == PROCESSOR_R4130)
#define TARGET_MIPS5400 (mips_arch == PROCESSOR_R5400)
#define TARGET_MIPS5500 (mips_arch == PROCESSOR_R5500)
+#define TARGET_MIPS5900 (mips_arch == PROCESSOR_R5900)
#define TARGET_MIPS7000 (mips_arch == PROCESSOR_R7000)
#define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000)
#define TARGET_OCTEON (mips_arch == PROCESSOR_OCTEON \
@@ -399,6 +400,9 @@ struct mips_cpu_info {
if (TARGET_MCU) \
builtin_define ("__mips_mcu"); \
\
+ if (TARGET_EVA) \
+ builtin_define ("__mips_eva"); \
+ \
if (TARGET_DSP) \
{ \
builtin_define ("__mips_dsp"); \
@@ -803,6 +807,7 @@ struct mips_cpu_info {
#define ISA_HAS_MUL3 ((TARGET_MIPS3900 \
|| TARGET_MIPS5400 \
|| TARGET_MIPS5500 \
+ || TARGET_MIPS5900 \
|| TARGET_MIPS7000 \
|| TARGET_MIPS9000 \
|| TARGET_MAD \
@@ -817,6 +822,22 @@ struct mips_cpu_info {
&& TARGET_OCTEON \
&& !TARGET_MIPS16)
+/* ISA supports instructions DMULT and DMULTU. */
+#define ISA_HAS_DMULT (TARGET_64BIT && !TARGET_MIPS5900)
+
+/* ISA supports instructions MULT and MULTU.
+ This is always true, but the macro is needed for ISA_HAS_<D>MULT
+ in mips.md. */
+#define ISA_HAS_MULT (1)
+
+/* ISA supports instructions DDIV and DDIVU. */
+#define ISA_HAS_DDIV (TARGET_64BIT && !TARGET_MIPS5900)
+
+/* ISA supports instructions DIV and DIVU.
+ This is always true, but the macro is needed for ISA_HAS_<D>DIV
+ in mips.md. */
+#define ISA_HAS_DIV (1)
+
#define ISA_HAS_DIV3 ((TARGET_LOONGSON_2EF \
|| TARGET_LOONGSON_3A) \
&& !TARGET_MIPS16)
@@ -833,7 +854,9 @@ struct mips_cpu_info {
/* ISA has the integer conditional move instructions introduced in mips4 and
ST Loongson 2E/2F. */
-#define ISA_HAS_CONDMOVE (ISA_HAS_FP_CONDMOVE || TARGET_LOONGSON_2EF)
+#define ISA_HAS_CONDMOVE (ISA_HAS_FP_CONDMOVE \
+ || TARGET_MIPS5900 \
+ || TARGET_LOONGSON_2EF)
/* ISA has LDC1 and SDC1. */
#define ISA_HAS_LDC1_SDC1 (!ISA_MIPS1 && !TARGET_MIPS16)
@@ -946,6 +969,7 @@ struct mips_cpu_info {
/* ISA has data prefetch instructions. This controls use of 'pref'. */
#define ISA_HAS_PREFETCH ((ISA_MIPS4 \
|| TARGET_LOONGSON_2EF \
+ || TARGET_MIPS5900 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
|| ISA_MIPS64 \
@@ -1007,15 +1031,18 @@ struct mips_cpu_info {
and "addiu $4,$4,1". */
#define ISA_HAS_LOAD_DELAY (ISA_MIPS1 \
&& !TARGET_MIPS3900 \
+ && !TARGET_MIPS5900 \
&& !TARGET_MIPS16 \
&& !TARGET_MICROMIPS)
/* Likewise mtc1 and mfc1. */
#define ISA_HAS_XFER_DELAY (mips_isa <= 3 \
+ && !TARGET_MIPS5900 \
&& !TARGET_LOONGSON_2EF)
/* Likewise floating-point comparisons. */
#define ISA_HAS_FCMP_DELAY (mips_isa <= 3 \
+ && !TARGET_MIPS5900 \
&& !TARGET_LOONGSON_2EF)
/* True if mflo and mfhi can be immediately followed by instructions
@@ -1035,6 +1062,7 @@ struct mips_cpu_info {
|| ISA_MIPS64 \
|| ISA_MIPS64R2 \
|| TARGET_MIPS5500 \
+ || TARGET_MIPS5900 \
|| TARGET_LOONGSON_2EF)
/* ISA includes synci, jr.hb and jalr.hb. */
@@ -1052,7 +1080,7 @@ struct mips_cpu_info {
/* ISA includes ll and sc. Note that this implies ISA_HAS_SYNC
because the expanders use both ISA_HAS_SYNC and ISA_HAS_LL_SC
instructions. */
-#define ISA_HAS_LL_SC (mips_isa >= 2 && !TARGET_MIPS16)
+#define ISA_HAS_LL_SC (mips_isa >= 2 && !TARGET_MIPS5900 && !TARGET_MIPS16)
#define GENERATE_LL_SC \
(target_flags_explicit & MASK_LLSC \
? TARGET_LLSC && !TARGET_MIPS16 \
@@ -1125,6 +1153,7 @@ struct mips_cpu_info {
%{mdsp} %{mno-dsp} \
%{mdspr2} %{mno-dspr2} \
%{mmcu} %{mno-mcu} \
+%{meva} %{mno-eva} \
%{msmartmips} %{mno-smartmips} \
%{mmt} %{mno-mt} \
%{mfix-vr4120} %{mfix-vr4130} \
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 6f6484b0d8c..ce322d8bc36 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -55,6 +55,7 @@
r5000
r5400
r5500
+ r5900
r7000
r8000
r9000
@@ -406,8 +407,12 @@
;; Is this an extended instruction in mips16 mode?
(define_attr "extended_mips16" "no,yes"
- (if_then_else (ior (eq_attr "move_type" "sll0")
- (eq_attr "jal" "direct"))
+ (if_then_else (ior ;; In general, constant-pool loads are extended
+ ;; instructions. We don't yet optimize for 16-bit
+ ;; PC-relative references.
+ (eq_attr "move_type" "sll0,loadpool")
+ (eq_attr "jal" "direct")
+ (eq_attr "got" "load"))
(const_string "yes")
(const_string "no")))
@@ -420,14 +425,89 @@
(match_test "TARGET_MICROMIPS")))
(const_string "yes")
(const_string "no")))
-
-;; Length of instruction in bytes.
-(define_attr "length" ""
- (cond [(and (eq_attr "extended_mips16" "yes")
- (match_test "TARGET_MIPS16"))
- (const_int 4)
- (and (eq_attr "compression" "micromips,all")
+;; The number of individual instructions that a non-branch pattern generates,
+;; using units of BASE_INSN_LENGTH.
+(define_attr "insn_count" ""
+ (cond [;; "Ghost" instructions occupy no space.
+ (eq_attr "type" "ghost")
+ (const_int 0)
+
+ ;; Extended instructions count as 2.
+ (and (eq_attr "extended_mips16" "yes")
+ (match_test "TARGET_MIPS16"))
+ (const_int 2)
+
+ ;; A GOT load followed by an add of $gp. This is not used for MIPS16.
+ (eq_attr "got" "xgot_high")
+ (const_int 2)
+
+ ;; SHIFT_SHIFTs are decomposed into two separate instructions.
+ ;; They are extended instructions on MIPS16 targets.
+ (eq_attr "move_type" "shift_shift")
+ (if_then_else (match_test "TARGET_MIPS16")
+ (const_int 4)
+ (const_int 2))
+
+ ;; Check for doubleword moves that are decomposed into two
+ ;; instructions. The individual instructions are unextended
+ ;; MIPS16 ones.
+ (and (eq_attr "move_type" "mtc,mfc,mtlo,mflo,move")
+ (eq_attr "dword_mode" "yes"))
+ (const_int 2)
+
+ ;; Constants, loads and stores are handled by external routines.
+ (and (eq_attr "move_type" "const,constN")
+ (eq_attr "dword_mode" "yes"))
+ (symbol_ref "mips_split_const_insns (operands[1])")
+ (eq_attr "move_type" "const,constN")
+ (symbol_ref "mips_const_insns (operands[1])")
+ (eq_attr "move_type" "load,fpload")
+ (symbol_ref "mips_load_store_insns (operands[1], insn)")
+ (eq_attr "move_type" "store,fpstore")
+ (symbol_ref "mips_load_store_insns (operands[0], insn)
+ + (TARGET_FIX_24K ? 1 : 0)")
+
+ ;; In the worst case, a call macro will take 8 instructions:
+ ;;
+ ;; lui $25,%call_hi(FOO)
+ ;; addu $25,$25,$28
+ ;; lw $25,%call_lo(FOO)($25)
+ ;; nop
+ ;; jalr $25
+ ;; nop
+ ;; lw $gp,X($sp)
+ ;; nop
+ (eq_attr "jal_macro" "yes")
+ (const_int 8)
+
+ ;; Various VR4120 errata require a nop to be inserted after a macc
+ ;; instruction. The assembler does this for us, so account for
+ ;; the worst-case length here.
+ (and (eq_attr "type" "imadd")
+ (match_test "TARGET_FIX_VR4120"))
+ (const_int 2)
+
+ ;; VR4120 errata MD(4): if there are consecutive dmult instructions,
+ ;; the result of the second one is missed. The assembler should work
+ ;; around this by inserting a nop after the first dmult.
+ (and (eq_attr "type" "imul,imul3")
+ (eq_attr "mode" "DI")
+ (match_test "TARGET_FIX_VR4120"))
+ (const_int 2)
+
+ (eq_attr "type" "idiv,idiv3")
+ (symbol_ref "mips_idiv_insns ()")
+
+ (not (eq_attr "sync_mem" "none"))
+ (symbol_ref "mips_sync_loop_insns (insn, operands)")]
+ (const_int 1)))
+
+;; Length of instruction in bytes. The default is derived from "insn_count",
+;; but there are special cases for branches (which must be handled here)
+;; and for compressed single instructions.
+(define_attr "length" ""
+ (cond [(and (eq_attr "compression" "micromips,all")
(eq_attr "dword_mode" "no")
(match_test "TARGET_MICROMIPS"))
(const_int 2)
@@ -580,95 +660,8 @@
(const_int 20)
(match_test "Pmode == SImode")
(const_int 16)
- ] (const_int 24))
-
- ;; "Ghost" instructions occupy no space.
- (eq_attr "type" "ghost")
- (const_int 0)
-
- ;; GOT loads are extended MIPS16 instructions and 4-byte
- ;; microMIPS instructions.
- (eq_attr "got" "load")
- (const_int 4)
-
- ;; A GOT load followed by an add of $gp.
- (eq_attr "got" "xgot_high")
- (const_int 8)
-
- ;; In general, constant-pool loads are extended instructions.
- (eq_attr "move_type" "loadpool")
- (const_int 4)
-
- ;; SHIFT_SHIFTs are decomposed into two separate instructions.
- ;; They are extended instructions on MIPS16 targets.
- (eq_attr "move_type" "shift_shift")
- (const_int 8)
-
- ;; Check for doubleword moves that are decomposed into two
- ;; instructions. The individual instructions are unextended
- ;; MIPS16 ones or 2-byte microMIPS ones.
- (and (eq_attr "move_type" "mtc,mfc,mtlo,mflo,move")
- (eq_attr "dword_mode" "yes"))
- (if_then_else (match_test "TARGET_COMPRESSION")
- (const_int 4)
- (const_int 8))
-
- ;; Doubleword CONST{,N} moves are split into two word
- ;; CONST{,N} moves.
- (and (eq_attr "move_type" "const,constN")
- (eq_attr "dword_mode" "yes"))
- (symbol_ref "mips_split_const_insns (operands[1]) * BASE_INSN_LENGTH")
-
- ;; Otherwise, constants, loads and stores are handled by external
- ;; routines.
- (eq_attr "move_type" "const,constN")
- (symbol_ref "mips_const_insns (operands[1]) * BASE_INSN_LENGTH")
- (eq_attr "move_type" "load,fpload")
- (symbol_ref "mips_load_store_insns (operands[1], insn)
- * BASE_INSN_LENGTH")
- (eq_attr "move_type" "store,fpstore")
- (symbol_ref "mips_load_store_insns (operands[0], insn)
- * BASE_INSN_LENGTH
- + (TARGET_FIX_24K ? NOP_INSN_LENGTH : 0)")
-
- ;; In the worst case, a call macro will take 8 instructions:
- ;;
- ;; lui $25,%call_hi(FOO)
- ;; addu $25,$25,$28
- ;; lw $25,%call_lo(FOO)($25)
- ;; nop
- ;; jalr $25
- ;; nop
- ;; lw $gp,X($sp)
- ;; nop
- (eq_attr "jal_macro" "yes")
- (const_int 32)
-
- ;; Various VR4120 errata require a nop to be inserted after a macc
- ;; instruction. The assembler does this for us, so account for
- ;; the worst-case length here.
- (and (eq_attr "type" "imadd")
- (match_test "TARGET_FIX_VR4120"))
- (const_int 8)
-
- ;; VR4120 errata MD(4): if there are consecutive dmult instructions,
- ;; the result of the second one is missed. The assembler should work
- ;; around this by inserting a nop after the first dmult.
- (and (eq_attr "type" "imul,imul3")
- (and (eq_attr "mode" "DI")
- (match_test "TARGET_FIX_VR4120")))
- (const_int 8)
-
- (eq_attr "type" "idiv,idiv3")
- (symbol_ref "mips_idiv_insns () * BASE_INSN_LENGTH")
-
- (not (eq_attr "sync_mem" "none"))
- (symbol_ref "mips_sync_loop_insns (insn, operands)
- * BASE_INSN_LENGTH")
-
- (match_test "TARGET_MIPS16")
- (const_int 2)
- ] (const_int 4)))
+ ] (const_int 24))]
+ (symbol_ref "get_attr_insn_count (insn) * BASE_INSN_LENGTH")))
;; Attribute describing the processor.
(define_enum_attr "cpu" "processor"
@@ -701,16 +694,11 @@
(const_string "hilo")]
(const_string "none")))
-;; Is it a single instruction?
-(define_attr "single_insn" "no,yes"
- (symbol_ref "(get_attr_length (insn) == (TARGET_MIPS16 ? 2 : 4)
- ? SINGLE_INSN_YES : SINGLE_INSN_NO)"))
-
;; Can the instruction be put into a delay slot?
(define_attr "can_delay" "no,yes"
(if_then_else (and (eq_attr "type" "!branch,call,jump")
- (and (eq_attr "hazard" "none")
- (eq_attr "single_insn" "yes")))
+ (eq_attr "hazard" "none")
+ (match_test "get_attr_insn_count (insn) == 1"))
(const_string "yes")
(const_string "no")))
@@ -755,7 +743,9 @@
;; This mode iterator allows :MOVECC to be used anywhere that a
;; conditional-move-type condition is needed.
(define_mode_iterator MOVECC [SI (DI "TARGET_64BIT")
- (CC "TARGET_HARD_FLOAT && !TARGET_LOONGSON_2EF")])
+ (CC "TARGET_HARD_FLOAT
+ && !TARGET_LOONGSON_2EF
+ && !TARGET_MIPS5900")])
;; 32-bit integer moves for which we provide move patterns.
(define_mode_iterator IMOVE32
@@ -1417,7 +1407,7 @@
"mul.<fmt>\t%0,%1,%2\;nop"
[(set_attr "type" "fmul")
(set_attr "mode" "<MODE>")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
(define_insn "mulv2sf3"
[(set (match_operand:V2SF 0 "register_operand" "=f")
@@ -1478,7 +1468,7 @@
[(set (match_operand:GPR 0 "register_operand")
(mult:GPR (match_operand:GPR 1 "register_operand")
(match_operand:GPR 2 "register_operand")))]
- ""
+ "ISA_HAS_<D>MULT"
{
rtx lo;
@@ -1524,7 +1514,7 @@
{
if (which_alternative == 1)
return "<d>mult\t%1,%2";
- if (<MODE>mode == SImode && TARGET_MIPS3900)
+ if (<MODE>mode == SImode && (TARGET_MIPS3900 || TARGET_MIPS5900))
return "mult\t%0,%1,%2";
return "<d>mul\t%0,%1,%2";
}
@@ -1558,7 +1548,7 @@
[(set (match_operand:GPR 0 "muldiv_target_operand" "=l")
(mult:GPR (match_operand:GPR 1 "register_operand" "d")
(match_operand:GPR 2 "register_operand" "d")))]
- "!TARGET_FIX_R4000"
+ "ISA_HAS_<D>MULT && !TARGET_FIX_R4000"
"<d>mult\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "<MODE>")])
@@ -1568,11 +1558,11 @@
(mult:GPR (match_operand:GPR 1 "register_operand" "d")
(match_operand:GPR 2 "register_operand" "d")))
(clobber (match_scratch:GPR 3 "=l"))]
- "TARGET_FIX_R4000"
+ "ISA_HAS_<D>MULT && TARGET_FIX_R4000"
"<d>mult\t%1,%2\;mflo\t%0"
[(set_attr "type" "imul")
(set_attr "mode" "<MODE>")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
;; On the VR4120 and VR4130, it is better to use "mtlo $0; macc" instead
;; of "mult; mflo". They have the same latency, but the first form gives
@@ -1632,7 +1622,7 @@
[(set_attr "type" "imadd")
(set_attr "accum_in" "3")
(set_attr "mode" "SI")
- (set_attr "length" "4,8")])
+ (set_attr "insn_count" "1,2")])
;; The same idea applies here. The middle alternative needs one less
;; clobber than the final alternative, so we add "*?" as a counterweight.
@@ -1651,7 +1641,7 @@
[(set_attr "type" "imadd")
(set_attr "accum_in" "3")
(set_attr "mode" "SI")
- (set_attr "length" "4,4,8")])
+ (set_attr "insn_count" "1,1,2")])
;; Split *mul_acc_si if both the source and destination accumulator
;; values are GPRs.
@@ -1732,7 +1722,7 @@
""
[(set_attr "type" "imadd")
(set_attr "accum_in" "1")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
;; Patterns generated by the define_peephole2 below.
@@ -1868,7 +1858,7 @@
[(set_attr "type" "imadd")
(set_attr "accum_in" "1")
(set_attr "mode" "SI")
- (set_attr "length" "4,8")])
+ (set_attr "insn_count" "1,2")])
;; Split *mul_sub_si if both the source and destination accumulator
;; values are GPRs.
@@ -1949,7 +1939,7 @@
"mult<u>\t%1,%2\;mflo\t%L0\;mfhi\t%M0"
[(set_attr "type" "imul")
(set_attr "mode" "SI")
- (set_attr "length" "12")])
+ (set_attr "insn_count" "3")])
(define_insn_and_split "<u>mulsidi3_64bit"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -1968,10 +1958,10 @@
}
[(set_attr "type" "imul")
(set_attr "mode" "SI")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "ISA_HAS_EXT_INS")
- (const_int 16)
- (const_int 28)))])
+ (const_int 4)
+ (const_int 7)))])
(define_expand "<u>mulsidi3_64bit_mips16"
[(set (match_operand:DI 0 "register_operand")
@@ -2035,7 +2025,7 @@
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))
(clobber (match_scratch:DI 3 "=l"))]
- "TARGET_64BIT && ISA_HAS_DMUL3"
+ "ISA_HAS_DMUL3"
"dmul\t%0,%1,%2"
[(set_attr "type" "imul3")
(set_attr "mode" "DI")])
@@ -2122,7 +2112,7 @@
}
[(set_attr "type" "imul")
(set_attr "mode" "SI")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
(define_expand "<su>mulsi3_highpart_split"
[(set (match_operand:SI 0 "register_operand")
@@ -2189,7 +2179,7 @@
(mult:TI (any_extend:TI (match_operand:DI 1 "register_operand"))
(any_extend:TI (match_operand:DI 2 "register_operand")))
(const_int 64))))]
- "TARGET_64BIT && !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
+ "ISA_HAS_DMULT && !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
{
if (TARGET_MIPS16)
emit_insn (gen_<su>muldi3_highpart_split (operands[0], operands[1],
@@ -2208,7 +2198,7 @@
(any_extend:TI (match_operand:DI 2 "register_operand" "d")))
(const_int 64))))
(clobber (match_scratch:DI 3 "=l"))]
- "TARGET_64BIT
+ "ISA_HAS_DMULT
&& !TARGET_MIPS16
&& !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
{ return TARGET_FIX_R4000 ? "dmult<u>\t%1,%2\n\tmfhi\t%0" : "#"; }
@@ -2221,7 +2211,7 @@
}
[(set_attr "type" "imul")
(set_attr "mode" "DI")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
(define_expand "<su>muldi3_highpart_split"
[(set (match_operand:DI 0 "register_operand")
@@ -2244,7 +2234,7 @@
[(set (match_operand:TI 0 "register_operand")
(mult:TI (any_extend:TI (match_operand:DI 1 "register_operand"))
(any_extend:TI (match_operand:DI 2 "register_operand"))))]
- "TARGET_64BIT && !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
+ "ISA_HAS_DMULT && !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
{
rtx hilo;
@@ -2266,7 +2256,7 @@
[(set (match_operand:TI 0 "muldiv_target_operand" "=x")
(mult:TI (any_extend:TI (match_operand:DI 1 "register_operand" "d"))
(any_extend:TI (match_operand:DI 2 "register_operand" "d"))))]
- "TARGET_64BIT
+ "ISA_HAS_DMULT
&& !TARGET_FIX_R4000
&& !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
"dmult<u>\t%1,%2"
@@ -2278,13 +2268,13 @@
(mult:TI (any_extend:TI (match_operand:DI 1 "register_operand" "d"))
(any_extend:TI (match_operand:DI 2 "register_operand" "d"))))
(clobber (match_scratch:TI 3 "=x"))]
- "TARGET_64BIT
+ "ISA_HAS_DMULT
&& TARGET_FIX_R4000
&& !(<CODE> == ZERO_EXTEND && TARGET_FIX_VR4120)"
"dmult<u>\t%1,%2\;mflo\t%L0\;mfhi\t%M0"
[(set_attr "type" "imul")
(set_attr "mode" "DI")
- (set_attr "length" "12")])
+ (set_attr "insn_count" "3")])
;; The R4650 supports a 32-bit multiply/ 64-bit accumulate
;; instruction. The HI/LO registers are used as a 64-bit accumulator.
@@ -2535,10 +2525,10 @@
}
[(set_attr "type" "fdiv")
(set_attr "mode" "<UNITMODE>")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "TARGET_FIX_SB1")
- (const_int 8)
- (const_int 4)))])
+ (const_int 2)
+ (const_int 1)))])
(define_insn "*recip<mode>3"
[(set (match_operand:ANYF 0 "register_operand" "=f")
@@ -2553,10 +2543,10 @@
}
[(set_attr "type" "frdiv")
(set_attr "mode" "<UNITMODE>")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "TARGET_FIX_SB1")
- (const_int 8)
- (const_int 4)))])
+ (const_int 2)
+ (const_int 1)))])
;; VR4120 errata MD(A1): signed division instructions do not work correctly
;; with negative operands. We use special libgcc functions instead.
@@ -2574,7 +2564,7 @@
(set (match_operand:GPR 3 "register_operand" "=d")
(mod:GPR (match_dup 1)
(match_dup 2)))]
- "!TARGET_FIX_VR4120"
+ "ISA_HAS_<D>DIV && !TARGET_FIX_VR4120"
"#"
"&& ((TARGET_MIPS16 && cse_not_expected) || reload_completed)"
[(const_int 0)]
@@ -2586,7 +2576,8 @@
}
[(set_attr "type" "idiv")
(set_attr "mode" "<MODE>")
- (set_attr "length" "8")])
+ ;; Worst case for MIPS16.
+ (set_attr "insn_count" "3")])
;; See the comment above "divmod<mode>4" for the MIPS16 handling.
(define_insn_and_split "udivmod<mode>4"
@@ -2596,7 +2587,7 @@
(set (match_operand:GPR 3 "register_operand" "=d")
(umod:GPR (match_dup 1)
(match_dup 2)))]
- ""
+ "ISA_HAS_<D>DIV"
"#"
"(TARGET_MIPS16 && cse_not_expected) || reload_completed"
[(const_int 0)]
@@ -2606,9 +2597,10 @@
emit_move_insn (operands[0], gen_rtx_REG (<MODE>mode, LO_REGNUM));
DONE;
}
- [(set_attr "type" "idiv")
- (set_attr "mode" "<MODE>")
- (set_attr "length" "8")])
+ [(set_attr "type" "idiv")
+ (set_attr "mode" "<MODE>")
+ ;; Worst case for MIPS16.
+ (set_attr "insn_count" "3")])
(define_expand "<u>divmod<mode>4_split"
[(set (match_operand:GPR 0 "register_operand")
@@ -2641,7 +2633,7 @@
[(any_div:GPR (match_operand:GPR 1 "register_operand" "d")
(match_operand:GPR 2 "register_operand" "d"))]
UNSPEC_SET_HILO))]
- ""
+ "ISA_HAS_<GPR:D>DIV"
{ return mips_output_division ("<GPR:d>div<u>\t%.,%1,%2", operands); }
[(set_attr "type" "idiv")
(set_attr "mode" "<GPR:MODE>")])
@@ -2668,10 +2660,10 @@
}
[(set_attr "type" "fsqrt")
(set_attr "mode" "<UNITMODE>")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "TARGET_FIX_SB1")
- (const_int 8)
- (const_int 4)))])
+ (const_int 2)
+ (const_int 1)))])
(define_insn "*rsqrt<mode>a"
[(set (match_operand:ANYF 0 "register_operand" "=f")
@@ -2686,10 +2678,10 @@
}
[(set_attr "type" "frsqrt")
(set_attr "mode" "<UNITMODE>")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "TARGET_FIX_SB1")
- (const_int 8)
- (const_int 4)))])
+ (const_int 2)
+ (const_int 1)))])
(define_insn "*rsqrt<mode>b"
[(set (match_operand:ANYF 0 "register_operand" "=f")
@@ -2704,10 +2696,10 @@
}
[(set_attr "type" "frsqrt")
(set_attr "mode" "<UNITMODE>")
- (set (attr "length")
+ (set (attr "insn_count")
(if_then_else (match_test "TARGET_FIX_SB1")
- (const_int 8)
- (const_int 4)))])
+ (const_int 2)
+ (const_int 1)))])
;;
;; ....................
@@ -3500,7 +3492,7 @@
[(set_attr "type" "fcvt")
(set_attr "mode" "DF")
(set_attr "cnv_mode" "D2I")
- (set_attr "length" "36")])
+ (set_attr "insn_count" "9")])
(define_expand "fix_truncsfsi2"
[(set (match_operand:SI 0 "register_operand")
@@ -3537,7 +3529,7 @@
[(set_attr "type" "fcvt")
(set_attr "mode" "SF")
(set_attr "cnv_mode" "S2I")
- (set_attr "length" "36")])
+ (set_attr "insn_count" "9")])
(define_insn "fix_truncdfdi2"
@@ -4015,7 +4007,7 @@
operands[2] = mips_unspec_address (operands[1], SYMBOL_64_HIGH);
operands[3] = mips_unspec_address (operands[1], SYMBOL_64_MID);
}
- [(set_attr "length" "20")])
+ [(set_attr "insn_count" "5")])
;; Use a scratch register to reduce the latency of the above pattern
;; on superscalar machines. The optimized sequence is:
@@ -4070,7 +4062,7 @@
operands[3] = mips_unspec_address (operands[1], SYMBOL_64_HIGH);
operands[4] = mips_unspec_address (operands[1], SYMBOL_64_LOW);
}
- [(set_attr "length" "24")])
+ [(set_attr "insn_count" "6")])
;; Split HIGHs into:
;;
@@ -5080,7 +5072,7 @@
return ".cprestore\t%1";
}
[(set_attr "type" "store")
- (set_attr "length" "4,12")])
+ (set_attr "insn_count" "1,3")])
(define_insn "use_cprestore_<mode>"
[(set (reg:P CPRESTORE_SLOT_REGNUM)
@@ -5141,7 +5133,7 @@
"\tjr.hb\t$31\n"
"\tnop%>%)";
}
- [(set_attr "length" "20")])
+ [(set_attr "insn_count" "5")])
;; Cache operations for R4000-style caches.
(define_insn "mips_cache"
@@ -5334,8 +5326,7 @@
;; not have and immediate). We recognize a shift of a load in order
;; to make it simple enough for combine to understand.
;;
-;; The length here is the worst case: the length of the split version
-;; will be more accurate.
+;; The instruction count here is the worst case.
(define_insn_and_split ""
[(set (match_operand:SI 0 "register_operand" "=d")
(lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
@@ -5348,7 +5339,8 @@
""
[(set_attr "type" "load")
(set_attr "mode" "SI")
- (set_attr "length" "8")])
+ (set (attr "insn_count")
+ (symbol_ref "mips_load_store_insns (operands[1], insn) + 2"))])
(define_insn "rotr<mode>3"
[(set (match_operand:GPR 0 "register_operand" "=d")
@@ -5987,7 +5979,7 @@
return "j\t%4";
}
- [(set_attr "length" "32")])
+ [(set_attr "insn_count" "16")])
;; For TARGET_USE_GOT, we save the gp in the jmp_buf as well.
;; While it is possible to either pull it off the stack (in the
@@ -6878,11 +6870,8 @@
(set (match_dup 0) (reg:P TLS_GET_TP_REGNUM))]
""
[(set_attr "type" "unknown")
- ; Since rdhwr always generates a trap for now, putting it in a delay
- ; slot would make the kernel's emulation of it much slower.
- (set_attr "can_delay" "no")
(set_attr "mode" "<MODE>")
- (set_attr "length" "8")])
+ (set_attr "insn_count" "2")])
(define_insn "*tls_get_tp_<mode>_split"
[(set (reg:P TLS_GET_TP_REGNUM)
@@ -6890,7 +6879,8 @@
"HAVE_AS_TLS && !TARGET_MIPS16"
".set\tpush\;.set\tmips32r2\t\;rdhwr\t$3,$29\;.set\tpop"
[(set_attr "type" "unknown")
- ; See tls_get_tp_<mode>
+ ; Since rdhwr always generates a trap for now, putting it in a delay
+ ; slot would make the kernel's emulation of it much slower.
(set_attr "can_delay" "no")
(set_attr "mode" "<MODE>")])
@@ -6922,7 +6912,7 @@
(set (match_dup 0) (reg:P TLS_GET_TP_REGNUM))]
""
[(set_attr "type" "multi")
- (set_attr "length" "8")
+ (set_attr "insn_count" "4")
(set_attr "mode" "<MODE>")])
(define_insn "*tls_get_tp_mips16_call_<mode>"
@@ -6934,7 +6924,7 @@
"HAVE_AS_TLS && TARGET_MIPS16"
{ return MIPS_CALL ("jal", operands, 0, -1); }
[(set_attr "type" "call")
- (set_attr "length" "6")
+ (set_attr "insn_count" "3")
(set_attr "mode" "<MODE>")])
;; Named pattern for expanding thread pointer reference.
diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
index e11710db3c0..08ab29b1810 100644
--- a/gcc/config/mips/mips.opt
+++ b/gcc/config/mips/mips.opt
@@ -141,6 +141,10 @@ membedded-data
Target Report Var(TARGET_EMBEDDED_DATA)
Use ROM instead of RAM
+meva
+Target Report Var(TARGET_EVA)
+Use Enhanced Virtual Addressing instructions
+
mexplicit-relocs
Target Report Mask(EXPLICIT_RELOCS)
Use NewABI-style %reloc() assembly operators
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 1af09e559b0..bd37067dfc4 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -313,7 +313,7 @@ mmix_init_machine_status (void)
return ggc_alloc_cleared_machine_function ();
}
-/* DATA_ALIGNMENT.
+/* DATA_ABI_ALIGNMENT.
We have trouble getting the address of stuff that is located at other
than 32-bit alignments (GETA requirements), so try to give everything
at least 32-bit alignment. */
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 4ca1a2b8c86..c5edc5777a9 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -164,7 +164,7 @@ struct GTY(()) machine_function
/* Copied from elfos.h. */
#define MAX_OFILE_ALIGNMENT (32768 * 8)
-#define DATA_ALIGNMENT(TYPE, BASIC_ALIGN) \
+#define DATA_ABI_ALIGNMENT(TYPE, BASIC_ALIGN) \
mmix_data_alignment (TYPE, BASIC_ALIGN)
#define CONSTANT_ALIGNMENT(CONSTANT, BASIC_ALIGN) \
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index 2e18bebf3d8..c2ed7389bc4 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -647,6 +647,15 @@ rl78_addr_space_pointer_mode (addr_space_t addrspace)
}
}
+/* Returns TRUE for valid addresses. */
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE rl78_valid_pointer_mode
+static bool
+rl78_valid_pointer_mode (enum machine_mode m)
+{
+ return (m == HImode || m == SImode);
+}
+
/* Return the appropriate mode for a named address address. */
#undef TARGET_ADDR_SPACE_ADDRESS_MODE
#define TARGET_ADDR_SPACE_ADDRESS_MODE rl78_addr_space_address_mode
@@ -2730,6 +2739,16 @@ rl78_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
}
+
+#undef TARGET_UNWIND_WORD_MODE
+#define TARGET_UNWIND_WORD_MODE rl78_unwind_word_mode
+
+static enum machine_mode
+rl78_unwind_word_mode (void)
+{
+ return HImode;
+}
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-rl78.h"
diff --git a/gcc/config/rl78/rl78.md b/gcc/config/rl78/rl78.md
index b3cfe6d1bbc..efc26210498 100644
--- a/gcc/config/rl78/rl78.md
+++ b/gcc/config/rl78/rl78.md
@@ -235,6 +235,24 @@
[(set_attr "valloc" "macax")]
)
+(define_expand "mulqi3"
+ [(set (match_operand:QI 0 "register_operand" "")
+ (mult:QI (match_operand:QI 1 "general_operand" "")
+ (match_operand:QI 2 "nonmemory_operand" "")))
+ ]
+ "" ; mulu supported by all targets
+ ""
+)
+
+(define_expand "mulhi3"
+ [(set (match_operand:HI 0 "register_operand" "")
+ (mult:HI (match_operand:HI 1 "general_operand" "")
+ (match_operand:HI 2 "nonmemory_operand" "")))
+ ]
+ "! RL78_MUL_NONE"
+ ""
+)
+
(define_expand "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=&v")
(mult:SI (match_operand:SI 1 "nonmemory_operand" "vi")
@@ -244,6 +262,58 @@
""
)
+(define_insn "*mulqi3_rl78"
+ [(set (match_operand:QI 0 "register_operand" "=&v")
+ (mult:QI (match_operand:QI 1 "general_operand" "+viU")
+ (match_operand:QI 2 "general_operand" "vi")))
+ ]
+ "" ; mulu supported by all targets
+ "; mulqi macro %0 = %1 * %2
+ mov a, %h1
+ mov x, a
+ mov a, %h2
+ mulu x ; ax = a * x
+ mov a, x
+ mov %h0, a
+ ; end of mulqi macro"
+;; [(set_attr "valloc" "macax")]
+)
+
+(define_insn "*mulhi3_rl78"
+ [(set (match_operand:HI 0 "register_operand" "=&v")
+ (mult:HI (match_operand:HI 1 "general_operand" "+viU")
+ (match_operand:HI 2 "general_operand" "vi")))
+ ]
+ "RL78_MUL_RL78"
+ "; mulhi macro %0 = %1 * %2
+ movw ax, %h1
+ movw bc, %h2
+ mulhu ; bcax = bc * ax
+ movw %h0, ax
+ ; end of mulhi macro"
+;; [(set_attr "valloc" "macax")]
+)
+
+(define_insn "*mulhi3_g13"
+ [(set (match_operand:HI 0 "register_operand" "=&v")
+ (mult:HI (match_operand:HI 1 "general_operand" "+viU")
+ (match_operand:HI 2 "general_operand" "vi")))
+ ]
+ "RL78_MUL_G13"
+ "; mulhi macro %0 = %1 * %2
+ mov a, #0x00
+ mov !0xf00e8, a ; MDUC
+ movw ax, %h1
+ movw 0xffff0, ax ; MDAL
+ movw ax, %h2
+ movw 0xffff2, ax ; MDAH
+ nop ; mdb = mdal * mdah
+ movw ax, 0xffff6 ; MDBL
+ movw %h0, ax
+ ; end of mulhi macro"
+;; [(set_attr "valloc" "umul")]
+)
+
;; 0xFFFF0 is MACR(L). 0xFFFF2 is MACR(H) but we don't care about it
;; because we're only using the lower 16 bits (which is the upper 16
;; bits of the result).
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 19a4ae9297d..4b91c5c5e24 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -323,15 +323,31 @@
#ifdef _ARCH_PWR8
/* Vector additions added in ISA 2.07. */
+#define vec_eqv __builtin_vec_eqv
+#define vec_nand __builtin_vec_nand
+#define vec_orc __builtin_vec_orc
#define vec_vaddudm __builtin_vec_vaddudm
+#define vec_vclz __builtin_vec_vclz
+#define vec_vclzb __builtin_vec_vclzb
+#define vec_vclzd __builtin_vec_vclzd
+#define vec_vclzh __builtin_vec_vclzh
+#define vec_vclzw __builtin_vec_vclzw
+#define vec_vgbbd __builtin_vec_vgbbd
#define vec_vmaxsd __builtin_vec_vmaxsd
#define vec_vmaxud __builtin_vec_vmaxud
#define vec_vminsd __builtin_vec_vminsd
#define vec_vminud __builtin_vec_vminud
+#define vec_vmrgew __builtin_vec_vmrgew
+#define vec_vmrgow __builtin_vec_vmrgow
#define vec_vpksdss __builtin_vec_vpksdss
#define vec_vpksdus __builtin_vec_vpksdus
#define vec_vpkudum __builtin_vec_vpkudum
#define vec_vpkudus __builtin_vec_vpkudus
+#define vec_vpopcnt __builtin_vec_vpopcnt
+#define vec_vpopcntb __builtin_vec_vpopcntb
+#define vec_vpopcntd __builtin_vec_vpopcntd
+#define vec_vpopcnth __builtin_vec_vpopcnth
+#define vec_vpopcntw __builtin_vec_vpopcntw
#define vec_vrld __builtin_vec_vrld
#define vec_vsld __builtin_vec_vsld
#define vec_vsrad __builtin_vec_vsrad
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 78d29001440..6607e450be3 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -128,6 +128,7 @@
UNSPEC_VUPKLS_V4SF
UNSPEC_VUPKHU_V4SF
UNSPEC_VUPKLU_V4SF
+ UNSPEC_VGBBD
])
(define_c_enum "unspecv"
@@ -941,6 +942,31 @@
"vmrglw %0,%1,%2"
[(set_attr "type" "vecperm")])
+;; Power8 vector merge even/odd
+(define_insn "p8_vmrgew"
+ [(set (match_operand:V4SI 0 "register_operand" "=v")
+ (vec_select:V4SI
+ (vec_concat:V8SI
+ (match_operand:V4SI 1 "register_operand" "v")
+ (match_operand:V4SI 2 "register_operand" "v"))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 2) (const_int 6)])))]
+ "TARGET_P8_VECTOR"
+ "vmrgew %0,%1,%2"
+ [(set_attr "type" "vecperm")])
+
+(define_insn "p8_vmrgow"
+ [(set (match_operand:V4SI 0 "register_operand" "=v")
+ (vec_select:V4SI
+ (vec_concat:V8SI
+ (match_operand:V4SI 1 "register_operand" "v")
+ (match_operand:V4SI 2 "register_operand" "v"))
+ (parallel [(const_int 1) (const_int 5)
+ (const_int 3) (const_int 7)])))]
+ "TARGET_P8_VECTOR"
+ "vmrgow %0,%1,%2"
+ [(set_attr "type" "vecperm")])
+
(define_insn "vec_widen_umult_even_v16qi"
[(set (match_operand:V8HI 0 "register_operand" "=v")
(unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
@@ -1017,10 +1043,13 @@
;; logical ops. Have the logical ops follow the memory ops in
;; terms of whether to prefer VSX or Altivec
+;; AND has a clobber to be consistant with VSX, which adds splitters for using
+;; the GPR registers.
(define_insn "*altivec_and<mode>3"
[(set (match_operand:VM 0 "register_operand" "=v")
(and:VM (match_operand:VM 1 "register_operand" "v")
- (match_operand:VM 2 "register_operand" "v")))]
+ (match_operand:VM 2 "register_operand" "v")))
+ (clobber (match_scratch:CC 3 "=X"))]
"VECTOR_MEM_ALTIVEC_P (<MODE>mode)"
"vand %0,%1,%2"
[(set_attr "type" "vecsimple")])
@@ -1050,8 +1079,8 @@
(define_insn "*altivec_nor<mode>3"
[(set (match_operand:VM 0 "register_operand" "=v")
- (not:VM (ior:VM (match_operand:VM 1 "register_operand" "v")
- (match_operand:VM 2 "register_operand" "v"))))]
+ (and:VM (not:VM (match_operand:VM 1 "register_operand" "v"))
+ (not:VM (match_operand:VM 2 "register_operand" "v"))))]
"VECTOR_MEM_ALTIVEC_P (<MODE>mode)"
"vnor %0,%1,%2"
[(set_attr "type" "vecsimple")])
@@ -2370,3 +2399,34 @@
emit_insn (gen_altivec_vcfux (operands[0], tmp, const0_rtx));
DONE;
}")
+
+
+;; Power8 vector instructions encoded as Altivec instructions
+
+;; Vector count leading zeros
+(define_insn "*p8v_clz<mode>2"
+ [(set (match_operand:VI2 0 "register_operand" "=v")
+ (clz:VI2 (match_operand:VI2 1 "register_operand" "v")))]
+ "TARGET_P8_VECTOR"
+ "vclz<wd> %0,%1"
+ [(set_attr "length" "4")
+ (set_attr "type" "vecsimple")])
+
+;; Vector population count
+(define_insn "*p8v_popcount<mode>2"
+ [(set (match_operand:VI2 0 "register_operand" "=v")
+ (popcount:VI2 (match_operand:VI2 1 "register_operand" "v")))]
+ "TARGET_P8_VECTOR"
+ "vpopcnt<wd> %0,%1"
+ [(set_attr "length" "4")
+ (set_attr "type" "vecsimple")])
+
+;; Vector Gather Bits by Bytes by Doubleword
+(define_insn "p8v_vgbbd"
+ [(set (match_operand:V16QI 0 "register_operand" "=v")
+ (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")]
+ UNSPEC_VGBBD))]
+ "TARGET_P8_VECTOR"
+ "vgbbd %0,%1"
+ [(set_attr "length" "4")
+ (set_attr "type" "vecsimple")])
diff --git a/gcc/config/rs6000/driver-rs6000.c b/gcc/config/rs6000/driver-rs6000.c
index e608dce184c..1a173d0b1cc 100644
--- a/gcc/config/rs6000/driver-rs6000.c
+++ b/gcc/config/rs6000/driver-rs6000.c
@@ -167,7 +167,7 @@ elf_platform (void)
if (fd != -1)
{
- char buf[1024];
+ static char buf[1024];
ElfW(auxv_t) *av;
ssize_t n;
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 3f280581feb..79f0f0b5f00 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -136,8 +136,11 @@ extern int dot_symbols;
SET_CMODEL (CMODEL_MEDIUM); \
if (rs6000_current_cmodel != CMODEL_SMALL) \
{ \
- TARGET_NO_FP_IN_TOC = 0; \
- TARGET_NO_SUM_IN_TOC = 0; \
+ if (!global_options_set.x_TARGET_NO_FP_IN_TOC) \
+ TARGET_NO_FP_IN_TOC \
+ = rs6000_current_cmodel == CMODEL_MEDIUM; \
+ if (!global_options_set.x_TARGET_NO_SUM_IN_TOC) \
+ TARGET_NO_SUM_IN_TOC = 0; \
} \
} \
} \
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 078c9387350..12a602b78c4 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -207,7 +207,7 @@
if (!REG_P (op))
return 0;
- if (REGNO (op) >= ARG_POINTER_REGNUM && !CA_REGNO_P (REGNO (op)))
+ if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
return 1;
return INT_REGNO_P (REGNO (op));
@@ -1121,9 +1121,16 @@
GET_MODE (XEXP (op, 0))),
1"))))
+;; Return 1 if OP is a valid comparison operator for "cbranch" instructions.
+;; If we're assuming that FP operations cannot generate user-visible traps,
+;; then on e500 we can use the ordered-signaling instructions to implement
+;; the unordered-quiet FP comparison predicates modulo a reversal.
(define_predicate "rs6000_cbranch_operator"
(if_then_else (match_test "TARGET_HARD_FLOAT && !TARGET_FPRS")
- (match_operand 0 "ordered_comparison_operator")
+ (if_then_else (match_test "flag_trapping_math")
+ (match_operand 0 "ordered_comparison_operator")
+ (ior (match_operand 0 "ordered_comparison_operator")
+ (match_code ("unlt,unle,ungt,unge"))))
(match_operand 0 "comparison_operator")))
;; Return 1 if OP is a comparison operation that is valid for an SCC insn --
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 7a80eff8924..1a5a709751d 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1234,10 +1234,23 @@ BU_VSX_OVERLOAD_2 (XXSPLTW, "xxspltw")
BU_VSX_OVERLOAD_X (LD, "ld")
BU_VSX_OVERLOAD_X (ST, "st")
+/* 1 argument VSX instructions added in ISA 2.07. */
+BU_P8V_VSX_1 (XSCVSPDPN, "xscvspdpn", CONST, vsx_xscvspdpn)
+BU_P8V_VSX_1 (XSCVDPSPN, "xscvdpspn", CONST, vsx_xscvdpspn)
+
/* 1 argument altivec instructions added in ISA 2.07. */
BU_P8V_AV_1 (ABS_V2DI, "abs_v2di", CONST, absv2di2)
BU_P8V_AV_1 (VUPKHSW, "vupkhsw", CONST, altivec_vupkhsw)
BU_P8V_AV_1 (VUPKLSW, "vupklsw", CONST, altivec_vupklsw)
+BU_P8V_AV_1 (VCLZB, "vclzb", CONST, clzv16qi2)
+BU_P8V_AV_1 (VCLZH, "vclzh", CONST, clzv8hi2)
+BU_P8V_AV_1 (VCLZW, "vclzw", CONST, clzv4si2)
+BU_P8V_AV_1 (VCLZD, "vclzd", CONST, clzv2di2)
+BU_P8V_AV_1 (VPOPCNTB, "vpopcntb", CONST, popcountv16qi2)
+BU_P8V_AV_1 (VPOPCNTH, "vpopcnth", CONST, popcountv8hi2)
+BU_P8V_AV_1 (VPOPCNTW, "vpopcntw", CONST, popcountv4si2)
+BU_P8V_AV_1 (VPOPCNTD, "vpopcntd", CONST, popcountv2di2)
+BU_P8V_AV_1 (VGBBD, "vgbbd", CONST, p8v_vgbbd)
/* 2 argument altivec instructions added in ISA 2.07. */
BU_P8V_AV_2 (VADDUDM, "vaddudm", CONST, addv2di3)
@@ -1245,6 +1258,8 @@ BU_P8V_AV_2 (VMINSD, "vminsd", CONST, sminv2di3)
BU_P8V_AV_2 (VMAXSD, "vmaxsd", CONST, smaxv2di3)
BU_P8V_AV_2 (VMINUD, "vminud", CONST, uminv2di3)
BU_P8V_AV_2 (VMAXUD, "vmaxud", CONST, umaxv2di3)
+BU_P8V_AV_2 (VMRGEW, "vmrgew", CONST, p8_vmrgew)
+BU_P8V_AV_2 (VMRGOW, "vmrgow", CONST, p8_vmrgow)
BU_P8V_AV_2 (VPKUDUM, "vpkudum", CONST, altivec_vpkudum)
BU_P8V_AV_2 (VPKSDSS, "vpksdss", CONST, altivec_vpksdss)
BU_P8V_AV_2 (VPKUDUS, "vpkudus", CONST, altivec_vpkudus)
@@ -1255,6 +1270,27 @@ BU_P8V_AV_2 (VSRD, "vsrd", CONST, vlshrv2di3)
BU_P8V_AV_2 (VSRAD, "vsrad", CONST, vashrv2di3)
BU_P8V_AV_2 (VSUBUDM, "vsubudm", CONST, subv2di3)
+BU_P8V_AV_2 (EQV_V16QI, "eqv_v16qi", CONST, eqvv16qi3)
+BU_P8V_AV_2 (EQV_V8HI, "eqv_v8hi", CONST, eqvv8hi3)
+BU_P8V_AV_2 (EQV_V4SI, "eqv_v4si", CONST, eqvv4si3)
+BU_P8V_AV_2 (EQV_V2DI, "eqv_v2di", CONST, eqvv2di3)
+BU_P8V_AV_2 (EQV_V4SF, "eqv_v4sf", CONST, eqvv4sf3)
+BU_P8V_AV_2 (EQV_V2DF, "eqv_v2df", CONST, eqvv2df3)
+
+BU_P8V_AV_2 (NAND_V16QI, "nand_v16qi", CONST, nandv16qi3)
+BU_P8V_AV_2 (NAND_V8HI, "nand_v8hi", CONST, nandv8hi3)
+BU_P8V_AV_2 (NAND_V4SI, "nand_v4si", CONST, nandv4si3)
+BU_P8V_AV_2 (NAND_V2DI, "nand_v2di", CONST, nandv2di3)
+BU_P8V_AV_2 (NAND_V4SF, "nand_v4sf", CONST, nandv4sf3)
+BU_P8V_AV_2 (NAND_V2DF, "nand_v2df", CONST, nandv2df3)
+
+BU_P8V_AV_2 (ORC_V16QI, "orc_v16qi", CONST, orcv16qi3)
+BU_P8V_AV_2 (ORC_V8HI, "orc_v8hi", CONST, orcv8hi3)
+BU_P8V_AV_2 (ORC_V4SI, "orc_v4si", CONST, orcv4si3)
+BU_P8V_AV_2 (ORC_V2DI, "orc_v2di", CONST, orcv2di3)
+BU_P8V_AV_2 (ORC_V4SF, "orc_v4sf", CONST, orcv4sf3)
+BU_P8V_AV_2 (ORC_V2DF, "orc_v2df", CONST, orcv2df3)
+
/* Vector comparison instructions added in ISA 2.07. */
BU_P8V_AV_2 (VCMPEQUD, "vcmpequd", CONST, vector_eqv2di)
BU_P8V_AV_2 (VCMPGTSD, "vcmpgtsd", CONST, vector_gtv2di)
@@ -1268,13 +1304,29 @@ BU_P8V_AV_P (VCMPGTUD_P, "vcmpgtud_p", CONST, vector_gtu_v2di_p)
/* ISA 2.07 vector overloaded 1 argument functions. */
BU_P8V_OVERLOAD_1 (VUPKHSW, "vupkhsw")
BU_P8V_OVERLOAD_1 (VUPKLSW, "vupklsw")
+BU_P8V_OVERLOAD_1 (VCLZ, "vclz")
+BU_P8V_OVERLOAD_1 (VCLZB, "vclzb")
+BU_P8V_OVERLOAD_1 (VCLZH, "vclzh")
+BU_P8V_OVERLOAD_1 (VCLZW, "vclzw")
+BU_P8V_OVERLOAD_1 (VCLZD, "vclzd")
+BU_P8V_OVERLOAD_1 (VPOPCNT, "vpopcnt")
+BU_P8V_OVERLOAD_1 (VPOPCNTB, "vpopcntb")
+BU_P8V_OVERLOAD_1 (VPOPCNTH, "vpopcnth")
+BU_P8V_OVERLOAD_1 (VPOPCNTW, "vpopcntw")
+BU_P8V_OVERLOAD_1 (VPOPCNTD, "vpopcntd")
+BU_P8V_OVERLOAD_1 (VGBBD, "vgbbd")
/* ISA 2.07 vector overloaded 2 argument functions. */
+BU_P8V_OVERLOAD_2 (EQV, "eqv")
+BU_P8V_OVERLOAD_2 (NAND, "nand")
+BU_P8V_OVERLOAD_2 (ORC, "orc")
BU_P8V_OVERLOAD_2 (VADDUDM, "vaddudm")
BU_P8V_OVERLOAD_2 (VMAXSD, "vmaxsd")
BU_P8V_OVERLOAD_2 (VMAXUD, "vmaxud")
BU_P8V_OVERLOAD_2 (VMINSD, "vminsd")
BU_P8V_OVERLOAD_2 (VMINUD, "vminud")
+BU_P8V_OVERLOAD_2 (VMRGEW, "vmrgew")
+BU_P8V_OVERLOAD_2 (VMRGOW, "vmrgow")
BU_P8V_OVERLOAD_2 (VPKSDSS, "vpksdss")
BU_P8V_OVERLOAD_2 (VPKSDUS, "vpksdus")
BU_P8V_OVERLOAD_2 (VPKUDUM, "vpkudum")
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 801b5bb225d..593b772ebd1 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -3515,6 +3515,404 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_VCMPGE_P, VSX_BUILTIN_XVCMPGEDP_P,
RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V2DF, RS6000_BTI_V2DF },
+ /* Power8 vector overloaded functions. */
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V4SF,
+ RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
+ { P8V_BUILTIN_VEC_EQV, P8V_BUILTIN_EQV_V2DF,
+ RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 },
+
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V4SF,
+ RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
+ { P8V_BUILTIN_VEC_NAND, P8V_BUILTIN_NAND_V2DF,
+ RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 },
+
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_bool_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
+ RS6000_BTI_unsigned_V16QI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_bool_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI,
+ RS6000_BTI_unsigned_V8HI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_bool_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V4SF,
+ RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
+ { P8V_BUILTIN_VEC_ORC, P8V_BUILTIN_ORC_V2DF,
+ RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 },
+
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VADDUDM, P8V_BUILTIN_VADDUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZB,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZB,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZH,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZH,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZ, P8V_BUILTIN_VCLZD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VCLZB, P8V_BUILTIN_VCLZB,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZB, P8V_BUILTIN_VCLZB,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VCLZH, P8V_BUILTIN_VCLZH,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZH, P8V_BUILTIN_VCLZH,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VCLZW, P8V_BUILTIN_VCLZW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZW, P8V_BUILTIN_VCLZW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VCLZD, P8V_BUILTIN_VCLZD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0, 0 },
+ { P8V_BUILTIN_VEC_VCLZD, P8V_BUILTIN_VCLZD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VMINSD, P8V_BUILTIN_VMINSD,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMINSD, P8V_BUILTIN_VMINSD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMINSD, P8V_BUILTIN_VMINSD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VMAXSD, P8V_BUILTIN_VMAXSD,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMAXSD, P8V_BUILTIN_VMAXSD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMAXSD, P8V_BUILTIN_VMAXSD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VMINUD, P8V_BUILTIN_VMINUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMINUD, P8V_BUILTIN_VMINUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMINUD, P8V_BUILTIN_VMINUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VMAXUD, P8V_BUILTIN_VMAXUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMAXUD, P8V_BUILTIN_VMAXUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VMAXUD, P8V_BUILTIN_VMAXUD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI,
+ RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VMRGEW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VMRGEW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+
+ { P8V_BUILTIN_VEC_VMRGOW, P8V_BUILTIN_VMRGOW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { P8V_BUILTIN_VEC_VMRGOW, P8V_BUILTIN_VMRGOW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI,
+ RS6000_BTI_unsigned_V4SI, 0 },
+
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTB,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTB,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTH,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTH,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNT, P8V_BUILTIN_VPOPCNTD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VPOPCNTB, P8V_BUILTIN_VPOPCNTB,
+ RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNTB, P8V_BUILTIN_VPOPCNTB,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VPOPCNTH, P8V_BUILTIN_VPOPCNTH,
+ RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNTH, P8V_BUILTIN_VPOPCNTH,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VPOPCNTW, P8V_BUILTIN_VPOPCNTW,
+ RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNTW, P8V_BUILTIN_VPOPCNTW,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VPOPCNTD, P8V_BUILTIN_VPOPCNTD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0, 0 },
+ { P8V_BUILTIN_VEC_VPOPCNTD, P8V_BUILTIN_VPOPCNTD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VPKUDUM, P8V_BUILTIN_VPKUDUM,
+ RS6000_BTI_V4SI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VPKUDUM, P8V_BUILTIN_VPKUDUM,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VPKUDUM, P8V_BUILTIN_VPKUDUM,
+ RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V2DI, RS6000_BTI_bool_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VPKSDSS, P8V_BUILTIN_VPKSDSS,
+ RS6000_BTI_V4SI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VPKUDUS, P8V_BUILTIN_VPKUDUS,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VPKSDUS, P8V_BUILTIN_VPKSDUS,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VRLD, P8V_BUILTIN_VRLD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VRLD, P8V_BUILTIN_VRLD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VSLD, P8V_BUILTIN_VSLD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSLD, P8V_BUILTIN_VSLD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VSRD, P8V_BUILTIN_VSRD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSRD, P8V_BUILTIN_VSRD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRAD,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRD,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_bool_V2DI, 0 },
+ { P8V_BUILTIN_VEC_VSUBUDM, P8V_BUILTIN_VSUBUDM,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
+
+ { P8V_BUILTIN_VEC_VUPKHSW, P8V_BUILTIN_VUPKHSW,
+ RS6000_BTI_V2DI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VUPKHSW, P8V_BUILTIN_VUPKHSW,
+ RS6000_BTI_bool_V2DI, RS6000_BTI_bool_V4SI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VUPKLSW, P8V_BUILTIN_VUPKLSW,
+ RS6000_BTI_V2DI, RS6000_BTI_V4SI, 0, 0 },
+ { P8V_BUILTIN_VEC_VUPKLSW, P8V_BUILTIN_VUPKLSW,
+ RS6000_BTI_bool_V2DI, RS6000_BTI_bool_V4SI, 0, 0 },
+
+ { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
+ RS6000_BTI_V16QI, 0, 0, 0 },
+ { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
+ RS6000_BTI_unsigned_V16QI, 0, 0, 0 },
+
/* Crypto builtins. */
{ CRYPTO_BUILTIN_VPERMXOR, CRYPTO_BUILTIN_VPERMXOR_V16QI,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
@@ -3822,11 +4220,20 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
TREE_USED (decl) = 1;
TREE_TYPE (decl) = arg1_type;
TREE_READONLY (decl) = TYPE_READONLY (arg1_type);
- DECL_INITIAL (decl) = arg1;
- stmt = build1 (DECL_EXPR, arg1_type, decl);
- TREE_ADDRESSABLE (decl) = 1;
- SET_EXPR_LOCATION (stmt, loc);
- stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+ if (c_dialect_cxx ())
+ {
+ stmt = build4 (TARGET_EXPR, arg1_type, decl, arg1,
+ NULL_TREE, NULL_TREE);
+ SET_EXPR_LOCATION (stmt, loc);
+ }
+ else
+ {
+ DECL_INITIAL (decl) = arg1;
+ stmt = build1 (DECL_EXPR, arg1_type, decl);
+ TREE_ADDRESSABLE (decl) = 1;
+ SET_EXPR_LOCATION (stmt, loc);
+ stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+ }
innerptrtype = build_pointer_type (arg1_inner_type);
@@ -3901,11 +4308,20 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
TREE_USED (decl) = 1;
TREE_TYPE (decl) = arg1_type;
TREE_READONLY (decl) = TYPE_READONLY (arg1_type);
- DECL_INITIAL (decl) = arg1;
- stmt = build1 (DECL_EXPR, arg1_type, decl);
- TREE_ADDRESSABLE (decl) = 1;
- SET_EXPR_LOCATION (stmt, loc);
- stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+ if (c_dialect_cxx ())
+ {
+ stmt = build4 (TARGET_EXPR, arg1_type, decl, arg1,
+ NULL_TREE, NULL_TREE);
+ SET_EXPR_LOCATION (stmt, loc);
+ }
+ else
+ {
+ DECL_INITIAL (decl) = arg1;
+ stmt = build1 (DECL_EXPR, arg1_type, decl);
+ TREE_ADDRESSABLE (decl) = 1;
+ SET_EXPR_LOCATION (stmt, loc);
+ stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+ }
innerptrtype = build_pointer_type (arg1_inner_type);
diff --git a/gcc/config/rs6000/rs6000-opts.h b/gcc/config/rs6000/rs6000-opts.h
index e143a4ca203..d528a4fd87a 100644
--- a/gcc/config/rs6000/rs6000-opts.h
+++ b/gcc/config/rs6000/rs6000-opts.h
@@ -30,21 +30,22 @@
/* Processor type. Order must match cpu attribute in MD file. */
enum processor_type
{
- PROCESSOR_RS64A,
- PROCESSOR_MPCCORE,
- PROCESSOR_PPC403,
- PROCESSOR_PPC405,
- PROCESSOR_PPC440,
- PROCESSOR_PPC476,
PROCESSOR_PPC601,
PROCESSOR_PPC603,
PROCESSOR_PPC604,
PROCESSOR_PPC604e,
PROCESSOR_PPC620,
PROCESSOR_PPC630,
+
PROCESSOR_PPC750,
PROCESSOR_PPC7400,
PROCESSOR_PPC7450,
+
+ PROCESSOR_PPC403,
+ PROCESSOR_PPC405,
+ PROCESSOR_PPC440,
+ PROCESSOR_PPC476,
+
PROCESSOR_PPC8540,
PROCESSOR_PPC8548,
PROCESSOR_PPCE300C2,
@@ -53,16 +54,21 @@ enum processor_type
PROCESSOR_PPCE500MC64,
PROCESSOR_PPCE5500,
PROCESSOR_PPCE6500,
+
PROCESSOR_POWER4,
PROCESSOR_POWER5,
PROCESSOR_POWER6,
PROCESSOR_POWER7,
+ PROCESSOR_POWER8,
+
+ PROCESSOR_RS64A,
+ PROCESSOR_MPCCORE,
PROCESSOR_CELL,
PROCESSOR_PPCA2,
- PROCESSOR_TITAN,
- PROCESSOR_POWER8
+ PROCESSOR_TITAN
};
+
/* FP processor type. */
enum fpu_type_t
{
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index d9bcf1a41ed..02836ecea6d 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -50,6 +50,7 @@ extern rtx rs6000_got_register (rtx);
extern rtx find_addr_reg (rtx);
extern rtx gen_easy_altivec_constant (rtx);
extern const char *output_vec_const_move (rtx *);
+extern const char *rs6000_output_move_128bit (rtx *);
extern void rs6000_expand_vector_init (rtx, rtx);
extern void paired_expand_vector_init (rtx, rtx);
extern void rs6000_expand_vector_set (rtx, rtx, int);
@@ -70,6 +71,8 @@ extern int insvdi_rshift_rlwimi_p (rtx, rtx, rtx);
extern int registers_ok_for_quad_peep (rtx, rtx);
extern int mems_ok_for_quad_peep (rtx, rtx);
extern bool gpr_or_gpr_p (rtx, rtx);
+extern bool direct_move_p (rtx, rtx);
+extern bool quad_load_store_p (rtx, rtx);
extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
enum reg_class);
extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index cb6876051d7..55273ab81bd 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -292,6 +292,39 @@ typedef rtx (*gen_2arg_fn_t) (rtx, rtx, rtx);
don't link in rs6000-c.c, so we can't call it directly. */
void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT, HOST_WIDE_INT);
+/* Simplfy register classes into simpler classifications. We assume
+ GPR_REG_TYPE - FPR_REG_TYPE are ordered so that we can use a simple range
+ check for standard register classes (gpr/floating/altivec/vsx) and
+ floating/vector classes (float/altivec/vsx). */
+
+enum rs6000_reg_type {
+ NO_REG_TYPE,
+ PSEUDO_REG_TYPE,
+ GPR_REG_TYPE,
+ VSX_REG_TYPE,
+ ALTIVEC_REG_TYPE,
+ FPR_REG_TYPE,
+ SPR_REG_TYPE,
+ CR_REG_TYPE,
+ SPE_ACC_TYPE,
+ SPEFSCR_REG_TYPE
+};
+
+/* Map register class to register type. */
+static enum rs6000_reg_type reg_class_to_reg_type[N_REG_CLASSES];
+
+/* First/last register type for the 'normal' register types (i.e. general
+ purpose, floating point, altivec, and VSX registers). */
+#define IS_STD_REG_TYPE(RTYPE) IN_RANGE(RTYPE, GPR_REG_TYPE, FPR_REG_TYPE)
+
+#define IS_FP_VECT_REG_TYPE(RTYPE) IN_RANGE(RTYPE, VSX_REG_TYPE, FPR_REG_TYPE)
+
+/* Direct moves to/from vsx/gpr registers that need an additional register to
+ do the move. */
+static enum insn_code reload_fpr_gpr[NUM_MACHINE_MODES];
+static enum insn_code reload_gpr_vsx[NUM_MACHINE_MODES];
+static enum insn_code reload_vsx_gpr[NUM_MACHINE_MODES];
+
/* Target cpu costs. */
@@ -1042,6 +1075,13 @@ static void rs6000_print_isa_options (FILE *, int, const char *,
static void rs6000_print_builtin_options (FILE *, int, const char *,
HOST_WIDE_INT);
+static enum rs6000_reg_type register_to_reg_type (rtx, bool *);
+static bool rs6000_secondary_reload_move (enum rs6000_reg_type,
+ enum rs6000_reg_type,
+ enum machine_mode,
+ secondary_reload_info *,
+ bool);
+
/* Hash table stuff for keeping track of TOC entries. */
struct GTY(()) toc_hash_struct
@@ -1587,8 +1627,7 @@ rs6000_hard_regno_mode_ok (int regno, enum machine_mode mode)
return ALTIVEC_REGNO_P (last_regno);
}
- /* Allow TImode in all VSX registers if the user asked for it. Note, PTImode
- can only go in GPRs. */
+ /* Allow TImode in all VSX registers if the user asked for it. */
if (mode == TImode && TARGET_VSX_TIMODE && VSX_REGNO_P (regno))
return 1;
@@ -2154,6 +2193,36 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
rs6000_regno_regclass[ARG_POINTER_REGNUM] = BASE_REGS;
rs6000_regno_regclass[FRAME_POINTER_REGNUM] = BASE_REGS;
+ /* Precalculate register class to simpler reload register class. We don't
+ need all of the register classes that are combinations of different
+ classes, just the simple ones that have constraint letters. */
+ for (c = 0; c < N_REG_CLASSES; c++)
+ reg_class_to_reg_type[c] = NO_REG_TYPE;
+
+ reg_class_to_reg_type[(int)GENERAL_REGS] = GPR_REG_TYPE;
+ reg_class_to_reg_type[(int)BASE_REGS] = GPR_REG_TYPE;
+ reg_class_to_reg_type[(int)VSX_REGS] = VSX_REG_TYPE;
+ reg_class_to_reg_type[(int)VRSAVE_REGS] = SPR_REG_TYPE;
+ reg_class_to_reg_type[(int)VSCR_REGS] = SPR_REG_TYPE;
+ reg_class_to_reg_type[(int)LINK_REGS] = SPR_REG_TYPE;
+ reg_class_to_reg_type[(int)CTR_REGS] = SPR_REG_TYPE;
+ reg_class_to_reg_type[(int)LINK_OR_CTR_REGS] = SPR_REG_TYPE;
+ reg_class_to_reg_type[(int)CR_REGS] = CR_REG_TYPE;
+ reg_class_to_reg_type[(int)CR0_REGS] = CR_REG_TYPE;
+ reg_class_to_reg_type[(int)SPE_ACC_REGS] = SPE_ACC_TYPE;
+ reg_class_to_reg_type[(int)SPEFSCR_REGS] = SPEFSCR_REG_TYPE;
+
+ if (TARGET_VSX)
+ {
+ reg_class_to_reg_type[(int)FLOAT_REGS] = VSX_REG_TYPE;
+ reg_class_to_reg_type[(int)ALTIVEC_REGS] = VSX_REG_TYPE;
+ }
+ else
+ {
+ reg_class_to_reg_type[(int)FLOAT_REGS] = FPR_REG_TYPE;
+ reg_class_to_reg_type[(int)ALTIVEC_REGS] = ALTIVEC_REG_TYPE;
+ }
+
/* Precalculate vector information, this must be set up before the
rs6000_hard_regno_nregs_internal below. */
for (m = 0; m < NUM_MACHINE_MODES; ++m)
@@ -2305,7 +2374,15 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
if (TARGET_LFIWZX)
rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
- /* Set up the reload helper functions. */
+ /* Setup the direct move combinations. */
+ for (m = 0; m < NUM_MACHINE_MODES; ++m)
+ {
+ reload_fpr_gpr[m] = CODE_FOR_nothing;
+ reload_gpr_vsx[m] = CODE_FOR_nothing;
+ reload_vsx_gpr[m] = CODE_FOR_nothing;
+ }
+
+ /* Set up the reload helper and direct move functions. */
if (TARGET_VSX || TARGET_ALTIVEC)
{
if (TARGET_64BIT)
@@ -2329,11 +2406,47 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
rs6000_vector_reload[DDmode][0] = CODE_FOR_reload_dd_di_store;
rs6000_vector_reload[DDmode][1] = CODE_FOR_reload_dd_di_load;
}
+ if (TARGET_P8_VECTOR)
+ {
+ rs6000_vector_reload[SFmode][0] = CODE_FOR_reload_sf_di_store;
+ rs6000_vector_reload[SFmode][1] = CODE_FOR_reload_sf_di_load;
+ rs6000_vector_reload[SDmode][0] = CODE_FOR_reload_sd_di_store;
+ rs6000_vector_reload[SDmode][1] = CODE_FOR_reload_sd_di_load;
+ }
if (TARGET_VSX_TIMODE)
{
rs6000_vector_reload[TImode][0] = CODE_FOR_reload_ti_di_store;
rs6000_vector_reload[TImode][1] = CODE_FOR_reload_ti_di_load;
}
+ if (TARGET_DIRECT_MOVE)
+ {
+ if (TARGET_POWERPC64)
+ {
+ reload_gpr_vsx[TImode] = CODE_FOR_reload_gpr_from_vsxti;
+ reload_gpr_vsx[V2DFmode] = CODE_FOR_reload_gpr_from_vsxv2df;
+ reload_gpr_vsx[V2DImode] = CODE_FOR_reload_gpr_from_vsxv2di;
+ reload_gpr_vsx[V4SFmode] = CODE_FOR_reload_gpr_from_vsxv4sf;
+ reload_gpr_vsx[V4SImode] = CODE_FOR_reload_gpr_from_vsxv4si;
+ reload_gpr_vsx[V8HImode] = CODE_FOR_reload_gpr_from_vsxv8hi;
+ reload_gpr_vsx[V16QImode] = CODE_FOR_reload_gpr_from_vsxv16qi;
+ reload_gpr_vsx[SFmode] = CODE_FOR_reload_gpr_from_vsxsf;
+
+ reload_vsx_gpr[TImode] = CODE_FOR_reload_vsx_from_gprti;
+ reload_vsx_gpr[V2DFmode] = CODE_FOR_reload_vsx_from_gprv2df;
+ reload_vsx_gpr[V2DImode] = CODE_FOR_reload_vsx_from_gprv2di;
+ reload_vsx_gpr[V4SFmode] = CODE_FOR_reload_vsx_from_gprv4sf;
+ reload_vsx_gpr[V4SImode] = CODE_FOR_reload_vsx_from_gprv4si;
+ reload_vsx_gpr[V8HImode] = CODE_FOR_reload_vsx_from_gprv8hi;
+ reload_vsx_gpr[V16QImode] = CODE_FOR_reload_vsx_from_gprv16qi;
+ reload_vsx_gpr[SFmode] = CODE_FOR_reload_vsx_from_gprsf;
+ }
+ else
+ {
+ reload_fpr_gpr[DImode] = CODE_FOR_reload_fpr_from_gprdi;
+ reload_fpr_gpr[DDmode] = CODE_FOR_reload_fpr_from_gprdd;
+ reload_fpr_gpr[DFmode] = CODE_FOR_reload_fpr_from_gprdf;
+ }
+ }
}
else
{
@@ -2356,6 +2469,13 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
rs6000_vector_reload[DDmode][0] = CODE_FOR_reload_dd_si_store;
rs6000_vector_reload[DDmode][1] = CODE_FOR_reload_dd_si_load;
}
+ if (TARGET_P8_VECTOR)
+ {
+ rs6000_vector_reload[SFmode][0] = CODE_FOR_reload_sf_si_store;
+ rs6000_vector_reload[SFmode][1] = CODE_FOR_reload_sf_si_load;
+ rs6000_vector_reload[SDmode][0] = CODE_FOR_reload_sd_si_store;
+ rs6000_vector_reload[SDmode][1] = CODE_FOR_reload_sd_si_load;
+ }
if (TARGET_VSX_TIMODE)
{
rs6000_vector_reload[TImode][0] = CODE_FOR_reload_ti_si_store;
@@ -2916,6 +3036,16 @@ rs6000_option_override_internal (bool global_init_p)
rs6000_isa_flags &= ~OPTION_MASK_VSX_TIMODE;
}
+ /* The quad memory instructions only works in 64-bit mode. In 32-bit mode,
+ silently turn off quad memory mode. */
+ if (TARGET_QUAD_MEMORY && !TARGET_POWERPC64)
+ {
+ if ((rs6000_isa_flags_explicit & OPTION_MASK_QUAD_MEMORY) != 0)
+ warning (0, N_("-mquad-memory requires 64-bit mode"));
+
+ rs6000_isa_flags &= ~OPTION_MASK_QUAD_MEMORY;
+ }
+
if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
rs6000_print_isa_options (stderr, 0, "after defaults", rs6000_isa_flags);
@@ -3042,7 +3172,8 @@ rs6000_option_override_internal (bool global_init_p)
/* Place FP constants in the constant pool instead of TOC
if section anchors enabled. */
- if (flag_section_anchors)
+ if (flag_section_anchors
+ && !global_options_set.x_TARGET_NO_FP_IN_TOC)
TARGET_NO_FP_IN_TOC = 1;
if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
@@ -4082,6 +4213,22 @@ rs6000_builtin_vectorized_function (tree fndecl, tree type_out,
enum built_in_function fn = DECL_FUNCTION_CODE (fndecl);
switch (fn)
{
+ case BUILT_IN_CLZIMAX:
+ case BUILT_IN_CLZLL:
+ case BUILT_IN_CLZL:
+ case BUILT_IN_CLZ:
+ if (TARGET_P8_VECTOR && in_mode == out_mode && out_n == in_n)
+ {
+ if (out_mode == QImode && out_n == 16)
+ return rs6000_builtin_decls[P8V_BUILTIN_VCLZB];
+ else if (out_mode == HImode && out_n == 8)
+ return rs6000_builtin_decls[P8V_BUILTIN_VCLZH];
+ else if (out_mode == SImode && out_n == 4)
+ return rs6000_builtin_decls[P8V_BUILTIN_VCLZW];
+ else if (out_mode == DImode && out_n == 2)
+ return rs6000_builtin_decls[P8V_BUILTIN_VCLZD];
+ }
+ break;
case BUILT_IN_COPYSIGN:
if (VECTOR_UNIT_VSX_P (V2DFmode)
&& out_mode == DFmode && out_n == 2
@@ -4097,6 +4244,22 @@ rs6000_builtin_vectorized_function (tree fndecl, tree type_out,
if (VECTOR_UNIT_ALTIVEC_P (V4SFmode))
return rs6000_builtin_decls[ALTIVEC_BUILTIN_COPYSIGN_V4SF];
break;
+ case BUILT_IN_POPCOUNTIMAX:
+ case BUILT_IN_POPCOUNTLL:
+ case BUILT_IN_POPCOUNTL:
+ case BUILT_IN_POPCOUNT:
+ if (TARGET_P8_VECTOR && in_mode == out_mode && out_n == in_n)
+ {
+ if (out_mode == QImode && out_n == 16)
+ return rs6000_builtin_decls[P8V_BUILTIN_VPOPCNTB];
+ else if (out_mode == HImode && out_n == 8)
+ return rs6000_builtin_decls[P8V_BUILTIN_VPOPCNTH];
+ else if (out_mode == SImode && out_n == 4)
+ return rs6000_builtin_decls[P8V_BUILTIN_VPOPCNTW];
+ else if (out_mode == DImode && out_n == 2)
+ return rs6000_builtin_decls[P8V_BUILTIN_VPOPCNTD];
+ }
+ break;
case BUILT_IN_SQRT:
if (VECTOR_UNIT_VSX_P (V2DFmode)
&& out_mode == DFmode && out_n == 2
@@ -4955,8 +5118,11 @@ rs6000_expand_vector_init (rtx target, rtx vals)
{
rtx freg = gen_reg_rtx (V4SFmode);
rtx sreg = force_reg (SFmode, XVECEXP (vals, 0, 0));
+ rtx cvt = ((TARGET_XSCVDPSPN)
+ ? gen_vsx_xscvdpspn_scalar (freg, sreg)
+ : gen_vsx_xscvdpsp_scalar (freg, sreg));
- emit_insn (gen_vsx_xscvdpsp_scalar (freg, sreg));
+ emit_insn (cvt);
emit_insn (gen_vsx_xxspltw_v4sf (target, freg, const0_rtx));
}
else
@@ -5339,6 +5505,72 @@ gpr_or_gpr_p (rtx op0, rtx op1)
|| (REG_P (op1) && INT_REGNO_P (REGNO (op1))));
}
+/* Return true if this is a move direct operation between GPR registers and
+ floating point/VSX registers. */
+
+bool
+direct_move_p (rtx op0, rtx op1)
+{
+ int regno0, regno1;
+
+ if (!REG_P (op0) || !REG_P (op1))
+ return false;
+
+ if (!TARGET_DIRECT_MOVE && !TARGET_MFPGPR)
+ return false;
+
+ regno0 = REGNO (op0);
+ regno1 = REGNO (op1);
+ if (regno0 >= FIRST_PSEUDO_REGISTER || regno1 >= FIRST_PSEUDO_REGISTER)
+ return false;
+
+ if (INT_REGNO_P (regno0))
+ return (TARGET_DIRECT_MOVE) ? VSX_REGNO_P (regno1) : FP_REGNO_P (regno1);
+
+ else if (INT_REGNO_P (regno1))
+ {
+ if (TARGET_MFPGPR && FP_REGNO_P (regno0))
+ return true;
+
+ else if (TARGET_DIRECT_MOVE && VSX_REGNO_P (regno0))
+ return true;
+ }
+
+ return false;
+}
+
+/* Return true if this is a load or store quad operation. */
+
+bool
+quad_load_store_p (rtx op0, rtx op1)
+{
+ bool ret;
+
+ if (!TARGET_QUAD_MEMORY)
+ ret = false;
+
+ else if (REG_P (op0) && MEM_P (op1))
+ ret = (quad_int_reg_operand (op0, GET_MODE (op0))
+ && quad_memory_operand (op1, GET_MODE (op1))
+ && !reg_overlap_mentioned_p (op0, op1));
+
+ else if (MEM_P (op0) && REG_P (op1))
+ ret = (quad_memory_operand (op0, GET_MODE (op0))
+ && quad_int_reg_operand (op1, GET_MODE (op1)));
+
+ else
+ ret = false;
+
+ if (TARGET_DEBUG_ADDR)
+ {
+ fprintf (stderr, "\n========== quad_load_store, return %s\n",
+ ret ? "true" : "false");
+ debug_rtx (gen_rtx_SET (VOIDmode, op0, op1));
+ }
+
+ return ret;
+}
+
/* Given an address, return a constant offset term if one exists. */
static rtx
@@ -5474,91 +5706,102 @@ virtual_stack_registers_memory_p (rtx op)
&& regnum <= LAST_VIRTUAL_POINTER_REGISTER);
}
-/* Return true if memory accesses to OP are known to never straddle
- a 32k boundary. */
+/* Return true if a MODE sized memory accesses to OP plus OFFSET
+ is known to not straddle a 32k boundary. */
static bool
offsettable_ok_by_alignment (rtx op, HOST_WIDE_INT offset,
enum machine_mode mode)
{
tree decl, type;
- unsigned HOST_WIDE_INT dsize, dalign;
+ unsigned HOST_WIDE_INT dsize, dalign, lsb, mask;
if (GET_CODE (op) != SYMBOL_REF)
return false;
+ dsize = GET_MODE_SIZE (mode);
decl = SYMBOL_REF_DECL (op);
if (!decl)
{
- if (GET_MODE_SIZE (mode) == 0)
+ if (dsize == 0)
return false;
/* -fsection-anchors loses the original SYMBOL_REF_DECL when
replacing memory addresses with an anchor plus offset. We
could find the decl by rummaging around in the block->objects
VEC for the given offset but that seems like too much work. */
- dalign = 1;
+ dalign = BITS_PER_UNIT;
if (SYMBOL_REF_HAS_BLOCK_INFO_P (op)
&& SYMBOL_REF_ANCHOR_P (op)
&& SYMBOL_REF_BLOCK (op) != NULL)
{
struct object_block *block = SYMBOL_REF_BLOCK (op);
- HOST_WIDE_INT lsb, mask;
- /* Given the alignment of the block.. */
dalign = block->alignment;
- mask = dalign / BITS_PER_UNIT - 1;
-
- /* ..and the combined offset of the anchor and any offset
- to this block object.. */
offset += SYMBOL_REF_BLOCK_OFFSET (op);
- lsb = offset & -offset;
+ }
+ else if (CONSTANT_POOL_ADDRESS_P (op))
+ {
+ /* It would be nice to have get_pool_align().. */
+ enum machine_mode cmode = get_pool_mode (op);
- /* ..find how many bits of the alignment we know for the
- object. */
- mask &= lsb - 1;
- dalign = mask + 1;
+ dalign = GET_MODE_ALIGNMENT (cmode);
}
- return dalign >= GET_MODE_SIZE (mode);
}
-
- if (DECL_P (decl))
+ else if (DECL_P (decl))
{
- if (TREE_CODE (decl) == FUNCTION_DECL)
- return true;
+ dalign = DECL_ALIGN (decl);
- if (!DECL_SIZE_UNIT (decl))
- return false;
+ if (dsize == 0)
+ {
+ /* Allow BLKmode when the entire object is known to not
+ cross a 32k boundary. */
+ if (!DECL_SIZE_UNIT (decl))
+ return false;
- if (!host_integerp (DECL_SIZE_UNIT (decl), 1))
- return false;
+ if (!host_integerp (DECL_SIZE_UNIT (decl), 1))
+ return false;
- dsize = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
- if (dsize > 32768)
- return false;
+ dsize = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
+ if (dsize > 32768)
+ return false;
- dalign = DECL_ALIGN_UNIT (decl);
- return dalign >= dsize;
+ return dalign / BITS_PER_UNIT >= dsize;
+ }
}
+ else
+ {
+ type = TREE_TYPE (decl);
- type = TREE_TYPE (decl);
+ dalign = TYPE_ALIGN (type);
+ if (CONSTANT_CLASS_P (decl))
+ dalign = CONSTANT_ALIGNMENT (decl, dalign);
+ else
+ dalign = DATA_ALIGNMENT (decl, dalign);
- if (TREE_CODE (decl) == STRING_CST)
- dsize = TREE_STRING_LENGTH (decl);
- else if (TYPE_SIZE_UNIT (type)
- && host_integerp (TYPE_SIZE_UNIT (type), 1))
- dsize = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
- else
- return false;
- if (dsize > 32768)
- return false;
+ if (dsize == 0)
+ {
+ /* BLKmode, check the entire object. */
+ if (TREE_CODE (decl) == STRING_CST)
+ dsize = TREE_STRING_LENGTH (decl);
+ else if (TYPE_SIZE_UNIT (type)
+ && host_integerp (TYPE_SIZE_UNIT (type), 1))
+ dsize = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
+ else
+ return false;
+ if (dsize > 32768)
+ return false;
+
+ return dalign / BITS_PER_UNIT >= dsize;
+ }
+ }
+
+ /* Find how many bits of the alignment we know for this access. */
+ mask = dalign / BITS_PER_UNIT - 1;
+ lsb = offset & -offset;
+ mask &= lsb - 1;
+ dalign = mask + 1;
- dalign = TYPE_ALIGN (type);
- if (CONSTANT_CLASS_P (decl))
- dalign = CONSTANT_ALIGNMENT (decl, dalign);
- else
- dalign = DATA_ALIGNMENT (decl, dalign);
- dalign /= BITS_PER_UNIT;
return dalign >= dsize;
}
@@ -5846,8 +6089,11 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
if (GET_CODE (x) == PLUS && XEXP (x, 1) == const0_rtx)
return force_reg (Pmode, XEXP (x, 0));
+ /* For TImode with load/store quad, restrict addresses to just a single
+ pointer, so it works with both GPRs and VSX registers. */
/* Make sure both operands are registers. */
- else if (GET_CODE (x) == PLUS)
+ else if (GET_CODE (x) == PLUS
+ && (mode != TImode || !TARGET_QUAD_MEMORY))
return gen_rtx_PLUS (Pmode,
force_reg (Pmode, XEXP (x, 0)),
force_reg (Pmode, XEXP (x, 1)));
@@ -6504,7 +6750,6 @@ use_toc_relative_ref (rtx sym)
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (sym),
get_pool_mode (sym)))
|| (TARGET_CMODEL == CMODEL_MEDIUM
- && !CONSTANT_POOL_ADDRESS_P (sym)
&& SYMBOL_REF_LOCAL_P (sym)));
}
@@ -6802,6 +7047,13 @@ rs6000_legitimate_address_p (enum machine_mode mode, rtx x, bool reg_ok_strict)
if (reg_offset_p
&& legitimate_constant_pool_address_p (x, mode, reg_ok_strict))
return 1;
+ /* For TImode, if we have load/store quad, only allow register indirect
+ addresses. This will allow the values to go in either GPRs or VSX
+ registers without reloading. The vector types would tend to go into VSX
+ registers, so we allow REG+REG, while TImode seems somewhat split, in that
+ some uses are GPR based, and some VSX based. */
+ if (mode == TImode && TARGET_QUAD_MEMORY)
+ return 0;
/* If not REG_OK_STRICT (before reload) let pass any stack offset. */
if (! reg_ok_strict
&& reg_offset_p
@@ -9314,20 +9566,17 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG
&& cfun->va_list_gpr_size)
{
- int nregs = GP_ARG_NUM_REG - first_reg_offset;
+ int n_gpr, nregs = GP_ARG_NUM_REG - first_reg_offset;
if (va_list_gpr_counter_field)
- {
- /* V4 va_list_gpr_size counts number of registers needed. */
- if (nregs > cfun->va_list_gpr_size)
- nregs = cfun->va_list_gpr_size;
- }
+ /* V4 va_list_gpr_size counts number of registers needed. */
+ n_gpr = cfun->va_list_gpr_size;
else
- {
- /* char * va_list instead counts number of bytes needed. */
- if (nregs > cfun->va_list_gpr_size / reg_size)
- nregs = cfun->va_list_gpr_size / reg_size;
- }
+ /* char * va_list instead counts number of bytes needed. */
+ n_gpr = (cfun->va_list_gpr_size + reg_size - 1) / reg_size;
+
+ if (nregs > n_gpr)
+ nregs = n_gpr;
mem = gen_rtx_MEM (BLKmode,
plus_constant (Pmode, save_area,
@@ -12857,6 +13106,7 @@ builtin_function_type (enum machine_mode mode_ret, enum machine_mode mode_arg0,
{
/* unsigned 1 argument functions. */
case CRYPTO_BUILTIN_VSBOX:
+ case P8V_BUILTIN_VGBBD:
h.uns_p[0] = 1;
h.uns_p[1] = 1;
break;
@@ -13947,29 +14197,226 @@ rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return NULL_TREE;
}
-enum reload_reg_type {
- GPR_REGISTER_TYPE,
- VECTOR_REGISTER_TYPE,
- OTHER_REGISTER_TYPE
-};
+/* Classify a register type. Because the FMRGOW/FMRGEW instructions only work
+ on traditional floating point registers, and the VMRGOW/VMRGEW instructions
+ only work on the traditional altivec registers, note if an altivec register
+ was choosen. */
-static enum reload_reg_type
-rs6000_reload_register_type (enum reg_class rclass)
+static enum rs6000_reg_type
+register_to_reg_type (rtx reg, bool *is_altivec)
{
- switch (rclass)
+ HOST_WIDE_INT regno;
+ enum reg_class rclass;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+
+ if (!REG_P (reg))
+ return NO_REG_TYPE;
+
+ regno = REGNO (reg);
+ if (regno >= FIRST_PSEUDO_REGISTER)
{
- case GENERAL_REGS:
- case BASE_REGS:
- return GPR_REGISTER_TYPE;
+ if (!lra_in_progress && !reload_in_progress && !reload_completed)
+ return PSEUDO_REG_TYPE;
- case FLOAT_REGS:
- case ALTIVEC_REGS:
- case VSX_REGS:
- return VECTOR_REGISTER_TYPE;
+ regno = true_regnum (reg);
+ if (regno < 0 || regno >= FIRST_PSEUDO_REGISTER)
+ return PSEUDO_REG_TYPE;
+ }
- default:
- return OTHER_REGISTER_TYPE;
+ gcc_assert (regno >= 0);
+
+ if (is_altivec && ALTIVEC_REGNO_P (regno))
+ *is_altivec = true;
+
+ rclass = rs6000_regno_regclass[regno];
+ return reg_class_to_reg_type[(int)rclass];
+}
+
+/* Helper function for rs6000_secondary_reload to return true if a move to a
+ different register classe is really a simple move. */
+
+static bool
+rs6000_secondary_reload_simple_move (enum rs6000_reg_type to_type,
+ enum rs6000_reg_type from_type,
+ enum machine_mode mode)
+{
+ int size;
+
+ /* Add support for various direct moves available. In this function, we only
+ look at cases where we don't need any extra registers, and one or more
+ simple move insns are issued. At present, 32-bit integers are not allowed
+ in FPR/VSX registers. Single precision binary floating is not a simple
+ move because we need to convert to the single precision memory layout.
+ The 4-byte SDmode can be moved. */
+ size = GET_MODE_SIZE (mode);
+ if (TARGET_DIRECT_MOVE
+ && ((mode == SDmode) || (TARGET_POWERPC64 && size == 8))
+ && ((to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
+ || (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)))
+ return true;
+
+ else if (TARGET_MFPGPR && TARGET_POWERPC64 && size == 8
+ && ((to_type == GPR_REG_TYPE && from_type == FPR_REG_TYPE)
+ || (to_type == FPR_REG_TYPE && from_type == GPR_REG_TYPE)))
+ return true;
+
+ else if ((size == 4 || (TARGET_POWERPC64 && size == 8))
+ && ((to_type == GPR_REG_TYPE && from_type == SPR_REG_TYPE)
+ || (to_type == SPR_REG_TYPE && from_type == GPR_REG_TYPE)))
+ return true;
+
+ return false;
+}
+
+/* Power8 helper function for rs6000_secondary_reload, handle all of the
+ special direct moves that involve allocating an extra register, return the
+ insn code of the helper function if there is such a function or
+ CODE_FOR_nothing if not. */
+
+static bool
+rs6000_secondary_reload_direct_move (enum rs6000_reg_type to_type,
+ enum rs6000_reg_type from_type,
+ enum machine_mode mode,
+ secondary_reload_info *sri,
+ bool altivec_p)
+{
+ bool ret = false;
+ enum insn_code icode = CODE_FOR_nothing;
+ int cost = 0;
+ int size = GET_MODE_SIZE (mode);
+
+ if (TARGET_POWERPC64)
+ {
+ if (size == 16)
+ {
+ /* Handle moving 128-bit values from GPRs to VSX point registers on
+ power8 when running in 64-bit mode using XXPERMDI to glue the two
+ 64-bit values back together. */
+ if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
+ {
+ cost = 3; /* 2 mtvsrd's, 1 xxpermdi. */
+ icode = reload_vsx_gpr[(int)mode];
+ }
+
+ /* Handle moving 128-bit values from VSX point registers to GPRs on
+ power8 when running in 64-bit mode using XXPERMDI to get access to the
+ bottom 64-bit value. */
+ else if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
+ {
+ cost = 3; /* 2 mfvsrd's, 1 xxpermdi. */
+ icode = reload_gpr_vsx[(int)mode];
+ }
+ }
+
+ else if (mode == SFmode)
+ {
+ if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
+ {
+ cost = 3; /* xscvdpspn, mfvsrd, and. */
+ icode = reload_gpr_vsx[(int)mode];
+ }
+
+ else if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
+ {
+ cost = 2; /* mtvsrz, xscvspdpn. */
+ icode = reload_vsx_gpr[(int)mode];
+ }
+ }
}
+
+ if (TARGET_POWERPC64 && size == 16)
+ {
+ /* Handle moving 128-bit values from GPRs to VSX point registers on
+ power8 when running in 64-bit mode using XXPERMDI to glue the two
+ 64-bit values back together. */
+ if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
+ {
+ cost = 3; /* 2 mtvsrd's, 1 xxpermdi. */
+ icode = reload_vsx_gpr[(int)mode];
+ }
+
+ /* Handle moving 128-bit values from VSX point registers to GPRs on
+ power8 when running in 64-bit mode using XXPERMDI to get access to the
+ bottom 64-bit value. */
+ else if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
+ {
+ cost = 3; /* 2 mfvsrd's, 1 xxpermdi. */
+ icode = reload_gpr_vsx[(int)mode];
+ }
+ }
+
+ else if (!TARGET_POWERPC64 && size == 8)
+ {
+ /* Handle moving 64-bit values from GPRs to floating point registers on
+ power8 when running in 32-bit mode using FMRGOW to glue the two 32-bit
+ values back together. Altivec register classes must be handled
+ specially since a different instruction is used, and the secondary
+ reload support requires a single instruction class in the scratch
+ register constraint. However, right now TFmode is not allowed in
+ Altivec registers, so the pattern will never match. */
+ if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE && !altivec_p)
+ {
+ cost = 3; /* 2 mtvsrwz's, 1 fmrgow. */
+ icode = reload_fpr_gpr[(int)mode];
+ }
+ }
+
+ if (icode != CODE_FOR_nothing)
+ {
+ ret = true;
+ if (sri)
+ {
+ sri->icode = icode;
+ sri->extra_cost = cost;
+ }
+ }
+
+ return ret;
+}
+
+/* Return whether a move between two register classes can be done either
+ directly (simple move) or via a pattern that uses a single extra temporary
+ (using power8's direct move in this case. */
+
+static bool
+rs6000_secondary_reload_move (enum rs6000_reg_type to_type,
+ enum rs6000_reg_type from_type,
+ enum machine_mode mode,
+ secondary_reload_info *sri,
+ bool altivec_p)
+{
+ /* Fall back to load/store reloads if either type is not a register. */
+ if (to_type == NO_REG_TYPE || from_type == NO_REG_TYPE)
+ return false;
+
+ /* If we haven't allocated registers yet, assume the move can be done for the
+ standard register types. */
+ if ((to_type == PSEUDO_REG_TYPE && from_type == PSEUDO_REG_TYPE)
+ || (to_type == PSEUDO_REG_TYPE && IS_STD_REG_TYPE (from_type))
+ || (from_type == PSEUDO_REG_TYPE && IS_STD_REG_TYPE (to_type)))
+ return true;
+
+ /* Moves to the same set of registers is a simple move for non-specialized
+ registers. */
+ if (to_type == from_type && IS_STD_REG_TYPE (to_type))
+ return true;
+
+ /* Check whether a simple move can be done directly. */
+ if (rs6000_secondary_reload_simple_move (to_type, from_type, mode))
+ {
+ if (sri)
+ {
+ sri->icode = CODE_FOR_nothing;
+ sri->extra_cost = 0;
+ }
+ return true;
+ }
+
+ /* Now check if we can do it in a few steps. */
+ return rs6000_secondary_reload_direct_move (to_type, from_type, mode, sri,
+ altivec_p);
}
/* Inform reload about cases where moving X with a mode MODE to a register in
@@ -13995,11 +14442,32 @@ rs6000_secondary_reload (bool in_p,
bool default_p = false;
sri->icode = CODE_FOR_nothing;
-
- /* Convert vector loads and stores into gprs to use an additional base
- register. */
icode = rs6000_vector_reload[mode][in_p != false];
- if (icode != CODE_FOR_nothing)
+
+ if (REG_P (x) || register_operand (x, mode))
+ {
+ enum rs6000_reg_type to_type = reg_class_to_reg_type[(int)rclass];
+ bool altivec_p = (rclass == ALTIVEC_REGS);
+ enum rs6000_reg_type from_type = register_to_reg_type (x, &altivec_p);
+
+ if (!in_p)
+ {
+ enum rs6000_reg_type exchange = to_type;
+ to_type = from_type;
+ from_type = exchange;
+ }
+
+ if (rs6000_secondary_reload_move (to_type, from_type, mode, sri,
+ altivec_p))
+ {
+ icode = (enum insn_code)sri->icode;
+ default_p = false;
+ ret = NO_REGS;
+ }
+ }
+
+ /* Handle vector moves with reload helper functions. */
+ if (ret == ALL_REGS && icode != CODE_FOR_nothing)
{
ret = NO_REGS;
sri->icode = CODE_FOR_nothing;
@@ -14011,12 +14479,21 @@ rs6000_secondary_reload (bool in_p,
/* Loads to and stores from gprs can do reg+offset, and wouldn't need
an extra register in that case, but it would need an extra
- register if the addressing is reg+reg or (reg+reg)&(-16). */
+ register if the addressing is reg+reg or (reg+reg)&(-16). Special
+ case load/store quad. */
if (rclass == GENERAL_REGS || rclass == BASE_REGS)
{
- if (!legitimate_indirect_address_p (addr, false)
- && !rs6000_legitimate_offset_address_p (PTImode, addr,
- false, true))
+ if (TARGET_POWERPC64 && TARGET_QUAD_MEMORY
+ && GET_MODE_SIZE (mode) == 16
+ && quad_memory_operand (x, mode))
+ {
+ sri->icode = icode;
+ sri->extra_cost = 2;
+ }
+
+ else if (!legitimate_indirect_address_p (addr, false)
+ && !rs6000_legitimate_offset_address_p (PTImode, addr,
+ false, true))
{
sri->icode = icode;
/* account for splitting the loads, and converting the
@@ -14030,7 +14507,7 @@ rs6000_secondary_reload (bool in_p,
else if ((rclass == FLOAT_REGS || rclass == NO_REGS)
&& (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8)
&& (legitimate_indirect_address_p (addr, false)
- || legitimate_indirect_address_p (XEXP (addr, 0), false)
+ || legitimate_indirect_address_p (addr, false)
|| rs6000_legitimate_offset_address_p (mode, addr,
false, true)))
@@ -14082,12 +14559,12 @@ rs6000_secondary_reload (bool in_p,
else
{
enum reg_class xclass = REGNO_REG_CLASS (regno);
- enum reload_reg_type rtype1 = rs6000_reload_register_type (rclass);
- enum reload_reg_type rtype2 = rs6000_reload_register_type (xclass);
+ enum rs6000_reg_type rtype1 = reg_class_to_reg_type[(int)rclass];
+ enum rs6000_reg_type rtype2 = reg_class_to_reg_type[(int)xclass];
/* If memory is needed, use default_secondary_reload to create the
stack slot. */
- if (rtype1 != rtype2 || rtype1 == OTHER_REGISTER_TYPE)
+ if (rtype1 != rtype2 || !IS_STD_REG_TYPE (rtype1))
default_p = true;
else
ret = NO_REGS;
@@ -14097,7 +14574,7 @@ rs6000_secondary_reload (bool in_p,
default_p = true;
}
else if (TARGET_POWERPC64
- && rs6000_reload_register_type (rclass) == GPR_REGISTER_TYPE
+ && reg_class_to_reg_type[(int)rclass] == GPR_REG_TYPE
&& MEM_P (x)
&& GET_MODE_SIZE (GET_MODE (x)) >= UNITS_PER_WORD)
{
@@ -14136,7 +14613,7 @@ rs6000_secondary_reload (bool in_p,
default_p = true;
}
else if (!TARGET_POWERPC64
- && rs6000_reload_register_type (rclass) == GPR_REGISTER_TYPE
+ && reg_class_to_reg_type[(int)rclass] == GPR_REG_TYPE
&& MEM_P (x)
&& GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD)
{
@@ -14699,42 +15176,25 @@ rs6000_debug_preferred_reload_class (rtx x, enum reg_class rclass)
set and vice versa. */
static bool
-rs6000_secondary_memory_needed (enum reg_class class1,
- enum reg_class class2,
+rs6000_secondary_memory_needed (enum reg_class from_class,
+ enum reg_class to_class,
enum machine_mode mode)
{
- if (class1 == class2)
- return false;
-
- /* Under VSX, there are 3 register classes that values could be in (VSX_REGS,
- ALTIVEC_REGS, and FLOAT_REGS). We don't need to use memory to copy
- between these classes. But we need memory for other things that can go in
- FLOAT_REGS like SFmode. */
- if (TARGET_VSX
- && (VECTOR_MEM_VSX_P (mode) || VECTOR_UNIT_VSX_P (mode))
- && (class1 == VSX_REGS || class1 == ALTIVEC_REGS
- || class1 == FLOAT_REGS))
- return (class2 != VSX_REGS && class2 != ALTIVEC_REGS
- && class2 != FLOAT_REGS);
+ enum rs6000_reg_type from_type, to_type;
+ bool altivec_p = ((from_class == ALTIVEC_REGS)
+ || (to_class == ALTIVEC_REGS));
- if (class1 == VSX_REGS || class2 == VSX_REGS)
- return true;
-
- if (class1 == FLOAT_REGS
- && (!TARGET_MFPGPR || !TARGET_POWERPC64
- || ((mode != DFmode)
- && (mode != DDmode)
- && (mode != DImode))))
- return true;
+ /* If a simple/direct move is available, we don't need secondary memory */
+ from_type = reg_class_to_reg_type[(int)from_class];
+ to_type = reg_class_to_reg_type[(int)to_class];
- if (class2 == FLOAT_REGS
- && (!TARGET_MFPGPR || !TARGET_POWERPC64
- || ((mode != DFmode)
- && (mode != DDmode)
- && (mode != DImode))))
- return true;
+ if (rs6000_secondary_reload_move (to_type, from_type, mode,
+ (secondary_reload_info *)0, altivec_p))
+ return false;
- if (class1 == ALTIVEC_REGS || class2 == ALTIVEC_REGS)
+ /* If we have a floating point or vector register class, we need to use
+ memory to transfer the data. */
+ if (IS_FP_VECT_REG_TYPE (from_type) || IS_FP_VECT_REG_TYPE (to_type))
return true;
return false;
@@ -14742,17 +15202,19 @@ rs6000_secondary_memory_needed (enum reg_class class1,
/* Debug version of rs6000_secondary_memory_needed. */
static bool
-rs6000_debug_secondary_memory_needed (enum reg_class class1,
- enum reg_class class2,
+rs6000_debug_secondary_memory_needed (enum reg_class from_class,
+ enum reg_class to_class,
enum machine_mode mode)
{
- bool ret = rs6000_secondary_memory_needed (class1, class2, mode);
+ bool ret = rs6000_secondary_memory_needed (from_class, to_class, mode);
fprintf (stderr,
- "rs6000_secondary_memory_needed, return: %s, class1 = %s, "
- "class2 = %s, mode = %s\n",
- ret ? "true" : "false", reg_class_names[class1],
- reg_class_names[class2], GET_MODE_NAME (mode));
+ "rs6000_secondary_memory_needed, return: %s, from_class = %s, "
+ "to_class = %s, mode = %s\n",
+ ret ? "true" : "false",
+ reg_class_names[from_class],
+ reg_class_names[to_class],
+ GET_MODE_NAME (mode));
return ret;
}
@@ -14958,6 +15420,170 @@ rs6000_debug_cannot_change_mode_class (enum machine_mode from,
return ret;
}
+/* Return a string to do a move operation of 128 bits of data. */
+
+const char *
+rs6000_output_move_128bit (rtx operands[])
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ enum machine_mode mode = GET_MODE (dest);
+ int dest_regno;
+ int src_regno;
+ bool dest_gpr_p, dest_fp_p, dest_av_p, dest_vsx_p;
+ bool src_gpr_p, src_fp_p, src_av_p, src_vsx_p;
+
+ if (REG_P (dest))
+ {
+ dest_regno = REGNO (dest);
+ dest_gpr_p = INT_REGNO_P (dest_regno);
+ dest_fp_p = FP_REGNO_P (dest_regno);
+ dest_av_p = ALTIVEC_REGNO_P (dest_regno);
+ dest_vsx_p = dest_fp_p | dest_av_p;
+ }
+ else
+ {
+ dest_regno = -1;
+ dest_gpr_p = dest_fp_p = dest_av_p = dest_vsx_p = false;
+ }
+
+ if (REG_P (src))
+ {
+ src_regno = REGNO (src);
+ src_gpr_p = INT_REGNO_P (src_regno);
+ src_fp_p = FP_REGNO_P (src_regno);
+ src_av_p = ALTIVEC_REGNO_P (src_regno);
+ src_vsx_p = src_fp_p | src_av_p;
+ }
+ else
+ {
+ src_regno = -1;
+ src_gpr_p = src_fp_p = src_av_p = src_vsx_p = false;
+ }
+
+ /* Register moves. */
+ if (dest_regno >= 0 && src_regno >= 0)
+ {
+ if (dest_gpr_p)
+ {
+ if (src_gpr_p)
+ return "#";
+
+ else if (TARGET_VSX && TARGET_DIRECT_MOVE && src_vsx_p)
+ return "#";
+ }
+
+ else if (TARGET_VSX && dest_vsx_p)
+ {
+ if (src_vsx_p)
+ return "xxlor %x0,%x1,%x1";
+
+ else if (TARGET_DIRECT_MOVE && src_gpr_p)
+ return "#";
+ }
+
+ else if (TARGET_ALTIVEC && dest_av_p && src_av_p)
+ return "vor %0,%1,%1";
+
+ else if (dest_fp_p && src_fp_p)
+ return "#";
+ }
+
+ /* Loads. */
+ else if (dest_regno >= 0 && MEM_P (src))
+ {
+ if (dest_gpr_p)
+ {
+ if (TARGET_QUAD_MEMORY && (dest_regno & 1) == 0
+ && quad_memory_operand (src, mode)
+ && !reg_overlap_mentioned_p (dest, src))
+ {
+ /* lq/stq only has DQ-form, so avoid X-form that %y produces. */
+ return REG_P (XEXP (src, 0)) ? "lq %0,%1" : "lq %0,%y1";
+ }
+ else
+ return "#";
+ }
+
+ else if (TARGET_ALTIVEC && dest_av_p
+ && altivec_indexed_or_indirect_operand (src, mode))
+ return "lvx %0,%y1";
+
+ else if (TARGET_VSX && dest_vsx_p)
+ {
+ if (mode == V16QImode || mode == V8HImode || mode == V4SImode)
+ return "lxvw4x %x0,%y1";
+ else
+ return "lxvd2x %x0,%y1";
+ }
+
+ else if (TARGET_ALTIVEC && dest_av_p)
+ return "lvx %0,%y1";
+
+ else if (dest_fp_p)
+ return "#";
+ }
+
+ /* Stores. */
+ else if (src_regno >= 0 && MEM_P (dest))
+ {
+ if (src_gpr_p)
+ {
+ if (TARGET_QUAD_MEMORY && (src_regno & 1) == 0
+ && quad_memory_operand (dest, mode))
+ {
+ /* lq/stq only has DQ-form, so avoid X-form that %y produces. */
+ return REG_P (XEXP (dest, 0)) ? "stq %1,%0" : "stq %1,%y0";
+ }
+ else
+ return "#";
+ }
+
+ else if (TARGET_ALTIVEC && src_av_p
+ && altivec_indexed_or_indirect_operand (src, mode))
+ return "stvx %1,%y0";
+
+ else if (TARGET_VSX && src_vsx_p)
+ {
+ if (mode == V16QImode || mode == V8HImode || mode == V4SImode)
+ return "stxvw4x %x1,%y0";
+ else
+ return "stxvd2x %x1,%y0";
+ }
+
+ else if (TARGET_ALTIVEC && src_av_p)
+ return "stvx %1,%y0";
+
+ else if (src_fp_p)
+ return "#";
+ }
+
+ /* Constants. */
+ else if (dest_regno >= 0
+ && (GET_CODE (src) == CONST_INT
+ || GET_CODE (src) == CONST_DOUBLE
+ || GET_CODE (src) == CONST_VECTOR))
+ {
+ if (dest_gpr_p)
+ return "#";
+
+ else if (TARGET_VSX && dest_vsx_p && zero_constant (src, mode))
+ return "xxlxor %x0,%x0,%x0";
+
+ else if (TARGET_ALTIVEC && dest_av_p)
+ return output_vec_const_move (operands);
+ }
+
+ if (TARGET_DEBUG_ADDR)
+ {
+ fprintf (stderr, "\n===== Bad 128 bit move:\n");
+ debug_rtx (gen_rtx_SET (VOIDmode, dest, src));
+ }
+
+ gcc_unreachable ();
+}
+
+
/* Given a comparison operation, return the bit number in CCR to test. We
know this is a valid comparison.
@@ -15674,11 +16300,6 @@ print_operand (FILE *file, rtx x, int code)
TOCs and the like. */
gcc_assert (GET_CODE (x) == SYMBOL_REF);
- /* Mark the decl as referenced so that cgraph will output the
- function. */
- if (SYMBOL_REF_DECL (x))
- mark_decl_referenced (SYMBOL_REF_DECL (x));
-
/* For macho, check to see if we need a stub. */
if (TARGET_MACHO)
{
@@ -16087,16 +16708,41 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
{
rtx cmp, or_result, compare_result2;
enum machine_mode op_mode = GET_MODE (op0);
+ bool reverse_p;
if (op_mode == VOIDmode)
op_mode = GET_MODE (op1);
+ /* First reverse the condition codes that aren't directly supported. */
+ switch (code)
+ {
+ case NE:
+ case UNLT:
+ case UNLE:
+ case UNGT:
+ case UNGE:
+ code = reverse_condition_maybe_unordered (code);
+ reverse_p = true;
+ break;
+
+ case EQ:
+ case LT:
+ case LE:
+ case GT:
+ case GE:
+ reverse_p = false;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
/* The E500 FP compare instructions toggle the GT bit (CR bit 1) only.
This explains the following mess. */
switch (code)
{
- case EQ: case UNEQ: case NE: case LTGT:
+ case EQ:
switch (op_mode)
{
case SFmode:
@@ -16122,7 +16768,8 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
}
break;
- case GT: case GTU: case UNGT: case UNGE: case GE: case GEU:
+ case GT:
+ case GE:
switch (op_mode)
{
case SFmode:
@@ -16148,7 +16795,8 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
}
break;
- case LT: case LTU: case UNLT: case UNLE: case LE: case LEU:
+ case LT:
+ case LE:
switch (op_mode)
{
case SFmode:
@@ -16173,24 +16821,16 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
gcc_unreachable ();
}
break;
+
default:
gcc_unreachable ();
}
/* Synthesize LE and GE from LT/GT || EQ. */
- if (code == LE || code == GE || code == LEU || code == GEU)
+ if (code == LE || code == GE)
{
emit_insn (cmp);
- switch (code)
- {
- case LE: code = LT; break;
- case GE: code = GT; break;
- case LEU: code = LT; break;
- case GEU: code = GT; break;
- default: gcc_unreachable ();
- }
-
compare_result2 = gen_reg_rtx (CCFPmode);
/* Do the EQ. */
@@ -16217,23 +16857,18 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode)
default:
gcc_unreachable ();
}
+
emit_insn (cmp);
/* OR them together. */
or_result = gen_reg_rtx (CCFPmode);
cmp = gen_e500_cr_ior_compare (or_result, compare_result,
- compare_result2);
+ compare_result2);
compare_result = or_result;
- code = EQ;
- }
- else
- {
- if (code == NE || code == LTGT)
- code = NE;
- else
- code = EQ;
}
+ code = reverse_p ? NE : EQ;
+
emit_insn (cmp);
}
else
@@ -17113,7 +17748,8 @@ emit_unlikely_jump (rtx cond, rtx label)
}
/* A subroutine of the atomic operation splitters. Emit a load-locked
- instruction in MODE. */
+ instruction in MODE. For QI/HImode, possibly use a pattern than includes
+ the zero_extend operation. */
static void
emit_load_locked (enum machine_mode mode, rtx reg, rtx mem)
@@ -17122,12 +17758,26 @@ emit_load_locked (enum machine_mode mode, rtx reg, rtx mem)
switch (mode)
{
+ case QImode:
+ fn = gen_load_lockedqi;
+ break;
+ case HImode:
+ fn = gen_load_lockedhi;
+ break;
case SImode:
- fn = gen_load_lockedsi;
+ if (GET_MODE (mem) == QImode)
+ fn = gen_load_lockedqi_si;
+ else if (GET_MODE (mem) == HImode)
+ fn = gen_load_lockedhi_si;
+ else
+ fn = gen_load_lockedsi;
break;
case DImode:
fn = gen_load_lockeddi;
break;
+ case TImode:
+ fn = gen_load_lockedti;
+ break;
default:
gcc_unreachable ();
}
@@ -17144,12 +17794,21 @@ emit_store_conditional (enum machine_mode mode, rtx res, rtx mem, rtx val)
switch (mode)
{
+ case QImode:
+ fn = gen_store_conditionalqi;
+ break;
+ case HImode:
+ fn = gen_store_conditionalhi;
+ break;
case SImode:
fn = gen_store_conditionalsi;
break;
case DImode:
fn = gen_store_conditionaldi;
break;
+ case TImode:
+ fn = gen_store_conditionalti;
+ break;
default:
gcc_unreachable ();
}
@@ -17246,8 +17905,9 @@ rs6000_adjust_atomic_subword (rtx orig_mem, rtx *pshift, rtx *pmask)
shift = gen_reg_rtx (SImode);
addr = gen_lowpart (SImode, addr);
emit_insn (gen_rlwinm (shift, addr, GEN_INT (3), GEN_INT (shift_mask)));
- shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
- shift, 1, OPTAB_LIB_WIDEN);
+ if (WORDS_BIG_ENDIAN)
+ shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
+ shift, 1, OPTAB_LIB_WIDEN);
*pshift = shift;
/* Mask for insertion. */
@@ -17295,7 +17955,7 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
{
rtx boolval, retval, mem, oldval, newval, cond;
rtx label1, label2, x, mask, shift;
- enum machine_mode mode;
+ enum machine_mode mode, orig_mode;
enum memmodel mod_s, mod_f;
bool is_weak;
@@ -17307,22 +17967,29 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
is_weak = (INTVAL (operands[5]) != 0);
mod_s = (enum memmodel) INTVAL (operands[6]);
mod_f = (enum memmodel) INTVAL (operands[7]);
- mode = GET_MODE (mem);
+ orig_mode = mode = GET_MODE (mem);
mask = shift = NULL_RTX;
if (mode == QImode || mode == HImode)
{
- mem = rs6000_adjust_atomic_subword (mem, &shift, &mask);
-
- /* Shift and mask OLDVAL into position with the word. */
+ /* Before power8, we didn't have access to lbarx/lharx, so generate a
+ lwarx and shift/mask operations. With power8, we need to do the
+ comparison in SImode, but the store is still done in QI/HImode. */
oldval = convert_modes (SImode, mode, oldval, 1);
- oldval = expand_simple_binop (SImode, ASHIFT, oldval, shift,
- NULL_RTX, 1, OPTAB_LIB_WIDEN);
- /* Shift and mask NEWVAL into position within the word. */
- newval = convert_modes (SImode, mode, newval, 1);
- newval = expand_simple_binop (SImode, ASHIFT, newval, shift,
- NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ if (!TARGET_SYNC_HI_QI)
+ {
+ mem = rs6000_adjust_atomic_subword (mem, &shift, &mask);
+
+ /* Shift and mask OLDVAL into position with the word. */
+ oldval = expand_simple_binop (SImode, ASHIFT, oldval, shift,
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+
+ /* Shift and mask NEWVAL into position within the word. */
+ newval = convert_modes (SImode, mode, newval, 1);
+ newval = expand_simple_binop (SImode, ASHIFT, newval, shift,
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ }
/* Prepare to adjust the return value. */
retval = gen_reg_rtx (SImode);
@@ -17351,7 +18018,25 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
}
cond = gen_reg_rtx (CCmode);
- x = gen_rtx_COMPARE (CCmode, x, oldval);
+ /* If we have TImode, synthesize a comparison. */
+ if (mode != TImode)
+ x = gen_rtx_COMPARE (CCmode, x, oldval);
+ else
+ {
+ rtx xor1_result = gen_reg_rtx (DImode);
+ rtx xor2_result = gen_reg_rtx (DImode);
+ rtx or_result = gen_reg_rtx (DImode);
+ rtx new_word0 = simplify_gen_subreg (DImode, x, TImode, 0);
+ rtx new_word1 = simplify_gen_subreg (DImode, x, TImode, 8);
+ rtx old_word0 = simplify_gen_subreg (DImode, oldval, TImode, 0);
+ rtx old_word1 = simplify_gen_subreg (DImode, oldval, TImode, 8);
+
+ emit_insn (gen_xordi3 (xor1_result, new_word0, old_word0));
+ emit_insn (gen_xordi3 (xor2_result, new_word1, old_word1));
+ emit_insn (gen_iordi3 (or_result, xor1_result, xor2_result));
+ x = gen_rtx_COMPARE (CCmode, or_result, const0_rtx);
+ }
+
emit_insn (gen_rtx_SET (VOIDmode, cond, x));
x = gen_rtx_NE (VOIDmode, cond, const0_rtx);
@@ -17361,7 +18046,7 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
if (mask)
x = rs6000_mask_atomic_subword (retval, newval, mask);
- emit_store_conditional (mode, cond, mem, x);
+ emit_store_conditional (orig_mode, cond, mem, x);
if (!is_weak)
{
@@ -17379,6 +18064,8 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
if (shift)
rs6000_finish_atomic_subword (operands[1], retval, shift);
+ else if (mode != GET_MODE (operands[1]))
+ convert_move (operands[1], retval, 1);
/* In all cases, CR0 contains EQ on success, and NE on failure. */
x = gen_rtx_EQ (SImode, cond, const0_rtx);
@@ -17402,7 +18089,7 @@ rs6000_expand_atomic_exchange (rtx operands[])
mode = GET_MODE (mem);
mask = shift = NULL_RTX;
- if (mode == QImode || mode == HImode)
+ if (!TARGET_SYNC_HI_QI && (mode == QImode || mode == HImode))
{
mem = rs6000_adjust_atomic_subword (mem, &shift, &mask);
@@ -17451,53 +18138,70 @@ rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
{
enum memmodel model = (enum memmodel) INTVAL (model_rtx);
enum machine_mode mode = GET_MODE (mem);
+ enum machine_mode store_mode = mode;
rtx label, x, cond, mask, shift;
rtx before = orig_before, after = orig_after;
mask = shift = NULL_RTX;
+ /* On power8, we want to use SImode for the operation. On previous systems,
+ use the operation in a subword and shift/mask to get the proper byte or
+ halfword. */
if (mode == QImode || mode == HImode)
{
- mem = rs6000_adjust_atomic_subword (mem, &shift, &mask);
-
- /* Shift and mask VAL into position with the word. */
- val = convert_modes (SImode, mode, val, 1);
- val = expand_simple_binop (SImode, ASHIFT, val, shift,
- NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ if (TARGET_SYNC_HI_QI)
+ {
+ val = convert_modes (SImode, mode, val, 1);
- switch (code)
+ /* Prepare to adjust the return value. */
+ before = gen_reg_rtx (SImode);
+ if (after)
+ after = gen_reg_rtx (SImode);
+ mode = SImode;
+ }
+ else
{
- case IOR:
- case XOR:
- /* We've already zero-extended VAL. That is sufficient to
- make certain that it does not affect other bits. */
- mask = NULL;
- break;
+ mem = rs6000_adjust_atomic_subword (mem, &shift, &mask);
- case AND:
- /* If we make certain that all of the other bits in VAL are
- set, that will be sufficient to not affect other bits. */
- x = gen_rtx_NOT (SImode, mask);
- x = gen_rtx_IOR (SImode, x, val);
- emit_insn (gen_rtx_SET (VOIDmode, val, x));
- mask = NULL;
- break;
+ /* Shift and mask VAL into position with the word. */
+ val = convert_modes (SImode, mode, val, 1);
+ val = expand_simple_binop (SImode, ASHIFT, val, shift,
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
- case NOT:
- case PLUS:
- case MINUS:
- /* These will all affect bits outside the field and need
- adjustment via MASK within the loop. */
- break;
+ switch (code)
+ {
+ case IOR:
+ case XOR:
+ /* We've already zero-extended VAL. That is sufficient to
+ make certain that it does not affect other bits. */
+ mask = NULL;
+ break;
- default:
- gcc_unreachable ();
- }
+ case AND:
+ /* If we make certain that all of the other bits in VAL are
+ set, that will be sufficient to not affect other bits. */
+ x = gen_rtx_NOT (SImode, mask);
+ x = gen_rtx_IOR (SImode, x, val);
+ emit_insn (gen_rtx_SET (VOIDmode, val, x));
+ mask = NULL;
+ break;
- /* Prepare to adjust the return value. */
- before = gen_reg_rtx (SImode);
- if (after)
- after = gen_reg_rtx (SImode);
- mode = SImode;
+ case NOT:
+ case PLUS:
+ case MINUS:
+ /* These will all affect bits outside the field and need
+ adjustment via MASK within the loop. */
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ /* Prepare to adjust the return value. */
+ before = gen_reg_rtx (SImode);
+ if (after)
+ after = gen_reg_rtx (SImode);
+ store_mode = mode = SImode;
+ }
}
mem = rs6000_pre_atomic_barrier (mem, model);
@@ -17530,9 +18234,11 @@ rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
NULL_RTX, 1, OPTAB_LIB_WIDEN);
x = rs6000_mask_atomic_subword (before, x, mask);
}
+ else if (store_mode != mode)
+ x = convert_modes (store_mode, mode, x, 1);
cond = gen_reg_rtx (CCmode);
- emit_store_conditional (mode, cond, mem, x);
+ emit_store_conditional (store_mode, cond, mem, x);
x = gen_rtx_NE (VOIDmode, cond, const0_rtx);
emit_unlikely_jump (x, label);
@@ -17541,11 +18247,22 @@ rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
if (shift)
{
+ /* QImode/HImode on machines without lbarx/lharx where we do a lwarx and
+ then do the calcuations in a SImode register. */
if (orig_before)
rs6000_finish_atomic_subword (orig_before, before, shift);
if (orig_after)
rs6000_finish_atomic_subword (orig_after, after, shift);
}
+ else if (store_mode != mode)
+ {
+ /* QImode/HImode on machines with lbarx/lharx where we do the native
+ operation and then do the calcuations in a SImode register. */
+ if (orig_before)
+ convert_move (orig_before, before, 1);
+ if (orig_after)
+ convert_move (orig_after, after, 1);
+ }
else if (orig_after && after != orig_after)
emit_move_insn (orig_after, after);
}
@@ -22560,7 +23277,10 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode)
fputs (DOUBLE_INT_ASM_OP, file);
else
fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff);
- fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
+ if (WORDS_BIG_ENDIAN)
+ fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
+ else
+ fprintf (file, "0x%lx\n", l & 0xffffffff);
return;
}
else
@@ -27197,26 +27917,31 @@ bool
altivec_expand_vec_perm_const (rtx operands[4])
{
struct altivec_perm_insn {
+ HOST_WIDE_INT mask;
enum insn_code impl;
unsigned char perm[16];
};
static const struct altivec_perm_insn patterns[] = {
- { CODE_FOR_altivec_vpkuhum,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vpkuhum,
{ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31 } },
- { CODE_FOR_altivec_vpkuwum,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vpkuwum,
{ 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 } },
- { CODE_FOR_altivec_vmrghb,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrghb,
{ 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23 } },
- { CODE_FOR_altivec_vmrghh,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrghh,
{ 0, 1, 16, 17, 2, 3, 18, 19, 4, 5, 20, 21, 6, 7, 22, 23 } },
- { CODE_FOR_altivec_vmrghw,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrghw,
{ 0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23 } },
- { CODE_FOR_altivec_vmrglb,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrglb,
{ 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31 } },
- { CODE_FOR_altivec_vmrglh,
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrglh,
{ 8, 9, 24, 25, 10, 11, 26, 27, 12, 13, 28, 29, 14, 15, 30, 31 } },
- { CODE_FOR_altivec_vmrglw,
- { 8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31 } }
+ { OPTION_MASK_ALTIVEC, CODE_FOR_altivec_vmrglw,
+ { 8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31 } },
+ { OPTION_MASK_P8_VECTOR, CODE_FOR_p8_vmrgew,
+ { 0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27 } },
+ { OPTION_MASK_P8_VECTOR, CODE_FOR_p8_vmrgow,
+ { 4, 5, 6, 7, 20, 21, 22, 23, 12, 13, 14, 15, 28, 29, 30, 31 } }
};
unsigned int i, j, elt, which;
@@ -27316,6 +28041,9 @@ altivec_expand_vec_perm_const (rtx operands[4])
{
bool swapped;
+ if ((patterns[j].mask & rs6000_isa_flags) == 0)
+ continue;
+
elt = patterns[j].perm[0];
if (perm[0] == elt)
swapped = false;
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 76f3bf99250..021e72a80e3 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -715,6 +715,11 @@ extern unsigned char rs6000_recip_bits[];
instructions for them. Might as well be consistent with bits and bytes. */
#define WORDS_BIG_ENDIAN 1
+/* This says that for the IBM long double the larger magnitude double
+ comes first. It's really a two element double array, and arrays
+ don't index differently between little- and big-endian. */
+#define LONG_DOUBLE_LARGE_FIRST 1
+
#define MAX_BITS_PER_WORD 64
/* Width of a word, in units (bytes). */
@@ -1114,10 +1119,10 @@ extern unsigned rs6000_pointer_size;
#define VINT_REGNO_P(N) ALTIVEC_REGNO_P (N)
/* Alternate name for any vector register supporting logical operations, no
- matter which instruction set(s) are available. Under VSX, we allow GPRs as
- well as vector registers on 64-bit systems. We don't allow 32-bit systems,
- due to the number of registers involved, and the number of instructions to
- load/store the values.. */
+ matter which instruction set(s) are available. For 64-bit mode, we also
+ allow logical operations in the GPRS. This is to allow atomic quad word
+ builtins not to need the VSX registers for lqarx/stqcx. It also helps with
+ __int128_t arguments that are passed in GPRs. */
#define VLOGICAL_REGNO_P(N) \
(ALTIVEC_REGNO_P (N) \
|| (TARGET_VSX && FP_REGNO_P (N)) \
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 013a0e38551..7fe23bff351 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -127,6 +127,13 @@
UNSPEC_LFIWZX
UNSPEC_FCTIWUZ
UNSPEC_GRP_END_NOP
+ UNSPEC_P8V_FMRGOW
+ UNSPEC_P8V_MTVSRWZ
+ UNSPEC_P8V_RELOAD_FROM_GPR
+ UNSPEC_P8V_MTVSRD
+ UNSPEC_P8V_XXPERMDI
+ UNSPEC_P8V_RELOAD_FROM_VSX
+ UNSPEC_FUSION_GPR
])
;;
@@ -166,9 +173,14 @@
(const_int 4)))
;; Processor type -- this attribute must exactly match the processor_type
-;; enumeration in rs6000.h.
-
-(define_attr "cpu" "rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,ppce6500,power4,power5,power6,power7,cell,ppca2,titan,power8"
+;; enumeration in rs6000-opts.h.
+(define_attr "cpu"
+ "ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,
+ ppc750,ppc7400,ppc7450,
+ ppc403,ppc405,ppc440,ppc476,
+ ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,ppce5500,ppce6500,
+ power4,power5,power6,power7,power8,
+ rs64a,mpccore,cell,ppca2,titan"
(const (symbol_ref "rs6000_cpu_attr")))
@@ -227,6 +239,12 @@
; extend modes for DImode
(define_mode_iterator QHSI [QI HI SI])
+; QImode or HImode for small atomic ops
+(define_mode_iterator QHI [QI HI])
+
+; HImode or SImode for sign extended fusion ops
+(define_mode_iterator HSI [HI SI])
+
; SImode or DImode, even if DImode doesn't fit in GPRs.
(define_mode_iterator SDI [SI DI])
@@ -268,6 +286,15 @@
(define_mode_iterator FMOVE128 [(TF "!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128")
(TD "TARGET_HARD_FLOAT && TARGET_FPRS")])
+; Iterators for 128 bit types for direct move
+(define_mode_iterator FMOVE128_GPR [(TI "TARGET_VSX_TIMODE")
+ (V16QI "")
+ (V8HI "")
+ (V4SI "")
+ (V4SF "")
+ (V2DI "")
+ (V2DF "")])
+
; Whether a floating point move is ok, don't allow SD without hardware FP
(define_mode_attr fmove_ok [(SF "")
(DF "")
@@ -284,11 +311,16 @@
(define_mode_attr f32_lr [(SF "f") (SD "wz")])
(define_mode_attr f32_lm [(SF "m") (SD "Z")])
(define_mode_attr f32_li [(SF "lfs%U1%X1 %0,%1") (SD "lfiwzx %0,%y1")])
+(define_mode_attr f32_lv [(SF "lxsspx %0,%y1") (SD "lxsiwzx %0,%y1")])
; Definitions for store from 32-bit fpr register
(define_mode_attr f32_sr [(SF "f") (SD "wx")])
(define_mode_attr f32_sm [(SF "m") (SD "Z")])
(define_mode_attr f32_si [(SF "stfs%U0%X0 %1,%0") (SD "stfiwx %1,%y0")])
+(define_mode_attr f32_sv [(SF "stxsspx %1,%y0") (SD "stxsiwzx %1,%y0")])
+
+; Definitions for 32-bit fpr direct move
+(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
; These modes do not fit in integer registers in 32-bit mode.
; but on e500v2, the gpr are 64 bit registers
@@ -368,7 +400,7 @@
(define_insn "*zero_extend<mode>di2_internal1"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
(zero_extend:DI (match_operand:QHSI 1 "reg_or_mem_operand" "m,r")))]
- "TARGET_POWERPC64"
+ "TARGET_POWERPC64 && (<MODE>mode != SImode || !TARGET_LFIWZX)"
"@
l<wd>z%U1%X1 %0,%1
rldicl %0,%1,0,<dbits>"
@@ -434,6 +466,29 @@
(const_int 0)))]
"")
+(define_insn "*zero_extendsidi2_lfiwzx"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wm")
+ (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
+ "TARGET_POWERPC64 && TARGET_LFIWZX"
+ "@
+ lwz%U1%X1 %0,%1
+ rldicl %0,%1,0,32
+ mtvsrwz %x0,%1
+ lfiwzx %0,%y1
+ lxsiwzx %x0,%y1"
+ [(set_attr_alternative "type"
+ [(if_then_else
+ (match_test "update_indexed_address_mem (operands[1], VOIDmode)")
+ (const_string "load_ux")
+ (if_then_else
+ (match_test "update_address_mem (operands[1], VOIDmode)")
+ (const_string "load_u")
+ (const_string "load")))
+ (const_string "*")
+ (const_string "mffgpr")
+ (const_string "fpload")
+ (const_string "fpload")])])
+
(define_insn "extendqidi2"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]
@@ -581,10 +636,33 @@
"TARGET_POWERPC64"
"")
-(define_insn ""
+(define_insn "*extendsidi2_lfiwax"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wm")
+ (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
+ "TARGET_POWERPC64 && TARGET_LFIWAX"
+ "@
+ lwa%U1%X1 %0,%1
+ extsw %0,%1
+ mtvsrwa %x0,%1
+ lfiwax %0,%y1
+ lxsiwax %x0,%y1"
+ [(set_attr_alternative "type"
+ [(if_then_else
+ (match_test "update_indexed_address_mem (operands[1], VOIDmode)")
+ (const_string "load_ext_ux")
+ (if_then_else
+ (match_test "update_address_mem (operands[1], VOIDmode)")
+ (const_string "load_ext_u")
+ (const_string "load_ext")))
+ (const_string "exts")
+ (const_string "mffgpr")
+ (const_string "fpload")
+ (const_string "fpload")])])
+
+(define_insn "*extendsidi2_nocell"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
(sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
- "TARGET_POWERPC64 && rs6000_gen_cell_microcode"
+ "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
"@
lwa%U1%X1 %0,%1
extsw %0,%1"
@@ -598,7 +676,7 @@
(const_string "load_ext")))
(const_string "exts")])])
-(define_insn ""
+(define_insn "*extendsidi2_nocell"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r")))]
"TARGET_POWERPC64 && !rs6000_gen_cell_microcode"
@@ -2035,7 +2113,9 @@
[(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
(unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")] UNSPEC_PARITY))]
"TARGET_CMPB && TARGET_POPCNTB"
- "prty<wd> %0,%1")
+ "prty<wd> %0,%1"
+ [(set_attr "length" "4")
+ (set_attr "type" "popcnt")])
(define_expand "parity<mode>2"
[(set (match_operand:GPR 0 "gpc_reg_operand" "")
@@ -4316,7 +4396,7 @@
#
#
#"
- [(set_attr "type" "delayed_compare,var_delayed_compare,delayed_compare,delayed_compare,var_delayed_compare,delayed_compare")
+ [(set_attr "type" "fast_compare,var_delayed_compare,delayed_compare,delayed_compare,var_delayed_compare,delayed_compare")
(set_attr "length" "4,4,4,8,8,8")])
(define_split
@@ -4348,7 +4428,7 @@
#
#
#"
- [(set_attr "type" "delayed_compare,var_delayed_compare,delayed_compare,delayed_compare,var_delayed_compare,delayed_compare")
+ [(set_attr "type" "fast_compare,var_delayed_compare,delayed_compare,delayed_compare,var_delayed_compare,delayed_compare")
(set_attr "length" "4,4,4,8,8,8")])
(define_split
@@ -5104,6 +5184,41 @@
"frsqrtes %0,%1"
[(set_attr "type" "fp")])
+;; This expander is here to avoid FLOAT_WORDS_BIGENDIAN tests in
+;; builtins.c and optabs.c that are not correct for IBM long double
+;; when little-endian.
+(define_expand "signbittf2"
+ [(set (match_dup 2)
+ (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
+ (set (match_dup 3)
+ (subreg:DI (match_dup 2) 0))
+ (set (match_dup 4)
+ (match_dup 5))
+ (set (match_operand:SI 0 "gpc_reg_operand" "")
+ (match_dup 6))]
+ "!TARGET_IEEEQUAD
+ && TARGET_HARD_FLOAT
+ && (TARGET_FPRS || TARGET_E500_DOUBLE)
+ && TARGET_LONG_DOUBLE_128"
+{
+ operands[2] = gen_reg_rtx (DFmode);
+ operands[3] = gen_reg_rtx (DImode);
+ if (TARGET_POWERPC64)
+ {
+ operands[4] = gen_reg_rtx (DImode);
+ operands[5] = gen_rtx_LSHIFTRT (DImode, operands[3], GEN_INT (63));
+ operands[6] = gen_rtx_SUBREG (SImode, operands[4],
+ WORDS_BIG_ENDIAN ? 4 : 0);
+ }
+ else
+ {
+ operands[4] = gen_reg_rtx (SImode);
+ operands[5] = gen_rtx_SUBREG (SImode, operands[3],
+ WORDS_BIG_ENDIAN ? 0 : 4);
+ operands[6] = gen_rtx_LSHIFTRT (SImode, operands[4], GEN_INT (31));
+ }
+})
+
(define_expand "copysign<mode>3"
[(set (match_dup 3)
(abs:SFDF (match_operand:SFDF 1 "gpc_reg_operand" "")))
@@ -5553,12 +5668,15 @@
; We don't define lfiwax/lfiwzx with the normal definition, because we
; don't want to support putting SImode in FPR registers.
(define_insn "lfiwax"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d")
- (unspec:DI [(match_operand:SI 1 "indexed_or_indirect_operand" "Z")]
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
+ (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
UNSPEC_LFIWAX))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
- "lfiwax %0,%y1"
- [(set_attr "type" "fpload")])
+ "@
+ lfiwax %0,%y1
+ lxsiwax %x0,%y1
+ mtvsrwa %x0,%1"
+ [(set_attr "type" "fpload,fpload,mffgpr")])
; This split must be run before register allocation because it allocates the
; memory slot that is needed to move values to/from the FPR. We don't allocate
@@ -5580,7 +5698,8 @@
rtx src = operands[1];
rtx tmp;
- if (!MEM_P (src) && TARGET_MFPGPR && TARGET_POWERPC64)
+ if (!MEM_P (src) && TARGET_POWERPC64
+ && (TARGET_MFPGPR || TARGET_DIRECT_MOVE))
tmp = convert_to_mode (DImode, src, false);
else
{
@@ -5629,12 +5748,15 @@
(set_attr "type" "fpload")])
(define_insn "lfiwzx"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d")
- (unspec:DI [(match_operand:SI 1 "indexed_or_indirect_operand" "Z")]
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
+ (unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
UNSPEC_LFIWZX))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
- "lfiwzx %0,%y1"
- [(set_attr "type" "fpload")])
+ "@
+ lfiwzx %0,%y1
+ lxsiwzx %x0,%y1
+ mtvsrwz %x0,%1"
+ [(set_attr "type" "fpload,fpload,mftgpr")])
(define_insn_and_split "floatunssi<mode>2_lfiwzx"
[(set (match_operand:SFDF 0 "gpc_reg_operand" "=d")
@@ -5651,7 +5773,8 @@
rtx src = operands[1];
rtx tmp;
- if (!MEM_P (src) && TARGET_MFPGPR && TARGET_POWERPC64)
+ if (!MEM_P (src) && TARGET_POWERPC64
+ && (TARGET_MFPGPR || TARGET_DIRECT_MOVE))
tmp = convert_to_mode (DImode, src, true);
else
{
@@ -5942,7 +6065,7 @@
emit_insn (gen_stfiwx (dest, tmp));
DONE;
}
- else if (TARGET_MFPGPR && TARGET_POWERPC64)
+ else if (TARGET_POWERPC64 && (TARGET_MFPGPR || TARGET_DIRECT_MOVE))
{
dest = gen_lowpart (DImode, dest);
emit_move_insn (dest, tmp);
@@ -6036,7 +6159,7 @@
emit_insn (gen_stfiwx (dest, tmp));
DONE;
}
- else if (TARGET_MFPGPR && TARGET_POWERPC64)
+ else if (TARGET_POWERPC64 && (TARGET_MFPGPR || TARGET_DIRECT_MOVE))
{
dest = gen_lowpart (DImode, dest);
emit_move_insn (dest, tmp);
@@ -8285,6 +8408,18 @@
(compare:CC (match_dup 0)
(const_int 0)))]
"")
+
+;; Eqv operation.
+(define_insn "*eqv<mode>3"
+ [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
+ (not:GPR
+ (xor:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")
+ (match_operand:GPR 2 "gpc_reg_operand" "r"))))]
+ ""
+ "eqv %0,%1,%2"
+ [(set_attr "type" "integer")
+ (set_attr "length" "4")])
+
;; Now define ways of moving data around.
@@ -8490,7 +8625,7 @@
cmp<wd>i %2,%0,0
mr. %0,%1
#"
- [(set_attr "type" "cmp,compare,cmp")
+ [(set_attr "type" "cmp,fast_compare,cmp")
(set_attr "length" "4,4,8")])
(define_split
@@ -8680,8 +8815,8 @@
}")
(define_insn "mov<mode>_hardfloat"
- [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,*c*l,!r,*h,!r,!r")
- (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,r,h,0,G,Fn"))]
+ [(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,wa,wa,<f32_lr>,<f32_sm>,wm,Z,?<f32_dm>,?r,*c*l,!r,*h,!r,!r")
+ (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,wa,j,<f32_lm>,<f32_sr>,Z,wm,r,<f32_dm>,r,h,0,G,Fn"))]
"(gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))
&& (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
@@ -8694,6 +8829,10 @@
xxlxor %x0,%x0,%x0
<f32_li>
<f32_si>
+ <f32_lv>
+ <f32_sv>
+ mtvsrwz %x0,%1
+ mfvsrwz %0,%x1
mt%0 %1
mf%1 %0
nop
@@ -8732,16 +8871,20 @@
(match_test "update_address_mem (operands[0], VOIDmode)")
(const_string "fpstore_u")
(const_string "fpstore")))
+ (const_string "fpload")
+ (const_string "fpstore")
+ (const_string "mftgpr")
+ (const_string "mffgpr")
(const_string "mtjmpr")
(const_string "mfjmpr")
(const_string "*")
(const_string "*")
(const_string "*")])
- (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,8")])
+ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8")])
(define_insn "*mov<mode>_softfloat"
[(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r,r,*h")
- (match_operand:FMOVE32 1 "input_operand" "r, r,h,m,r,I,L,G,Fn,0"))]
+ (match_operand:FMOVE32 1 "input_operand" "r,r,h,m,r,I,L,G,Fn,0"))]
"(gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))
&& (TARGET_SOFT_FLOAT || !TARGET_FPRS)"
@@ -8954,8 +9097,8 @@
; ld/std require word-aligned displacements -> 'Y' constraint.
; List Y->r and r->Y before r->r for reload.
(define_insn "*mov<mode>_hardfloat64"
- [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,ws,?wa,Z,?Z,ws,?wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg")
- (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,Z,ws,wa,ws,wa,j,r,Y,r,r,h,0,G,H,F,wg,r"))]
+ [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,ws,?wa,Z,?Z,ws,?wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wm")
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,Z,ws,wa,ws,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wm,r"))]
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& (gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))"
@@ -8980,7 +9123,9 @@
#
#
mftgpr %0,%1
- mffgpr %0,%1"
+ mffgpr %0,%1
+ mfvsrd %0,%x1
+ mtvsrd %x0,%1"
[(set_attr_alternative "type"
[(if_then_else
(match_test "update_indexed_address_mem (operands[0], VOIDmode)")
@@ -9038,8 +9183,10 @@
(const_string "*")
(const_string "*")
(const_string "mftgpr")
+ (const_string "mffgpr")
+ (const_string "mftgpr")
(const_string "mffgpr")])
- (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,12,16,4,4")])
+ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,12,16,4,4,4,4")])
(define_insn "*mov<mode>_softfloat64"
[(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=Y,r,r,cl,r,r,r,r,*h")
@@ -9154,8 +9301,8 @@
"&& reload_completed"
[(pc)]
{
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word),
operands[1]);
emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word),
@@ -9384,8 +9531,8 @@
&& TARGET_LONG_DOUBLE_128"
"
{
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
operands[3] = gen_reg_rtx (DFmode);
operands[4] = gen_reg_rtx (CCFPmode);
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
@@ -9419,6 +9566,216 @@
})
+;; Power8 merge instructions to allow direct move to/from floating point
+;; registers in 32-bit mode. We use TF mode to get two registers to move the
+;; individual 32-bit parts across. Subreg doesn't work too well on the TF
+;; value, since it is allocated in reload and not all of the flow information
+;; is setup for it. We have two patterns to do the two moves between gprs and
+;; fprs. There isn't a dependancy between the two, but we could potentially
+;; schedule other instructions between the two instructions. TFmode is
+;; currently limited to traditional FPR registers. If/when this is changed, we
+;; will need to revist %L to make sure it works with VSX registers, or add an
+;; %x version of %L.
+
+(define_insn "p8_fmrgow_<mode>"
+ [(set (match_operand:FMOVE64X 0 "register_operand" "=d")
+ (unspec:FMOVE64X [(match_operand:TF 1 "register_operand" "d")]
+ UNSPEC_P8V_FMRGOW))]
+ "!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "fmrgow %0,%1,%L1"
+ [(set_attr "type" "vecperm")])
+
+(define_insn "p8_mtvsrwz_1"
+ [(set (match_operand:TF 0 "register_operand" "=d")
+ (unspec:TF [(match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_P8V_MTVSRWZ))]
+ "!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "mtvsrwz %x0,%1"
+ [(set_attr "type" "mftgpr")])
+
+(define_insn "p8_mtvsrwz_2"
+ [(set (match_operand:TF 0 "register_operand" "+d")
+ (unspec:TF [(match_dup 0)
+ (match_operand:SI 1 "register_operand" "r")]
+ UNSPEC_P8V_MTVSRWZ))]
+ "!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "mtvsrwz %L0,%1"
+ [(set_attr "type" "mftgpr")])
+
+(define_insn_and_split "reload_fpr_from_gpr<mode>"
+ [(set (match_operand:FMOVE64X 0 "register_operand" "=ws")
+ (unspec:FMOVE64X [(match_operand:FMOVE64X 1 "register_operand" "r")]
+ UNSPEC_P8V_RELOAD_FROM_GPR))
+ (clobber (match_operand:TF 2 "register_operand" "=d"))]
+ "!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ rtx tmp = operands[2];
+ rtx gpr_hi_reg = gen_highpart (SImode, src);
+ rtx gpr_lo_reg = gen_lowpart (SImode, src);
+
+ emit_insn (gen_p8_mtvsrwz_1 (tmp, gpr_hi_reg));
+ emit_insn (gen_p8_mtvsrwz_2 (tmp, gpr_lo_reg));
+ emit_insn (gen_p8_fmrgow_<mode> (dest, tmp));
+ DONE;
+}
+ [(set_attr "length" "12")
+ (set_attr "type" "three")])
+
+;; Move 128 bit values from GPRs to VSX registers in 64-bit mode
+(define_insn "p8_mtvsrd_1"
+ [(set (match_operand:TF 0 "register_operand" "=ws")
+ (unspec:TF [(match_operand:DI 1 "register_operand" "r")]
+ UNSPEC_P8V_MTVSRD))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "mtvsrd %0,%1"
+ [(set_attr "type" "mftgpr")])
+
+(define_insn "p8_mtvsrd_2"
+ [(set (match_operand:TF 0 "register_operand" "+ws")
+ (unspec:TF [(match_dup 0)
+ (match_operand:DI 1 "register_operand" "r")]
+ UNSPEC_P8V_MTVSRD))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "mtvsrd %L0,%1"
+ [(set_attr "type" "mftgpr")])
+
+(define_insn "p8_xxpermdi_<mode>"
+ [(set (match_operand:FMOVE128_GPR 0 "register_operand" "=wa")
+ (unspec:FMOVE128_GPR [(match_operand:TF 1 "register_operand" "ws")]
+ UNSPEC_P8V_XXPERMDI))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "xxpermdi %x0,%1,%L1,0"
+ [(set_attr "type" "vecperm")])
+
+(define_insn_and_split "reload_vsx_from_gpr<mode>"
+ [(set (match_operand:FMOVE128_GPR 0 "register_operand" "=wa")
+ (unspec:FMOVE128_GPR
+ [(match_operand:FMOVE128_GPR 1 "register_operand" "r")]
+ UNSPEC_P8V_RELOAD_FROM_GPR))
+ (clobber (match_operand:TF 2 "register_operand" "=ws"))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ rtx tmp = operands[2];
+ rtx gpr_hi_reg = gen_highpart (DImode, src);
+ rtx gpr_lo_reg = gen_lowpart (DImode, src);
+
+ emit_insn (gen_p8_mtvsrd_1 (tmp, gpr_hi_reg));
+ emit_insn (gen_p8_mtvsrd_2 (tmp, gpr_lo_reg));
+ emit_insn (gen_p8_xxpermdi_<mode> (dest, tmp));
+}
+ [(set_attr "length" "12")
+ (set_attr "type" "three")])
+
+;; Move SFmode to a VSX from a GPR register. Because scalar floating point
+;; type is stored internally as double precision in the VSX registers, we have
+;; to convert it from the vector format.
+
+(define_insn_and_split "reload_vsx_from_gprsf"
+ [(set (match_operand:SF 0 "register_operand" "=wa")
+ (unspec:SF [(match_operand:SF 1 "register_operand" "r")]
+ UNSPEC_P8V_RELOAD_FROM_GPR))
+ (clobber (match_operand:DI 2 "register_operand" "=r"))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE && WORDS_BIG_ENDIAN"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx op0 = operands[0];
+ rtx op1 = operands[1];
+ rtx op2 = operands[2];
+ rtx op0_di = simplify_gen_subreg (DImode, op0, SFmode, 0);
+ rtx op1_di = simplify_gen_subreg (DImode, op1, SFmode, 0);
+
+ /* Move SF value to upper 32-bits for xscvspdpn. */
+ emit_insn (gen_ashldi3 (op2, op1_di, GEN_INT (32)));
+ emit_move_insn (op0_di, op2);
+ emit_insn (gen_vsx_xscvspdpn_directmove (op0, op0));
+ DONE;
+}
+ [(set_attr "length" "8")
+ (set_attr "type" "two")])
+
+;; Move 128 bit values from VSX registers to GPRs in 64-bit mode by doing a
+;; normal 64-bit move, followed by an xxpermdi to get the bottom 64-bit value,
+;; and then doing a move of that.
+(define_insn "p8_mfvsrd_3_<mode>"
+ [(set (match_operand:DF 0 "register_operand" "=r")
+ (unspec:DF [(match_operand:FMOVE128_GPR 1 "register_operand" "wa")]
+ UNSPEC_P8V_RELOAD_FROM_VSX))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE && WORDS_BIG_ENDIAN"
+ "mfvsrd %0,%x1"
+ [(set_attr "type" "mftgpr")])
+
+(define_insn_and_split "reload_gpr_from_vsx<mode>"
+ [(set (match_operand:FMOVE128_GPR 0 "register_operand" "=r")
+ (unspec:FMOVE128_GPR
+ [(match_operand:FMOVE128_GPR 1 "register_operand" "wa")]
+ UNSPEC_P8V_RELOAD_FROM_VSX))
+ (clobber (match_operand:FMOVE128_GPR 2 "register_operand" "=wa"))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE && WORDS_BIG_ENDIAN"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ rtx tmp = operands[2];
+ rtx gpr_hi_reg = gen_highpart (DFmode, dest);
+ rtx gpr_lo_reg = gen_lowpart (DFmode, dest);
+
+ emit_insn (gen_p8_mfvsrd_3_<mode> (gpr_hi_reg, src));
+ emit_insn (gen_vsx_xxpermdi_<mode> (tmp, src, src, GEN_INT (3)));
+ emit_insn (gen_p8_mfvsrd_3_<mode> (gpr_lo_reg, tmp));
+}
+ [(set_attr "length" "12")
+ (set_attr "type" "three")])
+
+;; Move SFmode to a GPR from a VSX register. Because scalar floating point
+;; type is stored internally as double precision, we have to convert it to the
+;; vector format.
+
+(define_insn_and_split "reload_gpr_from_vsxsf"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (unspec:SF [(match_operand:SF 1 "register_operand" "wa")]
+ UNSPEC_P8V_RELOAD_FROM_VSX))
+ (clobber (match_operand:V4SF 2 "register_operand" "=wa"))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE && WORDS_BIG_ENDIAN"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rtx op0 = operands[0];
+ rtx op1 = operands[1];
+ rtx op2 = operands[2];
+ rtx diop0 = simplify_gen_subreg (DImode, op0, SFmode, 0);
+
+ emit_insn (gen_vsx_xscvdpspn_scalar (op2, op1));
+ emit_insn (gen_p8_mfvsrd_4_disf (diop0, op2));
+ emit_insn (gen_lshrdi3 (diop0, diop0, GEN_INT (32)));
+ DONE;
+}
+ [(set_attr "length" "12")
+ (set_attr "type" "three")])
+
+(define_insn "p8_mfvsrd_4_disf"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec:DI [(match_operand:V4SF 1 "register_operand" "wa")]
+ UNSPEC_P8V_RELOAD_FROM_VSX))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE && WORDS_BIG_ENDIAN"
+ "mfvsrd %0,%x1"
+ [(set_attr "type" "mftgpr")])
+
+
;; Next come the multi-word integer load and store and the load and store
;; multiple insns.
@@ -9467,7 +9824,8 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(match_operand:DI 1 "const_int_operand" ""))]
"! TARGET_POWERPC64 && reload_completed
- && gpr_or_gpr_p (operands[0], operands[1])"
+ && gpr_or_gpr_p (operands[0], operands[1])
+ && !direct_move_p (operands[0], operands[1])"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 1))]
"
@@ -9485,13 +9843,14 @@
[(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])"
+ && gpr_or_gpr_p (operands[0], operands[1])
+ && !direct_move_p (operands[0], operands[1])"
[(pc)]
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_insn "*movdi_internal64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,?Z,?wa,?wa,r,*h,*h,?wa,r,?*wg")
- (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,wa,Z,wa,*h,r,0,O,*wg,r"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,?Z,?wa,?wa,r,*h,*h,?wa,r,?*wg,r,?*wm")
+ (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,wa,Z,wa,*h,r,0,O,*wg,r,*wm,r"))]
"TARGET_POWERPC64
&& (gpc_reg_operand (operands[0], DImode)
|| gpc_reg_operand (operands[1], DImode))"
@@ -9513,7 +9872,9 @@
nop
xxlxor %x0,%x0,%x0
mftgpr %0,%1
- mffgpr %0,%1"
+ mffgpr %0,%1
+ mfvsrd %0,%x1
+ mtvsrd %x0,%1"
[(set_attr_alternative "type"
[(if_then_else
(match_test "update_indexed_address_mem (operands[0], VOIDmode)")
@@ -9562,8 +9923,10 @@
(const_string "*")
(const_string "vecsimple")
(const_string "mftgpr")
+ (const_string "mffgpr")
+ (const_string "mftgpr")
(const_string "mffgpr")])
- (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4,4")])
+ (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4,4,4,4")])
;; Generate all one-bits and clear left or right.
;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
@@ -9652,19 +10015,23 @@
(const_string "conditional")))])
(define_insn "*mov<mode>_ppc64"
- [(set (match_operand:TI2 0 "nonimmediate_operand" "=Y,r,r")
- (match_operand:TI2 1 "input_operand" "r,Y,r"))]
- "(TARGET_POWERPC64
- && (<MODE>mode != TImode || VECTOR_MEM_NONE_P (TImode))
+ [(set (match_operand:TI2 0 "nonimmediate_operand" "=Y,r,r,r")
+ (match_operand:TI2 1 "input_operand" "r,Y,r,F"))]
+ "(TARGET_POWERPC64 && VECTOR_MEM_NONE_P (<MODE>mode)
&& (gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode)))"
- "#"
- [(set_attr "type" "store,load,*")])
+{
+ return rs6000_output_move_128bit (operands);
+}
+ [(set_attr "type" "store,load,*,*")
+ (set_attr "length" "8")])
(define_split
- [(set (match_operand:TI2 0 "gpc_reg_operand" "")
+ [(set (match_operand:TI2 0 "int_reg_operand" "")
(match_operand:TI2 1 "const_double_operand" ""))]
- "TARGET_POWERPC64"
+ "TARGET_POWERPC64
+ && (VECTOR_MEM_NONE_P (<MODE>mode)
+ || (reload_completed && INT_REGNO_P (REGNO (operands[0]))))"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 5))]
"
@@ -9691,7 +10058,9 @@
[(set (match_operand:TI2 0 "nonimmediate_operand" "")
(match_operand:TI2 1 "input_operand" ""))]
"reload_completed
- && gpr_or_gpr_p (operands[0], operands[1])"
+ && gpr_or_gpr_p (operands[0], operands[1])
+ && !direct_move_p (operands[0], operands[1])
+ && !quad_load_store_p (operands[0], operands[1])"
[(pc)]
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
@@ -12554,8 +12923,8 @@
(match_dup 13)]
{
REAL_VALUE_TYPE rv;
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
operands[5] = simplify_gen_subreg (DFmode, operands[1], TFmode, hi_word);
operands[6] = simplify_gen_subreg (DFmode, operands[1], TFmode, lo_word);
diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md
index cec2b430b82..bf10a5dc180 100644
--- a/gcc/config/rs6000/spe.md
+++ b/gcc/config/rs6000/spe.md
@@ -2604,8 +2604,8 @@
&& TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
"
{
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
operands[3] = gen_reg_rtx (DFmode);
operands[4] = gen_reg_rtx (CCFPmode);
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
@@ -2627,8 +2627,8 @@
&& TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
"
{
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
operands[3] = gen_reg_rtx (DFmode);
operands[4] = gen_reg_rtx (CCFPmode);
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md
index 252e2690a98..8616b3eca5f 100644
--- a/gcc/config/rs6000/sync.md
+++ b/gcc/config/rs6000/sync.md
@@ -18,14 +18,23 @@
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
-(define_mode_attr larx [(SI "lwarx") (DI "ldarx")])
-(define_mode_attr stcx [(SI "stwcx.") (DI "stdcx.")])
+(define_mode_attr larx [(QI "lbarx")
+ (HI "lharx")
+ (SI "lwarx")
+ (DI "ldarx")
+ (TI "lqarx")])
+
+(define_mode_attr stcx [(QI "stbcx.")
+ (HI "sthcx.")
+ (SI "stwcx.")
+ (DI "stdcx.")
+ (TI "stqcx.")])
(define_code_iterator FETCHOP [plus minus ior xor and])
(define_code_attr fetchop_name
[(plus "add") (minus "sub") (ior "or") (xor "xor") (and "and")])
(define_code_attr fetchop_pred
- [(plus "add_operand") (minus "gpc_reg_operand")
+ [(plus "add_operand") (minus "int_reg_operand")
(ior "logical_operand") (xor "logical_operand") (and "and_operand")])
(define_expand "mem_thread_fence"
@@ -129,16 +138,7 @@
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
case MEMMODEL_SEQ_CST:
- if (GET_MODE (operands[0]) == QImode)
- emit_insn (gen_loadsync_qi (operands[0]));
- else if (GET_MODE (operands[0]) == HImode)
- emit_insn (gen_loadsync_hi (operands[0]));
- else if (GET_MODE (operands[0]) == SImode)
- emit_insn (gen_loadsync_si (operands[0]));
- else if (GET_MODE (operands[0]) == DImode)
- emit_insn (gen_loadsync_di (operands[0]));
- else
- gcc_unreachable ();
+ emit_insn (gen_loadsync_<mode> (operands[0]));
break;
default:
gcc_unreachable ();
@@ -170,35 +170,109 @@
DONE;
})
-;; ??? Power ISA 2.06B says that there *is* a load-{byte,half}-and-reserve
-;; opcode that is "phased-in". Not implemented as of Power7, so not yet used,
-;; but let's prepare the macros anyway.
+;; Any supported integer mode that has atomic l<x>arx/st<x>cx. instrucitons
+;; other than the quad memory operations, which have special restrictions.
+;; Byte/halfword atomic instructions were added in ISA 2.06B, but were phased
+;; in and did not show up until power8. TImode atomic lqarx/stqcx. require
+;; special handling due to even/odd register requirements.
+(define_mode_iterator ATOMIC [(QI "TARGET_SYNC_HI_QI")
+ (HI "TARGET_SYNC_HI_QI")
+ SI
+ (DI "TARGET_POWERPC64")])
+
+;; Types that we should provide atomic instructions for.
-(define_mode_iterator ATOMIC [SI (DI "TARGET_POWERPC64")])
+(define_mode_iterator AINT [QI
+ HI
+ SI
+ (DI "TARGET_POWERPC64")
+ (TI "TARGET_SYNC_TI")])
(define_insn "load_locked<mode>"
- [(set (match_operand:ATOMIC 0 "gpc_reg_operand" "=r")
+ [(set (match_operand:ATOMIC 0 "int_reg_operand" "=r")
(unspec_volatile:ATOMIC
[(match_operand:ATOMIC 1 "memory_operand" "Z")] UNSPECV_LL))]
""
"<larx> %0,%y1"
[(set_attr "type" "load_l")])
+(define_insn "load_locked<QHI:mode>_si"
+ [(set (match_operand:SI 0 "int_reg_operand" "=r")
+ (unspec_volatile:SI
+ [(match_operand:QHI 1 "memory_operand" "Z")] UNSPECV_LL))]
+ "TARGET_SYNC_HI_QI"
+ "<QHI:larx> %0,%y1"
+ [(set_attr "type" "load_l")])
+
+;; Use PTImode to get even/odd register pairs
+(define_expand "load_lockedti"
+ [(use (match_operand:TI 0 "quad_int_reg_operand" ""))
+ (use (match_operand:TI 1 "memory_operand" ""))]
+ "TARGET_SYNC_TI"
+{
+ /* Use a temporary register to force getting an even register for the
+ lqarx/stqcrx. instructions. Normal optimizations will eliminate this
+ extra copy. */
+ rtx pti = gen_reg_rtx (PTImode);
+ emit_insn (gen_load_lockedpti (pti, operands[1]));
+ emit_move_insn (operands[0], gen_lowpart (TImode, pti));
+ DONE;
+})
+
+(define_insn "load_lockedpti"
+ [(set (match_operand:PTI 0 "quad_int_reg_operand" "=&r")
+ (unspec_volatile:PTI
+ [(match_operand:TI 1 "memory_operand" "Z")] UNSPECV_LL))]
+ "TARGET_SYNC_TI
+ && !reg_mentioned_p (operands[0], operands[1])
+ && quad_int_reg_operand (operands[0], PTImode)"
+ "lqarx %0,%y1"
+ [(set_attr "type" "load_l")])
+
(define_insn "store_conditional<mode>"
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
(unspec_volatile:CC [(const_int 0)] UNSPECV_SC))
(set (match_operand:ATOMIC 1 "memory_operand" "=Z")
- (match_operand:ATOMIC 2 "gpc_reg_operand" "r"))]
+ (match_operand:ATOMIC 2 "int_reg_operand" "r"))]
""
"<stcx> %2,%y1"
[(set_attr "type" "store_c")])
+(define_expand "store_conditionalti"
+ [(use (match_operand:CC 0 "cc_reg_operand" ""))
+ (use (match_operand:TI 1 "memory_operand" ""))
+ (use (match_operand:TI 2 "quad_int_reg_operand" ""))]
+ "TARGET_SYNC_TI"
+{
+ rtx op0 = operands[0];
+ rtx op1 = operands[1];
+ rtx op2 = operands[2];
+ rtx pti_op1 = change_address (op1, PTImode, XEXP (op1, 0));
+ rtx pti_op2 = gen_reg_rtx (PTImode);
+
+ /* Use a temporary register to force getting an even register for the
+ lqarx/stqcrx. instructions. Normal optimizations will eliminate this
+ extra copy. */
+ emit_move_insn (pti_op2, gen_lowpart (PTImode, op2));
+ emit_insn (gen_store_conditionalpti (op0, pti_op1, pti_op2));
+ DONE;
+})
+
+(define_insn "store_conditionalpti"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+ (unspec_volatile:CC [(const_int 0)] UNSPECV_SC))
+ (set (match_operand:PTI 1 "memory_operand" "=Z")
+ (match_operand:PTI 2 "quad_int_reg_operand" "r"))]
+ "TARGET_SYNC_TI && quad_int_reg_operand (operands[2], PTImode)"
+ "stqcx. %2,%y1"
+ [(set_attr "type" "store_c")])
+
(define_expand "atomic_compare_and_swap<mode>"
- [(match_operand:SI 0 "gpc_reg_operand" "") ;; bool out
- (match_operand:INT1 1 "gpc_reg_operand" "") ;; val out
- (match_operand:INT1 2 "memory_operand" "") ;; memory
- (match_operand:INT1 3 "reg_or_short_operand" "") ;; expected
- (match_operand:INT1 4 "gpc_reg_operand" "") ;; desired
+ [(match_operand:SI 0 "int_reg_operand" "") ;; bool out
+ (match_operand:AINT 1 "int_reg_operand" "") ;; val out
+ (match_operand:AINT 2 "memory_operand" "") ;; memory
+ (match_operand:AINT 3 "reg_or_short_operand" "") ;; expected
+ (match_operand:AINT 4 "int_reg_operand" "") ;; desired
(match_operand:SI 5 "const_int_operand" "") ;; is_weak
(match_operand:SI 6 "const_int_operand" "") ;; model succ
(match_operand:SI 7 "const_int_operand" "")] ;; model fail
@@ -209,9 +283,9 @@
})
(define_expand "atomic_exchange<mode>"
- [(match_operand:INT1 0 "gpc_reg_operand" "") ;; output
- (match_operand:INT1 1 "memory_operand" "") ;; memory
- (match_operand:INT1 2 "gpc_reg_operand" "") ;; input
+ [(match_operand:AINT 0 "int_reg_operand" "") ;; output
+ (match_operand:AINT 1 "memory_operand" "") ;; memory
+ (match_operand:AINT 2 "int_reg_operand" "") ;; input
(match_operand:SI 3 "const_int_operand" "")] ;; model
""
{
@@ -220,9 +294,9 @@
})
(define_expand "atomic_<fetchop_name><mode>"
- [(match_operand:INT1 0 "memory_operand" "") ;; memory
- (FETCHOP:INT1 (match_dup 0)
- (match_operand:INT1 1 "<fetchop_pred>" "")) ;; operand
+ [(match_operand:AINT 0 "memory_operand" "") ;; memory
+ (FETCHOP:AINT (match_dup 0)
+ (match_operand:AINT 1 "<fetchop_pred>" "")) ;; operand
(match_operand:SI 2 "const_int_operand" "")] ;; model
""
{
@@ -232,8 +306,8 @@
})
(define_expand "atomic_nand<mode>"
- [(match_operand:INT1 0 "memory_operand" "") ;; memory
- (match_operand:INT1 1 "gpc_reg_operand" "") ;; operand
+ [(match_operand:AINT 0 "memory_operand" "") ;; memory
+ (match_operand:AINT 1 "int_reg_operand" "") ;; operand
(match_operand:SI 2 "const_int_operand" "")] ;; model
""
{
@@ -243,10 +317,10 @@
})
(define_expand "atomic_fetch_<fetchop_name><mode>"
- [(match_operand:INT1 0 "gpc_reg_operand" "") ;; output
- (match_operand:INT1 1 "memory_operand" "") ;; memory
- (FETCHOP:INT1 (match_dup 1)
- (match_operand:INT1 2 "<fetchop_pred>" "")) ;; operand
+ [(match_operand:AINT 0 "int_reg_operand" "") ;; output
+ (match_operand:AINT 1 "memory_operand" "") ;; memory
+ (FETCHOP:AINT (match_dup 1)
+ (match_operand:AINT 2 "<fetchop_pred>" "")) ;; operand
(match_operand:SI 3 "const_int_operand" "")] ;; model
""
{
@@ -256,9 +330,9 @@
})
(define_expand "atomic_fetch_nand<mode>"
- [(match_operand:INT1 0 "gpc_reg_operand" "") ;; output
- (match_operand:INT1 1 "memory_operand" "") ;; memory
- (match_operand:INT1 2 "gpc_reg_operand" "") ;; operand
+ [(match_operand:AINT 0 "int_reg_operand" "") ;; output
+ (match_operand:AINT 1 "memory_operand" "") ;; memory
+ (match_operand:AINT 2 "int_reg_operand" "") ;; operand
(match_operand:SI 3 "const_int_operand" "")] ;; model
""
{
@@ -268,10 +342,10 @@
})
(define_expand "atomic_<fetchop_name>_fetch<mode>"
- [(match_operand:INT1 0 "gpc_reg_operand" "") ;; output
- (match_operand:INT1 1 "memory_operand" "") ;; memory
- (FETCHOP:INT1 (match_dup 1)
- (match_operand:INT1 2 "<fetchop_pred>" "")) ;; operand
+ [(match_operand:AINT 0 "int_reg_operand" "") ;; output
+ (match_operand:AINT 1 "memory_operand" "") ;; memory
+ (FETCHOP:AINT (match_dup 1)
+ (match_operand:AINT 2 "<fetchop_pred>" "")) ;; operand
(match_operand:SI 3 "const_int_operand" "")] ;; model
""
{
@@ -281,9 +355,9 @@
})
(define_expand "atomic_nand_fetch<mode>"
- [(match_operand:INT1 0 "gpc_reg_operand" "") ;; output
- (match_operand:INT1 1 "memory_operand" "") ;; memory
- (match_operand:INT1 2 "gpc_reg_operand" "") ;; operand
+ [(match_operand:AINT 0 "int_reg_operand" "") ;; output
+ (match_operand:AINT 1 "memory_operand" "") ;; memory
+ (match_operand:AINT 2 "int_reg_operand" "") ;; operand
(match_operand:SI 3 "const_int_operand" "")] ;; model
""
{
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
index 017a293cde3..62a5b941389 100644
--- a/gcc/config/rs6000/t-linux
+++ b/gcc/config/rs6000/t-linux
@@ -2,7 +2,7 @@
# or soft-float.
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
ifneq (,$(findstring spe,$(target)))
-MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring rs6000/e500-double.h, $(tm_file_list)),,v1)
+MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
else
MULTIARCH_DIRNAME = powerpc-linux-gnu
endif
diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 8b8b3427454..6cfebdeebdc 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -126,7 +126,9 @@
(match_operand:VEC_L 1 "input_operand" ""))]
"VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)
&& reload_completed
- && gpr_or_gpr_p (operands[0], operands[1])"
+ && gpr_or_gpr_p (operands[0], operands[1])
+ && !direct_move_p (operands[0], operands[1])
+ && !quad_load_store_p (operands[0], operands[1])"
[(pc)]
{
rs6000_split_multireg_move (operands[0], operands[1]);
@@ -730,9 +732,10 @@
"")
(define_expand "and<mode>3"
- [(set (match_operand:VEC_L 0 "vlogical_operand" "")
- (and:VEC_L (match_operand:VEC_L 1 "vlogical_operand" "")
- (match_operand:VEC_L 2 "vlogical_operand" "")))]
+ [(parallel [(set (match_operand:VEC_L 0 "vlogical_operand" "")
+ (and:VEC_L (match_operand:VEC_L 1 "vlogical_operand" "")
+ (match_operand:VEC_L 2 "vlogical_operand" "")))
+ (clobber (match_scratch:CC 3 ""))])]
"VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)
&& (<MODE>mode != TImode || TARGET_POWERPC64)"
"")
@@ -746,8 +749,8 @@
(define_expand "nor<mode>3"
[(set (match_operand:VEC_L 0 "vlogical_operand" "")
- (not:VEC_L (ior:VEC_L (match_operand:VEC_L 1 "vlogical_operand" "")
- (match_operand:VEC_L 2 "vlogical_operand" ""))))]
+ (and:VEC_L (not:VEC_L (match_operand:VEC_L 1 "vlogical_operand" ""))
+ (not:VEC_L (match_operand:VEC_L 2 "vlogical_operand" ""))))]
"VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)
&& (<MODE>mode != TImode || TARGET_POWERPC64)"
"")
@@ -760,6 +763,47 @@
&& (<MODE>mode != TImode || TARGET_POWERPC64)"
"")
+;; Power8 vector logical instructions.
+(define_expand "eqv<mode>3"
+ [(set (match_operand:VEC_L 0 "register_operand" "")
+ (not:VEC_L
+ (xor:VEC_L (match_operand:VEC_L 1 "register_operand" "")
+ (match_operand:VEC_L 2 "register_operand" ""))))]
+ "TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)
+ && (<MODE>mode != TImode || TARGET_POWERPC64)")
+
+;; Rewrite nand into canonical form
+(define_expand "nand<mode>3"
+ [(set (match_operand:VEC_L 0 "register_operand" "")
+ (ior:VEC_L
+ (not:VEC_L (match_operand:VEC_L 1 "register_operand" ""))
+ (not:VEC_L (match_operand:VEC_L 2 "register_operand" ""))))]
+ "TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)
+ && (<MODE>mode != TImode || TARGET_POWERPC64)")
+
+;; The canonical form is to have the negated elment first, so we need to
+;; reverse arguments.
+(define_expand "orc<mode>3"
+ [(set (match_operand:VEC_L 0 "register_operand" "")
+ (ior:VEC_L
+ (not:VEC_L (match_operand:VEC_L 1 "register_operand" ""))
+ (match_operand:VEC_L 2 "register_operand" "")))]
+ "TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)
+ && (<MODE>mode != TImode || TARGET_POWERPC64)")
+
+;; Vector count leading zeros
+(define_expand "clz<mode>2"
+ [(set (match_operand:VEC_I 0 "register_operand" "")
+ (clz:VEC_I (match_operand:VEC_I 1 "register_operand" "")))]
+ "TARGET_P8_VECTOR")
+
+;; Vector population count
+(define_expand "popcount<mode>2"
+ [(set (match_operand:VEC_I 0 "register_operand" "")
+ (popcount:VEC_I (match_operand:VEC_I 1 "register_operand" "")))]
+ "TARGET_P8_VECTOR")
+
+
;; Same size conversions
(define_expand "float<VEC_int><mode>2"
[(set (match_operand:VEC_F 0 "vfloat_operand" "")
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 4adf6e5ac55..b87da826a95 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -36,6 +36,10 @@
;; Iterator for logical types supported by VSX
(define_mode_iterator VSX_L [V16QI V8HI V4SI V2DI V4SF V2DF TI])
+;; Like VSX_L, but don't support TImode for doing logical instructions in
+;; 32-bit
+(define_mode_iterator VSX_L2 [V16QI V8HI V4SI V2DI V4SF V2DF])
+
;; Iterator for memory move. Handle TImode specially to allow
;; it to use gprs as well as vsx registers.
(define_mode_iterator VSX_M [V16QI V8HI V4SI V2DI V4SF V2DF])
@@ -191,6 +195,8 @@
UNSPEC_VSX_CVDPSXWS
UNSPEC_VSX_CVDPUXWS
UNSPEC_VSX_CVSPDP
+ UNSPEC_VSX_CVSPDPN
+ UNSPEC_VSX_CVDPSPN
UNSPEC_VSX_CVSXWDP
UNSPEC_VSX_CVUXWDP
UNSPEC_VSX_CVSXDSP
@@ -207,112 +213,31 @@
;; VSX moves
(define_insn "*vsx_mov<mode>"
- [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,*Y,*r,*r,<VSr>,?wa,*r,v,wZ,v")
- (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,Y,r,j,j,j,W,v,wZ"))]
+ [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,wQ,?&r,??Y,??r,??r,<VSr>,?wa,*r,v,wZ, v")
+ (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
"VECTOR_MEM_VSX_P (<MODE>mode)
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
{
- switch (which_alternative)
- {
- case 0:
- case 3:
- gcc_assert (MEM_P (operands[0])
- && 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 "stx<VSm>x %x1,%y0";
-
- case 1:
- case 4:
- gcc_assert (MEM_P (operands[1])
- && GET_CODE (XEXP (operands[1], 0)) != PRE_INC
- && GET_CODE (XEXP (operands[1], 0)) != PRE_DEC
- && GET_CODE (XEXP (operands[1], 0)) != PRE_MODIFY);
- return "lx<VSm>x %x0,%y1";
-
- case 2:
- case 5:
- return "xxlor %x0,%x1,%x1";
-
- case 6:
- case 7:
- case 8:
- case 11:
- return "#";
-
- case 9:
- case 10:
- return "xxlxor %x0,%x0,%x0";
-
- case 12:
- return output_vec_const_move (operands);
-
- case 13:
- gcc_assert (MEM_P (operands[0])
- && 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 "stvx %1,%y0";
-
- case 14:
- gcc_assert (MEM_P (operands[0])
- && 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 "lvx %0,%y1";
-
- default:
- gcc_unreachable ();
- }
+ return rs6000_output_move_128bit (operands);
}
- [(set_attr "type" "vecstore,vecload,vecsimple,vecstore,vecload,vecsimple,*,*,*,vecsimple,vecsimple,*,*,vecstore,vecload")])
+ [(set_attr "type" "vecstore,vecload,vecsimple,vecstore,vecload,vecsimple,load,store,store,load, *,vecsimple,vecsimple,*, *,vecstore,vecload")
+ (set_attr "length" "4,4,4,4,4,4,12,12,12,12,16,4,4,*,16,4,4")])
;; Unlike other VSX moves, allow the GPRs even for reloading, since a normal
;; use of TImode is for unions. However for plain data movement, slightly
;; favor the vector loads
(define_insn "*vsx_movti_64bit"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,wa,wa,wa,v, v,wZ,?Y,?r,?r,?r")
- (match_operand:TI 1 "input_operand" "wa, Z,wa, O,W,wZ, v, r, Y, r, n"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=Z,wa,wa,wa,v,v,wZ,wQ,&r,Y,r,r,?r")
+ (match_operand:TI 1 "input_operand" "wa,Z,wa,O,W,wZ,v,r,wQ,r,Y,r,n"))]
"TARGET_POWERPC64 && VECTOR_MEM_VSX_P (TImode)
&& (register_operand (operands[0], TImode)
|| register_operand (operands[1], TImode))"
{
- switch (which_alternative)
- {
- case 0:
- return "stxvd2x %x1,%y0";
-
- case 1:
- return "lxvd2x %x0,%y1";
-
- case 2:
- return "xxlor %x0,%x1,%x1";
-
- case 3:
- return "xxlxor %x0,%x0,%x0";
-
- case 4:
- return output_vec_const_move (operands);
-
- case 5:
- return "stvx %1,%y0";
-
- case 6:
- return "lvx %0,%y1";
-
- case 7:
- case 8:
- case 9:
- case 10:
- return "#";
-
- default:
- gcc_unreachable ();
- }
+ return rs6000_output_move_128bit (operands);
}
- [(set_attr "type" "vecstore,vecload,vecsimple,vecsimple,vecsimple,vecstore,vecload,*,*,*,*")
- (set_attr "length" " 4, 4, 4, 4, 8, 4, 4,8,8,8,8")])
+ [(set_attr "type" "vecstore,vecload,vecsimple,vecsimple,vecsimple,vecstore,vecload,store,load,store,load,*,*")
+ (set_attr "length" "4,4,4,4,16,4,4,8,8,8,8,8,8")])
(define_insn "*vsx_movti_32bit"
[(set (match_operand:TI 0 "nonimmediate_operand" "=Z,wa,wa,wa,v, v,wZ,Q,Y,????r,????r,????r,r")
@@ -1003,6 +928,40 @@
"xscvspdp %x0,%x1"
[(set_attr "type" "fp")])
+;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
+(define_insn "vsx_xscvdpspn"
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
+ (unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
+ UNSPEC_VSX_CVDPSPN))]
+ "TARGET_XSCVDPSPN"
+ "xscvdpspn %x0,%x1"
+ [(set_attr "type" "fp")])
+
+(define_insn "vsx_xscvspdpn"
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
+ UNSPEC_VSX_CVSPDPN))]
+ "TARGET_XSCVSPDPN"
+ "xscvspdpn %x0,%x1"
+ [(set_attr "type" "fp")])
+
+(define_insn "vsx_xscvdpspn_scalar"
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
+ (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
+ UNSPEC_VSX_CVDPSPN))]
+ "TARGET_XSCVDPSPN"
+ "xscvdpspn %x0,%x1"
+ [(set_attr "type" "fp")])
+
+;; Used by direct move to move a SFmode value from GPR to VSX register
+(define_insn "vsx_xscvspdpn_directmove"
+ [(set (match_operand:SF 0 "vsx_register_operand" "=wa")
+ (unspec:SF [(match_operand:SF 1 "vsx_register_operand" "wa")]
+ UNSPEC_VSX_CVSPDPN))]
+ "TARGET_XSCVSPDPN"
+ "xscvspdpn %x0,%x1"
+ [(set_attr "type" "fp")])
+
;; Convert from 64-bit to 32-bit types
;; Note, favor the Altivec registers since the usual use of these instructions
;; is in vector converts and we need to use the Altivec vperm instruction.
@@ -1088,70 +1047,368 @@
(set_attr "fp_type" "<VSfptype_simple>")])
-;; Logical operations
-;; Do not support TImode logical instructions on 32-bit at present, because the
-;; compiler will see that we have a TImode and when it wanted DImode, and
-;; convert the DImode to TImode, store it on the stack, and load it in a VSX
-;; register.
-(define_insn "*vsx_and<mode>3"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
- (and:VSX_L
- (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
+;; Logical operations. Do not support TImode logical instructions on 32-bit at
+;; present, because the compiler will see that we have a TImode and when it
+;; wanted DImode, and convert the DImode to TImode, store it on the stack, and
+;; load it in a VSX register or generate extra logical instructions in GPR
+;; registers.
+
+;; When we are splitting the operations to GPRs, we use three alternatives, two
+;; where the first/second inputs and output are in the same register, and the
+;; third where the output specifies an early clobber so that we don't have to
+;; worry about overlapping registers.
+
+(define_insn "*vsx_and<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (and:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "%wa")
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa")))
+ (clobber (match_scratch:CC 3 "X"))]
+ "!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
"xxland %x0,%x1,%x2"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
-(define_insn "*vsx_ior<mode>3"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
- (ior:VSX_L (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
+(define_insn_and_split "*vsx_and<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,&?r")
+ (and:VSX_L
+ (match_operand:VSX_L 1 "vlogical_operand" "%wa,0,r,r")
+ (match_operand:VSX_L 2 "vlogical_operand" "wa,r,0,r")))
+ (clobber (match_scratch:CC 3 "X,X,X,X"))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxland %x0,%x1,%x2
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(parallel [(set (match_dup 4) (and:DI (match_dup 5) (match_dup 6)))
+ (clobber (match_dup 3))])
+ (parallel [(set (match_dup 7) (and:DI (match_dup 8) (match_dup 9)))
+ (clobber (match_dup 3))])]
+{
+ operands[4] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[7] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[9] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
+
+(define_insn "*vsx_ior<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (ior:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "%wa")
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa")))]
+ "!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
"xxlor %x0,%x1,%x2"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_ior<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,&?r,?r,&?r")
+ (ior:VSX_L
+ (match_operand:VSX_L 1 "vlogical_operand" "%wa,0,r,r,0,r")
+ (match_operand:VSX_L 2 "vsx_reg_or_cint_operand" "wa,r,0,r,n,n")))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlor %x0,%x1,%x2
+ #
+ #
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(const_int 0)]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
-(define_insn "*vsx_xor<mode>3"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
- (xor:VSX_L
- (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
+ if (operands[5] == constm1_rtx)
+ emit_move_insn (operands[3], constm1_rtx);
+
+ else if (operands[5] == const0_rtx)
+ {
+ if (!rtx_equal_p (operands[3], operands[4]))
+ emit_move_insn (operands[3], operands[4]);
+ }
+ else
+ emit_insn (gen_iordi3 (operands[3], operands[4], operands[5]));
+
+ if (operands[8] == constm1_rtx)
+ emit_move_insn (operands[8], constm1_rtx);
+
+ else if (operands[8] == const0_rtx)
+ {
+ if (!rtx_equal_p (operands[6], operands[7]))
+ emit_move_insn (operands[6], operands[7]);
+ }
+ else
+ emit_insn (gen_iordi3 (operands[6], operands[7], operands[8]));
+ DONE;
+}
+ [(set_attr "type" "vecsimple,two,two,two,three,three")
+ (set_attr "length" "4,8,8,8,16,16")])
+
+(define_insn "*vsx_xor<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (xor:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "%wa")
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa")))]
+ "VECTOR_MEM_VSX_P (<MODE>mode) && !TARGET_POWERPC64"
"xxlxor %x0,%x1,%x2"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
-(define_insn "*vsx_one_cmpl<mode>2"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
- (not:VSX_L
- (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
+(define_insn_and_split "*vsx_xor<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,&?r,?r,&?r")
+ (xor:VSX_L
+ (match_operand:VSX_L 1 "vlogical_operand" "%wa,0,r,r,0,r")
+ (match_operand:VSX_L 2 "vsx_reg_or_cint_operand" "wa,r,0,r,n,n")))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlxor %x0,%x1,%x2
+ #
+ #
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (xor:DI (match_dup 4) (match_dup 5)))
+ (set (match_dup 6) (xor:DI (match_dup 7) (match_dup 8)))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two,three,three")
+ (set_attr "length" "4,8,8,8,16,16")])
+
+(define_insn "*vsx_one_cmpl<mode>2_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (not:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "wa")))]
+ "!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
"xxlnor %x0,%x1,%x1"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_one_cmpl<mode>2_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,&?r")
+ (not:VSX_L (match_operand:VSX_L 1 "vlogical_operand" "wa,0,r")))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlnor %x0,%x1,%x1
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 2) (not:DI (match_dup 3)))
+ (set (match_dup 4) (not:DI (match_dup 5)))]
+{
+ operands[2] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[3] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[5] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two")
+ (set_attr "length" "4,8,8")])
-(define_insn "*vsx_nor<mode>3"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
- (not:VSX_L
- (ior:VSX_L
- (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,?wa")
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,?wa"))))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
+(define_insn "*vsx_nor<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (and:VSX_L2
+ (not:VSX_L2 (match_operand:VSX_L 1 "vlogical_operand" "%wa"))
+ (not:VSX_L2 (match_operand:VSX_L 2 "vlogical_operand" "wa"))))]
+ "!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
"xxlnor %x0,%x1,%x2"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_nor<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,&?r")
+ (and:VSX_L
+ (not:VSX_L (match_operand:VSX_L 1 "vlogical_operand" "%wa,0,r,r"))
+ (not:VSX_L (match_operand:VSX_L 2 "vlogical_operand" "wa,r,0,r"))))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlnor %x0,%x1,%x2
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (and:DI (not:DI (match_dup 4)) (not:DI (match_dup 5))))
+ (set (match_dup 6) (and:DI (not:DI (match_dup 7)) (not:DI (match_dup 8))))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
+
+(define_insn "*vsx_andc<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (and:VSX_L2
+ (not:VSX_L2
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa"))
+ (match_operand:VSX_L2 1 "vlogical_operand" "wa")))]
+ "!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "xxlandc %x0,%x1,%x2"
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
-(define_insn "*vsx_andc<mode>3"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
+(define_insn_and_split "*vsx_andc<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,?r")
(and:VSX_L
(not:VSX_L
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,?wa"))
- (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,?wa")))]
- "VECTOR_MEM_VSX_P (<MODE>mode)
- && (<MODE>mode != TImode || TARGET_POWERPC64)"
- "xxlandc %x0,%x1,%x2"
- [(set_attr "type" "vecsimple")])
+ (match_operand:VSX_L 2 "vlogical_operand" "wa,0,r,r"))
+ (match_operand:VSX_L 1 "vlogical_operand" "wa,r,0,r")))]
+ "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlandc %x0,%x1,%x2
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (and:DI (not:DI (match_dup 4)) (match_dup 5)))
+ (set (match_dup 6) (and:DI (not:DI (match_dup 7)) (match_dup 8)))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
+
+;; Power8 vector logical instructions.
+(define_insn "*vsx_eqv<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (not:VSX_L2
+ (xor:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "wa")
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa"))))]
+ "!TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "xxleqv %x0,%x1,%x2"
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_eqv<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,?r")
+ (not:VSX_L
+ (xor:VSX_L (match_operand:VSX_L 1 "vlogical_operand" "wa,0,r,r")
+ (match_operand:VSX_L 2 "vlogical_operand" "wa,r,0,r"))))]
+ "TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxleqv %x0,%x1,%x2
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && TARGET_P8_VECTOR
+ && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (not:DI (xor:DI (match_dup 4) (match_dup 5))))
+ (set (match_dup 6) (not:DI (xor:DI (match_dup 7) (match_dup 8))))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
+
+;; Rewrite nand into canonical form
+(define_insn "*vsx_nand<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (ior:VSX_L2
+ (not:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "wa"))
+ (not:VSX_L2 (match_operand:VSX_L2 2 "vlogical_operand" "wa"))))]
+ "!TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "xxlnand %x0,%x1,%x2"
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_nand<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "register_operand" "=wa,?r,?r,?r")
+ (ior:VSX_L
+ (not:VSX_L (match_operand:VSX_L 1 "register_operand" "wa,0,r,r"))
+ (not:VSX_L (match_operand:VSX_L 2 "register_operand" "wa,r,0,r"))))]
+ "TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlnand %x0,%x1,%x2
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && TARGET_P8_VECTOR
+ && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (ior:DI (not:DI (match_dup 4)) (not:DI (match_dup 5))))
+ (set (match_dup 6) (ior:DI (not:DI (match_dup 7)) (not:DI (match_dup 8))))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
+
+;; Rewrite or complement into canonical form, by reversing the arguments
+(define_insn "*vsx_orc<mode>3_32bit"
+ [(set (match_operand:VSX_L2 0 "vlogical_operand" "=wa")
+ (ior:VSX_L2
+ (not:VSX_L2 (match_operand:VSX_L2 1 "vlogical_operand" "wa"))
+ (match_operand:VSX_L2 2 "vlogical_operand" "wa")))]
+ "!TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "xxlorc %x0,%x2,%x1"
+ [(set_attr "type" "vecsimple")
+ (set_attr "length" "4")])
+
+(define_insn_and_split "*vsx_orc<mode>3_64bit"
+ [(set (match_operand:VSX_L 0 "vlogical_operand" "=wa,?r,?r,?r")
+ (ior:VSX_L
+ (not:VSX_L (match_operand:VSX_L 1 "vlogical_operand" "wa,0,r,r"))
+ (match_operand:VSX_L 2 "vlogical_operand" "wa,r,0,r")))]
+ "TARGET_POWERPC64 && TARGET_P8_VECTOR && VECTOR_MEM_VSX_P (<MODE>mode)"
+ "@
+ xxlorc %x0,%x2,%x1
+ #
+ #
+ #"
+ "reload_completed && TARGET_POWERPC64 && TARGET_P8_VECTOR
+ && VECTOR_MEM_VSX_P (<MODE>mode)
+ && int_reg_operand (operands[0], <MODE>mode)"
+ [(set (match_dup 3) (ior:DI (not:DI (match_dup 4)) (match_dup 5)))
+ (set (match_dup 6) (ior:DI (not:DI (match_dup 7)) (match_dup 8)))]
+{
+ operands[3] = simplify_subreg (DImode, operands[0], <MODE>mode, 0);
+ operands[4] = simplify_subreg (DImode, operands[1], <MODE>mode, 0);
+ operands[5] = simplify_subreg (DImode, operands[2], <MODE>mode, 0);
+ operands[6] = simplify_subreg (DImode, operands[0], <MODE>mode, 8);
+ operands[7] = simplify_subreg (DImode, operands[1], <MODE>mode, 8);
+ operands[8] = simplify_subreg (DImode, operands[2], <MODE>mode, 8);
+}
+ [(set_attr "type" "vecsimple,two,two,two")
+ (set_attr "length" "4,8,8,8")])
;; Permute operations
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 30c34901f8d..358345a4437 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2017,14 +2017,18 @@ s390_decompose_address (rtx addr, struct s390_address *out)
Thus we don't check the displacement for validity here. If after
elimination the displacement turns out to be invalid after all,
this is fixed up by reload in any case. */
- if (base != arg_pointer_rtx
- && indx != arg_pointer_rtx
- && base != return_address_pointer_rtx
- && indx != return_address_pointer_rtx
- && base != frame_pointer_rtx
- && indx != frame_pointer_rtx
- && base != virtual_stack_vars_rtx
- && indx != virtual_stack_vars_rtx)
+ /* LRA maintains always displacements up to date and we need to
+ know the displacement is right during all LRA not only at the
+ final elimination. */
+ if (lra_in_progress
+ || (base != arg_pointer_rtx
+ && indx != arg_pointer_rtx
+ && base != return_address_pointer_rtx
+ && indx != return_address_pointer_rtx
+ && base != frame_pointer_rtx
+ && indx != frame_pointer_rtx
+ && base != virtual_stack_vars_rtx
+ && indx != virtual_stack_vars_rtx))
if (!DISP_IN_RANGE (offset))
return false;
}
@@ -3189,7 +3193,9 @@ s390_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
/* We need a scratch register when loading a PLUS expression which
is not a legitimate operand of the LOAD ADDRESS instruction. */
- if (in_p && s390_plus_operand (x, mode))
+ /* LRA can deal with transformation of plus op very well -- so we
+ don't need to prompt LRA in this case. */
+ if (! lra_in_progress && in_p && s390_plus_operand (x, mode))
sri->icode = (TARGET_64BIT ?
CODE_FOR_reloaddi_plus : CODE_FOR_reloadsi_plus);
@@ -7868,6 +7874,13 @@ s390_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
+/* Return true if we use LRA instead of reload pass. */
+static bool
+s390_lra_p (void)
+{
+ return s390_lra_flag;
+}
+
/* Return true if register FROM can be eliminated via register TO. */
static bool
@@ -11105,6 +11118,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
#undef TARGET_LEGITIMATE_CONSTANT_P
#define TARGET_LEGITIMATE_CONSTANT_P s390_legitimate_constant_p
+#undef TARGET_LRA_P
+#define TARGET_LRA_P s390_lra_p
+
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE s390_can_eliminate
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 43e24d5d112..b0e530f0ed4 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -221,7 +221,7 @@ enum processor_flags
/* Alignment on even addresses for LARL instruction. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
-#define DATA_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
+#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
/* Alignment is not required by the hardware. */
#define STRICT_ALIGNMENT 0
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index cad4f5f579a..0141b9813ef 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -277,7 +277,8 @@
(define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12"
(const (symbol_ref "s390_tune_attr")))
-(define_attr "cpu_facility" "standard,ieee,zarch,longdisp,extimm,dfp,z10,z196,zEC12"
+(define_attr "cpu_facility"
+ "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12"
(const_string "standard"))
(define_attr "enabled" ""
@@ -304,6 +305,10 @@
(match_test "TARGET_DFP"))
(const_int 1)
+ (and (eq_attr "cpu_facility" "cpu_zarch")
+ (match_test "TARGET_CPU_ZARCH"))
+ (const_int 1)
+
(and (eq_attr "cpu_facility" "z10")
(match_test "TARGET_Z10"))
(const_int 1)
@@ -2690,7 +2695,7 @@
"(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)"
"#"
[(set_attr "type" "cs")
- (set_attr "cpu_facility" "*,*,z10,*")])
+ (set_attr "cpu_facility" "*,*,z10,cpu_zarch")])
(define_split
[(set (match_operand:BLK 0 "memory_operand" "")
@@ -2899,7 +2904,7 @@
"(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)"
"#"
[(set_attr "type" "cs")
- (set_attr "cpu_facility" "*,*,z10,*")])
+ (set_attr "cpu_facility" "*,*,z10,cpu_zarch")])
(define_split
[(set (match_operand:BLK 0 "memory_operand" "")
@@ -3075,7 +3080,7 @@
"(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)"
"#"
[(set_attr "type" "cs")
- (set_attr "cpu_facility" "*,*,z10,*")])
+ (set_attr "cpu_facility" "*,*,z10,cpu_zarch")])
(define_split
[(set (reg:CCU CC_REGNUM)
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index b326441173c..ba38e6e14ed 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -149,3 +149,7 @@ Target Report Joined RejectNegative UInteger Var(s390_branch_cost) Init(1)
Set the branch costs for conditional branch instructions. Reasonable
values are small, non-negative integers. The default branch cost is
1.
+
+mlra
+Target Report Var(s390_lra_flag) Init(1) Save
+Use LRA instead of reload
diff --git a/gcc/configure b/gcc/configure
index 1f03eac6e27..8c221078102 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -8293,6 +8293,66 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h defines TIOCGWINSZ" >&5
+$as_echo_n "checking whether termios.h defines TIOCGWINSZ... " >&6; }
+if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <termios.h>
+#ifdef TIOCGWINSZ
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ ac_cv_sys_tiocgwinsz_in_termios_h=yes
+else
+ ac_cv_sys_tiocgwinsz_in_termios_h=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5
+$as_echo "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; }
+
+if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5
+$as_echo_n "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; }
+if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#ifdef TIOCGWINSZ
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes
+else
+ ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5
+$as_echo "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; }
+
+ if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then
+
+$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h
+
+ fi
+fi
+
for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
@@ -17834,7 +17894,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17837 "configure"
+#line 17897 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17940,7 +18000,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17943 "configure"
+#line 18003 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 855affdf152..41b64c78736 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -939,6 +939,7 @@ AC_HEADER_STDC
AC_HEADER_TIME
ACX_HEADER_STRING
AC_HEADER_SYS_WAIT
+AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
diff --git a/gcc/cp/ChangeLog.vtv b/gcc/cp/ChangeLog.vtv
new file mode 100644
index 00000000000..144a7af8aa7
--- /dev/null
+++ b/gcc/cp/ChangeLog.vtv
@@ -0,0 +1,37 @@
+2013-06-16 Caroline Tice <cmtice@google.com>
+
+ * class.c (finish_struct_1): Add call to vtv_save_class_info if vtable
+ verification is turned on.
+ * config-lang.in: Add vtable-class-hierarchy.c to the list of files
+ that use GCC's garbage collector.
+ * g++spec.c (VTABLE_LOAD_MODULE_UNIT): New macro for link option needed
+ with vtable verification.
+ (lang_specific_driver): Added variable to indicate if vtable
+ verification option is used, and which flavor. Process -fvtable-verify
+ option, update num_args if option is present, and add appropriate
+ driver options if fvtable-verify is present.
+ * vtable-class-hierarchy.c: New file, containing the bulk of vtable
+ verification's front-end work.
+ * mangle.c (get_mangled_vtable_map_var_name): New function.
+ * decl2.c (start_objects): Update function comment.
+ (cp_write_global_declarations): If vtable verification is turned on,
+ call vtv_recover_class_info and
+ vtv_compute_class_hierarchy_transitive_closure before calling
+ finalize_compilation_unit. Call vtv_generate_init_routine after.
+ (vtv_start_verification_constructor_init_function): New externally
+ visible wrapper function to call start_objects for vtable verification.
+ (vtv_finish_verification_constructor_init_function): New function.
+ * init.c (build_vtbl_address): Make function not static (externally
+ visible).
+ * Make-lang.in: (CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
+ list of object files.
+ (vtable-class-hierarchy.o): Add rule for building object file.
+ * pt.c (mark_class_instantiated): Add call to vtv_save_class_info if
+ vtable verification is turned on.
+ * cp-tree.h: Add extern function declarations for
+ vtv_start_verification_constructor_init_function,
+ vtv_finish_verification_constructor_init_function, build_vtbl_address,
+ vtv_compute_class_hierarchy_transitive_closure,
+ vtv_generate_init_routine, vtv_save_class_info,
+ vtv_recover_class_info and get_mangled_vtable_map_var_name.
+
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 0b6a83f3445..dfd061aff5c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7053,7 +7053,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
otherwise the call should go through the dispatcher. */
if (DECL_FUNCTION_VERSIONED (fn)
- && !targetm.target_option.can_inline_p (current_function_decl, fn))
+ && (current_function_decl == NULL
+ || !targetm.target_option.can_inline_p (current_function_decl, fn)))
{
fn = get_function_version_dispatcher (fn);
if (fn == NULL)
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c2e9b4e548e..e8f62b2b5f4 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1354,11 +1354,11 @@ find_abi_tags_r (tree *tp, int */*walk_subtrees*/, void *data)
return NULL_TREE;
}
-/* Check that class T has all the abi tags that subobject SUBOB has, or
- warn if not. */
+/* Set IDENTIFIER_MARKED on all the ABI tags on T and its (transitively
+ complete) template arguments. */
static void
-check_abi_tags (tree t, tree subob)
+mark_type_abi_tags (tree t, bool val)
{
tree attributes = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (t));
if (attributes)
@@ -1368,25 +1368,41 @@ check_abi_tags (tree t, tree subob)
{
tree tag = TREE_VALUE (list);
tree id = get_identifier (TREE_STRING_POINTER (tag));
- IDENTIFIER_MARKED (id) = true;
+ IDENTIFIER_MARKED (id) = val;
+ }
+ }
+
+ /* Also mark ABI tags from template arguments. */
+ if (CLASSTYPE_TEMPLATE_INFO (t))
+ {
+ tree args = CLASSTYPE_TI_ARGS (t);
+ for (int i = 0; i < TMPL_ARGS_DEPTH (args); ++i)
+ {
+ tree level = TMPL_ARGS_LEVEL (args, i+1);
+ for (int j = 0; j < TREE_VEC_LENGTH (level); ++j)
+ {
+ tree arg = TREE_VEC_ELT (level, j);
+ if (CLASS_TYPE_P (arg))
+ mark_type_abi_tags (arg, val);
+ }
}
}
+}
+
+/* Check that class T has all the abi tags that subobject SUBOB has, or
+ warn if not. */
+
+static void
+check_abi_tags (tree t, tree subob)
+{
+ mark_type_abi_tags (t, true);
tree subtype = TYPE_P (subob) ? subob : TREE_TYPE (subob);
struct abi_tag_data data = { t, subob };
cp_walk_tree_without_duplicates (&subtype, find_abi_tags_r, &data);
- if (attributes)
- {
- for (tree list = TREE_VALUE (attributes); list;
- list = TREE_CHAIN (list))
- {
- tree tag = TREE_VALUE (list);
- tree id = get_identifier (TREE_STRING_POINTER (tag));
- IDENTIFIER_MARKED (id) = false;
- }
- }
+ mark_type_abi_tags (t, false);
}
/* Run through the base classes of T, updating CANT_HAVE_CONST_CTOR_P,
@@ -3763,7 +3779,9 @@ walk_subobject_offsets (tree type,
/* Iterate through the fields of TYPE. */
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
- if (TREE_CODE (field) == FIELD_DECL && !DECL_ARTIFICIAL (field))
+ if (TREE_CODE (field) == FIELD_DECL
+ && TREE_TYPE (field) != error_mark_node
+ && !DECL_ARTIFICIAL (field))
{
tree field_offset;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 6a5102d9aba..7cbac435c89 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2737,7 +2737,10 @@ extern void decl_shadowed_for_var_insert (tree, tree);
: TREE_VEC_LENGTH (INNERMOST_TEMPLATE_ARGS (NODE))
#endif
/* The list of typedefs - used in the template - that need
- access checking at template instantiation time. */
+ access checking at template instantiation time.
+
+ FIXME this should be associated with the TEMPLATE_DECL, not the
+ TEMPLATE_INFO. */
#define TI_TYPEDEFS_NEEDING_ACCESS_CHECKING(NODE) \
((struct tree_template_info*)TEMPLATE_INFO_CHECK \
(NODE))->typedefs_needing_access_checking
@@ -5278,6 +5281,7 @@ extern bool decl_constant_var_p (tree);
extern bool decl_maybe_constant_var_p (tree);
extern void check_default_args (tree);
extern bool mark_used (tree);
+extern bool mark_used (tree, tsubst_flags_t);
extern void finish_static_data_member_decl (tree, tree, bool, tree, int);
extern tree cp_build_parm_decl (tree, tree);
extern tree get_guard (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c37b4fe5592..9eb1d12ceb2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -622,17 +622,20 @@ poplevel (int keep, int reverse, int functionbody)
push_local_binding where the list of decls returned by
getdecls is built. */
decl = TREE_CODE (d) == TREE_LIST ? TREE_VALUE (d) : d;
+ // See through references for improved -Wunused-variable (PR 38958).
+ tree type = non_reference (TREE_TYPE (decl));
if (VAR_P (decl)
&& (! TREE_USED (decl) || !DECL_READ_P (decl))
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl)
- && TREE_TYPE (decl) != error_mark_node
- && (!CLASS_TYPE_P (TREE_TYPE (decl))
- || !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl))))
+ && type != error_mark_node
+ && (!CLASS_TYPE_P (type)
+ || !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)))
{
if (! TREE_USED (decl))
warning (OPT_Wunused_variable, "unused variable %q+D", decl);
else if (DECL_CONTEXT (decl) == current_function_decl
+ // For -Wunused-but-set-variable leave references alone.
&& TREE_CODE (TREE_TYPE (decl)) != REFERENCE_TYPE
&& errorcount == unused_but_set_errorcount)
{
@@ -10530,21 +10533,13 @@ grokdeclarator (const cp_declarator *declarator,
&& (TREE_CODE (type) != ARRAY_TYPE || initialized == 0))
{
if (unqualified_id)
- error ("field %qD has incomplete type", unqualified_id);
+ error ("field %qD has incomplete type %qT",
+ unqualified_id, type);
else
error ("name %qT has incomplete type", type);
- /* If we're instantiating a template, tell them which
- instantiation made the field's type be incomplete. */
- if (current_class_type
- && TYPE_NAME (current_class_type)
- && IDENTIFIER_TEMPLATE (current_class_name)
- && declspecs->type
- && declspecs->type == type)
- error (" in instantiation of template %qT",
- current_class_type);
-
- return error_mark_node;
+ type = error_mark_node;
+ decl = NULL_TREE;
}
else
{
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f725d83d0f2..d5d29127cfd 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -835,9 +835,11 @@ grokfield (const cp_declarator *declarator,
init = NULL_TREE;
value = grokdeclarator (declarator, declspecs, FIELD, init != 0, &attrlist);
- if (! value || error_operand_p (value))
+ if (! value || value == error_mark_node)
/* friend or constructor went bad. */
return error_mark_node;
+ if (TREE_TYPE (value) == error_mark_node)
+ return value;
if (TREE_CODE (value) == TYPE_DECL && init)
{
@@ -1045,8 +1047,10 @@ grokbitfield (const cp_declarator *declarator,
{
tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, &attrlist);
- if (value == error_mark_node)
+ if (value == error_mark_node)
return NULL_TREE; /* friends went bad. */
+ if (TREE_TYPE (value) == error_mark_node)
+ return value;
/* Pass friendly classes back. */
if (VOID_TYPE_P (value))
@@ -1703,9 +1707,10 @@ maybe_make_one_only (tree decl)
if (VAR_P (decl))
{
+ struct varpool_node *node = varpool_node_for_decl (decl);
DECL_COMDAT (decl) = 1;
/* Mark it needed so we don't forget to emit it. */
- mark_decl_referenced (decl);
+ node->symbol.forced_by_abi = true;
TREE_USED (decl) = 1;
}
}
@@ -1813,7 +1818,22 @@ void
mark_needed (tree decl)
{
TREE_USED (decl) = 1;
- mark_decl_referenced (decl);
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ /* Extern inline functions don't become needed when referenced.
+ If we know a method will be emitted in other TU and no new
+ functions can be marked reachable, just use the external
+ definition. */
+ struct cgraph_node *node = cgraph_get_create_node (decl);
+ node->symbol.forced_by_abi = true;
+ }
+ else if (TREE_CODE (decl) == VAR_DECL)
+ {
+ struct varpool_node *node = varpool_node_for_decl (decl);
+ /* C++ frontend use mark_decl_references to force COMDAT variables
+ to be output that might appear dead otherwise. */
+ node->symbol.forced_by_abi = true;
+ }
}
/* DECL is either a FUNCTION_DECL or a VAR_DECL. This function
@@ -4202,7 +4222,7 @@ cp_write_global_declarations (void)
struct cgraph_node *node, *next;
node = cgraph_get_node (decl);
- if (node->same_body_alias)
+ if (node->symbol.cpp_implicit_alias)
node = cgraph_alias_target (node);
cgraph_for_node_and_aliases (node, clear_decl_external,
@@ -4517,7 +4537,7 @@ possibly_inlined_p (tree decl)
wrong, true otherwise. */
bool
-mark_used (tree decl)
+mark_used (tree decl, tsubst_flags_t complain)
{
/* If DECL is a BASELINK for a single function, then treat it just
like the DECL for the function. Otherwise, if the BASELINK is
@@ -4555,9 +4575,12 @@ mark_used (tree decl)
return false;
}
}
- error ("use of deleted function %qD", decl);
- if (!maybe_explain_implicit_delete (decl))
- error_at (DECL_SOURCE_LOCATION (decl), "declared here");
+ if (complain & tf_error)
+ {
+ error ("use of deleted function %qD", decl);
+ if (!maybe_explain_implicit_delete (decl))
+ inform (DECL_SOURCE_LOCATION (decl), "declared here");
+ }
return false;
}
@@ -4570,7 +4593,8 @@ mark_used (tree decl)
{
if (!processing_template_decl && type_uses_auto (TREE_TYPE (decl)))
{
- error ("use of %qD before deduction of %<auto%>", decl);
+ if (complain & tf_error)
+ error ("use of %qD before deduction of %<auto%>", decl);
return false;
}
return true;
@@ -4719,6 +4743,12 @@ mark_used (tree decl)
return true;
}
+bool
+mark_used (tree decl)
+{
+ return mark_used (decl, tf_warning_or_error);
+}
+
tree
vtv_start_verification_constructor_init_function (void)
{
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index d33afea2414..3d6da7b5e7a 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -50,12 +50,6 @@ along with GCC; see the file COPYING3. If not see
#define LIBSTDCXX_STATIC NULL
#endif
-/* Link commands for linking in libvtv_inint when doing vtable
- verification. */
-
-#define VTABLE_LOAD_MODULE_INIT "--whole-archive,-lvtv_init,--no-whole-archive"
-#define VTABLE_LOAD_MODULE_PREINIT "-lvtv_init"
-
void
lang_specific_driver (struct cl_decoded_option **in_decoded_options,
unsigned int *in_decoded_options_count,
@@ -117,11 +111,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
/* The total number of arguments with the new stuff. */
unsigned int num_args = 1;
- /* The command line contains a -fvtable_verify. We need to add the
- init library if we are linking and if we are adding the stdc++
- library. */
- int saw_vtable_verify = 0;
-
argc = *in_decoded_options_count;
decoded_options = *in_decoded_options;
added_libraries = *in_added_libraries;
@@ -248,13 +237,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
}
break;
- case OPT_fvtable_verify_:
- if (strcmp (arg, "std") == 0)
- saw_vtable_verify = 1;
- else if (strcmp (arg, "preinit") == 0)
- saw_vtable_verify = 2;
- break;
-
}
}
@@ -267,11 +249,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
/* Add one for shared_libgcc or extra static library. */
num_args = argc + added + need_math + (library > 0) * 4 + 1;
- /* Add two more linker args, '-Wl,-u_vtable_map_vars_start and
- '-Wl,-u_vtable_map_vars_end. */
- if (saw_vtable_verify && library > 0)
- num_args += 2;
-
new_decoded_options = XNEWVEC (struct cl_decoded_option, num_args);
i = 0;
@@ -334,40 +311,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
j++;
}
- /* Add option to make sure that if we are doing vtable
- verification then we link with the libvtv_init library. */
-
- if (saw_vtable_verify == 1 && library > 0)
- {
- generate_option(OPT_Wl_, VTABLE_LOAD_MODULE_INIT, 1,
- CL_DRIVER, &new_decoded_options[j]);
- added_libraries++;
- j++;
- }
- else if (saw_vtable_verify == 2 && library > 0)
- {
- generate_option(OPT_Wl_, VTABLE_LOAD_MODULE_PREINIT, 1,
- CL_DRIVER, &new_decoded_options[j]);
- added_libraries++;
- j++;
- }
-
- /* If we are doing vtable verification, make sure the linker does
- not garbage-collect the special symbols that mark the start and
- end of the ".vtable_map_vars" section in the binary. (See
- comments in vtv_start.c and vtv_end.c for more details). */
-
- if (saw_vtable_verify > 0 && library > 0)
- {
- generate_option (OPT_Wl_,"-u_vtable_map_vars_start", 1,
- CL_DRIVER, &new_decoded_options[j]);
- j++;
-
- generate_option (OPT_Wl_,"-u_vtable_map_vars_end", 1,
- CL_DRIVER, &new_decoded_options[j]);
- j++;
- }
-
/* Add `-lstdc++' if we haven't already done so. */
if (library > 0)
{
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 17d5ca26516..2b1f9fbf318 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -597,7 +597,9 @@ add_decl_to_level (tree decl, cp_binding_level *b)
if ((VAR_P (decl)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL
- && (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
+ && (!TREE_PUBLIC (decl)
+ || decl_anon_ns_mem_p (decl)
+ || DECL_DECLARED_INLINE_P (decl))))
vec_safe_push (b->static_decls, decl);
}
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 061b5714790..a581e88e44b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -5230,10 +5230,16 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
decl);
else if (ambiguous_decls)
{
- error_at (token->location,
- "reference to %qD is ambiguous",
- token->u.value);
- print_candidates (ambiguous_decls);
+ // cp_parser_lookup_name has the same diagnostic,
+ // thus make sure to emit it at most once.
+ if (cp_parser_uncommitted_to_tentative_parse_p
+ (parser))
+ {
+ error_at (token->location,
+ "reference to %qD is ambiguous",
+ token->u.value);
+ print_candidates (ambiguous_decls);
+ }
decl = error_mark_node;
}
else
@@ -5546,6 +5552,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
tree type;
tree expression;
const char *saved_message;
+ bool saved_in_type_id_in_expr_p;
/* All of these can be handled in the same way from the point
of view of parsing. Begin by consuming the token
@@ -5560,7 +5567,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
/* Look for the opening `<'. */
cp_parser_require (parser, CPP_LESS, RT_LESS);
/* Parse the type to which we are casting. */
+ saved_in_type_id_in_expr_p = parser->in_type_id_in_expr_p;
+ parser->in_type_id_in_expr_p = true;
type = cp_parser_type_id (parser);
+ parser->in_type_id_in_expr_p = saved_in_type_id_in_expr_p;
/* Look for the closing `>'. */
cp_parser_require (parser, CPP_GREATER, RT_GREATER);
/* Restore the old message. */
@@ -17779,7 +17789,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
&& !parser->in_type_id_in_expr_p
&& cp_parser_uncommitted_to_tentative_parse_p (parser)
/* However, a parameter-declaration of the form
- "foat(f)" (which is a valid declaration of a
+ "float(f)" (which is a valid declaration of a
parameter "f") can also be interpreted as an
expression (the conversion of "f" to "float"). */
&& !parenthesized_p)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d9a14cc3cbd..3602fcd2dd8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7561,7 +7561,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
if (CLASS_TYPE_P (template_type) && is_dependent_type)
/* If the type makes use of template parameters, the
code that generates debugging information will crash. */
- DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
+ DECL_IGNORED_P (TYPE_MAIN_DECL (t)) = 1;
/* Possibly limit visibility based on template args. */
TREE_PUBLIC (type_decl) = 1;
@@ -8863,9 +8863,8 @@ instantiate_class_template_1 (tree type)
else if (TREE_CODE (r) == FIELD_DECL)
{
/* Determine whether R has a valid type and can be
- completed later. If R is invalid, then it is
- replaced by error_mark_node so that it will not be
- added to TYPE_FIELDS. */
+ completed later. If R is invalid, then its type is
+ replaced by error_mark_node. */
tree rtype = TREE_TYPE (r);
if (can_complete_type_without_circularity (rtype))
complete_type (rtype);
@@ -8873,7 +8872,7 @@ instantiate_class_template_1 (tree type)
if (!COMPLETE_TYPE_P (rtype))
{
cxx_incomplete_type_error (r, rtype);
- r = error_mark_node;
+ TREE_TYPE (r) = error_mark_node;
}
}
@@ -10514,8 +10513,6 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* We don't have to set DECL_CONTEXT here; it is set by
finish_member_declaration. */
DECL_CHAIN (r) = NULL_TREE;
- if (VOID_TYPE_P (type))
- error ("instantiation of %q+D as type %qT", r, type);
apply_late_template_attributes (&r, DECL_ATTRIBUTES (r), 0,
args, complain, in_decl);
@@ -17402,6 +17399,13 @@ mark_decl_instantiated (tree result, int extern_p)
if (TREE_ASM_WRITTEN (result))
return;
+ /* For anonymous namespace we don't need to do anything. */
+ if (decl_anon_ns_mem_p (result))
+ {
+ gcc_assert (!TREE_PUBLIC (result));
+ return;
+ }
+
if (TREE_CODE (result) != FUNCTION_DECL)
/* The TREE_PUBLIC flag for function declarations will have been
set correctly by tsubst. */
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 90104406dff..f3094981dfb 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -622,19 +622,10 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
/* If *type is an unambiguous accessible base class of *exprtype,
convert statically. */
{
- tree binfo;
-
- binfo = lookup_base (TREE_TYPE (exprtype), TREE_TYPE (type),
- ba_check, NULL, complain);
-
+ tree binfo = lookup_base (TREE_TYPE (exprtype), TREE_TYPE (type),
+ ba_check, NULL, complain);
if (binfo)
- {
- expr = build_base_path (PLUS_EXPR, convert_from_reference (expr),
- binfo, 0, complain);
- if (TYPE_PTR_P (exprtype))
- expr = rvalue (expr);
- return expr;
- }
+ return build_static_cast (type, expr, complain);
}
/* Otherwise *exprtype must be a polymorphic class (have a vtbl). */
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c1385c10b60..0a700b7a0f6 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1778,8 +1778,9 @@ finish_qualified_id_expr (tree qualifying_class,
if (error_operand_p (expr))
return error_mark_node;
- if (DECL_P (expr) || BASELINK_P (expr))
- mark_used (expr);
+ if ((DECL_P (expr) || BASELINK_P (expr))
+ && !mark_used (expr, complain))
+ return error_mark_node;
if (template_p)
check_template_keyword (expr);
@@ -3689,10 +3690,17 @@ finish_offsetof (tree expr)
|| TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE
|| TREE_TYPE (expr) == unknown_type_node)
{
- if (TREE_CODE (expr) == COMPONENT_REF
- || TREE_CODE (expr) == COMPOUND_EXPR)
- expr = TREE_OPERAND (expr, 1);
- error ("cannot apply %<offsetof%> to member function %qD", expr);
+ if (TREE_CODE (expr) == INDIRECT_REF)
+ error ("second operand of %<offsetof%> is neither a single "
+ "identifier nor a sequence of member accesses and "
+ "array references");
+ else
+ {
+ if (TREE_CODE (expr) == COMPONENT_REF
+ || TREE_CODE (expr) == COMPOUND_EXPR)
+ expr = TREE_OPERAND (expr, 1);
+ error ("cannot apply %<offsetof%> to member function %qD", expr);
+ }
return error_mark_node;
}
if (REFERENCE_REF_P (expr))
@@ -9486,6 +9494,15 @@ add_capture (tree lambda, tree id, tree initializer, bool by_reference_p,
nelts_field, array_type_nelts (type));
type = ctype;
}
+ else if (variably_modified_type_p (type, NULL_TREE))
+ {
+ error ("capture of variable-size type %qT that is not a C++1y array "
+ "of runtime bound", type);
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && variably_modified_type_p (TREE_TYPE (type), NULL_TREE))
+ inform (input_location, "because the array element type %qT has "
+ "variable size", TREE_TYPE (type));
+ }
else if (by_reference_p)
{
type = build_reference_type (type);
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index e0ebae95723..401904d8ea4 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1236,6 +1236,8 @@ process_init_constructor_record (tree type, tree init,
type = TREE_TYPE (field);
if (DECL_BIT_FIELD_TYPE (field))
type = DECL_BIT_FIELD_TYPE (field);
+ if (type == error_mark_node)
+ return PICFLAG_ERRONEOUS;
if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
{
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index 4b06b36a878..4cb0d325da7 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -465,9 +465,12 @@ check_and_record_registered_pairs (tree vtable_decl, tree vptr_address,
&& TREE_CODE (TREE_OPERAND (vptr_address, 0)) == MEM_REF)
vptr_address = TREE_OPERAND (vptr_address, 0);
- offset = TREE_INT_CST_LOW (TREE_OPERAND (vptr_address, 1));
+ if (TREE_OPERAND_LENGTH (vptr_address) > 1)
+ offset = TREE_INT_CST_LOW (TREE_OPERAND (vptr_address, 1));
+ else
+ offset = 0;
- base_vtable_map_node = vtbl_map_get_node (base_class);
+ base_vtable_map_node = vtbl_map_get_node (TYPE_MAIN_VARIANT (base_class));
inserted_something = vtbl_map_node_registration_insert
(base_vtable_map_node,
@@ -627,9 +630,7 @@ register_other_binfo_vtables (tree binfo, tree base_class,
{
if ((!BINFO_PRIMARY_P (base_binfo)
|| BINFO_VIRTUAL_P (base_binfo))
- && (vtable_decl = get_vtbl_decl_for_binfo (base_binfo))
- && !(DECL_VTABLE_OR_VTT_P (vtable_decl)
- && DECL_CONSTRUCTION_VTABLE_P (vtable_decl)))
+ && (vtable_decl = get_vtbl_decl_for_binfo (base_binfo)))
{
tree vtable_address = build_vtbl_address (base_binfo);
@@ -835,6 +836,49 @@ insert_call_to_register_pair (tree vtable_address, int num_args, tree arg1,
num_calls_to_regpair++;
}
+static void
+output_set_info (tree record_type, tree *vtbl_ptr_array, int array_size)
+{
+ static int vtv_debug_log_fd = -1;
+ char buffer[1024];
+ int bytes_written __attribute__ ((unused));
+ int i;
+ const char *class_name =
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (record_type)));
+
+ if (vtv_debug_log_fd == -1)
+ vtv_debug_log_fd = open ("/tmp/vtv_set_ptr_data.log",
+ O_WRONLY | O_APPEND | O_CREAT, S_IRWXU);
+ if (vtv_debug_log_fd == -1)
+ return;
+
+ for (int i = 0; i < array_size; ++i)
+ {
+ const char *vptr_name = "unknown";
+ int vptr_offset = 0;
+
+ if (TREE_CODE (vtbl_ptr_array[i]) == POINTER_PLUS_EXPR)
+ {
+ tree arg0 = TREE_OPERAND (vtbl_ptr_array[i], 0);
+ tree arg1 = TREE_OPERAND (vtbl_ptr_array[i], 1);
+
+ if (TREE_CODE (arg0) == ADDR_EXPR)
+ arg0 = TREE_OPERAND (arg0, 0);
+
+ if (TREE_CODE (arg0) == VAR_DECL)
+ vptr_name = IDENTIFIER_POINTER (DECL_NAME (arg0));
+
+ if (TREE_CODE (arg1) == INTEGER_CST)
+ vptr_offset = TREE_INT_CST_LOW (arg1);
+ }
+
+ snprintf (buffer, sizeof (buffer), "%s %s %s + %d\n",
+ main_input_filename, class_name, vptr_name, vptr_offset);
+ bytes_written = write (vtv_debug_log_fd, buffer, strlen(buffer));
+ }
+
+}
+
/* This function goes through our internal class hierarchy & vtable
pointer data structure and outputs calls to __VLTRegisterPair for
every class-vptr pair (for those classes whose vtable would be
@@ -957,6 +1001,10 @@ register_all_pairs (tree body)
str2 = build_string_literal (strlen ("unknown") + 1,
"unknown");
+ if (flag_vtv_debug)
+ output_set_info (current->class_info->class_type,
+ vtbl_ptr_array, num_vtable_args);
+
if (num_vtable_args > 1)
{
insert_call_to_register_set (current->class_name, num_vtable_args,
@@ -995,7 +1043,7 @@ find_graph_node (tree class_type)
{
struct vtbl_map_node *vtbl_node;
- vtbl_node = vtbl_map_get_node (class_type);
+ vtbl_node = vtbl_map_get_node (TYPE_MAIN_VARIANT (class_type));
if (vtbl_node)
return vtbl_node->class_info;
@@ -1031,45 +1079,6 @@ update_class_hierarchy_information (tree base_class,
add_hierarchy_pair (base_node, derived_node);
}
-/* Generate an undefined variable (a reference) to a varible defined
- in the vtv_init libraty. In that way, if the a module is not linked
- with the vtv_init library, the linker will generate an undefined
- symbol error. Which is much better that getting a segmentation
- violation at runtime. The parameter, INIT_ROUTINE_BODY, is the
- function body of our constructor initialization function, to which
- we add the reference to this symbol (and all of our calls to
- __VLTRegisterPair).
-
- For more information, see comments in
- libstdc++-v3/libsupc++/vtv_init.cc. */
-
-static void
-create_undef_reference_to_vtv_init (tree init_routine_body)
-{
- const char *vtv_init_undef_var = "__vtv_defined_in_vtv_init_lib";
- tree var_decl;
- tree init_zero;
-
- var_decl = build_decl (UNKNOWN_LOCATION, VAR_DECL,
- get_identifier (vtv_init_undef_var),
- int32_type_node);
- TREE_PUBLIC (var_decl) = 1;
- DECL_EXTERNAL (var_decl) = 1;
- TREE_STATIC (var_decl) = 1;
- SET_DECL_ASSEMBLER_NAME (var_decl, get_identifier (vtv_init_undef_var));
- DECL_ARTIFICIAL (var_decl) = 1;
- TREE_READONLY (var_decl) = 0;
- DECL_IGNORED_P (var_decl) = 1;
- DECL_PRESERVE_P (var_decl) = 1;
- varpool_finalize_decl (var_decl);
-
- /* Store a value in the undefined variable to force the creation of a
- a reference. */
- init_zero = build2 (MODIFY_EXPR, TREE_TYPE (var_decl), var_decl,
- integer_zero_node);
- append_to_statement_list (init_zero, &init_routine_body);
-
-}
static void
write_out_vtv_count_data (void)
@@ -1085,7 +1094,6 @@ write_out_vtv_count_data (void)
if (vtv_count_log_fd == -1)
return;
- /* for (current = vtbl_map_nodes; current; current = current->next) */
for (unsigned i = 0; i < num_vtable_map_nodes; ++i)
{
struct vtbl_map_node *current = vtbl_map_nodes_vec[i];
@@ -1123,10 +1131,6 @@ vtv_register_class_hierarchy_information (tree init_routine_body)
/* Add class hierarchy pairs to the vtable map data structure. */
registered_something = register_all_pairs (init_routine_body);
- if (registered_something
- && flag_vtable_verify == VTV_STANDARD_PRIORITY)
- create_undef_reference_to_vtv_init (init_routine_body);
-
if (flag_vtv_counts)
write_out_vtv_count_data ();
@@ -1157,20 +1161,19 @@ vtv_generate_init_routine (void)
if (vtable_classes_found)
{
- current_function_decl =
- vtv_finish_verification_constructor_init_function (init_routine_body);
- allocate_struct_function (current_function_decl, false);
- TREE_STATIC (current_function_decl) = 1;
- TREE_USED (current_function_decl) = 1;
- DECL_PRESERVE_P (current_function_decl) = 1;
+ tree vtv_fndecl =
+ vtv_finish_verification_constructor_init_function (init_routine_body);
+ TREE_STATIC (vtv_fndecl) = 1;
+ TREE_USED (vtv_fndecl) = 1;
+ DECL_PRESERVE_P (vtv_fndecl) = 1;
if (flag_vtable_verify == VTV_PREINIT_PRIORITY)
{
- DECL_STATIC_CONSTRUCTOR (current_function_decl) = 0;
- assemble_vtv_preinit_initializer (current_function_decl);
+ DECL_STATIC_CONSTRUCTOR (vtv_fndecl) = 0;
+ assemble_vtv_preinit_initializer (vtv_fndecl);
}
- gimplify_function_tree (current_function_decl);
- cgraph_add_new_function (current_function_decl, false);
+ gimplify_function_tree (vtv_fndecl);
+ cgraph_add_new_function (vtv_fndecl, false);
cgraph_process_new_functions ();
}
@@ -1198,7 +1201,7 @@ vtable_find_or_create_map_decl (tree base_type)
var_name = get_mangled_vtable_map_var_name (base_type);
/* We've already created the variable; just look it. */
- vtable_map_node = vtbl_map_get_node (base_type);
+ vtable_map_node = vtbl_map_get_node (TYPE_MAIN_VARIANT (base_type));
if (!vtable_map_node || (vtable_map_node->vtbl_map_decl == NULL_TREE))
{
@@ -1236,7 +1239,8 @@ vtable_find_or_create_map_decl (tree base_type)
varpool_finalize_decl (var_decl);
if (!vtable_map_node)
- vtable_map_node = find_or_create_vtbl_map_node (base_type);
+ vtable_map_node =
+ find_or_create_vtbl_map_node (TYPE_MAIN_VARIANT (base_type));
if (vtable_map_node->vtbl_map_decl == NULL_TREE)
vtable_map_node->vtbl_map_decl = var_decl;
}
diff --git a/gcc/cse.c b/gcc/cse.c
index f2c8f635d39..7e6c5184a85 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1824,7 +1824,7 @@ flush_hash_table (void)
}
}
-/* Function called for each rtx to check whether true dependence exist. */
+/* Function called for each rtx to check whether an anti dependence exist. */
struct check_dependence_data
{
enum machine_mode mode;
@@ -1837,7 +1837,7 @@ check_dependence (rtx *x, void *data)
{
struct check_dependence_data *d = (struct check_dependence_data *) data;
if (*x && MEM_P (*x))
- return canon_true_dependence (d->exp, d->mode, d->addr, *x, NULL_RTX);
+ return canon_anti_dependence (d->exp, d->mode, d->addr, *x);
else
return 0;
}
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 589e41ed3df..2c73535c12b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -2263,8 +2263,8 @@ cselib_invalidate_mem (rtx mem_rtx)
continue;
}
if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS)
- && ! canon_true_dependence (mem_rtx, GET_MODE (mem_rtx),
- mem_addr, x, NULL_RTX))
+ && ! canon_anti_dependence (mem_rtx, GET_MODE (mem_rtx),
+ mem_addr, x))
{
has_mem = true;
num_mems++;
diff --git a/gcc/data-streamer-out.c b/gcc/data-streamer-out.c
index 4165b8747fc..247ff636e49 100644
--- a/gcc/data-streamer-out.c
+++ b/gcc/data-streamer-out.c
@@ -187,6 +187,11 @@ void
streamer_write_uhwi_stream (struct lto_output_stream *obs,
unsigned HOST_WIDE_INT work)
{
+ if (obs->left_in_block == 0)
+ lto_append_block (obs);
+ char *current_pointer = obs->current_pointer;
+ unsigned int left_in_block = obs->left_in_block;
+ unsigned int size = 0;
do
{
unsigned int byte = (work & 0x7f);
@@ -195,9 +200,34 @@ streamer_write_uhwi_stream (struct lto_output_stream *obs,
/* More bytes to follow. */
byte |= 0x80;
- streamer_write_char_stream (obs, byte);
+ *(current_pointer++) = byte;
+ left_in_block--;
+ size++;
}
- while (work != 0);
+ while (work != 0 && left_in_block > 0);
+ if (work != 0)
+ {
+ obs->left_in_block = 0;
+ lto_append_block (obs);
+ current_pointer = obs->current_pointer;
+ left_in_block = obs->left_in_block;
+ do
+ {
+ unsigned int byte = (work & 0x7f);
+ work >>= 7;
+ if (work != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ *(current_pointer++) = byte;
+ left_in_block--;
+ size++;
+ }
+ while (work != 0);
+ }
+ obs->current_pointer = current_pointer;
+ obs->left_in_block = left_in_block;
+ obs->total_size += size;
}
@@ -206,21 +236,56 @@ streamer_write_uhwi_stream (struct lto_output_stream *obs,
void
streamer_write_hwi_stream (struct lto_output_stream *obs, HOST_WIDE_INT work)
{
- int more, byte;
-
+ if (obs->left_in_block == 0)
+ lto_append_block (obs);
+ char *current_pointer = obs->current_pointer;
+ unsigned int left_in_block = obs->left_in_block;
+ unsigned int size = 0;
+ bool more;
do
{
- byte = (work & 0x7f);
- /* arithmetic shift */
- work >>= 7;
- more = !((work == 0 && (byte & 0x40) == 0)
- || (work == -1 && (byte & 0x40) != 0));
+ unsigned int byte = (work & 0x7f);
+ /* If the lower 7-bits are sign-extended 0 or -1 we are finished. */
+ work >>= 6;
+ more = !(work == 0 || work == -1);
if (more)
- byte |= 0x80;
-
- streamer_write_char_stream (obs, byte);
+ {
+ /* More bits to follow. */
+ work >>= 1;
+ byte |= 0x80;
+ }
+
+ *(current_pointer++) = byte;
+ left_in_block--;
+ size++;
+ }
+ while (more && left_in_block > 0);
+ if (more)
+ {
+ obs->left_in_block = 0;
+ lto_append_block (obs);
+ current_pointer = obs->current_pointer;
+ left_in_block = obs->left_in_block;
+ do
+ {
+ unsigned int byte = (work & 0x7f);
+ work >>= 6;
+ more = !(work == 0 || work == -1);
+ if (more)
+ {
+ work >>= 1;
+ byte |= 0x80;
+ }
+
+ *(current_pointer++) = byte;
+ left_in_block--;
+ size++;
+ }
+ while (more);
}
- while (more);
+ obs->current_pointer = current_pointer;
+ obs->left_in_block = left_in_block;
+ obs->total_size += size;
}
/* Write a GCOV counter value WORK to OBS. */
diff --git a/gcc/data-streamer.h b/gcc/data-streamer.h
index b79abd9fd92..c18779ba30a 100644
--- a/gcc/data-streamer.h
+++ b/gcc/data-streamer.h
@@ -183,8 +183,9 @@ streamer_write_char_stream (struct lto_output_stream *obs, char c)
lto_append_block (obs);
/* Write the actual character. */
- *obs->current_pointer = c;
- obs->current_pointer++;
+ char *current_pointer = obs->current_pointer;
+ *(current_pointer++) = c;
+ obs->current_pointer = current_pointer;
obs->total_size++;
obs->left_in_block--;
}
@@ -216,13 +217,7 @@ streamer_write_hwi_in_range (struct lto_output_stream *obs,
&& range < 0x7fffffff);
val -= min;
- streamer_write_char_stream (obs, val & 255);
- if (range >= 0xff)
- streamer_write_char_stream (obs, (val >> 8) & 255);
- if (range >= 0xffff)
- streamer_write_char_stream (obs, (val >> 16) & 255);
- if (range >= 0xffffff)
- streamer_write_char_stream (obs, (val >> 24) & 255);
+ streamer_write_uhwi_stream (obs, (unsigned HOST_WIDE_INT) val);
}
/* Input VAL into OBS and verify it is in range MIN...MAX that is supposed
@@ -235,17 +230,11 @@ streamer_read_hwi_in_range (struct lto_input_block *ib,
HOST_WIDE_INT max)
{
HOST_WIDE_INT range = max - min;
- HOST_WIDE_INT val = streamer_read_uchar (ib);
+ unsigned HOST_WIDE_INT uval = streamer_read_uhwi (ib);
gcc_checking_assert (range > 0 && range < 0x7fffffff);
- if (range >= 0xff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 8;
- if (range >= 0xffff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 16;
- if (range >= 0xffffff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 24;
- val += min;
+ HOST_WIDE_INT val = (HOST_WIDE_INT) (uval + (unsigned HOST_WIDE_INT) min);
if (val < min || val > max)
lto_value_range_error (purpose, val, min, max);
return val;
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index e16222c5993..6ce26efbe1e 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -13991,6 +13991,38 @@ int vec_any_le (vector long long, vector long long);
int vec_any_lt (vector long long, vector long long);
int vec_any_ne (vector long long, vector long long);
+vector long long vec_eqv (vector long long, vector long long);
+vector long long vec_eqv (vector bool long long, vector long long);
+vector long long vec_eqv (vector long long, vector bool long long);
+vector unsigned long long vec_eqv (vector unsigned long long,
+ vector unsigned long long);
+vector unsigned long long vec_eqv (vector bool long long,
+ vector unsigned long long);
+vector unsigned long long vec_eqv (vector unsigned long long,
+ vector bool long long);
+vector int vec_eqv (vector int, vector int);
+vector int vec_eqv (vector bool int, vector int);
+vector int vec_eqv (vector int, vector bool int);
+vector unsigned int vec_eqv (vector unsigned int, vector unsigned int);
+vector unsigned int vec_eqv (vector bool unsigned int,
+ vector unsigned int);
+vector unsigned int vec_eqv (vector unsigned int,
+ vector bool unsigned int);
+vector short vec_eqv (vector short, vector short);
+vector short vec_eqv (vector bool short, vector short);
+vector short vec_eqv (vector short, vector bool short);
+vector unsigned short vec_eqv (vector unsigned short, vector unsigned short);
+vector unsigned short vec_eqv (vector bool unsigned short,
+ vector unsigned short);
+vector unsigned short vec_eqv (vector unsigned short,
+ vector bool unsigned short);
+vector signed char vec_eqv (vector signed char, vector signed char);
+vector signed char vec_eqv (vector bool signed char, vector signed char);
+vector signed char vec_eqv (vector signed char, vector bool signed char);
+vector unsigned char vec_eqv (vector unsigned char, vector unsigned char);
+vector unsigned char vec_eqv (vector bool unsigned char, vector unsigned char);
+vector unsigned char vec_eqv (vector unsigned char, vector bool unsigned char);
+
vector long long vec_max (vector long long, vector long long);
vector unsigned long long vec_max (vector unsigned long long,
vector unsigned long long);
@@ -13999,6 +14031,70 @@ vector long long vec_min (vector long long, vector long long);
vector unsigned long long vec_min (vector unsigned long long,
vector unsigned long long);
+vector long long vec_nand (vector long long, vector long long);
+vector long long vec_nand (vector bool long long, vector long long);
+vector long long vec_nand (vector long long, vector bool long long);
+vector unsigned long long vec_nand (vector unsigned long long,
+ vector unsigned long long);
+vector unsigned long long vec_nand (vector bool long long,
+ vector unsigned long long);
+vector unsigned long long vec_nand (vector unsigned long long,
+ vector bool long long);
+vector int vec_nand (vector int, vector int);
+vector int vec_nand (vector bool int, vector int);
+vector int vec_nand (vector int, vector bool int);
+vector unsigned int vec_nand (vector unsigned int, vector unsigned int);
+vector unsigned int vec_nand (vector bool unsigned int,
+ vector unsigned int);
+vector unsigned int vec_nand (vector unsigned int,
+ vector bool unsigned int);
+vector short vec_nand (vector short, vector short);
+vector short vec_nand (vector bool short, vector short);
+vector short vec_nand (vector short, vector bool short);
+vector unsigned short vec_nand (vector unsigned short, vector unsigned short);
+vector unsigned short vec_nand (vector bool unsigned short,
+ vector unsigned short);
+vector unsigned short vec_nand (vector unsigned short,
+ vector bool unsigned short);
+vector signed char vec_nand (vector signed char, vector signed char);
+vector signed char vec_nand (vector bool signed char, vector signed char);
+vector signed char vec_nand (vector signed char, vector bool signed char);
+vector unsigned char vec_nand (vector unsigned char, vector unsigned char);
+vector unsigned char vec_nand (vector bool unsigned char, vector unsigned char);
+vector unsigned char vec_nand (vector unsigned char, vector bool unsigned char);
+
+vector long long vec_orc (vector long long, vector long long);
+vector long long vec_orc (vector bool long long, vector long long);
+vector long long vec_orc (vector long long, vector bool long long);
+vector unsigned long long vec_orc (vector unsigned long long,
+ vector unsigned long long);
+vector unsigned long long vec_orc (vector bool long long,
+ vector unsigned long long);
+vector unsigned long long vec_orc (vector unsigned long long,
+ vector bool long long);
+vector int vec_orc (vector int, vector int);
+vector int vec_orc (vector bool int, vector int);
+vector int vec_orc (vector int, vector bool int);
+vector unsigned int vec_orc (vector unsigned int, vector unsigned int);
+vector unsigned int vec_orc (vector bool unsigned int,
+ vector unsigned int);
+vector unsigned int vec_orc (vector unsigned int,
+ vector bool unsigned int);
+vector short vec_orc (vector short, vector short);
+vector short vec_orc (vector bool short, vector short);
+vector short vec_orc (vector short, vector bool short);
+vector unsigned short vec_orc (vector unsigned short, vector unsigned short);
+vector unsigned short vec_orc (vector bool unsigned short,
+ vector unsigned short);
+vector unsigned short vec_orc (vector unsigned short,
+ vector bool unsigned short);
+vector signed char vec_orc (vector signed char, vector signed char);
+vector signed char vec_orc (vector bool signed char, vector signed char);
+vector signed char vec_orc (vector signed char, vector bool signed char);
+vector unsigned char vec_orc (vector unsigned char, vector unsigned char);
+vector unsigned char vec_orc (vector bool unsigned char, vector unsigned char);
+vector unsigned char vec_orc (vector unsigned char, vector bool unsigned char);
+
vector int vec_pack (vector long long, vector long long);
vector unsigned int vec_pack (vector unsigned long long,
vector unsigned long long);
@@ -14047,6 +14143,27 @@ vector unsigned long long vec_vaddudm (vector bool unsigned long long,
vector unsigned long long vec_vaddudm (vector unsigned long long,
vector bool unsigned long long);
+vector long long vec_vclz (vector long long);
+vector unsigned long long vec_vclz (vector unsigned long long);
+vector int vec_vclz (vector int);
+vector unsigned int vec_vclz (vector int);
+vector short vec_vclz (vector short);
+vector unsigned short vec_vclz (vector unsigned short);
+vector signed char vec_vclz (vector signed char);
+vector unsigned char vec_vclz (vector unsigned char);
+
+vector signed char vec_vclzb (vector signed char);
+vector unsigned char vec_vclzb (vector unsigned char);
+
+vector long long vec_vclzd (vector long long);
+vector unsigned long long vec_vclzd (vector unsigned long long);
+
+vector short vec_vclzh (vector short);
+vector unsigned short vec_vclzh (vector unsigned short);
+
+vector int vec_vclzw (vector int);
+vector unsigned int vec_vclzw (vector int);
+
vector long long vec_vmaxsd (vector long long, vector long long);
vector unsigned long long vec_vmaxud (vector unsigned long long,
@@ -14068,6 +14185,27 @@ vector unsigned int vec_vpkudum (vector unsigned long long,
vector unsigned long long);
vector bool int vec_vpkudum (vector bool long long, vector bool long long);
+vector long long vec_vpopcnt (vector long long);
+vector unsigned long long vec_vpopcnt (vector unsigned long long);
+vector int vec_vpopcnt (vector int);
+vector unsigned int vec_vpopcnt (vector int);
+vector short vec_vpopcnt (vector short);
+vector unsigned short vec_vpopcnt (vector unsigned short);
+vector signed char vec_vpopcnt (vector signed char);
+vector unsigned char vec_vpopcnt (vector unsigned char);
+
+vector signed char vec_vpopcntb (vector signed char);
+vector unsigned char vec_vpopcntb (vector unsigned char);
+
+vector long long vec_vpopcntd (vector long long);
+vector unsigned long long vec_vpopcntd (vector unsigned long long);
+
+vector short vec_vpopcnth (vector short);
+vector unsigned short vec_vpopcnth (vector unsigned short);
+
+vector int vec_vpopcntw (vector int);
+vector unsigned int vec_vpopcntw (vector int);
+
vector long long vec_vrld (vector long long, vector unsigned long long);
vector unsigned long long vec_vrld (vector unsigned long long,
vector unsigned long long);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 06c55fe4808..dd828800955 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -512,7 +512,8 @@ Objective-C and Objective-C++ Dialects}.
-mword-relocations @gol
-mfix-cortex-m3-ldrd @gol
-munaligned-access @gol
--mneon-for-64bits}
+-mneon-for-64bits @gol
+-mrestrict-it}
@emph{AVR Options}
@gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
@@ -752,6 +753,7 @@ Objective-C and Objective-C++ Dialects}.
-mno-float -msingle-float -mdouble-float @gol
-mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol
-mmcu -mmno-mcu @gol
+-meva -mno-eva @gol
-mmicromips -mno-micromips @gol
-mfpu=@var{fpu-type} @gol
-msmartmips -mno-smartmips @gol
@@ -6172,7 +6174,7 @@ Controls optimization dumps from various optimization passes. If the
@samp{-@var{options}} form is used, @var{options} is a list of
@samp{-} separated options to select the dump details and
optimizations. If @var{options} is not specified, it defaults to
-@option{all} for details and @option{optall} for optimization
+@option{optimized} for details and @option{optall} for optimization
groups. If the @var{filename} is not specified, it defaults to
@file{stderr}. Note that the output @var{filename} will be overwritten
in case of multiple translation units. If a combined output from
@@ -11632,6 +11634,12 @@ defined.
Enables using Neon to handle scalar 64-bits operations. This is
disabled by default since the cost of moving data from core registers
to Neon is high.
+
+@item -mrestrict-it
+@opindex mrestrict-it
+Restricts generation of IT blocks to conform to the rules of ARMv8.
+IT blocks can only contain a single 16-bit instruction from a select
+set of instructions. This option is on by default for ARMv8 Thumb mode.
@end table
@node AVR Options
@@ -13825,10 +13833,19 @@ Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
set support.
+@item core-avx2
+Intel Core CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
+SSE4.1, SSE4.2, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2
+and F16C instruction set support.
+
@item atom
-Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
+Intel Atom CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
instruction set support.
+@item slm
+Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
+SSE4.1 and SSE4.2 instruction set support.
+
@item k6
AMD K6 CPU with MMX instruction set support.
@@ -16376,6 +16393,12 @@ Use (do not use) MT Multithreading instructions.
@opindex mno-mcu
Use (do not use) the MIPS MCU ASE instructions.
+@item -meva
+@itemx -mno-eva
+@opindex meva
+@opindex mno-eva
+Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
+
@item -mlong64
@opindex mlong64
Force @code{long} types to be 64 bits wide. See @option{-mlong32} for
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 8c72c850852..3b20991af52 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -8866,7 +8866,8 @@ can be quite tedious to describe these forms directly in the
(define_cond_exec
[@var{predicate-pattern}]
"@var{condition}"
- "@var{output-template}")
+ "@var{output-template}"
+ "@var{optional-insn-attribues}")
@end smallexample
@var{predicate-pattern} is the condition that must be true for the
@@ -8887,6 +8888,13 @@ In order to handle the general case, there is a global variable
@code{current_insn_predicate} that will contain the entire predicate
if the current insn is predicated, and will otherwise be @code{NULL}.
+@var{optional-insn-attributes} is an optional vector of attributes that gets
+appended to the insn attributes of the produced cond_exec rtx. It can
+be used to add some distinguishing attribute to cond_exec rtxs produced
+that way. An example usage would be to use this attribute in conjunction
+with attributes on the main pattern to disable particular alternatives under
+certain conditions.
+
When @code{define_cond_exec} is used, an implicit reference to
the @code{predicable} instruction attribute is made.
@xref{Insn Attributes}. This attribute must be a boolean (i.e.@: have
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index f8404814c96..f030b56ef6d 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1078,6 +1078,15 @@ arrays to be word-aligned so that @code{strcpy} calls that copy
constants to character arrays can be done inline.
@end defmac
+@defmac DATA_ABI_ALIGNMENT (@var{type}, @var{basic-align})
+Similar to @code{DATA_ALIGNMENT}, but for the cases where the ABI mandates
+some alignment increase, instead of optimization only purposes. E.g.@
+AMD x86-64 psABI says that variables with array type larger than 15 bytes
+must be aligned to 16 byte boundaries.
+
+If this macro is not defined, then @var{basic-align} is used.
+@end defmac
+
@defmac CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
If defined, a C expression to compute the alignment given to a constant
that is being placed in memory. @var{constant} is the constant and
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index b08dece763a..cc25fec495e 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -1062,6 +1062,15 @@ arrays to be word-aligned so that @code{strcpy} calls that copy
constants to character arrays can be done inline.
@end defmac
+@defmac DATA_ABI_ALIGNMENT (@var{type}, @var{basic-align})
+Similar to @code{DATA_ALIGNMENT}, but for the cases where the ABI mandates
+some alignment increase, instead of optimization only purposes. E.g.@
+AMD x86-64 psABI says that variables with array type larger than 15 bytes
+must be aligned to 16 byte boundaries.
+
+If this macro is not defined, then @var{basic-align} is used.
+@end defmac
+
@defmac CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
If defined, a C expression to compute the alignment given to a constant
that is being placed in memory. @var{constant} is the constant and
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 7442a27540a..55ad80451d6 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -866,7 +866,7 @@ opt_info_switch_p (const char *arg)
file_seen = xstrdup (filename);
if (!flags)
- flags = MSG_ALL;
+ flags = MSG_OPTIMIZED_LOCATIONS;
if (!optgroup_flags)
optgroup_flags = OPTGROUP_ALL;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b615b181a3b..f42ad66353b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7388,7 +7388,22 @@ struct external_ref_hasher : typed_free_remove <external_ref>
inline hashval_t
external_ref_hasher::hash (const value_type *r)
{
- return htab_hash_pointer (r->type);
+ dw_die_ref die = r->type;
+ hashval_t h = 0;
+
+ /* We can't use the address of the DIE for hashing, because
+ that will make the order of the stub DIEs non-deterministic. */
+ if (! die->comdat_type_p)
+ /* We have a symbol; use it to compute a hash. */
+ h = htab_hash_string (die->die_id.die_symbol);
+ else
+ {
+ /* We have a type signature; use a subset of the bits as the hash.
+ The 8-byte signature is at least as large as hashval_t. */
+ comdat_type_node_ref type_node = die->die_id.die_type_node;
+ memcpy (&h, type_node->signature, sizeof (h));
+ }
+ return h;
}
inline bool
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index fc56776f9fa..8a7b8a563d5 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3574,6 +3574,7 @@ try_split (rtx pat, rtx trial, int last)
break;
case REG_NON_LOCAL_GOTO:
+ case REG_CROSSING_JUMP:
for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn))
{
if (JUMP_P (insn))
diff --git a/gcc/expmed.c b/gcc/expmed.c
index daadd3def5d..79f3424961d 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -1486,6 +1486,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
This is because the most significant word is the one which may
be less than full. */
+ unsigned int backwards = WORDS_BIG_ENDIAN;
unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD;
unsigned int i;
rtx last;
@@ -1503,13 +1504,14 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if I is 1, use the next to lowest word; and so on. */
/* Word number in TARGET to use. */
unsigned int wordnum
- = (WORDS_BIG_ENDIAN
+ = (backwards
? GET_MODE_SIZE (GET_MODE (target)) / UNITS_PER_WORD - i - 1
: i);
/* Offset from start of field in OP0. */
- unsigned int bit_offset = (WORDS_BIG_ENDIAN
- ? MAX (0, ((int) bitsize - ((int) i + 1)
- * (int) BITS_PER_WORD))
+ unsigned int bit_offset = (backwards
+ ? MAX ((int) bitsize - ((int) i + 1)
+ * BITS_PER_WORD,
+ 0)
: (int) i * BITS_PER_WORD);
rtx target_part = operand_subword (target, wordnum, 1, VOIDmode);
rtx result_part
@@ -1541,7 +1543,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
for (i = nwords; i < total_words; i++)
emit_move_insn
(operand_subword (target,
- WORDS_BIG_ENDIAN ? total_words - i - 1 : i,
+ backwards ? total_words - i - 1 : i,
1, VOIDmode),
const0_rtx);
}
diff --git a/gcc/expr.c b/gcc/expr.c
index 0149740a10f..c68f489e8de 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9602,7 +9602,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
create_output_operand (&ops[0], NULL_RTX, mode);
create_fixed_operand (&ops[1], temp);
expand_insn (icode, 2, ops);
- return ops[0].value;
+ temp = ops[0].value;
}
return temp;
}
@@ -9621,34 +9621,25 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (mem_ref_refers_to_non_mem_p (exp))
{
HOST_WIDE_INT offset = mem_ref_offset (exp).low;
- tree bit_offset;
- tree bftype;
base = TREE_OPERAND (base, 0);
if (offset == 0
- && host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
+ && host_integerp (TYPE_SIZE (type), 1)
&& (GET_MODE_BITSIZE (DECL_MODE (base))
- == TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp)))))
- return expand_expr (build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (exp), base),
+ == TREE_INT_CST_LOW (TYPE_SIZE (type))))
+ return expand_expr (build1 (VIEW_CONVERT_EXPR, type, base),
target, tmode, modifier);
- bit_offset = bitsize_int (offset * BITS_PER_UNIT);
- bftype = TREE_TYPE (base);
- if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
- bftype = TREE_TYPE (exp);
- else
+ if (TYPE_MODE (type) == BLKmode)
{
temp = assign_stack_temp (DECL_MODE (base),
GET_MODE_SIZE (DECL_MODE (base)));
store_expr (base, temp, 0, false);
temp = adjust_address (temp, BLKmode, offset);
- set_mem_size (temp, int_size_in_bytes (TREE_TYPE (exp)));
+ set_mem_size (temp, int_size_in_bytes (type));
return temp;
}
- return expand_expr (build3 (BIT_FIELD_REF, bftype,
- base,
- TYPE_SIZE (TREE_TYPE (exp)),
- bit_offset),
- target, tmode, modifier);
+ exp = build3 (BIT_FIELD_REF, type, base, TYPE_SIZE (type),
+ bitsize_int (offset * BITS_PER_UNIT));
+ return expand_expr (exp, target, tmode, modifier);
}
address_mode = targetm.addr_space.address_mode (as);
base = TREE_OPERAND (exp, 0);
@@ -9690,7 +9681,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
create_output_operand (&ops[0], NULL_RTX, mode);
create_fixed_operand (&ops[1], temp);
expand_insn (icode, 2, ops);
- return ops[0].value;
+ temp = ops[0].value;
}
else if (SLOW_UNALIGNED_ACCESS (mode, align))
temp = extract_bit_field (temp, GET_MODE_BITSIZE (mode),
@@ -9918,11 +9909,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
&& modifier != EXPAND_STACK_PARM
? target : NULL_RTX),
VOIDmode,
- (modifier == EXPAND_INITIALIZER
- || modifier == EXPAND_CONST_ADDRESS
- || modifier == EXPAND_STACK_PARM)
- ? modifier : EXPAND_NORMAL);
-
+ modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
/* If the bitfield is volatile, we want to access it in the
field's mode, not the computed mode.
@@ -10081,6 +10068,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| (MEM_P (op0)
&& (MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1)
|| (bitpos % GET_MODE_ALIGNMENT (mode1) != 0))))
+ && modifier != EXPAND_MEMORY
&& ((modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_INITIALIZER)
? STRICT_ALIGNMENT
@@ -10202,7 +10190,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_INITIALIZER)
return op0;
- else if (target == 0)
+
+ if (target == 0)
target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
convert_move (target, op0, unsignedp);
@@ -10249,7 +10238,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* If we are converting to BLKmode, try to avoid an intermediate
temporary by fetching an inner memory reference. */
if (mode == BLKmode
- && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
+ && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& TYPE_MODE (TREE_TYPE (treeop0)) != BLKmode
&& handled_component_p (treeop0))
{
@@ -10268,7 +10257,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (!offset
&& (bitpos % BITS_PER_UNIT) == 0
&& bitsize >= 0
- && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) == 0)
+ && compare_tree_int (TYPE_SIZE (type), bitsize) == 0)
{
/* See the normal_inner_ref case for the rationale. */
orig_op0
@@ -10279,10 +10268,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
&& modifier != EXPAND_STACK_PARM
? target : NULL_RTX),
VOIDmode,
- (modifier == EXPAND_INITIALIZER
- || modifier == EXPAND_CONST_ADDRESS
- || modifier == EXPAND_STACK_PARM)
- ? modifier : EXPAND_NORMAL);
+ modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
if (MEM_P (orig_op0))
{
@@ -10309,8 +10295,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
if (!op0)
- op0 = expand_expr (treeop0,
- NULL_RTX, VOIDmode, modifier);
+ op0 = expand_expr (treeop0, NULL_RTX, VOIDmode, modifier);
/* If the input and output modes are both the same, we are done. */
if (mode == GET_MODE (op0))
diff --git a/gcc/final.c b/gcc/final.c
index c836e5dc842..d9b4408aadf 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1471,7 +1471,7 @@ typedef struct debug_prefix_map
} debug_prefix_map;
/* Linked list of such structures. */
-debug_prefix_map *debug_prefix_maps;
+static debug_prefix_map *debug_prefix_maps;
/* Record a debug file prefix mapping. ARG is the argument to
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index a2b7ac18312..a8e5f43faf4 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -421,6 +421,20 @@ negate_expr_p (tree t)
return negate_expr_p (TREE_REALPART (t))
&& negate_expr_p (TREE_IMAGPART (t));
+ case VECTOR_CST:
+ {
+ if (FLOAT_TYPE_P (TREE_TYPE (type)) || TYPE_OVERFLOW_WRAPS (type))
+ return true;
+
+ int count = TYPE_VECTOR_SUBPARTS (type), i;
+
+ for (i = 0; i < count; i++)
+ if (!negate_expr_p (VECTOR_CST_ELT (t, i)))
+ return false;
+
+ return true;
+ }
+
case COMPLEX_EXPR:
return negate_expr_p (TREE_OPERAND (t, 0))
&& negate_expr_p (TREE_OPERAND (t, 1));
@@ -560,6 +574,21 @@ fold_negate_expr (location_t loc, tree t)
}
break;
+ case VECTOR_CST:
+ {
+ int count = TYPE_VECTOR_SUBPARTS (type), i;
+ tree *elts = XALLOCAVEC (tree, count);
+
+ for (i = 0; i < count; i++)
+ {
+ elts[i] = fold_negate_expr (loc, VECTOR_CST_ELT (t, i));
+ if (elts[i] == NULL_TREE)
+ return NULL_TREE;
+ }
+
+ return build_vector (type, elts);
+ }
+
case COMPLEX_EXPR:
if (negate_expr_p (t))
return fold_build2_loc (loc, COMPLEX_EXPR, type,
@@ -2473,9 +2502,13 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
}
if (TREE_CODE (arg0) != TREE_CODE (arg1)
- /* This is needed for conversions and for COMPONENT_REF.
- Might as well play it safe and always test this. */
- || TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK
+ /* NOP_EXPR and CONVERT_EXPR are considered equal. */
+ && !(CONVERT_EXPR_P (arg0) && CONVERT_EXPR_P (arg1)))
+ return 0;
+
+ /* This is needed for conversions and for COMPONENT_REF.
+ Might as well play it safe and always test this. */
+ if (TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK
|| TREE_CODE (TREE_TYPE (arg1)) == ERROR_MARK
|| TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1)))
return 0;
@@ -3755,6 +3788,10 @@ simple_operand_p (const_tree exp)
#pragma weak, etc). */
&& ! TREE_PUBLIC (exp)
&& ! DECL_EXTERNAL (exp)
+ /* Weakrefs are not safe to be read, since they can be NULL.
+ They are !TREE_PUBLIC && !DECL_EXTERNAL but still
+ have DECL_WEAK flag set. */
+ && (! VAR_OR_FUNCTION_DECL_P (exp) || ! DECL_WEAK (exp))
/* Loading a static variable is unduly expensive, but global
registers aren't expensive. */
&& (! TREE_STATIC (exp) || DECL_REGISTER (exp))));
@@ -6160,9 +6197,12 @@ fold_real_zero_addition_p (const_tree type, const_tree addend, int negate)
if (!HONOR_SIGNED_ZEROS (TYPE_MODE (type)))
return true;
+ /* In a vector or complex, we would need to check the sign of all zeros. */
+ if (TREE_CODE (addend) != REAL_CST)
+ return false;
+
/* Treat x + -0 as x - 0 and x - -0 as x + 0. */
- if (TREE_CODE (addend) == REAL_CST
- && REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (addend)))
+ if (REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (addend)))
negate = !negate;
/* The mode has signed zeros, and we have to honor their sign.
@@ -10153,7 +10193,7 @@ fold_binary_loc (location_t loc,
fold_convert_loc (loc, type,
TREE_OPERAND (arg0, 0)));
- if (INTEGRAL_TYPE_P (type))
+ if (INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
{
/* Convert ~A + 1 to -A. */
if (TREE_CODE (arg0) == BIT_NOT_EXPR
@@ -10171,7 +10211,7 @@ fold_binary_loc (location_t loc,
STRIP_NOPS (tem);
if (operand_equal_p (tem, arg1, 0))
{
- t1 = build_minus_one_cst (type);
+ t1 = build_all_ones_cst (type);
return omit_one_operand_loc (loc, type, t1, arg1);
}
}
@@ -10185,7 +10225,7 @@ fold_binary_loc (location_t loc,
STRIP_NOPS (tem);
if (operand_equal_p (arg0, tem, 0))
{
- t1 = build_minus_one_cst (type);
+ t1 = build_all_ones_cst (type);
return omit_one_operand_loc (loc, type, t1, arg0);
}
}
@@ -10666,8 +10706,6 @@ fold_binary_loc (location_t loc,
TREE_OPERAND (arg1, 0)));
/* (-A) - B -> (-B) - A where B is easily negated and we can swap. */
if (TREE_CODE (arg0) == NEGATE_EXPR
- && (FLOAT_TYPE_P (type)
- || INTEGRAL_TYPE_P (type))
&& negate_expr_p (arg1)
&& reorder_operands_p (arg0, arg1))
return fold_build2_loc (loc, MINUS_EXPR, type,
@@ -10676,7 +10714,7 @@ fold_binary_loc (location_t loc,
fold_convert_loc (loc, type,
TREE_OPERAND (arg0, 0)));
/* Convert -A - 1 to ~A. */
- if (INTEGRAL_TYPE_P (type)
+ if (TREE_CODE (type) != COMPLEX_TYPE
&& TREE_CODE (arg0) == NEGATE_EXPR
&& integer_onep (arg1)
&& !TYPE_OVERFLOW_TRAPS (type))
@@ -10685,13 +10723,13 @@ fold_binary_loc (location_t loc,
TREE_OPERAND (arg0, 0)));
/* Convert -1 - A to ~A. */
- if (INTEGRAL_TYPE_P (type)
+ if (TREE_CODE (type) != COMPLEX_TYPE
&& integer_all_onesp (arg0))
return fold_build1_loc (loc, BIT_NOT_EXPR, type, op1);
- /* X - (X / CST) * CST is X % CST. */
- if (INTEGRAL_TYPE_P (type)
+ /* X - (X / Y) * Y is X % Y. */
+ if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
&& TREE_CODE (arg1) == MULT_EXPR
&& TREE_CODE (TREE_OPERAND (arg1, 0)) == TRUNC_DIV_EXPR
&& operand_equal_p (arg0,
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index af467b6b2a4..b003bacd706 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,128 @@
+2013-06-15 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/49074
+ PR fortran/56136
+ * dependency.c (gfc_check_argument_var_dependency): Return 0 in the
+ array constructor case.
+
+2013-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57508
+ * resolve.c (get_temp_from_expr): Don't copy function
+ result attributes to temporary.
+
+2013-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57596
+ * trans-decl.c (gfc_trans_deferred_vars): Honor OPTIONAL
+ for nullify and deferred-strings' length variable.
+
+2013-06-13 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/49074
+ * trans-expr.c (gfc_conv_variable): Don't walk the reference chain.
+ Handle NULL array references.
+ (gfc_conv_procedure_call): Remove code handling NULL array references.
+
+2013-06-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57535
+ * trans-array.c (build_class_array_ref): Fix ICE for
+ function result variables.
+
+2013-06-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37336
+ * trans-decl.c (init_intent_out_dt): Call finalizer
+ when approriate.
+
+2013-06-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57553
+ * simplify.c (gfc_simplify_storage_size): Handle literal
+ strings.
+ * trans-intrinsic.c (gfc_conv_intrinsic_storage_size):
+ Add missing fold_convert.
+
+2013-06-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57549
+ * array.c (gfc_match_array_constructor): Call
+ gfc_match_type_spec instead of gfc_match_decl_type_spec.
+ * match.c (gfc_match_type_spec): Renamed from match_type_spec.
+ (gfc_match_type_is, gfc_match_allocate): Update call.
+ * match.h (gfc_match_type_spec): Add prototype.
+
+2013-06-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57556
+ * trans.c (gfc_build_final_call): Init block before use.
+
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57542
+ * trans.c (gfc_build_final_call): Add se.pre to the block
+ and modify the assert.
+
+2013-06-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37336
+ * trans.h (gfc_build_final_call): Remove prototype.
+ (gfc_add_finalizer_call): Add prototype.
+ * trans-array.c (gfc_trans_dealloc_allocated): Support finalization.
+ (structure_alloc_comps): Update caller.
+ (gfc_trans_deferred_array): Call finalizer.
+ * trans-array.h (gfc_trans_dealloc_allocated): Update prototype.
+ * trans-decl.c (gfc_trans_deferred_vars): Don't deallocate/finalize
+ variables of the main program.
+ * trans-expr.c (gfc_conv_procedure_call): Support finalization.
+ * trans-openmp.c (gfc_omp_clause_dtor,
+ gfc_trans_omp_array_reduction): Update calls.
+ * trans-stmt.c (gfc_trans_deallocate): Avoid double deallocation
+ of alloc components.
+ * trans.c (gfc_add_finalizer_call): New function.
+ (gfc_deallocate_with_status,
+ gfc_deallocate_scalar_with_status): Call it
+ (gfc_build_final_call): Fix handling of scalar coarrays,
+ move up in the file and make static.
+
+2013-06-01 Janus Weil <janus@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ * error.c (get_terminal_width): Only limit the width if we're
+ outputting to a terminal. Try to determine width via ioctl.
+
+2013-06-01 Tobias Burnus <burnus@net-b.de>
+
+ * decl.c (add_global_entry): Take locus.
+ (gfc_match_entry): Update call.
+ (gfc_match_end): Better error location.
+ * parse.c (parse_block_data, parse_module, add_global_procedure,
+ add_global_program): Use better locus data.
+
+2013-05-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57456
+ * trans-array.c (gfc_array_init_size): Use passed type spec,
+ when available.
+ (gfc_array_allocate): Pass typespec on.
+ * trans-array.h (gfc_array_allocate): Update prototype.
+ * trans-stmt.c (gfc_trans_allocate): Pass typespec on.
+
+2013-05-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/54190
+ PR fortran/57217
+ * gfortran.h (gfc_terminal_width): Remove prototype.
+ * error.c (get_terminal_width): Moved here from misc.c. Renamed.
+ Try to determine terminal width from environment variable.
+ * interface.c (compare_type, compare_rank): New functions. Fix assumed
+ type/rank handling.
+ (compare_type_rank, check_dummy_characteristics,
+ check_result_characteristics, gfc_compare_interfaces): Use them.
+ (symbol_rank): Slightly modified and moved.
+ * misc.c (gfc_terminal_width): Moved to error.c.
+
2013-05-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/54189
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index c2ac1ece1e6..c6b8eb9f96a 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1073,7 +1073,7 @@ gfc_match_array_constructor (gfc_expr **result)
/* Try to match an optional "type-spec ::" */
gfc_clear_ts (&ts);
gfc_new_undo_checkpoint (changed_syms);
- if (gfc_match_decl_type_spec (&ts, 0) == MATCH_YES)
+ if (gfc_match_type_spec (&ts) == MATCH_YES)
{
seen_ts = (gfc_match (" ::") == MATCH_YES);
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 6ab9cc78438..f1aa31e07be 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -5354,7 +5354,8 @@ cleanup:
to return false upon finding an existing global entry. */
static bool
-add_global_entry (const char *name, const char *binding_label, bool sub)
+add_global_entry (const char *name, const char *binding_label, bool sub,
+ locus *where)
{
gfc_gsymbol *s;
enum gfc_symbol_type type;
@@ -5369,14 +5370,14 @@ add_global_entry (const char *name, const char *binding_label, bool sub)
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != type))
{
- gfc_global_used(s, NULL);
+ gfc_global_used (s, where);
return false;
}
else
{
s->type = type;
s->sym_name = name;
- s->where = gfc_current_locus;
+ s->where = *where;
s->defined = 1;
s->ns = gfc_current_ns;
}
@@ -5391,7 +5392,7 @@ add_global_entry (const char *name, const char *binding_label, bool sub)
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != type))
{
- gfc_global_used(s, NULL);
+ gfc_global_used (s, where);
return false;
}
else
@@ -5399,7 +5400,7 @@ add_global_entry (const char *name, const char *binding_label, bool sub)
s->type = type;
s->sym_name = name;
s->binding_label = binding_label;
- s->where = gfc_current_locus;
+ s->where = *where;
s->defined = 1;
s->ns = gfc_current_ns;
}
@@ -5528,6 +5529,7 @@ gfc_match_entry (void)
/* Check what next non-whitespace character is so we can tell if there
is the required parens if we have a BIND(C). */
+ old_loc = gfc_current_locus;
gfc_gobble_whitespace ();
peek_char = gfc_peek_ascii_char ();
@@ -5555,7 +5557,8 @@ gfc_match_entry (void)
}
if (!gfc_current_ns->parent
- && !add_global_entry (name, entry->binding_label, true))
+ && !add_global_entry (name, entry->binding_label, true,
+ &old_loc))
return MATCH_ERROR;
/* An entry in a subroutine. */
@@ -5574,7 +5577,6 @@ gfc_match_entry (void)
ENTRY f() RESULT (r)
can't be written as
ENTRY f RESULT (r). */
- old_loc = gfc_current_locus;
if (gfc_match_eos () == MATCH_YES)
{
gfc_current_locus = old_loc;
@@ -5624,7 +5626,8 @@ gfc_match_entry (void)
}
if (!gfc_current_ns->parent
- && !add_global_entry (name, entry->binding_label, false))
+ && !add_global_entry (name, entry->binding_label, false,
+ &old_loc))
return MATCH_ERROR;
}
@@ -6108,6 +6111,7 @@ gfc_match_end (gfc_statement *st)
goto cleanup;
}
+ old_loc = gfc_current_locus;
if (gfc_match_eos () == MATCH_YES)
{
if (!eos_ok && (*st == ST_END_SUBROUTINE || *st == ST_END_FUNCTION))
@@ -6131,10 +6135,12 @@ gfc_match_end (gfc_statement *st)
/* Verify that we've got the sort of end-block that we're expecting. */
if (gfc_match (target) != MATCH_YES)
{
- gfc_error ("Expecting %s statement at %C", gfc_ascii_statement (*st));
+ gfc_error ("Expecting %s statement at %L", gfc_ascii_statement (*st),
+ &old_loc);
goto cleanup;
}
+ old_loc = gfc_current_locus;
/* If we're at the end, make sure a block name wasn't required. */
if (gfc_match_eos () == MATCH_YES)
{
@@ -6147,8 +6153,8 @@ gfc_match_end (gfc_statement *st)
if (!block_name)
return MATCH_YES;
- gfc_error ("Expected block name of '%s' in %s statement at %C",
- block_name, gfc_ascii_statement (*st));
+ gfc_error ("Expected block name of '%s' in %s statement at %L",
+ block_name, gfc_ascii_statement (*st), &old_loc);
return MATCH_ERROR;
}
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index 38921b1993f..fcdc1e50177 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -990,7 +990,9 @@ gfc_check_argument_var_dependency (gfc_expr *var, sym_intent intent,
return 0;
case EXPR_ARRAY:
- return gfc_check_dependency (var, expr, 1);
+ /* the scalarizer always generates a temporary for array constructors,
+ so there is no dependency. */
+ return 0;
case EXPR_FUNCTION:
if (intent != INTENT_IN)
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 60b209354c5..35fe62706c6 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -30,6 +30,15 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "gfortran.h"
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif
+
+#ifdef GWINSZ_IN_SYS_IOCTL
+# include <sys/ioctl.h>
+#endif
+
+
static int suppress_errors = 0;
static int warnings_not_errors = 0;
@@ -59,12 +68,45 @@ gfc_pop_suppress_errors (void)
}
+/* Determine terminal width (for trimming source lines in output). */
+
+static int
+get_terminal_width (void)
+{
+ /* Only limit the width if we're outputting to a terminal. */
+#ifdef HAVE_UNISTD_H
+ if (!isatty (STDERR_FILENO))
+ return INT_MAX;
+#endif
+
+ /* Method #1: Use ioctl (not available on all systems). */
+#ifdef TIOCGWINSZ
+ struct winsize w;
+ w.ws_col = 0;
+ if (ioctl (0, TIOCGWINSZ, &w) == 0 && w.ws_col > 0)
+ return w.ws_col;
+#endif
+
+ /* Method #2: Query environment variable $COLUMNS. */
+ const char *p = getenv ("COLUMNS");
+ if (p)
+ {
+ int value = atoi (p);
+ if (value > 0)
+ return value;
+ }
+
+ /* If both fail, use reasonable default. */
+ return 80;
+}
+
+
/* Per-file error initialization. */
void
gfc_error_init_1 (void)
{
- terminal_width = gfc_terminal_width ();
+ terminal_width = get_terminal_width ();
errors = 0;
warnings = 0;
buffer_flag = 0;
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 27662f7ca40..14da0aff36f 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2436,7 +2436,6 @@ void gfc_start_source_files (void);
void gfc_end_source_files (void);
/* misc.c */
-int gfc_terminal_width (void);
void gfc_clear_ts (gfc_typespec *);
FILE *gfc_open_file (const char *);
const char *gfc_basic_typename (bt);
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index adc4e63845f..f06ecfe3ec4 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -508,18 +508,23 @@ gfc_compare_types (gfc_typespec *ts1, gfc_typespec *ts2)
}
-/* Given two symbols that are formal arguments, compare their ranks
- and types. Returns nonzero if they have the same rank and type,
- zero otherwise. */
+static int
+compare_type (gfc_symbol *s1, gfc_symbol *s2)
+{
+ if (s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
+ return 1;
+
+ return gfc_compare_types (&s1->ts, &s2->ts) || s2->ts.type == BT_ASSUMED;
+}
+
static int
-compare_type_rank (gfc_symbol *s1, gfc_symbol *s2)
+compare_rank (gfc_symbol *s1, gfc_symbol *s2)
{
gfc_array_spec *as1, *as2;
int r1, r2;
- if (s1->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK)
- || s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
+ if (s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
return 1;
as1 = (s1->ts.type == BT_CLASS) ? CLASS_DATA (s1)->as : s1->as;
@@ -528,13 +533,21 @@ compare_type_rank (gfc_symbol *s1, gfc_symbol *s2)
r1 = as1 ? as1->rank : 0;
r2 = as2 ? as2->rank : 0;
- if (r1 != r2
- && (!as1 || as1->type != AS_ASSUMED_RANK)
- && (!as2 || as2->type != AS_ASSUMED_RANK))
+ if (r1 != r2 && (!as2 || as2->type != AS_ASSUMED_RANK))
return 0; /* Ranks differ. */
- return gfc_compare_types (&s1->ts, &s2->ts)
- || s1->ts.type == BT_ASSUMED || s2->ts.type == BT_ASSUMED;
+ return 1;
+}
+
+
+/* Given two symbols that are formal arguments, compare their ranks
+ and types. Returns nonzero if they have the same rank and type,
+ zero otherwise. */
+
+static int
+compare_type_rank (gfc_symbol *s1, gfc_symbol *s2)
+{
+ return compare_type (s1, s2) && compare_rank (s1, s2);
}
@@ -1019,6 +1032,15 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2,
}
+static int
+symbol_rank (gfc_symbol *sym)
+{
+ gfc_array_spec *as;
+ as = (sym->ts.type == BT_CLASS) ? CLASS_DATA (sym)->as : sym->as;
+ return as ? as->rank : 0;
+}
+
+
/* Check if the characteristics of two dummy arguments match,
cf. F08:12.3.2. */
@@ -1030,12 +1052,20 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
return s1 == s2 ? true : false;
/* Check type and rank. */
- if (type_must_agree &&
- (!compare_type_rank (s1, s2) || !compare_type_rank (s2, s1)))
+ if (type_must_agree)
{
- snprintf (errmsg, err_len, "Type/rank mismatch in argument '%s'",
- s1->name);
- return false;
+ if (!compare_type (s1, s2) || !compare_type (s2, s1))
+ {
+ snprintf (errmsg, err_len, "Type mismatch in argument '%s' (%s/%s)",
+ s1->name, gfc_typename (&s1->ts), gfc_typename (&s2->ts));
+ return false;
+ }
+ if (!compare_rank (s1, s2))
+ {
+ snprintf (errmsg, err_len, "Rank mismatch in argument '%s' (%i/%i)",
+ s1->name, symbol_rank (s1), symbol_rank (s2));
+ return false;
+ }
}
/* Check INTENT. */
@@ -1203,9 +1233,16 @@ check_result_characteristics (gfc_symbol *s1, gfc_symbol *s2,
return true;
/* Check type and rank. */
- if (!compare_type_rank (r1, r2))
+ if (!compare_type (r1, r2))
+ {
+ snprintf (errmsg, err_len, "Type mismatch in function result (%s/%s)",
+ gfc_typename (&r1->ts), gfc_typename (&r2->ts));
+ return false;
+ }
+ if (!compare_rank (r1, r2))
{
- snprintf (errmsg, err_len, "Type/rank mismatch in function result");
+ snprintf (errmsg, err_len, "Rank mismatch in function result (%i/%i)",
+ symbol_rank (r1), symbol_rank (r2));
return false;
}
@@ -1437,13 +1474,26 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
errmsg, err_len))
return 0;
}
- else if (!compare_type_rank (f2->sym, f1->sym))
+ else
{
/* Only check type and rank. */
- if (errmsg != NULL)
- snprintf (errmsg, err_len, "Type/rank mismatch in argument '%s'",
- f1->sym->name);
- return 0;
+ if (!compare_type (f2->sym, f1->sym))
+ {
+ if (errmsg != NULL)
+ snprintf (errmsg, err_len, "Type mismatch in argument '%s' "
+ "(%s/%s)", f1->sym->name,
+ gfc_typename (&f1->sym->ts),
+ gfc_typename (&f2->sym->ts));
+ return 0;
+ }
+ if (!compare_rank (f2->sym, f1->sym))
+ {
+ if (errmsg != NULL)
+ snprintf (errmsg, err_len, "Rank mismatch in argument '%s' "
+ "(%i/%i)", f1->sym->name, symbol_rank (f1->sym),
+ symbol_rank (f2->sym));
+ return 0;
+ }
}
next:
f1 = f1->next;
@@ -1746,16 +1796,6 @@ done:
}
-static int
-symbol_rank (gfc_symbol *sym)
-{
- if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->as)
- return CLASS_DATA (sym)->as->rank;
-
- return (sym->as == NULL) ? 0 : sym->as->rank;
-}
-
-
/* Given a symbol of a formal argument list and an expression, if the
formal argument is allocatable, check that the actual argument is
allocatable. Returns nonzero if compatible, zero if not compatible. */
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index b44d8157717..2533584246b 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1937,8 +1937,8 @@ match_derived_type_spec (gfc_typespec *ts)
the implicit_flag is not needed, so it was removed. Derived types are
identified by their name alone. */
-static match
-match_type_spec (gfc_typespec *ts)
+match
+gfc_match_type_spec (gfc_typespec *ts)
{
match m;
locus old_locus;
@@ -3426,7 +3426,7 @@ gfc_match_allocate (void)
/* Match an optional type-spec. */
old_locus = gfc_current_locus;
- m = match_type_spec (&ts);
+ m = gfc_match_type_spec (&ts);
if (m == MATCH_ERROR)
goto cleanup;
else if (m == MATCH_NO)
@@ -5502,7 +5502,7 @@ gfc_match_type_is (void)
c = gfc_get_case ();
c->where = gfc_current_locus;
- if (match_type_spec (&c->ts) == MATCH_ERROR)
+ if (gfc_match_type_spec (&c->ts) == MATCH_ERROR)
goto cleanup;
if (gfc_match_char (')') != MATCH_YES)
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index ac8b9f84696..1a701f04f39 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -59,6 +59,8 @@ match gfc_match_char (char);
match gfc_match (const char *, ...);
match gfc_match_iterator (gfc_iterator *, int);
match gfc_match_parens (void);
+match gfc_match_type_spec (gfc_typespec *);
+
/* Statement matchers. */
match gfc_match_program (void);
diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index cce599b3cbc..9b8f31f68fc 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -24,15 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "gfortran.h"
-/* Get terminal width. */
-
-int
-gfc_terminal_width (void)
-{
- return 80;
-}
-
-
/* Initialize a typespec to unknown. */
void
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index a223a2cb704..f98a21399e3 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -4270,11 +4270,11 @@ parse_block_data (void)
s = gfc_get_gsymbol (gfc_new_block->name);
if (s->defined
|| (s->type != GSYM_UNKNOWN && s->type != GSYM_BLOCK_DATA))
- gfc_global_used(s, NULL);
+ gfc_global_used (s, &gfc_new_block->declared_at);
else
{
s->type = GSYM_BLOCK_DATA;
- s->where = gfc_current_locus;
+ s->where = gfc_new_block->declared_at;
s->defined = 1;
}
}
@@ -4302,11 +4302,11 @@ parse_module (void)
s = gfc_get_gsymbol (gfc_new_block->name);
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != GSYM_MODULE))
- gfc_global_used(s, NULL);
+ gfc_global_used (s, &gfc_new_block->declared_at);
else
{
s->type = GSYM_MODULE;
- s->where = gfc_current_locus;
+ s->where = gfc_new_block->declared_at;
s->defined = 1;
}
@@ -4360,7 +4360,7 @@ add_global_procedure (bool sub)
|| (s->type != GSYM_UNKNOWN
&& s->type != (sub ? GSYM_SUBROUTINE : GSYM_FUNCTION)))
{
- gfc_global_used (s, NULL);
+ gfc_global_used (s, &gfc_new_block->declared_at);
/* Silence follow-up errors. */
gfc_new_block->binding_label = NULL;
}
@@ -4368,7 +4368,7 @@ add_global_procedure (bool sub)
{
s->type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
s->sym_name = gfc_new_block->name;
- s->where = gfc_current_locus;
+ s->where = gfc_new_block->declared_at;
s->defined = 1;
s->ns = gfc_current_ns;
}
@@ -4385,7 +4385,7 @@ add_global_procedure (bool sub)
|| (s->type != GSYM_UNKNOWN
&& s->type != (sub ? GSYM_SUBROUTINE : GSYM_FUNCTION)))
{
- gfc_global_used (s, NULL);
+ gfc_global_used (s, &gfc_new_block->declared_at);
/* Silence follow-up errors. */
gfc_new_block->binding_label = NULL;
}
@@ -4394,7 +4394,7 @@ add_global_procedure (bool sub)
s->type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
s->sym_name = gfc_new_block->name;
s->binding_label = gfc_new_block->binding_label;
- s->where = gfc_current_locus;
+ s->where = gfc_new_block->declared_at;
s->defined = 1;
s->ns = gfc_current_ns;
}
@@ -4414,11 +4414,11 @@ add_global_program (void)
s = gfc_get_gsymbol (gfc_new_block->name);
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != GSYM_PROGRAM))
- gfc_global_used(s, NULL);
+ gfc_global_used (s, &gfc_new_block->declared_at);
else
{
s->type = GSYM_PROGRAM;
- s->where = gfc_current_locus;
+ s->where = gfc_new_block->declared_at;
s->defined = 1;
s->ns = gfc_current_ns;
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b2e8fdc1bb9..2788994112a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9295,6 +9295,10 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace *ns)
/* Add the attributes and the arrayspec to the temporary. */
tmp->n.sym->attr = gfc_expr_attr (e);
+ tmp->n.sym->attr.function = 0;
+ tmp->n.sym->attr.result = 0;
+ tmp->n.sym->attr.flavor = FL_VARIABLE;
+
if (as)
{
tmp->n.sym->as = gfc_copy_array_spec (as);
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 815043b2e11..683d58b6ee8 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -5717,7 +5717,7 @@ gfc_simplify_storage_size (gfc_expr *x,
if (x->ts.type == BT_CLASS || x->ts.deferred)
return NULL;
- if (x->ts.type == BT_CHARACTER
+ if (x->ts.type == BT_CHARACTER && x->expr_type != EXPR_CONSTANT
&& (!x->ts.u.cl || !x->ts.u.cl->length
|| x->ts.u.cl->length->expr_type != EXPR_CONSTANT))
return NULL;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index be3a5a0ef51..a4321cc3e26 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2991,7 +2991,13 @@ build_class_array_ref (gfc_se *se, tree base, tree index)
if (ts == NULL)
return false;
- if (class_ref == NULL)
+ if (class_ref == NULL && expr->symtree->n.sym->attr.function
+ && expr->symtree->n.sym == expr->symtree->n.sym->result)
+ {
+ gcc_assert (expr->symtree->n.sym->backend_decl == current_function_decl);
+ decl = gfc_get_fake_result_decl (expr->symtree->n.sym, 0);
+ }
+ else if (class_ref == NULL)
decl = expr->symtree->n.sym->backend_decl;
else
{
@@ -4834,7 +4840,8 @@ static tree
gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
gfc_expr ** lower, gfc_expr ** upper, stmtblock_t * pblock,
stmtblock_t * descriptor_block, tree * overflow,
- tree expr3_elem_size, tree *nelems, gfc_expr *expr3)
+ tree expr3_elem_size, tree *nelems, gfc_expr *expr3,
+ gfc_typespec *ts)
{
tree type;
tree tmp;
@@ -5012,6 +5019,9 @@ gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
tmp = TYPE_SIZE_UNIT (tmp);
}
}
+ else if (ts->type != BT_UNKNOWN && ts->type != BT_CHARACTER)
+ /* FIXME: Properly handle characters. See PR 57456. */
+ tmp = TYPE_SIZE_UNIT (gfc_typenode_for_spec (ts));
else
tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type));
@@ -5081,7 +5091,7 @@ gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
bool
gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
tree errlen, tree label_finish, tree expr3_elem_size,
- tree *nelems, gfc_expr *expr3)
+ tree *nelems, gfc_expr *expr3, gfc_typespec *ts)
{
tree tmp;
tree pointer;
@@ -5166,7 +5176,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
size = gfc_array_init_size (se->expr, ref->u.ar.as->rank,
ref->u.ar.as->corank, &offset, lower, upper,
&se->pre, &set_descriptor_block, &overflow,
- expr3_elem_size, nelems, expr3);
+ expr3_elem_size, nelems, expr3, ts);
if (dimension)
{
@@ -7243,7 +7253,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, bool g77,
/* Generate code to deallocate an array, if it is allocated. */
tree
-gfc_trans_dealloc_allocated (tree descriptor, bool coarray)
+gfc_trans_dealloc_allocated (tree descriptor, bool coarray, gfc_expr *expr)
{
tree tmp;
tree var;
@@ -7259,7 +7269,7 @@ gfc_trans_dealloc_allocated (tree descriptor, bool coarray)
are already deallocated are ignored. */
tmp = gfc_deallocate_with_status (coarray ? descriptor : var, NULL_TREE,
NULL_TREE, NULL_TREE, NULL_TREE, true,
- NULL, coarray);
+ expr, coarray);
gfc_add_expr_to_block (&block, tmp);
/* Zero the data pointer. */
@@ -7548,7 +7558,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
{
comp = fold_build3_loc (input_location, COMPONENT_REF, ctype,
decl, cdecl, NULL_TREE);
- tmp = gfc_trans_dealloc_allocated (comp, c->attr.codimension);
+ tmp = gfc_trans_dealloc_allocated (comp, c->attr.codimension, NULL);
gfc_add_expr_to_block (&tmpblock, tmp);
}
else if (c->attr.allocatable)
@@ -7580,7 +7590,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (comp)))
tmp = gfc_trans_dealloc_allocated (comp,
- CLASS_DATA (c)->attr.codimension);
+ CLASS_DATA (c)->attr.codimension, NULL);
else
{
tmp = gfc_deallocate_scalar_with_status (comp, NULL_TREE, true, NULL,
@@ -8292,7 +8302,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
stmtblock_t cleanup;
locus loc;
int rank;
- bool sym_has_alloc_comp;
+ bool sym_has_alloc_comp, has_finalizer;
sym_has_alloc_comp = (sym->ts.type == BT_DERIVED
|| sym->ts.type == BT_CLASS)
@@ -8379,8 +8389,12 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
/* Allocatable arrays need to be freed when they go out of scope.
The allocatable components of pointers must not be touched. */
- if (sym_has_alloc_comp && !(sym->attr.function || sym->attr.result)
- && !sym->attr.pointer && !sym->attr.save)
+ has_finalizer = sym->ts.type == BT_CLASS || sym->ts.type == BT_DERIVED
+ ? gfc_is_finalizable (sym->ts.u.derived, NULL) : false;
+ if ((!sym->attr.allocatable || !has_finalizer)
+ && sym_has_alloc_comp && !(sym->attr.function || sym->attr.result)
+ && !sym->attr.pointer && !sym->attr.save
+ && !sym->ns->proc_name->attr.is_main_program)
{
int rank;
rank = sym->as ? sym->as->rank : 0;
@@ -8389,10 +8403,13 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
}
if (sym->attr.allocatable && (sym->attr.dimension || sym->attr.codimension)
- && !sym->attr.save && !sym->attr.result)
+ && !sym->attr.save && !sym->attr.result
+ && !sym->ns->proc_name->attr.is_main_program)
{
tmp = gfc_trans_dealloc_allocated (sym->backend_decl,
- sym->attr.codimension);
+ sym->attr.codimension,
+ has_finalizer
+ ? gfc_lval_expr_from_sym (sym) : NULL);
gfc_add_expr_to_block (&cleanup, tmp);
}
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 6f44d797fad..8d9e46187c5 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -24,7 +24,7 @@ tree gfc_array_deallocate (tree, tree, tree, tree, tree, gfc_expr*);
/* Generate code to initialize and allocate an array. Statements are added to
se, which should contain an expression for the array descriptor. */
bool gfc_array_allocate (gfc_se *, gfc_expr *, tree, tree, tree, tree,
- tree, tree *, gfc_expr *);
+ tree, tree *, gfc_expr *, gfc_typespec *);
/* Allow the bounds of a loop to be set from a callee's array spec. */
void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *,
@@ -42,7 +42,7 @@ void gfc_trans_dummy_array_bias (gfc_symbol *, tree, gfc_wrapped_block *);
/* Generate entry and exit code for g77 calling convention arrays. */
void gfc_trans_g77_array (gfc_symbol *, gfc_wrapped_block *);
/* Generate code to deallocate an array, if it is allocated. */
-tree gfc_trans_dealloc_allocated (tree, bool);
+tree gfc_trans_dealloc_allocated (tree, bool, gfc_expr *);
tree gfc_duplicate_allocatable (tree dest, tree src, tree type, int rank);
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 100ec18be51..f04ebdced0a 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3501,38 +3501,57 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
&& !f->sym->attr.pointer
&& f->sym->ts.type == BT_DERIVED)
{
- if (f->sym->ts.u.derived->attr.alloc_comp && !f->sym->value)
+ tmp = NULL_TREE;
+
+ /* Note: Allocatables are excluded as they are already handled
+ by the caller. */
+ if (!f->sym->attr.allocatable
+ && gfc_is_finalizable (f->sym->ts.u.derived, NULL))
{
- tmp = gfc_deallocate_alloc_comp (f->sym->ts.u.derived,
- f->sym->backend_decl,
- f->sym->as ? f->sym->as->rank : 0);
+ stmtblock_t block;
+ gfc_expr *e;
+
+ gfc_init_block (&block);
+ f->sym->attr.referenced = 1;
+ e = gfc_lval_expr_from_sym (f->sym);
+ gfc_add_finalizer_call (&block, e);
+ gfc_free_expr (e);
+ tmp = gfc_finish_block (&block);
+ }
- if (f->sym->attr.optional
- || f->sym->ns->proc_name->attr.entry_master)
- {
- present = gfc_conv_expr_present (f->sym);
- tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp),
- present, tmp,
- build_empty_stmt (input_location));
- }
+ if (tmp == NULL_TREE && !f->sym->attr.allocatable
+ && f->sym->ts.u.derived->attr.alloc_comp && !f->sym->value)
+ tmp = gfc_deallocate_alloc_comp (f->sym->ts.u.derived,
+ f->sym->backend_decl,
+ f->sym->as ? f->sym->as->rank : 0);
- gfc_add_expr_to_block (&init, tmp);
+ if (tmp != NULL_TREE && (f->sym->attr.optional
+ || f->sym->ns->proc_name->attr.entry_master))
+ {
+ present = gfc_conv_expr_present (f->sym);
+ tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp),
+ present, tmp, build_empty_stmt (input_location));
}
- else if (f->sym->value)
+
+ if (tmp != NULL_TREE)
+ gfc_add_expr_to_block (&init, tmp);
+ else if (f->sym->value && !f->sym->attr.allocatable)
gfc_init_default_dt (f->sym, &init, true);
}
else if (f->sym && f->sym->attr.intent == INTENT_OUT
&& f->sym->ts.type == BT_CLASS
&& !CLASS_DATA (f->sym)->attr.class_pointer
- && CLASS_DATA (f->sym)->ts.u.derived->attr.alloc_comp)
+ && !CLASS_DATA (f->sym)->attr.allocatable)
{
- tmp = gfc_class_data_get (f->sym->backend_decl);
- if (CLASS_DATA (f->sym)->as == NULL)
- tmp = build_fold_indirect_ref_loc (input_location, tmp);
- tmp = gfc_deallocate_alloc_comp (CLASS_DATA (f->sym)->ts.u.derived,
- tmp,
- CLASS_DATA (f->sym)->as ?
- CLASS_DATA (f->sym)->as->rank : 0);
+ stmtblock_t block;
+ gfc_expr *e;
+
+ gfc_init_block (&block);
+ f->sym->attr.referenced = 1;
+ e = gfc_lval_expr_from_sym (f->sym);
+ gfc_add_finalizer_call (&block, e);
+ gfc_free_expr (e);
+ tmp = gfc_finish_block (&block);
if (f->sym->attr.optional || f->sym->ns->proc_name->attr.entry_master)
{
@@ -3836,12 +3855,21 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
if (!sym->attr.dummy || sym->attr.intent == INTENT_OUT)
{
/* Nullify when entering the scope. */
- gfc_add_modify (&init, se.expr,
- fold_convert (TREE_TYPE (se.expr),
- null_pointer_node));
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ TREE_TYPE (se.expr), se.expr,
+ fold_convert (TREE_TYPE (se.expr),
+ null_pointer_node));
+ if (sym->attr.optional)
+ {
+ tree present = gfc_conv_expr_present (sym);
+ tmp = build3_loc (input_location, COND_EXPR,
+ void_type_node, present, tmp,
+ build_empty_stmt (input_location));
+ }
+ gfc_add_expr_to_block (&init, tmp);
}
- if ((sym->attr.dummy ||sym->attr.result)
+ if ((sym->attr.dummy || sym->attr.result)
&& sym->ts.type == BT_CHARACTER
&& sym->ts.deferred)
{
@@ -3855,15 +3883,38 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
gfc_add_modify (&init, sym->ts.u.cl->backend_decl,
build_int_cst (gfc_charlen_type_node, 0));
else
- gfc_add_modify (&init, sym->ts.u.cl->backend_decl, tmp);
+ {
+ tree tmp2;
+
+ tmp2 = fold_build2_loc (input_location, MODIFY_EXPR,
+ gfc_charlen_type_node,
+ sym->ts.u.cl->backend_decl, tmp);
+ if (sym->attr.optional)
+ {
+ tree present = gfc_conv_expr_present (sym);
+ tmp2 = build3_loc (input_location, COND_EXPR,
+ void_type_node, present, tmp2,
+ build_empty_stmt (input_location));
+ }
+ gfc_add_expr_to_block (&init, tmp2);
+ }
gfc_restore_backend_locus (&loc);
/* Pass the final character length back. */
if (sym->attr.intent != INTENT_IN)
- tmp = fold_build2_loc (input_location, MODIFY_EXPR,
- gfc_charlen_type_node, tmp,
- sym->ts.u.cl->backend_decl);
+ {
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ gfc_charlen_type_node, tmp,
+ sym->ts.u.cl->backend_decl);
+ if (sym->attr.optional)
+ {
+ tree present = gfc_conv_expr_present (sym);
+ tmp = build3_loc (input_location, COND_EXPR,
+ void_type_node, present, tmp,
+ build_empty_stmt (input_location));
+ }
+ }
else
tmp = NULL_TREE;
}
@@ -3872,7 +3923,8 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
/* Deallocate when leaving the scope. Nullifying is not
needed. */
- if (!sym->attr.result && !sym->attr.dummy)
+ if (!sym->attr.result && !sym->attr.dummy
+ && !sym->ns->proc_name->attr.is_main_program)
{
if (sym->ts.type == BT_CLASS
&& CLASS_DATA (sym)->attr.codimension)
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 07b0fa6125e..bd8886cdf55 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1761,9 +1761,12 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
/* A scalarized term. We already know the descriptor. */
se->expr = ss_info->data.array.descriptor;
se->string_length = ss_info->string_length;
- for (ref = ss_info->data.array.ref; ref; ref = ref->next)
- if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
- break;
+ ref = ss_info->data.array.ref;
+ if (ref)
+ gcc_assert (ref->type == REF_ARRAY
+ && ref->u.ar.type != AR_ELEMENT);
+ else
+ gfc_conv_tmp_array_ref (se);
}
else
{
@@ -4041,23 +4044,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_init_se (&parmse, se);
parm_kind = ELEMENTAL;
- if (ss->dimen > 0 && e->expr_type == EXPR_VARIABLE
- && ss->info->data.array.ref == NULL)
- {
- gfc_conv_tmp_array_ref (&parmse);
- if (e->ts.type == BT_CHARACTER)
- gfc_conv_string_parameter (&parmse);
- else
- parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
- }
- else
- {
- gfc_conv_expr_reference (&parmse, e);
- if (e->ts.type == BT_CHARACTER && !e->rank
- && e->expr_type == EXPR_FUNCTION)
- parmse.expr = build_fold_indirect_ref_loc (input_location,
- parmse.expr);
- }
+ gfc_conv_expr_reference (&parmse, e);
+ if (e->ts.type == BT_CHARACTER && !e->rank
+ && e->expr_type == EXPR_FUNCTION)
+ parmse.expr = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
if (fsym && fsym->ts.type == BT_DERIVED
&& gfc_is_class_container_ref (e))
@@ -4274,10 +4265,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
if (e->ts.type == BT_CLASS)
ptr = gfc_class_data_get (ptr);
- tmp = gfc_deallocate_with_status (ptr, NULL_TREE,
- NULL_TREE, NULL_TREE,
- NULL_TREE, true, NULL,
- false);
+ tmp = gfc_deallocate_scalar_with_status (ptr, NULL_TREE,
+ true, e, e->ts);
gfc_add_expr_to_block (&block, tmp);
tmp = fold_build2_loc (input_location, MODIFY_EXPR,
void_type_node, ptr,
@@ -4409,8 +4398,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
tmp = gfc_finish_block (&block);
- gfc_add_expr_to_block (&se->pre, tmp);
-}
+ gfc_add_expr_to_block (&se->pre, tmp);
+ }
/* The conversion does not repackage the reference to a class
array - _data descriptor. */
@@ -4511,7 +4500,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
{
tmp = build_fold_indirect_ref_loc (input_location,
parmse.expr);
- tmp = gfc_trans_dealloc_allocated (tmp, false);
+ tmp = gfc_trans_dealloc_allocated (tmp, false, e);
if (fsym->attr.optional
&& e->expr_type == EXPR_VARIABLE
&& e->symtree->n.sym->attr.optional)
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index eca907eb5d8..3fbf193d03c 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -5249,12 +5249,10 @@ static void
gfc_conv_intrinsic_storage_size (gfc_se *se, gfc_expr *expr)
{
gfc_expr *arg;
- gfc_se argse,eight;
+ gfc_se argse;
tree type, result_type, tmp;
arg = expr->value.function.actual->expr;
- gfc_init_se (&eight, NULL);
- gfc_conv_expr (&eight, gfc_get_int_expr (expr->ts.kind, NULL, 8));
gfc_init_se (&argse, NULL);
result_type = gfc_get_int_type (expr->ts.kind);
@@ -5285,11 +5283,12 @@ gfc_conv_intrinsic_storage_size (gfc_se *se, gfc_expr *expr)
if (arg->ts.type == BT_CHARACTER)
tmp = size_of_string_in_bytes (arg->ts.kind, argse.string_length);
else
- tmp = fold_convert (result_type, size_in_bytes (type));
+ tmp = size_in_bytes (type);
+ tmp = fold_convert (result_type, tmp);
done:
se->expr = fold_build2_loc (input_location, MULT_EXPR, result_type, tmp,
- eight.expr);
+ build_int_cst (result_type, BITS_PER_UNIT));
gfc_add_block_to_block (&se->pre, &argse.pre);
}
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 882927e639a..2765561e889 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -325,7 +325,7 @@ gfc_omp_clause_dtor (tree clause ATTRIBUTE_UNUSED, tree decl)
/* Allocatable arrays in FIRSTPRIVATE/LASTPRIVATE etc. clauses need
to be deallocated if they were allocated. */
- return gfc_trans_dealloc_allocated (decl, false);
+ return gfc_trans_dealloc_allocated (decl, false, NULL);
}
@@ -707,7 +707,8 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gfc_start_block (&block);
gfc_add_expr_to_block (&block, gfc_trans_assignment (e3, e4, false,
true));
- gfc_add_expr_to_block (&block, gfc_trans_dealloc_allocated (decl, false));
+ gfc_add_expr_to_block (&block, gfc_trans_dealloc_allocated (decl, false,
+ NULL));
stmt = gfc_finish_block (&block);
}
else
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 781293401af..e2d0110ba96 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -4925,7 +4925,7 @@ gfc_trans_allocate (gfc_code * code)
nelems = NULL_TREE;
if (!gfc_array_allocate (&se, expr, stat, errmsg, errlen, label_finish,
- memsz, &nelems, code->expr3))
+ memsz, &nelems, code->expr3, &code->ext.alloc.ts))
{
bool unlimited_char;
@@ -5398,7 +5398,8 @@ gfc_trans_deallocate (gfc_code *code)
if (expr->rank || gfc_is_coarray (expr))
{
- if (expr->ts.type == BT_DERIVED && expr->ts.u.derived->attr.alloc_comp)
+ if (expr->ts.type == BT_DERIVED && expr->ts.u.derived->attr.alloc_comp
+ && !gfc_is_finalizable (expr->ts.u.derived, NULL))
{
gfc_ref *ref;
gfc_ref *last = NULL;
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 8211573e1b3..f17eaca39db 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -838,6 +838,225 @@ gfc_call_free (tree var)
}
+/* Build a call to a FINAL procedure, which finalizes "var". */
+
+static tree
+gfc_build_final_call (gfc_typespec ts, gfc_expr *final_wrapper, gfc_expr *var,
+ bool fini_coarray, gfc_expr *class_size)
+{
+ stmtblock_t block;
+ gfc_se se;
+ tree final_fndecl, array, size, tmp;
+ symbol_attribute attr;
+
+ gcc_assert (final_wrapper->expr_type == EXPR_VARIABLE);
+ gcc_assert (var);
+
+ gfc_start_block (&block);
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr (&se, final_wrapper);
+ final_fndecl = se.expr;
+ if (POINTER_TYPE_P (TREE_TYPE (final_fndecl)))
+ final_fndecl = build_fold_indirect_ref_loc (input_location, final_fndecl);
+
+ if (ts.type == BT_DERIVED)
+ {
+ tree elem_size;
+
+ gcc_assert (!class_size);
+ elem_size = gfc_typenode_for_spec (&ts);
+ elem_size = TYPE_SIZE_UNIT (elem_size);
+ size = fold_convert (gfc_array_index_type, elem_size);
+
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ if (var->rank)
+ {
+ se.descriptor_only = 1;
+ gfc_conv_expr_descriptor (&se, var);
+ array = se.expr;
+ }
+ else
+ {
+ gfc_conv_expr (&se, var);
+ gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
+ array = se.expr;
+
+ /* No copy back needed, hence set attr's allocatable/pointer
+ to zero. */
+ gfc_clear_attr (&attr);
+ gfc_init_se (&se, NULL);
+ array = gfc_conv_scalar_to_descriptor (&se, array, attr);
+ gcc_assert (se.post.head == NULL_TREE);
+ }
+ }
+ else
+ {
+ gfc_expr *array_expr;
+ gcc_assert (class_size);
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr (&se, class_size);
+ gfc_add_block_to_block (&block, &se.pre);
+ gcc_assert (se.post.head == NULL_TREE);
+ size = se.expr;
+
+ array_expr = gfc_copy_expr (var);
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ if (array_expr->rank)
+ {
+ gfc_add_class_array_ref (array_expr);
+ se.descriptor_only = 1;
+ gfc_conv_expr_descriptor (&se, array_expr);
+ array = se.expr;
+ }
+ else
+ {
+ gfc_add_data_component (array_expr);
+ gfc_conv_expr (&se, array_expr);
+ gfc_add_block_to_block (&block, &se.pre);
+ gcc_assert (se.post.head == NULL_TREE);
+ array = se.expr;
+ if (TREE_CODE (array) == ADDR_EXPR
+ && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0))))
+ tmp = TREE_OPERAND (array, 0);
+
+ if (!gfc_is_coarray (array_expr))
+ {
+ /* No copy back needed, hence set attr's allocatable/pointer
+ to zero. */
+ gfc_clear_attr (&attr);
+ gfc_init_se (&se, NULL);
+ array = gfc_conv_scalar_to_descriptor (&se, array, attr);
+ }
+ gcc_assert (se.post.head == NULL_TREE);
+ }
+ gfc_free_expr (array_expr);
+ }
+
+ if (!POINTER_TYPE_P (TREE_TYPE (array)))
+ array = gfc_build_addr_expr (NULL, array);
+
+ gfc_add_block_to_block (&block, &se.pre);
+ tmp = build_call_expr_loc (input_location,
+ final_fndecl, 3, array,
+ size, fini_coarray ? boolean_true_node
+ : boolean_false_node);
+ gfc_add_block_to_block (&block, &se.post);
+ gfc_add_expr_to_block (&block, tmp);
+ return gfc_finish_block (&block);
+}
+
+
+/* Add a call to the finalizer, using the passed *expr. Returns
+ true when a finalizer call has been inserted. */
+
+bool
+gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2)
+{
+ tree tmp;
+ gfc_ref *ref;
+ gfc_expr *expr;
+ gfc_expr *final_expr = NULL;
+ gfc_expr *elem_size = NULL;
+ bool has_finalizer = false;
+
+ if (!expr2 || (expr2->ts.type != BT_DERIVED && expr2->ts.type != BT_CLASS))
+ return false;
+
+ if (expr2->ts.type == BT_DERIVED)
+ {
+ gfc_is_finalizable (expr2->ts.u.derived, &final_expr);
+ if (!final_expr)
+ return false;
+ }
+
+ /* If we have a class array, we need go back to the class
+ container. */
+ expr = gfc_copy_expr (expr2);
+
+ if (expr->ref && expr->ref->next && !expr->ref->next->next
+ && expr->ref->next->type == REF_ARRAY
+ && expr->ref->type == REF_COMPONENT
+ && strcmp (expr->ref->u.c.component->name, "_data") == 0)
+ {
+ gfc_free_ref_list (expr->ref);
+ expr->ref = NULL;
+ }
+ else
+ for (ref = expr->ref; ref; ref = ref->next)
+ if (ref->next && ref->next->next && !ref->next->next->next
+ && ref->next->next->type == REF_ARRAY
+ && ref->next->type == REF_COMPONENT
+ && strcmp (ref->next->u.c.component->name, "_data") == 0)
+ {
+ gfc_free_ref_list (ref->next);
+ ref->next = NULL;
+ }
+
+ if (expr->ts.type == BT_CLASS)
+ {
+ has_finalizer = gfc_is_finalizable (expr->ts.u.derived, NULL);
+
+ if (!expr2->rank && !expr2->ref && CLASS_DATA (expr2->symtree->n.sym)->as)
+ expr->rank = CLASS_DATA (expr2->symtree->n.sym)->as->rank;
+
+ final_expr = gfc_copy_expr (expr);
+ gfc_add_vptr_component (final_expr);
+ gfc_add_component_ref (final_expr, "_final");
+
+ elem_size = gfc_copy_expr (expr);
+ gfc_add_vptr_component (elem_size);
+ gfc_add_component_ref (elem_size, "_size");
+ }
+
+ gcc_assert (final_expr->expr_type == EXPR_VARIABLE);
+
+ tmp = gfc_build_final_call (expr->ts, final_expr, expr,
+ false, elem_size);
+
+ if (expr->ts.type == BT_CLASS && !has_finalizer)
+ {
+ tree cond;
+ gfc_se se;
+
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ gfc_conv_expr (&se, final_expr);
+ cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node,
+ se.expr, build_int_cst (TREE_TYPE (se.expr), 0));
+
+ /* For CLASS(*) not only sym->_vtab->_final can be NULL
+ but already sym->_vtab itself. */
+ if (UNLIMITED_POLY (expr))
+ {
+ tree cond2;
+ gfc_expr *vptr_expr;
+
+ vptr_expr = gfc_copy_expr (expr);
+ gfc_add_vptr_component (vptr_expr);
+
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ gfc_conv_expr (&se, vptr_expr);
+ gfc_free_expr (vptr_expr);
+
+ cond2 = fold_build2_loc (input_location, NE_EXPR, boolean_type_node,
+ se.expr,
+ build_int_cst (TREE_TYPE (se.expr), 0));
+ cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
+ boolean_type_node, cond2, cond);
+ }
+
+ tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node,
+ cond, tmp, build_empty_stmt (input_location));
+ }
+
+ gfc_add_expr_to_block (block, tmp);
+
+ return true;
+}
+
/* User-deallocate; we emit the code directly from the front-end, and the
logic is the same as the previous library function:
@@ -930,6 +1149,7 @@ gfc_deallocate_with_status (tree pointer, tree status, tree errmsg,
/* When POINTER is not NULL, we free it. */
gfc_start_block (&non_null);
+ gfc_add_finalizer_call (&non_null, expr);
if (!coarray || gfc_option.coarray != GFC_FCOARRAY_LIB)
{
tmp = build_call_expr_loc (input_location,
@@ -1022,125 +1242,6 @@ gfc_deallocate_with_status (tree pointer, tree status, tree errmsg,
}
-/* Build a call to a FINAL procedure, which finalizes "var". */
-
-tree
-gfc_build_final_call (gfc_typespec ts, gfc_expr *final_wrapper, gfc_expr *var,
- bool fini_coarray, gfc_expr *class_size)
-{
- stmtblock_t block;
- gfc_se se;
- tree final_fndecl, array, size, tmp;
- symbol_attribute attr;
-
- gcc_assert (final_wrapper->expr_type == EXPR_VARIABLE);
- gcc_assert (var);
-
- gfc_init_se (&se, NULL);
- gfc_conv_expr (&se, final_wrapper);
- final_fndecl = se.expr;
- if (POINTER_TYPE_P (TREE_TYPE (final_fndecl)))
- final_fndecl = build_fold_indirect_ref_loc (input_location, final_fndecl);
-
- attr = gfc_expr_attr (var);
-
- if (ts.type == BT_DERIVED)
- {
- tree elem_size;
-
- gcc_assert (!class_size);
- elem_size = gfc_typenode_for_spec (&ts);
- elem_size = TYPE_SIZE_UNIT (elem_size);
- size = fold_convert (gfc_array_index_type, elem_size);
-
- gfc_init_se (&se, NULL);
- se.want_pointer = 1;
- if (var->rank || attr.dimension
- || (attr.codimension && attr.allocatable
- && gfc_option.coarray == GFC_FCOARRAY_LIB))
- {
- if (var->rank == 0)
- se.want_coarray = 1;
- se.descriptor_only = 1;
- gfc_conv_expr_descriptor (&se, var);
- array = se.expr;
- if (!POINTER_TYPE_P (TREE_TYPE (array)))
- array = gfc_build_addr_expr (NULL, array);
- }
- else
- {
- gfc_clear_attr (&attr);
- gfc_conv_expr (&se, var);
- gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
- array = se.expr;
- if (TREE_CODE (array) == ADDR_EXPR
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0))))
- tmp = TREE_OPERAND (array, 0);
-
- gfc_init_se (&se, NULL);
- array = gfc_conv_scalar_to_descriptor (&se, array, attr);
- array = gfc_build_addr_expr (NULL, array);
- gcc_assert (se.post.head == NULL_TREE);
- }
- }
- else
- {
- gfc_expr *array_expr;
- gcc_assert (class_size);
- gfc_init_se (&se, NULL);
- gfc_conv_expr (&se, class_size);
- gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
- size = se.expr;
-
- array_expr = gfc_copy_expr (var);
- gfc_init_se (&se, NULL);
- se.want_pointer = 1;
- if (array_expr->rank || attr.dimension
- || (attr.codimension && attr.allocatable
- && gfc_option.coarray == GFC_FCOARRAY_LIB))
- {
- gfc_add_class_array_ref (array_expr);
- if (array_expr->rank == 0)
- se.want_coarray = 1;
- se.descriptor_only = 1;
- gfc_conv_expr_descriptor (&se, array_expr);
- array = se.expr;
- if (! POINTER_TYPE_P (TREE_TYPE (array)))
- array = gfc_build_addr_expr (NULL, array);
- }
- else
- {
- gfc_clear_attr (&attr);
- gfc_add_data_component (array_expr);
- gfc_conv_expr (&se, array_expr);
- gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
- array = se.expr;
- if (TREE_CODE (array) == ADDR_EXPR
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0))))
- tmp = TREE_OPERAND (array, 0);
-
- /* attr: Argument is neither a pointer/allocatable,
- i.e. no copy back needed */
- gfc_init_se (&se, NULL);
- array = gfc_conv_scalar_to_descriptor (&se, array, attr);
- array = gfc_build_addr_expr (NULL, array);
- gcc_assert (se.post.head == NULL_TREE);
- }
- gfc_free_expr (array_expr);
- }
-
- gfc_start_block (&block);
- gfc_add_block_to_block (&block, &se.pre);
- tmp = build_call_expr_loc (input_location,
- final_fndecl, 3, array,
- size, fini_coarray ? boolean_true_node
- : boolean_false_node);
- gfc_add_block_to_block (&block, &se.post);
- gfc_add_expr_to_block (&block, tmp);
- return gfc_finish_block (&block);
-}
-
-
/* Generate code for deallocation of allocatable scalars (variables or
components). Before the object itself is freed, any allocatable
subcomponents are being deallocated. */
@@ -1151,6 +1252,7 @@ gfc_deallocate_scalar_with_status (tree pointer, tree status, bool can_fail,
{
stmtblock_t null, non_null;
tree cond, tmp, error;
+ bool finalizable;
cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, pointer,
build_int_cst (TREE_TYPE (pointer), 0));
@@ -1195,20 +1297,13 @@ gfc_deallocate_scalar_with_status (tree pointer, tree status, bool can_fail,
gfc_start_block (&non_null);
/* Free allocatable components. */
- if (ts.type == BT_DERIVED && ts.u.derived->attr.alloc_comp)
+ finalizable = gfc_add_finalizer_call (&non_null, expr);
+ if (!finalizable && ts.type == BT_DERIVED && ts.u.derived->attr.alloc_comp)
{
tmp = build_fold_indirect_ref_loc (input_location, pointer);
tmp = gfc_deallocate_alloc_comp (ts.u.derived, tmp, 0);
gfc_add_expr_to_block (&non_null, tmp);
}
- else if (ts.type == BT_CLASS
- && ts.u.derived->components->ts.u.derived->attr.alloc_comp)
- {
- tmp = build_fold_indirect_ref_loc (input_location, pointer);
- tmp = gfc_deallocate_alloc_comp (ts.u.derived->components->ts.u.derived,
- tmp, 0);
- gfc_add_expr_to_block (&non_null, tmp);
- }
tmp = build_call_expr_loc (input_location,
builtin_decl_explicit (BUILT_IN_FREE), 1,
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 0c0fe5d2058..06cb63d8132 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -352,8 +352,7 @@ tree gfc_vtable_final_get (tree);
tree gfc_get_vptr_from_expr (tree);
tree gfc_get_class_array_ref (tree, tree);
tree gfc_copy_class_to_class (tree, tree, tree);
-tree gfc_build_final_call (gfc_typespec, gfc_expr *, gfc_expr *, bool,
- gfc_expr *);
+bool gfc_add_finalizer_call (stmtblock_t *, gfc_expr *);
void gfc_conv_derived_to_class (gfc_se *, gfc_expr *, gfc_typespec, tree, bool,
bool);
void gfc_conv_class_to_class (gfc_se *, gfc_expr *, gfc_typespec, bool, bool,
diff --git a/gcc/function.c b/gcc/function.c
index 36c874fd372..3e33fc70632 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4980,8 +4980,6 @@ do_warn_unused_parameter (tree fn)
warning (OPT_Wunused_parameter, "unused parameter %q+D", decl);
}
-static GTY(()) rtx initial_trampoline;
-
/* Generate RTL for the end of the current function. */
void
@@ -6270,8 +6268,10 @@ thread_prologue_and_epilogue_insns (void)
break;
if (e)
{
- copy_bb = create_basic_block (NEXT_INSN (BB_END (e->src)),
- NULL_RTX, e->src);
+ /* Make sure we insert after any barriers. */
+ rtx end = get_last_bb_insn (e->src);
+ copy_bb = create_basic_block (NEXT_INSN (end),
+ NULL_RTX, e->src);
BB_COPY_PARTITION (copy_bb, e->src);
}
else
@@ -6538,7 +6538,7 @@ epilogue_done:
basic_block simple_return_block_cold = NULL;
edge pending_edge_hot = NULL;
edge pending_edge_cold = NULL;
- basic_block exit_pred = EXIT_BLOCK_PTR->prev_bb;
+ basic_block exit_pred;
int i;
gcc_assert (entry_edge != orig_entry_edge);
@@ -6566,6 +6566,12 @@ epilogue_done:
else
pending_edge_cold = e;
}
+
+ /* Save a pointer to the exit's predecessor BB for use in
+ inserting new BBs at the end of the function. Do this
+ after the call to split_block above which may split
+ the original exit pred. */
+ exit_pred = EXIT_BLOCK_PTR->prev_bb;
FOR_EACH_VEC_ELT (unconverted_simple_returns, i, e)
{
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 6ef4e8a1b77..97dd57ac265 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -722,6 +722,12 @@ proper position among the other output files. */
%{!pie:%{!shared:%e-fsanitize=thread linking must be done with -pie or -shared}}}}}"
#endif
+#ifndef VTABLE_VERIFICATION_SPEC
+#define VTABLE_VERIFICATION_SPEC "\
+%{!nostdlib:%{fvtable-verify=std: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}\
+ %{fvtable-verify=preinit: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}}"
+#endif
+
/* -u* was put back because both BSD and SysV seem to support it. */
/* %{static:} simply prevents an error message if the target machine
doesn't handle -static. */
@@ -740,11 +746,11 @@ proper position among the other output files. */
%{flto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*}\
%X %{o*} %{e*} %{N} %{n} %{r}\
- %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
- %(mflib) " STACK_SPLIT_SPEC "\
+ %(mflib) " STACK_SPLIT_SPEC " \
%{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index 4a84700d167..503ef24e301 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -184,6 +184,7 @@ end
# Define some macros helpful to gdb when it is expanding macros.
macro define __FILE__ "gdb"
macro define __LINE__ 1
+macro define __FUNCTION__ "gdb"
macro define __null 0
# Gracefully handle aborts in functions used from gdb.
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index 3665d956db9..add4624ba17 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -1672,6 +1672,10 @@ gen_regexp_sequence (const char *str)
int i;
sequence_vect = get_str_vect (str, &els_num, ',', TRUE);
+ if (els_num == -1)
+ fatal ("unbalanced parentheses in reservation `%s'", str);
+ if (sequence_vect == NULL)
+ fatal ("invalid reservation `%s'", str);
if (els_num > 1)
{
sequence = XCREATENODEVAR (struct regexp, sizeof (struct regexp)
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 1092bd8111e..19b92408dc4 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -1717,6 +1717,21 @@ process_one_cond_exec (struct queue_elem *ce_elem)
XVECEXP (insn, 1, 0) = pattern;
}
+ if (XVEC (ce_elem->data, 3) != NULL)
+ {
+ rtvec attributes = rtvec_alloc (XVECLEN (insn, 4)
+ + XVECLEN (ce_elem->data, 3));
+ int i = 0;
+ int j = 0;
+ for (i = 0; i < XVECLEN (insn, 4); i++)
+ RTVEC_ELT (attributes, i) = XVECEXP (insn, 4, i);
+
+ for (j = 0; j < XVECLEN (ce_elem->data, 3); j++, i++)
+ RTVEC_ELT (attributes, i) = XVECEXP (ce_elem->data, 3, j);
+
+ XVEC (insn, 4) = attributes;
+ }
+
XSTR (insn, 2) = alter_test_for_insn (ce_elem, insn_elem);
XTMPL (insn, 3) = alter_output_for_insn (ce_elem, insn_elem,
alternatives, max_operand);
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 181d28d1b61..60fca6bc285 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -73,11 +73,6 @@ can_refer_decl_in_current_unit_p (tree decl, tree from_decl)
if ((!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
|| (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL))
return true;
- /* Weakrefs have somewhat confusing DECL_EXTERNAL flag set; they
- are always safe. */
- if (DECL_EXTERNAL (decl)
- && lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
- return true;
/* We are folding reference from external vtable. The vtable may reffer
to a symbol keyed to other compilation unit. The other compilation
unit may be in separate DSO and the symbol may be hidden. */
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index b06d194da65..64cc031785d 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -204,7 +204,7 @@ struct gimple_opt_pass pass_lower_cf =
return false. */
static bool
-gimple_check_call_args (gimple stmt, tree fndecl)
+gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
{
tree parms, p;
unsigned int i, nargs;
@@ -243,6 +243,8 @@ gimple_check_call_args (gimple stmt, tree fndecl)
&& !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
return false;
}
+ if (args_count_match && p)
+ return false;
}
else if (parms)
{
@@ -271,11 +273,13 @@ gimple_check_call_args (gimple stmt, tree fndecl)
}
/* Verify if the type of the argument and lhs of CALL_STMT matches
- that of the function declaration CALLEE.
+ that of the function declaration CALLEE. If ARGS_COUNT_MATCH is
+ true, the arg count needs to be the same.
If we cannot verify this or there is a mismatch, return false. */
bool
-gimple_check_call_matching_types (gimple call_stmt, tree callee)
+gimple_check_call_matching_types (gimple call_stmt, tree callee,
+ bool args_count_match)
{
tree lhs;
@@ -285,7 +289,7 @@ gimple_check_call_matching_types (gimple call_stmt, tree callee)
&& !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)),
TREE_TYPE (lhs))
&& !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs))
- || !gimple_check_call_args (call_stmt, callee))
+ || !gimple_check_call_args (call_stmt, callee, args_count_match))
return false;
return true;
}
diff --git a/gcc/gimple.h b/gcc/gimple.h
index b4de403e65c..8ae07c9ba5d 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1101,6 +1101,9 @@ extern tree tree_ssa_strip_useless_type_conversions (tree);
extern bool useless_type_conversion_p (tree, tree);
extern bool types_compatible_p (tree, tree);
+/* In tree-ssa-coalesce.c */
+extern bool gimple_can_coalesce_p (tree, tree);
+
/* Return the first node in GIMPLE sequence S. */
static inline gimple_seq_node
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 9abd2247f37..afc183207f7 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -7279,19 +7279,31 @@ Builtin_call_expression::do_numeric_constant_value(Numeric_constant* nc) const
Field_reference_expression* farg = arg->field_reference_expression();
if (farg == NULL)
return false;
- Expression* struct_expr = farg->expr();
- Type* st = struct_expr->type();
- if (st->struct_type() == NULL)
- return false;
- if (st->named_type() != NULL)
- st->named_type()->convert(this->gogo_);
- unsigned int offset;
- if (!st->struct_type()->backend_field_offset(this->gogo_,
- farg->field_index(),
- &offset))
- return false;
+ unsigned int total_offset = 0;
+ while (true)
+ {
+ Expression* struct_expr = farg->expr();
+ Type* st = struct_expr->type();
+ if (st->struct_type() == NULL)
+ return false;
+ if (st->named_type() != NULL)
+ st->named_type()->convert(this->gogo_);
+ unsigned int offset;
+ if (!st->struct_type()->backend_field_offset(this->gogo_,
+ farg->field_index(),
+ &offset))
+ return false;
+ total_offset += offset;
+ if (farg->implicit() && struct_expr->field_reference_expression() != NULL)
+ {
+ // Go up until we reach the original base.
+ farg = struct_expr->field_reference_expression();
+ continue;
+ }
+ break;
+ }
nc->set_unsigned_long(Type::lookup_integer_type("uintptr"),
- static_cast<unsigned long>(offset));
+ static_cast<unsigned long>(total_offset));
return true;
}
else if (this->code_ == BUILTIN_REAL || this->code_ == BUILTIN_IMAG)
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index af178de5c4e..36f4c0d79f2 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -1860,6 +1860,15 @@ class Field_reference_expression : public Expression
field_index() const
{ return this->field_index_; }
+ // Return whether this node was implied by an anonymous field.
+ bool
+ implicit() const
+ { return this->implicit_; }
+
+ void
+ set_implicit(bool implicit)
+ { this->implicit_ = implicit; }
+
// Set the struct expression. This is used when parsing.
void
set_struct_expression(Expression* expr)
@@ -1914,6 +1923,9 @@ class Field_reference_expression : public Expression
Expression* expr_;
// The zero-based index of the field we are retrieving.
unsigned int field_index_;
+ // Whether this node was emitted implicitly for an embedded field,
+ // that is, expr_ is not the expr_ of the original user node.
+ bool implicit_;
// Whether we have already emitted a fieldtrack call.
bool called_fieldtrack_;
};
diff --git a/gcc/go/gofrontend/go.cc b/gcc/go/gofrontend/go.cc
index 11692af8095..c0b3fef7239 100644
--- a/gcc/go/gofrontend/go.cc
+++ b/gcc/go/gofrontend/go.cc
@@ -44,7 +44,7 @@ go_create_gogo(int int_type_size, int pointer_size, const char *pkgpath,
GO_EXTERN_C
void
go_parse_input_files(const char** filenames, unsigned int filename_count,
- bool only_check_syntax, bool require_return_statement)
+ bool only_check_syntax, bool)
{
go_assert(filename_count > 0);
@@ -84,6 +84,9 @@ go_parse_input_files(const char** filenames, unsigned int filename_count,
// Finalize method lists and build stub methods for named types.
::gogo->finalize_methods();
+ // Check that functions have a terminating statement.
+ ::gogo->check_return_statements();
+
// Now that we have seen all the names, lower the parse tree into a
// form which is easier to use.
::gogo->lower_parse_tree();
@@ -104,10 +107,6 @@ go_parse_input_files(const char** filenames, unsigned int filename_count,
if (only_check_syntax)
return;
- // Check that functions have return statements.
- if (require_return_statement)
- ::gogo->check_return_statements();
-
// Export global identifiers as appropriate.
::gogo->do_exports();
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index 7870dad729e..c9c62cedaaf 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -1707,8 +1707,8 @@ Expression_statement::do_check_types(Gogo*)
this->expr_->discarding_value();
}
-// An expression statement may fall through unless it is a call to a
-// function which does not return.
+// An expression statement is only a terminating statement if it is
+// a call to panic.
bool
Expression_statement::do_may_fall_through() const
@@ -1717,22 +1717,28 @@ Expression_statement::do_may_fall_through() const
if (call != NULL)
{
const Expression* fn = call->fn();
- const Func_expression* fe = fn->func_expression();
- if (fe != NULL)
+ // panic is still an unknown named object.
+ const Unknown_expression* ue = fn->unknown_expression();
+ if (ue != NULL)
{
- const Named_object* no = fe->named_object();
+ Named_object* no = ue->named_object();
- Function_type* fntype;
- if (no->is_function())
- fntype = no->func_value()->type();
- else if (no->is_function_declaration())
- fntype = no->func_declaration_value()->type();
- else
- fntype = NULL;
-
- // The builtin function panic does not return.
- if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
- return false;
+ if (no->is_unknown())
+ no = no->unknown_value()->real_named_object();
+ if (no != NULL)
+ {
+ Function_type* fntype;
+ if (no->is_function())
+ fntype = no->func_value()->type();
+ else if (no->is_function_declaration())
+ fntype = no->func_declaration_value()->type();
+ else
+ fntype = NULL;
+
+ // The builtin function panic does not return.
+ if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
+ return false;
+ }
}
}
return true;
@@ -3700,9 +3706,6 @@ class Constant_switch_statement : public Statement
void
do_check_types(Gogo*);
- bool
- do_may_fall_through() const;
-
Bstatement*
do_get_backend(Translate_context*);
@@ -3746,22 +3749,6 @@ Constant_switch_statement::do_check_types(Gogo*)
this->set_is_error();
}
-// Return whether this switch may fall through.
-
-bool
-Constant_switch_statement::do_may_fall_through() const
-{
- if (this->clauses_ == NULL)
- return true;
-
- // If we have a break label, then some case needed it. That implies
- // that the switch statement as a whole can fall through.
- if (this->break_label_ != NULL)
- return true;
-
- return this->clauses_->may_fall_through();
-}
-
// Convert to GENERIC.
Bstatement*
@@ -3911,6 +3898,22 @@ Switch_statement::do_dump_statement(Ast_dump_context* ast_dump_context) const
ast_dump_context->ostream() << std::endl;
}
+// Return whether this switch may fall through.
+
+bool
+Switch_statement::do_may_fall_through() const
+{
+ if (this->clauses_ == NULL)
+ return true;
+
+ // If we have a break label, then some case needed it. That implies
+ // that the switch statement as a whole can fall through.
+ if (this->break_label_ != NULL)
+ return true;
+
+ return this->clauses_->may_fall_through();
+}
+
// Make a switch statement.
Switch_statement*
@@ -4050,6 +4053,17 @@ Type_case_clauses::Type_case_clause::lower(Type* switch_val_type,
}
}
+// Return true if this type clause may fall through to the statements
+// following the switch.
+
+bool
+Type_case_clauses::Type_case_clause::may_fall_through() const
+{
+ if (this->statements_ == NULL)
+ return true;
+ return this->statements_->may_fall_through();
+}
+
// Dump the AST representation for a type case clause
void
@@ -4148,6 +4162,25 @@ Type_case_clauses::lower(Type* switch_val_type, Block* b,
NULL);
}
+// Return true if these clauses may fall through to the statements
+// following the switch statement.
+
+bool
+Type_case_clauses::may_fall_through() const
+{
+ bool found_default = false;
+ for (Type_clauses::const_iterator p = this->clauses_.begin();
+ p != this->clauses_.end();
+ ++p)
+ {
+ if (p->may_fall_through())
+ return true;
+ if (p->is_default())
+ found_default = true;
+ }
+ return !found_default;
+}
+
// Dump the AST representation for case clauses (from a switch statement)
void
@@ -4237,6 +4270,22 @@ Type_switch_statement::do_lower(Gogo*, Named_object*, Block* enclosing,
return Statement::make_block_statement(b, loc);
}
+// Return whether this switch may fall through.
+
+bool
+Type_switch_statement::do_may_fall_through() const
+{
+ if (this->clauses_ == NULL)
+ return true;
+
+ // If we have a break label, then some case needed it. That implies
+ // that the switch statement as a whole can fall through.
+ if (this->break_label_ != NULL)
+ return true;
+
+ return this->clauses_->may_fall_through();
+}
+
// Return the break label for this type switch statement, creating it
// if necessary.
@@ -4954,6 +5003,19 @@ Select_statement::do_lower(Gogo* gogo, Named_object* function,
return Statement::make_block_statement(b, loc);
}
+// Whether the select statement itself may fall through to the following
+// statement.
+
+bool
+Select_statement::do_may_fall_through() const
+{
+ // A select statement is terminating if no break statement
+ // refers to it and all of its clauses are terminating.
+ if (this->break_label_ != NULL)
+ return true;
+ return this->clauses_->may_fall_through();
+}
+
// Return the backend representation for a select statement.
Bstatement*
@@ -5114,6 +5176,20 @@ For_statement::set_break_continue_labels(Unnamed_label* break_label,
this->continue_label_ = continue_label;
}
+// Whether the overall statement may fall through.
+
+bool
+For_statement::do_may_fall_through() const
+{
+ // A for loop is terminating if it has no condition and
+ // no break statement.
+ if(this->cond_ != NULL)
+ return true;
+ if(this->break_label_ != NULL)
+ return true;
+ return false;
+}
+
// Dump the AST representation for a for statement.
void
diff --git a/gcc/go/gofrontend/statements.h b/gcc/go/gofrontend/statements.h
index c5995710792..ee5be875aa0 100644
--- a/gcc/go/gofrontend/statements.h
+++ b/gcc/go/gofrontend/statements.h
@@ -894,8 +894,7 @@ class Select_statement : public Statement
{ this->clauses_->check_types(); }
bool
- do_may_fall_through() const
- { return this->clauses_->may_fall_through(); }
+ do_may_fall_through() const;
Bstatement*
do_get_backend(Translate_context*);
@@ -1086,6 +1085,9 @@ class For_statement : public Statement
Statement*
do_lower(Gogo*, Named_object*, Block*, Statement_inserter*);
+ bool
+ do_may_fall_through() const;
+
Bstatement*
do_get_backend(Translate_context*)
{ go_unreachable(); }
@@ -1399,6 +1401,9 @@ class Switch_statement : public Statement
void
do_dump_statement(Ast_dump_context*) const;
+ bool
+ do_may_fall_through() const;
+
private:
// The value to switch on. This may be NULL.
Expression* val_;
@@ -1449,6 +1454,11 @@ class Type_case_clauses
lower(Type*, Block*, Temporary_statement* descriptor_temp,
Unnamed_label* break_label) const;
+ // Return true if these clauses may fall through to the statements
+ // following the switch statement.
+ bool
+ may_fall_through() const;
+
// Dump the AST representation to a dump context.
void
dump_clauses(Ast_dump_context*) const;
@@ -1493,6 +1503,12 @@ class Type_case_clauses
lower(Type*, Block*, Temporary_statement* descriptor_temp,
Unnamed_label* break_label, Unnamed_label** stmts_label) const;
+ // Return true if this clause may fall through to execute the
+ // statements following the switch statement. This is not the
+ // same as whether this clause falls through to the next clause.
+ bool
+ may_fall_through() const;
+
// Dump the AST representation to a dump context.
void
dump_clause(Ast_dump_context*) const;
@@ -1556,6 +1572,9 @@ class Type_switch_statement : public Statement
void
do_dump_statement(Ast_dump_context*) const;
+ bool
+ do_may_fall_through() const;
+
private:
// The variable holding the value we are switching on.
Named_object* var_;
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 76949828229..4fbb162edd1 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -4532,6 +4532,7 @@ Struct_type::field_reference_depth(Expression* struct_expr,
go_assert(sub != NULL);
}
sub->set_struct_expression(here);
+ sub->set_implicit(true);
}
else if (subdepth > found_depth)
delete sub;
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 40575773b0d..c6c2aeb4b87 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -3905,10 +3905,9 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
if (new_bb)
{
df_bb_replace (then_bb_index, new_bb);
- /* Since the fallthru edge was redirected from test_bb to new_bb,
- we need to ensure that new_bb is in the same partition as
- test bb (you can not fall through across section boundaries). */
- BB_COPY_PARTITION (new_bb, test_bb);
+ /* This should have been done above via force_nonfallthru_and_redirect
+ (possibly called from redirect_edge_and_branch_force). */
+ gcc_checking_assert (BB_PARTITION (new_bb) == BB_PARTITION (test_bb));
}
num_true_changes++;
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index af4e94862d3..9c29d1dbc91 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1481,7 +1481,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
tree otr_type;
tree t;
- if (param_index == -1)
+ if (param_index == -1
+ || known_vals.length () <= (unsigned int) param_index)
return NULL_TREE;
if (!ie->indirect_info->polymorphic)
@@ -1516,8 +1517,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
t = NULL;
}
else
- t = (known_vals.length () > (unsigned int) param_index
- ? known_vals[param_index] : NULL);
+ t = known_vals[param_index];
if (t &&
TREE_CODE (t) == ADDR_EXPR
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index a378c08f42f..5d50bb43604 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1101,7 +1101,6 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
struct ipa_ref *ref;
if ((!node->symbol.alias && !inline_summary (node)->inlinable)
- || cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE
|| node->global.inlined_to)
return;
if (!bitmap_set_bit (updated_nodes, node->uid))
@@ -1162,7 +1161,7 @@ update_callee_keys (fibheap_t heap, struct cgraph_node *node,
if (e->inline_failed
&& (callee = cgraph_function_or_thunk_node (e->callee, &avail))
&& inline_summary (callee)->inlinable
- && cgraph_function_body_availability (callee) >= AVAIL_AVAILABLE
+ && avail >= AVAIL_AVAILABLE
&& !bitmap_bit_p (updated_nodes, callee->uid))
{
if (can_inline_edge_p (e, false)
@@ -2055,8 +2054,8 @@ early_inliner (void)
es->call_stmt_time
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
if (edge->callee->symbol.decl
- && !gimple_check_call_matching_types (edge->call_stmt,
- edge->callee->symbol.decl))
+ && !gimple_check_call_matching_types (
+ edge->call_stmt, edge->callee->symbol.decl, false))
edge->call_stmt_cannot_inline_p = true;
}
timevar_pop (TV_INTEGRATION);
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 8918c5b3bf5..a65adbbe331 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2468,8 +2468,9 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
new_direct_edge->indirect_inlining_edge = 1;
if (new_direct_edge->call_stmt)
new_direct_edge->call_stmt_cannot_inline_p
- = !gimple_check_call_matching_types (new_direct_edge->call_stmt,
- new_direct_edge->callee->symbol.decl);
+ = !gimple_check_call_matching_types (
+ new_direct_edge->call_stmt,
+ new_direct_edge->callee->symbol.decl, false);
if (new_edges)
{
new_edges->safe_push (new_direct_edge);
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index c6c41c6657a..9705db19e12 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -1110,7 +1110,7 @@ propagate_pure_const (void)
if (dump_file)
{
dump_cgraph (dump_file);
- ipa_print_order(dump_file, "reduced", order, order_pos);
+ ipa_print_order (dump_file, "reduced", order, order_pos);
}
/* Propagate the local information through the call graph to produce
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 254c09fa4fb..0f2a5c8b424 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -139,8 +139,7 @@ process_references (struct ipa_ref_list *list,
symtab_node node = ref->referred;
if (node->symbol.definition
- && (!DECL_EXTERNAL (node->symbol.decl)
- || node->symbol.alias
+ && ((!DECL_EXTERNAL (node->symbol.decl) || node->symbol.alias)
|| (before_inlining_p
/* We use variable constructors during late complation for
constant folding. Keep references alive so partitioning
@@ -297,7 +296,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (e->callee->symbol.definition
&& (!e->inline_failed
|| !DECL_EXTERNAL (e->callee->symbol.decl)
- || cnode->symbol.alias
+ || e->callee->symbol.alias
|| before_inlining_p))
pointer_set_insert (reachable, e->callee);
enqueue_node ((symtab_node) e->callee, &first, reachable);
@@ -388,7 +387,11 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
for (vnode = varpool_first_variable (); vnode; vnode = vnext)
{
vnext = varpool_next_variable (vnode);
- if (!vnode->symbol.aux)
+ if (!vnode->symbol.aux
+ /* For can_refer_decl_in_current_unit_p we want to track for
+ all external variables if they are defined in other partition
+ or not. */
+ && (!flag_ltrans || !DECL_EXTERNAL (vnode->symbol.decl)))
{
if (file)
fprintf (file, " %s", varpool_node_name (vnode));
@@ -516,7 +519,7 @@ ipa_discover_readonly_nonaddressable_vars (void)
/* Return true when there is a reference to node and it is not vtable. */
static bool
-cgraph_address_taken_from_non_vtable_p (struct cgraph_node *node)
+address_taken_from_non_vtable_p (symtab_node node)
{
int i;
struct ipa_ref *ref;
@@ -534,6 +537,38 @@ cgraph_address_taken_from_non_vtable_p (struct cgraph_node *node)
return false;
}
+/* A helper for comdat_can_be_unshared_p. */
+
+static bool
+comdat_can_be_unshared_p_1 (symtab_node node)
+{
+ /* When address is taken, we don't know if equality comparison won't
+ break eventaully. Exception are virutal functions and vtables, where
+ this is not possible by language standard. */
+ if (!DECL_VIRTUAL_P (node->symbol.decl)
+ && address_taken_from_non_vtable_p (node))
+ return false;
+
+ /* If the symbol is used in some weird way, better to not touch it. */
+ if (node->symbol.force_output)
+ return false;
+
+ /* Explicit instantiations needs to be output when possibly
+ used externally. */
+ if (node->symbol.forced_by_abi
+ && TREE_PUBLIC (node->symbol.decl)
+ && (node->symbol.resolution != LDPR_PREVAILING_DEF_IRONLY
+ && !flag_whole_program))
+ return false;
+
+ /* Non-readonly and volatile variables can not be duplicated. */
+ if (is_a <varpool_node> (node)
+ && (!TREE_READONLY (node->symbol.decl)
+ || TREE_THIS_VOLATILE (node->symbol.decl)))
+ return false;
+ return true;
+}
+
/* COMDAT functions must be shared only if they have address taken,
otherwise we can produce our own private implementation with
-fwhole-program.
@@ -544,24 +579,21 @@ cgraph_address_taken_from_non_vtable_p (struct cgraph_node *node)
but in C++ there is no way to compare their addresses for equality. */
static bool
-cgraph_comdat_can_be_unshared_p (struct cgraph_node *node)
+comdat_can_be_unshared_p (symtab_node node)
{
- if ((cgraph_address_taken_from_non_vtable_p (node)
- && !DECL_VIRTUAL_P (node->symbol.decl))
- || !node->symbol.definition)
+ if (!comdat_can_be_unshared_p_1 (node))
return false;
if (node->symbol.same_comdat_group)
{
- struct cgraph_node *next;
+ symtab_node next;
/* If more than one function is in the same COMDAT group, it must
be shared even if just one function in the comdat group has
address taken. */
- for (next = cgraph (node->symbol.same_comdat_group);
- next != node; next = cgraph (next->symbol.same_comdat_group))
- if (cgraph_address_taken_from_non_vtable_p (next)
- && !DECL_VIRTUAL_P (next->symbol.decl))
- return false;
+ for (next = node->symbol.same_comdat_group;
+ next != node; next = next->symbol.same_comdat_group)
+ if (!comdat_can_be_unshared_p_1 (next))
+ return false;
}
return true;
}
@@ -574,9 +606,8 @@ cgraph_externally_visible_p (struct cgraph_node *node,
{
if (!node->symbol.definition)
return false;
- if (!DECL_COMDAT (node->symbol.decl)
- && (!TREE_PUBLIC (node->symbol.decl)
- || DECL_EXTERNAL (node->symbol.decl)))
+ if (!TREE_PUBLIC (node->symbol.decl)
+ || DECL_EXTERNAL (node->symbol.decl))
return false;
/* Do not try to localize built-in functions yet. One of problems is that we
@@ -607,7 +638,7 @@ cgraph_externally_visible_p (struct cgraph_node *node,
implementing same COMDAT) */
if ((in_lto_p || whole_program)
&& DECL_COMDAT (node->symbol.decl)
- && cgraph_comdat_can_be_unshared_p (node))
+ && comdat_can_be_unshared_p ((symtab_node) node))
return false;
/* When doing link time optimizations, hidden symbols become local. */
@@ -632,16 +663,10 @@ cgraph_externally_visible_p (struct cgraph_node *node,
bool
varpool_externally_visible_p (struct varpool_node *vnode)
{
- /* Do not touch weakrefs; while they are not externally visible,
- dropping their DECL_EXTERNAL flags confuse most
- of code handling them. */
- if (vnode->symbol.alias && DECL_EXTERNAL (vnode->symbol.decl))
- return true;
-
if (DECL_EXTERNAL (vnode->symbol.decl))
return true;
- if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl))
+ if (!TREE_PUBLIC (vnode->symbol.decl))
return false;
/* If linker counts on us, we must preserve the function. */
@@ -677,8 +702,8 @@ varpool_externally_visible_p (struct varpool_node *vnode)
is faster for dynamic linking. Also this match logic hidding vtables
from LTO symbol tables. */
if ((in_lto_p || flag_whole_program)
- && !vnode->symbol.force_output
- && DECL_COMDAT (vnode->symbol.decl) && DECL_VIRTUAL_P (vnode->symbol.decl))
+ && DECL_COMDAT (vnode->symbol.decl)
+ && comdat_can_be_unshared_p ((symtab_node) vnode))
return false;
/* When doing link time optimizations, hidden symbols become local. */
@@ -740,9 +765,11 @@ function_and_variable_visibility (bool whole_program)
/* Frontends and alias code marks nodes as needed before parsing is finished.
We may end up marking as node external nodes where this flag is meaningless
strip it. */
- if (node->symbol.force_output
- && (DECL_EXTERNAL (node->symbol.decl) || !node->symbol.definition))
- node->symbol.force_output = 0;
+ if (DECL_EXTERNAL (node->symbol.decl) || !node->symbol.definition)
+ {
+ node->symbol.force_output = 0;
+ node->symbol.forced_by_abi = 0;
+ }
/* C++ FE on lack of COMDAT support create local COMDAT functions
(that ought to be shared but can not due to object format
@@ -750,9 +777,9 @@ function_and_variable_visibility (bool whole_program)
happy. Clear the flag here to avoid confusion in middle-end. */
if (DECL_COMDAT (node->symbol.decl) && !TREE_PUBLIC (node->symbol.decl))
DECL_COMDAT (node->symbol.decl) = 0;
- /* For external decls stop tracking same_comdat_group, it doesn't matter
- what comdat group they are in when they won't be emitted in this TU,
- and simplifies later passes. */
+
+ /* For external decls stop tracking same_comdat_group. It doesn't matter
+ what comdat group they are in when they won't be emitted in this TU. */
if (node->symbol.same_comdat_group && DECL_EXTERNAL (node->symbol.decl))
{
#ifdef ENABLE_CHECKING
@@ -770,6 +797,7 @@ function_and_variable_visibility (bool whole_program)
gcc_assert ((!DECL_WEAK (node->symbol.decl)
&& !DECL_COMDAT (node->symbol.decl))
|| TREE_PUBLIC (node->symbol.decl)
+ || node->symbol.weakref
|| DECL_EXTERNAL (node->symbol.decl));
if (cgraph_externally_visible_p (node, whole_program))
{
@@ -777,8 +805,12 @@ function_and_variable_visibility (bool whole_program)
node->symbol.externally_visible = true;
}
else
- node->symbol.externally_visible = false;
- if (!node->symbol.externally_visible && node->symbol.definition
+ {
+ node->symbol.externally_visible = false;
+ node->symbol.forced_by_abi = false;
+ }
+ if (!node->symbol.externally_visible
+ && node->symbol.definition && !node->symbol.weakref
&& !DECL_EXTERNAL (node->symbol.decl))
{
gcc_assert (whole_program || in_lto_p
@@ -823,6 +855,7 @@ function_and_variable_visibility (bool whole_program)
{
/* weak flag makes no sense on local variables. */
gcc_assert (!DECL_WEAK (vnode->symbol.decl)
+ || vnode->symbol.weakref
|| TREE_PUBLIC (vnode->symbol.decl)
|| DECL_EXTERNAL (vnode->symbol.decl));
/* In several cases declarations can not be common:
@@ -856,8 +889,12 @@ function_and_variable_visibility (bool whole_program)
if (varpool_externally_visible_p (vnode))
vnode->symbol.externally_visible = true;
else
- vnode->symbol.externally_visible = false;
- if (!vnode->symbol.externally_visible)
+ {
+ vnode->symbol.externally_visible = false;
+ vnode->symbol.forced_by_abi = false;
+ }
+ if (!vnode->symbol.externally_visible
+ && !vnode->symbol.weakref)
{
gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->symbol.decl));
symtab_make_decl_local (vnode->symbol.decl);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 82cc49f2e42..9cc34c51a5a 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-05 Jan Hubicka <jh@suse.cz>
+
+ * class.c (emit_register_classes_in_jcr_section): Use DECL_PRESERVE_P
+ instead of mark_decl_referenced.
+
2013-05-29 Jan Hubicka <jh@suse.cz>
* decl.c (java_mark_decl_local): Update for new symtab flags.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 30679f72b39..cb6789643d3 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -2814,10 +2814,10 @@ emit_register_classes_in_jcr_section (void)
TREE_CONSTANT (cdecl) = 1;
DECL_ARTIFICIAL (cdecl) = 1;
DECL_IGNORED_P (cdecl) = 1;
+ DECL_PRESERVE_P (cdecl) = 1;
pushdecl_top_level (cdecl);
relayout_decl (cdecl);
rest_of_decl_compilation (cdecl, 1, 0);
- mark_decl_referenced (cdecl);
#else
/* A target has defined TARGET_USE_JCR_SECTION,
but doesn't have a JCR_SECTION_NAME. */
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index ef6e07e10c1..ed84d9568cf 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1997,15 +1997,8 @@ process_alt_operands (int only_alternative)
(op, this_alternative) == NO_REGS))))
reject += LRA_MAX_REJECT;
- if (MEM_P (op) && offmemok)
- {
- /* If we know offset and this non-offsetable memory,
- something wrong with this memory and it is better
- to try other memory possibilities. */
- if (MEM_OFFSET_KNOWN_P (op))
- reject += LRA_MAX_REJECT;
- }
- else if (! (const_to_mem && constmemok))
+ if (! (MEM_P (op) && offmemok)
+ && ! (const_to_mem && constmemok))
{
/* We prefer to reload pseudos over reloading other
things, since such reloads may be able to be
@@ -4545,7 +4538,7 @@ update_ebb_live_info (rtx head, rtx tail)
bitmap_clear_bit (&live_regs, reg->regno);
/* Mark each used value as live. */
for (reg = curr_id->regs; reg != NULL; reg = reg->next)
- if (reg->type == OP_IN
+ if (reg->type != OP_OUT
&& bitmap_bit_p (&check_only_regs, reg->regno))
bitmap_set_bit (&live_regs, reg->regno);
/* It is quite important to remove dead move insns because it
diff --git a/gcc/lra.c b/gcc/lra.c
index 7c6bff15b8b..51f17072317 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -306,11 +306,11 @@ lra_emit_add (rtx x, rtx y, rtx z)
|| (disp != NULL_RTX && ! CONSTANT_P (disp))
|| (scale != NULL_RTX && ! CONSTANT_P (scale)))
{
- /* Its is not an address generation. Probably we have no 3 op
+ /* It is not an address generation. Probably we have no 3 op
add. Last chance is to use 2-op add insn. */
lra_assert (x != y && x != z);
- emit_move_insn (x, z);
- insn = gen_add2_insn (x, y);
+ emit_move_insn (x, y);
+ insn = gen_add2_insn (x, z);
emit_insn (insn);
}
else
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 2268f240804..e3f8880be76 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -377,6 +377,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
struct cgraph_node *clone_of;
struct ipa_opt_pass_d *pass;
int i;
+ bool alias_p;
boundary_p = !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node);
@@ -468,6 +469,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->local.can_change_signature, 1);
bp_pack_value (&bp, node->local.redefined_extern_inline, 1);
bp_pack_value (&bp, node->symbol.force_output, 1);
+ bp_pack_value (&bp, node->symbol.forced_by_abi, 1);
bp_pack_value (&bp, node->symbol.unique_name, 1);
bp_pack_value (&bp, node->symbol.address_taken, 1);
bp_pack_value (&bp, node->abstract_and_needed, 1);
@@ -485,7 +487,9 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
defined in other unit, we may use the info on aliases to resolve
symbol1 != symbol2 type tests that we can do only for locally defined objects
otherwise. */
- bp_pack_value (&bp, node->symbol.alias && (!boundary_p || DECL_EXTERNAL (node->symbol.decl)), 1);
+ alias_p = node->symbol.alias && (!boundary_p || node->symbol.weakref);
+ bp_pack_value (&bp, alias_p, 1);
+ bp_pack_value (&bp, node->symbol.weakref, 1);
bp_pack_value (&bp, node->frequency, 2);
bp_pack_value (&bp, node->only_called_at_startup, 1);
bp_pack_value (&bp, node->only_called_at_exit, 1);
@@ -504,15 +508,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset);
streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value);
}
- if ((node->symbol.alias || node->thunk.thunk_p)
- && (!boundary_p || (node->symbol.alias && DECL_EXTERNAL (node->symbol.decl))))
- {
- streamer_write_hwi_in_range (ob->main_stream, 0, 1,
- node->thunk.alias != NULL);
- if (node->thunk.alias != NULL)
- lto_output_fn_decl_index (ob->decl_state, ob->main_stream,
- node->thunk.alias);
- }
}
/* Output the varpool NODE to OB.
@@ -522,10 +517,10 @@ static void
lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node *node,
lto_symtab_encoder_t encoder)
{
- bool boundary_p = (node->symbol.definition
- && !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node));
+ bool boundary_p = !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node);
struct bitpack_d bp;
int ref;
+ bool alias_p;
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
LTO_symtab_variable);
@@ -534,10 +529,13 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, node->symbol.externally_visible, 1);
bp_pack_value (&bp, node->symbol.force_output, 1);
+ bp_pack_value (&bp, node->symbol.forced_by_abi, 1);
bp_pack_value (&bp, node->symbol.unique_name, 1);
bp_pack_value (&bp, node->symbol.definition, 1);
- bp_pack_value (&bp, node->symbol.alias, 1);
- bp_pack_value (&bp, node->alias_of != NULL, 1);
+ alias_p = node->symbol.alias && (!boundary_p || node->symbol.weakref);
+ bp_pack_value (&bp, alias_p, 1);
+ bp_pack_value (&bp, node->symbol.weakref, 1);
+ bp_pack_value (&bp, node->symbol.analyzed && !boundary_p, 1);
gcc_assert (node->symbol.definition || !node->symbol.analyzed);
/* Constant pool initializers can be de-unified into individual ltrans units.
FIXME: Alternatively at -Os we may want to avoid generating for them the local
@@ -554,12 +552,11 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node
bp_pack_value (&bp, node->symbol.definition
&& referenced_from_other_partition_p (&node->symbol.ref_list,
encoder), 1);
- bp_pack_value (&bp, boundary_p && !DECL_EXTERNAL (node->symbol.decl), 1);
+ bp_pack_value (&bp, node->symbol.analyzed
+ && boundary_p && !DECL_EXTERNAL (node->symbol.decl), 1);
/* in_other_partition. */
}
streamer_write_bitpack (&bp);
- if (node->alias_of)
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->alias_of);
if (node->symbol.same_comdat_group && !boundary_p)
{
ref = lto_symtab_encoder_lookup (encoder,
@@ -679,7 +676,7 @@ output_refs (lto_symtab_encoder_t encoder)
count = ipa_ref_list_nreferences (&node->symbol.ref_list);
if (count)
{
- streamer_write_uhwi_stream (ob->main_stream, count);
+ streamer_write_gcov_count_stream (ob->main_stream, count);
streamer_write_uhwi_stream (ob->main_stream,
lto_symtab_encoder_lookup (encoder, node));
for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list,
@@ -756,7 +753,7 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
!lsei_end_p (lsei); lsei_next_variable_in_partition (&lsei))
{
struct varpool_node *vnode = lsei_varpool_node (lsei);
- gcc_assert (!vnode->symbol.alias || vnode->alias_of);
+
lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
add_references (encoder, &vnode->symbol.ref_list);
@@ -888,6 +885,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->local.can_change_signature = bp_unpack_value (bp, 1);
node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
node->symbol.force_output = bp_unpack_value (bp, 1);
+ node->symbol.forced_by_abi = bp_unpack_value (bp, 1);
node->symbol.unique_name = bp_unpack_value (bp, 1);
node->symbol.address_taken = bp_unpack_value (bp, 1);
node->abstract_and_needed = bp_unpack_value (bp, 1);
@@ -910,6 +908,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
TREE_STATIC (node->symbol.decl) = 0;
}
node->symbol.alias = bp_unpack_value (bp, 1);
+ node->symbol.weakref = bp_unpack_value (bp, 1);
node->frequency = (enum node_frequency)bp_unpack_value (bp, 2);
node->only_called_at_startup = bp_unpack_value (bp, 1);
node->only_called_at_exit = bp_unpack_value (bp, 1);
@@ -919,6 +918,16 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
LDPR_NUM_KNOWN);
}
+/* Return string alias is alias of. */
+
+static tree
+get_alias_symbol (tree decl)
+{
+ tree alias = lookup_attribute ("alias", DECL_ATTRIBUTES (decl));
+ return get_identifier (TREE_STRING_POINTER
+ (TREE_VALUE (TREE_VALUE (alias))));
+}
+
/* Read a node from input_block IB. TAG is the node's tag just read.
Return the node read or overwriten. */
@@ -950,7 +959,14 @@ input_node (struct lto_file_decl_data *file_data,
vNULL, false);
}
else
- node = cgraph_get_create_node (fn_decl);
+ {
+ /* Declaration of functions can be already merged with a declaration
+ from other input file. We keep cgraph unmerged until after streaming
+ of ipa passes is done. Alays forcingly create a fresh node. */
+ node = cgraph_create_empty_node ();
+ node->symbol.decl = fn_decl;
+ symtab_register_node ((symtab_node)node);
+ }
node->symbol.order = order;
if (order >= symtab_order)
@@ -1004,15 +1020,8 @@ input_node (struct lto_file_decl_data *file_data,
node->thunk.virtual_value = virtual_value;
node->thunk.virtual_offset_p = (type & 4);
}
- if (node->thunk.thunk_p || node->symbol.alias)
- {
- if (streamer_read_hwi_in_range (ib, "alias nonzero flag", 0, 1))
- {
- decl_index = streamer_read_uhwi (ib);
- node->thunk.alias = lto_file_decl_data_get_fn_decl (file_data,
- decl_index);
- }
- }
+ if (node->symbol.alias && !node->symbol.analyzed && node->symbol.weakref)
+ node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
return node;
}
@@ -1028,13 +1037,19 @@ input_varpool_node (struct lto_file_decl_data *file_data,
struct varpool_node *node;
struct bitpack_d bp;
int ref = LCC_NOT_FOUND;
- bool non_null_aliasof;
int order;
order = streamer_read_hwi (ib) + order_base;
decl_index = streamer_read_uhwi (ib);
var_decl = lto_file_decl_data_get_var_decl (file_data, decl_index);
- node = varpool_node_for_decl (var_decl);
+
+ /* Declaration of functions can be already merged with a declaration
+ from other input file. We keep cgraph unmerged until after streaming
+ of ipa passes is done. Alays forcingly create a fresh node. */
+ node = varpool_create_empty_node ();
+ node->symbol.decl = var_decl;
+ symtab_register_node ((symtab_node)node);
+
node->symbol.order = order;
if (order >= symtab_order)
symtab_order = order + 1;
@@ -1043,23 +1058,21 @@ input_varpool_node (struct lto_file_decl_data *file_data,
bp = streamer_read_bitpack (ib);
node->symbol.externally_visible = bp_unpack_value (&bp, 1);
node->symbol.force_output = bp_unpack_value (&bp, 1);
+ node->symbol.forced_by_abi = bp_unpack_value (&bp, 1);
node->symbol.unique_name = bp_unpack_value (&bp, 1);
node->symbol.definition = bp_unpack_value (&bp, 1);
node->symbol.alias = bp_unpack_value (&bp, 1);
- non_null_aliasof = bp_unpack_value (&bp, 1);
+ node->symbol.weakref = bp_unpack_value (&bp, 1);
+ node->symbol.analyzed = bp_unpack_value (&bp, 1);
node->symbol.used_from_other_partition = bp_unpack_value (&bp, 1);
node->symbol.in_other_partition = bp_unpack_value (&bp, 1);
- node->symbol.analyzed = (node->symbol.definition && (!node->symbol.alias || !node->symbol.in_other_partition));
if (node->symbol.in_other_partition)
{
DECL_EXTERNAL (node->symbol.decl) = 1;
TREE_STATIC (node->symbol.decl) = 0;
}
- if (non_null_aliasof)
- {
- decl_index = streamer_read_uhwi (ib);
- node->alias_of = lto_file_decl_data_get_var_decl (file_data, decl_index);
- }
+ if (node->symbol.alias && !node->symbol.analyzed && node->symbol.weakref)
+ node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
ref = streamer_read_hwi (ib);
/* Store a reference for now, and fix up later to be a pointer. */
node->symbol.same_comdat_group = (symtab_node) (intptr_t) ref;
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index e0db8b10a70..88985ddca23 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -155,6 +155,9 @@ enum LTO_tags
{
LTO_null = 0,
+ /* Special for streamer. Reference to previously-streamed node. */
+ LTO_tree_pickle_reference,
+
/* Reserve enough entries to fit all the tree and gimple codes handled
by the streamer. This guarantees that:
@@ -196,9 +199,6 @@ enum LTO_tags
/* EH try/catch node. */
LTO_eh_catch,
- /* Special for global streamer. Reference to previously-streamed node. */
- LTO_tree_pickle_reference,
-
/* References to indexable tree nodes. These objects are stored in
tables that are written separately from the function bodies that
reference them. This way they can be instantiated even when the
@@ -569,6 +569,9 @@ struct GTY(()) lto_file_decl_data
unsigned max_index;
struct gcov_ctr_summary GTY((skip)) profile_info;
+
+ /* Map assigning declarations their resolutions. */
+ pointer_map_t * GTY((skip)) resolution_map;
};
typedef struct lto_file_decl_data *lto_file_decl_data_ptr;
@@ -898,7 +901,7 @@ lto_symtab_encoder_t compute_ltrans_boundary (lto_symtab_encoder_t encoder);
/* In lto-symtab.c. */
extern void lto_symtab_merge_decls (void);
-extern void lto_symtab_merge_cgraph_nodes (void);
+extern void lto_symtab_merge_symbols (void);
extern tree lto_symtab_prevailing_decl (tree decl);
extern GTY(()) vec<tree, va_gc> *lto_global_var_decls;
@@ -921,7 +924,7 @@ extern vec<lto_out_decl_state_ptr> lto_function_decl_states;
static inline bool
lto_tag_is_tree_code_p (enum LTO_tags tag)
{
- return tag > LTO_null && (unsigned) tag <= MAX_TREE_CODES;
+ return tag > LTO_tree_pickle_reference && (unsigned) tag <= MAX_TREE_CODES;
}
@@ -929,8 +932,8 @@ lto_tag_is_tree_code_p (enum LTO_tags tag)
static inline bool
lto_tag_is_gimple_code_p (enum LTO_tags tag)
{
- return (unsigned) tag >= NUM_TREE_CODES + 1
- && (unsigned) tag < 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE;
+ return (unsigned) tag >= NUM_TREE_CODES + 2
+ && (unsigned) tag < 2 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE;
}
@@ -939,7 +942,7 @@ lto_tag_is_gimple_code_p (enum LTO_tags tag)
static inline enum LTO_tags
lto_gimple_code_to_tag (enum gimple_code code)
{
- return (enum LTO_tags) ((unsigned) code + NUM_TREE_CODES + 1);
+ return (enum LTO_tags) ((unsigned) code + NUM_TREE_CODES + 2);
}
@@ -949,7 +952,7 @@ static inline enum gimple_code
lto_tag_to_gimple_code (enum LTO_tags tag)
{
gcc_assert (lto_tag_is_gimple_code_p (tag));
- return (enum gimple_code) ((unsigned) tag - NUM_TREE_CODES - 1);
+ return (enum gimple_code) ((unsigned) tag - NUM_TREE_CODES - 2);
}
@@ -958,7 +961,7 @@ lto_tag_to_gimple_code (enum LTO_tags tag)
static inline enum LTO_tags
lto_tree_code_to_tag (enum tree_code code)
{
- return (enum LTO_tags) ((unsigned) code + 1);
+ return (enum LTO_tags) ((unsigned) code + 2);
}
@@ -968,7 +971,7 @@ static inline enum tree_code
lto_tag_to_tree_code (enum LTO_tags tag)
{
gcc_assert (lto_tag_is_tree_code_p (tag));
- return (enum tree_code) ((unsigned) tag - 1);
+ return (enum tree_code) ((unsigned) tag - 2);
}
/* Check that tag ACTUAL == EXPECTED. */
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 6c433f42731..257280cb970 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -235,9 +235,6 @@ lto_symtab_symbol_p (symtab_node e)
{
if (!TREE_PUBLIC (e->symbol.decl) && !DECL_EXTERNAL (e->symbol.decl))
return false;
- /* weakrefs are really static variables that are made external by a hack. */
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (e->symbol.decl)))
- return false;
return symtab_real_symbol_p (e);
}
@@ -542,7 +539,7 @@ lto_symtab_merge_decls (void)
/* Helper to process the decl chain for the symbol table entry *SLOT. */
static void
-lto_symtab_merge_cgraph_nodes_1 (symtab_node prevailing)
+lto_symtab_merge_symbols_1 (symtab_node prevailing)
{
symtab_node e, next;
@@ -568,88 +565,49 @@ lto_symtab_merge_cgraph_nodes_1 (symtab_node prevailing)
lto_symtab_merge_decls. */
void
-lto_symtab_merge_cgraph_nodes (void)
+lto_symtab_merge_symbols (void)
{
- struct cgraph_node *cnode;
- struct varpool_node *vnode;
symtab_node node;
- /* Populate assembler name hash. */
- symtab_initialize_asm_name_hash ();
-
if (!flag_ltrans)
- FOR_EACH_SYMBOL (node)
- if (lto_symtab_symbol_p (node)
- && node->symbol.next_sharing_asm_name
- && !node->symbol.previous_sharing_asm_name)
- lto_symtab_merge_cgraph_nodes_1 (node);
-
- FOR_EACH_FUNCTION (cnode)
{
- /* Resolve weakrefs to symbol defined in other unit. */
- if (!cnode->symbol.analyzed && cnode->thunk.alias && !DECL_P (cnode->thunk.alias))
+ symtab_initialize_asm_name_hash ();
+
+ /* Do the actual merging.
+ At this point we invalidate hash translating decls into symtab nodes
+ because after removing one of duplicate decls the hash is not correcly
+ updated to the ohter dupliate. */
+ FOR_EACH_SYMBOL (node)
+ if (lto_symtab_symbol_p (node)
+ && node->symbol.next_sharing_asm_name
+ && !node->symbol.previous_sharing_asm_name)
+ lto_symtab_merge_symbols_1 (node);
+
+ /* Resolve weakref aliases whose target are now in the compilation unit.
+ also re-populate the hash translating decls into symtab nodes*/
+ FOR_EACH_SYMBOL (node)
{
- symtab_node node = symtab_node_for_asm (cnode->thunk.alias);
- if (node && is_a <cgraph_node> (node))
+ cgraph_node *cnode, *cnode2;
+ if (!node->symbol.analyzed && node->symbol.alias_target)
{
- struct cgraph_node *n;
-
- for (n = cgraph (node); n && n->symbol.alias;
- n = n->symbol.analyzed ? cgraph_alias_target (n) : NULL)
- if (n == cnode)
- {
- error ("function %q+D part of alias cycle", cnode->symbol.decl);
- cnode->symbol.alias = false;
- break;
- }
- if (cnode->symbol.alias)
- {
- cgraph_create_function_alias (cnode->symbol.decl, node->symbol.decl);
- ipa_record_reference ((symtab_node)cnode, (symtab_node)node,
- IPA_REF_ALIAS, NULL);
- cnode->symbol.analyzed = true;
- }
+ symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target);
+ gcc_assert (node->symbol.weakref);
+ if (tgt)
+ symtab_resolve_alias (node, tgt);
}
- else if (node)
- error ("%q+D alias in between function and variable is not supported", cnode->symbol.decl);
- }
- if ((cnode->thunk.thunk_p || cnode->symbol.alias)
- && cnode->thunk.alias && DECL_P (cnode->thunk.alias))
- cnode->thunk.alias = lto_symtab_prevailing_decl (cnode->thunk.alias);
- cnode->symbol.aux = NULL;
- }
- FOR_EACH_VARIABLE (vnode)
- {
- /* Resolve weakrefs to symbol defined in other unit. */
- if (!vnode->symbol.analyzed && vnode->alias_of && !DECL_P (vnode->alias_of))
- {
- symtab_node node = symtab_node_for_asm (vnode->alias_of);
- if (node && is_a <cgraph_node> (node))
+ node->symbol.aux = NULL;
+
+ if (!(cnode = dyn_cast <cgraph_node> (node))
+ || !cnode->clone_of
+ || cnode->clone_of->symbol.decl != cnode->symbol.decl)
{
- struct varpool_node *n;
-
- for (n = varpool (node); n && n->symbol.alias;
- n = n->symbol.analyzed ? varpool_alias_target (n) : NULL)
- if (n == vnode)
- {
- error ("function %q+D part of alias cycle", vnode->symbol.decl);
- vnode->symbol.alias = false;
- break;
- }
- if (vnode->symbol.alias)
- {
- varpool_create_variable_alias (vnode->symbol.decl, node->symbol.decl);
- ipa_record_reference ((symtab_node)vnode, (symtab_node)node,
- IPA_REF_ALIAS, NULL);
- vnode->symbol.analyzed = true;
- }
+ if (cnode && DECL_BUILT_IN (node->symbol.decl)
+ && (cnode2 = cgraph_get_node (node->symbol.decl))
+ && cnode2 != cnode)
+ lto_cgraph_replace_node (cnode2, cnode);
+ symtab_insert_node_to_hashtable ((symtab_node)node);
}
- else if (node)
- error ("%q+D alias in between function and variable is not supported", vnode->symbol.decl);
}
- if (vnode->symbol.alias && DECL_P (vnode->alias_of))
- vnode->alias_of = lto_symtab_prevailing_decl (vnode->alias_of);
- vnode->symbol.aux = NULL;
}
}
@@ -673,11 +631,6 @@ lto_symtab_prevailing_decl (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
return decl;
- /* As an anoying special cases weakrefs are really static variables with
- EXTERNAL flag. */
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
- return decl;
-
/* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index ded10566313..4b36f440ca4 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,34 @@
+2013-06-12 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (read_cgraph_and_symbols): Set cgraph into streaming state.
+
+2013-06-12 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (register_resolution): Take lto_file_data argument.
+ (lto_register_var_decl_in_symtab,
+ lto_register_function_decl_in_symtab): Update.
+ (read_cgraph_and_symbols): Update resolution_map handling.
+
+2013-06-11 Jan Hubicka <jh@suse.cz>
+
+ * lto-partition.c (get_symbol_class): Simplify weakref handling.
+ (add_symbol_to_partition_1): Likewise.
+ (contained_in_symbol): Likewise.
+ (lto_balanced_map): Likewise.
+ (rename_statics): Drop weakref.
+
+2013-06-05 Richard Biener <rguenther@suse.de>
+
+ * lto.c (num_merged_types): New global variable.
+ (uniquify_nodes): Increase num_merged_types when merging a type.
+ (print_lto_report_1): Output the number of merged types.
+
+2013-06-01 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (read_cgraph_and_symbols): Simplify dumping; Replace
+ lto_symtab_merge_cgraph_nodes by lto_symtab_merge_symbols.
+ (do_whole_program_analysis): Update dumping.
+
2013-05-29 Jan Hubicka <jh@suse.cz>
* lto.c (has_analyzed_clone_p, lto_materialize_function): Update for new symtab
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 921b4e26e31..6f453806155 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -60,7 +60,7 @@ get_symbol_class (symtab_node node)
return SYMBOL_DUPLICATE;
/* Weakref aliases are always duplicated. */
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ if (node->symbol.weakref)
return SYMBOL_DUPLICATE;
/* External declarations are external. */
@@ -218,10 +218,7 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node node)
/* Add all aliases associated with the symbol. */
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
- if (ref->use == IPA_REF_ALIAS
- && !lookup_attribute ("weakref",
- DECL_ATTRIBUTES
- (ref->referring->symbol.decl)))
+ if (ref->use == IPA_REF_ALIAS && !node->symbol.weakref)
add_symbol_to_partition_1 (part, ref->referring);
/* Ensure that SAME_COMDAT_GROUP lists all allways added in a group. */
@@ -243,8 +240,7 @@ static symtab_node
contained_in_symbol (symtab_node node)
{
/* Weakrefs are never contained in anything. */
- if (lookup_attribute ("weakref",
- DECL_ATTRIBUTES (node->symbol.decl)))
+ if (node->symbol.weakref)
return node;
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
{
@@ -561,8 +557,7 @@ lto_balanced_map (void)
last_visited_node++;
- gcc_assert (node->symbol.definition
- || lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)));
+ gcc_assert (node->symbol.definition || node->symbol.weakref);
/* Compute boundary cost of callgraph edges. */
for (edge = node->callees; edge; edge = edge->next_callee)
@@ -871,8 +866,7 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node node)
once this is fixed. */
|| DECL_EXTERNAL (node->symbol.decl)
|| !symtab_real_symbol_p (node))
- && !may_need_named_section_p (encoder, node)
- && !lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ && !may_need_named_section_p (encoder, node))
return;
/* Now walk symbols sharing the same name and see if there are any conflicts.
@@ -897,11 +891,9 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node node)
/* Assign every symbol in the set that shares the same ASM name an unique
mangled name. */
for (s = symtab_node_for_asm (name); s;)
- if ((!s->symbol.externally_visible
- || lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ if (!s->symbol.externally_visible
&& ((symtab_real_symbol_p (s)
- && (!DECL_EXTERNAL (node->symbol.decl)
- || lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ && !DECL_EXTERNAL (node->symbol.decl)
&& !TREE_PUBLIC (node->symbol.decl))
|| may_need_named_section_p (encoder, s))
&& (!encoder
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index f2a59d3bf74..c756c31a19c 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1726,18 +1726,16 @@ get_resolution (struct data_in *data_in, unsigned index)
return LDPR_UNKNOWN;
}
-/* Map assigning declarations their resolutions. */
-static pointer_map_t *resolution_map;
-
/* We need to record resolutions until symbol table is read. */
static void
-register_resolution (tree decl, enum ld_plugin_symbol_resolution resolution)
+register_resolution (struct lto_file_decl_data *file_data, tree decl,
+ enum ld_plugin_symbol_resolution resolution)
{
if (resolution == LDPR_UNKNOWN)
return;
- if (!resolution_map)
- resolution_map = pointer_map_create ();
- *pointer_map_insert (resolution_map, decl) = (void *)(size_t)resolution;
+ if (!file_data->resolution_map)
+ file_data->resolution_map = pointer_map_create ();
+ *pointer_map_insert (file_data->resolution_map, decl) = (void *)(size_t)resolution;
}
/* Register DECL with the global symbol table and change its
@@ -1764,7 +1762,7 @@ lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl)
unsigned ix;
if (!streamer_tree_cache_lookup (data_in->reader_cache, decl, &ix))
gcc_unreachable ();
- register_resolution (decl, get_resolution (data_in, ix));
+ register_resolution (data_in->file_data, decl, get_resolution (data_in, ix));
}
}
@@ -1784,10 +1782,11 @@ lto_register_function_decl_in_symtab (struct data_in *data_in, tree decl)
unsigned ix;
if (!streamer_tree_cache_lookup (data_in->reader_cache, decl, &ix))
gcc_unreachable ();
- register_resolution (decl, get_resolution (data_in, ix));
+ register_resolution (data_in->file_data, decl, get_resolution (data_in, ix));
}
}
+static unsigned long num_merged_types = 0;
/* Given a streamer cache structure DATA_IN (holding a sequence of trees
for one compilation unit) go over all trees starting at index FROM until the
@@ -1817,7 +1816,10 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
to reset that flag afterwards - nothing that refers
to those types is left and they are collected. */
if (newt != t)
- TREE_VISITED (t) = 1;
+ {
+ num_merged_types++;
+ TREE_VISITED (t) = 1;
+ }
}
}
@@ -2861,6 +2863,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
struct cgraph_node *node;
int count = 0;
struct lto_file_decl_data **decl_data;
+ void **res;
+ symtab_node snode;
init_cgraph ();
@@ -2887,6 +2891,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* True, since the plugin splits the archives. */
gcc_assert (num_objects == nfiles);
}
+ cgraph_state = CGRAPH_LTO_STREAMING;
tree_with_vars = htab_create_ggc (101, htab_hash_pointer, htab_eq_pointer,
NULL);
@@ -2967,21 +2972,21 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
input_symtab ();
/* Store resolutions into the symbol table. */
- if (resolution_map)
- {
- void **res;
- symtab_node snode;
-
- FOR_EACH_SYMBOL (snode)
- if (symtab_real_symbol_p (snode)
- && (res = pointer_map_contains (resolution_map,
- snode->symbol.decl)))
- snode->symbol.resolution
- = (enum ld_plugin_symbol_resolution)(size_t)*res;
- pointer_map_destroy (resolution_map);
- resolution_map = NULL;
- }
+ FOR_EACH_SYMBOL (snode)
+ if (symtab_real_symbol_p (snode)
+ && snode->symbol.lto_file_data
+ && snode->symbol.lto_file_data->resolution_map
+ && (res = pointer_map_contains (snode->symbol.lto_file_data->resolution_map,
+ snode->symbol.decl)))
+ snode->symbol.resolution
+ = (enum ld_plugin_symbol_resolution)(size_t)*res;
+ for (i = 0; all_file_decl_data[i]; i++)
+ if (all_file_decl_data[i]->resolution_map)
+ {
+ pointer_map_destroy (all_file_decl_data[i]->resolution_map);
+ all_file_decl_data[i]->resolution_map = NULL;
+ }
timevar_pop (TV_IPA_LTO_CGRAPH_IO);
@@ -3033,10 +3038,9 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Before merging:\n");
- dump_cgraph (cgraph_dump_file);
- dump_varpool (cgraph_dump_file);
+ dump_symtab (cgraph_dump_file);
}
- lto_symtab_merge_cgraph_nodes ();
+ lto_symtab_merge_symbols ();
ggc_collect ();
/* FIXME: ipa_transforms_to_apply holds list of passes that have optimization
@@ -3137,6 +3141,7 @@ print_lto_report_1 (void)
htab_collisions (type_hash_cache));
else
fprintf (stderr, "[%s] GIMPLE type hash cache table is empty\n", pfx);
+ fprintf (stderr, "[%s] Merged %lu types\n", pfx, num_merged_types);
print_gimple_types_stats (pfx);
print_lto_report (pfx);
@@ -3169,10 +3174,7 @@ do_whole_program_analysis (void)
cgraph_function_flags_ready = true;
if (cgraph_dump_file)
- {
- dump_cgraph (cgraph_dump_file);
- dump_varpool (cgraph_dump_file);
- }
+ dump_symtab (cgraph_dump_file);
bitmap_obstack_initialize (NULL);
cgraph_state = CGRAPH_STATE_IPA_SSA;
@@ -3182,8 +3184,7 @@ do_whole_program_analysis (void)
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Optimized ");
- dump_cgraph (cgraph_dump_file);
- dump_varpool (cgraph_dump_file);
+ dump_symtab (cgraph_dump_file);
}
#ifdef ENABLE_CHECKING
verify_cgraph ();
diff --git a/gcc/passes.c b/gcc/passes.c
index b9f0edd451a..a7fe2da6d63 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -136,8 +136,8 @@ rest_of_decl_compilation (tree decl,
/* A quirk of the initial implementation of aliases required that the
user add "extern" to all of them. Which is silly, but now
historical. Do note that the symbol is in fact locally defined. */
- if (!lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
- DECL_EXTERNAL (decl) = 0;
+ DECL_EXTERNAL (decl) = 0;
+ TREE_STATIC (decl) = 1;
assemble_alias (decl, alias);
}
}
@@ -1710,7 +1710,7 @@ do_per_function (void (*callback) (void *data), void *data)
{
struct cgraph_node *node;
FOR_EACH_DEFINED_FUNCTION (node)
- if (gimple_has_body_p (node->symbol.decl)
+ if (node->symbol.analyzed && gimple_has_body_p (node->symbol.decl)
&& (!node->clone_of || node->symbol.decl != node->clone_of->symbol.decl))
{
push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
@@ -2462,6 +2462,7 @@ ipa_write_summaries (void)
lto_symtab_encoder_t encoder;
int i, order_pos;
struct varpool_node *vnode;
+ struct cgraph_node *node;
struct cgraph_node **order;
if (!flag_generate_lto || seen_error ())
@@ -2497,9 +2498,11 @@ ipa_write_summaries (void)
lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
}
+ FOR_EACH_DEFINED_FUNCTION (node)
+ if (node->symbol.alias)
+ lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
FOR_EACH_DEFINED_VARIABLE (vnode)
- if ((!vnode->symbol.alias || vnode->alias_of))
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
+ lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
ipa_write_summaries_1 (compute_ltrans_boundary (encoder));
diff --git a/gcc/rtl.def b/gcc/rtl.def
index f8aea32b397..b4ce1b99f3f 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -962,8 +962,9 @@ DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "define_asm_attributes", "V", RTX_EXTRA)
relational operator. Operands should have only one alternative.
1: A C expression giving an additional condition for recognizing
the generated pattern.
- 2: A template or C code to produce assembler output. */
-DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "Ess", RTX_EXTRA)
+ 2: A template or C code to produce assembler output.
+ 3: A vector of attributes to append to the resulting cond_exec insn. */
+DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "EssV", RTX_EXTRA)
/* Definition of an operand predicate. The difference between
DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE is that genrecog will
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 554da54fc6e..a489aaca754 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2705,6 +2705,8 @@ extern int canon_true_dependence (const_rtx, enum machine_mode, rtx,
const_rtx, rtx);
extern int read_dependence (const_rtx, const_rtx);
extern int anti_dependence (const_rtx, const_rtx);
+extern int canon_anti_dependence (const_rtx, enum machine_mode, rtx,
+ const_rtx);
extern int output_dependence (const_rtx, const_rtx);
extern int may_alias_p (const_rtx, const_rtx);
extern void init_alias_target (void);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index fe708488444..9567694bc15 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1199,6 +1199,10 @@ noop_move_p (const_rtx insn)
if (find_reg_note (insn, REG_EQUAL, NULL_RTX))
return 0;
+ /* Check the code to be executed for COND_EXEC. */
+ if (GET_CODE (pat) == COND_EXEC)
+ pat = COND_EXEC_CODE (pat);
+
if (GET_CODE (pat) == SET && set_noop_p (pat))
return 1;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index c7ef1d8e67e..8270d5880cf 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2690,8 +2690,15 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
/* Always add these dependencies to pending_reads, since
this insn may be followed by a write. */
- if (!deps->readonly)
- add_insn_mem_dependence (deps, true, insn, x);
+ if (!deps->readonly)
+ {
+ if ((deps->pending_read_list_length
+ + deps->pending_write_list_length)
+ > MAX_PENDING_LIST_LENGTH
+ && !DEBUG_INSN_P (insn))
+ flush_pending_lists (deps, insn, true, true);
+ add_insn_mem_dependence (deps, true, insn, x);
+ }
sched_analyze_2 (deps, XEXP (x, 0), insn);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 5c1dd25d8a4..9bb31e76ed9 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2067,8 +2067,7 @@ simplify_byte_swapping_operation (enum rtx_code code, enum machine_mode mode,
rtx tem;
/* (op (bswap x) C1)) -> (bswap (op x C2)) with C2 swapped. */
- if (GET_CODE (op0) == BSWAP
- && (CONST_INT_P (op1) || CONST_DOUBLE_AS_INT_P (op1)))
+ if (GET_CODE (op0) == BSWAP && CONST_SCALAR_INT_P (op1))
{
tem = simplify_gen_binary (code, mode, XEXP (op0, 0),
simplify_gen_unary (BSWAP, mode, op1, mode));
@@ -4814,7 +4813,7 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
/* (eq/ne (bswap x) C1) simplifies to (eq/ne x C2) with C2 swapped. */
if ((code == EQ || code == NE)
&& GET_CODE (op0) == BSWAP
- && (CONST_INT_P (op1) || CONST_DOUBLE_AS_INT_P (op1)))
+ && CONST_SCALAR_INT_P (op1))
return simplify_gen_relational (code, mode, cmp_mode, XEXP (op0, 0),
simplify_gen_unary (BSWAP, cmp_mode,
op1, cmp_mode));
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 1a7f8262add..85d47a81a1f 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -269,7 +269,11 @@ symtab_unregister_node (symtab_node node)
node->symbol.previous = NULL;
slot = htab_find_slot (symtab_hash, node, NO_INSERT);
- if (*slot == node)
+
+ /* During LTO symtab merging we temporarily corrupt decl to symtab node
+ hash. */
+ gcc_assert ((slot && *slot) || in_lto_p);
+ if (slot && *slot && *slot == node)
{
symtab_node replacement_node = NULL;
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
@@ -291,10 +295,14 @@ symtab_get_node (const_tree decl)
symtab_node *slot;
struct symtab_node_base key;
+#ifdef ENABLE_CHECKING
+ /* Check that we are called for sane type of object - functions
+ and static or external variables. */
gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == VAR_DECL
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
|| in_lto_p)));
+#endif
if (!symtab_hash)
return NULL;
@@ -481,6 +489,16 @@ dump_symtab_base (FILE *f, symtab_node node)
fprintf (f, " analyzed");
if (node->symbol.alias)
fprintf (f, " alias");
+ if (node->symbol.weakref)
+ fprintf (f, " weakref");
+ if (node->symbol.cpp_implicit_alias)
+ fprintf (f, " cpp_implicit_alias");
+ if (node->symbol.alias_target)
+ fprintf (f, " target:%s",
+ DECL_P (node->symbol.alias_target)
+ ? IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
+ (node->symbol.alias_target))
+ : IDENTIFIER_POINTER (node->symbol.alias_target));
fprintf (f, "\n Visibility:");
if (node->symbol.in_other_partition)
fprintf (f, " in_other_partition");
@@ -488,6 +506,10 @@ dump_symtab_base (FILE *f, symtab_node node)
fprintf (f, " used_from_other_partition");
if (node->symbol.force_output)
fprintf (f, " force_output");
+ if (node->symbol.forced_by_abi)
+ fprintf (f, " forced_by_abi");
+ if (node->symbol.externally_visible)
+ fprintf (f, " externally_visible");
if (node->symbol.resolution != LDPR_UNKNOWN)
fprintf (f, " %s",
ld_plugin_symbol_resolution_names[(int)node->symbol.resolution]);
@@ -627,11 +649,23 @@ verify_symtab_base (symtab_node node)
error_found = true;
}
- hashed_node = symtab_get_node (node->symbol.decl);
- if (!hashed_node)
+ if (cgraph_state != CGRAPH_LTO_STREAMING)
{
- error ("node not found in symtab decl hashtable");
- error_found = true;
+ hashed_node = symtab_get_node (node->symbol.decl);
+ if (!hashed_node)
+ {
+ error ("node not found in symtab decl hashtable");
+ error_found = true;
+ }
+ if (hashed_node != node
+ && (!is_a <cgraph_node> (node)
+ || !dyn_cast <cgraph_node> (node)->clone_of
+ || dyn_cast <cgraph_node> (node)->clone_of->symbol.decl
+ != node->symbol.decl))
+ {
+ error ("node differs from symtab decl hashtable");
+ error_found = true;
+ }
}
if (assembler_name_hash)
{
@@ -666,6 +700,22 @@ verify_symtab_base (symtab_node node)
error ("node is analyzed byt it is not a definition");
error_found = true;
}
+ if (node->symbol.cpp_implicit_alias && !node->symbol.alias)
+ {
+ error ("node is alias but not implicit alias");
+ error_found = true;
+ }
+ if (node->symbol.alias && !node->symbol.definition
+ && !node->symbol.weakref)
+ {
+ error ("node is alias but not definition");
+ error_found = true;
+ }
+ if (node->symbol.weakref && !node->symbol.alias)
+ {
+ error ("node is weakref but not an alias");
+ error_found = true;
+ }
if (node->symbol.same_comdat_group)
{
symtab_node n = node->symbol.same_comdat_group;
@@ -757,6 +807,7 @@ symtab_used_from_object_file_p (symtab_node node)
/* Make DECL local. FIXME: We shouldn't need to mess with rtl this early,
but other code such as notice_global_symbol generates rtl. */
+
void
symtab_make_decl_local (tree decl)
{
@@ -777,8 +828,6 @@ symtab_make_decl_local (tree decl)
DECL_VISIBILITY_SPECIFIED (decl) = 0;
DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
TREE_PUBLIC (decl) = 0;
- DECL_VISIBILITY_SPECIFIED (decl) = 0;
- DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
if (!DECL_RTL_SET_P (decl))
return;
@@ -796,6 +845,17 @@ symtab_make_decl_local (tree decl)
SYMBOL_REF_WEAK (symbol) = DECL_WEAK (decl);
}
+/* Return availability of NODE. */
+
+enum availability
+symtab_node_availability (symtab_node node)
+{
+ if (is_a <cgraph_node> (node))
+ return cgraph_function_body_availability (cgraph (node));
+ else
+ return cgraph_variable_initializer_availability (varpool (node));
+}
+
/* Given NODE, walk the alias chain to return the symbol NODE is alias of.
If NODE is not an alias, return NODE.
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
@@ -803,32 +863,155 @@ symtab_make_decl_local (tree decl)
symtab_node
symtab_alias_ultimate_target (symtab_node node, enum availability *availability)
{
+ bool weakref_p = false;
+
+ if (!node->symbol.alias)
+ {
+ if (availability)
+ *availability = symtab_node_availability (node);
+ return node;
+ }
+
+ /* To determine visibility of the target, we follow ELF semantic of aliases.
+ Here alias is an alternative assembler name of a given definition. Its
+ availablity prevails the availablity of its target (i.e. static alias of
+ weak definition is available.
+
+ Weakref is a different animal (and not part of ELF per se). It is just
+ alternative name of a given symbol used within one complation unit
+ and is translated prior hitting the object file. It inherits the
+ visibility of its target (i.e. weakref of non-overwritable definition
+ is non-overwritable, while weakref of weak definition is weak).
+
+ If we ever get into supporting targets with different semantics, a target
+ hook will be needed here. */
+
if (availability)
{
- if (is_a <cgraph_node> (node))
- *availability = cgraph_function_body_availability (cgraph (node));
+ weakref_p = node->symbol.weakref;
+ if (!weakref_p)
+ *availability = symtab_node_availability (node);
else
- *availability = cgraph_variable_initializer_availability (varpool (node));
+ *availability = AVAIL_LOCAL;
}
while (node)
{
if (node->symbol.alias && node->symbol.analyzed)
node = symtab_alias_target (node);
else
- return node;
- if (node && availability)
{
- enum availability a;
- if (is_a <cgraph_node> (node))
- a = cgraph_function_body_availability (cgraph (node));
+ if (!availability)
+ ;
+ else if (node->symbol.analyzed)
+ {
+ if (weakref_p)
+ {
+ enum availability a = symtab_node_availability (node);
+ if (a < *availability)
+ *availability = a;
+ }
+ }
else
- a = cgraph_variable_initializer_availability (varpool (node));
+ *availability = AVAIL_NOT_AVAILABLE;
+ return node;
+ }
+ if (node && availability && weakref_p)
+ {
+ enum availability a = symtab_node_availability (node);
if (a < *availability)
*availability = a;
+ weakref_p = node->symbol.weakref;
}
}
if (availability)
*availability = AVAIL_NOT_AVAILABLE;
return NULL;
}
+
+/* C++ FE sometimes change linkage flags after producing same body aliases.
+
+ FIXME: C++ produce implicit aliases for virtual functions and vtables that
+ are obviously equivalent. The way it is doing so is however somewhat
+ kludgy and interferes with the visibility code. As a result we need to
+ copy the visibility from the target to get things right. */
+
+void
+fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target)
+{
+ if (is_a <cgraph_node> (node))
+ {
+ DECL_DECLARED_INLINE_P (node->symbol.decl)
+ = DECL_DECLARED_INLINE_P (target->symbol.decl);
+ DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl)
+ = DECL_DISREGARD_INLINE_LIMITS (target->symbol.decl);
+ }
+ /* FIXME: It is not really clear why those flags should not be copied for
+ functions, too. */
+ else
+ {
+ DECL_WEAK (node->symbol.decl) = DECL_WEAK (target->symbol.decl);
+ DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (target->symbol.decl);
+ DECL_VISIBILITY (node->symbol.decl) = DECL_VISIBILITY (target->symbol.decl);
+ }
+ DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (target->symbol.decl);
+ if (TREE_PUBLIC (node->symbol.decl))
+ {
+ DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (target->symbol.decl);
+ DECL_COMDAT (node->symbol.decl) = DECL_COMDAT (target->symbol.decl);
+ DECL_COMDAT_GROUP (node->symbol.decl)
+ = DECL_COMDAT_GROUP (target->symbol.decl);
+ if (DECL_ONE_ONLY (target->symbol.decl)
+ && !node->symbol.same_comdat_group)
+ symtab_add_to_same_comdat_group ((symtab_node)node, (symtab_node)target);
+ }
+ node->symbol.externally_visible = target->symbol.externally_visible;
+}
+
+/* Add reference recording that NODE is alias of TARGET.
+ The function can fail in the case of aliasing cycles; in this case
+ it returns false. */
+
+bool
+symtab_resolve_alias (symtab_node node, symtab_node target)
+{
+ symtab_node n;
+
+ gcc_assert (!node->symbol.analyzed
+ && !vec_safe_length (node->symbol.ref_list.references));
+
+ /* Never let cycles to creep into the symbol table alias references;
+ those will make alias walkers to be infinite. */
+ for (n = target; n && n->symbol.alias;
+ n = n->symbol.analyzed ? symtab_alias_target (n) : NULL)
+ if (n == node)
+ {
+ if (is_a <cgraph_node> (node))
+ error ("function %q+D part of alias cycle", node->symbol.decl);
+ else if (is_a <varpool_node> (node))
+ error ("variable %q+D part of alias cycle", node->symbol.decl);
+ else
+ gcc_unreachable ();
+ node->symbol.alias = false;
+ return false;
+ }
+
+ /* "analyze" the node - i.e. mark the reference. */
+ node->symbol.definition = true;
+ node->symbol.alias = true;
+ node->symbol.analyzed = true;
+ ipa_record_reference (node, target, IPA_REF_ALIAS, NULL);
+
+ /* Alias targets become reudndant after alias is resolved into an reference.
+ We do not want to keep it around or we would have to mind updating them
+ when renaming symbols. */
+ node->symbol.alias_target = NULL;
+
+ if (node->symbol.cpp_implicit_alias && cgraph_state >= CGRAPH_STATE_CONSTRUCTION)
+ fixup_same_cpp_alias_visibility (node, target);
+
+ /* If alias has address taken, so does the target. */
+ if (node->symbol.address_taken)
+ symtab_alias_ultimate_target (target, NULL)->symbol.address_taken = true;
+ return true;
+}
#include "gt-symtab.h"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 27bf13439d0..da5bb5b16c2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,668 @@
+2013-06-16 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR rtl-optimization/57425
+ PR rtl-optimization/57569
+ * gcc.dg/torture/pr57425-1.c, gcc.dg/torture/pr57425-2.c: New files.
+ * gcc.dg/torture/pr57425-3.c, gcc.dg/torture/pr57569.c: Likewise.
+
+2013-06-15 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/49074
+ PR fortran/56136
+ * gfortran.dg/typebound_assignment_5.f03: Check the absence of any
+ packing.
+ * gfortran.dg/typebound_assignment_6.f03: New.
+
+2013-06-15 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * gcc.target/h8300/h8300.exp: New.
+ * gcc.dg/pragma-isr.c: Move to ...
+ * gcc.target/sh/torture/pragma-isr.c: ... here ...
+ * gcc.target/h8300/pragma-isr.c: ... and here.
+ * gcc.dg/pragma-isr2.c: Move to ...
+ * gcc.target/sh/torture/pragma-isr2.c: ... here ...
+ * gcc.target/h8300/pragma-isr2.c: ... and here.
+ * gcc.dg/pragma-isr-trapa.c: Move to ...
+ * gcc.target/sh/pragma-isr-trapa.c: ... here.
+ * gcc.dg/pragma-isr-trapa2.c: Move to ...
+ * gcc.target/sh/pragma-isr-trapa2.c: ... here.
+ * gcc.dg/pragma-isr-trap_exit.c: Move to ...
+ * gcc.target/sh/pragma-isr-trap-exit.c: ... here.
+ * gcc.dg/pragma-isr-nosave_low_regs.c: Move to ...
+ * gcc.target/sh/pragma-isr-nosave_low_regs.c: ... here.
+ * gcc.dg/attr-isr-nosave_low_regs.c: Move to ...
+ * gcc.target/sh/attr-isr-nosave_low_regs.c: ... here.
+ * gcc.dg/attr-isr-trap_exit.c: Move to ...
+ * gcc.target/sh/attr-isr-trap_exit.c: ... here.
+ * gcc.dg/attr-isr-trapa.c: Move to ...
+ * gcc.target/sh/attr-isr-trapa.c: ... here.
+
+2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51413
+ * g++.dg/ext/builtin-offsetof1.C: New.
+
+2013-06-14 Vidya Praveen <vidyapraveen@arm.com>
+
+ * gcc.target/aarch64/vect_smlal_1.c: New file.
+
+2013-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57508
+ * gfortran.dg/defined_assignment_7.f90: New.
+
+2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/57599
+ * g++.dg/rtti/dyncast6.C: New.
+ * g++.dg/cpp0x/dyncast1.C: Likewise.
+
+2013-06-14 Alan Modra <amodra@gmail.com>
+
+ PR middle-end/57134
+ * gcc.dg/pr57134.c: New.
+
+2013-06-14 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57596
+ * gfortran.dg/deferred_type_param_9.f90: New.
+
+2013-06-13 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/fold-minus-1.c: New testcase.
+
+2013-06-13 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/49074
+ * gfortran.dg/typebound_assignment_5.f03: New.
+
+2013-06-13 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/tree-ssa/forwprop-27.c: New testcase.
+
+2013-06-12 Michael Meissner <meissner@linux.vnet.ibm.com>
+ Pat Haugen <pthaugen@us.ibm.com>
+ Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/atomic-p7.c: New file, add tests for atomic
+ load/store instructions on power7, power8.
+ * gcc.target/powerpc/atomic-p8.c: Likewise.
+
+2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR c/57577
+ * c-c++-common/cilk-plus/AN/pr57577.c: New testcase.
+
+2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/38958
+ * g++.dg/warn/Wunused-var-20.C: New.
+
+2013-06-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.target/mips/mips.exp: Handle -f{no-,}common.
+ * gcc.target/mips/memcpy-1.c: Remove redundant dg-do.
+ Run with -fno-common.
+
+2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-c++-common/cilk-plus/AN/sec_implicit_ex.c (main): Replaced abort
+ and exit function calls with return 1 and return 0, respectively.
+
+2013-06-12 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gcc.target/mips/umips-branch-1.c, gcc.target/mips/umips-branch-2.c:
+ New tests.
+
+2013-06-12 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/57361
+ * gcc.dg/tree-ssa/pr57361.c: New file.
+
+2013-06-12 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * gcc.target/arm/unaligned-memcpy-4.c (src, dst): Initialize
+ to ensure alignment.
+ * gcc.target/arm/unaligned-memcpy-3.c (src): Likewise.
+
+2013-06-12 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/finalize_10.f90: Update scan-tree-dump.
+
+2013-06-12 Tobias Burnus <burnus@net-b.de>
+ Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ * gfortran.dg/finalize_10.f90: Update scan-tree-dump.
+
+2013-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/56564
+ * gcc.target/i386/pr56564-1.c: Skip on darwin, mingw and cygwin.
+ * gcc.target/i386/pr56564-3.c: Likewise.
+
+2013-06-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57535
+ * gfortran.dg/class_array_18.f90: New.
+
+2013-06-11 Jan Hubicka <jh@suse.cz>
+
+ PR c++/57551
+ * g++.dg/ext/visibility/anon6.C: Update testcase.
+
+2013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR c/57563
+ * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c (main): Fixed a bug
+ in how we check __sec_reduce_mutating function's result.
+
+2013-06-10 Michael Meissner <meissner@linux.vnet.ibm.com>
+ Pat Haugen <pthaugen@us.ibm.com>
+ Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/direct-move-vint1.c: New tests for power8
+ direct move instructions.
+ * gcc.target/powerpc/direct-move-vint2.c: Likewise.
+ * gcc.target/powerpc/direct-move.h: Likewise.
+ * gcc.target/powerpc/direct-move-float1.c: Likewise.
+ * gcc.target/powerpc/direct-move-float2.c: Likewise.
+ * gcc.target/powerpc/direct-move-double1.c: Likewise.
+ * gcc.target/powerpc/direct-move-double2.c: Likewise.
+ * gcc.target/powerpc/direct-move-long1.c: Likewise.
+ * gcc.target/powerpc/direct-move-long2.c: Likewise.
+
+2013-06-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/52440
+ * g++.dg/cpp0x/pr52440.C: New.
+
+2013-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/56564
+ * gcc.target/i386/pr56564-1.c: New test.
+ * gcc.target/i386/pr56564-2.c: New test.
+ * gcc.target/i386/pr56564-3.c: New test.
+ * gcc.target/i386/pr56564-4.c: New test.
+ * gcc.target/i386/avx256-unaligned-load-4.c: Add -fno-common.
+ * gcc.target/i386/avx256-unaligned-store-1.c: Likewise.
+ * gcc.target/i386/avx256-unaligned-store-3.c: Likewise.
+ * gcc.target/i386/avx256-unaligned-store-4.c: Likewise.
+ * gcc.target/i386/vect-sizes-1.c: Likewise.
+ * gcc.target/i386/memcpy-1.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-31.c (tmp): Initialize.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c (tmp): Likewise.
+
+2013-06-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ * g++.dg/abi/forced.C: Extend current handling of Linux-based x86
+ systems to cover all GNU systems.
+ * g++.dg/abi/guard2.C: Likewise.
+ * g++.dg/cpp0x/constexpr-rom.C: Likewise.
+ * g++.dg/eh/sighandle.C: Likewise.
+ * g++.dg/ext/cleanup-10.C: Likewise.
+ * g++.dg/ext/cleanup-11.C: Likewise.
+ * g++.dg/ext/cleanup-8.C: Likewise.
+ * g++.dg/ext/cleanup-9.C: Likewise.
+ * g++.dg/opt/const5.C: Likewise.
+ * g++.dg/opt/life1.C: Likewise.
+ * g++.dg/other/pr39496.C: Likewise.
+ * g++.old-deja/g++.abi/aggregates.C: Likewise.
+ * g++.old-deja/g++.abi/align.C: Likewise.
+ * g++.old-deja/g++.abi/bitfields.C: Likewise.
+ * g++.old-deja/g++.law/weak.C: Likewise.
+ * g++.old-deja/g++.pt/asm1.C: Likewise.
+ * gcc.c-torture/execute/20030125-1.x: Likewise.
+ * gcc.c-torture/execute/990127-2.x: Likewise.
+ * gcc.dg/20041106-1.c: Likewise.
+ * gcc.dg/20050503-1.c: Likewise.
+ * gcc.dg/builtin-object-size-5.c: Likewise.
+ * gcc.dg/cleanup-10.c: Likewise.
+ * gcc.dg/cleanup-11.c: Likewise.
+ * gcc.dg/cleanup-8.c: Likewise.
+ * gcc.dg/cleanup-9.c: Likewise.
+ * gcc.dg/complex-5.c: Likewise.
+ * gcc.dg/debug/dwarf2/asm-line1.c: Likewise.
+ * gcc.dg/debug/dwarf2/discriminator.c: Likewise.
+ * gcc.dg/dfp/convert-dfp-round-thread.c: Likewise.
+ * gcc.dg/dfp/pr35739.c: Likewise.
+ * gcc.dg/fdata-sections-1.c: Likewise.
+ * gcc.dg/lto/20090206-1_0.c: Likewise.
+ * gcc.dg/lto/20090206-2_0.c: Likewise.
+ * gcc.dg/pr30360.c: Likewise.
+ * gcc.dg/pr37303.c: Likewise.
+ * gcc.dg/pr39323-1.c: Likewise.
+ * gcc.dg/pr39323-2.c: Likewise.
+ * gcc.dg/pr39323-3.c: Likewise.
+ * gcc.dg/pr45416.c: Likewise.
+ * gcc.dg/setjmp-2.c: Likewise.
+ * gcc.dg/split-1.c: Likewise.
+ * gcc.dg/split-3.c: Likewise.
+ * gcc.dg/split-4.c: Likewise.
+ * gcc.dg/strlenopt-12g.c: Likewise.
+ * gcc.dg/strlenopt-14g.c: Likewise.
+ * gcc.dg/strlenopt-14gf.c: Likewise.
+ * gcc.dg/strlenopt-16g.c: Likewise.
+ * gcc.dg/strlenopt-17g.c: Likewise.
+ * gcc.dg/strlenopt-18g.c: Likewise.
+ * gcc.dg/strlenopt-1f.c: Likewise.
+ * gcc.dg/strlenopt-22g.c: Likewise.
+ * gcc.dg/strlenopt-2f.c: Likewise.
+ * gcc.dg/strlenopt-4g.c: Likewise.
+ * gcc.dg/strlenopt-4gf.c: Likewise.
+ * gcc.dg/struct-ret-3.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-2.c: Likewise.
+ * gcc.misc-tests/linkage.exp: Likewise.
+ * gcc.target/i386/20000724-1.c: Likewise.
+ * gcc.target/i386/align-main-3.c: Likewise.
+ * gcc.target/i386/cleanup-1.c: Likewise.
+ * gcc.target/i386/inline-mcpy.c: Likewise.
+ * gcc.target/i386/pr32268.c: Likewise.
+ * gcc.target/i386/pr36613.c: Likewise.
+ * gcc.target/i386/pr39013-1.c: Likewise.
+ * gcc.target/i386/pr39013-2.c: Likewise.
+ * gcc.target/i386/pr39496.c: Likewise.
+ * gcc.target/i386/pr40906-3.c: Likewise.
+ * gcc.target/i386/pr46084.c: Likewise.
+ * lib/target-supports.exp (check_effective_target_pie): Likewise.
+
+2013-06-09 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/6526
+ * gcc.target/sh/pr6526.c: New.
+
+2013-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/57568
+ * gcc.c-torture/execute/pr57568.c: New test.
+
+2013-06-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/37404
+ * g++.dg/other/vararg-4.C: New.
+
+2013-06-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57559
+ * gcc.target/s390/pr57559.c : New test.
+
+2013-06-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37336
+ * gfortran.dg/finalize_10.f90: New.
+ * gfortran.dg/auto_dealloc_2.f90: Update tree-dump.
+ * gfortran.dg/finalize_15.f90: New.
+
+2013-06-08 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57553
+ * gfortran.dg/storage_size_4.f90: New.
+
+2013-06-07 Sriraman Tallam <tmsriram@google.com>
+
+ PR c++/57548
+ * testsuite/g++.dg/ext/pr57548.C: New test.
+
+2013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR middle-end/57541
+ * c-c++-common/cilk-plus/AN/pr57541.c: New test case.
+
+2013-06-07 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/attr-alias.c: Remove brackets in template.
+
+2013-06-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57549
+ * gfortran.dg/array_constructor_48.f90: New.
+ * gfortran.dg/array_constructor_type_14.f03: Correct test case.
+ * gfortran.dg/array_constructor_type_15.f03: Ditto.
+
+2013-06-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/56315
+ * gcc.target/arm/xordi3-opt.c: New test.
+
+2013-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/debug/dwarf2/discriminator.c: Fix wording.
+ Revert to dg-options.
+
+2013-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ PR target/55033
+ * gcc.target/powerpc/pr55033.c: New.
+
+2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53658
+ * g++.dg/cpp0x/alias-decl-36.C: New.
+
+2013-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+ Pat Haugen <pthaugen@us.ibm.com>
+ Peter Bergner <bergner@vnet.ibm.com>
+
+ * gcc.target/powerpc/p8vector-builtin-1.c: New test to test
+ power8 builtin functions.
+ * gcc.target/powerpc/p8vector-builtin-2.c: Likewise.
+ * gcc.target/powerpc/p8vector-builtin-3.c: Likewise.
+ * gcc.target/powerpc/p8vector-builtin-4.c: Likewise.
+ * gcc.target/powerpc/p8vector-builtin-5.c: Likewise.
+ * gcc.target/powerpc/p8vector-builtin-6.c: Likewise.
+ * gcc.target/powerpc/p8vector-builtin-7.c: Likewise.
+ * gcc.target/powerpc/p8vector-vectorize-1.c: New
+ tests to test power8 auto-vectorization.
+ * gcc.target/powerpc/p8vector-vectorize-2.c: Likewise.
+ * gcc.target/powerpc/p8vector-vectorize-3.c: Likewise.
+ * gcc.target/powerpc/p8vector-vectorize-4.c: Likewise.
+ * gcc.target/powerpc/p8vector-vectorize-5.c: Likewise.
+
+ * gcc.target/powerpc/crypto-builtin-1.c: Use effective target
+ powerpc_p8vector_ok instead of powerpc_vsx_ok.
+
+ * gcc.target/powerpc/bool.c: New file, add eqv, nand, nor tests.
+
+ * lib/target-supports.exp (check_p8vector_hw_available) Add power8
+ support.
+ (check_effective_target_powerpc_p8vector_ok): Likewise.
+ (is-effective-target): Likewise.
+ (check_vect_support_and_set_flags): Likewise.
+
+2013-06-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/43652
+ * g++.dg/parse/error53.C: New.
+
+2013-06-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57459
+ * gcc.target/i386/pr57459.c: New test.
+
+2013-06-06 Teresa Johnson <tejohnson@google.com>
+
+ PR c++/53743
+ * gcc.dg/tree-prof/va-arg-pack-1.c: Cloned from c-torture, made
+ into -freorder-blocks-and-partition test.
+ * gcc.dg/tree-prof/comp-goto-1.c: Ditto.
+ * gcc.dg/tree-prof/20041218-1.c: Ditto.
+ * gcc.dg/tree-prof/pr52027.c: Use -O2.
+ * gcc.dg/tree-prof/pr50907.c: Ditto.
+ * gcc.dg/tree-prof/pr45354.c: Ditto.
+ * g++.dg/tree-prof/partition2.C: Ditto.
+ * g++.dg/tree-prof/partition3.C: Ditto.
+
+2013-06-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57542
+ * gfortran.dg/finalize_16.f90: New.
+
+2013-06-06 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * gcc.dg/vect/no-section-anchors-vect-68.c:
+ Add dg-skip-if aarch64_tiny.
+
+2013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR C/57457
+ * c-c++-common/cilk-plus/AN/pr57457.c: New test.
+ * c-c++-common/cilk-plus/AN/pr57457-2.c: Likewise.
+
+2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51908
+ * g++.dg/cpp0x/decltype54.C: New.
+
+2013-06-05 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * gcc.dg/fshort-wchar.c: Add extra dg-options for
+ arm*-*-*eabi* targets.
+ * gcc.dg/tree-ssa/pr42585.c: Change dg-final to catch
+ arm*-*-* targets.
+ * gcc.dg/tree-ssa/pr43491.c: Likewise.
+
+2013-06-05 Manfred Schwarb <manfred99@gmx.ch>
+ Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/string_length_2.f90: Fix dg-do run.
+ * gfortran.dg/io_real_boz_3.f90: Remove extra space in "dg-do run".
+ * gfortran.dg/io_real_boz_4.f90: Ditto.
+ * gfortran.dg/io_real_boz_5.f90: Ditto.
+
+2013-06-05 Andreas Schwab <schwab@suse.de>
+
+ * gcc.dg/tree-ssa/attr-alias.c: Remove duplicated contents.
+
+2013-06-04 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/attr-alias.c: New testcase.
+
+2013-06-04 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-c++-common/cilk-plus/AN/array_test1.c (main): Replaced argc, argv
+ parameters with void.
+ (main2): Removed argc parameter.
+ * c-c++-common/cilk-plus/AN/array_test2.c (main2): Likewise.
+ (main): Replaced argc, argv parameters with void.
+ * c-c++-common/cilk-plus/AN/array_test_ND.c (main): Likewise.
+ (main2): Removed argc parameter.
+ * c-c++-common/cilk-plus/AN/builtin_fn_custom.c (main): Replaced argc
+ argv parameters with void. Added __asm volatile to avoid optimization
+ on argc, if necessary.
+ * c-c++-common/cilk-plus/AN/builtin_fn_mutating (main): Likewise.
+ * c-c++-common/cilk-plus/AN/builtin_func_double.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/builtin_func_double2.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/conditional.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/exec-once.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/exec-once2.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/fn_ptr.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/gather-scatter-errors.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/gather_scatter.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/misc.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/parser_errors.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/parser_errors2.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/parser_errors3.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/parser_errors4.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/rank_mismatch2.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/sec_implicit_ex.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/sec_reduce_return.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/test_builtin_return.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/vla.c (main): Likewise.
+ * c-c++-common/cilk-plus/AN/comma-exp.c (main): Replaced argc, argv
+ parameters with void.
+ (main2): Removed argc parameter.
+ * c-c++-common/cilk-plus/AN/if_test.c (main2): Likewise.
+ (main): Replaced argc, argv parameters with void.
+ * c-c++-common/cilk-plus/AN/fp_triplet_values (main2): Replace argc,
+ argv parameters with void. Also renamed this function as main, and
+ delete the existing main.
+ * c-c++-common/cilk-plus/AN/sec_implicit.c (main2): Likewise.
+ * c-c++-common/cilk-plus/AN/sec_implicit2.c (main2): Likewise.
+ * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c (main2): Likewise.
+
+2013-06-04 Ian Bolton <ian.bolton@arm.com>
+
+ * gcc.target/aarch64/movi_1.c: New test.
+
+2013-06-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37336
+ * gfortran.dg/finalize_12.f90: New.
+ * gfortran.dg/alloc_comp_basics_1.f90: Add BLOCK for
+ end of scope finalization.
+ * gfortran.dg/alloc_comp_constructor_1.f90: Ditto.
+ * gfortran.dg/allocatable_scalar_9.f90: Ditto.
+ * gfortran.dg/auto_dealloc_2.f90: Ditto.
+ * gfortran.dg/class_19.f03: Ditto.
+ * gfortran.dg/coarray_lib_alloc_1.f90: Ditto.
+ * gfortran.dg/coarray_lib_alloc_2.f90: Ditto.
+ * gfortran.dg/extends_14.f03: Ditto.
+ * gfortran.dg/move_alloc_4.f90: Ditto.
+ * gfortran.dg/typebound_proc_27.f03: Ditto.
+
+2013-06-04 Manfred Schwarb <manfred99@gmx.ch>
+
+ * gfortran.dg/bounds_check_7.f90: Remove "! {".
+ * gfortran.dg/coarray_poly_3.f90: Remove inactive, broken dg-*.
+ * gfortran.dg/default_initialization_5.f90: Update dg-do.
+ * gfortran.dg/g77/f77-edit-s-out.f: Fix broken dg-output.
+ * gfortran.dg/g77/f77-edit-t-out.f: Fix broken dg-output.
+ * gfortran.dg/g77/f77-edit-x-out.f: Fix broken dg-output.
+ * gfortran.dg/init_flag_11.f90: Fix broken dg-options.
+ * gfortran.dg/io_real_boz_3.f90: Add comment regarding dg-do run.
+ * gfortran.dg/io_real_boz_4.f90: Ditto.
+ * gfortran.dg/io_real_boz_5.f90: Ditto.
+ * gfortran.dg/namelist_print_1.f: Fix broken dg-output.
+ * gfortran.dg/read_x_eor.f90: Fix broken dg-output.
+ * gfortran.dg/repeat_1.f90: Improve dg-output pattern.
+ * gfortran.dg/spread_bounds_1.f90: Fix broken dg-output.
+ * gfortran.dg/transpose_2.f90: Fix dg-output.
+
+2013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-c++-common/cilk-plus/AN/if_test_errors.c (main): New testcase.
+ * c-c++-common/cilk-plus/AN/rank_mismatch.c: Added a '-w' option to
+ dg-option and an header comment.
+
+2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/57419
+ * g++.dg/cpp0x/sfinae46.C: New.
+ * g++.dg/cpp0x/defaulted13.C: Adjust.
+ * g++.dg/cpp0x/defaulted2.C: Likewise.
+ * g++.dg/cpp0x/defaulted26.C: Likewise.
+ * g++.dg/cpp0x/defaulted3.C: Likewise.
+ * g++.dg/cpp0x/error1.C: Likewise.
+ * g++.dg/cpp0x/implicit1.C: Likewise.
+ * g++.dg/cpp0x/implicit11.C: Likewise.
+ * g++.dg/cpp0x/inh-ctor13.C: Likewise.
+ * g++.dg/cpp0x/initlist47.C: Likewise.
+ * g++.dg/cpp0x/initlist9.C: Likewise.
+ * g++.dg/cpp0x/lambda/lambda-errloc.C: Likewise.
+ * g++.dg/cpp0x/lambda/lambda-errloc2.C: Likewise.
+ * g++.dg/cpp0x/nsdmi-local.C: Likewise.
+ * g++.dg/cpp0x/union4.C: Likewise.
+ * g++.dg/template/crash108.C: Likewise.
+ * g++.dg/template/crash41.C: Likewise.
+ * g++.old-deja/g++.jason/local.C: Likewise.
+ * g++.old-deja/g++.law/visibility3.C: Likewise.
+
+2013-06-03 Teresa Johnson <tejohnson@google.com>
+
+ * gcc.dg/vect/bb-slp-31.c: Update vect dump message.
+ * gcc.dg/vect/bb-slp-14.c: Ditto.
+ * gcc.dg/vect/fast-math-bb-slp-call-1.c: Ditto.
+ * gcc.dg/vect/bb-slp-23.c: Ditto.
+ * gcc.dg/vect/bb-slp-15.c: Ditto.
+ * gcc.dg/vect/fast-math-bb-slp-call-2.c: Ditto.
+ * gcc.dg/vect/bb-slp-24.c: Ditto.
+ * gcc.dg/vect/bb-slp-16.c: Ditto.
+ * gcc.dg/vect/bb-slp-25.c: Ditto.
+ * gcc.dg/vect/bb-slp-pattern-2.c: Ditto.
+ * gcc.dg/vect/bb-slp-17.c: Ditto.
+ * gcc.dg/vect/bb-slp-1.c: Ditto.
+ * gcc.dg/vect/bb-slp-26.c: Ditto.
+ * gcc.dg/vect/bb-slp-18.c: Ditto.
+ * gcc.dg/vect/bb-slp-2.c: Ditto.
+ * gcc.dg/vect/no-tree-reassoc-bb-slp-12.c: Ditto.
+ * gcc.dg/vect/bb-slp-27.c: Ditto.
+ * gcc.dg/vect/bb-slp-19.c: Ditto.
+ * gcc.dg/vect/bb-slp-3.c: Ditto.
+ * gcc.dg/vect/bb-slp-28.c: Ditto.
+ * gcc.dg/vect/bb-slp-4.c: Ditto.
+ * gcc.dg/vect/bb-slp-29.c: Ditto.
+ * gcc.dg/vect/bb-slp-5.c: Ditto.
+ * gcc.dg/vect/bb-slp-6.c: Ditto.
+ * gcc.dg/vect/bb-slp-8a.c: Ditto.
+ * gcc.dg/vect/bb-slp-7.c: Ditto.
+ * gcc.dg/vect/bb-slp-8b.c: Ditto.
+ * gcc.dg/vect/bb-slp-8.c: Ditto.
+ * gcc.dg/vect/bb-slp-9.c: Ditto.
+ * gcc.dg/vect/bb-slp-10.c: Ditto.
+ * gcc.dg/vect/bb-slp-11.c: Ditto.
+ * gcc.dg/vect/bb-slp-20.c: Ditto.
+ * gcc.dg/vect/bb-slp-cond-1.c: Ditto.
+ * gcc.dg/vect/bb-slp-21.c: Ditto.
+ * gcc.dg/vect/bb-slp-30.c: Ditto.
+ * gcc.dg/vect/bb-slp-13.c: Ditto.
+ * gcc.dg/vect/bb-slp-22.c: Ditto.
+ * g++.dg/vect/slp-pr50413.cc: Ditto.
+ * g++.dg/vect/slp-pr56812.cc: Ditto.
+ * g++.dg/vect/slp-pr50819.cc: Ditto.
+
+2013-06-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57456
+ * gfortran.dg/class_array_17.f90: New.
+
+2013-05-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ada/acats/floatstore.lst: New.
+ * ada/acats/run_all.sh: Process it.
+
+2013-05-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/powerpc/e500-ord-1.c: New test.
+ * gcc.target/powerpc/e500-ord-2.c: Likewise.
+ * gcc.target/powerpc/e500-unord-1.c: Likewise.
+ * gcc.target/powerpc/e500-unord-2.c: Likewise.
+
+2013-05-31 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * g++.dg/torture/pr54684.C: Add -fno-short-enums.
+
+2013-05-31 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * gcc.target/arm/pr56184.C: Add -fno-short-enums.
+
+2013-05-31 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * g++.old-deja/g++.robertl/eb76.C: Add -fno-short-enums.
+
+2013-05-31 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR c/57452
+ * c-c++-common/cilk-plus/AN/if_test.c: Fixed out of bounds issue in
+ test-case.
+
+2013-05-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/shrink-wrap-alloca.c: Use __builtin_alloca.
+
+2013-05-31 Marek Polacek <polacek@redhat.com>
+
+ PR tree-optimization/57478
+ PR tree-optimization/57453
+ * gcc.dg/torture/pr57478.c: New test.
+
+2013-05-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57456
+ * gfortran.dg/class_array_17.f90: New.
+
+2013-05-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/56315
+ * gcc.target/arm/iordi3-opt.c: New test.
+
+2013-05-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/54190
+ PR fortran/57217
+ * gfortran.dg/dummy_procedure_5.f90: Modified error message.
+ * gfortran.dg/interface_26.f90: Ditto.
+ * gfortran.dg/proc_ptr_11.f90: Ditto.
+ * gfortran.dg/proc_ptr_15.f90: Ditto.
+ * gfortran.dg/proc_ptr_comp_20.f90: Ditto.
+ * gfortran.dg/proc_ptr_comp_33.f90: Ditto.
+ * gfortran.dg/proc_ptr_result_5.f90: Ditto.
+ * gfortran.dg/typebound_override_1.f90: Ditto.
+ * gfortran.dg/typebound_override_4.f90: Ditto.
+ * gfortran.dg/typebound_proc_6.f03: Ditto.
+ * gfortran.dg/assumed_type_7.f90: New test.
+ * gfortran.dg/typebound_override_5.f90: New test.
+ * gfortran.dg/typebound_override_6.f90: New test.
+ * gfortran.dg/typebound_override_7.f90: New test.
+
2013-05-30 Tobias Burnus <burnus@net-b.de>
PR middle-end/57073
@@ -222,6 +887,10 @@
PR tree-optimization/57294
* gcc.dg/ipa/pr57294.c: New test.
+2013-05-24 Dehao Chen <dehao@google.com>
+
+ * gcc.dg/debug/dwarf2/discriminator.c: New Testcase.
+
2013-05-24 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/scalar_intrinsics.c
diff --git a/gcc/testsuite/ada/acats/floatstore.lst b/gcc/testsuite/ada/acats/floatstore.lst
new file mode 100644
index 00000000000..fe1746983e4
--- /dev/null
+++ b/gcc/testsuite/ada/acats/floatstore.lst
@@ -0,0 +1 @@
+cxg2021
diff --git a/gcc/testsuite/ada/acats/run_all.sh b/gcc/testsuite/ada/acats/run_all.sh
index 3d8aca91105..5ec3e13083c 100755
--- a/gcc/testsuite/ada/acats/run_all.sh
+++ b/gcc/testsuite/ada/acats/run_all.sh
@@ -225,6 +225,10 @@ for chapter in $chapters; do
if [ $? -eq 0 ]; then
extraflags="$extraflags -gnatE"
fi
+ grep $i $testdir/floatstore.lst > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ extraflags="$extraflags -ffloat-store"
+ fi
grep $i $testdir/stackcheck.lst > /dev/null 2>&1
if [ $? -eq 0 ]; then
extraflags="$extraflags -fstack-check"
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
index bdd271a7730..e4f1ea8a73a 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
@@ -3,23 +3,17 @@
#include <stdlib.h>
-int main2 (int argc, char **argv);
+int main2 (char **argv);
-int main(int argc, char **argv)
+int main(void)
{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
+ int x = 0;
+ const char *array[] = {"a.out", "5"};
+ x = main2 ((char **)array);
return x;
}
-int main2 (int argc, char **argv)
+int main2 (char **argv)
{
int array[10], ii = 0, x = 2, z= 0 , y = 0 ;
for (ii = 0; ii < 10; ii++)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
index bd7a4ad2b62..60f2de2834a 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
@@ -2,23 +2,17 @@
/* { dg-options "-fcilkplus" } */
#include <stdlib.h>
-int main2(int argc, char **argv);
-int main(int argc, char **argv)
+int main2 (char **argv);
+int main(void)
{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
+ int x = 0;
+ const char *array[] = {"a.out", "5"};
+ x = main2 ((char **)array);
return x;
}
-int main2(int argc, char **argv)
+int main2(char **argv)
{
int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
index 1431c22b261..e89bbab268b 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
@@ -2,28 +2,21 @@
/* { dg-options "-fcilkplus" } */
#include <stdlib.h>
-int main2(int argc, char **argv);
-int main(int argc, char **argv)
+int main2(char **argv);
+int main(void)
{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "10", "15"};
- x = main2 (3, (char **)array);
- }
- else if (argc == 3)
- x = main2 (argc, argv);
- else
- return 1;
-
+ int x = 0;
+ const char *array[] = {"a.out", "10", "15"};
+ x = main2 ((char **)array);
return x;
}
-int main2(int argc, char **argv)
+int main2(char **argv)
{
int array[10][15], ii = 0, jj = 0,x = 0, z= 1 , y = 10 ;
int array_2[10][15];
-
+ int argc = 3;
+ __asm volatile ("" : "+r" (argc));
for (ii = 0; ii < 10; ii++) {
for (jj = 0; jj< 15; jj++) {
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
index 8bdf1fd3ca1..c5d3d7c7530 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
@@ -16,7 +16,7 @@ double my_func (double x, double y)
/* char __sec_reduce_add (int *); */
-int main(int argc, char **argv)
+int main(void)
{
int ii,array[10], y = 0, y_int = 0, array2[10];
double x, yy, array3[10], array4[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
index 34cbd2c4cc3..7c194c2aa20 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
@@ -13,7 +13,7 @@ void my_func (double *x, double y)
}
-int main(int argc, char **argv)
+int main(void)
{
int ii,array[10], y = 0, y_int = 0, array2[10];
double x = 0.000, yy, array3[10], array4[10];
@@ -44,11 +44,11 @@ int main(int argc, char **argv)
max_value = array3[0] * array4[0];
for (ii = 0; ii < 10; ii++)
if (array3[ii] * array4[ii] > max_value) {
- max_value = array3[ii] * array4[ii];
max_index = ii;
}
-
+ for (ii = 0; ii < 10; ii++)
+ my_func (&max_value, array3[ii] * array4[ii]);
#if HAVE_IO
for (ii = 0; ii < 10; ii++)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
index c6b518e6229..0c05994ee30 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
@@ -4,7 +4,7 @@
/* #include <stdlib.h> */
/* char __sec_reduce_add (int *); */
-int main(int argc, char **argv)
+int main(void)
{
int ii,array[10], y = 0, y_int = 0, array2[10];
double x, yy, array3[10], array4[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
index c8a3ed7880f..7337a5106d9 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
@@ -5,8 +5,9 @@
#include <stdio.h>
#endif
-int main(int argc, char **argv)
+int main(void)
{
+ int argc = 1;
int ii,array[10], y = 0, y_int = 0, array2[10], y_int2=0, y2=0;
double x, yy, array3[10], array4[10];
int all_zero, all_nonzero, any_zero, any_nonzero;
@@ -20,6 +21,7 @@ int main(int argc, char **argv)
array3[ii] = (double) ii + 0.00;
array4[ii] = (double) (1.00000/ (double)(ii+1));
}
+ __asm volatile ("" : "+r" (argc));
y_int = __sec_reduce_any_nonzero (array3[:] + array[4]);
y_int2 = __sec_reduce_any_zero (array3[:] + array[4]);
y = __sec_reduce_all_nonzero ((array3[:] + array4[:]) * (argc-1));
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
index bcb3e1b1612..845d916ab96 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
@@ -3,25 +3,20 @@
#include <stdlib.h>
-int main2 (int argc, char **argv);
-int main(int argc, char **argv)
+int main2 (char **argv);
+int main(void)
{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
+ int x = 0;
+ const char *array[] = {"a.out", "5"};
+ x = main2 ((char **)array);
return x;
}
-int main2 (int argc, char **argv)
+int main2 (char **argv)
{
+ int argc = 2;
int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
-
+ __asm volatile ("" : "+r" (argc));
for (ii = 0; ii < 10; ii++)
array[ii] = 10;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
index 0be99b2102b..07c50173bfb 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
@@ -2,10 +2,12 @@
/* { dg-options "-fcilkplus" } */
#include <stdlib.h>
-int main(int argc, char **argv)
+int main(void)
{
+ int argc = 1;
short array[1000], array2[1000], *array3, cond[1000], ii = 0;
+ __asm volatile ("" : "+r" (argc));
for (ii = 0; ii < 1000; ii++) {
cond[ii] = 1;
array[ii] = 1000;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
index 4b2a09f48b0..00b018a2c85 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
@@ -17,7 +17,7 @@ int func (int *x)
#endif
return *x;
}
-int main (int argc, char **argv)
+int main (void)
{
char array[NUMBER], array2[NUMBER];
int ii, d = 2;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
index 8d208b92c8f..d9f39dd66a8 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
@@ -35,11 +35,13 @@ int func4(int x)
/* This program makes an assumption that argc == 1. */
-int main (int argc, char **argv)
+int main (void)
{
-
+ int argc = 1;
int array[2500];
+ /* This is done to make sure the compiler does not optimize out argc. */
+ __asm volatile ("" : "+r" (argc));
/* This should set array[0->999] to 5. */
array[argc-1:func2(++argc):1] = 5;
array[1000:500:1] = 10; /* set all variables in array[1000-->1499] to 10. */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
index 1010920b3aa..024a1589994 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
@@ -2,12 +2,13 @@
typedef int (*foo)(int);
-int main(int argc, char **argv)
+int main(void)
{
int array[10], array2[10][10];
foo func_array[10];
foo func_array2[10][10];
foo ***func_array_ptr;
+ int argc = 5;
array[:] = func_array[:](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
func_array[0:5](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
index cb504f309ed..b2ac7bcc85a 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
@@ -3,27 +3,12 @@
float q;
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
- return x;
-}
-
void func (int *x)
{
*x = 5;
}
-int main2 (int argc, char **argv)
+int main (void)
{
int array[10], array2[10];
array2[:] = array[1.5:2]; /* { dg-error "start-index of array notation triplet is not an integer" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
index f4283dbf11f..f425fbec0f5 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
@@ -1,10 +1,10 @@
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
extern int func (int);
int array[10][10], array2[10];
-
+ int argc = 1;
array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
index 67e1c19d6cc..b11a40ed325 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#endif
-int main(int argc, char **argv)
+int main(void)
{
int array[10][10], array2[10], array3[10], x = 0, y;
int x_correct, y_correct, ii, jj = 0;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
index b150b18f297..5544d4550aa 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
@@ -1,31 +1,29 @@
/* { dg-do run } */
/* { dg-options "-fcilkplus" } */
+#if HAVE_IO
+#include <stdio.h>
+#endif
#include <stdlib.h>
-int main2 (int argc, char **argv);
+int main2 (char **argv);
int main(int argc, char **argv)
{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "10", "15"};
- x = main2 (3, (char **) array);
- }
- else if (argc == 3)
- x = main2 (argc, argv);
- else
- return 1;
-
+ int x = 0;
+ const char *array[] = {"a.out", "10", "15"};
+ x = main2 ((char **) array);
return x;
}
-int main2 (int argc, char **argv)
+int main2 (char **argv)
{
int x = 3, y, z, array[10], array2[10], TwodArray[10][10], jj,kk,ll ;
- int array2_check[10];
- int FourDArray[10][10][10][10];
- int ii = 0;
+ int array2_check[10], array2d_check[10][10], array2d[10][10];
+ int FourDArray[10][10][10][10], array4[10][10][10][10];
+ int array4_check[10][10][10][10];
+ int ii = 0, argc = 3;
+
+ __asm volatile ("" : "+r" (argc));
for (ii = 0; ii < 10; ii++)
{
@@ -71,10 +69,6 @@ int main2 (int argc, char **argv)
if (array2_check[ii] != array2[ii])
return 3;
-
-
-
-
x = atoi (argv[1])-10;
y = atoi (argv[1])/2;
z = (atoi (argv[1]))/5;
@@ -110,14 +104,16 @@ int main2 (int argc, char **argv)
if (array2_check[ii] != array2[ii])
return 4;
- for (ii = 0; ii < 10; ii++)
+ for (ii = 0; ii < 10; ii++) {
array2[ii] = 10;
+ array2_check[ii] = 10;
+ }
/* This if loop will change all the 10's to 5's */
- if (array[atoi(argv[1])-10:atoi(argv[1]): atoi(argv[1])/5])
- array2[:] = 5;
+ if (array[atoi(argv[1])-10:atoi(argv[1])/2: atoi(argv[1])/5])
+ array2[atoi(argv[1])-10: atoi (argv[1])/2: atoi(argv[1])/5] = 5;
else
- array2[:] = 10;
+ array2[atoi(argv[1])-10: atoi (argv[1])/2: atoi(argv[1])/5] = 10;
for (ii = atoi(argv[1])-10; ii < atoi(argv[1]) + (atoi (argv[1])-10);
ii +=atoi(argv[1])/5)
@@ -127,9 +123,13 @@ int main2 (int argc, char **argv)
array2_check[ii] = 10;
for (ii = 0; ii < 10; ii++)
- if (array2_check[ii] != array2[ii])
+ if (array2_check[ii] != array2[ii]) {
+#if HAVE_IO
+ printf("array2[%2d] = %2d array2_check[%2d] = %2d\n", ii, array2[ii],
+ ii, array2_check[ii]);
+#endif
return 5;
-
+ }
for (ii = 0; ii < 10; ii++)
for (jj = 0; jj < 10; jj++)
@@ -137,29 +137,39 @@ int main2 (int argc, char **argv)
for (ii = 0; ii < 10; ii++)
- {
- array2[ii] = 10;
- array2_check[ii] = 10;
+ for (ii = 0; ii < 10; ii++) {
+ array2d[ii][jj] = 10;
+ array2d_check[ii][jj] = 10;
}
/* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
if (TwodArray[:][:] != 10)
- array2[:] = 10;
+ array2d[:][:] = 10;
else
- array2[:] = 5;
+ array2d[:][:] = 5;
for (ii = 0; ii < 10; ii++) {
for (jj = 0; jj < 10; jj++) {
if (TwodArray[ii][jj] != 10)
- array2_check[ii] = 10;
+ array2d_check[ii][jj] = 10;
+ else
+ array2d_check[ii][jj] = 5;
}
}
for (ii = 0; ii < 10; ii++)
- {
- array2[ii] = 10;
- array2_check[ii] = 10;
- }
+ for (jj = 0; jj < 10; jj++)
+ if (array2d[ii][jj] != array2d_check[ii][jj])
+ return 6;
+
+ for (ii = 0; ii < 10; ii++)
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ {
+ array4[ii][jj][kk][ll] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
+ }
for (ii = 0; ii < 10; ii++)
for (jj = 0; jj < 10; jj++)
@@ -169,26 +179,38 @@ int main2 (int argc, char **argv)
/* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
if (FourDArray[:][:][:][:] != 10)
- array2[:] = 10;
+ array4[:][:][:][:] = 10;
else
- array2[:] = 5;
+ array4[:][:][:][:] = 5;
for (ii = 0; ii < 10; ii++) {
for (jj = 0; jj < 10; jj++) {
for (kk = 0; kk < 10; kk++) {
for (ll = 0; ll < 10; ll++) {
if (FourDArray[ii][jj][kk][ll] != 10)
- array2_check[ii] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
+ else
+ array4_check[ii][jj][kk][ll] = 5;
}
}
}
}
-
+
for (ii = 0; ii < 10; ii++)
- {
- array2[ii] = 10;
- array2_check[ii] = 10;
- }
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll])
+ return 7;
+
+ for (ii = 0; ii < 10; ii++)
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ {
+ array4[ii][jj][kk][ll] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
+ }
for (ii = 0; ii < 10; ii++)
for (jj = 0; jj < 10; jj++)
@@ -197,54 +219,88 @@ int main2 (int argc, char **argv)
FourDArray[ii][jj][kk][ll] = atoi(argv[1]);
/* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] != 10)
- array2[:] = 10;
+ if (FourDArray[0:10:1][0:5:2][9:10:-1][0:5:2] != 10)
+ array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 10;
else
- array2[:] = 5;
+ array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 5;
for (ii = 0; ii < 10; ii++) {
for (jj = 0; jj < 10; jj += 2) {
for (kk = 9; kk >= 0; kk--) {
- for (ll = x; ll < 10; ll = ll += z) {
+ for (ll = 0; ll < 10; ll += 2) {
if (FourDArray[ii][jj][kk][ll] != 10)
- array2_check[ii] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
else
- array2_check[ii] = 5;
+ array4_check[ii][jj][kk][ll] = 5;
}
}
}
}
for (ii = 0; ii < 10; ii++)
- {
- array2[ii] = 10;
- array2_check[ii] = 10;
- }
-
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll]) {
+#if HAVE_IO
+ printf("array4_check[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
+ array4_check[ii][jj][kk][ll]);
+ printf("array4[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
+ array4[ii][jj][kk][ll]);
+#endif
+ return 8;
+ }
+
for (ii = 0; ii < 10; ii++)
for (jj = 0; jj < 10; jj++)
for (kk = 0; kk < 10; kk++)
for (ll = 0; ll < 10; ll++)
FourDArray[ii][jj][kk][ll] = atoi(argv[1]);
+
+ for (ii = 0; ii < 10; ii++)
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ {
+ array4[ii][jj][kk][ll] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
+ }
+
/* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
if (FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] +
FourDArray[0:10:1][0:5:2][9:-10:1][x:y:z] != 20)
- array2[:] = 10;
+ array4[0:10:1][0:5:2][9:10:-1][x:y:z] = 10;
else
- array2[:] = 5;
+ array4[0:10][0:5:2][9:10:-1][x:y:z] = 5;
for (ii = 0; ii < 10; ii++) {
for (jj = 0; jj < 10; jj += 2) {
for (kk = 9; kk >= 0; kk--) {
- for (ll = x; ll < 10; ll = ll += z) {
+ for (ll = 0; ll < 10; ll += 2) {
if (FourDArray[ii][jj][kk][ll] != 10)
- array2_check[ii] = 10;
+ array4_check[ii][jj][kk][ll] = 10;
else
- array2_check[ii] = 5;
+ array4_check[ii][jj][kk][ll] = 5;
}
}
}
}
+
+ for (ii = 0; ii < 10; ii++)
+ for (jj = 0; jj < 10; jj++)
+ for (kk = 0; kk < 10; kk++)
+ for (ll = 0; ll < 10; ll++)
+ if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll]) {
+#if HAVE_IO
+ printf("array4_check[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
+ array4_check[ii][jj][kk][ll]);
+ printf("array4[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
+ array4[ii][jj][kk][ll]);
+#endif
+ return 9;
+ }
+
+
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c
new file mode 100644
index 00000000000..d17d8cf5de2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+#include <stdlib.h>
+int main (void)
+{
+ int x = 3, y, z, array[10], array2[10], TwodArray[10][10], jj,kk,ll ;
+ int array2_check[10], array2d_check[10][10], array2d[10][10];
+ int FourDArray[10][10][10][10], array4[10][10][10][10];
+ int array4_check[10][10][10][10];
+ int ii = 0;
+
+ x = 5;
+ y = 10;
+ z = 2;
+
+ if (!array[:]) /* This is OK! */
+ array2[:] = 5;
+ else
+ array2[:] = 10;
+ if (!(array[0:10:1] + array[0:10:1])) /* { dg-error "condition and the then-block" } */
+ array2d[:][:] = 5;
+ else
+ array2[:] = 10;
+
+ if (!(array[0:10:1] + array[0:10:1])) /* { dg-error "condition and the else-block" } */
+ array2[:] = 5;
+ else
+ array2d[:][:] = 10;
+
+
+ if (TwodArray[:][:] != 10) /* { dg-error "condition and the then-block" } */
+ array2[:] = 10;
+ else
+ array2[:] = 5;
+
+ if (FourDArray[43][:][:][:] != 10) /* This is OK! */
+ array4[45][:][:][:] = 10;
+ else
+ array4[32][:][:][:] = 5;
+
+ /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
+ if (FourDArray[42][0:10:1][9:10:-1][0:5:2] != 10) /* { dg-error "condition and the then-block" } */
+ array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 10;
+ else
+ array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 5;
+
+ /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
+ if (FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] +
+ FourDArray[0:10:1][0:5:2][9:-10:1][x:y:z] != 20)
+ array4[0:10:1][0:5:2][9:10:-1][x:y:z] = 10;
+ else
+ array4[0:10][0:5:2][9:10:-1][x:y:z] = 5;
+
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
index 891e1dc5559..35eb11537d1 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
int array[10], array2[10][10];
int x, ii, jj ;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
index 7b1aa89517f..a0a3742f5df 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
index 8bf2282088e..2e86b4f92da 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
index 824e18660fd..34dfa16dd81 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
index 25a8a8fb62c..eba28a81ce3 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c
new file mode 100644
index 00000000000..ac11b9209b1
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+/* Test-case contains no array notation but is compiled with -fcilkplus.
+ It will still print the too few arguments func, thereby saying the
+ if-statement after the for-loop to check for !flag_enable_cilkplus ||
+ !is_cilkplus_reduce_function (fundecl) is not valid is always taken. */
+
+int func (int, int); /* { dg-message "declared here" } */
+
+int main (void)
+{
+ int a = 5, b = 2;
+ return func (a); /* { dg-error "too few arguments to function" } */
+}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c
new file mode 100644
index 00000000000..68a1fd81185
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+/* This test has no array notation components in it and thus should compile
+ fine without crashing. */
+
+typedef unsigned int size_t;
+typedef int (*__compar_fn_t) (const void *, const void *);
+extern void *bsearch (const void *__key, const void *__base,
+ size_t __nmemb, size_t __size, __compar_fn_t
+ __compar)
+ __attribute__ ((__nonnull__ (1, 2, 5))) ;
+extern __inline __attribute__ ((__gnu_inline__)) void *
+bsearch (const void *__key, const void *__base, size_t __nmemb, size_t
+ __size,
+ __compar_fn_t __compar)
+{
+ size_t __l, __u, __idx;
+ const void *__p;
+ int __comparison;
+ __l = 0;
+ __u = __nmemb;
+ while (__l < __u)
+ {
+ __idx = (__l + __u) / 2;
+ __p = (void *) (((const char *) __base) +
+ (__idx * __size));
+ __comparison = (*__compar) (__key,
+ __p);
+ if (__comparison < 0)
+ __u = __idx;
+ else if (__comparison > 0)
+ __l = __idx + 1;
+ else
+ return (void *)
+ __p;
+ }
+ return ((void *)0);
+}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c
new file mode 100755
index 00000000000..cabdb2376e6
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+int A[10];
+
+int main () {
+ char c = (char)N; /* { dg-error "undeclared" } */
+ short s = (short)N;
+ long l = (long)N;
+ A[l:s:c];
+}
+
+/* { dg-message "note: each" "defined" { target *-*-* } 7 } */
+
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c
new file mode 100644
index 00000000000..fb3490efa82
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+int A[10], B[10][10];
+int foo (int a);
+
+int main () {
+ A[:] = foo (B[:][:]); /* { dg-error "rank mismatch between" } */
+ A[0] = foo (B[:][:]); /* { dg-error "cannot be scalar when" } */
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
index a8c9dab5673..b5e37ced12d 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
@@ -1,7 +1,10 @@
/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
+/* { dg-options "-fcilkplus -w" } */
-int main (int argc, char **argv)
+/* We use -w because in the first error, there will be a warning of setting an
+ integer to a pointer. Just ignore it to expose the rank mismatch error. */
+
+int main (void)
{
int x = 0;
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
index 74fece4d172..4a4882dbae6 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
@@ -7,10 +7,10 @@ int function_call (int x)
return x;
}
-int main(int argc, char **argv)
+int main (void)
{
int array[100], array2[100][100];
-
+ int argc = 4;
array[:] = array[:] + array2[:][:]; /* { dg-error "rank mismatch between" } */
if (array[:] + array2[:][:]) /* { dg-error "rank mismatch between" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
index fe66cf87be0..bacbf350566 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
@@ -1,22 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
- return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
index 29f8c32d4a0..0aef0c29aca 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
@@ -1,25 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char**)array);
- }
- else
- x = main2 (argc, argv);
-
- return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
{
+ int argc = 2;
int array[10][10], array2[10];
-
+ __asm volatile ("" : "+r" (argc));
array[:][:] = __sec_implicit_index(argc) + array[:][:]; /* { dg-error "__sec_implicit_index parameter" } */
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
index c5f7cdf18e7..4912e6c6ce5 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
@@ -1,11 +1,7 @@
/* { dg-do run } */
/* { dg-options "-fcilkplus" } */
-void abort (void);
-void exit (int);
-
-
-int main(int argc, char **argv)
+int main(void)
{
int jj, kk, array_3C[10][10][10];
int ii,array[10], y = 0, y_int = 0, array2[10], array_3[10][10][10];
@@ -24,10 +20,7 @@ int main(int argc, char **argv)
for (jj = 0; jj < 10; jj++)
for (kk = 0; kk < 10; kk++)
if (array_3[ii][jj][kk] != array_3C[ii][jj][kk])
- abort ();
+ return 1;
-
- exit (0);
-
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
index 4bd6030a61d..9652e1594b4 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
@@ -1,22 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
-int main2 (int argc, char **argv);
-int main (int argc, char **argv)
-{
- int x = 0;
- if (argc == 1)
- {
- const char *array[] = {"a.out", "5"};
- x = main2 (2, (char **)array);
- }
- else
- x = main2 (argc, argv);
-
- return x;
-}
-
-int main2 (int argc, char **argv)
+int main (void)
{
int array[10][10], array2[10];
int x, y;
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
index a72cfafba1c..034017146f3 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
@@ -11,10 +11,12 @@ int mult_all (int *my_array, int size)
return __sec_reduce_mul (my_array[0:size]);
}
-int main (int argc, char **argv)
+int main (void)
{
+ int argc = 1;
int array[10000];
-
+
+ __asm volatile ("" : "+r" (argc));
array[:] = argc; /* All elements should be one. */
if (add_all (array, 10000) != 10000)
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
index 0df324a80d4..b9f9f8d6507 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
@@ -28,11 +28,13 @@ int func4 (int *a1, int *a2)
{
return a1[NUMBER-1] * (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) + a2[0] + a2[1] + a2[3])/a1[NUMBER-2];
}
-int main(int argc, char **argv)
+int main(void)
{
int array[NUMBER], array2[NUMBER];
int return_value = 0;
int ii = 0;
+ int argc = 1;
+ __asm volatile ("" : "+r" (argc));
for (ii = 0; ii < NUMBER; ii++)
{
array[ii] = argc; /* This should calculate to 1. */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
index 038ae482df8..843745e384f 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
@@ -5,8 +5,10 @@ int func (int x)
{
return x++;
}
-int main(int argc, char **argv)
+int main(void)
{
+ int argc = 1;
+ __asm volatile ("" : "+r" (argc));
int array[argc];
array[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in variable-length arrays." } */
diff --git a/gcc/testsuite/g++.dg/abi/abi-tag5.C b/gcc/testsuite/g++.dg/abi/abi-tag5.C
new file mode 100644
index 00000000000..de5580239dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/abi-tag5.C
@@ -0,0 +1,6 @@
+// { dg-options -Wabi-tag }
+
+struct __attribute__ ((abi_tag ("foo"))) A { };
+template <class T> struct B: T { };
+
+B<A> b;
diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C
index 7a9c35964f7..0e6be28bd4f 100644
--- a/gcc/testsuite/g++.dg/abi/forced.C
+++ b/gcc/testsuite/g++.dg/abi/forced.C
@@ -1,5 +1,4 @@
-// This test only applies to glibc (NPTL) targets.
-// { dg-do run { target *-*-linux* } }
+// { dg-do run { target *-*-linux* *-*-gnu* } }
// { dg-options "-pthread" }
#include <pthread.h>
diff --git a/gcc/testsuite/g++.dg/abi/guard2.C b/gcc/testsuite/g++.dg/abi/guard2.C
index 988fd385bf9..c35fa7e1c82 100644
--- a/gcc/testsuite/g++.dg/abi/guard2.C
+++ b/gcc/testsuite/g++.dg/abi/guard2.C
@@ -1,6 +1,6 @@
// PR c++/41611
// Test that the guard gets its own COMDAT group.
-// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* } } }
+// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* } } }
struct A {
static int f()
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C
new file mode 100644
index 00000000000..dd3a422c2a2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C
@@ -0,0 +1,6 @@
+// PR c++/53658
+// { dg-do compile { target c++11 } }
+
+struct A;
+template <typename> using Foo = const A;
+template <typename Item> Foo <Item> bar();
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C
index 0536b356185..a6aa34eb2f5 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C
@@ -2,7 +2,7 @@
// { dg-options -std=c++0x }
// { dg-additional-options -G0 { target { { alpha*-*-* frv*-*-* ia64-*-* lm32*-*-* m32r*-*-* microblaze*-*-* mips*-*-* powerpc*-*-* rs6000*-*-* score*-*-* } && { ! { *-*-darwin* *-*-aix* alpha*-*-*vms* } } } } }
// { dg-final { scan-assembler "\\.rdata" { target mips*-*-* } } }
-// { dg-final { scan-assembler "rodata" { target { { *-*-linux-gnu || *-*-elf } && { ! mips*-*-* } } } } }
+// { dg-final { scan-assembler "rodata" { target { { *-*-linux-gnu *-*-gnu* *-*-elf } && { ! mips*-*-* } } } } }
struct Data
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype54.C b/gcc/testsuite/g++.dg/cpp0x/decltype54.C
new file mode 100644
index 00000000000..9d301c0a739
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype54.C
@@ -0,0 +1,26 @@
+// PR c++/51908
+// { dg-do compile { target c++11 } }
+
+struct foo1
+{
+ template <typename Ret, typename... Args>
+ operator decltype(static_cast<Ret (*)(Args...)>(nullptr)) () const;
+};
+
+struct foo2
+{
+ template <typename Ret, typename... Args>
+ operator decltype(static_cast<Ret (*)(Args... args)>(nullptr)) () const;
+};
+
+struct foo3
+{
+ template <typename Ret, typename Arg>
+ operator decltype(static_cast<Ret (*)(Arg)>(nullptr)) () const;
+};
+
+struct foo4
+{
+ template <typename Ret, typename Arg>
+ operator decltype(static_cast<Ret (*)(Arg arg)>(nullptr)) () const;
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted13.C b/gcc/testsuite/g++.dg/cpp0x/defaulted13.C
index 8b23579217e..5ddbcb38c1c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted13.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted13.C
@@ -7,13 +7,13 @@ struct NonCopyable {
};
template<>
-NonCopyable<int>::NonCopyable(NonCopyable<int> const&) = delete; // { dg-error "declared" }
+NonCopyable<int>::NonCopyable(NonCopyable<int> const&) = delete; // { dg-message "declared" }
template<typename T>
NonCopyable<T>::NonCopyable(NonCopyable<T> const&) = default;
template<>
-NonCopyable<double>::NonCopyable(NonCopyable<double> const&) = delete; // { dg-error "declared" }
+NonCopyable<double>::NonCopyable(NonCopyable<double> const&) = delete; // { dg-message "declared" }
int main()
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
index e3aac8f1a9f..ce551a3fee2 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
@@ -42,7 +42,7 @@ struct E
struct F
{
F() = default;
- F(const F&) = delete; // { dg-error "declared" }
+ F(const F&) = delete; // { dg-message "declared" }
};
struct G
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted26.C b/gcc/testsuite/g++.dg/cpp0x/defaulted26.C
index 69bd0accbd4..746fa908180 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted26.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted26.C
@@ -1,7 +1,7 @@
// PR c++/49066
// { dg-options -std=c++0x }
-void foo() = delete; // { dg-error "declared here" }
+void foo() = delete; // { dg-message "declared here" }
void foo();
int main() { foo(); } // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted3.C b/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
index 5e2116b53b3..bc5b14d2d59 100644
--- a/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
@@ -4,7 +4,7 @@
template<class T>
struct A {
template<class U>
- bool operator==(const A<U>&) = delete; // { dg-error "declared" }
+ bool operator==(const A<U>&) = delete; // { dg-message "declared" }
operator bool () { return true; }
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/dyncast1.C b/gcc/testsuite/g++.dg/cpp0x/dyncast1.C
new file mode 100644
index 00000000000..1224f361ff3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/dyncast1.C
@@ -0,0 +1,31 @@
+// PR c++/57599
+// { dg-do compile { target c++11 } }
+
+struct A { };
+struct B : public A { };
+
+template<class, class>
+struct is_same { static constexpr bool value = false; };
+
+template<class T>
+struct is_same<T, T> { static constexpr bool value = true; };
+
+template<class T>
+T val();
+
+static_assert(is_same<decltype(dynamic_cast<A*>(val<B*>())),
+ A*>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<A&>(val<B&>())),
+ A&>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<const A*>(val<B*>())),
+ const A*>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<const A&>(val<B&>())),
+ const A&>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<volatile A*>(val<B*>())),
+ volatile A*>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<volatile A&>(val<B&>())),
+ volatile A&>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<const volatile A*>(val<B*>())),
+ const volatile A*>::value, "Ouch");
+static_assert(is_same<decltype(dynamic_cast<const volatile A&>(val<B&>())),
+ const volatile A&>::value, "Ouch");
diff --git a/gcc/testsuite/g++.dg/cpp0x/error1.C b/gcc/testsuite/g++.dg/cpp0x/error1.C
index 751b3b75e0c..15cd38f8807 100644
--- a/gcc/testsuite/g++.dg/cpp0x/error1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/error1.C
@@ -2,7 +2,7 @@
// { dg-do compile }
// { dg-options "-std=c++0x" }
-template<int... N> void foo (int... x[N]) // { dg-error "int \\\[N\\\]\\.\\.\\. x" }
+template<int... N> void foo (int... x[N]) // { dg-message "int \\\[N\\\]\\.\\.\\. x" }
{
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit1.C b/gcc/testsuite/g++.dg/cpp0x/implicit1.C
index 2efbde6a93a..e4e16e1ad35 100644
--- a/gcc/testsuite/g++.dg/cpp0x/implicit1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit1.C
@@ -15,7 +15,7 @@ D d; // { dg-error "deleted" }
struct E
{
- ~E() = delete; // { dg-error "declared here" }
+ ~E() = delete; // { dg-message "declared here" }
};
struct F
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit11.C b/gcc/testsuite/g++.dg/cpp0x/implicit11.C
index 7ec8e95dcb6..c974e2b7761 100644
--- a/gcc/testsuite/g++.dg/cpp0x/implicit11.C
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit11.C
@@ -4,7 +4,7 @@
struct A
{
- ~A() = delete; // { dg-error "declared here" }
+ ~A() = delete; // { dg-message "declared here" }
};
struct B: A { }; // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C
index 2e18e5d62f3..95cf932d001 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C
@@ -8,7 +8,7 @@ struct A
struct C
{
- C() = delete; // { dg-error "declared here" }
+ C() = delete; // { dg-message "declared here" }
};
struct B: A, C
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist47.C b/gcc/testsuite/g++.dg/cpp0x/initlist47.C
index b76fb58361f..06d683e038a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist47.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist47.C
@@ -1,6 +1,6 @@
// { dg-options -std=c++0x }
-struct A { ~A() = delete; }; // { dg-error "declared" }
+struct A { ~A() = delete; }; // { dg-message "declared" }
int main()
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist9.C b/gcc/testsuite/g++.dg/cpp0x/initlist9.C
index d596b391508..197fdd4ad04 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist9.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist9.C
@@ -8,7 +8,7 @@ struct b
b() = default;
~b() = default;
b& operator=(const b&) = delete;
- b(const b&) = delete; // { dg-error "declared" }
+ b(const b&) = delete; // { dg-message "declared" }
b(bool _t): t (_t) { }
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc.C
index f4766691eec..92c54313874 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc.C
@@ -5,7 +5,7 @@
struct A
{
A();
- A(const A& a) = delete; // { dg-error "declared" }
+ A(const A& a) = delete; // { dg-message "declared" }
};
int main()
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
index f94d64ec0ea..213f7c0babf 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
@@ -3,7 +3,7 @@
struct A {
A();
- A(const A&) = delete; // { dg-error "declared" }
+ A(const A&) = delete; // { dg-message "declared" }
};
template <class T>
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C
index c735b9e5359..db5b5c7f3d7 100644
--- a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C
@@ -9,11 +9,11 @@ template<class Tp>
Tp elem; // { dg-error "incomplete type" }
constexpr single(const Tp& e)
- : elem(e) { } // { dg-error "invalid field" }
+ : elem(e) { }
single(single&& s)
noexcept(std::is_nothrow_move_constructible<Tp>::value)
- : elem(s.elem) { } // { dg-error "invalid field|no member" }
+ : elem(s.elem) { }
};
template<class Tp>
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C
index 9b84c8c3ded..2330365f7ce 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C
@@ -3,6 +3,6 @@
int main()
{
- int q = 1; // { dg-error "declared here" }
+ int q = 1; // { dg-message "declared here" }
struct test { int x = q; } instance; // { dg-error "local variable" }
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C
index b45fe8392a7..069232755f9 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C
@@ -1,5 +1,5 @@
// PR c++/52377
-// { dg-do run { target c++11 } }
+// { dg-require-effective-target c++11 }
union A // { dg-error "multiple" }
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr52440.C b/gcc/testsuite/g++.dg/cpp0x/pr52440.C
new file mode 100644
index 00000000000..0210f53b9d9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr52440.C
@@ -0,0 +1,27 @@
+// PR c++/52440
+// { dg-do compile { target c++11 } }
+
+template<bool>
+struct V
+{
+ typedef void type;
+};
+
+template<typename T>
+struct X
+{
+ template<typename>
+ static constexpr bool always_true()
+ {
+ return true;
+ }
+
+ template<typename U,
+ typename = typename V<always_true<U>()>::type>
+ X(U &&) {}
+};
+
+int main()
+{
+ X<int> x(42);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae46.C b/gcc/testsuite/g++.dg/cpp0x/sfinae46.C
new file mode 100644
index 00000000000..20e859c23ee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae46.C
@@ -0,0 +1,13 @@
+// PR c++/57419
+// { dg-do compile { target c++11 } }
+
+template< typename q >
+decltype( &q::f ) t( q ) {}
+
+char t( ... ) { return {}; }
+
+class c { void f() = delete; };
+class d { static void f() = delete; };
+
+static_assert( sizeof( t( c() ) ), "c" );
+static_assert( sizeof( t( d() ) ), "d" );
diff --git a/gcc/testsuite/g++.dg/cpp0x/union4.C b/gcc/testsuite/g++.dg/cpp0x/union4.C
index 07050475d36..c82a81cdba8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/union4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/union4.C
@@ -3,7 +3,7 @@
struct SFoo
{
- SFoo() =delete; // { dg-error "declared" }
+ SFoo() =delete; // { dg-message "declared" }
};
union UFoo // { dg-error "deleted" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/vla7.C b/gcc/testsuite/g++.dg/cpp1y/vla7.C
new file mode 100644
index 00000000000..df34c8219db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/vla7.C
@@ -0,0 +1,12 @@
+// PR c++/55520
+// { dg-options "-Wno-vla" }
+// { dg-require-effective-target c++11 }
+
+int main(int argc, char** argv)
+{
+ int x[1][argc];
+
+ [&x](int i) { // { dg-error "variable.size" }
+ x[0][i] = 0; // { dg-prune-output "assignment" }
+ }(5);
+}
diff --git a/gcc/testsuite/g++.dg/eh/sighandle.C b/gcc/testsuite/g++.dg/eh/sighandle.C
index e516ad0a483..5c4995e7677 100644
--- a/gcc/testsuite/g++.dg/eh/sighandle.C
+++ b/gcc/testsuite/g++.dg/eh/sighandle.C
@@ -1,4 +1,4 @@
-// { dg-do run { target { *-*-aix5* i?86-*-linux* x86_64-*-linux* } } }
+// { dg-do run { target { *-*-aix5* i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }
// { dg-options "-fexceptions -fnon-call-exceptions" }
#include <signal.h>
diff --git a/gcc/testsuite/g++.dg/ext/builtin-offsetof1.C b/gcc/testsuite/g++.dg/ext/builtin-offsetof1.C
new file mode 100644
index 00000000000..5c5e9cf246b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/builtin-offsetof1.C
@@ -0,0 +1,9 @@
+// PR c++/51413
+// { dg-options "-w" }
+
+struct A
+{
+ static void foo();
+};
+
+int i = __builtin_offsetof(A, foo[1]); // { dg-error "neither a single identifier nor a sequence of member accesses and array references" }
diff --git a/gcc/testsuite/g++.dg/ext/cleanup-10.C b/gcc/testsuite/g++.dg/ext/cleanup-10.C
index eeb607b2988..66c7b76bb6b 100644
--- a/gcc/testsuite/g++.dg/ext/cleanup-10.C
+++ b/gcc/testsuite/g++.dg/ext/cleanup-10.C
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through signal frames
on alternate stack. */
diff --git a/gcc/testsuite/g++.dg/ext/cleanup-11.C b/gcc/testsuite/g++.dg/ext/cleanup-11.C
index 0b6d11ce26d..6e965214127 100644
--- a/gcc/testsuite/g++.dg/ext/cleanup-11.C
+++ b/gcc/testsuite/g++.dg/ext/cleanup-11.C
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through realtime signal
frames on alternate stack. */
diff --git a/gcc/testsuite/g++.dg/ext/cleanup-8.C b/gcc/testsuite/g++.dg/ext/cleanup-8.C
index be667684898..ccf9bef6816 100644
--- a/gcc/testsuite/g++.dg/ext/cleanup-8.C
+++ b/gcc/testsuite/g++.dg/ext/cleanup-8.C
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through signal
frames. */
diff --git a/gcc/testsuite/g++.dg/ext/cleanup-9.C b/gcc/testsuite/g++.dg/ext/cleanup-9.C
index 87f82839988..dcdfcae0da7 100644
--- a/gcc/testsuite/g++.dg/ext/cleanup-9.C
+++ b/gcc/testsuite/g++.dg/ext/cleanup-9.C
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through realtime
signal frames. */
diff --git a/gcc/testsuite/g++.dg/ext/pr57548.C b/gcc/testsuite/g++.dg/ext/pr57548.C
new file mode 100644
index 00000000000..1cc728d294c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/pr57548.C
@@ -0,0 +1,25 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-ifunc "" } */
+
+int fum (); // Extra declaration that is merged with the second one.
+int fum () __attribute__ ((target("default")));
+
+
+int fum () __attribute__((target( "mmx")));
+int fum () __attribute__((target( "popcnt")));
+int fum () __attribute__((target( "sse")));
+int fum () __attribute__((target( "sse2")));
+int fum () __attribute__((target( "sse3")));
+int fum () __attribute__((target( "ssse3")));
+int fum () __attribute__((target( "sse4.1")));
+int fum () __attribute__((target( "sse4.2")));
+int fum () __attribute__((target( "avx")));
+int fum () __attribute__((target( "avx2")));
+
+int fum () __attribute__((target("arch=core2")));
+int fum () __attribute__((target("arch=corei7")));
+int fum () __attribute__((target("arch=atom")));
+
+int (*p)() = &fum;
+
+int j = fum();
diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon6.C b/gcc/testsuite/g++.dg/ext/visibility/anon6.C
index 951de4964e4..c55432add86 100644
--- a/gcc/testsuite/g++.dg/ext/visibility/anon6.C
+++ b/gcc/testsuite/g++.dg/ext/visibility/anon6.C
@@ -1,9 +1,11 @@
// PR c++/33094
// { dg-final { scan-assembler "1BIiE1cE" } }
// { dg-final { scan-assembler-not "globl.*1BIiE1cE" } }
-// { dg-final { scan-assembler-not "1CIiE1cE" } }
+// { dg-final { scan-assembler-not "comdat" } }
+// { dg-final { scan-assembler-not "weak" } }
+// { dg-final { scan-assembler-not "1AIiE1cE" } }
-// Test that B<int>::c is emitted as an internal symbol, and C<int>::c is
+// Test that B<int>::c is emitted as an internal symbol, and A<int>::c is
// not emitted.
namespace
@@ -18,7 +20,7 @@ namespace
template <typename T>
class B
{
- static const T c = 0;
+ __attribute__ ((__used__)) static const T c = 0;
};
template <typename T> const T B<T>::c;
diff --git a/gcc/testsuite/g++.dg/init/array26.C b/gcc/testsuite/g++.dg/init/array26.C
index 83c4e0c4a4d..f8f3c3743fc 100644
--- a/gcc/testsuite/g++.dg/init/array26.C
+++ b/gcc/testsuite/g++.dg/init/array26.C
@@ -8,4 +8,4 @@ struct B
A a; // { dg-error "incomplete type" }
};
-B b[1] = (B[]) { 0 }; // { dg-error "initializer" }
+B b[1] = (B[]) { 0 };
diff --git a/gcc/testsuite/g++.dg/opt/const5.C b/gcc/testsuite/g++.dg/opt/const5.C
index 3785271a083..68fe61628bc 100644
--- a/gcc/testsuite/g++.dg/opt/const5.C
+++ b/gcc/testsuite/g++.dg/opt/const5.C
@@ -1,7 +1,7 @@
// We don't have a good way of determining how ".rodata" is spelled on
// all targets, so we limit this test to a few common targets where we
// do know the spelling.
-// { dg-do compile { target i?86-*-linux* x86_64-*-linux* } }
+// { dg-do compile { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } }
// { dg-final { scan-assembler "\\.rodata" } }
template <typename T>
diff --git a/gcc/testsuite/g++.dg/opt/life1.C b/gcc/testsuite/g++.dg/opt/life1.C
index dd840f9abec..9b8a61aa90d 100644
--- a/gcc/testsuite/g++.dg/opt/life1.C
+++ b/gcc/testsuite/g++.dg/opt/life1.C
@@ -1,6 +1,6 @@
// This testcase did not set up the pic register on IA-32 due
// to bug in calculate_global_regs_live EH edge handling.
-// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } }
+// { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } }
// { dg-require-effective-target fpic }
// { dg-options "-O2 -fPIC" }
diff --git a/gcc/testsuite/g++.dg/other/pr39496.C b/gcc/testsuite/g++.dg/other/pr39496.C
index e535ee0d69b..c9e55df436f 100644
--- a/gcc/testsuite/g++.dg/other/pr39496.C
+++ b/gcc/testsuite/g++.dg/other/pr39496.C
@@ -1,5 +1,5 @@
// PR target/39496
-// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } }
+// { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } }
// { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -mtune=i686 -msse2 -mfpmath=sse" }
// Verify that {foo,bar}{,2}param are all passed on the stack, using
diff --git a/gcc/testsuite/g++.dg/other/vararg-4.C b/gcc/testsuite/g++.dg/other/vararg-4.C
new file mode 100644
index 00000000000..e242cfceffb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/vararg-4.C
@@ -0,0 +1,12 @@
+// PR c++/37404
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef __gnuc_va_list va_list;
+
+template <class> struct S { static void foo () { } };
+template <class T, int N>
+struct S<T [N]> { static void foo () { T(); } };
+
+int main () {
+ S<va_list>::foo();
+}
diff --git a/gcc/testsuite/g++.dg/parse/error53.C b/gcc/testsuite/g++.dg/parse/error53.C
new file mode 100644
index 00000000000..3d6fe64c1d8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error53.C
@@ -0,0 +1,3 @@
+// PR c++/43652
+
+static const char const * stdin_name = "<stdin>"; // { dg-error "19:duplicate" }
diff --git a/gcc/testsuite/g++.dg/rtti/dyncast6.C b/gcc/testsuite/g++.dg/rtti/dyncast6.C
new file mode 100644
index 00000000000..a6329e9441c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/dyncast6.C
@@ -0,0 +1,59 @@
+// PR c++/57599
+
+class A { };
+
+class B : public A { };
+
+void p()
+{
+ B* b;
+
+ A* a1;
+ a1 = dynamic_cast<A*>(b);
+ a1 = dynamic_cast<const A*>(b); // { dg-error "invalid" }
+ a1 = dynamic_cast<volatile A*>(b); // { dg-error "invalid" }
+ a1 = dynamic_cast<const volatile A*>(b); // { dg-error "invalid" }
+
+ const A* a2;
+ a2 = dynamic_cast<A*>(b);
+ a2 = dynamic_cast<const A*>(b);
+ a2 = dynamic_cast<volatile A*>(b); // { dg-error "invalid" }
+ a2 = dynamic_cast<const volatile A*>(b); // { dg-error "invalid" }
+
+ volatile A* a3;
+ a3 = dynamic_cast<A*>(b);
+ a3 = dynamic_cast<const A*>(b); // { dg-error "invalid" }
+ a3 = dynamic_cast<volatile A*>(b);
+ a3 = dynamic_cast<const volatile A*>(b); // { dg-error "invalid" }
+
+ const volatile A* a4;
+ a4 = dynamic_cast<A*>(b);
+ a4 = dynamic_cast<const A*>(b);
+ a4 = dynamic_cast<volatile A*>(b);
+ a4 = dynamic_cast<const volatile A*>(b);
+}
+
+void r()
+{
+ B b;
+
+ A& a1 = dynamic_cast<A&>(b);
+ A& a2 = dynamic_cast<const A&>(b); // { dg-error "invalid" }
+ A& a3 = dynamic_cast<volatile A&>(b); // { dg-error "invalid" }
+ A& a4 = dynamic_cast<const volatile A&>(b); // { dg-error "invalid" }
+
+ const A& ca1 = dynamic_cast<A&>(b);
+ const A& ca2 = dynamic_cast<const A&>(b);
+ const A& ca3 = dynamic_cast<volatile A&>(b); // { dg-error "invalid" }
+ const A& ca4 = dynamic_cast<const volatile A&>(b); // { dg-error "invalid" }
+
+ volatile A& va1 = dynamic_cast<A&>(b);
+ volatile A& va2 = dynamic_cast<const A&>(b); // { dg-error "invalid" }
+ volatile A& va3 = dynamic_cast<volatile A&>(b);
+ volatile A& va4 = dynamic_cast<const volatile A&>(b);// { dg-error "invalid" }
+
+ const volatile A& cva1 = dynamic_cast<A&>(b);
+ const volatile A& cva2 = dynamic_cast<const A&>(b);
+ const volatile A& cva3 = dynamic_cast<volatile A&>(b);
+ const volatile A& cva4 = dynamic_cast<const volatile A&>(b);
+}
diff --git a/gcc/testsuite/g++.dg/template/crash108.C b/gcc/testsuite/g++.dg/template/crash108.C
index b6f49a19e58..221d80ee5f1 100644
--- a/gcc/testsuite/g++.dg/template/crash108.C
+++ b/gcc/testsuite/g++.dg/template/crash108.C
@@ -1,5 +1,5 @@
// PR c++/50861
template<class T> struct A {A(int b=k(0));}; // { dg-error "parameter|arguments" }
-void f(int k){A<int> a;} // // { dg-error "declared" }
+void f(int k){A<int> a;} // // { dg-message "declared" }
// { dg-message "note" "note" { target *-*-* } 3 }
diff --git a/gcc/testsuite/g++.dg/template/crash41.C b/gcc/testsuite/g++.dg/template/crash41.C
index 9a440b0761e..16e7028a668 100644
--- a/gcc/testsuite/g++.dg/template/crash41.C
+++ b/gcc/testsuite/g++.dg/template/crash41.C
@@ -1,7 +1,7 @@
// PR c++/22464
template<typename T>
-void do_something(const T* A) // { dg-error "declared" }
+void do_something(const T* A) // { dg-message "declared" }
{
struct helper_t{
helper_t() {
diff --git a/gcc/testsuite/g++.dg/template/error2.C b/gcc/testsuite/g++.dg/template/error2.C
index 96f0bcae661..be5ab1d450e 100644
--- a/gcc/testsuite/g++.dg/template/error2.C
+++ b/gcc/testsuite/g++.dg/template/error2.C
@@ -7,9 +7,8 @@
template<class T> struct X
{
- T m; // { dg-error "as type 'void'" "void" }
- // { dg-error "incomplete type" "incomplate" { target *-*-* } 10 }
- // { dg-error "invalid" "invalid" { target *-*-* } 10 }
+ T m; // { dg-error "void" "void" }
+ // { dg-error "incomplete type" "incomplete" { target *-*-* } 10 }
};
template<class T >
diff --git a/gcc/testsuite/g++.dg/template/instantiate3.C b/gcc/testsuite/g++.dg/template/instantiate3.C
index 0e9fd706015..c0754da9227 100644
--- a/gcc/testsuite/g++.dg/template/instantiate3.C
+++ b/gcc/testsuite/g++.dg/template/instantiate3.C
@@ -10,7 +10,7 @@ template <class TYPE>
struct ACE_Cleanup_Adapter
{
TYPE &object ()
- { return object_; } // { dg-error "invalid" }
+ { return object_; }
TYPE object_; // { dg-error "incomplete type" }
};
diff --git a/gcc/testsuite/g++.dg/torture/pr54684.C b/gcc/testsuite/g++.dg/torture/pr54684.C
index 40c47f3fa29..4934011e45f 100644
--- a/gcc/testsuite/g++.dg/torture/pr54684.C
+++ b/gcc/testsuite/g++.dg/torture/pr54684.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "-fno-short-enums" }
typedef union tree_node *tree;
typedef union gimple_statement_d *gimple;
diff --git a/gcc/testsuite/g++.dg/tree-prof/partition2.C b/gcc/testsuite/g++.dg/tree-prof/partition2.C
index ca5671f3ffa..0bc50fae98a 100644
--- a/gcc/testsuite/g++.dg/tree-prof/partition2.C
+++ b/gcc/testsuite/g++.dg/tree-prof/partition2.C
@@ -1,6 +1,6 @@
// PR middle-end/45458
// { dg-require-effective-target freorder }
-// { dg-options "-fnon-call-exceptions -freorder-blocks-and-partition" }
+// { dg-options "-O2 -fnon-call-exceptions -freorder-blocks-and-partition" }
int
main ()
diff --git a/gcc/testsuite/g++.dg/tree-prof/partition3.C b/gcc/testsuite/g++.dg/tree-prof/partition3.C
index 78469836921..c62174aa4d3 100644
--- a/gcc/testsuite/g++.dg/tree-prof/partition3.C
+++ b/gcc/testsuite/g++.dg/tree-prof/partition3.C
@@ -1,6 +1,6 @@
// PR middle-end/45566
// { dg-require-effective-target freorder }
-// { dg-options "-O -fnon-call-exceptions -freorder-blocks-and-partition" }
+// { dg-options "-O2 -fnon-call-exceptions -freorder-blocks-and-partition" }
int k;
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr50413.cc b/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
index e7bdf1f1c32..c47caf10747 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr50413.cc
@@ -160,6 +160,6 @@ void shift(unsigned char t)
V.bitmap.b96 = t;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr50819.cc b/gcc/testsuite/g++.dg/vect/slp-pr50819.cc
index 402218bc5b7..96f82c30218 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr50819.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr50819.cc
@@ -49,5 +49,5 @@ const & v2) {
res = res + s*(v1+v2);
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 2 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 2 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
index 9b2fcc683c3..9570fb31e86 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
@@ -17,5 +17,5 @@ void mydata::Set (float x)
data[i] = x;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-var-20.C b/gcc/testsuite/g++.dg/warn/Wunused-var-20.C
new file mode 100644
index 00000000000..792c25369c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wunused-var-20.C
@@ -0,0 +1,19 @@
+// PR c++/38958
+// { dg-options "-Wunused" }
+
+volatile int g;
+
+struct Lock
+{
+ ~Lock() { g = 0; }
+};
+
+Lock AcquireLock() { return Lock(); }
+
+int main()
+{
+ const Lock& lock = AcquireLock();
+ g = 1;
+ g = 2;
+ g = 3;
+}
diff --git a/gcc/testsuite/g++.dg/warn/anonymous-namespace-5.C b/gcc/testsuite/g++.dg/warn/anonymous-namespace-5.C
new file mode 100644
index 00000000000..6f5a081d89e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/anonymous-namespace-5.C
@@ -0,0 +1,8 @@
+namespace {
+ void f(); // { dg-message "never defined" }
+}
+
+int main()
+{
+ f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/aggregates.C b/gcc/testsuite/g++.old-deja/g++.abi/aggregates.C
index 24f430bd64e..4eb1ce94a79 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/aggregates.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/aggregates.C
@@ -1,4 +1,4 @@
-// { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* } }
+// { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* i?86-*-freebsd* } }
// { dg-require-effective-target ilp32 }
// { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/align.C b/gcc/testsuite/g++.old-deja/g++.abi/align.C
index 037add32c81..b8966859c3e 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/align.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/align.C
@@ -1,4 +1,4 @@
-// { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* i?86-*-darwin* } }
+// { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* i?86-*-freebsd* i?86-*-darwin* } }
// { dg-require-effective-target ilp32 }
// { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
index d5c3192095d..504a0e9b27b 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
@@ -1,4 +1,4 @@
-// { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* } }
+// { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* i?86-*-freebsd* } }
// { dg-require-effective-target ilp32 }
// { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/local.C b/gcc/testsuite/g++.old-deja/g++.jason/local.C
index 21fa9f58771..18d810a33ba 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/local.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/local.C
@@ -5,7 +5,7 @@ int x;
void f ()
{
static int s;
- int x; // { dg-error "" } referenced below
+ int x; // { dg-message "" } referenced below
extern int q();
struct local {
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility3.C b/gcc/testsuite/g++.old-deja/g++.law/visibility3.C
index 64d64df647f..ddbbc84badc 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility3.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility3.C
@@ -11,7 +11,7 @@ int x;
int main(void)
{
static int s;
- int x; // { dg-error "" } declared
+ int x; // { dg-message "" } declared
extern int g();
struct local {
diff --git a/gcc/testsuite/g++.old-deja/g++.law/weak.C b/gcc/testsuite/g++.old-deja/g++.law/weak.C
index 99a0f1772e5..49132adbeb3 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/weak.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/weak.C
@@ -1,4 +1,4 @@
-// { dg-do link { target i?86-*-linux* x86_64-*-linux* } }
+// { dg-do link { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } }
// { dg-require-effective-target static }
// { dg-options "-static" }
// Bug: g++ fails to instantiate operator<<.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
index 8e54a8ed54a..068a90f9ac6 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
@@ -1,4 +1,4 @@
-// { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
+// { dg-do assemble { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } }
// We'd use ebx with 32-bit pic code, so skip.
// { dg-skip-if "" { ilp32 && { ! nonpic } } { "*" } { "" } }
// Origin: "Weidmann, Nicholas" <nicholas.weidmann@swx.ch>
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
index c74e7bd8134..3125dc15f34 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "-fno-short-enums" }
// the template operator!= interferes. It should be in a namespace.
#include <utility>
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.x b/gcc/testsuite/gcc.c-torture/execute/20030125-1.x
index 3a5b1355613..895cff7fef7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030125-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/20030125-1.x
@@ -1,4 +1,7 @@
# Only glibc includes all c99 functions at the moment.
-if { ! [istarget "*-linux*"] } { return 1 }
+if { ! ([istarget "*-linux*"]
+ || [istarget "*-gnu*"])} then {
+ return 1
+}
if { [check_effective_target_uclibc] } { return 1 }
return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/990127-2.x b/gcc/testsuite/gcc.c-torture/execute/990127-2.x
index 3e1d8352d22..501e9314713 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990127-2.x
+++ b/gcc/testsuite/gcc.c-torture/execute/990127-2.x
@@ -5,6 +5,7 @@
if { [istarget i?86-*-darwin*]
|| [istarget i?86-*-linux*]
+ || [istarget i?86-*-gnu*]
|| [istarget i?86-*-kfreebsd*-gnu]
|| [istarget i?86-*-knetbsd*-gnu]
|| [istarget i?86-*-solaris2*]
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57568.c b/gcc/testsuite/gcc.c-torture/execute/pr57568.c
new file mode 100644
index 00000000000..9a7ddb0c56f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr57568.c
@@ -0,0 +1,12 @@
+/* PR target/57568 */
+
+extern void abort (void);
+int a[6][9] = { }, b = 1, *c = &a[3][5];
+
+int
+main ()
+{
+ if (b && (*c = *c + *c))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/20041106-1.c b/gcc/testsuite/gcc.dg/20041106-1.c
index f33ba01c8cd..cba4a06f11a 100644
--- a/gcc/testsuite/gcc.dg/20041106-1.c
+++ b/gcc/testsuite/gcc.dg/20041106-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* *-*-solaris* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* } } */
/* { dg-options -O2 } */
#include <sys/types.h>
diff --git a/gcc/testsuite/gcc.dg/20050503-1.c b/gcc/testsuite/gcc.dg/20050503-1.c
index 200494fa759..f85129a95c7 100644
--- a/gcc/testsuite/gcc.dg/20050503-1.c
+++ b/gcc/testsuite/gcc.dg/20050503-1.c
@@ -47,4 +47,4 @@ F3 (14b, int, strncmp, const char *, const char *, size_t, (a1, "abcdefghijklm",
F2 (15, char *, strchr, const char *, int, (a1, a2))
/* All the calls above should be tail call optimized on i?86/x86-64. */
-/* { dg-final { scan-assembler-not "call" { target i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-final { scan-assembler-not "call" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
diff --git a/gcc/testsuite/gcc.dg/attr-isr-nosave_low_regs.c b/gcc/testsuite/gcc.dg/attr-isr-nosave_low_regs.c
deleted file mode 100644
index 3bda1014caa..00000000000
--- a/gcc/testsuite/gcc.dg/attr-isr-nosave_low_regs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do compile { target { { sh-*-* sh[1234ble]*-*-* } && nonpic } } } */
-/* { dg-options "-O" } */
-
-extern void bar ();
-
-void foo ()
-{
-}
-
-#pragma interrupt
-void ( __attribute__ ((nosave_low_regs)) isr) ()
-{
- bar ();
-}
-
-void delay(int a)
-{
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
-/* A call will clobber all call-saved registers, but because of
- #pragma nosave_low_regs, r0..r7 need not be saved/restored.
- One of these registers will also do fine to hold the function address.
- Call-saved registers r8..r13 also don't need to be restored. */
-/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
-/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
-/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
-/* { dg-final { scan-assembler-times "macl" 2} } */
diff --git a/gcc/testsuite/gcc.dg/attr-isr-trap_exit.c b/gcc/testsuite/gcc.dg/attr-isr-trap_exit.c
deleted file mode 100644
index 7ea24c494f0..00000000000
--- a/gcc/testsuite/gcc.dg/attr-isr-trap_exit.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* { dg-do compile { target sh-*-* sh[1234ble]*-*-* } } */
-/* { dg-options "-O" } */
-/* Check that trapa / interrput_handler attributes can paired in
- either order. */
-void h0() __attribute__ ((trap_exit (4))) __attribute__ ((interrupt_handler));
-void h1() __attribute__ ((interrupt_handler)) __attribute__ ((trap_exit (5)));
-
-void foo ()
-{
-}
-
-void h0 () {}
-/* { dg-final { scan-assembler "trapa\[ \t\]\[ \t\]*#4"} } */
-/* { dg-final { scan-assembler-times "trapa" 1} } */
-
-void delay(int a)
-{
-}
-int main()
-{
- return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/attr-isr-trapa.c b/gcc/testsuite/gcc.dg/attr-isr-trapa.c
deleted file mode 100644
index 47caf2112da..00000000000
--- a/gcc/testsuite/gcc.dg/attr-isr-trapa.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile { target { { sh-*-* sh[1234ble]*-*-* } && nonpic } } } */
-/* { dg-options "-O" } */
-extern void foo ();
-
-void
-(__attribute__ ((trapa_handler)) isr) ()
-{
- foo ();
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
-/* No interrupt-specific saves should be needed. /
-/* { dg-final { scan-assembler-not "\[^f\]r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
-/* { dg-final { scan-assembler-not "@r15\[^\n\]*\[^f\]r\[0-7\]\n" } } */
-/* { dg-final { scan-assembler-not "\[^f\]r\[8-9\]" } } */
-/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
-/* { dg-final { scan-assembler-not "macl" } } */
diff --git a/gcc/testsuite/gcc.dg/builtin-object-size-5.c b/gcc/testsuite/gcc.dg/builtin-object-size-5.c
index 4cb580ebc9a..7c274cdfd42 100644
--- a/gcc/testsuite/gcc.dg/builtin-object-size-5.c
+++ b/gcc/testsuite/gcc.dg/builtin-object-size-5.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-do compile { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
/* { dg-options "-O2" } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c
index 11b7403f5ed..16035b1ca43 100644
--- a/gcc/testsuite/gcc.dg/cleanup-10.c
+++ b/gcc/testsuite/gcc.dg/cleanup-10.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through signal frames
on alternate stack. */
diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c
index d0c78d577b7..ccc61ed41b8 100644
--- a/gcc/testsuite/gcc.dg/cleanup-11.c
+++ b/gcc/testsuite/gcc.dg/cleanup-11.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through realtime signal
frames on alternate stack. */
diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c
index d2335606a21..553c0385d5d 100644
--- a/gcc/testsuite/gcc.dg/cleanup-8.c
+++ b/gcc/testsuite/gcc.dg/cleanup-8.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through signal
frames. */
diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c
index b73125ace96..fe2807234c2 100644
--- a/gcc/testsuite/gcc.dg/cleanup-9.c
+++ b/gcc/testsuite/gcc.dg/cleanup-9.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target hppa*-*-hpux* *-*-linux* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
/* Verify that cleanups work with exception handling through realtime
signal frames. */
diff --git a/gcc/testsuite/gcc.dg/complex-5.c b/gcc/testsuite/gcc.dg/complex-5.c
index 41c4ba0b909..ffedefea360 100644
--- a/gcc/testsuite/gcc.dg/complex-5.c
+++ b/gcc/testsuite/gcc.dg/complex-5.c
@@ -1,7 +1,7 @@
/* PR middle-end/33088 */
/* Origin: Joseph S. Myers <jsm28@gcc.gnu.org> */
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
/* { dg-options "-std=c99 -O -ffloat-store -lm" } */
#include <fenv.h>
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
index 1d2e1481e5a..f94dfce93ea 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
@@ -1,5 +1,5 @@
/* PR debug/50983 */
-/* { dg-do compile { target *-*-linux-gnu } } */
+/* { dg-do compile { target *-*-gnu* } } */
/* { dg-options "-O0 -gdwarf-2" } */
/* { dg-final { scan-assembler "is_stmt 1" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c b/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c
index d88a1f5332b..5eef4ab95fe 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c
@@ -1,7 +1,7 @@
/* HAVE_AS_DWARF2_DEBUG_LINE macro needs to be defined to pass the unittest.
- However, there dg cannot defin it as, so we restrict the target to linux. */
-/* { dg-do compile { target *-*-linux-gnu } } */
-/* { dg-additional-options "-O0" } */
+ However, dg cannot access it, so we restrict to GNU targets. */
+/* { dg-do compile { target *-*-gnu* } } */
+/* { dg-options "-O0 -gdwarf-2" } */
/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])?\n" } } */
/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 2\n" } } */
/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 1\n" } } */
diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c
index d288ac70c82..6727e800c3f 100644
--- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c
+++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c
@@ -1,5 +1,5 @@
/* { dg-options "-std=gnu99 -D_GNU_SOURCE -pthread" } */
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
/* N1150 5.2: Conversions among decimal floating types and between
decimal floating types and generic floating types.
diff --git a/gcc/testsuite/gcc.dg/dfp/pr35739.c b/gcc/testsuite/gcc.dg/dfp/pr35739.c
index d4e1839026e..0fc9d478f5f 100644
--- a/gcc/testsuite/gcc.dg/dfp/pr35739.c
+++ b/gcc/testsuite/gcc.dg/dfp/pr35739.c
@@ -1,5 +1,5 @@
/* PR c/35739 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O -fpreprocessed -fmudflap" } */
_Decimal128
diff --git a/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc/testsuite/gcc.dg/fdata-sections-1.c
index d2b2b580738..51686b92179 100644
--- a/gcc/testsuite/gcc.dg/fdata-sections-1.c
+++ b/gcc/testsuite/gcc.dg/fdata-sections-1.c
@@ -1,7 +1,7 @@
/* PR middle-end/15486 */
/* Origin: Jonathan Larmour <jifl-bugzilla@jifvik.org> */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-fdata-sections" } */
int x;
diff --git a/gcc/testsuite/gcc.dg/fold-minus-1.c b/gcc/testsuite/gcc.dg/fold-minus-1.c
new file mode 100644
index 00000000000..c0fb89a01ae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-minus-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-gimple" } */
+
+typedef int vec __attribute__((vector_size(2*sizeof(int))));
+
+void f(vec*x,vec*y){
+ *x -= *x / *y * *y;
+}
+void g(vec*x,vec*y,vec*z){
+ *x = -1 - *x;
+ *y = -*y - 1;
+ *z = -*z - 13;
+}
+
+/* { dg-final { scan-tree-dump-times "%" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "~" 2 "gimple"} } */
+/* { dg-final { scan-tree-dump-not "/" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "\\\+" "gimple"} } */
+/* { dg-final { scan-tree-dump "{ -13, -13 }" "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/fshort-wchar.c b/gcc/testsuite/gcc.dg/fshort-wchar.c
index c9c751504df..bb698816774 100644
--- a/gcc/testsuite/gcc.dg/fshort-wchar.c
+++ b/gcc/testsuite/gcc.dg/fshort-wchar.c
@@ -2,7 +2,7 @@
/* { dg-do run } */
/* { dg-options "-fshort-wchar" } */
-/* { dg-options "-fshort-wchar -Wl,--no-wchar-size-warning" { target arm*-*-*eabi } } */
+/* { dg-options "-fshort-wchar -Wl,--no-wchar-size-warning" { target arm*-*-*eabi* } } */
/* Source: Neil Booth, 10 Dec 2002.
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-1_0.c b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
index c9fc97334c7..83d2c8607f5 100644
--- a/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-skip-if "" { ! { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } { "*" } { "" } } */
/* { dg-lto-options {{-fPIC -r -nostdlib -flto -flto-partition=1to1 -msse2}} } */
/* { dg-require-effective-target sse2 } */
/* { dg-suppress-ld-options {-fPIC -msse2} } */
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
index 2f4020a011c..40b71328fa9 100644
--- a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
@@ -1,5 +1,5 @@
/* { dg-lto-do link } */
-/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-skip-if "" { ! { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } { "*" } { "" } } */
/* { dg-require-effective-target fpic } */
/* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
/* { dg-suppress-ld-options {-fPIC} } */
diff --git a/gcc/testsuite/gcc.dg/pr30360.c b/gcc/testsuite/gcc.dg/pr30360.c
index d4dae0d5f47..4254c0a38c0 100644
--- a/gcc/testsuite/gcc.dg/pr30360.c
+++ b/gcc/testsuite/gcc.dg/pr30360.c
@@ -1,5 +1,5 @@
/* PR c/30360 */
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* s390*-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* ia64-*-linux* s390*-*-linux* } } */
/* { dg-options "-O2 -std=gnu99" } */
#define I (__extension__ 1.0iF)
diff --git a/gcc/testsuite/gcc.dg/pr37303.c b/gcc/testsuite/gcc.dg/pr37303.c
index ea0827c91ff..bd9f4a8a6c5 100644
--- a/gcc/testsuite/gcc.dg/pr37303.c
+++ b/gcc/testsuite/gcc.dg/pr37303.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-elf* *-*-linux-gnu* } } */
+/* { dg-do compile { target *-*-elf* *-*-gnu* } } */
/* { dg-options "-std=c99" }
/* { dg-final { scan-assembler "rdata|rodata" } } */
diff --git a/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc/testsuite/gcc.dg/pr39323-1.c
index 2876bf39aba..5e3baec4b60 100644
--- a/gcc/testsuite/gcc.dg/pr39323-1.c
+++ b/gcc/testsuite/gcc.dg/pr39323-1.c
@@ -1,5 +1,5 @@
/* PR c/39323 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment is too large" } */
typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment is too large" } */
diff --git a/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc/testsuite/gcc.dg/pr39323-2.c
index 9304c74bc4f..a8707297341 100644
--- a/gcc/testsuite/gcc.dg/pr39323-2.c
+++ b/gcc/testsuite/gcc.dg/pr39323-2.c
@@ -1,5 +1,5 @@
/* PR c/39323 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
int bar __attribute__ ((aligned(1 << 28))) = 20;
diff --git a/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc/testsuite/gcc.dg/pr39323-3.c
index c045f17c832..b452d3c96e5 100644
--- a/gcc/testsuite/gcc.dg/pr39323-3.c
+++ b/gcc/testsuite/gcc.dg/pr39323-3.c
@@ -1,5 +1,5 @@
/* PR c/39323 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
typedef int __attribute__ ((aligned(1 << 28))) int28;
int28 foo = 20;
diff --git a/gcc/testsuite/gcc.dg/pr45416.c b/gcc/testsuite/gcc.dg/pr45416.c
index b8077dd9471..2f013ccd610 100644
--- a/gcc/testsuite/gcc.dg/pr45416.c
+++ b/gcc/testsuite/gcc.dg/pr45416.c
@@ -9,7 +9,7 @@ int foo(long long a)
return 0;
}
-/* { dg-final { scan-assembler "andl" { target i?86-*-linux* x86_64-*-linux* } } } " */
-/* { dg-final { scan-assembler-not "setne" { target i?86-*-linux* x86_64-*-linux* } } }" */
+/* { dg-final { scan-assembler "andl" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } " */
+/* { dg-final { scan-assembler-not "setne" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }" */
/* { dg-final { scan-assembler "and|ubfx" { target arm*-*-* } } } */
/* { dg-final { scan-assembler-not "moveq" { target arm*-*-* } } }" */
diff --git a/gcc/testsuite/gcc.dg/pr57134.c b/gcc/testsuite/gcc.dg/pr57134.c
new file mode 100644
index 00000000000..94ff0929c90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr57134.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mstrict-align" { target { powerpc*-*-linux* powerpc*-*-elf* } } } */
+
+#include <stdint.h>
+
+typedef struct {
+ int64_t counter;
+} atomic64_t;
+
+struct buffer_page {
+ void *a, *b;
+ atomic64_t entries;
+};
+
+static __inline__ __attribute__((always_inline)) int64_t
+atomic64_read(const atomic64_t *v)
+{
+ int64_t t;
+ __asm__ __volatile__("# %0, %1" : "=r"(t) : "m"(v->counter));
+ return t;
+}
+
+int rb_remove_pages(void *p)
+{
+ struct buffer_page *blah = (void *)((intptr_t) p & -4);
+ return atomic64_read(&blah->entries);
+}
diff --git a/gcc/testsuite/gcc.dg/pragma-isr-nosave_low_regs.c b/gcc/testsuite/gcc.dg/pragma-isr-nosave_low_regs.c
deleted file mode 100644
index c71c88cb75f..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr-nosave_low_regs.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do compile { target { { sh-*-* sh[1234ble]*-*-* } && nonpic } } } */
-/* { dg-options "-O" } */
-extern void foo ();
-#pragma interrupt
-#pragma nosave_low_regs
-void
-isr()
-{
- foo ();
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
-/* A call will clobber all call-saved registers, but because of
- #pragma nosave_low_regs, r0..r7 need not be saved/restored.
- One of these registers will also do fine to hold the function address.
- Call-saved registers r8..r13 also don't need to be restored. */
-/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
-/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
-/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
-/* { dg-final { scan-assembler-times "macl" 2} } */
diff --git a/gcc/testsuite/gcc.dg/pragma-isr-trap_exit.c b/gcc/testsuite/gcc.dg/pragma-isr-trap_exit.c
deleted file mode 100644
index 00a0608ccb4..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr-trap_exit.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile { target sh-*-* sh[1234ble]*-*-* } } */
-/* { dg-options "-O" } */
-/* This test case will check whether trapa is generated only for isr. */
-#pragma interrupt
-void isr() __attribute__ ((trap_exit (4)));
-void isr()
-{
-}
-void delay(int a)
-{
-}
-int main()
-{
- return 0;
-}
-
-/* { dg-final { scan-assembler-times "trapa\[ \t\]\[ \t\]*#4" 1} } */
diff --git a/gcc/testsuite/gcc.dg/pragma-isr-trapa.c b/gcc/testsuite/gcc.dg/pragma-isr-trapa.c
deleted file mode 100644
index 2d32885dbdd..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr-trapa.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile { target { { sh-*-* sh[1234ble]*-*-* } && nonpic } } } */
-/* { dg-options "-O" } */
-extern void foo ();
-#pragma trapa
-void
-isr()
-{
- foo ();
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
-/* No interrupt-specific saves should be needed. /
-/* { dg-final { scan-assembler-not "r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
-/* { dg-final { scan-assembler-not "@r15\[^\n\]*r\[0-7\]\n" } } */
-/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
-/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
-/* { dg-final { scan-assembler-not "macl" } } */
diff --git a/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c b/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c
deleted file mode 100644
index a1165893be5..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* { dg-do compile { target { { sh-*-* sh4*-*-* } && nonpic } } } */
-/* { dg-skip-if "FPU Required" { "sh*-*-*" } { "-m*nofpu*" } { "" } } */
-/* { dg-skip-if "FPU Required" { "sh*-*-*" } { "-m4al*" } { "" } } */
-/* { dg-options "-O -m4" } */
-
-extern void foo ();
-#pragma trapa
-void
-isr()
-{
- foo ();
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
-/* No interrupt-specific saves should be needed.
- The function call will require to load the address first into a register,
- then use that for a jsr or jmp. It will also need to load a constant
- address in order to load fpscr. */
-/* { dg-final { scan-assembler-times "r\[0-7\]\n" 3 } } */
-/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
-/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
-/* { dg-final { scan-assembler-not "macl" } } */
-/* fpscr needs to be saved, loaded and restored. */
-/* { dg-final { scan-assembler-times "\[^_\]fpscr" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/pragma-isr.c b/gcc/testsuite/gcc.dg/pragma-isr.c
deleted file mode 100644
index e7565a68245..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile { target h8300-*-* sh-*-* sh[1234ble]*-*-* } } */
-/* { dg-options "-O3" } */
-/* Test case will check whether rte is generated for two ISRs*/
-extern void foo();
-#pragma interrupt
-void isr1(void)
-{
- foo();
-}
-
-#pragma interrupt
-void isr2(void)
-{
- foo();
-}
-
-/* { dg-final { scan-assembler-times "rte" 2} } */
diff --git a/gcc/testsuite/gcc.dg/pragma-isr2.c b/gcc/testsuite/gcc.dg/pragma-isr2.c
deleted file mode 100644
index 3e2e4bb38ba..00000000000
--- a/gcc/testsuite/gcc.dg/pragma-isr2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* { dg-do compile { target h8300-*-* sh-*-* sh[1234ble]*-*-* } } */
-/* { dg-options "-O" } */
-/* This test case will check whether rte is generated only for isr. */
-#pragma interrupt
-void isr()
-{
-}
-void delay(int a)
-{
-}
-int main()
-{
- return 0;
-}
-
-/* { dg-final { scan-assembler-times "rte" 1} } */
diff --git a/gcc/testsuite/gcc.dg/setjmp-2.c b/gcc/testsuite/gcc.dg/setjmp-2.c
index f31f6b29268..bd35a256738 100644
--- a/gcc/testsuite/gcc.dg/setjmp-2.c
+++ b/gcc/testsuite/gcc.dg/setjmp-2.c
@@ -1,6 +1,6 @@
/* PR middle-end/17813 */
/* Origin: Tom Hughes <tom@compton.nu> */
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
/* { dg-options "-O -fomit-frame-pointer" } */
/* { dg-options "-O -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
diff --git a/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c b/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
index 9e69ca16645..fbe6f4fd20d 100644
--- a/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
+++ b/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
@@ -1,13 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
-extern int * alloca (int);
-
int *p;
void
test (int a)
{
if (a > 0)
- p = alloca (4);
+ p = __builtin_alloca (4);
}
diff --git a/gcc/testsuite/gcc.dg/split-1.c b/gcc/testsuite/gcc.dg/split-1.c
index 044b4e2889b..91fcb4aa55e 100644
--- a/gcc/testsuite/gcc.dg/split-1.c
+++ b/gcc/testsuite/gcc.dg/split-1.c
@@ -1,6 +1,6 @@
/* This test needs to use setrlimit to set the stack size, so it can
only run on Unix. */
-/* { dg-do run { target *-*-linux* *-*-solaris* *-*-darwin* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
/* { dg-require-effective-target split_stack } */
/* { dg-options "-fsplit-stack" } */
diff --git a/gcc/testsuite/gcc.dg/split-3.c b/gcc/testsuite/gcc.dg/split-3.c
index 360f6720c78..64bbb8c0ec0 100644
--- a/gcc/testsuite/gcc.dg/split-3.c
+++ b/gcc/testsuite/gcc.dg/split-3.c
@@ -1,6 +1,6 @@
/* This test needs to use setrlimit to set the stack size, so it can
only run on Unix. */
-/* { dg-do run { target *-*-linux* *-*-solaris* *-*-darwin* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
/* { dg-require-effective-target split_stack } */
/* { dg-options "-fsplit-stack" } */
diff --git a/gcc/testsuite/gcc.dg/split-4.c b/gcc/testsuite/gcc.dg/split-4.c
index 38196bed6c7..b89164e34d6 100644
--- a/gcc/testsuite/gcc.dg/split-4.c
+++ b/gcc/testsuite/gcc.dg/split-4.c
@@ -1,6 +1,6 @@
/* This test needs to use setrlimit to set the stack size, so it can
only run on Unix. */
-/* { dg-do run { target *-*-linux* *-*-solaris* *-*-darwin* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
/* { dg-require-effective-target split_stack } */
/* { dg-options "-fsplit-stack" } */
diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c
index 2b6508f01d9..f1dec1f9c97 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-12g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c
index 62a120de07b..86c57f195f0 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-14g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy and mempcpy functions. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c
index 999759e86f6..6e5c9b08e16 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c
@@ -1,6 +1,6 @@
/* This test needs runtime that provides stpcpy, mempcpy and __*_chk
functions. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define FORTIFY_SOURCE 2
diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c
index 11e4d319adb..0e74ad7f202 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-16g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c
index b61bf74b8b2..f06435f6b92 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-17g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c
index c70daea4b28..21b6c47c0bf 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-18g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c
index 4b0207fd4f7..ce1097f9b9e 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-1f.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides __*_chk functions. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define FORTIFY_SOURCE 2
diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c
index 45c6345fc8b..4cd6a5f1c78 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-22g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c
index 7996e67618c..ba4797d51f2 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-2f.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides __*_chk functions. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define FORTIFY_SOURCE 2
diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c
index 7b397366e9c..c9a5f00ba94 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-4g.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy function. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c
index cf99212a152..743066f2eb0 100644
--- a/gcc/testsuite/gcc.dg/strlenopt-4gf.c
+++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c
@@ -1,5 +1,5 @@
/* This test needs runtime that provides stpcpy and __*_chk functions. */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-tree-strlen" } */
#define USE_GNU
diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c
index 0be43b6d6bc..36cc87e7d0e 100644
--- a/gcc/testsuite/gcc.dg/struct-ret-3.c
+++ b/gcc/testsuite/gcc.dg/struct-ret-3.c
@@ -1,7 +1,7 @@
/* PR middle-end/31309 */
/* Origin: Peeter Joot <peeterj@ca.ibm.com> */
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
#include <sys/mman.h>
#include <string.h>
diff --git a/gcc/testsuite/gcc.dg/torture/pr57425-1.c b/gcc/testsuite/gcc.dg/torture/pr57425-1.c
new file mode 100644
index 00000000000..8ca85cafe6d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57425-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+union setconflict
+{
+ int a[20];
+ long b[10];
+};
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ union setconflict a;
+ int *c;
+ c = a.a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ union setconflict a;
+ long *c;
+ c = a.b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57425-2.c b/gcc/testsuite/gcc.dg/torture/pr57425-2.c
new file mode 100644
index 00000000000..ccb546e0ee7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57425-2.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ int a[20];
+ int *c;
+ c = a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ long b[10];
+ long *c;
+ c = b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57425-3.c b/gcc/testsuite/gcc.dg/torture/pr57425-3.c
new file mode 100644
index 00000000000..8e0c7fe2dec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57425-3.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ long a[20];
+ long *c;
+ c = a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ long long b[10];
+ long long *c;
+ c = b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57478.c b/gcc/testsuite/gcc.dg/torture/pr57478.c
new file mode 100644
index 00000000000..e81348dfd73
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57478.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef struct Node Node;
+
+struct Node
+{
+ Node *Pred, *Suc;
+ Node *SubBestPred;
+ Node *SubBestSuc;
+};
+
+void
+foo (Node *N)
+{
+ do
+ {
+ N->SubBestPred = N->Pred;
+ N->SubBestSuc = N->Suc;
+ }
+ while (N = N->Suc);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57569.c b/gcc/testsuite/gcc.dg/torture/pr57569.c
new file mode 100644
index 00000000000..f036d559d6c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57569.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+struct S { int f0; } a;
+
+int b, e, *d = &b, f;
+
+void
+fn1 ()
+{
+ int **g[9][6];
+ int ***h = &g[6][3];
+ for (; e < 9; e++) {
+ f = 0;
+ for (; f < 6; f++)
+ g[e][f] = &d;
+ }
+ ***h = 0;
+}
+
+void
+fn2 ()
+{
+ fn1 ();
+ struct S c[4][10] = {};
+ a = c[3][9];
+}
+
+int
+main ()
+{
+ fn2 ();
+ if (a.f0 != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
index c93ffa8673e..2fd3be8fda2 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
#include <setjmp.h>
#include <signal.h>
diff --git a/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c b/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c
new file mode 100644
index 00000000000..cbd1c7c80ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c
@@ -0,0 +1,119 @@
+/* PR rtl-optimization/16968 */
+/* Testcase by Jakub Jelinek <jakub@redhat.com> */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+struct T
+{
+ unsigned int b, c, *d;
+ unsigned char e;
+};
+struct S
+{
+ unsigned int a;
+ struct T f;
+};
+struct U
+{
+ struct S g, h;
+};
+struct V
+{
+ unsigned int i;
+ struct U j;
+};
+
+extern void exit (int);
+extern void abort (void);
+
+void *
+dummy1 (void *x)
+{
+ return "";
+}
+
+void *
+dummy2 (void *x, void *y)
+{
+ exit (0);
+}
+
+struct V *
+baz (unsigned int x)
+{
+ static struct V v;
+ __builtin_memset (&v, 0x55, sizeof (v));
+ return &v;
+}
+
+int
+check (void *x, struct S *y)
+{
+ if (y->a || y->f.b || y->f.c || y->f.d || y->f.e)
+ abort ();
+ return 1;
+}
+
+static struct V *
+bar (unsigned int x, void *y)
+{
+ const struct T t = { 0, 0, (void *) 0, 0 };
+ struct V *u;
+ void *v;
+ v = dummy1 (y);
+ if (!v)
+ return (void *) 0;
+
+ u = baz (sizeof (struct V));
+ u->i = x;
+ u->j.g.a = 0;
+ u->j.g.f = t;
+ u->j.h.a = 0;
+ u->j.h.f = t;
+
+ if (!check (v, &u->j.g) || !check (v, &u->j.h))
+ return (void *) 0;
+ return u;
+}
+
+int
+foo (unsigned int *x, unsigned int y, void **z)
+{
+ void *v;
+ unsigned int i, j;
+
+ *z = v = (void *) 0;
+
+ for (i = 0; i < y; i++)
+ {
+ struct V *c;
+
+ j = *x;
+
+ switch (j)
+ {
+ case 1:
+ c = bar (j, x);
+ break;
+ default:
+ c = 0;
+ break;
+ }
+ if (c)
+ v = dummy2 (v, c);
+ else
+ return 1;
+ }
+
+ *z = v;
+ return 0;
+}
+
+int
+main (void)
+{
+ unsigned int one = 1;
+ void *p;
+ foo (&one, 1, &p);
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
new file mode 100644
index 00000000000..bbfe1f4728f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
@@ -0,0 +1,166 @@
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+#include <stdlib.h>
+
+#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
+typedef unsigned int uint32;
+typedef signed int sint32;
+
+typedef uint32 reg_t;
+
+typedef unsigned long int host_addr_t;
+typedef uint32 target_addr_t;
+typedef sint32 target_saddr_t;
+
+typedef union
+{
+ struct
+ {
+ unsigned int offset:18;
+ unsigned int ignore:4;
+ unsigned int s1:8;
+ int :2;
+ signed int simm:14;
+ unsigned int s3:8;
+ unsigned int s2:8;
+ int pad2:2;
+ } f1;
+ long long ll;
+ double d;
+} insn_t;
+
+typedef struct
+{
+ target_addr_t vaddr_tag;
+ unsigned long int rigged_paddr;
+} tlb_entry_t;
+
+typedef struct
+{
+ insn_t *pc;
+ reg_t registers[256];
+ insn_t *program;
+ tlb_entry_t tlb_tab[0x100];
+} environment_t;
+
+enum operations
+{
+ LOAD32_RR,
+ METAOP_DONE
+};
+
+host_addr_t
+f ()
+{
+ abort ();
+}
+
+reg_t
+simulator_kernel (int what, environment_t *env)
+{
+ register insn_t *pc = env->pc;
+ register reg_t *regs = env->registers;
+ register insn_t insn;
+ register int s1;
+ register reg_t r2;
+ register void *base_addr = &&sim_base_addr;
+ register tlb_entry_t *tlb = env->tlb_tab;
+
+ if (what != 0)
+ {
+ int i;
+ static void *op_map[] =
+ {
+ &&L_LOAD32_RR,
+ &&L_METAOP_DONE,
+ };
+ insn_t *program = env->program;
+ for (i = 0; i < what; i++)
+ program[i].f1.offset = op_map[program[i].f1.offset] - base_addr;
+ }
+
+ sim_base_addr:;
+
+ insn = *pc++;
+ r2 = (*(reg_t *) (((char *) regs) + (insn.f1.s2 << 2)));
+ s1 = (insn.f1.s1 << 2);
+ goto *(base_addr + insn.f1.offset);
+
+ L_LOAD32_RR:
+ {
+ target_addr_t vaddr_page = r2 / 4096;
+ unsigned int x = vaddr_page % 0x100;
+ insn = *pc++;
+
+ for (;;)
+ {
+ target_addr_t tag = tlb[x].vaddr_tag;
+ host_addr_t rigged_paddr = tlb[x].rigged_paddr;
+
+ if (tag == vaddr_page)
+ {
+ *(reg_t *) (((char *) regs) + s1) = *(uint32 *) (rigged_paddr + r2);
+ r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
+ s1 = insn.f1.s1 << 2;
+ goto *(base_addr + insn.f1.offset);
+ }
+
+ if (((target_saddr_t) tag < 0))
+ {
+ *(reg_t *) (((char *) regs) + s1) = *(uint32 *) f ();
+ r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
+ s1 = insn.f1.s1 << 2;
+ goto *(base_addr + insn.f1.offset);
+ }
+
+ x = (x - 1) % 0x100;
+ }
+
+ L_METAOP_DONE:
+ return (*(reg_t *) (((char *) regs) + s1));
+ }
+}
+
+insn_t program[2 + 1];
+
+void *malloc ();
+
+int
+main ()
+{
+ environment_t env;
+ insn_t insn;
+ int i, res;
+ host_addr_t a_page = (host_addr_t) malloc (2 * 4096);
+ target_addr_t a_vaddr = 0x123450;
+ target_addr_t vaddr_page = a_vaddr / 4096;
+ a_page = (a_page + 4096 - 1) & -4096;
+
+ env.tlb_tab[((vaddr_page) % 0x100)].vaddr_tag = vaddr_page;
+ env.tlb_tab[((vaddr_page) % 0x100)].rigged_paddr = a_page - vaddr_page * 4096;
+ insn.f1.offset = LOAD32_RR;
+ env.registers[0] = 0;
+ env.registers[2] = a_vaddr;
+ *(sint32 *) (a_page + a_vaddr % 4096) = 88;
+ insn.f1.s1 = 0;
+ insn.f1.s2 = 2;
+
+ for (i = 0; i < 2; i++)
+ program[i] = insn;
+
+ insn.f1.offset = METAOP_DONE;
+ insn.f1.s1 = 0;
+ program[2] = insn;
+
+ env.pc = program;
+ env.program = program;
+
+ res = simulator_kernel (2 + 1, &env);
+
+ if (res != 88)
+ abort ();
+ exit (0);
+}
+#else
+main(){ exit (0); }
+#endif
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr45354.c b/gcc/testsuite/gcc.dg/tree-prof/pr45354.c
index b30ad77694d..849e786bb2d 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/pr45354.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/pr45354.c
@@ -1,5 +1,5 @@
/* { dg-require-effective-target freorder } */
-/* { dg-options "-O -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr50907.c b/gcc/testsuite/gcc.dg/tree-prof/pr50907.c
index 2ba26e392cb..b850513a13b 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/pr50907.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/pr50907.c
@@ -1,5 +1,5 @@
/* PR middle-end/50907 */
/* { dg-require-effective-target freorder } */
-/* { dg-options "-O -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling -fpic" { target { { powerpc*-*-* ia64-*-* x86_64-*-* } && fpic } } } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling -fpic" { target { { powerpc*-*-* ia64-*-* x86_64-*-* } && fpic } } } */
#include "pr45354.c"
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr52027.c b/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
index c12f8b484e1..c46a14b2e86 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
@@ -1,6 +1,6 @@
/* PR debug/52027 */
/* { dg-require-effective-target freorder } */
-/* { dg-options "-O -freorder-blocks-and-partition -fno-reorder-functions" } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fno-reorder-functions" } */
void
foo (int len)
diff --git a/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c b/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c
new file mode 100644
index 00000000000..8d17dbfef85
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c
@@ -0,0 +1,145 @@
+/* __builtin_va_arg_pack () builtin tests. */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+int v1 = 8;
+long int v2 = 3;
+void *v3 = (void *) &v2;
+struct A { char c[16]; } v4 = { "foo" };
+long double v5 = 40;
+char seen[20];
+int cnt;
+
+__attribute__ ((noinline)) int
+foo1 (int x, int y, ...)
+{
+ int i;
+ long int l;
+ void *v;
+ struct A a;
+ long double ld;
+ va_list ap;
+
+ va_start (ap, y);
+ if (x < 0 || x >= 20 || seen[x])
+ abort ();
+ seen[x] = ++cnt;
+ if (y != 6)
+ abort ();
+ i = va_arg (ap, int);
+ if (i != 5)
+ abort ();
+ switch (x)
+ {
+ case 0:
+ i = va_arg (ap, int);
+ if (i != 9 || v1 != 9)
+ abort ();
+ a = va_arg (ap, struct A);
+ if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0)
+ abort ();
+ v = (void *) va_arg (ap, struct A *);
+ if (v != (void *) &v4)
+ abort ();
+ l = va_arg (ap, long int);
+ if (l != 3 || v2 != 4)
+ abort ();
+ break;
+ case 1:
+ ld = va_arg (ap, long double);
+ if (ld != 41 || v5 != ld)
+ abort ();
+ i = va_arg (ap, int);
+ if (i != 8)
+ abort ();
+ v = va_arg (ap, void *);
+ if (v != &v2)
+ abort ();
+ break;
+ case 2:
+ break;
+ default:
+ abort ();
+ }
+ va_end (ap);
+ return x;
+}
+
+__attribute__ ((noinline)) int
+foo2 (int x, int y, ...)
+{
+ long long int ll;
+ void *v;
+ struct A a, b;
+ long double ld;
+ va_list ap;
+
+ va_start (ap, y);
+ if (x < 0 || x >= 20 || seen[x])
+ abort ();
+ seen[x] = ++cnt | 64;
+ if (y != 10)
+ abort ();
+ switch (x)
+ {
+ case 11:
+ break;
+ case 12:
+ ld = va_arg (ap, long double);
+ if (ld != 41 || v5 != 40)
+ abort ();
+ a = va_arg (ap, struct A);
+ if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0)
+ abort ();
+ b = va_arg (ap, struct A);
+ if (__builtin_memcmp (b.c, v4.c, sizeof (b.c)) != 0)
+ abort ();
+ v = va_arg (ap, void *);
+ if (v != &v2)
+ abort ();
+ ll = va_arg (ap, long long int);
+ if (ll != 16LL)
+ abort ();
+ break;
+ case 2:
+ break;
+ default:
+ abort ();
+ }
+ va_end (ap);
+ return x + 8;
+}
+
+__attribute__ ((noinline)) int
+foo3 (void)
+{
+ return 6;
+}
+
+extern inline __attribute__ ((always_inline, gnu_inline)) int
+bar (int x, ...)
+{
+ if (x < 10)
+ return foo1 (x, foo3 (), 5, __builtin_va_arg_pack ());
+ return foo2 (x, foo3 () + 4, __builtin_va_arg_pack ());
+}
+
+int
+main (void)
+{
+ if (bar (0, ++v1, v4, &v4, v2++) != 0)
+ abort ();
+ if (bar (1, ++v5, 8, v3) != 1)
+ abort ();
+ if (bar (2) != 2)
+ abort ();
+ if (bar (v1 + 2) != 19)
+ abort ();
+ if (bar (v1 + 3, v5--, v4, v4, v3, 16LL) != 20)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c
new file mode 100644
index 00000000000..96c0dc24bed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+void abort (void);
+__attribute__ ((weak))
+int test()
+{
+ return 0;
+}
+static int test2() __attribute__ ((alias("test")));
+static int test3() __attribute__ ((weakref)) __attribute__ ((alias("test2")));
+static int test4() __attribute__ ((weakref)) __attribute__ ((alias("test")));
+main()
+{
+ test();
+ test2();
+ test3();
+ test4();
+}
+
+/* calls to test1 and test2 can be inlined and optmized away. Calls
+ to test and test4 are overwritable. */
+
+/* { dg-final { scan-tree-dump-times " test " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " test4 " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-not " test1 " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " test2 " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c b/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c
new file mode 100644
index 00000000000..5cae9ae2a35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c
@@ -0,0 +1,195 @@
+/* { dg-do compile } */
+
+/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+
+typedef long unsigned int size_t;
+union tree_node;
+typedef union tree_node *tree;
+union gimple_statement_d;
+typedef union gimple_statement_d *gimple;
+typedef const union tree_node *const_tree;
+typedef const union gimple_statement_d *const_gimple;
+struct gimple_seq_d;
+typedef struct gimple_seq_d *gimple_seq;
+struct edge_def;
+typedef struct edge_def *edge;
+struct basic_block_def;
+typedef struct basic_block_def *basic_block;
+typedef const struct basic_block_def *const_basic_block;
+struct tree_exp
+{
+ tree operands[1];
+};
+typedef struct ssa_use_operand_d
+{
+ tree *use;
+} ssa_use_operand_t;
+struct phi_arg_d
+{
+ struct ssa_use_operand_d imm_use;
+};
+union tree_node
+{
+ struct tree_exp exp;
+};
+struct function
+{
+};
+extern struct function *cfun;
+struct edge_def
+{
+ unsigned int dest_idx;
+};
+static __inline__ void
+VEC_edge_must_be_pointer_type (void)
+{
+ (void) ((edge) 1 == (void *) 1);
+} typedef struct VEC_edge_base
+
+{
+ unsigned num;
+ unsigned alloc;
+ edge vec[1];
+} VEC_edge_base;
+typedef struct VEC_edge_none
+{
+ VEC_edge_base base;
+} VEC_edge_none;
+
+static __inline__ edge
+VEC_edge_base_index (const VEC_edge_base * vec_, unsigned ix_,
+ const char *file_, unsigned line_, const char *function_)
+{
+ return vec_->vec[ix_];
+}
+
+typedef struct VEC_edge_gc
+{
+ VEC_edge_base base;
+} VEC_edge_gc;
+struct basic_block_def
+{
+ VEC_edge_gc *succs;
+};
+static __inline__ edge
+single_succ_edge (const_basic_block bb)
+{
+ return (VEC_edge_base_index
+ ((((bb)->succs) ? &((bb)->succs)->base : 0), (0),
+ "/home/gcc/virgin-gcc/gcc/basic-block.h", 563, __FUNCTION__));
+}
+
+edge find_edge (basic_block, basic_block);
+typedef tree *def_operand_p;
+typedef ssa_use_operand_t *use_operand_p;
+struct gimple_seq_node_d;
+typedef struct gimple_seq_node_d *gimple_seq_node;
+struct gimple_seq_node_d
+{
+ gimple stmt;
+};
+typedef struct
+{
+ gimple_seq_node ptr;
+ gimple_seq seq;
+ basic_block bb;
+} gimple_stmt_iterator;
+struct gimple_statement_phi
+{
+ struct phi_arg_d args[1];
+};
+union gimple_statement_d
+{
+ struct gimple_statement_phi gimple_phi;
+};
+extern size_t const gimple_ops_offset_[];
+static __inline__ tree *
+gimple_ops (gimple gs)
+{
+ size_t off;
+ off = gimple_ops_offset_[gimple_statement_structure (gs)];
+ return (tree *) ((char *) gs + off);
+}
+
+static __inline__ tree
+gimple_op (const_gimple gs, unsigned i)
+{
+ return gimple_ops ((((union
+ {
+ const union gimple_statement_d * _q;
+ union gimple_statement_d * _nq;}) (((gs))))._nq))[i];
+}
+
+static __inline__ struct phi_arg_d *
+gimple_phi_arg (gimple gs, unsigned index)
+{
+ return &(gs->gimple_phi.args[index]);
+}
+
+static __inline__ tree
+gimple_switch_label (const_gimple gs, unsigned index)
+{
+ return gimple_op (gs, index + 1);
+}
+
+gimple_stmt_iterator gsi_start_phis (basic_block);
+extern basic_block label_to_block_fn (struct function *, tree);
+
+static __inline__ tree
+get_use_from_ptr (use_operand_p use)
+{
+ return *(use->use);
+}
+
+static __inline__ use_operand_p
+gimple_phi_arg_imm_use_ptr (gimple gs, int i)
+{
+ return &gimple_phi_arg (gs, i)->imm_use;
+}
+
+struct switch_conv_info
+{
+ basic_block final_bb;
+ basic_block switch_bb;
+ const char *reason;
+ tree *default_values;
+};
+static struct switch_conv_info info;
+
+static void
+gather_default_values (tree default_case)
+{
+ gimple_stmt_iterator gsi;
+ basic_block bb =
+ (label_to_block_fn ((cfun + 0), default_case->exp.operands[2]));
+ edge e;
+ int i = 0;
+ if (bb == info.final_bb)
+ e = find_edge (info.switch_bb, bb);
+ else
+ e = single_succ_edge (bb);
+ for (gsi = gsi_start_phis (info.final_bb);
+ gsi_gsi_start_phis (info.final_bb); gsi_next (&gsi))
+ {
+ gimple phi = gsi.ptr->stmt;
+ tree val = get_use_from_ptr (gimple_phi_arg_imm_use_ptr
+ ((((phi))), (((e)->dest_idx))));
+ info.default_values[i++] = val;
+ }
+}
+
+unsigned char
+process_switch (gimple swtch)
+{
+ unsigned int i, branch_num = gimple_switch_num_labels (swtch);
+ tree index_type;
+ info.reason = "switch has no labels\n";
+ gather_default_values (gimple_switch_label (swtch, 0));
+}
+
+/* Verify that out-of-ssa coalescing did its job by verifying there are not
+ any partition copies inserted. */
+
+/* { dg-final { scan-rtl-dump-not "partition copy" "expand"} } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c
new file mode 100644
index 00000000000..9e1b0763b44
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+typedef int V __attribute__((vector_size(2*sizeof(int))));
+typedef __complex__ int C;
+
+void f (V *v1, V *v2){
+ V w1 = *v1;
+ V x1 = ~w1;
+ *v1 = x1 + 1;
+ V w2 = *v2;
+ V x2 = ~w2;
+ *v2 = x2 + w2;
+}
+
+void g (V *v1, V *v2){
+ V c1 = { 5, -10 };
+ V c2 = { 32, 13 };
+ *v1 = (*v1|c1)&c2;
+ *v2 = (*v2^c1)^c2;
+}
+
+void h (C *v1, C *v2){
+ C w = *v2;
+ C x = *v1 - w;
+ *v1 = x + w;
+}
+
+void i (V *v1, V *v2){
+ V c1 = { 5, -10 };
+ V c2 = { 32, 13 };
+ *v1 = (*v1-c1)+c2;
+ *v2 = (c1-*v2)+c2;
+}
+
+/* { dg-final { scan-tree-dump-not "\\\+" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 0, 4 }" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 37, -5 }" "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
index d01b8abdda7..520c357a3ad 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
@@ -35,6 +35,6 @@ Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr)
/* Whether the structs are totally scalarized or not depends on the
MOVE_RATIO macro defintion in the back end. The scalarization will
not take place when using small values for MOVE_RATIO. */
-/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "arm-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
-/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "arm-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "arm*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "arm*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c b/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
index 24734004456..44dc5f2d3cf 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
@@ -37,6 +37,6 @@ long foo(long data, long v)
}
/* We should not eliminate global register variable when it is the RHS of
a single assignment. */
-/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" { target { arm-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { arm-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" { target { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c b/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c
new file mode 100644
index 00000000000..81f27b3cd1f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1-details" } */
+
+struct A { int x; double y; };
+void f (struct A *a) {
+ *a = *a;
+}
+
+/* { dg-final { scan-tree-dump "Deleted dead store" "dse1"} } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-1.c
index c13ee3b181d..11882ec5d4a 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-1.c
@@ -56,6 +56,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
index f127c7f11ef..6eb8f5465f8 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
@@ -50,6 +50,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "unsupported alignment in basic block." 1 "slp" { xfail vect_element_align } } } */
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_element_align } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-11.c b/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
index 225d08ec33b..9844788ea0d 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
@@ -48,6 +48,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect64 } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-13.c b/gcc/testsuite/gcc.dg/vect/bb-slp-13.c
index 4e114d5f94a..f312ea64fc1 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-13.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-13.c
@@ -46,6 +46,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-14.c b/gcc/testsuite/gcc.dg/vect/bb-slp-14.c
index fc6b457811f..9a36033ca7b 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-14.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-14.c
@@ -47,6 +47,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-15.c b/gcc/testsuite/gcc.dg/vect/bb-slp-15.c
index cab46d6092c..842699ecb0a 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-15.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-15.c
@@ -51,6 +51,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-16.c b/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
index 4390753db4d..609dc7b6a3e 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
@@ -65,6 +65,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-17.c b/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
index a64543f8297..5a917b8b3f7 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
@@ -57,6 +57,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-18.c b/gcc/testsuite/gcc.dg/vect/bb-slp-18.c
index 7869e32fe3e..98501ccf6a6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-18.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-18.c
@@ -46,6 +46,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-19.c b/gcc/testsuite/gcc.dg/vect/bb-slp-19.c
index a314626f0d6..2f726121c94 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-19.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-19.c
@@ -53,6 +53,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-2.c
index 20a61a08d2d..da228f7c33c 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-2.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-2.c
@@ -53,6 +53,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-20.c b/gcc/testsuite/gcc.dg/vect/bb-slp-20.c
index 9991fe39985..caaecb9bafb 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-20.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-20.c
@@ -63,7 +63,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-21.c b/gcc/testsuite/gcc.dg/vect/bb-slp-21.c
index acd332079cd..eba9d08c951 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-21.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-21.c
@@ -63,7 +63,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "slp" { target { ! {vect_int_mult } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-22.c b/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
index 2fa2c1b3276..30bc57a6bbb 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
@@ -63,7 +63,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { ! {vect_int_mult } } } } } */
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 2 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { ! {vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 2 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-23.c b/gcc/testsuite/gcc.dg/vect/bb-slp-23.c
index 1c09048ee07..a736c385c81 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-23.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-23.c
@@ -51,6 +51,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-24.c b/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
index cbe1cb3edea..10d8e406647 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
@@ -54,6 +54,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_element_align } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-25.c b/gcc/testsuite/gcc.dg/vect/bb-slp-25.c
index 193ab9d4db3..b92535df00c 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-25.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-25.c
@@ -54,6 +54,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_element_align } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-26.c b/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
index cf8f9587d03..f40c12402b6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
@@ -55,6 +55,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect64 } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-27.c b/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
index 7157ebadddc..e9b386f4921 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
@@ -44,6 +44,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-28.c b/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
index 996f8f3cad8..3dc1a0d8a7c 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
@@ -66,6 +66,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_pack_trunc && vect_unpack } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_int_mult && { vect_pack_trunc && vect_unpack } } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-29.c b/gcc/testsuite/gcc.dg/vect/bb-slp-29.c
index e37b96d14d9..c2bc391885d 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-29.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-29.c
@@ -54,6 +54,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_int_mult && vect_element_align } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-3.c b/gcc/testsuite/gcc.dg/vect/bb-slp-3.c
index fee62d7f98f..98cbc5b80ea 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-3.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-3.c
@@ -42,6 +42,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-30.c b/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
index 63689e3434e..a587780364f 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
@@ -43,5 +43,5 @@ test1(void)
int main() { test1(); return a[21]; }
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-31.c b/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
index 9a3eac62b52..e2704dc721f 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
@@ -9,4 +9,4 @@ void f(){
a[1]=1+2*a[1]*a[1];
}
-/* { dg-final { scan-tree-dump "basic block vectorized using SLP" "slp" } } */
+/* { dg-final { scan-tree-dump "Vectorized basic-block" "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-4.c b/gcc/testsuite/gcc.dg/vect/bb-slp-4.c
index a7632f9832b..5b983c7e63e 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-4.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-4.c
@@ -38,6 +38,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-5.c b/gcc/testsuite/gcc.dg/vect/bb-slp-5.c
index c4a8a881e02..cd1679e981d 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-5.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-5.c
@@ -47,6 +47,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-6.c b/gcc/testsuite/gcc.dg/vect/bb-slp-6.c
index 176010ae5d9..39d8c04cc9a 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-6.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-6.c
@@ -45,6 +45,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-7.c b/gcc/testsuite/gcc.dg/vect/bb-slp-7.c
index 4f82122111a..c0ca017d0d8 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-7.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-7.c
@@ -46,6 +46,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-8.c b/gcc/testsuite/gcc.dg/vect/bb-slp-8.c
index b1203f4dbba..1cb3ddd65e6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-8.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-8.c
@@ -48,6 +48,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c b/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c
index 2251275d4fb..9db6747985e 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c
@@ -47,6 +47,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 0 "slp" } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c b/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c
index 62a691e1baf..dc6353999f3 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c
@@ -49,6 +49,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-9.c b/gcc/testsuite/gcc.dg/vect/bb-slp-9.c
index 5535dee0641..3b950897249 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-9.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-9.c
@@ -46,6 +46,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
index ae833e53dc0..38c18a71fc7 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
@@ -41,6 +41,6 @@ int main ()
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_element_align } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c
index 30fa487cbf6..0d4d54fe0c2 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c
@@ -48,5 +48,5 @@ int main ()
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_element_align && vect_pack_trunc } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_element_align && vect_pack_trunc } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
index b109be23250..137267619f2 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
@@ -18,7 +18,7 @@ struct s{
struct t e; /* unaligned (offset 2N+4N+4 B) */
};
-struct s tmp;
+struct s tmp = { 1 };
int main1 ()
{
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
index b109be23250..137267619f2 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
@@ -18,7 +18,7 @@ struct s{
struct t e; /* unaligned (offset 2N+4N+4 B) */
};
-struct s tmp;
+struct s tmp = { 1 };
int main1 ()
{
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c b/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
index 7b76b440e1b..d842658c679 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
@@ -45,5 +45,5 @@ main ()
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c b/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c
index bf19fcd1594..d6fb6a2b6f9 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c
@@ -63,5 +63,5 @@ main ()
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 2 "slp" { target vect_call_lrint } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 2 "slp" { target vect_call_lrint } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
index 4b613050a4c..7a7765110ec 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
@@ -1,4 +1,6 @@
-/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_int }
+ { dg-skip-if "AArch64 tiny code model does not support programs larger than 1MiB" {aarch64_tiny} {"*"} {""} }
+ */
#include <stdarg.h>
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c b/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c
index 349bf8b30fe..b4154835a11 100644
--- a/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c
+++ b/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c
@@ -47,6 +47,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "Vectorized basic-block" 1 "slp" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index e89236c137f..469020ed6a2 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -48,7 +48,9 @@ if { [isnative] && ![is_remote host] } then {
if [ string match "*64-bit*" $file_string ] {
set native_cflags "-m64"
}
- } elseif {[istarget "i*86-*-linux*"] || [istarget "x86_64-*-linux*"]} {
+ } elseif {[istarget "i*86-*-linux*"]
+ || [istarget "i*86-*-gnu*"]
+ || [istarget "x86_64-*-linux*"]} then {
set file_string [exec file "linkage-x.o"]
if [ string match "*32-bit*" $file_string ] {
set native_cflags "-m32"
diff --git a/gcc/testsuite/gcc.target/aarch64/movi_1.c b/gcc/testsuite/gcc.target/aarch64/movi_1.c
new file mode 100644
index 00000000000..e2842b39e02
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/movi_1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+dummy (short* b)
+{
+ /* { dg-final { scan-assembler "movi\tv\[0-9\]+\.4h, 0x4, lsl 8" } } */
+ /* { dg-final { scan-assembler-not "movi\tv\[0-9\]+\.4h, 0x400" } } */
+ /* { dg-final { scan-assembler-not "movi\tv\[0-9\]+\.4h, 1024" } } */
+ register short x asm ("h8") = 1024;
+ asm volatile ("" : : "w" (x));
+ *b = x;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/vect_smlal_1.c b/gcc/testsuite/gcc.target/aarch64/vect_smlal_1.c
new file mode 100644
index 00000000000..1f86eaeeb6e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/vect_smlal_1.c
@@ -0,0 +1,325 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-inline -save-temps -fno-vect-cost-model" } */
+
+typedef signed char S8_t;
+typedef signed short S16_t;
+typedef signed int S32_t;
+typedef signed long S64_t;
+typedef signed char *__restrict__ pS8_t;
+typedef signed short *__restrict__ pS16_t;
+typedef signed int *__restrict__ pS32_t;
+typedef signed long *__restrict__ pS64_t;
+typedef unsigned char U8_t;
+typedef unsigned short U16_t;
+typedef unsigned int U32_t;
+typedef unsigned long U64_t;
+typedef unsigned char *__restrict__ pU8_t;
+typedef unsigned short *__restrict__ pU16_t;
+typedef unsigned int *__restrict__ pU32_t;
+typedef unsigned long *__restrict__ pU64_t;
+
+extern void abort ();
+
+void
+test_addS64_tS32_t4 (pS64_t a, pS32_t b, pS32_t c)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ a[i] += (S64_t) b[i] * (S64_t) c[i];
+}
+
+/* { dg-final { scan-assembler "smlal\tv\[0-9\]+\.2d" } } */
+/* { dg-final { scan-assembler "smlal2\tv\[0-9\]+\.2d" } } */
+
+void
+test_addS32_tS16_t8 (pS32_t a, pS16_t b, pS16_t c)
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ a[i] += (S32_t) b[i] * (S32_t) c[i];
+}
+
+/* { dg-final { scan-assembler "smlal\tv\[0-9\]+\.4s" } } */
+/* { dg-final { scan-assembler "smlal2\tv\[0-9\]+\.4s" } } */
+
+void
+test_addS16_tS8_t16 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += (S16_t) b[i] * (S16_t) c[i];
+}
+
+void
+test_addS16_tS8_t16_neg0 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += (S16_t) -b[i] * (S16_t) -c[i];
+}
+
+void
+test_addS16_tS8_t16_neg1 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] -= (S16_t) b[i] * (S16_t) -c[i];
+}
+
+void
+test_addS16_tS8_t16_neg2 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] -= (S16_t) -b[i] * (S16_t) c[i];
+}
+
+/* { dg-final { scan-assembler-times "smlal\tv\[0-9\]+\.8h" 4 } } */
+/* { dg-final { scan-assembler-times "smlal2\tv\[0-9\]+\.8h" 4 } } */
+
+void
+test_subS64_tS32_t4 (pS64_t a, pS32_t b, pS32_t c)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ a[i] -= (S64_t) b[i] * (S64_t) c[i];
+}
+
+/* { dg-final { scan-assembler "smlsl\tv\[0-9\]+\.2d" } } */
+/* { dg-final { scan-assembler "smlsl2\tv\[0-9\]+\.2d" } } */
+
+void
+test_subS32_tS16_t8 (pS32_t a, pS16_t b, pS16_t c)
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ a[i] -= (S32_t) b[i] * (S32_t) c[i];
+}
+
+/* { dg-final { scan-assembler "smlsl\tv\[0-9\]+\.4s" } } */
+/* { dg-final { scan-assembler "smlsl2\tv\[0-9\]+\.4s" } } */
+
+void
+test_subS16_tS8_t16 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] -= (S16_t) b[i] * (S16_t) c[i];
+}
+
+void
+test_subS16_tS8_t16_neg0 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += (S16_t) -b[i] * (S16_t) c[i];
+}
+
+void
+test_subS16_tS8_t16_neg1 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += (S16_t) b[i] * (S16_t) -c[i];
+}
+
+void
+test_subS16_tS8_t16_neg2 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += -((S16_t) b[i] * (S16_t) c[i]);
+}
+
+void
+test_subS16_tS8_t16_neg3 (pS16_t a, pS8_t b, pS8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] -= (S16_t) -b[i] * (S16_t) -c[i];
+}
+
+/* { dg-final { scan-assembler-times "smlsl\tv\[0-9\]+\.8h" 5 } } */
+/* { dg-final { scan-assembler-times "smlsl2\tv\[0-9\]+\.8h" 5 } } */
+
+void
+test_addU64_tU32_t4 (pU64_t a, pU32_t b, pU32_t c)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ a[i] += (U64_t) b[i] * (U64_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlal\tv\[0-9\]+\.2d" } } */
+/* { dg-final { scan-assembler "umlal2\tv\[0-9\]+\.2d" } } */
+
+void
+test_addU32_tU16_t8 (pU32_t a, pU16_t b, pU16_t c)
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ a[i] += (U32_t) b[i] * (U32_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlal\tv\[0-9\]+\.4s" } } */
+/* { dg-final { scan-assembler "umlal2\tv\[0-9\]+\.4s" } } */
+
+void
+test_addU16_tU8_t16 (pU16_t a, pU8_t b, pU8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] += (U16_t) b[i] * (U16_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlal\tv\[0-9\]+\.8h" } } */
+/* { dg-final { scan-assembler "umlal2\tv\[0-9\]+\.8h" } } */
+
+void
+test_subU64_tU32_t4 (pU64_t a, pU32_t b, pU32_t c)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ a[i] -= (U64_t) b[i] * (U64_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlsl\tv\[0-9\]+\.2d" } } */
+/* { dg-final { scan-assembler "umlsl2\tv\[0-9\]+\.2d" } } */
+
+void
+test_subU32_tU16_t8 (pU32_t a, pU16_t b, pU16_t c)
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ a[i] -= (U32_t) b[i] * (U32_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlsl\tv\[0-9\]+\.4s" } } */
+/* { dg-final { scan-assembler "umlsl2\tv\[0-9\]+\.4s" } } */
+
+void
+test_subU16_tU8_t16 (pU16_t a, pU8_t b, pU8_t c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] -= (U16_t) b[i] * (U16_t) c[i];
+}
+
+/* { dg-final { scan-assembler "umlsl\tv\[0-9\]+\.8h" } } */
+/* { dg-final { scan-assembler "umlsl2\tv\[0-9\]+\.8h" } } */
+
+
+S64_t add_rS64[4] = { 6, 7, -4, -3 };
+S32_t add_rS32[8] = { 6, 7, -4, -3, 10, 11, 0, 1 };
+S16_t add_rS16[16] =
+ { 6, 7, -4, -3, 10, 11, 0, 1, 14, 15, 4, 5, 18, 19, 8, 9 };
+
+S64_t sub_rS64[4] = { 0, 1, 2, 3 };
+S32_t sub_rS32[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+S16_t sub_rS16[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
+U64_t add_rU64[4] = { 0x6, 0x7, 0x2fffffffc, 0x2fffffffd };
+
+U32_t add_rU32[8] =
+{
+ 0x6, 0x7, 0x2fffc, 0x2fffd,
+ 0xa, 0xb, 0x30000, 0x30001
+};
+
+U16_t add_rU16[16] =
+{
+ 0x6, 0x7, 0x2fc, 0x2fd, 0xa, 0xb, 0x300, 0x301,
+ 0xe, 0xf, 0x304, 0x305, 0x12, 0x13, 0x308, 0x309
+};
+
+U64_t sub_rU64[4] = { 0, 1, 2, 3 };
+U32_t sub_rU32[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+U16_t sub_rU16[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
+S8_t neg_r[16] = { -6, -5, 8, 9, -2, -1, 12, 13, 2, 3, 16, 17, 6, 7, 20, 21 };
+
+S64_t S64_ta[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+S32_t S32_tb[16] = { 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2 };
+S32_t S32_tc[16] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
+
+S32_t S32_ta[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+S16_t S16_tb[16] = { 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2 };
+S16_t S16_tc[16] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
+
+S16_t S16_ta[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+S8_t S8_tb[16] = { 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2 };
+S8_t S8_tc[16] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
+
+
+#define CHECK(T,N,AS,US) \
+do \
+ { \
+ for (i = 0; i < N; i++) \
+ if (S##T##_ta[i] != AS##_r##US##T[i]) \
+ abort (); \
+ } \
+while (0)
+
+#define SCHECK(T,N,AS) CHECK(T,N,AS,S)
+#define UCHECK(T,N,AS) CHECK(T,N,AS,U)
+
+#define NCHECK(RES) \
+do \
+ { \
+ for (i = 0; i < 16; i++) \
+ if (S16_ta[i] != RES[i]) \
+ abort (); \
+ } \
+while (0)
+
+
+int
+main ()
+{
+ int i;
+
+ test_addS64_tS32_t4 (S64_ta, S32_tb, S32_tc);
+ SCHECK (64, 4, add);
+ test_addS32_tS16_t8 (S32_ta, S16_tb, S16_tc);
+ SCHECK (32, 8, add);
+ test_addS16_tS8_t16 (S16_ta, S8_tb, S8_tc);
+ SCHECK (16, 16, add);
+ test_subS64_tS32_t4 (S64_ta, S32_tb, S32_tc);
+ SCHECK (64, 4, sub);
+ test_subS32_tS16_t8 (S32_ta, S16_tb, S16_tc);
+ SCHECK (32, 8, sub);
+ test_subS16_tS8_t16 (S16_ta, S8_tb, S8_tc);
+ SCHECK (16, 16, sub);
+
+ test_addU64_tU32_t4 (S64_ta, S32_tb, S32_tc);
+ UCHECK (64, 4, add);
+ test_addU32_tU16_t8 (S32_ta, S16_tb, S16_tc);
+ UCHECK (32, 8, add);
+ test_addU16_tU8_t16 (S16_ta, S8_tb, S8_tc);
+ UCHECK (16, 16, add);
+ test_subU64_tU32_t4 (S64_ta, S32_tb, S32_tc);
+ UCHECK (64, 4, sub);
+ test_subU32_tU16_t8 (S32_ta, S16_tb, S16_tc);
+ UCHECK (32, 8, sub);
+ test_subU16_tU8_t16 (S16_ta, S8_tb, S8_tc);
+ UCHECK (16, 16, sub);
+
+ test_addS16_tS8_t16_neg0 (S16_ta, S8_tb, S8_tc);
+ NCHECK (add_rS16);
+ test_subS16_tS8_t16_neg0 (S16_ta, S8_tb, S8_tc);
+ NCHECK (sub_rS16);
+ test_addS16_tS8_t16_neg1 (S16_ta, S8_tb, S8_tc);
+ NCHECK (add_rS16);
+ test_subS16_tS8_t16_neg1 (S16_ta, S8_tb, S8_tc);
+ NCHECK (sub_rS16);
+ test_addS16_tS8_t16_neg2 (S16_ta, S8_tb, S8_tc);
+ NCHECK (add_rS16);
+ test_subS16_tS8_t16_neg2 (S16_ta, S8_tb, S8_tc);
+ NCHECK (sub_rS16);
+ test_subS16_tS8_t16_neg3 (S16_ta, S8_tb, S8_tc);
+ NCHECK (neg_r);
+
+ return 0;
+}
+
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/arm/iordi3-opt.c b/gcc/testsuite/gcc.target/arm/iordi3-opt.c
new file mode 100644
index 00000000000..b3f465b7492
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/iordi3-opt.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+unsigned long long or64 (unsigned long long input)
+{
+ return input | 0x200000004ULL;
+}
+
+/* { dg-final { scan-assembler-not "mov\[\\t \]+.+,\[\\t \]*.+" } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr56184.C b/gcc/testsuite/gcc.target/arm/pr56184.C
index db92db13f9e..d44c1b432da 100644
--- a/gcc/testsuite/gcc.target/arm/pr56184.C
+++ b/gcc/testsuite/gcc.target/arm/pr56184.C
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors" } */
+/* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors" } */
typedef unsigned int size_t;
__extension__ typedef int __intptr_t;
diff --git a/gcc/testsuite/gcc.target/arm/unaligned-memcpy-3.c b/gcc/testsuite/gcc.target/arm/unaligned-memcpy-3.c
index 9e2d1641bbc..d0b09bd48fe 100644
--- a/gcc/testsuite/gcc.target/arm/unaligned-memcpy-3.c
+++ b/gcc/testsuite/gcc.target/arm/unaligned-memcpy-3.c
@@ -4,7 +4,7 @@
#include <string.h>
-char src[16];
+char src[16] = {0};
void aligned_src (char *dest)
{
diff --git a/gcc/testsuite/gcc.target/arm/unaligned-memcpy-4.c b/gcc/testsuite/gcc.target/arm/unaligned-memcpy-4.c
index 4708c510140..830e22e09df 100644
--- a/gcc/testsuite/gcc.target/arm/unaligned-memcpy-4.c
+++ b/gcc/testsuite/gcc.target/arm/unaligned-memcpy-4.c
@@ -4,8 +4,8 @@
#include <string.h>
-char src[16];
-char dest[16];
+char src[16] = { 0 };
+char dest[16] = { 0 };
void aligned_both (void)
{
diff --git a/gcc/testsuite/gcc.target/arm/xordi3-opt.c b/gcc/testsuite/gcc.target/arm/xordi3-opt.c
new file mode 100644
index 00000000000..7e031c3af2c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/xordi3-opt.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+unsigned long long xor64 (unsigned long long input)
+{
+ return input ^ 0x200000004ULL;
+}
+
+/* { dg-final { scan-assembler-not "mov\[\\t \]+.+,\[\\t \]*.+" } } */
diff --git a/gcc/testsuite/gcc.target/h8300/h8300.exp b/gcc/testsuite/gcc.target/h8300/h8300.exp
new file mode 100644
index 00000000000..474fc454ce3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/h8300/h8300.exp
@@ -0,0 +1,82 @@
+# Copyright (C) 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a h8300 target.
+if ![istarget h8300*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
+# Copyright (C) 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a h8300 target.
+if ![istarget h8300*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/h8300/pragma-isr.c b/gcc/testsuite/gcc.target/h8300/pragma-isr.c
new file mode 100644
index 00000000000..24fba30d8b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/h8300/pragma-isr.c
@@ -0,0 +1,40 @@
+/* Check whether rte is generated for two ISRs. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "-O3" } */
+/* { dg-final { scan-assembler-times "rte" 2} } */
+
+extern void foo (void);
+
+#pragma interrupt
+void
+isr1 (void)
+{
+ foo ();
+}
+
+#pragma interrupt
+void
+isr2 (void)
+{
+ foo ();
+}
+/* Check whether rte is generated for two ISRs. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "-O3" } */
+/* { dg-final { scan-assembler-times "rte" 2} } */
+
+extern void foo (void);
+
+#pragma interrupt
+void
+isr1 (void)
+{
+ foo ();
+}
+
+#pragma interrupt
+void
+isr2 (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/h8300/pragma-isr2.c b/gcc/testsuite/gcc.target/h8300/pragma-isr2.c
new file mode 100644
index 00000000000..7c242ec3112
--- /dev/null
+++ b/gcc/testsuite/gcc.target/h8300/pragma-isr2.c
@@ -0,0 +1,42 @@
+/* Check whether rte is generated only for an ISR. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+
+#pragma interrupt
+void
+isr (void)
+{
+}
+
+void
+delay (int a)
+{
+}
+
+int
+main (void)
+{
+ return 0;
+}
+/* Check whether rte is generated only for an ISR. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+
+#pragma interrupt
+void
+isr (void)
+{
+}
+
+void
+delay (int a)
+{
+}
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/20000724-1.c b/gcc/testsuite/gcc.target/i386/20000724-1.c
index cbcd4f1f1d6..e4acdd7e4a7 100644
--- a/gcc/testsuite/gcc.target/i386/20000724-1.c
+++ b/gcc/testsuite/gcc.target/i386/20000724-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-require-effective-target ia32 } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
diff --git a/gcc/testsuite/gcc.target/i386/align-main-3.c b/gcc/testsuite/gcc.target/i386/align-main-3.c
index 6f8c758035c..b3a000acec7 100644
--- a/gcc/testsuite/gcc.target/i386/align-main-3.c
+++ b/gcc/testsuite/gcc.target/i386/align-main-3.c
@@ -1,5 +1,5 @@
/* Test for stack alignment with sibcall optimization. */
-/* { dg-do compile { target { *-*-linux* && ia32 } } } */
+/* { dg-do compile { target { { *-*-linux* *-*-gnu* } && ia32 } } } */
/* { dg-options "-O2 -mpreferred-stack-boundary=4 -mincoming-stack-boundary=2" } */
/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%\[re\]?sp" } } */
/* { dg-final { scan-assembler "call\[\\t \]*foo" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
index e0eb92b57c9..c5afa061963 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store" } */
+/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store -fno-common" } */
#define N 1024
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
index 1a53ba14a00..77eaa422e4b 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store" } */
+/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -fno-common" } */
#define N 1024
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
index 26c993be7e9..e6744a892bc 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -mtune=generic" } */
+/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -mtune=generic -fno-common" } */
#define N 1024
diff --git a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
index 6d734faa25e..85682452fae 100644
--- a/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store" } */
+/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store -fno-common" } */
#define N 1024
diff --git a/gcc/testsuite/gcc.target/i386/cleanup-1.c b/gcc/testsuite/gcc.target/i386/cleanup-1.c
index 1a47fcb0311..fc82f35a0ab 100644
--- a/gcc/testsuite/gcc.target/i386/cleanup-1.c
+++ b/gcc/testsuite/gcc.target/i386/cleanup-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2" } */
/* Test complex CFA value expressions. */
diff --git a/gcc/testsuite/gcc.target/i386/inline-mcpy.c b/gcc/testsuite/gcc.target/i386/inline-mcpy.c
index 7eacb5f9825..c31be050efa 100644
--- a/gcc/testsuite/gcc.target/i386/inline-mcpy.c
+++ b/gcc/testsuite/gcc.target/i386/inline-mcpy.c
@@ -1,7 +1,7 @@
/* Test if we inline memcpy even with -Os, when the user requested it. */
/* Don't name this test with memcpy in its name, otherwise the scan-assembler
would be confused. */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-Os -minline-all-stringops" } */
/* { dg-final { scan-assembler-not "memcpy" } } */
char f(int i)
diff --git a/gcc/testsuite/gcc.target/i386/memcpy-1.c b/gcc/testsuite/gcc.target/i386/memcpy-1.c
index bc6f95ab6b4..b716c5d9583 100644
--- a/gcc/testsuite/gcc.target/i386/memcpy-1.c
+++ b/gcc/testsuite/gcc.target/i386/memcpy-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
-/* { dg-options "-O2 -march=pentiumpro -minline-all-stringops" } */
+/* { dg-options "-O2 -march=pentiumpro -minline-all-stringops -fno-common" } */
/* { dg-final { scan-assembler "rep" } } */
/* { dg-final { scan-assembler "movs" } } */
/* { dg-final { scan-assembler-not "test" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32268.c b/gcc/testsuite/gcc.target/i386/pr32268.c
index a5d673ad94f..66ed5061947 100644
--- a/gcc/testsuite/gcc.target/i386/pr32268.c
+++ b/gcc/testsuite/gcc.target/i386/pr32268.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2" } */
extern void abort(void);
diff --git a/gcc/testsuite/gcc.target/i386/pr36613.c b/gcc/testsuite/gcc.target/i386/pr36613.c
index e9d7d11cedc..358e1cd725a 100644
--- a/gcc/testsuite/gcc.target/i386/pr36613.c
+++ b/gcc/testsuite/gcc.target/i386/pr36613.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */
+/* { dg-do run { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ilp32 } } } */
/* { dg-options "-Os" } */
/* PR target/36613 */
diff --git a/gcc/testsuite/gcc.target/i386/pr39013-1.c b/gcc/testsuite/gcc.target/i386/pr39013-1.c
index 25f02fcdba6..1bfab88b7fa 100644
--- a/gcc/testsuite/gcc.target/i386/pr39013-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr39013-1.c
@@ -1,5 +1,5 @@
/* PR target/39013 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fpie -std=gnu89" } */
inline int foo (void);
diff --git a/gcc/testsuite/gcc.target/i386/pr39013-2.c b/gcc/testsuite/gcc.target/i386/pr39013-2.c
index 615d54900f8..a85ce76e4c0 100644
--- a/gcc/testsuite/gcc.target/i386/pr39013-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr39013-2.c
@@ -1,5 +1,5 @@
/* PR target/39013 */
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fpie -std=gnu99" } */
inline int foo (void); /* { dg-warning "declared but never defined" } */
diff --git a/gcc/testsuite/gcc.target/i386/pr39496.c b/gcc/testsuite/gcc.target/i386/pr39496.c
index e14c87513ca..6efc0b8bb6d 100644
--- a/gcc/testsuite/gcc.target/i386/pr39496.c
+++ b/gcc/testsuite/gcc.target/i386/pr39496.c
@@ -1,5 +1,5 @@
/* PR target/39496 */
-/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ia32 } } } */
+/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && ia32 } } } */
/* { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -mtune=i686 -msse2 -mfpmath=sse" } */
/* Verify that {foo,bar}{,2}param are all passed on the stack, using
normal calling conventions, when not optimizing. */
diff --git a/gcc/testsuite/gcc.target/i386/pr40906-3.c b/gcc/testsuite/gcc.target/i386/pr40906-3.c
index ac7d183b71a..13be303cd28 100644
--- a/gcc/testsuite/gcc.target/i386/pr40906-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr40906-3.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
/* { dg-require-effective-target ia32 } */
/* { dg-require-effective-target sse2 } */
/* { dg-options "-O2 -fomit-frame-pointer -fno-asynchronous-unwind-tables -msse2 -mpush-args -mno-accumulate-outgoing-args" } */
diff --git a/gcc/testsuite/gcc.target/i386/pr46084.c b/gcc/testsuite/gcc.target/i386/pr46084.c
index 3ca22eb2923..30bac08cc95 100644
--- a/gcc/testsuite/gcc.target/i386/pr46084.c
+++ b/gcc/testsuite/gcc.target/i386/pr46084.c
@@ -1,6 +1,6 @@
/* This test needs to use setrlimit to set the stack size, so it can
only run on Unix. */
-/* { dg-do run { target *-*-linux* *-*-solaris* *-*-darwin* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
/* { dg-require-effective-target avx_runtime } */
/* { dg-require-effective-target split_stack } */
/* { dg-options "-fsplit-stack -O2 -mavx" } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56564-1.c b/gcc/testsuite/gcc.target/i386/pr56564-1.c
new file mode 100644
index 00000000000..13955bcd1d3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56564-1.c
@@ -0,0 +1,26 @@
+/* PR target/56564 */
+/* { dg-do compile { target { fpic && lp64 } } } */
+/* { dg-skip-if "No symbol interposition for PIC" { *-*-mingw* *-*-cygwin* *-*-darwin* } } */
+/* { dg-options "-O3 -fpic -fdump-tree-optimized" } */
+
+struct S { long a, b; } s = { 5, 6 };
+char t[16] = { 7 };
+
+int
+foo (void)
+{
+ return ((__UINTPTR_TYPE__) &s) & 15;
+}
+
+int
+bar (void)
+{
+ return ((__UINTPTR_TYPE__) &t[0]) & 15;
+}
+
+/* { dg-final { scan-tree-dump-times "&s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&t" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]s:" { target { *-*-linux* } } } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]t:" { target { *-*-linux* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56564-2.c b/gcc/testsuite/gcc.target/i386/pr56564-2.c
new file mode 100644
index 00000000000..fc89a4ccafc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56564-2.c
@@ -0,0 +1,25 @@
+/* PR target/56564 */
+/* { dg-do compile { target { *-*-linux* && lp64 } } } */
+/* { dg-options "-O3 -fno-pic -fdump-tree-optimized" } */
+
+struct S { long a, b; } s = { 5, 6 };
+char t[16] = { 7 };
+
+int
+foo (void)
+{
+ return ((__UINTPTR_TYPE__) &s) & 15;
+}
+
+int
+bar (void)
+{
+ return ((__UINTPTR_TYPE__) &t[0]) & 15;
+}
+
+/* { dg-final { scan-tree-dump-times "&s" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&t" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 2 "optimized" } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]s:" { target { *-*-linux* } } } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]t:" { target { *-*-linux* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56564-3.c b/gcc/testsuite/gcc.target/i386/pr56564-3.c
new file mode 100644
index 00000000000..d45bffb0699
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56564-3.c
@@ -0,0 +1,29 @@
+/* PR target/56564 */
+/* { dg-do compile { target { fpic && lp64 } } } */
+/* { dg-skip-if "No symbol interposition for PIC" { *-*-mingw* *-*-cygwin* *-*-darwin* } } */
+/* { dg-options "-O3 -fpic -fdump-tree-optimized" } */
+
+__thread struct S { long a, b; } s = { 5, 6 };
+__thread char t[16] = { 7 };
+
+int
+foo (void)
+{
+ return ((__UINTPTR_TYPE__) &s) & 15;
+}
+
+/* For backwards compatibility we don't assume that t must
+ be aligned to 16 bytes, but align it anyway. */
+
+int
+bar (void)
+{
+ return ((__UINTPTR_TYPE__) &t[0]) & 15;
+}
+
+/* { dg-final { scan-tree-dump-times "&s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&t" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 0 "optimized" } } */
+/* { dg-final { scan-assembler-not ".align\[ \t]*16\[^:]*\[\n\r]s:" { target { *-*-linux* } } } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]t:" { target { *-*-linux* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56564-4.c b/gcc/testsuite/gcc.target/i386/pr56564-4.c
new file mode 100644
index 00000000000..a0b3d3d3940
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56564-4.c
@@ -0,0 +1,22 @@
+/* PR target/56564 */
+/* { dg-do compile { target { *-*-linux* && lp64 } } } */
+/* { dg-options "-O3 -fno-pic -fdump-tree-optimized" } */
+
+__thread struct S { long a, b; } s = { 5, 6 };
+__thread char t[16] = { 7 };
+
+int
+foo (void)
+{
+ return ((__UINTPTR_TYPE__) &s) & 15;
+}
+
+int
+bar (void)
+{
+ return ((__UINTPTR_TYPE__) &t[0]) & 15;
+}
+
+/* { dg-final { scan-assembler-not ".align\[ \t]*16\[^:]*\[\n\r]s:" { target { *-*-linux* } } } } */
+/* { dg-final { scan-assembler ".align\[ \t]*16\[^:]*\[\n\r]t:" { target { *-*-linux* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr57459.c b/gcc/testsuite/gcc.target/i386/pr57459.c
new file mode 100644
index 00000000000..75101145afc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr57459.c
@@ -0,0 +1,60 @@
+/* PR rtl-optimization/57459 */
+/* { dg-do run } */
+/* { dg-options "-fno-inline -O2 -minline-all-stringops -fno-omit-frame-pointer" } */
+
+int total1[10], total2[10], total3[10], total4[10], total5[10], a[20];
+int len;
+
+void stackclean() {
+ void *ptr = __builtin_alloca(20000);
+ __builtin_memset(ptr, 0, 20000);
+}
+
+void foo(const char *s) {
+ int r1 = a[1];
+ int r2 = a[2];
+ int r3 = a[3];
+ int r4 = a[4];
+ int r5 = a[5];
+
+ len = __builtin_strlen(s);
+
+ if (s != 0)
+ return;
+
+ while (r1) {
+ total1[r1] = r1;
+ r1--;
+ }
+
+ while (r2) {
+ total2[r2] = r2;
+ r2--;
+ }
+
+ while (r3) {
+ total3[r3] = r3;
+ r3--;
+ }
+
+ while (r4) {
+ total4[r4] = r4;
+ r4--;
+ }
+
+ while (r5) {
+ total5[r5] = r5;
+ r5--;
+ }
+}
+
+extern void abort (void);
+
+int main() {
+ stackclean();
+ foo("abcdefgh");
+ if (len != 8)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/vect-sizes-1.c b/gcc/testsuite/gcc.target/i386/vect-sizes-1.c
index 3c18f3bd699..6ca38d2fe47 100644
--- a/gcc/testsuite/gcc.target/i386/vect-sizes-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-sizes-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -ffast-math -mavx -mtune=generic" } */
+/* { dg-options "-O3 -ffast-math -mavx -mtune=generic -fno-common" } */
double a[1024];
diff --git a/gcc/testsuite/gcc.target/mips/memcpy-1.c b/gcc/testsuite/gcc.target/mips/memcpy-1.c
index f4e4698141e..94786a7371f 100644
--- a/gcc/testsuite/gcc.target/mips/memcpy-1.c
+++ b/gcc/testsuite/gcc.target/mips/memcpy-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-options "-fno-common" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler-not "\tlbu\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index 15b1386bd9e..54c97db2481 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -286,6 +286,7 @@ foreach option {
# Add -ffoo/-fno-foo options to mips_option_groups.
foreach option {
+ common
delayed-branch
expensive-optimizations
fast-math
diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-1.c b/gcc/testsuite/gcc.target/mips/umips-branch-1.c
new file mode 100644
index 00000000000..441abcaf3ad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/umips-branch-1.c
@@ -0,0 +1,10 @@
+/* { dg-options "(-mmicromips)" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+
+int MICROMIPS
+foo (void)
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler "\tjr?\t\\\$31\n\tmove\t\\\$2,\\\$0" } } */
diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-2.c b/gcc/testsuite/gcc.target/mips/umips-branch-2.c
new file mode 100644
index 00000000000..15647631180
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/umips-branch-2.c
@@ -0,0 +1,10 @@
+/* { dg-options "(-mmicromips)" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+
+int MICROMIPS
+foo (int *x)
+{
+ return x[5000];
+}
+
+/* { dg-final { scan-assembler "\tjr?\t\\\$31\n\tlw\t\\\$2,20000\\(\\\$4\\)" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/atomic-p7.c b/gcc/testsuite/gcc.target/powerpc/atomic-p7.c
new file mode 100644
index 00000000000..3442bfba4cd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/atomic-p7.c
@@ -0,0 +1,207 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mcpu=power7 -O2" } */
+/* { dg-final { scan-assembler-not "lbarx" } } */
+/* { dg-final { scan-assembler-not "lharx" } } */
+/* { dg-final { scan-assembler-times "lwarx" 18 } } */
+/* { dg-final { scan-assembler-times "ldarx" 6 } } */
+/* { dg-final { scan-assembler-not "lqarx" } } */
+/* { dg-final { scan-assembler-not "stbcx" } } */
+/* { dg-final { scan-assembler-not "sthcx" } } */
+/* { dg-final { scan-assembler-times "stwcx" 18 } } */
+/* { dg-final { scan-assembler-times "stdcx" 6 } } */
+/* { dg-final { scan-assembler-not "stqcx" } } */
+/* { dg-final { scan-assembler-times "bl __atomic" 6 } } */
+/* { dg-final { scan-assembler-times "isync" 12 } } */
+/* { dg-final { scan-assembler-times "lwsync" 8 } } */
+/* { dg-final { scan-assembler-not "mtvsrd" } } */
+/* { dg-final { scan-assembler-not "mtvsrwa" } } */
+/* { dg-final { scan-assembler-not "mtvsrwz" } } */
+/* { dg-final { scan-assembler-not "mfvsrd" } } */
+/* { dg-final { scan-assembler-not "mfvsrwz" } } */
+
+/* Test for the byte atomic operations on power8 using lbarx/stbcx. */
+char
+char_fetch_add_relaxed (char *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+char
+char_fetch_sub_consume (char *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+char
+char_fetch_and_acquire (char *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+char
+char_fetch_ior_release (char *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+char
+char_fetch_xor_acq_rel (char *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+char
+char_fetch_nand_seq_cst (char *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+/* Test for the half word atomic operations on power8 using lharx/sthcx. */
+short
+short_fetch_add_relaxed (short *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+short
+short_fetch_sub_consume (short *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+short
+short_fetch_and_acquire (short *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+short
+short_fetch_ior_release (short *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+short
+short_fetch_xor_acq_rel (short *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+short
+short_fetch_nand_seq_cst (short *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+/* Test for the word atomic operations on power8 using lwarx/stwcx. */
+int
+int_fetch_add_relaxed (int *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+int
+int_fetch_sub_consume (int *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+int
+int_fetch_and_acquire (int *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+int
+int_fetch_ior_release (int *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+int
+int_fetch_xor_acq_rel (int *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+int
+int_fetch_nand_seq_cst (int *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+/* Test for the double word atomic operations on power8 using ldarx/stdcx. */
+long
+long_fetch_add_relaxed (long *ptr, long value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+long
+long_fetch_sub_consume (long *ptr, long value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+long
+long_fetch_and_acquire (long *ptr, long value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+long
+long_fetch_ior_release (long *ptr, long value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+long
+long_fetch_xor_acq_rel (long *ptr, long value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+long
+long_fetch_nand_seq_cst (long *ptr, long value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+/* Test for the quad word atomic operations on power8 using ldarx/stdcx. */
+__int128_t
+quad_fetch_add_relaxed (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+__int128_t
+quad_fetch_sub_consume (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+__int128_t
+quad_fetch_and_acquire (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+__int128_t
+quad_fetch_ior_release (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+__int128_t
+quad_fetch_xor_acq_rel (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+__int128_t
+quad_fetch_nand_seq_cst (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/atomic-p8.c b/gcc/testsuite/gcc.target/powerpc/atomic-p8.c
new file mode 100644
index 00000000000..17460ac4c73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/atomic-p8.c
@@ -0,0 +1,237 @@
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-final { scan-assembler-times "lbarx" 7 } } */
+/* { dg-final { scan-assembler-times "lharx" 7 } } */
+/* { dg-final { scan-assembler-times "lwarx" 7 } } */
+/* { dg-final { scan-assembler-times "ldarx" 7 } } */
+/* { dg-final { scan-assembler-times "lqarx" 7 } } */
+/* { dg-final { scan-assembler-times "stbcx" 7 } } */
+/* { dg-final { scan-assembler-times "sthcx" 7 } } */
+/* { dg-final { scan-assembler-times "stwcx" 7 } } */
+/* { dg-final { scan-assembler-times "stdcx" 7 } } */
+/* { dg-final { scan-assembler-times "stqcx" 7 } } */
+/* { dg-final { scan-assembler-not "bl __atomic" } } */
+/* { dg-final { scan-assembler-times "isync" 20 } } */
+/* { dg-final { scan-assembler-times "lwsync" 10 } } */
+/* { dg-final { scan-assembler-not "mtvsrd" } } */
+/* { dg-final { scan-assembler-not "mtvsrwa" } } */
+/* { dg-final { scan-assembler-not "mtvsrwz" } } */
+/* { dg-final { scan-assembler-not "mfvsrd" } } */
+/* { dg-final { scan-assembler-not "mfvsrwz" } } */
+
+/* Test for the byte atomic operations on power8 using lbarx/stbcx. */
+char
+char_fetch_add_relaxed (char *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+char
+char_fetch_sub_consume (char *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+char
+char_fetch_and_acquire (char *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+char
+char_fetch_ior_release (char *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+char
+char_fetch_xor_acq_rel (char *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+char
+char_fetch_nand_seq_cst (char *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+void
+char_val_compare_and_swap (char *p, int i, int j, char *q)
+{
+ *q = __sync_val_compare_and_swap (p, i, j);
+}
+
+/* Test for the half word atomic operations on power8 using lharx/sthcx. */
+short
+short_fetch_add_relaxed (short *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+short
+short_fetch_sub_consume (short *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+short
+short_fetch_and_acquire (short *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+short
+short_fetch_ior_release (short *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+short
+short_fetch_xor_acq_rel (short *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+short
+short_fetch_nand_seq_cst (short *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+void
+short_val_compare_and_swap (short *p, int i, int j, short *q)
+{
+ *q = __sync_val_compare_and_swap (p, i, j);
+}
+
+/* Test for the word atomic operations on power8 using lwarx/stwcx. */
+int
+int_fetch_add_relaxed (int *ptr, int value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+int
+int_fetch_sub_consume (int *ptr, int value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+int
+int_fetch_and_acquire (int *ptr, int value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+int
+int_fetch_ior_release (int *ptr, int value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+int
+int_fetch_xor_acq_rel (int *ptr, int value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+int
+int_fetch_nand_seq_cst (int *ptr, int value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+void
+int_val_compare_and_swap (int *p, int i, int j, int *q)
+{
+ *q = __sync_val_compare_and_swap (p, i, j);
+}
+
+/* Test for the double word atomic operations on power8 using ldarx/stdcx. */
+long
+long_fetch_add_relaxed (long *ptr, long value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+long
+long_fetch_sub_consume (long *ptr, long value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+long
+long_fetch_and_acquire (long *ptr, long value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+long
+long_fetch_ior_release (long *ptr, long value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+long
+long_fetch_xor_acq_rel (long *ptr, long value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+long
+long_fetch_nand_seq_cst (long *ptr, long value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+void
+long_val_compare_and_swap (long *p, long i, long j, long *q)
+{
+ *q = __sync_val_compare_and_swap (p, i, j);
+}
+
+/* Test for the quad word atomic operations on power8 using ldarx/stdcx. */
+__int128_t
+quad_fetch_add_relaxed (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_add (ptr, value, __ATOMIC_RELAXED);
+}
+
+__int128_t
+quad_fetch_sub_consume (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_sub (ptr, value, __ATOMIC_CONSUME);
+}
+
+__int128_t
+quad_fetch_and_acquire (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_and (ptr, value, __ATOMIC_ACQUIRE);
+}
+
+__int128_t
+quad_fetch_ior_release (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_or (ptr, value, __ATOMIC_RELEASE);
+}
+
+__int128_t
+quad_fetch_xor_acq_rel (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_xor (ptr, value, __ATOMIC_ACQ_REL);
+}
+
+__int128_t
+quad_fetch_nand_seq_cst (__int128_t *ptr, __int128_t value)
+{
+ return __atomic_fetch_nand (ptr, value, __ATOMIC_SEQ_CST);
+}
+
+void
+quad_val_compare_and_swap (__int128_t *p, __int128_t i, __int128_t j, __int128_t *q)
+{
+ *q = __sync_val_compare_and_swap (p, i, j);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/bool.c b/gcc/testsuite/gcc.target/powerpc/bool.c
new file mode 100644
index 00000000000..f007db4b5bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/bool.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "eqv" } } */
+/* { dg-final { scan-assembler "nand" } } */
+/* { dg-final { scan-assembler "nor" } } */
+
+#ifndef TYPE
+#define TYPE unsigned long
+#endif
+
+TYPE op1 (TYPE a, TYPE b) { return ~(a ^ b); } /* eqv */
+TYPE op2 (TYPE a, TYPE b) { return ~(a & b); } /* nand */
+TYPE op3 (TYPE a, TYPE b) { return ~(a | b); } /* nor */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c
index 8fd4f079567..87291954ee3 100644
--- a/gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/crypto-builtin-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
-/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
typedef vector unsigned long long crypto_t;
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c
new file mode 100644
index 00000000000..534a04a937b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-double1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-final { scan-assembler-times "mtvsrd" 1 } } */
+/* { dg-final { scan-assembler-times "mfvsrd" 1 } } */
+
+/* Check code generation for direct move for long types. */
+
+#define TYPE double
+#define IS_FLOAT 1
+#define NO_ALTIVEC 1
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c
new file mode 100644
index 00000000000..750debfc0df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-double2.c
@@ -0,0 +1,14 @@
+/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+/* Check whether we get the right bits for direct move at runtime. */
+
+#define TYPE double
+#define IS_FLOAT 1
+#define NO_ALTIVEC 1
+#define DO_MAIN
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c
new file mode 100644
index 00000000000..ff1e97c0d43
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-float1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-final { scan-assembler-times "mtvsrd" 2 } } */
+/* { dg-final { scan-assembler-times "mfvsrd" 2 } } */
+/* { dg-final { scan-assembler-times "xscvdpspn" 2 } } */
+/* { dg-final { scan-assembler-times "xscvspdpn" 2 } } */
+
+/* Check code generation for direct move for long types. */
+
+#define TYPE float
+#define IS_FLOAT 1
+#define NO_ALTIVEC 1
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c
new file mode 100644
index 00000000000..ace728ff6d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-float2.c
@@ -0,0 +1,14 @@
+/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+/* Check whether we get the right bits for direct move at runtime. */
+
+#define TYPE float
+#define IS_FLOAT 1
+#define NO_ALTIVEC 1
+#define DO_MAIN
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c
new file mode 100644
index 00000000000..907e802c72b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-long1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-final { scan-assembler-times "mtvsrd" 1 } } */
+/* { dg-final { scan-assembler-times "mfvsrd" 2 } } */
+
+/* Check code generation for direct move for long types. */
+
+#define TYPE long
+#define IS_INT 1
+#define NO_ALTIVEC 1
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c
new file mode 100644
index 00000000000..fba613e4548
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-long2.c
@@ -0,0 +1,14 @@
+/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+/* Check whether we get the right bits for direct move at runtime. */
+
+#define TYPE long
+#define IS_INT 1
+#define NO_ALTIVEC 1
+#define DO_MAIN
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c b/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c
new file mode 100644
index 00000000000..cdfa18857f1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-vint1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+/* { dg-final { scan-assembler-times "mtvsrd" 4 } } */
+/* { dg-final { scan-assembler-times "mfvsrd" 4 } } */
+
+/* Check code generation for direct move for long types. */
+
+#define TYPE vector int
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c b/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c
new file mode 100644
index 00000000000..5c0c9abdac5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move-vint2.c
@@ -0,0 +1,12 @@
+/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+/* Check whether we get the right bits for direct move at runtime. */
+
+#define TYPE vector int
+#define DO_MAIN
+
+#include "direct-move.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/direct-move.h b/gcc/testsuite/gcc.target/powerpc/direct-move.h
new file mode 100644
index 00000000000..4e84fd678bb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/direct-move.h
@@ -0,0 +1,183 @@
+/* Test functions for direct move support. */
+
+
+void __attribute__((__noinline__))
+copy (TYPE *a, TYPE *b)
+{
+ *b = *a;
+}
+
+#ifndef NO_GPR
+void __attribute__((__noinline__))
+load_gpr (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ __asm__ ("# gpr, reg = %0" : "+b" (c));
+ *b = c;
+}
+#endif
+
+#ifndef NO_FPR
+void __attribute__((__noinline__))
+load_fpr (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ __asm__ ("# fpr, reg = %0" : "+d" (c));
+ *b = c;
+}
+#endif
+
+#ifndef NO_ALTIVEC
+void __attribute__((__noinline__))
+load_altivec (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ __asm__ ("# altivec, reg = %0" : "+v" (c));
+ *b = c;
+}
+#endif
+
+#ifndef NO_VSX
+void __attribute__((__noinline__))
+load_vsx (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ __asm__ ("# vsx, reg = %x0" : "+wa" (c));
+ *b = c;
+}
+#endif
+
+#ifndef NO_GPR_TO_VSX
+void __attribute__((__noinline__))
+load_gpr_to_vsx (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ TYPE d;
+ __asm__ ("# gpr, reg = %0" : "+b" (c));
+ d = c;
+ __asm__ ("# vsx, reg = %x0" : "+wa" (d));
+ *b = d;
+}
+#endif
+
+#ifndef NO_VSX_TO_GPR
+void __attribute__((__noinline__))
+load_vsx_to_gpr (TYPE *a, TYPE *b)
+{
+ TYPE c = *a;
+ TYPE d;
+ __asm__ ("# vsx, reg = %x0" : "+wa" (c));
+ d = c;
+ __asm__ ("# gpr, reg = %0" : "+b" (d));
+ *b = d;
+}
+#endif
+
+#ifdef DO_MAIN
+typedef void (fn_type (TYPE *, TYPE *));
+
+struct test_struct {
+ fn_type *func;
+ const char *name;
+};
+
+const struct test_struct test_functions[] = {
+ { copy, "copy" },
+#ifndef NO_GPR
+ { load_gpr, "load_gpr" },
+#endif
+#ifndef NO_FPR
+ { load_fpr, "load_fpr" },
+#endif
+#ifndef NO_ALTIVEC
+ { load_altivec, "load_altivec" },
+#endif
+#ifndef NO_VSX
+ { load_vsx, "load_vsx" },
+#endif
+#ifndef NO_GPR_TO_VSX
+ { load_gpr_to_vsx, "load_gpr_to_vsx" },
+#endif
+#ifndef NO_VSX_TO_GPR
+ { load_vsx_to_gpr, "load_vsx_to_gpr" },
+#endif
+};
+
+/* Test a given value for each of the functions. */
+void __attribute__((__noinline__))
+test_value (TYPE a)
+{
+ size_t i;
+
+ for (i = 0; i < sizeof (test_functions) / sizeof (test_functions[0]); i++)
+ {
+ TYPE b;
+
+ test_functions[i].func (&a, &b);
+ if (memcmp ((void *)&a, (void *)&b, sizeof (TYPE)) != 0)
+ abort ();
+ }
+}
+
+/* Main program. */
+int
+main (void)
+{
+ size_t i;
+ long j;
+ union {
+ TYPE value;
+ unsigned char bytes[sizeof (TYPE)];
+ } u;
+
+#if IS_INT
+ TYPE value = (TYPE)-5;
+ for (i = 0; i < 12; i++)
+ {
+ test_value (value);
+ value++;
+ }
+
+ for (i = 0; i < 8*sizeof (TYPE); i++)
+ test_value (((TYPE)1) << i);
+
+#elif IS_UNS
+ TYPE value = (TYPE)0;
+ for (i = 0; i < 10; i++)
+ {
+ test_value (value);
+ test_value (~ value);
+ value++;
+ }
+
+ for (i = 0; i < 8*sizeof (TYPE); i++)
+ test_value (((TYPE)1) << i);
+
+#elif IS_FLOAT
+ TYPE value = (TYPE)-5;
+ for (i = 0; i < 12; i++)
+ {
+ test_value (value);
+ value++;
+ }
+
+ test_value ((TYPE)3.1415926535);
+ test_value ((TYPE)1.23456);
+ test_value ((TYPE)(-0.0));
+ test_value ((TYPE)NAN);
+ test_value ((TYPE)+INFINITY);
+ test_value ((TYPE)-INFINITY);
+#else
+
+ for (j = 0; j < 10; j++)
+ {
+ for (i = 0; i < sizeof (TYPE); i++)
+ u.bytes[i] = (unsigned char) (random () >> 4);
+
+ test_value (u.value);
+ }
+#endif
+
+ return 0;
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/powerpc/e500-ord-1.c b/gcc/testsuite/gcc.target/powerpc/e500-ord-1.c
new file mode 100644
index 00000000000..c4f2769901c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/e500-ord-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target powerpc*-*-eabi* } } */
+/* { dg-options "-O -ftrapping-math -fdump-rtl-final" } */
+
+int isgreater (float f1, float f2)
+{
+ int r = (f1 > f2);
+ return !r ? -1 : 1;
+}
+
+int isgreaterequal (float f1, float f2)
+{
+ int r = (f1 >= f2);
+ return !r ? -1 : 1;
+}
+
+int isless (float f1, float f2)
+{
+ int r = (f1 < f2);
+ return !r ? -1 : 1;
+}
+
+int islessequal (float f1, float f2)
+{
+ int r = (f1 <= f2);
+ return !r ? -1 : 1;
+}
+
+/* { dg-final { scan-rtl-dump-not "__unordsf2" "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/e500-ord-2.c b/gcc/testsuite/gcc.target/powerpc/e500-ord-2.c
new file mode 100644
index 00000000000..a6b5c297370
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/e500-ord-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target powerpc*-*-eabi* } } */
+/* { dg-options "-O -fno-trapping-math -fdump-rtl-final" } */
+
+int isgreater (float f1, float f2)
+{
+ int r = (f1 > f2);
+ return !r ? -1 : 1;
+}
+
+int isgreaterequal (float f1, float f2)
+{
+ int r = (f1 >= f2);
+ return !r ? -1 : 1;
+}
+
+int isless (float f1, float f2)
+{
+ int r = (f1 < f2);
+ return !r ? -1 : 1;
+}
+
+int islessequal (float f1, float f2)
+{
+ int r = (f1 <= f2);
+ return !r ? -1 : 1;
+}
+
+/* { dg-final { scan-rtl-dump-not "__unordsf2" "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/e500-unord-1.c b/gcc/testsuite/gcc.target/powerpc/e500-unord-1.c
new file mode 100644
index 00000000000..0cd75d8d30d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/e500-unord-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target powerpc*-*-eabi* } } */
+/* { dg-options "-O -ftrapping-math -fdump-rtl-final" } */
+
+int isgreater (float f1, float f2)
+{
+ int r = __builtin_isgreater (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int isgreaterequal (float f1, float f2)
+{
+ int r = __builtin_isgreaterequal (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int isless (float f1, float f2)
+{
+ int r = __builtin_isless (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int islessequal (float f1, float f2)
+{
+ int r = __builtin_islessequal (f1, f2);
+ return !r ? -1 : 1;
+}
+
+/* { dg-final { scan-rtl-dump-times "__unordsf2" 4 "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/e500-unord-2.c b/gcc/testsuite/gcc.target/powerpc/e500-unord-2.c
new file mode 100644
index 00000000000..51b1316f271
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/e500-unord-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target powerpc*-*-eabi* } } */
+/* { dg-options "-O -fno-trapping-math -fdump-rtl-final" } */
+
+int isgreater (float f1, float f2)
+{
+ int r = __builtin_isgreater (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int isgreaterequal (float f1, float f2)
+{
+ int r = __builtin_isgreaterequal (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int isless (float f1, float f2)
+{
+ int r = __builtin_isless (f1, f2);
+ return !r ? -1 : 1;
+}
+
+int islessequal (float f1, float f2)
+{
+ int r = __builtin_islessequal (f1, f2);
+ return !r ? -1 : 1;
+}
+
+/* { dg-final { scan-rtl-dump-not "__unordsf2" "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-1.c
new file mode 100644
index 00000000000..6fd3acc2a9d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-1.c
@@ -0,0 +1,65 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#ifndef TYPE
+#define TYPE long long
+#endif
+
+#ifndef SIGN_TYPE
+#define SIGN_TYPE signed TYPE
+#endif
+
+#ifndef UNS_TYPE
+#define UNS_TYPE unsigned TYPE
+#endif
+
+typedef vector SIGN_TYPE v_sign;
+typedef vector UNS_TYPE v_uns;
+
+v_sign sign_add (v_sign a, v_sign b)
+{
+ return a + b;
+}
+
+v_sign sign_sub (v_sign a, v_sign b)
+{
+ return a - b;
+}
+
+v_sign sign_shift_left (v_sign a, v_sign b)
+{
+ return a << b;
+}
+
+v_sign sign_shift_right (v_sign a, v_sign b)
+{
+ return a >> b;
+}
+
+v_uns uns_add (v_uns a, v_uns b)
+{
+ return a + b;
+}
+
+v_uns uns_sub (v_uns a, v_uns b)
+{
+ return a - b;
+}
+
+v_uns uns_shift_left (v_uns a, v_uns b)
+{
+ return a << b;
+}
+
+v_uns uns_shift_right (v_uns a, v_uns b)
+{
+ return a >> b;
+}
+
+/* { dg-final { scan-assembler-times "vaddudm" 2 } } */
+/* { dg-final { scan-assembler-times "vsubudm" 2 } } */
+/* { dg-final { scan-assembler-times "vsld" 2 } } */
+/* { dg-final { scan-assembler-times "vsrad" 1 } } */
+/* { dg-final { scan-assembler-times "vsrd" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-2.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-2.c
new file mode 100644
index 00000000000..412040bfa05
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-2.c
@@ -0,0 +1,204 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#include <altivec.h>
+
+typedef vector long long v_sign;
+typedef vector unsigned long long v_uns;
+typedef vector bool long long v_bool;
+
+v_sign sign_add_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vaddudm (a, b);
+}
+
+v_sign sign_add_2 (v_sign a, v_sign b)
+{
+ return vec_add (a, b);
+}
+
+v_sign sign_add_3 (v_sign a, v_sign b)
+{
+ return vec_vaddudm (a, b);
+}
+
+v_sign sign_sub_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vsubudm (a, b);
+}
+
+v_sign sign_sub_2 (v_sign a, v_sign b)
+{
+ return vec_sub (a, b);
+}
+
+
+v_sign sign_sub_3 (v_sign a, v_sign b)
+{
+ return vec_vsubudm (a, b);
+}
+
+v_sign sign_min_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vminsd (a, b);
+}
+
+v_sign sign_min_2 (v_sign a, v_sign b)
+{
+ return vec_min (a, b);
+}
+
+v_sign sign_min_3 (v_sign a, v_sign b)
+{
+ return vec_vminsd (a, b);
+}
+
+v_sign sign_max_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vmaxsd (a, b);
+}
+
+v_sign sign_max_2 (v_sign a, v_sign b)
+{
+ return vec_max (a, b);
+}
+
+v_sign sign_max_3 (v_sign a, v_sign b)
+{
+ return vec_vmaxsd (a, b);
+}
+
+v_sign sign_abs (v_sign a)
+{
+ return vec_abs (a); /* xor, vsubudm, vmaxsd. */
+}
+
+v_bool sign_eq (v_sign a, v_sign b)
+{
+ return vec_cmpeq (a, b);
+}
+
+v_bool sign_lt (v_sign a, v_sign b)
+{
+ return vec_cmplt (a, b);
+}
+
+v_uns uns_add_2 (v_uns a, v_uns b)
+{
+ return vec_add (a, b);
+}
+
+v_uns uns_add_3 (v_uns a, v_uns b)
+{
+ return vec_vaddudm (a, b);
+}
+
+v_uns uns_sub_2 (v_uns a, v_uns b)
+{
+ return vec_sub (a, b);
+}
+
+v_uns uns_sub_3 (v_uns a, v_uns b)
+{
+ return vec_vsubudm (a, b);
+}
+
+v_uns uns_min_2 (v_uns a, v_uns b)
+{
+ return vec_min (a, b);
+}
+
+v_uns uns_min_3 (v_uns a, v_uns b)
+{
+ return vec_vminud (a, b);
+}
+
+v_uns uns_max_2 (v_uns a, v_uns b)
+{
+ return vec_max (a, b);
+}
+
+v_uns uns_max_3 (v_uns a, v_uns b)
+{
+ return vec_vmaxud (a, b);
+}
+
+v_bool uns_eq (v_uns a, v_uns b)
+{
+ return vec_cmpeq (a, b);
+}
+
+v_bool uns_lt (v_uns a, v_uns b)
+{
+ return vec_cmplt (a, b);
+}
+
+v_sign sign_rl_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vrld (a, b);
+}
+
+v_sign sign_rl_2 (v_sign a, v_uns b)
+{
+ return vec_rl (a, b);
+}
+
+v_uns uns_rl_2 (v_uns a, v_uns b)
+{
+ return vec_rl (a, b);
+}
+
+v_sign sign_sl_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vsld (a, b);
+}
+
+v_sign sign_sl_2 (v_sign a, v_uns b)
+{
+ return vec_sl (a, b);
+}
+
+v_sign sign_sl_3 (v_sign a, v_uns b)
+{
+ return vec_vsld (a, b);
+}
+
+v_uns uns_sl_2 (v_uns a, v_uns b)
+{
+ return vec_sl (a, b);
+}
+
+v_uns uns_sl_3 (v_uns a, v_uns b)
+{
+ return vec_vsld (a, b);
+}
+
+v_sign sign_sra_1 (v_sign a, v_sign b)
+{
+ return __builtin_altivec_vsrad (a, b);
+}
+
+v_sign sign_sra_2 (v_sign a, v_uns b)
+{
+ return vec_sra (a, b);
+}
+
+v_sign sign_sra_3 (v_sign a, v_uns b)
+{
+ return vec_vsrad (a, b);
+}
+
+/* { dg-final { scan-assembler-times "vaddudm" 5 } } */
+/* { dg-final { scan-assembler-times "vsubudm" 6 } } */
+/* { dg-final { scan-assembler-times "vmaxsd" 4 } } */
+/* { dg-final { scan-assembler-times "vminsd" 3 } } */
+/* { dg-final { scan-assembler-times "vmaxud" 2 } } */
+/* { dg-final { scan-assembler-times "vminud" 2 } } */
+/* { dg-final { scan-assembler-times "vcmpequd" 2 } } */
+/* { dg-final { scan-assembler-times "vcmpgtsd" 1 } } */
+/* { dg-final { scan-assembler-times "vcmpgtud" 1 } } */
+/* { dg-final { scan-assembler-times "vrld" 3 } } */
+/* { dg-final { scan-assembler-times "vsld" 5 } } */
+/* { dg-final { scan-assembler-times "vsrad" 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-3.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-3.c
new file mode 100644
index 00000000000..b3f725f2d96
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-3.c
@@ -0,0 +1,104 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O3 -ftree-vectorize -fvect-cost-model" } */
+
+#include <altivec.h>
+
+typedef vector long long vll_sign;
+typedef vector unsigned long long vll_uns;
+typedef vector bool long long vll_bool;
+
+typedef vector int vi_sign;
+typedef vector unsigned int vi_uns;
+typedef vector bool int vi_bool;
+
+typedef vector short vs_sign;
+typedef vector unsigned short vs_uns;
+typedef vector bool short vs_bool;
+
+typedef vector signed char vc_sign;
+typedef vector unsigned char vc_uns;
+typedef vector bool char vc_bool;
+
+
+vi_sign vi_pack_1 (vll_sign a, vll_sign b)
+{
+ return __builtin_altivec_vpkudum (a, b);
+}
+
+vi_sign vi_pack_2 (vll_sign a, vll_sign b)
+{
+ return vec_pack (a, b);
+}
+
+vi_sign vi_pack_3 (vll_sign a, vll_sign b)
+{
+ return vec_vpkudum (a, b);
+}
+
+vs_sign vs_pack_1 (vi_sign a, vi_sign b)
+{
+ return __builtin_altivec_vpkuwum (a, b);
+}
+
+vs_sign vs_pack_2 (vi_sign a, vi_sign b)
+{
+ return vec_pack (a, b);
+}
+
+vs_sign vs_pack_3 (vi_sign a, vi_sign b)
+{
+ return vec_vpkuwum (a, b);
+}
+
+vc_sign vc_pack_1 (vs_sign a, vs_sign b)
+{
+ return __builtin_altivec_vpkuhum (a, b);
+}
+
+vc_sign vc_pack_2 (vs_sign a, vs_sign b)
+{
+ return vec_pack (a, b);
+}
+
+vc_sign vc_pack_3 (vs_sign a, vs_sign b)
+{
+ return vec_vpkuhum (a, b);
+}
+
+vll_sign vll_unpack_hi_1 (vi_sign a)
+{
+ return __builtin_altivec_vupkhsw (a);
+}
+
+vll_sign vll_unpack_hi_2 (vi_sign a)
+{
+ return vec_unpackh (a);
+}
+
+vll_sign vll_unpack_hi_3 (vi_sign a)
+{
+ return __builtin_vec_vupkhsw (a);
+}
+
+vll_sign vll_unpack_lo_1 (vi_sign a)
+{
+ return vec_vupklsw (a);
+}
+
+vll_sign vll_unpack_lo_2 (vi_sign a)
+{
+ return vec_unpackl (a);
+}
+
+vll_sign vll_unpack_lo_3 (vi_sign a)
+{
+ return vec_vupklsw (a);
+}
+
+/* { dg-final { scan-assembler-times "vpkudum" 3 } } */
+/* { dg-final { scan-assembler-times "vpkuwum" 3 } } */
+/* { dg-final { scan-assembler-times "vpkuhum" 3 } } */
+/* { dg-final { scan-assembler-times "vupklsw" 3 } } */
+/* { dg-final { scan-assembler-times "vupkhsw" 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-4.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-4.c
new file mode 100644
index 00000000000..518a6aa5e64
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-4.c
@@ -0,0 +1,249 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O3 -ftree-vectorize -fvect-cost-model" } */
+
+#include <altivec.h>
+
+typedef vector long long vll_sign;
+typedef vector unsigned long long vll_uns;
+typedef vector bool long long vll_bool;
+
+typedef vector int vi_sign;
+typedef vector unsigned int vi_uns;
+typedef vector bool int vi_bool;
+
+typedef vector short vs_sign;
+typedef vector unsigned short vs_uns;
+typedef vector bool short vs_bool;
+
+typedef vector signed char vc_sign;
+typedef vector unsigned char vc_uns;
+typedef vector bool char vc_bool;
+
+vll_sign vll_clz_1 (vll_sign a)
+{
+ return __builtin_altivec_vclzd (a);
+}
+
+vll_sign vll_clz_2 (vll_sign a)
+{
+ return vec_vclz (a);
+}
+
+vll_sign vll_clz_3 (vll_sign a)
+{
+ return vec_vclzd (a);
+}
+
+vll_uns vll_clz_4 (vll_uns a)
+{
+ return vec_vclz (a);
+}
+
+vll_uns vll_clz_5 (vll_uns a)
+{
+ return vec_vclzd (a);
+}
+
+vi_sign vi_clz_1 (vi_sign a)
+{
+ return __builtin_altivec_vclzw (a);
+}
+
+vi_sign vi_clz_2 (vi_sign a)
+{
+ return vec_vclz (a);
+}
+
+vi_sign vi_clz_3 (vi_sign a)
+{
+ return vec_vclzw (a);
+}
+
+vi_uns vi_clz_4 (vi_uns a)
+{
+ return vec_vclz (a);
+}
+
+vi_uns vi_clz_5 (vi_uns a)
+{
+ return vec_vclzw (a);
+}
+
+vs_sign vs_clz_1 (vs_sign a)
+{
+ return __builtin_altivec_vclzh (a);
+}
+
+vs_sign vs_clz_2 (vs_sign a)
+{
+ return vec_vclz (a);
+}
+
+vs_sign vs_clz_3 (vs_sign a)
+{
+ return vec_vclzh (a);
+}
+
+vs_uns vs_clz_4 (vs_uns a)
+{
+ return vec_vclz (a);
+}
+
+vs_uns vs_clz_5 (vs_uns a)
+{
+ return vec_vclzh (a);
+}
+
+vc_sign vc_clz_1 (vc_sign a)
+{
+ return __builtin_altivec_vclzb (a);
+}
+
+vc_sign vc_clz_2 (vc_sign a)
+{
+ return vec_vclz (a);
+}
+
+vc_sign vc_clz_3 (vc_sign a)
+{
+ return vec_vclzb (a);
+}
+
+vc_uns vc_clz_4 (vc_uns a)
+{
+ return vec_vclz (a);
+}
+
+vc_uns vc_clz_5 (vc_uns a)
+{
+ return vec_vclzb (a);
+}
+
+vll_sign vll_popcnt_1 (vll_sign a)
+{
+ return __builtin_altivec_vpopcntd (a);
+}
+
+vll_sign vll_popcnt_2 (vll_sign a)
+{
+ return vec_vpopcnt (a);
+}
+
+vll_sign vll_popcnt_3 (vll_sign a)
+{
+ return vec_vpopcntd (a);
+}
+
+vll_uns vll_popcnt_4 (vll_uns a)
+{
+ return vec_vpopcnt (a);
+}
+
+vll_uns vll_popcnt_5 (vll_uns a)
+{
+ return vec_vpopcntd (a);
+}
+
+vi_sign vi_popcnt_1 (vi_sign a)
+{
+ return __builtin_altivec_vpopcntw (a);
+}
+
+vi_sign vi_popcnt_2 (vi_sign a)
+{
+ return vec_vpopcnt (a);
+}
+
+vi_sign vi_popcnt_3 (vi_sign a)
+{
+ return vec_vpopcntw (a);
+}
+
+vi_uns vi_popcnt_4 (vi_uns a)
+{
+ return vec_vpopcnt (a);
+}
+
+vi_uns vi_popcnt_5 (vi_uns a)
+{
+ return vec_vpopcntw (a);
+}
+
+vs_sign vs_popcnt_1 (vs_sign a)
+{
+ return __builtin_altivec_vpopcnth (a);
+}
+
+vs_sign vs_popcnt_2 (vs_sign a)
+{
+ return vec_vpopcnt (a);
+}
+
+vs_sign vs_popcnt_3 (vs_sign a)
+{
+ return vec_vpopcnth (a);
+}
+
+vs_uns vs_popcnt_4 (vs_uns a)
+{
+ return vec_vpopcnt (a);
+}
+
+vs_uns vs_popcnt_5 (vs_uns a)
+{
+ return vec_vpopcnth (a);
+}
+
+vc_sign vc_popcnt_1 (vc_sign a)
+{
+ return __builtin_altivec_vpopcntb (a);
+}
+
+vc_sign vc_popcnt_2 (vc_sign a)
+{
+ return vec_vpopcnt (a);
+}
+
+vc_sign vc_popcnt_3 (vc_sign a)
+{
+ return vec_vpopcntb (a);
+}
+
+vc_uns vc_popcnt_4 (vc_uns a)
+{
+ return vec_vpopcnt (a);
+}
+
+vc_uns vc_popcnt_5 (vc_uns a)
+{
+ return vec_vpopcntb (a);
+}
+
+vc_uns vc_gbb_1 (vc_uns a)
+{
+ return __builtin_altivec_vgbbd (a);
+}
+
+vc_sign vc_gbb_2 (vc_sign a)
+{
+ return vec_vgbbd (a);
+}
+
+vc_uns vc_gbb_3 (vc_uns a)
+{
+ return vec_vgbbd (a);
+}
+
+/* { dg-final { scan-assembler-times "vclzd" 5 } } */
+/* { dg-final { scan-assembler-times "vclzw" 5 } } */
+/* { dg-final { scan-assembler-times "vclzh" 5 } } */
+/* { dg-final { scan-assembler-times "vclzb" 5 } } */
+
+/* { dg-final { scan-assembler-times "vpopcntd" 5 } } */
+/* { dg-final { scan-assembler-times "vpopcntw" 5 } } */
+/* { dg-final { scan-assembler-times "vpopcnth" 5 } } */
+/* { dg-final { scan-assembler-times "vpopcntb" 5 } } */
+
+/* { dg-final { scan-assembler-times "vgbbd" 3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-5.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-5.c
new file mode 100644
index 00000000000..2e64551ff68
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-5.c
@@ -0,0 +1,105 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#include <altivec.h>
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#ifndef ATTR_ALIGN
+#define ATTR_ALIGN __attribute__((__aligned__(ALIGN)))
+#endif
+
+#define DOIT(TYPE, PREFIX) \
+TYPE PREFIX ## _eqv_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_eqv (a, b); \
+} \
+ \
+TYPE PREFIX ## _eqv_arith (TYPE a, TYPE b) \
+{ \
+ return ~(a ^ b); \
+} \
+ \
+TYPE PREFIX ## _nand_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_nand (a, b); \
+} \
+ \
+TYPE PREFIX ## _nand_arith1 (TYPE a, TYPE b) \
+{ \
+ return ~(a & b); \
+} \
+ \
+TYPE PREFIX ## _nand_arith2 (TYPE a, TYPE b) \
+{ \
+ return (~a) | (~b); \
+} \
+ \
+TYPE PREFIX ## _orc_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_orc (a, b); \
+} \
+ \
+TYPE PREFIX ## _orc_arith1 (TYPE a, TYPE b) \
+{ \
+ return (~ a) | b; \
+} \
+ \
+TYPE PREFIX ## _orc_arith2 (TYPE a, TYPE b) \
+{ \
+ return a | (~ b); \
+}
+
+#define DOIT_FLOAT(TYPE, PREFIX) \
+TYPE PREFIX ## _eqv_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_eqv (a, b); \
+} \
+ \
+TYPE PREFIX ## _nand_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_nand (a, b); \
+} \
+ \
+TYPE PREFIX ## _orc_builtin (TYPE a, TYPE b) \
+{ \
+ return vec_orc (a, b); \
+}
+
+typedef vector signed char sign_char_vec;
+typedef vector short sign_short_vec;
+typedef vector int sign_int_vec;
+typedef vector long long sign_llong_vec;
+
+typedef vector unsigned char uns_char_vec;
+typedef vector unsigned short uns_short_vec;
+typedef vector unsigned int uns_int_vec;
+typedef vector unsigned long long uns_llong_vec;
+
+typedef vector float float_vec;
+typedef vector double double_vec;
+
+DOIT(sign_char_vec, sign_char)
+DOIT(sign_short_vec, sign_short)
+DOIT(sign_int_vec, sign_int)
+DOIT(sign_llong_vec, sign_llong)
+
+DOIT(uns_char_vec, uns_char)
+DOIT(uns_short_vec, uns_short)
+DOIT(uns_int_vec, uns_int)
+DOIT(uns_llong_vec, uns_llong)
+
+DOIT_FLOAT(float_vec, float)
+DOIT_FLOAT(double_vec, double)
+
+/* { dg-final { scan-assembler-times "xxleqv" 18 } } */
+/* { dg-final { scan-assembler-times "xxlnand" 26 } } */
+/* { dg-final { scan-assembler-times "xxlorc" 26 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-6.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-6.c
new file mode 100644
index 00000000000..8b81781c6a4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-6.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+vector float dbl_to_float_p8 (double x) { return __builtin_vsx_xscvdpspn (x); }
+double float_to_dbl_p8 (vector float x) { return __builtin_vsx_xscvspdpn (x); }
+
+/* { dg-final { scan-assembler "xscvdpspn" } } */
+/* { dg-final { scan-assembler "xscvspdpn" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-7.c b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-7.c
new file mode 100644
index 00000000000..45a300fb944
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-builtin-7.c
@@ -0,0 +1,32 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+#include <altivec.h>
+
+typedef vector int v_sign;
+typedef vector unsigned int v_uns;
+
+v_sign even_sign (v_sign a, v_sign b)
+{
+ return vec_vmrgew (a, b);
+}
+
+v_uns even_uns (v_uns a, v_uns b)
+{
+ return vec_vmrgew (a, b);
+}
+
+v_sign odd_sign (v_sign a, v_sign b)
+{
+ return vec_vmrgow (a, b);
+}
+
+v_uns odd_uns (v_uns a, v_uns b)
+{
+ return vec_vmrgow (a, b);
+}
+
+/* { dg-final { scan-assembler-times "vmrgew" 2 } } */
+/* { dg-final { scan-assembler-times "vmrgow" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-1.c b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-1.c
new file mode 100644
index 00000000000..9a975bd6fe2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-1.c
@@ -0,0 +1,200 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#ifndef TYPE
+#define TYPE long long
+#endif
+
+#ifndef SIGN_TYPE
+#define SIGN_TYPE signed TYPE
+#endif
+
+#ifndef UNS_TYPE
+#define UNS_TYPE unsigned TYPE
+#endif
+
+#define ALIGN_ATTR __attribute__((__aligned__(ALIGN)))
+
+SIGN_TYPE sa[SIZE] ALIGN_ATTR;
+SIGN_TYPE sb[SIZE] ALIGN_ATTR;
+SIGN_TYPE sc[SIZE] ALIGN_ATTR;
+
+UNS_TYPE ua[SIZE] ALIGN_ATTR;
+UNS_TYPE ub[SIZE] ALIGN_ATTR;
+UNS_TYPE uc[SIZE] ALIGN_ATTR;
+
+void
+sign_add (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = sb[i] + sc[i];
+}
+
+void
+sign_sub (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = sb[i] - sc[i];
+}
+
+void
+sign_shift_left (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = sb[i] << sc[i];
+}
+
+void
+sign_shift_right (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = sb[i] >> sc[i];
+}
+
+void
+sign_max (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = (sb[i] > sc[i]) ? sb[i] : sc[i];
+}
+
+void
+sign_min (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = (sb[i] < sc[i]) ? sb[i] : sc[i];
+}
+
+void
+sign_abs (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = (sb[i] < 0) ? -sb[i] : sb[i]; /* xor, vsubudm, vmaxsd. */
+}
+
+void
+sign_eq (SIGN_TYPE val1, SIGN_TYPE val2)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = (sb[i] == sc[i]) ? val1 : val2;
+}
+
+void
+sign_lt (SIGN_TYPE val1, SIGN_TYPE val2)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ sa[i] = (sb[i] < sc[i]) ? val1 : val2;
+}
+
+void
+uns_add (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = ub[i] + uc[i];
+}
+
+void
+uns_sub (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = ub[i] - uc[i];
+}
+
+void
+uns_shift_left (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = ub[i] << uc[i];
+}
+
+void
+uns_shift_right (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = ub[i] >> uc[i];
+}
+
+void
+uns_max (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = (ub[i] > uc[i]) ? ub[i] : uc[i];
+}
+
+void
+uns_min (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = (ub[i] < uc[i]) ? ub[i] : uc[i];
+}
+
+void
+uns_eq (UNS_TYPE val1, UNS_TYPE val2)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = (ub[i] == uc[i]) ? val1 : val2;
+}
+
+void
+uns_lt (UNS_TYPE val1, UNS_TYPE val2)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ ua[i] = (ub[i] < uc[i]) ? val1 : val2;
+}
+
+/* { dg-final { scan-assembler-times "\[\t \]vaddudm\[\t \]" 2 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vsubudm\[\t \]" 3 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vmaxsd\[\t \]" 2 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vmaxud\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vminsd\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vminud\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vsld\[\t \]" 2 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vsrad\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vsrd\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vcmpequd\[\t \]" 2 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vcmpgtsd\[\t \]" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]vcmpgtud\[\t \]" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-2.c
new file mode 100644
index 00000000000..8feba0a1347
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-2.c
@@ -0,0 +1,30 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model" } */
+
+#include <stddef.h>
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#define ALIGN_ATTR __attribute__((__aligned__(ALIGN)))
+
+long long sign_ll[SIZE] ALIGN_ATTR;
+int sign_i [SIZE] ALIGN_ATTR;
+
+void copy_int_to_long_long (void)
+{
+ size_t i;
+
+ for (i = 0; i < SIZE; i++)
+ sign_ll[i] = sign_i[i];
+}
+
+/* { dg-final { scan-assembler "vupkhsw" } } */
+/* { dg-final { scan-assembler "vupklsw" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-3.c b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-3.c
new file mode 100644
index 00000000000..570f2e5991c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-3.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model" } */
+
+#include <stddef.h>
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#define ALIGN_ATTR __attribute__((__aligned__(ALIGN)))
+
+long long sign_ll[SIZE] ALIGN_ATTR;
+int sign_i [SIZE] ALIGN_ATTR;
+
+void copy_long_long_to_int (void)
+{
+ size_t i;
+
+ for (i = 0; i < SIZE; i++)
+ sign_i[i] = sign_ll[i];
+}
+
+/* { dg-final { scan-assembler "vpkudum" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-4.c b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-4.c
new file mode 100644
index 00000000000..90df8868051
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-4.c
@@ -0,0 +1,69 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#define ALIGN_ATTR __attribute__((__aligned__(ALIGN)))
+
+#define DO_BUILTIN(PREFIX, TYPE, CLZ, POPCNT) \
+TYPE PREFIX ## _a[SIZE] ALIGN_ATTR; \
+TYPE PREFIX ## _b[SIZE] ALIGN_ATTR; \
+ \
+void \
+PREFIX ## _clz (void) \
+{ \
+ unsigned long i; \
+ \
+ for (i = 0; i < SIZE; i++) \
+ PREFIX ## _a[i] = CLZ (PREFIX ## _b[i]); \
+} \
+ \
+void \
+PREFIX ## _popcnt (void) \
+{ \
+ unsigned long i; \
+ \
+ for (i = 0; i < SIZE; i++) \
+ PREFIX ## _a[i] = POPCNT (PREFIX ## _b[i]); \
+}
+
+#if !defined(DO_LONG_LONG) && !defined(DO_LONG) && !defined(DO_INT) && !defined(DO_SHORT) && !defined(DO_CHAR)
+#define DO_INT 1
+#endif
+
+#if DO_LONG_LONG
+/* At the moment, only int is auto vectorized. */
+DO_BUILTIN (sll, long long, __builtin_clzll, __builtin_popcountll)
+DO_BUILTIN (ull, unsigned long long, __builtin_clzll, __builtin_popcountll)
+#endif
+
+#if defined(_ARCH_PPC64) && DO_LONG
+DO_BUILTIN (sl, long, __builtin_clzl, __builtin_popcountl)
+DO_BUILTIN (ul, unsigned long, __builtin_clzl, __builtin_popcountl)
+#endif
+
+#if DO_INT
+DO_BUILTIN (si, int, __builtin_clz, __builtin_popcount)
+DO_BUILTIN (ui, unsigned int, __builtin_clz, __builtin_popcount)
+#endif
+
+#if DO_SHORT
+DO_BUILTIN (ss, short, __builtin_clz, __builtin_popcount)
+DO_BUILTIN (us, unsigned short, __builtin_clz, __builtin_popcount)
+#endif
+
+#if DO_CHAR
+DO_BUILTIN (sc, signed char, __builtin_clz, __builtin_popcount)
+DO_BUILTIN (uc, unsigned char, __builtin_clz, __builtin_popcount)
+#endif
+
+/* { dg-final { scan-assembler-times "vclzw" 2 } } */
+/* { dg-final { scan-assembler-times "vpopcntw" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-5.c b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-5.c
new file mode 100644
index 00000000000..17563bf477a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/p8vector-vectorize-5.c
@@ -0,0 +1,87 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8 -O2 -ftree-vectorize -fvect-cost-model -fno-unroll-loops -fno-unroll-all-loops" } */
+
+#ifndef SIZE
+#define SIZE 1024
+#endif
+
+#ifndef ALIGN
+#define ALIGN 32
+#endif
+
+#ifndef ATTR_ALIGN
+#define ATTR_ALIGN __attribute__((__aligned__(ALIGN)))
+#endif
+
+#ifndef TYPE
+#define TYPE unsigned int
+#endif
+
+TYPE in1 [SIZE] ATTR_ALIGN;
+TYPE in2 [SIZE] ATTR_ALIGN;
+TYPE eqv [SIZE] ATTR_ALIGN;
+TYPE nand1[SIZE] ATTR_ALIGN;
+TYPE nand2[SIZE] ATTR_ALIGN;
+TYPE orc1 [SIZE] ATTR_ALIGN;
+TYPE orc2 [SIZE] ATTR_ALIGN;
+
+void
+do_eqv (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ eqv[i] = ~(in1[i] ^ in2[i]);
+ }
+}
+
+void
+do_nand1 (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ nand1[i] = ~(in1[i] & in2[i]);
+ }
+}
+
+void
+do_nand2 (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ nand2[i] = (~in1[i]) | (~in2[i]);
+ }
+}
+
+void
+do_orc1 (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ orc1[i] = (~in1[i]) | in2[i];
+ }
+}
+
+void
+do_orc2 (void)
+{
+ unsigned long i;
+
+ for (i = 0; i < SIZE; i++)
+ {
+ orc1[i] = in1[i] | (~in2[i]);
+ }
+}
+
+/* { dg-final { scan-assembler-times "xxleqv" 1 } } */
+/* { dg-final { scan-assembler-times "xxlnand" 2 } } */
+/* { dg-final { scan-assembler-times "xxlorc" 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr55033.c b/gcc/testsuite/gcc.target/powerpc/pr55033.c
new file mode 100644
index 00000000000..2c1835e21f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr55033.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_eabi_ok } */
+/* { dg-options "-mcpu=8540 -msoft-float -msdata=eabi -G 8 -fno-common" } */
+
+extern void f (void);
+
+struct s
+{
+ int *p;
+ int *q;
+};
+
+extern int a;
+
+extern const struct s c;
+
+const struct s c = { &a, 0 };
+
+void
+f (void)
+{
+ char buf[4] = { 0, 1, 2, 3 };
+}
diff --git a/gcc/testsuite/gcc.target/s390/pr57559.c b/gcc/testsuite/gcc.target/s390/pr57559.c
new file mode 100644
index 00000000000..15c3878c4cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr57559.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/57559 */
+
+/* { dg-do compile } */
+/* { dg-options "-march=z10 -m64 -mzarch -O1" } */
+
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+struct _IO_marker
+{
+};
+static const int32_t mfcone = 1;
+static const uint8_t *mfctop = (const uint8_t *) &mfcone;
+int32_t
+decContextTestEndian (uint8_t quiet)
+{
+ int32_t res = 0;
+ uint32_t dle = (uint32_t) 0;
+ if (*(int *) 10 != 0)
+ {
+ res = (int32_t) * mfctop - dle;
+ }
+ return res;
+}
diff --git a/gcc/testsuite/gcc.target/sh/attr-isr-nosave_low_regs.c b/gcc/testsuite/gcc.target/sh/attr-isr-nosave_low_regs.c
new file mode 100644
index 00000000000..2f1d5180140
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/attr-isr-nosave_low_regs.c
@@ -0,0 +1,32 @@
+/* A call will clobber all call-saved registers.
+ If #pragma nosave_low_regs is specified, do not save/restore r0..r7.
+ (On SH3* and SH4* r0..r7 are banked)
+ One of these registers will also do fine to hold the function address.
+ Call-saved registers r8..r13 also don't need to be restored. */
+/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m1*" "-m2*" "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
+/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
+/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-times "macl" 2 } } */
+
+extern void bar (void);
+
+void
+foo (void)
+{
+}
+
+#pragma interrupt
+void
+( __attribute__ ((nosave_low_regs)) isr) (void)
+{
+ bar ();
+}
+
+void
+delay (int a)
+{
+}
diff --git a/gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c b/gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c
new file mode 100644
index 00000000000..ad61aaa1db5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c
@@ -0,0 +1,31 @@
+/* Check that trapa / interrput_handler attributes can paired in
+ either order. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler "trapa\[ \t\]\[ \t\]*#4"} } */
+/* { dg-final { scan-assembler-times "trapa" 1 } } */
+
+void h0 (void) __attribute__ ((trap_exit (4))) __attribute__ ((interrupt_handler));
+void h1 (void) __attribute__ ((interrupt_handler)) __attribute__ ((trap_exit (5)));
+
+void
+foo (void)
+{
+}
+
+void
+h0 (void)
+{
+}
+
+void delay
+(int a)
+{
+}
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/sh/attr-isr-trapa.c b/gcc/testsuite/gcc.target/sh/attr-isr-trapa.c
new file mode 100644
index 00000000000..e1bc8a4af62
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/attr-isr-trapa.c
@@ -0,0 +1,18 @@
+/* Check that no interrupt-specific register saves are generated. */
+/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+/* { dg-final { scan-assembler-not "r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
+/* { dg-final { scan-assembler-not "@r15\[^\n\]*r\[0-7\]\n" } } */
+/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
+/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-not "macl" } } */
+
+extern void foo (void);
+
+void
+(__attribute__ ((trapa_handler)) isr) (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/sh/pr6526.c b/gcc/testsuite/gcc.target/sh/pr6526.c
new file mode 100644
index 00000000000..a7dd6d87af6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr6526.c
@@ -0,0 +1,64 @@
+/* Check that the XF registers are not clobbered by an integer division
+ that is done using double precision FPU division. */
+/* { dg-do run { target "sh*-*-*" } } */
+/* { dg-options "-O1 -mdiv=call-fp" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4*-single" "-m4*-single-only" } } */
+
+#include <assert.h>
+#include <stdlib.h>
+
+extern void __set_fpscr (int);
+
+void
+write_xf0 (float* f)
+{
+ __asm__ __volatile__ ("frchg; fmov.s @%0,fr0; frchg" : : "r" (f) : "memory");
+}
+
+void
+read_xf0 (float* f)
+{
+ __asm__ __volatile__ ("frchg; fmov.s fr0,@%0; frchg" : : "r" (f) : "memory");
+}
+
+int __attribute__ ((noinline))
+test_00 (int a, int b)
+{
+ return a / b;
+}
+
+unsigned int __attribute__ ((noinline))
+test_01 (unsigned a, unsigned b)
+{
+ return a / b;
+}
+
+int __attribute__ ((noinline))
+test_02 (int x)
+{
+ return x & 0;
+}
+
+int
+main (void)
+{
+ float test_value;
+ int r = 0;
+
+ /* Set FPSCR.FR to 1. */
+ __set_fpscr (0x200000);
+
+ test_value = 123;
+ write_xf0 (&test_value);
+ r += test_00 (40, 4);
+ read_xf0 (&test_value);
+ assert (test_value == 123);
+
+ test_value = 321;
+ write_xf0 (&test_value);
+ r += test_01 (50, 5);
+ read_xf0 (&test_value);
+ assert (test_value == 321);
+
+ return test_02 (r);
+}
diff --git a/gcc/testsuite/gcc.target/sh/pragma-isr-nosave_low_regs.c b/gcc/testsuite/gcc.target/sh/pragma-isr-nosave_low_regs.c
new file mode 100644
index 00000000000..e1d880d3309
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pragma-isr-nosave_low_regs.c
@@ -0,0 +1,23 @@
+/* A call will clobber all call-saved registers.
+ If #pragma nosave_low_regs is specified, do not save/restore r0..r7.
+ (On SH3* and SH4* r0..r7 are banked)
+ One of these registers will also do fine to hold the function address.
+ Call-saved registers r8..r13 also don't need to be restored. */
+/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m1*" "-m2*" "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
+/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
+/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-times "macl" 2 } } */
+
+extern void foo (void);
+
+#pragma interrupt
+#pragma nosave_low_regs
+void
+isr (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/sh/pragma-isr-trap-exit.c b/gcc/testsuite/gcc.target/sh/pragma-isr-trap-exit.c
new file mode 100644
index 00000000000..823eb967b41
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pragma-isr-trap-exit.c
@@ -0,0 +1,24 @@
+/* Check whether trapa is generated only for an ISR. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "trapa\[ \t\]\[ \t\]*#4" 1 } } */
+
+#pragma interrupt
+void isr (void) __attribute__ ((trap_exit (4)));
+
+void
+isr (void)
+{
+}
+
+void
+delay (int a)
+{
+}
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/sh/pragma-isr-trapa.c b/gcc/testsuite/gcc.target/sh/pragma-isr-trapa.c
new file mode 100644
index 00000000000..cc57014dde7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pragma-isr-trapa.c
@@ -0,0 +1,19 @@
+/* Check that no interrupt-specific register saves are generated. */
+/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+/* { dg-final { scan-assembler-not "r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
+/* { dg-final { scan-assembler-not "@r15\[^\n\]*r\[0-7\]\n" } } */
+/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
+/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-not "macl" } } */
+
+extern void foo (void);
+
+#pragma trapa
+void
+isr (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/sh/pragma-isr-trapa2.c b/gcc/testsuite/gcc.target/sh/pragma-isr-trapa2.c
new file mode 100644
index 00000000000..9a23b976f44
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pragma-isr-trapa2.c
@@ -0,0 +1,24 @@
+/* Check that no interrupt-specific register saves are generated.
+ The function call will require to load the address first into a register,
+ then use that for a jsr or jmp. It will also need to load a constant
+ address in order to load fpscr. */
+/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+/* { dg-final { scan-assembler-times "r\[0-7\]\n" 3 } } */
+/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
+/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-not "macl" } } */
+
+/* Expect that fpscr needs to be saved, loaded and restored. */
+/* { dg-final { scan-assembler-times "\[^_\]fpscr" 3 } } */
+
+extern void foo (void);
+
+#pragma trapa
+void
+isr (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/sh/torture/pragma-isr.c b/gcc/testsuite/gcc.target/sh/torture/pragma-isr.c
new file mode 100644
index 00000000000..3c917bc6577
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/torture/pragma-isr.c
@@ -0,0 +1,20 @@
+/* Check whether rte is generated for two ISRs. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-final { scan-assembler-times "rte" 2 } } */
+
+extern void foo (void);
+
+#pragma interrupt
+void
+isr1 (void)
+{
+ foo ();
+}
+
+#pragma interrupt
+void
+isr2 (void)
+{
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.target/sh/torture/pragma-isr2.c b/gcc/testsuite/gcc.target/sh/torture/pragma-isr2.c
new file mode 100644
index 00000000000..89d70084ed9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/torture/pragma-isr2.c
@@ -0,0 +1,21 @@
+/* Check whether rte is generated only for an ISRs. */
+/* { dg-do compile { target "sh*-*-*" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
+/* { dg-final { scan-assembler-times "rte" 1 } } */
+
+#pragma interrupt
+void
+isr (void)
+{
+}
+
+void
+delay (int a)
+{
+}
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
index 9b08129add6..65724fe4b72 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
@@ -33,8 +33,10 @@ program alloc
integer, allocatable :: a2(:)
end type alloc2
- type(alloc2) :: b
integer :: i
+
+ BLOCK ! To ensure that the allocatables are freed at the end of the scope
+ type(alloc2) :: b
type(alloc2), allocatable :: c(:)
if (allocated(b%a2) .OR. allocated(b%a1)) then
@@ -64,7 +66,7 @@ program alloc
deallocate(c)
! 7 calls to _gfortran_deallocate (b (3) and c(4) goes aout of scope)
-
+ END BLOCK
contains
subroutine allocate_alloc2(b)
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90
index 969e703094c..8003c051477 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90
@@ -19,9 +19,12 @@ Program test_constructor
type(thytype), allocatable :: q(:)
end type mytype
- type (mytype) :: x
type (thytype) :: foo = thytype(reshape ([43, 100, 54, 76], [2,2]))
integer :: y(0:1, -1:0) = reshape ([42, 99, 55, 77], [2,2])
+
+ BLOCK ! Add scoping unit as the vars are otherwise implicitly SAVEd
+
+ type (mytype) :: x
integer, allocatable :: yy(:,:)
type (thytype), allocatable :: bar(:)
integer :: i
@@ -70,7 +73,7 @@ Program test_constructor
! Check that passing the constructor to a procedure works
call check_mytype (mytype(y, [foo, foo]))
-
+ END BLOCK
contains
subroutine check_mytype(x)
diff --git a/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90 b/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90
index 3488c0d7277..fd0b4dbf216 100644
--- a/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90
+++ b/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90
@@ -28,10 +28,12 @@ end type t4
end module m
use m
+block ! Start new scoping unit as otherwise the vars are implicitly SAVEd
type(t1) :: na1, a1, aa1(:)
type(t2) :: na2, a2, aa2(:)
type(t3) :: na3, a3, aa3(:)
type(t4) :: na4, a4, aa4(:)
+
allocatable :: a1, a2, a3, a4, aa1, aa2, aa3,aa4
if(allocated(a1)) call abort()
@@ -47,6 +49,7 @@ if(allocated(na1%b1)) call abort()
if(allocated(na2%b2)) call abort()
if(allocated(na3%b3)) call abort()
if(allocated(na4%b4)) call abort()
+end block
end
! { dg-final { scan-tree-dump-times "__builtin_free" 32 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_48.f90 b/gcc/testsuite/gfortran.dg/array_constructor_48.f90
new file mode 100644
index 00000000000..5916eddf838
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_48.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR fortran/57549
+!
+! Contributed by Vladimir Fuka
+!
+ type t
+ end type
+ type(t),allocatable :: a(:)
+ a = [t::t()]
+ print *, [ integer :: ]
+end
+
+subroutine invalid()
+ print *, [ type(integer) :: ] ! { dg-error "Syntax error in array constructor" }
+ print *, [ type(tt) :: ] ! { dg-error "Syntax error in array constructor" }
+end subroutine invalid
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_type_14.f03 b/gcc/testsuite/gfortran.dg/array_constructor_type_14.f03
index 04ac728010a..0e24334dcfc 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_type_14.f03
+++ b/gcc/testsuite/gfortran.dg/array_constructor_type_14.f03
@@ -16,7 +16,7 @@ PROGRAM test
TYPE(foo), DIMENSION(2) :: arr
- arr = (/ TYPE(foo) :: x, foo(0, 1.) /)
+ arr = (/ foo :: x, foo(0, 1.) /)
IF (arr(1)%i /= 42 .OR. arr(1)%x /= 42. .OR. &
arr(2)%i /= 0 .OR. arr(2)%x /= 1.) THEN
CALL abort()
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_type_15.f03 b/gcc/testsuite/gfortran.dg/array_constructor_type_15.f03
index 20736988b5a..a94655562e9 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_type_15.f03
+++ b/gcc/testsuite/gfortran.dg/array_constructor_type_15.f03
@@ -18,5 +18,5 @@ PROGRAM test
TYPE(foo), PARAMETER :: x = foo(42, 42.)
- WRITE (*,*) (/ TYPE(foo) :: x, foo(0, 1.), bar(.TRUE.) /) ! { dg-error "convert TYPE" }
+ WRITE (*,*) (/ foo :: x, foo(0, 1.), bar(.TRUE.) /) ! { dg-error "convert TYPE" }
END PROGRAM test
diff --git a/gcc/testsuite/gfortran.dg/assumed_type_7.f90 b/gcc/testsuite/gfortran.dg/assumed_type_7.f90
new file mode 100644
index 00000000000..48cb43e7f8d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/assumed_type_7.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+implicit none
+call sub(f) ! { dg-error "Type mismatch in argument" }
+contains
+
+ subroutine f(x)
+ type(*) :: x
+ end subroutine
+
+ subroutine sub(g)
+ interface
+ subroutine g(x)
+ integer :: x
+ end subroutine
+ end interface
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90 b/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90
index d261973e20b..04ee7f26997 100644
--- a/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90
+++ b/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90
@@ -11,11 +11,12 @@ type :: t
integer, allocatable :: i(:)
end type
+block ! New block as the main program implies SAVE
type(t) :: a
call init(a)
call init(a)
-
+end block
contains
subroutine init(x)
@@ -25,5 +26,6 @@ contains
end program
-! { dg-final { scan-tree-dump-times "__builtin_free" 5 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free" 4 "original" } }
+! { dg-final { scan-tree-dump-times "x->_vptr->_final \\(" 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_7.f90 b/gcc/testsuite/gfortran.dg/bounds_check_7.f90
index c488a68cadc..b38419908bb 100644
--- a/gcc/testsuite/gfortran.dg/bounds_check_7.f90
+++ b/gcc/testsuite/gfortran.dg/bounds_check_7.f90
@@ -5,7 +5,7 @@
subroutine foo(a)
integer a(*), i
i = 0
- a(i) = 42 ! {
+ a(i) = 42
end subroutine foo
program test
diff --git a/gcc/testsuite/gfortran.dg/class_19.f03 b/gcc/testsuite/gfortran.dg/class_19.f03
index 6dcd99c13a2..428015c99ec 100644
--- a/gcc/testsuite/gfortran.dg/class_19.f03
+++ b/gcc/testsuite/gfortran.dg/class_19.f03
@@ -39,5 +39,5 @@ program main
end program main
-! { dg-final { scan-tree-dump-times "__builtin_free" 15 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free" 12 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/class_array_17.f90 b/gcc/testsuite/gfortran.dg/class_array_17.f90
new file mode 100644
index 00000000000..e5961e11035
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_array_17.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/57456
+!
+module m
+ implicit none
+ type t
+ integer :: i
+ end type t
+ type, extends(t) :: t2
+ integer :: j
+ end type t2
+end module m
+
+program test
+ use m
+ implicit none
+ integer :: i
+ class(t), save, allocatable :: y(:)
+
+ allocate (t2 :: y(5))
+ select type(y)
+ type is (t2)
+ do i = 1, 5
+ y(i)%i = i
+ y(i)%j = i*10
+ end do
+ end select
+ deallocate(y)
+end
+
+! { dg-final { scan-tree-dump-times "__builtin_malloc \\(40\\);" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/class_array_18.f90 b/gcc/testsuite/gfortran.dg/class_array_18.f90
new file mode 100644
index 00000000000..5f2f3dee7f2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_array_18.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR fortran/57535
+!
+program test
+ implicit none
+ type t
+ integer :: ii = 55
+ end type t
+contains
+ function func2()
+ class(t), allocatable :: func2(:)
+ allocate(func2(3))
+ func2%ii = [111,222,333]
+ end function func2
+end program test
diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_alloc_1.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_1.f90
index c0d06a4bd2a..926d531ef7d 100644
--- a/gcc/testsuite/gfortran.dg/coarray_lib_alloc_1.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_1.f90
@@ -4,6 +4,7 @@
! Allocate/deallocate with libcaf.
!
+ subroutine test()
integer(4), allocatable :: xx[:], yy(:)[:]
integer :: stat
character(len=200) :: errmsg
diff --git a/gcc/testsuite/gfortran.dg/coarray_lib_alloc_2.f90 b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_2.f90
index 3aaff1e8c35..472e0beb719 100644
--- a/gcc/testsuite/gfortran.dg/coarray_lib_alloc_2.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_lib_alloc_2.f90
@@ -4,6 +4,7 @@
! Allocate/deallocate with libcaf.
!
+ subroutine test()
type t
end type t
class(t), allocatable :: xx[:], yy(:)[:]
diff --git a/gcc/testsuite/gfortran.dg/coarray_poly_3.f90 b/gcc/testsuite/gfortran.dg/coarray_poly_3.f90
index 8edd8d3c63e..fd46206ea15 100644
--- a/gcc/testsuite/gfortran.dg/coarray_poly_3.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_poly_3.f90
@@ -25,7 +25,7 @@ end
function func() ! { dg-error "shall not be a coarray or have a coarray component" }
type t
end type t
- class(t), allocatable :: func[*] ! { dg-error ""
+ class(t), allocatable :: func[*]
end
function func2() ! { dg-error "must be dummy, allocatable or pointer" }
@@ -33,7 +33,7 @@ function func2() ! { dg-error "must be dummy, allocatable or pointer" }
integer, allocatable :: caf[:]
end type t
class(t) :: func2a ! { dg-error "CLASS variable 'func2a' at .1. must be dummy, allocatable or pointer" }
- class(t) :: func2 ! {CLASS variable 'func' at (1) must be dummy, allocatable or pointer
+ class(t) :: func2
end
subroutine foo1(x1) ! { dg-error "Coarray variable 'x1' at .1. shall not have codimensions with deferred shape" }
diff --git a/gcc/testsuite/gfortran.dg/default_initialization_5.f90 b/gcc/testsuite/gfortran.dg/default_initialization_5.f90
index b32dae7c6cb..50860e0d064 100644
--- a/gcc/testsuite/gfortran.dg/default_initialization_5.f90
+++ b/gcc/testsuite/gfortran.dg/default_initialization_5.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run }
! { dg-options "-fdump-tree-original" }
!
! PR fortran/51435
diff --git a/gcc/testsuite/gfortran.dg/deferred_type_param_9.f90 b/gcc/testsuite/gfortran.dg/deferred_type_param_9.f90
new file mode 100644
index 00000000000..a6e685753f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/deferred_type_param_9.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+!
+! PR fortran/57596
+!
+! Contributed by Valery Weber
+!
+PROGRAM main
+ IMPLICIT NONE
+ call get ()
+ call get2 ()
+contains
+ SUBROUTINE get (c_val)
+ CHARACTER( : ), INTENT( INOUT ), ALLOCATABLE, OPTIONAL :: c_val
+ CHARACTER( 10 ) :: c_val_tmp
+ if(present(c_val)) call abort()
+ END SUBROUTINE get
+ SUBROUTINE get2 (c_val)
+ CHARACTER( : ), INTENT( OUT ), ALLOCATABLE, OPTIONAL :: c_val
+ CHARACTER( 10 ) :: c_val_tmp
+ if(present(c_val)) call abort()
+ END SUBROUTINE get2
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/defined_assignment_7.f90 b/gcc/testsuite/gfortran.dg/defined_assignment_7.f90
new file mode 100644
index 00000000000..5f60f50e781
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/defined_assignment_7.f90
@@ -0,0 +1,29 @@
+! { dg-compile }
+!
+! PR fortran/57508
+!
+module ForTrilinos_ref_counter
+ type ref_counter
+ contains
+ procedure :: assign
+ generic :: assignment(=) => assign
+ end type
+contains
+ subroutine assign (lhs, rhs)
+ class (ref_counter), intent(inout) :: lhs
+ class (ref_counter), intent(in) :: rhs
+ end subroutine
+end module
+module FEpetra_BlockMap
+ use ForTrilinos_ref_counter, only : ref_counter
+ type :: Epetra_BlockMap
+ type(ref_counter) :: counter
+ end type
+contains
+ function from_struct() result(new_Epetra_BlockMap)
+ type(Epetra_BlockMap) :: new_Epetra_BlockMap
+ end function
+ type(Epetra_BlockMap) function create_arbitrary()
+ create_arbitrary = from_struct()
+ end function
+end module
diff --git a/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90 b/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90
index 5ab4e7cec8e..cb0e7c04d0e 100644
--- a/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90
+++ b/gcc/testsuite/gfortran.dg/dummy_procedure_5.f90
@@ -15,7 +15,7 @@ program main
end type
type(u), external :: ufunc
- call sub(ufunc) ! { dg-error "Type/rank mismatch in function result" }
+ call sub(ufunc) ! { dg-error "Type mismatch in function result" }
contains
diff --git a/gcc/testsuite/gfortran.dg/extends_14.f03 b/gcc/testsuite/gfortran.dg/extends_14.f03
index 876e8c703cf..15e38ff9081 100644
--- a/gcc/testsuite/gfortran.dg/extends_14.f03
+++ b/gcc/testsuite/gfortran.dg/extends_14.f03
@@ -16,12 +16,13 @@ program evolve_aflow
type, extends(state_t) :: astate_t
end type
+ block ! New scoping unit as "a"/"b" are otherwise implicitly SAVEd
type(astate_t) :: a,b
allocate(a%U(1000))
a = b
-
+ end block
end program
! { dg-final { scan-tree-dump-times "__builtin_free" 3 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_10.f90 b/gcc/testsuite/gfortran.dg/finalize_10.f90
new file mode 100644
index 00000000000..c56e13a09f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_10.f90
@@ -0,0 +1,39 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/37336
+!
+! Finalize nonallocatable INTENT(OUT)
+!
+module m
+ type t
+ end type t
+ type t2
+ contains
+ final :: fini
+ end type t2
+contains
+ elemental subroutine fini(var)
+ type(t2), intent(inout) :: var
+ end subroutine fini
+end module m
+
+subroutine foo(x,y,aa,bb)
+ use m
+ class(t), intent(out) :: x(:),y
+ type(t2), intent(out) :: aa(:),bb
+end subroutine foo
+
+! Finalize CLASS + set default init
+! { dg-final { scan-tree-dump-times "y->_vptr->_final \\(&desc.\[0-9\]+, y->_vptr->_size, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump "__builtin_memcpy \\(\\(void .\\) y->_data, \\(void .\\) y->_vptr->_def_init, \\((unsigned long|unsigned int|character\\(kind=4\\))\\) y->_vptr->_size\\);" "original" } }
+! { dg-final { scan-tree-dump-times "x->_vptr->_final \\(&x->_data, x->_vptr->_size, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "x->_vptr->_copy \\(x->_vptr->_def_init, &x->_data\\);" 1 "original" } }
+
+! FINALIZE TYPE:
+! { dg-final { scan-tree-dump-times "parm.\[0-9\]+.data = \\(void \\*\\) &\\(\\*aa.\[0-9\]+\\)\\\[0\\\];" 1 "original" } }
+! { dg!final { scan-tree-dump-times "__final_m_T2 (&parm.\[0-9\]+, 0, 0);" 1 "original" } }
+! { dg!final { scan-tree-dump-times "desc.\[0-9\]+.data = \\(void \\* restrict\\) bb;" 1 "original" } }
+! { dg!final { scan-tree-dump-times "__final_m_T2 (&desc.\[0-9\]+, 0, 0);" 1 "original" } }
+
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_12.f90 b/gcc/testsuite/gfortran.dg/finalize_12.f90
new file mode 100644
index 00000000000..f1508ec8135
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_12.f90
@@ -0,0 +1,175 @@
+! { dg-do run }
+! { dg-options "-fcoarray=single" }
+!
+! PR fortran/37336
+!
+module m
+ implicit none
+ type t
+ integer :: i
+ contains
+ final :: fini, fini2
+ end type t
+ integer :: global_count1, global_count2
+contains
+ subroutine fini(x)
+ type(t) :: x
+ !print *, 'fini:',x%i
+ if (global_count1 == -1) call abort ()
+ if (x%i /= 42) call abort()
+ x%i = 33
+ global_count1 = global_count1 + 1
+ end subroutine fini
+ subroutine fini2(x)
+ type(t) :: x(:)
+ !print *, 'fini2', x%i
+ if (global_count2 == -1) call abort ()
+ if (size(x) /= 5) call abort()
+ if (any (x%i /= [1,2,3,4,5]) .and. any (x%i /= [6,7,8,9,10])) call abort()
+ x%i = 33
+ global_count2 = global_count2 + 10
+ end subroutine fini2
+end module m
+
+program pp
+ use m
+ implicit none
+ type(t), allocatable :: ya
+ class(t), allocatable :: yc
+ type(t), allocatable :: yaa(:)
+ class(t), allocatable :: yca(:)
+
+ type(t), allocatable :: ca[:]
+ class(t), allocatable :: cc[:]
+ type(t), allocatable :: caa(:)[:]
+ class(t), allocatable :: cca(:)[:]
+
+ global_count1 = -1
+ global_count2 = -1
+ allocate (ya, yc, yaa(5), yca(5))
+ global_count1 = 0
+ global_count2 = 0
+ ya%i = 42
+ yc%i = 42
+ yaa%i = [1,2,3,4,5]
+ yca%i = [1,2,3,4,5]
+
+ call foo(ya, yc, yaa, yca)
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+
+ ! Coarray finalization
+ allocate (ca[*], cc[*], caa(5)[*], cca(5)[*])
+ global_count1 = 0
+ global_count2 = 0
+ ca%i = 42
+ cc%i = 42
+ caa%i = [1,2,3,4,5]
+ cca%i = [1,2,3,4,5]
+ deallocate (ca, cc, caa, cca)
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+ global_count1 = -1
+ global_count2 = -1
+
+ block
+ type(t), allocatable :: za
+ class(t), allocatable :: zc
+ type(t), allocatable :: zaa(:)
+ class(t), allocatable :: zca(:)
+
+ ! Test intent(out) finalization
+ allocate (za, zc, zaa(5), zca(5))
+ global_count1 = 0
+ global_count2 = 0
+ za%i = 42
+ zc%i = 42
+ zaa%i = [1,2,3,4,5]
+ zca%i = [1,2,3,4,5]
+
+ call foo(za, zc, zaa, zca)
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+
+ ! Test intent(out) finalization with optional
+ call foo_opt()
+ call opt()
+
+ ! Test intent(out) finalization with optional
+ allocate (za, zc, zaa(5), zca(5))
+ global_count1 = 0
+ global_count2 = 0
+ za%i = 42
+ zc%i = 42
+ zaa%i = [1,2,3,4,5]
+ zca%i = [1,2,3,4,5]
+
+ call foo_opt(za, zc, zaa, zca)
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+
+ ! Test DEALLOCATE finalization
+ allocate (za, zc, zaa(5), zca(5))
+ global_count1 = 0
+ global_count2 = 0
+ za%i = 42
+ zc%i = 42
+ zaa%i = [1,2,3,4,5]
+ zca%i = [6,7,8,9,10]
+ deallocate (za, zc, zaa, zca)
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+
+ ! Test end-of-scope finalization
+ allocate (za, zc, zaa(5), zca(5))
+ global_count1 = 0
+ global_count2 = 0
+ za%i = 42
+ zc%i = 42
+ zaa%i = [1,2,3,4,5]
+ zca%i = [6,7,8,9,10]
+ end block
+
+ if (global_count1 /= 2) call abort ()
+ if (global_count2 /= 20) call abort ()
+
+ ! Test that no end-of-scope finalization occurs
+ ! for SAVED variable in main
+ allocate (ya, yc, yaa(5), yca(5))
+ global_count1 = -1
+ global_count2 = -1
+
+contains
+
+ subroutine opt(xa, xc, xaa, xca)
+ type(t), allocatable, optional :: xa
+ class(t), allocatable, optional :: xc
+ type(t), allocatable, optional :: xaa(:)
+ class(t), allocatable, optional :: xca(:)
+ call foo_opt(xc, xc, xaa)
+ !call foo_opt(xa, xc, xaa, xca) ! FIXME: Fails (ICE) due to PR 57445
+ end subroutine opt
+ subroutine foo_opt(xa, xc, xaa, xca)
+ type(t), allocatable, intent(out), optional :: xa
+ class(t), allocatable, intent(out), optional :: xc
+ type(t), allocatable, intent(out), optional :: xaa(:)
+ class(t), allocatable, intent(out), optional :: xca(:)
+
+ if (.not. present(xa)) &
+ return
+ if (allocated (xa)) call abort ()
+ if (allocated (xc)) call abort ()
+ if (allocated (xaa)) call abort ()
+ if (allocated (xca)) call abort ()
+ end subroutine foo_opt
+ subroutine foo(xa, xc, xaa, xca)
+ type(t), allocatable, intent(out) :: xa
+ class(t), allocatable, intent(out) :: xc
+ type(t), allocatable, intent(out) :: xaa(:)
+ class(t), allocatable, intent(out) :: xca(:)
+ if (allocated (xa)) call abort ()
+ if (allocated (xc)) call abort ()
+ if (allocated (xaa)) call abort ()
+ if (allocated (xca)) call abort ()
+ end subroutine foo
+end program
diff --git a/gcc/testsuite/gfortran.dg/finalize_13.f90 b/gcc/testsuite/gfortran.dg/finalize_13.f90
new file mode 100644
index 00000000000..78b20acd5d7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_13.f90
@@ -0,0 +1,161 @@
+! { dg-do run }
+!
+! PR fortran/37336
+!
+module m
+ implicit none
+ type t
+ integer :: i
+ contains
+ final :: fini3, fini2, fini_elm
+ end type t
+
+ type, extends(t) :: t2
+ integer :: j
+ contains
+ final :: f2ini2, f2ini_elm
+ end type t2
+
+ logical :: elem_call
+ logical :: rank2_call
+ logical :: rank3_call
+ integer :: cnt, cnt2
+ integer :: fini_call
+
+contains
+ subroutine fini2 (x)
+ type(t), intent(in), contiguous :: x(:,:)
+ if (.not. rank2_call) call abort ()
+ if (size(x,1) /= 2 .or. size(x,2) /= 3) call abort()
+ !print *, 'fini2:', x%i
+ if (any (x%i /= reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
+ fini_call = fini_call + 1
+ end subroutine
+
+ subroutine fini3 (x)
+ type(t), intent(in) :: x(2,2,*)
+ integer :: i,j,k
+ if (.not. elem_call) call abort ()
+ if (.not. rank3_call) call abort ()
+ if (cnt2 /= 9) call abort()
+ if (cnt /= 1) call abort()
+ do i = 1, 2
+ do j = 1, 2
+ do k = 1, 2
+ !print *, k,j,i,x(k,j,i)%i
+ if (x(k,j,i)%i /= k+10*j+100*i) call abort()
+ end do
+ end do
+ end do
+ fini_call = fini_call + 1
+ end subroutine
+
+ impure elemental subroutine fini_elm (x)
+ type(t), intent(in) :: x
+ if (.not. elem_call) call abort ()
+ if (rank3_call) call abort ()
+ if (cnt2 /= 6) call abort()
+ if (cnt /= x%i) call abort()
+ !print *, 'fini_elm:', cnt, x%i
+ fini_call = fini_call + 1
+ cnt = cnt + 1
+ end subroutine
+
+ subroutine f2ini2 (x)
+ type(t2), intent(in), target :: x(:,:)
+ if (.not. rank2_call) call abort ()
+ if (size(x,1) /= 2 .or. size(x,2) /= 3) call abort()
+ !print *, 'f2ini2:', x%i
+ !print *, 'f2ini2:', x%j
+ if (any (x%i /= reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
+ if (any (x%j /= 100*reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
+ fini_call = fini_call + 1
+ end subroutine
+
+ impure elemental subroutine f2ini_elm (x)
+ type(t2), intent(in) :: x
+ integer, parameter :: exprected(*) &
+ = [111, 112, 121, 122, 211, 212, 221, 222]
+
+ if (.not. elem_call) call abort ()
+ !print *, 'f2ini_elm:', cnt2, x%i, x%j
+ if (rank3_call) then
+ if (x%i /= exprected(cnt2)) call abort ()
+ if (x%j /= 1000*exprected(cnt2)) call abort ()
+ else
+ if (cnt2 /= x%i .or. cnt2*10 /= x%j) call abort()
+ end if
+ cnt2 = cnt2 + 1
+ fini_call = fini_call + 1
+ end subroutine
+end module m
+
+
+program test
+ use m
+ implicit none
+ class(t), save, allocatable :: y(:), z(:,:), zz(:,:,:)
+ target :: z, zz
+ integer :: i,j,k
+
+ elem_call = .false.
+ rank2_call = .false.
+ rank3_call = .false.
+ allocate (t2 :: y(5))
+ select type (y)
+ type is (t2)
+ do i = 1, 5
+ y(i)%i = i
+ y(i)%j = i*10
+ end do
+ end select
+ cnt = 1
+ cnt2 = 1
+ fini_call = 0
+ elem_call = .true.
+ deallocate (y)
+ if (fini_call /= 10) call abort ()
+
+ elem_call = .false.
+ rank2_call = .false.
+ rank3_call = .false.
+ allocate (t2 :: z(2,3))
+ select type (z)
+ type is (t2)
+ do i = 1, 3
+ do j = 1, 2
+ z(j,i)%i = j+10*i
+ z(j,i)%j = (j+10*i)*100
+ end do
+ end do
+ end select
+ cnt = 1
+ cnt2 = 1
+ fini_call = 0
+ rank2_call = .true.
+ deallocate (z)
+ if (fini_call /= 2) call abort ()
+
+ elem_call = .false.
+ rank2_call = .false.
+ rank3_call = .false.
+ allocate (t2 :: zz(2,2,2))
+ select type (zz)
+ type is (t2)
+ do i = 1, 2
+ do j = 1, 2
+ do k = 1, 2
+ zz(k,j,i)%i = k+10*j+100*i
+ zz(k,j,i)%j = (k+10*j+100*i)*1000
+ end do
+ end do
+ end do
+ end select
+ cnt = 1
+ cnt2 = 1
+ fini_call = 0
+ rank3_call = .true.
+ elem_call = .true.
+ deallocate (zz)
+ if (fini_call /= 2*2*2+1) call abort ()
+end program test
diff --git a/gcc/testsuite/gfortran.dg/finalize_14.f90 b/gcc/testsuite/gfortran.dg/finalize_14.f90
new file mode 100644
index 00000000000..edec8841ee6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_14.f90
@@ -0,0 +1,220 @@
+! { dg-do compile }
+!
+! PR fortran/37336
+!
+! Started to fail when finalization was added.
+!
+! Contributed by Ian Chivers in PR fortran/44465
+!
+module shape_module
+
+ type shape_type
+ integer :: x_=0
+ integer :: y_=0
+ contains
+ procedure , pass(this) :: getx
+ procedure , pass(this) :: gety
+ procedure , pass(this) :: setx
+ procedure , pass(this) :: sety
+ procedure , pass(this) :: moveto
+ procedure , pass(this) :: draw
+ end type shape_type
+
+interface assignment(=)
+ module procedure generic_shape_assign
+end interface
+
+contains
+
+ integer function getx(this)
+ implicit none
+ class (shape_type) , intent(in) :: this
+ getx=this%x_
+ end function getx
+
+ integer function gety(this)
+ implicit none
+ class (shape_type) , intent(in) :: this
+ gety=this%y_
+ end function gety
+
+ subroutine setx(this,x)
+ implicit none
+ class (shape_type), intent(inout) :: this
+ integer , intent(in) :: x
+ this%x_=x
+ end subroutine setx
+
+ subroutine sety(this,y)
+ implicit none
+ class (shape_type), intent(inout) :: this
+ integer , intent(in) :: y
+ this%y_=y
+ end subroutine sety
+
+ subroutine moveto(this,newx,newy)
+ implicit none
+ class (shape_type), intent(inout) :: this
+ integer , intent(in) :: newx
+ integer , intent(in) :: newy
+ this%x_=newx
+ this%y_=newy
+ end subroutine moveto
+
+ subroutine draw(this)
+ implicit none
+ class (shape_type), intent(in) :: this
+ print *,' x = ' , this%x_
+ print *,' y = ' , this%y_
+ end subroutine draw
+
+ subroutine generic_shape_assign(lhs,rhs)
+ implicit none
+ class (shape_type) , intent(out) , allocatable :: lhs
+ class (shape_type) , intent(in) :: rhs
+ print *,' In generic_shape_assign'
+ if ( allocated(lhs) ) then
+ deallocate(lhs)
+ end if
+ allocate(lhs,source=rhs)
+ end subroutine generic_shape_assign
+
+end module shape_module
+
+! Circle_p.f90
+
+module circle_module
+
+use shape_module
+
+type , extends(shape_type) :: circle_type
+
+ integer :: radius_
+
+ contains
+
+ procedure , pass(this) :: getradius
+ procedure , pass(this) :: setradius
+ procedure , pass(this) :: draw => draw_circle
+
+end type circle_type
+
+ contains
+
+ integer function getradius(this)
+ implicit none
+ class (circle_type) , intent(in) :: this
+ getradius=this%radius_
+ end function getradius
+
+ subroutine setradius(this,radius)
+ implicit none
+ class (circle_type) , intent(inout) :: this
+ integer , intent(in) :: radius
+ this%radius_=radius
+ end subroutine setradius
+
+ subroutine draw_circle(this)
+ implicit none
+ class (circle_type), intent(in) :: this
+ print *,' x = ' , this%x_
+ print *,' y = ' , this%y_
+ print *,' radius = ' , this%radius_
+ end subroutine draw_circle
+
+end module circle_module
+
+
+! Rectangle_p.f90
+
+module rectangle_module
+
+use shape_module
+
+type , extends(shape_type) :: rectangle_type
+
+ integer :: width_
+ integer :: height_
+
+ contains
+
+ procedure , pass(this) :: getwidth
+ procedure , pass(this) :: setwidth
+ procedure , pass(this) :: getheight
+ procedure , pass(this) :: setheight
+ procedure , pass(this) :: draw => draw_rectangle
+
+end type rectangle_type
+
+ contains
+
+ integer function getwidth(this)
+ implicit none
+ class (rectangle_type) , intent(in) :: this
+ getwidth=this%width_
+ end function getwidth
+
+ subroutine setwidth(this,width)
+ implicit none
+ class (rectangle_type) , intent(inout) :: this
+ integer , intent(in) :: width
+ this%width_=width
+ end subroutine setwidth
+
+ integer function getheight(this)
+ implicit none
+ class (rectangle_type) , intent(in) :: this
+ getheight=this%height_
+ end function getheight
+
+ subroutine setheight(this,height)
+ implicit none
+ class (rectangle_type) , intent(inout) :: this
+ integer , intent(in) :: height
+ this%height_=height
+ end subroutine setheight
+
+ subroutine draw_rectangle(this)
+ implicit none
+ class (rectangle_type), intent(in) :: this
+ print *,' x = ' , this%x_
+ print *,' y = ' , this%y_
+ print *,' width = ' , this%width_
+ print *,' height = ' , this%height_
+
+ end subroutine draw_rectangle
+
+end module rectangle_module
+
+
+
+program polymorphic
+
+use shape_module
+use circle_module
+use rectangle_module
+
+implicit none
+
+type shape_w
+ class (shape_type) , allocatable :: shape_v
+end type shape_w
+
+type (shape_w) , dimension(3) :: p
+
+ print *,' shape '
+
+ p(1)%shape_v=shape_type(10,20)
+ call p(1)%shape_v%draw()
+
+ print *,' circle '
+
+ p(2)%shape_v=circle_type(100,200,300)
+ call p(2)%shape_v%draw()
+
+ print *,' rectangle '
+
+ p(3)%shape_v=rectangle_type(1000,2000,3000,4000)
+ call p(3)%shape_v%draw()
+
+end program polymorphic
diff --git a/gcc/testsuite/gfortran.dg/finalize_15.f90 b/gcc/testsuite/gfortran.dg/finalize_15.f90
new file mode 100644
index 00000000000..3c18b2ae108
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_15.f90
@@ -0,0 +1,238 @@
+! { dg-do run }
+!
+! PR fortran/37336
+!
+! Check the scalarizer/array packing with strides
+! in the finalization wrapper
+!
+module m
+ implicit none
+
+ type t1
+ integer :: i
+ contains
+ final :: fini_elem
+ end type t1
+
+ type, extends(t1) :: t1e
+ integer :: j
+ contains
+ final :: fini_elem2
+ end type t1e
+
+ type t2
+ integer :: i
+ contains
+ final :: fini_shape
+ end type t2
+
+ type, extends(t2) :: t2e
+ integer :: j
+ contains
+ final :: fini_shape2
+ end type t2e
+
+ type t3
+ integer :: i
+ contains
+ final :: fini_explicit
+ end type t3
+
+ type, extends(t3) :: t3e
+ integer :: j
+ contains
+ final :: fini_explicit2
+ end type t3e
+
+ integer :: cnt1, cnt1e, cnt2, cnt2e, cnt3, cnt3e
+
+contains
+
+ impure elemental subroutine fini_elem(x)
+ type(t1), intent(inout) :: x
+ integer :: i, j, i2, j2
+
+ if (cnt1e /= 5*4) call abort ()
+ j = mod (cnt1,5)+1
+ i = cnt1/5 + 1
+ i2 = (i-1)*3 + 1
+ j2 = (j-1)*2 + 1
+ if (x%i /= j2 + 100*i2) call abort ()
+ x%i = x%i * (-13)
+ cnt1 = cnt1 + 1
+ end subroutine fini_elem
+
+ impure elemental subroutine fini_elem2(x)
+ type(t1e), intent(inout) :: x
+ integer :: i, j, i2, j2
+
+ j = mod (cnt1e,5)+1
+ i = cnt1e/5 + 1
+ i2 = (i-1)*3 + 1
+ j2 = (j-1)*2 + 1
+ if (x%i /= j2 + 100*i2) call abort ()
+ if (x%j /= (j2 + 100*i2)*100) call abort ()
+ x%j = x%j * (-13)
+ cnt1e = cnt1e + 1
+ end subroutine fini_elem2
+
+ subroutine fini_shape(x)
+ type(t2) :: x(:,:)
+ if (cnt2e /= 1 .or. cnt2 /= 0) call abort ()
+ call check_var_sec(x%i, 1)
+ x%i = x%i * (-13)
+ cnt2 = cnt2 + 1
+ end subroutine fini_shape
+
+ subroutine fini_shape2(x)
+ type(t2e) :: x(:,:)
+ call check_var_sec(x%i, 1)
+ call check_var_sec(x%j, 100)
+ x%j = x%j * (-13)
+ cnt2e = cnt2e + 1
+ end subroutine fini_shape2
+
+ subroutine fini_explicit(x)
+ type(t3) :: x(5,4)
+ if (cnt3e /= 1 .or. cnt3 /= 0) call abort ()
+ call check_var_sec(x%i, 1)
+ x%i = x%i * (-13)
+ cnt3 = cnt3 + 1
+ end subroutine fini_explicit
+
+ subroutine fini_explicit2(x)
+ type(t3e) :: x(5,4)
+ call check_var_sec(x%i, 1)
+ call check_var_sec(x%j, 100)
+ x%j = x%j * (-13)
+ cnt3e = cnt3e + 1
+ end subroutine fini_explicit2
+
+ subroutine fin_test_1(x)
+ class(t1), intent(out) :: x(5,4)
+ end subroutine fin_test_1
+
+ subroutine fin_test_2(x)
+ class(t2), intent(out) :: x(:,:)
+ end subroutine fin_test_2
+
+ subroutine fin_test_3(x)
+ class(t3), intent(out) :: x(:,:)
+ if (any (shape(x) /= [5,4])) call abort ()
+ end subroutine fin_test_3
+
+ subroutine check_var_sec(x, factor)
+ integer :: x(:,:)
+ integer, value :: factor
+ integer :: i, j, i2, j2
+
+ do i = 1, 4
+ i2 = (i-1)*3 + 1
+ do j = 1, 5
+ j2 = (j-1)*2 + 1
+ if (x(j,i) /= (j2 + 100*i2)*factor) call abort ()
+ end do
+ end do
+ end subroutine check_var_sec
+end module m
+
+
+program test
+ use m
+ implicit none
+
+ class(t1), allocatable :: x(:,:)
+ class(t2), allocatable :: y(:,:)
+ class(t3), allocatable :: z(:,:)
+ integer :: i, j
+
+ cnt1 = 0; cnt1e = 0; cnt2 = 0; cnt2e = 0; cnt3 = 0; cnt3e = 0
+
+ allocate (t1e :: x(10,10))
+ allocate (t2e :: y(10,10))
+ allocate (t3e :: z(10,10))
+
+ select type(x)
+ type is (t1e)
+ do i = 1, 10
+ do j = 1, 10
+ x(j,i)%i = j + 100*i
+ x(j,i)%j = (j + 100*i)*100
+ end do
+ end do
+ end select
+
+ select type(y)
+ type is (t2e)
+ do i = 1, 10
+ do j = 1, 10
+ y(j,i)%i = j + 100*i
+ y(j,i)%j = (j + 100*i)*100
+ end do
+ end do
+ end select
+
+ select type(z)
+ type is (t3e)
+ do i = 1, 10
+ do j = 1, 10
+ z(j,i)%i = j + 100*i
+ z(j,i)%j = (j + 100*i)*100
+ end do
+ end do
+ end select
+
+ if (cnt1 + cnt1e + cnt2 + cnt2e + cnt3 + cnt3e /= 0) call abort()
+
+ call fin_test_1(x(::2,::3))
+ if (cnt1 /= 5*4) call abort ()
+ if (cnt1e /= 5*4) call abort ()
+ cnt1 = 0; cnt1e = 0
+ if (cnt2 + cnt2e + cnt3 + cnt3e /= 0) call abort()
+
+ call fin_test_2(y(::2,::3))
+ if (cnt2 /= 1) call abort ()
+ if (cnt2e /= 1) call abort ()
+ cnt2 = 0; cnt2e = 0
+ if (cnt1 + cnt1e + cnt3 + cnt3e /= 0) call abort()
+
+ call fin_test_3(z(::2,::3))
+ if (cnt3 /= 1) call abort ()
+ if (cnt3e /= 1) call abort ()
+ cnt3 = 0; cnt3e = 0
+ if (cnt1 + cnt1e + cnt2 + cnt2e /= 0) call abort()
+
+ select type(x)
+ type is (t1e)
+ call check_val(x%i, 1)
+ call check_val(x%j, 100)
+ end select
+
+ select type(y)
+ type is (t2e)
+ call check_val(y%i, 1)
+ call check_val(y%j, 100)
+ end select
+
+ select type(z)
+ type is (t3e)
+ call check_val(z%i, 1)
+ call check_val(z%j, 100)
+ end select
+
+contains
+ subroutine check_val(x, factor)
+ integer :: x(:,:)
+ integer, value :: factor
+ integer :: i, j
+ do i = 1, 10
+ do j = 1, 10
+ if (mod (j-1, 2) == 0 .and. mod (i-1, 3) == 0) then
+ if (x(j,i) /= (j + 100*i)*factor*(-13)) call abort ()
+ else
+ if (x(j,i) /= (j + 100*i)*factor) call abort ()
+ end if
+ end do
+ end do
+ end subroutine check_val
+end program test
diff --git a/gcc/testsuite/gfortran.dg/finalize_16.f90 b/gcc/testsuite/gfortran.dg/finalize_16.f90
new file mode 100644
index 00000000000..89c5cfb8d99
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_16.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+! { dg-options "-fcheck=all" }
+!
+! PR fortran/57542
+!
+! Contributed by Salvatore Filippone
+!
+module type_mod
+ type inner
+ end type inner
+
+ type outer
+ class(inner), allocatable :: item
+ end type outer
+
+ type container
+ class(outer), allocatable :: item
+ end type container
+
+ type maintype
+ type(container), allocatable :: v(:)
+ end type maintype
+
+end module type_mod
+
+subroutine testfinal(var)
+ use type_mod
+ type(maintype), intent(inout) :: var
+ ! A real code would obviously check
+ ! this is really allocated
+ deallocate(var%v(1)%item%item)
+end subroutine testfinal
diff --git a/gcc/testsuite/gfortran.dg/g77/f77-edit-s-out.f b/gcc/testsuite/gfortran.dg/g77/f77-edit-s-out.f
index 89a8df2caff..7a22ae6b814 100644
--- a/gcc/testsuite/gfortran.dg/g77/f77-edit-s-out.f
+++ b/gcc/testsuite/gfortran.dg/g77/f77-edit-s-out.f
@@ -4,7 +4,7 @@ C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C
C { dg-do run }
-C ( dg-output "^" }
+C { dg-output "^" }
10 format(SP,I3,1X,SS,I3)
20 format(SP,I3,1X,SS,I3,SP,I3)
30 format(SP,I3,1X,SS,I3,S,I3)
diff --git a/gcc/testsuite/gfortran.dg/g77/f77-edit-t-out.f b/gcc/testsuite/gfortran.dg/g77/f77-edit-t-out.f
index 8e411888f2b..b47b7477603 100644
--- a/gcc/testsuite/gfortran.dg/g77/f77-edit-t-out.f
+++ b/gcc/testsuite/gfortran.dg/g77/f77-edit-t-out.f
@@ -4,9 +4,9 @@ C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C
C { dg-do run }
-C ( dg-output "^" }
+C { dg-output "^" }
write(*,'(I4,T8,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
write(*,'(I4,TR3,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
write(*,'(I4,5X,TL2,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
-C ( dg-output "\$" }
+C { dg-output "\$" }
end
diff --git a/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f b/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
index 9d196331dd1..13a9d7a93e8 100644
--- a/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
+++ b/gcc/testsuite/gfortran.dg/g77/f77-edit-x-out.f
@@ -4,7 +4,7 @@ C
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
C
C { dg-do run }
-C ( dg-output "^" }
+C { dg-output "^" }
write(*,'(I1,1X,I1,2X,I1)') 1,2,3 ! { dg-output "1 2 3(\n|\r\n|\r)" }
C Section 13.5.3 explains why there are no trailing blanks
write(*,'(I1,1X,I1,2X,I1,3X)') 1,2,3 ! { dg-output "1 2 3(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/init_flag_11.f90 b/gcc/testsuite/gfortran.dg/init_flag_11.f90
index 7a5239fc457..d881c2c9ce8 100644
--- a/gcc/testsuite/gfortran.dg/init_flag_11.f90
+++ b/gcc/testsuite/gfortran.dg/init_flag_11.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-flags "-finit-local-zero -fno-automatic"
+! { dg-options "-finit-local-zero -fno-automatic" }
!
! PR fortran/53818
!
diff --git a/gcc/testsuite/gfortran.dg/interface_26.f90 b/gcc/testsuite/gfortran.dg/interface_26.f90
index 330c434d2a3..6f8325faf32 100644
--- a/gcc/testsuite/gfortran.dg/interface_26.f90
+++ b/gcc/testsuite/gfortran.dg/interface_26.f90
@@ -23,7 +23,7 @@ PROGRAM test
USE funcs
INTEGER :: rs
INTEGER, PARAMETER :: a = 2, b = 1
- rs = recSum( a, b, test1, sumInts ) ! { dg-error "Type/rank mismatch in argument" }
+ rs = recSum( a, b, test1, sumInts ) ! { dg-error "Type mismatch in argument" }
write(*,*) "Results", rs
CONTAINS
RECURSIVE INTEGER FUNCTION recSum( a,b,UserFunction,UserOp ) RESULT( res )
@@ -37,7 +37,7 @@ CONTAINS
END INTERFACE
INTEGER, EXTERNAL :: UserOp
- res = UserFunction( a,b, UserOp ) ! { dg-error "Type/rank mismatch in function result" }
+ res = UserFunction( a,b, UserOp ) ! { dg-error "Type mismatch in function result" }
if( res .lt. 10 ) then
res = recSum( a, res, UserFunction, UserOp )
diff --git a/gcc/testsuite/gfortran.dg/io_real_boz_3.f90 b/gcc/testsuite/gfortran.dg/io_real_boz_3.f90
index 8043167cd7f..abf02ba168d 100644
--- a/gcc/testsuite/gfortran.dg/io_real_boz_3.f90
+++ b/gcc/testsuite/gfortran.dg/io_real_boz_3.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run }
! { dg-options "-std=f2008" }
! { dg-require-effective-target fortran_real_16 }
!
diff --git a/gcc/testsuite/gfortran.dg/io_real_boz_4.f90 b/gcc/testsuite/gfortran.dg/io_real_boz_4.f90
index f2c2aca4bd6..044f755e23e 100644
--- a/gcc/testsuite/gfortran.dg/io_real_boz_4.f90
+++ b/gcc/testsuite/gfortran.dg/io_real_boz_4.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run }
! { dg-options "-std=f2003" }
! { dg-require-effective-target fortran_real_16 }
!
diff --git a/gcc/testsuite/gfortran.dg/io_real_boz_5.f90 b/gcc/testsuite/gfortran.dg/io_real_boz_5.f90
index db8e6e7557c..a908dd7bbc0 100644
--- a/gcc/testsuite/gfortran.dg/io_real_boz_5.f90
+++ b/gcc/testsuite/gfortran.dg/io_real_boz_5.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run }
! { dg-options "-std=f2008" }
! { dg-require-effective-target fortran_real_16 }
!
diff --git a/gcc/testsuite/gfortran.dg/move_alloc_4.f90 b/gcc/testsuite/gfortran.dg/move_alloc_4.f90
index 4dc493f097f..b23ef70bb93 100644
--- a/gcc/testsuite/gfortran.dg/move_alloc_4.f90
+++ b/gcc/testsuite/gfortran.dg/move_alloc_4.f90
@@ -10,13 +10,14 @@ program testmv3
integer, allocatable :: ia(:), ja(:)
end type
+ block ! For auto-dealloc, as PROGRAM implies SAVE
type(bar), allocatable :: sm,sm2
allocate(sm)
allocate(sm%ia(10),sm%ja(10))
call move_alloc(sm2,sm)
-
+ end block
end program testmv3
! { dg-final { scan-tree-dump-times "__builtin_free" 9 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/namelist_print_1.f b/gcc/testsuite/gfortran.dg/namelist_print_1.f
index 2e5de8305b8..d97d1c9e9a4 100644
--- a/gcc/testsuite/gfortran.dg/namelist_print_1.f
+++ b/gcc/testsuite/gfortran.dg/namelist_print_1.f
@@ -8,6 +8,6 @@
real x
namelist /mynml/ x
x = 1
-! ( dg-output "^" }
+! { dg-output "^" }
print mynml ! { dg-output "&MYNML(\n|\r\n|\r) X= 1.00000000 ,(\n|\r\n|\r) /(\n|\r\n|\r)" }
end
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
index e00594ab7a4..bee73f45213 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
@@ -40,11 +40,11 @@ program bsp
p2 => p1
p1 => p2
- p1 => abs ! { dg-error "Type/rank mismatch in function result" }
- p2 => abs ! { dg-error "Type/rank mismatch in function result" }
+ p1 => abs ! { dg-error "Type mismatch in function result" }
+ p2 => abs ! { dg-error "Type mismatch in function result" }
p3 => dsin
- p3 => sin ! { dg-error "Type/rank mismatch in function result" }
+ p3 => sin ! { dg-error "Type mismatch in function result" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_15.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
index f1d3d184c96..b4f1b2f6ee8 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_15.f90
@@ -19,10 +19,10 @@ p4 => p3
p6 => p1
! invalid
-p1 => iabs ! { dg-error "Type/rank mismatch in function result" }
-p1 => p2 ! { dg-error "Type/rank mismatch in function result" }
-p1 => p5 ! { dg-error "Type/rank mismatch in function result" }
-p6 => iabs ! { dg-error "Type/rank mismatch in function result" }
+p1 => iabs ! { dg-error "Type mismatch in function result" }
+p1 => p2 ! { dg-error "Type mismatch in function result" }
+p1 => p5 ! { dg-error "Type mismatch in function result" }
+p6 => iabs ! { dg-error "Type mismatch in function result" }
p4 => p2 ! { dg-error "is not a subroutine" }
contains
@@ -32,4 +32,3 @@ contains
end subroutine
end
-
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
index 3cad7dfa66b..29a2ef9f0d4 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_20.f90
@@ -27,11 +27,11 @@ type(t2) :: o2
procedure(logical),pointer :: pp1
procedure(complex),pointer :: pp2
-pp1 => pp2 ! { dg-error "Type/rank mismatch" }
-pp2 => o2%ppc ! { dg-error "Type/rank mismatch" }
+pp1 => pp2 ! { dg-error "Type mismatch in function result" }
+pp2 => o2%ppc ! { dg-error "Type mismatch in function result" }
-o1%ppc => pp1 ! { dg-error "Type/rank mismatch" }
-o1%ppc => o2%ppc ! { dg-error "Type/rank mismatch" }
+o1%ppc => pp1 ! { dg-error "Type mismatch in function result" }
+o1%ppc => o2%ppc ! { dg-error "Type mismatch in function result" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_33.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_33.f90
index b6a31fe3a0b..55a768017fa 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_comp_33.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_33.f90
@@ -11,7 +11,7 @@ module m
type :: rectangle
real :: width, height
- procedure(get_area_ai), pointer :: get_area => get_my_area ! { dg-error "Type/rank mismatch" }
+ procedure(get_area_ai), pointer :: get_area => get_my_area ! { dg-error "Type mismatch in argument" }
end type rectangle
abstract interface
@@ -51,7 +51,7 @@ program p
type(rectangle) :: rect
rect = rectangle (1.0, 2.0, get1)
- rect = rectangle (3.0, 4.0, get2) ! { dg-error "Type/rank mismatch" }
+ rect = rectangle (3.0, 4.0, get2) ! { dg-error "Type mismatch in argument" }
contains
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
index b021ca7c76e..121fd4d87f9 100644
--- a/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_result_5.f90
@@ -6,7 +6,7 @@
program test
procedure(real), pointer :: p
- p => f() ! { dg-error "Type/rank mismatch in function result" }
+ p => f() ! { dg-error "Type mismatch in function result" }
contains
function f()
pointer :: f
diff --git a/gcc/testsuite/gfortran.dg/read_x_eor.f90 b/gcc/testsuite/gfortran.dg/read_x_eor.f90
index 064835a8b28..a06e6df1453 100644
--- a/gcc/testsuite/gfortran.dg/read_x_eor.f90
+++ b/gcc/testsuite/gfortran.dg/read_x_eor.f90
@@ -1,5 +1,5 @@
! { dg-do run }
-! ( dg-output "^" }
+! { dg-output "^" }
!
! Test fix for pr24785 - EOR used to scrub the 2X.
! Reduced from PR example submitted by Harald Anlauf <anlauf@gmx.de>
diff --git a/gcc/testsuite/gfortran.dg/repeat_1.f90 b/gcc/testsuite/gfortran.dg/repeat_1.f90
index 7a1d6f9294c..1ac105c2e3c 100644
--- a/gcc/testsuite/gfortran.dg/repeat_1.f90
+++ b/gcc/testsuite/gfortran.dg/repeat_1.f90
@@ -17,4 +17,4 @@ contains
f = x
end function f
end
-! { dg-output "Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative .* line 6)"
+! { dg-output "Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative \\(its value is -1\\)" }
diff --git a/gcc/testsuite/gfortran.dg/spread_bounds_1.f90 b/gcc/testsuite/gfortran.dg/spread_bounds_1.f90
index 7e5bc651ff5..53e08b1c657 100644
--- a/gcc/testsuite/gfortran.dg/spread_bounds_1.f90
+++ b/gcc/testsuite/gfortran.dg/spread_bounds_1.f90
@@ -8,5 +8,5 @@ program main
times = 2
target = spread(source,2,times)
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return value of SPREAD intrinsic in dimension 2: is 3, should be 2"
+! { dg-output "Fortran runtime error: Incorrect extent in return value of SPREAD intrinsic in dimension 2: is 3, should be 2" }
diff --git a/gcc/testsuite/gfortran.dg/storage_size_4.f90 b/gcc/testsuite/gfortran.dg/storage_size_4.f90
new file mode 100644
index 00000000000..bcfd5c3e4f8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/storage_size_4.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/57553
+!
+! Ensure that there is no ICE and that compile-time simplication works.
+!
+ use iso_fortran_env
+ implicit none
+ integer, parameter :: ESize = storage_size('a')
+ integer, parameter :: ESize2 = storage_size('aa')
+ if ( ESize/CHARACTER_STORAGE_SIZE /= 1) call abort()
+ if ( ESize2/CHARACTER_STORAGE_SIZE /= 2) call abort()
+end
+
+subroutine S ( A )
+ character(len=*), intent(in) :: A
+ integer :: ESize = 4
+ esize = ( storage_size(a) + 7 ) / 8
+end
+
+! { dg-final { scan-tree-dump-not "abort" "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/string_length_2.f90 b/gcc/testsuite/gfortran.dg/string_length_2.f90
index 63cea9e1dab..8ea76bfe3bb 100644
--- a/gcc/testsuite/gfortran.dg/string_length_2.f90
+++ b/gcc/testsuite/gfortran.dg/string_length_2.f90
@@ -1,4 +1,4 @@
-! { dg-run }
+! { dg-do run }
! { dg-options "-fdump-tree-original" }
! Test that all string length calculations are
! optimized away.
diff --git a/gcc/testsuite/gfortran.dg/transpose_2.f90 b/gcc/testsuite/gfortran.dg/transpose_2.f90
index 4ab3bc4bb1a..e509d3686bd 100644
--- a/gcc/testsuite/gfortran.dg/transpose_2.f90
+++ b/gcc/testsuite/gfortran.dg/transpose_2.f90
@@ -15,5 +15,4 @@ program main
b = 2.1
b = transpose(a)
end program main
-! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of
-! array 'b' (3/2)" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of array 'b' \\(3/2\\)" }
diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_5.f03 b/gcc/testsuite/gfortran.dg/typebound_assignment_5.f03
new file mode 100644
index 00000000000..3ee4848fc37
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_assignment_5.f03
@@ -0,0 +1,44 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/49074
+! ICE on defined assignment with class arrays.
+
+ module foo
+ type bar
+ integer :: i
+
+ contains
+
+ generic :: assignment (=) => assgn_bar
+ procedure, private :: assgn_bar
+ end type bar
+
+ contains
+
+ elemental subroutine assgn_bar (a, b)
+ class (bar), intent (inout) :: a
+ class (bar), intent (in) :: b
+
+ select type (b)
+ type is (bar)
+ a%i = b%i
+ end select
+
+ return
+ end subroutine assgn_bar
+ end module foo
+
+ program main
+ use foo
+
+ type (bar), allocatable :: foobar(:)
+
+ allocate (foobar(2))
+ foobar = [bar(1), bar(2)]
+ if (any(foobar%i /= [1, 2])) call abort
+ end program
+
+! { dg-final { scan-tree-dump-not "_gfortran_internal_pack" "original" } }
+! { dg-final { scan-tree-dump-not "_gfortran_internal_unpack" "original" } }
+! { dg-final { cleanup-tree-dump "original"} }
diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_6.f03 b/gcc/testsuite/gfortran.dg/typebound_assignment_6.f03
new file mode 100644
index 00000000000..c17de3e3d7c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_assignment_6.f03
@@ -0,0 +1,43 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/56136
+! ICE on defined assignment with class arrays.
+!
+! Original testcase by Alipasha <alipash.celeris@gmail.com>
+
+ MODULE A_TEST_M
+ TYPE :: A_TYPE
+ INTEGER :: I
+ CONTAINS
+ GENERIC :: ASSIGNMENT (=) => ASGN_A
+ PROCEDURE, PRIVATE :: ASGN_A
+ END TYPE
+
+ CONTAINS
+
+ ELEMENTAL SUBROUTINE ASGN_A (A, B)
+ CLASS (A_TYPE), INTENT (INOUT) :: A
+ CLASS (A_TYPE), INTENT (IN) :: B
+ A%I = B%I
+ END SUBROUTINE
+ END MODULE A_TEST_M
+
+ PROGRAM ASGN_REALLOC_TEST
+ USE A_TEST_M
+ TYPE (A_TYPE), ALLOCATABLE :: A(:)
+ INTEGER :: I, J
+
+ ALLOCATE (A(100))
+ A = (/ (A_TYPE(I), I=1,SIZE(A)) /)
+ A(1:50) = A(51:100)
+ IF (ANY(A%I /= (/ ((50+I, I=1,SIZE(A)/2), J=1,2) /))) CALL ABORT
+ A(::2) = A(1:50) ! pack/unpack
+ IF (ANY(A( ::2)%I /= (/ (50+I, I=1,SIZE(A)/2) /))) CALL ABORT
+ IF (ANY(A(2::2)%I /= (/ ((50+2*I, I=1,SIZE(A)/4), J=1,2) /))) CALL ABORT
+ END PROGRAM
+
+! { dg-final { scan-tree-dump-times "_gfortran_internal_pack" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_internal_unpack" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
+
diff --git a/gcc/testsuite/gfortran.dg/typebound_override_1.f90 b/gcc/testsuite/gfortran.dg/typebound_override_1.f90
index 96f90256342..7eb685615f4 100644
--- a/gcc/testsuite/gfortran.dg/typebound_override_1.f90
+++ b/gcc/testsuite/gfortran.dg/typebound_override_1.f90
@@ -20,7 +20,7 @@ module m
type, extends(t1) :: t2
contains
procedure, nopass :: a => a2 ! { dg-error "Character length mismatch in function result" }
- procedure, nopass :: b => b2 ! { dg-error "Type/rank mismatch in function result" }
+ procedure, nopass :: b => b2 ! { dg-error "Rank mismatch in function result" }
procedure, nopass :: c => c2 ! FIXME: dg-warning "Possible character length mismatch"
procedure, nopass :: d => d2 ! valid, check for commutativity (+,*)
procedure, nopass :: e => e2 ! { dg-error "Character length mismatch in function result" }
diff --git a/gcc/testsuite/gfortran.dg/typebound_override_4.f90 b/gcc/testsuite/gfortran.dg/typebound_override_4.f90
index 2b747a87b6e..95131dea3b8 100644
--- a/gcc/testsuite/gfortran.dg/typebound_override_4.f90
+++ b/gcc/testsuite/gfortran.dg/typebound_override_4.f90
@@ -22,7 +22,7 @@ module r_mod
implicit none
type, extends(base_type) :: r_type
contains
- procedure, pass(map) :: clone => r_clone ! { dg-error "Type/rank mismatch in argument" }
+ procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" }
end type
contains
subroutine r_clone(map,mapout)
diff --git a/gcc/testsuite/gfortran.dg/typebound_override_5.f90 b/gcc/testsuite/gfortran.dg/typebound_override_5.f90
new file mode 100644
index 00000000000..565dd48d4fd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_override_5.f90
@@ -0,0 +1,40 @@
+! { dg-do compile }
+!
+! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
+! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module base_mod
+ implicit none
+ type base_type
+ integer :: kind
+ contains
+ procedure, pass(map) :: clone => base_clone
+ end type
+contains
+ subroutine base_clone(map,mapout,info)
+ class(base_type), intent(inout) :: map
+ class(base_type), intent(inout) :: mapout
+ integer :: info
+ end subroutine
+end module
+
+module r_mod
+ use base_mod
+ implicit none
+ type, extends(base_type) :: r_type
+ real :: dat
+ contains
+ procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" }
+ end type
+contains
+ subroutine r_clone(map,mapout,info)
+ class(r_type), intent(inout) :: map
+!gcc$ attributes no_arg_check :: mapout
+ integer, intent(inout) :: mapout
+ integer :: info
+ end subroutine
+end module
+
+! { dg-final { cleanup-modules "base_mod r_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_override_6.f90 b/gcc/testsuite/gfortran.dg/typebound_override_6.f90
new file mode 100644
index 00000000000..45720fd610f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_override_6.f90
@@ -0,0 +1,39 @@
+! { dg-do compile }
+!
+! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
+! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module base_mod
+ implicit none
+ type base_type
+ integer :: kind
+ contains
+ procedure, pass(map) :: clone => base_clone
+ end type
+contains
+ subroutine base_clone(map,mapout,info)
+ class(base_type), intent(inout) :: map
+ class(base_type), intent(inout) :: mapout
+ integer :: info
+ end subroutine
+end module
+
+module r_mod
+ use base_mod
+ implicit none
+ type, extends(base_type) :: r_type
+ real :: dat
+ contains
+ procedure, pass(map) :: clone => r_clone ! { dg-error "Rank mismatch in argument" }
+ end type
+contains
+ subroutine r_clone(map,mapout,info)
+ class(r_type), intent(inout) :: map
+ class(base_type), intent(inout) :: mapout(..)
+ integer :: info
+ end subroutine
+end module
+
+! { dg-final { cleanup-modules "base_mod r_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_override_7.f90 b/gcc/testsuite/gfortran.dg/typebound_override_7.f90
new file mode 100644
index 00000000000..0c7c48ad566
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_override_7.f90
@@ -0,0 +1,39 @@
+! { dg-do compile }
+!
+! PR 54190: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
+! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module base_mod
+ implicit none
+ type base_type
+ integer :: kind
+ contains
+ procedure, pass(map) :: clone => base_clone
+ end type
+contains
+ subroutine base_clone(map,mapout,info)
+ class(base_type), intent(inout) :: map
+ class(base_type), intent(inout) :: mapout
+ integer :: info
+ end subroutine
+end module
+
+module r_mod
+ use base_mod
+ implicit none
+ type, extends(base_type) :: r_type
+ real :: dat
+ contains
+ procedure, pass(map) :: clone => r_clone ! { dg-error "Type mismatch in argument" }
+ end type
+contains
+ subroutine r_clone(map,mapout,info)
+ class(r_type), intent(inout) :: map
+ type(*), intent(inout) :: mapout
+ integer :: info
+ end subroutine
+end module
+
+! { dg-final { cleanup-modules "base_mod r_mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_27.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_27.f03
index 28c44dff120..ce845a03b06 100644
--- a/gcc/testsuite/gfortran.dg/typebound_proc_27.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_27.f03
@@ -33,6 +33,7 @@ program prog
use m
+ block ! Start new scoping unit as PROGRAM implies SAVE
type(tx) :: this
type(tx), target :: that
type(tx), pointer :: p
@@ -64,6 +65,7 @@ program prog
!print *,this%i
if(any (this%i /= [8, 9])) call abort()
+ end block
end program prog
!
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_6.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_6.f03
index 3a32cbc96a2..1e1d871c39f 100644
--- a/gcc/testsuite/gfortran.dg/typebound_proc_6.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_6.f03
@@ -72,7 +72,7 @@ MODULE testmod
PROCEDURE, NOPASS :: subroutine2 => proc_intfunc ! { dg-error "must also be a SUBROUTINE" }
PROCEDURE, NOPASS :: intfunction1 => proc_intfunc ! Ok, matching functions.
PROCEDURE, NOPASS :: intfunction2 => proc_sub ! { dg-error "must also be a FUNCTION" }
- PROCEDURE, NOPASS :: intfunction3 => proc_realfunc ! { dg-error "Type/rank mismatch in function result" }
+ PROCEDURE, NOPASS :: intfunction3 => proc_realfunc ! { dg-error "Type mismatch in function result" }
! For access-based checks.
PROCEDURE, NOPASS, PUBLIC :: priv => proc_sub ! Ok, increases visibility.
@@ -89,7 +89,7 @@ MODULE testmod
! For corresponding dummy arguments.
PROCEDURE, PASS :: corresp1 => proc_tmeint ! Ok.
PROCEDURE, PASS :: corresp2 => proc_tmeintx ! { dg-error "should be named 'a'" }
- PROCEDURE, PASS :: corresp3 => proc_tmereal ! { dg-error "Type/rank mismatch in argument 'a'" }
+ PROCEDURE, PASS :: corresp3 => proc_tmereal ! { dg-error "Type mismatch in argument 'a'" }
END TYPE t
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 28b6b6d9ffd..a5bca6b72c1 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -826,7 +826,8 @@ proc check_effective_target_fpic { } {
proc check_effective_target_pie { } {
if { [istarget *-*-darwin\[912\]*]
- || [istarget *-*-linux*] } {
+ || [istarget *-*-linux*]
+ || [istarget *-*-gnu*] } {
return 1;
}
return 0
@@ -1311,6 +1312,32 @@ proc check_effective_target_avx_runtime { } {
return 0
}
+# Return 1 if the target supports executing power8 vector instructions, 0
+# otherwise. Cache the result.
+
+proc check_p8vector_hw_available { } {
+ return [check_cached_effective_target p8vector_hw_available {
+ # Some simulators are known to not support VSX/power8 instructions.
+ # For now, disable on Darwin
+ if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} {
+ expr 0
+ } else {
+ set options "-mpower8-vector"
+ check_runtime_nocache p8vector_hw_available {
+ int main()
+ {
+ #ifdef __MACH__
+ asm volatile ("xxlorc vs0,vs0,vs0");
+ #else
+ asm volatile ("xxlorc 0,0,0");
+ #endif
+ return 0;
+ }
+ } $options
+ }
+ }]
+}
+
# Return 1 if the target supports executing VSX instructions, 0
# otherwise. Cache the result.
@@ -2749,6 +2776,33 @@ proc check_effective_target_powerpc_altivec_ok { } {
}
}
+# Return 1 if this is a PowerPC target supporting -mpower8-vector
+
+proc check_effective_target_powerpc_p8vector_ok { } {
+ if { ([istarget powerpc*-*-*]
+ && ![istarget powerpc-*-linux*paired*])
+ || [istarget rs6000-*-*] } {
+ # AltiVec is not supported on AIX before 5.3.
+ if { [istarget powerpc*-*-aix4*]
+ || [istarget powerpc*-*-aix5.1*]
+ || [istarget powerpc*-*-aix5.2*] } {
+ return 0
+ }
+ return [check_no_compiler_messages powerpc_p8vector_ok object {
+ int main (void) {
+#ifdef __MACH__
+ asm volatile ("xxlorc vs0,vs0,vs0");
+#else
+ asm volatile ("xxlorc 0,0,0");
+#endif
+ return 0;
+ }
+ } "-mpower8-vector"]
+ } else {
+ return 0
+ }
+}
+
# Return 1 if this is a PowerPC target supporting -mvsx
proc check_effective_target_powerpc_vsx_ok { } {
@@ -4576,6 +4630,7 @@ proc is-effective-target { arg } {
switch $arg {
"vmx_hw" { set selected [check_vmx_hw_available] }
"vsx_hw" { set selected [check_vsx_hw_available] }
+ "p8vector_hw" { set selected [check_p8vector_hw_available] }
"ppc_recip_hw" { set selected [check_ppc_recip_hw_available] }
"named_sections" { set selected [check_named_sections_available] }
"gc_sections" { set selected [check_gc_sections_available] }
@@ -4597,6 +4652,7 @@ proc is-effective-target-keyword { arg } {
switch $arg {
"vmx_hw" { return 1 }
"vsx_hw" { return 1 }
+ "p8vector_hw" { return 1 }
"ppc_recip_hw" { return 1 }
"named_sections" { return 1 }
"gc_sections" { return 1 }
@@ -5181,7 +5237,9 @@ proc check_vect_support_and_set_flags { } {
}
lappend DEFAULT_VECTCFLAGS "-maltivec"
- if [check_vsx_hw_available] {
+ if [check_p8vector_hw_available] {
+ lappend DEFAULT_VECTCFLAGS "-mpower8-vector" "-mno-allow-movmisalign"
+ } elseif [check_vsx_hw_available] {
lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign"
}
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index d7e5a40106f..6289ea46a89 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -3933,7 +3933,7 @@ get_cg_data (struct cgraph_node **node, bool traverse_aliases)
struct tm_ipa_cg_data *d;
if (traverse_aliases && (*node)->symbol.alias)
- *node = cgraph_get_node ((*node)->thunk.alias);
+ *node = cgraph_alias_target (*node);
d = (struct tm_ipa_cg_data *) (*node)->symbol.aux;
@@ -4681,6 +4681,13 @@ ipa_tm_mark_force_output_node (struct cgraph_node *node)
node->symbol.analyzed = true;
}
+static inline void
+ipa_tm_mark_forced_by_abi_node (struct cgraph_node *node)
+{
+ node->symbol.forced_by_abi = true;
+ node->symbol.analyzed = true;
+}
+
/* Callback data for ipa_tm_create_version_alias. */
struct create_version_alias_info
{
@@ -4699,7 +4706,7 @@ ipa_tm_create_version_alias (struct cgraph_node *node, void *data)
tree old_decl, new_decl, tm_name;
struct cgraph_node *new_node;
- if (!node->same_body_alias)
+ if (!node->symbol.cpp_implicit_alias)
return false;
old_decl = node->symbol.decl;
@@ -4737,6 +4744,8 @@ ipa_tm_create_version_alias (struct cgraph_node *node, void *data)
if (info->old_node->symbol.force_output
|| ipa_ref_list_first_referring (&info->old_node->symbol.ref_list))
ipa_tm_mark_force_output_node (new_node);
+ if (info->old_node->symbol.forced_by_abi)
+ ipa_tm_mark_forced_by_abi_node (new_node);
return false;
}
@@ -4792,6 +4801,8 @@ ipa_tm_create_version (struct cgraph_node *old_node)
if (old_node->symbol.force_output
|| ipa_ref_list_first_referring (&old_node->symbol.ref_list))
ipa_tm_mark_force_output_node (new_node);
+ if (old_node->symbol.forced_by_abi)
+ ipa_tm_mark_forced_by_abi_node (new_node);
/* Do the same thing, but for any aliases of the original node. */
{
@@ -5369,7 +5380,7 @@ ipa_tm_execute (void)
bool doit = false;
node = tm_callees[i];
- if (node->same_body_alias)
+ if (node->symbol.cpp_implicit_alias)
continue;
a = cgraph_function_body_availability (node);
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 9fecb6cb663..6329fdd5015 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -699,7 +699,9 @@ create_emultls_var (struct varpool_node *var, void *data)
tree cdecl;
struct varpool_node *cvar;
- cdecl = new_emutls_decl (var->symbol.decl, var->alias_of);
+ cdecl = new_emutls_decl (var->symbol.decl,
+ var->symbol.alias && var->symbol.analyzed
+ ? varpool_alias_target (var)->symbol.decl : NULL);
cvar = varpool_get_node (cdecl);
control_vars.quick_push (cvar);
@@ -711,7 +713,7 @@ create_emultls_var (struct varpool_node *var, void *data)
need to do this once for the main variable. */
emutls_common_1 (var->symbol.decl, cdecl, (tree *)data);
}
- if (var->symbol.alias && !var->alias_of)
+ if (var->symbol.alias && !var->symbol.analyzed)
cvar->symbol.alias = true;
/* Indicate that the value of the TLS variable may be found elsewhere,
@@ -767,7 +769,7 @@ ipa_lower_emutls (void)
{
var = tls_vars->nodes[i];
- if (var->symbol.alias && !var->alias_of)
+ if (var->symbol.alias && !var->symbol.analyzed)
any_aliases = true;
else if (!var->symbol.alias)
varpool_for_node_and_aliases (var, create_emultls_var, &ctor_body, true);
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 24fcfbfe920..caa8d7457fb 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -464,7 +464,7 @@ extern void record_vars_into (tree, tree);
extern void record_vars (tree);
extern bool gimple_seq_may_fallthru (gimple_seq);
extern bool gimple_stmt_may_fallthru (gimple);
-extern bool gimple_check_call_matching_types (gimple, tree);
+extern bool gimple_check_call_matching_types (gimple, tree, bool);
/* In tree-ssa.c */
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index f028b25b19a..4c630a3130e 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -93,7 +93,7 @@ static sbitmap old_ssa_names;
the operations done on them are presence tests. */
static sbitmap new_ssa_names;
-sbitmap interesting_blocks;
+static sbitmap interesting_blocks;
/* Set of SSA names that have been marked to be released after they
were registered in the replacement table. They will be finally
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 2b8311a6c05..16345713505 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -39,7 +39,7 @@ struct object_size_info
unsigned int *stack, *tos;
};
-static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
+static const unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
static tree compute_object_offset (const_tree, const_tree);
static unsigned HOST_WIDE_INT addr_object_size (struct object_size_info *,
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index 354b5f182a8..d6471918d51 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -943,8 +943,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
continue;
register_ssa_partition (map, arg);
- if ((SSA_NAME_VAR (arg) == SSA_NAME_VAR (res)
- && TREE_TYPE (arg) == TREE_TYPE (res))
+ if (gimple_can_coalesce_p (arg, res)
|| (e->flags & EDGE_ABNORMAL))
{
saw_copy = true;
@@ -985,8 +984,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
if (gimple_assign_copy_p (stmt)
&& TREE_CODE (lhs) == SSA_NAME
&& TREE_CODE (rhs1) == SSA_NAME
- && SSA_NAME_VAR (lhs) == SSA_NAME_VAR (rhs1)
- && TREE_TYPE (lhs) == TREE_TYPE (rhs1))
+ && gimple_can_coalesce_p (lhs, rhs1))
{
v1 = SSA_NAME_VERSION (lhs);
v2 = SSA_NAME_VERSION (rhs1);
@@ -1037,8 +1035,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
v1 = SSA_NAME_VERSION (outputs[match]);
v2 = SSA_NAME_VERSION (input);
- if (SSA_NAME_VAR (outputs[match]) == SSA_NAME_VAR (input)
- && TREE_TYPE (outputs[match]) == TREE_TYPE (input))
+ if (gimple_can_coalesce_p (outputs[match], input))
{
cost = coalesce_cost (REG_BR_PROB_BASE,
optimize_bb_for_size_p (bb));
@@ -1072,8 +1069,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
first = var;
else
{
- gcc_assert (SSA_NAME_VAR (var) == SSA_NAME_VAR (first)
- && TREE_TYPE (var) == TREE_TYPE (first));
+ gcc_assert (gimple_can_coalesce_p (var, first));
v1 = SSA_NAME_VERSION (first);
v2 = SSA_NAME_VERSION (var);
bitmap_set_bit (used_in_copy, v1);
@@ -1210,8 +1206,7 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
var2 = ssa_name (y);
/* Assert the coalesces have the same base variable. */
- gcc_assert (SSA_NAME_VAR (var1) == SSA_NAME_VAR (var2)
- && TREE_TYPE (var1) == TREE_TYPE (var2));
+ gcc_assert (gimple_can_coalesce_p (var1, var2));
if (debug)
fprintf (debug, "Coalesce list: ");
@@ -1341,3 +1336,38 @@ coalesce_ssa_name (void)
return map;
}
+
+/* Given SSA_NAMEs NAME1 and NAME2, return true if they are candidates for
+ coalescing together, false otherwise.
+
+ This must stay consistent with var_map_base_init in tree-ssa-live.c. */
+
+bool
+gimple_can_coalesce_p (tree name1, tree name2)
+{
+ /* First check the SSA_NAME's associated DECL. We only want to
+ coalesce if they have the same DECL or both have no associated DECL. */
+ if (SSA_NAME_VAR (name1) != SSA_NAME_VAR (name2))
+ return false;
+
+ /* Now check the types. If the types are the same, then we should
+ try to coalesce V1 and V2. */
+ tree t1 = TREE_TYPE (name1);
+ tree t2 = TREE_TYPE (name2);
+ if (t1 == t2)
+ return true;
+
+ /* If the types are not the same, check for a canonical type match. This
+ (for example) allows coalescing when the types are fundamentally the
+ same, but just have different names.
+
+ Note pointer types with different address spaces may have the same
+ canonical type. Those are rejected for coalescing by the
+ types_compatible_p check. */
+ if (TYPE_CANONICAL (t1)
+ && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2)
+ && types_compatible_p (t1, t2))
+ return true;
+
+ return false;
+}
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index ad99ea9d5d4..39f47abd83b 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -84,6 +84,13 @@ dse_possible_dead_store_p (gimple stmt, gimple *use_stmt)
*use_stmt = NULL;
+ /* Self-assignments are zombies. */
+ if (operand_equal_p (gimple_assign_rhs1 (stmt), gimple_assign_lhs (stmt), 0))
+ {
+ *use_stmt = stmt;
+ return true;
+ }
+
/* Find the first dominated statement that clobbers (part of) the
memory stmt stores to with no intermediate statement that may use
part of the memory stmt stores. That is, find a store that may
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 6043d318d71..c6a7eafbad5 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1978,8 +1978,8 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
/* (a | CST1) & CST2 -> (a & CST2) | (CST1 & CST2). */
if (code == BIT_AND_EXPR
&& def1_code == BIT_IOR_EXPR
- && TREE_CODE (arg2) == INTEGER_CST
- && TREE_CODE (def1_arg2) == INTEGER_CST)
+ && CONSTANT_CLASS_P (arg2)
+ && CONSTANT_CLASS_P (def1_arg2))
{
tree cst = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg2),
arg2, def1_arg2);
@@ -2009,8 +2009,8 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
|| code == BIT_IOR_EXPR
|| code == BIT_XOR_EXPR)
&& def1_code == code
- && TREE_CODE (arg2) == INTEGER_CST
- && TREE_CODE (def1_arg2) == INTEGER_CST)
+ && CONSTANT_CLASS_P (arg2)
+ && CONSTANT_CLASS_P (def1_arg2))
{
tree cst = fold_build2 (code, TREE_TYPE (arg2),
arg2, def1_arg2);
@@ -2022,7 +2022,6 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
/* Canonicalize X ^ ~0 to ~X. */
if (code == BIT_XOR_EXPR
- && TREE_CODE (arg2) == INTEGER_CST
&& integer_all_onesp (arg2))
{
gimple_assign_set_rhs_with_ops (gsi, BIT_NOT_EXPR, arg1, NULL_TREE);
@@ -2433,7 +2432,7 @@ associate_plusminus (gimple_stmt_iterator *gsi)
(A +- B) - A -> +- B
(A +- B) -+ B -> A
(CST +- A) +- CST -> CST +- A
- (A + CST) +- CST -> A + CST
+ (A +- CST) +- CST -> A +- CST
~A + A -> -1
~A + 1 -> -A
A - (A +- B) -> -+ B
@@ -2479,8 +2478,8 @@ associate_plusminus (gimple_stmt_iterator *gsi)
gcc_assert (gsi_stmt (*gsi) == stmt);
gimple_set_modified (stmt, true);
}
- else if (TREE_CODE (rhs2) == INTEGER_CST
- && TREE_CODE (def_rhs1) == INTEGER_CST)
+ else if (CONSTANT_CLASS_P (rhs2)
+ && CONSTANT_CLASS_P (def_rhs1))
{
/* (CST +- A) +- CST -> CST +- A. */
tree cst = fold_binary (code, TREE_TYPE (rhs1),
@@ -2496,16 +2495,17 @@ associate_plusminus (gimple_stmt_iterator *gsi)
gimple_set_modified (stmt, true);
}
}
- else if (TREE_CODE (rhs2) == INTEGER_CST
- && TREE_CODE (def_rhs2) == INTEGER_CST
- && def_code == PLUS_EXPR)
+ else if (CONSTANT_CLASS_P (rhs2)
+ && CONSTANT_CLASS_P (def_rhs2))
{
- /* (A + CST) +- CST -> A + CST. */
- tree cst = fold_binary (code, TREE_TYPE (rhs1),
+ /* (A +- CST) +- CST -> A +- CST. */
+ enum tree_code mix = (code == def_code)
+ ? PLUS_EXPR : MINUS_EXPR;
+ tree cst = fold_binary (mix, TREE_TYPE (rhs1),
def_rhs2, rhs2);
if (cst && !TREE_OVERFLOW (cst))
{
- code = PLUS_EXPR;
+ code = def_code;
gimple_assign_set_rhs_code (stmt, code);
rhs1 = def_rhs1;
gimple_assign_set_rhs1 (stmt, rhs1);
@@ -2515,23 +2515,24 @@ associate_plusminus (gimple_stmt_iterator *gsi)
}
}
}
- else if (def_code == BIT_NOT_EXPR
- && INTEGRAL_TYPE_P (TREE_TYPE (rhs1)))
+ else if (def_code == BIT_NOT_EXPR && code == PLUS_EXPR)
{
tree def_rhs1 = gimple_assign_rhs1 (def_stmt);
- if (code == PLUS_EXPR
- && operand_equal_p (def_rhs1, rhs2, 0))
+ if (operand_equal_p (def_rhs1, rhs2, 0))
{
/* ~A + A -> -1. */
- code = INTEGER_CST;
- rhs1 = build_int_cst_type (TREE_TYPE (rhs2), -1);
+ rhs1 = build_all_ones_cst (TREE_TYPE (rhs2));
rhs2 = NULL_TREE;
+ code = TREE_CODE (rhs1);
gimple_assign_set_rhs_with_ops (gsi, code, rhs1, NULL_TREE);
gcc_assert (gsi_stmt (*gsi) == stmt);
gimple_set_modified (stmt, true);
}
- else if (code == PLUS_EXPR
- && integer_onep (rhs1))
+ else if ((TREE_CODE (TREE_TYPE (rhs2)) != COMPLEX_TYPE
+ && integer_onep (rhs2))
+ || (TREE_CODE (rhs2) == COMPLEX_CST
+ && integer_onep (TREE_REALPART (rhs2))
+ && integer_onep (TREE_IMAGPART (rhs2))))
{
/* ~A + 1 -> -A. */
code = NEGATE_EXPR;
@@ -2580,8 +2581,8 @@ associate_plusminus (gimple_stmt_iterator *gsi)
gcc_assert (gsi_stmt (*gsi) == stmt);
gimple_set_modified (stmt, true);
}
- else if (TREE_CODE (rhs1) == INTEGER_CST
- && TREE_CODE (def_rhs1) == INTEGER_CST)
+ else if (CONSTANT_CLASS_P (rhs1)
+ && CONSTANT_CLASS_P (def_rhs1))
{
/* CST +- (CST +- A) -> CST +- A. */
tree cst = fold_binary (code, TREE_TYPE (rhs2),
@@ -2597,8 +2598,8 @@ associate_plusminus (gimple_stmt_iterator *gsi)
gimple_set_modified (stmt, true);
}
}
- else if (TREE_CODE (rhs1) == INTEGER_CST
- && TREE_CODE (def_rhs2) == INTEGER_CST)
+ else if (CONSTANT_CLASS_P (rhs1)
+ && CONSTANT_CLASS_P (def_rhs2))
{
/* CST +- (A +- CST) -> CST +- A. */
tree cst = fold_binary (def_code == code
@@ -2615,17 +2616,16 @@ associate_plusminus (gimple_stmt_iterator *gsi)
}
}
}
- else if (def_code == BIT_NOT_EXPR
- && INTEGRAL_TYPE_P (TREE_TYPE (rhs2)))
+ else if (def_code == BIT_NOT_EXPR)
{
tree def_rhs1 = gimple_assign_rhs1 (def_stmt);
if (code == PLUS_EXPR
&& operand_equal_p (def_rhs1, rhs1, 0))
{
/* A + ~A -> -1. */
- code = INTEGER_CST;
- rhs1 = build_int_cst_type (TREE_TYPE (rhs1), -1);
+ rhs1 = build_all_ones_cst (TREE_TYPE (rhs1));
rhs2 = NULL_TREE;
+ code = TREE_CODE (rhs1);
gimple_assign_set_rhs_with_ops (gsi, code, rhs1, NULL_TREE);
gcc_assert (gsi_stmt (*gsi) == stmt);
gimple_set_modified (stmt, true);
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 83a52a0482c..a624d0055c2 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -111,8 +111,12 @@ var_map_base_init (var_map map)
as it restricts the sets we compute conflicts for.
Using TREE_TYPE to generate sets is the easies as
type equivalency also holds for SSA names with the same
- underlying decl. */
- m->base.from = TREE_TYPE (var);
+ underlying decl.
+
+ Check gimple_can_coalesce_p when changing this code. */
+ m->base.from = (TYPE_CANONICAL (TREE_TYPE (var))
+ ? TYPE_CANONICAL (TREE_TYPE (var))
+ : TREE_TYPE (var));
/* If base variable hasn't been seen, set it up. */
slot = tree_to_index.find_slot (m, INSERT);
if (!*slot)
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index a15c4042867..e9c32b3c8be 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1447,9 +1447,7 @@ execute_cse_sincos (void)
arg1 = gimple_call_arg (stmt, 1);
loc = gimple_location (stmt);
- if (real_minus_onep (arg0)
- && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
- && !host_integerp (arg1,0))
+ if (real_minus_onep (arg0))
{
tree t0, t1, cond, one, minus_one;
gimple stmt;
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 1bfe2b2476f..d7aeefe0b22 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -382,7 +382,7 @@ new_var_info (tree t, const char *name)
/* A map mapping call statements to per-stmt variables for uses
and clobbers specific to the call. */
-struct pointer_map_t *call_stmt_vars;
+static struct pointer_map_t *call_stmt_vars;
/* Lookup or create the variable for the call statement CALL. */
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index 1fbc524e57f..555485a07c3 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -474,12 +474,11 @@ uncprop_into_successor_phis (basic_block bb)
equiv_hash_elt an_equiv_elt;
equiv_hash_elt **slot;
- /* If the argument is not an invariant, and refers to the same
- underlying variable as the PHI result, then there's no
- point in un-propagating the argument. */
+ /* If the argument is not an invariant and can be potentially
+ coalesced with the result, then there's no point in
+ un-propagating the argument. */
if (!is_gimple_min_invariant (arg)
- && (SSA_NAME_VAR (arg) == SSA_NAME_VAR (res)
- && TREE_TYPE (arg) == TREE_TYPE (res)))
+ && gimple_can_coalesce_p (arg, res))
continue;
/* Lookup this argument's value in the hash table. */
@@ -493,7 +492,7 @@ uncprop_into_successor_phis (basic_block bb)
int j;
/* Walk every equivalence with the same value. If we find
- one with the same underlying variable as the PHI result,
+ one that can potentially coalesce with the PHI rsult,
then replace the value in the argument with its equivalent
SSA_NAME. Use the most recent equivalence as hopefully
that results in shortest lifetimes. */
@@ -501,8 +500,7 @@ uncprop_into_successor_phis (basic_block bb)
{
tree equiv = elt->equivalences[j];
- if (SSA_NAME_VAR (equiv) == SSA_NAME_VAR (res)
- && TREE_TYPE (equiv) == TREE_TYPE (res))
+ if (gimple_can_coalesce_p (equiv, res))
{
SET_PHI_ARG_DEF (phi, e->dest_idx, equiv);
break;
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index 2625dd6b42f..39b212e47b3 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -87,8 +87,9 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
bp_pack_value (bp, TYPE_UNSIGNED (expr), 1);
else
bp_pack_value (bp, 0, 1);
- /* We write debug info two times, do not confuse the second one. */
- bp_pack_value (bp, ((TYPE_P (expr) || TREE_CODE (expr) == TYPE_DECL)
+ /* We write debug info two times, do not confuse the second one.
+ The only relevant TREE_ASM_WRITTEN use is on SSA names. */
+ bp_pack_value (bp, (TREE_CODE (expr) != SSA_NAME
? 0 : TREE_ASM_WRITTEN (expr)), 1);
if (TYPE_P (expr))
bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c
index f29690f62b9..e4d948b4cca 100644
--- a/gcc/tree-streamer.c
+++ b/gcc/tree-streamer.c
@@ -152,6 +152,7 @@ streamer_tree_cache_insert_1 (struct streamer_tree_cache_d *cache,
the requested location slot. */
ix = *ix_p;
streamer_tree_cache_add_to_node_array (cache, ix, t);
+ *slot = (void *)(size_t) (ix + 1);
}
/* Indicate that T was already in the cache. */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index d3281e4e51b..3b10b1989b4 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -5801,7 +5801,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (dump_enabled_p ())
{
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ dump_printf_loc (MSG_NOTE, vect_location,
"LOOP VECTORIZED\n");
if (loop->inner)
dump_printf_loc (MSG_NOTE, vect_location,
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 648385a9b0c..0a48727821a 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -640,7 +640,10 @@ vect_recog_widen_mult_pattern (vec<gimple> *stmts,
&& vect_handle_widen_op_by_const (last_stmt, MULT_EXPR, oprnd1,
&oprnd0, stmts, type,
&half_type0, def_stmt0))
- half_type1 = half_type0;
+ {
+ half_type1 = half_type0;
+ oprnd1 = fold_convert (half_type1, oprnd1);
+ }
else
return NULL;
}
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 3dde0636e0f..ea8c202d187 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1932,7 +1932,8 @@ vect_bb_slp_scalar_cost (basic_block bb,
imm_use_iterator use_iter;
gimple use_stmt;
FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, DEF_FROM_PTR (def_p))
- if (gimple_bb (use_stmt) != bb
+ if (gimple_code (use_stmt) == GIMPLE_PHI
+ || gimple_bb (use_stmt) != bb
|| !STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (use_stmt)))
{
life[i] = true;
@@ -3181,7 +3182,7 @@ vect_slp_transform_bb (basic_block bb)
}
if (dump_enabled_p ())
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ dump_printf_loc (MSG_NOTE, vect_location,
"BASIC BLOCK VECTORIZED\n");
destroy_bb_vec_info (bb_vinfo);
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 814f96c3017..1ef31eefd1d 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -118,8 +118,8 @@ vectorize_loops (void)
if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
&& dump_enabled_p ())
- dump_printf (MSG_NOTE, "\n\nVectorizing loop at %s:%d\n",
- LOC_FILE (vect_location), LOC_LINE (vect_location));
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "Vectorized loop\n");
vect_transform_loop (loop_vinfo);
num_vectorized_loops++;
}
@@ -179,8 +179,8 @@ execute_vect_slp (void)
{
vect_slp_transform_bb (bb);
if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "basic block vectorized using SLP\n");
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "Vectorized basic-block\n");
}
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 6c71025b6b4..2c93c0e7c21 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1643,6 +1643,21 @@ build_one_cst (tree type)
}
}
+/* Return an integer of type TYPE containing all 1's in as much precision as
+ it contains, or a complex or vector whose subparts are such integers. */
+
+tree
+build_all_ones_cst (tree type)
+{
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tree scalar = build_all_ones_cst (TREE_TYPE (type));
+ return build_complex (type, scalar, scalar);
+ }
+ else
+ return build_minus_one_cst (type);
+}
+
/* Return a constant of arithmetic type TYPE which is the
opposite of the multiplicative identity of the set TYPE. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 54abf25ade2..a8e2fadd49e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4768,6 +4768,7 @@ extern tree build_real_from_int_cst (tree, const_tree);
extern tree build_complex (tree, tree, tree);
extern tree build_one_cst (tree);
extern tree build_minus_one_cst (tree);
+extern tree build_all_ones_cst (tree);
extern tree build_zero_cst (tree);
extern tree build_string (int, const char *);
extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);
diff --git a/gcc/tsan.c b/gcc/tsan.c
index a3b65650e38..d218eed5a1b 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -198,7 +198,7 @@ enum tsan_atomic_action
/* Table how to map sync/atomic builtins to their corresponding
tsan equivalents. */
-static struct tsan_map_atomic
+static const struct tsan_map_atomic
{
enum built_in_function fcode, tsan_fcode;
enum tsan_atomic_action action;
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index b665b1c3904..67bc2c8ea8e 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1231,7 +1231,7 @@ static bool
check_ic_target (gimple call_stmt, struct cgraph_node *target)
{
location_t locus;
- if (gimple_check_call_matching_types (call_stmt, target->symbol.decl))
+ if (gimple_check_call_matching_types (call_stmt, target->symbol.decl, true))
return true;
locus = gimple_location (call_stmt);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 81552fe6fed..b4048b5b4dd 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -307,19 +307,22 @@ get_section (const char *name, unsigned int flags, tree decl)
return sect;
}
/* Sanity check user variables for flag changes. */
- if (decl == 0)
- decl = sect->named.decl;
- gcc_assert (decl);
- if (sect->named.decl == NULL)
- error ("%+D causes a section type conflict", decl);
- else
+ if (sect->named.decl != NULL
+ && DECL_P (sect->named.decl)
+ && decl != sect->named.decl)
{
- error ("%+D causes a section type conflict with %D",
- decl, sect->named.decl);
- if (decl != sect->named.decl)
- inform (DECL_SOURCE_LOCATION (sect->named.decl),
- "%qD was declared here", sect->named.decl);
+ if (decl != NULL && DECL_P (decl))
+ error ("%+D causes a section type conflict with %D",
+ decl, sect->named.decl);
+ else
+ error ("section type conflict with %D", sect->named.decl);
+ inform (DECL_SOURCE_LOCATION (sect->named.decl),
+ "%qD was declared here", sect->named.decl);
}
+ else if (decl != NULL && DECL_P (decl))
+ error ("%+D causes a section type conflict", decl);
+ else
+ error ("section type conflict");
/* Make sure we don't error about one section multiple times. */
sect->common.flags |= SECTION_OVERRIDE;
}
@@ -409,9 +412,6 @@ get_named_section (tree decl, const char *name, int reloc)
}
flags = targetm.section_type_flags (decl, name, reloc);
-
- if (decl && !DECL_P (decl))
- decl = NULL_TREE;
return get_section (name, flags, decl);
}
@@ -966,13 +966,80 @@ align_variable (tree decl, bool dont_output_data)
align = MAX_OFILE_ALIGNMENT;
}
- /* On some machines, it is good to increase alignment sometimes. */
if (! DECL_USER_ALIGN (decl))
{
+#ifdef DATA_ABI_ALIGNMENT
+ unsigned int data_abi_align
+ = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align);
+ /* For backwards compatibility, don't assume the ABI alignment for
+ TLS variables. */
+ if (! DECL_THREAD_LOCAL_P (decl) || data_abi_align <= BITS_PER_WORD)
+ align = data_abi_align;
+#endif
+
+ /* On some machines, it is good to increase alignment sometimes.
+ But as DECL_ALIGN is used both for actually emitting the variable
+ and for code accessing the variable as guaranteed alignment, we
+ can only increase the alignment if it is a performance optimization
+ if the references to it must bind to the current definition. */
+ if (decl_binds_to_current_def_p (decl))
+ {
+#ifdef DATA_ALIGNMENT
+ unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+ /* Don't increase alignment too much for TLS variables - TLS space
+ is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
+ align = data_align;
+#endif
+#ifdef CONSTANT_ALIGNMENT
+ if (DECL_INITIAL (decl) != 0
+ && DECL_INITIAL (decl) != error_mark_node)
+ {
+ unsigned int const_align
+ = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
+ /* Don't increase alignment too much for TLS variables - TLS
+ space is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
+ align = const_align;
+ }
+#endif
+ }
+ }
+
+ /* Reset the alignment in case we have made it tighter, so we can benefit
+ from it in get_pointer_alignment. */
+ DECL_ALIGN (decl) = align;
+}
+
+/* Return DECL_ALIGN (decl), possibly increased for optimization purposes
+ beyond what align_variable returned. */
+
+static unsigned int
+get_variable_align (tree decl)
+{
+ unsigned int align = DECL_ALIGN (decl);
+
+ /* For user aligned vars or static vars align_variable already did
+ everything. */
+ if (DECL_USER_ALIGN (decl) || !TREE_PUBLIC (decl))
+ return align;
+
+#ifdef DATA_ABI_ALIGNMENT
+ if (DECL_THREAD_LOCAL_P (decl))
+ align = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align);
+#endif
+
+ /* For decls that bind to the current definition, align_variable
+ did also everything, except for not assuming ABI required alignment
+ of TLS variables. For other vars, increase the alignment here
+ as an optimization. */
+ if (!decl_binds_to_current_def_p (decl))
+ {
+ /* On some machines, it is good to increase alignment sometimes. */
#ifdef DATA_ALIGNMENT
unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
/* Don't increase alignment too much for TLS variables - TLS space
- is too precious. */
+ is too precious. */
if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
align = data_align;
#endif
@@ -989,9 +1056,7 @@ align_variable (tree decl, bool dont_output_data)
#endif
}
- /* Reset the alignment in case we have made it tighter, so we can benefit
- from it in get_pointer_alignment. */
- DECL_ALIGN (decl) = align;
+ return align;
}
/* Return the section into which the given VAR_DECL or CONST_DECL
@@ -1043,7 +1108,8 @@ get_variable_section (tree decl, bool prefer_noswitch_p)
return bss_noswitch_section;
}
- return targetm.asm_out.select_section (decl, reloc, DECL_ALIGN (decl));
+ return targetm.asm_out.select_section (decl, reloc,
+ get_variable_align (decl));
}
/* Return the block into which object_block DECL should be placed. */
@@ -1780,7 +1846,8 @@ emit_bss (tree decl ATTRIBUTE_UNUSED,
unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
{
#if defined ASM_OUTPUT_ALIGNED_BSS
- ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size, DECL_ALIGN (decl));
+ ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size,
+ get_variable_align (decl));
return true;
#endif
}
@@ -1796,10 +1863,11 @@ emit_common (tree decl ATTRIBUTE_UNUSED,
{
#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON
ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, decl, name,
- size, DECL_ALIGN (decl));
+ size, get_variable_align (decl));
return true;
#elif defined ASM_OUTPUT_ALIGNED_COMMON
- ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, name, size, DECL_ALIGN (decl));
+ ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, name, size,
+ get_variable_align (decl));
return true;
#else
ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded);
@@ -1828,7 +1896,8 @@ emit_tls_common (tree decl ATTRIBUTE_UNUSED,
NAME is the name of DECL's SYMBOL_REF. */
static void
-assemble_noswitch_variable (tree decl, const char *name, section *sect)
+assemble_noswitch_variable (tree decl, const char *name, section *sect,
+ unsigned int align)
{
unsigned HOST_WIDE_INT size, rounded;
@@ -1850,7 +1919,7 @@ assemble_noswitch_variable (tree decl, const char *name, section *sect)
* (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
if (!sect->noswitch.callback (decl, name, size, rounded)
- && (unsigned HOST_WIDE_INT) DECL_ALIGN_UNIT (decl) > rounded)
+ && (unsigned HOST_WIDE_INT) (align / BITS_PER_UNIT) > rounded)
warning (0, "requested alignment for %q+D is greater than "
"implemented alignment of %wu", decl, rounded);
}
@@ -1880,7 +1949,7 @@ assemble_variable_contents (tree decl, const char *name,
/* Output the actual data. */
output_constant (DECL_INITIAL (decl),
tree_low_cst (DECL_SIZE_UNIT (decl), 1),
- DECL_ALIGN (decl));
+ get_variable_align (decl));
else
/* Leave space for it. */
assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1));
@@ -1904,6 +1973,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
const char *name;
rtx decl_rtl, symbol;
section *sect;
+ unsigned int align;
bool asan_protected = false;
/* This function is supposed to handle VARIABLES. Ensure we have one. */
@@ -2003,6 +2073,8 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
set_mem_align (decl_rtl, DECL_ALIGN (decl));
+ align = get_variable_align (decl);
+
if (TREE_PUBLIC (decl))
maybe_assemble_visibility (decl);
@@ -2032,9 +2104,19 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
place_block_symbol (symbol);
}
else if (SECTION_STYLE (sect) == SECTION_NOSWITCH)
- assemble_noswitch_variable (decl, name, sect);
+ assemble_noswitch_variable (decl, name, sect, align);
else
{
+ /* The following bit of code ensures that vtable_map
+ variables are not only in the comdat section, but that
+ each variable has its own unique comdat name. If this
+ code is removed, the variables end up in the same section
+ with a single comdat name.
+
+ FIXME: resolve_unique_section needs to deal better with
+ decls with both DECL_SECTION_NAME and DECL_ONE_ONLY. Once
+ that is fixed, this if-else statement can be replaced with
+ a single call to "switch_to_section (sect)". */
if (sect->named.name
&& (strcmp (sect->named.name, ".vtable_map_vars") == 0))
{
@@ -2049,9 +2131,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#endif
}
else
- switch_to_section (sect);
- if (DECL_ALIGN (decl) > BITS_PER_UNIT)
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DECL_ALIGN_UNIT (decl)));
+ switch_to_section (sect);
+ if (align > BITS_PER_UNIT)
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
assemble_variable_contents (decl, name, dont_output_data);
if (asan_protected)
{
@@ -4501,7 +4583,7 @@ static unsigned HOST_WIDE_INT
output_constructor (tree, unsigned HOST_WIDE_INT, unsigned int,
oc_outer_state *);
-/* Output assembler code for constant EXP to FILE, with no label.
+/* Output assembler code for constant EXP, with no label.
This includes the pseudo-op such as ".int" or ".byte", and a newline.
Assumes output_addressed_constants has been done on EXP already.
@@ -4643,28 +4725,21 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
switch (TREE_CODE (exp))
{
case CONSTRUCTOR:
- output_constructor (exp, size, align, NULL);
+ output_constructor (exp, size, align, NULL);
return;
case STRING_CST:
- thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp),
- size);
+ thissize
+ = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), size);
assemble_string (TREE_STRING_POINTER (exp), thissize);
break;
-
case VECTOR_CST:
{
- int elt_size;
- unsigned int i, nalign;
- enum machine_mode inner;
-
- inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
- nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
-
- elt_size = GET_MODE_SIZE (inner);
-
+ enum machine_mode inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
+ unsigned int nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
+ int elt_size = GET_MODE_SIZE (inner);
output_constant (VECTOR_CST_ELT (exp, 0), elt_size, align);
thissize = elt_size;
- for (i = 1; i < VECTOR_CST_NELTS (exp); ++i)
+ for (unsigned int i = 1; i < VECTOR_CST_NELTS (exp); i++)
{
output_constant (VECTOR_CST_ELT (exp, i), elt_size, nalign);
thissize += elt_size;
@@ -4744,25 +4819,22 @@ typedef struct {
/* Received arguments. */
tree exp; /* Constructor expression. */
+ tree type; /* Type of constructor expression. */
unsigned HOST_WIDE_INT size; /* # bytes to output - pad if necessary. */
unsigned int align; /* Known initial alignment. */
-
- /* Constructor expression data. */
- tree type; /* Expression type. */
- tree field; /* Current field decl in a record. */
- tree min_index; /* Lower bound if specified for an array. */
+ tree min_index; /* Lower bound if specified for an array. */
/* Output processing state. */
HOST_WIDE_INT total_bytes; /* # bytes output so far / current position. */
- bool byte_buffer_in_use; /* Whether byte ... */
- int byte; /* ... contains part of a bitfield byte yet to
- be output. */
-
+ int byte; /* Part of a bitfield byte yet to be output. */
int last_relative_index; /* Implicit or explicit index of the last
array element output within a bitfield. */
+ bool byte_buffer_in_use; /* Whether BYTE is in use. */
+
/* Current element. */
- tree val; /* Current element value. */
- tree index; /* Current element index. */
+ tree field; /* Current field decl in a record. */
+ tree val; /* Current element value. */
+ tree index; /* Current element index. */
} oc_local_state;
@@ -4884,11 +4956,12 @@ output_constructor_regular_field (oc_local_state *local)
local->total_bytes += fieldsize;
}
-/* Helper for output_constructor. From the current LOCAL and OUTER states,
- output an element that is a true bitfield or part of an outer one. */
+/* Helper for output_constructor. From the LOCAL state, output an element
+ that is a true bitfield or part of an outer one. BIT_OFFSET is the offset
+ from the start of a possibly ongoing outer byte buffer. */
static void
-output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
+output_constructor_bitfield (oc_local_state *local, unsigned int bit_offset)
{
/* Bit size of this element. */
HOST_WIDE_INT ebitsize
@@ -4915,7 +4988,7 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
/* Bit position of this element from the start of a possibly ongoing
outer byte buffer. */
HOST_WIDE_INT byte_relative_ebitpos
- = ((outer ? outer->bit_offset : 0) + constructor_relative_ebitpos);
+ = bit_offset + constructor_relative_ebitpos;
/* From the start of a possibly ongoing outer byte buffer, offsets to
the first bit of this element and to the first bit past the end of
@@ -4939,8 +5012,7 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
return;
}
- /* If this field does not start in this (or, next) byte,
- skip some bytes. */
+ /* If this field does not start in this (or next) byte, skip some bytes. */
if (next_offset / BITS_PER_UNIT != local->total_bytes)
{
/* Output remnant of any bit field in previous bytes. */
@@ -4972,13 +5044,12 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
pending data, then retrieve the new pending data afterwards. */
if (TREE_CODE (local->val) == CONSTRUCTOR)
{
- oc_outer_state output_state;
-
- output_state.bit_offset = next_offset % BITS_PER_UNIT;
- output_state.byte = local->byte;
+ oc_outer_state temp_state;
+ temp_state.bit_offset = next_offset % BITS_PER_UNIT;
+ temp_state.byte = local->byte;
local->total_bytes
- += output_constructor (local->val, 0, 0, &output_state);
- local->byte = output_state.byte;
+ += output_constructor (local->val, 0, 0, &temp_state);
+ local->byte = temp_state.byte;
return;
}
@@ -4993,8 +5064,7 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
HOST_WIDE_INT next_byte = next_offset / BITS_PER_UNIT;
HOST_WIDE_INT next_bit = next_offset % BITS_PER_UNIT;
- /* Advance from byte to byte
- within this element when necessary. */
+ /* Advance from byte to byte within this element when necessary. */
while (next_byte != local->total_bytes)
{
assemble_integer (GEN_INT (local->byte), 1, BITS_PER_UNIT, 1);
@@ -5002,10 +5072,8 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
local->byte = 0;
}
- /* Number of bits we can process at once
- (all part of the same byte). */
- this_time = MIN (end_offset - next_offset,
- BITS_PER_UNIT - next_bit);
+ /* Number of bits we can process at once (all part of the same byte). */
+ this_time = MIN (end_offset - next_offset, BITS_PER_UNIT - next_bit);
if (BYTES_BIG_ENDIAN)
{
/* On big-endian machine, take the most significant bits
@@ -5084,7 +5152,7 @@ output_constructor_bitfield (oc_local_state *local, oc_outer_state *outer)
static unsigned HOST_WIDE_INT
output_constructor (tree exp, unsigned HOST_WIDE_INT size,
- unsigned int align, oc_outer_state * outer)
+ unsigned int align, oc_outer_state *outer)
{
unsigned HOST_WIDE_INT cnt;
constructor_elt *ce;
@@ -5093,22 +5161,20 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
/* Setup our local state to communicate with helpers. */
local.exp = exp;
+ local.type = TREE_TYPE (exp);
local.size = size;
local.align = align;
+ if (TREE_CODE (local.type) == ARRAY_TYPE && TYPE_DOMAIN (local.type))
+ local.min_index = TYPE_MIN_VALUE (TYPE_DOMAIN (local.type));
+ else
+ local.min_index = NULL_TREE;
local.total_bytes = 0;
local.byte_buffer_in_use = outer != NULL;
local.byte = outer ? outer->byte : 0;
- local.type = TREE_TYPE (exp);
-
local.last_relative_index = -1;
- local.min_index = NULL_TREE;
- if (TREE_CODE (local.type) == ARRAY_TYPE
- && TYPE_DOMAIN (local.type) != NULL_TREE)
- local.min_index = TYPE_MIN_VALUE (TYPE_DOMAIN (local.type));
-
gcc_assert (HOST_BITS_PER_WIDE_INT >= BITS_PER_UNIT);
/* As CE goes through the elements of the constant, FIELD goes through the
@@ -5120,9 +5186,10 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
(even if the initializer in a source program incorrectly contains
more one). */
- local.field = NULL_TREE;
if (TREE_CODE (local.type) == RECORD_TYPE)
local.field = TYPE_FIELDS (local.type);
+ else
+ local.field = NULL_TREE;
for (cnt = 0;
vec_safe_iterate (CONSTRUCTOR_ELTS (exp), cnt, &ce);
@@ -5175,7 +5242,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
build_nonstandard_integer_type
(TYPE_PRECISION (TREE_TYPE (local.val)), 0),
local.val);
- output_constructor_bitfield (&local, outer);
+ output_constructor_bitfield (&local, outer ? outer->bit_offset : 0);
}
}
@@ -5591,13 +5658,6 @@ assemble_alias (tree decl, tree target)
if (alias == target)
error ("weakref %q+D ultimately targets itself", decl);
- else
- {
-#ifndef ASM_OUTPUT_WEAKREF
- IDENTIFIER_TRANSPARENT_ALIAS (alias) = 1;
- TREE_CHAIN (alias) = target;
-#endif
- }
if (TREE_PUBLIC (decl))
error ("weakref %q+D must have static linkage", decl);
}
@@ -6764,10 +6824,10 @@ bool
decl_binds_to_current_def_p (tree decl)
{
gcc_assert (DECL_P (decl));
- if (!TREE_PUBLIC (decl))
- return true;
if (!targetm.binds_local_p (decl))
return false;
+ if (!TREE_PUBLIC (decl))
+ return true;
/* When resolution is available, just use it. */
if (TREE_CODE (decl) == VAR_DECL
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
@@ -6785,10 +6845,20 @@ decl_binds_to_current_def_p (tree decl)
return resolution_to_local_definition_p (node->symbol.resolution);
}
/* Otherwise we have to assume the worst for DECL_WEAK (hidden weaks
- binds locally but still can be overwritten).
+ binds locally but still can be overwritten), DECL_COMMON (can be merged
+ with a non-common definition somewhere in the same module) or
+ DECL_EXTERNAL.
This rely on fact that binds_local_p behave as decl_replaceable_p
for all other declaration types. */
- return !DECL_WEAK (decl);
+ if (DECL_WEAK (decl))
+ return false;
+ if (DECL_COMMON (decl)
+ && (DECL_INITIAL (decl) == NULL
+ || DECL_INITIAL (decl) == error_mark_node))
+ return false;
+ if (DECL_EXTERNAL (decl))
+ return false;
+ return true;
}
/* A replaceable function or variable is one which may be replaced
@@ -7014,7 +7084,7 @@ place_block_symbol (rtx symbol)
else
{
decl = SYMBOL_REF_DECL (symbol);
- alignment = DECL_ALIGN (decl);
+ alignment = get_variable_align (decl);
size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
if (flag_asan && asan_protect_global (decl))
{
diff --git a/gcc/varpool.c b/gcc/varpool.c
index 1916b76d960..fd193d3c74a 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -36,18 +36,26 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "flags.h"
+/* Allocate new callgraph node and insert it into basic data structures. */
+
+struct varpool_node *
+varpool_create_empty_node (void)
+{
+ struct varpool_node *node = ggc_alloc_cleared_varpool_node ();
+ node->symbol.type = SYMTAB_VARIABLE;
+ return node;
+}
+
/* Return varpool node assigned to DECL. Create new one when needed. */
struct varpool_node *
varpool_node_for_decl (tree decl)
{
struct varpool_node *node = varpool_get_node (decl);
- gcc_assert (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl) || DECL_EXTERNAL (decl) || in_lto_p));
+ gcc_checking_assert (TREE_CODE (decl) == VAR_DECL);
if (node)
return node;
- node = ggc_alloc_cleared_varpool_node ();
- node->symbol.type = SYMTAB_VARIABLE;
+ node = varpool_create_empty_node ();
node->symbol.decl = decl;
symtab_register_node ((symtab_node)node);
return node;
@@ -130,28 +138,6 @@ varpool_node_for_asm (tree asmname)
return NULL;
}
-/* Determine if variable DECL is needed. That is, visible to something
- either outside this translation unit, something magic in the system
- configury */
-bool
-decide_is_variable_needed (struct varpool_node *node, tree decl)
-{
- if (DECL_EXTERNAL (decl))
- return false;
-
- /* If the user told us it is used, then it must be so. */
- if (node->symbol.force_output)
- return true;
-
- /* Externally visible variables must be output. The exception is
- COMDAT variables that must be output only when they are needed. */
- if (TREE_PUBLIC (decl)
- && !DECL_COMDAT (decl))
- return true;
-
- return false;
-}
-
/* Return if DECL is constant and its initial value is known (so we can do
constant folding using DECL_INITIAL (decl)). */
@@ -240,30 +226,9 @@ varpool_analyze_node (struct varpool_node *node)
already informed about increased alignment. */
align_variable (decl, 0);
}
- if (node->symbol.alias && node->alias_of)
- {
- struct varpool_node *tgt = varpool_node_for_decl (node->alias_of);
- struct varpool_node *n;
-
- for (n = tgt; n && n->symbol.alias;
- n = n->symbol.analyzed ? varpool_alias_target (n) : NULL)
- if (n == node)
- {
- error ("variable %q+D part of alias cycle", node->symbol.decl);
- node->symbol.alias = false;
- continue;
- }
- if (!vec_safe_length (node->symbol.ref_list.references))
- ipa_record_reference ((symtab_node)node, (symtab_node)tgt, IPA_REF_ALIAS, NULL);
- if (node->extra_name_alias)
- {
- DECL_WEAK (node->symbol.decl) = DECL_WEAK (node->alias_of);
- DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (node->alias_of);
- DECL_VISIBILITY (node->symbol.decl) = DECL_VISIBILITY (node->alias_of);
- fixup_same_cpp_alias_visibility ((symtab_node) node,
- (symtab_node) tgt, node->alias_of);
- }
- }
+ if (node->symbol.alias)
+ symtab_resolve_alias
+ ((symtab_node) node, (symtab_node) varpool_get_node (node->symbol.alias_target));
else if (DECL_INITIAL (decl))
record_references_in_initializer (decl, node->symbol.analyzed);
node->symbol.analyzed = true;
@@ -281,7 +246,7 @@ assemble_aliases (struct varpool_node *node)
{
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
do_assemble_alias (alias->symbol.decl,
- DECL_ASSEMBLER_NAME (alias->alias_of));
+ DECL_ASSEMBLER_NAME (node->symbol.decl));
assemble_aliases (alias);
}
}
@@ -494,18 +459,9 @@ varpool_create_variable_alias (tree alias, tree decl)
alias_node = varpool_node_for_decl (alias);
alias_node->symbol.alias = true;
alias_node->symbol.definition = true;
- alias_node->alias_of = decl;
-
- /* Extra name alias mechanizm creates aliases really late
- via DECL_ASSEMBLER_NAME mechanizm.
- This is unfortunate because they are not going through the
- standard channels. Ensure they get output. */
- if (cgraph_state >= CGRAPH_STATE_IPA)
- {
- varpool_analyze_node (alias_node);
- if (TREE_PUBLIC (alias))
- alias_node->symbol.externally_visible = true;
- }
+ alias_node->symbol.alias_target = decl;
+ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (alias)) != NULL)
+ alias_node->symbol.weakref = true;
return alias_node;
}
@@ -522,7 +478,15 @@ varpool_extra_name_alias (tree alias, tree decl)
return NULL;
#endif
alias_node = varpool_create_variable_alias (alias, decl);
- alias_node->extra_name_alias = true;
+ alias_node->symbol.cpp_implicit_alias = true;
+
+ /* Extra name alias mechanizm creates aliases really late
+ via DECL_ASSEMBLER_NAME mechanizm.
+ This is unfortunate because they are not going through the
+ standard channels. Ensure they get output. */
+ if (cpp_implicit_aliases_done)
+ symtab_resolve_alias ((symtab_node)alias_node,
+ (symtab_node)varpool_node_for_decl (decl));
return alias_node;
}
diff --git a/gcc/vtable-verify.c b/gcc/vtable-verify.c
index 582f0424f8a..749dfb33a89 100644
--- a/gcc/vtable-verify.c
+++ b/gcc/vtable-verify.c
@@ -634,7 +634,8 @@ verify_bb_vtables (basic_block bb)
gcc_assert (vtbl_var_decl);
vtbl_decl = vtbl_var_decl;
- vtable_map_node = vtbl_map_get_node (class_type);
+ vtable_map_node = vtbl_map_get_node
+ (TYPE_MAIN_VARIANT (class_type));
gcc_assert (verify_vtbl_ptr_fndecl);
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 66f29215579..56b34639237 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,38 @@
+2013-06-16 Jürgen Urban <JuergenUrban@gmx.de>
+
+ * config/mips/lib2funcs.c: New file.
+ * config/mips/t-mips (LIB2ADD_ST): Add it.
+
+2013-06-09 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/6526
+ * config/sh/lib1funcs.S (sdivsi3_i4, udivsi3_i4): Do not change bits
+ other than FPSCR.PR and FPSCR.SZ. Add SH4A implementation.
+
+2013-06-08 Walter Lee <walt@tilera.com>
+
+ * config/tilepro/atomic.h: Don't include stdint.h or features.h.
+ Replace int64_t with long long. Add __extension__ where
+ appropriate.
+ * config/tilepro/atomic.c: Include config.h.
+
+2013-06-06 Douglas B Rupp <rupp@adacore.com>
+
+ * config.host (arm-wrs-vxworks): Configure with other soft float.
+
+2013-06-04 Jürgen Urban <JuergenUrban@gmx.de>
+
+ * config.host (mipsr5900-*-elf*, mipsr5900el-*-elf*, mips64r5900-*-elf*)
+ (mips64r5900el-*-elf*): New configurations.
+
+2013-06-04 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/ibm-ldouble.c: Enable for little-endian.
+
+2013-06-03 Yuri Rumyantsev <yuri.s.rumyantsev@intel.com>
+
+ * config/i386/cpuinfo.c (INTEL_SLM): New enum value.
+
2013-05-28 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sol2-unwind.h (MD_FALLBACK_FRAME_STATE_FOR): Do not set
diff --git a/libgcc/config.host b/libgcc/config.host
index 65c95ba49f8..35f37466f97 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -316,7 +316,7 @@ alpha*-dec-*vms*)
md_unwind_header=alpha/vms-unwind.h
;;
arm-wrs-vxworks)
- tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-fdpbit"
+ tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
;;
arm*-*-netbsdelf*)
@@ -739,7 +739,17 @@ mips*-*-netbsd*) # NetBSD/mips, either endian.
;;
mips*-*-linux*) # Linux MIPS, either endian.
extra_parts="$extra_parts crtfastmath.o"
- tmake_file="${tmake_file} t-crtfm mips/t-mips16"
+ tmake_file="${tmake_file} t-crtfm"
+ # Check for MicroMIPS support.
+ case ${host} in
+ mips64r5900* | mipsr5900*)
+ # The MIPS16 support code uses floating point
+ # instructions that are not supported on r5900.
+ ;;
+ *)
+ tmake_file="${tmake_file} mips/t-mips16"
+ ;;
+ esac
md_unwind_header=mips/linux-unwind.h
if test "${ac_cv_sizeof_long_double}" = 16; then
tmake_file="${tmake_file} mips/t-tpbit"
@@ -777,10 +787,18 @@ mips-*-elf* | mipsel-*-elf*)
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
extra_parts="$extra_parts crti.o crtn.o"
;;
+mipsr5900-*-elf* | mipsr5900el-*-elf*)
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
+ extra_parts="$extra_parts crti.o crtn.o"
+ ;;
mips64-*-elf* | mips64el-*-elf*)
tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
extra_parts="$extra_parts crti.o crtn.o"
;;
+mips64r5900-*-elf* | mips64r5900el-*-elf*)
+ tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
+ extra_parts="$extra_parts crti.o crtn.o"
+ ;;
mips64vr-*-elf* | mips64vrel-*-elf*)
tmake_file="$tmake_file mips/t-elf mips/t-vr mips/t-crtstuff"
extra_parts="$extra_parts crti.o crtn.o"
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 39b9d1175bb..b7e64c3d720 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -47,14 +47,16 @@ enum processor_vendor
VENDOR_MAX
};
+/* Any new types or subtypes have to be inserted at the end. */
+
enum processor_types
{
INTEL_ATOM = 1,
- INTEL_SLM,
INTEL_CORE2,
INTEL_COREI7,
AMDFAM10H,
AMDFAM15H,
+ INTEL_SLM,
CPU_TYPE_MAX
};
diff --git a/libgcc/config/mips/lib2funcs.c b/libgcc/config/mips/lib2funcs.c
new file mode 100644
index 00000000000..85d9f17a4cd
--- /dev/null
+++ b/libgcc/config/mips/lib2funcs.c
@@ -0,0 +1,44 @@
+/* libgcc routines for MIPS
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ DMULT/DDIV replacement support by Juergen Urban, JuergenUrban@gmx.de.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#if defined(__mips64) && defined(_MIPS_ARCH_R5900)
+
+/* Build DI version of libgcc functions. */
+#define LIBGCC2_UNITS_PER_WORD 4
+
+/* The following function is needed when !ISA_HAS_DMULT. */
+#define L_muldi3
+
+/* The following functions are needed when !ISA_HAS_DDIV. */
+#define L_divdi3
+#define L_moddi3
+#define L_udivdi3
+#define L_umoddi3
+#define L_udivmoddi4
+
+/* Use generic definition of functions. */
+#include "libgcc2.c"
+
+#endif
diff --git a/libgcc/config/mips/t-mips b/libgcc/config/mips/t-mips
index 719c062ef0d..ed5550e7048 100644
--- a/libgcc/config/mips/t-mips
+++ b/libgcc/config/mips/t-mips
@@ -4,3 +4,5 @@ FPBIT = true
FPBIT_CFLAGS = -DQUIET_NAN_NEGATED
DPBIT = true
DPBIT_CFLAGS = -DQUIET_NAN_NEGATED
+
+LIB2ADD_ST += $(srcdir)/config/mips/lib2funcs.c
diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
index 96fcc77a881..28e02e995d4 100644
--- a/libgcc/config/rs6000/ibm-ldouble.c
+++ b/libgcc/config/rs6000/ibm-ldouble.c
@@ -42,10 +42,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
NaN is don't-care.
- This code currently assumes big-endian. */
+ This code currently assumes the most significant double is in
+ the lower numbered register or lower addressed memory. */
-#if (!defined (__LITTLE_ENDIAN__) \
- && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
+#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless (x, y)
diff --git a/libgcc/config/sh/lib1funcs.S b/libgcc/config/sh/lib1funcs.S
index 5f0bbff264f..51addf360cf 100644
--- a/libgcc/config/sh/lib1funcs.S
+++ b/libgcc/config/sh/lib1funcs.S
@@ -1003,11 +1003,17 @@ hiset: sts macl,r0 ! r0 = bb*dd
ENDFUNC(GLOBAL(mulsi3))
#endif
#endif /* ! __SH5__ */
+
+/*------------------------------------------------------------------------------
+ 32 bit signed integer division that uses FPU double precision division. */
+
#ifdef L_sdivsi3_i4
.title "SH DIVIDE"
-!! 4 byte integer Divide code for the Renesas SH
+
#if defined (__SH4__) || defined (__SH2A__)
-!! args in r4 and r5, result in fpul, clobber dr0, dr2
+/* This variant is used when FPSCR.PR = 1 (double precision) is the default
+ setting.
+ Args in r4 and r5, result in fpul, clobber dr0, dr2. */
.global GLOBAL(sdivsi3_i4)
HIDDEN_FUNC(GLOBAL(sdivsi3_i4))
@@ -1021,8 +1027,13 @@ GLOBAL(sdivsi3_i4):
ftrc dr0,fpul
ENDFUNC(GLOBAL(sdivsi3_i4))
+
#elif defined (__SH2A_SINGLE__) || defined (__SH2A_SINGLE_ONLY__) || defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
-!! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
+/* This variant is used when FPSCR.PR = 0 (sigle precision) is the default
+ setting.
+ Args in r4 and r5, result in fpul, clobber r2, dr0, dr2.
+ For this to work, we must temporarily switch the FPU do double precision,
+ but we better do not touch FPSCR.FR. See PR 6526. */
#if ! __SH5__ || __SH5__ == 32
#if __SH5__
@@ -1031,24 +1042,43 @@ GLOBAL(sdivsi3_i4):
.global GLOBAL(sdivsi3_i4)
HIDDEN_FUNC(GLOBAL(sdivsi3_i4))
GLOBAL(sdivsi3_i4):
- sts.l fpscr,@-r15
- mov #8,r2
- swap.w r2,r2
- lds r2,fpscr
- lds r4,fpul
- float fpul,dr0
- lds r5,fpul
- float fpul,dr2
- fdiv dr2,dr0
- ftrc dr0,fpul
+
+#ifndef __SH4A__
+ mov.l r3,@-r15
+ sts fpscr,r2
+ mov #8,r3
+ swap.w r3,r3 // r3 = 1 << 19 (FPSCR.PR bit)
+ or r2,r3
+ lds r3,fpscr // Set FPSCR.PR = 1.
+ lds r4,fpul
+ float fpul,dr0
+ lds r5,fpul
+ float fpul,dr2
+ fdiv dr2,dr0
+ ftrc dr0,fpul
+ lds r2,fpscr
rts
- lds.l @r15+,fpscr
+ mov.l @r15+,r3
+#else
+/* On SH4A we can use the fpchg instruction to flip the FPSCR.PR bit. */
+ fpchg
+ lds r4,fpul
+ float fpul,dr0
+ lds r5,fpul
+ float fpul,dr2
+ fdiv dr2,dr0
+ ftrc dr0,fpul
+ rts
+ fpchg
+
+#endif /* __SH4A__ */
ENDFUNC(GLOBAL(sdivsi3_i4))
#endif /* ! __SH5__ || __SH5__ == 32 */
#endif /* ! __SH4__ || __SH2A__ */
-#endif
+#endif /* L_sdivsi3_i4 */
+//------------------------------------------------------------------------------
#ifdef L_sdivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
sh2e/sh3e code. */
@@ -1367,54 +1397,60 @@ div0: rts
mov #0,r0
ENDFUNC(GLOBAL(sdivsi3))
-#endif /* ! __SHMEDIA__ */
-#endif
-#ifdef L_udivsi3_i4
+#endif /* ! __SHMEDIA__ */
+#endif /* L_sdivsi3 */
+
+/*------------------------------------------------------------------------------
+ 32 bit unsigned integer division that uses FPU double precision division. */
+#ifdef L_udivsi3_i4
.title "SH DIVIDE"
-!! 4 byte integer Divide code for the Renesas SH
+
#if defined (__SH4__) || defined (__SH2A__)
-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
-!! and t bit
+/* This variant is used when FPSCR.PR = 1 (double precision) is the default
+ setting.
+ Args in r4 and r5, result in fpul,
+ clobber r0, r1, r4, r5, dr0, dr2, dr4, and t bit */
.global GLOBAL(udivsi3_i4)
HIDDEN_FUNC(GLOBAL(udivsi3_i4))
GLOBAL(udivsi3_i4):
- mov #1,r1
- cmp/hi r1,r5
- bf trivial
- rotr r1
- xor r1,r4
- lds r4,fpul
- mova L1,r0
+ mov #1,r1
+ cmp/hi r1,r5
+ bf/s trivial
+ rotr r1
+ xor r1,r4
+ lds r4,fpul
+ mova L1,r0
#ifdef FMOVD_WORKS
- fmov.d @r0+,dr4
+ fmov.d @r0+,dr4
#else
- fmov.s @r0+,DR40
- fmov.s @r0,DR41
+ fmov.s @r0+,DR40
+ fmov.s @r0,DR41
#endif
- float fpul,dr0
- xor r1,r5
- lds r5,fpul
- float fpul,dr2
- fadd dr4,dr0
- fadd dr4,dr2
- fdiv dr2,dr0
+ float fpul,dr0
+ xor r1,r5
+ lds r5,fpul
+ float fpul,dr2
+ fadd dr4,dr0
+ fadd dr4,dr2
+ fdiv dr2,dr0
rts
- ftrc dr0,fpul
+ ftrc dr0,fpul
trivial:
rts
- lds r4,fpul
+ lds r4,fpul
.align 2
#ifdef FMOVD_WORKS
- .align 3 ! make double below 8 byte aligned.
+ .align 3 // Make the double below 8 byte aligned.
#endif
L1:
.double 2147483648
ENDFUNC(GLOBAL(udivsi3_i4))
+
#elif defined (__SH5__) && ! defined (__SH4_NOFPU__) && ! defined (__SH2A_NOFPU__)
#if ! __SH5__ || __SH5__ == 32
!! args in r4 and r5, result in fpul, clobber r20, r21, dr0, fr33
@@ -1436,57 +1472,106 @@ GLOBAL(udivsi3_i4):
ENDFUNC(GLOBAL(udivsi3_i4))
#endif /* ! __SH5__ || __SH5__ == 32 */
+
#elif defined (__SH2A_SINGLE__) || defined (__SH2A_SINGLE_ONLY__) || defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__)
-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
+/* This variant is used when FPSCR.PR = 0 (sigle precision) is the default
+ setting.
+ Args in r4 and r5, result in fpul,
+ clobber r0, r1, r4, r5, dr0, dr2, dr4.
+ For this to work, we must temporarily switch the FPU do double precision,
+ but we better do not touch FPSCR.FR. See PR 6526. */
.global GLOBAL(udivsi3_i4)
HIDDEN_FUNC(GLOBAL(udivsi3_i4))
GLOBAL(udivsi3_i4):
- mov #1,r1
- cmp/hi r1,r5
- bf trivial
- sts.l fpscr,@-r15
- mova L1,r0
- lds.l @r0+,fpscr
- rotr r1
- xor r1,r4
- lds r4,fpul
+
+#ifndef __SH4A__
+ mov #1,r1
+ cmp/hi r1,r5
+ bf/s trivial
+ rotr r1 // r1 = 1 << 31
+ sts.l fpscr,@-r15
+ xor r1,r4
+ mov.l @(0,r15),r0
+ xor r1,r5
+ mov.l L2,r1
+ lds r4,fpul
+ or r0,r1
+ mova L1,r0
+ lds r1,fpscr
#ifdef FMOVD_WORKS
- fmov.d @r0+,dr4
+ fmov.d @r0+,dr4
#else
- fmov.s @r0+,DR40
- fmov.s @r0,DR41
+ fmov.s @r0+,DR40
+ fmov.s @r0,DR41
#endif
- float fpul,dr0
- xor r1,r5
- lds r5,fpul
- float fpul,dr2
- fadd dr4,dr0
- fadd dr4,dr2
- fdiv dr2,dr0
- ftrc dr0,fpul
+ float fpul,dr0
+ lds r5,fpul
+ float fpul,dr2
+ fadd dr4,dr0
+ fadd dr4,dr2
+ fdiv dr2,dr0
+ ftrc dr0,fpul
rts
- lds.l @r15+,fpscr
+ lds.l @r15+,fpscr
#ifdef FMOVD_WORKS
- .align 3 ! make double below 8 byte aligned.
+ .align 3 // Make the double below 8 byte aligned.
#endif
trivial:
rts
- lds r4,fpul
+ lds r4,fpul
.align 2
-L1:
-#ifndef FMOVD_WORKS
- .long 0x80000
+L2:
+#ifdef FMOVD_WORKS
+ .long 0x180000 // FPSCR.PR = 1, FPSCR.SZ = 1
#else
- .long 0x180000
+ .long 0x80000 // FPSCR.PR = 1
#endif
+L1:
+ .double 2147483648
+
+#else
+/* On SH4A we can use the fpchg instruction to flip the FPSCR.PR bit.
+ Although on SH4A fmovd usually works, it would require either additional
+ two fschg instructions or an FPSCR push + pop. It's not worth the effort
+ for loading only one double constant. */
+ mov #1,r1
+ cmp/hi r1,r5
+ bf/s trivial
+ rotr r1 // r1 = 1 << 31
+ fpchg
+ mova L1,r0
+ xor r1,r4
+ fmov.s @r0+,DR40
+ lds r4,fpul
+ fmov.s @r0,DR41
+ xor r1,r5
+ float fpul,dr0
+ lds r5,fpul
+ float fpul,dr2
+ fadd dr4,dr0
+ fadd dr4,dr2
+ fdiv dr2,dr0
+ ftrc dr0,fpul
+ rts
+ fpchg
+
+trivial:
+ rts
+ lds r4,fpul
+
+ .align 2
+L1:
.double 2147483648
+#endif /* __SH4A__ */
+
+
ENDFUNC(GLOBAL(udivsi3_i4))
#endif /* ! __SH4__ */
-#endif
+#endif /* L_udivsi3_i4 */
#ifdef L_udivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
diff --git a/libgcc/config/tilepro/atomic.c b/libgcc/config/tilepro/atomic.c
index 762bd6dc7f6..6417c1304cd 100644
--- a/libgcc/config/tilepro/atomic.c
+++ b/libgcc/config/tilepro/atomic.c
@@ -21,6 +21,7 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "atomic.h"
diff --git a/libgcc/config/tilepro/atomic.h b/libgcc/config/tilepro/atomic.h
index fc494ea606a..8d38f0dee9c 100644
--- a/libgcc/config/tilepro/atomic.h
+++ b/libgcc/config/tilepro/atomic.h
@@ -92,8 +92,6 @@
compare-and-exchange routine, so may be potentially less efficient. */
#endif
-#include <stdint.h>
-#include <features.h>
#ifdef __tilegx__
#include <arch/spr_def.h>
#else
@@ -122,9 +120,9 @@ static __inline __attribute__ ((always_inline))
/* 64-bit integer compare-and-exchange. */
static __inline __attribute__ ((always_inline))
- int64_t arch_atomic_val_compare_and_exchange_8 (volatile int64_t * mem,
- int64_t oldval,
- int64_t newval)
+ long long arch_atomic_val_compare_and_exchange_8 (volatile long long
+ *mem, long long oldval,
+ long long newval)
{
#ifdef __tilegx__
__insn_mtspr (SPR_CMPEXCH_VALUE, oldval);
@@ -139,7 +137,7 @@ static __inline __attribute__ ((always_inline))
"R04" (newval_lo), "R05" (newval_hi),
"m" (*mem):"r20", "r21", "r22", "r23", "r24", "r25",
"r26", "r27", "r28", "r29", "memory");
- return ((uint64_t) result_hi) << 32 | result_lo;
+ return ((long long) result_hi) << 32 | result_lo;
#endif
}
@@ -150,11 +148,11 @@ extern int __arch_atomic_error_bad_argument_size (void)
#define arch_atomic_val_compare_and_exchange(mem, o, n) \
- ({ \
+ __extension__ ({ \
(__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \
((sizeof(*(mem)) == 8) ? \
arch_atomic_val_compare_and_exchange_8( \
- (volatile int64_t*)(mem), (__typeof((o)-(o)))(o), \
+ (volatile long long*)(mem), (__typeof((o)-(o)))(o), \
(__typeof((n)-(n)))(n)) : \
(sizeof(*(mem)) == 4) ? \
arch_atomic_val_compare_and_exchange_4( \
@@ -164,7 +162,7 @@ extern int __arch_atomic_error_bad_argument_size (void)
})
#define arch_atomic_bool_compare_and_exchange(mem, o, n) \
- ({ \
+ __extension__ ({ \
__typeof(o) __o = (o); \
__builtin_expect( \
__o == arch_atomic_val_compare_and_exchange((mem), __o, (n)), 1); \
@@ -174,7 +172,7 @@ extern int __arch_atomic_error_bad_argument_size (void)
/* Loop with compare_and_exchange until we guess the correct value.
Normally "expr" will be an expression using __old and __value. */
#define __arch_atomic_update_cmpxchg(mem, value, expr) \
- ({ \
+ __extension__ ({ \
__typeof(value) __value = (value); \
__typeof(*(mem)) *__mem = (mem), __old = *__mem, __guess; \
do { \
@@ -189,12 +187,14 @@ extern int __arch_atomic_error_bad_argument_size (void)
/* Generic atomic op with 8- or 4-byte variant.
The _mask, _addend, and _expr arguments are ignored on tilegx. */
#define __arch_atomic_update(mem, value, op, _mask, _addend, _expr) \
- ({ \
+ __extension__ ({ \
((__typeof(*(mem))) \
((sizeof(*(mem)) == 8) ? (__typeof(*(mem)-*(mem)))__insn_##op( \
- (void *)(mem), (int64_t)(__typeof((value)-(value)))(value)) : \
+ (volatile void *)(mem), \
+ (long long)(__typeof((value)-(value)))(value)) : \
(sizeof(*(mem)) == 4) ? (int)__insn_##op##4( \
- (void *)(mem), (int32_t)(__typeof((value)-(value)))(value)) : \
+ (volatile void *)(mem), \
+ (int)(__typeof((value)-(value)))(value)) : \
__arch_atomic_error_bad_argument_size())); \
})
@@ -224,7 +224,7 @@ static __inline __attribute__ ((always_inline))
/* Generic atomic op with 8- or 4-byte variant.
The _op argument is ignored on tilepro. */
#define __arch_atomic_update(mem, value, _op, mask, addend, expr) \
- ({ \
+ __extension__ ({ \
(__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \
((sizeof(*(mem)) == 8) ? \
__arch_atomic_update_cmpxchg((mem), (value), (expr)) : \
@@ -263,13 +263,13 @@ static __inline __attribute__ ((always_inline))
__arch_atomic_update_cmpxchg(mem, mask, ~(__old & __value))
#define arch_atomic_bit_set(mem, bit) \
- ({ \
+ __extension__ ({ \
__typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \
__mask & arch_atomic_or((mem), __mask); \
})
#define arch_atomic_bit_clear(mem, bit) \
- ({ \
+ __extension__ ({ \
__typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \
__mask & arch_atomic_and((mem), ~__mask); \
})
diff --git a/libgcc/vtv_end.c b/libgcc/vtv_end.c
index ee09c0a7982..89eec4834e5 100644
--- a/libgcc/vtv_end.c
+++ b/libgcc/vtv_end.c
@@ -49,6 +49,12 @@ along with GCC; see the file COPYING3. If not see
#include "vtv-change-permission.h"
+__attribute__ ((constructor(100))) void
+__VLTprotect (void)
+{
+ __VLTChangePermission (__VLTP_READ_ONLY);
+}
+
/* Page-sized variable to mark end of .vtable_map_vars section. */
char _vtable_map_vars_end[VTV_PAGE_SIZE]
__attribute__ ((__visibility__ ("protected"), used,
diff --git a/libgcc/vtv_start.c b/libgcc/vtv_start.c
index 0bb85af35f9..68086a2dfbe 100644
--- a/libgcc/vtv_start.c
+++ b/libgcc/vtv_start.c
@@ -47,6 +47,12 @@ along with GCC; see the file COPYING3. If not see
#include "vtv-change-permission.h"
+__attribute__ ((constructor(98))) void
+__VLTunprotect (void)
+{
+ __VLTChangePermission (__VLTP_READ_WRITE);
+}
+
/* Page-aligned symbol to mark beginning of .vtable_map_vars section. */
char _vtable_map_vars_start []
__attribute__ ((__visibility__ ("protected"), used, aligned(VTV_PAGE_SIZE),
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 59ac4da949f..38a53190179 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/57496
+ * io/write_float.def (ISFINITE2Q, ISFINITE2, ISFINITE2L, ISFINITE,
+ SIGNBIT2Q, SIGNBIT2, SIGNBIT2L, SIGNBIT, ISNAN2Q, ISNAN2, ISNAN2L,
+ ISNAN): New macros.
+ (output_float_FMT_G_,WRITE_FLOAT): Use them.
+
2013-05-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too.
@@ -19,25 +27,25 @@
2013-04-29 Janne Blomqvist <jb@gcc.gnu.org>
- * intrinsics/system_clock (gf_gettime_mono): Use variable
- resolution for fractional seconds argument.
- (system_clock_4): Simplify, update for gf_gettime_mono change.
- (system_clock_8): Likewise.
+ * intrinsics/system_clock (gf_gettime_mono): Use variable
+ resolution for fractional seconds argument.
+ (system_clock_4): Simplify, update for gf_gettime_mono change.
+ (system_clock_8): Likewise.
2013-04-29 Janne Blomqvist <jb@gcc.gnu.org>
- PR fortran/56981
- * io/transfer.c (next_record_w_unf): First fix head marker, then
- write tail.
- (next_record): Call flush_if_unbuffered.
- * io/unix.c (struct unix_stream): Add field unbuffered.
- (flush_if_unbuffered): New function.
- (fd_to_stream): New argument.
- (open_external): Fix fd_to_stream call.
- (input_stream): Likewise.
- (output_stream): Likewise.
- (error_stream): Likewise.
- * io/unix.h (flush_if_unbuffered): New prototype.
+ PR fortran/56981
+ * io/transfer.c (next_record_w_unf): First fix head marker, then
+ write tail.
+ (next_record): Call flush_if_unbuffered.
+ * io/unix.c (struct unix_stream): Add field unbuffered.
+ (flush_if_unbuffered): New function.
+ (fd_to_stream): New argument.
+ (open_external): Fix fd_to_stream call.
+ (input_stream): Likewise.
+ (output_stream): Likewise.
+ (error_stream): Likewise.
+ * io/unix.h (flush_if_unbuffered): New prototype.
2013-04-28 Janne Blomqvist <jb@gcc.gnu.org>
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index a157f0b6328..b634ff54f0b 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -961,6 +961,34 @@ __qmath_(quadmath_snprintf) (buffer, size, "%+-#.*Qf", \
#endif
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define ISFINITE2Q(val) finiteq(val)
+#endif
+#define ISFINITE2(val) isfinite(val)
+#define ISFINITE2L(val) isfinite(val)
+
+#define ISFINITE(suff,val) TOKENPASTE(ISFINITE2,suff)(val)
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define SIGNBIT2Q(val) signbitq(val)
+#endif
+#define SIGNBIT2(val) signbit(val)
+#define SIGNBIT2L(val) signbit(val)
+
+#define SIGNBIT(suff,val) TOKENPASTE(SIGNBIT2,suff)(val)
+
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define ISNAN2Q(val) isnanq(val)
+#endif
+#define ISNAN2(val) isnan(val)
+#define ISNAN2L(val) isnan(val)
+
+#define ISNAN(suff,val) TOKENPASTE(ISNAN2,suff)(val)
+
+
+
/* Generate corresponding I/O format for FMT_G and output.
The rules to translate FMT_G to FMT_E or FMT_F from DEC fortran
LRM (table 11-2, Chapter 11, "I/O Formatting", P11-25) is:
@@ -1127,7 +1155,7 @@ OUTPUT_FLOAT_FMT_G(16,L)
{\
GFC_REAL_ ## x tmp; \
tmp = * (GFC_REAL_ ## x *)source; \
- if (isfinite (tmp)) \
+ if (ISFINITE (y,tmp)) \
nprinted = DTOA(y,0,tmp); \
else\
nprinted = -1;\
@@ -1194,10 +1222,10 @@ determine_en_precision (st_parameter_dt *dtp, const fnode *f,
{\
GFC_REAL_ ## x tmp;\
tmp = * (GFC_REAL_ ## x *)source;\
- sign_bit = signbit (tmp);\
- if (!isfinite (tmp))\
+ sign_bit = SIGNBIT (y,tmp);\
+ if (!ISFINITE (y,tmp))\
{ \
- write_infnan (dtp, f, isnan (tmp), sign_bit);\
+ write_infnan (dtp, f, ISNAN (y,tmp), sign_bit);\
return;\
}\
tmp = sign_bit ? -tmp : tmp;\
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 1747cec0988..1a0f1337334 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,17 @@
+2013-06-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.c/icv-2.c: Extend current handling of
+ Linux-based x86 systems to cover all GNU systems.
+ * testsuite/libgomp.c/lock-3.c: Likewise.
+ * testsuite/libgomp.c/pr48591.c: Likewise.
+
+2013-06-06 Thomas Schwinge <thomas@codesourcery.com>
+
+ * configure.tgt (XCFLAGS): Add -ftls-model=initial-exec for
+ GNU/Hurd, as done for Linux-based systems.
+
+ * config/posix/ptrlock.h: Fix comment.
+
2013-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/57423
diff --git a/libgomp/config/posix/ptrlock.h b/libgomp/config/posix/ptrlock.h
index eec4e19df7c..76c2deb173d 100644
--- a/libgomp/config/posix/ptrlock.h
+++ b/libgomp/config/posix/ptrlock.h
@@ -22,9 +22,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
-/* This is a Linux specific implementation of a mutex synchronization
- mechanism for libgomp. This type is private to the library. This
- implementation uses atomic instructions and the futex syscall. */
+/* This is a generic POSIX implementation of a mutex synchronization
+ mechanism for libgomp. This type is private to the library. */
#ifndef GOMP_PTRLOCK_H
#define GOMP_PTRLOCK_H 1
diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 2eecc93a349..8b1841792d4 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -14,7 +14,10 @@
if test $gcc_cv_have_tls = yes ; then
case "${target}" in
- *-*-linux*)
+ *-*-k*bsd*-gnu*)
+ ;;
+
+ *-*-linux* | *-*-gnu*)
XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
;;
esac
diff --git a/libgomp/testsuite/libgomp.c/icv-2.c b/libgomp/testsuite/libgomp.c/icv-2.c
index 326f8eb404a..3a80d6123a8 100644
--- a/libgomp/testsuite/libgomp.c/icv-2.c
+++ b/libgomp/testsuite/libgomp.c/icv-2.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
diff --git a/libgomp/testsuite/libgomp.c/lock-3.c b/libgomp/testsuite/libgomp.c/lock-3.c
index 1fc83726d18..02c90b98a87 100644
--- a/libgomp/testsuite/libgomp.c/lock-3.c
+++ b/libgomp/testsuite/libgomp.c/lock-3.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target *-*-linux* } } */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
diff --git a/libgomp/testsuite/libgomp.c/pr48591.c b/libgomp/testsuite/libgomp.c/pr48591.c
index 18dfd7f47be..230439d2f30 100644
--- a/libgomp/testsuite/libgomp.c/pr48591.c
+++ b/libgomp/testsuite/libgomp.c/pr48591.c
@@ -1,5 +1,5 @@
/* PR middle-end/48591 */
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* ia64-*-linux* } } */
/* { dg-options "-fopenmp" } */
extern void abort (void);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a30a363a3f5..96bc317b0a3 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,15 @@
+2013-05-31 Matt Burgess <matthew@linuxfromscratch.org>
+
+ PR other/56780
+ * libiberty/configure.ac: Move test for --enable-install-libiberty
+ outside of the 'with_target_subdir' test so that it actually gets
+ run. Add output messages to show the test result.
+ * libiberty/configure: Regenerate.
+ * libiberty/Makefile.in (install_to_libdir): Place the
+ installation of the libiberty library in the same guard as that
+ used for the headers to prevent it being installed unless
+ requested via --enable-install-libiberty.
+
2013-05-06 David Edelsohn <dje.gcc@gmail.com>
Peter Bergner <bergner@vnet.ibm.com>
Segher Boessenkool <segher@kernel.crashing.org>
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index f6a3ebd6d3d..75ff82d984a 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -355,19 +355,19 @@ install-strip: install
# since it will be passed the multilib flags.
MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
install_to_libdir: all
- ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
- ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
- mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)
if test -n "${target_header_dir}"; then \
- case "${target_header_dir}" in \
- /*) thd=${target_header_dir};; \
- *) thd=${includedir}/${target_header_dir};; \
- esac; \
- ${mkinstalldirs} $(DESTDIR)$${thd}; \
- for h in ${INSTALLED_HEADERS}; do \
- ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
- done; \
+ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+ $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \
+ ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \
+ mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \
+ case "${target_header_dir}" in \
+ /*) thd=${target_header_dir};; \
+ *) thd=${includedir}/${target_header_dir};; \
+ esac; \
+ ${mkinstalldirs} $(DESTDIR)$${thd}; \
+ for h in ${INSTALLED_HEADERS}; do \
+ ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
+ done; \
fi
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
diff --git a/libiberty/configure b/libiberty/configure
index 17bd3c5bacb..e601ccd99f4 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -675,8 +675,8 @@ with_cross_host
with_newlib
enable_maintainer_mode
enable_multilib
-enable_largefile
enable_install_libiberty
+enable_largefile
'
ac_precious_vars='build_alias
host_alias
@@ -1303,8 +1303,8 @@ Optional Features:
enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-multilib build many library versions (default)
+ --enable-install-libiberty Install headers and library for end users
--disable-largefile omit support for large files
- --enable-install-libiberty Install headers for end users
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \
cross_compiling=maybe
fi
+# We may wish to install the target headers somewhere.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5
+$as_echo_n "checking whether to install libiberty headers and static library... " >&6; }
+
+# Check whether --enable-install-libiberty was given.
+if test "${enable_install_libiberty+set}" = set; then :
+ enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
+else
+ enable_install_libiberty=no
+fi
+
+# Option parsed, now set things appropriately.
+case x"$enable_install_libiberty" in
+ xyes|x)
+ target_header_dir=libiberty
+ ;;
+ xno)
+ target_header_dir=
+ ;;
+ *)
+ # This could be sanity-checked in various ways...
+ target_header_dir="${enable_install_libiberty}"
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5
+$as_echo "$enable_install_libiberty" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5
+$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;}
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -5761,29 +5790,6 @@ _ACEOF
esac
- # We may wish to install the target headers somewhere.
- # Check whether --enable-install-libiberty was given.
-if test "${enable_install_libiberty+set}" = set; then :
- enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
-else
- enable_install_libiberty=no
-fi
-
- # Option parsed, now set things appropriately.
- case x"$enable_install_libiberty" in
- xyes|x)
- target_header_dir=libiberty
- ;;
- xno)
- target_header_dir=
- ;;
- *)
- # This could be sanity-checked in various ways...
- target_header_dir="${enable_install_libiberty}"
- ;;
- esac
-
-
else
# Not a target library, so we set things up to run the test suite.
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index c7638942644..fcea46f6c7b 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \
cross_compiling=maybe
fi
+# We may wish to install the target headers somewhere.
+AC_MSG_CHECKING([whether to install libiberty headers and static library])
+dnl install-libiberty is disabled by default
+
+AC_ARG_ENABLE(install-libiberty,
+[ --enable-install-libiberty Install headers and library for end users],
+enable_install_libiberty=$enableval,
+enable_install_libiberty=no)dnl
+
+# Option parsed, now set things appropriately.
+case x"$enable_install_libiberty" in
+ xyes|x)
+ target_header_dir=libiberty
+ ;;
+ xno)
+ target_header_dir=
+ ;;
+ *)
+ # This could be sanity-checked in various ways...
+ target_header_dir="${enable_install_libiberty}"
+ ;;
+esac
+AC_MSG_RESULT($enable_install_libiberty)
+AC_MSG_NOTICE([target_header_dir = $target_header_dir])
+
GCC_NO_EXECUTABLES
AC_PROG_CC
AC_SYS_LARGEFILE
@@ -492,27 +517,6 @@ if test -n "${with_target_subdir}"; then
esac
- # We may wish to install the target headers somewhere.
- AC_ARG_ENABLE(install-libiberty,
- [ --enable-install-libiberty Install headers for end users],
- enable_install_libiberty=$enableval,
- enable_install_libiberty=no)dnl
-
- # Option parsed, now set things appropriately.
- case x"$enable_install_libiberty" in
- xyes|x)
- target_header_dir=libiberty
- ;;
- xno)
- target_header_dir=
- ;;
- *)
- # This could be sanity-checked in various ways...
- target_header_dir="${enable_install_libiberty}"
- ;;
- esac
-
-
else
# Not a target library, so we set things up to run the test suite.
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 04490fd8b1d..ed9114b9147 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,15 @@
+2013-03-31 Gerald Pfeifer <gerald@pfeifer.com>
+
+ PR bootstrap/56714
+ * local_atomic (__always_inline): Always define our version.
+ (__calculate_memory_order): Mark inline.
+ (atomic_thread_fence): Ditto.
+ (atomic_signal_fence): Ditto.
+ (atomic_bool::atomic_flag_test_and_set_explicit): Ditto.
+ (atomic_bool::atomic_flag_clear_explicit): Ditto.
+ (atomic_bool::atomic_flag_test_and_set): Ditto.
+ (atomic_bool::atomic_flag_clear): Ditto.
+
2013-04-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/sjlj.S: New file.
diff --git a/libitm/local_atomic b/libitm/local_atomic
index 4cd961af9ba..f6bbb11695c 100644
--- a/libitm/local_atomic
+++ b/libitm/local_atomic
@@ -41,9 +41,8 @@
#ifndef _GLIBCXX_ATOMIC
#define _GLIBCXX_ATOMIC 1
-#ifndef __always_inline
-#define __always_inline inline __attribute__((always_inline))
-#endif
+#undef __always_inline
+#define __always_inline __attribute__((always_inline))
// #pragma GCC system_header
@@ -75,7 +74,7 @@ namespace std // _GLIBCXX_VISIBILITY(default)
memory_order_seq_cst
} memory_order;
- __always_inline memory_order
+ inline __always_inline memory_order
__calculate_memory_order(memory_order __m) noexcept
{
const bool __cond1 = __m == memory_order_release;
@@ -85,13 +84,13 @@ namespace std // _GLIBCXX_VISIBILITY(default)
return __mo2;
}
- __always_inline void
+ inline __always_inline void
atomic_thread_fence(memory_order __m) noexcept
{
__atomic_thread_fence (__m);
}
- __always_inline void
+ inline __always_inline void
atomic_signal_fence(memory_order __m) noexcept
{
__atomic_thread_fence (__m);
@@ -1545,38 +1544,38 @@ namespace std // _GLIBCXX_VISIBILITY(default)
// Function definitions, atomic_flag operations.
- __always_inline bool
+ inline __always_inline bool
atomic_flag_test_and_set_explicit(atomic_flag* __a,
memory_order __m) noexcept
{ return __a->test_and_set(__m); }
- __always_inline bool
+ inline __always_inline bool
atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
memory_order __m) noexcept
{ return __a->test_and_set(__m); }
- __always_inline void
+ inline __always_inline void
atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
{ __a->clear(__m); }
- __always_inline void
+ inline __always_inline void
atomic_flag_clear_explicit(volatile atomic_flag* __a,
memory_order __m) noexcept
{ __a->clear(__m); }
- __always_inline bool
+ inline __always_inline bool
atomic_flag_test_and_set(atomic_flag* __a) noexcept
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
- __always_inline bool
+ inline __always_inline bool
atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
- __always_inline void
+ inline __always_inline void
atomic_flag_clear(atomic_flag* __a) noexcept
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
- __always_inline void
+ inline __always_inline void
atomic_flag_clear(volatile atomic_flag* __a) noexcept
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 8cc31a318fc..d2c80b35704 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-03 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * sanitizer_common/sanitizer_linux.cc (MemoryMappingLayout::Next):
+ Cherry pick upstream r182922.
+
2013-05-07 Christophe Lyon <christophe.lyon@linaro.org>
* configure.tgt: Add ARM pattern.
diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
index 06e5a0a6441..1ab6f780fa3 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
@@ -410,7 +410,9 @@ bool MemoryMappingLayout::Next(uptr *start, uptr *end, uptr *offset,
CHECK_EQ(*current_++, ' ');
while (IsDecimal(*current_))
current_++;
- CHECK_EQ(*current_++, ' ');
+ // Qemu may lack the trailing space.
+ // http://code.google.com/p/address-sanitizer/issues/detail?id=160
+ // CHECK_EQ(*current_++, ' ');
// Skip spaces.
while (current_ < next_line && *current_ == ' ')
current_++;
diff --git a/libstdc++-v3/ChangeLog.vtv b/libstdc++-v3/ChangeLog.vtv
new file mode 100644
index 00000000000..32f7dfa26b9
--- /dev/null
+++ b/libstdc++-v3/ChangeLog.vtv
@@ -0,0 +1,44 @@
+2013-06-16 Caroline Tice <cmtice@google.com>
+
+ * configure: Regenerate.
+ * src/Makefile.in: Regenerate.
+ * src/c++98/Makefile.am (EXTRA_VTV_LDFLAGS, LIBVTV_FLAGS, VTV_CXXFLAGS):
+ New definitions, conditioned on ENABLE_VTABLE_VERIFY.
+ (AM_CXXFLAGS): Add VTV_CXXFLAGS to list.
+ (CXXLINK): Add LIBVTV_FLAGS.
+ * src/c++11/Makefile.am: Ditto.
+ * src/c++98/Makefile.in: Regenerate.
+ * src/Makefile.am (libvtv__la_LIBADD): Add definition, conditioned on
+ ENABLE_VTABLE_VERIFY.
+ (LIBVTV_FLAGS): Add definition, conditioned on ENABLE_VTABLE_VERIFY.
+ (libstdc___la_LDFLAGS): Add 'Wl,-u_vtable_map_var_start,
+ -u_vtable_map_var_end' if ENABLE_VTABLE_VERIFY is true.
+ (AM_CXXFLAGS): Add VTV_CXXFLAGS.
+ (CXXLINK): Add LIBVTV_FLAGS.
+ * src/c++11/Makefile.in: Regenerate.
+ * configure.ac (predep_objects_CXX): Add libgcc/vtv_start.o, if
+ enable_vtable_verify is yes.
+ (postdep_objects_CXX): Add libgcc/vtv_end.o if enable_vtable_verify is
+ yes.
+ (GLIBCXX_ENABLE_VTABLE_VERIFY): New definition.
+ * libsupc++/vtv_set.h: New file.
+ * libsupc++/vtv_stubs.cc: New file.
+ * libsupc++/vtv_utils.cc: New file.
+ * libsupc++/vtv_utils.h: New file.
+ * libsupc++/vtv_init.cc: New file.
+ * libsupc++/vtv_malloc.cc: New file.
+ * libsupc++/Makefile.am (sources): Add vtv_rts.cc, vtv_malloc.cc and
+ vtv_utils.cc to the list.
+ (vtv_init_sources, vtv_stubs_soruces, libvtv_init_la_sources,
+ libvtv_stubs_la_sources): New definitions.
+ (toolexeclib_LTLIBRARIES): Add libvtv_init.la and libvtv_stubs.la
+ * libsupc++/Makefile.in: Regenerate.
+ * libsupc++/vtv_rts.cc: New file.
+ * libsupc++/vtv_malloc.h: New file.
+ * libsupc++/vtv_rts.h: New file.
+ * libsupc++/vtv_fail.h: New file.
+ * libsupc++/vtv_map.h: New file.
+ * config/abi/pre/gnu.ver: Add vtable verification runtime functions to
+ the list of globally visible symbols.
+ * acinclude.m4: Add GLIBCXX_ENABLE_VTABLE_VERIFY option and comments.
+
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 18549dc71a3..9e7fc77f47c 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -302,7 +302,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
diff --git a/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
index 8b4416af020..c62f4db8fd9 100644
--- a/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
@@ -403,6 +403,7 @@ FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE5pbaseEv@@GLIBCXX_3.4
FUNC:_ZNKSt15basic_streambufIwSt11char_traitsIwEE6getlocEv@@GLIBCXX_3.4
FUNC:_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
FUNC:_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
+FUNC:_ZNKSt16bad_array_length4whatEv@@CXXABI_1.3.8
FUNC:_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIjEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_LDBL_3.4
FUNC:_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intIlEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_LDBL_3.4
FUNC:_ZNKSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intImEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_@@GLIBCXX_LDBL_3.4
@@ -556,6 +557,7 @@ FUNC:_ZNKSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
FUNC:_ZNKSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
FUNC:_ZNKSt19basic_ostringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
FUNC:_ZNKSt19basic_ostringstreamIwSt11char_traitsIwESaIwEE5rdbufEv@@GLIBCXX_3.4
+FUNC:_ZNKSt20bad_array_new_length4whatEv@@CXXABI_1.3.8
FUNC:_ZNKSt3tr14hashIRKSbIwSt11char_traitsIwESaIwEEEclES6_@@GLIBCXX_3.4.10
FUNC:_ZNKSt3tr14hashIRKSsEclES2_@@GLIBCXX_3.4.10
FUNC:_ZNKSt3tr14hashISbIwSt11char_traitsIwESaIwEEEclES4_@@GLIBCXX_3.4.10
@@ -1934,6 +1936,9 @@ FUNC:_ZNSt16__numpunct_cacheIwEC2Em@@GLIBCXX_3.4
FUNC:_ZNSt16__numpunct_cacheIwED0Ev@@GLIBCXX_3.4
FUNC:_ZNSt16__numpunct_cacheIwED1Ev@@GLIBCXX_3.4
FUNC:_ZNSt16__numpunct_cacheIwED2Ev@@GLIBCXX_3.4
+FUNC:_ZNSt16bad_array_lengthD0Ev@@CXXABI_1.3.8
+FUNC:_ZNSt16bad_array_lengthD1Ev@@CXXABI_1.3.8
+FUNC:_ZNSt16bad_array_lengthD2Ev@@CXXABI_1.3.8
FUNC:_ZNSt16invalid_argumentC1ERKSs@@GLIBCXX_3.4
FUNC:_ZNSt16invalid_argumentC2ERKSs@@GLIBCXX_3.4
FUNC:_ZNSt16invalid_argumentD0Ev@@GLIBCXX_3.4
@@ -2098,6 +2103,9 @@ FUNC:_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv@@GLIBCXX_3.4.5
FUNC:_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv@GLIBCXX_3.4
FUNC:_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv@@GLIBCXX_3.4.5
FUNC:_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv@GLIBCXX_3.4
+FUNC:_ZNSt20bad_array_new_lengthD0Ev@@CXXABI_1.3.8
+FUNC:_ZNSt20bad_array_new_lengthD1Ev@@CXXABI_1.3.8
+FUNC:_ZNSt20bad_array_new_lengthD2Ev@@CXXABI_1.3.8
FUNC:_ZNSt22condition_variable_anyC1Ev@@GLIBCXX_3.4.11
FUNC:_ZNSt22condition_variable_anyC2Ev@@GLIBCXX_3.4.11
FUNC:_ZNSt22condition_variable_anyD1Ev@@GLIBCXX_3.4.11
@@ -2128,6 +2136,8 @@ FUNC:_ZNSt6__norm15_List_node_base7reverseEv@@GLIBCXX_3.4.9
FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
+FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
+FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
@@ -2402,17 +2412,17 @@ FUNC:_ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order@@GLIBCXX_3.4.1
FUNC:_ZNVSt9__atomic011atomic_flag5clearESt12memory_order@@GLIBCXX_3.4.11
FUNC:_ZSt10unexpectedv@@GLIBCXX_3.4
FUNC:_ZSt11_Hash_bytesPKvmm@@CXXABI_1.3.5
-FUNC:_ZSt13get_terminatev@@GLIBCXX_3.4.19
+FUNC:_ZSt13get_terminatev@@GLIBCXX_3.4.20
FUNC:_ZSt13set_terminatePFvvE@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIfEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_3.4
FUNC:_ZSt14__convert_to_vIgEvPKcRT_RSt12_Ios_IostateRKP15__locale_struct@@GLIBCXX_LDBL_3.4
-FUNC:_ZSt14get_unexpectedv@@GLIBCXX_3.4.19
+FUNC:_ZSt14get_unexpectedv@@GLIBCXX_3.4.20
FUNC:_ZSt14set_unexpectedPFvvE@@GLIBCXX_3.4
FUNC:_ZSt15_Fnv_hash_bytesPKvmm@@CXXABI_1.3.5
FUNC:_ZSt15future_categoryv@@GLIBCXX_3.4.15
-FUNC:_ZSt15get_new_handlerv@@GLIBCXX_3.4.19
+FUNC:_ZSt15get_new_handlerv@@GLIBCXX_3.4.20
FUNC:_ZSt15set_new_handlerPFvvE@@GLIBCXX_3.4
FUNC:_ZSt15system_categoryv@@GLIBCXX_3.4.11
FUNC:_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@@GLIBCXX_3.4.9
@@ -2692,6 +2702,8 @@ FUNC:__cxa_pure_virtual@@CXXABI_1.3
FUNC:__cxa_rethrow@@CXXABI_1.3
FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
FUNC:__cxa_throw@@CXXABI_1.3
+FUNC:__cxa_throw_bad_array_length@@CXXABI_1.3.8
+FUNC:__cxa_throw_bad_array_new_length@@CXXABI_1.3.8
FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
FUNC:__cxa_vec_cctor@@CXXABI_1.3
FUNC:__cxa_vec_cleanup@@CXXABI_1.3
@@ -2738,6 +2750,7 @@ OBJECT:0:CXXABI_1.3.4
OBJECT:0:CXXABI_1.3.5
OBJECT:0:CXXABI_1.3.6
OBJECT:0:CXXABI_1.3.7
+OBJECT:0:CXXABI_1.3.8
OBJECT:0:CXXABI_LDBL_1.3
OBJECT:0:CXXABI_TM_1
OBJECT:0:GLIBCXX_3.4
@@ -2753,6 +2766,7 @@ OBJECT:0:GLIBCXX_3.4.17
OBJECT:0:GLIBCXX_3.4.18
OBJECT:0:GLIBCXX_3.4.19
OBJECT:0:GLIBCXX_3.4.2
+OBJECT:0:GLIBCXX_3.4.20
OBJECT:0:GLIBCXX_3.4.3
OBJECT:0:GLIBCXX_3.4.4
OBJECT:0:GLIBCXX_3.4.5
@@ -3209,6 +3223,8 @@ OBJECT:1:_ZNSt21__numeric_limits_base9is_iec559E@@GLIBCXX_3.4
OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4
OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4
OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11
+OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19
+OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19
OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11
OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11
OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
@@ -3216,6 +3232,7 @@ OBJECT:1:_ZSt7nothrow@@GLIBCXX_3.4
OBJECT:20:_ZTSSt12ctype_bynameIcE@@GLIBCXX_3.4
OBJECT:20:_ZTSSt12ctype_bynameIwE@@GLIBCXX_3.4
OBJECT:20:_ZTSSt15underflow_error@@GLIBCXX_3.4
+OBJECT:21:_ZTSSt16bad_array_length@@CXXABI_1.3.8
OBJECT:21:_ZTSSt16invalid_argument@@GLIBCXX_3.4
OBJECT:22:_ZTSNSt8ios_base7failureE@@GLIBCXX_3.4
OBJECT:22:_ZTSSt10moneypunctIcLb0EE@@GLIBCXX_3.4
@@ -3298,6 +3315,7 @@ OBJECT:24:_ZTISt15time_get_bynameIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE
OBJECT:24:_ZTISt15time_put_bynameIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt15time_put_bynameIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt15underflow_error@@GLIBCXX_3.4
+OBJECT:24:_ZTISt16bad_array_length@@CXXABI_1.3.8
OBJECT:24:_ZTISt16invalid_argument@@GLIBCXX_3.4
OBJECT:24:_ZTISt17bad_function_call@@GLIBCXX_3.4.15
OBJECT:24:_ZTISt17moneypunct_bynameIcLb0EE@@GLIBCXX_3.4
@@ -3310,6 +3328,7 @@ OBJECT:24:_ZTISt19basic_istringstreamIcSt11char_traitsIcESaIcEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt19basic_istringstreamIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt19basic_ostringstreamIcSt11char_traitsIcESaIcEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt19basic_ostringstreamIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4
+OBJECT:24:_ZTISt20bad_array_new_length@@CXXABI_1.3.8
OBJECT:24:_ZTISt5ctypeIwE@@GLIBCXX_3.4
OBJECT:24:_ZTISt7codecvtIcc11__mbstate_tE@@GLIBCXX_3.4
OBJECT:24:_ZTISt7codecvtIwc11__mbstate_tE@@GLIBCXX_3.4
@@ -3332,6 +3351,7 @@ OBJECT:24:_ZTISt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBC
OBJECT:24:_ZTISt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4
OBJECT:24:_ZTISt9strstream@@GLIBCXX_3.4
+OBJECT:25:_ZTSSt20bad_array_new_length@@CXXABI_1.3.8
OBJECT:272:_ZSt4cerr@@GLIBCXX_3.4
OBJECT:272:_ZSt4clog@@GLIBCXX_3.4
OBJECT:272:_ZSt4cout@@GLIBCXX_3.4
@@ -3518,8 +3538,10 @@ OBJECT:40:_ZTVSt14overflow_error@@GLIBCXX_3.4
OBJECT:40:_ZTVSt15time_put_bynameIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4
OBJECT:40:_ZTVSt15time_put_bynameIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4
OBJECT:40:_ZTVSt15underflow_error@@GLIBCXX_3.4
+OBJECT:40:_ZTVSt16bad_array_length@@CXXABI_1.3.8
OBJECT:40:_ZTVSt16invalid_argument@@GLIBCXX_3.4
OBJECT:40:_ZTVSt17bad_function_call@@GLIBCXX_3.4.15
+OBJECT:40:_ZTVSt20bad_array_new_length@@CXXABI_1.3.8
OBJECT:40:_ZTVSt8bad_cast@@GLIBCXX_3.4
OBJECT:40:_ZTVSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4
OBJECT:40:_ZTVSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 604e061f337..7e17ab0b4ea 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1336,20 +1336,6 @@ GLIBCXX_3.4.18 {
std::__detail::_Prime_rehash_policy::*;
};
- # Virtual table verification symbols
- _Z12__VLTprotectv;
- _Z14__VLTunprotectv;
- _Z17__VLTRegisterPair*;
- _Z22__VLTRegisterPairDebug*;
- _Z16__VLTRegisterSet*;
- _Z21__VLTRegisterSetDebug*;
- _Z24__VLTVerifyVtablePointer*;
- _Z29__VLTVerifyVtablePointerDebug*;
- _Z17__vtv_verify_fail*;
- _Z17__vtv_really_fail*;
- _Z14__VLTDumpStats*;
- __VLTChangePermission;
-
# std::this_thread::__sleep_for
_ZNSt11this_thread11__sleep_for*;
@@ -1586,6 +1572,22 @@ CXXABI_1.3.8 {
__cxa_throw_bad_array_length;
_Z*St16bad_array_length*;
+
+ # Virtual table verification symbols
+ _Z12__VLTprotectv;
+ _Z14__VLTunprotectv;
+ _Z17__VLTRegisterPair*;
+ _Z22__VLTRegisterPairDebug*;
+ _Z16__VLTRegisterSet*;
+ _Z21__VLTRegisterSetDebug*;
+ _Z24__VLTVerifyVtablePointer*;
+ _Z29__VLTVerifyVtablePointerDebug*;
+ _Z17__vtv_verify_fail*;
+ _Z23__vtv_verify_fail_debug*;
+ _Z17__vtv_really_fail*;
+ _Z14__VLTDumpStats*;
+ __VLTChangePermission;
+
} CXXABI_1.3.7;
# Symbols in the support library (libsupc++) supporting transactional memory.
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index cdd0fb219bc..23b3f523bcf 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -330,7 +330,7 @@ case "${host}" in
mips64*)
abi_baseline_pair=mips64-linux-gnu
;;
- powerpc64)
+ powerpc64*)
abi_baseline_pair=powerpc64-linux-gnu
;;
s390)
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 799bd327bd3..ff0ea51c727 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -284,7 +284,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
diff --git a/libstdc++-v3/fragment.am b/libstdc++-v3/fragment.am
index 79b011e80ae..5b7c08b3207 100644
--- a/libstdc++-v3/fragment.am
+++ b/libstdc++-v3/fragment.am
@@ -26,7 +26,7 @@ XTEMPLATE_FLAGS =
endif
if ENABLE_VTABLE_VERIFY
-VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs -Wl,-lvtv
VTV_CXXFLAGS = -fvtable-verify=std \
-Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
else
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index e8ef7066bcd..801a8858087 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -58,6 +58,7 @@ std_headers = \
${std_srcdir}/regex \
${std_srcdir}/scoped_allocator \
${std_srcdir}/set \
+ ${std_srcdir}/shared_mutex \
${std_srcdir}/sstream \
${std_srcdir}/stack \
${std_srcdir}/stdexcept \
@@ -87,6 +88,7 @@ bits_headers = \
${bits_srcdir}/basic_string.tcc \
${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/c++0x_warning.h \
+ ${bits_srcdir}/c++14_warning.h \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
@@ -117,6 +119,7 @@ bits_headers = \
${bits_srcdir}/move.h \
${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \
+ ${bits_srcdir}/parse_numbers.h \
${bits_srcdir}/postypes.h \
${bits_srcdir}/ptr_traits.h \
${bits_srcdir}/random.h \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 9972eeccb09..5f4583a3652 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -274,7 +274,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
@@ -328,6 +328,7 @@ std_headers = \
${std_srcdir}/regex \
${std_srcdir}/scoped_allocator \
${std_srcdir}/set \
+ ${std_srcdir}/shared_mutex \
${std_srcdir}/sstream \
${std_srcdir}/stack \
${std_srcdir}/stdexcept \
@@ -357,6 +358,7 @@ bits_headers = \
${bits_srcdir}/basic_string.tcc \
${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/c++0x_warning.h \
+ ${bits_srcdir}/c++14_warning.h \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
@@ -387,6 +389,7 @@ bits_headers = \
${bits_srcdir}/move.h \
${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \
+ ${bits_srcdir}/parse_numbers.h \
${bits_srcdir}/postypes.h \
${bits_srcdir}/ptr_traits.h \
${bits_srcdir}/random.h \
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 33ea145d521..e68d3171095 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -412,7 +412,7 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap,
* Returns @c __a.max_size() if that expression is well-formed,
* otherwise returns @c numeric_limits<size_type>::max()
*/
- static size_type max_size(const _Alloc& __a)
+ static size_type max_size(const _Alloc& __a) noexcept
{ return _S_max_size(__a); }
/**
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 23bd9b9c096..cbea5664e71 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -3103,8 +3103,40 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ };
#endif
+#if __cplusplus > 201103L
+
+ inline namespace literals
+ {
+ inline namespace string_literals
+ {
+
+ inline basic_string<char>
+ operator"" s(const char* __str, size_t __len)
+ { return basic_string<char>{__str, __len}; }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ inline basic_string<wchar_t>
+ operator"" s(const wchar_t* __str, size_t __len)
+ { return basic_string<wchar_t>{__str, __len}; }
+#endif
+
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+ inline basic_string<char16_t>
+ operator"" s(const char16_t* __str, size_t __len)
+ { return basic_string<char16_t>{__str, __len}; }
+
+ inline basic_string<char32_t>
+ operator"" s(const char32_t* __str, size_t __len)
+ { return basic_string<char32_t>{__str, __len}; }
+#endif
+
+ } // inline namespace string_literals
+ } // inline namespace literals
+
+#endif // __cplusplus > 201103L
+
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/bits/c++14_warning.h b/libstdc++-v3/include/bits/c++14_warning.h
new file mode 100644
index 00000000000..ff2adfa75da
--- /dev/null
+++ b/libstdc++-v3/include/bits/c++14_warning.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/c++14_warning.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _CXX14_WARNING_H
+#define _CXX14_WARNING_H 1
+
+#if __cplusplus <= 201103L
+#error This file requires compiler and library support for the forthcoming \
+ISO C++ 2014 standard. This support is currently experimental, and must be \
+enabled with the -std=c++1y or -std=gnu++1y compiler options.
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 04ae4cb7c3a..aca8484e222 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -84,6 +84,12 @@
# define _GLIBCXX_DEPRECATED
#endif
+// Macros for ABI tag attributes.
+#ifndef _GLIBCXX_ABI_TAG_CXX11
+# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
+#endif
+
+
#if __cplusplus
// Macro for constexpr, to support in mixed 03/0x mode.
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index e7c4bdd816e..c3cee971399 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -338,7 +338,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Node*
_M_get_node()
- { return _Node_alloc_traits::allocate(_M_get_Node_allocator(), 1); }
+ {
+ auto __ptr = _Node_alloc_traits::allocate(_M_get_Node_allocator(), 1);
+ return std::__addressof(*__ptr);
+ }
template<typename... _Args>
_Node*
@@ -367,7 +370,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
void
_M_put_node(_Node* __p)
- { _Node_alloc_traits::deallocate(_M_get_Node_allocator(), __p, 1); }
+ {
+ typedef typename _Node_alloc_traits::pointer _Ptr;
+ auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__p);
+ _Node_alloc_traits::deallocate(_M_get_Node_allocator(), __ptr, 1);
+ }
_Fwd_list_node_base*
_M_erase_after(_Fwd_list_node_base* __pos);
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index 0ff6e132a83..8ce264ed72e 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -775,7 +775,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
_M_allocate_node(_Args&&... __args)
{
- __node_type* __n = _Node_alloc_traits::allocate(_M_node_allocator(), 1);
+ auto __nptr = _Node_alloc_traits::allocate(_M_node_allocator(), 1);
+ __node_type* __n = std::__addressof(*__nptr);
__try
{
_Value_alloc_type __a(_M_node_allocator());
@@ -786,7 +787,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
__catch(...)
{
- _Node_alloc_traits::deallocate(_M_node_allocator(), __n, 1);
+ _Node_alloc_traits::deallocate(_M_node_allocator(), __nptr, 1);
__throw_exception_again;
}
}
@@ -800,10 +801,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
_M_deallocate_node(__node_type* __n)
{
+ typedef typename _Node_alloc_traits::pointer _Ptr;
+ auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__n);
_Value_alloc_type __a(_M_node_allocator());
_Value_alloc_traits::destroy(__a, __n->_M_valptr());
__n->~__node_type();
- _Node_alloc_traits::deallocate(_M_node_allocator(), __n, 1);
+ _Node_alloc_traits::deallocate(_M_node_allocator(), __ptr, 1);
}
template<typename _Key, typename _Value,
@@ -835,7 +838,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_Bucket_alloc_type __alloc(_M_node_allocator());
- __bucket_type* __p = _Bucket_alloc_traits::allocate(__alloc, __n);
+ auto __ptr = _Bucket_alloc_traits::allocate(__alloc, __n);
+ __bucket_type* __p = std::__addressof(*__ptr);
__builtin_memset(__p, 0, __n * sizeof(__bucket_type));
return __p;
}
@@ -849,8 +853,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
_M_deallocate_buckets(__bucket_type* __bkts, size_type __n)
{
+ typedef typename _Bucket_alloc_traits::pointer _Ptr;
+ auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__bkts);
_Bucket_alloc_type __alloc(_M_node_allocator());
- _Bucket_alloc_traits::deallocate(__alloc, __bkts, __n);
+ _Bucket_alloc_traits::deallocate(__alloc, __ptr, __n);
}
template<typename _Key, typename _Value,
diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index fb6c61fcc0a..d54edcd4168 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* type is copyable, in which case an lvalue-reference is returned instead.
*/
template<typename _Tp>
- inline constexpr typename
+ constexpr typename
conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
move_if_noexcept(_Tp& __x) noexcept
{ return std::move(__x); }
diff --git a/libstdc++-v3/include/bits/parse_numbers.h b/libstdc++-v3/include/bits/parse_numbers.h
new file mode 100644
index 00000000000..eaa3d27a18a
--- /dev/null
+++ b/libstdc++-v3/include/bits/parse_numbers.h
@@ -0,0 +1,417 @@
+// Components for compile-time parsing of numbers -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/parse_numbers.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{chrono}
+ */
+
+#ifndef _PARSE_NUMBERS_H
+#define _PARSE_NUMBERS_H 1
+
+#pragma GCC system_header
+
+// From n3642.pdf except I added binary literals and digit separator '`'.
+
+#if __cplusplus > 201103L
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+namespace __parse_int {
+
+ template<unsigned _Base, char _Dig>
+ struct _Digit;
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '0'>
+ {
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '1'>
+ {
+ static constexpr bool valid{true};
+ static constexpr unsigned value{1};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '2'>
+ {
+ static_assert(_Base > 2, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{2};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '3'>
+ {
+ static_assert(_Base > 3, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{3};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '4'>
+ {
+ static_assert(_Base > 4, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{4};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '5'>
+ {
+ static_assert(_Base > 5, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{5};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '6'>
+ {
+ static_assert(_Base > 6, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{6};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '7'>
+ {
+ static_assert(_Base > 7, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{7};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '8'>
+ {
+ static_assert(_Base > 8, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{8};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, '9'>
+ {
+ static_assert(_Base > 9, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{9};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'a'>
+ {
+ static_assert(_Base > 0xa, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xa};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'A'>
+ {
+ static_assert(_Base > 0xa, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xa};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'b'>
+ {
+ static_assert(_Base > 0xb, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xb};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'B'>
+ {
+ static_assert(_Base > 0xb, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xb};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'c'>
+ {
+ static_assert(_Base > 0xc, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xc};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'C'>
+ {
+ static_assert(_Base > 0xc, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xc};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'd'>
+ {
+ static_assert(_Base > 0xd, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xd};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'D'>
+ {
+ static_assert(_Base > 0xd, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xd};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'e'>
+ {
+ static_assert(_Base > 0xe, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xe};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'E'>
+ {
+ static_assert(_Base > 0xe, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xe};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'f'>
+ {
+ static_assert(_Base > 0xf, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xf};
+ };
+
+ template<unsigned _Base>
+ struct _Digit<_Base, 'F'>
+ {
+ static_assert(_Base > 0xf, "invalid digit");
+ static constexpr bool valid{true};
+ static constexpr unsigned value{0xf};
+ };
+
+ // Digit separator
+ template<unsigned _Base>
+ struct _Digit<_Base, '`'>
+ {
+ static constexpr bool valid{false};
+ static constexpr unsigned value{0};
+ };
+
+
+//------------------------------------------------------------------------------
+
+ template<unsigned _Base, char _Dig, char... _Digs>
+ struct _Digits_help
+ {
+ static constexpr unsigned
+ value{_Digit<_Base, _Dig>::valid ?
+ 1U + _Digits_help<_Base, _Digs...>::value :
+ _Digits_help<_Base, _Digs...>::value};
+ };
+
+ template<unsigned _Base, char _Dig>
+ struct _Digits_help<_Base, _Dig>
+ {
+ static constexpr unsigned value{_Digit<_Base, _Dig>::valid ? 1U : 0U};
+ };
+
+ template<unsigned _Base, char... _Digs>
+ struct _Digits
+ {
+ static constexpr unsigned value{_Digits_help<_Base, _Digs...>::value};
+ };
+
+ template<unsigned _Base>
+ struct _Digits<_Base>
+ {
+ static constexpr unsigned value{0U};
+ };
+
+//------------------------------------------------------------------------------
+
+ template<unsigned _Base, char _Dig, char... _Digs>
+ struct _Power_help
+ {
+ static constexpr unsigned
+ value{_Digit<_Base, _Dig>::valid ?
+ _Base * _Power_help<_Base, _Digs...>::value :
+ _Power_help<_Base, _Digs...>::value};
+ };
+
+ template<unsigned _Base, char _Dig>
+ struct _Power_help<_Base, _Dig>
+ {
+ static constexpr unsigned value{_Digit<_Base, _Dig>::valid ? 1U : 0U};
+ };
+
+ template<unsigned _Base, char... _Digs>
+ struct _Power
+ {
+ static constexpr unsigned value{_Power_help<_Base, _Digs...>::value};
+ };
+
+ template<unsigned _Base>
+ struct _Power<_Base>
+ {
+ static constexpr unsigned value{0U};
+ };
+
+//------------------------------------------------------------------------------
+
+ template<unsigned _Base, unsigned _Pow, char _Dig, char... _Digs>
+ struct _Number_help
+ {
+ static constexpr unsigned
+ value{_Digit<_Base, _Dig>::valid ?
+ _Pow * _Digit<_Base, _Dig>::value
+ + _Number_help<_Base, _Pow / _Base, _Digs...>::value :
+ _Number_help<_Base, _Pow, _Digs...>::value};
+ };
+
+ template<unsigned _Base, unsigned _Pow, char _Dig>
+ struct _Number_help<_Base, _Pow, _Dig>
+ {
+ //static_assert(_Pow == 1U, "power should be one");
+ static constexpr unsigned
+ value{_Digit<_Base, _Dig>::valid ? _Digit<_Base, _Dig>::value : 0U};
+ };
+
+ template<unsigned _Base, char... _Digs>
+ struct _Number
+ {
+ static constexpr unsigned
+ value{_Number_help<_Base, _Power<_Base, _Digs...>::value,
+ _Digs...>::value};
+ };
+
+ template<unsigned _Base>
+ struct _Number<_Base>
+ {
+ static constexpr unsigned value{0U};
+ };
+
+//------------------------------------------------------------------------------
+// This _Parse_int is the same 'level' as the old _Base_dispatch.
+
+ template<char... _Digs>
+ struct _Parse_int;
+
+ template<char... _Digs>
+ struct _Parse_int<'0', 'b', _Digs...>
+ {
+ static constexpr unsigned long long
+ value{_Number<2U, _Digs...>::value};
+ };
+
+ template<char... _Digs>
+ struct _Parse_int<'0', 'B', _Digs...>
+ {
+ static constexpr unsigned long long
+ value{_Number<2U, _Digs...>::value};
+ };
+
+ template<char... _Digs>
+ struct _Parse_int<'0', 'x', _Digs...>
+ {
+ static constexpr unsigned long long
+ value{_Number<16U, _Digs...>::value};
+ };
+
+ template<char... _Digs>
+ struct _Parse_int<'0', 'X', _Digs...>
+ {
+ static constexpr unsigned long long
+ value{_Number<16U, _Digs...>::value};
+ };
+
+ template<char... _Digs>
+ struct _Parse_int<'0', _Digs...>
+ {
+ static constexpr unsigned long long
+ value{_Number<8U, _Digs...>::value};
+ };
+
+ template<char... _Digs>
+ struct _Parse_int
+ {
+ static constexpr unsigned long long
+ value{_Number<10U, _Digs...>::value};
+ };
+
+} // namespace __parse_int
+
+
+namespace __select_int {
+
+ template<unsigned long long _Val, typename... _Ints>
+ struct _Select_int_base;
+
+ template<unsigned long long _Val, typename _IntType, typename... _Ints>
+ struct _Select_int_base<_Val, _IntType, _Ints...>
+ : integral_constant
+ <
+ typename conditional
+ <
+ _Val <= static_cast<unsigned long long>
+ (std::numeric_limits<_IntType>::max()),
+ _IntType,
+ typename _Select_int_base<_Val, _Ints...>::value_type
+ >::type,
+ _Val
+ >
+ { };
+
+ template<unsigned long long _Val>
+ struct _Select_int_base<_Val> : integral_constant<unsigned long long, _Val>
+ { };
+
+ template<char... _Digs>
+ struct _Select_int
+ : _Select_int_base<
+ __parse_int::_Parse_int<_Digs...>::value,
+ unsigned char,
+ unsigned short,
+ unsigned int,
+ unsigned long,
+ unsigned long long
+ >
+ { };
+
+} // namespace __select_int
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
+#endif // __cplusplus > 201103L
+
+#endif // _PARSE_NUMBERS_H
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 873005b8b1a..e61f22b66a8 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -4371,6 +4371,140 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return true;
}
+#if __cplusplus > 201103L
+ /**
+ * @brief Checks whether a permutaion of the second sequence is equal
+ * to the first sequence.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 Start of first range.
+ * @param __last1 End of first range.
+ * @param __first2 Start of second range.
+ * @param __last2 End of first range.
+ * @return true if there exists a permutation of the elements in the range
+ * [__first2, __last2), beginning with ForwardIterator2 begin,
+ * such that equal(__first1, __last1, begin) returns true;
+ * otherwise, returns false.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2>
+ bool
+ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+ {
+ using _Cat1
+ = typename iterator_traits<_ForwardIterator1>::iterator_category;
+ using _Cat2
+ = typename iterator_traits<_ForwardIterator2>::iterator_category;
+ using _It1_is_RA = is_same<_Cat1, random_access_iterator_tag>;
+ using _It2_is_RA = is_same<_Cat2, random_access_iterator_tag>;
+ if (_It1_is_RA() && _It1_is_RA())
+ {
+ auto __d1 = std::distance(__first1, __last1);
+ auto __d2 = std::distance(__first2, __last2);
+ if (__d1 != __d2)
+ return false;
+ }
+
+ // Efficiently compare identical prefixes: O(N) if sequences
+ // have the same elements in the same order.
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ break;
+
+ if (__first1 == __last1 && __first2 == __last2)
+ return true;
+
+ if (std::distance(__first1, __last1) != std::distance(__first2, __last2))
+ return false;
+
+ for (auto __scan = __first1; __scan != __last1; ++__scan)
+ {
+ if (__scan != _GLIBCXX_STD_A::find(__first1, __scan, *__scan))
+ continue; // We've seen this one before.
+
+ auto __matches = std::count(__first2, __last2, *__scan);
+ if (0 == __matches
+ || std::count(__scan, __last1, *__scan) != __matches)
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @brief Checks whether a permutation of the second sequence is equal
+ * to the first sequence.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 Start of first range.
+ * @param __last1 End of first range.
+ * @param __first2 Start of second range.
+ * @param __last2 End of first range.
+ * @param __pred A binary predicate.
+ * @return true if there exists a permutation of the elements in the range
+ * [__first2, __last2), beginning with ForwardIterator2 begin,
+ * such that equal(__first1, __last1, __begin, __pred) returns true;
+ * otherwise, returns false.
+ */
+ template<typename _ForwardIterator1, typename _ForwardIterator2,
+ typename _BinaryPredicate>
+ bool
+ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _BinaryPredicate __pred)
+ {
+ using _Cat1
+ = typename iterator_traits<_ForwardIterator1>::iterator_category;
+ using _Cat2
+ = typename iterator_traits<_ForwardIterator2>::iterator_category;
+ using _It1_is_RA = is_same<_Cat1, random_access_iterator_tag>;
+ using _It2_is_RA = is_same<_Cat2, random_access_iterator_tag>;
+ constexpr bool __ra_iters = _It1_is_RA() && _It1_is_RA();
+ if (__ra_iters)
+ {
+ auto __d1 = std::distance(__first1, __last1);
+ auto __d2 = std::distance(__first2, __last2);
+ if (__d1 != __d2)
+ return false;
+ }
+
+ // Efficiently compare identical prefixes: O(N) if sequences
+ // have the same elements in the same order.
+ for (; __first1 != __last1; ++__first1, ++__first2)
+ if (!bool(__pred(*__first1, *__first2)))
+ break;
+
+ if (__ra_iters)
+ {
+ if (__first1 == __last1)
+ return true;
+ }
+ else
+ {
+ auto __d1 = std::distance(__first1, __last1);
+ auto __d2 = std::distance(__first2, __last2);
+ if (__d1 == 0 && __d2 == 0)
+ return true;
+ if (__d1 != __d2)
+ return false;
+ }
+
+ for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan)
+ {
+ using std::placeholders::_1;
+
+ if (__scan != _GLIBCXX_STD_A::find_if(__first1, __scan,
+ std::bind(__pred, _1, *__scan)))
+ continue; // We've seen this one before.
+
+ auto __matches = std::count_if(__first2, __last2,
+ std::bind(__pred, _1, *__scan));
+ if (0 == __matches
+ || std::count_if(__scan, __last1,
+ std::bind(__pred, _1, *__scan)) != __matches)
+ return false;
+ }
+ return true;
+ }
+#endif
+
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
/**
* @brief Shuffle the elements of a sequence using a uniform random
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index a90881f8f62..67f859b3602 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -798,6 +798,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return false;
return true;
}
+
+#if __cplusplus > 201103L
+ template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ return false;
+ return true;
+ }
+#endif
};
template<>
@@ -810,6 +823,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
* (__last1 - __first1));
}
+
+#if __cplusplus > 201103L
+ template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2,
+ const _Tp* __last2)
+ {
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
+ }
+#endif
};
template<typename _II1, typename _II2>
@@ -827,6 +851,65 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return std::__equal<__simple>::equal(__first1, __last1, __first2);
}
+#if __cplusplus > 201103L
+ template<bool _BoolType>
+ struct __equal2
+ {
+ template<typename _It>
+ using _IterCat = typename iterator_traits<_It>::iterator_category;
+ template<typename _It>
+ using _IsRA = is_same<_IterCat<_It>, random_access_iterator_tag>;
+
+ template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ constexpr bool __ra_iters = _IsRA<_II1>() && _IsRA<_II2>();
+ if (__ra_iters)
+ {
+ auto __d1 = std::distance(__first1, __last1);
+ auto __d2 = std::distance(__first2, __last2);
+ if (__d1 != __d2)
+ return false;
+ }
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
+ if (!(*__first1 == *__first2))
+ return false;
+ return __ra_iters || (__first1 == __last1 && __first2 == __last2);
+ }
+ };
+
+ template<>
+ struct __equal2<true>
+ {
+ template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2,
+ const _Tp* __last2)
+ {
+ if ((__last1 - __first1) != (__last2 - __first2))
+ return false;
+ return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
+ * (__last1 - __first1));
+ }
+ };
+
+ template<typename _II1, typename _II2>
+ inline bool
+ __equal2_aux(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ typedef typename iterator_traits<_II1>::value_type _ValueType1;
+ typedef typename iterator_traits<_II2>::value_type _ValueType2;
+ const bool __simple = ((__is_integer<_ValueType1>::__value
+ || __is_pointer<_ValueType1>::__value)
+ && __is_pointer<_II1>::__value
+ && __is_pointer<_II2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
+
+ return __equal2<__simple>::equal(__first1, __last1, __first2, __last2);
+ }
+#endif
template<typename, typename>
struct __lc_rai
@@ -1064,6 +1147,86 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
return true;
}
+#if __cplusplus > 201103L
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 An input iterator.
+ * @param __last1 An input iterator.
+ * @param __first2 An input iterator.
+ * @param __last2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using @c == and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _II1, typename _II2>
+ inline bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_II1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_II2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_II1>::value_type,
+ typename iterator_traits<_II2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ return std::__equal2_aux(std::__niter_base(__first1),
+ std::__niter_base(__last1),
+ std::__niter_base(__first2),
+ std::__niter_base(__last2));
+ }
+
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 An input iterator.
+ * @param __last1 An input iterator.
+ * @param __first2 An input iterator.
+ * @param __last2 An input iterator.
+ * @param __binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
+ template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+ inline bool
+ equal(_IIter1 __first1, _IIter1 __last1,
+ _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ using _Cat1 = typename iterator_traits<_IIter1>::iterator_category;
+ using _Cat2 = typename iterator_traits<_IIter2>::iterator_category;
+ using _IIter1_is_RA = is_same<_Cat1, random_access_iterator_tag>;
+ using _IIter2_is_RA = is_same<_Cat2, random_access_iterator_tag>;
+ constexpr bool __ra_iters = _IIter1_is_RA() && _IIter1_is_RA();
+ if (__ra_iters)
+ {
+ auto __d1 = std::distance(__first1, __last1);
+ auto __d2 = std::distance(__first2, __last2);
+ if (__d1 != __d2)
+ return false;
+ }
+
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+ return false;
+ return __ra_iters || (__first1 == __last1 && __first2 == __last2);
+ }
+#endif
+
/**
* @brief Performs @b dictionary comparison on ranges.
* @ingroup sorting_algorithms
@@ -1211,6 +1374,84 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
}
+#if __cplusplus > 201103L
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 An input iterator.
+ * @param __last1 An input iterator.
+ * @param __first2 An input iterator.
+ * @param __last2 An input iterator.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using @c == and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIterator1>::value_type,
+ typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ while (__first1 != __last1 && __first2 != __last2
+ && *__first1 == *__first2)
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @ingroup non_mutating_algorithms
+ * @param __first1 An input iterator.
+ * @param __last1 An input iterator.
+ * @param __first2 An input iterator.
+ * @param __last2 An input iterator.
+ * @param __binary_pred A binary predicate @link functors
+ * functor@endlink.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
+ template<typename _InputIterator1, typename _InputIterator2,
+ typename _BinaryPredicate>
+ pair<_InputIterator1, _InputIterator2>
+ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+ _InputIterator2 __first2, _InputIterator2 __last2,
+ _BinaryPredicate __binary_pred)
+ {
+ // concept requirements
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
+ __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
+ while (__first1 != __last1 && __first2 != __last2
+ && bool(__binary_pred(*__first1, *__first2)))
+ {
+ ++__first1;
+ ++__first2;
+ }
+ return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+ }
+#endif
+
_GLIBCXX_END_NAMESPACE_ALGO
} // namespace std
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 1f6763cd244..d05e4b9ab7d 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -690,7 +690,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
erase(const_iterator __position)
{ return _M_t.erase(__position); }
- // LWG 2059.
+ // LWG 2059
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(iterator __position)
{ return _M_t.erase(__position); }
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 696e298aa8b..809ea540b8a 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -596,6 +596,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ return _M_t.erase(__position); }
// LWG 2059.
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(iterator __position)
{ return _M_t.erase(__position); }
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index ea22f4c8057..8ceb02ac65f 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -532,6 +532,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* not touched in any way. Managing the pointer is the user's
* responsibility.
*/
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __position)
{ return _M_t.erase(__position); }
@@ -583,6 +584,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* touched in any way. Managing the pointer is the user's
* responsibility.
*/
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __first, const_iterator __last)
{ return _M_t.erase(__first, __last); }
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 14f9f5a1823..44eb5897f0e 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -546,6 +546,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* touched in any way. Managing the pointer is the user's
* responsibility.
*/
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __position)
{ return _M_t.erase(__position); }
@@ -597,6 +598,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* the element is itself a pointer, the pointed-to memory is not touched
* in any way. Managing the pointer is the user's responsibility.
*/
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __first, const_iterator __last)
{ return _M_t.erase(__first, __last); }
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index cb5a8eff800..91bf4df4511 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -336,21 +336,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Node_allocator;
protected:
- typedef _Rb_tree_node_base* _Base_ptr;
- typedef const _Rb_tree_node_base* _Const_Base_ptr;
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
public:
- typedef _Key key_type;
- typedef _Val value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef _Rb_tree_node<_Val>* _Link_type;
- typedef const _Rb_tree_node<_Val>* _Const_Link_type;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef _Alloc allocator_type;
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
_Node_allocator&
_M_get_Node_allocator() _GLIBCXX_NOEXCEPT
@@ -800,6 +800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 130. Associative erase should return an iterator.
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __position)
{
@@ -810,6 +811,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// LWG 2059.
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(iterator __position)
{
@@ -833,6 +835,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 130. Associative erase should return an iterator.
+ _GLIBCXX_ABI_TAG_CXX11
iterator
erase(const_iterator __first, const_iterator __last)
{
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 22a5166cc3c..6d5b29e09d2 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -397,7 +397,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Pair&&>::value>::type>
std::pair<iterator, bool>
insert(_Pair&& __x)
- { return _M_h.insert(std::move(__x)); }
+ { return _M_h.insert(std::forward<_Pair>(__x)); }
//@}
//@{
@@ -431,7 +431,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Pair&&>::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __x)
- { return _M_h.insert(__hint, std::move(__x)); }
+ { return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
//@}
/**
@@ -1093,7 +1093,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Pair&&>::value>::type>
iterator
insert(_Pair&& __x)
- { return _M_h.insert(std::move(__x)); }
+ { return _M_h.insert(std::forward<_Pair>(__x)); }
//@}
//@{
@@ -1125,7 +1125,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Pair&&>::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __x)
- { return _M_h.insert(__hint, std::move(__x)); }
+ { return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
//@}
/**
diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef
index 00660f3a5a4..94d8957716d 100644
--- a/libstdc++-v3/include/c_global/cstddef
+++ b/libstdc++-v3/include/c_global/cstddef
@@ -36,7 +36,20 @@
// ISO C++ 14882: 18.1 Types
//
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
+
#pragma GCC system_header
#include <bits/c++config.h>
#include <stddef.h>
+
+#if __cplusplus >= 201103L
+namespace std
+{
+ // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
+ using ::max_align_t;
+}
+#endif
+
+#endif // _GLIBCXX_CSTDDEF
diff --git a/libstdc++-v3/include/c_std/cstddef b/libstdc++-v3/include/c_std/cstddef
index 9500bc514bd..6f1b5bd5d79 100644
--- a/libstdc++-v3/include/c_std/cstddef
+++ b/libstdc++-v3/include/c_std/cstddef
@@ -44,4 +44,12 @@
#include <bits/c++config.h>
#include <stddef.h>
+#if __cplusplus >= 201103L
+namespace std
+{
+ // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
+ using ::max_align_t;
+}
#endif
+
+#endif // _GLIBCXX_CSTDDEF
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 6d9df7d7dda..d5ef984279d 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -39,6 +39,7 @@
#include <type_traits>
#include <limits>
#include <ctime>
+#include <bits/parse_numbers.h> // for literals support.
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
@@ -712,7 +713,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
*
* Time returned represents wall time from the system-wide clock.
*/
- struct system_clock
+ struct system_clock
{
typedef chrono::nanoseconds duration;
typedef duration::rep rep;
@@ -774,13 +775,137 @@ _GLIBCXX_END_NAMESPACE_VERSION
*/
using high_resolution_clock = system_clock;
- } // end inline namespace _V2
+ } // end inline namespace _V2
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace chrono
+#if __cplusplus > 201103L
+
+ inline namespace literals
+ {
+ inline namespace chrono_literals
+ {
+
+ namespace __select_type
+ {
+
+ using namespace __parse_int;
+
+ template<unsigned long long _Val, typename _Dur>
+ struct _Select_type
+ : conditional<
+ _Val <= static_cast<unsigned long long>
+ (numeric_limits<typename _Dur::rep>::max()),
+ _Dur, void>
+ {
+ static constexpr typename _Select_type::type
+ value{static_cast<typename _Select_type::type>(_Val)};
+ };
+
+ template<unsigned long long _Val, typename _Dur>
+ constexpr typename _Select_type<_Val, _Dur>::type
+ _Select_type<_Val, _Dur>::value;
+
+ } // __select_type
+
+ constexpr chrono::duration<long double, ratio<3600,1>>
+ operator"" h(long double __hours)
+ { return chrono::duration<long double, ratio<3600,1>>{__hours}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::hours>::type
+ operator"" h()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::hours>::value;
+ }
+
+ constexpr chrono::duration<long double, ratio<60,1>>
+ operator"" min(long double __mins)
+ { return chrono::duration<long double, ratio<60,1>>{__mins}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::minutes>::type
+ operator"" min()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::minutes>::value;
+ }
+
+ constexpr chrono::duration<long double>
+ operator"" s(long double __secs)
+ { return chrono::duration<long double>{__secs}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::seconds>::type
+ operator"" s()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::seconds>::value;
+ }
+
+ constexpr chrono::duration<long double, milli>
+ operator"" ms(long double __msecs)
+ { return chrono::duration<long double, milli>{__msecs}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::milliseconds>::type
+ operator"" ms()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::milliseconds>::value;
+ }
+
+ constexpr chrono::duration<long double, micro>
+ operator"" us(long double __usecs)
+ { return chrono::duration<long double, micro>{__usecs}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::microseconds>::type
+ operator"" us()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::microseconds>::value;
+ }
+
+ constexpr chrono::duration<long double, nano>
+ operator"" ns(long double __nsecs)
+ { return chrono::duration<long double, nano>{__nsecs}; }
+
+ template <char... _Digits>
+ constexpr typename
+ __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
+ chrono::nanoseconds>::type
+ operator"" ns()
+ {
+ return __select_type::_Select_type<
+ __select_int::_Select_int<_Digits...>::value,
+ chrono::nanoseconds>::value;
+ }
+
+ } // inline namespace chrono_literals
+ } // inline namespace literals
+
+#endif // __cplusplus > 201103L
+
// @} group chrono
-} // namespace
+} // namespace std
#endif //_GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index b31e8b18d71..7f100a0420d 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -142,11 +142,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
- __attribute ((__abi_tag__ ("cxx11")))
+ _GLIBCXX_ABI_TAG_CXX11
constexpr _Tp
real() { return _M_real; }
- __attribute ((__abi_tag__ ("cxx11")))
+ _GLIBCXX_ABI_TAG_CXX11
constexpr _Tp
imag() { return _M_imag; }
#else
diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip
index 599d220dadc..47284e82a5a 100644
--- a/libstdc++-v3/include/std/iomanip
+++ b/libstdc++-v3/include/std/iomanip
@@ -334,7 +334,160 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __os;
}
-#endif
+#if __cplusplus > 201103L
+
+ namespace __detail {
+
+ /**
+ * @brief Struct for delimited strings.
+ * The left and right delimiters can be different.
+ */
+ template<typename _String, typename _CharT>
+ struct _Quoted_string
+ {
+ static_assert(is_reference<_String>::value
+ || is_pointer<_String>::value,
+ "String type must be pointer or reference");
+
+ _Quoted_string(_String __str, _CharT __del, _CharT __esc)
+ : _M_string(__str), _M_delim{__del}, _M_escape{__esc}
+ { }
+
+ _Quoted_string&
+ operator=(_Quoted_string&) = delete;
+
+ _String _M_string;
+ _CharT _M_delim;
+ _CharT _M_escape;
+ };
+
+ /**
+ * @brief Inserter for delimited strings.
+ * The left and right delimiters can be different.
+ */
+ template<typename _CharT, typename _Traits>
+ auto&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const _Quoted_string<const _CharT*, _CharT>& __str)
+ {
+ __os << __str._M_delim;
+ for (const _CharT* __c = __str._M_string; *__c; ++__c)
+ {
+ if (*__c == __str._M_delim || *__c == __str._M_escape)
+ __os << __str._M_escape;
+ __os << *__c;
+ }
+ __os << __str._M_delim;
+
+ return __os;
+ }
+
+ /**
+ * @brief Inserter for delimited strings.
+ * The left and right delimiters can be different.
+ */
+ template<typename _CharT, typename _Traits, typename _String>
+ auto&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const _Quoted_string<_String, _CharT>& __str)
+ {
+ __os << __str._M_delim;
+ for (auto& __c : __str._M_string)
+ {
+ if (__c == __str._M_delim || __c == __str._M_escape)
+ __os << __str._M_escape;
+ __os << __c;
+ }
+ __os << __str._M_delim;
+
+ return __os;
+ }
+
+ /**
+ * @brief Extractor for delimited strings.
+ * The left and right delimiters can be different.
+ */
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ auto&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is,
+ const _Quoted_string<basic_string<_CharT, _Traits, _Alloc>&,
+ _CharT>& __str)
+ {
+ __str._M_string.clear();
+
+ _CharT __c;
+ __is >> __c;
+ if (!__is.good())
+ return __is;
+ if (__c != __str._M_delim)
+ {
+ __is.unget();
+ __is >> __str._M_string;
+ return __is;
+ }
+ std::ios_base::fmtflags __flags
+ = __is.flags(__is.flags() & ~std::ios_base::skipws);
+ do
+ {
+ __is >> __c;
+ if (!__is.good())
+ break;
+ if (__c == __str._M_escape)
+ {
+ __is >> __c;
+ if (!__is.good())
+ break;
+ }
+ else if (__c == __str._M_delim)
+ break;
+ __str._M_string += __c;
+ }
+ while (true);
+ __is.setf(__flags);
+
+ return __is;
+ }
+
+ } // namespace __detail
+
+ /**
+ * @brief Manipulator for quoted strings.
+ * @param __str String to quote.
+ * @param __delim Character to quote string with.
+ * @param __escape Escape character to escape itself or quote character.
+ */
+ template<typename _CharT>
+ inline auto
+ quoted(const _CharT* __string,
+ _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
+ {
+ return __detail::_Quoted_string<const _CharT*, _CharT>(__string, __delim,
+ __escape);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline auto
+ quoted(const basic_string<_CharT, _Traits, _Alloc>& __string,
+ _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
+ {
+ return __detail::_Quoted_string<
+ const basic_string<_CharT, _Traits, _Alloc>&, _CharT>(
+ __string, __delim, __escape);
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline auto
+ quoted(basic_string<_CharT, _Traits, _Alloc>& __string,
+ _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
+ {
+ return __detail::_Quoted_string<
+ basic_string<_CharT, _Traits, _Alloc>&, _CharT>(
+ __string, __delim, __escape);
+ }
+
+#endif // __cplusplus > 201103L
+
+#endif // __cplusplus >= 201103L
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 3c666c19e50..cdd05a37cbe 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -783,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__set_once_functor_lock_ptr(&__functor_lock);
#endif
- int __e = __gthread_once(&(__once._M_once), &__once_proxy);
+ int __e = __gthread_once(&__once._M_once, &__once_proxy);
#ifndef _GLIBCXX_HAVE_TLS
if (__functor_lock)
diff --git a/libstdc++-v3/include/std/shared_mutex b/libstdc++-v3/include/std/shared_mutex
new file mode 100644
index 00000000000..39ab83a2845
--- /dev/null
+++ b/libstdc++-v3/include/std/shared_mutex
@@ -0,0 +1,437 @@
+// <shared_mutex> -*- C++ -*-
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file include/shared_mutex
+ * This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_SHARED_MUTEX
+#define _GLIBCXX_SHARED_MUTEX 1
+
+#pragma GCC system_header
+
+#if __cplusplus <= 201103L
+# include <bits/c++14_warning.h>
+#else
+
+#include <bits/c++config.h>
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+# include <mutex>
+# include <condition_variable>
+#endif
+#include <bits/functexcept.h>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ /**
+ * @ingroup mutexes
+ * @{
+ */
+
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+ /// shared_mutex
+ class shared_mutex
+ {
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+ struct _Mutex : mutex
+ {
+ typedef chrono::steady_clock __clock_t;
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ { return __try_lock_for_impl(__rtime); }
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+ chrono::time_point<_Clock, chrono::seconds> __s =
+ chrono::time_point_cast<chrono::seconds>(__atime);
+
+ chrono::nanoseconds __ns =
+ chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+ __gthread_time_t __ts = {
+ static_cast<std::time_t>(__s.time_since_epoch().count()),
+ static_cast<long>(__ns.count())
+ };
+
+ return !__gthread_mutex_timedlock(native_handle(), &__ts);
+ }
+
+ private:
+ template<typename _Rep, typename _Period>
+ typename enable_if<
+ ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+
+ template <typename _Rep, typename _Period>
+ typename enable_if<
+ !ratio_less_equal<__clock_t::period, _Period>::value, bool>::type
+ __try_lock_for_impl(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+ __clock_t::time_point __atime = __clock_t::now()
+ + ++chrono::duration_cast<__clock_t::duration>(__rtime);
+
+ return try_lock_until(__atime);
+ }
+ };
+#else
+ typedef mutex _Mutex;
+#endif
+
+ // Based on Howard Hinnant's reference implementation from N2406
+
+ _Mutex _M_mut;
+ condition_variable _M_gate1;
+ condition_variable _M_gate2;
+ unsigned _M_state;
+
+ static constexpr unsigned _S_write_entered
+ = 1U << (sizeof(unsigned)*__CHAR_BIT__ - 1);
+ static constexpr unsigned _M_n_readers = ~_S_write_entered;
+
+ public:
+ shared_mutex() : _M_state(0) {}
+
+ ~shared_mutex()
+ {
+ _GLIBCXX_DEBUG_ASSERT( _M_state == 0 );
+ }
+
+ shared_mutex(const shared_mutex&) = delete;
+ shared_mutex& operator=(const shared_mutex&) = delete;
+
+ // Exclusive ownership
+
+ void
+ lock()
+ {
+ unique_lock<mutex> __lk(_M_mut);
+ while (_M_state & _S_write_entered)
+ _M_gate1.wait(__lk);
+ _M_state |= _S_write_entered;
+ while (_M_state & _M_n_readers)
+ _M_gate2.wait(__lk);
+ }
+
+ bool
+ try_lock()
+ {
+ unique_lock<mutex> __lk(_M_mut, try_to_lock);
+ if (__lk.owns_lock() && _M_state == 0)
+ {
+ _M_state = _S_write_entered;
+ return true;
+ }
+ return false;
+ }
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
+ {
+ unique_lock<_Mutex> __lk(_M_mut, __rel_time);
+ if (__lk.owns_lock() && _M_state == 0)
+ {
+ _M_state = _S_write_entered;
+ return true;
+ }
+ return false;
+ }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
+ {
+ unique_lock<_Mutex> __lk(_M_mut, __abs_time);
+ if (__lk.owns_lock() && _M_state == 0)
+ {
+ _M_state = _S_write_entered;
+ return true;
+ }
+ return false;
+ }
+#endif
+
+ void
+ unlock()
+ {
+ {
+ lock_guard<_Mutex> __lk(_M_mut);
+ _M_state = 0;
+ }
+ _M_gate1.notify_all();
+ }
+
+ // Shared ownership
+
+ void
+ lock_shared()
+ {
+ unique_lock<mutex> __lk(_M_mut);
+ while ((_M_state & _S_write_entered)
+ || (_M_state & _M_n_readers) == _M_n_readers)
+ {
+ _M_gate1.wait(__lk);
+ }
+ unsigned __num_readers = (_M_state & _M_n_readers) + 1;
+ _M_state &= ~_M_n_readers;
+ _M_state |= __num_readers;
+ }
+
+ bool
+ try_lock_shared()
+ {
+ unique_lock<_Mutex> __lk(_M_mut, try_to_lock);
+ unsigned __num_readers = _M_state & _M_n_readers;
+ if (__lk.owns_lock() && !(_M_state & _S_write_entered)
+ && __num_readers != _M_n_readers)
+ {
+ ++__num_readers;
+ _M_state &= ~_M_n_readers;
+ _M_state |= __num_readers;
+ return true;
+ }
+ return false;
+ }
+
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time)
+ {
+ unique_lock<_Mutex> __lk(_M_mut, __rel_time);
+ if (__lk.owns_lock())
+ {
+ unsigned __num_readers = _M_state & _M_n_readers;
+ if (!(_M_state & _S_write_entered)
+ && __num_readers != _M_n_readers)
+ {
+ ++__num_readers;
+ _M_state &= ~_M_n_readers;
+ _M_state |= __num_readers;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ template <typename _Clock, typename _Duration>
+ bool
+ try_lock_shared_until(const chrono::time_point<_Clock,
+ _Duration>& __abs_time)
+ {
+ unique_lock<_Mutex> __lk(_M_mut, __abs_time);
+ if (__lk.owns_lock())
+ {
+ unsigned __num_readers = _M_state & _M_n_readers;
+ if (!(_M_state & _S_write_entered)
+ && __num_readers != _M_n_readers)
+ {
+ ++__num_readers;
+ _M_state &= ~_M_n_readers;
+ _M_state |= __num_readers;
+ return true;
+ }
+ }
+ return false;
+ }
+#endif
+
+ void
+ unlock_shared()
+ {
+ lock_guard<_Mutex> __lk(_M_mut);
+ unsigned __num_readers = (_M_state & _M_n_readers) - 1;
+ _M_state &= ~_M_n_readers;
+ _M_state |= __num_readers;
+ if (_M_state & _S_write_entered)
+ {
+ if (__num_readers == 0)
+ _M_gate2.notify_one();
+ }
+ else
+ {
+ if (__num_readers == _M_n_readers - 1)
+ _M_gate1.notify_one();
+ }
+ }
+ };
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+
+ /// shared_lock
+ template<typename _Mutex>
+ class shared_lock
+ {
+ public:
+ typedef _Mutex mutex_type;
+
+ // Shared locking
+
+ shared_lock() noexcept : _M_pm(nullptr), _M_owns(false) { }
+
+ explicit
+ shared_lock(mutex_type& __m) : _M_pm(&__m), _M_owns(true)
+ { __m.lock_shared(); }
+
+ shared_lock(mutex_type& __m, defer_lock_t) noexcept
+ : _M_pm(&__m), _M_owns(false) { }
+
+ shared_lock(mutex_type& __m, try_to_lock_t)
+ : _M_pm(&__m), _M_owns(__m.try_lock_shared()) { }
+
+ shared_lock(mutex_type& __m, adopt_lock_t)
+ : _M_pm(&__m), _M_owns(true) { }
+
+ template<typename _Clock, typename _Duration>
+ shared_lock(mutex_type& __m,
+ const chrono::time_point<_Clock, _Duration>& __abs_time)
+ : _M_pm(&__m), _M_owns(__m.try_lock_shared_until(__abs_time)) { }
+
+ template<typename _Rep, typename _Period>
+ shared_lock(mutex_type& __m,
+ const chrono::duration<_Rep, _Period>& __rel_time)
+ : _M_pm(&__m), _M_owns(__m.try_lock_shared_for(__rel_time)) { }
+
+ ~shared_lock()
+ {
+ if (_M_owns)
+ _M_pm->unlock_shared();
+ }
+
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
+
+ shared_lock(shared_lock&& __sl) noexcept : shared_lock()
+ { swap(__sl); }
+
+ shared_lock&
+ operator=(shared_lock&& __sl) noexcept
+ {
+ shared_lock(std::move(__sl)).swap(*this);
+ return *this;
+ }
+
+ void
+ lock()
+ {
+ _M_lockable();
+ _M_pm->lock_shared();
+ _M_owns = true;
+ }
+
+ bool
+ try_lock()
+ {
+ _M_lockable();
+ return _M_owns = _M_pm->try_lock_shared();
+ }
+
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
+ {
+ _M_lockable();
+ return _M_owns = _M_pm->try_lock_shared_for(__rel_time);
+ }
+
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
+ {
+ _M_lockable();
+ return _M_owns = _M_pm->try_lock_shared_until(__abs_time);
+ }
+
+ void
+ unlock()
+ {
+ if (!_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ _M_pm->unlock_shared();
+ _M_owns = false;
+ }
+
+ // Setters
+
+ void
+ swap(shared_lock& __u) noexcept
+ {
+ std::swap(_M_pm, __u._M_pm);
+ std::swap(_M_owns, __u._M_owns);
+ }
+
+ mutex_type*
+ release() noexcept
+ {
+ _M_owns = false;
+ return std::exchange(_M_pm, nullptr);
+ }
+
+ // Getters
+
+ bool owns_lock() const noexcept { return _M_owns; }
+
+ explicit operator bool() const noexcept { return _M_owns; }
+
+ mutex_type* mutex() const noexcept { return _M_pm; }
+
+ private:
+ void
+ _M_lockable() const
+ {
+ if (_M_pm == nullptr)
+ __throw_system_error(int(errc::operation_not_permitted));
+ if (_M_owns)
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
+ }
+
+ mutex_type* _M_pm;
+ bool _M_owns;
+ };
+
+ /// Swap specialization for shared_lock
+ template<typename _Mutex>
+ void
+ swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept
+ { __x.swap(__y); }
+
+ // @} group mutexes
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+#endif // C++14
+
+#endif // _GLIBCXX_SHARED_MUTEX
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 69f5bd1f72f..063ce02e9c7 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -856,25 +856,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
template<typename... _TElements, typename... _UElements>
- inline constexpr bool
+ constexpr bool
operator!=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__t == __u); }
template<typename... _TElements, typename... _UElements>
- inline constexpr bool
+ constexpr bool
operator>(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return __u < __t; }
template<typename... _TElements, typename... _UElements>
- inline constexpr bool
+ constexpr bool
operator<=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__u < __t); }
template<typename... _TElements, typename... _UElements>
- inline constexpr bool
+ constexpr bool
operator>=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__t < __u); }
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index a0a8327bec5..eef9df6998c 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -60,6 +60,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
constexpr operator value_type() const { return value; }
+#if __cplusplus > 201103L
+ constexpr value_type operator()() const { return value; }
+#endif
};
template<typename _Tp, _Tp __v>
@@ -374,33 +377,97 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes......)>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes...) const>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes......) const>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes...) volatile>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) volatile &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) volatile &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes......) volatile>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) volatile &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) volatile &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes...) const volatile>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const volatile &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes...) const volatile &&>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes......) const volatile>
: public true_type { };
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const volatile &>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct is_function<_Res(_ArgTypes......) const volatile &&>
+ : public true_type { };
+
template<typename>
struct __is_null_pointer_helper
: public false_type { };
@@ -479,6 +546,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
{ };
+ // Utility to detect referenceable types ([defns.referenceable]).
+
+ template<typename _Tp>
+ struct __is_referenceable
+ : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
+ { };
+
+ template<typename _Res, typename... _Args>
+ struct __is_referenceable<_Res(_Args...)>
+ : public true_type
+ { };
+
+ template<typename _Res, typename... _Args>
+ struct __is_referenceable<_Res(_Args......)>
+ : public true_type
+ { };
+
// Type properties.
/// is_const
@@ -944,15 +1028,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_constructible_impl<_Tp, _Args...>::type
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_copy_constructible_impl;
template<typename _Tp>
- struct __is_copy_constructible_impl<_Tp, true>
+ struct __is_copy_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_copy_constructible_impl<_Tp, false>
+ struct __is_copy_constructible_impl<_Tp, true>
: public is_constructible<_Tp, const _Tp&>
{ };
@@ -962,15 +1046,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_copy_constructible_impl<_Tp>
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_move_constructible_impl;
template<typename _Tp>
- struct __is_move_constructible_impl<_Tp, true>
+ struct __is_move_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_move_constructible_impl<_Tp, false>
+ struct __is_move_constructible_impl<_Tp, true>
: public is_constructible<_Tp, _Tp&&>
{ };
@@ -1030,15 +1114,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__is_nt_constructible_impl<_Tp, _Args...>>::type
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nothrow_copy_constructible_impl;
template<typename _Tp>
- struct __is_nothrow_copy_constructible_impl<_Tp, true>
+ struct __is_nothrow_copy_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_nothrow_copy_constructible_impl<_Tp, false>
+ struct __is_nothrow_copy_constructible_impl<_Tp, true>
: public is_nothrow_constructible<_Tp, const _Tp&>
{ };
@@ -1048,15 +1132,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_nothrow_copy_constructible_impl<_Tp>
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nothrow_move_constructible_impl;
template<typename _Tp>
- struct __is_nothrow_move_constructible_impl<_Tp, true>
+ struct __is_nothrow_move_constructible_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_nothrow_move_constructible_impl<_Tp, false>
+ struct __is_nothrow_move_constructible_impl<_Tp, true>
: public is_nothrow_constructible<_Tp, _Tp&&>
{ };
@@ -1088,15 +1172,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_assignable_helper<_Tp, _Up>::type
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_copy_assignable_impl;
template<typename _Tp>
- struct __is_copy_assignable_impl<_Tp, true>
+ struct __is_copy_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_copy_assignable_impl<_Tp, false>
+ struct __is_copy_assignable_impl<_Tp, true>
: public is_assignable<_Tp&, const _Tp&>
{ };
@@ -1106,15 +1190,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_copy_assignable_impl<_Tp>
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_move_assignable_impl;
template<typename _Tp>
- struct __is_move_assignable_impl<_Tp, true>
+ struct __is_move_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_move_assignable_impl<_Tp, false>
+ struct __is_move_assignable_impl<_Tp, true>
: public is_assignable<_Tp&, _Tp&&>
{ };
@@ -1136,15 +1220,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__is_nt_assignable_impl<_Tp, _Up>>::type
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nt_copy_assignable_impl;
template<typename _Tp>
- struct __is_nt_copy_assignable_impl<_Tp, true>
+ struct __is_nt_copy_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_nt_copy_assignable_impl<_Tp, false>
+ struct __is_nt_copy_assignable_impl<_Tp, true>
: public is_nothrow_assignable<_Tp&, const _Tp&>
{ };
@@ -1154,15 +1238,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __is_nt_copy_assignable_impl<_Tp>
{ };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __is_nt_move_assignable_impl;
template<typename _Tp>
- struct __is_nt_move_assignable_impl<_Tp, true>
+ struct __is_nt_move_assignable_impl<_Tp, false>
: public false_type { };
template<typename _Tp>
- struct __is_nt_move_assignable_impl<_Tp, false>
+ struct __is_nt_move_assignable_impl<_Tp, true>
: public is_nothrow_assignable<_Tp&, _Tp&&>
{ };
@@ -1370,30 +1454,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct remove_reference<_Tp&&>
{ typedef _Tp type; };
- template<typename _Tp,
- bool = __and_<__not_<is_reference<_Tp>>,
- __not_<is_void<_Tp>>>::value,
- bool = is_rvalue_reference<_Tp>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __add_lvalue_reference_helper
{ typedef _Tp type; };
template<typename _Tp>
- struct __add_lvalue_reference_helper<_Tp, true, false>
+ struct __add_lvalue_reference_helper<_Tp, true>
{ typedef _Tp& type; };
- template<typename _Tp>
- struct __add_lvalue_reference_helper<_Tp, false, true>
- { typedef typename remove_reference<_Tp>::type& type; };
-
/// add_lvalue_reference
template<typename _Tp>
struct add_lvalue_reference
: public __add_lvalue_reference_helper<_Tp>
{ };
- template<typename _Tp,
- bool = __and_<__not_<is_reference<_Tp>>,
- __not_<is_void<_Tp>>>::value>
+ template<typename _Tp, bool = __is_referenceable<_Tp>::value>
struct __add_rvalue_reference_helper
{ typedef _Tp type; };
@@ -1651,10 +1726,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ };
/// add_pointer
+ template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
+ is_void<_Tp>>::value>
+ struct __add_pointer_helper
+ { typedef _Tp type; };
+
template<typename _Tp>
- struct add_pointer
+ struct __add_pointer_helper<_Tp, true>
{ typedef typename remove_reference<_Tp>::type* type; };
+ template<typename _Tp>
+ struct add_pointer
+ : public __add_pointer_helper<_Tp>
+ { };
+
template<std::size_t _Len>
struct __aligned_storage_msa
@@ -1735,12 +1820,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _Tp>
- struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
- {
- typedef _Tp& __type;
- };
-
- template<typename _Tp>
struct __decay_and_strip
{
typedef typename __strip_reference_wrapper<
diff --git a/libstdc++-v3/include/tr1/modified_bessel_func.tcc b/libstdc++-v3/include/tr1/modified_bessel_func.tcc
index 3d1fb904a03..146d932de2f 100644
--- a/libstdc++-v3/include/tr1/modified_bessel_func.tcc
+++ b/libstdc++-v3/include/tr1/modified_bessel_func.tcc
@@ -357,12 +357,13 @@ namespace tr1
* derivatives @f$ Ai'(x) @f$ and @f$ Bi(x) @f$
* respectively.
*
- * @param __n The order of the Airy functions.
* @param __x The argument of the Airy functions.
- * @param __i_n The output Airy function.
- * @param __k_n The output Airy function.
- * @param __ip_n The output derivative of the Airy function.
- * @param __kp_n The output derivative of the Airy function.
+ * @param __Ai The output Airy function of the first kind.
+ * @param __Bi The output Airy function of the second kind.
+ * @param __Aip The output derivative of the Airy function
+ * of the first kind.
+ * @param __Bip The output derivative of the Airy function
+ * of the second kind.
*/
template <typename _Tp>
void
@@ -372,9 +373,7 @@ namespace tr1
const _Tp __rootx = std::sqrt(__absx);
const _Tp __z = _Tp(2) * __absx * __rootx / _Tp(3);
- if (__isnan(__x))
- return std::numeric_limits<_Tp>::quiet_NaN();
- else if (__x > _Tp(0))
+ if (__x > _Tp(0))
{
_Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index 0a76e5f3986..4fdd9f44387 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -26,7 +26,7 @@ include $(top_srcdir)/fragment.am
# separately too.
# 1) separate libsupc++.la
if ENABLE_VTABLE_VERIFY
-toolexeclib_LTLIBRARIES = libsupc++.la libvtv_init.la libvtv_stubs.la
+toolexeclib_LTLIBRARIES = libsupc++.la libvtv.la libvtv_stubs.la
else
toolexeclib_LTLIBRARIES = libsupc++.la
endif
@@ -101,18 +101,19 @@ sources = \
vterminate.cc
if ENABLE_VTABLE_VERIFY
+
sources += \
+ vtv_fail.cc
+
+ vtv_sources = \
vtv_rts.cc \
vtv_malloc.cc \
vtv_utils.cc
- vtv_init_sources = \
- vtv_init.cc
-
vtv_stubs_sources = \
vtv_stubs.cc
- libvtv_init_la_SOURCES = $(vtv_init_sources)
+ libvtv_la_SOURCES = $(vtv_sources)
libvtv_stubs_la_SOURCES = $(vtv_stubs_sources)
endif
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index ed5516ef866..f9386c43973 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -39,9 +39,7 @@ target_triplet = @target@
DIST_COMMON = $(top_srcdir)/fragment.am $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(bits_HEADERS) $(std_HEADERS)
@ENABLE_VTABLE_VERIFY_TRUE@am__append_1 = \
-@ENABLE_VTABLE_VERIFY_TRUE@ vtv_rts.cc \
-@ENABLE_VTABLE_VERIFY_TRUE@ vtv_malloc.cc \
-@ENABLE_VTABLE_VERIFY_TRUE@ vtv_utils.cc
+@ENABLE_VTABLE_VERIFY_TRUE@ vtv_fail.cc
subdir = libsupc++
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -96,8 +94,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bitsdir)" \
"$(DESTDIR)$(stddir)"
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
libsupc___la_LIBADD =
-@ENABLE_VTABLE_VERIFY_TRUE@am__objects_1 = vtv_rts.lo vtv_malloc.lo \
-@ENABLE_VTABLE_VERIFY_TRUE@ vtv_utils.lo
+@ENABLE_VTABLE_VERIFY_TRUE@am__objects_1 = vtv_fail.lo
am__objects_2 = array_type_info.lo atexit_arm.lo atexit_thread.lo \
bad_alloc.lo bad_array_length.lo bad_array_new.lo bad_cast.lo \
bad_typeid.lo class_type_info.lo del_op.lo del_opnt.lo \
@@ -123,12 +120,12 @@ libsupc__convenience_la_LIBADD =
am_libsupc__convenience_la_OBJECTS = $(am__objects_2) $(am__objects_3)
libsupc__convenience_la_OBJECTS = \
$(am_libsupc__convenience_la_OBJECTS)
-libvtv_init_la_LIBADD =
-@ENABLE_VTABLE_VERIFY_TRUE@am__objects_4 = vtv_init.lo
-@ENABLE_VTABLE_VERIFY_TRUE@am_libvtv_init_la_OBJECTS = \
-@ENABLE_VTABLE_VERIFY_TRUE@ $(am__objects_4)
-libvtv_init_la_OBJECTS = $(am_libvtv_init_la_OBJECTS)
-@ENABLE_VTABLE_VERIFY_TRUE@am_libvtv_init_la_rpath = -rpath \
+libvtv_la_LIBADD =
+@ENABLE_VTABLE_VERIFY_TRUE@am__objects_4 = vtv_rts.lo vtv_malloc.lo \
+@ENABLE_VTABLE_VERIFY_TRUE@ vtv_utils.lo
+@ENABLE_VTABLE_VERIFY_TRUE@am_libvtv_la_OBJECTS = $(am__objects_4)
+libvtv_la_OBJECTS = $(am_libvtv_la_OBJECTS)
+@ENABLE_VTABLE_VERIFY_TRUE@am_libvtv_la_rpath = -rpath \
@ENABLE_VTABLE_VERIFY_TRUE@ $(toolexeclibdir)
libvtv_stubs_la_LIBADD =
@ENABLE_VTABLE_VERIFY_TRUE@am__objects_5 = vtv_stubs.lo
@@ -150,7 +147,7 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
SOURCES = $(libsupc___la_SOURCES) $(libsupc__convenience_la_SOURCES) \
- $(libvtv_init_la_SOURCES) $(libvtv_stubs_la_SOURCES)
+ $(libvtv_la_SOURCES) $(libvtv_stubs_la_SOURCES)
HEADERS = $(bits_HEADERS) $(std_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -361,7 +358,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
@@ -383,7 +380,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# Need this library to both be part of libstdc++.a, and installed
# separately too.
# 1) separate libsupc++.la
-@ENABLE_VTABLE_VERIFY_TRUE@toolexeclib_LTLIBRARIES = libsupc++.la libvtv_init.la libvtv_stubs.la
+@ENABLE_VTABLE_VERIFY_TRUE@toolexeclib_LTLIBRARIES = libsupc++.la libvtv.la libvtv_stubs.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
std_HEADERS = \
@@ -411,13 +408,15 @@ sources = array_type_info.cc atexit_arm.cc atexit_thread.cc \
pointer_type_info.cc pure.cc si_class_type_info.cc tinfo.cc \
tinfo2.cc vec.cc vmi_class_type_info.cc vterminate.cc \
$(am__append_1)
-@ENABLE_VTABLE_VERIFY_TRUE@vtv_init_sources = \
-@ENABLE_VTABLE_VERIFY_TRUE@ vtv_init.cc
+@ENABLE_VTABLE_VERIFY_TRUE@vtv_sources = \
+@ENABLE_VTABLE_VERIFY_TRUE@ vtv_rts.cc \
+@ENABLE_VTABLE_VERIFY_TRUE@ vtv_malloc.cc \
+@ENABLE_VTABLE_VERIFY_TRUE@ vtv_utils.cc
@ENABLE_VTABLE_VERIFY_TRUE@vtv_stubs_sources = \
@ENABLE_VTABLE_VERIFY_TRUE@ vtv_stubs.cc
-@ENABLE_VTABLE_VERIFY_TRUE@libvtv_init_la_SOURCES = $(vtv_init_sources)
+@ENABLE_VTABLE_VERIFY_TRUE@libvtv_la_SOURCES = $(vtv_sources)
@ENABLE_VTABLE_VERIFY_TRUE@libvtv_stubs_la_SOURCES = $(vtv_stubs_sources)
libsupc___la_SOURCES = $(sources) $(c_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
@@ -582,8 +581,8 @@ libsupc++.la: $(libsupc___la_OBJECTS) $(libsupc___la_DEPENDENCIES)
$(CXXLINK) $(am_libsupc___la_rpath) $(libsupc___la_OBJECTS) $(libsupc___la_LIBADD) $(LIBS)
libsupc++convenience.la: $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_DEPENDENCIES)
$(CXXLINK) $(libsupc__convenience_la_OBJECTS) $(libsupc__convenience_la_LIBADD) $(LIBS)
-libvtv_init.la: $(libvtv_init_la_OBJECTS) $(libvtv_init_la_DEPENDENCIES)
- $(CXXLINK) $(am_libvtv_init_la_rpath) $(libvtv_init_la_OBJECTS) $(libvtv_init_la_LIBADD) $(LIBS)
+libvtv.la: $(libvtv_la_OBJECTS) $(libvtv_la_DEPENDENCIES)
+ $(CXXLINK) $(am_libvtv_la_rpath) $(libvtv_la_OBJECTS) $(libvtv_la_LIBADD) $(LIBS)
libvtv_stubs.la: $(libvtv_stubs_la_OBJECTS) $(libvtv_stubs_la_DEPENDENCIES)
$(CXXLINK) $(am_libvtv_stubs_la_rpath) $(libvtv_stubs_la_OBJECTS) $(libvtv_stubs_la_LIBADD) $(LIBS)
diff --git a/libstdc++-v3/libsupc++/vtv_fail.cc b/libstdc++-v3/libsupc++/vtv_fail.cc
new file mode 100644
index 00000000000..4f183d8cac2
--- /dev/null
+++ b/libstdc++-v3/libsupc++/vtv_fail.cc
@@ -0,0 +1,233 @@
+/* Copyright (C) 2012-2013
+ Free Software Foundation
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file is part of the vtable security feature implementation.
+ The vtable security feature is designed to detect when a virtual
+ call is about to be made through an invalid vtable pointer
+ (possibly due to data corruption or malicious attacks).
+
+ This file also contains the failure functions that get called when
+ a vtable pointer is not found in the data set. Two particularly
+ important functions are __vtv_verify_fail and __vtv_really_fail.
+ They are both externally visible. __vtv_verify_fail is defined in
+ such a way that it can be replaced by a programmer, if desired. It
+ is the function that __VLTVerifyVtablePointer calls if it can't
+ find the pointer in the data set. Allowing the programmer to
+ overwrite this function means that he/she can do some alternate
+ verification, including NOT failing in certain specific cases, if
+ desired. This may be the case if the programmer has to deal wtih
+ unverified third party software, for example. __vtv_really_fail is
+ available for the programmer to call from his version of
+ __vtv_verify_fail, if he decides the failure is real.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <execinfo.h>
+#include <unistd.h>
+
+#include "vtv_utils.h"
+#include "vtv_fail.h"
+
+/* This is used to disable aborts for debugging purposes. */
+bool vtv_no_abort = false;
+
+
+extern "C" {
+
+ /* __fortify_fail is a function in glibc that calls __libc_message,
+ causing it to print out a program termination error message
+ (including the name of the binary being terminated), a stack
+ trace where the error occurred, and a memory map dump. Ideally
+ we would have called __libc_message directly, but that function
+ does not appear to be accessible to functions outside glibc,
+ whereas __fortify_fail is. We call __fortify_fail from
+ __vtv_really_fail. We looked at calling __libc_fatal, which is
+ externally accessible, but it does not do the back trace and
+ memory dump. */
+
+ extern void __fortify_fail (const char *) __attribute__((noreturn));
+
+} /* extern "C" */
+
+const unsigned long SET_HANDLE_HANDLE_BIT = 0x2;
+
+/* Instantiate the template classes (in vtv_set.h) for our particular
+ hash table needs. */
+typedef void * vtv_set_handle;
+typedef vtv_set_handle * vtv_set_handle_handle;
+
+static int vtv_failures_log_fd = -1;
+
+/* Open error logging file, if not already open, and write vtable
+ verification failure messages (LOG_MSG) to the log file. Also
+ generate a backtrace in the log file, if GENERATE_BACKTRACE is
+ set. */
+
+static void
+log_error_message (const char *log_msg, bool generate_backtrace)
+{
+ if (vtv_failures_log_fd == -1)
+ vtv_failures_log_fd = vtv_open_log ("vtable_verification_failures.log");
+
+ if (vtv_failures_log_fd == -1)
+ return;
+
+ vtv_add_to_log (vtv_failures_log_fd, "%s", log_msg);
+
+ if (generate_backtrace)
+ {
+#define STACK_DEPTH 20
+ void *callers[STACK_DEPTH];
+ int actual_depth = backtrace (callers, STACK_DEPTH);
+ backtrace_symbols_fd (callers, actual_depth, vtv_failures_log_fd);
+ }
+}
+
+/* In the case where a vtable map variable is the only instance of the
+ variable we have seen, it points directly to the set of valid
+ vtable pointers. All subsequent instances of the 'same' vtable map
+ variable point to the first vtable map variable. This function,
+ given a vtable map variable PTR, checks a bit to see whether it's
+ pointing directly to the data set or to the first vtable map
+ variable. */
+
+static inline bool
+is_set_handle_handle (void * ptr)
+{
+ return ((unsigned long) ptr & SET_HANDLE_HANDLE_BIT)
+ == SET_HANDLE_HANDLE_BIT;
+}
+
+/* Returns the actual pointer value of a vtable map variable, PTR (see
+ comments for is_set_handle_handle for more details). */
+
+static inline vtv_set_handle *
+ptr_from_set_handle_handle (void * ptr)
+{
+ return (vtv_set_handle *) ((unsigned long) ptr & ~SET_HANDLE_HANDLE_BIT);
+}
+
+/* Given a vtable map variable, PTR, this function sets the bit that
+ says this is the second (or later) instance of a vtable map
+ variable. */
+
+static inline vtv_set_handle_handle
+set_handle_handle (vtv_set_handle * ptr)
+{
+ return (vtv_set_handle_handle) ((unsigned long) ptr | SET_HANDLE_HANDLE_BIT);
+}
+
+/* This function is called from __VLTVerifyVtablePointerDebug; it
+ sends as much debugging information as it can to the error log
+ file, then calls __vtv_verify_fail. SET_HANDLE_PTR is the pointer
+ to the set of valid vtable pointers, VTBL_PTR is the pointer that
+ was not found in the set, and DEBUG_MSG is the message to be
+ written to the log file before failing. n */
+
+void
+__vtv_verify_fail_debug (void **set_handle_ptr, const void *vtbl_ptr,
+ const char *debug_msg)
+{
+ log_error_message (debug_msg, false);
+
+ /* Call the public interface in case it has been overwritten by
+ user. */
+ __vtv_verify_fail (set_handle_ptr, vtbl_ptr);
+
+ log_error_message ("Returned from __vtv_verify_fail."
+ " Secondary verification succeeded.\n", false);
+}
+
+/* This function calls __fortify_fail with a FAILURE_MSG and then
+ calls abort. */
+
+void
+__vtv_really_fail (const char *failure_msg)
+{
+ __fortify_fail (failure_msg);
+
+ /* We should never get this far; __fortify_fail calls __libc_message
+ which prints out a back trace and a memory dump and then is
+ supposed to call abort, but let's play it safe anyway and call abort
+ ourselves. */
+ abort ();
+}
+
+/* This function takes an error MSG, a vtable map variable
+ (DATA_SET_PTR) and a vtable pointer (VTBL_PTR). It is called when
+ an attempt to verify VTBL_PTR with the set pointed to by
+ DATA_SET_PTR failed. It outputs a failure message with the
+ addresses involved, and calls __vtv_really_fail. */
+
+static void
+vtv_fail (const char *msg, void **data_set_ptr, const void *vtbl_ptr)
+{
+ char buffer[128];
+ int buf_len;
+ const char *format_str =
+ "*** Unable to verify vtable pointer (%p) in set (%p) *** \n";
+
+ snprintf (buffer, sizeof (buffer), format_str, vtbl_ptr,
+ is_set_handle_handle(*data_set_ptr) ?
+ ptr_from_set_handle_handle (*data_set_ptr) :
+ *data_set_ptr);
+ buf_len = strlen (buffer);
+ /* Send this to to stderr. */
+ write (2, buffer, buf_len);
+
+ if (!vtv_no_abort)
+ __vtv_really_fail (msg);
+}
+
+/* Send information about what we were trying to do when verification
+ failed to the error log, then call vtv_fail. This function can be
+ overwritten/replaced by the user, to implement a secondary
+ verification function instead. DATA_SET_PTR is the vtable map
+ variable used for the failed verification, and VTBL_PTR is the
+ vtable pointer that was not found in the set. */
+
+void
+__vtv_verify_fail (void **data_set_ptr, const void *vtbl_ptr)
+{
+ char log_msg[256];
+ snprintf (log_msg, sizeof (log_msg), "Looking for vtable %p in set %p.\n",
+ vtbl_ptr,
+ is_set_handle_handle (*data_set_ptr) ?
+ ptr_from_set_handle_handle (*data_set_ptr) :
+ *data_set_ptr);
+ log_error_message (log_msg, false);
+
+ const char *format_str =
+ "*** Unable to verify vtable pointer (%p) in set (%p) *** \n";
+ snprintf (log_msg, sizeof (log_msg), format_str, vtbl_ptr, *data_set_ptr);
+ log_error_message (log_msg, false);
+ log_error_message (" Backtrace: \n", true);
+
+ const char *fail_msg = "Potential vtable pointer corruption detected!!\n";
+ vtv_fail (fail_msg, data_set_ptr, vtbl_ptr);
+}
+
diff --git a/libstdc++-v3/libsupc++/vtv_fail.h b/libstdc++-v3/libsupc++/vtv_fail.h
index 79f3285e68b..ff525b919a9 100644
--- a/libstdc++-v3/libsupc++/vtv_fail.h
+++ b/libstdc++-v3/libsupc++/vtv_fail.h
@@ -50,4 +50,9 @@ extern void
__vtv_verify_fail (void **data_set_ptr, const void *vtbl_pointer)
__attribute__((visibility ("default")));
+extern void
+__vtv_verify_fail_debug (void **data_set_ptr, const void *vtbl_pointer,
+ const char *debug_msg)
+ __attribute__((visibility ("default")));
+
#endif /* _VTV_FAIL_H */
diff --git a/libstdc++-v3/libsupc++/vtv_rts.cc b/libstdc++-v3/libsupc++/vtv_rts.cc
index 199be4c0bbc..eb82eb42c8e 100644
--- a/libstdc++-v3/libsupc++/vtv_rts.cc
+++ b/libstdc++-v3/libsupc++/vtv_rts.cc
@@ -93,20 +93,6 @@
__VLTVerifyVtablePointerDebug, which have extra parameters in order
to make it easier to debug verification failures.
- This file also contains the failure functions that get called when
- a vtable pointer is not found in the data set. Two particularly
- important functions are __vtv_verify_fail and __vtv_really_fail.
- They are both externally visible. __vtv_verify_fail is defined in
- such a way that it can be replaced by a programmer, if desired. It
- is the function that __VLTVerifyVtablePointer calls if it can't
- find the pointer in the data set. Allowing the programmer to
- overwrite this function means that he/she can do some alternate
- verification, including NOT failing in certain specific cases, if
- desired. This may be the case if the programmer has to deal wtih
- unverified third party software, for example. __vtv_really_fail is
- available for the programmer to call from his version of
- __vtv_verify_fail, if he decides the failure is real.
-
The final piece of functionality implemented in this file is symbol
resolution for multiple instances of the same vtable map variable.
If the same virtual class is used in two different compilation
@@ -159,27 +145,6 @@
bool vtv_debug = false;
-/* This is used to disable aborts for debugging purposes. */
-bool vtv_no_abort = false;
-
-extern "C" {
-
- /* __fortify_fail is a function in glibc that calls __libc_message,
- causing it to print out a program termination error message
- (including the name of the binary being terminated), a stack
- trace where the error occurred, and a memory map dump. Ideally
- we would have called __libc_message directly, but that function
- does not appear to be accessible to functions outside glibc,
- whereas __fortify_fail is. We call __fortify_fail from
- __vtv_really_fail. We looked at calling __libc_fatal, which is
- externally accessible, but it does not do the back trace and
- memory dump. */
-
- extern void __fortify_fail (const char *) __attribute__((noreturn));
-
-} /* extern "C" */
-
-
/* The following variables are used only for debugging and performance
tuning purposes. Therefore they do not need to be "protected".
They cannot be used to attack the vtable verification system and if
@@ -1170,27 +1135,6 @@ __VLTRegisterPairDebug (void **set_handle_ptr, const void *set_symbol_key,
}
-/* This function is called from __VLTVerifyVtablePointerDebug; it
- sends as much debugging information as it can to the error log
- file, then calls __vtv_verify_fail. SET_HANDLE_PTR is the pointer
- to the set of valid vtable pointers, VTBL_PTR is the pointer that
- was not found in the set, and DEBUG_MSG is the message to be
- written to the log file before failing. n */
-
-static void
-__vtv_verify_fail_debug (void **set_handle_ptr, const void *vtbl_ptr,
- const char *debug_msg)
-{
- log_error_message (debug_msg, false);
-
- /* Call the public interface in case it has been overwritten by
- user. */
- __vtv_verify_fail (set_handle_ptr, vtbl_ptr);
-
- log_error_message ("Returned from __vtv_verify_fail."
- " Secondary verification succeeded.\n", false);
-}
-
/* This is the debug version of the verification function. It takes
the address of a vtable map variable (SET_HANDLE_PTR) and a
VTABLE_PTR to validate, as well as the name of the vtable map
@@ -1407,75 +1351,6 @@ __VLTVerifyVtablePointer (void ** set_handle_ptr, const void * vtable_ptr)
return vtable_ptr;
}
-/* This function calls __fortify_fail with a FAILURE_MSG and then
- calls abort. */
-
-void
-__vtv_really_fail (const char *failure_msg)
-{
- __fortify_fail (failure_msg);
-
- /* We should never get this far; __fortify_fail calls __libc_message
- which prints out a back trace and a memory dump and then is
- supposed to call abort, but let's play it safe anyway and call abort
- ourselves. */
- abort ();
-}
-
-/* This function takes an error MSG, a vtable map variable
- (DATA_SET_PTR) and a vtable pointer (VTBL_PTR). It is called when
- an attempt to verify VTBL_PTR with the set pointed to by
- DATA_SET_PTR failed. It outputs a failure message with the
- addresses involved, and calls __vtv_really_fail. */
-
-static void
-vtv_fail (const char *msg, void **data_set_ptr, const void *vtbl_ptr)
-{
- char buffer[128];
- int buf_len;
- const char *format_str =
- "*** Unable to verify vtable pointer (%p) in set (%p) *** \n";
-
- snprintf (buffer, sizeof (buffer), format_str, vtbl_ptr,
- is_set_handle_handle(*data_set_ptr) ?
- ptr_from_set_handle_handle (*data_set_ptr) :
- *data_set_ptr);
- buf_len = strlen (buffer);
- /* Send this to to stderr. */
- write (2, buffer, buf_len);
-
- if (!vtv_no_abort)
- __vtv_really_fail (msg);
-}
-
-/* Send information about what we were trying to do when verification
- failed to the error log, then call vtv_fail. This function can be
- overwritten/replaced by the user, to implement a secondary
- verification function instead. DATA_SET_PTR is the vtable map
- variable used for the failed verification, and VTBL_PTR is the
- vtable pointer that was not found in the set. */
-
-void
-__vtv_verify_fail (void **data_set_ptr, const void *vtbl_ptr)
-{
- char log_msg[256];
- snprintf (log_msg, sizeof (log_msg), "Looking for vtable %p in set %p.\n",
- vtbl_ptr,
- is_set_handle_handle (*data_set_ptr) ?
- ptr_from_set_handle_handle (*data_set_ptr) :
- *data_set_ptr);
- log_error_message (log_msg, false);
-
- const char *format_str =
- "*** Unable to verify vtable pointer (%p) in set (%p) *** \n";
- snprintf (log_msg, sizeof (log_msg), format_str, vtbl_ptr, *data_set_ptr);
- log_error_message (log_msg, false);
- log_error_message (" Backtrace: \n", true);
-
- const char *fail_msg = "Potential vtable pointer corruption detected!!\n";
- vtv_fail (fail_msg, data_set_ptr, vtbl_ptr);
-}
-
static int page_count_2 = 0;
static int
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index c04a87e8071..858155f0ed0 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -274,7 +274,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
index f69b6a75182..4dd0904b2e1 100644
--- a/libstdc++-v3/python/Makefile.in
+++ b/libstdc++-v3/python/Makefile.in
@@ -298,7 +298,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
index a1fe07766ab..2df82a267fa 100755
--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -56,7 +56,7 @@ case ${query} in
--cxxflags)
CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0"
CXXFLAGS_config="@SECTION_FLAGS@ @CXXFLAGS@ @EXTRA_CXX_FLAGS@"
- CXXFLAGS_vtv="-Wl,--whole-archive -lvtv_init -Wl,--no-whole-archive"
+ CXXFLAGS_vtv=" -lvtv"
echo ${CXXFLAGS_default} ${CXXFLAGS_config} ${CXXFLAGS_vtv}
;;
--cxxparallelflags)
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index f817470e8cd..777fe68a183 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -67,22 +67,8 @@ libstdc___la_DEPENDENCIES = \
$(top_builddir)/src/c++98/libc++98convenience.la \
$(top_builddir)/src/c++11/libc++11convenience.la
-#if ENABLE_VTABLE_VERIFY
-#libstdc___la_LDFLAGS = \
-# -version-info $(libtool_VERSION) ${version_arg} -lm -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#
-#libvtv___la_LIBADD = \
-# $(top_builddir)/libsupc++/.libs
-#LIBVTV_FLAGS = \
-# -L$(libvtv___la_LIBADD) --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std
-#else
libstdc___la_LDFLAGS = \
-version-info $(libtool_VERSION) ${version_arg} -lm
-#libvtv___la_LIBADD =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
@@ -195,14 +181,6 @@ CXXLINK = \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
-#CXXLINK = \
-# $(LIBTOOL) --tag CXX \
-# $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-# --mode=link $(CXX) \
-# $(LIBVTV_FLAGS) \
-# $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
-
-
# Symbol versioning for shared libraries.
if ENABLE_SYMVERS
libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index c55e7566cc5..de7f3e9567a 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -324,7 +324,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
@@ -375,24 +375,9 @@ libstdc___la_DEPENDENCIES = \
$(top_builddir)/src/c++98/libc++98convenience.la \
$(top_builddir)/src/c++11/libc++11convenience.la
-
-#if ENABLE_VTABLE_VERIFY
-#libstdc___la_LDFLAGS = \
-# -version-info $(libtool_VERSION) ${version_arg} -lm -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#
-#libvtv___la_LIBADD = \
-# $(top_builddir)/libsupc++/.libs
-#LIBVTV_FLAGS = \
-# -L$(libvtv___la_LIBADD) --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std
-#else
libstdc___la_LDFLAGS = \
-version-info $(libtool_VERSION) ${version_arg} -lm
-#libvtv___la_LIBADD =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
# A note on compatibility and static libraries.
diff --git a/libstdc++-v3/src/c++11/Makefile.am b/libstdc++-v3/src/c++11/Makefile.am
index 6dbdccd333e..58d3025f0e7 100644
--- a/libstdc++-v3/src/c++11/Makefile.am
+++ b/libstdc++-v3/src/c++11/Makefile.am
@@ -60,22 +60,6 @@ vpath % $(top_srcdir)/src/c++11
libc__11convenience_la_SOURCES = $(sources) $(inst_sources)
-# We need to add this here because even thought the GCC driver normally would
-# add the flags below when doing a vtable-verification build, the driver
-# flags do not appear to be used when building the C++ std library.
-
-#if ENABLE_VTABLE_VERIFY
-#EXTRA_VTV_LDFLAGS = \
-# -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#LIBVTV_FLAGS = \
-# -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std $(EXTRA_VTV_LDFLAGS)
-#else
-#EXTRA_VTV_LDFLAGS =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
-
# Use special rules for the hashtable.cc file so that all
# the generated template functions are also instantiated.
hashtable_c++0x.lo: hashtable_c++0x.cc
diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in
index b0f3bf42570..cdf5e538b1d 100644
--- a/libstdc++-v3/src/c++11/Makefile.in
+++ b/libstdc++-v3/src/c++11/Makefile.in
@@ -291,7 +291,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
@@ -637,22 +637,6 @@ uninstall-am:
vpath % $(top_srcdir)/src/c++11
-# We need to add this here because even thought the GCC driver normally would
-# add the flags below when doing a vtable-verification build, the driver
-# flags do not appear to be used when building the C++ std library.
-
-#if ENABLE_VTABLE_VERIFY
-#EXTRA_VTV_LDFLAGS = \
-# -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#LIBVTV_FLAGS = \
-# -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std $(EXTRA_VTV_LDFLAGS)
-#else
-#EXTRA_VTV_LDFLAGS =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
-
# Use special rules for the hashtable.cc file so that all
# the generated template functions are also instantiated.
hashtable_c++0x.lo: hashtable_c++0x.cc
diff --git a/libstdc++-v3/src/c++98/Makefile.am b/libstdc++-v3/src/c++98/Makefile.am
index 17fbca7df79..8ebff1aff23 100644
--- a/libstdc++-v3/src/c++98/Makefile.am
+++ b/libstdc++-v3/src/c++98/Makefile.am
@@ -142,22 +142,6 @@ vpath % $(top_srcdir)/src/c++98
libc__98convenience_la_SOURCES = $(sources)
-# We need to add this here because even thought the GCC driver normally would
-# add the flags below when doing a vtable-verification build, the driver
-# flags do not appear to be used when building the C++ std library.
-
-#if ENABLE_VTABLE_VERIFY
-#EXTRA_VTV_LDFLAGS = \
-# -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#LIBVTV_FLAGS = \
-# -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std $(EXTRA_VTV_LDFLAGS)
-#else
-#EXTRA_VTV_LDFLAGS =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
-
# Use special rules for the deprecated source files so that they find
# deprecated include files.
GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in
index a6af8002619..8c60e596f4f 100644
--- a/libstdc++-v3/src/c++98/Makefile.in
+++ b/libstdc++-v3/src/c++98/Makefile.in
@@ -307,7 +307,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
@@ -407,22 +407,6 @@ sources = \
libc__98convenience_la_SOURCES = $(sources)
-# We need to add this here because even thought the GCC driver normally would
-# add the flags below when doing a vtable-verification build, the driver
-# flags do not appear to be used when building the C++ std library.
-
-#if ENABLE_VTABLE_VERIFY
-#EXTRA_VTV_LDFLAGS = \
-# -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
-#LIBVTV_FLAGS = \
-# -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
-#VTV_CXXFLAGS = -fvtable-verify=std $(EXTRA_VTV_LDFLAGS)
-#else
-#EXTRA_VTV_LDFLAGS =
-#LIBVTV_FLAGS =
-#VTV_CXXFLAGS =
-#endif
-
# Use special rules for the deprecated source files so that they find
# deprecated include files.
GLIBCXX_INCLUDE_DIR = $(glibcxx_builddir)/include
diff --git a/libstdc++-v3/testsuite/17_intro/freestanding.cc b/libstdc++-v3/testsuite/17_intro/freestanding.cc
index 4b5b4910629..6518af5b831 100644
--- a/libstdc++-v3/testsuite/17_intro/freestanding.cc
+++ b/libstdc++-v3/testsuite/17_intro/freestanding.cc
@@ -1,4 +1,4 @@
-// { dg-options "-x c -std=gnu++0x -lsupc++" }
+// { dg-options "-x c -std=gnu++0x -lsupc++ -fvtable-verify=none" }
// Copyright (C) 2010-2013 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
index a07a0dfe574..5de6ac027e8 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/49745.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target *-*-linux* } }
+// { dg-do compile { target *-*-linux* *-*-gnu* } }
// Copyright (C) 2011-2013 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
index 000445972c9..e7cabc30bd2 100644
--- a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
+++ b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
@@ -1,5 +1,5 @@
// { dg-require-sharedlib "" }
-// { dg-options "-g -O2 -pthread -ldl -x c" { target *-*-linux* } }
+// { dg-options "-g -O2 -pthread -ldl -x c" { target *-*-linux* *-*-gnu* } }
// Copyright (C) 2005-2013 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc
new file mode 100644
index 00000000000..405e097dcc5
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <cstddef>
+
+std::max_align_t t;
diff --git a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc
new file mode 100644
index 00000000000..d702720815c
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <cstddef>
+#include <type_traits>
+
+static_assert (std::is_pod<std::max_align_t>::value, "");
diff --git a/libstdc++-v3/testsuite/18_support/pthread_guard.cc b/libstdc++-v3/testsuite/18_support/pthread_guard.cc
index be397bd65c6..47f78c3765a 100644
--- a/libstdc++-v3/testsuite/18_support/pthread_guard.cc
+++ b/libstdc++-v3/testsuite/18_support/pthread_guard.cc
@@ -16,8 +16,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-darwin* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } }
#include <cstdlib>
#include <pthread.h>
diff --git a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc
index aaa28a34c37..152f03a6cb1 100644
--- a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc
+++ b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc
@@ -40,6 +40,10 @@ void test01()
VERIFY( (is_same<add_lvalue_reference<ClassType&&>::type, ClassType&>::value) );
VERIFY( (is_same<add_lvalue_reference<void>::type, void>::value) );
VERIFY( (is_same<add_lvalue_reference<const void>::type, const void>::value) );
+ VERIFY( (is_same<add_lvalue_reference<bool(int) const>::type, bool(int) const>::value) );
+ VERIFY( (is_same<add_lvalue_reference<bool(int) &>::type, bool(int) &>::value) );
+ VERIFY( (is_same<add_lvalue_reference<bool(int) const &&>::type, bool(int) const &&>::value) );
+ VERIFY( (is_same<add_lvalue_reference<bool(int)>::type, bool(&)(int)>::value) );
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc
index 556b78ef583..7dcb1dcec98 100644
--- a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc
+++ b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc
@@ -31,6 +31,7 @@ void test01()
VERIFY( (is_same<add_rvalue_reference<int>::type, int&&>::value) );
VERIFY( (is_same<add_rvalue_reference<int&&>::type, int&&>::value) );
+ VERIFY( (is_same<add_rvalue_reference<int&>::type, int&>::value) );
VERIFY( (is_same<add_rvalue_reference<const int>::type, const int&&>::value) );
VERIFY( (is_same<add_rvalue_reference<int*>::type, int*&&>::value) );
VERIFY( (is_same<add_rvalue_reference<ClassType&&>::type, ClassType&&>::value) );
@@ -38,6 +39,10 @@ void test01()
VERIFY( (is_same<add_rvalue_reference<int(int)>::type, int(&&)(int)>::value) );
VERIFY( (is_same<add_rvalue_reference<void>::type, void>::value) );
VERIFY( (is_same<add_rvalue_reference<const void>::type, const void>::value) );
+ VERIFY( (is_same<add_rvalue_reference<bool(int) const>::type, bool(int) const>::value) );
+ VERIFY( (is_same<add_rvalue_reference<bool(int) &>::type, bool(int) &>::value) );
+ VERIFY( (is_same<add_rvalue_reference<bool(int) const &&>::type, bool(int) const &&>::value) );
+ VERIFY( (is_same<add_rvalue_reference<bool(int)>::type, bool(&&)(int)>::value) );
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc
index 48236afeae7..51b2c5fa0c4 100644
--- a/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc
@@ -43,6 +43,10 @@ void test01()
typedef void (fn_type) ();
typedef decay<fn_type>::type test4_type;
VERIFY( (is_same<test4_type, std::add_pointer<fn_type>::type>::value) );
+
+ typedef void (cfn_type) () const;
+ typedef decay<cfn_type>::type test5_type;
+ VERIFY( (is_same<test5_type, cfn_type>::value) );
}
int main()
diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
index ad821905a06..1aeba824ec5 100644
--- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
@@ -19,7 +19,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 1859 }
+// { dg-error "static assertion failed" "" { target *-*-* } 1938 }
#include <utility>
diff --git a/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
index d0619fd9ca0..d4c17288a99 100644
--- a/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
@@ -27,4 +27,4 @@ struct D : B { };
D d;
std::default_delete<B[]> db;
typedef decltype(db(&d)) type; // { dg-error "use of deleted function" }
-// { dg-error "declared here" "" { target *-*-* } 122 }
+// { dg-prune-output "declared" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc b/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc
new file mode 100644
index 00000000000..a5e21e9a3dd
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc
@@ -0,0 +1,7 @@
+// { dg-options "-std=gnu++1y" }
+// { dg-do compile }
+
+// Test error: reference to '__detail' is ambiguous
+
+#include <chrono>
+#include <random>
diff --git a/libstdc++-v3/testsuite/20_util/duration/literals/types.cc b/libstdc++-v3/testsuite/20_util/duration/literals/types.cc
new file mode 100644
index 00000000000..710dc425655
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/literals/types.cc
@@ -0,0 +1,70 @@
+// { dg-options "-std=gnu++1y" }
+// { dg-do compile }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <type_traits>
+
+void
+test03()
+{
+ using namespace std::literals::chrono_literals;
+
+ static_assert(std::is_same<decltype(1h), std::chrono::hours>::value,
+ "1h is std::chrono::hours");
+
+ static_assert(std::is_same<decltype(1.0h),
+ std::chrono::duration<long double, std::ratio<3600L, 1L>>>::value,
+ "1.0h is std::chrono::duration<long double, std::ratio<3600L, 1L>>");
+
+ static_assert(std::is_same<decltype(1min), std::chrono::minutes>::value,
+ "1min is std::chrono::minutes");
+
+ static_assert(std::is_same<decltype(1.0min),
+ std::chrono::duration<long double, std::ratio<60L, 1L>>>::value,
+ "1.0min is std::chrono::duration<long double, std::ratio<60L, 1L>>");
+
+ static_assert(std::is_same<decltype(1s), std::chrono::seconds>::value,
+ "1s is std::chrono::seconds");
+
+ static_assert(std::is_same<decltype(1.0s),
+ std::chrono::duration<long double, std::ratio<1L, 1L>>>::value,
+ "1.0s is std::chrono::duration<long double, std::ratio<1L, 1L>>");
+
+ static_assert(std::is_same<decltype(1ms), std::chrono::milliseconds>::value,
+ "1ms is std::chrono::milliseconds");
+
+ static_assert(std::is_same<decltype(1.0ms),
+ std::chrono::duration<long double, std::ratio<1L, 1000L>>>::value,
+ "1.0ms is std::chrono::duration<long double, std::ratio<1L, 1000L>>");
+
+ static_assert(std::is_same<decltype(1us), std::chrono::microseconds>::value,
+ "1us is std::chrono::microseconds");
+
+ static_assert(std::is_same<decltype(1.0us),
+ std::chrono::duration<long double, std::ratio<1L, 1000000L>>>::value,
+ "1.0us is std::chrono::duration<long double, std::ratio<1L, 1000000L>>");
+
+ static_assert(std::is_same<decltype(1ns), std::chrono::nanoseconds>::value,
+ "1ns is std::chrono::nanoseconds");
+
+ static_assert(std::is_same<decltype(1.0ns),
+ std::chrono::duration<long double, std::ratio<1L, 1000000000L>>>::value,
+ "1.0ns is std::chrono::duration<long double, std::ratio<1L, 1000000000L>>");
+}
diff --git a/libstdc++-v3/testsuite/20_util/duration/literals/values.cc b/libstdc++-v3/testsuite/20_util/duration/literals/values.cc
new file mode 100644
index 00000000000..8f2be113749
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/literals/values.cc
@@ -0,0 +1,65 @@
+// { dg-do run }
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <testsuite_hooks.h>
+
+void
+test03()
+{
+ using namespace std::literals::chrono_literals;
+
+ auto jiffy = 23ns;
+ VERIFY( jiffy == std::chrono::nanoseconds(23) );
+ auto fjiffy = 23.0ns;
+ VERIFY( (fjiffy == std::chrono::duration<long double, std::nano>(23.0L)) );
+ auto blip = 14us;
+ VERIFY( blip == std::chrono::microseconds(14) );
+ auto fblip = 14.0us;
+ VERIFY( (fblip == std::chrono::duration<long double, std::micro>(14.0L)) );
+ auto bit = 77ms;
+ VERIFY( bit == std::chrono::milliseconds(77) );
+ auto fbit = 77.0ms;
+ VERIFY( (fbit == std::chrono::duration<long double, std::milli>(77.0L)) );
+ auto warmup = 33s;
+ VERIFY( warmup == std::chrono::seconds(33) );
+ auto fwarmup = 33.0s;
+ VERIFY( (fwarmup == std::chrono::duration<long double, std::ratio<1,1>>(33.0L)) );
+ auto classtime = 50min;
+ VERIFY( classtime == std::chrono::minutes(50) );
+ auto fclasstime = 50.0min;
+ VERIFY( (fclasstime == std::chrono::duration<long double, std::ratio<60,1>>(50.0L)) );
+ auto longtime = 1h + 30min;
+ VERIFY( longtime == std::chrono::minutes(90) );
+ auto flongtime = 1.0h + 30.0min;
+ VERIFY( (flongtime == std::chrono::duration<long double, std::ratio<3600,1>>(1.0L)
+ + std::chrono::duration<long double, std::ratio<60,1>>(30.0L)) );
+ VERIFY( (flongtime == std::chrono::duration<long double, std::ratio<60,1>>(90.0L)) );
+ auto workday = 8h;
+ VERIFY( workday == std::chrono::hours(8) );
+ auto fworkday = 8.0h;
+ VERIFY( (fworkday == std::chrono::duration<long double, std::ratio<3600,1>>(8.0L)) );
+}
+
+int
+main()
+{
+ test03();
+}
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
index 1b686e476cf..db4237991bf 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
@@ -31,5 +31,5 @@ void test01()
test_type d;
}
-// { dg-error "rep cannot be a duration" "" { target *-*-* } 245 }
+// { dg-error "rep cannot be a duration" "" { target *-*-* } 246 }
// { dg-error "required from here" "" { target *-*-* } 31 }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
index 2cc5cd68e0a..8da5dbff431 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
@@ -32,5 +32,5 @@ void test01()
test_type d; // { dg-error "required from here" }
}
-// { dg-error "must be a specialization of ratio" "" { target *-*-* } 246 }
+// { dg-error "must be a specialization of ratio" "" { target *-*-* } 247 }
// { dg-prune-output "not a member" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
index a9313ccb2cc..4837f5d64fc 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
@@ -33,5 +33,5 @@ void test01()
test_type d;
}
-// { dg-error "period must be positive" "" { target *-*-* } 248 }
+// { dg-error "period must be positive" "" { target *-*-* } 249 }
// { dg-error "required from here" "" { target *-*-* } 33 }
diff --git a/libstdc++-v3/testsuite/20_util/integral_constant/call_operator.cc b/libstdc++-v3/testsuite/20_util/integral_constant/call_operator.cc
new file mode 100644
index 00000000000..c5b0385240e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/integral_constant/call_operator.cc
@@ -0,0 +1,36 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <type_traits>
+#include <cassert> //testsuite_hooks.h>
+
+typedef std::integral_constant<int, 1> ic_one;
+typedef std::integral_constant<int, 0> ic_zero;
+typedef std::integral_constant<int, -1> ic_minus_one;
+
+typedef std::integral_constant<bool, true> ic_true;
+typedef std::integral_constant<bool, false> ic_false;
+
+static_assert( ic_one{}() == 1, "1" );
+static_assert( ic_zero{}() == 0, "0" );
+static_assert( ic_minus_one{}() == -1, "-1" );
+
+static_assert( ic_true{}() == true, "true" );
+static_assert( ic_false{}() == false, "false" );
diff --git a/libstdc++-v3/testsuite/20_util/is_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc
index 8d45671fd1d..396b2452c87 100644
--- a/libstdc++-v3/testsuite/20_util/is_assignable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc
@@ -277,8 +277,8 @@ static_assert(!std::is_assignable<DelAnyAssign&, int&>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&, const int&>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&, void>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&, void()>::value, "Error");
-// static_assert(!std::is_assignable<DelAnyAssign&, void()
-// const>::value, "Error");
+static_assert(!std::is_assignable<DelAnyAssign&,
+ void() const>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&, void(&)()>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&, void(&&)()>::value, "Error");
static_assert(!std::is_assignable<DelAnyAssign&,
@@ -580,6 +580,9 @@ static_assert(!std::is_assignable<const UAssignAll&,
UAssignAll&>::value, "Error");
static_assert(!std::is_assignable<const UAssignAll&, const
UAssignAll&>::value, "Error");
+static_assert(!std::is_assignable<UAssignAll&, void() const>::value, "Error");
+static_assert(!std::is_assignable<UAssignAll&, void() &>::value, "Error");
+static_assert(!std::is_assignable<UAssignAll&, void() const volatile &&>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, int>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, int&>::value, "Error");
@@ -600,7 +603,6 @@ static_assert(std::is_assignable<UAssignAll&,
std::nullptr_t&>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, void()>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, void(&)()>::value, "Error");
-//static_assert(std::is_assignable<UAssignAll&, void() const>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, void(*)()>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, void(*&)()>::value, "Error");
static_assert(std::is_assignable<UAssignAll&, int*>::value, "Error");
@@ -636,8 +638,8 @@ static_assert(!std::is_assignable<UDelAssignAll&,
std::nullptr_t&>::value, "Error");
static_assert(!std::is_assignable<UDelAssignAll&, void()>::value, "Error");
static_assert(!std::is_assignable<UDelAssignAll&, void(&)()>::value, "Error");
-// static_assert(!std::is_assignable<UDelAssignAll&, void()
-// const>::value, "Error");
+static_assert(!std::is_assignable<UDelAssignAll&, void()
+ const>::value, "Error");
static_assert(!std::is_assignable<UDelAssignAll&, void(*)()>::value, "Error");
static_assert(!std::is_assignable<UDelAssignAll&, void(*&)()>::value, "Error");
static_assert(!std::is_assignable<UDelAssignAll&, int*>::value, "Error");
diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc
index f3119111b0c..1a6f264c243 100644
--- a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc
+++ b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc
@@ -72,8 +72,8 @@ static_assert(!std::is_constructible<DelEllipsis, SE>::value, "Error");
static_assert(!std::is_constructible<DelEllipsis, OpE>::value, "Error");
static_assert(!std::is_constructible<DelEllipsis, OpSE>::value, "Error");
static_assert(!std::is_constructible<DelEllipsis, void()>::value, "Error");
-// static_assert(!std::is_constructible<DelEllipsis, void() const>::value,
-// "Error");
+static_assert(!std::is_constructible<DelEllipsis, void() const>::value,
+ "Error");
static_assert(!std::is_constructible<DelEllipsis, int[1]>::value, "Error");
static_assert(!std::is_constructible<DelEllipsis, int[]>::value, "Error");
static_assert(!std::is_constructible<DelEllipsis, int*>::value, "Error");
@@ -461,20 +461,20 @@ static_assert(!std::is_constructible<OpSE, void()>::value, "Error");
static_assert(!std::is_constructible<int[], void()>::value, "Error");
static_assert(!std::is_constructible<int[1], void()>::value, "Error");
-// static_assert(!std::is_constructible<void(int) const,
-// void() const>::value, "Error");
-// static_assert(!std::is_constructible<int, void() const>::value, "Error");
-// static_assert(!std::is_constructible<Abstract, void() const>::value, "Error");
-// static_assert(!std::is_constructible<std::nullptr_t, void() const>::value,
-// "Error");
-// static_assert(!std::is_constructible<Empty, void() const>::value, "Error");
-// static_assert(!std::is_constructible<U, void() const>::value, "Error");
-// static_assert(!std::is_constructible<E, void() const>::value, "Error");
-// static_assert(!std::is_constructible<SE, void() const>::value, "Error");
-// static_assert(!std::is_constructible<OpE, void() const>::value, "Error");
-// static_assert(!std::is_constructible<OpSE, void() const>::value, "Error");
-// static_assert(!std::is_constructible<int[], void() const>::value, "Error");
-// static_assert(!std::is_constructible<int[1], void() const>::value, "Error");
+static_assert(!std::is_constructible<void(int) const,
+ void() const>::value, "Error");
+static_assert(!std::is_constructible<int, void() const>::value, "Error");
+static_assert(!std::is_constructible<Abstract, void() const>::value, "Error");
+static_assert(!std::is_constructible<std::nullptr_t, void() const>::value,
+ "Error");
+static_assert(!std::is_constructible<Empty, void() const>::value, "Error");
+static_assert(!std::is_constructible<U, void() const>::value, "Error");
+static_assert(!std::is_constructible<E, void() const>::value, "Error");
+static_assert(!std::is_constructible<SE, void() const>::value, "Error");
+static_assert(!std::is_constructible<OpE, void() const>::value, "Error");
+static_assert(!std::is_constructible<OpSE, void() const>::value, "Error");
+static_assert(!std::is_constructible<int[], void() const>::value, "Error");
+static_assert(!std::is_constructible<int[1], void() const>::value, "Error");
static_assert(!std::is_constructible<void, int, int>::value, "Error");
static_assert(!std::is_constructible<void, Empty, B>::value, "Error");
@@ -488,8 +488,8 @@ static_assert(!std::is_constructible<void, int[], int[]>::value, "Error");
static_assert(!std::is_constructible<void, void, int>::value, "Error");
static_assert(!std::is_constructible<void, void, void>::value, "Error");
static_assert(!std::is_constructible<void, void(), void()>::value, "Error");
-// static_assert(!std::is_constructible<void, void() const,
-// void() volatile>::value, "Error");
+static_assert(!std::is_constructible<void, void() const,
+ void() volatile>::value, "Error");
static_assert(!std::is_constructible<int, int, int>::value, "Error");
static_assert(!std::is_constructible<const int, int, int>::value, "Error");
@@ -651,13 +651,13 @@ static_assert(!std::is_constructible<void(), void, void>::value, "Error");
static_assert(!std::is_constructible<void(), void(), int>::value, "Error");
static_assert(!std::is_constructible<void(), void(), void()>::value, "Error");
-// static_assert(!std::is_constructible<void() const, int, int>::value, "Error");
-// static_assert(!std::is_constructible<void() const, void, int>::value, "Error");
-// static_assert(!std::is_constructible<void() const, void, void>::value, "Error");
-// static_assert(!std::is_constructible<void() const, void() volatile,
-// int>::value, "Error");
-// static_assert(!std::is_constructible<void() const, void() volatile const,
-// void() const>::value, "Error");
+static_assert(!std::is_constructible<void() const, int, int>::value, "Error");
+static_assert(!std::is_constructible<void() const, void, int>::value, "Error");
+static_assert(!std::is_constructible<void() const, void, void>::value, "Error");
+static_assert(!std::is_constructible<void() const, void() volatile,
+ int>::value, "Error");
+static_assert(!std::is_constructible<void() const, void() volatile const,
+ void() const>::value, "Error");
static_assert(!std::is_constructible<FromArgs<int>, int, int>::value, "Error");
static_assert(!std::is_constructible<const FromArgs<int>, int, int>::value,
diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc
index bad1a08f622..af5e3ba777a 100644
--- a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc
@@ -52,6 +52,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_property<is_copy_assignable,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_property<is_copy_assignable,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_property<is_copy_assignable,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_property<is_copy_assignable,
+ bool(...) &&>(false)) );
+ VERIFY( (test_property<is_copy_assignable,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_copy_assignable, NoexceptMoveAssignClass>(false)) );
VERIFY( (test_property<is_copy_assignable, ExceptMoveAssignClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc
index 0fe00d250e3..0a9686d67e1 100644
--- a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc
@@ -61,6 +61,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_category<is_copy_constructible,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_category<is_copy_constructible,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_category<is_copy_constructible,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_category<is_copy_constructible,
+ bool(...) &&>(false)) );
+ VERIFY( (test_category<is_copy_constructible,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_copy_constructible,
volatile NoexceptCopyConsClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_function/value.cc b/libstdc++-v3/testsuite/20_util/is_function/value.cc
index 6e88e77bf89..ce52ac9872d 100644
--- a/libstdc++-v3/testsuite/20_util/is_function/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_function/value.cc
@@ -32,6 +32,9 @@ void test01()
VERIFY( (test_category<is_function, ClassType (ClassType)>(true)) );
VERIFY( (test_category<is_function, float (int, float, int[], int&)>(true)) );
VERIFY( (test_category<is_function, int (int, ...)>(true)) );
+ VERIFY( (test_category<is_function, bool (ClassType) const>(true)) );
+ VERIFY( (test_category<is_function, ClassType () &>(true)) );
+ VERIFY( (test_category<is_function, char (int, ClassType) const volatile &&>(true)) );
// Negative tests.
VERIFY( (test_category<is_function, int&>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc
index ab2d493c01a..c96f739a635 100644
--- a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc
@@ -54,6 +54,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_property<is_move_assignable,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_property<is_move_assignable,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_property<is_move_assignable,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_property<is_move_assignable,
+ bool(...) &&>(false)) );
+ VERIFY( (test_property<is_move_assignable,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_move_assignable, DeletedCopyAssignClass>(false)) );
VERIFY( (test_property<is_move_assignable, DeletedMoveAssignClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc
index edda59403cd..94af3e1ba14 100644
--- a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc
@@ -59,6 +59,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_category<is_move_constructible,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_category<is_move_constructible,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_category<is_move_constructible,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_category<is_move_constructible,
+ bool(...) &&>(false)) );
+ VERIFY( (test_category<is_move_constructible,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_move_constructible,
const NoexceptMoveConsClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc
index 969b1304cdc..72ce0a069f1 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc
@@ -55,6 +55,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_property<is_nothrow_copy_assignable,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_property<is_nothrow_copy_assignable,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_property<is_nothrow_copy_assignable,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_property<is_nothrow_copy_assignable,
+ bool(...) &&>(false)) );
+ VERIFY( (test_property<is_nothrow_copy_assignable,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_nothrow_copy_assignable,
ExceptCopyAssignClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc
index 541747942e9..33d82af54e9 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc
@@ -58,6 +58,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_category<is_nothrow_copy_constructible,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_category<is_nothrow_copy_constructible,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_category<is_nothrow_copy_constructible,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_category<is_nothrow_copy_constructible,
+ bool(...) &&>(false)) );
+ VERIFY( (test_category<is_nothrow_copy_constructible,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_nothrow_copy_constructible,
volatile NoexceptCopyConsClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc
index 5ce26f84ecf..54d94c2f234 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc
@@ -57,6 +57,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_property<is_nothrow_move_assignable,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_property<is_nothrow_move_assignable,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_property<is_nothrow_move_assignable,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_property<is_nothrow_move_assignable,
+ bool(...) &&>(false)) );
+ VERIFY( (test_property<is_nothrow_move_assignable,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_nothrow_move_assignable,
ExceptMoveAssignClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc
index cee6912974f..9afe428f765 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc
@@ -55,6 +55,14 @@ void test01()
int (ClassType::*[2][3])>(false)) );
VERIFY( (test_category<is_nothrow_move_constructible,
int (ClassType::*[][2][3]) (int)>(false)) );
+ VERIFY( (test_category<is_nothrow_move_constructible,
+ ClassType(unsigned) const &>(false)) );
+ VERIFY( (test_category<is_nothrow_move_constructible,
+ bool(ClassType) const>(false)) );
+ VERIFY( (test_category<is_nothrow_move_constructible,
+ bool(...) &&>(false)) );
+ VERIFY( (test_category<is_nothrow_move_constructible,
+ EnumType(int, ...)>(false)) );
VERIFY( (test_property<is_nothrow_move_constructible,
const NoexceptMoveConsClass>(false)) );
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index 077e32797a6..53090b34564 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1601 }
-// { dg-error "declaration of" "" { target *-*-* } 1565 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1676 }
+// { dg-error "declaration of" "" { target *-*-* } 1640 }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index 2bc1cbbad12..7b7e59911f4 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -48,5 +48,5 @@ void test01()
// { dg-error "required from here" "" { target *-*-* } 40 }
// { dg-error "required from here" "" { target *-*-* } 42 }
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1519 }
-// { dg-error "declaration of" "" { target *-*-* } 1483 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1594 }
+// { dg-error "declaration of" "" { target *-*-* } 1558 }
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
index d44b58b9841..5417442ba67 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
@@ -17,8 +17,8 @@
// 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads -std=gnu++0x" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
index 79e67dff6dd..80354c78651 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
@@ -17,8 +17,8 @@
// 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
new file mode 100644
index 00000000000..25803853dd8
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++1y" }
+// { dg-do compile }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <string>
+#include <type_traits>
+
+void
+test01()
+{
+ using namespace std::literals::string_literals;
+
+ static_assert(std::is_same<decltype("Hello"s), std::string>::value,
+ "\"Hello\"s is std::string");
+
+ static_assert(std::is_same<decltype(u8"Hello"s), std::string>::value,
+ "u8\"Hello\"s is std::string");
+
+ static_assert(std::is_same<decltype(L"Hello"s), std::wstring>::value,
+ "L\"Hello\"s is std::wstring");
+
+ static_assert(std::is_same<decltype(u"Hello"s), std::u16string>::value,
+ "u\"Hello\"s is std::u16string");
+
+ static_assert(std::is_same<decltype(U"Hello"s), std::u32string>::value,
+ "U\"Hello\"s is std::u32string");
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
new file mode 100644
index 00000000000..4732f29f814
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
@@ -0,0 +1,46 @@
+// { dg-do run }
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <string>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ using namespace std::literals::string_literals;
+
+ std::string planet = "Mercury"s;
+ std::wstring wplanet = L"Venus"s;
+ std::string u8planet = u8"Mars"s;
+ std::u16string u16planet = u"Juiter"s;
+ std::u32string u32planet = U"Saturn"s;
+
+ VERIFY( planet == std::string("Mercury") );
+ VERIFY( wplanet == std::wstring(L"Venus") );
+ VERIFY( u8planet == std::string(u8"Mars") );
+ VERIFY( u16planet == std::u16string(u"Juiter") );
+ VERIFY( u32planet == std::u32string(U"Saturn") );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc b/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc
index 25f32f1461a..fd8bb8aabd2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc
@@ -16,8 +16,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <ext/new_allocator.h>
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc
index 3e9d5526399..996453e119d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc
@@ -19,8 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <string>
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
index 9f51aef11a6..d269486b0c9 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
@@ -1,4 +1,4 @@
-// { dg-do run { xfail { ! { *-*-linux* } } } }
+// { dg-do run { xfail { ! { *-*-linux* *-*-gnu* } } } }
// { dg-require-namedlocale "de_DE" }
// Copyright (C) 2000-2013 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
index 92d93795734..51ccd4b62d1 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
@@ -1,4 +1,4 @@
-// { dg-do run { xfail *-*-![linux]* } }
+// { dg-do run { xfail { ! { *-*-linux* *-*-gnu* } } } }
// { dg-require-namedlocale "de_DE" }
// Copyright (C) 2000-2013 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc
index 20ed46e0a04..a6c375c3a22 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
// { dg-require-namedlocale "en_US" }
// { dg-require-namedlocale "fr_FR" }
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
index 5ee44c29519..24649377c23 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
// { dg-require-namedlocale "en_US" }
// { dg-require-namedlocale "fr_FR" }
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/allocator/ext_ptr.cc b/libstdc++-v3/testsuite/23_containers/forward_list/allocator/ext_ptr.cc
new file mode 100644
index 00000000000..6f3a0ed75dc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/allocator/ext_ptr.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <forward_list>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+bool operator==(const T& l, const T& r) { return l.i == r.i; }
+bool operator<(const T& l, const T& r) { return l.i < r.i; }
+
+using __gnu_test::CustomPointerAlloc;
+
+template class std::forward_list<T, CustomPointerAlloc<T>>;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef CustomPointerAlloc<T> alloc_type;
+ typedef std::forward_list<T, alloc_type> test_type;
+ test_type v;
+ v.push_front(T());
+ VERIFY( ++v.begin() == v.end() );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/list/pthread1.cc b/libstdc++-v3/testsuite/23_containers/list/pthread1.cc
index 6c43697403f..174e159d5ce 100644
--- a/libstdc++-v3/testsuite/23_containers/list/pthread1.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/pthread1.cc
@@ -17,8 +17,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
// This multi-threading C++/STL/POSIX code adheres to rules outlined here:
diff --git a/libstdc++-v3/testsuite/23_containers/list/pthread5.cc b/libstdc++-v3/testsuite/23_containers/list/pthread5.cc
index 38a0e88752e..9ba87e78011 100644
--- a/libstdc++-v3/testsuite/23_containers/list/pthread5.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/pthread5.cc
@@ -19,8 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/map/dr130.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc
index e155b4a4338..e155b4a4338 100644
--- a/libstdc++-v3/testsuite/23_containers/map/dr130.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc
diff --git a/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc
new file mode 100644
index 00000000000..0a17c56c62b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options -std=c++11 }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Test that the C++11 variants have an ABI tag
+
+#include <map>
+
+using container = std::map<int, int>;
+using iterator = typename container::iterator;
+using const_iterator = typename container::const_iterator;
+
+// { dg-final { scan-assembler "_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E" } }
+iterator (container::*p1)(iterator) = &container::erase;
diff --git a/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc
new file mode 100644
index 00000000000..9d7cde973f2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc
@@ -0,0 +1,40 @@
+// { dg-require-effective-target ia32 }
+// { dg-require-sharedlib "" }
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <testsuite_containers.h>
+
+int main()
+{
+ typedef std::map<int, int> container_type;
+
+ {
+ container_type s { {0,0} , {1,1} , {2,2} };
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
+ }
+
+ {
+ container_type s { {0,0} , {1,1} , {2,2} };
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/map/pthread6.cc b/libstdc++-v3/testsuite/23_containers/map/pthread6.cc
index e9c4ab778ed..bebafa6c9a3 100644
--- a/libstdc++-v3/testsuite/23_containers/map/pthread6.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/pthread6.cc
@@ -18,8 +18,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <string>
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/dr130.cc b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc
index b303fa62e52..b303fa62e52 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/dr130.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc
new file mode 100644
index 00000000000..7bd26a35245
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options -std=c++11 }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Test that the C++11 variants have an ABI tag
+
+#include <map>
+
+using container = std::multimap<int, int>;
+using iterator = typename container::iterator;
+using const_iterator = typename container::const_iterator;
+
+// { dg-final { scan-assembler "_ZNSt8multimapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E" } }
+iterator (container::*p1)(iterator) = &container::erase;
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc
new file mode 100644
index 00000000000..236100cd920
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc
@@ -0,0 +1,40 @@
+// { dg-require-effective-target ia32 }
+// { dg-require-sharedlib "" }
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <testsuite_containers.h>
+
+int main()
+{
+ typedef std::multimap<int, int> container_type;
+
+ {
+ container_type s { {0,0} , {1,1} , {2,2} };
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
+ }
+
+ {
+ container_type s { {0,0} , {1,1} , {2,2} };
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/dr130.cc b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc
index fc8aaf6d825..fc8aaf6d825 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset/dr130.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc
new file mode 100644
index 00000000000..bbe2d054d94
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// { dg-options -std=c++11 }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Test that the C++11 variants have an ABI tag
+
+#include <set>
+
+using container = std::multiset<int>;
+using iterator = typename container::iterator;
+using const_iterator = typename container::const_iterator;
+
+// { dg-final { scan-assembler "_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
+iterator (container::*p1)(const_iterator) = &container::erase;
+
+// { dg-final { scan-assembler "_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiES5_" } }
+iterator (container::*p2)(const_iterator, const_iterator) = &container::erase;
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc
new file mode 100644
index 00000000000..9155b648c15
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc
@@ -0,0 +1,40 @@
+// { dg-require-effective-target ia32 }
+// { dg-require-sharedlib "" }
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <testsuite_containers.h>
+
+int main()
+{
+ typedef std::multiset<int> container_type;
+
+ {
+ container_type s { 0, 1, 2 };
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
+ }
+
+ {
+ container_type s { 0, 1, 2 };
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/set/dr130.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc
index 18b863240dc..18b863240dc 100644
--- a/libstdc++-v3/testsuite/23_containers/set/dr130.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc
diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc
new file mode 100644
index 00000000000..e612b2c9943
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// { dg-options -std=c++11 }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+// Test that the C++11 variants have an ABI tag
+
+#include <set>
+
+using container = std::set<int>;
+using iterator = typename container::iterator;
+using const_iterator = typename container::const_iterator;
+
+// { dg-final { scan-assembler "_ZNSt3setIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
+iterator (container::*p1)(const_iterator) = &container::erase;
+
+// { dg-final { scan-assembler "_ZNSt3setIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiES5_" } }
+iterator (container::*p2)(const_iterator, const_iterator) = &container::erase;
diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc
new file mode 100644
index 00000000000..a894f0ce709
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc
@@ -0,0 +1,40 @@
+// { dg-require-effective-target ia32 }
+// { dg-require-sharedlib "" }
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <testsuite_containers.h>
+
+int main()
+{
+ typedef std::set<int> container_type;
+
+ {
+ container_type s { 0, 1, 2 };
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
+ }
+
+ {
+ container_type s { 0, 1, 2 };
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C
new file mode 100644
index 00000000000..aa11e5ccd51
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <unordered_map>
+#include <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ {
+ std::unordered_map<std::string, std::string> mymap;
+ std::pair<std::string, std::string> mypair{std::string("key"),
+ std::string("value")};
+ mymap.insert(mypair);
+
+ VERIFY( mypair.first.length() && mypair.second.length() );
+ }
+
+ {
+ std::unordered_map<std::string, std::string> mymap;
+ std::pair<std::string, std::string> mypair{std::string("key"),
+ std::string("value")};
+ mymap.insert(mymap.begin(), mypair);
+
+ VERIFY( mypair.first.length() && mypair.second.length() );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C b/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C
new file mode 100644
index 00000000000..8a44eb91c95
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C
@@ -0,0 +1,51 @@
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <unordered_map>
+#include <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ {
+ std::unordered_multimap<std::string, std::string> mymmap;
+ std::pair<std::string, std::string> mypair{std::string("key"),
+ std::string("value")};
+ mymmap.insert(mypair);
+
+ VERIFY( mypair.first.length() && mypair.second.length() );
+ }
+
+ {
+ std::unordered_multimap<std::string, std::string> mymmap;
+ std::pair<std::string, std::string> mypair{std::string("key"),
+ std::string("value")};
+ mymmap.insert(mymmap.begin(), mypair);
+
+ VERIFY( mypair.first.length() && mypair.second.length() );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/ext_ptr.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/ext_ptr.cc
new file mode 100644
index 00000000000..55d9af3a5cb
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/ext_ptr.cc
@@ -0,0 +1,48 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <unordered_set>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+bool operator==(const T& l, const T& r) { return l.i == r.i; }
+struct H { std::size_t operator()(const T& t) const noexcept { return t.i; }
+};
+struct E : std::equal_to<T> { };
+
+using __gnu_test::CustomPointerAlloc;
+
+template class std::unordered_set<T, H, E, CustomPointerAlloc<T>>;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef CustomPointerAlloc<T> alloc_type;
+ typedef std::unordered_set<T, H, E, alloc_type> test_type;
+ test_type v;
+ v.insert(T());
+ VERIFY( ++v.begin() == v.end() );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/allocator/ext_ptr.cc b/libstdc++-v3/testsuite/23_containers/vector/allocator/ext_ptr.cc
new file mode 100644
index 00000000000..b94a47a939b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/vector/allocator/ext_ptr.cc
@@ -0,0 +1,44 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <vector>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::CustomPointerAlloc;
+
+template class std::vector<T, CustomPointerAlloc<T>>;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef CustomPointerAlloc<T> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v;
+ v.push_back(T());
+ VERIFY( ++v.begin() == v.end() );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
index 74fd8494f60..750dc138e87 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/1.cc b/libstdc++-v3/testsuite/25_algorithms/equal/1.cc
index 22af7650f0e..f8c13550de3 100644
--- a/libstdc++-v3/testsuite/25_algorithms/equal/1.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/equal/1.cc
@@ -27,6 +27,8 @@ int array1[] = {0, 1};
int array2[] = {1, 0};
int array3[] = {1, 0};
+bool __attribute__((unused)) test = false;
+
void test1()
{
Container con1(array1, array1);
@@ -45,17 +47,10 @@ void test3()
{
Container con1(array1, array1 + 2);
Container con2(array2, array2 + 2);
- VERIFY( !std::equal(con2.begin(), con2.end(), con1.begin()) );
-}
-
-void test4()
-{
- Container con1(array1, array1 + 2);
- Container con2(array2, array2 + 2);
VERIFY( !std::equal(con1.begin(), con1.end(), con2.begin()) );
}
-void test5()
+void test4()
{
Container con3(array3, array3 + 2);
Container con2(array2, array2 + 2);
@@ -68,5 +63,4 @@ int main()
test2();
test3();
test4();
- test5();
}
diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/2.cc b/libstdc++-v3/testsuite/25_algorithms/equal/2.cc
new file mode 100644
index 00000000000..012609f7fe8
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/equal/2.cc
@@ -0,0 +1,193 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.11 [alg.equal]
+
+// { dg-options "-std=gnu++1y" }
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
+using __gnu_test::test_container;
+using __gnu_test::input_iterator_wrapper;
+using __gnu_test::random_access_iterator_wrapper;
+
+typedef test_container<int, input_iterator_wrapper> Container;
+typedef test_container<int, random_access_iterator_wrapper> RA_Container;
+int array1[] = {0, 1};
+int array2[] = {1, 0};
+int array3[] = {1, 0};
+
+struct equal_to
+{
+ static int count;
+
+ bool operator()(int l, int r)
+ {
+ ++count;
+ return l == r;
+ }
+} eq;
+
+int equal_to::count = 0;
+
+bool __attribute__((unused)) test = false;
+
+void test1()
+{
+ const Container con1(array1, array1);
+ const Container con2(array2, array2);
+
+ auto c1 = con1;
+ auto c2 = con2;
+ VERIFY( std::equal(c1.begin(), c1.end(), c2.begin(), c2.end()) );
+ VERIFY( equal_to::count == 0 );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( std::equal(c1.begin(), c1.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 0 );
+}
+
+void test2()
+{
+ const Container con1(array1, array1 + 0);
+ const Container con2(array2, array2 + 2);
+
+ auto c1 = con1;
+ auto c2 = con2;
+ VERIFY( !std::equal(c1.begin(), c1.end(), c2.begin(), c2.end()) );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c1.begin(), c1.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 0 );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c1.begin(), c1.end()) );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c1.begin(), c1.end(), eq) );
+ VERIFY( equal_to::count == 0 );
+}
+
+void test3()
+{
+ const Container con1(array1, array1 + 2);
+ const Container con2(array2, array2 + 2);
+
+ auto c1 = con1;
+ auto c2 = con2;
+ VERIFY( !std::equal(c1.begin(), c1.end(), c2.begin(), c2.end()) );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c1.begin(), c1.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 1 );
+ equal_to::count = 0;
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c1.begin(), c1.end()) );
+
+ c1 = con1;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c1.begin(), c1.end(), eq) );
+ VERIFY( equal_to::count == 1 );
+ equal_to::count = 0;
+}
+
+void test4()
+{
+ const Container con3(array3, array3 + 2);
+ const Container con2(array2, array2 + 2);
+
+ auto c3 = con3;
+ auto c2 = con2;
+ VERIFY( std::equal(c3.begin(), c3.end(), c2.begin(), c2.end()) );
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( std::equal(c3.begin(), c3.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 2 );
+ equal_to::count = 0;
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( std::equal(c2.begin(), c2.end(), c3.begin(), c3.end()) );
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( std::equal(c2.begin(), c2.end(), c3.begin(), c3.end(), eq) );
+ VERIFY( equal_to::count == 2 );
+ equal_to::count = 0;
+}
+
+void test5()
+{
+ const Container con3(array3, array3 + 1);
+ const Container con2(array2, array2 + 2);
+
+ auto c3 = con3;
+ auto c2 = con2;
+ VERIFY( !std::equal(c3.begin(), c3.end(), c2.begin(), c2.end()) );
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( !std::equal(c3.begin(), c3.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 1 );
+ equal_to::count = 0;
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c3.begin(), c3.end()) );
+
+ c3 = con3;
+ c2 = con2;
+ VERIFY( !std::equal(c2.begin(), c2.end(), c3.begin(), c3.end(), eq) );
+ VERIFY( equal_to::count == 1 );
+ equal_to::count = 0;
+}
+
+void test6()
+{
+ RA_Container c3(array3, array3 + 1);
+ RA_Container c2(array2, array2 + 2);
+
+ VERIFY( !std::equal(c3.begin(), c3.end(), c2.begin(), c2.end()) );
+
+ VERIFY( !std::equal(c3.begin(), c3.end(), c2.begin(), c2.end(), eq) );
+ VERIFY( equal_to::count == 0 );
+
+ VERIFY( !std::equal(c2.begin(), c2.end(), c3.begin(), c3.end()) );
+
+ VERIFY( !std::equal(c2.begin(), c2.end(), c3.begin(), c3.end(), eq) );
+ VERIFY( equal_to::count == 0 );
+}
+
+int main()
+{
+ test1();
+ test2();
+ test3();
+ test4();
+ test5();
+ test6();
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/check_type2.cc b/libstdc++-v3/testsuite/25_algorithms/equal/check_type2.cc
new file mode 100644
index 00000000000..c80cced5923
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/equal/check_type2.cc
@@ -0,0 +1,48 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.11 [alg.equal]
+
+// { dg-do compile }
+// { dg-options " -std=gnu++1y " }
+
+#include <algorithm>
+#include <testsuite_iterators.h>
+using __gnu_test::input_iterator_wrapper;
+
+struct Lhs1 { };
+
+struct Rhs1 { };
+
+bool operator==(const Lhs1&, const Rhs1&) {return true;}
+
+struct Lhs2 { };
+
+struct Rhs2 { };
+
+bool
+predicate(const Lhs2&, const Rhs2&) {return true;}
+
+bool
+test1(input_iterator_wrapper<Lhs1>& lhs1,
+ input_iterator_wrapper<Rhs1>& rhs1)
+{ return std::equal(lhs1, lhs1, rhs1, rhs1); }
+
+bool
+test2(input_iterator_wrapper<Lhs2>& lhs2,
+ input_iterator_wrapper<Rhs2>& rhs2)
+{ return std::equal(lhs2, lhs2, rhs2, rhs2, predicate); }
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc
new file mode 100644
index 00000000000..d573fa2c932
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/2.cc
@@ -0,0 +1,115 @@
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.12 [alg.is_permutation] Is permutation
+
+#include <algorithm>
+#include <functional>
+#include <testsuite_hooks.h>
+
+struct my_equal_to
+{
+ bool
+ operator()(int __x, int __y) const
+ { return __x % 10 == __y % 10; }
+};
+
+const int arr0[] = { 11, 22, 33, 44, 55 };
+
+void
+do_test(int arr1[5], bool np = true, unsigned N = 5)
+{
+ bool test __attribute__((unused)) = true;
+
+ do
+ VERIFY( std::is_permutation(arr1, arr1 + 5, arr0, arr0 + N) == np );
+ while (std::next_permutation(arr1, arr1 + 5));
+}
+
+template<typename Predicate>
+ void
+ do_test(int arr1[5], Predicate pred, bool np = true, unsigned N = 5)
+ {
+ bool test __attribute__((unused)) = true;
+
+ do
+ VERIFY( std::is_permutation(arr1, arr1 + 5, arr0, arr0 + N, pred) == np );
+ while (std::next_permutation(arr1, arr1 + 5));
+ }
+
+void test01()
+{
+ int arr1[] = { 11, 22, 33, 44, 55 };
+ do_test(arr1);
+ do_test(arr1, false, 4);
+
+ int arr2[] = { 11, 33, 33, 44, 55 };
+ do_test(arr2, false);
+
+ int arr3[] = { 33, 33, 33, 44, 44 };
+ do_test(arr3, false);
+
+ int arr4[] = { 11, 22, 33, 44, 55 };
+ do_test(arr4, std::equal_to<int>());
+ do_test(arr4, std::equal_to<int>(), false, 4);
+
+ int arr5[] = { 11, 33, 33, 44, 55 };
+ do_test(arr5, std::equal_to<int>(), false);
+
+ int arr6[] = { 33, 33, 33, 44, 44 };
+ do_test(arr6, std::equal_to<int>(), false);
+
+ int arr7[] = { 1, 2, 3, 4, 5 };
+ do_test(arr7, my_equal_to());
+ do_test(arr7, my_equal_to(), false, 4);
+
+ int arr8[] = { 1, 3, 3, 4, 5 };
+ do_test(arr8, my_equal_to(), false);
+
+ int arr9[] = { 3, 3, 3, 4, 4 };
+ do_test(arr9, my_equal_to(), false);
+
+ int arr10[] = { 111, 222, 333, 444, 555 };
+ do_test(arr10, my_equal_to());
+ do_test(arr10, my_equal_to(), false, 4);
+
+ int arr11[] = { 1, 222, 33, 4, 55 };
+ do_test(arr11, my_equal_to());
+
+ int arr12[] = { 111, 333, 333, 444, 555 };
+ do_test(arr12, my_equal_to(), false);
+
+ int arr13[] = { 333, 333, 333, 444, 444 };
+ do_test(arr13, my_equal_to(), false);
+}
+
+bool thrower(int, int) { throw 1; }
+
+void test02()
+{
+ int arr[] = { 11, 22, 33 };
+ using namespace std;
+ is_permutation(begin(arr0), end(arr0), begin(arr), end(arr), thrower);
+}
+
+int main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/check_type2.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/check_type2.cc
new file mode 100644
index 00000000000..9cdf87daf08
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/check_type2.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.12 [alg.is_permutation] Is permutation
+
+// { dg-do compile }
+// { dg-options " -std=gnu++1y " }
+
+#include <algorithm>
+#include <testsuite_iterators.h>
+
+using __gnu_test::forward_iterator_wrapper;
+
+struct X { };
+bool operator==(const X&, const X) { return true; }
+
+struct Y { };
+bool predicate(const Y&, const Y&) { return true; }
+
+bool
+test1(forward_iterator_wrapper<X>& x1,
+ forward_iterator_wrapper<X>& x2)
+{
+ return std::is_permutation(x1, x1, x2, x2);
+}
+
+bool
+test2(forward_iterator_wrapper<Y>& y1,
+ forward_iterator_wrapper<Y>& y2)
+{
+ return std::is_permutation(y1, y1, y2, y2, predicate);
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/mismatch/1.cc b/libstdc++-v3/testsuite/25_algorithms/mismatch/1.cc
index bcf2f5e12f2..c70d778a142 100644
--- a/libstdc++-v3/testsuite/25_algorithms/mismatch/1.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/mismatch/1.cc
@@ -29,6 +29,8 @@ int array1[] = {0, 1};
int array2[] = {1, 0};
int array3[] = {1, 0, 1};
+bool __attribute__((unused)) test = false;
+
void test1a()
{
Container con1(array1, array1);
diff --git a/libstdc++-v3/testsuite/25_algorithms/mismatch/2.cc b/libstdc++-v3/testsuite/25_algorithms/mismatch/2.cc
new file mode 100644
index 00000000000..4eac4a9e3ef
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/mismatch/2.cc
@@ -0,0 +1,175 @@
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.10 [mismatch]
+
+// { dg-options " -std=gnu++1y " }
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
+using __gnu_test::test_container;
+using __gnu_test::input_iterator_wrapper;
+
+typedef test_container<int, input_iterator_wrapper> Container;
+
+int array1[] = {0, 1};
+int array2[] = {1, 0};
+int array3[] = {1, 0, 1};
+
+struct equal_to
+{
+ static int count;
+
+ bool operator()(int l, int r)
+ {
+ ++count;
+ return l == r;
+ }
+} eq;
+
+int equal_to::count = 0;
+
+bool __attribute__((unused)) test = false;
+
+void test1()
+{
+ // empty ranges
+ Container con1(array1, array1);
+ Container con2(array2, array2);
+ auto res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+ res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+ VERIFY( equal_to::count == 0 );
+}
+
+void test2()
+{
+ // first range empty, second non-empty
+ Container con1(array1, array1);
+ Container con2(array2, array2 + 2);
+ auto res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+
+ res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+ VERIFY( equal_to::count == 0 );
+}
+
+void test3()
+{
+ // first range non-empty, second empty
+ Container con1(array1, array1 + 2);
+ Container con2(array2, array2);
+ auto res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+
+ res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+ VERIFY( equal_to::count == 0 );
+}
+
+void test4()
+{
+ // non-empty, mismatching ranges
+ Container con1(array1, array1 + 2);
+ Container con2(array2, array2 + 2);
+ auto res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+
+ con1.bounds.first = array1;
+ con2.bounds.first = array2;
+ res = std::mismatch(con1.begin(), con1.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array1 );
+ VERIFY( res.second.ptr == array2 );
+ VERIFY( equal_to::count == 1 );
+ equal_to::count = 0;
+}
+
+void test5()
+{
+ // non-empty, matching ranges
+ Container con3(array3, array3 + 2);
+ Container con2(array2, array2 + 2);
+ auto res = std::mismatch(con3.begin(), con3.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array3 + 2 );
+ VERIFY( res.second.ptr == array2 + 2 );
+
+ con3.bounds.first = array3;
+ con2.bounds.first = array2;
+ res = std::mismatch(con3.begin(), con3.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array3 + 2 );
+ VERIFY( res.second.ptr == array2 + 2 );
+ VERIFY( equal_to::count == 2 );
+ equal_to::count = 0;
+}
+
+void test6()
+{
+ // non-empty, matching sub-ranges, first range longer
+ Container con3(array3, array3 + 3);
+ Container con2(array2, array2 + 2);
+ auto res = std::mismatch(con3.begin(), con3.end(), con2.begin(), con2.end());
+ VERIFY( res.first.ptr == array3 + 2 );
+ VERIFY( res.second.ptr == array2 + 2 );
+
+ con3.bounds.first = array3;
+ con2.bounds.first = array2;
+ res = std::mismatch(con3.begin(), con3.end(), con2.begin(), con2.end(), eq);
+ VERIFY( res.first.ptr == array3 + 2 );
+ VERIFY( res.second.ptr == array2 + 2 );
+ VERIFY( equal_to::count == 2 );
+ equal_to::count = 0;
+}
+
+void test7()
+{
+ // non-empty, matching sub-ranges, second range longer
+ Container con3(array3, array3 + 3);
+ Container con2(array2, array2 + 2);
+ auto res = std::mismatch(con2.begin(), con2.end(), con3.begin(), con3.end());
+ VERIFY( res.first.ptr == array2 + 2 );
+ VERIFY( res.second.ptr == array3 + 2 );
+
+ con3.bounds.first = array3;
+ con2.bounds.first = array2;
+ res = std::mismatch(con2.begin(), con2.end(), con3.begin(), con3.end(), eq);
+ VERIFY( res.first.ptr == array2 + 2 );
+ VERIFY( res.second.ptr == array3 + 2 );
+ VERIFY( equal_to::count == 2 );
+ equal_to::count = 0;
+}
+
+int main()
+{
+ test1();
+ test2();
+ test3();
+ test4();
+ test5();
+ test6();
+ test7();
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/mismatch/check_type2.cc b/libstdc++-v3/testsuite/25_algorithms/mismatch/check_type2.cc
new file mode 100644
index 00000000000..3ec1f88401a
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/mismatch/check_type2.cc
@@ -0,0 +1,51 @@
+// Copyright (C) 2005-2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 25.2.10 [mismatch]
+
+// { dg-options " -std=gnu++1y " }
+// { dg-do compile }
+
+#include <algorithm>
+#include <utility>
+#include <testsuite_iterators.h>
+
+using __gnu_test::input_iterator_wrapper;
+
+struct Lhs1 { };
+
+struct Rhs1 { };
+
+bool operator==(const Lhs1&, const Rhs1&) {return true;}
+
+struct Lhs2 { };
+
+struct Rhs2 { };
+
+bool predicate(const Lhs2&, const Rhs2&) {return true;}
+
+std::pair<input_iterator_wrapper<Lhs1>, input_iterator_wrapper<Rhs1> >
+test1(input_iterator_wrapper<Lhs1>& lhs1, input_iterator_wrapper<Rhs1>& rhs1)
+{
+ return std::mismatch(lhs1, lhs1, rhs1, rhs1);
+}
+
+std::pair<input_iterator_wrapper<Lhs2>, input_iterator_wrapper<Rhs2> >
+test2(input_iterator_wrapper<Lhs2>& lhs2, input_iterator_wrapper<Rhs2>& rhs2)
+{
+ return std::mismatch(lhs2, lhs2, rhs2, rhs2, predicate);
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
index d7ad5fecf59..d7900823e0d 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
@@ -20,8 +20,8 @@
// { dg-do compile }
// { dg-add-options no_pch }
-// { dg-xfail-if "" { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } { "*" } { "" } }
-// { dg-excess-errors "" { target { { *-*-linux* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } } }
+// { dg-xfail-if "" { { *-*-linux* *-*-gnu* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } { "*" } { "" } }
+// { dg-excess-errors "" { target { { *-*-linux* *-*-gnu* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } } }
#include <math.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc
index ca3c4112889..4794f4ec658 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc
@@ -18,8 +18,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc b/libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc
index 44545ebbae4..2ddf56df838 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc
@@ -18,8 +18,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/quoted.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/quoted.cc
new file mode 100644
index 00000000000..bcfae1e3977
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/quoted.cc
@@ -0,0 +1,88 @@
+// { dg-do run }
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 27.7.6 - Quoted manipulators [quoted.manip]
+
+#include <string>
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ // Basic test from paper.
+ bool test [[gnu::unused]] = true;
+ std::stringstream ss;
+ std::string original = "foolish me";
+ std::string round_trip;
+ ss << std::quoted(original);
+ ss >> std::quoted(round_trip);
+ VERIFY( original == round_trip );
+}
+
+void
+test02()
+{
+ // Test skipws correctness.
+ bool test [[gnu::unused]] = true;
+ std::stringstream ss;
+ ss << std::quoted("Hello Goodbye") << ' ' << 1 << ' ' << 2;
+ std::string song;
+ int thing1, thing2;
+ ss >> std::quoted(song) >> thing1 >> thing2;
+ VERIFY( song == "Hello Goodbye" );
+ VERIFY( thing1 == 1 );
+ VERIFY( thing2 == 2 );
+}
+
+void
+test03()
+{
+ // Test read of unquoted string.
+ bool test [[gnu::unused]] = true;
+ std::stringstream ss;
+ ss << "Alpha Omega";
+ std::string testit;
+ ss >> std::quoted(testit);
+ VERIFY( testit == "Alpha" );
+}
+
+auto
+test04(const std::string& message)
+{
+ // Test 'const basic_string&'
+ bool test [[gnu::unused]] = true;
+ std::stringstream ss;
+ ss << "** Error: " << std::quoted(message) << " **";
+ return ss.str();
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ test03();
+ auto ss = test04("My biscuits are burnin'!");
+ VERIFY( ss == "** Error: \"My biscuits are burnin'!\" **" );
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/quoted.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/quoted.cc
new file mode 100644
index 00000000000..ac4e0fb65e0
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/quoted.cc
@@ -0,0 +1,88 @@
+// { dg-do run }
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// 27.7.6 - Quoted manipulators [quoted.manip]
+
+#include <string>
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ // Basic test from paper.
+ bool test [[gnu::unused]] = true;
+ std::wstringstream ss;
+ std::wstring original = L"foolish me";
+ std::wstring round_trip;
+ ss << std::quoted(original);
+ ss >> std::quoted(round_trip);
+ VERIFY( original == round_trip );
+}
+
+void
+test02()
+{
+ // Test skipws correctness.
+ bool test [[gnu::unused]] = true;
+ std::wstringstream ss;
+ ss << std::quoted(L"Hello Goodbye") << L' ' << 1 << L' ' << 2;
+ std::wstring song;
+ int thing1, thing2;
+ ss >> std::quoted(song) >> thing1 >> thing2;
+ VERIFY( song == L"Hello Goodbye" );
+ VERIFY( thing1 == 1 );
+ VERIFY( thing2 == 2 );
+}
+
+void
+test03()
+{
+ // Test read of unquoted string.
+ bool test [[gnu::unused]] = true;
+ std::wstringstream ss;
+ ss << L"Alpha Omega";
+ std::wstring testit;
+ ss >> std::quoted(testit);
+ VERIFY( testit == L"Alpha" );
+}
+
+auto
+test04(const std::wstring& message)
+{
+ // Test 'const basic_string&'
+ bool test [[gnu::unused]] = true;
+ std::wstringstream ss;
+ ss << L"** Error: " << std::quoted(message) << L" **";
+ return ss.str();
+}
+
+int
+main()
+{
+ test01();
+ test02();
+ test03();
+ auto ss = test04(L"My biscuits are burnin'!");
+ VERIFY( ss == L"** Error: \"My biscuits are burnin'!\" **" );
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/async/42819.cc b/libstdc++-v3/testsuite/30_threads/async/42819.cc
index 91595ce50ed..18cb5d3290b 100644
--- a/libstdc++-v3/testsuite/30_threads/async/42819.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/42819.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/49668.cc b/libstdc++-v3/testsuite/30_threads/async/49668.cc
index 04f79beba8b..5ee00645a80 100644
--- a/libstdc++-v3/testsuite/30_threads/async/49668.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/49668.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/54297.cc b/libstdc++-v3/testsuite/30_threads/async/54297.cc
index e293d75a544..2d09132e02b 100644
--- a/libstdc++-v3/testsuite/30_threads/async/54297.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/54297.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/any.cc b/libstdc++-v3/testsuite/30_threads/async/any.cc
index b3b0f757f84..1ea6e7313b5 100644
--- a/libstdc++-v3/testsuite/30_threads/async/any.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/any.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/async.cc b/libstdc++-v3/testsuite/30_threads/async/async.cc
index 3ebcb1b57ff..f2ce205b20d 100644
--- a/libstdc++-v3/testsuite/30_threads/async/async.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/async.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/launch.cc b/libstdc++-v3/testsuite/30_threads/async/launch.cc
index d7a0c95de1e..de4c45285cf 100644
--- a/libstdc++-v3/testsuite/30_threads/async/launch.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/launch.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/async/sync.cc b/libstdc++-v3/testsuite/30_threads/async/sync.cc
index d4538806e20..e9b112ddf57 100644
--- a/libstdc++-v3/testsuite/30_threads/async/sync.cc
+++ b/libstdc++-v3/testsuite/30_threads/async/sync.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/call_once/39909.cc b/libstdc++-v3/testsuite/30_threads/call_once/39909.cc
index 3f5835fdec3..04562edc09e 100644
--- a/libstdc++-v3/testsuite/30_threads/call_once/39909.cc
+++ b/libstdc++-v3/testsuite/30_threads/call_once/39909.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/call_once/49668.cc b/libstdc++-v3/testsuite/30_threads/call_once/49668.cc
index 0b16764420a..d99c09aea11 100644
--- a/libstdc++-v3/testsuite/30_threads/call_once/49668.cc
+++ b/libstdc++-v3/testsuite/30_threads/call_once/49668.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc b/libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc
index de12936fbea..392ab8ca02e 100644
--- a/libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc
+++ b/libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc
index 118d9be5e9d..63874d79746 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc
index 53f722ef283..5dcc9a20501 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc
index db64ca72ea3..c5a96f62b14 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
index c46a2a2029b..52504dd516d 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc
index 296aaf0cccc..e16a873a0b2 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* hppa*-hp-hpux11* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* hppa*-hp-hpux11* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc
index 89f7edf5dcd..cd89697a2bb 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc
index 1865522a526..2bee32591ba 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc
index d5435b643f1..ce52847619d 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc
index f1dccb2e9c4..32bed3beb61 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc
index 728c409cef9..6a3fe1335f8 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
index 4f7461f9022..1e38cd7082f 100644
--- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/move.cc b/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
index 1d00f6770ef..4d2c5a6c9c1 100644
--- a/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/45133.cc b/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
index 40bb3266c6b..17819b8aee3 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/get.cc b/libstdc++-v3/testsuite/30_threads/future/members/get.cc
index 04c8a137808..4535e5e25ba 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/get.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/get.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/get2.cc b/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
index 2f052405cf6..86b9786574b 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/share.cc b/libstdc++-v3/testsuite/30_threads/future/members/share.cc
index 788c00588ef..9e7b9dd0c2d 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/share.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/share.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/valid.cc b/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
index 162d3396cbf..b01147e7bf5 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
index f3902c3f41d..8d37e44377f 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
index d436dccc261..8ab087b5adb 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
index 9bb8e1d68dc..8f270e55b56 100644
--- a/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/lock/1.cc b/libstdc++-v3/testsuite/30_threads/lock/1.cc
index 8a4428b0d9a..74a1eca6ac8 100644
--- a/libstdc++-v3/testsuite/30_threads/lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/lock/2.cc b/libstdc++-v3/testsuite/30_threads/lock/2.cc
index 0924ee1651a..15405d42e2f 100644
--- a/libstdc++-v3/testsuite/30_threads/lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/lock/3.cc b/libstdc++-v3/testsuite/30_threads/lock/3.cc
index 176bbdf1f0c..242f19b715b 100644
--- a/libstdc++-v3/testsuite/30_threads/lock/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/lock/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/lock/4.cc b/libstdc++-v3/testsuite/30_threads/lock/4.cc
index 6283af8e4d4..128463c48e7 100644
--- a/libstdc++-v3/testsuite/30_threads/lock/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/lock/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc
index 2aa0b9fb519..c81df9385ce 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc b/libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc
index d8237de52b9..d57aabe8579 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc b/libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc
index 98db0aa24a3..81415bae19b 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc b/libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc
index c601e061a2e..870ac748118 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc
index 96e26bc7d73..0afc49615ef 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc
index 45c8d0b0b52..d6b033d091e 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc
index bb3fcd412e4..cbdbcdf9369 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
@@ -24,6 +24,7 @@
#include <mutex>
+#include <thread>
#include <system_error>
#include <testsuite_hooks.h>
@@ -38,15 +39,18 @@ int main()
m.lock();
bool b;
- try
- {
- b = m.try_lock();
- VERIFY( !b );
- }
- catch (const std::system_error& e)
- {
- VERIFY( false );
- }
+ std::thread t([&] {
+ try
+ {
+ b = m.try_lock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ });
+ t.join();
+ VERIFY( !b );
m.unlock();
}
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc b/libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc
index b9169f99307..6efc9c111ee 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
index 91e186bb7aa..4c30fa3d2cd 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
index 86baa69c350..7a9ac6ab86f 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
index 3411192a7fa..eddc9657045 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
index bff7bf72d73..df746cb74b2 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
index 02296bb5aa6..f64c233e952 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
@@ -1,5 +1,5 @@
-// { dg-do compile { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do compile { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++11 -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++11 -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
index 5a6456a92ea..b1ebee6ac38 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
index 0c0c5014bc1..ef1b61b9867 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
index 4c6dd87c608..926cb926857 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
index d508cc6b902..dc1b58160e8 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
index e867c181534..db6b23e48c8 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
index f1a643c0bb4..cfa72a361fa 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
index 00459fb63ba..100b501b722 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
index 8070533b1da..c500214e8dc 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
index 3373b58ae3e..424f5b51973 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
index 62d73900763..8bdf05e7148 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
index b2241ee73aa..54582d78bca 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
index a3af379c5d6..eb2dcd039c7 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
index ad2c1f00a83..a3281fff5fd 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
index 9f8f13e9b66..3c5b31efc97 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
index 33bf21f59fd..defec1f22a7 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
index 737fe716f75..fcfd4b7e6e2 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
index 5594b2cc865..832ee31fe28 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
index 43edc47c181..7d5b1bec6dc 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc b/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
index 916b70738be..d9083bab6f1 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
index 6fea6e2abbd..2f5795bbb81 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
index 920c1169631..adfa203fdad 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
index 84c26d6ffcb..4820a22609f 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
index f9c7bf74810..2fe51226e89 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
index 2ee5987f02b..a9545a3f3a4 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
index 5e958da077e..ee7c907b18e 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc b/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
index cc4ad9bbd5d..2046b6ea1c1 100644
--- a/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
+++ b/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc
index 3c5f94b6f4f..6c1a8fa34ae 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc
index cdebf21ba5f..e3714174273 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc
index 794e565b72d..27612762b03 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc
index 4da02ca8f79..b83f84f3984 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc
index a1d40308667..d2fa8766956 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc
index 28d67b26056..91322c48437 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc
index e40c9fceccf..8c420913706 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc
index 7d7ad0420e4..02e3271a661 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
index 1cdd976062a..25e99881456 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
index c7901b07b45..8e29c55d8f5 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
index ed1c1dbe093..9fd2b976f6b 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
index 9dc396e17e0..c036272bfc4 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
index 64a930521a7..ab3f4c1d03f 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
index 16609db6329..a30d84766ee 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
index 5c5acbba00a..23eed9565ef 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
index 1506592ad14..87c7dca840d 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options "-std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options "-std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
index 806f4fb12bb..b75e8aa77f5 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
index 9abf0db70e2..4df55941d85 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
index 7c67639a3c1..f5aadcb6429 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
index 5c5acbba00a..23eed9565ef 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
index 9034c7a417a..527fecb73fd 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
index 23284b92431..75124f76f15 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
index 0654433b03b..cf2da065f44 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
index a24ea26f96e..dee378e9caf 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
index 9d2628dff62..2aeaeb33fd0 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
index 2fed6d510ed..fa1d7a674d6 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
index 025cbc6040d..e8a5e7845ed 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
index c92597eba3c..c32ee258418 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
index 084393587a2..697f0e7b700 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
index d2f12e9ed0d..7588f066734 100644
--- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/1.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/1.cc
new file mode 100644
index 00000000000..c05044e3471
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/1.cc
@@ -0,0 +1,53 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ lock_type lock;
+
+ VERIFY( !lock.owns_lock() );
+ VERIFY( !(bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/2.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/2.cc
new file mode 100644
index 00000000000..02d1d6bceca
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/2.cc
@@ -0,0 +1,54 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type lock(m);
+
+ VERIFY( lock.owns_lock() );
+ VERIFY( (bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/3.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/3.cc
new file mode 100644
index 00000000000..9af2bfa46a0
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/3.cc
@@ -0,0 +1,54 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type lock(m, std::defer_lock);
+
+ VERIFY( !lock.owns_lock() );
+ VERIFY( !(bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/4.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/4.cc
new file mode 100644
index 00000000000..e80d1ae8fc7
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/4.cc
@@ -0,0 +1,54 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type lock(m, std::try_to_lock);
+
+ VERIFY( lock.owns_lock() );
+ VERIFY( (bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/5.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/5.cc
new file mode 100644
index 00000000000..95a704c935e
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/5.cc
@@ -0,0 +1,58 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads-timed "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+ typedef std::chrono::system_clock clock_type;
+
+ try
+ {
+ clock_type::time_point t = clock_type::now() + std::chrono::seconds(5);
+
+ mutex_type m;
+ lock_type lock(m, t);
+
+ VERIFY( lock.owns_lock() );
+ VERIFY( (bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/cons/6.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/6.cc
new file mode 100644
index 00000000000..a1a8eea7908
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/cons/6.cc
@@ -0,0 +1,58 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads-timed "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+ typedef std::chrono::system_clock clock_type;
+
+ try
+ {
+ clock_type::duration d = std::chrono::seconds(5);
+
+ mutex_type m;
+ lock_type lock(m, d);
+
+ VERIFY( lock.owns_lock() );
+ VERIFY( (bool)lock );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/locking/1.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/1.cc
new file mode 100644
index 00000000000..1d52cd928cd
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/1.cc
@@ -0,0 +1,61 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l(m, std::defer_lock);
+
+ l.lock();
+
+ VERIFY( (bool)l );
+ VERIFY( l.owns_lock() );
+
+ l.unlock();
+
+ VERIFY( !(bool)l );
+ VERIFY( !l.owns_lock() );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/locking/2.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/2.cc
new file mode 100644
index 00000000000..38886d97b1c
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/2.cc
@@ -0,0 +1,106 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ lock_type l;
+
+ // Lock shared_lock w/o mutex
+ try
+ {
+ l.lock();
+ }
+ catch (const std::system_error& ex)
+ {
+ VERIFY( ex.code() == std::make_error_code
+ (std::errc::operation_not_permitted) );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+}
+
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l(m);
+
+ // Lock already locked shared_lock.
+ try
+ {
+ l.lock();
+ }
+ catch (const std::system_error& ex)
+ {
+ VERIFY( ex.code() == std::make_error_code
+ (std::errc::resource_deadlock_would_occur) );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+}
+
+int main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/locking/3.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/3.cc
new file mode 100644
index 00000000000..a8b3ff7dec6
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/3.cc
@@ -0,0 +1,67 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads-timed "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l(m, std::defer_lock);
+
+ try
+ {
+ l.try_lock_for(std::chrono::milliseconds(100));
+ }
+ catch(const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ VERIFY( l.owns_lock() );
+ }
+ catch (const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/locking/4.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/4.cc
new file mode 100644
index 00000000000..4b4743e14c6
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/locking/4.cc
@@ -0,0 +1,69 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads-timed "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <chrono>
+#include <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+ typedef std::chrono::system_clock clock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l(m, std::defer_lock);
+ clock_type::time_point t = clock_type::now() + std::chrono::seconds(1);
+
+ try
+ {
+ l.try_lock_until(t);
+ }
+ catch(const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ VERIFY( l.owns_lock() );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/1.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/1.cc
new file mode 100644
index 00000000000..fd661de63ce
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/1.cc
@@ -0,0 +1,68 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l1(m);
+ lock_type l2;
+
+ try
+ {
+ l1.swap(l2);
+ }
+ catch (const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+
+ VERIFY( !(bool)l1 );
+ VERIFY( (bool)l2 );
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/2.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/2.cc
new file mode 100644
index 00000000000..c22340060b9
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/modifiers/2.cc
@@ -0,0 +1,68 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+ typedef std::shared_lock<mutex_type> lock_type;
+
+ try
+ {
+ mutex_type m;
+ lock_type l1(m);
+ lock_type l2;
+
+ try
+ {
+ l1.swap(l2);
+ }
+ catch (const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+
+ VERIFY( !(bool)l1 );
+ VERIFY( (bool)l2 );
+ }
+ catch (const std::system_error&)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/explicit_instantiation.cc
new file mode 100644
index 00000000000..53d7a98641f
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/explicit_instantiation.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+
+// NB: This file is for testing with NO OTHER INCLUDES.
+
+#include <shared_mutex>
+
+namespace std
+{
+ template class shared_lock<shared_mutex>;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/typedefs.cc b/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/typedefs.cc
new file mode 100644
index 00000000000..cd4fa3ea851
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_lock/requirements/typedefs.cc
@@ -0,0 +1,33 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+
+// NB: This file is for testing with NO OTHER INCLUDES.
+
+#include <shared_mutex>
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::shared_lock<std::shared_mutex> test_type;
+ typedef test_type::mutex_type mutex_type;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/1.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/1.cc
new file mode 100644
index 00000000000..794e8ae57c3
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/1.cc
@@ -0,0 +1,49 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+
+ try
+ {
+ mutex_type m1;
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/assign_neg.cc
new file mode 100644
index 00000000000..092cd100bac
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/assign_neg.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2008-2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+
+void test01()
+{
+ // assign
+ typedef std::shared_mutex mutex_type;
+ mutex_type m1;
+ mutex_type m2;
+ m1 = m2; // { dg-error "deleted" }
+}
+
+// { dg-prune-output "include" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/copy_neg.cc
new file mode 100644
index 00000000000..a9faf279de1
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/cons/copy_neg.cc
@@ -0,0 +1,34 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+
+void test01()
+{
+ // assign
+ typedef std::shared_mutex mutex_type;
+ mutex_type m1;
+ mutex_type m2(m1); // { dg-error "deleted" }
+}
+
+// { dg-prune-output "include" }
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/requirements/standard_layout.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/requirements/standard_layout.cc
new file mode 100644
index 00000000000..84f22cc239f
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/requirements/standard_layout.cc
@@ -0,0 +1,31 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <testsuite_common_types.h>
+
+void test01()
+{
+ __gnu_test::standard_layout test;
+ test.operator()<std::shared_mutex>();
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/1.cc
new file mode 100644
index 00000000000..7381ec2e862
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/1.cc
@@ -0,0 +1,52 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ bool b = m.try_lock();
+ VERIFY( b );
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/2.cc
new file mode 100644
index 00000000000..393d9f2dba7
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/shared_mutex/try_lock/2.cc
@@ -0,0 +1,67 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++1y -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++1y " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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 <shared_mutex>
+#include <thread>
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::shared_mutex mutex_type;
+
+ try
+ {
+ mutex_type m;
+ m.lock();
+ bool b;
+
+ std::thread t([&] {
+ try
+ {
+ b = m.try_lock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ });
+ t.join();
+ VERIFY( !b );
+
+ m.unlock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ catch (...)
+ {
+ VERIFY( false );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/1.cc b/libstdc++-v3/testsuite/30_threads/this_thread/1.cc
index 4a83fe23b38..a3c18536545 100644
--- a/libstdc++-v3/testsuite/30_threads/this_thread/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/this_thread/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/2.cc b/libstdc++-v3/testsuite/30_threads/this_thread/2.cc
index fb26086ff01..0438972cb81 100644
--- a/libstdc++-v3/testsuite/30_threads/this_thread/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/this_thread/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/3.cc b/libstdc++-v3/testsuite/30_threads/this_thread/3.cc
index be28dc9389a..6666cf67dbe 100644
--- a/libstdc++-v3/testsuite/30_threads/this_thread/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/this_thread/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/4.cc b/libstdc++-v3/testsuite/30_threads/this_thread/4.cc
index c6fb7edbe96..f124a1cf5eb 100644
--- a/libstdc++-v3/testsuite/30_threads/this_thread/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/this_thread/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/1.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/1.cc
index 70092f8afa3..6236ba74be7 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/2.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/2.cc
index 4de774b1543..7101864b6ae 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/3.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/3.cc
index 8a42fa159d0..6b81c35270b 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/4.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/4.cc
index 5454b47afd1..ab3894fa034 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc
index 316dde5b247..3eec26dcef4 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/5.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/5.cc
index 585b1d64c67..cb574432a16 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/5.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/5.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/6.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/6.cc
index 39911bbbaae..1fcd057af99 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/6.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/6.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/7.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/7.cc
index bab8fecb199..7b4edd98c48 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/7.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/7.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/8.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/8.cc
index 74ab5aa825c..6208a6d204b 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/8.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/8.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/9.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/9.cc
index c88cef659e2..317df670a39 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/9.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/9.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc
index d275440149a..632cc0f9942 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/1.cc b/libstdc++-v3/testsuite/30_threads/thread/members/1.cc
index 627534436ae..9bd2e189583 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/2.cc b/libstdc++-v3/testsuite/30_threads/thread/members/2.cc
index 2cef7ce18f0..8d395ed68ba 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/3.cc b/libstdc++-v3/testsuite/30_threads/thread/members/3.cc
index 9e3c3c4b761..86cee7159e7 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/4.cc b/libstdc++-v3/testsuite/30_threads/thread/members/4.cc
index 382536df583..edacdb27ef5 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/5.cc b/libstdc++-v3/testsuite/30_threads/thread/members/5.cc
index a6aaa635d90..114b6a988b5 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/5.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/5.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc b/libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc
index 7cff28a67b6..e936ad275dc 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/native_handle/cancel.cc b/libstdc++-v3/testsuite/30_threads/thread/native_handle/cancel.cc
index 874fb8e8654..600274bb7be 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/native_handle/cancel.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/native_handle/cancel.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/thread/native_handle/typesizes.cc
index 85673befb27..ca4ee090009 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-linux* *-*-solaris* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
diff --git a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
index 202107c0ce3..31f118aca02 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc
index ba7ae2ce57e..303bc679de0 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
index 6d3aa589c05..d5278d6f35c 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc
index 1d8ad2aba2d..33791a0e097 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc
index 96545631c2f..992105e0702 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
index b0b0431996b..0fbd0121481 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc
index eb9ae4c2b6a..41e371f1a9f 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc
index bb4ddbff1ce..b6f63e8c90e 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc
index 7c1ea7c04c1..3d2fe1ee75a 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc
index ce7c4ee3d68..c0af31509f7 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc
index f435fd62af6..8eac47c95e8 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc
index eb9ae4c2b6a..41e371f1a9f 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc
index bb4ddbff1ce..b6f63e8c90e 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc b/libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc
index 6125ea77d34..9b394e998fc 100644
--- a/libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/try_lock/1.cc b/libstdc++-v3/testsuite/30_threads/try_lock/1.cc
index e8b7004b893..22eb4b66226 100644
--- a/libstdc++-v3/testsuite/30_threads/try_lock/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/try_lock/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/try_lock/2.cc b/libstdc++-v3/testsuite/30_threads/try_lock/2.cc
index a2f6f4b0fca..6d7b8eeca18 100644
--- a/libstdc++-v3/testsuite/30_threads/try_lock/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/try_lock/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/try_lock/3.cc b/libstdc++-v3/testsuite/30_threads/try_lock/3.cc
index 272c43402f8..740eb061f53 100644
--- a/libstdc++-v3/testsuite/30_threads/try_lock/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/try_lock/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/try_lock/4.cc b/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
index 9449e0ca514..32bb66285f3 100644
--- a/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc
index afba658c741..6f0f707317a 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc
index 03720279acf..5a66f272b58 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc
index 4306e31fe53..0d95bf9af3c 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc
index 3c405cbef16..e6b5f4d2537 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc
index 925fd2001d6..7d7f97301af 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc
index 33df5902f25..718aba7fade 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc
index 31744565917..7d5039aaacb 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
index 36934a3a9df..5d18a1a0c6b 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc
index 88ba9579cda..b403a262fb7 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc
index 1878eb495bd..ff947c9ba59 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc
index 38c03e5e084..cfdf9ccaa3f 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc
index c067a289a7d..2fdbea8d7e3 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc
@@ -1,5 +1,5 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" }
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index 7678f7b139d..31e96b9b8ed 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -277,7 +277,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXLINKFLAGS =
-@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = -L$(top_builddir)/libsupc++/.libs --whole-archive -lvtv_init --no-whole-archive
+@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXLINKFLAGS = "-Wl,-lvtv"
@ENABLE_VTABLE_VERIFY_FALSE@VTV_CXXFLAGS =
@ENABLE_VTABLE_VERIFY_TRUE@VTV_CXXFLAGS = -fvtable-verify=std \
@ENABLE_VTABLE_VERIFY_TRUE@ -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc b/libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc
index 9d1c520114e..3d07dd35f7c 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc
@@ -1,5 +1,5 @@
// { dg-require-sharedlib "" }
-// { dg-options "-g -O2 -pthread -ldl" { target *-*-linux* } }
+// { dg-options "-g -O2 -pthread -ldl" { target *-*-linux* *-*-gnu* } }
// Copyright (C) 2004-2013 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/ext/profile/mh.cc b/libstdc++-v3/testsuite/ext/profile/mh.cc
index 593e1a72046..3265d2e3ead 100644
--- a/libstdc++-v3/testsuite/ext/profile/mh.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mh.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target *-*-linux* } }
+// { dg-do compile { target *-*-linux* *-*-gnu* } }
// { dg-xfail-if "" { uclibc } { "*" } { "" } }
// { dg-require-profile-mode "" }
diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
index d77c7124990..23c551b0b6e 100644
--- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
@@ -25,4 +25,4 @@
#include <vector>
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 269 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 275 }
diff --git a/libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc b/libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc
index 689d90679ca..f32350165c0 100644
--- a/libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc
+++ b/libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc
@@ -17,8 +17,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <ext/rope>
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 5d0a2ff7060..c339044a656 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -161,7 +161,9 @@ proc libstdc++_init { testfile } {
set v3-sharedlib 0
set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
if {$sharedlibdir != ""} {
- if { [string match "*-*-linux*" $target_triplet] && [isnative] } {
+ if { ([string match "*-*-linux*" $target_triplet]
+ || [string match "*-*-gnu*" $target_triplet])
+ && [isnative] } then {
set v3-sharedlib 1
verbose -log "shared library support detected"
}
@@ -626,7 +628,7 @@ proc v3-build_support { } {
# Compile with "-w" so that warnings issued by the compiler
# do not prevent compilation.
if { [v3_target_compile $srcdir/util/$f $object_file "sharedlib" \
- [list "incdir=$srcdir" "additional_flags=-w -shared -fPIC -DPIC"]]
+ [list "incdir=$srcdir" "additional_flags=-fno-inline -w -shared -fPIC -DPIC"]]
!= "" } {
error "could not compile $f"
}
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc
index 547213f9b85..0e4e6c20260 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/shared_ptr.cc
@@ -1,5 +1,5 @@
// { dg-do run }
-// { dg-options "-std=gnu++11 -g" }
+// { dg-options "-std=gnu++11 -g -O0" }
// Copyright (C) 2012-2013 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc
index d23a6e52bc2..9012dc3a783 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc
@@ -17,8 +17,8 @@
// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <tr1/memory>
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc
index 0d8ce046cb7..e5605e45056 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc
@@ -17,8 +17,8 @@
// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* } }
// { dg-options "-pthreads" { target *-*-solaris* } }
#include <tr1/memory>
diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc
new file mode 100644
index 00000000000..f2a5d7511c4
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/airy.cc
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// 2013-06-12 Edward Smith-Rowland <3dw4rd@verizon.net>
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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/>.
+
+// PR libstdc++/56430 - In __airy: return-statement with a value,
+// in function returning 'void'.
+
+#include <tr1/cmath>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ double x, Ai, Bi, Aip, Bip;
+ x = 1.0;
+ std::tr1::__detail::__airy(x, Ai, Bi, Aip, Bip);
+}
diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h
index 2360274289e..d569eb0712d 100644
--- a/libstdc++-v3/testsuite/util/testsuite_allocator.h
+++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h
@@ -28,6 +28,7 @@
#include <tr1/unordered_map>
#include <bits/move.h>
+#include <ext/pointer.h>
#include <testsuite_hooks.h>
namespace __gnu_test
@@ -488,6 +489,36 @@ namespace __gnu_test
{ typedef ExplicitConsAlloc<Up> other; };
};
+#if __cplusplus >= 201103L
+ template<typename Tp>
+ class CustomPointerAlloc : public std::allocator<Tp>
+ {
+ template<typename Up, typename Sp = __gnu_cxx::_Std_pointer_impl<Up>>
+ using Ptr = __gnu_cxx::_Pointer_adapter<Sp>;
+
+ public:
+ CustomPointerAlloc() = default;
+
+ template<typename Up>
+ CustomPointerAlloc(const CustomPointerAlloc<Up>&) { }
+
+ template<typename Up>
+ struct rebind
+ { typedef CustomPointerAlloc<Up> other; };
+
+ typedef Ptr<Tp> pointer;
+ typedef Ptr<const Tp> const_pointer;
+ typedef Ptr<void> void_pointer;
+ typedef Ptr<const void> const_void_pointer;
+
+ pointer allocate(std::size_t n, pointer = {})
+ { return pointer(std::allocator<Tp>::allocate(n)); }
+
+ void deallocate(pointer p, std::size_t n)
+ { std::allocator<Tp>::deallocate(std::addressof(*p), n); }
+ };
+#endif
+
} // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_ALLOCATOR_H
diff --git a/libstdc++-v3/testsuite/util/testsuite_containers.h b/libstdc++-v3/testsuite/util/testsuite_containers.h
index 723f8adaf80..7e41d05ef43 100644
--- a/libstdc++-v3/testsuite/util/testsuite_containers.h
+++ b/libstdc++-v3/testsuite/util/testsuite_containers.h
@@ -223,6 +223,58 @@ namespace __gnu_test
template<typename _Tp>
_Tp citerator<_Tp>::_S_container;
+ // DR 130 vs. C++98 vs. C++11.
+ // Defined in testsuite_shared.cc.
+ void
+ erase_external(std::set<int>& s);
+
+ void
+ erase_external(std::multiset<int>& s);
+
+ void
+ erase_external(std::map<int, int>& s);
+
+ void
+ erase_external(std::multimap<int, int>& s);
+
+ void
+ erase_external_iterators(std::set<int>& s);
+
+ void
+ erase_external_iterators(std::multiset<int>& s);
+
+ void
+ erase_external_iterators(std::map<int, int>& s);
+
+ void
+ erase_external_iterators(std::multimap<int, int>& s);
+
+// NB: "must be compiled with C++11"
+#if __cplusplus >= 201103L
+template<typename _Tp>
+ void
+ linkage_check_cxx98_cxx11_erase(_Tp& container)
+ {
+ // Crashing when exteral reference and internal reference symbols are
+ // equivalently mangled but have different size return types in C++98
+ // and C++11 signatures.
+ erase_external(container); // C++98
+ container.erase(container.begin()); // C++11
+ }
+
+template<typename _Tp>
+ void
+ linkage_check_cxx98_cxx11_erase_iterators(_Tp& container)
+ {
+ // Crashing when exteral reference and internal reference symbols are
+ // equivalently mangled but have different size return types in C++98
+ // and C++11 signatures.
+ erase_external_iterators(container);// C++98
+
+ auto iter = container.begin();
+ container.erase(iter, ++iter); // C++11
+ }
+#endif
} // namespace __gnu_test
diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 757282bd014..9bb58588651 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -116,7 +116,7 @@ namespace __gnu_test
*
* This class takes a pointer and wraps it to provide exactly
* the requirements of a output_iterator. It should not be
- * instansiated directly, but generated from a test_container
+ * instantiated directly, but generated from a test_container
*/
template<class T>
struct output_iterator_wrapper
@@ -177,7 +177,7 @@ namespace __gnu_test
*
* This class takes a pointer and wraps it to provide exactly
* the requirements of a input_iterator. It should not be
- * instansiated directly, but generated from a test_container
+ * instantiated directly, but generated from a test_container
*/
template<class T>
class input_iterator_wrapper
@@ -259,7 +259,7 @@ namespace __gnu_test
*
* This class takes a pointer and wraps it to provide exactly
* the requirements of a forward_iterator. It should not be
- * instansiated directly, but generated from a test_container
+ * instantiated directly, but generated from a test_container
*/
template<class T>
struct forward_iterator_wrapper : public input_iterator_wrapper<T>
@@ -313,7 +313,7 @@ namespace __gnu_test
*
* This class takes a pointer and wraps it to provide exactly
* the requirements of a forward_iterator. It should not be
- * instansiated directly, but generated from a test_container
+ * instantiated directly, but generated from a test_container
*/
template<class T>
struct bidirectional_iterator_wrapper : public forward_iterator_wrapper<T>
@@ -377,7 +377,7 @@ namespace __gnu_test
*
* This class takes a pointer and wraps it to provide exactly
* the requirements of a forward_iterator. It should not be
- * instansiated directly, but generated from a test_container
+ * instantiated directly, but generated from a test_container
*/
template<class T>
struct random_access_iterator_wrapper
diff --git a/libstdc++-v3/testsuite/util/testsuite_performance.h b/libstdc++-v3/testsuite/util/testsuite_performance.h
index 4e2212ac960..c4a161fa165 100644
--- a/libstdc++-v3/testsuite/util/testsuite_performance.h
+++ b/libstdc++-v3/testsuite/util/testsuite_performance.h
@@ -35,7 +35,7 @@
#include <cxxabi.h>
#include <testsuite_common_types.h>
-#ifdef __linux__
+#if defined (__linux__) || defined (__GLIBC__)
#include <malloc.h>
#elif defined (__FreeBSD__)
extern "C"
diff --git a/libstdc++-v3/testsuite/util/testsuite_shared.cc b/libstdc++-v3/testsuite/util/testsuite_shared.cc
index ed7f4716f86..e07a03e6a47 100644
--- a/libstdc++-v3/testsuite/util/testsuite_shared.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_shared.cc
@@ -19,9 +19,13 @@
#include <stdexcept>
#include <iostream>
#include <sstream>
+#include <set>
+#include <map>
#include <ext/mt_allocator.h>
#include <bits/functexcept.h>
+namespace __gnu_test
+{
// libstdc++/22309
extern "C" void
try_allocation()
@@ -70,3 +74,57 @@ try_function_random_fail()
// Randomly throw. See if other threads cleanup.
std::__throw_bad_exception();
}
+
+#if __cplusplus < 201103L
+// "must be compiled with C++98"
+ void
+ erase_external(std::set<int>& s)
+ { s.erase(s.begin()); }
+
+ void
+ erase_external(std::multiset<int>& s)
+ { s.erase(s.begin()); }
+
+ void
+ erase_external(std::map<int, int>& s)
+ { s.erase(s.begin()); }
+
+ void
+ erase_external(std::multimap<int, int>& s)
+ { s.erase(s.begin()); }
+
+ void
+ erase_external_iterators(std::set<int>& s)
+ {
+ typedef typename std::set<int>::iterator iterator_type;
+ iterator_type iter = s.begin();
+ s.erase(iter, ++iter);
+ }
+
+ void
+ erase_external_iterators(std::multiset<int>& s)
+ {
+ typedef typename std::multiset<int>::iterator iterator_type;
+ iterator_type iter = s.begin();
+ s.erase(iter, ++iter);
+ }
+
+ void
+ erase_external_iterators(std::map<int, int>& s)
+ {
+ typedef typename std::map<int, int>::iterator iterator_type;
+ iterator_type iter = s.begin();
+ s.erase(iter, ++iter);
+ }
+
+
+ void
+ erase_external_iterators(std::multimap<int, int>& s)
+ {
+ typedef typename std::multimap<int, int>::iterator iterator_type;
+ iterator_type iter = s.begin();
+ s.erase(iter, ++iter);
+ }
+#endif
+
+} // end namepace __gnu_test