aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2016-03-30 22:07:45 +0000
committerMichael Meissner <meissner@linux.vnet.ibm.com>2016-03-30 22:07:45 +0000
commit8445c9b065c2cf5fc637caf86d1a20493135af79 (patch)
treeb29e4d12674c675286e1c2fb04cfdb97fb17cd83
parentc0c667a4e2cb1c2c64348d890a2a2d2119c3d103 (diff)
parent5416ccc1643061d74894c51c8a98adde9ab22417 (diff)
Merge up to 234598
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/pre-gcc7@234601 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog13
-rw-r--r--MAINTAINERS1
-rw-r--r--boehm-gc/ChangeLog11
-rw-r--r--boehm-gc/configure.host2
-rw-r--r--boehm-gc/include/private/gcconfig.h11
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--gcc/ChangeLog732
-rw-r--r--gcc/ChangeLog.ibm19
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/gcc-interface/Makefile.in31
-rw-r--r--gcc/ada/gcc-interface/decl.c17
-rw-r--r--gcc/ada/s-osinte-gnu.ads801
-rw-r--r--gcc/bitmap.c63
-rw-r--r--gcc/bitmap.h3
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/c-family/ChangeLog28
-rw-r--r--gcc/c-family/c-common.c4
-rw-r--r--gcc/c-family/c-cppbuiltin.c8
-rw-r--r--gcc/c-family/c-indentation.c10
-rw-r--r--gcc/c-family/c.opt4
-rw-r--r--gcc/c/ChangeLog20
-rw-r--r--gcc/c/c-parser.c8
-rw-r--r--gcc/c/c-typeck.c18
-rw-r--r--gcc/calls.c6
-rw-r--r--gcc/cgraph.c4
-rw-r--r--gcc/cgraph.h3
-rw-r--r--gcc/cgraphclones.c8
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--gcc/combine.c19
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/config/aarch64/aarch64-protos.h4
-rw-r--r--gcc/config/aarch64/aarch64.c130
-rw-r--r--gcc/config/aarch64/aarch64.h2
-rw-r--r--gcc/config/arm/arm.c21
-rw-r--r--gcc/config/arm/arm1020e.md11
-rw-r--r--gcc/config/arm/driver-arm.c11
-rw-r--r--gcc/config/avr/avr.md2
-rw-r--r--gcc/config/epiphany/epiphany.md4
-rw-r--r--gcc/config/ft32/ft32.md8
-rw-r--r--gcc/config/ft32/ft32.opt4
-rw-r--r--gcc/config/gnu.h8
-rw-r--r--gcc/config/i386/gnu.h4
-rw-r--r--gcc/config/i386/i386.c61
-rw-r--r--gcc/config/i386/i386.h3
-rw-r--r--gcc/config/i386/i386.md121
-rw-r--r--gcc/config/i386/sol2.h5
-rw-r--r--gcc/config/i386/sse.md12
-rw-r--r--gcc/config/i386/znver1.md90
-rw-r--r--gcc/config/moxie/moxiebox.h6
-rw-r--r--gcc/config/nvptx/nvptx.c4
-rw-r--r--gcc/config/pa/constraints.md4
-rw-r--r--gcc/config/pa/pa.md5
-rw-r--r--gcc/config/rs6000/constraints.md2
-rw-r--r--gcc/config/rs6000/predicates.md7
-rw-r--r--gcc/config/rs6000/rs6000-c.c16
-rw-r--r--gcc/config/rs6000/rs6000-cpus.def1
-rw-r--r--gcc/config/rs6000/rs6000.md26
-rw-r--r--gcc/config/rx/rx.c2
-rw-r--r--gcc/config/sol2.c5
-rw-r--r--gcc/coverage.c6
-rw-r--r--gcc/cp/ChangeLog211
-rw-r--r--gcc/cp/call.c41
-rw-r--r--gcc/cp/class.c73
-rw-r--r--gcc/cp/constexpr.c131
-rw-r--r--gcc/cp/cp-gimplify.c21
-rw-r--r--gcc/cp/cp-tree.h8
-rw-r--r--gcc/cp/cp-ubsan.c17
-rw-r--r--gcc/cp/decl.c125
-rw-r--r--gcc/cp/decl2.c8
-rw-r--r--gcc/cp/init.c21
-rw-r--r--gcc/cp/parser.c8
-rw-r--r--gcc/cp/pt.c21
-rw-r--r--gcc/cp/search.c4
-rw-r--r--gcc/cp/tree.c14
-rw-r--r--gcc/cp/typeck.c86
-rw-r--r--gcc/cp/typeck2.c19
-rw-r--r--gcc/diagnostic-show-locus.c6
-rw-r--r--gcc/doc/extend.texi88
-rw-r--r--gcc/doc/invoke.texi21
-rw-r--r--gcc/dwarf2out.c27
-rw-r--r--gcc/fold-const.c23
-rw-r--r--gcc/fortran/ChangeLog27
-rw-r--r--gcc/fortran/gfortran.h2
-rw-r--r--gcc/fortran/openmp.c2
-rw-r--r--gcc/fortran/scanner.c2
-rw-r--r--gcc/fortran/trans-decl.c14
-rw-r--r--gcc/fortran/trans-expr.c26
-rw-r--r--gcc/fortran/trans-openmp.c6
-rw-r--r--gcc/fortran/trans-stmt.c12
-rw-r--r--gcc/fortran/trans.h3
-rw-r--r--gcc/function.h4
-rw-r--r--gcc/genmatch.c72
-rw-r--r--gcc/genrecog.c2
-rw-r--r--gcc/gimple-match-head.c1
-rw-r--r--gcc/gimplify.c55
-rw-r--r--gcc/graphite-scop-detection.c10
-rw-r--r--gcc/hsa-brig.c2
-rw-r--r--gcc/hsa-dump.c6
-rw-r--r--gcc/hsa-gen.c23
-rw-r--r--gcc/hsa.h3
-rw-r--r--gcc/ipa-chkp.c20
-rw-r--r--gcc/ipa-devirt.c47
-rw-r--r--gcc/ipa-icf.c5
-rw-r--r--gcc/ipa-inline-transform.c3
-rw-r--r--gcc/ipa-polymorphic-call.c41
-rw-r--r--gcc/ipa-prop.c4
-rw-r--r--gcc/ira-color.c46
-rw-r--r--gcc/ira.c47
-rw-r--r--gcc/lower-subreg.c3
-rw-r--r--gcc/lra-constraints.c9
-rw-r--r--gcc/lra.c4
-rw-r--r--gcc/lto-streamer-in.c1
-rw-r--r--gcc/lto-streamer-out.c1
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-lang.c2
-rw-r--r--gcc/match.pd26
-rw-r--r--gcc/omp-low.c2
-rw-r--r--gcc/opts.c7
-rw-r--r--gcc/params.def8
-rw-r--r--gcc/passes.c14
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/fr.po445
-rw-r--r--gcc/reload1.c4
-rw-r--r--gcc/reorg.c2
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/rtlanal.c26
-rw-r--r--gcc/sched-deps.c21
-rw-r--r--gcc/sched-int.h1
-rw-r--r--gcc/sel-sched-ir.c51
-rw-r--r--gcc/sel-sched.c5
-rw-r--r--gcc/ssa-iterators.h8
-rw-r--r--gcc/symtab.c14
-rw-r--r--gcc/testsuite/ChangeLog630
-rw-r--r--gcc/testsuite/ChangeLog.ibm4
-rw-r--r--gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c82
-rw-r--r--gcc/testsuite/c-c++-common/Wmisleading-indentation.c194
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c17
-rw-r--r--gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c2
-rw-r--r--gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c36
-rw-r--r--gcc/testsuite/c-c++-common/goacc/clauses-fail.c12
-rw-r--r--gcc/testsuite/c-c++-common/goacc/combined-directives.c7
-rw-r--r--gcc/testsuite/c-c++-common/goacc/host_data-1.c (renamed from gcc/testsuite/c-c++-common/goacc/use_device-1.c)12
-rw-r--r--gcc/testsuite/c-c++-common/goacc/host_data-2.c78
-rw-r--r--gcc/testsuite/c-c++-common/goacc/host_data-5.c23
-rw-r--r--gcc/testsuite/c-c++-common/goacc/host_data-6.c25
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-1.c43
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-default.c2
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-empty.c6
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-eternal.c11
-rw-r--r--gcc/testsuite/c-c++-common/goacc/kernels-noreturn.c12
-rw-r--r--gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c189
-rw-r--r--gcc/testsuite/c-c++-common/goacc/loop-2-parallel.c162
-rw-r--r--gcc/testsuite/c-c++-common/goacc/loop-3.c58
-rw-r--r--gcc/testsuite/c-c++-common/goacc/loop-clauses.c4
-rw-r--r--gcc/testsuite/c-c++-common/goacc/nesting-1.c8
-rw-r--r--gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c29
-rw-r--r--gcc/testsuite/c-c++-common/goacc/parallel-1.c36
-rw-r--r--gcc/testsuite/c-c++-common/goacc/reduction-1.c57
-rw-r--r--gcc/testsuite/c-c++-common/goacc/reduction-2.c42
-rw-r--r--gcc/testsuite/c-c++-common/goacc/reduction-3.c42
-rw-r--r--gcc/testsuite/c-c++-common/goacc/reduction-4.c40
-rw-r--r--gcc/testsuite/c-c++-common/goacc/routine-3.c128
-rw-r--r--gcc/testsuite/c-c++-common/goacc/routine-4.c73
-rw-r--r--gcc/testsuite/c-c++-common/goacc/routine-5.c15
-rw-r--r--gcc/testsuite/c-c++-common/goacc/tile.c258
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c19
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c38
-rw-r--r--gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c14
-rw-r--r--gcc/testsuite/c-c++-common/nonnull-1.c8
-rw-r--r--gcc/testsuite/c-c++-common/pr70144-1.c9
-rw-r--r--gcc/testsuite/c-c++-common/pr70144-2.c12
-rw-r--r--gcc/testsuite/c-c++-common/pr70264.c13
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc14
-rw-r--r--gcc/testsuite/g++.dg/cpp/pr23827_cxx98_neg.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-69315.C35
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70001-4.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70204a.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70204b.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-__func__2.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-inline-1.C29
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-inline.C40
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-recursion2.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-trivial1.C20
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-70218.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic122.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr5.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/nsdmi-union1.C33
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr70001.C49
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ50.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/fold7.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/range-for1.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/pr70271.C36
-rw-r--r--gcc/testsuite/g++.dg/expr/pmf-2.C18
-rw-r--r--gcc/testsuite/g++.dg/ext/attribute-may-alias-4.C17
-rw-r--r--gcc/testsuite/g++.dg/ext/java-3.C39
-rw-r--r--gcc/testsuite/g++.dg/ext/pr70290.C24
-rw-r--r--gcc/testsuite/g++.dg/goacc/reference.C39
-rw-r--r--gcc/testsuite/g++.dg/goacc/routine-1.C13
-rw-r--r--gcc/testsuite/g++.dg/goacc/routine-2.C42
-rw-r--r--gcc/testsuite/g++.dg/goacc/template.C81
-rw-r--r--gcc/testsuite/g++.dg/lookup/pr70205.C11
-rw-r--r--gcc/testsuite/g++.dg/opt/flifetime-dse5.C13
-rw-r--r--gcc/testsuite/g++.dg/opt/flifetime-dse6.C11
-rw-r--r--gcc/testsuite/g++.dg/opt/pr70245-aux.cc56
-rw-r--r--gcc/testsuite/g++.dg/opt/pr70245.C52
-rw-r--r--gcc/testsuite/g++.dg/opt/pr70245.h14
-rw-r--r--gcc/testsuite/g++.dg/other/bitfield5.C15
-rw-r--r--gcc/testsuite/g++.dg/pr63384.C12
-rw-r--r--gcc/testsuite/g++.dg/template/mangle2.C19
-rw-r--r--gcc/testsuite/g++.dg/template/partial-specialization4.C26
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem30.C45
-rw-r--r--gcc/testsuite/g++.dg/torture/pr70251.C11
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C2
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr70147-1.C12
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr70147-2.C77
-rw-r--r--gcc/testsuite/g++.dg/ubsan/vptr-11.C84
-rw-r--r--gcc/testsuite/g++.dg/warn/Wignored-attributes-1.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/Wignored-attributes-2.C7
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C14
-rw-r--r--gcc/testsuite/g++.dg/warn/constexpr-70194.C12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20151204.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr69102.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr70199.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr70240.c26
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr70263-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr70355.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68532.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70222-1.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70222-2.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70429.c17
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-19.c17
-rw-r--r--gcc/testsuite/gcc.dg/atomic-op-6.c11
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pr70052.c24
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr68715-2.c35
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr68715.c36
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr68809-2.c27
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr68809.c28
-rw-r--r--gcc/testsuite/gcc.dg/ifcvt-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr70306.c45
-rw-r--r--gcc/testsuite/gcc.dg/nested-func-10.c56
-rw-r--r--gcc/testsuite/gcc.dg/nested-func-9.c47
-rw-r--r--gcc/testsuite/gcc.dg/pic-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/pic-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/pic-3.c10
-rw-r--r--gcc/testsuite/gcc.dg/pic-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-3.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-5.c10
-rw-r--r--gcc/testsuite/gcc.dg/pie-6.c6
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/plugin/location-overflow-test-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr69032.c11
-rw-r--r--gcc/testsuite/gcc.dg/pr69650.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr70161-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr70161.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr70219.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr70252.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr70269.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr70281.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr70317.c26
-rw-r--r--gcc/testsuite/gcc.dg/pr70326.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr70405.c15
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-11.c7
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70083.c4
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70278.c37
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70288-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70288-2.c35
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70310.c20
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70333.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70370.c45
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70396.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70421.c22
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70450.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr68714.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr69845-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr69845-2.c20
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr70232.c129
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr70372.c14
-rw-r--r--gcc/testsuite/gcc.dg/uninit-19.c52
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr70354-1.c50
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr70354-2.c37
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr63304_1.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70120-1.c19
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70120-2.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70120-3.c22
-rw-r--r--gcc/testsuite/gcc.target/arm/attr-align1.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/attr-align3.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/attr_arm.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/flip-thumb.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/pr69307.c34
-rw-r--r--gcc/testsuite/gcc.target/arm/pr70278.c41
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vextractf128-256-5.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-pr70354-1.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-pr70354-2.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr70329-1.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512bw-pr70329-2.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr70421.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/cleanup-1.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/cleanup-2.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr64411.C27
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70251.c52
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70263-2.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70293.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70300.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70302.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70325.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70327.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70355.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70406.c13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-36.c46
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_allocate_5.f081
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/combined-directives.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/data-tree.f952
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/host_data-tree.f952
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/kernels-alias-2.f9523
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/kernels-alias-3.f9519
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/kernels-alias-4.f9520
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/kernels-alias.f9523
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/kernels-tree.f952
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/loop-1.f9515
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/loop-5.f956
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/loop-6.f958
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/loop-tree-1.f906
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/parallel-tree.f952
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/private-3.f951
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/routine-5.f904
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f9517
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f9520
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f9510
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr68715.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/unlimited_polymorphic_26.f9047
-rw-r--r--gcc/testsuite/gnat.dg/specs/double_record_extension3.ads22
-rw-r--r--gcc/testsuite/lib/prune.exp25
-rw-r--r--gcc/testsuite/lib/target-supports.exp25
-rw-r--r--gcc/tree-inline.c48
-rw-r--r--gcc/tree-inline.h2
-rw-r--r--gcc/tree-pretty-print.c2
-rw-r--r--gcc/tree-ssa-coalesce.c123
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c18
-rw-r--r--gcc/tree-ssa-loop-ivopts.c16
-rw-r--r--gcc/tree-ssa-loop-niter.c9
-rw-r--r--gcc/tree-ssa-loop-unswitch.c4
-rw-r--r--gcc/tree-ssa-propagate.c2
-rw-r--r--gcc/tree-ssa-reassoc.c165
-rw-r--r--gcc/tree-ssa-sccvn.c2
-rw-r--r--gcc/tree-ssa-threadbackward.c2
-rw-r--r--gcc/tree-vect-generic.c50
-rw-r--r--gcc/tree-vect-loop.c7
-rw-r--r--gcc/tree-vect-patterns.c15
-rw-r--r--gcc/tree-vect-stmts.c26
-rw-r--r--gcc/tree-vrp.c21
-rw-r--r--include/ChangeLog5
-rw-r--r--include/gomp-constants.h6
-rw-r--r--libcpp/ChangeLog22
-rw-r--r--libcpp/directives.c13
-rw-r--r--libcpp/expr.c2
-rw-r--r--libcpp/include/cpplib.h1
-rw-r--r--libcpp/init.c4
-rw-r--r--libcpp/line-map.c40
-rw-r--r--libcpp/macro.c9
-rw-r--r--libcpp/po/ChangeLog8
-rw-r--r--libcpp/po/da.po12
-rw-r--r--libcpp/po/fr.po10
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/src/aarch64/ffitarget.h1
-rw-r--r--libgcc/ChangeLog18
-rw-r--r--libgcc/ChangeLog.ibm4
-rw-r--r--libgcc/config/ft32/lib1funcs.S90
-rw-r--r--libgcc/config/ft32/t-ft324
-rw-r--r--libgcc/config/rs6000/extendkftf2-sw.c4
-rw-r--r--libgcc/config/sol2/gmon.c36
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/caf/libcaf.h4
-rw-r--r--libgfortran/caf/single.c17
-rw-r--r--libgomp/ChangeLog156
-rw-r--r--libgomp/oacc-mem.c6
-rw-r--r--libgomp/oacc-parallel.c6
-rw-r--r--libgomp/plugin/plugin-hsa.c25
-rw-r--r--libgomp/testsuite/libgomp.c++/pr70376.C20
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/c++.exp33
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/template-reduction.C98
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c3
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c434
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/clauses-1.c26
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c (renamed from libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-2.c)2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c (renamed from libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-2.c)2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses.h (renamed from libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-1.c)92
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c23
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c114
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c31
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-1.c48
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c100
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c354
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-1.c184
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-clauses.c62
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c6
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c895
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/private-variables.c953
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c129
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c88
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-4.c123
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c76
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/update-1-2.c282
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/update-1.c87
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c28
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-4.c28
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-6.c46
-rw-r--r--libgomp/testsuite/libgomp.oacc-c/c.exp29
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/asyncwait-1.f90122
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/asyncwait-2.f9029
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/asyncwait-3.f9031
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/clauses-1.f90290
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/declare-1.f9041
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/default-1.f9054
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/firstprivate-1.f9042
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/gang-static-1.f9079
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/if-1.f90886
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f9042
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f951
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/pr68813.f9019
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/private-variables.f90544
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f904
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f904
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/update-1.f90242
-rw-r--r--libstdc++-v3/ChangeLog18
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver2
-rw-r--r--libstdc++-v3/doc/html/manual/using_macros.html3
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml3
-rw-r--r--libstdc++-v3/include/Makefile.am2
-rw-r--r--libstdc++-v3/include/Makefile.in2
-rw-r--r--libstdc++-v3/include/bits/concept_check.h3
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc19
-rw-r--r--libstdc++-v3/testsuite/18_support/free_eh_pool.cc35
476 files changed, 16091 insertions, 2546 deletions
diff --git a/ChangeLog b/ChangeLog
index 5573a74fe3f..29a5f7a5606 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2016-03-29 Kelvin Nilsen <kdnilsen@linux.vnet.ibm.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2016-03-17 Cary Coutant <ccoutant@gmail.com>
+
+ Sync with binutils-gdb:
+
+ 2016-03-17 Cary Coutant <ccoutant@gmail.com>
+
+ * configure.ac: Add mips and s390 to the gold target check.
+ * configure: Regenerate.
+
2016-03-01 DJ Delorie <dj@redhat.com>
* MAINTAINERS (mep): Remove myself as MeP maintainer.
diff --git a/MAINTAINERS b/MAINTAINERS
index 7265f4f9df1..e11eb9b7544 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -517,6 +517,7 @@ Quentin Neill <quentin.neill.gnu@gmail.com>
Adam Nemet <adambnemet@gmail.com>
Thomas Neumann <tneumann@users.sourceforge.net>
Dan Nicolaescu <dann@ics.uci.edu>
+Kelvin Nilsen <kdnilsen@linux.vnet.ibm.com>
James Norris <jnorris@codesourcery.com>
Diego Novillo <dnovillo@google.com>
Dorit Nuzman <dorit@il.ibm.com>
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 365038e4bfe..6896c67b757 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,14 @@
+2016-03-29 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * configure.host: Set gc_use_mmap on *-kfreebsd-gnu* and *-gnu*.
+ * include/private/gcconfig.h [HURD && USE_MMAP]: Define
+ USE_MMAP_ANON.
+
+2016-03-16 Andreas Schwab <schwab@suse.de>
+
+ * include/private/gcconfig.h [AARCH64] (ALIGNMENT, CPP_WORDSZ):
+ Define for __ILP32__.
+
2015-10-09 David Malcolm <dmalcolm@redhat.com>
* testsuite/lib/boehm-gc.exp: Load multiline.exp before
diff --git a/boehm-gc/configure.host b/boehm-gc/configure.host
index 97f4dacb6de..229a03877b9 100644
--- a/boehm-gc/configure.host
+++ b/boehm-gc/configure.host
@@ -41,7 +41,7 @@ else
fi
case "${host}" in
- *-linux*)
+ *-linux*|*-kfreebsd-gnu*|*-gnu*)
gc_use_mmap=yes
;;
esac
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index 7e081d993bb..44b9d7d86c3 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -1854,9 +1854,14 @@
# endif
# ifdef AARCH64
-# define CPP_WORDSZ 64
+# ifdef __ILP32__
+# define ALIGNMENT 4
+# define CPP_WORDSZ 32
+# else
+# define ALIGNMENT 8
+# define CPP_WORDSZ 64
+# endif
# define MACH_TYPE "AARCH64"
-# define ALIGNMENT 8
# ifndef HBLKSIZE
# define HBLKSIZE 4096
# endif
@@ -2132,7 +2137,7 @@
# endif
# endif
-#if defined(LINUX) && defined(USE_MMAP)
+#if (defined(LINUX) || defined(HURD)) && defined(USE_MMAP)
/* The kernel may do a somewhat better job merging mappings etc. */
/* with anonymous mappings. */
# define USE_MMAP_ANON
diff --git a/configure b/configure
index 89c863ca97c..35f231ea92b 100755
--- a/configure
+++ b/configure
@@ -2973,7 +2973,7 @@ case "${ENABLE_GOLD}" in
# Check for target supported by gold.
case "${target}" in
i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
- | aarch64*-*-* | tilegx*-*-*)
+ | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*)
configdirs="$configdirs gold"
if test x${ENABLE_GOLD} = xdefault; then
default_ld=gold
diff --git a/configure.ac b/configure.ac
index 321b90896f0..74bf58aad93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,7 +351,7 @@ case "${ENABLE_GOLD}" in
# Check for target supported by gold.
case "${target}" in
i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
- | aarch64*-*-* | tilegx*-*-*)
+ | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*)
configdirs="$configdirs gold"
if test x${ENABLE_GOLD} = xdefault; then
default_ld=gold
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ac8b40dae68..9e4e0acfe2b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,732 @@
+2016-03-30 Jan Hubicka <hubicka@ucw.cz>
+
+ * tree-ssa-loop-niter.c (idx_infer_loop_bounds): We can't get realistic
+ estimates here.
+ * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
+ max_loop_iterations_int.
+ (tree_unswitch_outer_loop): Likewise.
+ * tree-ssa-loop-ivopts.c (avg_loop_niter): Likewise.
+ * tree-vect-loop.c (vect_analyze_loop_2): Likewise.
+
+2016-03-30 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70450
+ * fold-const.c (extract_muldiv_1): Fix thinko in wide_int::from
+ usage.
+
+2016-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70421
+ * config/i386/i386.c (ix86_expand_vector_set): Fix up argument order
+ in gen_blendm expander.
+
+2016-03-30 Nick Clifton <nickc@redhat.com>
+
+ PR target/62254
+ * config/arm/arm.c (arm_reload_out_hi): Add code to handle the
+ case where we are already provided with an SImode SUBREG.
+
+2016-03-30 Michael Matz <matz@suse.de>
+ Richard Biener <rguenther@suse.de>
+
+ PR ipa/12392
+ * ipa-polymorphic-call.c (struct type_change_info): Change
+ speculative to an unsigned allowing to limit the work we do.
+ (csftc_abort_walking_p): New inline function..
+ (check_stmt_for_type_change): Limit the number of may-defs
+ skipped for speculative devirtualization to
+ max-speculative-devirt-maydefs.
+ * params.def (max-speculative-devirt-maydefs): New param.
+ * doc/invoke.texi (--param max-speculative-devirt-maydefs): Document.
+
+2016-03-30 Mike Stump <mrs@gcc.gnu.org>
+
+ PR target/63890
+ * config/i386/i386.h (ACCUMULATE_OUTGOING_ARGS): Use when profiling
+ and TARGET_MACHO.
+
+2016-03-30 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR tree-optimization/59124
+ * tree-vrp.c (register_edge_assert_for_2): For NAME != CST1
+ where NAME = A +- CST2 add the assertion A != (CST1 -+ CST2).
+
+2016-03-29 Jeff Law <law@redhat.com>
+
+ * tree-ssa-coalesce.c (struct ssa_conflicts): Fix typo in
+ comment.
+
+2016-03-10 Jan Hubicka <hubicka@ucw.cz>
+
+ * tree-ssa-loop-ivcanon.c (try_peel_loop): Change type of peel
+ to HOST_WIDE_INT.
+
+2016-03-29 Thomas Schwinge <thomas@codesourcery.com>
+
+ * config/gnu.h (CPP_SPEC, LIB_SPEC): Don't override.
+ * config/i386/gnu.h (STARTFILE_SPEC): Use gcrt1.o instead of
+ gcrt0.o if linking dynamically.
+
+2016-03-10 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/70283
+ * ipa-devirt.c (methods_equal_p): New function.
+ (compare_virtual_tables): Use it.
+ * cgraph.h (symbol_table::symbol_suffix_separator): Declare.
+ * cgraphclones.c (clone_function_name_1): Use
+ symbol_table::symbol_suffix_separator.
+ * coverage.c (build_var): Likewise.
+ * symtab.c (symbol_table::symbol_suffix_separator): New.
+
+2016-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70429
+ * combine.c (simplify_shift_const_1): For ASHIFTRT don't optimize
+ (cst1 >> count) >> cst2 into (cst1 >> cst2) >> count if
+ mode != result_mode.
+
+ PR c++/70353
+ * tree-inline.c (remap_decls): Don't add_local_decl if
+ cfun is null.
+
+ PR tree-optimization/70405
+ * ssa-iterators.h (num_imm_uses): Add missing braces.
+
+2016-03-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/68695
+ * ira-color.c (allocno_copy_cost_saving): New.
+ (improve_allocation): Use it.
+
+2016-03-29 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/70355
+ * lower-subreg.c (simplify_subreg_concatn): Reject paradoxical
+ subregs.
+
+2016-03-29 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70424
+ * ipa-prop.c (ipa_compute_jump_functions_for_edge): Always
+ use alignment returned by get_pointer_alignment_1 if it is
+ bigger than BITS_PER_UNIT.
+ * builtins.c (get_pointer_alignment_1): Do not return true
+ for alignment extracted from SSA info.
+
+2016-03-28 James Bowman <james.bowman@ftdichip.com>
+
+ * config/ft32/ft32.opt (mnodiv): New.
+ * config/ft32/ft32.md (*divsi3, *modsi3): Qualify with
+ TARGET_NODIV.
+ * doc/invoke.texi (FT32 Options -mnodiv): New.
+
+2016-03-28 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70406
+ * config/i386/i386.md (define_split, andn): Fix modes.
+
+2016-03-26 Richard Biener <rguenther@suse.de>
+ Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ PR ipa/70366
+ * ipa-inline-transform.c (inline_call): Pass opts_for_fn (to->decl)
+ instead of
+ TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl))
+ as 2nd argument to cl_optimization_restore().
+
+2016-03-25 Richard Henderson <rth@redhat.com>
+
+ PR target/70120
+ * config/aarch64/aarch64.c (aarch64_asm_output_pool_epilogue): New.
+ * config/aarch64/aarch64-protos.h: Declare it.
+ * config/aarch64/aarch64.h (ASM_OUTPUT_POOL_EPILOGUE): New.
+
+2016-03-25 Alan Modra <amodra@gmail.com>
+
+ PR target/70052
+ * config/rs6000/constraints.md (j): Simplify.
+ * config/rs6000/predicates.md (easy_fp_constant): Exclude
+ decimal float 0.D.
+ * config/rs6000/rs6000.md (zero_fp): New mode_attr.
+ (mov<mode>_hardfloat, mov<mode>_hardfloat32, mov<mode>_hardfloat64,
+ mov<mode>_64bit_dm, mov<mode>_32bit): Use zero_fp in place of j
+ in all constraint alternatives.
+ (movtd_64bit_nodm): Delete "j" constraint alternative.
+
+2016-03-24 Aldy Hernandez <aldyh@redhat.com>
+
+ * tree-ssa-propagate.c: Enhance docs for
+ SSA_PROP_NOT_INTERESTING.
+
+2016-03-24 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/extend.texi: Fix typo in documentation to pure attribute.
+
+2016-03-24 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/70319
+ * config/pa/pa.md (bswapdi2): Use a scratch register.
+
+2016-03-24 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/69845
+ * fold-const.c (extract_muldiv_1): Correct test for multiplication
+ overflow.
+
+2016-03-24 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*anddi3_doubleword): Generate AND insn
+ using ix86_expand_binary_operator instead of gen_andsi3.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70396
+ * tree-vect-stmts.c (vectorizable_comparison): Use
+ get_vectype_for_scalar_type.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70370
+ * gimplify.c (gimplify_asm_expr): Handle !allows_mem outputs
+ with register bases.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70372
+ * tree-ssa-reassoc.c (eliminate_plus_minus_pair): Use
+ build_all_ones_cst to also handle vector types correctly.
+
+2016-03-23 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/70381
+ * config/rs6000/rs6000-cpus.def (ISA_2_6_MASKS_SERVER): Do not set
+ -mfloat128 here.
+
+2016-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/69884
+ * doc/invoke.texi: Document -Wignored-attributes.
+
+2016-03-23 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/69042
+ * params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND): Increase the
+ parameter from 30 to 40.
+
+2016-03-23 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/69042
+ * tree-ssa-loop-ivopts.c (add_iv_candidate_for_use): Add IV cand
+ for use with constant offset stripped in base.
+
+2016-03-23 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70251
+ * match.pd (A + (B vcmp C ? 1 : 0) -> A - (B vcmp C)): Adjust
+ mode compatibility check.
+ (A - (B vcmp C ? 1 : 0) -> A + (B vcmp C)): Likewise.
+
+2016-03-23 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/64058
+ * tree-ssa-coalesce.c (struct coalesce_pair): Add new field
+ CONFLICT_COUNT.
+ (struct ssa_conflicts): Move up earlier in the file.
+ (conflicts_, var_map_): New static variables.
+ (initialize_conflict_count): New function to initialize the
+ CONFLICT_COUNT field for each conflict pair.
+ (compare_pairs): Lazily initialize the conflict count and use it
+ as the first tie-breaker.
+ (sort_coalesce_list): Add new arguments conflicts, map. Initialize
+ and wipe conflicts_ and map_ around the call to qsort. Remove
+ special case for 2 coalesce pairs.
+ * bitmap.c (bitmap_count_unique_bits): New function.
+ (bitmap_count_bits_in_word): New function, extracted from
+ bitmap_count_bits.
+ (bitmap_count_bits): Use bitmap_count_bits_in_word.
+ * bitmap.h (bitmap_count_unique_bits): Declare it.
+
+2016-03-23 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR target/69917
+ * config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Follow
+ transparent alias chain for decl assembler name.
+ * config/sol2.c (solaris_assemble_visibility): Likewise.
+
+2016-03-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm1020e.md (1020call_op): Reduce reservation
+ duration.
+ (v10_fdivs): Likewise.
+ (v10_fdivd): Likewise.
+
+2016-03-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR driver/70132
+ * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic
+ to not call fclose twice on file.
+
+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70354
+ * tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern): If
+ oprnd0 is wider than oprnd1 and there is a cast from the wider
+ type to oprnd1, mask it with the mask of the narrower type.
+
+ PR target/70321
+ * config/i386/i386.md (*anddi3_doubleword, *<code>di3_doubleword):
+ Optimize TARGET_STV splitters, if high or low word of last argument
+ is 0 or -1.
+
+2016-03-22 Jeff Law <law@redhat.com>
+
+ PR target/70232
+ tree-ssa-threadbackward.c
+ (fsm_find_control_statement_thread_paths): Correctly distinguish
+ between old style jump threads vs FSM jump threads.
+
+2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR target/70302
+ * config/i386/i386.c (scalar_chain::convert_op): Support
+ uninitialized register usage case.
+
+2016-03-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70251
+ * genmatch.c (gen_transform): Adjust last parameter to a three-state
+ int...
+ (capture::gen_transform): ... to change behavior when substituting
+ a condition into cond or not-cond expr context.
+ (dt_simplify::gen_1): Adjust.
+ * gimple-match-head.c: Include gimplify.h for unshare_expr.
+ * match.pd (A + (B vcmp C ? 1 : 0) -> A - (B vcmp C)): Revert
+ last change and instead change to
+ A + (B vcmp C ? 1 : 0) -> A - (B vcmp C ? -1 : 0).
+ (A - (B vcmp C ? 1 : 0) -> A + (B vcmp C)): Likewise.
+
+2016-03-22 Anthony Green <green@moxielogic.com>
+
+ * config/moxie/moxiebox.h (CC1_SPEC): Define. Fix endianness
+ issue for moxiebox targets.
+ (CC1PLUS_SPEC): Ditto.
+
+2016-03-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70333
+ * fold-const.c (extract_muldiv_1): Properly perform multiplication
+ in the wide type.
+
+2016-03-22 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * config/i386/i386.c (def_builtin): Remove duplicated functionality.
+
+2016-03-22 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70325
+ * config/i386/i386.c (def_builtin): Handle
+ OPTION_MASK_ISA_AVX512VL to be and-ed with other
+ bits.
+ (const struct builtin_description bdesc_special_args[]):
+ Remove duplicate ISA bits.
+
+2016-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70329
+ * config/i386/i386.c (ix86_expand_vecop_qihi): Don't bother computing
+ d.perm[i] for i >= d.nelt. If not full_interleave, compute d.perm[i]
+ in a way that works also for AVX512BW.
+
+ PR target/70300
+ * config/i386/i386.md (cvtsd2ss splitter): Unpack in destination
+ instead of source if operands[1] is xmm16 and above and
+ !TARGET_AVX512VL. Use avx512f_vec_dupv16sf_1 instead of
+ vec_interleave_lowv4sf if we need to unpack xmm16 and above.
+
+ PR c++/70295
+ * gimplify.c (gimplify_modify_expr): Call gimple_set_no_warning
+ on assign if (*from_p) is a comparison, set it to
+ TREE_NO_WARNING (*from_p).
+
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70326
+ * lra.c (restore_scratches): Ignore deleted insns.
+
+2016-03-21 Marc Glisse <marc.glisse@inria.fr>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70317
+ * match.pd (cmp @0 @0): Pass @0 instead of TYPE_MODE (TREE_TYPE (@0))
+ to HONOR_NANS.
+
+2016-03-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70327
+ * config/i386/i386.md (movxi): Use ix86_expand_vector_move instead
+ of ix86_expand_move.
+ (movoi): Ditto.
+ (movti): Use general_operand for operand 1 predicate.
+
+2016-03-21 Martin Liska <mliska@suse.cz>
+
+ * hsa-dump.c (dump_hsa_insn_1): dump default branch of SBR
+ insns.
+ (dump_hsa_symbol): Dump BRIG offset of hsa_symbols.
+
+2016-03-21 Martin Liska <mliska@suse.cz>
+
+ PR ipa/70306
+ * ipa-icf.c (sem_function::parse): Skip static
+ constructors and destructors.
+
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70296
+ * config/rs6000/rs6000-c.c (rs6000_macro_to_expand): If IDENT is
+ function-like macro, peek following token(s) if it is followed
+ by CPP_OPEN_PAREN token with optional padding in between, and
+ if not, don't treat it like a macro.
+
+2016-03-21 Thomas Schwinge <thomas@codesourcery.com>
+ Alexander Monakov <amonakov@ispras.ru>
+
+ * config/nvptx/nvptx.c (nvptx_option_override): Don't emit sorry
+ for the stabs debug format.
+
+2016-03-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70310
+ * tree-vect-generic.c (expand_vector_condition): Fold the built
+ condition.
+
+2016-03-21 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70293
+ * config/i386/sse.md: (define_insn "*vec_dup<mode>"/AVX2):
+ Block third alternative for AVX-512VL target,
+
+2016-03-21 Martin Liska <mliska@suse.cz>
+
+ PR hsa/70234
+ * hsa-brig.c (emit_function_directives): Mark unemitted
+ global variables for emission.
+ * hsa-gen.c (hsa_symbol::hsa_symbol): Initialize a new flag.
+ (get_symbol_for_decl): Likewise.
+ * hsa.h (struct hsa_symbol): New flag.
+
+2016-03-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70288
+ * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Make sure
+ we do not estimate unsimplified all-constant conditionals or
+ switches as optimized away.
+
+2016-03-21 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/69102
+ * sched-deps.c (sched_analyze_insn): Do not set last_args_size field
+ when we have a readonly dependency context.
+
+2016-03-18 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/70263
+ * ira.c (memref_used_between_p): Assert we found END in the insn chain.
+ (update_equiv_regs): When trying to move a store to after the insn
+ that sets the source of the store, make sure the store occurs after
+ the insn that sets the source of the store. When successful note
+ the REG_EQUIV note created in the dump file.
+
+2016-03-16 David Wohlferd <dw@LimeGreenSocks.com>
+ Bernd Schmidt <bschmidt@redhat.com>
+
+ * doc/extend.texi: Document more potential problems with basic asms.
+
+2016-03-18 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/70278
+ * lra-constraints.c (split_reg): Handle the case where biggest_mode is
+ VOIDmode.
+
+2016-03-18 Jason Merrill <jason@redhat.com>
+
+ * calls.c (load_register_parameters): Fix zero size sibcall logic.
+
+2016-03-18 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * config/i386/sse.md: Use vpbroadcastq for broadcasting DF
+ values to 128b regs.
+
+2016-03-18 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR tree-optimization/70252
+ * tree-vect-stmts.c (supportable_widening_operation): Check resulting
+ boolean vector has a proper number of elements.
+ (supportable_narrowing_operation): Likewise.
+
+2016-03-18 Tom de Vries <tom@codesourcery.com>
+
+ PR ipa/70269
+ * cgraph.c (cgraph_node::get_body): Set dump_file to NULL after save.
+
+2016-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ * reload1.c (emit_input_reload_insns): Use simplify_replace_rtx
+ instead of replace_rtx for DEBUG_INSNs.
+
+2016-03-18 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
+
+ * config/i386/znver1.md : Fix latencies of FP/SSE/AVX
+ load type reservations.
+
+2016-03-17 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/70188
+ * config/pa/constraints.md: Revert 2015-02-13 change. Use
+ define_constraint for "Q" and "T" constraints.
+
+2016-03-17 Evandro Menezes <e.menezes@samsung.com>
+
+ Tweak the pipeline model for Exynos M1
+
+ * config/aarch64/aarch64.c (exynosm1_tunings): Enable weak prefetching
+ model.
+
+2016-03-17 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/70264
+ * diagnostic-show-locus.c (compatible_locations_p): Handle the case
+ where one or both locations aren't within a line_map.
+
+2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR driver/70192
+ * opts.c (finish_options): Don't set flag_pie to the default if
+ -fpic, -fPIC, -fno-pic or -fno-PIC is used. Set flag_pic to 0
+ if it is -1.
+
+2016-03-17 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ * config/i386/i386.md (*movv4qicc_insn+1..36): Pass
+ true as ALL_REGS argument to replace_rtx.
+
+2016-03-17 Richard Biener <rguenther@suse.de>
+
+ PR debug/70271
+ * dwarf2out.c (dwarf2out_early_finish): Process deferred_asm_name
+ last.
+
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70245
+ * rtl.h (replace_rtx): Add ALL_REGS argument.
+ * rtlanal.c (replace_rtx): Likewise. If true, use REGNO
+ equality and assert mode is the same, instead of just rtx pointer
+ equality.
+ * config/i386/i386.md (mov + arithmetics with load peephole): Pass
+ true as ALL_REGS argument to replace_rtx.
+
+2016-03-17 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * match.pd (A + (B vcmp C ? 1 : 0) -> A - (B vcmp C)): Apply
+ for boolean vector with vector mode only.
+ (A - (B vcmp C ? 1 : 0) -> A + (B vcmp C)): Likewise.
+
+2016-03-17 Nick Clifton <nickc@redhat.com>
+
+ PR target/70162
+ * config/rx/rx.c (rx_print_integer): Print negative constants in
+ decimal.
+
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70261
+ * rtlanal.c (replace_rtx): Revert 2016-03-16 change.
+
+2016-03-16 Richard Henderson <rth@redhat.com>
+ Richard Biener <rguenth@suse.de>
+
+ PR middle-end/70240
+ PR middle-end/68215
+ PR tree-opt/68714
+ * gimplify.c (gimplify_expr) [VEC_COND_EXPR]: Gimplify the
+ first operand as is_gimple_condexpr.
+
+ PR middle-end/70240
+ PR middle-end/68215
+ Revert r231575
+ 2015-12-11 Eric Botcazou <ebotcazou@adacore.com>
+ * tree-vect-generic.c (tree_vec_extract): Remove GSI parameter.
+ Do not gimplify the result.
+ (do_unop): Adjust call to tree_vec_extract.
+ (do_binop): Likewise.
+ (do_compare): Likewise.
+ (do_plus_minus): Likewise.
+ (do_negate): Likewise.
+ (expand_vector_condition): Likewise.
+ (do_cond): Likewise.
+
+2016-03-16 Richard Henderson <rth@redhat.com>
+
+ PR target/70048
+ * config/aarch64/aarch64.c (virt_or_elim_regno_p): New.
+ (aarch64_classify_address): Use it.
+ (aarch64_legitimize_address): Force all subexpressions of PLUS
+ into registers. Simplify as (sfp+const)+reg or (reg+reg)+const.
+
+2016-03-16 Jakub Jelinek <jakub@redhat.com>
+ Richard Biener <rguenth@suse.de>
+
+ PR target/70245
+ * rtlanal.c (replace_rtx): For REG, if from is a REG,
+ return to even if only REGNO is equal, and assert
+ mode is the same.
+
+2016-03-11 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/70224
+ * reorg.c (relax_delay_slots): Pass right argument to CROSSING_JUMP_P.
+
+2016-03-16 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/70199
+ * function.h (struct function): Add has_forced_label_in_static.
+ * gimplify.c (force_labels_r): Set it.
+ * lto-streamer-in.c (input_struct_function_base): Read it.
+ * lto-streamer-out.c (output_struct_function_base): Write it.
+ * tree-inline.c (has_label_address_in_static_1): Remove.
+ (copy_forbidden): Remove fndecl parameter; test
+ has_forced_label_in_static.
+ (inline_forbidden_p): Update call to copy_forbidden.
+ (tree_versionable_function_p): Likewise.
+ * ipa-chkp.c (chkp_instrumentable_p): Likewise.
+ (chkp_versioning): Likewise.
+ * tree-inline.h (copy_forbidden): Update decl.
+
+2016-03-16 Marek Polacek <polacek@redhat.com>
+
+ PR c/70093
+ * cgraphunit.c (cgraph_node::expand_thunk): Also build call to the
+ function being thunked if the result type doesn't have fixed size.
+ * gimplify.c (gimplify_modify_expr): Also set LHS if the result type
+ doesn't have fixed size.
+
+2016-03-16 Bin Cheng <bin.cheng@arm.com>
+
+ * tree-vect-loop.c (vect_analyze_loop_2): Fix wrong dump info by
+ reporting malformed loop nest.
+
+2016-03-16 Tom de Vries <tom@codesourcery.com>
+
+ PR lto/70187
+ * ipa-devirt.c (possible_polymorphic_call_targets): Move
+ nodes.length () == 1 test to before first nodes[0] access.
+
+2016-03-16 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/68715
+ * graphite-scop-detection.c (scop_detection::merge_sese): Add missing
+ single_pred_p test.
+
+2016-03-16 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/68809
+ * graphite-scop-detection.c (same_close_phi_node): Test if result types
+ are the same.
+
+2016-03-16 Carlos O'Donell <carlos@redhat.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * doc/extend.texi (Common Function Attributes): Describe ifunc impact
+ on leaf attribute. Mention ELF interposition problems.
+
+2016-03-16 Alan Modra <amodra@gmail.com>
+
+ PR rtl-optimization/69195
+ PR rtl-optimization/47992
+ * ira.c (indirect_jump_optimize): Ignore artificial defs.
+ Add comments.
+
+2016-03-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR bootstrap/69513
+ * dwarf2out.c (flush_limbo_die_list): Really flush the limbo list.
+
+2016-03-15 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * config/avr/avr.md (rotl<mode>3): Set mode for operand 2.
+
+2016-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70222
+ * combine.c (simplify_shift_const_1): For A >> B >> C LSHIFTRT
+ optimization if mode is different from result_mode, queue up masking
+ of the result in outer_op. Formatting fix.
+
+ PR middle-end/70239
+ * tree-ssa-sccvn.c (VN_INFO_GET): Use safe_grow_cleared instead
+ of safe_grow.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/69032
+ * sel-sched-ir.c (get_seqno_by_preds): Include both insn and head when
+ looping backwards over basic block insns.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR target/66660
+ * sel-sched-ir.c (merge_expr): Avoid changing the speculative pattern
+ to non-speculative when propagating trap bits.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/63384
+ * sel-sched.c (invoke_aftermath_hooks): Do not decrease issue_more on
+ DEBUG_INSN_P insns.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR target/64411
+ * sched-deps.c (get_implicit_reg_pending_clobbers): New function,
+ factored out from ...
+ (sched_analyze_insn): ... here.
+ * sched-int.h (get_implicit_reg_pending_clobbers): Declare it.
+ * sel-sched-ir.c (setup_id_implicit_regs): New function, use
+ get_implicit_reg_pending_clobbers in it.
+ (setup_id_reg_sets): Use setup_id_implicit_regs.
+ (deps_init_id): Ditto.
+
+2016-03-15 Tom de Vries <tom@codesourcery.com>
+
+ PR ipa/70161
+ * cgraph.c (cgraph_node::get_body): Save, reset and restore
+ dump_file_name.
+ * passes.c (execute_one_ipa_transform_pass): Add missing argument to
+ execute_function_dump.
+ (execute_one_pass): Don't dump function if it will be dumped after ipa
+ transform.
+
+2016-03-15 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * genrecog.c (match_pattern_2): If pred is NULL don't call
+ safe_predicate_mode on it.
+
+2016-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70219
+ * lra-constraints.c (delete_move_and_clobber): Change assertion
+ to also allow dregno == 0.
+
+2016-03-14 Richard Henderson <rth@redhat.com>
+
+ PR tree-opt/68714
+ * tree-ssa-reassoc.c (ovce_extract_ops, optimize_vec_cond_expr): New.
+ (can_reassociate_p): Allow ANY_INTEGRAL_TYPE_P.
+ (reassociate_bb): Use optimize_vec_cond_expr; avoid
+ optimize_range_tests, attempt_builtin_copysign and attempt_builtin_powi
+ on vectors.
+
2016-03-14 Bernd Schmidt <bschmidt@redhat.com>
PR target/70083
@@ -206,7 +935,8 @@
2016-03-10 Jan Hubicka <hubicka@ucw.cz>
PR lto/69589
- * cgraph.c (cgraph_node::dump): Dump split_part and indirect_call_target.
+ * cgraph.c (cgraph_node::dump): Dump split_part and
+ indirect_call_target.
* cgraph.h (cgraph_node): Add indirect_call_target flag.
* ipa.c (has_addr_references_p): Cleanup.
(is_indirect_call_target_p): New.
diff --git a/gcc/ChangeLog.ibm b/gcc/ChangeLog.ibm
index 8031b4118e2..bb007dc7ad6 100644
--- a/gcc/ChangeLog.ibm
+++ b/gcc/ChangeLog.ibm
@@ -1,3 +1,8 @@
+2016-03-30 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 234598.
+ * REVISION: Update subversion id.
+
2016-03-30 Kelvin Nilsen <kelvin@gcc.gnu.org>
* doc/extend.texi: Document __builtin_darn (void),
@@ -8,21 +13,21 @@
#include "rs6000-bultin.def".
(rs6000_builtin_mask_calculate): Add in the RS6000_BTM_MODULO and
RS6000_BTM_64BIT flags to the returned mask, depending on
- configuration.
+ configuration.
(def_builtin): Correct an error in the assignments made to the
- debugging variable attr_string.
+ debugging variable attr_string.
(rs6000_expand_builtin): Add support for no-operand built-in
- functions.
+ functions.
(builtin_function_type): Remove fatal_error assertion that is no
- longer valid.
+ longer valid.
(rs6000_common_init_builtins): Add support for no-operand built-in
- functions.
+ functions.
* config/rs6000/altivec.h: Add macro definitions for darn,
- darn_32, and darn_raw.
+ darn_32, and darn_raw.
* config/rs6000/rs6000.h (RS6000_BTM_MODULO): New macro
definition.
(RS6000_BTC_PURE): Enhance comment associated with this macro
- definition.
+ definition.
(RS6000_BTM_64BIT): New macro definition.
* config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_0): Introduce
use and documentation of this new macro.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index d0d79aafd45..c54a1a699de 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20160314
+20160330
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9fa560dffa2..0c9b179792d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2016-03-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (components_to_record): Add special case for
+ single field with representation clause at offset 0.
+
+2016-03-16 Svante Signell <svante.signell@gmail.com>
+
+ * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd.
+ * s-osinte-gnu.ads: New file.
+
2016-03-13 Eric Botcazou <ebotcazou@adacore.com>
* system-vxworks-m68k.ads (Stack_Check_Probes): Set to True.
@@ -77,7 +87,7 @@
2016-02-17 Eric Botcazou <ebotcazou@adacore.com>
- * exp_ch4.adb (Expand_N_Indexed_Component): Active synchronization if
+ * exp_ch4.adb (Expand_N_Indexed_Component): Activate synchronization if
the prefix denotes an entity which Has_Atomic_Components.
* gcc-interface/trans.c (node_is_atomic): Return true if the prefix
denotes an entity which Has_Atomic_Components.
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 8d91b667087..bfc718b38bb 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for GNU Ada Compiler (GNAT).
-# Copyright (C) 1994-2015 Free Software Foundation, Inc.
+# Copyright (C) 1994-2016 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -1420,6 +1420,35 @@ ifeq ($(strip $(filter-out %86 kfreebsd%,$(target_cpu) $(target_os))),)
MISCLIB = -lutil
endif
+# i[3456]86-pc-gnu i.e. GNU Hurd
+ifeq ($(strip $(filter-out %86 pc gnu,$(target_cpu) $(target_vendor) $(target_os))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-freebsd.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-gnu.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(X86_TARGET_PAIRS) \
+ system.ads<system-freebsd-x86.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-freebsd.ads \
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4b0ce2824c4..ad8452810d4 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7606,6 +7606,23 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
if (p_gnu_rep_list && gnu_rep_list)
*p_gnu_rep_list = chainon (*p_gnu_rep_list, gnu_rep_list);
+ /* If only one field has a rep clause and it starts at 0, put back the field
+ at the head of the regular field list. This will avoid creating a useless
+ REP part below and deal with the annoying case of an extension of a record
+ with variable size and rep clause, for which the _Parent field is forced
+ at offset 0 and has variable size, which we do not support below. */
+ else if (gnu_rep_list
+ && !DECL_CHAIN (gnu_rep_list)
+ && !variants_have_rep
+ && first_free_pos
+ && integer_zerop (first_free_pos)
+ && integer_zerop (bit_position (gnu_rep_list)))
+ {
+ DECL_CHAIN (gnu_rep_list) = gnu_field_list;
+ gnu_field_list = gnu_rep_list;
+ gnu_rep_list = NULL_TREE;
+ }
+
/* Otherwise, sort the fields by bit position and put them into their own
record, before the others, if we also have fields without rep clause. */
else if (gnu_rep_list)
diff --git a/gcc/ada/s-osinte-gnu.ads b/gcc/ada/s-osinte-gnu.ads
new file mode 100644
index 00000000000..b3397c1ea8e
--- /dev/null
+++ b/gcc/ada/s-osinte-gnu.ads
@@ -0,0 +1,801 @@
+------------------------------------------------------------------------------
+-- --
+-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- S Y S T E M . O S _ I N T E R F A C E --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1991-1994, Florida State University --
+-- Copyright (C) 1995-2016, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
+-- --
+-- As a special exception 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/>. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. --
+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the GNU/Hurd (POSIX Threads) version of this package
+
+-- This package encapsulates all direct interfaces to OS services
+-- that are needed by children of System.
+
+-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
+-- Preelaborate. This package is designed to be a bottom-level (leaf) package
+
+with Interfaces.C;
+with Unchecked_Conversion;
+
+package System.OS_Interface is
+ pragma Preelaborate;
+
+ pragma Linker_Options ("-lpthread");
+ pragma Linker_Options ("-lrt");
+
+ subtype int is Interfaces.C.int;
+ subtype char is Interfaces.C.char;
+ subtype short is Interfaces.C.short;
+ subtype long is Interfaces.C.long;
+ subtype unsigned is Interfaces.C.unsigned;
+ subtype unsigned_short is Interfaces.C.unsigned_short;
+ subtype unsigned_long is Interfaces.C.unsigned_long;
+ subtype unsigned_char is Interfaces.C.unsigned_char;
+ subtype plain_char is Interfaces.C.plain_char;
+ subtype size_t is Interfaces.C.size_t;
+
+ -----------
+ -- Errno --
+ -----------
+ -- From /usr/include/i386-gnu/bits/errno.h
+
+ function errno return int;
+ pragma Import (C, errno, "__get_errno");
+
+ EAGAIN : constant := 1073741859;
+ EINTR : constant := 1073741828;
+ EINVAL : constant := 1073741846;
+ ENOMEM : constant := 1073741836;
+ EPERM : constant := 1073741825;
+ ETIMEDOUT : constant := 1073741884;
+
+ -------------
+ -- Signals --
+ -------------
+ -- From /usr/include/i386-gnu/bits/signum.h
+
+ Max_Interrupt : constant := 32;
+ type Signal is new int range 0 .. Max_Interrupt;
+ for Signal'Size use int'Size;
+
+ SIGHUP : constant := 1; -- hangup
+ SIGINT : constant := 2; -- interrupt (rubout)
+ SIGQUIT : constant := 3; -- quit (ASCD FS)
+ SIGILL : constant := 4; -- illegal instruction (not reset)
+ SIGTRAP : constant := 5; -- trace trap (not reset)
+ SIGIOT : constant := 6; -- IOT instruction
+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
+ SIGEMT : constant := 7; -- EMT instruction
+ SIGFPE : constant := 8; -- floating point exception
+ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
+ SIGBUS : constant := 10; -- bus error
+ SIGSEGV : constant := 11; -- segmentation violation
+ SIGSYS : constant := 12; -- bad argument to system call
+ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
+ SIGALRM : constant := 14; -- alarm clock
+ SIGTERM : constant := 15; -- software termination signal from kill
+ SIGURG : constant := 16; -- urgent condition on IO channel
+ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
+ SIGTSTP : constant := 18; -- user stop requested from tty
+ SIGCONT : constant := 19; -- stopped process has been continued
+ SIGCLD : constant := 20; -- alias for SIGCHLD
+ SIGCHLD : constant := 20; -- child status change
+ SIGTTIN : constant := 21; -- background tty read attempted
+ SIGTTOU : constant := 22; -- background tty write attempted
+ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
+ SIGPOLL : constant := 23; -- I/O possible (same as SIGIO?)
+ SIGXCPU : constant := 24; -- CPU time limit exceeded
+ SIGXFSZ : constant := 25; -- filesize limit exceeded
+ SIGVTALRM : constant := 26; -- virtual timer expired
+ SIGPROF : constant := 27; -- profiling timer expired
+ SIGWINCH : constant := 28; -- window size change
+ SIGINFO : constant := 29; -- information request (NetBSD/FreeBSD)
+ SIGUSR1 : constant := 30; -- user defined signal 1
+ SIGUSR2 : constant := 31; -- user defined signal 2
+ SIGLOST : constant := 32; -- Resource lost (Sun); server died (GNU)
+
+ SIGADAABORT : constant := SIGABRT;
+ -- Change this if you want to use another signal for task abort.
+ -- SIGTERM might be a good one.
+
+ type Signal_Set is array (Natural range <>) of Signal;
+
+ Unmasked : constant Signal_Set := (
+ SIGTRAP,
+ -- To enable debugging on multithreaded applications, mark SIGTRAP to
+ -- be kept unmasked.
+
+ SIGBUS,
+
+ SIGTTIN, SIGTTOU, SIGTSTP,
+ -- Keep these three signals unmasked so that background processes
+ -- and IO behaves as normal "C" applications
+
+ SIGPROF,
+ -- To avoid confusing the profiler
+
+ SIGKILL, SIGSTOP);
+ -- These two signals actually cannot be masked;
+ -- POSIX simply won't allow it.
+
+ Reserved : constant Signal_Set :=
+ -- I am not sure why the following signal is reserved.
+ -- I guess they are not supported by this version of GNU/Hurd.
+ (0 .. 0 => SIGVTALRM);
+
+ type sigset_t is private;
+
+ -- From /usr/include/signal.h /usr/include/i386-gnu/bits/sigset.h
+ function sigaddset (set : access sigset_t; sig : Signal) return int;
+ pragma Import (C, sigaddset, "sigaddset");
+
+ function sigdelset (set : access sigset_t; sig : Signal) return int;
+ pragma Import (C, sigdelset, "sigdelset");
+
+ function sigfillset (set : access sigset_t) return int;
+ pragma Import (C, sigfillset, "sigfillset");
+
+ function sigismember (set : access sigset_t; sig : Signal) return int;
+ pragma Import (C, sigismember, "sigismember");
+
+ function sigemptyset (set : access sigset_t) return int;
+ pragma Import (C, sigemptyset, "sigemptyset");
+
+ -- sigcontext is architecture dependent, so define it private
+ type struct_sigcontext is private;
+
+ -- From /usr/include/i386-gnu/bits/sigaction.h: Note: arg. order differs
+ type struct_sigaction is record
+ sa_handler : System.Address;
+ sa_mask : sigset_t;
+ sa_flags : int;
+ end record;
+ pragma Convention (C, struct_sigaction);
+
+ type struct_sigaction_ptr is access all struct_sigaction;
+
+ -- From /usr/include/i386-gnu/bits/sigaction.h
+ SIG_BLOCK : constant := 1;
+ SIG_UNBLOCK : constant := 2;
+ SIG_SETMASK : constant := 3;
+
+ -- From /usr/include/i386-gnu/bits/signum.h
+ SIG_ERR : constant := 1;
+ SIG_DFL : constant := 0;
+ SIG_IGN : constant := 1;
+ SIG_HOLD : constant := 2;
+
+ -- From /usr/include/i386-gnu/bits/sigaction.h
+ SA_SIGINFO : constant := 16#0040#;
+ SA_ONSTACK : constant := 16#0001#;
+
+ function sigaction
+ (sig : Signal;
+ act : struct_sigaction_ptr;
+ oact : struct_sigaction_ptr) return int;
+ pragma Import (C, sigaction, "sigaction");
+
+ ----------
+ -- Time --
+ ----------
+
+ Time_Slice_Supported : constant Boolean := True;
+ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
+
+ type timespec is private;
+
+ function nanosleep (rqtp, rmtp : access timespec) return int;
+ pragma Import (C, nanosleep, "nanosleep");
+
+ type clockid_t is new int;
+ CLOCK_REALTIME : constant clockid_t := 0;
+
+ -- From: /usr/include/time.h
+ function clock_gettime
+ (clock_id : clockid_t;
+ tp : access timespec)
+ return int;
+ pragma Import (C, clock_gettime, "clock_gettime");
+
+ function clock_getres
+ (clock_id : clockid_t;
+ res : access timespec) return int;
+ pragma Import (C, clock_getres, "clock_getres");
+
+ function To_Duration (TS : timespec) return Duration;
+ pragma Inline (To_Duration);
+
+ function To_Timespec (D : Duration) return timespec;
+ pragma Inline (To_Timespec);
+
+ -- From: /usr/include/unistd.h
+ function sysconf (name : int) return long;
+ pragma Import (C, sysconf);
+
+ -- From /usr/include/i386-gnu/bits/confname.h
+ SC_CLK_TCK : constant := 2;
+ SC_NPROCESSORS_ONLN : constant := 84;
+
+ -------------------------
+ -- Priority Scheduling --
+ -------------------------
+ -- From /usr/include/i386-gnu/bits/sched.h
+
+ SCHED_OTHER : constant := 0;
+ SCHED_FIFO : constant := 1;
+ SCHED_RR : constant := 2;
+
+ function To_Target_Priority
+ (Prio : System.Any_Priority) return Interfaces.C.int;
+ -- Maps System.Any_Priority to a POSIX priority.
+
+ -------------
+ -- Process --
+ -------------
+
+ type pid_t is private;
+
+ -- From: /usr/include/signal.h
+ function kill (pid : pid_t; sig : Signal) return int;
+ pragma Import (C, kill, "kill");
+
+ -- From: /usr/include/unistd.h
+ function getpid return pid_t;
+ pragma Import (C, getpid, "getpid");
+
+ ---------
+ -- LWP --
+ ---------
+
+ -- From: /usr/include/pthread/pthread.h
+ function lwp_self return System.Address;
+ -- lwp_self does not exist on this thread library, revert to pthread_self
+ -- which is the closest approximation (with getpid). This function is
+ -- needed to share 7staprop.adb across POSIX-like targets.
+ pragma Import (C, lwp_self, "pthread_self");
+
+ -------------
+ -- Threads --
+ -------------
+
+ type Thread_Body is access
+ function (arg : System.Address) return System.Address;
+ pragma Convention (C, Thread_Body);
+
+ function Thread_Body_Access is new
+ Unchecked_Conversion (System.Address, Thread_Body);
+
+ -- From: /usr/include/bits/pthread.h:typedef int __pthread_t;
+ -- /usr/include/pthread/pthreadtypes.h:typedef __pthread_t pthread_t;
+ type pthread_t is new unsigned_long;
+ subtype Thread_Id is pthread_t;
+
+ function To_pthread_t is new Unchecked_Conversion
+ (unsigned_long, pthread_t);
+
+ type pthread_mutex_t is limited private;
+ type pthread_rwlock_t is limited private;
+ type pthread_cond_t is limited private;
+ type pthread_attr_t is limited private;
+ type pthread_mutexattr_t is limited private;
+ type pthread_rwlockattr_t is limited private;
+ type pthread_condattr_t is limited private;
+ type pthread_key_t is private;
+
+ -- From /usr/include/pthread/pthreadtypes.h
+ PTHREAD_CREATE_DETACHED : constant := 1;
+ PTHREAD_CREATE_JOINABLE : constant := 0;
+
+ PTHREAD_SCOPE_PROCESS : constant := 1;
+ PTHREAD_SCOPE_SYSTEM : constant := 0;
+
+ -----------
+ -- Stack --
+ -----------
+
+ -- From: /usr/include/i386-gnu/bits/sigstack.h
+ type stack_t is record
+ ss_sp : System.Address;
+ ss_size : size_t;
+ ss_flags : int;
+ end record;
+ pragma Convention (C, stack_t);
+
+ function sigaltstack
+ (ss : not null access stack_t;
+ oss : access stack_t) return int;
+ pragma Import (C, sigaltstack, "sigaltstack");
+
+ Alternate_Stack : aliased System.Address;
+ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
+
+ Alternate_Stack_Size : constant := 0;
+ -- No alternate signal stack is used on this platform
+
+ Stack_Base_Available : constant Boolean := False;
+ -- Indicates whether the stack base is available on this target
+
+ function Get_Stack_Base (thread : pthread_t) return Address;
+ pragma Inline (Get_Stack_Base);
+ -- returns the stack base of the specified thread. Only call this function
+ -- when Stack_Base_Available is True.
+
+ -- From: /usr/include/unistd.h __getpagesize or getpagesize??
+ function Get_Page_Size return int;
+ pragma Import (C, Get_Page_Size, "__getpagesize");
+ -- Returns the size of a page
+
+ -- From /usr/include/i386-gnu/bits/mman.h
+ PROT_NONE : constant := 0;
+ PROT_READ : constant := 4;
+ PROT_WRITE : constant := 2;
+ PROT_EXEC : constant := 1;
+ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
+ PROT_ON : constant := PROT_NONE;
+ PROT_OFF : constant := PROT_ALL;
+
+ -- From /usr/include/i386-gnu/bits/mman.h
+ function mprotect (addr : Address; len : size_t; prot : int) return int;
+ pragma Import (C, mprotect);
+
+ ---------------------------------------
+ -- Nonstandard Thread Initialization --
+ ---------------------------------------
+
+ procedure pthread_init;
+ pragma Inline (pthread_init);
+ -- This is a dummy procedure to share some GNULLI files
+
+ -------------------------
+ -- POSIX.1c Section 3 --
+ -------------------------
+
+ -- From: /usr/include/signal.h:
+ -- sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
+ function sigwait (set : access sigset_t; sig : access Signal) return int;
+ pragma Import (C, sigwait, "sigwait");
+
+ -- From: /usr/include/pthread/pthread.h:
+ -- extern int pthread_kill (pthread_t thread, int signo);
+ function pthread_kill (thread : pthread_t; sig : Signal) return int;
+ pragma Import (C, pthread_kill, "pthread_kill");
+
+ -- From: /usr/include/i386-gnu/bits/sigthread.h
+ -- extern int pthread_sigmask (int __how, __const __sigset_t *__newmask,
+ -- __sigset_t *__oldmask) __THROW;
+ function pthread_sigmask
+ (how : int;
+ set : access sigset_t;
+ oset : access sigset_t) return int;
+ pragma Import (C, pthread_sigmask, "pthread_sigmask");
+
+ --------------------------
+ -- POSIX.1c Section 11 --
+ --------------------------
+
+ -- From: /usr/include/pthread/pthread.h and
+ -- /usr/include/pthread/pthreadtypes.h
+ function pthread_mutexattr_init
+ (attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
+
+ function pthread_mutexattr_destroy
+ (attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
+
+ function pthread_mutex_init
+ (mutex : access pthread_mutex_t;
+ attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
+
+ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
+
+ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
+
+ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
+
+ function pthread_rwlockattr_init
+ (attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlockattr_init, "pthread_rwlockattr_init");
+
+ function pthread_rwlockattr_destroy
+ (attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy");
+ PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0;
+ PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
+
+ function pthread_rwlockattr_setkind_np
+ (attr : access pthread_rwlockattr_t;
+ pref : int) return int;
+ pragma Import
+ (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
+
+ function pthread_rwlock_init
+ (mutex : access pthread_rwlock_t;
+ attr : access pthread_rwlockattr_t) return int;
+ pragma Import (C, pthread_rwlock_init, "pthread_rwlock_init");
+
+ function pthread_rwlock_destroy
+ (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_destroy, "pthread_rwlock_destroy");
+
+ function pthread_rwlock_rdlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_rdlock, "pthread_rwlock_rdlock");
+
+ function pthread_rwlock_wrlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_wrlock, "pthread_rwlock_wrlock");
+
+ function pthread_rwlock_unlock (mutex : access pthread_rwlock_t) return int;
+ pragma Import (C, pthread_rwlock_unlock, "pthread_rwlock_unlock");
+
+ function pthread_condattr_init
+ (attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
+
+ function pthread_condattr_destroy
+ (attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
+
+ function pthread_cond_init
+ (cond : access pthread_cond_t;
+ attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_cond_init, "pthread_cond_init");
+
+ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
+ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
+
+ function pthread_cond_signal (cond : access pthread_cond_t) return int;
+ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
+
+ function pthread_cond_wait
+ (cond : access pthread_cond_t;
+ mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
+
+ function pthread_cond_timedwait
+ (cond : access pthread_cond_t;
+ mutex : access pthread_mutex_t;
+ abstime : access timespec) return int;
+ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
+
+ Relative_Timed_Wait : constant Boolean := False;
+ -- pthread_cond_timedwait requires an absolute delay time
+
+ --------------------------
+ -- POSIX.1c Section 13 --
+ --------------------------
+ -- From /usr/include/pthread/pthreadtypes.h
+
+ PTHREAD_PRIO_NONE : constant := 0;
+ PTHREAD_PRIO_PROTECT : constant := 2;
+ PTHREAD_PRIO_INHERIT : constant := 1;
+
+ -- From: /usr/include/pthread/pthread.h
+ function pthread_mutexattr_setprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : int) return int;
+ pragma Import (C, pthread_mutexattr_setprotocol,
+ "pthread_mutexattr_setprotocol");
+
+ function pthread_mutexattr_getprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : access int) return int;
+ pragma Import (C, pthread_mutexattr_getprotocol,
+ "pthread_mutexattr_getprotocol");
+
+ function pthread_mutexattr_setprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : int) return int;
+ pragma Import (C, pthread_mutexattr_setprioceiling,
+ "pthread_mutexattr_setprioceiling");
+
+ function pthread_mutexattr_getprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : access int) return int;
+ pragma Import (C, pthread_mutexattr_getprioceiling,
+ "pthread_mutexattr_getprioceiling");
+
+ type struct_sched_param is record
+ sched_priority : int; -- scheduling priority
+ end record;
+ pragma Convention (C, struct_sched_param);
+
+ function pthread_setschedparam
+ (thread : pthread_t;
+ policy : int;
+ param : access struct_sched_param) return int;
+ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
+
+ function pthread_attr_setscope
+ (attr : access pthread_attr_t;
+ contentionscope : int) return int;
+ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
+
+ function pthread_attr_getscope
+ (attr : access pthread_attr_t;
+ contentionscope : access int) return int;
+ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
+
+ function pthread_attr_setinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : int) return int;
+ pragma Import (C, pthread_attr_setinheritsched,
+ "pthread_attr_setinheritsched");
+
+ function pthread_attr_getinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : access int) return int;
+ pragma Import (C, pthread_attr_getinheritsched,
+ "pthread_attr_getinheritsched");
+
+ function pthread_attr_setschedpolicy
+ (attr : access pthread_attr_t;
+ policy : int) return int;
+ pragma Import (C, pthread_attr_setschedpolicy, "pthread_setschedpolicy");
+
+ function sched_yield return int;
+ pragma Import (C, sched_yield, "sched_yield");
+
+ ---------------------------
+ -- P1003.1c - Section 16 --
+ ---------------------------
+
+ function pthread_attr_init
+ (attributes : access pthread_attr_t) return int;
+ pragma Import (C, pthread_attr_init, "pthread_attr_init");
+
+ function pthread_attr_destroy
+ (attributes : access pthread_attr_t) return int;
+ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
+
+ function pthread_attr_setdetachstate
+ (attr : access pthread_attr_t;
+ detachstate : int) return int;
+ pragma Import
+ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
+
+ function pthread_attr_setstacksize
+ (attr : access pthread_attr_t;
+ stacksize : size_t) return int;
+ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
+
+ -- From: /usr/include/pthread/pthread.h
+ function pthread_create
+ (thread : access pthread_t;
+ attributes : access pthread_attr_t;
+ start_routine : Thread_Body;
+ arg : System.Address) return int;
+ pragma Import (C, pthread_create, "pthread_create");
+
+ procedure pthread_exit (status : System.Address);
+ pragma Import (C, pthread_exit, "pthread_exit");
+
+ function pthread_self return pthread_t;
+ pragma Import (C, pthread_self, "pthread_self");
+
+ --------------------------
+ -- POSIX.1c Section 17 --
+ --------------------------
+
+ function pthread_setspecific
+ (key : pthread_key_t;
+ value : System.Address) return int;
+ pragma Import (C, pthread_setspecific, "pthread_setspecific");
+
+ function pthread_getspecific (key : pthread_key_t) return System.Address;
+ pragma Import (C, pthread_getspecific, "pthread_getspecific");
+
+ type destructor_pointer is access procedure (arg : System.Address);
+ pragma Convention (C, destructor_pointer);
+
+ function pthread_key_create
+ (key : access pthread_key_t;
+ destructor : destructor_pointer) return int;
+ pragma Import (C, pthread_key_create, "pthread_key_create");
+
+ -- From /usr/include/i386-gnu/bits/sched.h
+ CPU_SETSIZE : constant := 1_024;
+
+ type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
+ for bit_field'Size use CPU_SETSIZE;
+ pragma Pack (bit_field);
+ pragma Convention (C, bit_field);
+
+ type cpu_set_t is record
+ bits : bit_field;
+ end record;
+ pragma Convention (C, cpu_set_t);
+
+private
+
+ type sigset_t is array (1 .. 4) of unsigned;
+
+ -- In GNU/Hurd the component sa_handler turns out to
+ -- be one a union type, and the selector is a macro:
+ -- #define sa_handler __sigaction_handler.sa_handler
+ -- #define sa_sigaction __sigaction_handler.sa_sigaction
+
+ -- Should we add a signal_context type here ?
+ -- How could it be done independent of the CPU architecture ?
+ -- sigcontext type is opaque, so it is architecturally neutral.
+ -- It is always passed as an access type, so define it as an empty record
+ -- since the contents are not used anywhere.
+ type struct_sigcontext is null record;
+ pragma Convention (C, struct_sigcontext);
+
+ type pid_t is new int;
+
+ type time_t is new long;
+
+ type timespec is record
+ tv_sec : time_t;
+ tv_nsec : long;
+ end record;
+ pragma Convention (C, timespec);
+
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- typedef struct __pthread_attr pthread_attr_t;
+ -- /usr/include/i386-gnu/bits/thread-attr.h: struct __pthread_attr...
+ -- /usr/include/pthread/pthreadtypes.h: enum __pthread_contentionscope
+ -- enum __pthread_detachstate detachstate;
+ -- enum __pthread_inheritsched inheritsched;
+ -- enum __pthread_contentionscope contentionscope;
+ -- Not used: schedpolicy : int;
+ type pthread_attr_t is record
+ schedparam : struct_sched_param;
+ stackaddr : System.Address;
+ stacksize : size_t;
+ guardsize : size_t;
+ detachstate : int;
+ inheritsched : int;
+ contentionscope : int;
+ schedpolicy : int;
+ end record;
+ pragma Convention (C, pthread_attr_t);
+
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- typedef struct __pthread_condattr pthread_condattr_t;
+ -- From: /usr/include/i386-gnu/bits/condition-attr.h:
+ -- struct __pthread_condattr {
+ -- enum __pthread_process_shared pshared;
+ -- __Clockid_T Clock;}
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- enum __pthread_process_shared
+ type pthread_condattr_t is record
+ pshared : int;
+ clock : clockid_t;
+ end record;
+ pragma Convention (C, pthread_condattr_t);
+
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- typedef struct __pthread_mutexattr pthread_mutexattr_t; and
+ -- /usr/include/i386-gnu/bits/mutex-attr.h
+ -- struct __pthread_mutexattr {
+ -- int prioceiling;
+ -- enum __pthread_mutex_protocol protocol;
+ -- enum __pthread_process_shared pshared;
+ -- enum __pthread_mutex_type mutex_type;};
+ type pthread_mutexattr_t is record
+ prioceiling : int;
+ protocol : int;
+ pshared : int;
+ mutex_type : int;
+ end record;
+ pragma Convention (C, pthread_mutexattr_t);
+
+ -- From: /usr/include/pthread/pthreadtypes.h
+ -- typedef struct __pthread_mutex pthread_mutex_t; and
+ -- /usr/include/i386-gnu/bits/mutex.h:
+ -- struct __pthread_mutex {
+ -- __pthread_spinlock_t __held;
+ -- __pthread_spinlock_t __lock;
+ -- /* in cthreads, mutex_init does not initialized the third
+ -- pointer, as such, we cannot rely on its value for anything. */
+ -- char *cthreadscompat1;
+ -- struct __pthread *__queue;
+ -- struct __pthread_mutexattr *attr;
+ -- void *data;
+ -- /* up to this point, we are completely compatible with cthreads
+ -- and what libc expects. */
+ -- void *owner;
+ -- unsigned locks;
+ -- /* if null then the default attributes apply. */
+ -- };
+
+ type pthread_mutex_t is record
+ held : int;
+ lock : int;
+ cthreadcompat : System.Address;
+ queue : System.Address;
+ attr : System.Address;
+ data : System.Address;
+ owner : System.Address;
+ locks : unsigned;
+ end record;
+ pragma Convention (C, pthread_mutex_t);
+ -- pointer needed?
+ -- type pthread_mutex_t_ptr is access pthread_mutex_t;
+
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- typedef struct __pthread_cond pthread_cond_t;
+ -- typedef struct __pthread_condattr pthread_condattr_t;
+ -- /usr/include/i386-gnu/bits/condition.h:struct __pthread_cond{}
+ -- pthread_condattr_t: see above!
+ -- /usr/include/i386-gnu/bits/condition.h:
+ -- struct __pthread_condimpl *__impl;
+
+ type pthread_cond_t is record
+ lock : int;
+ queue : System.Address;
+ condattr : System.Address;
+ impl : System.Address;
+ data : System.Address;
+ end record;
+ pragma Convention (C, pthread_cond_t);
+
+ -- From: /usr/include/pthread/pthreadtypes.h:
+ -- typedef __pthread_key pthread_key_t; and
+ -- /usr/include/i386-gnu/bits/thread-specific.h:
+ -- typedef int __pthread_key;
+
+ type pthread_key_t is new int;
+
+ -- From: /usr/include/i386-gnu/bits/rwlock-attr.h:
+ -- struct __pthread_rwlockattr {
+ -- enum __pthread_process_shared pshared; };
+
+ type pthread_rwlockattr_t is record
+ pshared : int;
+ end record;
+ pragma Convention (C, pthread_rwlockattr_t);
+
+ -- From: /usr/include/i386-gnu/bits/rwlock.h:
+ -- struct __pthread_rwlock {
+ -- __pthread_spinlock_t __held;
+ -- __pthread_spinlock_t __lock;
+ -- int readers;
+ -- struct __pthread *readerqueue;
+ -- struct __pthread *writerqueue;
+ -- struct __pthread_rwlockattr *__attr;
+ -- void *__data; };
+
+ type pthread_rwlock_t is record
+ held : int;
+ lock : int;
+ readers : int;
+ readerqueue : System.Address;
+ writerqueue : System.Address;
+ attr : pthread_rwlockattr_t;
+ data : int;
+ end record;
+ pragma Convention (C, pthread_rwlock_t);
+
+end System.OS_Interface;
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index ac20ae5830f..0c05512b666 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -662,6 +662,26 @@ bitmap_popcount (BITMAP_WORD a)
return ret;
}
#endif
+
+/* Count and return the number of bits set in the bitmap word BITS. */
+static unsigned long
+bitmap_count_bits_in_word (const BITMAP_WORD *bits)
+{
+ unsigned long count = 0;
+
+ for (unsigned ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
+ {
+#if GCC_VERSION >= 3400
+ /* Note that popcountl matches BITMAP_WORD in type, so the actual size
+ of BITMAP_WORD is not material. */
+ count += __builtin_popcountl (bits[ix]);
+#else
+ count += bitmap_popcount (bits[ix]);
+#endif
+ }
+ return count;
+}
+
/* Count the number of bits set in the bitmap, and return it. */
unsigned long
@@ -669,19 +689,44 @@ bitmap_count_bits (const_bitmap a)
{
unsigned long count = 0;
const bitmap_element *elt;
- unsigned ix;
for (elt = a->first; elt; elt = elt->next)
+ count += bitmap_count_bits_in_word (elt->bits);
+
+ return count;
+}
+
+/* Count the number of unique bits set in A and B and return it. */
+
+unsigned long
+bitmap_count_unique_bits (const_bitmap a, const_bitmap b)
+{
+ unsigned long count = 0;
+ const bitmap_element *elt_a, *elt_b;
+
+ for (elt_a = a->first, elt_b = b->first; elt_a && elt_b; )
{
- for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
+ /* If we're at different indices, then count all the bits
+ in the lower element. If we're at the same index, then
+ count the bits in the IOR of the two elements. */
+ if (elt_a->indx < elt_b->indx)
{
-#if GCC_VERSION >= 3400
- /* Note that popcountl matches BITMAP_WORD in type, so the actual size
- of BITMAP_WORD is not material. */
- count += __builtin_popcountl (elt->bits[ix]);
-#else
- count += bitmap_popcount (elt->bits[ix]);
-#endif
+ count += bitmap_count_bits_in_word (elt_a->bits);
+ elt_a = elt_a->next;
+ }
+ else if (elt_b->indx < elt_a->indx)
+ {
+ count += bitmap_count_bits_in_word (elt_b->bits);
+ elt_b = elt_b->next;
+ }
+ else
+ {
+ BITMAP_WORD bits[BITMAP_ELEMENT_WORDS];
+ for (unsigned ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
+ bits[ix] = elt_a->bits[ix] | elt_b->bits[ix];
+ count += bitmap_count_bits_in_word (bits);
+ elt_a = elt_a->next;
+ elt_b = elt_b->next;
}
}
return count;
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 805e37eb47b..111571186b7 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -280,6 +280,9 @@ extern bool bitmap_single_bit_set_p (const_bitmap);
/* Count the number of bits set in the bitmap. */
extern unsigned long bitmap_count_bits (const_bitmap);
+/* Count the number of unique bits set across the two bitmaps. */
+extern unsigned long bitmap_count_unique_bits (const_bitmap, const_bitmap);
+
/* Boolean operations on bitmaps. The _into variants are two operand
versions that modify the first source operand. The other variants
are three operand versions that to not destroy the source bitmaps.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 058ecc39aab..9368ed0f5e3 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -463,7 +463,7 @@ get_pointer_alignment_1 (tree exp, unsigned int *alignp,
if (*alignp == 0)
*alignp = 1u << (HOST_BITS_PER_INT - 1);
/* We cannot really tell whether this result is an approximation. */
- return true;
+ return false;
}
else
{
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 534d6058870..26b1dabd6ee 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,31 @@
+2016-03-28 Jason Merrill <jason@redhat.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Update __cpp_range_based_for.
+
+2016-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/69884
+ * c.opt (Wignored-attributes): New option.
+
+2016-03-22 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/69993
+ * c-indentation.c (warn_for_misleading_indentation): Rewrite the
+ diagnostic text, reversing the order of the warning and note so
+ that they appear in source order.
+
+2016-03-17 Marek Polacek <polacek@redhat.com>
+
+ PR c/69407
+ * c-common.c (resolve_overloaded_builtin): Set TREE_USED for the fetch
+ operations.
+
+2016-03-14 Jason Merrill <jason@redhat.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Set __cpp_hex_float.
+
+ * c-cppbuiltin.c (c_cpp_builtins): Bump __cpp_range_based_for.
+
2016-03-09 Richard Biener <rguenther@suse.de>
PR c/70143
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 08b761c4776..30c815d5381 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -11445,6 +11445,10 @@ resolve_overloaded_builtin (location_t loc, tree function,
&& orig_code != BUILT_IN_ATOMIC_STORE_N)
result = sync_resolve_return (first_param, result, orig_format);
+ if (fetch_op)
+ /* Prevent -Wunused-value warning. */
+ TREE_USED (result) = true;
+
/* If new_return is set, assign function to that expr and cast the
result to void since the generic interface returned void. */
if (new_return)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 19999c7ef1d..94523b8fc7c 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -818,6 +818,10 @@ c_cpp_builtins (cpp_reader *pfile)
if (!pedantic || cxx_dialect > cxx11)
cpp_define (pfile, "__cpp_binary_literals=201304");
+ /* Similarly for hexadecimal floating point literals and C++17. */
+ if (!pedantic || cpp_get_options (parse_in)->extended_numbers)
+ cpp_define (pfile, "__cpp_hex_float=201603");
+
/* Arrays of runtime bound were removed from C++14, but we still
support GNU VLAs. Let's define this macro to a low number
(corresponding to the initial test release of GNU C++) if we won't
@@ -837,7 +841,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_lambdas=200907");
if (cxx_dialect == cxx11)
cpp_define (pfile, "__cpp_constexpr=200704");
- cpp_define (pfile, "__cpp_range_based_for=200907");
+ cpp_define (pfile, "__cpp_range_based_for=201603");
if (cxx_dialect <= cxx14)
cpp_define (pfile, "__cpp_static_assert=200410");
cpp_define (pfile, "__cpp_decltype=200707");
@@ -871,7 +875,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_namespace_attributes=201411");
cpp_define (pfile, "__cpp_enumerator_attributes=201411");
cpp_define (pfile, "__cpp_nested_namespace_definitions=201411");
- cpp_define (pfile, "__cpp_fold_expressions=201411");
+ cpp_define (pfile, "__cpp_fold_expressions=201603");
cpp_define (pfile, "__cpp_nontype_template_args=201411");
}
if (flag_concepts)
diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c
index b84fbf408e3..1da3f6824c1 100644
--- a/gcc/c-family/c-indentation.c
+++ b/gcc/c-family/c-indentation.c
@@ -602,10 +602,12 @@ warn_for_misleading_indentation (const token_indent_info &guard_tinfo,
body_tinfo,
next_tinfo))
{
- if (warning_at (next_tinfo.location, OPT_Wmisleading_indentation,
- "statement is indented as if it were guarded by..."))
- inform (guard_tinfo.location,
- "...this %qs clause, but it is not",
+ if (warning_at (guard_tinfo.location, OPT_Wmisleading_indentation,
+ "this %qs clause does not guard...",
+ guard_tinfo_to_string (guard_tinfo)))
+ inform (next_tinfo.location,
+ ("...this statement, but the latter is misleadingly indented"
+ " as if it is guarded by the %qs"),
guard_tinfo_to_string (guard_tinfo));
}
}
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 7c5f6c7b5cc..4f86876c533 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -482,6 +482,10 @@ Wignored-qualifiers
C C++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra)
Warn whenever type qualifiers are ignored.
+Wignored-attributes
+C C++ Var(warn_ignored_attributes) Init(1) Warning
+Warn whenever attributes are ignored.
+
Wincompatible-pointer-types
C ObjC Var(warn_incompatible_pointer_types) Init(1) Warning
Warn when there is a conversion between pointers that have incompatible types.
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 95fde9fb057..c8cb0227e2a 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,23 @@
+2016-03-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/70281
+ * c-parser.c (c_parser_postfix_expression): Set the source range
+ for uses of "__builtin_types_compatible_p".
+
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/70280
+ * c-typeck.c (composite_type): Don't count void_list_node
+ into len, if the list is terminated by void_list_node, start
+ with void_list_node instead of NULL for newargs. Stop
+ at void_list_node.
+
+2016-03-16 Marek Polacek <polacek@redhat.com>
+
+ PR c/70093
+ * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for
+ nested functions returning VM types.
+
2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
* c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 60ec996bf70..646068424bd 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -7782,9 +7782,10 @@ c_parser_postfix_expression (c_parser *parser)
expr.value = error_mark_node;
break;
}
- c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
- "expected %<)%>");
{
+ location_t close_paren_loc = c_parser_peek_token (parser)->location;
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
+ "expected %<)%>");
tree e1, e2;
e1 = groktypename (t1, NULL, NULL);
e2 = groktypename (t2, NULL, NULL);
@@ -7799,6 +7800,7 @@ c_parser_postfix_expression (c_parser *parser)
expr.value
= comptypes (e1, e2) ? integer_one_node : integer_zero_node;
+ set_c_expr_source_range (&expr, loc, close_paren_loc);
}
break;
case RID_BUILTIN_CALL_WITH_STATIC_CHAIN:
@@ -10715,7 +10717,7 @@ c_parser_oacc_data_clause (c_parser *parser, pragma_omp_clause c_kind,
kind = GOMP_MAP_FORCE_ALLOC;
break;
case PRAGMA_OACC_CLAUSE_DELETE:
- kind = GOMP_MAP_FORCE_DEALLOC;
+ kind = GOMP_MAP_DELETE;
break;
case PRAGMA_OACC_CLAUSE_DEVICE:
kind = GOMP_MAP_FORCE_TO;
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 6aa0f03dabe..fb274d5f3c9 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -518,15 +518,17 @@ composite_type (tree t1, tree t2)
/* If both args specify argument types, we must merge the two
lists, argument by argument. */
- len = list_length (p1);
- newargs = 0;
+ for (len = 0, newargs = p1;
+ newargs && newargs != void_list_node;
+ len++, newargs = TREE_CHAIN (newargs))
+ ;
for (i = 0; i < len; i++)
newargs = tree_cons (NULL_TREE, NULL_TREE, newargs);
n = newargs;
- for (; p1;
+ for (; p1 && p1 != void_list_node;
p1 = TREE_CHAIN (p1), p2 = TREE_CHAIN (p2), n = TREE_CHAIN (n))
{
/* A null type means arg type is not specified.
@@ -3068,6 +3070,16 @@ build_function_call_vec (location_t loc, vec<location_t> arg_loc,
result = build_call_array_loc (loc, TREE_TYPE (fntype),
function, nargs, argarray);
+ /* In this improbable scenario, a nested function returns a VM type.
+ Create a TARGET_EXPR so that the call always has a LHS, much as
+ what the C++ FE does for functions returning non-PODs. */
+ if (variably_modified_type_p (TREE_TYPE (fntype), NULL_TREE))
+ {
+ tree tmp = create_tmp_var_raw (TREE_TYPE (fntype));
+ result = build4 (TARGET_EXPR, TREE_TYPE (fntype), tmp, result,
+ NULL_TREE, NULL_TREE);
+ }
+
if (VOID_TYPE_P (TREE_TYPE (result)))
{
if (TYPE_QUALS (TREE_TYPE (result)) != TYPE_UNQUALIFIED)
diff --git a/gcc/calls.c b/gcc/calls.c
index 7b28f4315ab..6415e08b28d 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2083,9 +2083,9 @@ load_register_parameters (struct arg_data *args, int num_actuals,
/* Check for overlap with already clobbered argument area,
providing that this has non-zero size. */
if (is_sibcall
- && (size == 0
- || mem_overlaps_already_clobbered_arg_p
- (XEXP (args[i].value, 0), size)))
+ && size != 0
+ && (mem_overlaps_already_clobbered_arg_p
+ (XEXP (args[i].value, 0), size)))
*sibcall_failure = 1;
if (size % UNITS_PER_WORD == 0
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 871ed62fd61..4804081f3d9 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3369,7 +3369,10 @@ cgraph_node::get_body (void)
{
opt_pass *saved_current_pass = current_pass;
FILE *saved_dump_file = dump_file;
+ const char *saved_dump_file_name = dump_file_name;
int saved_dump_flags = dump_flags;
+ dump_file_name = NULL;
+ dump_file = NULL;
push_cfun (DECL_STRUCT_FUNCTION (decl));
execute_all_ipa_transforms ();
@@ -3381,6 +3384,7 @@ cgraph_node::get_body (void)
current_pass = saved_current_pass;
dump_file = saved_dump_file;
+ dump_file_name = saved_dump_file_name;
dump_flags = saved_dump_flags;
}
return updated;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index d0345c698c5..e9292852399 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -2173,6 +2173,9 @@ public:
FILE* GTY ((skip)) dump_file;
+ /* Return symbol used to separate symbol name from suffix. */
+ static char symbol_suffix_separator ();
+
private:
/* Allocate new callgraph node. */
inline cgraph_node * allocate_cgraph_symbol (void);
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 354655e85d2..07ceb1a80d4 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -512,13 +512,7 @@ clone_function_name_1 (const char *name, const char *suffix)
prefix = XALLOCAVEC (char, len + strlen (suffix) + 2);
memcpy (prefix, name, len);
strcpy (prefix + len + 1, suffix);
-#ifndef NO_DOT_IN_LABEL
- prefix[len] = '.';
-#elif !defined NO_DOLLAR_IN_LABEL
- prefix[len] = '$';
-#else
- prefix[len] = '_';
-#endif
+ prefix[len] = symbol_table::symbol_suffix_separator ();
ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix, clone_fn_id_num++);
return get_identifier (tmp_name);
}
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 8b3fddc435e..4351ae49952 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1708,7 +1708,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
/* Build call to the function being thunked. */
if (!VOID_TYPE_P (restype)
- && (!alias_is_noreturn || TREE_ADDRESSABLE (restype)))
+ && (!alias_is_noreturn
+ || TREE_ADDRESSABLE (restype)
+ || TREE_CODE (TYPE_SIZE_UNIT (restype)) != INTEGER_CST))
{
if (DECL_BY_REFERENCE (resdecl))
{
diff --git a/gcc/combine.c b/gcc/combine.c
index 24dcefa0bf6..1d0e8beeb2c 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10524,9 +10524,24 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
&& CONST_INT_P (XEXP (varop, 0))
&& !CONST_INT_P (XEXP (varop, 1)))
{
+ /* For ((unsigned) (cstULL >> count)) >> cst2 we have to make
+ sure the result will be masked. See PR70222. */
+ if (code == LSHIFTRT
+ && mode != result_mode
+ && !merge_outer_ops (&outer_op, &outer_const, AND,
+ GET_MODE_MASK (result_mode)
+ >> orig_count, result_mode,
+ &complement_p))
+ break;
+ /* For ((int) (cstLL >> count)) >> cst2 just give up. Queuing
+ up outer sign extension (often left and right shift) is
+ hardly more efficient than the original. See PR70429. */
+ if (code == ASHIFTRT && mode != result_mode)
+ break;
+
rtx new_rtx = simplify_const_binary_operation (code, mode,
- XEXP (varop, 0),
- GEN_INT (count));
+ XEXP (varop, 0),
+ GEN_INT (count));
varop = gen_rtx_fmt_ee (code, mode, new_rtx, XEXP (varop, 1));
count = 0;
continue;
diff --git a/gcc/common.opt b/gcc/common.opt
index 1c8cc8ede8f..67048db7c9b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1840,7 +1840,7 @@ Common Report Var(flag_peephole2) Optimization
Enable an RTL peephole pass before sched2.
fPIC
-Common Report Var(flag_pic,2) Negative(fPIE)
+Common Report Var(flag_pic,2) Negative(fPIE) Init(-1)
Generate position-independent code if possible (large mode).
fPIE
@@ -1848,7 +1848,7 @@ Common Report Var(flag_pie,2) Negative(fpic) Init(-1)
Generate position-independent code for executables if possible (large mode).
fpic
-Common Report Var(flag_pic,1) Negative(fpie)
+Common Report Var(flag_pic,1) Negative(fpie) Init(-1)
Generate position-independent code if possible (small mode).
fpie
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index dced2098918..58c9d0d01d8 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -429,4 +429,8 @@ bool extract_base_offset_in_addr (rtx mem, rtx *base, rtx *offset);
bool aarch64_operands_ok_for_ldpstp (rtx *, bool, enum machine_mode);
bool aarch64_operands_adjust_ok_for_ldpstp (rtx *, bool, enum machine_mode);
extern bool aarch64_nopcrelative_literal_loads;
+
+extern void aarch64_asm_output_pool_epilogue (FILE *, const char *,
+ tree, HOST_WIDE_INT);
+
#endif /* GCC_AARCH64_PROTOS_H */
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index cf1239dd69d..b7086dd4667 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -537,7 +537,7 @@ static const struct tune_params exynosm1_tunings =
2, /* min_div_recip_mul_df. */
48, /* max_case_values. */
64, /* cache_line_size. */
- tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
+ tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_APPROX_RSQRT) /* tune_flags. */
};
@@ -3847,6 +3847,18 @@ aarch64_mode_valid_for_sched_fusion_p (machine_mode mode)
&& GET_MODE_SIZE (mode) == 8);
}
+/* Return true if REGNO is a virtual pointer register, or an eliminable
+ "soft" frame register. Like REGNO_PTR_FRAME_P except that we don't
+ include stack_pointer or hard_frame_pointer. */
+static bool
+virt_or_elim_regno_p (unsigned regno)
+{
+ return ((regno >= FIRST_VIRTUAL_REGISTER
+ && regno <= LAST_VIRTUAL_POINTER_REGISTER)
+ || regno == FRAME_POINTER_REGNUM
+ || regno == ARG_POINTER_REGNUM);
+}
+
/* Return true if X is a valid address for machine mode MODE. If it is,
fill in INFO appropriately. STRICT_P is true if REG_OK_STRICT is in
effect. OUTER_CODE is PARALLEL for a load/store pair. */
@@ -3890,9 +3902,7 @@ aarch64_classify_address (struct aarch64_address_info *info,
if (! strict_p
&& REG_P (op0)
- && (op0 == virtual_stack_vars_rtx
- || op0 == frame_pointer_rtx
- || op0 == arg_pointer_rtx)
+ && virt_or_elim_regno_p (REGNO (op0))
&& CONST_INT_P (op1))
{
info->type = ADDRESS_REG_IMM;
@@ -4953,74 +4963,43 @@ aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1)))
{
- HOST_WIDE_INT offset = INTVAL (XEXP (x, 1));
- HOST_WIDE_INT base_offset;
+ rtx base = XEXP (x, 0);
+ rtx offset_rtx XEXP (x, 1);
+ HOST_WIDE_INT offset = INTVAL (offset_rtx);
- if (GET_CODE (XEXP (x, 0)) == PLUS)
+ if (GET_CODE (base) == PLUS)
{
- rtx op0 = XEXP (XEXP (x, 0), 0);
- rtx op1 = XEXP (XEXP (x, 0), 1);
+ rtx op0 = XEXP (base, 0);
+ rtx op1 = XEXP (base, 1);
- /* Address expressions of the form Ra + Rb + CONST.
+ /* Force any scaling into a temp for CSE. */
+ op0 = force_reg (Pmode, op0);
+ op1 = force_reg (Pmode, op1);
- If CONST is within the range supported by the addressing
- mode "reg+offset", do not split CONST and use the
- sequence
- Rt = Ra + Rb;
- addr = Rt + CONST. */
- if (REG_P (op0) && REG_P (op1))
- {
- machine_mode addr_mode = GET_MODE (x);
- rtx base = gen_reg_rtx (addr_mode);
- rtx addr = plus_constant (addr_mode, base, offset);
+ /* Let the pointer register be in op0. */
+ if (REG_POINTER (op1))
+ std::swap (op0, op1);
- if (aarch64_legitimate_address_hook_p (mode, addr, false))
- {
- emit_insn (gen_adddi3 (base, op0, op1));
- return addr;
- }
- }
- /* Address expressions of the form Ra + Rb<<SCALE + CONST.
-
- If Reg + Rb<<SCALE is a valid address expression, do not
- split CONST and use the sequence
- Rc = CONST;
- Rt = Ra + Rc;
- addr = Rt + Rb<<SCALE.
-
- TODO: We really should split CONST out of memory referece
- because:
- a) We depend on GIMPLE optimizers to pick up common sub
- expression involving the scaling operation.
- b) The index Rb is likely a loop iv, it's better to split
- the CONST so that computation of new base Rt is a loop
- invariant and can be moved out of loop. This is more
- important when the original base Ra is sfp related.
-
- Unfortunately, GIMPLE optimizers (e.g., SLSR) can not handle
- this kind of CSE opportunity at the time of this change, we
- have to force register scaling expr out of memory ref now. */
- else if (REG_P (op0) || REG_P (op1))
+ /* If the pointer is virtual or frame related, then we know that
+ virtual register instantiation or register elimination is going
+ to apply a second constant. We want the two constants folded
+ together easily. Therefore, emit as (OP0 + CONST) + OP1. */
+ if (virt_or_elim_regno_p (REGNO (op0)))
{
- machine_mode addr_mode = GET_MODE (x);
- rtx base = gen_reg_rtx (addr_mode);
-
- /* Switch to make sure that register is in op0. */
- if (REG_P (op1))
- std::swap (op0, op1);
-
- rtx addr = plus_constant (addr_mode, base, offset);
-
- if (aarch64_legitimate_address_hook_p (mode, addr, false))
- {
- base = force_operand (gen_rtx_PLUS (addr_mode, op1, op0),
- NULL_RTX);
- return plus_constant (addr_mode, base, offset);
- }
+ base = expand_binop (Pmode, add_optab, op0, offset_rtx,
+ NULL_RTX, true, OPTAB_DIRECT);
+ return gen_rtx_PLUS (Pmode, base, op1);
}
+
+ /* Otherwise, in order to encourage CSE (and thence loop strength
+ reduce) scaled addresses, emit as (OP0 + OP1) + CONST. */
+ base = expand_binop (Pmode, add_optab, op0, op1,
+ NULL_RTX, true, OPTAB_DIRECT);
+ x = gen_rtx_PLUS (Pmode, base, offset_rtx);
}
/* Does it look like we'll need a load/store-pair operation? */
+ HOST_WIDE_INT base_offset;
if (GET_MODE_SIZE (mode) > 16
|| mode == TImode)
base_offset = ((offset + 64 * GET_MODE_SIZE (mode))
@@ -5032,15 +5011,12 @@ aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
else
base_offset = offset & ~0xfff;
- if (base_offset == 0)
- return x;
-
- offset -= base_offset;
- rtx base_reg = gen_reg_rtx (Pmode);
- rtx val = force_operand (plus_constant (Pmode, XEXP (x, 0), base_offset),
- NULL_RTX);
- emit_move_insn (base_reg, val);
- x = plus_constant (Pmode, base_reg, offset);
+ if (base_offset != 0)
+ {
+ base = plus_constant (Pmode, base, base_offset);
+ base = force_operand (base, NULL_RTX);
+ return plus_constant (Pmode, base, offset - base_offset);
+ }
}
return x;
@@ -5579,6 +5555,18 @@ aarch64_select_rtx_section (machine_mode mode,
return default_elf_select_rtx_section (mode, x, align);
}
+/* Implement ASM_OUTPUT_POOL_EPILOGUE. */
+void
+aarch64_asm_output_pool_epilogue (FILE *f, const char *, tree,
+ HOST_WIDE_INT offset)
+{
+ /* When using per-function literal pools, we must ensure that any code
+ section is aligned to the minimal instruction length, lest we get
+ errors from the assembler re "unaligned instructions". */
+ if ((offset & 3) && aarch64_can_use_per_function_literal_pools_p ())
+ ASM_OUTPUT_ALIGN (f, 2);
+}
+
/* Costs. */
/* Helper function for rtx cost calculation. Strip a shift expression
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index ec96ce3468b..7750d1c060d 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -928,4 +928,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#define EXTRA_SPECS \
{ "asm_cpu_spec", ASM_CPU_SPEC }
+#define ASM_OUTPUT_POOL_EPILOGUE aarch64_asm_output_pool_epilogue
+
#endif /* GCC_AARCH64_H */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c868490d768..5974c65d314 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -15596,14 +15596,27 @@ arm_reload_out_hi (rtx *operands)
/* The slot is out of range, or was dressed up in a SUBREG. */
base = reg_equiv_address (REGNO (ref));
- /* PR 62554: If there is no equivalent memory location then just move
+ /* PR 62254: If there is no equivalent memory location then just move
the value as an SImode register move. This happens when the target
architecture variant does not have an HImode register move. */
if (base == NULL)
{
- gcc_assert (REG_P (outval));
- emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0),
- gen_rtx_SUBREG (SImode, outval, 0)));
+ gcc_assert (REG_P (outval) || SUBREG_P (outval));
+
+ if (REG_P (outval))
+ {
+ emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0),
+ gen_rtx_SUBREG (SImode, outval, 0)));
+ }
+ else /* SUBREG_P (outval) */
+ {
+ if (GET_MODE (SUBREG_REG (outval)) == SImode)
+ emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0),
+ SUBREG_REG (outval)));
+ else
+ /* FIXME: Handle other cases ? */
+ gcc_unreachable ();
+ }
return;
}
}
diff --git a/gcc/config/arm/arm1020e.md b/gcc/config/arm/arm1020e.md
index 7cdab57ddb3..84a300d8045 100644
--- a/gcc/config/arm/arm1020e.md
+++ b/gcc/config/arm/arm1020e.md
@@ -246,13 +246,14 @@
(eq_attr "type" "branch"))
"1020a_e")
-;; The latency for a call is not predictable. Therefore, we use 32 as
-;; roughly equivalent to positive infinity.
+;; The latency for a call is not predictable. Therefore, we model as blocking
+;; execution for a number of cycles but we can't do anything more accurate
+;; than that.
(define_insn_reservation "1020call_op" 32
(and (eq_attr "tune" "arm1020e,arm1022e")
(eq_attr "type" "call"))
- "1020a_e*32")
+ "1020a_e*4")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; VFP
@@ -300,12 +301,12 @@
(define_insn_reservation "v10_fdivs" 18
(and (eq_attr "vfp10" "yes")
(eq_attr "type" "fdivs, fsqrts"))
- "1020a_e+v10_ds*14")
+ "1020a_e+v10_ds*4")
(define_insn_reservation "v10_fdivd" 32
(and (eq_attr "vfp10" "yes")
(eq_attr "type" "fdivd, fsqrtd"))
- "1020a_e+v10_fmac+v10_ds*28")
+ "1020a_e+v10_fmac+v10_ds*4")
(define_insn_reservation "v10_floads" 4
(and (eq_attr "vfp10" "yes")
diff --git a/gcc/config/arm/driver-arm.c b/gcc/config/arm/driver-arm.c
index 466743b9d47..95dc9d53b6c 100644
--- a/gcc/config/arm/driver-arm.c
+++ b/gcc/config/arm/driver-arm.c
@@ -128,12 +128,11 @@ host_detect_local_cpu (int argc, const char **argv)
}
}
- fclose (f);
-
- if (val == NULL)
- goto not_found;
-
- return concat ("-m", argv[0], "=", val, NULL);
+ if (val)
+ {
+ fclose (f);
+ return concat ("-m", argv[0], "=", val, NULL);
+ }
not_found:
{
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index ff26f2e325b..c9884461841 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -3351,7 +3351,7 @@
(define_expand "rotl<mode>3"
[(parallel [(set (match_operand:HISI 0 "register_operand" "")
(rotate:HISI (match_operand:HISI 1 "register_operand" "")
- (match_operand:VOID 2 "const_int_operand" "")))
+ (match_operand:HISI 2 "const_int_operand" "")))
(clobber (match_dup 3))])]
""
{
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index 15a61513e97..18f96613ae6 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -2026,8 +2026,8 @@
{
operands[10] = simplify_gen_subreg (<WMODE:MODE>mode, operands[3],
<WMODE2:MODE>mode, 0);
- replace_rtx (operands[2], operands[9], operands[3]);
- replace_rtx (operands[2], operands[0], operands[10]);
+ replace_rtx (operands[2], operands[9], operands[3], true);
+ replace_rtx (operands[2], operands[0], operands[10], true);
gcc_assert (!reg_overlap_mentioned_p (operands[0], operands[2]));
})
diff --git a/gcc/config/ft32/ft32.md b/gcc/config/ft32/ft32.md
index e8029af76ea..35b38a8896f 100644
--- a/gcc/config/ft32/ft32.md
+++ b/gcc/config/ft32/ft32.md
@@ -101,7 +101,7 @@
(div:SI
(match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "ft32_rimm_operand" "r,KA")))]
- ""
+ "!TARGET_NODIV"
"div.l %0,%1,%2")
(define_insn "modsi3"
@@ -109,7 +109,7 @@
(mod:SI
(match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "ft32_rimm_operand" "r,KA")))]
- ""
+ "!TARGET_NODIV"
"mod.l %0,%1,%2")
(define_insn "udivsi3"
@@ -117,7 +117,7 @@
(udiv:SI
(match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "ft32_rimm_operand" "r,KA")))]
- ""
+ "!TARGET_NODIV"
"udiv.l %0,%1,%2")
(define_insn "umodsi3"
@@ -125,7 +125,7 @@
(umod:SI
(match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "register_operand" "r,KA")))]
- ""
+ "!TARGET_NODIV"
"umod.l %0,%1,%2")
(define_insn "extvsi"
diff --git a/gcc/config/ft32/ft32.opt b/gcc/config/ft32/ft32.opt
index e48c72b172e..20054a20b3c 100644
--- a/gcc/config/ft32/ft32.opt
+++ b/gcc/config/ft32/ft32.opt
@@ -25,3 +25,7 @@ target the software simulator.
mlra
Target Report Var(ft32_lra_flag) Init(0) Save
Use LRA instead of reload.
+
+mnodiv
+Target Report Mask(NODIV)
+Avoid use of the DIV and MOD instructions
diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h
index 1d98ec831e8..1dbecdae6dc 100644
--- a/gcc/config/gnu.h
+++ b/gcc/config/gnu.h
@@ -19,14 +19,6 @@ You should have received a copy of the GNU General Public License
along with GCC. If not, see <http://www.gnu.org/licenses/>.
*/
-/* Provide GCC options for standard feature-test macros. */
-#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
-
-/* Default C library spec. */
-#undef LIB_SPEC
-#define LIB_SPEC "%{pthread:-lpthread} %{pg|p|profile:-lc_p;:-lc}"
-
#undef GNU_USER_TARGET_OS_CPP_BUILTINS
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
do { \
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index c726d31f496..9d2f94f69c2 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -27,11 +27,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
- "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
+ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#else
#define STARTFILE_SPEC \
- "%{!shared: %{pg|p|profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \
+ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3d8dbc48e5f..7a75a31741b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3409,6 +3409,20 @@ scalar_chain::convert_op (rtx *op, rtx_insn *insn)
fprintf (dump_file, " Preloading operand for insn %d into r%d\n",
INSN_UID (insn), REGNO (tmp));
}
+ else if (REG_P (*op))
+ {
+ /* We may have not converted register usage in case
+ this register has no definition. Otherwise it
+ should be converted in convert_reg. */
+ df_ref ref;
+ FOR_EACH_INSN_USE (ref, insn)
+ if (DF_REF_REGNO (ref) == REGNO (*op))
+ {
+ gcc_assert (!DF_REF_CHAIN (ref));
+ break;
+ }
+ *op = gen_rtx_SUBREG (V2DImode, *op, 0);
+ }
else
{
gcc_assert (SUBREG_P (*op));
@@ -13449,9 +13463,11 @@ ix86_expand_epilogue (int style)
rtx sa = EH_RETURN_STACKADJ_RTX;
rtx_insn *insn;
- /* Stack align doesn't work with eh_return. */
- gcc_assert (!stack_realign_drap);
- /* Neither does regparm nested functions. */
+ /* %ecx can't be used for both DRAP register and eh_return. */
+ if (crtl->drap_reg)
+ gcc_assert (REGNO (crtl->drap_reg) != CX_REG);
+
+ /* regparm nested functions don't work with eh_return. */
gcc_assert (!ix86_static_chain_on_stack);
if (frame_pointer_needed)
@@ -32429,6 +32445,14 @@ def_builtin (HOST_WIDE_INT mask, const char *name,
{
ix86_builtins_isa[(int) code].isa = mask;
+ /* OPTION_MASK_ISA_AVX512VL has special meaning. Despite of generic case,
+ where any bit set means that built-in is enable, this bit must be *and-ed*
+ with another one. E.g.: OPTION_MASK_ISA_AVX512DQ | OPTION_MASK_ISA_AVX512VL
+ means that *both* cpuid bits must be set for the built-in to be available.
+ Handle this here. */
+ if (mask & ix86_isa_flags & OPTION_MASK_ISA_AVX512VL)
+ mask &= ~OPTION_MASK_ISA_AVX512VL;
+
mask &= ~OPTION_MASK_ISA_64BIT;
if (mask == 0
|| (mask & ix86_isa_flags) != 0
@@ -34094,9 +34118,9 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_permvarv16hi_mask, "__builtin_ia32_permvarhi256_mask", IX86_BUILTIN_VPERMVARHI256_MASK, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI_V16HI_UHI },
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_permvarv8hi_mask, "__builtin_ia32_permvarhi128_mask", IX86_BUILTIN_VPERMVARHI128_MASK, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_V8HI_UQI },
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16hi3_mask, "__builtin_ia32_vpermt2varhi256_mask", IX86_BUILTIN_VPERMT2VARHI256, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI_V16HI_UHI },
- { OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16hi3_maskz, "__builtin_ia32_vpermt2varhi256_maskz", IX86_BUILTIN_VPERMT2VARHI256_MASKZ, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI_V16HI_UHI },
+ { OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16hi3_maskz, "__builtin_ia32_vpermt2varhi256_maskz", IX86_BUILTIN_VPERMT2VARHI256_MASKZ, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI_V16HI_UHI },
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv8hi3_mask, "__builtin_ia32_vpermt2varhi128_mask", IX86_BUILTIN_VPERMT2VARHI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_V8HI_UQI },
- { OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv8hi3_maskz, "__builtin_ia32_vpermt2varhi128_maskz", IX86_BUILTIN_VPERMT2VARHI128_MASKZ, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_V8HI_UQI },
+ { OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv8hi3_maskz, "__builtin_ia32_vpermt2varhi128_maskz", IX86_BUILTIN_VPERMT2VARHI128_MASKZ, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_V8HI_UQI },
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermi2varv16hi3_mask, "__builtin_ia32_vpermi2varhi256_mask", IX86_BUILTIN_VPERMI2VARHI256, UNKNOWN, (int) V16HI_FTYPE_V16HI_V16HI_V16HI_UHI },
{ OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermi2varv8hi3_mask, "__builtin_ia32_vpermi2varhi128_mask", IX86_BUILTIN_VPERMI2VARHI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_V8HI_UQI },
{ OPTION_MASK_ISA_AVX512VL, CODE_FOR_rcp14v4df_mask, "__builtin_ia32_rcp14pd256_mask", IX86_BUILTIN_RCP14PD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_UQI },
@@ -34811,9 +34835,9 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_permvarv32qi_mask, "__builtin_ia32_permvarqi256_mask", IX86_BUILTIN_VPERMVARQI256_MASK, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_V32QI_USI },
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_permvarv16qi_mask, "__builtin_ia32_permvarqi128_mask", IX86_BUILTIN_VPERMVARQI128_MASK, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI_UHI },
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv32qi3_mask, "__builtin_ia32_vpermt2varqi256_mask", IX86_BUILTIN_VPERMT2VARQI256, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_V32QI_USI },
- { OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv32qi3_maskz, "__builtin_ia32_vpermt2varqi256_maskz", IX86_BUILTIN_VPERMT2VARQI256_MASKZ, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_V32QI_USI },
+ { OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv32qi3_maskz, "__builtin_ia32_vpermt2varqi256_maskz", IX86_BUILTIN_VPERMT2VARQI256_MASKZ, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_V32QI_USI },
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16qi3_mask, "__builtin_ia32_vpermt2varqi128_mask", IX86_BUILTIN_VPERMT2VARQI128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI_UHI },
- { OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16qi3_maskz, "__builtin_ia32_vpermt2varqi128_maskz", IX86_BUILTIN_VPERMT2VARQI128_MASKZ, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI_UHI },
+ { OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermt2varv16qi3_maskz, "__builtin_ia32_vpermt2varqi128_maskz", IX86_BUILTIN_VPERMT2VARQI128_MASKZ, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI_UHI },
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermi2varv32qi3_mask, "__builtin_ia32_vpermi2varqi256_mask", IX86_BUILTIN_VPERMI2VARQI256, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI_V32QI_USI },
{ OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_vpermi2varv16qi3_mask, "__builtin_ia32_vpermi2varqi128_mask", IX86_BUILTIN_VPERMI2VARQI128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI_UHI },
};
@@ -46908,7 +46932,12 @@ half:
{
tmp = gen_reg_rtx (mode);
emit_insn (gen_rtx_SET (tmp, gen_rtx_VEC_DUPLICATE (mode, val)));
- emit_insn (gen_blendm (target, tmp, target,
+ /* The avx512*_blendm<mode> expanders have different operand order
+ from VEC_MERGE. In VEC_MERGE, the first input operand is used for
+ elements where the mask is set and second input operand otherwise,
+ in {sse,avx}*_*blend* the first input operand is used for elements
+ where the mask is clear and second input operand otherwise. */
+ emit_insn (gen_blendm (target, target, tmp,
force_reg (mmode,
gen_int_mode (1 << elt, mmode))));
}
@@ -51910,16 +51939,24 @@ ix86_expand_vecop_qihi (enum rtx_code code, rtx dest, rtx op1, rtx op2)
{
/* For SSE2, we used an full interleave, so the desired
results are in the even elements. */
- for (i = 0; i < 64; ++i)
+ for (i = 0; i < d.nelt; ++i)
d.perm[i] = i * 2;
}
else
{
/* For AVX, the interleave used above was not cross-lane. So the
extraction is evens but with the second and third quarter swapped.
- Happily, that is even one insn shorter than even extraction. */
- for (i = 0; i < 64; ++i)
- d.perm[i] = i * 2 + ((i & 24) == 8 ? 16 : (i & 24) == 16 ? -16 : 0);
+ Happily, that is even one insn shorter than even extraction.
+ For AVX512BW we have 4 lanes. We extract evens from within a lane,
+ always first from the first and then from the second source operand,
+ the index bits above the low 4 bits remains the same.
+ Thus, for d.nelt == 32 we want permutation
+ 0,2,4,..14, 32,34,36,..46, 16,18,20,..30, 48,50,52,..62
+ and for d.nelt == 64 we want permutation
+ 0,2,4,..14, 64,66,68,..78, 16,18,20,..30, 80,82,84,..94,
+ 32,34,36,..46, 96,98,100,..110, 48,50,52,..62, 112,114,116,..126. */
+ for (i = 0; i < d.nelt; ++i)
+ d.perm[i] = ((i * 2) & 14) + ((i & 8) ? d.nelt : 0) + (i & ~15);
}
ok = ix86_expand_vec_perm_const_1 (&d);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 8d39b5de2cb..d0b418b0fd9 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1638,7 +1638,8 @@ enum reg_class
#define ACCUMULATE_OUTGOING_ARGS \
((TARGET_ACCUMULATE_OUTGOING_ARGS && optimize_function_for_speed_p (cfun)) \
- || TARGET_STACK_PROBE || TARGET_64BIT_MS_ABI)
+ || TARGET_STACK_PROBE || TARGET_64BIT_MS_ABI \
+ || (TARGET_MACHO && crtl->profile))
/* If defined, a C expression whose value is nonzero when we want to use PUSH
instructions to pass outgoing arguments. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 554e6239fda..f324ea7ea41 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1872,14 +1872,6 @@
(set_attr "mode" "<MODE>")])
-;; Move instructions.
-
-(define_expand "movxi"
- [(set (match_operand:XI 0 "nonimmediate_operand")
- (match_operand:XI 1 "general_operand"))]
- "TARGET_AVX512F"
- "ix86_expand_move (XImode, operands); DONE;")
-
;; Reload patterns to support multi-word load/store
;; with non-offsetable address.
(define_expand "reload_noff_store"
@@ -1914,15 +1906,23 @@
DONE;
})
+;; Move instructions.
+
+(define_expand "movxi"
+ [(set (match_operand:XI 0 "nonimmediate_operand")
+ (match_operand:XI 1 "general_operand"))]
+ "TARGET_AVX512F"
+ "ix86_expand_vector_move (XImode, operands); DONE;")
+
(define_expand "movoi"
[(set (match_operand:OI 0 "nonimmediate_operand")
(match_operand:OI 1 "general_operand"))]
"TARGET_AVX"
- "ix86_expand_move (OImode, operands); DONE;")
+ "ix86_expand_vector_move (OImode, operands); DONE;")
(define_expand "movti"
[(set (match_operand:TI 0 "nonimmediate_operand")
- (match_operand:TI 1 "nonimmediate_operand"))]
+ (match_operand:TI 1 "general_operand"))]
"TARGET_64BIT || TARGET_SSE"
{
if (TARGET_64BIT)
@@ -4229,17 +4229,28 @@
{
/* If it is unsafe to overwrite upper half of source, we need
to move to destination and unpack there. */
- if ((ORIGINAL_REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
- || PSEUDO_REGNO_BYTES (ORIGINAL_REGNO (operands[1])) > 4)
- && true_regnum (operands[0]) != true_regnum (operands[1]))
+ if (((ORIGINAL_REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
+ || PSEUDO_REGNO_BYTES (ORIGINAL_REGNO (operands[1])) > 4)
+ && true_regnum (operands[0]) != true_regnum (operands[1]))
+ || (EXT_REX_SSE_REG_P (operands[1])
+ && !TARGET_AVX512VL))
{
rtx tmp = gen_rtx_REG (SFmode, true_regnum (operands[0]));
emit_move_insn (tmp, operands[1]);
}
else
operands[3] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0);
- emit_insn (gen_vec_interleave_lowv4sf (operands[3], operands[3],
- operands[3]));
+ /* FIXME: vec_interleave_lowv4sf for AVX512VL should allow
+ =v, v, then vbroadcastss will be only needed for AVX512F without
+ AVX512VL. */
+ if (!EXT_REX_SSE_REGNO_P (true_regnum (operands[3])))
+ emit_insn (gen_vec_interleave_lowv4sf (operands[3], operands[3],
+ operands[3]));
+ else
+ {
+ rtx tmp = simplify_gen_subreg (V16SFmode, operands[3], V4SFmode, 0);
+ emit_insn (gen_avx512f_vec_dupv16sf_1 (tmp, tmp));
+ }
}
else
emit_insn (gen_vec_setv4sf_0 (operands[3],
@@ -8130,16 +8141,31 @@
(match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:DI 2 "x86_64_szext_general_operand" "Z,re,rm")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && TARGET_STV && TARGET_SSE2 && ix86_binary_operator_ok (AND, DImode, operands)"
+ "!TARGET_64BIT && TARGET_STV && TARGET_SSE2
+ && ix86_binary_operator_ok (AND, DImode, operands)"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0)
- (and:SI (match_dup 1) (match_dup 2)))
- (clobber (reg:CC FLAGS_REG))])
- (parallel [(set (match_dup 3)
- (and:SI (match_dup 4) (match_dup 5)))
- (clobber (reg:CC FLAGS_REG))])]
- "split_double_mode (DImode, &operands[0], 3, &operands[0], &operands[3]);")
+ [(const_int 0)]
+{
+ split_double_mode (DImode, &operands[0], 3, &operands[0], &operands[3]);
+ if (operands[2] == const0_rtx)
+ {
+ operands[1] = const0_rtx;
+ ix86_expand_move (SImode, &operands[0]);
+ }
+ else if (operands[2] != constm1_rtx)
+ ix86_expand_binary_operator (AND, SImode, &operands[0]);
+ else if (operands[5] == constm1_rtx)
+ emit_note (NOTE_INSN_DELETED);
+ if (operands[5] == const0_rtx)
+ {
+ operands[4] = const0_rtx;
+ ix86_expand_move (SImode, &operands[3]);
+ }
+ else if (operands[5] != constm1_rtx)
+ ix86_expand_binary_operator (AND, SImode, &operands[3]);
+ DONE;
+})
(define_insn "*andsi_1"
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r,Ya,!k")
@@ -8289,10 +8315,10 @@
(clobber (reg:CC FLAGS_REG))]
"TARGET_AVX512F && !TARGET_BMI && reload_completed"
[(set (match_dup 0)
- (not:HI (match_dup 0)))
+ (not:SWI12 (match_dup 0)))
(parallel [(set (match_dup 0)
- (and:HI (match_dup 0)
- (match_dup 1)))
+ (and:SWI12 (match_dup 0)
+ (match_dup 1)))
(clobber (reg:CC FLAGS_REG))])])
;; Turn *anddi_1 into *andsi_1_zext if possible.
@@ -8654,16 +8680,41 @@
(match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
(match_operand:DI 2 "x86_64_szext_general_operand" "Z,re,rm")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && TARGET_STV && TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, DImode, operands)"
+ "!TARGET_64BIT && TARGET_STV && TARGET_SSE2
+ && ix86_binary_operator_ok (<CODE>, DImode, operands)"
"#"
"&& reload_completed"
- [(parallel [(set (match_dup 0)
- (any_or:SI (match_dup 1) (match_dup 2)))
- (clobber (reg:CC FLAGS_REG))])
- (parallel [(set (match_dup 3)
- (any_or:SI (match_dup 4) (match_dup 5)))
- (clobber (reg:CC FLAGS_REG))])]
- "split_double_mode (DImode, &operands[0], 3, &operands[0], &operands[3]);")
+ [(const_int 0)]
+{
+ split_double_mode (DImode, &operands[0], 3, &operands[0], &operands[3]);
+ if (operands[2] == constm1_rtx)
+ {
+ if (<CODE> == IOR)
+ {
+ operands[1] = constm1_rtx;
+ ix86_expand_move (SImode, &operands[0]);
+ }
+ else
+ ix86_expand_unary_operator (NOT, SImode, &operands[0]);
+ }
+ else if (operands[2] != const0_rtx)
+ ix86_expand_binary_operator (<CODE>, SImode, &operands[0]);
+ else if (operands[5] == const0_rtx)
+ emit_note (NOTE_INSN_DELETED);
+ if (operands[5] == constm1_rtx)
+ {
+ if (<CODE> == IOR)
+ {
+ operands[4] = constm1_rtx;
+ ix86_expand_move (SImode, &operands[3]);
+ }
+ else
+ ix86_expand_unary_operator (NOT, SImode, &operands[3]);
+ }
+ else if (operands[5] != const0_rtx)
+ ix86_expand_binary_operator (<CODE>, SImode, &operands[3]);
+ DONE;
+})
(define_insn_and_split "*andndi3_doubleword"
[(set (match_operand:DI 0 "register_operand" "=r,r")
@@ -17885,7 +17936,7 @@
(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 0) (match_dup 1)]))
(clobber (reg:CC FLAGS_REG))])]
- "operands[4] = replace_rtx (operands[2], operands[0], operands[1]);")
+ "operands[4] = replace_rtx (operands[2], operands[0], operands[1], true);")
(define_peephole2
[(set (match_operand 0 "register_operand")
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index e56e554a740..368c2d2d211 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -137,8 +137,9 @@ along with GCC; see the file COPYING3. If not see
/* The Solaris assembler wants a .local for non-exported aliases. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
do { \
- const char *declname = \
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ tree id = DECL_ASSEMBLER_NAME (DECL); \
+ ultimate_transparent_alias_target (&id); \
+ const char *declname = IDENTIFIER_POINTER (id); \
ASM_OUTPUT_DEF ((FILE), declname, \
IDENTIFIER_POINTER (TARGET)); \
if (! TREE_PUBLIC (DECL)) \
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 3c521b367f9..44141ea5d97 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -17269,7 +17269,14 @@
(match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm")
(parallel [(const_int 0)]))))]
"TARGET_AVX512F"
- "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
+{
+ /* There is no DF broadcast (in AVX-512*) to 128b register.
+ Mimic it with integer variant. */
+ if (<MODE>mode == V2DFmode)
+ return "vpbroadcastq\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}";
+ else
+ return "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}";
+}
[(set_attr "type" "ssemov")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
@@ -17412,7 +17419,8 @@
v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0|%0, %1}
v<sseintprefix>broadcast<bcstscalarsuff>\t{%x1, %0|%0, %x1}
#"
- [(set_attr "type" "ssemov")
+ [(set_attr "isa" "*,*,noavx512vl")
+ (set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
(set_attr "prefix" "maybe_evex")
(set_attr "mode" "<sseinsnmode>")])
diff --git a/gcc/config/i386/znver1.md b/gcc/config/i386/znver1.md
index 1d28c056a15..7db0562a074 100644
--- a/gcc/config/i386/znver1.md
+++ b/gcc/config/i386/znver1.md
@@ -328,7 +328,7 @@
(eq_attr "type" "fcmov"))
"znver1-vector,znver1-fvector")
-(define_insn_reservation "znver1_fp_mov_direct_load" 5
+(define_insn_reservation "znver1_fp_mov_direct_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "znver1_decode" "direct")
(and (eq_attr "type" "fmov")
@@ -349,7 +349,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp3")
-(define_insn_reservation "znver1_fp_mov_double_load" 9
+(define_insn_reservation "znver1_fp_mov_double_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "znver1_decode" "double")
(and (eq_attr "type" "fmov")
@@ -386,7 +386,7 @@
(eq_attr "type" "fcmp"))))
"znver1-double,znver1-fp0,znver1-fp2")
-(define_insn_reservation "znver1_fp_fcmp_load" 6
+(define_insn_reservation "znver1_fp_fcmp_load" 9
(and (eq_attr "cpu" "znver1")
(and (eq_attr "memory" "none")
(and (eq_attr "znver1_decode" "double")
@@ -400,13 +400,13 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp0*5")
-(define_insn_reservation "znver1_fp_op_mul_load" 9
+(define_insn_reservation "znver1_fp_op_mul_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "fop,fmul")
(eq_attr "memory" "load")))
"znver1-direct,znver1-load,znver1-fp0*5")
-(define_insn_reservation "znver1_fp_op_imul_load" 13
+(define_insn_reservation "znver1_fp_op_imul_load" 16
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "fop,fmul")
(and (eq_attr "fp_int_src" "true")
@@ -419,13 +419,13 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp3*15")
-(define_insn_reservation "znver1_fp_op_div_load" 19
+(define_insn_reservation "znver1_fp_op_div_load" 22
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "fdiv")
(eq_attr "memory" "load")))
"znver1-direct,znver1-load,znver1-fp3*15")
-(define_insn_reservation "znver1_fp_op_idiv_load" 24
+(define_insn_reservation "znver1_fp_op_idiv_load" 27
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "fdiv")
(and (eq_attr "fp_int_src" "true")
@@ -444,7 +444,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp0|znver1-fp1|znver1-fp3")
-(define_insn_reservation "znver1_mmx_add_load" 5
+(define_insn_reservation "znver1_mmx_add_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "mmxadd")
(eq_attr "memory" "load")))
@@ -456,7 +456,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp0|znver1-fp3")
-(define_insn_reservation "znver1_mmx_cmp_load" 5
+(define_insn_reservation "znver1_mmx_cmp_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "mmxcmp")
(eq_attr "memory" "load")))
@@ -468,7 +468,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp1|znver1-fp2")
-(define_insn_reservation "znver1_mmx_cvt_pck_shuf_load" 5
+(define_insn_reservation "znver1_mmx_cvt_pck_shuf_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "mmxcvt,sseshuf,sseshuf1")
(eq_attr "memory" "load")))
@@ -480,7 +480,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp2")
-(define_insn_reservation "znver1_mmx_shift_move_load" 5
+(define_insn_reservation "znver1_mmx_shift_move_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "mmxshft,mmxmov")
(eq_attr "memory" "load")))
@@ -498,7 +498,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp0*3")
-(define_insn_reservation "znver1_mmx_load" 7
+(define_insn_reservation "znver1_mmx_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "mmxmul")
(eq_attr "memory" "load")))
@@ -511,7 +511,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fpu")
-(define_insn_reservation "znver1_avx256_log_load" 5
+(define_insn_reservation "znver1_avx256_log_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF,OI")
(and (eq_attr "type" "sselog")
@@ -524,7 +524,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fpu")
-(define_insn_reservation "znver1_sse_log_load" 5
+(define_insn_reservation "znver1_sse_log_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "sselog")
(eq_attr "memory" "load")))
@@ -537,7 +537,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp1|znver1-fp2")
-(define_insn_reservation "znver1_avx256_log1_load" 5
+(define_insn_reservation "znver1_avx256_log1_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF,OI")
(and (eq_attr "type" "sselog1")
@@ -550,7 +550,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp1|znver1-fp2")
-(define_insn_reservation "znver1_sse_log1_load" 5
+(define_insn_reservation "znver1_sse_log1_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "sselog1")
(eq_attr "memory" "!none")))
@@ -565,7 +565,7 @@
(eq_attr "memory" "none"))))))
"znver1-direct,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_sse_comi_load" 5
+(define_insn_reservation "znver1_sse_comi_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF")
(and (eq_attr "prefix" "!vex")
@@ -583,7 +583,7 @@
(eq_attr "memory" "none"))))))
"znver1-double,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_sse_comi_double_load" 7
+(define_insn_reservation "znver1_sse_comi_double_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V4SF,V2DF,TI")
(and (eq_attr "prefix" "vex")
@@ -600,7 +600,7 @@
(eq_attr "memory" "none")))))
"znver1-direct,znver1-fp1|znver1-fp2")
-(define_insn_reservation "znver1_sse_test_load" 5
+(define_insn_reservation "znver1_sse_test_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF,TI")
(and (eq_attr "prefix_extra" "1")
@@ -642,7 +642,7 @@
(eq_attr "memory" "store"))))
"znver1-direct,znver1-fpu,znver1-store")
-(define_insn_reservation "znver1_sseavx_mov_load" 5
+(define_insn_reservation "znver1_sseavx_mov_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF,TI")
(and (eq_attr "type" "ssemov")
@@ -663,7 +663,7 @@
(eq_attr "memory" "store"))))
"znver1-double,znver1-fpu,znver1-store")
-(define_insn_reservation "znver1_avx256_mov_load" 5
+(define_insn_reservation "znver1_avx256_mov_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF,OI")
(and (eq_attr "type" "ssemov")
@@ -678,7 +678,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp2|znver1-fp3")
-(define_insn_reservation "znver1_sseavx_add_load" 7
+(define_insn_reservation "znver1_sseavx_add_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF,TI")
(and (eq_attr "type" "sseadd")
@@ -692,7 +692,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp2|znver1-fp3")
-(define_insn_reservation "znver1_avx256_add_load" 7
+(define_insn_reservation "znver1_avx256_add_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF,OI")
(and (eq_attr "type" "sseadd")
@@ -706,7 +706,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_sseavx_fma_load" 9
+(define_insn_reservation "znver1_sseavx_fma_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF")
(and (eq_attr "type" "ssemuladd")
@@ -720,7 +720,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_avx256_fma_load" 9
+(define_insn_reservation "znver1_avx256_fma_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF")
(and (eq_attr "type" "ssemuladd")
@@ -734,7 +734,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp0|znver1-fp1|znver1-fp3")
-(define_insn_reservation "znver1_sseavx_iadd_load" 5
+(define_insn_reservation "znver1_sseavx_iadd_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "DI,TI")
(and (eq_attr "type" "sseiadd")
@@ -748,7 +748,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp0|znver1-fp1|znver1-fp3")
-(define_insn_reservation "znver1_avx256_iadd_load" 5
+(define_insn_reservation "znver1_avx256_iadd_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "OI")
(and (eq_attr "type" "sseiadd")
@@ -756,7 +756,7 @@
"znver1-double,znver1-load,znver1-fp0|znver1-fp1|znver1-fp3")
;; SSE conversions.
-(define_insn_reservation "znver1_ssecvtsf_si_load" 9
+(define_insn_reservation "znver1_ssecvtsf_si_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SI")
(and (eq_attr "type" "sseicvt")
@@ -772,7 +772,7 @@
(eq_attr "memory" "none")))))
"znver1-double,znver1-fp3,znver1-ieu0")
-(define_insn_reservation "znver1_ssecvtdf_si_load" 9
+(define_insn_reservation "znver1_ssecvtdf_si_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SI")
(and (eq_attr "type" "sseicvt")
@@ -789,7 +789,7 @@
(eq_attr "memory" "none")))
"znver1-direct,znver1-fp3")
-(define_insn_reservation "znver1_ssecvt_load" 8
+(define_insn_reservation "znver1_ssecvt_load" 11
(and (eq_attr "cpu" "znver1")
(and (eq_attr "type" "ssecvt")
(eq_attr "memory" "load")))
@@ -803,7 +803,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp3*10")
-(define_insn_reservation "znver1_ssediv_ss_ps_load" 14
+(define_insn_reservation "znver1_ssediv_ss_ps_load" 17
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V4SF,SF")
(and (eq_attr "type" "ssediv")
@@ -817,7 +817,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp3*13")
-(define_insn_reservation "znver1_ssediv_sd_pd_load" 17
+(define_insn_reservation "znver1_ssediv_sd_pd_load" 20
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V2DF,DF")
(and (eq_attr "type" "ssediv")
@@ -831,7 +831,7 @@
(eq_attr "type" "ssediv"))))
"znver1-double,znver1-fp3*12")
-(define_insn_reservation "znver1_ssediv_avx256_ps_load" 16
+(define_insn_reservation "znver1_ssediv_avx256_ps_load" 19
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF")
(and (eq_attr "type" "ssediv")
@@ -845,7 +845,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp3*15")
-(define_insn_reservation "znver1_ssediv_avx256_pd_load" 18
+(define_insn_reservation "znver1_ssediv_avx256_pd_load" 22
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V4DF")
(and (eq_attr "type" "ssediv")
@@ -859,7 +859,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,(znver1-fp0|znver1-fp1)*3")
-(define_insn_reservation "znver1_ssemul_ss_ps_load" 7
+(define_insn_reservation "znver1_ssemul_ss_ps_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V4SF,SF")
(and (eq_attr "type" "ssemul")
@@ -873,7 +873,7 @@
(eq_attr "memory" "none"))))
"znver1-double,(znver1-fp0|znver1-fp1)*3")
-(define_insn_reservation "znver1_ssemul_avx256_ps_load" 7
+(define_insn_reservation "znver1_ssemul_avx256_ps_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF")
(and (eq_attr "type" "ssemul")
@@ -887,7 +887,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,(znver1-fp0|znver1-fp1)*4")
-(define_insn_reservation "znver1_ssemul_sd_pd_load" 8
+(define_insn_reservation "znver1_ssemul_sd_pd_load" 11
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V2DF,DF")
(and (eq_attr "type" "ssemul")
@@ -902,7 +902,7 @@
(eq_attr "memory" "none")))))
"znver1-double,(znver1-fp0|znver1-fp1)*4")
-(define_insn_reservation "znver1_ssemul_avx256_pd_load" 8
+(define_insn_reservation "znver1_ssemul_avx256_pd_load" 12
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V4DF")
(and (eq_attr "type" "ssemul")
@@ -924,14 +924,14 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp0*4")
-(define_insn_reservation "znver1_sseimul_load" 7
+(define_insn_reservation "znver1_sseimul_load" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "TI")
(and (eq_attr "type" "sseimul")
(eq_attr "memory" "load"))))
"znver1-direct,znver1-load,znver1-fp0*3")
-(define_insn_reservation "znver1_sseimul_avx256_load" 8
+(define_insn_reservation "znver1_sseimul_avx256_load" 11
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "OI")
(and (eq_attr "type" "sseimul")
@@ -945,7 +945,7 @@
(eq_attr "type" "sseimul"))))
"znver1-direct,znver1-fp0*3")
-(define_insn_reservation "znver1_sseimul_load_di" 7
+(define_insn_reservation "znver1_sseimul_load_di" 10
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "DI")
(and (eq_attr "type" "sseimul")
@@ -960,7 +960,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_sse_cmp_load" 5
+(define_insn_reservation "znver1_sse_cmp_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "SF,DF,V4SF,V2DF")
(and (eq_attr "type" "ssecmp")
@@ -974,7 +974,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp0|znver1-fp1")
-(define_insn_reservation "znver1_sse_cmp_avx256_load" 5
+(define_insn_reservation "znver1_sse_cmp_avx256_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "V8SF,V4DF")
(and (eq_attr "type" "ssecmp")
@@ -988,7 +988,7 @@
(eq_attr "memory" "none"))))
"znver1-direct,znver1-fp0|znver1-fp3")
-(define_insn_reservation "znver1_sse_icmp_load" 5
+(define_insn_reservation "znver1_sse_icmp_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "QI,HI,SI,DI,TI")
(and (eq_attr "type" "ssecmp")
@@ -1002,7 +1002,7 @@
(eq_attr "memory" "none"))))
"znver1-double,znver1-fp0|znver1-fp3")
-(define_insn_reservation "znver1_sse_icmp_avx256_load" 5
+(define_insn_reservation "znver1_sse_icmp_avx256_load" 8
(and (eq_attr "cpu" "znver1")
(and (eq_attr "mode" "OI")
(and (eq_attr "type" "ssecmp")
diff --git a/gcc/config/moxie/moxiebox.h b/gcc/config/moxie/moxiebox.h
index f67bfd67d85..502ffe121e1 100644
--- a/gcc/config/moxie/moxiebox.h
+++ b/gcc/config/moxie/moxiebox.h
@@ -39,6 +39,12 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_SPEC
#define ASM_SPEC "-EL"
+#undef CC1_SPEC
+#define CC1_SPEC "-mel %{meb:%ethis target is little-endian}"
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC CC1_SPEC
+
#undef MULTILIB_DEFAULTS
#undef SIZE_TYPE
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 1672426ea3c..b088cf89bb9 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -160,10 +160,6 @@ nvptx_option_override (void)
/* Assumes that it will see only hard registers. */
flag_var_tracking = 0;
- if (write_symbols == DBX_DEBUG)
- /* The stabs testcases want to know stabs isn't supported. */
- sorry ("stabs debug format not supported");
-
if (nvptx_optimize < 0)
nvptx_optimize = optimize > 0;
diff --git a/gcc/config/pa/constraints.md b/gcc/config/pa/constraints.md
index b90e8f6ddd8..cd38e4509a0 100644
--- a/gcc/config/pa/constraints.md
+++ b/gcc/config/pa/constraints.md
@@ -106,7 +106,7 @@
(and (match_code "mem")
(match_test "IS_LO_SUM_DLT_ADDR_P (XEXP (op, 0))")))
-(define_memory_constraint "Q"
+(define_constraint "Q"
"A memory operand that can be used as the destination operand of an
integer store, or the source operand of an integer load. That is
any memory operand that isn't a symbolic, indexed or lo_sum memory
@@ -122,7 +122,7 @@
(and (match_code "mem")
(match_test "IS_INDEX_ADDR_P (XEXP (op, 0))")))
-(define_memory_constraint "T"
+(define_constraint "T"
"A memory operand for floating-point loads and stores."
(match_test "floating_point_store_memory_operand (op, mode)"))
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 2587c054648..75100d2d69f 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -1229,9 +1229,10 @@
(define_insn "bswapdi2"
[(set (match_operand:DI 0 "register_operand" "=&r")
- (bswap:DI (match_operand:DI 1 "register_operand" "+r")))]
+ (bswap:DI (match_operand:DI 1 "register_operand" "r")))
+ (clobber (match_scratch:DI 2 "=r"))]
"TARGET_64BIT"
- "permh,3210 %1,%1\;hshl %1,8,%0\;hshr,u %1,8,%1\;or %0,%1,%0"
+ "permh,3210 %1,%2\;hshl %2,8,%0\;hshr,u %2,8,%2\;or %0,%2,%0"
[(set_attr "type" "multi")
(set_attr "length" "16")])
diff --git a/gcc/config/rs6000/constraints.md b/gcc/config/rs6000/constraints.md
index 94cd6a374ee..df0cb23333c 100644
--- a/gcc/config/rs6000/constraints.md
+++ b/gcc/config/rs6000/constraints.md
@@ -287,4 +287,4 @@ usually better to use @samp{m} or @samp{es} in @code{asm} statements)"
(define_constraint "j"
"Zero vector constant"
- (match_test "op == const0_rtx || op == CONST0_RTX (GET_MODE (op))"))
+ (match_test "op == const0_rtx || op == CONST0_RTX (mode)"))
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 4f638845817..05f29701ad4 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -527,13 +527,14 @@
&& mode != DImode)
return 1;
+ /* 0.0D is not all zero bits. */
+ if (DECIMAL_FLOAT_MODE_P (mode))
+ return 0;
+
/* The constant 0.0 is easy under VSX. */
if (TARGET_VSX && SCALAR_FLOAT_MODE_P (mode) && op == CONST0_RTX (mode))
return 1;
- if (DECIMAL_FLOAT_MODE_P (mode))
- return 0;
-
/* If we are using V.4 style PIC, consider all constants to be hard. */
if (flag_pic && DEFAULT_ABI == ABI_V4)
return 0;
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 5a20d7b87dd..76b90f4092d 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -216,7 +216,21 @@ rs6000_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
else if (ident && (ident != C_CPP_HASHNODE (__vector_keyword)))
{
enum rid rid_code = (enum rid)(ident->rid_code);
- if (ident->type == NT_MACRO)
+ enum node_type itype = ident->type;
+ /* If there is a function-like macro, check if it is going to be
+ invoked with or without arguments. Without following ( treat
+ it like non-macro, otherwise the following cpp_get_token eats
+ what should be preserved. */
+ if (itype == NT_MACRO && cpp_fun_like_macro_p (ident))
+ {
+ int idx2 = idx;
+ do
+ tok = cpp_peek_token (pfile, idx2++);
+ while (tok->type == CPP_PADDING);
+ if (tok->type != CPP_OPEN_PAREN)
+ itype = NT_VOID;
+ }
+ if (itype == NT_MACRO)
{
do
(void) cpp_get_token (pfile);
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index fd9abe9af3d..ed4af4017b9 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -44,7 +44,6 @@
#define ISA_2_6_MASKS_SERVER (ISA_2_5_MASKS_SERVER \
| OPTION_MASK_POPCNTD \
| OPTION_MASK_ALTIVEC \
- | OPTION_MASK_FLOAT128 \
| OPTION_MASK_VSX \
| OPTION_MASK_VSX_TIMODE \
| OPTION_MASK_UPPER_REGS_DF)
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 6ad1e1df67f..fe6a5ad8ce9 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -428,6 +428,16 @@
(SD "REAL_VALUE_TO_TARGET_DECIMAL32")
(DD "REAL_VALUE_TO_TARGET_DECIMAL64")])
+; Whether 0.0 has an all-zero bit pattern
+(define_mode_attr zero_fp [(SF "j")
+ (DF "j")
+ (TF "j")
+ (IF "j")
+ (KF "j")
+ (SD "wn")
+ (DD "wn")
+ (TD "wn")])
+
; Definitions for load to 32-bit fpr register
(define_mode_attr f32_lr [(SF "f") (SD "wz")])
(define_mode_attr f32_lr2 [(SF "wb") (SD "wn")])
@@ -6487,7 +6497,7 @@
(define_insn "mov<mode>_hardfloat"
[(set (match_operand:FMOVE32 0 "nonimmediate_operand" "=!r,!r,m,f,<f32_vsx>,<f32_vsx>,!r,<f32_lr>,<f32_lr2>,<f32_sm>,<f32_sm2>,<f32_av>,Z,?<f32_dm>,?r,*c*l,!r,*h")
- (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,j,j,<f32_lm>,<f32_lm2>,<f32_sr>,<f32_sr2>,Z,<f32_av>,r,<f32_dm>,r,h,0"))]
+ (match_operand:FMOVE32 1 "input_operand" "r,m,r,f,<f32_vsx>,<zero_fp>,<zero_fp>,<f32_lm>,<f32_lm2>,<f32_sr>,<f32_sr2>,Z,<f32_av>,r,<f32_dm>,r,h,0"))]
"(gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))
&& (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT)"
@@ -6627,7 +6637,7 @@
(define_insn "*mov<mode>_hardfloat32"
[(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,<f64_av>,Z,<f64_p9>,o,<f64_vsx>,<f64_vsx>,!r,Y,r,!r")
- (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,o,<f64_p9>,<f64_vsx>,j,j,r,Y,r"))]
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,<f64_av>,o,<f64_p9>,<f64_vsx>,<zero_fp>,<zero_fp>,r,Y,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))"
@@ -6665,7 +6675,7 @@
; 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,<f64_p9>,o,<f64_av>,Z,<f64_vsx>,<f64_vsx>,!r,Y,r,!r,*c*l,!r,*h,r,wg,r,<f64_dm>")
- (match_operand:FMOVE64 1 "input_operand" "d,m,d,o,<f64_p9>,Z,<f64_av>,<f64_vsx>,j,j,r,Y,r,r,h,0,wg,r,<f64_dm>,r"))]
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,o,<f64_p9>,Z,<f64_av>,<f64_vsx>,<zero_fp>,<zero_fp>,r,Y,r,r,h,0,wg,r,<f64_dm>,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))"
@@ -6728,7 +6738,7 @@
(define_insn_and_split "*mov<mode>_64bit_dm"
[(set (match_operand:FMOVE128_FPR 0 "nonimmediate_operand" "=m,d,d,d,Y,r,r,r,wh")
- (match_operand:FMOVE128_FPR 1 "input_operand" "d,m,d,j,r,jY,r,wh,r"))]
+ (match_operand:FMOVE128_FPR 1 "input_operand" "d,m,d,<zero_fp>,r,<zero_fp>Y,r,wh,r"))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_POWERPC64
&& FLOAT128_2REG_P (<MODE>mode)
&& (<MODE>mode != TDmode || WORDS_BIG_ENDIAN)
@@ -6741,8 +6751,8 @@
[(set_attr "length" "8,8,8,8,12,12,8,8,8")])
(define_insn_and_split "*movtd_64bit_nodm"
- [(set (match_operand:TD 0 "nonimmediate_operand" "=m,d,d,d,Y,r,r")
- (match_operand:TD 1 "input_operand" "d,m,d,j,r,jY,r"))]
+ [(set (match_operand:TD 0 "nonimmediate_operand" "=m,d,d,Y,r,r")
+ (match_operand:TD 1 "input_operand" "d,m,d,r,Y,r"))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_POWERPC64 && !WORDS_BIG_ENDIAN
&& (gpc_reg_operand (operands[0], TDmode)
|| gpc_reg_operand (operands[1], TDmode))"
@@ -6750,11 +6760,11 @@
"&& reload_completed"
[(pc)]
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }
- [(set_attr "length" "8,8,8,8,12,12,8")])
+ [(set_attr "length" "8,8,8,12,12,8")])
(define_insn_and_split "*mov<mode>_32bit"
[(set (match_operand:FMOVE128_FPR 0 "nonimmediate_operand" "=m,d,d,d,Y,r,r")
- (match_operand:FMOVE128_FPR 1 "input_operand" "d,m,d,j,r,jY,r"))]
+ (match_operand:FMOVE128_FPR 1 "input_operand" "d,m,d,<zero_fp>,r,<zero_fp>Y,r"))]
"TARGET_HARD_FLOAT && TARGET_FPRS && !TARGET_POWERPC64
&& (FLOAT128_2REG_P (<MODE>mode)
|| int_reg_operand_not_pseudo (operands[0], <MODE>mode)
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index 88cf18cf7b4..3a374a01c70 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -467,7 +467,7 @@ rx_print_operand_address (FILE * file, machine_mode /*mode*/, rtx addr)
static void
rx_print_integer (FILE * file, HOST_WIDE_INT val)
{
- if (IN_RANGE (val, -64, 64))
+ if (val < 64)
fprintf (file, HOST_WIDE_INT_PRINT_DEC, val);
else
fprintf (file,
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index 560a07b6060..47b41fd1408 100644
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -142,8 +142,11 @@ solaris_assemble_visibility (tree decl, int vis ATTRIBUTE_UNUSED)
};
const char *name, *type;
+ tree id = DECL_ASSEMBLER_NAME (decl);
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ while (IDENTIFIER_TRANSPARENT_ALIAS (id))
+ id = TREE_CHAIN (id);
+ name = IDENTIFIER_POINTER (id);
type = visibility_types[vis];
fprintf (asm_out_file, "\t.%s\t", type);
diff --git a/gcc/coverage.c b/gcc/coverage.c
index e3bab61f4b6..b1fce7d0e7a 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -745,11 +745,7 @@ build_var (tree fn_decl, tree type, int counter)
else
sprintf (buf, "__gcov%u_", counter);
len = strlen (buf);
-#ifndef NO_DOT_IN_LABEL
- buf[len - 1] = '.';
-#elif !defined NO_DOLLAR_IN_LABEL
- buf[len - 1] = '$';
-#endif
+ buf[len - 1] = symbol_table::symbol_suffix_separator ();
memcpy (buf + len, fn_name, fn_name_len + 1);
DECL_NAME (var) = get_identifier (buf);
TREE_STATIC (var) = 1;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1a668e89fdc..91ad5ac341f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,7 +1,216 @@
+2016-03-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/70353
+ * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
+ in constexpr functions.
+
+2016-03-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/70422
+ PR c++/64266
+ PR c++/70353
+ * decl.c, pt.c, constexpr.c: Revert last patch.
+
+2016-03-25 Jason Merrill <jason@redhat.com>
+ Martin Liška <mliska@suse.cz>
+
+ PR c++/64266
+ PR c++/70353
+ Core issue 1962
+ * decl.c (cp_fname_init): Decay the initializer to pointer.
+ (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
+ DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
+ Don't call cp_finish_decl.
+ * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
+ * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
+ Handle DECL_VALUE_EXPR.
+
+2016-03-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/70386
+ * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
+
+ PR c++/70323
+ * constexpr.c (cxx_eval_call_expression): Don't cache result if
+ *overflow_p.
+
+2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/62212
+ * tree.c (build_cplus_array_type): Determine type-dependentess
+ with uses_template_parms instead of with dependent_type_p.
+
+2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70347
+ * typeck.c (process_init_constructor_union): If the initializer
+ is empty, use the union's NSDMI if it has one.
+
+2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70332
+ * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
+ NSDMI that's part of an aggregrate initialization.
+
+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70001
+ * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
+ for 1..max even for multi-dimensional arrays. Call unshare_expr
+ on it.
+
+ PR c++/70323
+ * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
+ on TREE_OVERFLOW constants.
+
+ PR c++/70376
+ * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
+ for OMP_TASKLOOP here.
+ (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
+ genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
+
+2016-03-23 Alexandre Oliva <aoliva@redhat.com>
+ Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/69315
+ * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
+ * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
+ (finish_function): Don't set or test them.
+ * decl2.c (mark_used): Don't handle defer_mark_used_calls.
+
+2016-03-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/70344
+ * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
+
+2016-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/69884
+ * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
+
+2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * call.c (build_conditional_expr_1): Always use original
+ condition type for vector type checks and build.
+
+2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70096
+ * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
+
+2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70204
+ * constexpr.c (non_const_var_error): Check
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
+
+2016-03-21 Richard Henderson <rth@redhat.com>
+
+ PR c++/70273
+ * decl.c (notice_forced_label_r): New.
+ (cp_finish_decl): Use it.
+
+2016-03-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/70285
+ * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
+
+2016-03-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/70139
+ * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
+
+ PR c++/70147
+ * class.c (vptr_via_virtual_p): New.
+ (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
+ * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
+ a vptr from any virtual base in a not-in-charge 'structor.
+
+ * decl.c (build_clobber_this): Factor out of
+ start_preparsed_function and begin_destructor_body. Handle
+ virtual bases better.
+
+ * class.c (build_if_in_charge): Split out from build_base_path.
+ * init.c (expand_virtual_init, expand_default_init): Use it.
+ * call.c (build_special_member_call): Use it.
+
+2016-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70267
+ * init.c (build_new_1): Complain and return error_mark_node
+ if alloc_fn is not _Jv_AllocObject function returning pointer.
+
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70205
+ * search.c (adjust_result_of_qualified_name_lookup): Don't
+ update the BASELINK_BINFO of DECL if the second call
+ to lookup_base fails.
+
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70218
+ * parser.c (cp_parser_lambda_expression): Move call to
+ pop_deferring_access_checks ahead of the call to
+ cp_parser_end_tentative_firewall.
+
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70144
+ * cp-tree.h (magic_varargs_p): Return int instead of bool.
+ * call.c (magic_varargs_p): Return int instead of bool, return 2 for
+ Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
+ varargs.
+ (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
+ if magic_varargs_p == 1, call decay_conversion
+ instead of mark_type_use. Don't store error_mark_node arguments to
+ argarray, instead return error_mark_node.
+
+ PR c++/70272
+ * decl.c (begin_destructor_body): Don't insert clobber if
+ is_empty_class (current_class_type).
+
+2016-03-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70194
+ * typeck.c (warn_for_null_address): New function.
+ (cp_build_binary_op): Call it.
+
+2016-03-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/70259
+ * decl.c (start_preparsed_function): Don't clobber an empty base.
+
+2016-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70147
+ * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
+ BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
+
+ PR c++/70147
+ * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
+ set in_base_initializer.
+
+2016-03-15 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70209
+ * tree.c (strip_typedefs): Call strip_typedefs again on the
+ DECL_ORIGINAL_TYPE result.
+
+2016-03-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/70095
+ * pt.c (instantiate_decl): Fix call to variable_template_p.
+
+ PR c++/70141
+ * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
+
2016-03-14 Casey Carter <casey@carter.net>
Jason Merrill <jason@redhat.com>
- P08184R0: Generalizing the Range-Based For Loop
+ P0184R0: Generalizing the Range-Based For Loop
* parser.c (cp_convert_range_for): Set the type of __end separately.
(cp_parser_perform_range_for_lookup): Allow different begin/end
types if they are comparable.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 3ad3bd52d9d..ed234904a63 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4634,6 +4634,8 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
if (VECTOR_INTEGER_TYPE_P (TREE_TYPE (arg1)))
{
+ tree arg1_type = TREE_TYPE (arg1);
+
/* If arg1 is another cond_expr choosing between -1 and 0,
then we can use its comparison. It may help to avoid
additional comparison, produce more accurate diagnostics
@@ -4653,7 +4655,6 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
|| error_operand_p (arg3))
return error_mark_node;
- tree arg1_type = TREE_TYPE (arg1);
arg2_type = TREE_TYPE (arg2);
arg3_type = TREE_TYPE (arg3);
@@ -7040,15 +7041,17 @@ convert_for_arg_passing (tree type, tree val, tsubst_flags_t complain)
return val;
}
-/* Returns true iff FN is a function with magic varargs, i.e. ones for
- which no conversions at all should be done. This is true for some
- builtins which don't act like normal functions. */
+/* Returns non-zero iff FN is a function with magic varargs, i.e. ones for
+ which just decay_conversion or no conversions at all should be done.
+ This is true for some builtins which don't act like normal functions.
+ Return 2 if no conversions at all should be done, 1 if just
+ decay_conversion. */
-bool
+int
magic_varargs_p (tree fn)
{
if (flag_cilkplus && is_cilkplus_reduce_builtin (fn) != BUILT_IN_NONE)
- return true;
+ return 2;
if (DECL_BUILT_IN (fn))
switch (DECL_FUNCTION_CODE (fn))
@@ -7057,14 +7060,14 @@ magic_varargs_p (tree fn)
case BUILT_IN_CONSTANT_P:
case BUILT_IN_NEXT_ARG:
case BUILT_IN_VA_START:
- return true;
+ return 1;
default:;
return lookup_attribute ("type generic",
TYPE_ATTRIBUTES (TREE_TYPE (fn))) != 0;
}
- return false;
+ return 0;
}
/* Returns the decl of the dispatcher function if FN is a function version. */
@@ -7515,9 +7518,17 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
for (; arg_index < vec_safe_length (args); ++arg_index)
{
tree a = (*args)[arg_index];
- if (magic_varargs_p (fn))
- /* Do no conversions for magic varargs. */
- a = mark_type_use (a);
+ int magic = magic_varargs_p (fn);
+ if (magic == 2)
+ {
+ /* Do no conversions for certain magic varargs. */
+ a = mark_type_use (a);
+ if (TREE_CODE (a) == FUNCTION_DECL && reject_gcc_builtin (a))
+ return error_mark_node;
+ }
+ else if (magic == 1)
+ /* For other magic varargs only do decay_conversion. */
+ a = decay_conversion (a, complain);
else if (DECL_CONSTRUCTOR_P (fn)
&& same_type_ignoring_top_level_qualifiers_p (DECL_CONTEXT (fn),
TREE_TYPE (a)))
@@ -7530,6 +7541,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
}
else
a = convert_arg_to_ellipsis (a, complain);
+ if (a == error_mark_node)
+ return error_mark_node;
argarray[j++] = a;
}
@@ -7992,11 +8005,7 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
vtt = decay_conversion (vtt, complain);
if (vtt == error_mark_node)
return error_mark_node;
- vtt = build3 (COND_EXPR, TREE_TYPE (vtt),
- build2 (EQ_EXPR, boolean_type_node,
- current_in_charge_parm, integer_zero_node),
- current_vtt_parm,
- vtt);
+ vtt = build_if_in_charge (vtt, current_vtt_parm);
if (BINFO_SUBVTT_INDEX (binfo))
sub_vtt = fold_build_pointer_plus (vtt, BINFO_SUBVTT_INDEX (binfo));
else
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f6ad696c8f1..98cbab5a00f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -225,6 +225,24 @@ int n_convert_harshness = 0;
int n_compute_conversion_costs = 0;
int n_inner_fields_searched = 0;
+/* Return a COND_EXPR that executes TRUE_STMT if this execution of the
+ 'structor is in charge of 'structing virtual bases, or FALSE_STMT
+ otherwise. */
+
+tree
+build_if_in_charge (tree true_stmt, tree false_stmt)
+{
+ gcc_assert (DECL_HAS_IN_CHARGE_PARM_P (current_function_decl));
+ tree cmp = build2 (NE_EXPR, boolean_type_node,
+ current_in_charge_parm, integer_zero_node);
+ tree type = unlowered_expr_type (true_stmt);
+ if (VOID_TYPE_P (type))
+ type = unlowered_expr_type (false_stmt);
+ tree cond = build3 (COND_EXPR, type,
+ cmp, true_stmt, false_stmt);
+ return cond;
+}
+
/* Convert to or from a base subobject. EXPR is an expression of type
`A' or `A*', an expression of type `B' or `B*' is returned. To
convert A to a base B, CODE is PLUS_EXPR and BINFO is the binfo for
@@ -470,12 +488,9 @@ build_base_path (enum tree_code code,
/* Negative fixed_type_p means this is a constructor or destructor;
virtual base layout is fixed in in-charge [cd]tors, but not in
base [cd]tors. */
- offset = build3 (COND_EXPR, ptrdiff_type_node,
- build2 (EQ_EXPR, boolean_type_node,
- current_in_charge_parm, integer_zero_node),
- v_offset,
- convert_to_integer (ptrdiff_type_node,
- BINFO_OFFSET (binfo)));
+ offset = build_if_in_charge
+ (convert_to_integer (ptrdiff_type_node, BINFO_OFFSET (binfo)),
+ v_offset);
else
offset = v_offset;
}
@@ -8475,6 +8490,40 @@ get_primary_binfo (tree binfo)
return copied_binfo (primary_base, binfo);
}
+/* As above, but iterate until we reach the binfo that actually provides the
+ vptr for BINFO. */
+
+static tree
+most_primary_binfo (tree binfo)
+{
+ tree b = binfo;
+ while (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (b))
+ && !BINFO_LOST_PRIMARY_P (b))
+ {
+ tree primary_base = get_primary_binfo (b);
+ gcc_assert (BINFO_PRIMARY_P (primary_base)
+ && BINFO_INHERITANCE_CHAIN (primary_base) == b);
+ b = primary_base;
+ }
+ return b;
+}
+
+/* Returns true if BINFO gets its vptr from a virtual base of the most derived
+ type. Note that the virtual inheritance might be above or below BINFO in
+ the hierarchy. */
+
+bool
+vptr_via_virtual_p (tree binfo)
+{
+ if (TYPE_P (binfo))
+ binfo = TYPE_BINFO (binfo);
+ tree primary = most_primary_binfo (binfo);
+ /* Don't limit binfo_via_virtual, we want to return true when BINFO itself is
+ a morally virtual base. */
+ tree virt = binfo_via_virtual (primary, NULL_TREE);
+ return virt != NULL_TREE;
+}
+
/* If INDENTED_P is zero, indent to INDENT. Return nonzero. */
static int
@@ -9762,17 +9811,7 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid)
/* To find the complete object, we will first convert to our most
primary base, and then add the offset in the vtbl to that value. */
- b = binfo;
- while (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (b))
- && !BINFO_LOST_PRIMARY_P (b))
- {
- tree primary_base;
-
- primary_base = get_primary_binfo (b);
- gcc_assert (BINFO_PRIMARY_P (primary_base)
- && BINFO_INHERITANCE_CHAIN (primary_base) == b);
- b = primary_base;
- }
+ b = most_primary_binfo (binfo);
offset = size_diffop_loc (input_location,
BINFO_OFFSET (vid->rtti_binfo), BINFO_OFFSET (b));
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 5f97c9dad19..8ea71113d99 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -1239,19 +1239,54 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
return t;
}
+ if (fun == current_function_decl)
+ {
+ /* A call to the current function, i.e.
+ constexpr int f (int i) {
+ constexpr int j = f(i-1);
+ return j;
+ }
+ This would be OK without the constexpr on the declaration of j. */
+ if (!ctx->quiet)
+ error_at (loc, "%qD called in a constant expression before its "
+ "definition is complete", fun);
+ *non_constant_p = true;
+ return t;
+ }
+
+ constexpr_ctx new_ctx = *ctx;
+ if (DECL_CONSTRUCTOR_P (fun) && !ctx->object
+ && TREE_CODE (t) == AGGR_INIT_EXPR)
+ {
+ /* We want to have an initialization target for an AGGR_INIT_EXPR.
+ If we don't already have one in CTX, use the AGGR_INIT_EXPR_SLOT. */
+ new_ctx.object = AGGR_INIT_EXPR_SLOT (t);
+ tree ctor = new_ctx.ctor = build_constructor (DECL_CONTEXT (fun), NULL);
+ CONSTRUCTOR_NO_IMPLICIT_ZERO (ctor) = true;
+ ctx->values->put (new_ctx.object, ctor);
+ ctx = &new_ctx;
+ }
+
/* Shortcut trivial constructor/op=. */
if (trivial_fn_p (fun))
{
+ tree init = NULL_TREE;
if (call_expr_nargs (t) == 2)
- {
- tree arg = convert_from_reference (get_nth_callarg (t, 1));
- return cxx_eval_constant_expression (ctx, arg,
- lval, non_constant_p,
- overflow_p);
- }
+ init = convert_from_reference (get_nth_callarg (t, 1));
else if (TREE_CODE (t) == AGGR_INIT_EXPR
&& AGGR_INIT_ZERO_FIRST (t))
- return build_zero_init (DECL_CONTEXT (fun), NULL_TREE, false);
+ init = build_zero_init (DECL_CONTEXT (fun), NULL_TREE, false);
+ if (init)
+ {
+ tree op = get_nth_callarg (t, 0);
+ if (is_dummy_object (op))
+ op = ctx->object;
+ else
+ op = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (op)), op);
+ tree set = build2 (MODIFY_EXPR, TREE_TYPE (op), op, init);
+ return cxx_eval_constant_expression (ctx, set, lval,
+ non_constant_p, overflow_p);
+ }
}
/* We can't defer instantiating the function any longer. */
@@ -1287,19 +1322,6 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
}
}
- constexpr_ctx new_ctx = *ctx;
- if (DECL_CONSTRUCTOR_P (fun) && !ctx->object
- && TREE_CODE (t) == AGGR_INIT_EXPR)
- {
- /* We want to have an initialization target for an AGGR_INIT_EXPR.
- If we don't already have one in CTX, use the AGGR_INIT_EXPR_SLOT. */
- new_ctx.object = AGGR_INIT_EXPR_SLOT (t);
- tree ctor = new_ctx.ctor = build_constructor (DECL_CONTEXT (fun), NULL);
- CONSTRUCTOR_NO_IMPLICIT_ZERO (ctor) = true;
- ctx->values->put (new_ctx.object, ctor);
- ctx = &new_ctx;
- }
-
bool non_constant_args = false;
cxx_bind_parameters_in_call (ctx, t, &new_call,
non_constant_p, overflow_p, &non_constant_args);
@@ -1426,7 +1448,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (result == error_mark_node)
*non_constant_p = true;
- if (*non_constant_p)
+ if (*non_constant_p || *overflow_p)
result = error_mark_node;
else if (!result)
result = void_node;
@@ -2246,8 +2268,19 @@ cxx_eval_bare_aggregate (const constexpr_ctx *ctx, tree t,
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (t);
bool changed = false;
gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (t));
+ tree type = TREE_TYPE (t);
- verify_ctor_sanity (ctx, TREE_TYPE (t));
+ constexpr_ctx new_ctx;
+ if (TYPE_PTRMEMFUNC_P (type))
+ {
+ /* We don't really need the ctx->ctor business for a PMF, but it's
+ simpler to use the same code. */
+ new_ctx = *ctx;
+ new_ctx.ctor = build_constructor (type, NULL);
+ new_ctx.object = NULL_TREE;
+ ctx = &new_ctx;
+ };
+ verify_ctor_sanity (ctx, type);
vec<constructor_elt, va_gc> **p = &CONSTRUCTOR_ELTS (ctx->ctor);
vec_alloc (*p, vec_safe_length (v));
@@ -2258,7 +2291,6 @@ cxx_eval_bare_aggregate (const constexpr_ctx *ctx, tree t,
FOR_EACH_CONSTRUCTOR_ELT (v, i, index, value)
{
tree orig_value = value;
- constexpr_ctx new_ctx;
init_subob_ctx (ctx, new_ctx, index, value);
if (new_ctx.ctor != ctx->ctor)
/* If we built a new CONSTRUCTOR, attach it now so that other
@@ -2312,7 +2344,7 @@ cxx_eval_bare_aggregate (const constexpr_ctx *ctx, tree t,
CONSTRUCTOR_NO_IMPLICIT_ZERO (t) = false;
TREE_CONSTANT (t) = constant_p;
TREE_SIDE_EFFECTS (t) = side_effects_p;
- if (VECTOR_TYPE_P (TREE_TYPE (t)))
+ if (VECTOR_TYPE_P (type))
t = fold (t);
return t;
}
@@ -2340,7 +2372,6 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
vec<constructor_elt, va_gc> **p = &CONSTRUCTOR_ELTS (ctx->ctor);
vec_alloc (*p, max + 1);
bool pre_init = false;
- tree pre_init_elt = NULL_TREE;
unsigned HOST_WIDE_INT i;
/* For the default constructor, build up a call to the default
@@ -2370,6 +2401,7 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
{
tree idx = build_int_cst (size_type_node, i);
tree eltinit;
+ bool reuse = false;
constexpr_ctx new_ctx;
init_subob_ctx (ctx, new_ctx, idx, pre_init ? init : elttype);
if (new_ctx.ctor != ctx->ctor)
@@ -2378,7 +2410,10 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
{
/* A multidimensional array; recurse. */
if (value_init || init == NULL_TREE)
- eltinit = NULL_TREE;
+ {
+ eltinit = NULL_TREE;
+ reuse = i == 0;
+ }
else
eltinit = cp_build_array_ref (input_location, init, idx,
tf_warning_or_error);
@@ -2390,18 +2425,9 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
{
/* Initializing an element using value or default initialization
we just pre-built above. */
- if (pre_init_elt == NULL_TREE)
- pre_init_elt
- = cxx_eval_constant_expression (&new_ctx, init, lval,
- non_constant_p, overflow_p);
- eltinit = pre_init_elt;
- /* Don't reuse the result of cxx_eval_constant_expression
- call if it isn't a constant initializer or if it requires
- relocations. */
- if (initializer_constant_valid_p (pre_init_elt,
- TREE_TYPE (pre_init_elt))
- != null_pointer_node)
- pre_init_elt = NULL_TREE;
+ eltinit = cxx_eval_constant_expression (&new_ctx, init, lval,
+ non_constant_p, overflow_p);
+ reuse = i == 0;
}
else
{
@@ -2427,6 +2453,23 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
}
else
CONSTRUCTOR_APPEND_ELT (*p, idx, eltinit);
+ /* Reuse the result of cxx_eval_constant_expression call
+ from the first iteration to all others if it is a constant
+ initializer that doesn't require relocations. */
+ if (reuse
+ && max > 1
+ && (initializer_constant_valid_p (eltinit, TREE_TYPE (eltinit))
+ == null_pointer_node))
+ {
+ if (new_ctx.ctor != ctx->ctor)
+ eltinit = new_ctx.ctor;
+ for (i = 1; i < max; ++i)
+ {
+ idx = build_int_cst (size_type_node, i);
+ CONSTRUCTOR_APPEND_ELT (*p, idx, unshare_expr (eltinit));
+ }
+ break;
+ }
}
if (!*non_constant_p)
@@ -2756,7 +2799,8 @@ non_const_var_error (tree r)
inform (DECL_SOURCE_LOCATION (r),
"%q#D is volatile", r);
else if (!DECL_INITIAL (r)
- || !TREE_CONSTANT (DECL_INITIAL (r)))
+ || !TREE_CONSTANT (DECL_INITIAL (r))
+ || !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r))
inform (DECL_SOURCE_LOCATION (r),
"%qD was not initialized with a constant "
"expression", r);
@@ -3298,8 +3342,13 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
}
if (CONSTANT_CLASS_P (t))
{
- if (TREE_OVERFLOW (t) && (!flag_permissive || ctx->quiet))
- *overflow_p = true;
+ if (TREE_OVERFLOW (t))
+ {
+ if (!ctx->quiet)
+ permerror (input_location, "overflow in constant expression");
+ if (!flag_permissive || ctx->quiet)
+ *overflow_p = true;
+ }
return t;
}
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 6a767fa13a4..90b3464e5de 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -386,7 +386,8 @@ genericize_omp_for_stmt (tree *stmt_p, int *walk_subtrees, void *data)
tree clab = begin_bc_block (bc_continue, locus);
cp_walk_tree (&OMP_FOR_BODY (stmt), cp_genericize_r, data, NULL);
- cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_genericize_r, data, NULL);
+ if (TREE_CODE (stmt) != OMP_TASKLOOP)
+ cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_INIT (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_COND (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_INCR (stmt), cp_genericize_r, data, NULL);
@@ -1272,7 +1273,9 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
if (TREE_CODE (d) == VAR_DECL)
gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
}
- else if (TREE_CODE (stmt) == OMP_PARALLEL || TREE_CODE (stmt) == OMP_TASK)
+ else if (TREE_CODE (stmt) == OMP_PARALLEL
+ || TREE_CODE (stmt) == OMP_TASK
+ || TREE_CODE (stmt) == OMP_TASKLOOP)
{
struct cp_genericize_omp_taskreg omp_ctx;
tree c, decl;
@@ -1312,7 +1315,10 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
default:
break;
}
- cp_walk_tree (&OMP_BODY (stmt), cp_genericize_r, data, NULL);
+ if (TREE_CODE (stmt) == OMP_TASKLOOP)
+ genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
+ else
+ cp_walk_tree (&OMP_BODY (stmt), cp_genericize_r, data, NULL);
wtd->omp_ctx = omp_ctx.outer;
splay_tree_delete (omp_ctx.variables);
}
@@ -1380,8 +1386,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
genericize_break_stmt (stmt_p);
else if (TREE_CODE (stmt) == OMP_FOR
|| TREE_CODE (stmt) == OMP_SIMD
- || TREE_CODE (stmt) == OMP_DISTRIBUTE
- || TREE_CODE (stmt) == OMP_TASKLOOP)
+ || TREE_CODE (stmt) == OMP_DISTRIBUTE)
genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
else if ((flag_sanitize
& (SANITIZE_NULL | SANITIZE_ALIGNMENT | SANITIZE_VPTR))
@@ -2130,6 +2135,12 @@ cp_fold (tree x)
else
x = fold (x);
+ /* A COND_EXPR might have incompatible types in branches if one or both
+ arms are bitfields. If folding exposed such a branch, fix it up. */
+ if (TREE_CODE (x) != code)
+ if (tree type = is_bitfield_expr_with_lowered_type (x))
+ x = fold_convert (type, x);
+
break;
case CALL_EXPR:
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a08c59b3d14..b7b770f9200 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1988,7 +1988,7 @@ struct GTY(()) lang_type {
#define CLASSTYPE_VBASECLASSES(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vbases)
/* The type corresponding to NODE when NODE is used as a base class,
- i.e., NODE without virtual base classes. */
+ i.e., NODE without virtual base classes or tail padding. */
#define CLASSTYPE_AS_BASE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->as_base)
@@ -5563,7 +5563,7 @@ public:
/* in call.c */
extern bool check_dtor_name (tree, tree);
-bool magic_varargs_p (tree);
+int magic_varargs_p (tree);
extern tree build_conditional_expr (location_t, tree, tree, tree,
tsubst_flags_t);
@@ -5638,6 +5638,7 @@ extern tree get_function_version_dispatcher (tree);
/* in class.c */
extern tree build_vfield_ref (tree, tree);
+extern tree build_if_in_charge (tree true_stmt, tree false_stmt = void_node);
extern tree build_base_path (enum tree_code, tree,
tree, int, tsubst_flags_t);
extern tree convert_to_base (tree, tree, bool, bool,
@@ -5676,6 +5677,7 @@ extern void invalidate_class_lookup_cache (void);
extern void maybe_note_name_used_in_class (tree, tree);
extern void note_name_declared_in_class (tree, tree);
extern tree get_vtbl_decl_for_binfo (tree);
+extern bool vptr_via_virtual_p (tree);
extern void debug_class (tree);
extern void debug_thunks (tree);
extern void set_linkage_according_to_type (tree, tree);
@@ -5844,8 +5846,6 @@ extern tree fndecl_declared_return_type (tree);
extern bool undeduced_auto_decl (tree);
extern void require_deduced_type (tree);
-extern bool defer_mark_used_calls;
-extern GTY(()) vec<tree, va_gc> *deferred_mark_used_calls;
extern tree finish_case_label (location_t, tree, tree);
extern tree cxx_maybe_build_cleanup (tree, tsubst_flags_t);
diff --git a/gcc/cp/cp-ubsan.c b/gcc/cp/cp-ubsan.c
index 2ad0a26207f..be24a5ca5c8 100644
--- a/gcc/cp/cp-ubsan.c
+++ b/gcc/cp/cp-ubsan.c
@@ -283,7 +283,7 @@ cp_ubsan_dfs_initialize_vtbl_ptrs (tree binfo, void *data)
if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
return dfs_skip_bases;
- if (!BINFO_PRIMARY_P (binfo) || BINFO_VIRTUAL_P (binfo))
+ if (!BINFO_PRIMARY_P (binfo))
{
tree base_ptr = TREE_VALUE ((tree) data);
@@ -299,8 +299,13 @@ cp_ubsan_dfs_initialize_vtbl_ptrs (tree binfo, void *data)
/* Assign NULL to the vptr. */
tree vtbl = build_zero_cst (TREE_TYPE (vtbl_ptr));
- finish_expr_stmt (cp_build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl,
- tf_warning_or_error));
+ tree stmt = cp_build_modify_expr (vtbl_ptr, NOP_EXPR, vtbl,
+ tf_warning_or_error);
+ if (vptr_via_virtual_p (binfo))
+ /* If this vptr comes from a virtual base of the complete object, only
+ clear it if we're in charge of virtual bases. */
+ stmt = build_if_in_charge (stmt);
+ finish_expr_stmt (stmt);
}
return NULL_TREE;
@@ -318,9 +323,15 @@ cp_ubsan_maybe_initialize_vtbl_ptrs (tree addr)
tree type = TREE_TYPE (TREE_TYPE (addr));
tree list = build_tree_list (type, addr);
+ /* We cannot rely on the vtable being set up. We have to indirect via the
+ vtt_parm. */
+ int save_in_base_initializer = in_base_initializer;
+ in_base_initializer = 1;
/* Walk through the hierarchy, initializing the vptr in each base
class to NULL. */
dfs_walk_once (TYPE_BINFO (type), cp_ubsan_dfs_initialize_vtbl_ptrs,
NULL, list);
+
+ in_base_initializer = save_in_base_initializer;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 27c3597a570..cfae210da55 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -227,11 +227,6 @@ struct GTY((for_user)) named_label_entry {
function, two inside the body of a function in a local class, etc.) */
int function_depth;
-/* To avoid unwanted recursion, finish_function defers all mark_used calls
- encountered during its execution until it finishes. */
-bool defer_mark_used_calls;
-vec<tree, va_gc> *deferred_mark_used_calls;
-
/* States indicating how grokdeclarator() should handle declspecs marked
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
@@ -6256,8 +6251,11 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
return;
/* We defer emission of local statics until the corresponding
- DECL_EXPR is expanded. */
- defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl);
+ DECL_EXPR is expanded. But with constexpr its function might never
+ be expanded, so go ahead and tell cgraph about the variable now. */
+ defer_p = ((DECL_FUNCTION_SCOPE_P (decl)
+ && !DECL_DECLARED_CONSTEXPR_P (DECL_CONTEXT (decl)))
+ || DECL_VIRTUAL_P (decl));
/* Defer template instantiations. */
if (DECL_LANG_SPECIFIC (decl)
@@ -6499,6 +6497,19 @@ is_concept_var (tree decl)
&& DECL_DECLARED_CONCEPT_P (decl));
}
+/* A helper function to be called via walk_tree. If any label exists
+ under *TP, it is (going to be) forced. Set has_forced_label_in_static. */
+
+static tree
+notice_forced_label_r (tree *tp, int *walk_subtrees, void *)
+{
+ if (TYPE_P (*tp))
+ *walk_subtrees = 0;
+ if (TREE_CODE (*tp) == LABEL_DECL)
+ cfun->has_forced_label_in_static = 1;
+ return NULL_TREE;
+}
+
/* Finish processing of a declaration;
install its line number and initial value.
If the length of an array type is not known before,
@@ -6744,13 +6755,17 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
&& !DECL_ARTIFICIAL (decl))
{
push_local_name (decl);
- if (DECL_CONSTRUCTOR_P (current_function_decl)
- || DECL_DESTRUCTOR_P (current_function_decl))
- /* Normally local_decls is populated during GIMPLE lowering,
- but [cd]tors are never actually compiled directly. We need
- to put statics on the list so we can deal with the label
- address extension. FIXME. */
- add_local_decl (cfun, decl);
+ /* Normally has_forced_label_in_static is set during GIMPLE
+ lowering, but [cd]tors are never actually compiled directly.
+ We need to set this early so we can deal with the label
+ address extension. */
+ if ((DECL_CONSTRUCTOR_P (current_function_decl)
+ || DECL_DESTRUCTOR_P (current_function_decl))
+ && init)
+ {
+ walk_tree (&init, notice_forced_label_r, NULL, NULL);
+ add_local_decl (cfun, decl);
+ }
/* And make sure it's in the symbol table for
c_parse_final_cleanups to find. */
varpool_node::get_create (decl);
@@ -13712,6 +13727,43 @@ implicit_default_ctor_p (tree fn)
&& sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (fn)));
}
+/* Clobber the contents of *this to let the back end know that the object
+ storage is dead when we enter the constructor or leave the destructor. */
+
+static tree
+build_clobber_this ()
+{
+ /* Clobbering an empty base is pointless, and harmful if its one byte
+ TYPE_SIZE overlays real data. */
+ if (is_empty_class (current_class_type))
+ return void_node;
+
+ /* If we have virtual bases, clobber the whole object, but only if we're in
+ charge. If we don't have virtual bases, clobber the as-base type so we
+ don't mess with tail padding. */
+ bool vbases = CLASSTYPE_VBASECLASSES (current_class_type);
+
+ tree ctype = current_class_type;
+ if (!vbases)
+ ctype = CLASSTYPE_AS_BASE (ctype);
+
+ tree clobber = build_constructor (ctype, NULL);
+ TREE_THIS_VOLATILE (clobber) = true;
+
+ tree thisref = current_class_ref;
+ if (ctype != current_class_type)
+ {
+ thisref = build_nop (build_reference_type (ctype), current_class_ptr);
+ thisref = convert_from_reference (thisref);
+ }
+
+ tree exprstmt = build2 (MODIFY_EXPR, void_type_node, thisref, clobber);
+ if (vbases)
+ exprstmt = build_if_in_charge (exprstmt);
+
+ return exprstmt;
+}
+
/* Create the FUNCTION_DECL for a function definition.
DECLSPECS and DECLARATOR are the parts of the declaration;
they describe the function's name and the type it returns,
@@ -14121,21 +14173,13 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
&& (flag_lifetime_dse > 1)
&& DECL_CONSTRUCTOR_P (decl1)
&& !DECL_CLONED_FUNCTION_P (decl1)
+ /* Clobbering an empty base is harmful if it overlays real data. */
+ && !is_empty_class (current_class_type)
/* We can't clobber safely for an implicitly-defined default constructor
because part of the initialization might happen before we enter the
constructor, via AGGR_INIT_ZERO_FIRST (c++/68006). */
&& !implicit_default_ctor_p (decl1))
- {
- /* Insert a clobber to let the back end know that the object storage
- is dead when we enter the constructor. */
- tree btype = CLASSTYPE_AS_BASE (current_class_type);
- tree clobber = build_constructor (btype, NULL);
- TREE_THIS_VOLATILE (clobber) = true;
- tree bref = build_nop (build_reference_type (btype), current_class_ptr);
- bref = convert_from_reference (bref);
- tree exprstmt = build2 (MODIFY_EXPR, btype, bref, clobber);
- finish_expr_stmt (exprstmt);
- }
+ finish_expr_stmt (build_clobber_this ());
if (!processing_template_decl
&& DECL_CONSTRUCTOR_P (decl1)
@@ -14352,19 +14396,10 @@ begin_destructor_body (void)
initialize_vtbl_ptrs (current_class_ptr);
finish_compound_stmt (compound_stmt);
- if (flag_lifetime_dse)
- {
- /* Insert a cleanup to let the back end know that the object is dead
- when we exit the destructor, either normally or via exception. */
- tree btype = CLASSTYPE_AS_BASE (current_class_type);
- tree clobber = build_constructor (btype, NULL);
- TREE_THIS_VOLATILE (clobber) = true;
- tree bref = build_nop (build_reference_type (btype),
- current_class_ptr);
- bref = convert_from_reference (bref);
- tree exprstmt = build2 (MODIFY_EXPR, btype, bref, clobber);
- finish_decl_cleanup (NULL_TREE, exprstmt);
- }
+ if (flag_lifetime_dse
+ /* Clobbering an empty base is harmful if it overlays real data. */
+ && !is_empty_class (current_class_type))
+ finish_decl_cleanup (NULL_TREE, build_clobber_this ());
/* And insert cleanups for our bases and members so that they
will be properly destroyed if we throw. */
@@ -14557,9 +14592,6 @@ finish_function (int flags)
if (c_dialect_objc ())
objc_finish_function ();
- gcc_assert (!defer_mark_used_calls);
- defer_mark_used_calls = true;
-
record_key_method_defined (fndecl);
fntype = TREE_TYPE (fndecl);
@@ -14809,17 +14841,6 @@ finish_function (int flags)
/* Clean up. */
current_function_decl = NULL_TREE;
- defer_mark_used_calls = false;
- if (deferred_mark_used_calls)
- {
- unsigned int i;
- tree decl;
-
- FOR_EACH_VEC_SAFE_ELT (deferred_mark_used_calls, i, decl)
- mark_used (decl);
- vec_free (deferred_mark_used_calls);
- }
-
invoke_plugin_callbacks (PLUGIN_FINISH_PARSE_FUNCTION, fndecl);
return fndecl;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 73b0d280c43..b3cc99a7dc1 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -5140,14 +5140,6 @@ mark_used (tree decl, tsubst_flags_t complain)
if (DECL_ODR_USED (decl))
return true;
- /* If within finish_function, defer the rest until that function
- finishes, otherwise it might recurse. */
- if (defer_mark_used_calls)
- {
- vec_safe_push (deferred_mark_used_calls, decl);
- return true;
- }
-
/* Normally, we can wait until instantiation-time to synthesize DECL.
However, if DECL is a static data member initialized with a constant
or a constexpr function, we need it right now because a reference to
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 1ba3c59c90e..aee3b8416e4 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1243,12 +1243,7 @@ expand_virtual_init (tree binfo, tree decl)
/* The actual initializer is the VTT value only in the subobject
constructor. In maybe_clone_body we'll substitute NULL for
the vtt_parm in the case of the non-subobject constructor. */
- vtbl = build3 (COND_EXPR,
- TREE_TYPE (vtbl),
- build2 (EQ_EXPR, boolean_type_node,
- current_in_charge_parm, integer_zero_node),
- vtbl2,
- vtbl);
+ vtbl = build_if_in_charge (vtbl, vtbl2);
}
/* Compute the location of the vtpr. */
@@ -1741,11 +1736,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
&parms, binfo, flags,
complain);
base = fold_build_cleanup_point_expr (void_type_node, base);
- rval = build3 (COND_EXPR, void_type_node,
- build2 (EQ_EXPR, boolean_type_node,
- current_in_charge_parm, integer_zero_node),
- base,
- complete);
+ rval = build_if_in_charge (complete, base);
}
else
{
@@ -2872,6 +2863,14 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts,
return error_mark_node;
}
alloc_fn = OVL_CURRENT (alloc_fn);
+ if (TREE_CODE (alloc_fn) != FUNCTION_DECL
+ || TREE_CODE (TREE_TYPE (alloc_fn)) != FUNCTION_TYPE
+ || !POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (alloc_fn))))
+ {
+ if (complain & tf_error)
+ error ("%qD is not a function returning a pointer", alloc_fn);
+ return error_mark_node;
+ }
class_addr = build1 (ADDR_EXPR, jclass_node, class_decl);
alloc_call = cp_build_function_call_nary (alloc_fn, complain,
class_addr, NULL_TREE);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d38f1dd9a5c..7e13c6e74f6 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9781,8 +9781,6 @@ cp_parser_lambda_expression (cp_parser* parser)
= auto_is_implicit_function_template_parm_p;
}
- pop_deferring_access_checks ();
-
/* This field is only used during parsing of the lambda. */
LAMBDA_EXPR_THIS_CAPTURE (lambda_expr) = NULL_TREE;
@@ -9798,6 +9796,8 @@ cp_parser_lambda_expression (cp_parser* parser)
cp_parser_end_tentative_firewall (parser, start, lambda_expr);
+ pop_deferring_access_checks ();
+
return lambda_expr;
}
@@ -11497,7 +11497,7 @@ cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
*end, ERROR_MARK,
NULL, tf_none)
!= error_mark_node))
- /* P08184R0 allows __begin and __end to have different types,
+ /* P0184R0 allows __begin and __end to have different types,
but make sure they are comparable so we can give a better
diagnostic. */;
else
@@ -30086,7 +30086,7 @@ cp_parser_oacc_data_clause (cp_parser *parser, pragma_omp_clause c_kind,
kind = GOMP_MAP_FORCE_ALLOC;
break;
case PRAGMA_OACC_CLAUSE_DELETE:
- kind = GOMP_MAP_FORCE_DEALLOC;
+ kind = GOMP_MAP_DELETE;
break;
case PRAGMA_OACC_CLAUSE_DEVICE:
kind = GOMP_MAP_FORCE_TO;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9766668dfcf..a6398c04f85 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6950,7 +6950,8 @@ canonicalize_type_argument (tree arg, tsubst_flags_t complain)
tree canon = strip_typedefs (arg, &removed_attributes);
if (removed_attributes
&& (complain & tf_warning))
- warning (0, "ignoring attributes on template argument %qT", arg);
+ warning (OPT_Wignored_attributes,
+ "ignoring attributes on template argument %qT", arg);
return canon;
}
@@ -8851,8 +8852,9 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
break;
case TYPENAME_TYPE:
- if (!fn)
- WALK_SUBTREE (TYPENAME_TYPE_FULLNAME (t));
+ /* A template-id in a TYPENAME_TYPE might be a deduced context after
+ partial instantiation. */
+ WALK_SUBTREE (TYPENAME_TYPE_FULLNAME (t));
break;
case CONSTRUCTOR:
@@ -12373,6 +12375,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* The initializer must not be expanded until it is required;
see [temp.inst]. */
DECL_INITIAL (r) = NULL_TREE;
+ if (VAR_P (r))
+ DECL_MODE (r) = VOIDmode;
if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL))
SET_DECL_RTL (r, NULL);
DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
@@ -13874,10 +13878,13 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (r == NULL_TREE)
{
- /* We get here for a use of 'this' in an NSDMI. */
+ /* We get here for a use of 'this' in an NSDMI as part of a
+ constructor call or as part of an aggregate initialization. */
if (DECL_NAME (t) == this_identifier
- && current_function_decl
- && DECL_CONSTRUCTOR_P (current_function_decl))
+ && ((current_function_decl
+ && DECL_CONSTRUCTOR_P (current_function_decl))
+ || (current_class_ref
+ && TREE_CODE (current_class_ref) == PLACEHOLDER_EXPR)))
return current_class_ptr;
/* This can happen for a parameter name used later in a function
@@ -21934,7 +21941,7 @@ instantiate_decl (tree d, int defer_ok,
if (enter_context)
pop_nested_class ();
- if (variable_template_p (td))
+ if (variable_template_p (gen_tmpl))
note_variable_template_instantiation (d);
}
else if (TREE_CODE (d) == FUNCTION_DECL && DECL_DEFAULTED_FN (code_pattern))
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 79246118915..503e34b7f2e 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1751,9 +1751,11 @@ adjust_result_of_qualified_name_lookup (tree decl,
if (base && base != error_mark_node)
{
BASELINK_ACCESS_BINFO (decl) = base;
- BASELINK_BINFO (decl)
+ tree decl_binfo
= lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)),
ba_unique, NULL, tf_none);
+ if (decl_binfo && decl_binfo != error_mark_node)
+ BASELINK_BINFO (decl) = decl_binfo;
}
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index aaf9a4f2188..5d9de344e7c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -824,9 +824,8 @@ build_cplus_array_type (tree elt_type, tree index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- bool dependent = (processing_template_decl
- && (dependent_type_p (elt_type)
- || (index_type && dependent_type_p (index_type))));
+ bool dependent = (uses_template_parms (elt_type)
+ || (index_type && uses_template_parms (index_type)));
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
/* Start with an array of the TYPE_MAIN_VARIANT. */
@@ -1460,9 +1459,12 @@ strip_typedefs (tree t, bool *remove_attributes)
if (!result)
{
if (typedef_variant_p (t))
- /* Explicitly get the underlying type, as TYPE_MAIN_VARIANT doesn't
- strip typedefs with attributes. */
- result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (t)));
+ {
+ /* Explicitly get the underlying type, as TYPE_MAIN_VARIANT doesn't
+ strip typedefs with attributes. */
+ result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (t)));
+ result = strip_typedefs (result);
+ }
else
result = TYPE_MAIN_VARIANT (t);
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 20f0afc74d7..447006cb327 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3974,6 +3974,38 @@ build_vec_cmp (tree_code code, tree type,
return build3 (VEC_COND_EXPR, type, cmp, minus_one_vec, zero_vec);
}
+/* Possibly warn about an address never being NULL. */
+
+static void
+warn_for_null_address (location_t location, tree op, tsubst_flags_t complain)
+{
+ if (!warn_address
+ || (complain & tf_warning) == 0
+ || c_inhibit_evaluation_warnings != 0
+ || TREE_NO_WARNING (op))
+ return;
+
+ tree cop = fold_non_dependent_expr (op);
+
+ if (TREE_CODE (cop) == ADDR_EXPR
+ && decl_with_nonnull_addr_p (TREE_OPERAND (cop, 0))
+ && !TREE_NO_WARNING (cop))
+ warning_at (location, OPT_Waddress, "the address of %qD will never "
+ "be NULL", TREE_OPERAND (cop, 0));
+
+ if (CONVERT_EXPR_P (op)
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (op, 0))) == REFERENCE_TYPE)
+ {
+ tree inner_op = op;
+ STRIP_NOPS (inner_op);
+
+ if (DECL_P (inner_op))
+ warning_at (location, OPT_Waddress,
+ "the compiler can assume that the address of "
+ "%qD will never be NULL", inner_op);
+ }
+}
+
/* Build a binary-operation expression without default conversions.
CODE is the kind of expression to build.
LOCATION is the location_t of the operator in the source code.
@@ -4520,32 +4552,7 @@ cp_build_binary_op (location_t location,
else
result_type = type0;
- if (TREE_CODE (op0) == ADDR_EXPR
- && decl_with_nonnull_addr_p (TREE_OPERAND (op0, 0)))
- {
- if ((complain & tf_warning)
- && c_inhibit_evaluation_warnings == 0
- && !TREE_NO_WARNING (op0))
- warning (OPT_Waddress, "the address of %qD will never be NULL",
- TREE_OPERAND (op0, 0));
- }
-
- if (CONVERT_EXPR_P (op0)
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (op0, 0)))
- == REFERENCE_TYPE)
- {
- tree inner_op0 = op0;
- STRIP_NOPS (inner_op0);
-
- if ((complain & tf_warning)
- && c_inhibit_evaluation_warnings == 0
- && !TREE_NO_WARNING (op0)
- && DECL_P (inner_op0))
- warning_at (location, OPT_Waddress,
- "the compiler can assume that the address of "
- "%qD will never be NULL",
- inner_op0);
- }
+ warn_for_null_address (location, op0, complain);
}
else if (((code1 == POINTER_TYPE || TYPE_PTRDATAMEM_P (type1))
&& null_ptr_cst_p (op0))
@@ -4559,32 +4566,7 @@ cp_build_binary_op (location_t location,
else
result_type = type1;
- if (TREE_CODE (op1) == ADDR_EXPR
- && decl_with_nonnull_addr_p (TREE_OPERAND (op1, 0)))
- {
- if ((complain & tf_warning)
- && c_inhibit_evaluation_warnings == 0
- && !TREE_NO_WARNING (op1))
- warning (OPT_Waddress, "the address of %qD will never be NULL",
- TREE_OPERAND (op1, 0));
- }
-
- if (CONVERT_EXPR_P (op1)
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (op1, 0)))
- == REFERENCE_TYPE)
- {
- tree inner_op1 = op1;
- STRIP_NOPS (inner_op1);
-
- if ((complain & tf_warning)
- && c_inhibit_evaluation_warnings == 0
- && !TREE_NO_WARNING (op1)
- && DECL_P (inner_op1))
- warning_at (location, OPT_Waddress,
- "the compiler can assume that the address of "
- "%qD will never be NULL",
- inner_op1);
- }
+ warn_for_null_address (location, op1, complain);
}
else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE)
|| (TYPE_PTRDATAMEM_P (type0) && TYPE_PTRDATAMEM_P (type1)))
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 2a76c96c7d4..4ab77cda387 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1499,9 +1499,24 @@ process_init_constructor_union (tree type, tree init,
constructor_elt *ce;
int len;
- /* If the initializer was empty, use default zero initialization. */
+ /* If the initializer was empty, use the union's NSDMI if it has one.
+ Otherwise use default zero initialization. */
if (vec_safe_is_empty (CONSTRUCTOR_ELTS (init)))
- return 0;
+ {
+ for (tree field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ {
+ if (DECL_INITIAL (field))
+ {
+ CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (init),
+ field,
+ get_nsdmi (field, /*in_ctor=*/false));
+ break;
+ }
+ }
+
+ if (vec_safe_is_empty (CONSTRUCTOR_ELTS (init)))
+ return 0;
+ }
len = CONSTRUCTOR_ELTS (init)->length ();
if (len > 1)
diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c
index f10ade5591c..bf956661252 100644
--- a/gcc/diagnostic-show-locus.c
+++ b/gcc/diagnostic-show-locus.c
@@ -486,6 +486,12 @@ compatible_locations_p (location_t loc_a, location_t loc_b)
if (IS_ADHOC_LOC (loc_b))
loc_b = get_location_from_adhoc_loc (line_table, loc_b);
+ /* If either location is one of the special locations outside of a
+ linemap, they are only compatible if they are equal. */
+ if (loc_a < RESERVED_LOCATION_COUNT
+ || loc_b < RESERVED_LOCATION_COUNT)
+ return loc_a == loc_b;
+
const line_map *map_a = linemap_lookup (line_table, loc_a);
linemap_assert (map_a);
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7749bcbf257..7e9ad7757d5 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2772,29 +2772,40 @@ refer to the following subsections for details.
@item leaf
@cindex @code{leaf} function attribute
-Calls to external functions with this attribute must return to the current
-compilation unit only by return or by exception handling. In particular, leaf
-functions are not allowed to call callback function passed to it from the current
-compilation unit or directly call functions exported by the unit or longjmp
-into the unit. Leaf function might still call functions from other compilation
-units and thus they are not necessarily leaf in the sense that they contain no
-function calls at all.
-
-The attribute is intended for library functions to improve dataflow analysis.
-The compiler takes the hint that any data not escaping the current compilation unit can
-not be used or modified by the leaf function. For example, the @code{sin} function
-is a leaf function, but @code{qsort} is not.
-
-Note that leaf functions might invoke signals and signal handlers might be
-defined in the current compilation unit and use static variables. The only
-compliant way to write such a signal handler is to declare such variables
-@code{volatile}.
-
-The attribute has no effect on functions defined within the current compilation
-unit. This is to allow easy merging of multiple compilation units into one,
-for example, by using the link-time optimization. For this reason the
-attribute is not allowed on types to annotate indirect calls.
-
+Calls to external functions with this attribute must return to the
+current compilation unit only by return or by exception handling. In
+particular, a leaf function is not allowed to invoke callback functions
+passed to it from the current compilation unit, directly call functions
+exported by the unit, or @code{longjmp} into the unit. Leaf functions
+might still call functions from other compilation units and thus they
+are not necessarily leaf in the sense that they contain no function
+calls at all.
+
+The attribute is intended for library functions to improve dataflow
+analysis. The compiler takes the hint that any data not escaping the
+current compilation unit cannot be used or modified by the leaf
+function. For example, the @code{sin} function is a leaf function, but
+@code{qsort} is not.
+
+Note that leaf functions might indirectly run a signal handler defined
+in the current compilation unit that uses static variables. Similarly,
+when lazy symbol resolution is in effect, leaf functions might invoke
+indirect functions whose resolver function or implementation function is
+defined in the current compilation unit and uses static variables. There
+is no standard-compliant way to write such a signal handler, resolver
+function, or implementation function, and the best that you can do is to
+remove the @code{leaf} attribute or mark all such static variables
+@code{volatile}. Lastly, for ELF-based systems that support symbol
+interposition, care should be taken that functions defined in the
+current compilation unit do not unexpectedly interpose other symbols
+based on the defined standards mode and defined feature test macros;
+otherwise an inadvertent callback would be added.
+
+The attribute has no effect on functions defined within the current
+compilation unit. This is to allow easy merging of multiple compilation
+units into one, for example, by using the link-time optimization. For
+this reason the attribute is not allowed on types to annotate indirect
+calls.
@item malloc
@cindex @code{malloc} function attribute
@@ -3034,7 +3045,7 @@ int square (int) __attribute__ ((pure));
says that the hypothetical function @code{square} is safe to call
fewer times than the program says.
-Some of common examples of pure functions are @code{strlen} or @code{memcmp}.
+Some common examples of pure functions are @code{strlen} or @code{memcmp}.
Interesting non-pure functions are functions with infinite loops or those
depending on volatile memory or other system resource, that may change between
two consecutive calls (such as @code{feof} in a multithreading environment).
@@ -7441,10 +7452,10 @@ note that some assembler dialects use semicolons to start a comment.
@end table
@subsubheading Remarks
-Using extended @code{asm} typically produces smaller, safer, and more
-efficient code, and in most cases it is a better solution than basic
-@code{asm}. However, there are two situations where only basic @code{asm}
-can be used:
+Using extended @code{asm} (@pxref{Extended Asm}) typically produces
+smaller, safer, and more efficient code, and in most cases it is a
+better solution than basic @code{asm}. However, there are two
+situations where only basic @code{asm} can be used:
@itemize @bullet
@item
@@ -7481,9 +7492,24 @@ assembly code when optimizing. This can lead to unexpected duplicate
symbol errors during compilation if your assembly code defines symbols or
labels.
-Since GCC does not parse the @var{AssemblerInstructions}, it has no
-visibility of any symbols it references. This may result in GCC discarding
-those symbols as unreferenced.
+@strong{Warning:} The C standards do not specify semantics for @code{asm},
+making it a potential source of incompatibilities between compilers. These
+incompatibilities may not produce compiler warnings/errors.
+
+GCC does not parse basic @code{asm}'s @var{AssemblerInstructions}, which
+means there is no way to communicate to the compiler what is happening
+inside them. GCC has no visibility of symbols in the @code{asm} and may
+discard them as unreferenced. It also does not know about side effects of
+the assembler code, such as modifications to memory or registers. Unlike
+some compilers, GCC assumes that no changes to either memory or registers
+occur. This assumption may change in a future release.
+
+To avoid complications from future changes to the semantics and the
+compatibility issues between compilers, consider replacing basic @code{asm}
+with extended @code{asm}. See
+@uref{https://gcc.gnu.org/wiki/ConvertBasicAsmToExtended, How to convert
+from basic asm to extended asm} for information about how to perform this
+conversion.
The compiler copies the assembler instructions in a basic @code{asm}
verbatim to the assembly language output file, without
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4174b4a0cc1..5c1a9fbf5a0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -267,7 +267,7 @@ Objective-C and Objective-C++ Dialects}.
-Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
-Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol
-Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
--Wignored-qualifiers -Wincompatible-pointer-types @gol
+-Wignored-qualifiers -Wignored-attributes -Wincompatible-pointer-types @gol
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol
-Winit-self -Winline -Wno-int-conversion @gol
-Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof @gol
@@ -712,7 +712,7 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-msmall-model -mno-lsim}
@emph{FT32 Options}
-@gccoptlist{-msim -mlra}
+@gccoptlist{-msim -mlra -mnodiv}
@emph{FRV Options}
@gccoptlist{-mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 @gol
@@ -3889,6 +3889,14 @@ even without this option.
This warning is also enabled by @option{-Wextra}.
+@item -Wignored-attributes @r{(C and C++ only)}
+@opindex Wignored-attributes
+@opindex Wno-ignored-attributes
+Warn when an attribute is ignored. This is different from the
+@option{-Wattributes} option in that it warns whenever the compiler decides
+to drop an attribute, not that the attribute is either unknown, used in a
+wrong place, etc. This warning is enabled by default.
+
@item -Wmain
@opindex Wmain
@opindex Wno-main
@@ -9596,6 +9604,11 @@ Enable emission of special debug stores within HSA kernels which are
then read and reported by libgomp plugin. Generation of these stores
is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
enable it.
+
+@item max-speculative-devirt-maydefs
+The maximum number of may-defs we analyze when looking for a must-def
+specifying the dynamic type of an object that invokes a virtual call
+we may be able to devirtualize speculatively.
@end table
@end table
@@ -15822,6 +15835,10 @@ I/O functions are needed.
Enable Local Register Allocation. This is still experimental for FT32,
so by default the compiler uses standard reload.
+@item -mnodiv
+@opindex mnodiv
+Do not use div and mod instructions.
+
@end table
@node FRV Options
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6d5e3f540f5..0bbff87a95e 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27281,12 +27281,15 @@ optimize_location_lists (dw_die_ref die)
static void
flush_limbo_die_list (void)
{
- limbo_die_node *node, *next_node;
+ limbo_die_node *node;
- for (node = limbo_die_list; node; node = next_node)
+ /* get_context_die calls force_decl_die, which can put new DIEs on the
+ limbo list in LTO mode when nested functions are put in a different
+ partition than that of their parent function. */
+ while ((node = limbo_die_list))
{
dw_die_ref die = node->die;
- next_node = node->next;
+ limbo_die_list = node->next;
if (die->die_parent == NULL)
{
@@ -27324,8 +27327,6 @@ flush_limbo_die_list (void)
}
}
}
-
- limbo_die_list = NULL;
}
/* Output stuff that dwarf requires at the end of every file,
@@ -27685,10 +27686,15 @@ dwarf2out_finish (const char *filename)
static void
dwarf2out_early_finish (void)
{
- limbo_die_node *node;
+ /* The point here is to flush out the limbo list so that it is empty
+ and we don't need to stream it for LTO. */
+ flush_limbo_die_list ();
+
+ gen_scheduled_generic_parms_dies ();
+ gen_remaining_tmpl_value_param_die_attribute ();
/* Add DW_AT_linkage_name for all deferred DIEs. */
- for (node = deferred_asm_name; node; node = node->next)
+ for (limbo_die_node *node = deferred_asm_name; node; node = node->next)
{
tree decl = node->created_for;
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
@@ -27702,13 +27708,6 @@ dwarf2out_early_finish (void)
}
}
deferred_asm_name = NULL;
-
- /* The point here is to flush out the limbo list so that it is empty
- and we don't need to stream it for LTO. */
- flush_limbo_die_list ();
-
- gen_scheduled_generic_parms_dies ();
- gen_remaining_tmpl_value_param_die_attribute ();
}
/* Reset all state within dwarf2out.c so that we can rerun the compiler
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 696b4a6996f..788ecc3a6b7 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6116,11 +6116,9 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
{
tree tem = const_binop (code, fold_convert (ctype, t),
fold_convert (ctype, c));
- /* If the multiplication overflowed to INT_MIN then we lost sign
- information on it and a subsequent multiplication might
- spuriously overflow. See PR68142. */
- if (TREE_OVERFLOW (tem)
- && wi::eq_p (tem, wi::min_value (TYPE_PRECISION (ctype), SIGNED)))
+ /* If the multiplication overflowed, we lost information on it.
+ See PR68142 and PR69845. */
+ if (TREE_OVERFLOW (tem))
return NULL_TREE;
return tem;
}
@@ -6376,18 +6374,19 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
bool overflow_p = false;
bool overflow_mul_p;
signop sign = TYPE_SIGN (ctype);
- wide_int mul = wi::mul (op1, c, sign, &overflow_mul_p);
+ unsigned prec = TYPE_PRECISION (ctype);
+ wide_int mul = wi::mul (wide_int::from (op1, prec,
+ TYPE_SIGN (TREE_TYPE (op1))),
+ wide_int::from (c, prec,
+ TYPE_SIGN (TREE_TYPE (c))),
+ sign, &overflow_mul_p);
overflow_p = TREE_OVERFLOW (c) | TREE_OVERFLOW (op1);
if (overflow_mul_p
&& ((sign == UNSIGNED && tcode != MULT_EXPR) || sign == SIGNED))
overflow_p = true;
if (!overflow_p)
- {
- mul = wide_int::from (mul, TYPE_PRECISION (ctype),
- TYPE_SIGN (TREE_TYPE (op1)));
- return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
- wide_int_to_tree (ctype, mul));
- }
+ return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
+ wide_int_to_tree (ctype, mul));
}
/* If these operations "cancel" each other, we have the main
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9ed112ec631..5ab7d3ff285 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,30 @@
+2016-03-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70397
+ * trans-expr.c (gfc_class_len_or_zero_get): Add function to return a
+ constant zero tree, when the class to get the _len component from is
+ not unlimited polymorphic.
+ (gfc_copy_class_to_class): Use the new function.
+ * trans.h: Added interface of new function gfc_class_len_or_zero_get.
+
+2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+
+ * trans-decl.c (gfc_build_builtin_function_decls):
+ caf_stop_numeric and caf_stop_str definition.
+ * trans-stmt.c (gfc_trans_stop): invoke external functions
+ for stop and stop_str when coarrays are used.
+ * trans.h: extern for new functions.
+
+2016-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/69043
+ * scanner.c (load_file): Update to use S_ISREG macro.
+
+2016-03-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gfortran.h (enum gfc_omp_map_op): Rename OMP_MAP_FORCE_DEALLOC
+ to OMP_MAP_DELETE. Adjust all users.
+
2016-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Jim MacArthur <jim.macarthur@codethink.co.uk>
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 33fffd8bdcf..a0fb5fda9e5 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1112,8 +1112,8 @@ enum gfc_omp_map_op
OMP_MAP_TO,
OMP_MAP_FROM,
OMP_MAP_TOFROM,
+ OMP_MAP_DELETE,
OMP_MAP_FORCE_ALLOC,
- OMP_MAP_FORCE_DEALLOC,
OMP_MAP_FORCE_TO,
OMP_MAP_FORCE_FROM,
OMP_MAP_FORCE_TOFROM,
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 51ab96ec6e5..a6c39cda694 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -764,7 +764,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask,
if ((mask & OMP_CLAUSE_DELETE)
&& gfc_match ("delete ( ") == MATCH_YES
&& gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP],
- OMP_MAP_FORCE_DEALLOC))
+ OMP_MAP_DELETE))
continue;
if ((mask & OMP_CLAUSE_PRESENT)
&& gfc_match ("present ( ") == MATCH_YES
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 33d96d88d92..f4dedd69757 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -2246,7 +2246,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
return false;
}
stat_result = stat (realfilename, &st);
- if (stat_result == 0 && !(st.st_mode & S_IFREG))
+ if (stat_result == 0 && !S_ISREG(st.st_mode))
{
fprintf (stderr, "%s:%d: Error: Included path '%s'"
" is not a regular file\n",
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 4bd7dc4e853..309baf1c69e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -137,6 +137,8 @@ tree gfor_fndecl_caf_sendget;
tree gfor_fndecl_caf_sync_all;
tree gfor_fndecl_caf_sync_memory;
tree gfor_fndecl_caf_sync_images;
+tree gfor_fndecl_caf_stop_str;
+tree gfor_fndecl_caf_stop_numeric;
tree gfor_fndecl_caf_error_stop;
tree gfor_fndecl_caf_error_stop_str;
tree gfor_fndecl_caf_atomic_def;
@@ -3550,6 +3552,18 @@ gfc_build_builtin_function_decls (void)
/* CAF's ERROR STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1;
+ gfor_fndecl_caf_stop_numeric = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_stop_numeric")), ".R.",
+ void_type_node, 1, gfc_int4_type_node);
+ /* CAF's STOP doesn't return. */
+ TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_numeric) = 1;
+
+ gfor_fndecl_caf_stop_str = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_stop_str")), ".R.",
+ void_type_node, 2, pchar_type_node, gfc_int4_type_node);
+ /* CAF's STOP doesn't return. */
+ TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_str) = 1;
+
gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_atomic_define")), "R..RW",
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 4baadc84ef0..8d039a670b5 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -173,6 +173,29 @@ gfc_class_len_get (tree decl)
}
+/* Try to get the _len component of a class. When the class is not unlimited
+ poly, i.e. no _len field exists, then return a zero node. */
+
+tree
+gfc_class_len_or_zero_get (tree decl)
+{
+ tree len;
+ /* For class arrays decl may be a temporary descriptor handle, the vptr is
+ then available through the saved descriptor. */
+ if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl))
+ decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
+ if (POINTER_TYPE_P (TREE_TYPE (decl)))
+ decl = build_fold_indirect_ref_loc (input_location, decl);
+ len = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)),
+ CLASS_LEN_FIELD);
+ return len != NULL_TREE ? fold_build3_loc (input_location, COMPONENT_REF,
+ TREE_TYPE (len), decl, len,
+ NULL_TREE)
+ : integer_zero_node;
+}
+
+
/* Get the specified FIELD from the VPTR. */
static tree
@@ -250,6 +273,7 @@ gfc_vptr_size_get (tree vptr)
#undef CLASS_DATA_FIELD
#undef CLASS_VPTR_FIELD
+#undef CLASS_LEN_FIELD
#undef VTABLE_HASH_FIELD
#undef VTABLE_SIZE_FIELD
#undef VTABLE_EXTENDS_FIELD
@@ -1120,7 +1144,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited)
if (unlimited)
{
if (from != NULL_TREE && unlimited)
- from_len = gfc_class_len_get (from);
+ from_len = gfc_class_len_or_zero_get (from);
else
from_len = integer_zero_node;
}
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 5990202c68c..a905ca607ae 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -2119,12 +2119,12 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
case OMP_MAP_TOFROM:
OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_TOFROM);
break;
+ case OMP_MAP_DELETE:
+ OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_DELETE);
+ break;
case OMP_MAP_FORCE_ALLOC:
OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_ALLOC);
break;
- case OMP_MAP_FORCE_DEALLOC:
- OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_DEALLOC);
- break;
case OMP_MAP_FORCE_TO:
OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_TO);
break;
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index cb54499ec39..2fc43eddbe5 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -635,7 +635,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop_str
: gfor_fndecl_error_stop_string)
- : gfor_fndecl_stop_string,
+ : (flag_coarray == GFC_FCOARRAY_LIB
+ ? gfor_fndecl_caf_stop_str
+ : gfor_fndecl_stop_string),
2, build_int_cst (pchar_type_node, 0), tmp);
}
else if (code->expr1->ts.type == BT_INTEGER)
@@ -646,7 +648,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop
: gfor_fndecl_error_stop_numeric)
- : gfor_fndecl_stop_numeric_f08, 1,
+ : (flag_coarray == GFC_FCOARRAY_LIB
+ ? gfor_fndecl_caf_stop_numeric
+ : gfor_fndecl_stop_numeric_f08), 1,
fold_convert (gfc_int4_type_node, se.expr));
}
else
@@ -657,7 +661,9 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
? (flag_coarray == GFC_FCOARRAY_LIB
? gfor_fndecl_caf_error_stop_str
: gfor_fndecl_error_stop_string)
- : gfor_fndecl_stop_string,
+ : (flag_coarray == GFC_FCOARRAY_LIB
+ ? gfor_fndecl_caf_stop_str
+ : gfor_fndecl_stop_string),
2, se.expr, se.string_length);
}
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 316ee9b540f..512615ab1e4 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -365,6 +365,7 @@ tree gfc_class_set_static_fields (tree, tree, tree);
tree gfc_class_data_get (tree);
tree gfc_class_vptr_get (tree);
tree gfc_class_len_get (tree);
+tree gfc_class_len_or_zero_get (tree);
gfc_expr * gfc_find_and_cut_at_last_class_ref (gfc_expr *);
/* Get an accessor to the class' vtab's * field, when a class handle is
available. */
@@ -762,6 +763,8 @@ extern GTY(()) tree gfor_fndecl_caf_sendget;
extern GTY(()) tree gfor_fndecl_caf_sync_all;
extern GTY(()) tree gfor_fndecl_caf_sync_memory;
extern GTY(()) tree gfor_fndecl_caf_sync_images;
+extern GTY(()) tree gfor_fndecl_caf_stop_numeric;
+extern GTY(()) tree gfor_fndecl_caf_stop_str;
extern GTY(()) tree gfor_fndecl_caf_error_stop;
extern GTY(()) tree gfor_fndecl_caf_error_stop_str;
extern GTY(()) tree gfor_fndecl_caf_atomic_def;
diff --git a/gcc/function.h b/gcc/function.h
index c4368cda7f2..501ef684840 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -328,6 +328,10 @@ struct GTY(()) function {
from nested functions. */
unsigned int has_nonlocal_label : 1;
+ /* Nonzero if function being compiled has a forced label
+ placed into static storage. */
+ unsigned int has_forced_label_in_static : 1;
+
/* Nonzero if we've set cannot_be_copied_reason. I.e. if
(cannot_be_copied_set && !cannot_be_copied_reason), the function
can in fact be copied. */
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index bb97bfb642c..1f5f45c206a 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -548,7 +548,7 @@ struct operand {
virtual void gen_transform (FILE *, int, const char *, bool, int,
const char *, capture_info *,
dt_operand ** = 0,
- bool = true)
+ int = 0)
{ gcc_unreachable (); }
};
@@ -590,7 +590,7 @@ struct expr : public operand
bool force_single_use;
virtual void gen_transform (FILE *f, int, const char *, bool, int,
const char *, capture_info *,
- dt_operand ** = 0, bool = true);
+ dt_operand ** = 0, int = 0);
};
/* An operator that is represented by native C code. This is always
@@ -622,7 +622,7 @@ struct c_expr : public operand
vec<id_tab> ids;
virtual void gen_transform (FILE *f, int, const char *, bool, int,
const char *, capture_info *,
- dt_operand ** = 0, bool = true);
+ dt_operand ** = 0, int = 0);
};
/* A wrapper around another operand that captures its value. */
@@ -637,7 +637,7 @@ struct capture : public operand
operand *what;
virtual void gen_transform (FILE *f, int, const char *, bool, int,
const char *, capture_info *,
- dt_operand ** = 0, bool = true);
+ dt_operand ** = 0, int = 0);
};
/* if expression. */
@@ -2149,7 +2149,7 @@ get_operand_type (id_base *op, const char *in_type,
void
expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
int depth, const char *in_type, capture_info *cinfo,
- dt_operand **indexes, bool)
+ dt_operand **indexes, int)
{
id_base *opr = operation;
/* When we delay operator substituting during lowering of fors we
@@ -2213,9 +2213,8 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
i == 0 ? NULL : op0type);
ops[i]->gen_transform (f, indent, dest, gimple, depth + 1, optype,
cinfo, indexes,
- ((!(*opr == COND_EXPR)
- && !(*opr == VEC_COND_EXPR))
- || i != 0));
+ (*opr == COND_EXPR
+ || *opr == VEC_COND_EXPR) && i == 0 ? 1 : 2);
}
const char *opr_name;
@@ -2306,7 +2305,7 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
void
c_expr::gen_transform (FILE *f, int indent, const char *dest,
bool, int, const char *, capture_info *,
- dt_operand **, bool)
+ dt_operand **, int)
{
if (dest && nr_stmts == 1)
fprintf_indent (f, indent, "%s = ", dest);
@@ -2378,7 +2377,7 @@ c_expr::gen_transform (FILE *f, int indent, const char *dest,
void
capture::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
int depth, const char *in_type, capture_info *cinfo,
- dt_operand **indexes, bool expand_compares)
+ dt_operand **indexes, int cond_handling)
{
if (what && is_a<expr *> (what))
{
@@ -2394,20 +2393,29 @@ capture::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
fprintf_indent (f, indent, "%s = captures[%u];\n", dest, where);
/* ??? Stupid tcc_comparison GENERIC trees in COND_EXPRs. Deal
- with substituting a capture of that.
- ??? Returning false here will also not allow any other patterns
- to match. */
- if (gimple && expand_compares
+ with substituting a capture of that. */
+ if (gimple
+ && cond_handling != 0
&& cinfo->info[where].cond_expr_cond_p)
{
- fprintf_indent (f, indent, "if (COMPARISON_CLASS_P (%s))\n", dest);
- fprintf_indent (f, indent, " {\n");
- fprintf_indent (f, indent, " if (!seq) return false;\n");
- fprintf_indent (f, indent, " %s = gimple_build (seq, TREE_CODE (%s),"
- " TREE_TYPE (%s), TREE_OPERAND (%s, 0),"
- " TREE_OPERAND (%s, 1));\n",
- dest, dest, dest, dest, dest);
- fprintf_indent (f, indent, " }\n");
+ /* If substituting into a cond_expr condition, unshare. */
+ if (cond_handling == 1)
+ fprintf_indent (f, indent, "%s = unshare_expr (%s);\n", dest, dest);
+ /* If substituting elsewhere we might need to decompose it. */
+ else if (cond_handling == 2)
+ {
+ /* ??? Returning false here will also not allow any other patterns
+ to match unless this generator was split out. */
+ fprintf_indent (f, indent, "if (COMPARISON_CLASS_P (%s))\n", dest);
+ fprintf_indent (f, indent, " {\n");
+ fprintf_indent (f, indent, " if (!seq) return false;\n");
+ fprintf_indent (f, indent, " %s = gimple_build (seq,"
+ " TREE_CODE (%s),"
+ " TREE_TYPE (%s), TREE_OPERAND (%s, 0),"
+ " TREE_OPERAND (%s, 1));\n",
+ dest, dest, dest, dest, dest);
+ fprintf_indent (f, indent, " }\n");
+ }
}
}
@@ -3043,18 +3051,14 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
"type", e->expr_type,
j == 0 ? NULL : "TREE_TYPE (res_ops[0])");
/* We need to expand GENERIC conditions we captured from
- COND_EXPRs. */
- bool expand_generic_cond_exprs_p
- = (!is_predicate
- /* But avoid doing that if the GENERIC condition is
- valid - which it is in the first operand of COND_EXPRs
- and VEC_COND_EXRPs. */
- && ((!(*opr == COND_EXPR)
- && !(*opr == VEC_COND_EXPR))
- || j != 0));
+ COND_EXPRs and we need to unshare them when substituting
+ into COND_EXPRs. */
+ int cond_handling = 0;
+ if (!is_predicate)
+ cond_handling = ((*opr == COND_EXPR
+ || *opr == VEC_COND_EXPR) && j == 0) ? 1 : 2;
e->ops[j]->gen_transform (f, indent, dest, true, 1, optype,
- &cinfo,
- indexes, expand_generic_cond_exprs_p);
+ &cinfo, indexes, cond_handling);
}
/* Re-fold the toplevel result. It's basically an embedded
@@ -3068,7 +3072,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
|| result->type == operand::OP_C_EXPR)
{
result->gen_transform (f, indent, "res_ops[0]", true, 1, "type",
- &cinfo, indexes, false);
+ &cinfo, indexes);
fprintf_indent (f, indent, "*res_code = TREE_CODE (res_ops[0]);\n");
if (is_a <capture *> (result)
&& cinfo.info[as_a <capture *> (result)->where].cond_expr_cond_p)
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index f8b8ef46dc5..47e42660fcc 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -4037,7 +4037,7 @@ match_pattern_2 (state *s, md_rtx_info *info, position *pos, rtx pattern)
/* Check the mode first, to distinguish things like SImode
and DImode register_operands, as described above. */
machine_mode mode = GET_MODE (e->pattern);
- if (safe_predicate_mode (pred, mode))
+ if (pred && safe_predicate_mode (pred, mode))
s = add_decision (s, rtx_test::mode (e->pos), mode, true);
/* Assign to operands[] first, so that the rtx usually doesn't
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index 3e6d15f1b36..c86a4ffb0e3 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "internal-fn.h"
#include "case-cfn-macros.h"
+#include "gimplify.h"
/* Forward declarations of the private auto-generated matchers.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index b331e410a3c..b9757db4c89 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1414,7 +1414,10 @@ force_labels_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
if (TYPE_P (*tp))
*walk_subtrees = 0;
if (TREE_CODE (*tp) == LABEL_DECL)
- FORCED_LABEL (*tp) = 1;
+ {
+ FORCED_LABEL (*tp) = 1;
+ cfun->has_forced_label_in_static = 1;
+ }
return NULL_TREE;
}
@@ -4838,7 +4841,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
}
notice_special_calls (call_stmt);
if (!gimple_call_noreturn_p (call_stmt)
- || TREE_ADDRESSABLE (TREE_TYPE (*to_p)))
+ || TREE_ADDRESSABLE (TREE_TYPE (*to_p))
+ || TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (*to_p))) != INTEGER_CST)
gimple_call_set_lhs (call_stmt, *to_p);
assign = call_stmt;
}
@@ -4846,6 +4850,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
{
assign = gimple_build_assign (*to_p, *from_p);
gimple_set_location (assign, EXPR_LOCATION (*expr_p));
+ if (COMPARISON_CLASS_P (*from_p))
+ gimple_set_no_warning (assign, TREE_NO_WARNING (*from_p));
}
if (gimplify_ctxp->into_ssa && is_gimple_reg (*to_p))
@@ -5185,6 +5191,32 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
ret = tret;
}
+ /* If the constraint does not allow memory make sure we gimplify
+ it to a register if it is not already but its base is. This
+ happens for complex and vector components. */
+ if (!allows_mem)
+ {
+ tree op = TREE_VALUE (link);
+ if (! is_gimple_val (op)
+ && is_gimple_reg_type (TREE_TYPE (op))
+ && is_gimple_reg (get_base_address (op)))
+ {
+ tree tem = create_tmp_reg (TREE_TYPE (op));
+ tree ass;
+ if (is_inout)
+ {
+ ass = build2 (MODIFY_EXPR, TREE_TYPE (tem),
+ tem, unshare_expr (op));
+ gimplify_and_add (ass, pre_p);
+ }
+ ass = build2 (MODIFY_EXPR, TREE_TYPE (tem), op, tem);
+ gimplify_and_add (ass, post_p);
+
+ TREE_VALUE (link) = tem;
+ tret = GS_OK;
+ }
+ }
+
vec_safe_push (outputs, link);
TREE_CHAIN (link) = NULL_TREE;
@@ -8190,7 +8222,7 @@ gimplify_oacc_declare_1 (tree clause)
case GOMP_MAP_ALLOC:
case GOMP_MAP_FORCE_ALLOC:
case GOMP_MAP_FORCE_TO:
- new_op = GOMP_MAP_FORCE_DEALLOC;
+ new_op = GOMP_MAP_DELETE;
ret = true;
break;
@@ -10795,8 +10827,23 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
goto expr_2;
}
- case FMA_EXPR:
case VEC_COND_EXPR:
+ {
+ enum gimplify_status r0, r1, r2;
+
+ r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_condexpr, fb_rvalue);
+ r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ r2 = gimplify_expr (&TREE_OPERAND (*expr_p, 2), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+
+ ret = MIN (MIN (r0, r1), r2);
+ recalculate_side_effects (*expr_p);
+ }
+ break;
+
+ case FMA_EXPR:
case VEC_PERM_EXPR:
/* Classified as tcc_expression. */
goto expr_3;
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 03b1c49d728..7615842b332 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -273,8 +273,10 @@ trivially_empty_bb_p (basic_block bb)
static inline bool
same_close_phi_node (gphi *p1, gphi *p2)
{
- return operand_equal_p (gimple_phi_arg_def (p1, 0),
- gimple_phi_arg_def (p2, 0), 0);
+ return (types_compatible_p (TREE_TYPE (gimple_phi_result (p1)),
+ TREE_TYPE (gimple_phi_result (p2)))
+ && operand_equal_p (gimple_phi_arg_def (p1, 0),
+ gimple_phi_arg_def (p2, 0), 0));
}
static void make_close_phi_nodes_unique (basic_block bb);
@@ -834,7 +836,9 @@ scop_detection::merge_sese (sese_l first, sese_l second) const
{
/* Find the first empty succ (with single exit) of combined.exit. */
basic_block imm_succ = combined.exit->dest;
- if (single_succ_p (imm_succ) && trivially_empty_bb_p (imm_succ))
+ if (single_succ_p (imm_succ)
+ && single_pred_p (imm_succ)
+ && trivially_empty_bb_p (imm_succ))
combined.exit = single_succ_edge (imm_succ);
else
{
diff --git a/gcc/hsa-brig.c b/gcc/hsa-brig.c
index 2a301be8106..9b6c0b888e0 100644
--- a/gcc/hsa-brig.c
+++ b/gcc/hsa-brig.c
@@ -643,6 +643,8 @@ emit_function_directives (hsa_function_representation *f, bool is_declaration)
if (!f->m_declaration_p)
for (int i = 0; f->m_global_symbols.iterate (i, &sym); i++)
{
+ gcc_assert (!sym->m_emitted_to_brig);
+ sym->m_emitted_to_brig = true;
emit_directive_variable (sym);
brig_insn_count++;
}
diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c
index c5f1f69cd39..b69b34d8ff0 100644
--- a/gcc/hsa-dump.c
+++ b/gcc/hsa-dump.c
@@ -721,6 +721,9 @@ dump_hsa_symbol (FILE *f, hsa_symbol *symbol)
if (symbol->m_type & BRIG_TYPE_ARRAY_MASK)
fprintf (f, "[%lu]", (unsigned long) symbol->m_dim);
+
+ if (symbol->m_directive_offset)
+ fprintf (f, " /* BRIG offset: %u */", symbol->m_directive_offset);
}
/* Dump textual representation of HSA IL operand OP to file F. */
@@ -929,7 +932,8 @@ dump_hsa_insn_1 (FILE *f, hsa_insn_basic *insn, int *indent)
fprintf (f, ", ");
}
- fprintf (f, "]");
+ fprintf (f, "] /* default: BB %i */",
+ hsa_bb_for_bb (sbr->m_default_bb)->m_index);
}
else if (is_a <hsa_insn_arg_block *> (insn))
{
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 5939a577f3f..72eecf9462e 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -162,7 +162,7 @@ hsa_symbol::hsa_symbol ()
m_directive_offset (0), m_type (BRIG_TYPE_NONE),
m_segment (BRIG_SEGMENT_NONE), m_linkage (BRIG_LINKAGE_NONE), m_dim (0),
m_cst_value (NULL), m_global_scope_p (false), m_seen_error (false),
- m_allocation (BRIG_ALLOCATION_AUTOMATIC)
+ m_allocation (BRIG_ALLOCATION_AUTOMATIC), m_emitted_to_brig (false)
{
}
@@ -174,7 +174,7 @@ hsa_symbol::hsa_symbol (BrigType16_t type, BrigSegment8_t segment,
m_directive_offset (0), m_type (type), m_segment (segment),
m_linkage (linkage), m_dim (0), m_cst_value (NULL),
m_global_scope_p (global_scope_p), m_seen_error (false),
- m_allocation (allocation)
+ m_allocation (allocation), m_emitted_to_brig (false)
{
}
@@ -880,11 +880,28 @@ get_symbol_for_decl (tree decl)
gcc_checking_assert (slot);
if (*slot)
{
+ hsa_symbol *sym = (*slot);
+
/* If the symbol is problematic, mark current function also as
problematic. */
- if ((*slot)->m_seen_error)
+ if (sym->m_seen_error)
hsa_fail_cfun ();
+ /* PR hsa/70234: If a global variable was marked to be emitted,
+ but HSAIL generation of a function using the variable fails,
+ we should retry to emit the variable in context of a different
+ function.
+
+ Iterate elements whether a symbol is already in m_global_symbols
+ of not. */
+ if (is_in_global_vars && !sym->m_emitted_to_brig)
+ {
+ for (unsigned i = 0; i < hsa_cfun->m_global_symbols.length (); i++)
+ if (hsa_cfun->m_global_symbols[i] == sym)
+ return *slot;
+ hsa_cfun->m_global_symbols.safe_push (sym);
+ }
+
return *slot;
}
else
diff --git a/gcc/hsa.h b/gcc/hsa.h
index 6a7c651ce9b..1d6baaba9b5 100644
--- a/gcc/hsa.h
+++ b/gcc/hsa.h
@@ -110,6 +110,9 @@ struct hsa_symbol
/* Symbol allocation. */
BrigAllocation m_allocation;
+ /* Flag used for global variables if a variable is already emitted or not. */
+ bool m_emitted_to_brig;
+
private:
/* Default constructor. */
hsa_symbol ();
diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c
index 4a6b43e7a8a..5f5df6483a7 100644
--- a/gcc/ipa-chkp.c
+++ b/gcc/ipa-chkp.c
@@ -470,7 +470,7 @@ chkp_instrumentable_p (tree fndecl)
return (!lookup_attribute ("bnd_legacy", DECL_ATTRIBUTES (fndecl))
&& (!flag_chkp_instrument_marked_only
|| lookup_attribute ("bnd_instrument", DECL_ATTRIBUTES (fndecl)))
- && (!fn || !copy_forbidden (fn, fndecl)));
+ && (!fn || !copy_forbidden (fn)));
}
/* Return clone created for instrumentation of NODE or NULL. */
@@ -644,22 +644,22 @@ chkp_versioning (void)
FOR_EACH_DEFINED_FUNCTION (node)
{
+ tree decl = node->decl;
if (!node->instrumentation_clone
&& !node->instrumented_version
&& !node->alias
&& !node->thunk.thunk_p
- && (!DECL_BUILT_IN (node->decl)
- || (DECL_BUILT_IN_CLASS (node->decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (node->decl) < BEGIN_CHKP_BUILTINS)))
+ && (!DECL_BUILT_IN (decl)
+ || (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) < BEGIN_CHKP_BUILTINS)))
{
- if (chkp_instrumentable_p (node->decl))
- chkp_maybe_create_clone (node->decl);
- else if ((reason = copy_forbidden (DECL_STRUCT_FUNCTION (node->decl),
- node->decl)))
+ if (chkp_instrumentable_p (decl))
+ chkp_maybe_create_clone (decl);
+ else if ((reason = copy_forbidden (DECL_STRUCT_FUNCTION (decl))))
{
- if (warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wchkp,
+ if (warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wchkp,
"function cannot be instrumented"))
- inform (DECL_SOURCE_LOCATION (node->decl), reason, node->decl);
+ inform (DECL_SOURCE_LOCATION (decl), reason, decl);
}
}
}
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index e4fb56210f6..069495105bf 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -705,6 +705,29 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
return odr_types_equivalent_p (t1, t2, false, NULL, visited, loc1, loc2);
}
+/* Return true if DECL1 and DECL2 are identical methods. Consider
+ name equivalent to name.localalias.xyz. */
+
+static bool
+methods_equal_p (tree decl1, tree decl2)
+{
+ if (DECL_ASSEMBLER_NAME (decl1) == DECL_ASSEMBLER_NAME (decl2))
+ return true;
+ const char sep = symbol_table::symbol_suffix_separator ();
+
+ const char *name1 = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl1));
+ const char *ptr1 = strchr (name1, sep);
+ int len1 = ptr1 ? ptr1 - name1 : strlen (name1);
+
+ const char *name2 = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl2));
+ const char *ptr2 = strchr (name2, sep);
+ int len2 = ptr2 ? ptr2 - name2 : strlen (name2);
+
+ if (len1 != len2)
+ return false;
+ return !strncmp (name1, name2, len1);
+}
+
/* Compare two virtual tables, PREVAILING and VTABLE and output ODR
violation warnings. */
@@ -758,8 +781,8 @@ compare_virtual_tables (varpool_node *prevailing, varpool_node *vtable)
accept the other case. */
while (!end2
&& (end1
- || (DECL_ASSEMBLER_NAME (ref1->referred->decl)
- != DECL_ASSEMBLER_NAME (ref2->referred->decl)
+ || (methods_equal_p (ref1->referred->decl,
+ ref2->referred->decl)
&& TREE_CODE (ref1->referred->decl) == FUNCTION_DECL))
&& TREE_CODE (ref2->referred->decl) != FUNCTION_DECL)
{
@@ -785,8 +808,7 @@ compare_virtual_tables (varpool_node *prevailing, varpool_node *vtable)
}
while (!end1
&& (end2
- || (DECL_ASSEMBLER_NAME (ref2->referred->decl)
- != DECL_ASSEMBLER_NAME (ref1->referred->decl)
+ || (methods_equal_p (ref2->referred->decl, ref1->referred->decl)
&& TREE_CODE (ref2->referred->decl) == FUNCTION_DECL))
&& TREE_CODE (ref1->referred->decl) != FUNCTION_DECL)
{
@@ -823,8 +845,7 @@ compare_virtual_tables (varpool_node *prevailing, varpool_node *vtable)
if (!end1 && !end2)
{
- if (DECL_ASSEMBLER_NAME (ref1->referred->decl)
- == DECL_ASSEMBLER_NAME (ref2->referred->decl))
+ if (methods_equal_p (ref1->referred->decl, ref2->referred->decl))
continue;
class_type->odr_violated = true;
@@ -920,11 +941,14 @@ compare_virtual_tables (varpool_node *prevailing, varpool_node *vtable)
"unit");
gcc_assert (TREE_CODE (ref2->referred->decl)
== FUNCTION_DECL);
- inform (DECL_SOURCE_LOCATION (ref1->referred->decl),
- "virtual method %qD", ref1->referred->decl);
- inform (DECL_SOURCE_LOCATION (ref2->referred->decl),
+ inform (DECL_SOURCE_LOCATION
+ (ref1->referred->ultimate_alias_target ()->decl),
+ "virtual method %qD",
+ ref1->referred->ultimate_alias_target ()->decl);
+ inform (DECL_SOURCE_LOCATION
+ (ref2->referred->ultimate_alias_target ()->decl),
"ought to match virtual method %qD but does not",
- ref2->referred->decl);
+ ref2->referred->ultimate_alias_target ()->decl);
}
else
inform (DECL_SOURCE_LOCATION
@@ -3178,10 +3202,10 @@ possible_polymorphic_call_targets (tree otr_type,
if (!outer_type->all_derivations_known)
{
if (!speculative && final_warning_records
+ && nodes.length () == 1
&& TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
{
if (complete
- && nodes.length () == 1
&& warn_suggest_final_types
&& !outer_type->derived_types.length ())
{
@@ -3197,7 +3221,6 @@ possible_polymorphic_call_targets (tree otr_type,
}
if (complete
&& warn_suggest_final_methods
- && nodes.length () == 1
&& types_same_for_odr (DECL_CONTEXT (nodes[0]->decl),
outer_type->type))
{
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index d82eb879d05..aa6589c16e1 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1697,6 +1697,11 @@ sem_function::parse (cgraph_node *node, bitmap_obstack *stack)
if (lookup_attribute_by_prefix ("omp ", DECL_ATTRIBUTES (node->decl)) != NULL)
return NULL;
+ /* PR ipa/70306. */
+ if (DECL_STATIC_CONSTRUCTOR (node->decl)
+ || DECL_STATIC_DESTRUCTOR (node->decl))
+ return NULL;
+
sem_function *f = new sem_function (node, 0, stack);
f->init ();
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 5dc0b5af287..f966fb00ffb 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -329,8 +329,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
{
struct gcc_options opts = global_options;
- cl_optimization_restore (&opts,
- TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)));
+ cl_optimization_restore (&opts, opts_for_fn (to->decl));
opts.x_flag_strict_aliasing = false;
if (dump_file)
fprintf (dump_file, "Dropping flag_strict_aliasing on %s:%i\n",
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 842ca13cd06..0ebbd4ae66d 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dfa.h"
#include "gimple-pretty-print.h"
#include "tree-into-ssa.h"
+#include "params.h"
/* Return true when TYPE contains an polymorphic type and thus is interesting
for devirtualization machinery. */
@@ -1094,14 +1095,15 @@ struct type_change_info
tree known_current_type;
HOST_WIDE_INT known_current_offset;
+ /* Set to nonzero if we possibly missed some dynamic type changes and we
+ should consider the set to be speculative. */
+ unsigned speculative;
+
/* Set to true if dynamic type change has been detected. */
bool type_maybe_changed;
/* Set to true if multiple types have been encountered. known_current_type
must be disregarded in that case. */
bool multiple_types_encountered;
- /* Set to true if we possibly missed some dynamic type changes and we should
- consider the set to be speculative. */
- bool speculative;
bool seen_unanalyzed_store;
};
@@ -1338,6 +1340,19 @@ record_known_type (struct type_change_info *tci, tree type, HOST_WIDE_INT offset
tci->type_maybe_changed = true;
}
+
+/* The maximum number of may-defs we visit when looking for a must-def
+ that changes the dynamic type in check_stmt_for_type_change. Tuned
+ after the PR12392 testcase which unlimited spends 40% time within
+ these alias walks and 8% with the following limit. */
+
+static inline bool
+csftc_abort_walking_p (unsigned speculative)
+{
+ unsigned max = PARAM_VALUE (PARAM_MAX_SPECULATIVE_DEVIRT_MAYDEFS);
+ return speculative > max ? true : false;
+}
+
/* Callback of walk_aliased_vdefs and a helper function for
detect_type_change to check whether a particular statement may modify
the virtual table pointer, and if possible also determine the new type of
@@ -1384,15 +1399,15 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
&size, &max_size, &reverse);
if (size != max_size || max_size == -1)
{
- tci->speculative = true;
- return false;
+ tci->speculative++;
+ return csftc_abort_walking_p (tci->speculative);
}
if (op && TREE_CODE (op) == MEM_REF)
{
if (!tree_fits_shwi_p (TREE_OPERAND (op, 1)))
{
- tci->speculative = true;
- return false;
+ tci->speculative++;
+ return csftc_abort_walking_p (tci->speculative);
}
offset += tree_to_shwi (TREE_OPERAND (op, 1))
* BITS_PER_UNIT;
@@ -1402,8 +1417,8 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
;
else
{
- tci->speculative = true;
- return false;
+ tci->speculative++;
+ return csftc_abort_walking_p (tci->speculative);
}
op = walk_ssa_copies (op);
}
@@ -1438,8 +1453,8 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
fprintf (dump_file, " Function call may change dynamic type:");
print_gimple_stmt (dump_file, stmt, 0, 0);
}
- tci->speculative = true;
- return false;
+ tci->speculative++;
+ return csftc_abort_walking_p (tci->speculative);
}
/* Check for inlined virtual table store. */
else if (noncall_stmt_may_be_vtbl_ptr_store (stmt))
@@ -1461,7 +1476,7 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
if (dump_file)
fprintf (dump_file, " Unanalyzed store may change type.\n");
tci->seen_unanalyzed_store = true;
- tci->speculative = true;
+ tci->speculative++;
}
else
record_known_type (tci, type, offset);
@@ -1646,7 +1661,7 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance,
tci.otr_type = otr_type;
tci.type_maybe_changed = false;
tci.multiple_types_encountered = false;
- tci.speculative = false;
+ tci.speculative = 0;
tci.seen_unanalyzed_store = false;
walk_aliased_vdefs (&ao, gimple_vuse (stmt), check_stmt_for_type_change,
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d62c70405db..65482bad366 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -1639,11 +1639,11 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
unsigned HOST_WIDE_INT hwi_bitpos;
unsigned align;
- if (get_pointer_alignment_1 (arg, &align, &hwi_bitpos)
+ get_pointer_alignment_1 (arg, &align, &hwi_bitpos);
+ if (align > BITS_PER_UNIT
&& align % BITS_PER_UNIT == 0
&& hwi_bitpos % BITS_PER_UNIT == 0)
{
- gcc_checking_assert (align != 0);
jfunc->alignment.known = true;
jfunc->alignment.align = align / BITS_PER_UNIT;
jfunc->alignment.misalign = hwi_bitpos / BITS_PER_UNIT;
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 1e4c64fa940..fba8da4bd4f 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -2728,6 +2728,37 @@ allocno_cost_compare_func (const void *v1p, const void *v2p)
return ALLOCNO_NUM (p1) - ALLOCNO_NUM (p2);
}
+/* Return savings on removed copies when ALLOCNO is assigned to
+ HARD_REGNO. */
+static int
+allocno_copy_cost_saving (ira_allocno_t allocno, int hard_regno)
+{
+ int cost = 0;
+ enum reg_class rclass;
+ ira_copy_t cp, next_cp;
+
+ rclass = REGNO_REG_CLASS (hard_regno);
+ for (cp = ALLOCNO_COPIES (allocno); cp != NULL; cp = next_cp)
+ {
+ if (cp->first == allocno)
+ {
+ next_cp = cp->next_first_allocno_copy;
+ if (ALLOCNO_HARD_REGNO (cp->second) != hard_regno)
+ continue;
+ }
+ else if (cp->second == allocno)
+ {
+ next_cp = cp->next_second_allocno_copy;
+ if (ALLOCNO_HARD_REGNO (cp->first) != hard_regno)
+ continue;
+ }
+ else
+ gcc_unreachable ();
+ cost += cp->freq * ira_register_move_cost[ALLOCNO_MODE (allocno)][rclass][rclass];
+ }
+ return cost;
+}
+
/* We used Chaitin-Briggs coloring to assign as many pseudos as
possible to hard registers. Let us try to improve allocation with
cost point of view. This function improves the allocation by
@@ -2768,9 +2799,7 @@ improve_allocation (void)
continue;
check++;
aclass = ALLOCNO_CLASS (a);
- allocno_costs = ALLOCNO_UPDATED_HARD_REG_COSTS (a);
- if (allocno_costs == NULL)
- allocno_costs = ALLOCNO_HARD_REG_COSTS (a);
+ allocno_costs = ALLOCNO_HARD_REG_COSTS (a);
if ((hregno = ALLOCNO_HARD_REGNO (a)) < 0)
base_cost = ALLOCNO_UPDATED_MEMORY_COST (a);
else if (allocno_costs == NULL)
@@ -2779,7 +2808,8 @@ improve_allocation (void)
case). */
continue;
else
- base_cost = allocno_costs[ira_class_hard_reg_index[aclass][hregno]];
+ base_cost = (allocno_costs[ira_class_hard_reg_index[aclass][hregno]]
+ - allocno_copy_cost_saving (a, hregno));
try_p = false;
get_conflict_and_start_profitable_regs (a, false,
conflicting_regs,
@@ -2797,6 +2827,7 @@ improve_allocation (void)
k = allocno_costs == NULL ? 0 : j;
costs[hregno] = (allocno_costs == NULL
? ALLOCNO_UPDATED_CLASS_COST (a) : allocno_costs[k]);
+ costs[hregno] -= allocno_copy_cost_saving (a, hregno);
costs[hregno] -= base_cost;
if (costs[hregno] < 0)
try_p = true;
@@ -2835,14 +2866,13 @@ improve_allocation (void)
k = (ira_class_hard_reg_index
[ALLOCNO_CLASS (conflict_a)][conflict_hregno]);
ira_assert (k >= 0);
- if ((allocno_costs = ALLOCNO_UPDATED_HARD_REG_COSTS (conflict_a))
+ if ((allocno_costs = ALLOCNO_HARD_REG_COSTS (conflict_a))
!= NULL)
spill_cost -= allocno_costs[k];
- else if ((allocno_costs = ALLOCNO_HARD_REG_COSTS (conflict_a))
- != NULL)
- spill_cost -= allocno_costs[k];
else
spill_cost -= ALLOCNO_UPDATED_CLASS_COST (conflict_a);
+ spill_cost
+ += allocno_copy_cost_saving (conflict_a, conflict_hregno);
conflict_nregs
= hard_regno_nregs[conflict_hregno][ALLOCNO_MODE (conflict_a)];
for (r = conflict_hregno;
diff --git a/gcc/ira.c b/gcc/ira.c
index 5e7a2edf3b4..c12318a6227 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3225,13 +3225,18 @@ memref_referenced_p (rtx memref, rtx x)
}
/* TRUE if some insn in the range (START, END] references a memory location
- that would be affected by a store to MEMREF. */
+ that would be affected by a store to MEMREF.
+
+ Callers should not call this routine if START is after END in the
+ RTL chain. */
+
static int
memref_used_between_p (rtx memref, rtx_insn *start, rtx_insn *end)
{
rtx_insn *insn;
- for (insn = NEXT_INSN (start); insn != NEXT_INSN (end);
+ for (insn = NEXT_INSN (start);
+ insn && insn != NEXT_INSN (end);
insn = NEXT_INSN (insn))
{
if (!NONDEBUG_INSN_P (insn))
@@ -3245,6 +3250,7 @@ memref_used_between_p (rtx memref, rtx_insn *start, rtx_insn *end)
return 1;
}
+ gcc_assert (insn == NEXT_INSN (end));
return 0;
}
@@ -3337,6 +3343,7 @@ update_equiv_regs (void)
int loop_depth;
bitmap cleared_regs;
bool *pdx_subregs;
+ bitmap_head seen_insns;
/* Use pdx_subregs to show whether a reg is used in a paradoxical
subreg. */
@@ -3606,11 +3613,14 @@ update_equiv_regs (void)
/* A second pass, to gather additional equivalences with memory. This needs
to be done after we know which registers we are going to replace. */
+ bitmap_initialize (&seen_insns, NULL);
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
rtx set, src, dest;
unsigned regno;
+ bitmap_set_bit (&seen_insns, INSN_UID (insn));
+
if (! INSN_P (insn))
continue;
@@ -3651,6 +3661,7 @@ update_equiv_regs (void)
rtx_insn *init_insn =
as_a <rtx_insn *> (XEXP (reg_equiv[regno].init_insns, 0));
if (validate_equiv_mem (init_insn, src, dest)
+ && bitmap_bit_p (&seen_insns, INSN_UID (init_insn))
&& ! memref_used_between_p (dest, init_insn, insn)
/* Attaching a REG_EQUIV note will fail if INIT_INSN has
multiple sets. */
@@ -3661,9 +3672,15 @@ update_equiv_regs (void)
ira_reg_equiv[regno].init_insns
= gen_rtx_INSN_LIST (VOIDmode, insn, NULL_RTX);
df_notes_rescan (init_insn);
+ if (dump_file)
+ fprintf (dump_file,
+ "Adding REG_EQUIV to insn %d for source of insn %d\n",
+ INSN_UID (init_insn),
+ INSN_UID (insn));
}
}
}
+ bitmap_clear (&seen_insns);
cleared_regs = BITMAP_ALLOC (NULL);
/* Now scan all regs killed in an insn to see if any of them are
@@ -3842,7 +3859,8 @@ update_equiv_regs (void)
free (pdx_subregs);
}
-/* A pass over indirect jumps, converting simple cases to direct jumps. */
+/* A pass over indirect jumps, converting simple cases to direct jumps.
+ Combine does this optimization too, but only within a basic block. */
static void
indirect_jump_optimize (void)
{
@@ -3862,14 +3880,23 @@ indirect_jump_optimize (void)
int regno = REGNO (SET_SRC (x));
if (DF_REG_DEF_COUNT (regno) == 1)
{
- rtx_insn *def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (regno));
- rtx note = find_reg_note (def_insn, REG_LABEL_OPERAND, NULL_RTX);
-
- if (note)
+ df_ref def = DF_REG_DEF_CHAIN (regno);
+ if (!DF_REF_IS_ARTIFICIAL (def))
{
- rtx lab = gen_rtx_LABEL_REF (Pmode, XEXP (note, 0));
- if (validate_replace_rtx (SET_SRC (x), lab, insn))
- rebuild_p = true;
+ rtx_insn *def_insn = DF_REF_INSN (def);
+ rtx note = find_reg_note (def_insn, REG_LABEL_OPERAND, NULL_RTX);
+
+ if (note)
+ {
+ /* Substitute a LABEL_REF to the label given by the
+ note rather than using SET_SRC of DEF_INSN.
+ DEF_INSN might be loading the label constant from
+ a constant pool, which isn't what we want in a
+ direct branch. */
+ rtx lab = gen_rtx_LABEL_REF (Pmode, XEXP (note, 0));
+ if (validate_replace_rtx (SET_SRC (x), lab, insn))
+ rebuild_p = true;
+ }
}
}
}
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 5432d0597c5..f7b3ac4170e 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -614,7 +614,8 @@ simplify_subreg_concatn (machine_mode outermode, rtx op,
innermode = GET_MODE (op);
gcc_assert (byte < GET_MODE_SIZE (innermode));
- gcc_assert (GET_MODE_SIZE (outermode) <= GET_MODE_SIZE (innermode));
+ if (GET_MODE_SIZE (outermode) > GET_MODE_SIZE (innermode))
+ return NULL_RTX;
inner_size = GET_MODE_SIZE (innermode) / XVECLEN (op, 0);
part = XVECEXP (op, 0, byte / inner_size);
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 171ed657c85..4883eefc532 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -4982,7 +4982,12 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
nregs = 1;
mode = lra_reg_info[hard_regno].biggest_mode;
machine_mode reg_rtx_mode = GET_MODE (regno_reg_rtx[hard_regno]);
- if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (reg_rtx_mode))
+ /* A reg can have a biggest_mode of VOIDmode if it was only ever seen
+ as part of a multi-word register. In that case, or if the biggest
+ mode was larger than a register, just use the reg_rtx. Otherwise,
+ limit the size to that of the biggest access in the function. */
+ if (mode == VOIDmode
+ || GET_MODE_SIZE (mode) > GET_MODE_SIZE (reg_rtx_mode))
{
original_reg = regno_reg_rtx[hard_regno];
mode = reg_rtx_mode;
@@ -5868,7 +5873,7 @@ delete_move_and_clobber (rtx_insn *insn, int dregno)
rtx_insn *prev_insn = PREV_INSN (insn);
lra_set_insn_deleted (insn);
- lra_assert (dregno > 0);
+ lra_assert (dregno >= 0);
if (prev_insn != NULL && NONDEBUG_INSN_P (prev_insn)
&& GET_CODE (PATTERN (prev_insn)) == CLOBBER
&& dregno == get_regno (XEXP (PATTERN (prev_insn), 0)))
diff --git a/gcc/lra.c b/gcc/lra.c
index a6ce36529f8..a724ef782c2 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -1967,6 +1967,10 @@ restore_scratches (void)
for (i = 0; scratches.iterate (i, &loc); i++)
{
+ /* Ignore already deleted insns. */
+ if (NOTE_P (loc->insn)
+ && NOTE_KIND (loc->insn) == NOTE_INSN_DELETED)
+ continue;
if (last != loc->insn)
{
last = loc->insn;
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 48a1c868bac..dd48777effa 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1008,6 +1008,7 @@ input_struct_function_base (struct function *fn, struct data_in *data_in,
fn->after_inlining = bp_unpack_value (&bp, 1);
fn->stdarg = bp_unpack_value (&bp, 1);
fn->has_nonlocal_label = bp_unpack_value (&bp, 1);
+ fn->has_forced_label_in_static = bp_unpack_value (&bp, 1);
fn->calls_alloca = bp_unpack_value (&bp, 1);
fn->calls_setjmp = bp_unpack_value (&bp, 1);
fn->has_force_vectorize_loops = bp_unpack_value (&bp, 1);
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 997a28b0159..6703d4106de 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2014,6 +2014,7 @@ output_struct_function_base (struct output_block *ob, struct function *fn)
bp_pack_value (&bp, fn->after_inlining, 1);
bp_pack_value (&bp, fn->stdarg, 1);
bp_pack_value (&bp, fn->has_nonlocal_label, 1);
+ bp_pack_value (&bp, fn->has_forced_label_in_static, 1);
bp_pack_value (&bp, fn->calls_alloca, 1);
bp_pack_value (&bp, fn->calls_setjmp, 1);
bp_pack_value (&bp, fn->has_force_vectorize_loops, 1);
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 7a298d6edf0..dbb69a2e076 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR lto/70258
+ * lto-lang.c (lto_post_options): Set flag_pic to flag_pie for
+ PIE.
+
2016-03-08 Jakub Jelinek <jakub@redhat.com>
* lto-symtab.h (lto_symtab_prevail_decl): Fix spelling
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 691e9e20905..b5efe3aab7e 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -836,7 +836,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* If -fPIC or -fPIE was used at compile time, be sure that
flag_pie is 2. */
flag_pie = MAX (flag_pie, flag_pic);
- flag_pic = 0;
+ flag_pic = flag_pie;
break;
case LTO_LINKER_OUTPUT_EXEC: /* Normal executable */
diff --git a/gcc/match.pd b/gcc/match.pd
index 112deb3abbd..c0ed305ed0e 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1752,26 +1752,26 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(cnd (logical_inverted_value truth_valued_p@0) @1 @2)
(cnd @0 @2 @1)))
-/* A + (B vcmp C ? 1 : 0) -> A - (B vcmp C), since vector comparisons
- return all-1 or all-0 results. */
+/* A + (B vcmp C ? 1 : 0) -> A - (B vcmp C ? -1 : 0), since vector comparisons
+ return all -1 or all 0 results. */
/* ??? We could instead convert all instances of the vec_cond to negate,
but that isn't necessarily a win on its own. */
(simplify
- (plus:c @3 (view_convert? (vec_cond @0 integer_each_onep@1 integer_zerop@2)))
+ (plus:c @3 (view_convert? (vec_cond:s @0 integer_each_onep@1 integer_zerop@2)))
(if (VECTOR_TYPE_P (type)
- && TYPE_VECTOR_SUBPARTS (type) == TYPE_VECTOR_SUBPARTS (TREE_TYPE (@0))
+ && TYPE_VECTOR_SUBPARTS (type) == TYPE_VECTOR_SUBPARTS (TREE_TYPE (@1))
&& (TYPE_MODE (TREE_TYPE (type))
- == TYPE_MODE (TREE_TYPE (TREE_TYPE (@0)))))
- (minus @3 (view_convert @0))))
+ == TYPE_MODE (TREE_TYPE (TREE_TYPE (@1)))))
+ (minus @3 (view_convert (vec_cond @0 (negate @1) @2)))))
-/* ... likewise A - (B vcmp C ? 1 : 0) -> A + (B vcmp C). */
+/* ... likewise A - (B vcmp C ? 1 : 0) -> A + (B vcmp C ? -1 : 0). */
(simplify
- (minus @3 (view_convert? (vec_cond @0 integer_each_onep@1 integer_zerop@2)))
+ (minus @3 (view_convert? (vec_cond:s @0 integer_each_onep@1 integer_zerop@2)))
(if (VECTOR_TYPE_P (type)
- && TYPE_VECTOR_SUBPARTS (type) == TYPE_VECTOR_SUBPARTS (TREE_TYPE (@0))
+ && TYPE_VECTOR_SUBPARTS (type) == TYPE_VECTOR_SUBPARTS (TREE_TYPE (@1))
&& (TYPE_MODE (TREE_TYPE (type))
- == TYPE_MODE (TREE_TYPE (TREE_TYPE (@0)))))
- (plus @3 (view_convert @0))))
+ == TYPE_MODE (TREE_TYPE (TREE_TYPE (@1)))))
+ (plus @3 (view_convert (vec_cond @0 (negate @1) @2)))))
/* Simplifications of comparisons. */
@@ -1864,7 +1864,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(simplify
(cmp @0 @0)
(if (! FLOAT_TYPE_P (TREE_TYPE (@0))
- || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (@0))))
+ || ! HONOR_NANS (@0))
{ constant_boolean_node (true, type); }
(if (cmp != EQ_EXPR)
(eq @0 @0)))))
@@ -1873,7 +1873,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(cmp @0 @0)
(if (cmp != NE_EXPR
|| ! FLOAT_TYPE_P (TREE_TYPE (@0))
- || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (@0))))
+ || ! HONOR_NANS (@0))
{ constant_boolean_node (false, type); })))
(for cmp (unle unge uneq)
(simplify
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 82dec9d09b4..3fd6eb304b6 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -15746,7 +15746,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
case GOMP_MAP_TOFROM:
case GOMP_MAP_POINTER:
case GOMP_MAP_TO_PSET:
- case GOMP_MAP_FORCE_DEALLOC:
+ case GOMP_MAP_DELETE:
case GOMP_MAP_RELEASE:
case GOMP_MAP_ALWAYS_TO:
case GOMP_MAP_ALWAYS_FROM:
diff --git a/gcc/opts.c b/gcc/opts.c
index 2f453122b09..0f9431a0b32 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -766,13 +766,18 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
default value. */
if (opts->x_flag_pie == -1)
{
- if (opts->x_flag_pic == 0)
+ /* We initialize opts->x_flag_pic to -1 so that we can tell if
+ -fpic, -fPIC, -fno-pic or -fno-PIC is used. */
+ if (opts->x_flag_pic == -1)
opts->x_flag_pie = DEFAULT_FLAG_PIE;
else
opts->x_flag_pie = 0;
}
+ /* If -fPIE or -fpie is used, turn on PIC. */
if (opts->x_flag_pie)
opts->x_flag_pic = opts->x_flag_pie;
+ else if (opts->x_flag_pic == -1)
+ opts->x_flag_pic = 0;
if (opts->x_flag_pic && !opts->x_flag_pie)
opts->x_flag_shlib = 1;
opts->x_flag_opts_finished = true;
diff --git a/gcc/params.def b/gcc/params.def
index 2ee631d9fc5..dbff305b7f4 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -502,7 +502,7 @@ DEFPARAM(PARAM_LIM_EXPENSIVE,
DEFPARAM(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
"iv-consider-all-candidates-bound",
"Bound on number of candidates below that all candidates are considered in iv optimizations.",
- 30, 0, 0)
+ 40, 0, 0)
/* The induction variable optimizations give up on loops that contain more
induction variable uses. */
@@ -1203,6 +1203,12 @@ DEFPARAM (PARAM_HSA_GEN_DEBUG_STORES,
"hsa-gen-debug-stores",
"Level of hsa debug stores verbosity",
0, 0, 1)
+
+DEFPARAM (PARAM_MAX_SPECULATIVE_DEVIRT_MAYDEFS,
+ "max-speculative-devirt-maydefs",
+ "Maximum number of may-defs visited when devirtualizing "
+ "speculatively", 50, 0, 0)
+
/*
Local variables:
diff --git a/gcc/passes.c b/gcc/passes.c
index 1bf89edc921..9d9025116f4 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2214,7 +2214,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
check_profile_consistency (pass->static_pass_number, 1, true);
if (dump_file)
- do_per_function (execute_function_dump, NULL);
+ do_per_function (execute_function_dump, pass);
pass_fini_dump_file (pass);
current_pass = NULL;
@@ -2351,15 +2351,15 @@ execute_one_pass (opt_pass *pass)
check_profile_consistency (pass->static_pass_number, 1, true);
verify_interpass_invariants ();
- if (dump_file)
- do_per_function (execute_function_dump, pass);
- if (pass->type == IPA_PASS)
+ if (pass->type == IPA_PASS
+ && ((ipa_opt_pass_d *)pass)->function_transform)
{
struct cgraph_node *node;
- if (((ipa_opt_pass_d *)pass)->function_transform)
- FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
- node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass);
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+ node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass);
}
+ else if (dump_file)
+ do_per_function (execute_function_dump, pass);
if (!current_function_decl)
symtab->process_new_functions ();
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 53059c7683b..4a5069f0193 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-17 Joseph Myers <joseph@codesourcery.com>
+
+ * fr.po: Update.
+
2016-03-12 Joseph Myers <joseph@codesourcery.com>
* sv.po: Update.
diff --git a/gcc/po/fr.po b/gcc/po/fr.po
index 80ebf4cde1a..1baca52fd01 100644
--- a/gcc/po/fr.po
+++ b/gcc/po/fr.po
@@ -5,7 +5,7 @@
#
# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996.
# François-Xavier Coudert <fxcoudert@gmail.com>, 2008.
-# Stéphane Aulery <lkppo@free.fr>, 2015.
+# Stéphane Aulery <lkppo@free.fr>, 2015, 2016.
#
# Vocabulaire utilisé
# lvalue = membre gauche
@@ -122,10 +122,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: gcc 5.2.0\n"
+"Project-Id-Version: gcc 6.1-b20160131\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2016-01-31 15:50+0000\n"
-"PO-Revision-Date: 2015-12-30 14:31+0100\n"
+"PO-Revision-Date: 2016-03-17 00:28+0100\n"
"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
"Language-Team: French <traduc@traduc.org>\n"
"Language: fr\n"
@@ -391,185 +391,125 @@ msgid "Options:\n"
msgstr "Options :\n"
#: gcc.c:3384
-#, fuzzy
-#| msgid " -pass-exit-codes Exit with highest error code from a phase\n"
msgid " -pass-exit-codes Exit with highest error code from a phase.\n"
-msgstr " -pass-exit-codes Quitter avec le plus grand code d’erreur d’une phase\n"
+msgstr " -pass-exit-codes Quitter avec le plus grand code d’erreur d’une phase.\n"
#: gcc.c:3385
-#, fuzzy
-#| msgid " --help Display this information\n"
msgid " --help Display this information.\n"
-msgstr " --help Afficher cette aide\n"
+msgstr " --help Afficher cette aide.\n"
#: gcc.c:3386
-#, fuzzy
-#| msgid " --target-help Display target specific command line options\n"
msgid " --target-help Display target specific command line options.\n"
-msgstr " --target-help Afficher les options de ligne de commande spécifiques à la cible\n"
+msgstr " --target-help Afficher les options de ligne de commande spécifiques à la cible.\n"
#: gcc.c:3387
-#, fuzzy
-#| msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]\n"
msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n"
-msgstr " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,…]\n"
+msgstr " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,…].\n"
#: gcc.c:3388
-#, fuzzy
-#| msgid " Display specific types of command line options\n"
msgid " Display specific types of command line options.\n"
-msgstr " Afficher les types spécifiques des options de la ligne de commande\n"
+msgstr " Afficher les types spécifiques des options de la ligne de commande.\n"
#: gcc.c:3390
-#, fuzzy
-#| msgid " (Use '-v --help' to display command line options of sub-processes)\n"
msgid " (Use '-v --help' to display command line options of sub-processes).\n"
-msgstr " (Utiliser « -v --help » pour afficher les options de la ligne de commande des sous-processus)\n"
+msgstr " (Utiliser « -v --help » pour afficher les options de la ligne de commande des sous-processus).\n"
#: gcc.c:3391
-#, fuzzy
-#| msgid " --version Display compiler version information\n"
msgid " --version Display compiler version information.\n"
-msgstr " --help Afficher des informations sur la version du compilateur\n"
+msgstr " --help Afficher des informations sur la version du compilateur.\n"
#: gcc.c:3392
-#, fuzzy
-#| msgid " -dumpspecs Display all of the built in spec strings\n"
msgid " -dumpspecs Display all of the built in spec strings.\n"
-msgstr " -dumpspecs Afficher tous les chaînes de specs internes\n"
+msgstr " -dumpspecs Afficher tous les chaînes de specs internes.\n"
#: gcc.c:3393
-#, fuzzy
-#| msgid " -dumpversion Display the version of the compiler\n"
msgid " -dumpversion Display the version of the compiler.\n"
-msgstr " -dumpversion Afficher la version du compilateur\n"
+msgstr " -dumpversion Afficher la version du compilateur.\n"
#: gcc.c:3394
-#, fuzzy
-#| msgid " -dumpmachine Display the compiler's target processor\n"
msgid " -dumpmachine Display the compiler's target processor.\n"
-msgstr " -dumpmachine Afficher le processeur ciblé par le compilateur\n"
+msgstr " -dumpmachine Afficher le processeur ciblé par le compilateur.\n"
#: gcc.c:3395
-#, fuzzy
-#| msgid " -print-search-dirs Display the directories in the compiler's search path\n"
msgid " -print-search-dirs Display the directories in the compiler's search path.\n"
-msgstr " -print-search-dirs Afficher les répertoires du chemin de recherche du compilateur\n"
+msgstr " -print-search-dirs Afficher les répertoires du chemin de recherche du compilateur.\n"
#: gcc.c:3396
-#, fuzzy
-#| msgid " -print-libgcc-file-name Display the name of the compiler's companion library\n"
msgid " -print-libgcc-file-name Display the name of the compiler's companion library.\n"
-msgstr " -print-libgcc-file-name Afficher le nom de la bibliothèque accompagnant le compilateur\n"
+msgstr " -print-libgcc-file-name Afficher le nom de la bibliothèque accompagnant le compilateur.\n"
#: gcc.c:3397
-#, fuzzy
-#| msgid " -print-file-name=<lib> Display the full path to library <lib>\n"
msgid " -print-file-name=<lib> Display the full path to library <lib>.\n"
-msgstr " -print-file-name=<lib> Afficher le chemin d’accès complet vers la bibliothèque <lib>\n"
+msgstr " -print-file-name=<lib> Afficher le chemin d’accès complet vers la bibliothèque <lib>.\n"
#: gcc.c:3398
-#, fuzzy
-#| msgid " -print-prog-name=<prog> Display the full path to compiler component <prog>\n"
msgid " -print-prog-name=<prog> Display the full path to compiler component <prog>.\n"
-msgstr " -print-prog-name=<prog> Afficher le chemin d’accès complet vers le composant du compilateur <prog>\n"
+msgstr " -print-prog-name=<prog> Afficher le chemin d’accès complet vers le composant du compilateur <prog>.\n"
#: gcc.c:3399
-#, fuzzy
-#| msgid ""
-#| " -print-multiarch Display the target's normalized GNU triplet, used as\n"
-#| " a component in the library path\n"
msgid ""
" -print-multiarch Display the target's normalized GNU triplet, used as\n"
" a component in the library path.\n"
msgstr ""
" -print-multiarch Afficher le triplet GNU normalisé de la cible, utilisé comme\n"
-" un composant dans le chemin d’accès de la bibliothèque\n"
+" un composant dans le chemin d’accès de la bibliothèque.\n"
#: gcc.c:3402
-#, fuzzy
-#| msgid " -print-multi-directory Display the root directory for versions of libgcc\n"
msgid " -print-multi-directory Display the root directory for versions of libgcc.\n"
-msgstr " -print-multi-directory Afficher la racine du répertoire des versions de libgcc\n"
+msgstr " -print-multi-directory Afficher la racine du répertoire des versions de libgcc.\n"
#: gcc.c:3403
-#, fuzzy
-#| msgid ""
-#| " -print-multi-lib Display the mapping between command line options and\n"
-#| " multiple library search directories\n"
msgid ""
" -print-multi-lib Display the mapping between command line options and\n"
" multiple library search directories.\n"
msgstr ""
" -print-multi-lib Afficher la table de correspondance entre les options de\n"
" la ligne de commande et les multiples répertoires de\n"
-" recherche des bibliothèques\n"
+" recherche des bibliothèques.\n"
#: gcc.c:3406
-#, fuzzy
-#| msgid " -print-multi-os-directory Display the relative path to OS libraries\n"
msgid " -print-multi-os-directory Display the relative path to OS libraries.\n"
-msgstr " -print-multi-os-directory Afficher le chemin relatif du répertoire vers les bibliothèques de l’OS\n"
+msgstr " -print-multi-os-directory Afficher le chemin relatif du répertoire vers les bibliothèques de l’OS.\n"
#: gcc.c:3407
-#, fuzzy
-#| msgid " -print-sysroot Display the target libraries directory\n"
msgid " -print-sysroot Display the target libraries directory.\n"
-msgstr " -print-sysroot Afficher le répertoire des bibliothèques de la cible\n"
+msgstr " -print-sysroot Afficher le répertoire des bibliothèques de la cible.\n"
#: gcc.c:3408
-#, fuzzy
-#| msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers\n"
msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.\n"
-msgstr " -print-sysroot-headers-suffix Afficher le suffixe de la racine système utilisé pour trouver les en-têtes\n"
+msgstr " -print-sysroot-headers-suffix Afficher le suffixe de la racine système utilisé pour trouver les en-têtes.\n"
#: gcc.c:3409
-#, fuzzy
-#| msgid " -Wa,<options> Pass comma-separated <options> on to the assembler\n"
msgid " -Wa,<options> Pass comma-separated <options> on to the assembler.\n"
-msgstr " -Wa,<options> Passer les <options> séparées par des virgules à l’assembleur\n"
+msgstr " -Wa,<options> Passer les <options> séparées par des virgules à l’assembleur.\n"
#: gcc.c:3410
-#, fuzzy
-#| msgid " -Wp,<options> Pass comma-separated <options> on to the preprocessor\n"
msgid " -Wp,<options> Pass comma-separated <options> on to the preprocessor.\n"
-msgstr " -Wp,<options> Passer les <options> séparées par des virgules au préprocesseur\n"
+msgstr " -Wp,<options> Passer les <options> séparées par des virgules au préprocesseur.\n"
#: gcc.c:3411
-#, fuzzy
-#| msgid " -Wl,<options> Pass comma-separated <options> on to the linker\n"
msgid " -Wl,<options> Pass comma-separated <options> on to the linker.\n"
-msgstr " -Wl,<options> Passer les <options> séparées par des virgules à l'éditeur de liens\n"
+msgstr " -Wl,<options> Passer les <options> séparées par des virgules à l'éditeur de liens.\n"
#: gcc.c:3412
-#, fuzzy
-#| msgid " -Xassembler <arg> Pass <arg> on to the assembler\n"
msgid " -Xassembler <arg> Pass <arg> on to the assembler.\n"
-msgstr " -Xassembler <argument> Passer l’<argument> à l’assembleur\n"
+msgstr " -Xassembler <argument> Passer l’<argument> à l’assembleur.\n"
#: gcc.c:3413
-#, fuzzy
-#| msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"
msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor.\n"
-msgstr " -Xpreprocessor <argument> Passer l’<argument> au préprocesseur\n"
+msgstr " -Xpreprocessor <argument> Passer l’<argument> au préprocesseur.\n"
#: gcc.c:3414
-#, fuzzy
-#| msgid " -Xlinker <arg> Pass <arg> on to the linker\n"
msgid " -Xlinker <arg> Pass <arg> on to the linker.\n"
-msgstr " -Xlinker <argument> Passer l’<argument> à l’éditeur de liens\n"
+msgstr " -Xlinker <argument> Passer l’<argument> à l’éditeur de liens.\n"
#: gcc.c:3415
-#, fuzzy
-#| msgid " -save-temps Do not delete intermediate files\n"
msgid " -save-temps Do not delete intermediate files.\n"
-msgstr " -save-temps ne pas détruire les fichiers intermédiaires\n"
+msgstr " -save-temps Ne pas détruire les fichiers intermédiaires.\n"
#: gcc.c:3416
-#, fuzzy
-#| msgid " -save-temps=<arg> Do not delete intermediate files\n"
msgid " -save-temps=<arg> Do not delete intermediate files.\n"
-msgstr " -save-temps=<arg> ne pas détruire les fichiers intermédiaires\n"
+msgstr " -save-temps=<arg> Ne pas détruire les fichiers intermédiaires.\n"
#: gcc.c:3417
msgid ""
@@ -578,28 +518,20 @@ msgid ""
msgstr ""
#: gcc.c:3420
-#, fuzzy
-#| msgid " -pipe Use pipes rather than intermediate files\n"
msgid " -pipe Use pipes rather than intermediate files.\n"
-msgstr " -pipe utiliser des pipes au lieu de fichiers intermédiaires\n"
+msgstr " -pipe Utiliser des pipes au lieu de fichiers intermédiaires.\n"
#: gcc.c:3421
-#, fuzzy
-#| msgid " -time Time the execution of each subprocess\n"
msgid " -time Time the execution of each subprocess.\n"
-msgstr " -time mesurer le temps d'exécution de chaque sous-processus\n"
+msgstr " -time Mesurer le temps d'exécution de chaque sous-processus.\n"
#: gcc.c:3422
-#, fuzzy
-#| msgid " -specs=<file> Override built-in specs with the contents of <file>\n"
msgid " -specs=<file> Override built-in specs with the contents of <file>.\n"
-msgstr " -specs=<fichier> écraser les specs internes à l'aide du contenu du <fichier>\n"
+msgstr " -specs=<fichier> Écraser les specs internes à l'aide du contenu du <fichier>.\n"
#: gcc.c:3423
-#, fuzzy
-#| msgid " -std=<standard> Assume that the input sources are for <standard>\n"
msgid " -std=<standard> Assume that the input sources are for <standard>.\n"
-msgstr " -std=<standard> Présumer que les fichiers sources respectent le <standard>\n"
+msgstr " -std=<standard> Présumer que les fichiers sources respectent le <standard>.\n"
#: gcc.c:3424
msgid ""
@@ -608,76 +540,52 @@ msgid ""
msgstr ""
#: gcc.c:3427
-#, fuzzy
-#| msgid " -B <directory> Add <directory> to the compiler's search paths\n"
msgid " -B <directory> Add <directory> to the compiler's search paths.\n"
-msgstr " -B <répertoire> ajouter le <répertoire> aux chemins de recherche du compilateur\n"
+msgstr " -B <répertoire> Ajouter le <répertoire> aux chemins de recherche du compilateur.\n"
#: gcc.c:3428
-#, fuzzy
-#| msgid " -v Display the programs invoked by the compiler\n"
msgid " -v Display the programs invoked by the compiler.\n"
-msgstr " -v afficher les programmes invoqués par le compilateur\n"
+msgstr " -v Afficher les programmes invoqués par le compilateur.\n"
#: gcc.c:3429
-#, fuzzy
-#| msgid " -### Like -v but options quoted and commands not executed\n"
msgid " -### Like -v but options quoted and commands not executed.\n"
-msgstr " -### identique à -v mais les options et les commandes entre guillemets ne sont pas exécutées\n"
+msgstr " -### Identique à -v mais les options et les commandes entre guillemets ne sont pas exécutées.\n"
#: gcc.c:3430
-#, fuzzy
-#| msgid " -E Preprocess only; do not compile, assemble or link\n"
msgid " -E Preprocess only; do not compile, assemble or link.\n"
-msgstr " -E pré-traiter seulement ; ne pas compiler, assembler ou éditer les liens\n"
+msgstr " -E Pré-traiter seulement ; ne pas compiler, assembler ou éditer les liens.\n"
#: gcc.c:3431
-#, fuzzy
-#| msgid " -S Compile only; do not assemble or link\n"
msgid " -S Compile only; do not assemble or link.\n"
-msgstr " -S compiler seulement ; ne pas assembler ou éditer les liens\n"
+msgstr " -S Compiler seulement ; ne pas assembler ou éditer les liens.\n"
#: gcc.c:3432
-#, fuzzy
-#| msgid " -c Compile and assemble, but do not link\n"
msgid " -c Compile and assemble, but do not link.\n"
-msgstr " -S compiler et assembler, mais ne pas éditer les liens\n"
+msgstr " -S Compiler et assembler, mais ne pas éditer les liens.\n"
#: gcc.c:3433
-#, fuzzy
-#| msgid " -o <file> Place the output into <file>\n"
msgid " -o <file> Place the output into <file>.\n"
-msgstr " -o <fichier> placer la sortie dans le <fichier>\n"
+msgstr " -o <fichier> Placer la sortie dans le <fichier>.\n"
#: gcc.c:3434
-#, fuzzy
-#| msgid " -pie Create a position independent executable\n"
msgid " -pie Create a position independent executable.\n"
-msgstr " -pipe créer un exécutable à chargement aléatoire en mémoire (PIE)\n"
+msgstr " -pipe Créer un exécutable à chargement aléatoire en mémoire (PIE).\n"
#: gcc.c:3435
-#, fuzzy
-#| msgid " -shared Create a shared library\n"
msgid " -shared Create a shared library.\n"
-msgstr " -shared créer une bibliothèque partagée\n"
+msgstr " -shared Créer une bibliothèque partagée.\n"
#: gcc.c:3436
-#, fuzzy
-#| msgid ""
-#| " -x <language> Specify the language of the following input files\n"
-#| " Permissible languages include: c c++ assembler none\n"
-#| " 'none' means revert to the default behavior of\n"
-#| " guessing the language based on the file's extension\n"
msgid ""
" -x <language> Specify the language of the following input files.\n"
" Permissible languages include: c c++ assembler none\n"
" 'none' means revert to the default behavior of\n"
" guessing the language based on the file's extension.\n"
msgstr ""
-" -x <langage> spécifier le langage des fichiers suivants d'entrée\n"
+" -x <langage> Spécifier le langage des fichiers suivants d'entrée.\n"
" Les langages permis sont: c c++ assembler none\n"
" « none » signifiant d'utiliser le comportement par défaut\n"
-" en tentant d'identifier le langage par l'extension du fichier\n"
+" en tentant d'identifier le langage par l'extension du fichier.\n"
#: gcc.c:3443
#, c-format
@@ -944,10 +852,9 @@ msgstr ""
"%s.\n"
#: gcov-tool.c:526
-#, fuzzy, c-format
-#| msgid "Copyright %s 2014-2015 Free Software Foundation, Inc.\n"
+#, c-format
msgid "Copyright %s 2014-2016 Free Software Foundation, Inc.\n"
-msgstr "Copyright %s 2014-2015 Free Software Foundation, Inc.\n"
+msgstr "Copyright %s 2014-2016 Free Software Foundation, Inc.\n"
#: gcov-tool.c:529 gcov.c:506
#, c-format
@@ -1405,10 +1312,8 @@ msgstr "incapable de générer des recharges pour:"
#. What to print when a switch has no documentation.
#: opts.c:184
-#, fuzzy
-#| msgid "This switch lacks documentation"
msgid "This option lacks documentation."
-msgstr "Cette option manque de documentation"
+msgstr "Cette option manque de documentation."
#: opts.c:185
msgid "Uses of this option are diagnosed."
@@ -1457,70 +1362,48 @@ msgid " All options with the desired characteristics have already been displayed
msgstr ""
#: opts.c:1332
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are target specific"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes sont spécifiques à la cible"
#: opts.c:1335
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options control compiler warning messages"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes contrôlent les messages d’avertissement du compilateur"
#: opts.c:1338
-#, fuzzy
-#| msgid "Perform loop optimizations"
msgid "The following options control optimizations"
-msgstr "Exécuter l'optimisation des boucles"
+msgstr "Les options suivantes contrôlent les optimisations"
#: opts.c:1341 opts.c:1380
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are language-independent"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes sont indépendantes du langage"
#: opts.c:1344
-#, fuzzy
-#| msgid "The --param option recognizes the following as parameters:\n"
msgid "The --param option recognizes the following as parameters"
-msgstr "L'option --param reconnaît les paramètres suivant:\n"
+msgstr "L'option --param reconnaît les paramètres suivant"
#: opts.c:1350
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are specific to just the language "
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes sont spécifiques au langage "
#: opts.c:1352
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are supported by the language "
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes sont prises en charge pour le langage "
#: opts.c:1363
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are not documented"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes sont non documentées"
#: opts.c:1365
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options take separate arguments"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes prennent des arguments séparées"
#: opts.c:1367
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options take joined arguments"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes prennent des arguments communs"
#: opts.c:1378
-#, fuzzy
-#| msgid "The following options are language-independent:\n"
msgid "The following options are language-related"
-msgstr "Les options suivantes sont indépendantes du langage:\n"
+msgstr "Les options suivantes concernent les langages"
#: plugin.c:796
msgid "Event"
@@ -1610,10 +1493,9 @@ msgid "%s%s%s %sversion %s (%s) compiled by CC, "
msgstr "%s%s%s %sversion %s (%s) compilé par CC, "
#: toplev.c:646
-#, fuzzy, c-format
-#| msgid "GMP version %s, MPFR version %s, MPC version %s\n"
+#, c-format
msgid "GMP version %s, MPFR version %s, MPC version %s, isl version %s\n"
-msgstr "GMP version %s, MPFR version %s, MPC version %s\n"
+msgstr "GMP version %s, MPFR version %s, MPC version %s, isl version %s\n"
#: toplev.c:648
#, c-format
@@ -1676,20 +1558,16 @@ msgid "--param large-function-growth limit reached"
msgstr "--param large-function-growth limite atteinte"
#: cif-code.def:70
-#, fuzzy
-#| msgid "--param large-function-growth limit reached"
msgid "--param large-stack-frame-growth limit reached"
-msgstr "--param large-function-growth limite atteinte"
+msgstr "--param large-stack-frame-growth limite atteinte"
#: cif-code.def:72
msgid "--param max-inline-insns-single limit reached"
msgstr "--param max-inline-insns-single limite atteinte"
#: cif-code.def:74
-#, fuzzy
-#| msgid "--param max-inline-insns-single limit reached"
msgid "--param max-inline-insns-auto limit reached"
-msgstr "--param max-inline-insns-single limite atteinte"
+msgstr "--param max-inline-insns-auto limite atteinte"
#: cif-code.def:76
msgid "--param inline-unit-growth limit reached"
@@ -1708,10 +1586,8 @@ msgid "function not declared inline and code size would grow"
msgstr ""
#: cif-code.def:92
-#, fuzzy
-#| msgid "mismatched braces in specs"
msgid "mismatched arguments"
-msgstr "accolades non concordantes dans les specs"
+msgstr "arguments non concordantes"
#: cif-code.def:96
#, fuzzy
@@ -1763,7 +1639,7 @@ msgstr "votre fonction sera mal compilée"
#: cif-code.def:133
msgid "unreachable"
-msgstr ""
+msgstr "introuvable"
#. The remainder are real diagnostic types.
#: diagnostic.def:33
@@ -1805,10 +1681,8 @@ msgstr "débogage : "
#. These two would be re-classified as DK_WARNING or DK_ERROR, so the
#. prefix does not matter.
#: diagnostic.def:43
-#, fuzzy
-#| msgid "warning: "
msgid "pedwarn: "
-msgstr "attention : "
+msgstr "pédant : "
#: diagnostic.def:44
msgid "permerror: "
@@ -1825,16 +1699,14 @@ msgid "The minimal estimated speedup allowing inliner to ignore inline-insns-sin
msgstr ""
#: params.def:71
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions in a single function eligible for inlining"
+#, no-c-format
msgid "The maximum number of instructions in a single function eligible for inlining."
-msgstr "Le nombre maximum d'instructions dans une fonction simple éligible au type enligne"
+msgstr "Le nombre maximum d'instructions dans une fonction simple éligible au type enligne."
#: params.def:83
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions when automatically inlining"
+#, no-c-format
msgid "The maximum number of instructions when automatically inlining."
-msgstr "Le nombre maximum d'instructions lorsqu'automatiquement de type enligne"
+msgstr "Le nombre maximum d'instructions lorsqu'automatiquement de type enligne."
#: params.def:88
#, fuzzy, no-c-format
@@ -1891,22 +1763,19 @@ msgid "If -ftree-vectorize is used, the minimal loop bound of a loop to be consi
msgstr ""
#: params.def:152
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to consider to fill a delay slot"
+#, no-c-format
msgid "The maximum number of instructions to consider to fill a delay slot."
-msgstr "Le nombre maximum d'instructions à considérer pour remplir une slot délai"
+msgstr "Le nombre maximum d'instructions à considérer pour remplir une slot délai."
#: params.def:163
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to consider to find accurate live register information"
+#, no-c-format
msgid "The maximum number of instructions to consider to find accurate live register information."
-msgstr "Le nombre maximum d'instructions à considérer pour repérer un registre d'information actif et précis"
+msgstr "Le nombre maximum d'instructions à considérer pour repérer un registre d'information actif et précis."
#: params.def:173
-#, fuzzy, no-c-format
-#| msgid "The maximum length of scheduling's pending operations list"
+#, no-c-format
msgid "The maximum length of scheduling's pending operations list."
-msgstr "La longueur maximale de la liste des opération en attente d'ordonnancement"
+msgstr "La longueur maximale de la liste des opération en attente d'ordonnancement."
#: params.def:180
#, fuzzy, no-c-format
@@ -1915,16 +1784,14 @@ msgid "The maximum number of backtrack attempts the scheduler should make when m
msgstr "Le nombre maximum d'instructions à considérer à inclure dans une boucle"
#: params.def:185
-#, fuzzy, no-c-format
-#| msgid "The size of function body to be considered large"
+#, no-c-format
msgid "The size of function body to be considered large."
-msgstr "La taille du corps de la fonction est considéré comme étant grande"
+msgstr "La taille du corps de la fonction est considéré comme étant grande."
#: params.def:189
-#, fuzzy, no-c-format
-#| msgid "Maximal growth due to inlining of large function (in percent)"
+#, no-c-format
msgid "Maximal growth due to inlining of large function (in percent)."
-msgstr "Croissance maximal en raison de l'enlignage d'une grande fonction (en pourcentage)"
+msgstr "Croissance maximal en raison de l'enlignage d'une grande fonction (en pourcentage)."
#: params.def:193
#, fuzzy, no-c-format
@@ -1933,16 +1800,15 @@ msgid "The size of translation unit to be considered large."
msgstr "La taille du corps de la fonction est considéré comme étant grande"
#: params.def:197
-#, fuzzy, no-c-format
-#| msgid "how much can given compilation unit grow because of the inlining (in percent)"
+#, no-c-format
msgid "How much can given compilation unit grow because of the inlining (in percent)."
-msgstr "quelle croissance d'une unité de compilation peut être tolérée en raison de l'enlignage (en pourcentage)"
+msgstr "Quelle croissance d'une unité de compilation peut être tolérée en raison de l'enlignage (en pourcentage)."
#: params.def:201
#, fuzzy, no-c-format
#| msgid "how much can given compilation unit grow because of the inlining (in percent)"
msgid "How much can given compilation unit grow because of the interprocedural constant propagation (in percent)."
-msgstr "quelle croissance d'une unité de compilation peut être tolérée en raison de l'enlignage (en pourcentage)"
+msgstr "Quelle croissance d'une unité de compilation peut être tolérée en raison de l'enlignage (en pourcentage)"
#: params.def:205
#, no-c-format
@@ -1962,10 +1828,9 @@ msgid "Maximal stack frame growth due to inlining (in percent)."
msgstr "Croissance maximal en raison de l'enlignage d'une grande fonction (en pourcentage)"
#: params.def:220
-#, fuzzy, no-c-format
-#| msgid "The maximum amount of memory to be allocated by GCSE"
+#, no-c-format
msgid "The maximum amount of memory to be allocated by GCSE."
-msgstr "La taille maximale de mémoire à être alloué par GCSE"
+msgstr "La taille maximale de mémoire à être alloué par GCSE."
#: params.def:227
#, fuzzy, no-c-format
@@ -2004,34 +1869,29 @@ msgid "Maximum depth of sqrt chains to use when synthesizing exponentiation by a
msgstr ""
#: params.def:287
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to consider to unroll in a loop"
+#, no-c-format
msgid "The maximum number of instructions to consider to unroll in a loop."
-msgstr "Le nombre maximum d'instructions à considérer à inclure dans une boucle"
+msgstr "Le nombre maximum d'instructions à considérer à inclure dans une boucle."
#: params.def:293
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to consider to unroll in a loop on average"
+#, no-c-format
msgid "The maximum number of instructions to consider to unroll in a loop on average."
-msgstr "Le nombre maximum d'instructions à considérer à inclure dans une boucle en moyenne"
+msgstr "Le nombre maximum d'instructions à considérer à inclure dans une boucle en moyenne."
#: params.def:298
-#, fuzzy, no-c-format
-#| msgid "The maximum number of unrollings of a single loop"
+#, no-c-format
msgid "The maximum number of unrollings of a single loop."
-msgstr "Le nombre maximum d'instructions à inclure dans une boucle simple"
+msgstr "Le nombre maximum d'instructions à inclure dans une boucle simple."
#: params.def:303
-#, fuzzy, no-c-format
-#| msgid "The maximum number of insns of a peeled loop"
+#, no-c-format
msgid "The maximum number of insns of a peeled loop."
-msgstr "Le nombre maximum d'insns de boucle réduite"
+msgstr "Le nombre maximum d'insns de boucle réduite."
#: params.def:308
-#, fuzzy, no-c-format
-#| msgid "The maximum number of peelings of a single loop"
+#, no-c-format
msgid "The maximum number of peelings of a single loop."
-msgstr "Le nombre maximum de passes de réduction d'une boucle simple"
+msgstr "Le nombre maximum de passes de réduction d'une boucle simple."
#: params.def:313
#, fuzzy, no-c-format
@@ -2040,22 +1900,19 @@ msgid "The maximum number of branches on the path through the peeled sequence."
msgstr "Le nombre maximum d'insns d'une boucle complètement réduite"
#: params.def:318
-#, fuzzy, no-c-format
-#| msgid "The maximum number of insns of a completely peeled loop"
+#, no-c-format
msgid "The maximum number of insns of a completely peeled loop."
-msgstr "Le nombre maximum d'insns d'une boucle complètement réduite"
+msgstr "Le nombre maximum d'insns d'une boucle complètement réduite."
#: params.def:323
-#, fuzzy, no-c-format
-#| msgid "The maximum number of peelings of a single loop that is peeled completely"
+#, no-c-format
msgid "The maximum number of peelings of a single loop that is peeled completely."
-msgstr "Le nombre maximum de réductions d'une boucle simple qui a été complètement réduite"
+msgstr "Le nombre maximum de réductions d'une boucle simple qui a été complètement réduite."
#: params.def:328
-#, fuzzy, no-c-format
-#| msgid "The maximum number of insns of a peeled loop that rolls only once"
+#, no-c-format
msgid "The maximum number of insns of a peeled loop that rolls only once."
-msgstr "Le nombre maximum d'insns d'une boucle réduite qui tourne une seule fois"
+msgstr "Le nombre maximum d'insns d'une boucle réduite qui tourne une seule fois."
#: params.def:333
#, fuzzy, no-c-format
@@ -2064,16 +1921,14 @@ msgid "The maximum depth of a loop nest we completely peel."
msgstr "Le nombre maximum d'insns d'une boucle complètement réduite"
#: params.def:339
-#, fuzzy, no-c-format
-#| msgid "The maximum number of insns of an unswitched loop"
+#, no-c-format
msgid "The maximum number of insns of an unswitched loop."
-msgstr "Le nombre maximum d'insns d'une boucle sans branchement"
+msgstr "Le nombre maximum d'insns d'une boucle sans branchement."
#: params.def:344
-#, fuzzy, no-c-format
-#| msgid "The maximum number of unswitchings in a single loop"
+#, no-c-format
msgid "The maximum number of unswitchings in a single loop."
-msgstr "Le nombre maximum de non branchement dans une boucle simple"
+msgstr "Le nombre maximum de non branchement dans une boucle simple."
#: params.def:351
#, no-c-format
@@ -2111,10 +1966,9 @@ msgid "A basic block profile count is considered hot if it contributes to the gi
msgstr ""
#: params.def:386
-#, fuzzy, no-c-format
-#| msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot"
+#, no-c-format
msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot."
-msgstr "Sélectionner la fraction de la fréquence maximale d'exécutions du bloc de base dans la fonction selon le bloc de base donné doit être considéré comme chaud « hot »"
+msgstr "Sélectionner la fraction de la fréquence maximale d'exécutions du bloc de base dans la fonction selon le bloc de base donné doit être considéré comme chaud « hot »."
#: params.def:391
#, no-c-format
@@ -2144,46 +1998,39 @@ msgid "Set the estimated probability in percentage for builtin expect. The defau
msgstr ""
#: params.def:434
-#, fuzzy, no-c-format
-#| msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available"
+#, no-c-format
msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available."
-msgstr "Le pourcentage de fonction, pondéré par la fréquence d'exécutions, qui doit être couvert la formation de la trace. Utilisé lorsque le feedback par profile est disponible"
+msgstr "Le pourcentage de fonction, pondéré par la fréquence d'exécutions, qui doit être couvert la formation de la trace. Utilisé lorsque le feedback par profile est disponible."
#: params.def:438
-#, fuzzy, no-c-format
-#| msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available"
+#, no-c-format
msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available."
-msgstr "Le pourcentage de fonction, pondéré par la fréquence d'exécutions, qui doit être couvert la formation de la trace. Utilisé lorsque le feedback par profilage n'est disponible"
+msgstr "Le pourcentage de fonction, pondéré par la fréquence d'exécutions, qui doit être couvert la formation de la trace. Utilisé lorsque le feedback par profilage n'est disponible."
#: params.def:442
-#, fuzzy, no-c-format
-#| msgid "Maximal code growth caused by tail duplication (in percent)"
+#, no-c-format
msgid "Maximal code growth caused by tail duplication (in percent)."
-msgstr "Croissance maximal du code en raison de duplication de queue (en pourcentage)"
+msgstr "Croissance maximal du code en raison de duplication de queue (en pourcentage)."
#: params.def:446
-#, fuzzy, no-c-format
-#| msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)"
+#, no-c-format
msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)."
-msgstr "Stopper la croissance renversée si la probabilité inverse des meilleures bordures est inférieure à ce seuil (en pourcentage)"
+msgstr "Stopper la croissance renversée si la probabilité inverse des meilleures bordures est inférieure à ce seuil (en pourcentage)."
#: params.def:450
-#, fuzzy, no-c-format
-#| msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available"
+#, no-c-format
msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available."
-msgstr "Stopper la croissance anticipée si la probabilité des meilleures bordures est inférieure à ce seuil (en pourcentage). Utilisé lorsque le feedback par profilage est disponible"
+msgstr "Stopper la croissance anticipée si la probabilité des meilleures bordures est inférieure à ce seuil (en pourcentage). Utilisé lorsque le feedback par profilage est disponible."
#: params.def:454
-#, fuzzy, no-c-format
-#| msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available"
+#, no-c-format
msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available."
-msgstr "Stopper la croissance anticipée si la probabilité des meilleures bordures est inférieure à ce seuil (en pourcentage). Utilisé lorsque le feedback par profilage n'est pas disponible"
+msgstr "Stopper la croissance anticipée si la probabilité des meilleures bordures est inférieure à ce seuil (en pourcentage). Utilisé lorsque le feedback par profilage n'est pas disponible."
#: params.def:460
-#, fuzzy, no-c-format
-#| msgid "The maximum number of incoming edges to consider for crossjumping"
+#, no-c-format
msgid "The maximum number of incoming edges to consider for crossjumping."
-msgstr "Le nombre maximum de bordures à considérer pour les sauts croisés"
+msgstr "Le nombre maximum de bordures à considérer pour les sauts croisés."
#: params.def:466
#, fuzzy, no-c-format
@@ -2203,10 +2050,9 @@ msgid "The maximum number of insns to duplicate when unfactoring computed gotos.
msgstr "Le nombre maximum d'insns d'une boucle sans branchement"
#: params.def:484
-#, fuzzy, no-c-format
-#| msgid "The maximum length of path considered in cse"
+#, no-c-format
msgid "The maximum length of path considered in cse."
-msgstr "La longueur maximale des chemins considérés dans cse"
+msgstr "La longueur maximale des chemins considérés dans cse."
#: params.def:488
#, fuzzy, no-c-format
@@ -2262,28 +2108,24 @@ msgid "Max number of loop peels to enhancement alignment of data references in a
msgstr ""
#: params.def:550
-#, fuzzy, no-c-format
-#| msgid "The maximum memory locations recorded by cselib"
+#, no-c-format
msgid "The maximum memory locations recorded by cselib."
-msgstr "Le nombre maximum de localisations mémoire enregistrées par cselib"
+msgstr "Le nombre maximum de localisations mémoire enregistrées par cselib."
#: params.def:563
-#, fuzzy, no-c-format
-#| msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap"
+#, no-c-format
msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap."
msgstr "L'expansion minimale des tas pour lancer la collecte des rebuts, en pourcentage de la taille totale du tas."
#: params.def:568
-#, fuzzy, no-c-format
-#| msgid "Minimum heap size before we start collecting garbage, in kilobytes"
+#, no-c-format
msgid "Minimum heap size before we start collecting garbage, in kilobytes."
msgstr "La taille minimale du tas avant de lancer la collecte des rebuts, en ko."
#: params.def:576
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to search backward when looking for equivalent reload"
+#, no-c-format
msgid "The maximum number of instructions to search backward when looking for equivalent reload."
-msgstr "Le nombre maximum d'instructions à rechercher antérieurement lors d'une recherche d'une recharge équivalente"
+msgstr "Le nombre maximum d'instructions à rechercher antérieurement lors d'une recherche d'une recharge équivalente."
#: params.def:581
#, no-c-format
@@ -2417,22 +2259,19 @@ msgid "The number of prefetches that can run at the same time."
msgstr ""
#: params.def:743
-#, fuzzy, no-c-format
-#| msgid "The size of L1 cache"
+#, no-c-format
msgid "The size of L1 cache."
-msgstr "La taille du cache L1"
+msgstr "La taille du cache L1."
#: params.def:750
-#, fuzzy, no-c-format
-#| msgid "The size of L1 cache"
+#, no-c-format
msgid "The size of L1 cache line."
-msgstr "La taille du cache L1"
+msgstr "La taille du cache L1."
#: params.def:757
-#, fuzzy, no-c-format
-#| msgid "The size of L2 cache"
+#, no-c-format
msgid "The size of L2 cache."
-msgstr "La taille du cache L2"
+msgstr "La taille du cache L2."
#: params.def:768
#, no-c-format
@@ -2803,16 +2642,12 @@ msgid "format"
msgstr "format"
#: c-family/c-format.c:418
-#, fuzzy
-#| msgid "field width"
msgid "field width specifier"
-msgstr "largeur de champ"
+msgstr "spécificateur de largeur de champ"
#: c-family/c-format.c:419
-#, fuzzy
-#| msgid "field precision"
msgid "field precision specifier"
-msgstr "champ de précision"
+msgstr "spécificateur de champ de précision"
#: c-family/c-format.c:536 c-family/c-format.c:560 config/i386/msformat-c.c:42
msgid "' ' flag"
@@ -2915,10 +2750,8 @@ msgid "'q' flag"
msgstr "fanion « q »"
#: c-family/c-format.c:593
-#, fuzzy
-#| msgid "the `'' printf flag"
msgid "the 'q' diagnostic flag"
-msgstr "le fanion « ' » de printf"
+msgstr "le fanion « d » de diagnostique"
#: c-family/c-format.c:606 config/i386/msformat-c.c:63
msgid "assignment suppression"
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 252394e0777..c2800f8cb79 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -7395,7 +7395,9 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl,
/* Adjust any debug insns between temp and insn. */
while ((temp = NEXT_INSN (temp)) != insn)
if (DEBUG_INSN_P (temp))
- replace_rtx (PATTERN (temp), old, reloadreg);
+ INSN_VAR_LOCATION_LOC (temp)
+ = simplify_replace_rtx (INSN_VAR_LOCATION_LOC (temp),
+ old, reloadreg);
else
gcc_assert (NOTE_P (temp));
}
diff --git a/gcc/reorg.c b/gcc/reorg.c
index a02141f47e7..7b28821c99f 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3307,7 +3307,7 @@ relax_delay_slots (rtx_insn *first)
reorg_redirect_jump (delay_jump_insn, trial);
target_label = trial;
if (crossing)
- CROSSING_JUMP_P (insn) = 1;
+ CROSSING_JUMP_P (delay_jump_insn) = 1;
}
/* If the first insn at TARGET_LABEL is redundant with a previous
diff --git a/gcc/rtl.h b/gcc/rtl.h
index c91d60d3c90..7f0bfa443a0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3011,7 +3011,7 @@ extern bool can_nonlocal_goto (const rtx_insn *);
extern void copy_reg_eh_region_note_forward (rtx, rtx_insn *, rtx);
extern void copy_reg_eh_region_note_backward (rtx, rtx_insn *, rtx);
extern int inequality_comparisons_p (const_rtx);
-extern rtx replace_rtx (rtx, rtx, rtx);
+extern rtx replace_rtx (rtx, rtx, rtx, bool = false);
extern void replace_label (rtx *, rtx, rtx, bool);
extern void replace_label_in_insn (rtx_insn *, rtx, rtx, bool);
extern bool rtx_referenced_p (const_rtx, const_rtx);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index bacc5f25f4a..b4dff86c0e9 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2946,10 +2946,13 @@ inequality_comparisons_p (const_rtx x)
not enter into CONST_DOUBLE for the replace.
Note that copying is not done so X must not be shared unless all copies
- are to be modified. */
+ are to be modified.
+
+ ALL_REGS is true if we want to replace all REGs equal to FROM, not just
+ those pointer-equal ones. */
rtx
-replace_rtx (rtx x, rtx from, rtx to)
+replace_rtx (rtx x, rtx from, rtx to, bool all_regs)
{
int i, j;
const char *fmt;
@@ -2961,9 +2964,17 @@ replace_rtx (rtx x, rtx from, rtx to)
if (x == 0)
return 0;
- if (GET_CODE (x) == SUBREG)
+ if (all_regs
+ && REG_P (x)
+ && REG_P (from)
+ && REGNO (x) == REGNO (from))
+ {
+ gcc_assert (GET_MODE (x) == GET_MODE (from));
+ return to;
+ }
+ else if (GET_CODE (x) == SUBREG)
{
- rtx new_rtx = replace_rtx (SUBREG_REG (x), from, to);
+ rtx new_rtx = replace_rtx (SUBREG_REG (x), from, to, all_regs);
if (CONST_INT_P (new_rtx))
{
@@ -2979,7 +2990,7 @@ replace_rtx (rtx x, rtx from, rtx to)
}
else if (GET_CODE (x) == ZERO_EXTEND)
{
- rtx new_rtx = replace_rtx (XEXP (x, 0), from, to);
+ rtx new_rtx = replace_rtx (XEXP (x, 0), from, to, all_regs);
if (CONST_INT_P (new_rtx))
{
@@ -2997,10 +3008,11 @@ replace_rtx (rtx x, rtx from, rtx to)
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
- XEXP (x, i) = replace_rtx (XEXP (x, i), from, to);
+ XEXP (x, i) = replace_rtx (XEXP (x, i), from, to, all_regs);
else if (fmt[i] == 'E')
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- XVECEXP (x, i, j) = replace_rtx (XVECEXP (x, i, j), from, to);
+ XVECEXP (x, i, j) = replace_rtx (XVECEXP (x, i, j),
+ from, to, all_regs);
}
return x;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 4961dfb3d7e..8f3a124a8fa 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2860,6 +2860,17 @@ sched_macro_fuse_insns (rtx_insn *insn)
}
+/* Get the implicit reg pending clobbers for INSN and save them in TEMP. */
+void
+get_implicit_reg_pending_clobbers (HARD_REG_SET *temp, rtx_insn *insn)
+{
+ extract_insn (insn);
+ preprocess_constraints (insn);
+ alternative_mask preferred = get_preferred_alternatives (insn);
+ ira_implicitly_set_insn_hard_regs (temp, preferred);
+ AND_COMPL_HARD_REG_SET (*temp, ira_no_alloc_regs);
+}
+
/* Analyze an INSN with pattern X to find all dependencies. */
static void
sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn)
@@ -2872,12 +2883,7 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn)
if (! reload_completed)
{
HARD_REG_SET temp;
-
- extract_insn (insn);
- preprocess_constraints (insn);
- alternative_mask prefrred = get_preferred_alternatives (insn);
- ira_implicitly_set_insn_hard_regs (&temp, prefrred);
- AND_COMPL_HARD_REG_SET (temp, ira_no_alloc_regs);
+ get_implicit_reg_pending_clobbers (&temp, insn);
IOR_HARD_REG_SET (implicit_reg_pending_clobbers, temp);
}
@@ -3489,7 +3495,8 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn)
{
if (deps->last_args_size)
add_dependence (insn, deps->last_args_size, REG_DEP_OUTPUT);
- deps->last_args_size = insn;
+ if (!deps->readonly)
+ deps->last_args_size = insn;
}
}
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 2a457033306..de5d3269266 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -1351,6 +1351,7 @@ extern void finish_deps_global (void);
extern void deps_analyze_insn (struct deps_desc *, rtx_insn *);
extern void remove_from_deps (struct deps_desc *, rtx_insn *);
extern void init_insn_reg_pressure_info (rtx_insn *);
+extern void get_implicit_reg_pending_clobbers (HARD_REG_SET *, rtx_insn *);
extern dw_t get_dep_weak (ds_t, ds_t);
extern ds_t set_dep_weak (ds_t, ds_t, dw_t);
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index d6c86b86bf2..83f813aa571 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1871,12 +1871,16 @@ merge_expr (expr_t to, expr_t from, insn_t split_point)
/* Make sure that speculative pattern is propagated into exprs that
have non-speculative one. This will provide us with consistent
speculative bits and speculative patterns inside expr. */
- if ((EXPR_SPEC_DONE_DS (from) != 0
- && EXPR_SPEC_DONE_DS (to) == 0)
- /* Do likewise for volatile insns, so that we always retain
- the may_trap_p bit on the resulting expression. */
- || (VINSN_MAY_TRAP_P (EXPR_VINSN (from))
- && !VINSN_MAY_TRAP_P (EXPR_VINSN (to))))
+ if (EXPR_SPEC_DONE_DS (to) == 0
+ && (EXPR_SPEC_DONE_DS (from) != 0
+ /* Do likewise for volatile insns, so that we always retain
+ the may_trap_p bit on the resulting expression. However,
+ avoid propagating the trapping bit into the instructions
+ already speculated. This would result in replacing the
+ speculative pattern with the non-speculative one and breaking
+ the speculation support. */
+ || (!VINSN_MAY_TRAP_P (EXPR_VINSN (to))
+ && VINSN_MAY_TRAP_P (EXPR_VINSN (from)))))
change_vinsn_in_expr (to, EXPR_VINSN (from));
merge_expr_data (to, from, split_point);
@@ -2650,6 +2654,23 @@ maybe_downgrade_id_to_use (idata_t id, insn_t insn)
IDATA_TYPE (id) = USE;
}
+/* Setup implicit register clobbers calculated by sched-deps for INSN
+ before reload and save them in ID. */
+static void
+setup_id_implicit_regs (idata_t id, insn_t insn)
+{
+ if (reload_completed)
+ return;
+
+ HARD_REG_SET temp;
+ unsigned regno;
+ hard_reg_set_iterator hrsi;
+
+ get_implicit_reg_pending_clobbers (&temp, insn);
+ EXECUTE_IF_SET_IN_HARD_REG_SET (temp, 0, regno, hrsi)
+ SET_REGNO_REG_SET (IDATA_REG_SETS (id), regno);
+}
+
/* Setup register sets describing INSN in ID. */
static void
setup_id_reg_sets (idata_t id, insn_t insn)
@@ -2704,6 +2725,9 @@ setup_id_reg_sets (idata_t id, insn_t insn)
}
}
+ /* Also get implicit reg clobbers from sched-deps. */
+ setup_id_implicit_regs (id, insn);
+
return_regset_to_pool (tmp);
}
@@ -2735,20 +2759,18 @@ deps_init_id (idata_t id, insn_t insn, bool force_unique_p)
deps_init_id_data.force_use_p = false;
init_deps (dc, false);
-
memcpy (&deps_init_id_sched_deps_info,
&const_deps_init_id_sched_deps_info,
sizeof (deps_init_id_sched_deps_info));
-
if (spec_info != NULL)
deps_init_id_sched_deps_info.generate_spec_deps = 1;
-
sched_deps_info = &deps_init_id_sched_deps_info;
deps_analyze_insn (dc, insn);
+ /* Implicit reg clobbers received from sched-deps separately. */
+ setup_id_implicit_regs (id, insn);
free_deps (dc);
-
deps_init_id_data.id = NULL;
}
@@ -4084,11 +4106,14 @@ get_seqno_by_preds (rtx_insn *insn)
insn_t *preds;
int n, i, seqno;
- while (tmp != head)
+ /* Loop backwards from INSN to HEAD including both. */
+ while (1)
{
- tmp = PREV_INSN (tmp);
if (INSN_P (tmp))
- return INSN_SEQNO (tmp);
+ return INSN_SEQNO (tmp);
+ if (tmp == head)
+ break;
+ tmp = PREV_INSN (tmp);
}
cfg_preds (bb, &preds, &n);
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 09cf0284603..b795aea0ac2 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -4262,8 +4262,9 @@ invoke_aftermath_hooks (fence_t fence, rtx_insn *best_insn, int issue_more)
issue_more);
memcpy (FENCE_STATE (fence), curr_state, dfa_state_size);
}
- else if (GET_CODE (PATTERN (best_insn)) != USE
- && GET_CODE (PATTERN (best_insn)) != CLOBBER)
+ else if (!DEBUG_INSN_P (best_insn)
+ && GET_CODE (PATTERN (best_insn)) != USE
+ && GET_CODE (PATTERN (best_insn)) != CLOBBER)
issue_more--;
return issue_more;
diff --git a/gcc/ssa-iterators.h b/gcc/ssa-iterators.h
index c58639ba22e..a7d75d6d47e 100644
--- a/gcc/ssa-iterators.h
+++ b/gcc/ssa-iterators.h
@@ -448,9 +448,11 @@ num_imm_uses (const_tree var)
unsigned int num = 0;
if (!MAY_HAVE_DEBUG_STMTS)
- for (ptr = start->next; ptr != start; ptr = ptr->next)
- if (USE_STMT (ptr))
- num++;
+ {
+ for (ptr = start->next; ptr != start; ptr = ptr->next)
+ if (USE_STMT (ptr))
+ num++;
+ }
else
for (ptr = start->next; ptr != start; ptr = ptr->next)
if (USE_STMT (ptr) && !is_gimple_debug (USE_STMT (ptr)))
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 523c95dd29e..2d7705e657c 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -2137,3 +2137,17 @@ symtab_node::definition_alignment ()
call_for_symbol_and_aliases (get_alignment_1, &align, true);
return align;
}
+
+/* Return symbol used to separate symbol name from suffix. */
+
+char
+symbol_table::symbol_suffix_separator ()
+{
+#ifndef NO_DOT_IN_LABEL
+ return '.';
+#elif !defined NO_DOLLAR_IN_LABEL
+ return '$';
+#else
+ return '_';
+#endif
+}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b2fdd0b2383..505e7d78de1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,631 @@
+2016-03-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Forward-port from 5 branch
+ 2016-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/70356
+ * gcc.target/i386/avx-vextractf128-256-5.c: Move
+ dg-require-effective-target after dg-do.
+
+ 2015-12-30 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * gcc.target/i386/avx-vextractf128-256-5.c: New test.
+
+2016-03-30 Thomas Schwinge <thomas@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+ Chung-Lin Tang <cltang@codesourcery.com>
+ Cesar Philippidis <cesar@codesourcery.com>
+ James Norris <jnorris@codesourcery.com>
+ Tom de Vries <tom@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-c++-common/goacc/combined-directives.c: Clean up dg-*
+ directives.
+ * c-c++-common/goacc/loop-clauses.c: Likewise.
+ * g++.dg/goacc/template.C: Likewise.
+ * gfortran.dg/goacc/combined-directives.f90: Likewise.
+ * gfortran.dg/goacc/loop-1.f95: Likewise.
+ * gfortran.dg/goacc/loop-5.f95: Likewise.
+ * gfortran.dg/goacc/loop-6.f95: Likewise.
+ * gfortran.dg/goacc/loop-tree-1.f90: Likewise.
+ * c-c++-common/goacc-gomp/nesting-1.c: Update.
+ * c-c++-common/goacc-gomp/nesting-fail-1.c: Likewise.
+ * c-c++-common/goacc/clauses-fail.c: Likewise.
+ * c-c++-common/goacc/parallel-1.c: Likewise.
+ * c-c++-common/goacc/reduction-1.c: Likewise.
+ * c-c++-common/goacc/reduction-2.c: Likewise.
+ * c-c++-common/goacc/reduction-3.c: Likewise.
+ * c-c++-common/goacc/reduction-4.c: Likewise.
+ * c-c++-common/goacc/routine-3.c: Likewise.
+ * c-c++-common/goacc/routine-4.c: Likewise.
+ * c-c++-common/goacc/routine-5.c: Likewise.
+ * c-c++-common/goacc/tile.c: Likewise.
+ * g++.dg/goacc/template.C: Likewise.
+ * gfortran.dg/goacc/combined-directives.f90: Likewise.
+ * c-c++-common/goacc/nesting-1.c: Move dg-error test cases into...
+ * c-c++-common/goacc/nesting-fail-1.c: ... this file. Update.
+ * c-c++-common/goacc/kernels-1.c: Update. Incorporate...
+ * c-c++-common/goacc/kernels-empty.c: ... this file, and...
+ * c-c++-common/goacc/kernels-eternal.c: ... this file, and...
+ * c-c++-common/goacc/kernels-noreturn.c: ... this file.
+ * c-c++-common/goacc/host_data-1.c: New file. Incorporate...
+ * c-c++-common/goacc/use_device-1.c: ... this file.
+ * c-c++-common/goacc/host_data-2.c: New file. Incorporate...
+ * c-c++-common/goacc/host_data-5.c: ... this file, and...
+ * c-c++-common/goacc/host_data-6.c: ... this file.
+ * c-c++-common/goacc/loop-2-kernels.c: New file.
+ * c-c++-common/goacc/loop-2-parallel.c: Likewise.
+ * c-c++-common/goacc/loop-3.c: Likewise.
+ * g++.dg/goacc/reference.C: Likewise.
+ * g++.dg/goacc/routine-1.C: Likewise.
+ * g++.dg/goacc/routine-2.C: Likewise.
+
+2016-03-30 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70450
+ * gcc.dg/torture/pr70450.c: New testcase.
+
+2016-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70421
+ * gcc.dg/torture/pr70421.c: New test.
+ * gcc.target/i386/avx512f-pr70421.c: New test.
+
+2016-03-30 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR tree-optimization/59124
+ * gcc.dg/Warray-bounds-19.c: New test.
+
+2016-03-29 Zachary T Welch <zwelch@codesourcery.com>
+
+ * lib/prune.exp (escape_regex_chars): New.
+ (prune_file_path): Update to quote metcharacters for regexp.
+
+2016-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70429
+ * gcc.c-torture/execute/pr70429.c: New test.
+
+ PR tree-optimization/70405
+ * gcc.dg/pr70405.c: New test.
+
+2016-03-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70397
+ * gfortran.dg/unlimited_polymorphic_25.f90: New test.
+ * gfortran.dg/unlimited_polymorphic_26.f90: New test.
+
+2016-03-29 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR testsuite/64177
+ * c-c++-common/cilk-plus/CK/spawning_arg.c (main): Call
+ __cilkrts_set_param to set two workers.
+ * c-c++-common/cilk-plus/CK/steal_check.c (main): Likewise.
+ * g++.dg/cilk-plus/CK/catch_exc.cc (main): Likewise.
+
+2016-03-28 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ g++.dg/ext/fnname5.C: Update the test for Darwin.
+
+2016-03-28 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70406
+ * gcc.target/i386/pr70406.c: New test.
+
+2016-03-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/double_record_extension3.ads: New test.
+
+2016-03-25 Richard Henderson <rth@redhat.com>
+
+ PR target/70120
+ * gcc.target/aarch64/pr70120-1.c: New.
+ * gcc.target/aarch64/pr70120-2.c: New.
+ * gcc.target/aarch64/pr70120-3.c: New.
+
+2016-03-25 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/62212
+ * g++.dg/template/mangle2.C: The dg-do directive should be
+ "compile" not "assemble".
+
+2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR lto/69650
+ * gcc.dg/pr69650.c: New test.
+
+2016-03-25 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/ext/pr70290.C: Prune non-standard ABI.
+
+2016-03-25 Alan Modra <amodra@gmail.com>
+
+ * gcc.dg/dfp/pr70052.c: New test.
+
+2016-03-24 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/69845
+ * gcc.dg/tree-ssa/pr69845-1.c: New test.
+ * gcc.dg/tree-ssa/pr69845-2.c: New test.
+
+2016-03-24 Tom de Vries <tom@codesourcery.com>
+
+ * gfortran.dg/goacc/host_data-tree.f95: Add missing initialization.
+
+2016-03-24 Tom de Vries <tom@codesourcery.com>
+
+ * c-c++-common/goacc/uninit-use-device-clause.c: New test.
+ * gfortran.dg/goacc/uninit-use-device-clause.f95: New test.
+
+2016-03-24 Tom de Vries <tom@codesourcery.com>
+
+ * c-c++-common/goacc/uninit-dim-clause.c: New test.
+ * gfortran.dg/goacc/uninit-dim-clause.f95: New test.
+
+2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/62212
+ * g++.dg/template/mangle2.C: New test.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70396
+ * gcc.dg/torture/pr70396.c: New testcase.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70370
+ * gcc.dg/torture/pr70370.c: New testcase.
+
+2016-03-24 Tom de Vries <tom@codesourcery.com>
+
+ * gfortran.dg/goacc/data-tree.f95: Add missing initialization.
+ * gfortran.dg/goacc/kernels-tree.f95: Same.
+ * gfortran.dg/goacc/parallel-tree.f95: Same.
+
+2016-03-24 Tom de Vries <tom@codesourcery.com>
+
+ * c-c++-common/goacc/uninit-if-clause.c: New test.
+ * gfortran.dg/goacc/uninit-if-clause.f95: New test.
+
+2016-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70290
+ * g++.dg/ext/pr70290.C: Add -Wno-psabi -w to dg-options. Formatting.
+
+2016-03-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70372
+ * gcc.dg/tree-ssa/pr70372.c: New testcase.
+
+2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70347
+ * g++.dg/cpp1y/nsdmi-union1.C: New test.
+
+2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70332
+ * g++.dg/cpp1y/nsdmi-aggr5.C: New test.
+
+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70001
+ * g++.dg/cpp0x/constexpr-70001-4.C: New test.
+ * g++.dg/cpp1y/pr70001.C: New test.
+
+ PR c++/70323
+ * g++.dg/cpp0x/constexpr-70323.C: New test.
+
+2016-03-23 Alexandre Oliva <aoliva@redhat.com>
+ Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/69315
+ * g++.dg/cpp0x/constexpr-69315.C: New test.
+ * g++.dg/cpp0x/variadic122.C: Change one dg-warning into dg-bogus.
+
+2016-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/69884
+ * g++.dg/warn/Wignored-attributes-1.C: New test.
+ * g++.dg/warn/Wignored-attributes-2.C: New test.
+
+2016-03-23 Tom de Vries <tom@codesourcery.com>
+
+ * c-c++-common/goacc/kernels-default.c (foo): Add missing
+ initialization.
+ * gfortran.dg/goacc/private-3.f95 (test): Same.
+ * gfortran.dg/goacc/routine-5.f90 (gang, worker, vector, seq): Add
+ missing use param.
+
+2016-03-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * lib/target-supports.exp: Remove v7ve entry from loop
+ creating effective target checks.
+ (check_effective_target_arm_arch_v7ve_ok): New procedure.
+ (add_options_for_arm_arch_v7ve): Likewise.
+
+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70354
+ * gcc.dg/vect/pr70354-1.c: New test.
+ * gcc.dg/vect/pr70354-2.c: New test.
+ * gcc.target/i386/avx2-pr70354-1.c: New test.
+ * gcc.target/i386/avx2-pr70354-2.c: New test.
+
+2016-03-22 Jeff Law <law@redhat.com>
+
+ PR target/70232
+ * gcc.dg/tree-ssa/pr70232.c: New test.
+
+2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR target/70302
+ * gcc.target/i386/pr70302.c: New test.
+
+2016-03-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70251
+ * g++.dg/torture/pr70251.C: New testcase.
+
+2016-03-22 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/69993
+ * c-c++-common/Wmisleading-indentation-3.c: New test, based on
+ Wmisleading-indentation.c.
+ * c-c++-common/Wmisleading-indentation.c: Update thoughout to
+ reflect change to diagnostic text and order of messages.
+ * gcc.dg/plugin/location-overflow-test-2.c: Likewise.
+
+2016-03-22 David Edelsohn <dje.gcc@gmail.com>
+
+ * g++.dg/ext/java-3.C: Don't compile on AIX.
+
+2016-03-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70333
+ * gcc.dg/torture/pr70333.c: New testcase.
+
+2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * g++.dg/ext/pr70290.C: New test.
+
+2016-03-22 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70325
+ * gcc.target/i386/pr70325.c: New test.
+
+2016-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70329
+ * gcc.target/i386/avx512bw-pr70329-1.c: New test.
+ * gcc.target/i386/avx512bw-pr70329-2.c: New test.
+
+ PR target/70300
+ * gcc.target/i386/pr70300.c: New test.
+
+ PR c++/70295
+ * c-c++-common/nonnull-1.c (func): Remove parens around cp4 != 0.
+ (func2): New function for cond with parens, xfail warning for c++.
+ * g++.dg/warn/Wnonnull-compare-8.C: New test.
+
+2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70096
+ * g++.dg/template/ptrmem30.C: New test.
+
+2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70204
+ * g++.dg/cpp0x/constexpr-70204a.C: New test.
+ * g++.dg/cpp0x/constexpr-70204b.C: New test.
+
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70326
+ * gcc.dg/pr70326.c: New test.
+
+2016-03-21 Marc Glisse <marc.glisse@inria.fr>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70317
+ * gcc.dg/pr70317.c: New test.
+
+2016-03-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70327
+ * gcc.target/i386/pr70327.c: New test.
+
+2016-03-21 Martin Liska <mliska@suse.cz>
+
+ PR ipa/70306
+ * gcc.dg/ipa/pr70306.c: New test.
+
+2016-03-21 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * gcc.target/arm/attr-align1.c: Skip if M-profile.
+ * gcc.target/arm/attr-align3.c: Likewise.
+ * gcc.target/arm/attr_arm.c: Likewise.
+ * gcc.target/arm/flip-thumb.c: Likewise.
+
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70296
+ * gcc.target/powerpc/altivec-36.c: New test.
+
+2016-03-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70310
+ * gcc.dg/torture/pr70310.c: New testcase.
+
+2016-03-21 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/70293
+ * gcc.target/i386/pr70293.c: New test.
+
+2016-03-21 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70288
+ * gcc.dg/torture/pr70288-1.c: New testcase.
+ * gcc.dg/torture/pr70288-2.c: Likewise.
+
+2016-03-21 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/69307
+ * gcc.target/arm/pr69307.c: New test.
+
+2016-03-21 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/69102
+ * gcc.c-torture/compile/pr69102.c: New test.
+
+2016-03-18 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/70263
+ * gcc.c-torture/compile/pr70263-1.c: New test.
+ * gcc.target/i386/pr70263-2.c: New test.
+
+2016-03-18 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/70278
+ * gcc.dg/torture/pr70278.c: New test.
+ * gcc.target/arm/pr70278.c: New test.
+
+2016-03-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/70281
+ * gcc.dg/plugin/diagnostic-test-expressions-1.c
+ (test_builtin_types_compatible_p): New test function.
+ * gcc.dg/pr70281.c: New test case.
+
+2016-03-18 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/70113
+ * gcc.target/aarch64/pr63304_1.c: Add -mno-fix-cortex-a53-843419.
+
+2016-03-18 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR tree-optimization/70252
+ * gcc.dg/pr70252.c: New test.
+
+2016-03-18 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/pr70161-2.c: New test.
+ * gcc.dg/pr70161.c: New test.
+
+2016-03-18 Tom de Vries <tom@codesourcery.com>
+
+ PR ipa/70269
+ * gcc.dg/pr70269.c: New test.
+
+2016-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70267
+ * g++.dg/ext/java-3.C: New test.
+
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70205
+ * g++.dg/lookup/pr70205.C: New test.
+
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70218
+ * g++.dg/cpp0x/lambda/lambda-70218.C: New test.
+
+2016-03-17 Marek Polacek <polacek@redhat.com>
+
+ PR c/69407
+ * gcc.dg/atomic-op-6.c: New test.
+
+2016-03-17 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/70264
+ * c-c++-common/pr70264.c: New test case.
+
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70144
+ * c-c++-common/pr70144-1.c: New test.
+ * c-c++-common/pr70144-2.c: New test.
+
+ PR c++/70272
+ * g++.dg/opt/flifetime-dse5.C (main): Remove extra semicolon.
+ * g++.dg/opt/flifetime-dse6.C: New test.
+ * g++.dg/tree-ssa/ehcleanup-1.C: Adjust unreachable count.
+
+2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR driver/70192
+ * gcc.dg/pic-1.c: New test.
+ * gcc.dg/pic-2.c: Likewise.
+ * gcc.dg/pic-3.c: Likewise.
+ * gcc.dg/pic-4.c: Likewise.
+ * gcc.dg/pie-1.c: Likewise.
+ * gcc.dg/pie-2.c: Likewise.
+ * gcc.dg/pie-3.c: Likewise.
+ * gcc.dg/pie-4.c: Likewise.
+ * gcc.dg/pie-5.c: Likewise.
+ * gcc.dg/pie-6.c: Likewise.
+
+2016-03-17 Tom de Vries <tom@codesourcery.com>
+
+ * gfortran.dg/goacc/kernels-alias-3.f95: New test.
+ * gfortran.dg/goacc/kernels-alias-4.f95: New test.
+
+2016-03-17 Richard Biener <rguenther@suse.de>
+
+ PR debug/70271
+ * g++.dg/debug/pr70271.C: New testcase.
+
+2016-03-17 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * gcc.target/i386/pr70251.c: New test.
+
+2016-03-17 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70194
+ * g++.dg/warn/constexpr-70194.C: New test.
+
+2016-03-16 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/70240
+ * gcc.c-torture/compile/pr70240.c: New.
+
+2016-03-16 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * gcc.c-torture/compile/20151204.c: Skip for avr.
+
+2016-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70245
+ * g++.dg/opt/pr70245.C: New test.
+ * g++.dg/opt/pr70245.h: New file.
+ * g++.dg/opt/pr70245-aux.cc: New file.
+
+2016-03-16 Martin Sebor <msebor@redhat.com>
+
+ * g++.dg/cpp1y/constexpr-instantiate.C: Correct DejaGnu directives.
+
+2016-03-16 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/70199
+ * gcc.c-torture/compile/pr70199.c: New.
+
+2016-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.dg/uninit-19.c: Run dos2unix.
+
+2016-03-16 Marek Polacek <polacek@redhat.com>
+
+ PR c/70093
+ * gcc.dg/nested-func-10.c: New test.
+ * gcc.dg/nested-func-9.c: New test.
+
+2016-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/68714
+ * gcc.dg/tree-ssa/pr68714.c: Add -w -Wno-psabi to dg-options.
+
+2016-03-16 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/68715
+ * gcc.dg/graphite/pr68715-2.c: New test.
+ * gcc.dg/graphite/pr68715.c: New test.
+ * gfortran.dg/graphite/pr68715.f90: New test.
+
+2016-03-16 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/68809
+ * gcc.dg/graphite/pr68809-2.c: New test.
+ * gcc.dg/graphite/pr68809.c: New test.
+
+2016-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70147
+ * g++.dg/ubsan/pr70147-2.C (C::C): Initialize A base with invalid
+ method call to i () as argument. Adjust expected output.
+
+ PR c++/70147
+ * g++.dg/ubsan/pr70147-1.C: New test.
+ * g++.dg/ubsan/pr70147-2.C: New test.
+
+2016-03-15 Martin Sebor <msebor@redhat.com>
+
+ PR c++/58281
+ * g++.dg/cpp1y/constexpr-instantiate.C: Add new test.
+
+2016-03-15 John David Anglin <danglin@gcc.gnu.org>
+
+ * gcc.c-torture/execute/pr68532.c: Add -fno-common option on
+ hppa*-*-hpux*.
+
+ * gcc.dg/ifcvt-4.c: Add hppa*64*-*-* to skip list.
+
+ PR libfortran/69799
+ * gfortran.dg/coarray_allocate_5.f08: Add "-latomic" option if
+ libatomic_available.
+
+2016-03-15 Marek Polacek <polacek@redhat.com>
+
+ PR c++/70209
+ * g++.dg/ext/attribute-may-alias-4.C: New test.
+
+2016-03-15 Alexander Monakov <amonakov@ispras.ru>
+
+ * g++.dg/pr63384.C: Add -w to dg-options. Remove '-toggle' in
+ -fvar-tracking-assignments-toggle flag.
+
+2016-03-15 Pat Haugen <pthaugen@us.ibm.com>
+
+ * gcc.dg/ifcvt-4.c: Add -misel for powerpc*.
+
+2016-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70222
+ * gcc.c-torture/execute/pr70222-1.c: New test.
+ * gcc.c-torture/execute/pr70222-2.c: New test.
+
+2016-03-15 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/tree-ssa/pr68714.c: Test during reassoc1 pass.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/69032
+ * gcc.dg/pr69032.c: New test.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/63384
+ * g++.dg/pr63384.C: New test.
+
+2016-03-15 Andrey Belevantsev <abel@ispras.ru>
+
+ PR target/64411
+ * gcc.target/i386/pr64411.C: New test.
+
+2016-03-15 Tom de Vries <tom@codesourcery.com>
+
+ * gfortran.dg/goacc/kernels-alias-2.f95: New test.
+ * gfortran.dg/goacc/kernels-alias.f95: New test.
+
+2016-03-14 Martin Sebor <msebor@redhat.com>
+
+ PR c++/53792
+ * g++.dg/cpp0x/constexpr-inline.C: New test.
+ * g++.dg/cpp0x/constexpr-inline-1.C: Same.
+
+2016-03-14 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.dg/torture/pr70083.c: Prune non-standard ABI.
+
+2016-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70219
+ * gcc.dg/pr70219.c: New test.
+
2016-03-14 Bernd Schmidt <bschmidt@redhat.com>
PR target/70083
@@ -319,7 +947,7 @@
* gcc.target/arm/pr45701-2.c: Likewise.
2016-02-26 Richard Biener <rguenther@suse.de>
- Jeff Law <law@redhat.com>
+ Jeff Law <law@redhat.com>
PR tree-optimization/69740
* gcc.c-torture/compile/pr69740-1.c: New test.
diff --git a/gcc/testsuite/ChangeLog.ibm b/gcc/testsuite/ChangeLog.ibm
index eb65dd14d9f..5eb53985782 100644
--- a/gcc/testsuite/ChangeLog.ibm
+++ b/gcc/testsuite/ChangeLog.ibm
@@ -1,3 +1,7 @@
+2016-03-30 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 234598.
+
2016-03-30 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/darn-0.c: New test.
diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c
new file mode 100644
index 00000000000..277a3885e21
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation-3.c
@@ -0,0 +1,82 @@
+/* Verify -Wmisleading-indentation with source-printing.
+ This is a subset of Wmisleading-indentation.c. */
+
+/* { dg-options "-Wmisleading-indentation -fdiagnostics-show-caret" } */
+/* { dg-do compile } */
+
+extern int foo (int);
+extern int bar (int, int);
+extern int flagA;
+extern int flagB;
+extern int flagC;
+extern int flagD;
+
+void
+fn_5 (double *a, double *b, double *sum, double *prod)
+{
+ int i = 0;
+ for (i = 0; i < 10; i++) /* { dg-warning "3: this 'for' clause does not guard..." } */
+ sum[i] = a[i] * b[i];
+ prod[i] = a[i] * b[i]; /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
+/* { dg-begin-multiline-output "" }
+ for (i = 0; i < 10; i++)
+ ^~~
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ prod[i] = a[i] * b[i];
+ ^~~~
+ { dg-end-multiline-output "" } */
+}
+
+/* Based on CVE-2014-1266 aka "goto fail" */
+int fn_6 (int a, int b, int c)
+{
+ int err;
+
+ /* ... */
+ if ((err = foo (a)) != 0)
+ goto fail;
+ if ((err = foo (b)) != 0) /* { dg-message "2: this 'if' clause does not guard..." } */
+ goto fail;
+ goto fail; /* { dg-message "3: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
+ if ((err = foo (c)) != 0)
+ goto fail;
+ /* ... */
+
+/* { dg-begin-multiline-output "" }
+ if ((err = foo (b)) != 0)
+ ^~
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ goto fail;
+ ^~~~
+ { dg-end-multiline-output "" } */
+
+fail:
+ return err;
+}
+
+#define FOR_EACH(VAR, START, STOP) \
+ for ((VAR) = (START); (VAR) < (STOP); (VAR++)) /* { dg-warning "3: this 'for' clause does not guard..." } */
+
+void fn_14 (void)
+{
+ int i;
+ FOR_EACH (i, 0, 10) /* { dg-message "in expansion of macro .FOR_EACH." } */
+ foo (i);
+ bar (i, i); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
+
+/* { dg-begin-multiline-output "" }
+ for ((VAR) = (START); (VAR) < (STOP); (VAR++))
+ ^
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ FOR_EACH (i, 0, 10)
+ ^~~~~~~~
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ bar (i, i);
+ ^~~
+ { dg-end-multiline-output "" } */
+}
+#undef FOR_EACH
diff --git a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
index ba512e779a2..dcc66e7f6fc 100644
--- a/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
+++ b/gcc/testsuite/c-c++-common/Wmisleading-indentation.c
@@ -12,17 +12,17 @@ int
fn_1 (int flag)
{
int x = 4, y = 5;
- if (flag) /* { dg-message "3: ...this 'if' clause, but it is not" } */
+ if (flag) /* { dg-warning "3: this 'if' clause does not guard..." } */
x = 3;
- y = 2; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ y = 2; /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
return x * y;
}
int
fn_2 (int flag, int x, int y)
{
- if (flag) /* { dg-message "3: ...this 'if' clause, but it is not" } */
- x++; y++; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ if (flag) /* { dg-warning "3: this 'if' clause does not guard..." } */
+ x++; y++; /* { dg-message "10: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
return x * y;
}
@@ -33,9 +33,9 @@ fn_3 (int flag)
int x = 4, y = 5;
if (flag)
x = 3;
- else /* { dg-message "3: ...this 'else' clause, but it is not" } */
+ else /* { dg-warning "3: this 'else' clause does not guard..." } */
x = 2;
- y = 2; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ y = 2; /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'" } */
return x * y;
}
@@ -43,18 +43,18 @@ void
fn_4 (double *a, double *b, double *c)
{
int i = 0;
- while (i < 10) /* { dg-message "3: ...this 'while' clause, but it is not" } */
+ while (i < 10) /* { dg-warning "3: this 'while' clause does not guard..." } */
a[i] = b[i] * c[i];
- i++; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ i++; /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'" } */
}
void
fn_5 (double *a, double *b, double *sum, double *prod)
{
int i = 0;
- for (i = 0; i < 10; i++) /* { dg-output "3: ...this 'for' clause, but it is not" } */
+ for (i = 0; i < 10; i++) /* { dg-warning "3: this 'for' clause does not guard..." } */
sum[i] = a[i] * b[i];
- prod[i] = a[i] * b[i]; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ prod[i] = a[i] * b[i]; /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
}
/* Based on CVE-2014-1266 aka "goto fail" */
@@ -65,9 +65,9 @@ int fn_6 (int a, int b, int c)
/* ... */
if ((err = foo (a)) != 0)
goto fail;
- if ((err = foo (b)) != 0) /* { dg-message "2: ...this 'if' clause, but it is not" } */
+ if ((err = foo (b)) != 0) /* { dg-message "2: this 'if' clause does not guard..." } */
goto fail;
- goto fail; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ goto fail; /* { dg-message "3: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
if ((err = foo (c)) != 0)
goto fail;
/* ... */
@@ -80,8 +80,8 @@ int fn_7 (int p, int q, int r, int s, int t)
{
if (bar (p, q))
{
- if (p) /* { dg-message "7: ...this 'if' clause, but it is not" } */
- q++; r++; /* { dg-warning "statement is indented as if it were guarded by..." } */
+ if (p) /* { dg-message "7: this 'if' clause does not guard..." } */
+ q++; r++; /* { dg-message "14: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
t++;
}
return p + q + r + s + t;
@@ -95,20 +95,20 @@ int fn_8 (int a, int b, int c)
void fn_9 (int flag)
{
- if (flag) /* { dg-message "3: ...this 'if' clause, but it is not" } */
+ if (flag) /* { dg-warning "3: this 'if' clause does not guard..." } */
foo (0);
- foo (1); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
void fn_10 (int flag)
{
- if (flag) /* { dg-message "3: ...this 'if' clause, but it is not" } */
+ if (flag) /* { dg-warning "3: this 'if' clause does not guard..." } */
if (flag / 2)
{
foo (0);
foo (1);
}
- foo (2); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (2); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
foo (3);
}
@@ -116,48 +116,48 @@ void fn_11 (void)
{
if (flagA)
if (flagB)
- if (flagC) /* { dg-message "7: ...this 'if' clause, but it is not" } */
+ if (flagC) /* { dg-message "7: this 'if' clause does not guard..." } */
foo (0);
- bar (1, 2); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ bar (1, 2); /* { dg-message "9: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
void fn_12 (void)
{
if (flagA)
- if (flagB) /* { dg-message "5: ...this 'if' clause, but it is not" } */
+ if (flagB) /* { dg-message "5: this 'if' clause does not guard..." } */
if (flagC)
foo (0);
- bar (1, 2); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ bar (1, 2); /* { dg-message "7: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
void fn_13 (void)
{
- if (flagA) /* { dg-message "3: ...this 'if' clause, but it is not" } */
+ if (flagA) /* { dg-warning "3: this 'if' clause does not guard..." } */
if (flagB)
if (flagC)
foo (0);
- bar (1, 2); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ bar (1, 2); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
#define FOR_EACH(VAR, START, STOP) \
- for ((VAR) = (START); (VAR) < (STOP); (VAR++)) /* { dg-message "3: ...this 'for' clause, but it is not" } */
+ for ((VAR) = (START); (VAR) < (STOP); (VAR++)) /* { dg-warning "3: this 'for' clause does not guard..." } */
void fn_14 (void)
{
int i;
- FOR_EACH (i, 0, 10) /* { dg-message "3: in expansion of macro" } */
+ FOR_EACH (i, 0, 10) /* { dg-message "in expansion of macro .FOR_EACH." } */
foo (i);
- bar (i, i); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ bar (i, i); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
}
#undef FOR_EACH
-#define FOR_EACH(VAR, START, STOP) for ((VAR) = (START); (VAR) < (STOP); (VAR++)) /* { dg-message "36: ...this 'for' clause, but it is not" } */
+#define FOR_EACH(VAR, START, STOP) for ((VAR) = (START); (VAR) < (STOP); (VAR++)) /* { dg-message "36: this 'for' clause does not guard..." } */
void fn_15 (void)
{
int i;
- FOR_EACH (i, 0, 10) /* { dg-message "3: in expansion of macro" } */
+ FOR_EACH (i, 0, 10) /* { dg-message "in expansion of macro .FOR_EACH." } */
foo (i);
- bar (i, i); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ bar (i, i); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
}
#undef FOR_EACH
@@ -166,9 +166,9 @@ void fn_16_spaces (void)
int i;
for (i = 0; i < 10; i++)
while (flagA)
- if (flagB) /* { dg-message "7: ...this 'if' clause, but it is not" } */
+ if (flagB) /* { dg-message "7: this 'if' clause does not guard..." } */
foo (0);
- foo (1); /* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1); /* { dg-message "9: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
void fn_16_tabs (void)
@@ -176,49 +176,49 @@ void fn_16_tabs (void)
int i;
for (i = 0; i < 10; i++)
while (flagA)
- if (flagB) /* { dg-message "7: ...this 'if' clause, but it is not" } */
+ if (flagB) /* { dg-message "7: this 'if' clause does not guard..." } */
foo (0);
- foo (1);/* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1);/* { dg-message "2: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
}
void fn_17_spaces (void)
{
int i;
- for (i = 0; i < 10; i++) /* { dg-message "3: ...this 'for' clause, but it is not" } */
+ for (i = 0; i < 10; i++) /* { dg-warning "3: this 'for' clause does not guard..." } */
while (flagA)
if (flagB)
foo (0);
- foo (1);/* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1);/* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
}
void fn_17_tabs (void)
{
int i;
- for (i = 0; i < 10; i++) /* { dg-message "3: ...this 'for' clause, but it is not" } */
+ for (i = 0; i < 10; i++) /* { dg-warning "3: this 'for' clause does not guard..." } */
while (flagA)
if (flagB)
foo (0);
- foo (1);/* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1);/* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'" } */
}
void fn_18_spaces (void)
{
int i;
for (i = 0; i < 10; i++)
- while (flagA) /* { dg-message "5: ...this 'while' clause, but it is not" } */
+ while (flagA) /* { dg-message "5: this 'while' clause does not guard..." } */
if (flagB)
foo (0);
- foo (1);/* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1);/* { dg-message "7: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'" } */
}
void fn_18_tabs (void)
{
int i;
for (i = 0; i < 10; i++)
- while (flagA) /* { dg-message "5: ...this 'while' clause, but it is not" } */
+ while (flagA) /* { dg-message "5: this 'while' clause does not guard..." } */
if (flagB)
foo (0);
- foo (1);/* { dg-warning "statement is indented as if it were guarded by..." } */
+ foo (1);/* { dg-message "7: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'" } */
}
/* This shouldn't lead to a warning. */
@@ -701,108 +701,108 @@ fn_37 (void)
int i;
#define EMPTY
-#define FOR_EACH(VAR, START, STOP) for (VAR = START; VAR < STOP; VAR++)
+#define FOR_EACH(VAR, START, STOP) for (VAR = START; VAR < STOP; VAR++) /* { dg-warning "this 'for' clause" } */
- while (flagA); /* { dg-message "3: ...this 'while' clause" } */
- foo (0); /* { dg-warning "statement is indented as if" } */
+ while (flagA); /* { dg-warning "3: this 'while' clause" } */
+ foo (0); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'" } */
if (flagA)
;
- else if (flagB); /* { dg-message "8: ...this 'if' clause" } */
- foo (0); /* { dg-warning "statement is indented as if" } */
- while (flagA) /* { dg-message "3: ...this 'while' clause" } */
+ else if (flagB); /* { dg-warning "8: this 'if' clause" } */
+ foo (0); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
+ while (flagA) /* { dg-warning "3: this 'while' clause" } */
/* blah */;
- foo (0); /* { dg-warning "statement is indented as if" } */
+ foo (0); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'" } */
if (flagA)
;
- else if (flagB) /* { dg-message "8: ...this 'if' clause" } */
+ else if (flagB) /* { dg-warning "8: this 'if' clause" } */
foo (1);
- foo (2); /* { dg-warning "statement is indented as if" } */
+ foo (2); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
if (flagA)
foo (1);
- else if (flagB) /* { dg-message "8: ...this 'if' clause" } */
+ else if (flagB) /* { dg-warning "8: this 'if' clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented as if" } */
+ foo (3); /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
- if (flagB) /* { dg-message "3: ...this 'if' clause" } */
+ if (flagB) /* { dg-warning "3: this 'if' clause" } */
/* blah */;
- { /* { dg-warning "statement is indented as if" } */
+ { /* { dg-message "5: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
foo (0);
}
- if (flagB) /* { dg-message "3: ...this 'if' clause" } */
+ if (flagB) /* { dg-warning "3: this 'if' clause" } */
/* blah */;
- { /* { dg-warning "statement is indented as if" } */
+ { /* { dg-message "4: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'" } */
foo (0);
}
if (flagB)
;
- else; foo (0); /* { dg-warning "statement is indented as if" } */
+ else; foo (0); /* { dg-warning "3: this 'else' clause" } */
- if (flagC); foo (2); /* { dg-warning "statement is indented as if" } */
+ if (flagC); foo (2); /* { dg-warning "3: this 'if' clause" } */
- if (flagA)
- ; /* blah */ { /* { dg-warning "statement is indented as if" } */
+ if (flagA) /* { dg-warning "3: this 'if' clause" } */
+ ; /* blah */ { /* { dg-message "18: ...this statement" } */
foo (1);
}
- if (flagB) ; /* { dg-message "3: ...this 'if' clause" } */
- return; /* { dg-warning "statement is indented as if" } */
+ if (flagB) ; /* { dg-warning "3: this 'if' clause" } */
+ return; /* { dg-message "5: ...this statement" } */
- if (flagB) EMPTY; /* { dg-message "3: ...this 'if' clause" } */
- foo (1); /* { dg-warning "statement is indented as if" } */
+ if (flagB) EMPTY; /* { dg-warning "3: this 'if' clause" } */
+ foo (1); /* { dg-message "5: ...this statement" } */
- for (i = 0; i < 10; i++); /* { dg-message "3: ...this 'for' clause" } */
- foo (2); /* { dg-warning "statement is indented as if" } */
+ for (i = 0; i < 10; i++); /* { dg-warning "3: this 'for' clause" } */
+ foo (2); /* { dg-message "5: ...this statement" } */
- FOR_EACH (i, 0, 10);
- foo (2); /* { dg-warning "statement is indented as if" } */
+ FOR_EACH (i, 0, 10); /* { dg-message "3: in expansion of macro .FOR_EACH." } */
+ foo (2); /* { dg-message "5: ...this statement" } */
- FOR_EACH (i, 0, 10);
- { /* { dg-warning "statement is indented as if" } */
+ FOR_EACH (i, 0, 10); /* { dg-message "3: in expansion of macro .FOR_EACH." } */
+ { /* { dg-message "5: ...this statement" } */
foo (3);
}
- FOR_EACH (i, 0, 10);
- { /* { dg-warning "statement is indented as if" } */
+ FOR_EACH (i, 0, 10); /* { dg-message "3: in expansion of macro .FOR_EACH." } */
+ { /* { dg-message "3: ...this statement" } */
foo (3);
}
- while (i++); { /* { dg-warning "statement is indented as if" } */
+ while (i++); { /* { dg-warning "3: this 'while' clause" } */
foo (3);
}
- if (i++); { /* { dg-warning "statement is indented as if" } */
+ if (i++); { /* { dg-warning "3: this 'if' clause" } */
foo (3);
}
if (flagA) {
foo (1);
- } else /* { dg-message "5: ...this 'else' clause" } */
+ } else /* { dg-warning "5: this 'else' clause" } */
if (flagB)
foo (2);
- foo (3); /* { dg-warning "statement is indented as if" } */
+ foo (3); /* { dg-message "5: ...this statement" } */
if (flagA)
foo (1);
- else if (flagB); /* { dg-message "8: ...this 'if' clause" } */
- foo (2); /* { dg-warning "statement is indented as if" } */
+ else if (flagB); /* { dg-warning "8: this 'if' clause" } */
+ foo (2); /* { dg-message "5: ...this statement" } */
- for (i = 0; /* { dg-message "3: ...this 'for' clause" } */
+ for (i = 0; /* { dg-warning "3: this 'for' clause" } */
i < 10;
i++);
- foo (i); /* { dg-warning "statement is indented as if" } */
+ foo (i); /* { dg-message "5: ...this statement" } */
if (flagA)
{
foo (1);
}
- else if (flagB); /* { dg-message "8: ...this 'if' clause" } */
- { /* { dg-warning "statement is indented as if" } */
+ else if (flagB); /* { dg-warning "8: this 'if' clause" } */
+ { /* { dg-message "3: ...this statement" } */
foo (2);
}
@@ -1025,10 +1025,10 @@ fn_42_b (int locked)
if (locked)
i = foo (0);
- else /* { dg-message "...this .else. clause" } */
+ else /* { dg-warning "this .else. clause" } */
i = foo (1);
engine_ref_debug(e, 0, -1)
- if (i > 0) /* { dg-warning "statement is indented" } */
+ if (i > 0) /* { dg-message "...this statement" } */
return 1;
return 0;
#undef engine_ref_debug
@@ -1117,7 +1117,7 @@ test43_c (void)
foo (1);
} else if (flagB) /* { dg-message "...this .if. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Aligned with the "else". Likewise, we should warn. */
@@ -1129,7 +1129,7 @@ test43_d (void)
foo (1);
} else if (flagB) /* { dg-message "...this .if. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Indented between the "else" and the "if". Likewise, we should warn. */
@@ -1141,7 +1141,7 @@ test43_e (void)
foo (1);
} else if (flagB) /* { dg-message "...this .if. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Aligned with the "if". Likewise, we should warn. */
@@ -1151,9 +1151,9 @@ test43_f (void)
{
if (flagA) {
foo (1);
- } else if (flagB) /* { dg-message "...this .else. clause" } */
+ } else if (flagB) /* { dg-warning "this .else. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Indented more than the "if". Likewise, we should warn. */
@@ -1165,7 +1165,7 @@ test43_g (void)
foo (1);
} else if (flagB) /* { dg-message "...this .if. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Again, but without the 2nd "if". */
@@ -1210,9 +1210,9 @@ test44_c (void)
{
if (flagA) {
foo (1);
- } else /* { dg-message "...this .else. clause" } */
+ } else /* { dg-warning "this .else. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Aligned with the "else". Likewise, we should warn. */
@@ -1222,9 +1222,9 @@ test44_d (void)
{
if (flagA) {
foo (1);
- } else /* { dg-message "...this .else. clause" } */
+ } else /* { dg-warning "this .else. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
/* Indented more than the "else". Likewise, we should warn. */
@@ -1234,7 +1234,7 @@ test44_e (void)
{
if (flagA) {
foo (1);
- } else /* { dg-message "...this .else. clause" } */
+ } else /* { dg-warning "this .else. clause" } */
foo (2);
- foo (3); /* { dg-warning "statement is indented" } */
+ foo (3); /* { dg-message "...this statement" } */
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
index 95e6cab02c1..138b82c187c 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
@@ -2,6 +2,17 @@
/* { dg-options "-fcilkplus" } */
/* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int __cilkrts_set_param (const char *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+
void f0(volatile int *steal_flag)
{
int i = 0;
@@ -32,6 +43,10 @@ void f3()
int main()
{
+ /* Ensure more than one worker. */
+ if (__cilkrts_set_param("nworkers", "2") != 0)
+ __builtin_abort();
+
f3();
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
index 6e2876531c3..6b41c7faf04 100644
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
@@ -2,8 +2,16 @@
/* { dg-options "-fcilkplus" } */
/* { dg-additional-options "-lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
-// #include <cilk/cilk_api.h>
-extern void __cilkrts_set_param (char *, char *);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int __cilkrts_set_param (const char *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
void foo(volatile int *);
@@ -11,7 +19,10 @@ void main2(void);
int main(void)
{
- // __cilkrts_set_param ((char *)"nworkers", (char *)"2");
+ /* Ensure more than one worker. */
+ if (__cilkrts_set_param("nworkers", "2") != 0)
+ __builtin_abort();
+
main2();
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c
index dabba8cb5ea..aaf0e7a4ee6 100644
--- a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c
+++ b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c
@@ -20,12 +20,12 @@ f_acc_kernels (void)
}
}
+#pragma acc routine vector
void
f_acc_loop (void)
{
int i;
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
diff --git a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
index 5e3f183998a..1a3324200e2 100644
--- a/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
+++ b/gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c
@@ -1,4 +1,5 @@
extern int i;
+#pragma acc declare create(i)
void
f_omp (void)
@@ -14,6 +15,9 @@ f_omp (void)
#pragma acc update host(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
#pragma acc enter data copyin(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
#pragma acc exit data delete(i) /* { dg-error "OpenACC construct inside of non-OpenACC region" } */
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+ for (i = 0; i < 2; ++i)
+ ;
}
#pragma omp for
@@ -358,85 +362,77 @@ f_acc_data (void)
}
}
+#pragma acc routine
void
f_acc_loop (void)
{
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp parallel /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp parallel /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp for /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp for /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
for (i = 0; i < 3; i++)
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp sections /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp sections /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
{
;
}
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp single /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp single /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp task /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp task /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp master /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp master /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp critical /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp critical /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp ordered /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp ordered /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
}
-#pragma acc parallel
#pragma acc loop
for (i = 0; i < 2; ++i)
{
-#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
-#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
;
-#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
+#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC routine" } */
}
}
diff --git a/gcc/testsuite/c-c++-common/goacc/clauses-fail.c b/gcc/testsuite/c-c++-common/goacc/clauses-fail.c
index 661d364f066..853d010d038 100644
--- a/gcc/testsuite/c-c++-common/goacc/clauses-fail.c
+++ b/gcc/testsuite/c-c++-common/goacc/clauses-fail.c
@@ -1,3 +1,5 @@
+/* Miscellaneous tests where clause parsing is expected to fail. */
+
void
f (void)
{
@@ -17,3 +19,13 @@ f (void)
for (i = 0; i < 2; ++i)
;
}
+
+
+void
+f2 (void)
+{
+ int a, b[100];
+
+#pragma acc parallel firstprivate (b[10:20]) /* { dg-error "expected ... before ... token" } */
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/combined-directives.c b/gcc/testsuite/c-c++-common/goacc/combined-directives.c
index c3872851298..c2a3c57b48b 100644
--- a/gcc/testsuite/c-c++-common/goacc/combined-directives.c
+++ b/gcc/testsuite/c-c++-common/goacc/combined-directives.c
@@ -1,10 +1,7 @@
-// { dg-do compile }
-// { dg-options "-fopenacc -fdump-tree-gimple" }
+// { dg-additional-options "-fdump-tree-gimple" }
-// This error is temporary. Remove when support is added for these clauses
-// in the middle end. Also remove the comments from the reduction test
+// Remove the comments from the reduction test
// after the FE learns that reduction variables may appear in data clauses too.
-// { dg-prune-output "sorry, unimplemented" }
void
test ()
diff --git a/gcc/testsuite/c-c++-common/goacc/use_device-1.c b/gcc/testsuite/c-c++-common/goacc/host_data-1.c
index 9a4f6d079f3..0c7a857d0bf 100644
--- a/gcc/testsuite/c-c++-common/goacc/use_device-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/host_data-1.c
@@ -1,4 +1,14 @@
-/* { dg-do compile } */
+/* Test valid use of host_data directive. */
+
+int v1[3][3];
+
+void
+f (void)
+{
+#pragma acc host_data use_device(v1)
+ ;
+}
+
void bar (float *, float *);
diff --git a/gcc/testsuite/c-c++-common/goacc/host_data-2.c b/gcc/testsuite/c-c++-common/goacc/host_data-2.c
new file mode 100644
index 00000000000..bdce42472b9
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/host_data-2.c
@@ -0,0 +1,78 @@
+/* Test invalid use of host_data directive. */
+
+int v0;
+#pragma acc host_data use_device(v0) /* { dg-error "expected declaration specifiers before" } */
+
+
+void
+f (void)
+{
+ int v2 = 3;
+#pragma acc host_data copy(v2) /* { dg-error ".copy. is not valid for ..pragma acc host_data." } */
+ ;
+
+#pragma acc host_data use_device(v2)
+ ;
+ /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } 14 } */
+ /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an arraynor reference to pointer or array" "" { target c++ } 14 } */
+
+#pragma acc host_data use_device(v0)
+ ;
+ /* { dg-error ".use_device_ptr. variable is neither a pointer nor an array" "" { target c } 19 } */
+ /* { dg-error ".use_device_ptr. variable is neither a pointer, nor an arraynor reference to pointer or array" "" { target c++ } 19 } */
+}
+
+
+void
+f2 (void)
+{
+ int x[100];
+
+#pragma acc enter data copyin (x)
+ /* Specifying an array index is not valid for host_data/use_device. */
+#pragma acc host_data use_device (x[4]) /* { dg-error "expected '\\\)' before '\\\[' token" } */
+ ;
+#pragma acc exit data delete (x)
+}
+
+
+void
+f3 (void)
+{
+ int x[100];
+
+#pragma acc data copyin (x[25:50])
+ {
+ int *xp;
+#pragma acc host_data use_device (x)
+ {
+ /* This use of the present clause is undefined behavior for OpenACC. */
+#pragma acc parallel present (x) copyout (xp) /* { dg-error "variable .x. declared in enclosing .host_data. region" } */
+ {
+ xp = x;
+ }
+ }
+ }
+}
+
+
+void
+f4 (void)
+{
+ int x[50];
+
+#pragma acc data copyin (x[10:30])
+ {
+ int *xp;
+#pragma acc host_data use_device (x)
+ {
+ /* Here 'x' being implicitly firstprivate for the parallel region
+ conflicts with it being declared as use_device in the enclosing
+ host_data region. */
+#pragma acc parallel copyout (xp)
+ {
+ xp = x; /* { dg-error "variable .x. declared in enclosing .host_data. region" } */
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/host_data-5.c b/gcc/testsuite/c-c++-common/goacc/host_data-5.c
deleted file mode 100644
index a4206c8b930..00000000000
--- a/gcc/testsuite/c-c++-common/goacc/host_data-5.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* { dg-do compile } */
-
-#define N 1024
-
-int main (int argc, char* argv[])
-{
- int x[N];
-
-#pragma acc data copyin (x[0:N])
- {
- int *xp;
-#pragma acc host_data use_device (x)
- {
- /* This use of the present clause is undefined behavior for OpenACC. */
-#pragma acc parallel present (x) copyout (xp) /* { dg-error "variable 'x' declared in enclosing 'host_data' region" } */
- {
- xp = x;
- }
- }
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/goacc/host_data-6.c b/gcc/testsuite/c-c++-common/goacc/host_data-6.c
deleted file mode 100644
index 8be7912e280..00000000000
--- a/gcc/testsuite/c-c++-common/goacc/host_data-6.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do compile } */
-
-#define N 1024
-
-int main (int argc, char* argv[])
-{
- int x[N];
-
-#pragma acc data copyin (x[0:N])
- {
- int *xp;
-#pragma acc host_data use_device (x)
- {
- /* Here 'x' being implicitly firstprivate for the parallel region
- conflicts with it being declared as use_device in the enclosing
- host_data region. */
-#pragma acc parallel copyout (xp)
- {
- xp = x; /* { dg-error "variable 'x' declared in enclosing 'host_data' region" } */
- }
- }
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-1.c b/gcc/testsuite/c-c++-common/goacc/kernels-1.c
index e91b81c8d04..4fcf86eca69 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-1.c
@@ -1,6 +1,45 @@
-void
-foo (void)
+int
+kernels_empty (void)
{
#pragma acc kernels
;
+
+ return 0;
+}
+
+int
+kernels_eternal (void)
+{
+#pragma acc kernels
+ {
+ while (1)
+ ;
+ }
+
+ return 0;
+}
+
+int
+kernels_noreturn (void)
+{
+#pragma acc kernels
+ __builtin_abort ();
+
+ return 0;
+}
+
+
+float b[10][15][10];
+
+void
+kernels_loop_ptr_it (void)
+{
+ float *i;
+
+#pragma acc kernels
+ {
+#pragma acc loop
+ for (i = &b[0][0][0]; i < &b[0][0][10]; i++)
+ ;
+ }
}
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-default.c b/gcc/testsuite/c-c++-common/goacc/kernels-default.c
index 58cd5e10a5b..cb031c11a34 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-default.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-default.c
@@ -4,7 +4,7 @@
void
foo (void)
{
- unsigned int i;
+ unsigned int i = 0;
#pragma acc kernels
{
i++;
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-empty.c b/gcc/testsuite/c-c++-common/goacc/kernels-empty.c
deleted file mode 100644
index e91b81c8d04..00000000000
--- a/gcc/testsuite/c-c++-common/goacc/kernels-empty.c
+++ /dev/null
@@ -1,6 +0,0 @@
-void
-foo (void)
-{
-#pragma acc kernels
- ;
-}
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-eternal.c b/gcc/testsuite/c-c++-common/goacc/kernels-eternal.c
deleted file mode 100644
index edc17d2960c..00000000000
--- a/gcc/testsuite/c-c++-common/goacc/kernels-eternal.c
+++ /dev/null
@@ -1,11 +0,0 @@
-int
-main (void)
-{
-#pragma acc kernels
- {
- while (1)
- ;
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-noreturn.c b/gcc/testsuite/c-c++-common/goacc/kernels-noreturn.c
deleted file mode 100644
index 1a8cc6778e8..00000000000
--- a/gcc/testsuite/c-c++-common/goacc/kernels-noreturn.c
+++ /dev/null
@@ -1,12 +0,0 @@
-int
-main (void)
-{
-
-#pragma acc kernels
- {
- __builtin_abort ();
- }
-
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c b/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
new file mode 100644
index 00000000000..01ad32d6eac
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
@@ -0,0 +1,189 @@
+void K(void)
+{
+ int i, j;
+
+#pragma acc kernels
+ {
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(num:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 0; j < 10; j++)
+ { }
+#pragma acc loop worker
+ for (j = 0; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "inner loop uses same" }
+ for (j = 0; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq gang // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker(num:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 0; j < 10; j++)
+ { }
+#pragma acc loop worker // { dg-error "inner loop uses same" }
+ for (j = 0; j < 10; j++)
+ { }
+#pragma acc loop gang
+ for (j = 0; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq worker // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector(length:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq vector // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop seq auto // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+ }
+
+#pragma acc kernels loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang(num:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc kernels loop worker
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop worker(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop worker(num:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop seq worker // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc kernels loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc kernels loop vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop vector(5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop vector(length:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop seq vector // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc kernels loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc kernels loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop seq auto // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc kernels loop gang auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+#pragma acc kernels loop worker auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+#pragma acc kernels loop vector auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/loop-2-parallel.c b/gcc/testsuite/c-c++-common/goacc/loop-2-parallel.c
new file mode 100644
index 00000000000..0ef5741ca4b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/loop-2-parallel.c
@@ -0,0 +1,162 @@
+void P(void)
+{
+ int i, j;
+
+#pragma acc parallel
+ {
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang // { dg-message "containing loop" }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq gang // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker // { dg-message "containing loop" 2 }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq worker // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector
+ for (i = 0; i < 10; i++)
+ { }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector // { dg-message "containing loop" 3 }
+ for (i = 0; i < 10; i++)
+ {
+#pragma acc loop vector // { dg-error "inner loop uses same" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop worker // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+#pragma acc loop gang // { dg-error "incorrectly nested" }
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop seq vector // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop seq auto // { dg-error "'seq' overrides" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector auto // { dg-error "'auto' conflicts" }
+ for (i = 0; i < 10; i++)
+ { }
+
+ }
+
+#pragma acc parallel loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop gang
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop gang(static:5)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop gang(static:*)
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc parallel loop seq gang // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+
+#pragma acc parallel loop worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc parallel loop seq worker // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc parallel loop gang worker
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc parallel loop vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc parallel loop seq vector // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc parallel loop gang vector
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop worker vector
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc parallel loop auto
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop seq auto // { dg-error "'seq' overrides" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'seq' overrides" "" { target c++ } }
+ { }
+#pragma acc parallel loop gang auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+#pragma acc parallel loop worker auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+#pragma acc parallel loop vector auto // { dg-error "'auto' conflicts" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "'auto' conflicts" "" { target c++ } }
+ { }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/loop-3.c b/gcc/testsuite/c-c++-common/goacc/loop-3.c
new file mode 100644
index 00000000000..44b65a8bf57
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/loop-3.c
@@ -0,0 +1,58 @@
+void par1 (void)
+{
+ int i, j;
+
+#pragma acc parallel
+ {
+#pragma acc loop gang(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop gang(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop worker(num:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector(5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+#pragma acc loop vector(length:5) // { dg-error "argument not permitted" }
+ for (i = 0; i < 10; i++)
+ { }
+
+ }
+}
+
+void p2 (void)
+{
+ int i, j;
+
+#pragma acc parallel loop gang(5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+#pragma acc parallel loop gang(num:5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+
+#pragma acc parallel loop worker(5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+#pragma acc parallel loop worker(num:5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+
+#pragma acc parallel loop vector(5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+#pragma acc parallel loop vector(length:5) // { dg-error "argument not permitted" "" { target c } }
+ for (i = 0; i < 10; i++) // { dg-error "argument not permitted" "" { target c++ } }
+ { }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/loop-clauses.c b/gcc/testsuite/c-c++-common/goacc/loop-clauses.c
index 97b8786a290..f3c720730ea 100644
--- a/gcc/testsuite/c-c++-common/goacc/loop-clauses.c
+++ b/gcc/testsuite/c-c++-common/goacc/loop-clauses.c
@@ -1,7 +1,3 @@
-/* { dg-do compile } */
-
-/* { dg-prune-output "sorry, unimplemented" } */
-
int
main ()
{
diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-1.c
index 3a8f838906c..cab4f98950d 100644
--- a/gcc/testsuite/c-c++-common/goacc/nesting-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/nesting-1.c
@@ -58,10 +58,6 @@ f_acc_data (void)
#pragma acc exit data delete(i)
-#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
- for (i = 0; i < 2; ++i)
- ;
-
#pragma acc data
{
#pragma acc parallel
@@ -92,10 +88,6 @@ f_acc_data (void)
#pragma acc enter data copyin(i)
#pragma acc exit data delete(i)
-
-#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
- for (i = 0; i < 2; ++i)
- ;
}
}
}
diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
index 506a1aeaa6a..93a911120d4 100644
--- a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c
@@ -38,6 +38,25 @@ f_acc_kernels (void)
}
}
+void
+f_acc_data (void)
+{
+ unsigned int i;
+#pragma acc data
+ {
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+ for (i = 0; i < 2; ++i)
+ ;
+
+#pragma acc data
+ {
+#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+ for (i = 0; i < 2; ++i)
+ ;
+ }
+ }
+}
+
#pragma acc routine
void
f_acc_routine (void)
@@ -45,3 +64,13 @@ f_acc_routine (void)
#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */
;
}
+
+void
+f (void)
+{
+ int i, v = 0;
+
+#pragma acc loop gang reduction (+:v) /* { dg-error "loop directive must be associated with an OpenACC compute region" } */
+ for (i = 0; i < 10; i++)
+ v++;
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/parallel-1.c b/gcc/testsuite/c-c++-common/goacc/parallel-1.c
index a8605266747..6c6cc88ecad 100644
--- a/gcc/testsuite/c-c++-common/goacc/parallel-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/parallel-1.c
@@ -1,6 +1,38 @@
-void
-foo (void)
+int
+parallel_empty (void)
{
#pragma acc parallel
;
+
+ return 0;
+}
+
+int
+parallel_eternal (void)
+{
+#pragma acc parallel
+ {
+ while (1)
+ ;
+ }
+
+ return 0;
+}
+
+int
+parallel_noreturn (void)
+{
+#pragma acc parallel
+ __builtin_abort ();
+
+ return 0;
+}
+
+int
+parallel_clauses (void)
+{
+ int a, b[100];
+
+#pragma acc parallel firstprivate (a, b)
+ ;
}
diff --git a/gcc/testsuite/c-c++-common/goacc/reduction-1.c b/gcc/testsuite/c-c++-common/goacc/reduction-1.c
index de97125b4cf..3c1c2dda6cf 100644
--- a/gcc/testsuite/c-c++-common/goacc/reduction-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/reduction-1.c
@@ -1,70 +1,65 @@
-/* { dg-require-effective-target alloca } */
/* Integer reductions. */
-#define vl 32
+#define n 1000
int
main(void)
{
- const int n = 1000;
int i;
int result, array[n];
int lresult;
/* '+' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (+:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (+:result)
for (i = 0; i < n; i++)
result += array[i];
/* '*' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (*:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (*:result)
for (i = 0; i < n; i++)
result *= array[i];
-// result = 0;
-// vresult = 0;
-//
-// /* 'max' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result > array[i] ? result : array[i];
-//
-// /* 'min' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result < array[i] ? result : array[i];
+ /* 'max' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (max:result)
+ for (i = 0; i < n; i++)
+ result = result > array[i] ? result : array[i];
+
+ /* 'min' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (min:result)
+ for (i = 0; i < n; i++)
+ result = result < array[i] ? result : array[i];
/* '&' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (&:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (&:result)
for (i = 0; i < n; i++)
result &= array[i];
/* '|' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (|:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (|:result)
for (i = 0; i < n; i++)
result |= array[i];
/* '^' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (^:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (^:result)
for (i = 0; i < n; i++)
result ^= array[i];
/* '&&' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (&&:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (&&:lresult)
for (i = 0; i < n; i++)
lresult = lresult && (result > array[i]);
/* '||' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (||:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (||:lresult)
for (i = 0; i < n; i++)
lresult = lresult || (result > array[i]);
diff --git a/gcc/testsuite/c-c++-common/goacc/reduction-2.c b/gcc/testsuite/c-c++-common/goacc/reduction-2.c
index 2964236f6c6..c3105a2073c 100644
--- a/gcc/testsuite/c-c++-common/goacc/reduction-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/reduction-2.c
@@ -1,49 +1,47 @@
-/* { dg-require-effective-target alloca } */
/* float reductions. */
-#define vl 32
+#define n 1000
int
main(void)
{
- const int n = 1000;
int i;
float result, array[n];
int lresult;
/* '+' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (+:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (+:result)
for (i = 0; i < n; i++)
result += array[i];
/* '*' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (*:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (*:result)
for (i = 0; i < n; i++)
result *= array[i];
-// /* 'max' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result > array[i] ? result : array[i];
-//
-// /* 'min' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result < array[i] ? result : array[i];
+ /* 'max' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (max:result)
+ for (i = 0; i < n; i++)
+ result = result > array[i] ? result : array[i];
+
+ /* 'min' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (min:result)
+ for (i = 0; i < n; i++)
+ result = result < array[i] ? result : array[i];
/* '&&' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (&&:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (&&:lresult)
for (i = 0; i < n; i++)
lresult = lresult && (result > array[i]);
/* '||' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (||:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (||:lresult)
for (i = 0; i < n; i++)
lresult = lresult || (result > array[i]);
diff --git a/gcc/testsuite/c-c++-common/goacc/reduction-3.c b/gcc/testsuite/c-c++-common/goacc/reduction-3.c
index 34c51c2505a..4dbde04bc3b 100644
--- a/gcc/testsuite/c-c++-common/goacc/reduction-3.c
+++ b/gcc/testsuite/c-c++-common/goacc/reduction-3.c
@@ -1,49 +1,47 @@
-/* { dg-require-effective-target alloca } */
/* double reductions. */
-#define vl 32
+#define n 1000
int
main(void)
{
- const int n = 1000;
int i;
double result, array[n];
int lresult;
/* '+' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (+:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (+:result)
for (i = 0; i < n; i++)
result += array[i];
/* '*' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (*:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (*:result)
for (i = 0; i < n; i++)
result *= array[i];
-// /* 'max' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result > array[i] ? result : array[i];
-//
-// /* 'min' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result < array[i] ? result : array[i];
+ /* 'max' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (max:result)
+ for (i = 0; i < n; i++)
+ result = result > array[i] ? result : array[i];
+
+ /* 'min' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (min:result)
+ for (i = 0; i < n; i++)
+ result = result < array[i] ? result : array[i];
/* '&&' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (&&:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (&&:lresult)
for (i = 0; i < n; i++)
lresult = lresult && (result > array[i]);
/* '||' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (||:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (||:lresult)
for (i = 0; i < n; i++)
lresult = lresult || (result > array[i]);
diff --git a/gcc/testsuite/c-c++-common/goacc/reduction-4.c b/gcc/testsuite/c-c++-common/goacc/reduction-4.c
index 328c0d4e27b..c4572b97bb1 100644
--- a/gcc/testsuite/c-c++-common/goacc/reduction-4.c
+++ b/gcc/testsuite/c-c++-common/goacc/reduction-4.c
@@ -1,51 +1,35 @@
-/* { dg-require-effective-target alloca } */
/* complex reductions. */
-#define vl 32
+#define n 1000
int
main(void)
{
- const int n = 1000;
int i;
__complex__ double result, array[n];
int lresult;
/* '+' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (+:result)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (+:result)
for (i = 0; i < n; i++)
result += array[i];
- /* Needs support for complex multiplication. */
-
-// /* '*' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (*:result)
-// for (i = 0; i < n; i++)
-// result *= array[i];
-//
-// /* 'max' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result > array[i] ? result : array[i];
-//
-// /* 'min' reductions. */
-// #pragma acc parallel vector_length (vl)
-// #pragma acc loop reduction (+:result)
-// for (i = 0; i < n; i++)
-// result = result < array[i] ? result : array[i];
+ /* '*' reductions. */
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (*:result)
+ for (i = 0; i < n; i++)
+ result *= array[i];
/* '&&' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (&&:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (&&:lresult)
for (i = 0; i < n; i++)
lresult = lresult && (__real__(result) > __real__(array[i]));
/* '||' reductions. */
-#pragma acc parallel vector_length (vl)
-#pragma acc loop reduction (||:lresult)
+#pragma acc parallel
+#pragma acc loop gang worker vector reduction (||:lresult)
for (i = 0; i < n; i++)
lresult = lresult || (__real__(result) > __real__(array[i]));
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-3.c b/gcc/testsuite/c-c++-common/goacc/routine-3.c
index e6f83bd151a..b322d267769 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-3.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-3.c
@@ -1,52 +1,118 @@
+/* Test invalid calls to routines. */
+
#pragma acc routine gang
-void gang (void) /* { dg-message "declared here" 3 } */
+int
+gang () /* { dg-message "declared here" 3 } */
{
+ #pragma acc loop gang worker vector
+ for (int i = 0; i < 10; i++)
+ {
+ }
+
+ return 1;
}
#pragma acc routine worker
-void worker (void) /* { dg-message "declared here" 2 } */
+int
+worker () /* { dg-message "declared here" 2 } */
{
+ #pragma acc loop worker vector
+ for (int i = 0; i < 10; i++)
+ {
+ }
+
+ return 1;
}
#pragma acc routine vector
-void vector (void) /* { dg-message "declared here" 1 } */
+int
+vector () /* { dg-message "declared here" } */
{
+ #pragma acc loop vector
+ for (int i = 0; i < 10; i++)
+ {
+ }
+
+ return 1;
}
#pragma acc routine seq
-void seq (void)
+int
+seq ()
{
+ return 1;
}
-int main ()
+int
+main ()
{
-
-#pragma acc parallel num_gangs (32) num_workers (32) vector_length (32)
+ int red = 0;
+#pragma acc parallel copy (red)
{
- #pragma acc loop gang /* { dg-message "loop here" 1 } */
- for (int i = 0; i < 10; i++)
- {
- gang (); /* { dg-error "routine call uses same" } */
- worker ();
- vector ();
- seq ();
- }
- #pragma acc loop worker /* { dg-message "loop here" 2 } */
- for (int i = 0; i < 10; i++)
- {
- gang (); /* { dg-error "routine call uses same" } */
- worker (); /* { dg-error "routine call uses same" } */
- vector ();
- seq ();
- }
- #pragma acc loop vector /* { dg-message "loop here" 3 } */
- for (int i = 0; i < 10; i++)
- {
- gang (); /* { dg-error "routine call uses same" } */
- worker (); /* { dg-error "routine call uses same" } */
- vector (); /* { dg-error "routine call uses same" } */
- seq ();
- }
+ /* Independent/seq loop tests. */
+#pragma acc loop reduction (+:red) // { dg-warning "insufficient partitioning" }
+ for (int i = 0; i < 10; i++)
+ red += gang ();
+
+#pragma acc loop reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += worker ();
+
+#pragma acc loop reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += vector ();
+
+ /* Gang routine tests. */
+#pragma acc loop gang reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += gang (); // { dg-error "routine call uses same" }
+
+#pragma acc loop worker reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += gang (); // { dg-error "routine call uses same" }
+
+#pragma acc loop vector reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += gang (); // { dg-error "routine call uses same" }
+
+ /* Worker routine tests. */
+#pragma acc loop gang reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += worker ();
+
+#pragma acc loop worker reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += worker (); // { dg-error "routine call uses same" }
+
+#pragma acc loop vector reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += worker (); // { dg-error "routine call uses same" }
+
+ /* Vector routine tests. */
+#pragma acc loop gang reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += vector ();
+
+#pragma acc loop worker reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += vector ();
+
+#pragma acc loop vector reduction (+:red) /* { dg-message "containing loop" } */
+ for (int i = 0; i < 10; i++)
+ red += vector (); // { dg-error "routine call uses same" }
+
+ /* Seq routine tests. */
+#pragma acc loop gang reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += seq ();
+
+#pragma acc loop worker reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += seq ();
+
+#pragma acc loop vector reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red += seq ();
}
return 0;
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-4.c b/gcc/testsuite/c-c++-common/goacc/routine-4.c
index 004d7132bf6..3e5fc4f5d77 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-4.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-4.c
@@ -1,3 +1,4 @@
+/* Test invalid intra-routine parallelism. */
void gang (void);
void worker (void);
@@ -14,6 +15,24 @@ void seq (void)
worker (); /* { dg-error "routine call uses" } */
vector (); /* { dg-error "routine call uses" } */
seq ();
+
+ int red;
+
+#pragma acc loop reduction (+:red) // { dg-warning "insufficient partitioning" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop gang reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop worker reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop vector reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
}
void vector (void) /* { dg-message "declared here" 1 } */
@@ -22,6 +41,24 @@ void vector (void) /* { dg-message "declared here" 1 } */
worker (); /* { dg-error "routine call uses" } */
vector ();
seq ();
+
+ int red;
+
+#pragma acc loop reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop gang reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop worker reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop vector reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
}
void worker (void) /* { dg-message "declared here" 2 } */
@@ -30,6 +67,24 @@ void worker (void) /* { dg-message "declared here" 2 } */
worker ();
vector ();
seq ();
+
+ int red;
+
+#pragma acc loop reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop gang reduction (+:red) // { dg-error "disallowed by containing routine" }
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop worker reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop vector reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
}
void gang (void) /* { dg-message "declared here" 3 } */
@@ -38,4 +93,22 @@ void gang (void) /* { dg-message "declared here" 3 } */
worker ();
vector ();
seq ();
+
+ int red;
+
+#pragma acc loop reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop gang reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop worker reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
+
+#pragma acc loop vector reduction (+:red)
+ for (int i = 0; i < 10; i++)
+ red ++;
}
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-5.c b/gcc/testsuite/c-c++-common/goacc/routine-5.c
index c34838f9d03..2a9db90dcb9 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-5.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-5.c
@@ -46,6 +46,21 @@ using namespace g;
#pragma acc routine (c) /* { dg-error "does not refer to" } */
+
+void Bar ();
+
+void Foo ()
+{
+ Bar ();
+}
+
+#pragma acc routine (Bar) // { dg-error "must be applied before use" }
+
+#pragma acc routine (Foo) gang // { dg-error "must be applied before definition" }
+
+#pragma acc routine (Baz) // { dg-error "not been declared" }
+
+
int vb1; /* { dg-error "directive for use" } */
extern int vb2; /* { dg-error "directive for use" } */
static int vb3; /* { dg-error "directive for use" } */
diff --git a/gcc/testsuite/c-c++-common/goacc/tile.c b/gcc/testsuite/c-c++-common/goacc/tile.c
index 2a81427f053..8e70e718e1f 100644
--- a/gcc/testsuite/c-c++-common/goacc/tile.c
+++ b/gcc/testsuite/c-c++-common/goacc/tile.c
@@ -1,5 +1,3 @@
-/* { dg-do compile } */
-
int
main ()
{
@@ -71,3 +69,259 @@ main ()
return 0;
}
+
+
+void par (void)
+{
+ int i, j;
+
+#pragma acc parallel
+ {
+#pragma acc loop tile // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile() // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(1)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(2)
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc loop tile(-2) // { dg-warning "'tile' value must be positive" }
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc loop tile(i)
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc loop tile(2, 2, 1)
+ for (i = 1; i < 3; i++)
+ {
+ for (j = 4; j < 6; j++)
+ { }
+ }
+#pragma acc loop tile(2, 2)
+ for (i = 1; i < 5; i+=2)
+ {
+ for (j = i + 1; j < 7; j+=i)
+ { }
+ }
+#pragma acc loop vector tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+ }
+}
+void p3 (void)
+{
+ int i, j;
+
+
+#pragma acc parallel loop tile // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop tile() // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop tile(1)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop tile(*, 1)
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc parallel loop tile(-2) // { dg-warning "'tile' value must be positive" }
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc parallel loop tile(i)
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc parallel loop tile(2, 2, 1)
+ for (i = 1; i < 3; i++)
+ {
+ for (j = 4; j < 6; j++)
+ { }
+ }
+#pragma acc parallel loop tile(2, 2)
+ for (i = 1; i < 5; i+=2)
+ {
+ for (j = i + 1; j < 7; j++)
+ { }
+ }
+#pragma acc parallel loop vector tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop vector gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop vector worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc parallel loop gang worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+
+}
+
+
+void
+kern (void)
+{
+ int i, j;
+
+#pragma acc kernels
+ {
+#pragma acc loop tile // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile() // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(1)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(2)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(6-2)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(6+2)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(*, 1)
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 10; i++)
+ { }
+ }
+#pragma acc loop tile(-2) // { dg-warning "'tile' value must be positive" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(i)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop tile(2, 2, 1)
+ for (i = 2; i < 4; i++)
+ for (i = 4; i < 6; i++)
+ { }
+#pragma acc loop tile(2, 2)
+ for (i = 1; i < 5; i+=2)
+ for (j = i+1; j < 7; i++)
+ { }
+#pragma acc loop vector tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop vector worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc loop gang worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+ }
+}
+
+
+void k3 (void)
+{
+ int i, j;
+
+#pragma acc kernels loop tile // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop tile() // { dg-error "expected" }
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop tile(1)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop tile(*, 1)
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 1; j < 10; j++)
+ { }
+ }
+#pragma acc kernels loop tile(-2) // { dg-warning "'tile' value must be positive" }
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc kernels loop tile(i)
+ for (i = 1; i < 10; i++)
+ { }
+#pragma acc kernels loop tile(2, 2, 1)
+ for (i = 1; i < 3; i++)
+ {
+ for (j = 4; j < 6; j++)
+ { }
+ }
+#pragma acc kernels loop tile(2, 2)
+ for (i = 1; i < 5; i++)
+ {
+ for (j = i + 1; j < 7; j += i)
+ { }
+ }
+#pragma acc kernels loop vector tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop vector gang tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop vector worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+#pragma acc kernels loop gang worker tile(*)
+ for (i = 0; i < 10; i++)
+ { }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
new file mode 100644
index 00000000000..0a006e370e4
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Wuninitialized" } */
+
+#include <stdbool.h>
+
+int
+main (void)
+{
+ int i, j, k;
+
+ #pragma acc parallel num_gangs(i) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc parallel num_workers(j) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc parallel vector_length(k) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c
new file mode 100644
index 00000000000..55caa4c2c7f
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-if-clause.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Wuninitialized" } */
+/* { dg-excess-errors "PR70392" { xfail c++ } } */
+
+#include <stdbool.h>
+
+int
+main (void)
+{
+ int l, l2, l3, l4;
+ bool b, b2, b3, b4;
+ int i, i2;
+
+ #pragma acc parallel if(l) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc parallel if(b) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ ;
+
+ #pragma acc kernels if(l2) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc kernels if(b2) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ ;
+
+ #pragma acc data if(l3) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc data if(b3) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ ;
+
+ #pragma acc update if(l4) self(i) /* { dg-warning "is used uninitialized in this function" } */
+ ;
+
+ #pragma acc update if(b4) self(i2) /* { dg-warning "is used uninitialized in this function" "" { xfail c++ } } */
+ ;
+
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c
new file mode 100644
index 00000000000..c5d327caf80
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-use-device-clause.c
@@ -0,0 +1,14 @@
+/* Test fails due to PR70388. */
+/* { dg-do compile } */
+/* { dg-excess-errors "PR70388" { xfail *-*-* } } */
+/* { dg-additional-options "-Wuninitialized" } */
+
+void
+foo (void)
+{
+ int i;
+
+#pragma acc host_data use_device(i) /* { dg-warning "is used uninitialized in this function" "" { xfail *-*-* } } */
+ {
+ }
+}
diff --git a/gcc/testsuite/c-c++-common/nonnull-1.c b/gcc/testsuite/c-c++-common/nonnull-1.c
index fb2814c4498..2446d6fbcfa 100644
--- a/gcc/testsuite/c-c++-common/nonnull-1.c
+++ b/gcc/testsuite/c-c++-common/nonnull-1.c
@@ -24,5 +24,11 @@ func (char *cp1, char *cp2, char *cp3, char *cp4)
if (NULL != cp3) /* { dg-warning "nonnull argument" "cp3 compared to NULL" } */
return 3;
- return (cp4 != 0) ? 0 : 1; /* { dg-warning "nonnull argument" "cp4 compared to NULL" } */
+ return cp4 != 0 ? 0 : 1; /* { dg-warning "nonnull argument" "cp4 compared to NULL" } */
+}
+
+__attribute__((nonnull (1))) int
+func2 (char *cp)
+{
+ return (cp != NULL) ? 1 : 0; /* { dg-warning "nonnull argument" "cp compared to NULL" { xfail c++ } } */
}
diff --git a/gcc/testsuite/c-c++-common/pr70144-1.c b/gcc/testsuite/c-c++-common/pr70144-1.c
new file mode 100644
index 00000000000..01c7b78b179
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr70144-1.c
@@ -0,0 +1,9 @@
+/* PR c++/70144 */
+/* { dg-do compile } */
+
+void
+foo ()
+{
+ __builtin_constant_p (__builtin_constant_p) ?: ({ unsigned t = 0; t; }); /* { dg-error "must be directly called" } */
+ __builtin_classify_type (__builtin_expect); /* { dg-error "must be directly called" } */
+}
diff --git a/gcc/testsuite/c-c++-common/pr70144-2.c b/gcc/testsuite/c-c++-common/pr70144-2.c
new file mode 100644
index 00000000000..0973b792e95
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr70144-2.c
@@ -0,0 +1,12 @@
+/* PR c++/70144 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int
+main ()
+{
+ if (__builtin_constant_p (__builtin_memset) != 0
+ || __builtin_classify_type (__builtin_memset) != 5)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr70264.c b/gcc/testsuite/c-c++-common/pr70264.c
new file mode 100644
index 00000000000..815aad175e5
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr70264.c
@@ -0,0 +1,13 @@
+/* { dg-options "-fdiagnostics-show-caret" } */
+
+#define X __LINE__ /* { dg-error "expected" } */
+X
+
+/* { dg-begin-multiline-output "" }
+ #define X __LINE__
+ ^
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ X
+ ^
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
index 0633d19030c..09ddf8b28e3 100644
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
+++ b/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
@@ -10,6 +10,16 @@
#endif
#include <cstdlib>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int __cilkrts_set_param (const char *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
void func(int volatile* steal_me)
{
@@ -59,6 +69,10 @@ void my_test()
int main()
{
+ /* Ensure more than one worker. */
+ if (__cilkrts_set_param("nworkers", "2") != 0)
+ __builtin_abort();
+
my_test();
#if HAVE_IO
printf("PASSED\n");
diff --git a/gcc/testsuite/g++.dg/cpp/pr23827_cxx98_neg.C b/gcc/testsuite/g++.dg/cpp/pr23827_cxx98_neg.C
index 39d9fe4d1e0..a0e468c5e62 100644
--- a/gcc/testsuite/g++.dg/cpp/pr23827_cxx98_neg.C
+++ b/gcc/testsuite/g++.dg/cpp/pr23827_cxx98_neg.C
@@ -1,4 +1,4 @@
// { dg-do compile { target c++98_only } }
/* { dg-options "-ansi -pedantic-errors" } */
-double x = 0x3.1415babep0; // { dg-error "use of C..11 hexadecimal floating constant" }
+double x = 0x3.1415babep0; // { dg-error "use of C..1z hexadecimal floating constant" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-69315.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-69315.C
new file mode 100644
index 00000000000..cf32938ecc0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-69315.C
@@ -0,0 +1,35 @@
+// PR c++/69315
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2" }
+
+// Template instantiation and evaluation for folding within
+// finish_function may call finish_function recursively.
+// Make sure we don't reject or delay that sort of recursion.
+
+template <bool> struct Iter;
+
+struct Arg {
+ Iter<true> begin();
+ Iter<true> end();
+};
+
+template <bool> struct Iter {
+ int operator*();
+ Iter operator++();
+ template <bool C1, bool C2> friend constexpr bool operator==(Iter<C1>, Iter<C2>);
+ template <bool C1, bool C2> friend constexpr bool operator!=(Iter<C1>, Iter<C2>);
+};
+
+void func(Arg a) {
+ for (auto ch : a) {
+ a.begin() == a.end();
+ }
+}
+
+template <bool C1, bool C2> constexpr bool operator==(Iter<C1>, Iter<C2>) {
+ return true;
+}
+
+template <bool C1, bool C2> constexpr bool operator!=(Iter<C1> a, Iter<C2> b) {
+ return a == b;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-4.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-4.C
new file mode 100644
index 00000000000..c1ab1765b3e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70001-4.C
@@ -0,0 +1,13 @@
+// PR c++/70001
+// { dg-do compile { target c++11 } }
+
+struct B
+{
+ int a;
+ constexpr B () : a (0) { }
+};
+
+struct A
+{
+ B b[1 << 19][1][1][1];
+} c;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70204a.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70204a.C
new file mode 100644
index 00000000000..5ac551927e1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70204a.C
@@ -0,0 +1,18 @@
+// PR c++/70204
+// { dg-do compile { target c++11 } }
+
+int a;
+
+template < int N, int I >
+void fn1 ()
+{
+ const int x = I * a, y = x;
+ fn1 < y, I > (); // { dg-error "constant|no match" }
+}
+
+int
+main ()
+{
+ fn1 < 0, 0 > ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70204b.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70204b.C
new file mode 100644
index 00000000000..2b07d4fec9e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70204b.C
@@ -0,0 +1,10 @@
+// PR c++/70204
+// { dg-do compile { target c++11 } }
+
+int a;
+
+void fn1 ()
+{
+ const int x = 0 * a;
+ constexpr int y = x; // { dg-error "constant" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
new file mode 100644
index 00000000000..8307ac8e0a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
@@ -0,0 +1,10 @@
+// PR c++/70323
+// { dg-do compile { target c++11 } }
+
+constexpr int overflow_if_0 (int i) { return __INT_MAX__ + !i; }
+constexpr int overflow_if_1 (int i) { return __INT_MAX__ + i; }
+
+constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression" }
+constexpr bool i0_1 = overflow_if_0 (1);
+constexpr bool i1_0 = overflow_if_1 (0);
+constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
new file mode 100644
index 00000000000..d166787ca8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
@@ -0,0 +1,11 @@
+// PR c++/70323
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
+
+constexpr int overflow_if_0 (int i) { return __INT_MAX__ + !i; }
+constexpr int overflow_if_1 (int i) { return __INT_MAX__ + i; }
+
+constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression" }
+constexpr bool i0_1 = overflow_if_0 (1);
+constexpr bool i1_0 = overflow_if_1 (0);
+constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-__func__2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-__func__2.C
new file mode 100644
index 00000000000..e6782905423
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-__func__2.C
@@ -0,0 +1,13 @@
+// PR c++/70353
+// { dg-do link { target c++11 } }
+
+constexpr const char* ce ()
+{
+ return __func__;
+}
+
+const char *c = ce();
+
+int main()
+{
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-inline-1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-inline-1.C
new file mode 100644
index 00000000000..fed69904912
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-inline-1.C
@@ -0,0 +1,29 @@
+// PR c++/53792 - [C++11] improving compiler-time constexpr evaluation
+// Test case from comment #8.
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-O1 -fdump-tree-optimized" }
+
+template <class T>
+void sink (T);
+
+constexpr unsigned foo ()
+{
+ unsigned i = 1;
+ while ((i << 1) > i)
+ i = i << 1;
+
+ return i;
+}
+
+template <unsigned N>
+struct S { };
+
+void bar ()
+{
+ sink (foo ());
+ sink (S<foo ()>());
+}
+
+// Verify that the call to the foo() constexpr function is inlined
+// regardless of whether or not it's invoked in a constant expression.
+// { dg-final { scan-tree-dump-not "= *foo *\\\(" "optimized" } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-inline.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-inline.C
new file mode 100644
index 00000000000..d04257c8c33
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-inline.C
@@ -0,0 +1,40 @@
+// PR c++/53792 - [C++11] improving compiler-time constexpr evaluation
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-O1 -fdump-tree-optimized" }
+
+struct entry
+{
+ char const* label;
+ int value;
+};
+
+constexpr bool same (char const *x, char const *y)
+{
+ return !*x && !*y ? true : /* default */ (*x == *y && same (x + 1, y + 1));
+}
+
+constexpr int
+keyToValue (char const *label, entry const *entries)
+{
+ return !entries->label ? entries->value
+ : same (entries->label, label) ? entries->value
+ : /* default */ keyToValue (label, entries + 1);
+}
+
+constexpr entry foo[] = {{"Foo", 0}, {"Bar", 1}, {"FooBar", 2}, {0, -1}};
+
+int bar ()
+{
+ int result = keyToValue ("Foo", foo);
+ return result;
+}
+
+int baz ()
+{
+ constexpr int result = keyToValue ("Foo", foo);
+ return result;
+}
+
+// Verify that the call to the keyToValue() constexpr function is inlined
+// regardless of whether or not it's invoked in a constexpr expression.
+// { dg-final { scan-tree-dump-not "keyToValue" "optimized" } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion2.C
new file mode 100644
index 00000000000..978b998afeb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion2.C
@@ -0,0 +1,17 @@
+// PR c++/70344
+// { dg-do compile { target c++11 } }
+
+struct Z
+{
+ Z () = default;
+ Z (Z const &) = default;
+ constexpr Z (Z &&) {}
+};
+
+constexpr int
+fn (Z v)
+{
+ return fn (v);
+}
+
+auto t = fn (Z ());
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-trivial1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-trivial1.C
new file mode 100644
index 00000000000..f4b74a7eec9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-trivial1.C
@@ -0,0 +1,20 @@
+// PR c++/70139
+// { dg-options "-fno-elide-constructors" }
+// { dg-do compile { target c++11 } }
+
+template<class T, class U>
+struct A
+{
+ T a;
+ U b;
+ constexpr A () : a (), b () { }
+ constexpr A (const T &x, const U &y) : a (x), b (y) { }
+};
+struct B
+{
+ constexpr B (const bool x) : c (x) {}
+ constexpr bool operator!= (const B x) const { return c != x.c; }
+ bool c;
+};
+constexpr static A<B, B*> d[] = { { B (true), nullptr }, { B (false), nullptr } };
+static_assert (d[0].a != d[1].a, "");
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-70218.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-70218.C
new file mode 100644
index 00000000000..ae8cc2f5000
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-70218.C
@@ -0,0 +1,17 @@
+// PR c++/70218
+// { dg-do compile { target c++11 } }
+
+struct X {
+private:
+ int i;
+};
+
+struct Y {
+ Y (int) { }
+};
+
+void
+foo ()
+{
+ Y ([] { X x; x.i = 3; return 0; } ()); // { dg-error "private" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic122.C b/gcc/testsuite/g++.dg/cpp0x/variadic122.C
index aa21ddddd18..12dc9012c37 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic122.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic122.C
@@ -9,7 +9,7 @@ template < class T > struct Container
template < class T >
T deref (T)
-{} // { dg-warning "no return" }
+{} // { dg-bogus "no return" }
template < class T, class ... Args >
auto deref (T u, int, Args ... args)->decltype (deref (u.f (), args ...))
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C
new file mode 100644
index 00000000000..ab2021b91bd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C
@@ -0,0 +1,21 @@
+// PR c++/58281 - Problem with explicitly instantiated constexpr template
+// functions
+// { dg-do compile { target c++11 } }
+// { dg-options "-fdump-tree-optimized" }
+
+
+template <typename T>
+constexpr bool f (T a)
+{
+ return a == 3;
+}
+
+extern template bool f<int>(int);
+
+bool g (int x) { return f (x); }
+
+template bool f<int>(int);
+
+// Verify that the defintions of both f() and g() are emitted.
+// { dg-final { scan-tree-dump-times "\nconstexpr bool f\\\(" 1 "optimized" } }
+// { dg-final { scan-tree-dump-times "\nbool g\\\(" 1 "optimized" } }
diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
index 67f75a72548..397b9a89957 100644
--- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
+++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
@@ -55,8 +55,8 @@
#ifndef __cpp_range_based_for
# error "__cpp_range_based_for"
-#elif __cpp_range_based_for != 200907
-# error "__cpp_range_based_for != 200907"
+#elif __cpp_range_based_for < 200907
+# error "__cpp_range_based_for < 200907"
#endif
#ifndef __cpp_static_assert
diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
index d9dbf6283a2..fa59f90fa89 100644
--- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
+++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
@@ -48,8 +48,8 @@
#ifndef __cpp_range_based_for
# error "__cpp_range_based_for"
-#elif __cpp_range_based_for != 200907
-# error "__cpp_range_based_for != 200907"
+#elif __cpp_range_based_for < 200907
+# error "__cpp_range_based_for < 200907"
#endif
#ifndef __cpp_static_assert
diff --git a/gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr5.C b/gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr5.C
new file mode 100644
index 00000000000..fe377c399c8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/nsdmi-aggr5.C
@@ -0,0 +1,24 @@
+// PR c++/70332
+// { dg-do run { target c++14 } }
+
+template <class T>
+struct C
+{
+ T m;
+ T *n = &m;
+};
+
+C<int> c { };
+
+int
+main ()
+{
+ *c.n = 5;
+ if (c.m != 5)
+ __builtin_abort ();
+
+ C<int> d { 10 };
+ *d.n = *d.n + 1;
+ if (d.m != 11)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/nsdmi-union1.C b/gcc/testsuite/g++.dg/cpp1y/nsdmi-union1.C
new file mode 100644
index 00000000000..d9dd0bfcc91
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/nsdmi-union1.C
@@ -0,0 +1,33 @@
+// PR c++/70347
+// { dg-do run { target c++14 } }
+
+union A {
+ char a;
+ long b = -42;
+};
+
+struct B {
+ union {
+ char a = 10;
+ long b;
+ };
+};
+
+A c1{};
+A c2{4};
+B c3{};
+B c4{{9}};
+
+int main() {
+ if (c1.b != -42)
+ __builtin_abort ();
+
+ if (c2.a != 4)
+ __builtin_abort ();
+
+ if (c3.a != 10)
+ __builtin_abort ();
+
+ if (c4.a != 9)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr70001.C b/gcc/testsuite/g++.dg/cpp1y/pr70001.C
new file mode 100644
index 00000000000..adbb13251e6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/pr70001.C
@@ -0,0 +1,49 @@
+// PR c++/70001
+// { dg-do compile { target c++14 } }
+
+struct B
+{
+ int a;
+ constexpr B () : a (0) { }
+ constexpr B (int x) : a (x) { }
+};
+struct C
+{
+ B c;
+ constexpr C () : c (0) { }
+};
+struct A
+{
+ B b[1 << 4];
+};
+struct D
+{
+ C d[1 << 4];
+};
+
+constexpr int
+foo (int a, int b)
+{
+ A c;
+ c.b[a].a += b;
+ c.b[b].a += a;
+ return c.b[0].a + c.b[a].a + c.b[b].a;
+}
+
+constexpr int
+bar (int a, int b)
+{
+ D c;
+ c.d[a].c.a += b;
+ c.d[b].c.a += a;
+ return c.d[0].c.a + c.d[a].c.a + c.d[b].c.a;
+}
+
+constexpr int d = foo (1, 2);
+constexpr int e = foo (0, 3);
+constexpr int f = foo (2, 4);
+constexpr int g = bar (1, 2);
+constexpr int h = bar (0, 3);
+constexpr int i = bar (2, 4);
+static_assert (d == 3 && e == 6 && f == 6, "");
+static_assert (g == 3 && h == 6 && i == 6, "");
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ50.C b/gcc/testsuite/g++.dg/cpp1y/var-templ50.C
new file mode 100644
index 00000000000..138a3997122
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ50.C
@@ -0,0 +1,11 @@
+// PR c++/70095
+// { dg-do link { target c++14 } }
+
+template <typename T> struct Foo;
+template <typename T> int variable_template = 0;
+template <typename T> int variable_template<Foo<T>> = 0;
+template <typename T> int get_variable_template() { return variable_template<T>; }
+
+int main() {
+ get_variable_template<Foo<int>>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
index 9b3b284bf40..74c6f2978df 100644
--- a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
+++ b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
@@ -42,8 +42,8 @@
#ifndef __cpp_range_based_for
# error "__cpp_range_based_for"
-#elif __cpp_range_based_for != 200907
-# error "__cpp_range_based_for != 200907"
+#elif __cpp_range_based_for != 201603
+# error "__cpp_range_based_for != 201603"
#endif
#ifndef __cpp_decltype
@@ -328,8 +328,8 @@
#ifndef __cpp_fold_expressions
# error "__cpp_fold_expressions"
-#elif __cpp_fold_expressions != 201411
-# error "__cpp_fold_expressions != 201411"
+#elif __cpp_fold_expressions != 201603
+# error "__cpp_fold_expressions != 201603"
#endif
#ifndef __cpp_nontype_template_args
@@ -337,3 +337,9 @@
#elif __cpp_nontype_template_args != 201411
# error "__cpp_nontype_template_args != 201411"
#endif
+
+#ifndef __cpp_hex_float
+# error "__cpp_hex_float"
+#elif __cpp_hex_float != 201603
+# error "__cpp_hex_float != 201603"
+#endif
diff --git a/gcc/testsuite/g++.dg/cpp1z/fold7.C b/gcc/testsuite/g++.dg/cpp1z/fold7.C
index 3e6925ad2e1..0451774b62c 100644
--- a/gcc/testsuite/g++.dg/cpp1z/fold7.C
+++ b/gcc/testsuite/g++.dg/cpp1z/fold7.C
@@ -4,6 +4,6 @@
#error __cpp_fold_expressions not defined
#endif
-#if __cpp_fold_expressions != 201411
+#if __cpp_fold_expressions != 201603
#error Wrong value for __cpp_fold_expressions
#endif
diff --git a/gcc/testsuite/g++.dg/cpp1z/range-for1.C b/gcc/testsuite/g++.dg/cpp1z/range-for1.C
index 370381ab60f..36e2d029553 100644
--- a/gcc/testsuite/g++.dg/cpp1z/range-for1.C
+++ b/gcc/testsuite/g++.dg/cpp1z/range-for1.C
@@ -1,4 +1,4 @@
-// P08184R0: Generalizing the Range-Based For Loop
+// P0184R0: Generalizing the Range-Based For Loop
// { dg-options "-std=c++1z" }
struct A {
diff --git a/gcc/testsuite/g++.dg/debug/pr70271.C b/gcc/testsuite/g++.dg/debug/pr70271.C
new file mode 100644
index 00000000000..3c96d3a49e9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr70271.C
@@ -0,0 +1,36 @@
+// { dg-do compile }
+
+template <typename Function>
+struct function_traits
+: public function_traits<decltype(&Function::operator())>
+{ };
+
+template <typename ClassType, typename ReturnType, typename... Args>
+struct function_traits<ReturnType(ClassType::*)(Args...) const>
+{
+ typedef ReturnType (*pointer)(Args...);
+ typedef ReturnType return_type;
+};
+
+template <typename Function>
+typename function_traits<Function>::pointer
+FunctionPointer (const Function& lambda)
+{
+ return static_cast<typename function_traits<Function>::pointer>(lambda);
+}
+
+template <typename Function>
+typename function_traits<Function>::return_type
+GetReturnValue (Function func)
+{
+ typename function_traits<Function>::return_type *dummy;
+ return *dummy;
+}
+template <typename T> class ClassFoo {};
+template <typename T> void FuncBar () { }
+
+template <> inline void FuncBar<double> ()
+{
+ typedef void (*func_type)(ClassFoo<double> &);
+ func_type f1 = FunctionPointer ([](ClassFoo<double> & ref) { });
+}
diff --git a/gcc/testsuite/g++.dg/expr/pmf-2.C b/gcc/testsuite/g++.dg/expr/pmf-2.C
new file mode 100644
index 00000000000..79e36cf78c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/pmf-2.C
@@ -0,0 +1,18 @@
+// PR c++/70386
+// { dg-options "-Wall" }
+
+struct A { void f () {} };
+struct B : public A {};
+struct C : public A {};
+struct D : public B, public C {};
+
+typedef void (C::*cp) ();
+typedef void (D::*dp) ();
+
+int
+main ()
+{
+ cp c = &A::f;
+ dp d = c;
+ return (cp () == d);
+}
diff --git a/gcc/testsuite/g++.dg/ext/attribute-may-alias-4.C b/gcc/testsuite/g++.dg/ext/attribute-may-alias-4.C
new file mode 100644
index 00000000000..a459d49e9ee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attribute-may-alias-4.C
@@ -0,0 +1,17 @@
+// PR c++/70209
+
+struct V {
+ typedef float F;
+ template <typename S> void m_fn1(S);
+};
+
+template <typename> struct A {
+ typedef V::F Ta __attribute__((__may_alias__));
+ Ta *m_data;
+ void m_fn2(V &);
+};
+
+template <>
+void A<int>::m_fn2(V &p) {
+ p.m_fn1(m_data);
+}
diff --git a/gcc/testsuite/g++.dg/ext/java-3.C b/gcc/testsuite/g++.dg/ext/java-3.C
new file mode 100644
index 00000000000..128db653116
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/java-3.C
@@ -0,0 +1,39 @@
+// PR c++/70267
+// { dg-do compile { target { ! { powerpc-ibm-aix* } } } }
+// { dg-options "-O2" }
+
+extern "Java"
+{
+ typedef __java_int jint;
+ namespace java
+ {
+ namespace lang
+ {
+ class Class;
+ class Object;
+ class Throwable {};
+ class Foo;
+ }
+ }
+}
+
+typedef struct java::lang::Object * jobject;
+typedef struct java::lang::Throwable * jthrowable;
+typedef class java::lang::Class * jclass;
+
+using java::lang::Foo;
+
+class Foo: public java::lang::Throwable
+{
+ public:static::java::lang::Class class$;
+};
+
+extern "C" Foo _Jv_AllocObject (jclass);
+extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
+
+void
+Bar4 (void)
+{
+ Foo * f = new java::lang::Foo; // { dg-error "is not a function returning a pointer" }
+ throw (f);
+}
diff --git a/gcc/testsuite/g++.dg/ext/pr70290.C b/gcc/testsuite/g++.dg/ext/pr70290.C
new file mode 100644
index 00000000000..f5242271d17
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/pr70290.C
@@ -0,0 +1,24 @@
+/* PR target/70290 */
+/* { dg-do compile } */
+/* { dg-options "-Wno-psabi -w" } */
+/* { dg-additional-options "-mavx512vl" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef int vec __attribute__((vector_size(32)));
+
+vec
+test1 (vec x, vec y)
+{
+ return (x < y) ? 1 : 0;
+}
+
+vec
+test2 (vec x, vec y)
+{
+ vec zero = { };
+ vec one = zero + 1;
+ return (x < y) ? one : zero;
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector passed by reference.*" } */
+
diff --git a/gcc/testsuite/g++.dg/goacc/reference.C b/gcc/testsuite/g++.dg/goacc/reference.C
new file mode 100644
index 00000000000..b000668b1aa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/goacc/reference.C
@@ -0,0 +1,39 @@
+int
+test1 (int &ref)
+{
+#pragma acc kernels copy (ref)
+ {
+ ref = 10;
+ }
+}
+
+int
+test2 (int &ref)
+{
+ int b;
+#pragma acc kernels copyout (b)
+ {
+ b = ref + 10;
+ }
+
+#pragma acc parallel copyout (b)
+ {
+ b = ref + 10;
+ }
+
+ ref = b;
+}
+
+int
+main()
+{
+ int a = 0;
+ int &ref_a = a;
+
+ #pragma acc parallel copy (a, ref_a)
+ {
+ ref_a = 5;
+ }
+
+ return a;
+}
diff --git a/gcc/testsuite/g++.dg/goacc/routine-1.C b/gcc/testsuite/g++.dg/goacc/routine-1.C
new file mode 100644
index 00000000000..a73a73d5fc1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/goacc/routine-1.C
@@ -0,0 +1,13 @@
+/* Test valid use of the routine directive. */
+
+namespace N
+{
+ extern void foo1();
+ extern void foo2();
+#pragma acc routine (foo1)
+#pragma acc routine
+ void foo3()
+ {
+ }
+}
+#pragma acc routine (N::foo2)
diff --git a/gcc/testsuite/g++.dg/goacc/routine-2.C b/gcc/testsuite/g++.dg/goacc/routine-2.C
new file mode 100644
index 00000000000..2d1646647af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/goacc/routine-2.C
@@ -0,0 +1,42 @@
+/* Test invalid use of the routine directive. */
+
+template <typename T>
+extern T one_d();
+#pragma acc routine (one_d) /* { dg-error "names a set of overloads" } */
+
+template <typename T>
+T
+one()
+{
+ return 1;
+}
+#pragma acc routine (one) /* { dg-error "names a set of overloads" } */
+
+int incr (int);
+float incr (float);
+int inc;
+
+#pragma acc routine (incr) /* { dg-error "names a set of overloads" } */
+
+#pragma acc routine (increment) /* { dg-error "has not been declared" } */
+
+#pragma acc routine (inc) /* { dg-error "does not refer to a function" } */
+
+#pragma acc routine (+) /* { dg-error "expected unqualified-id before '.' token" } */
+
+int sum (int, int);
+
+namespace foo {
+#pragma acc routine (sum)
+ int sub (int, int);
+}
+
+#pragma acc routine (foo::sub)
+
+/* It's strange to apply a routine directive to subset of overloaded
+ functions, but that is permissible in OpenACC 2.x. */
+
+int decr (int a);
+
+#pragma acc routine
+float decr (float a);
diff --git a/gcc/testsuite/g++.dg/goacc/template.C b/gcc/testsuite/g++.dg/goacc/template.C
index f7a717bf7ed..f139dc25b58 100644
--- a/gcc/testsuite/g++.dg/goacc/template.C
+++ b/gcc/testsuite/g++.dg/goacc/template.C
@@ -1,8 +1,3 @@
-// This error is temporary. Remove when support is added for these clauses
-// in the middle end. Also remove the comments from the reduction test
-// after the FE learns that reduction variables may appear in data clauses too.
-// { dg-prune-output "sorry, unimplemented" }
-
#pragma acc routine
template <typename T> T
accDouble(int val)
@@ -20,55 +15,62 @@ oacc_parallel_copy (T a)
double z = 4;
#pragma acc parallel num_gangs (a) num_workers (a) vector_length (a) default (none) copyout (b) copyin (a)
- {
+#pragma acc loop gang worker vector
+ for (int i = 0; i < 1; i++)
b = a;
- }
#pragma acc parallel num_gangs (a) copy (w, x, y, z)
- {
- w = accDouble<char>(w);
- x = accDouble<int>(x);
- y = accDouble<float>(y);
- z = accDouble<double>(z);
- }
+#pragma acc loop
+ for (int i = 0; i < 1; i++)
+ {
+ w = accDouble<char>(w);
+ x = accDouble<int>(x);
+ y = accDouble<float>(y);
+ z = accDouble<double>(z);
+ }
#pragma acc parallel num_gangs (a) if (1)
{
+#pragma acc loop independent collapse (2) gang
+ for (int i = 0; i < a; i++)
+ for (int j = 0; j < 5; j++)
+ b = a;
+
#pragma acc loop auto tile (a, 3)
- for (int i = 0; i < a; i++)
- for (int j = 0; j < 5; j++)
- b = a;
+ for (int i = 0; i < a; i++)
+ for (int j = 0; j < 5; j++)
+ b = a;
#pragma acc loop seq
- for (int i = 0; i < a; i++)
- b = a;
+ for (int i = 0; i < a; i++)
+ b = a;
}
T c;
#pragma acc parallel num_workers (10)
- {
+#pragma acc loop worker
+ for (int i = 0; i < 1; i++)
+ {
#pragma acc atomic capture
- c = b++;
+ c = b++;
#pragma atomic update
- c++;
+ c++;
#pragma acc atomic read
- b = a;
+ b = a;
#pragma acc atomic write
- b = a;
- }
+ b = a;
+ }
-//#pragma acc parallel reduction (+:c)
-// {
-// c = 1;
-// }
+#pragma acc parallel reduction (+:c)
+ c = 1;
#pragma acc data if (1) copy (b)
{
- #pragma acc parallel
+#pragma acc parallel
{
b = a;
}
@@ -76,9 +78,9 @@ oacc_parallel_copy (T a)
#pragma acc enter data copyin (b)
#pragma acc parallel present (b)
- {
- b = a;
- }
+ {
+ b = a;
+ }
#pragma acc update host (b)
#pragma acc update self (b)
@@ -109,11 +111,9 @@ oacc_kernels_copy (T a)
#pragma acc kernels copyout (b) copyin (a)
b = a;
-//#pragma acc kernels loop reduction (+:c)
-// for (int i = 0; i < 10; i++)
-// {
-// c = 1;
-// }
+#pragma acc kernels loop reduction (+:c)
+ for (int i = 0; i < 10; i++)
+ c = 1;
#pragma acc data if (1) copy (b)
{
@@ -125,9 +125,10 @@ oacc_kernels_copy (T a)
#pragma acc enter data copyin (b)
#pragma acc kernels present (b)
- {
- b = a;
- }
+ {
+ b = a;
+ }
+
return b;
}
diff --git a/gcc/testsuite/g++.dg/lookup/pr70205.C b/gcc/testsuite/g++.dg/lookup/pr70205.C
new file mode 100644
index 00000000000..3bda7fb35ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/pr70205.C
@@ -0,0 +1,11 @@
+// PR c++/70205
+
+struct A
+{
+protected:
+ static void f ();
+};
+struct B : A { };
+struct C : A { };
+struct D : C, B { void a () { D::f (); } };
+struct E : D { void b () { D::f (); } };
diff --git a/gcc/testsuite/g++.dg/opt/flifetime-dse5.C b/gcc/testsuite/g++.dg/opt/flifetime-dse5.C
new file mode 100644
index 00000000000..92759440f00
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/flifetime-dse5.C
@@ -0,0 +1,13 @@
+// PR c++/70259
+// { dg-options -O2 }
+// { dg-do run }
+
+struct Empty { };
+struct A { A() : a(true) { } bool a; };
+struct B : Empty { B() : Empty() { } };
+struct C : A, B { C() : A(), B() { } };
+int main() {
+ C c;
+ if ( c.a == false )
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/g++.dg/opt/flifetime-dse6.C b/gcc/testsuite/g++.dg/opt/flifetime-dse6.C
new file mode 100644
index 00000000000..6c805586252
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/flifetime-dse6.C
@@ -0,0 +1,11 @@
+// PR c++/70272
+// { dg-options -O2 }
+// { dg-do run }
+
+struct Empty { };
+struct A { A() : a(true) { } bool a; ~A() { if (!a) __builtin_abort(); } };
+struct B : Empty { B() : Empty() { } ~B() { } };
+struct C : A, B { C() : A(), B() { } ~C() { } };
+int main() {
+ C c;
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr70245-aux.cc b/gcc/testsuite/g++.dg/opt/pr70245-aux.cc
new file mode 100644
index 00000000000..7f65f20174f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr70245-aux.cc
@@ -0,0 +1,56 @@
+// PR target/70245
+// { dg-do compile }
+// { dg-options "" }
+
+#include "pr70245.h"
+
+D m;
+A n, o;
+int p, q;
+
+int *
+fn1 (char *x, int *y)
+{
+ *y = 0;
+ return &p;
+}
+
+void
+fn2 ()
+{
+ __builtin_abort ();
+}
+
+void *
+fn3 (int *x)
+{
+ *x = 0;
+ return (void *) &m;
+}
+
+void *
+fn4 ()
+{
+ a = &o;
+ o.a1.d = 9;
+ m.d = sizeof (D);
+ __builtin_memcpy (o.a2.c, "abcdefghijklmnop", 16);
+ return (void *) &n;
+}
+
+void
+fn5 (A *x, B *y, unsigned char *z, int *w)
+{
+ if (x != &n || y != &k || z != (unsigned char *) (&m + 1))
+ __builtin_abort ();
+ q++;
+}
+
+int
+main ()
+{
+ d = fn5;
+ baz (0);
+ if (q != 1)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr70245.C b/gcc/testsuite/g++.dg/opt/pr70245.C
new file mode 100644
index 00000000000..21280b7aaf5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr70245.C
@@ -0,0 +1,52 @@
+// PR target/70245
+// { dg-do run }
+// { dg-additional-sources "pr70245-aux.cc" }
+// { dg-options "-O2" }
+// { dg-additional-options "-fPIC" { target fpic } }
+// { dg-additional-options "-march=i386 -mtune=atom" { target ia32 } }
+
+#include "pr70245.h"
+
+struct A *a, *i;
+int b, c, e, l;
+F d;
+
+static A *
+foo (B *x, int *y, int *z)
+{
+ unsigned char *f = (unsigned char *) fn3 (y);
+ D *g = (D *) f;
+ A *h;
+ if (e || a || c || b || g->d)
+ return 0;
+ h = (A *) fn4 ();
+ __builtin_memcpy (h, a, sizeof (A));
+ h->a1 = *(D *) f;
+ if (d)
+ {
+ d (h, x, f + g->d, z);
+ if (*z)
+ fn2 ();
+ }
+ return h;
+}
+
+static A *
+bar (B *x, int *y)
+{
+ int *j = fn1 (x->b, y);
+ if (*y > 0)
+ return 0;
+ i = foo (x, j, y);
+ return i;
+}
+
+B k;
+
+void
+baz (int x)
+{
+ if (x)
+ bar (0, 0);
+ bar (&k, &l);
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr70245.h b/gcc/testsuite/g++.dg/opt/pr70245.h
new file mode 100644
index 00000000000..b0c54064725
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr70245.h
@@ -0,0 +1,14 @@
+extern struct A *a, *i;
+extern int b, c, e, l;
+int *fn1 (char *, int *);
+void fn2 ();
+void *fn3 (int *);
+struct B { char *b; };
+typedef void (*F) (A *, B *, unsigned char *, int *);
+struct C { int c[16]; };
+struct D { int d; };
+struct A { D a1; C a2; };
+void *fn4 ();
+extern F d;
+extern B k;
+extern void baz (int);
diff --git a/gcc/testsuite/g++.dg/other/bitfield5.C b/gcc/testsuite/g++.dg/other/bitfield5.C
new file mode 100644
index 00000000000..b8cd4dd206a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/bitfield5.C
@@ -0,0 +1,15 @@
+// PR c++/70285
+
+int a;
+
+struct S
+{
+ int i:8;
+} b;
+
+int
+fn1 (bool x)
+{
+ (&fn1 ? b.i : a) = 42;
+ return (&fn1 ? b.i : a);
+}
diff --git a/gcc/testsuite/g++.dg/pr63384.C b/gcc/testsuite/g++.dg/pr63384.C
new file mode 100644
index 00000000000..ac581d06cb3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr63384.C
@@ -0,0 +1,12 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fsel-sched-reschedule-pipelined -fvar-tracking-assignments -ftree-vectorize -w" } */
+
+template <class T> T **make_test_matrix() {
+ T **data = new T *;
+ for (int i = 0; i < 1000; i++)
+ ;
+}
+
+template <typename T> void test() { T **c = make_test_matrix<T>(); }
+
+main() { test<float>(); }
diff --git a/gcc/testsuite/g++.dg/template/mangle2.C b/gcc/testsuite/g++.dg/template/mangle2.C
new file mode 100644
index 00000000000..2f3c5f41ce7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/mangle2.C
@@ -0,0 +1,19 @@
+// PR c++/62212
+// { dg-do compile }
+
+typedef int my_int;
+
+template<typename T>
+struct X {
+ enum {value = 1};
+};
+
+template<typename T>
+void f(const my_int(&)[X<T>::value]);
+
+int main() {
+ const my_int a[1] = {};
+ f<void>(a);
+}
+
+// { dg-final { scan-assembler "_Z1fIvEvRAsr1XIT_E5value_Ki" } }
diff --git a/gcc/testsuite/g++.dg/template/partial-specialization4.C b/gcc/testsuite/g++.dg/template/partial-specialization4.C
new file mode 100644
index 00000000000..1f2acedf47e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial-specialization4.C
@@ -0,0 +1,26 @@
+// PR c++/70141
+
+template <typename T>
+struct outer
+{
+ template <typename U>
+ struct inner
+ {
+
+ };
+};
+
+
+template <typename T>
+struct is_inner_for
+{
+ template <typename Whatever>
+ struct predicate;
+
+ template <typename U>
+ struct predicate<typename outer<T>::template inner<U> >
+ {
+ };
+};
+
+is_inner_for<int>::predicate<outer<int>::inner<double> > p;
diff --git a/gcc/testsuite/g++.dg/template/ptrmem30.C b/gcc/testsuite/g++.dg/template/ptrmem30.C
new file mode 100644
index 00000000000..923238bec4d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem30.C
@@ -0,0 +1,45 @@
+// PR c++/70096
+// { dg-do run }
+
+int read;
+
+struct Holder
+{
+ void foo () { read = data; }
+ int data;
+};
+
+void
+poison_stack ()
+{
+ volatile char a[256];
+ __builtin_memset ((void *)a, 0xa, sizeof a);
+}
+
+template <typename F>
+void test1 ()
+{
+ Holder h;
+ h.data = 42;
+ F Holder::*fptr = &Holder::foo;
+ (h.*fptr)();
+}
+
+template <typename F>
+void test2 ()
+{
+ Holder h;
+ h.data = 42;
+ F Holder::*fptr1 = &Holder::foo;
+ F Holder::*fptr2 = fptr1;
+ (h.*fptr2)();
+}
+
+
+int main ()
+{
+ poison_stack ();
+ test1<void()>();
+ poison_stack ();
+ test2<void()>();
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr70251.C b/gcc/testsuite/g++.dg/torture/pr70251.C
new file mode 100644
index 00000000000..5af35b2d8cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr70251.C
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// { dg-additional-options "-w -Wno-psabi" }
+
+typedef int vec __attribute__((vector_size(64)));
+vec f(vec x,vec y,vec z)
+{
+ vec zero={};
+ vec one=zero+1;
+ vec c=x<y;
+ return z+(c?one:zero);
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C b/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
index a5dc2aa38d7..d6e4cf37205 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
@@ -26,5 +26,5 @@ t (void)
// { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
//
// And as a result also contained control flow.
-// { dg-final { scan-tree-dump-times "Removing unreachable" 6 "ehcleanup1" } }
+// { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }
//
diff --git a/gcc/testsuite/g++.dg/ubsan/pr70147-1.C b/gcc/testsuite/g++.dg/ubsan/pr70147-1.C
new file mode 100644
index 00000000000..f4dd859450d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr70147-1.C
@@ -0,0 +1,12 @@
+// PR c++/70147
+// { dg-do run }
+// { dg-options "-fsanitize=vptr" }
+
+struct A { A () {} virtual void f () {} };
+struct B : virtual A { B () {} virtual void f () {} };
+struct C : B, virtual A { C () {} } c;
+
+int
+main ()
+{
+}
diff --git a/gcc/testsuite/g++.dg/ubsan/pr70147-2.C b/gcc/testsuite/g++.dg/ubsan/pr70147-2.C
new file mode 100644
index 00000000000..4e858a52d5a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr70147-2.C
@@ -0,0 +1,77 @@
+// PR c++/70147
+// { dg-do run }
+// { dg-skip-if "" { *-*-* } { "*" } { "-O0" } }
+// { dg-options "-fsanitize=vptr" }
+
+struct A
+{
+ A () : a (0) {}
+ A (int x) : a (x) {}
+ virtual void f () {}
+ virtual int i () { int r = 0; __asm ("" : "+r" (r)); return r; }
+ int a;
+};
+struct E
+{
+ E () : e (0) {}
+ E (int x) : e (x) {}
+ virtual void f () {}
+ virtual int g () { int r = 0; __asm ("" : "+r" (r)); return r; }
+ int e;
+};
+struct F
+{
+ F () : f (0) {}
+ F (int x) : f (x) {}
+ virtual int h () { int r = 0; __asm ("" : "+r" (r)); return r; }
+ int f;
+};
+struct B : virtual A, public E, public F
+{
+ B ()
+ : E (
+ g ()
+ + h ()
+ + i ()
+ ),
+ F (g ()
+ + h ()
+ + i ()),
+ b (g () + h () + i ()) // It is ok to call the methods here.
+ {
+ b += g () + h () + i (); // And here too.
+ }
+ virtual void f () {}
+ int b;
+};
+struct C : B, virtual A
+{
+ C () : A (i ()) {}
+};
+
+int
+main ()
+{
+ C c;
+}
+
+// { dg-output "\[^\n\r]*pr70147-2.C:49:\[0-9]*: runtime error: member call on address 0x\[0-9a-fA-F]* which does not point to an object of type 'A'(\n|\r\n|\r)" }
+// { dg-output "0x\[0-9a-fA-F]*: note: object has invalid vptr(\n|\r\n|\r)" }
+// { dg-output " ?.. .. .. .. ?.. .. .. .. ?.. .. .. .. \[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?\\^~~~~~~~~~~\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?invalid vptr\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*pr70147-2.C:33:\[0-9]*: runtime error: member call on address 0x\[0-9a-fA-F]* which does not point to an object of type 'E'(\n|\r\n|\r)" }
+// { dg-output "0x\[0-9a-fA-F]*: note: object has invalid vptr(\n|\r\n|\r)" }
+// { dg-output " ?.. .. .. .. ?.. .. .. .. ?.. .. .. .. \[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?\\^~~~~~~~~~~\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?invalid vptr(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*pr70147-2.C:34:\[0-9]*: runtime error: member call on address 0x\[0-9a-fA-F]* which does not point to an object of type 'F'(\n|\r\n|\r)" }
+// { dg-output "0x\[0-9a-fA-F]*: note: object has invalid vptr(\n|\r\n|\r)" }
+// { dg-output " ?.. .. .. .. ?.. .. .. .. ?.. .. .. .. \[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?\\^~~~~~~~~~~\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?invalid vptr\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output "\[^\n\r]*pr70147-2.C:38:\[0-9]*: runtime error: member call on address 0x\[0-9a-fA-F]* which does not point to an object of type 'F'(\n|\r\n|\r)" }
+// { dg-output "0x\[0-9a-fA-F]*: note: object has invalid vptr(\n|\r\n|\r)" }
+// { dg-output " ?.. .. .. .. ?.. .. .. .. ?.. .. .. .. \[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?\\^~~~~~~~~~~\[^\n\r]*(\n|\r\n|\r)" }
+// { dg-output " ?invalid vptr" }
diff --git a/gcc/testsuite/g++.dg/ubsan/vptr-11.C b/gcc/testsuite/g++.dg/ubsan/vptr-11.C
new file mode 100644
index 00000000000..4516b1e3256
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/vptr-11.C
@@ -0,0 +1,84 @@
+// PR c++/70147
+// { dg-do run }
+// { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
+
+static int ac, ad, bc, bd, cc, cd, dc, dd;
+struct A
+{
+ A ()
+ {
+ ac++;
+ }
+ virtual void f ()
+ {
+ }
+ __attribute__ ((noinline)) ~ A ();
+};
+
+struct D
+{
+ __attribute__ ((noinline)) D (int);
+ ~D ()
+ {
+ dd++;
+ }
+};
+struct B: virtual A, D
+{
+ B ():D (1)
+ {
+ bc++;
+ }
+ virtual void f ()
+ {
+ }
+ ~B ()
+ {
+ bd++;
+ }
+};
+
+struct C: B, virtual A
+{
+ C ()
+ {
+ cc++;
+ }
+ ~C ()
+ {
+ cd++;
+ }
+};
+
+D::D (int x)
+{
+ if (x)
+ throw 1;
+ dc++;
+}
+
+__attribute__ ((noinline, noclone))
+void foo (A * p)
+{
+ p->f ();
+}
+
+A::~A ()
+{
+ foo (this);
+ ad++;
+}
+
+int
+main ()
+{
+ try
+ {
+ C c;
+ }
+ catch ( ...)
+ {
+ }
+ if (ac != 1 || ad != 1 || bc || bd || cc || cd || dc || dd)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wignored-attributes-1.C b/gcc/testsuite/g++.dg/warn/Wignored-attributes-1.C
new file mode 100644
index 00000000000..46ccc4a12f9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wignored-attributes-1.C
@@ -0,0 +1,6 @@
+// PR c++/69884
+// { dg-do compile }
+
+typedef float __m128 __attribute__((__vector_size__(16), __may_alias__));
+template <typename> struct A;
+template <> struct A<__m128>; // { dg-warning "ignoring attributes on template argument" }
diff --git a/gcc/testsuite/g++.dg/warn/Wignored-attributes-2.C b/gcc/testsuite/g++.dg/warn/Wignored-attributes-2.C
new file mode 100644
index 00000000000..6431607aaec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wignored-attributes-2.C
@@ -0,0 +1,7 @@
+// PR c++/69884
+// { dg-do compile }
+// { dg-options "-Wno-ignored-attributes" }
+
+typedef float __m128 __attribute__((__vector_size__(16), __may_alias__));
+template <typename> struct A;
+template <> struct A<__m128>;
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C b/gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C
new file mode 100644
index 00000000000..28dcac872ad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C
@@ -0,0 +1,14 @@
+// PR c++/70295
+// { dg-do compile }
+// { dg-options "-O2 -Wnonnull-compare" }
+
+struct A { A (); virtual ~A (); bool foo (bool); };
+struct B : virtual public A { B (); virtual ~B (); };
+
+bool
+A::foo (bool x)
+{
+ if (x && dynamic_cast<B *>(this) != (B *) 0) // { dg-bogus "nonnull argument" }
+ return true;
+ return false;
+}
diff --git a/gcc/testsuite/g++.dg/warn/constexpr-70194.C b/gcc/testsuite/g++.dg/warn/constexpr-70194.C
new file mode 100644
index 00000000000..cdc56c0c6f2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/constexpr-70194.C
@@ -0,0 +1,12 @@
+// PR c++/70194
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
+
+int i;
+
+const bool b0 = &i == 0; // { dg-warning "the address of .i. will never be NULL" }
+constexpr int *p = &i;
+const bool b1 = p == 0; // { dg-warning "the address of .i. will never be NULL" }
+const bool b2 = 0 == p; // { dg-warning "the address of .i. will never be NULL" }
+const bool b3 = p != 0; // { dg-warning "the address of .i. will never be NULL" }
+const bool b4 = 0 != p; // { dg-warning "the address of .i. will never be NULL" }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20151204.c b/gcc/testsuite/gcc.c-torture/compile/20151204.c
index 036316ced95..e07e13d4878 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20151204.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20151204.c
@@ -1,3 +1,5 @@
+/* { dg-skip-if "Array too big" { "avr-*-*" } } */
+
typedef __SIZE_TYPE__ size_t;
int strcmp (const char*, const char*);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr69102.c b/gcc/testsuite/gcc.c-torture/compile/pr69102.c
new file mode 100644
index 00000000000..b1328cad974
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr69102.c
@@ -0,0 +1,21 @@
+/* { dg-options "-Og -fPIC -fschedule-insns2 -fselective-scheduling2 -fno-tree-fre --param=max-sched-extend-regions-iters=10" } */
+void bar (unsigned int);
+
+void
+foo (void)
+{
+ char buf[1] = { 3 };
+ const char *p = buf;
+ const char **q = &p;
+ unsigned int ch;
+ switch (**q)
+ {
+ case 1: ch = 5; break;
+ case 2: ch = 4; break;
+ case 3: ch = 3; break;
+ case 4: ch = 2; break;
+ case 5: ch = 1; break;
+ default: ch = 0; break;
+ }
+ bar (ch);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70199.c b/gcc/testsuite/gcc.c-torture/compile/pr70199.c
new file mode 100644
index 00000000000..a4323f09f23
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr70199.c
@@ -0,0 +1,20 @@
+static volatile int v = 0;
+static
+void benchmark(long runs) {
+ void* labels[] = {
+ &&l0, &&l1, &&l2
+ };
+ for(unsigned int mask = 0x1F; mask > 0; mask >>= 1) {
+ unsigned lfsr = 0xACE1u;
+ long n = 10000000;
+ while(n > 0) {
+ l2: v;
+ l1: v;
+ goto *labels[lfsr & mask];
+ l0: n--;
+ }
+ }
+}
+int f(void) {
+ benchmark(10000000);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70240.c b/gcc/testsuite/gcc.c-torture/compile/pr70240.c
new file mode 100644
index 00000000000..830d4ddcc93
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr70240.c
@@ -0,0 +1,26 @@
+typedef short v16hi __attribute__ ((vector_size (32)));
+typedef int v8si __attribute__ ((vector_size (32)));
+typedef long long v4di __attribute__ ((vector_size (32)));
+
+int
+foo(int u16_0, int u32_0, int u64_0, int u16_1, int u32_1, int u64_1, v16hi v32u16_0, v8si v32u32_0, v4di v32u64_0, v16hi v32u16_1, v8si v32u32_1, v4di v32u64_1)
+{
+ do {
+ v32u16_1 += (v16hi){ v32u32_1[7], ~v32u32_1[3], 0, v32u64_0[0]};
+ u32_0 = (u32_0 << 31) | (u32_0 >> ~v32u32_0[1]);
+ u64_0 += 1;
+ v32u64_0[2] <<= v32u64_0[2] & 63;
+ u16_1 = (u16_1 >> (v32u16_0[11] & 15)) | (u16_1 << (-v32u16_0[11] & 15));
+ v32u16_0 -= ~v32u16_1;
+ v32u32_1[5] += u32_1;
+ if (v32u32_1[3] >= 0) {
+ u64_1 -= ~v32u64_1[1];
+ v32u16_1 += (v16hi){ -u64_1, ~u32_0, ~u16_1, v32u32_1[1], 0, ~v32u16_1[2], ~v32u64_1[2], ~v32u32_0[7]};
+ }
+ v32u64_1 += (v4di){0, 0, ~v32u32_0[5]};
+ v32u32_1 *= (v8si){0, ~v32u32_1[6]};
+ v32u64_0[3] &= 0x1234;
+ v32u64_0 += (v4di){v32u32_1[6]};
+ } while (u16_0 < 0x1234);
+ return u64_0 + u16_1;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70263-1.c b/gcc/testsuite/gcc.c-torture/compile/pr70263-1.c
new file mode 100644
index 00000000000..d4bf28043f3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr70263-1.c
@@ -0,0 +1,11 @@
+int a[91];
+int b, c;
+void fn1() {
+ int n, m;
+ do {
+ a[c--];
+ a[--c] = m;
+ a[--m] = b;
+ } while (n);
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70355.c b/gcc/testsuite/gcc.c-torture/compile/pr70355.c
new file mode 100644
index 00000000000..474942715f8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr70355.c
@@ -0,0 +1,14 @@
+/* { dg-require-effective-target int128 } */
+/* { dg-additional-options "-g" } */
+
+typedef unsigned __int128 v2ti __attribute__ ((vector_size (32)));
+
+unsigned
+foo (unsigned i, v2ti v)
+{
+ do {
+ i--;
+ v %= ~v;
+ } while (i);
+ return v[0] + v[1];
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68532.c b/gcc/testsuite/gcc.c-torture/execute/pr68532.c
index 5d4bd8e06d3..ac677cbc287 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr68532.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68532.c
@@ -1,4 +1,5 @@
/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
#define SIZE 128
unsigned short _Alignas (16) in[SIZE];
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c b/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c
new file mode 100644
index 00000000000..d79672e7fb4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/70222 */
+
+int a = 1;
+unsigned int b = 2;
+int c = 0;
+int d = 0;
+
+void
+foo ()
+{
+ int e = ((-(c >= c)) < b) > ((int) (-1ULL >> ((a / a) * 15)));
+ d = -e;
+}
+
+__attribute__((noinline, noclone)) void
+bar (int x)
+{
+ if (x != -1)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ foo ();
+ bar (d);
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c b/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c
new file mode 100644
index 00000000000..7611c986a9b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/70222 */
+
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+__attribute__((noinline, noclone)) unsigned int
+foo (int x)
+{
+ unsigned long long y = -1ULL >> x;
+ return (unsigned int) y >> 31;
+}
+#endif
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ if (foo (15) != 1 || foo (32) != 1 || foo (33) != 0)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70429.c b/gcc/testsuite/gcc.c-torture/execute/pr70429.c
new file mode 100644
index 00000000000..6b08c8ead08
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70429.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/70429 */
+
+__attribute__((noinline, noclone)) int
+foo (int a)
+{
+ return (int) (0x14ff6e2207db5d1fLL >> a) >> 4;
+}
+
+int
+main ()
+{
+ if (sizeof (int) != 4 || sizeof (long long) != 8 || __CHAR_BIT__ != 8)
+ return 0;
+ if (foo (1) != 0x3edae8 || foo (2) != -132158092)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-19.c b/gcc/testsuite/gcc.dg/Warray-bounds-19.c
new file mode 100644
index 00000000000..e2f9661cde3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-19.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/59124 */
+/* { dg-options "-O3 -Warray-bounds" } */
+
+unsigned baz[6];
+
+void foo(unsigned *bar, unsigned n)
+{
+ unsigned i, j;
+
+ if (n > 6)
+ n = 6;
+
+ for (i = 1; i < n; i++)
+ for (j = i - 1; j > 0; j--)
+ bar[j - 1] = baz[j - 1];
+}
+
diff --git a/gcc/testsuite/gcc.dg/atomic-op-6.c b/gcc/testsuite/gcc.dg/atomic-op-6.c
new file mode 100644
index 00000000000..f88c29389cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-op-6.c
@@ -0,0 +1,11 @@
+/* Test we don't generate bogus warnings. */
+/* PR c/69407 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra" } */
+
+void
+foo (int *p, int a)
+{
+ __atomic_fetch_add (&p, a, 0); /* { dg-bogus "value computed is not used" } */
+ __atomic_add_fetch (&p, a, 0); /* { dg-bogus "value computed is not used" } */
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pr70052.c b/gcc/testsuite/gcc.dg/dfp/pr70052.c
new file mode 100644
index 00000000000..53eb0757a81
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pr70052.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+typedef struct
+{
+ _Decimal128 td0;
+ _Decimal128 td1;
+} TDx2_t;
+
+
+TDx2_t
+D256_add_finite (void)
+{
+ _Decimal128 z, zz;
+ TDx2_t result = {0.DL, 0.DL};
+
+ if (zz == 0.DL)
+ {
+ result.td0 = z;
+ return result;
+ }
+
+ return result;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68715-2.c b/gcc/testsuite/gcc.dg/graphite/pr68715-2.c
new file mode 100644
index 00000000000..270d948f1f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68715-2.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -floop-interchange" } */
+
+int a, b, c, d, f, g;
+int e[1], h[1];
+void fn2 ();
+void fn3 ();
+void
+fn1 ()
+{
+ fn2 ();
+ b = 0;
+ for (; b < 10; b++)
+ ;
+}
+
+void
+fn2 ()
+{
+ if (a)
+ {
+ fn3 ();
+ c = d;
+ }
+}
+
+void
+fn3 ()
+{
+ for (; g; g++)
+ e[g] = 2;
+ if (f)
+ for (; g; g++)
+ h[g] = 5;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68715.c b/gcc/testsuite/gcc.dg/graphite/pr68715.c
new file mode 100644
index 00000000000..14da2fbf939
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68715.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-interchange" } */
+
+int a[1], c[1];
+int b, d, e;
+
+void
+fn1 (int p1)
+{
+ for (;;)
+ ;
+}
+
+int
+fn3 ()
+{
+ for (; e; e++)
+ c[e] = 2;
+ for (; d; d--)
+ a[d] = 8;
+ return 0;
+}
+
+int fn5 (int);
+
+int
+fn2 ()
+{
+ fn3 ();
+}
+
+void
+fn4 ()
+{
+ fn1 (b || fn5 (fn2 ()));
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68809-2.c b/gcc/testsuite/gcc.dg/graphite/pr68809-2.c
new file mode 100644
index 00000000000..e6639b85ef4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68809-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int ae, vs, gf;
+char ue;
+
+void
+kc (char);
+
+void
+pm (void)
+{
+ unsigned int v9;
+ int td = (gf != 0);
+ while (vs)
+ {
+ kc (ue);
+ for (ae = 0; ae < 70; ++ae)
+ {
+ }
+ ae &= 4;
+ ae ^ td && ((ue = 0) != 0);
+ ++vs;
+ }
+ v9 = ue + 1;
+ ue - v9 && ((ue = 0) != 0);
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68809.c b/gcc/testsuite/gcc.dg/graphite/pr68809.c
new file mode 100644
index 00000000000..1d758418f95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68809.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int ae, vs;
+char ue;
+
+void
+kc (char);
+
+void
+pm (void)
+{
+ unsigned int v9;
+ int gf = 0;
+ vs = 1;
+ while (vs)
+ {
+ gf -= ue;
+ kc (ue);
+ for (ae = 0; ae < 70; ++ae)
+ {
+ }
+ ae &= 4;
+ ae ^ (gf != 0) && ((ue = 0) != 0);
+ }
+ v9 = ue + 1;
+ ue - v9 && ((ue = 0) != 0);
+}
diff --git a/gcc/testsuite/gcc.dg/ifcvt-4.c b/gcc/testsuite/gcc.dg/ifcvt-4.c
index c096523b4de..d0d131b9ad8 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-4.c
@@ -1,5 +1,6 @@
/* { dg-options "-fdump-rtl-ce1 -O2 --param max-rtl-if-conversion-insns=3" } */
-/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* powerpc64le*-*-* visium-*-*" } {"*"} { "" } } */
+/* { dg-additional-options "-misel" { target { powerpc*-*-* } } } */
+/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* hppa*64*-*-* visium-*-*" } {"*"} { "" } } */
int
foo (int x, int y, int a)
diff --git a/gcc/testsuite/gcc.dg/ipa/pr70306.c b/gcc/testsuite/gcc.dg/ipa/pr70306.c
new file mode 100644
index 00000000000..be18208afd4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr70306.c
@@ -0,0 +1,45 @@
+/* { dg-options "-O2 -fdump-ipa-icf" } */
+/* { dg-do run } */
+
+int ctor_counter = 1;
+int dtor_counter;
+
+__attribute__((constructor))
+void A()
+{
+ ctor_counter++;
+}
+
+__attribute__((destructor))
+void B()
+{
+ if (dtor_counter == 0)
+ __builtin_abort ();
+
+ dtor_counter--;
+}
+
+__attribute__((constructor))
+static void C() {
+ ctor_counter++;
+}
+
+__attribute__((destructor))
+static void D() {
+ if (dtor_counter == 0)
+ __builtin_abort ();
+
+ dtor_counter--;
+}
+
+int main()
+{
+ if (ctor_counter != 3)
+ __builtin_abort ();
+
+ dtor_counter = 2;
+
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */
diff --git a/gcc/testsuite/gcc.dg/nested-func-10.c b/gcc/testsuite/gcc.dg/nested-func-10.c
new file mode 100644
index 00000000000..ac6f76fbbe7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/nested-func-10.c
@@ -0,0 +1,56 @@
+/* PR c/70093 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void __attribute__((noinline, noclone))
+foo (int n)
+{
+ struct S { int a[n]; };
+
+ struct S __attribute__((noreturn))
+ fn (void)
+ {
+ __builtin_abort ();
+ }
+
+ auto struct S __attribute__((noreturn))
+ fn2 (void)
+ {
+ __builtin_abort ();
+ }
+
+ struct S x;
+ __typeof__ (fn ()) *p = &x;
+ switch (n)
+ {
+ case 1:
+ fn ();
+ break;
+ case 2:
+ fn2 ();
+ break;
+ case 3:
+ x = fn ();
+ if (x.a[0] != 42)
+ __builtin_abort ();
+ break;
+ case 4:
+ if (fn ().a[0] != 42)
+ __builtin_abort ();
+ break;
+ case 5:
+ if (p->a[0] != 42)
+ __builtin_abort ();
+ break;
+ case 6:
+ if (fn2 ().a[0] != 42)
+ __builtin_abort ();
+ break;
+ }
+}
+
+int
+main (void)
+{
+ foo (1);
+}
diff --git a/gcc/testsuite/gcc.dg/nested-func-9.c b/gcc/testsuite/gcc.dg/nested-func-9.c
new file mode 100644
index 00000000000..902c2585393
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/nested-func-9.c
@@ -0,0 +1,47 @@
+/* PR c/70093 */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+void
+foo (int n)
+{
+ struct S { int a[n]; };
+
+ struct S
+ fn (void)
+ {
+ struct S s;
+ s.a[0] = 42;
+ return s;
+ }
+
+ auto struct S
+ fn2 (void)
+ {
+ return fn ();
+ }
+
+ struct S x;
+ fn ();
+ fn2 ();
+ x = fn ();
+
+ if (x.a[0] != 42)
+ __builtin_abort ();
+
+ if (fn ().a[0] != 42)
+ __builtin_abort ();
+
+ __typeof__ (fn ()) *p = &x;
+ if (p->a[0] != 42)
+ __builtin_abort ();
+
+ if (fn2 ().a[0] != 42)
+ __builtin_abort ();
+}
+
+int
+main (void)
+{
+ foo (1);
+}
diff --git a/gcc/testsuite/gcc.dg/pic-1.c b/gcc/testsuite/gcc.dg/pic-1.c
new file mode 100644
index 00000000000..86360aa3ae4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pic-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fpic" } */
+
+#if __PIC__ != 1
+# error __PIC__ is not 1!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c
new file mode 100644
index 00000000000..2c742e932b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pic-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fPIC" } */
+
+#if __PIC__ != 2
+# error __PIC__ is not 2!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pic-3.c b/gcc/testsuite/gcc.dg/pic-3.c
new file mode 100644
index 00000000000..7c4bbced218
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pic-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fno-pic" } */
+
+#ifdef __PIC__
+# error __PIC__ is defined!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pic-4.c b/gcc/testsuite/gcc.dg/pic-4.c
new file mode 100644
index 00000000000..727fe14bace
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pic-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fno-PIC" } */
+
+#ifdef __PIC__
+# error __PIC__ is defined!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-1.c b/gcc/testsuite/gcc.dg/pie-1.c
new file mode 100644
index 00000000000..ca43e8b7adc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fpie" } */
+
+#if __PIC__ != 1
+# error __PIC__ is not 1!
+#endif
+
+#if __PIE__ != 1
+# error __PIE__ is not 1!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-2.c b/gcc/testsuite/gcc.dg/pie-2.c
new file mode 100644
index 00000000000..e185e515655
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fPIE" } */
+
+#if __PIC__ != 2
+# error __PIC__ is not 2!
+#endif
+
+#if __PIE__ != 2
+# error __PIE__ is not 2!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-3.c b/gcc/testsuite/gcc.dg/pie-3.c
new file mode 100644
index 00000000000..0ccc56b194d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fno-pie" } */
+
+#ifdef __PIC__
+# error __PIC__ is defined!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-4.c b/gcc/testsuite/gcc.dg/pie-4.c
new file mode 100644
index 00000000000..f42bad3d297
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-options "-fno-PIE" } */
+
+#ifdef __PIC__
+# error __PIC__ is defined!
+#endif
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-5.c b/gcc/testsuite/gcc.dg/pie-5.c
new file mode 100644
index 00000000000..d49554f184c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-5.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target pie_enabled } } */
+/* { dg-options "" } */
+
+#ifndef __PIC__
+# error __PIC__ is not defined!
+#endif
+
+#ifndef __PIE__
+# error __PIE__ is not defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/pie-6.c b/gcc/testsuite/gcc.dg/pie-6.c
new file mode 100644
index 00000000000..fac1e945f69
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pie-6.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target { ! pie_enabled } } } */
+/* { dg-options "" } */
+
+#ifdef __PIE__
+# error __PIE__ is defined!
+#endif
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
index 170060f9a21..93729361388 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c
@@ -534,6 +534,24 @@ void test_builtin_choose_expr (int i)
}
extern int f (int);
+
+void test_builtin_types_compatible_p (unsigned long i)
+{
+ __emit_expression_range (0,
+ f (i) + __builtin_types_compatible_p (long, int)); /* { dg-warning "range" } */
+/* { dg-begin-multiline-output "" }
+ f (i) + __builtin_types_compatible_p (long, int));
+ ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
+
+ __emit_expression_range (0,
+ __builtin_types_compatible_p (long, int) + f (i)); /* { dg-warning "range" } */
+/* { dg-begin-multiline-output "" }
+ __builtin_types_compatible_p (long, int) + f (i));
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
+ { dg-end-multiline-output "" } */
+}
+
void test_builtin_call_with_static_chain (int i, void *ptr)
{
__emit_expression_range (0, __builtin_call_with_static_chain (f (i), ptr)); /* { dg-warning "range" } */
diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-2.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-2.c
index c8b45b654ba..eb37519a0db 100644
--- a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-2.c
@@ -20,7 +20,7 @@ int
fn_1 (int flag)
{
int foo = 4, bar = 5;
- if (flag) foo = 3; bar = 2; /* { dg-warning "indented" } */
+ if (flag) foo = 3; bar = 2; /* { dg-warning "this .if." } */
return foo * bar;
}
diff --git a/gcc/testsuite/gcc.dg/pr69032.c b/gcc/testsuite/gcc.dg/pr69032.c
new file mode 100644
index 00000000000..e0925cd8c56
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69032.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fsched-pressure -fsel-sched-pipelining -fselective-scheduling" } */
+
+void foo (long long i)
+{
+ while (i != -1)
+ {
+ ++i;
+ __asm__ ("");
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr69650.c b/gcc/testsuite/gcc.dg/pr69650.c
new file mode 100644
index 00000000000..decdb89a0be
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69650.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+# 9 "somefile" 2 /* { dg-warning "linemarker ignored due to incorrect nesting" } */
+not_a_type a; /* { dg-error "unknown type" } */
diff --git a/gcc/testsuite/gcc.dg/pr70161-2.c b/gcc/testsuite/gcc.dg/pr70161-2.c
new file mode 100644
index 00000000000..d2cb22140c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph -fipa-pta" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70161.c b/gcc/testsuite/gcc.dg/pr70161.c
new file mode 100644
index 00000000000..0b173c7ee9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70219.c b/gcc/testsuite/gcc.dg/pr70219.c
new file mode 100644
index 00000000000..bbdbe67c735
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70219.c
@@ -0,0 +1,18 @@
+/* PR middle-end/70219 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O1 -w -Wno-psabi" } */
+
+typedef int B __attribute__ ((vector_size (32)));
+typedef int D __attribute__ ((vector_size (32)));
+typedef long E __attribute__ ((vector_size (32)));
+typedef __int128 F;
+typedef __int128 G __attribute__ ((vector_size (32)));
+
+F
+foo (int a, unsigned b, F c, B d, G e, B f, D g, E h, G i)
+{
+ b /= c;
+ e /= (G) ~d;
+ h -= (E){ g[4], e[1], 64, ~f[1] };
+ return b + e[1] + h[0] + h[1] + i[1];
+}
diff --git a/gcc/testsuite/gcc.dg/pr70252.c b/gcc/testsuite/gcc.dg/pr70252.c
new file mode 100644
index 00000000000..209e691ecee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70252.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-march=skylake-avx512" { target { i?86-*-* x86_64-*-* } } } */
+
+extern unsigned char a [150];
+extern unsigned char b [150];
+extern unsigned char c [150];
+extern unsigned char d [150];
+extern unsigned char e [150];
+
+void foo () {
+ for (int i = 92; i <= 141; i += 2) {
+ int tmp = (d [i] && b [i]) <= (a [i] > c [i]);
+ e [i] = tmp >> b [i];
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr70269.c b/gcc/testsuite/gcc.dg/pr70269.c
new file mode 100644
index 00000000000..030cea1e605
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70269.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-graph" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70281.c b/gcc/testsuite/gcc.dg/pr70281.c
new file mode 100644
index 00000000000..9447fb1f2a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70281.c
@@ -0,0 +1,9 @@
+/* { dg-options "-Wall -fdiagnostics-show-caret" } */
+int bch_stats_show ()
+{
+ return __builtin_types_compatible_p (unsigned, int) ? "" : ""; /* { dg-warning "cast" } */
+/* { dg-begin-multiline-output "" }
+ return __builtin_types_compatible_p (unsigned, int) ? "" : "";
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
+ { dg-end-multiline-output "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr70317.c b/gcc/testsuite/gcc.dg/pr70317.c
new file mode 100644
index 00000000000..8f0864b76e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70317.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/70317 */
+/* { dg-do compile } */
+/* { dg-skip-if "No NaN support" { spu*-*-* vax*-*-* pdp11*-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef double V __attribute__((vector_size (256)));
+typedef __typeof ((V) {} < (V) {}) T;
+T a, b;
+
+__attribute__((noinline, noclone, optimize ("finite-math-only"))) void
+foo (V *x)
+{
+ V z = *x;
+ a = z <= z;
+}
+
+/* { dg-final { scan-tree-dump "a\[^\n\r]*= . -1, -1," "optimized" } } */
+
+__attribute__((noinline, noclone, optimize ("no-finite-math-only"))) void
+bar (V *x)
+{
+ V z = *x;
+ b = z <= z;
+}
+
+/* { dg-final { scan-tree-dump-not "b\[^\n\r]*= . -1, -1," "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr70326.c b/gcc/testsuite/gcc.dg/pr70326.c
new file mode 100644
index 00000000000..8332899d67f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70326.c
@@ -0,0 +1,20 @@
+/* PR middle-end/70326 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-Og -fno-dce -fno-guess-branch-probability -fschedule-insns -fno-tree-coalesce-vars -fno-tree-dce -w -Wno-psabi" } */
+
+typedef unsigned int A __attribute__ ((vector_size (32)));
+typedef unsigned __int128 B;
+typedef unsigned __int128 C __attribute__ ((vector_size (32)));
+typedef unsigned __int128 D __attribute__ ((vector_size (32)));
+
+void
+foo (B a, D b, A c, A d, C e)
+{
+ b /= (D) {11} | 1;
+ a ^= a <= 10;
+ e *= (C) d;
+ e += (C) ~b;
+ c[0] ^= c[0] <= 0x1234;
+ a = (a >> 1) | (a << 127);
+ b += (D) {45, 123};
+}
diff --git a/gcc/testsuite/gcc.dg/pr70405.c b/gcc/testsuite/gcc.dg/pr70405.c
new file mode 100644
index 00000000000..bff390ff06d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70405.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/70405 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-additional-options "-mavx512f" { target i?86-*-* x86_64-*-* } } */
+
+typedef short V __attribute__ ((vector_size (32)));
+
+int
+foo (V *p)
+{
+ V v = *p;
+ v >>= v;
+ v -= v[0];
+ return v[3];
+}
diff --git a/gcc/testsuite/gcc.dg/sibcall-11.c b/gcc/testsuite/gcc.dg/sibcall-11.c
new file mode 100644
index 00000000000..ae587708236
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sibcall-11.c
@@ -0,0 +1,7 @@
+// Test for sibcall optimization with empty struct.
+// { dg-options "-O2" }
+// { dg-final { scan-assembler "jmp" { target i?86-*-* x86_64-*-* } } }
+
+struct A { };
+void f(struct A);
+void g(struct A a) { f(a); }
diff --git a/gcc/testsuite/gcc.dg/torture/pr70083.c b/gcc/testsuite/gcc.dg/torture/pr70083.c
index 7f047a5b044..0cf289255c9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70083.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70083.c
@@ -18,3 +18,7 @@ foo(int u32_0, int u64_0, int u64_1, v16hi v32u16_0, v8si v32u32_0, v4di v32u64_
v32u32_1 /= (v8si){0x1e7390, v32u16_0[12], ~v32u16_1[2], -u64_0};
return v32u16_0[4] + v32u16_0[5] + v32u32_0[5] + v32u32_1[6] + v32u64_1[3];
}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector passed by reference.*" } */
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr70278.c b/gcc/testsuite/gcc.dg/torture/pr70278.c
new file mode 100644
index 00000000000..89bd2660c1f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70278.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+typedef union
+{
+ double value;
+ struct
+ {
+ unsigned int msw;
+ } parts;
+} ieee_double_shape_type;
+double __ieee754_hypot(double x, double y)
+{
+ double a=x,b=y,t1,t2,y1,y2,w;
+ int j,k,ha,hb;
+ do { ieee_double_shape_type gh_u; gh_u.value = (x); (ha) = gh_u.parts.msw; } while (0);;
+ if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
+ if(ha > 0x5f300000) {
+ do { ieee_double_shape_type sh_u; sh_u.value = (a); sh_u.parts.msw = (ha); (a) = sh_u.value; } while (0);;
+ }
+ w = a-b;
+ if (w <= b)
+ {
+ t2 = a - t1;
+ w = t1*y1-(w*(-w)-(t1*y2+t2*b));
+ }
+ if(k!=0) {
+ } else return w;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70288-1.c b/gcc/testsuite/gcc.dg/torture/pr70288-1.c
new file mode 100644
index 00000000000..1fb049548fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70288-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+int main()
+{
+ int var6 = -1267827473;
+ do {
+ ++var6;
+ double s1_115[4], s2_108[4];
+ int var8 = -161498264;
+ do {
+ ++var8;
+ int var12 = 1260960076;
+ for (; var12 <= 1260960080; ++var12) {
+ int var13 = 1960990937;
+ do {
+ ++var13;
+ int var14 = 2128638723;
+ for (; var14 <= 2128638728; ++var14) {
+ int var22 = -1141190839;
+ do {
+ ++var22;
+ if (s2_108 > s1_115) {
+ int var23 = -890798748;
+ do {
+ ++var23;
+ long long e_119[4];
+ } while (var23 <= -890798746);
+ }
+ } while (var22 <= -1141190829);
+ }
+ } while (var13 <= 1960990946);
+ }
+ } while (var8 <= -161498254);
+ } while (var6 <= -1267827462);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70288-2.c b/gcc/testsuite/gcc.dg/torture/pr70288-2.c
new file mode 100644
index 00000000000..ad90fd45887
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70288-2.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+int main()
+{
+ int var6 = -1267827473;
+ do {
+ ++var6;
+ double s1_115[4], s2_108[4];
+ int var8 = -161498264;
+ do {
+ ++var8;
+ int var12 = 1260960076;
+ for (; var12 <= 1260960080; ++var12) {
+ int var13 = 1960990937;
+ do {
+ ++var13;
+ int var14 = 2128638723;
+ for (; var14 <= 2128638728; ++var14) {
+ int var22 = -1141190839;
+ do {
+ ++var22;
+ if (s2_108 > s1_115) {
+ int var23 = -890798748;
+ do {
+ long long e_119[4];
+ } while (var23 <= -890798746);
+ }
+ } while (var22 <= -1141190829);
+ }
+ } while (var13 <= 1960990946);
+ }
+ } while (var8 <= -161498254);
+ } while (var6 <= -1267827462);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70310.c b/gcc/testsuite/gcc.dg/torture/pr70310.c
new file mode 100644
index 00000000000..a962562fca2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70310.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+typedef unsigned char v32u8 __attribute__ ((vector_size (32)));
+
+unsigned __attribute__((noinline, noclone))
+foo(unsigned u)
+{
+ v32u8 v32u8_0 = (v32u8){} > (v32u8){-u};
+ return v32u8_0[31] + v32u8_0[0];
+}
+
+int
+main ()
+{
+ unsigned x = foo(0);
+ __builtin_printf ("%08x\n",x);
+ if (x != 0)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70333.c b/gcc/testsuite/gcc.dg/torture/pr70333.c
new file mode 100644
index 00000000000..854e6d59e1a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70333.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+
+unsigned long int
+foo (signed char b, signed char e)
+{
+ return ((2ULL * b) * (e * 13)) * (32 << 24);
+}
+
+int
+main ()
+{
+ if (__CHAR_BIT__ == 8
+ && sizeof (int) == 4
+ && sizeof (long long) == 8
+ && foo (-60, 1) != 0xffffff3d00000000ULL)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70370.c b/gcc/testsuite/gcc.dg/torture/pr70370.c
new file mode 100644
index 00000000000..d077bee3f0f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70370.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+
+_Complex float
+test1 (_Complex float f)
+{
+ __asm__ ("" : "+r" (__real f));
+ return f;
+}
+
+_Complex float
+test2 (_Complex float f)
+{
+ __asm__ ("" : "=r" (__real f));
+ return f;
+}
+
+struct X { int i; };
+
+struct X
+test3 (struct X x)
+{
+ __asm__ ("" : "=r" (x.i));
+ return x;
+}
+
+struct X
+test4 (struct X x)
+{
+ __asm__ ("" : "+r" (x.i));
+ return x;
+}
+
+struct X
+test5 (struct X x)
+{
+ __asm__ ("" : "=r" (x));
+ return x;
+}
+
+struct X
+test6 (struct X x)
+{
+ __asm__ ("" : "+r" (x));
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70396.c b/gcc/testsuite/gcc.dg/torture/pr70396.c
new file mode 100644
index 00000000000..839610f2095
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70396.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+struct S2 {
+ signed f1 : 3;
+};
+int a[100];
+int b, c;
+char d;
+void fn1() {
+ struct S2 e;
+ b / e.f1;
+ c = 2;
+ for (; c < 100; c++) {
+ d = 0;
+ a[c] = ~e.f1 != d;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70421.c b/gcc/testsuite/gcc.dg/torture/pr70421.c
new file mode 100644
index 00000000000..8f97acd42be
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70421.c
@@ -0,0 +1,22 @@
+/* PR target/70421 */
+/* { dg-do run } */
+/* { dg-additional-options "-Wno-psabi -w" } */
+
+typedef unsigned V __attribute__ ((vector_size (64)));
+
+unsigned __attribute__ ((noinline, noclone))
+foo (unsigned x, V u, V v)
+{
+ v[1] ^= v[2];
+ x ^= ((V) v)[u[0]];
+ return x;
+}
+
+int
+main ()
+{
+ unsigned x = foo (0x10, (V) { 1 }, (V) { 0x100, 0x1000, 0x10000 });
+ if (x != 0x11010)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70450.c b/gcc/testsuite/gcc.dg/torture/pr70450.c
new file mode 100644
index 00000000000..ee5e24d0522
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70450.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+
+unsigned long int a = 2UL;
+int b = 2;
+unsigned long int c = 2UL;
+
+void foo ()
+{
+ c = 2 * ((2 * a) * (2 * (-b)));
+}
+
+int main ()
+{
+ foo();
+ if (c != 18446744073709551584UL)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68714.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68714.c
new file mode 100644
index 00000000000..8cd7c14c288
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68714.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/68714 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1 -w -Wno-psabi" } */
+
+typedef int vec __attribute__((vector_size(16)));
+vec f(vec x,vec y){
+ return x<y|x==y;
+}
+
+/* { dg-final { scan-tree-dump-times " <= " 1 "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69845-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69845-1.c
new file mode 100644
index 00000000000..92927ba4913
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69845-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32 } */
+/* { dg-options "-O -fdump-tree-gimple -fdump-tree-optimized" } */
+
+int
+main ()
+{
+ struct S { char s; } v;
+ v.s = 47;
+ int a = (int) v.s;
+ int b = (27005061 + (a + 680455));
+ int c = ((1207142401 * (((8 * b) + 9483541) - 230968044)) + 469069442);
+ if (c != 1676211843)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "b \\\* 8" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69845-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69845-2.c
new file mode 100644
index 00000000000..e0b38e9966c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69845-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32 } */
+/* { dg-options "-O -fdump-tree-gimple -fdump-tree-optimized" } */
+
+int
+main ()
+{
+ struct S { char s; } v;
+ v.s = 47;
+ unsigned int a = (unsigned int) v.s;
+ unsigned int b = (27005061 + (a + 680455));
+ unsigned int c
+ = ((1207142401u * (((8u * b) + 9483541u) - 230968044u)) + 469069442u);
+ if (c != 1676211843u)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "b \\\* 1067204616" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
new file mode 100644
index 00000000000..6cc987a722a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
@@ -0,0 +1,129 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
+
+/* All the threads found by the FSM threader should have too
+ many statements to be profitable. */
+/* { dg-final { scan-tree-dump-not "Registering FSM " "dom2"} } */
+/* { dg-final { scan-tree-dump-not "Registering FSM " "dom3"} } */
+/* { dg-final { scan-tree-dump-not "Registering FSM " "vrp1"} } */
+/* { dg-final { scan-tree-dump-not "Registering FSM " "vrp2"} } */
+
+typedef _Bool bool;
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+typedef unsigned long long uint64_t;
+typedef unsigned int size_t;
+
+enum {
+ false = 0,
+ true = 1
+};
+
+struct list_head {
+ struct list_head *next, *prev;
+};
+
+
+extern void * memcpy(void *, const void *, size_t);
+extern int memcmp(const void *,const void *,size_t);
+extern void * memset(void *, int, size_t);
+extern void __memzero(void *ptr, size_t n);
+
+static inline uint64_t wwn_to_uint64_t(uint8_t *wwn)
+{
+ return (uint64_t)wwn[0] << 56 | (uint64_t)wwn[1] << 48 |
+ (uint64_t)wwn[2] << 40 | (uint64_t)wwn[3] << 32 |
+ (uint64_t)wwn[4] << 24 | (uint64_t)wwn[5] << 16 |
+ (uint64_t)wwn[6] << 8 | (uint64_t)wwn[7];
+}
+
+struct lpfc_name {
+ union {
+ uint8_t wwn[8];
+ } u;
+};
+
+struct lpfc_hba {
+ uint32_t cfg_fof;
+ uint32_t cfg_oas_flags;
+ struct list_head luns;
+};
+
+struct lpfc_device_id {
+ struct lpfc_name vport_wwpn;
+ struct lpfc_name target_wwpn;
+ uint64_t lun;
+};
+
+struct lpfc_device_data {
+ struct list_head listentry;
+ struct lpfc_device_id device_id;
+ bool oas_enabled;
+ bool available;
+};
+
+bool
+lpfc_find_next_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn,
+ struct lpfc_name *target_wwpn, uint64_t *starting_lun,
+ struct lpfc_name *found_vport_wwpn,
+ struct lpfc_name *found_target_wwpn,
+ uint64_t *found_lun,
+ uint32_t *found_lun_status)
+{
+
+ struct lpfc_device_data *lun_info;
+ struct lpfc_device_id *device_id;
+ uint64_t lun;
+ bool found = false;
+
+ if (__builtin_expect(!!(!phba), 0) || !vport_wwpn || !target_wwpn ||
+ !starting_lun || !found_vport_wwpn ||
+ !found_target_wwpn || !found_lun || !found_lun_status ||
+ (*starting_lun == -1u) ||
+ !phba->cfg_fof)
+ return false;
+
+ lun = *starting_lun;
+ *found_lun = -1;
+ *starting_lun = -1;
+
+
+
+ for (lun_info = ({ const typeof( ((typeof(*lun_info) *)0)->listentry ) *__mptr = ((&phba->luns)->next); (typeof(*lun_info) *)( (char *)__mptr - __builtin_offsetof(typeof(*lun_info), listentry) );}); &lun_info->listentry != (&phba->luns); lun_info = ({ const typeof( ((typeof(*(lun_info)) *)0)->listentry ) *__mptr = ((lun_info)->listentry.next); (typeof(*(lun_info)) *)( (char *)__mptr - __builtin_offsetof(typeof(*(lun_info)), listentry) );})) {
+ if (((wwn_to_uint64_t(vport_wwpn->u.wwn) == 0) ||
+ (memcmp(&lun_info->device_id.vport_wwpn, vport_wwpn,
+ sizeof(struct lpfc_name)) == 0)) &&
+ ((wwn_to_uint64_t(target_wwpn->u.wwn) == 0) ||
+ (memcmp(&lun_info->device_id.target_wwpn, target_wwpn,
+ sizeof(struct lpfc_name)) == 0)) &&
+ (lun_info->oas_enabled)) {
+ device_id = &lun_info->device_id;
+ if ((!found) && ((lun == 0) || (device_id->lun == lun))) {
+ *found_lun = device_id->lun;
+ memcpy(found_vport_wwpn, &device_id->vport_wwpn, sizeof(struct lpfc_name));
+ memcpy(found_target_wwpn, &device_id->target_wwpn, sizeof(struct lpfc_name));
+ if (lun_info->available)
+ *found_lun_status = 0x01;
+ else
+ *found_lun_status = 0;
+ if (phba->cfg_oas_flags & 0x01)
+ ({ void *__p = (vport_wwpn); size_t __n = sizeof(struct lpfc_name); if ((__n) != 0) { if (__builtin_constant_p((0x0)) && (0x0) == 0) __memzero((__p),(__n)); else memset((__p),(0x0),(__n)); } (__p); })
+ ;
+ if (phba->cfg_oas_flags & 0x02)
+ ({ void *__p = (target_wwpn); size_t __n = sizeof(struct lpfc_name); if ((__n) != 0) { if (__builtin_constant_p((0x0)) && (0x0) == 0) __memzero((__p),(__n)); else memset((__p),(0x0),(__n)); } (__p); })
+ ;
+ found = true;
+ } else if (found) {
+ *starting_lun = device_id->lun;
+ memcpy(vport_wwpn, &device_id->vport_wwpn,
+ sizeof(struct lpfc_name));
+ memcpy(target_wwpn, &device_id->target_wwpn,
+ sizeof(struct lpfc_name));
+ break;
+ }
+ }
+ }
+ return found;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c
new file mode 100644
index 00000000000..a6d18d25c1c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70372.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-fre -w -Wno-psabi" } */
+
+typedef unsigned v2ti __attribute__ ((vector_size (32)));
+
+v2ti
+foo (v2ti u, v2ti v)
+{
+ u[0] >>= 0xf;
+ v ^= ~v;
+ v &= ~u;
+ v -= -u;
+ return v;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c
index fc7aceaa70b..d7b9ed04b7d 100644
--- a/gcc/testsuite/gcc.dg/uninit-19.c
+++ b/gcc/testsuite/gcc.dg/uninit-19.c
@@ -1,26 +1,26 @@
-/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
-
-int a, l, m;
-float *b;
-float c, d, e, g, h;
-unsigned char i, k;
-void
-fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
- unsigned char *c2, float *p10)
-{
- if (p1 & 8)
- b[3] = p10[a]; /* 13. */
-}
-
-void
-fn2 ()
-{
- float *n;
- if (l & 6)
- n = &c + m;
- fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 22. */
-}
-
-/* { dg-warning "may be used uninitialized" "" { target nonpic } 13 } */
-/* { dg-warning "may be used uninitialized" "" { target { ! nonpic } } 22 } */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int a, l, m;
+float *b;
+float c, d, e, g, h;
+unsigned char i, k;
+void
+fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
+ unsigned char *c2, float *p10)
+{
+ if (p1 & 8)
+ b[3] = p10[a]; /* 13. */
+}
+
+void
+fn2 ()
+{
+ float *n;
+ if (l & 6)
+ n = &c + m;
+ fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 22. */
+}
+
+/* { dg-warning "may be used uninitialized" "" { target nonpic } 13 } */
+/* { dg-warning "may be used uninitialized" "" { target { ! nonpic } } 22 } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr70354-1.c b/gcc/testsuite/gcc.dg/vect/pr70354-1.c
new file mode 100644
index 00000000000..70de8119a29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr70354-1.c
@@ -0,0 +1,50 @@
+/* PR tree-optimization/70354 */
+/* { dg-do run } */
+
+#ifndef main
+#include "tree-vect.h"
+#endif
+
+long long int b[64], c[64], g[64];
+unsigned long long int a[64], d[64], e[64], f[64], h[64];
+
+__attribute__ ((noinline, noclone)) void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ {
+ d[i] = h[i] << (((((unsigned long long int) b[i] * e[i])
+ << (-a[i] - 3752448776177690134ULL))
+ - 8214565720323784703ULL) - 1ULL);
+ e[i] = (_Bool) (f[i] + (unsigned long long int) g[i]);
+ g[i] = c[i];
+ }
+}
+
+int
+main ()
+{
+ int i;
+#ifndef main
+ check_vect ();
+#endif
+ if (__CHAR_BIT__ != 8 || sizeof (long long int) != 8)
+ return 0;
+ for (i = 0; i < 64; ++i)
+ {
+ a[i] = 14694295297531861425ULL;
+ b[i] = -1725558902283030715LL;
+ c[i] = 4402992416302558097LL;
+ e[i] = 6297173129107286501ULL;
+ f[i] = 13865724171235650855ULL;
+ g[i] = 982871027473857427LL;
+ h[i] = 8193845517487445944ULL;
+ }
+ foo ();
+ for (i = 0; i < 64; i++)
+ if (d[i] != 8193845517487445944ULL || e[i] != 1
+ || g[i] != 4402992416302558097ULL)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr70354-2.c b/gcc/testsuite/gcc.dg/vect/pr70354-2.c
new file mode 100644
index 00000000000..356a1152d0c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr70354-2.c
@@ -0,0 +1,37 @@
+/* PR tree-optimization/70354 */
+/* { dg-do run } */
+
+#ifndef main
+#include "tree-vect.h"
+#endif
+
+unsigned long long a[64], b[64];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ a[i] <<= (b[i] - 0x1200000000ULL);
+}
+
+int
+main ()
+{
+ int i;
+#ifndef main
+ check_vect ();
+#endif
+ if (__CHAR_BIT__ != 8 || sizeof (long long int) != 8)
+ return 0;
+ for (i = 0; i < 64; i++)
+ {
+ a[i] = 0x1234ULL;
+ b[i] = 0x1200000000ULL + (i % 54);
+ }
+ foo ();
+ for (i = 0; i < 64; i++)
+ if (a[i] != (0x1234ULL << (i % 54)))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr63304_1.c b/gcc/testsuite/gcc.target/aarch64/pr63304_1.c
index fa0fb56d9e1..c917f81c022 100644
--- a/gcc/testsuite/gcc.target/aarch64/pr63304_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/pr63304_1.c
@@ -1,5 +1,5 @@
/* { dg-do assemble } */
-/* { dg-options "-O1 --save-temps" } */
+/* { dg-options "-O1 --save-temps -mno-fix-cortex-a53-843419" } */
#pragma GCC push_options
#pragma GCC target ("+nothing+simd, cmodel=small")
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70120-1.c b/gcc/testsuite/gcc.target/aarch64/pr70120-1.c
new file mode 100644
index 00000000000..31a5e949b11
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70120-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -fschedule-insns -mno-pc-relative-literal-loads -g" } */
+
+typedef short v32u16 __attribute__ ((vector_size (32)));
+typedef int v32u32 __attribute__ ((vector_size (32)));
+typedef long v32u64 __attribute__ ((vector_size (32)));
+typedef __int128 u128;
+typedef __int128 v32u128 __attribute__ ((vector_size (32)));
+
+int
+foo(int u16_0, int u32_0, int u64_0, u128 u128_0, int u16_1, int u32_1, int u64_1, u128 u128_1, v32u16 v32u16_0, v32u32 v32u32_0, v32u64 v32u64_0, v32u128 v32u128_0, v32u16 v32u16_1, v32u32 v32u32_1, v32u64 v32u64_1, v32u128 v32u128_1)
+{
+ v32u32_1 ^= (v32u32) ~ v32u64_0;
+ v32u32_1 %= (v32u32) - v32u16_1 | 1;
+ v32u16_1 -= (v32u16) v32u16_1;
+ v32u64_0 *= (v32u64){~ u128_0, v32u16_1[5], v32u16_0[15], v32u32_1[4]};
+ v32u16_0 /= (v32u16){0x574c, ~u128_1, v32u128_1[0], u64_1, v32u64_0[1], v32u64_1[2], 0, 0x8ce6, u128_1, 0x5e69} |1;
+ return v32u16_0[0] + v32u16_0[6] + v32u16_0[8] + v32u16_0[9] + v32u32_0[0] + v32u32_0[1] + v32u32_0[2] + v32u32_0[3] + v32u32_0[4] + v32u32_0[6] + v32u64_0[0] + v32u64_0[2] + v32u64_0[3] + v32u128_0[0] + v32u128_0[1] + v32u32_1[0] + v32u32_1[2] + v32u64_1[2] + v32u64_1[3] + v32u128_1[1];
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70120-2.c b/gcc/testsuite/gcc.target/aarch64/pr70120-2.c
new file mode 100644
index 00000000000..0110224754b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70120-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -freorder-functions -g3 -mcmodel=large" } */
+
+typedef short v32u16 __attribute__ ((vector_size (32)));
+typedef int v32u32 __attribute__ ((vector_size (32)));
+typedef long v32u64 __attribute__ ((vector_size (32)));
+typedef __int128 u128;
+typedef __int128 v32u128 __attribute__ ((vector_size (32)));
+
+int
+foo (int u16_0, int u32_0, int u64_0, u128 u128_0, int u16_1, int u32_1, v32u16 v32u16_0, v32u32 v32u32_0, v32u64 v32u64_0, v32u128 v32u128_0, v32u16 v32u16_1, v32u32 v32u32_1, v32u64 v32u64_1, v32u128 v32u128_1)
+{
+ u128_0 <<= 0x6c;
+ v32u16_1 %= (v32u16) { 1, 64, 0xf294, 0, u32_1, v32u32_1[6], ~u128_0, 0x2912, v32u32_0[2]} | 1;
+ v32u16_0 ^= (v32u16){-v32u16_1[11], -u32_1, 64, ~u128_0, 0, 1, 64, ~u64_0, 0};
+ return u16_0 + u32_0 + u16_1 + v32u16_0[0] + v32u32_0[1] + v32u32_0[2] + v32u32_0[4] + v32u32_0[6] + v32u64_0[0] + v32u64_0[1] + v32u64_0[2] + v32u64_0[3] + v32u128_0[0] + v32u128_0[1] + v32u16_1[0] + v32u32_1[7] + v32u64_1[0] + v32u64_1[1] + v32u64_1[2] + v32u64_1[3] + v32u128_1[0] + v32u128_1[1];
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70120-3.c b/gcc/testsuite/gcc.target/aarch64/pr70120-3.c
new file mode 100644
index 00000000000..2b70df72a98
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70120-3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ffunction-sections -mno-pc-relative-literal-loads -g3" } */
+
+typedef unsigned short u16;
+typedef unsigned short v32u16 __attribute__((vector_size(32)));
+typedef unsigned int u32;
+typedef unsigned int v32u32 __attribute__((vector_size(32)));
+typedef unsigned long long u64;
+typedef unsigned long long v32u64 __attribute__((vector_size(32)));
+typedef unsigned __int128 u128;
+typedef unsigned __int128 v32u128 __attribute__((vector_size(32)));
+u128 __attribute__((noinline, noclone))
+foo(u16 u16_0, u32 u32_0, u64 u64_0, u128 u128_0, u16 u16_1, u32 u32_1, u64 u64_1, u128 u128_1, v32u16 v32u16_0, v32u32 v32u32_0, v32u64 v32u64_0, v32u128 v32u128_0, v32u16 v32u16_1, v32u32 v32u32_1, v32u64 v32u64_1, v32u128 v32u128_1)
+{
+ v32u128_1 %= (v32u128)v32u32_1 | 1;
+ u16_1 /= ((u32)~(u128)(((u128)0xa1 << 0))) | 1;
+ v32u32_0 += (v32u32){(u16)v32u16_1[9], (u16)v32u16_1[14], (u32)-v32u32_0[7], ((u64)(u32)(((u128)0x43bc59e9 << 0))), ((u32)(u32)(((u128)0x14a47ba8f240a6 << 0))), (u128)v32u128_1[1], (u16)u16_1, (u64)-u64_1};
+ return u16_0 + u32_0 + u64_0 + u128_0 + u16_1 + u32_1 + u64_1 + u128_1 + v32u16_0[0] + v32u16_0[1] + v32u16_0[2] + v32u16_0[3] + v32u16_0[4] + v32u16_0[5] + v32u16_0[6] + v32u16_0[7] + v32u16_0[8] + v32u16_0[9] + v32u16_0[10] + v32u16_0[11] + v32u16_0[12] + v32u16_0[13] + v32u16_0[14] + v32u16_0[15] + v32u32_0[0] + v32u32_0[1] + v32u32_0[2] + v32u32_0[3] + v32u32_0[4] + v32u32_0[5] + v32u32_0[6] + v32u32_0[7] + v32u64_0[0] + v32u64_0[1] + v32u64_0[2] + v32u64_0[3] + v32u128_0[0] + v32u128_0[1] + v32u16_1[0] + v32u16_1[1] + v32u16_1[2] + v32u16_1[3] + v32u16_1[4] + v32u16_1[5] + v32u16_1[6] + v32u16_1[7] + v32u16_1[8] + v32u16_1[9] + v32u16_1[10] + v32u16_1[11] + v32u16_1[12] + v32u16_1[13] + v32u16_1[14] + v32u16_1[15] + v32u32_1[0] + v32u32_1[1] + v32u32_1[2] + v32u32_1[3] + v32u32_1[4] + v32u32_1[5] + v32u32_1[6] + v32u32_1[7] + v32u64_1[0] + v32u64_1[1] + v32u64_1[2] + v32u64_1[3] + v32u128_1[0] + v32u128_1[1];
+}
+int main()
+{
+}
diff --git a/gcc/testsuite/gcc.target/arm/attr-align1.c b/gcc/testsuite/gcc.target/arm/attr-align1.c
index 96d29a9eed5..a53f1670686 100644
--- a/gcc/testsuite/gcc.target/arm/attr-align1.c
+++ b/gcc/testsuite/gcc.target/arm/attr-align1.c
@@ -2,6 +2,7 @@
Verify alignment when both attribute optimize and target are used. */
/* { dg-do compile } */
/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
+/* { dg-skip-if "" arm_cortex_m } */
void
__attribute__ ((target ("arm")))
diff --git a/gcc/testsuite/gcc.target/arm/attr-align3.c b/gcc/testsuite/gcc.target/arm/attr-align3.c
index edcf64b45e0..593d7fbc2b9 100644
--- a/gcc/testsuite/gcc.target/arm/attr-align3.c
+++ b/gcc/testsuite/gcc.target/arm/attr-align3.c
@@ -2,6 +2,7 @@
Verify alignment when attribute target is used. */
/* { dg-do compile } */
/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
+/* { dg-skip-if "" arm_cortex_m } */
/* { dg-options "-Os -mthumb" } */
/* Check that arm code is always 4 bytes aligned. */
diff --git a/gcc/testsuite/gcc.target/arm/attr_arm.c b/gcc/testsuite/gcc.target/arm/attr_arm.c
index f5c70ef690f..d765d121e29 100644
--- a/gcc/testsuite/gcc.target/arm/attr_arm.c
+++ b/gcc/testsuite/gcc.target/arm/attr_arm.c
@@ -1,5 +1,6 @@
/* Check that attribute target arm is recognized. */
/* { dg-do compile } */
+/* { dg-skip-if "" arm_cortex_m } */
/* { dg-final { scan-assembler "\\.arm" } } */
/* { dg-final { scan-assembler-not "\\.thumb_func" } } */
diff --git a/gcc/testsuite/gcc.target/arm/flip-thumb.c b/gcc/testsuite/gcc.target/arm/flip-thumb.c
index 355d6637755..4bbe546b632 100644
--- a/gcc/testsuite/gcc.target/arm/flip-thumb.c
+++ b/gcc/testsuite/gcc.target/arm/flip-thumb.c
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* Make sure the current multilib supports thumb. */
/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
+/* { dg-skip-if "" arm_cortex_m } */
/* { dg-options "-O2 -mflip-thumb -mno-restrict-it" } */
/* { dg-final { scan-assembler "\\.arm" } } */
/* { dg-final { scan-assembler-times "\\.thumb_func" 1} } */
diff --git a/gcc/testsuite/gcc.target/arm/pr69307.c b/gcc/testsuite/gcc.target/arm/pr69307.c
new file mode 100644
index 00000000000..c04cfa2973f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr69307.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fselective-scheduling -mtune=arm1136j-s" } */
+
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long int uint64_t;
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+u64 __attribute__((noinline, noclone))
+foo(u8 u8_0, u16 u16_0, u32 u32_0, u64 u64_0, u8 u8_1, u16 u16_1, u32 u32_1, u64 u64_1, u8 u8_2, u16 u16_2, u32 u32_2, u64 u64_2, u8 u8_3, u16 u16_3, u32 u32_3, u64 u64_3)
+{
+ u8 *p8_2 = &u8_2;
+ u16 *p16_2 = &u16_2;
+ u8 *p8_3 = &u8_3;
+ u64 *p64_3 = &u64_3;
+ p8_2 = &u8_3;
+ *p8_3 -= *p64_3;
+ *p8_2 = (u64)*p8_2 % ((u64)*p8_2 | 3);
+ u8_2 = (u64)u8_2 / ((u64)*p16_2 | 1);
+ u16_0 = (u64)u16_0 % ((u64)*p8_2 | 3);
+ return u8_0 + u16_0 + u32_0 + u64_0 + u8_1 + u16_1 + u32_1 + u64_1 + u8_2 + u16_2 + u32_2 + u64_2 + u8_3 + u16_3 + u32_3 + u64_3;
+}
+int main()
+{
+ u64 x = 0;
+ x += foo(3llu, 6llu, 15llu, 28llu, 5llu, 11llu, 20llu, 44llu, 7llu, 10llu, 20llu, 55llu, 0llu, 9llu, 17llu, 48llu);
+ __builtin_printf("%02x%02x%02x%02x%02x%02x%02x%02x\n", (unsigned)((x >> 0) & 0xff), (unsigned)((x >> 8) & 0xff), (unsigned)((x >> 16) & 0xff), (unsigned)((x >> 24) & 0xff), (unsigned)((x >> 32) & 0xff), (unsigned)((x >> 40) & 0xff), (unsigned)((x >> 48) & 0xff), (unsigned)((x >> 56) & 0xff));
+ if (x != 0x1f3)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr70278.c b/gcc/testsuite/gcc.target/arm/pr70278.c
new file mode 100644
index 00000000000..c44c07b7b59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr70278.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */
+/* { dg-options "-mthumb" } */
+/* { dg-add-options arm_arch_v4t } */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+typedef union
+{
+ double value;
+ struct
+ {
+ unsigned int msw;
+ } parts;
+} ieee_double_shape_type;
+double __ieee754_hypot(double x, double y)
+{
+ double a=x,b=y,t1,t2,y1,y2,w;
+ int j,k,ha,hb;
+ do { ieee_double_shape_type gh_u; gh_u.value = (x); (ha) = gh_u.parts.msw; } while (0);;
+ if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
+ if(ha > 0x5f300000) {
+ do { ieee_double_shape_type sh_u; sh_u.value = (a); sh_u.parts.msw = (ha); (a) = sh_u.value; } while (0);;
+ }
+ w = a-b;
+ if (w <= b)
+ {
+ t2 = a - t1;
+ w = t1*y1-(w*(-w)-(t1*y2+t2*b));
+ }
+ if(k!=0) {
+ } else return w;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-5.c b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-5.c
new file mode 100644
index 00000000000..3a1db4b3bb4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-5.c
@@ -0,0 +1,12 @@
+/* { dg-do assemble { target { ! ia32 } } } */
+/* { dg-require-effective-target avx512f } */
+/* { dg-options "-O2 -mavx512f" } */
+
+#include <immintrin.h>
+
+register __m512d z asm ("zmm16"); /* { dg-warning "call-clobbered register used for global register variable" } */
+
+__m128d foo ()
+{
+ return _mm256_extractf128_pd (_mm512_extractf64x4_pd(z, 0), 1);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-pr70354-1.c b/gcc/testsuite/gcc.target/i386/avx2-pr70354-1.c
new file mode 100644
index 00000000000..d2d9b83d924
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-pr70354-1.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/70354 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -mavx2" } */
+/* { dg-require-effective-target avx2 } */
+
+#include "avx2-check.h"
+
+#define main() do_main ()
+
+#include "../../gcc.dg/vect/pr70354-1.c"
+
+static void
+avx2_test (void)
+{
+ do_main ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-pr70354-2.c b/gcc/testsuite/gcc.target/i386/avx2-pr70354-2.c
new file mode 100644
index 00000000000..709a51bcb8c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-pr70354-2.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/70354 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -mavx2" } */
+/* { dg-require-effective-target avx2 } */
+
+#include "avx2-check.h"
+
+#define main() do_main ()
+
+#include "../../gcc.dg/vect/pr70354-2.c"
+
+static void
+avx2_test (void)
+{
+ do_main ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-1.c
new file mode 100644
index 00000000000..bb9a9551d0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-1.c
@@ -0,0 +1,27 @@
+/* PR target/70329 */
+/* { dg-do run } */
+/* { dg-options "-O0 -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+#include "avx512f-helper.h"
+
+typedef unsigned char A __attribute__ ((vector_size (64)));
+typedef unsigned int B __attribute__ ((vector_size (64)));
+
+unsigned __attribute__ ((noinline, noclone))
+foo (A a, A b, B c)
+{
+ a *= b;
+ c[1] += a[8];
+ return c[1];
+}
+
+void
+TEST (void)
+{
+ A a = (A) { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ unsigned x = foo (a, a, (B) { 1, 2 });
+ if (x != 83)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-2.c
new file mode 100644
index 00000000000..731b9260794
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr70329-2.c
@@ -0,0 +1,33 @@
+/* PR target/70329 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+#include "avx512f-helper.h"
+
+__attribute__((noinline, noclone)) void
+foo (unsigned char *src1, unsigned char *src2, unsigned char *dst)
+{
+ int i;
+
+ for (i = 0; i < 64; i++)
+ dst[i] = (unsigned char) ((int) src1[i] * (int) src2[i]);
+}
+
+void
+TEST (void)
+{
+ unsigned char a[64], b[64], c[64];
+ int i;
+
+ for (i = 0; i < 64; i++)
+ {
+ a[i] = i;
+ b[i] = (i + 1);
+ }
+ foo (a, b, c);
+ for (i = 0; i < 64; i++)
+ if (c[i] != (unsigned char) (i * (i + 1)))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr70421.c b/gcc/testsuite/gcc.target/i386/avx512f-pr70421.c
new file mode 100644
index 00000000000..60e1e2a8863
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr70421.c
@@ -0,0 +1,15 @@
+/* PR target/70421 */
+/* { dg-do run } */
+/* { dg-require-effective-target avx512f } */
+/* { dg-options "-O2 -mavx512f" } */
+
+#include "avx512f-check.h"
+
+#define main() do_main()
+#include "../../gcc.dg/torture/pr70421.c"
+
+static void
+avx512f_test (void)
+{
+ do_main ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/cleanup-1.c b/gcc/testsuite/gcc.target/i386/cleanup-1.c
index fc82f35a0ab..dcfcc4edb5f 100644
--- a/gcc/testsuite/gcc.target/i386/cleanup-1.c
+++ b/gcc/testsuite/gcc.target/i386/cleanup-1.c
@@ -4,6 +4,7 @@
#include <unwind.h>
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
@@ -47,6 +48,14 @@ handler (void *p __attribute__((unused)))
_exit (0);
}
+static void
+__attribute__((noinline))
+check (intptr_t p)
+{
+ if ((p & 15) != 0)
+ abort ();
+}
+
static int __attribute__((noinline))
fn5 (void)
{
@@ -59,6 +68,8 @@ void
bar (void)
{
char dummy __attribute__((cleanup (counter)));
+ unsigned long tmp[4] __attribute__((aligned(16)));
+ check ((intptr_t) tmp);
fn5 ();
}
@@ -133,9 +144,9 @@ foo (int x)
".type _L_mutex_lock_%=, @function\n"
"_L_mutex_lock_%=:\n"
"1:\t" "leaq %1, %%rdi\n"
-"2:\t" "subq $128, %%rsp\n"
+"2:\t" "subq $136, %%rsp\n"
"3:\t" "call bar\n"
-"4:\t" "addq $128, %%rsp\n"
+"4:\t" "addq $136, %%rsp\n"
"5:\t" "jmp 24f\n"
"6:\t" ".size _L_mutex_lock_%=, .-_L_mutex_lock_%=\n\t"
".previous\n\t"
@@ -179,7 +190,7 @@ foo (int x)
".sleb128 4b-3b\n"
"16:\t" ".byte 0x40 + (4b-3b-1) # DW_CFA_advance_loc\n\t"
".byte 0x0e # DW_CFA_def_cfa_offset\n\t"
- ".uleb128 128\n\t"
+ ".uleb128 136\n\t"
".byte 0x16 # DW_CFA_val_expression\n\t"
".uleb128 0x10\n\t"
".uleb128 20f-17f\n"
diff --git a/gcc/testsuite/gcc.target/i386/cleanup-2.c b/gcc/testsuite/gcc.target/i386/cleanup-2.c
index 0ec7c3182ad..7e60323373b 100644
--- a/gcc/testsuite/gcc.target/i386/cleanup-2.c
+++ b/gcc/testsuite/gcc.target/i386/cleanup-2.c
@@ -4,6 +4,7 @@
#include <unwind.h>
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
@@ -47,6 +48,14 @@ handler (void *p __attribute__((unused)))
_exit (0);
}
+static void
+__attribute__((noinline))
+check (intptr_t p)
+{
+ if ((p & 15) != 0)
+ abort ();
+}
+
static int __attribute__((noinline))
fn5 (void)
{
@@ -59,6 +68,8 @@ void
bar (void)
{
char dummy __attribute__((cleanup (counter)));
+ unsigned long tmp[4] __attribute__((aligned(16)));
+ check ((intptr_t) tmp);
fn5 ();
}
@@ -74,9 +85,9 @@ foo (int x)
".type _L_mutex_lock_%=, @function\n"
"_L_mutex_lock_%=:\n"
"1:\t" "leaq %1, %%rdi\n"
-"2:\t" "subq $128, %%rsp\n"
+"2:\t" "subq $136, %%rsp\n"
"3:\t" "call bar\n"
-"4:\t" "addq $128, %%rsp\n"
+"4:\t" "addq $136, %%rsp\n"
"5:\t" "jmp 21f\n"
"6:\t" ".size _L_mutex_lock_%=, .-_L_mutex_lock_%=\n\t"
".previous\n\t"
@@ -160,7 +171,7 @@ foo (int x)
".uleb128 6b-5b-1\n"
"19:\t" ".byte 0x40 + (3b-1b) # DW_CFA_advance_loc\n\t"
".byte 0xe # DW_CFA_def_cfa_offset\n\t"
- ".uleb128 128\n\t"
+ ".uleb128 136\n\t"
".byte 0x40 + (5b-3b) # DW_CFA_advance_loc\n\t"
".byte 0xe # DW_CFA_def_cfa_offset\n\t"
".uleb128 0\n\t"
diff --git a/gcc/testsuite/gcc.target/i386/pr64411.C b/gcc/testsuite/gcc.target/i386/pr64411.C
new file mode 100644
index 00000000000..55858fb48eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr64411.C
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mcmodel=medium -fPIC -fschedule-insns -fselective-scheduling" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern "C" long strtol ()
+ { return 0; }
+
+static struct {
+ void *sp[2];
+} info;
+
+union S813
+{
+ void * c[5];
+}
+s813;
+
+S813 a813[5];
+S813 check813 (S813, S813 *, S813);
+
+void checkx813 ()
+{
+ __builtin_memset (&s813, '\0', sizeof (s813));
+ __builtin_memset (&info, '\0', sizeof (info));
+ check813 (s813, &a813[1], a813[2]);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70251.c b/gcc/testsuite/gcc.target/i386/pr70251.c
new file mode 100644
index 00000000000..97078cd4795
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70251.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+#include "avx512f-helper.h"
+
+unsigned long long int
+hash(unsigned long long int seed, unsigned long long int v)
+{
+ return seed ^ (v + 0x9e3779b9 + (seed<<6) + (seed>>2));
+}
+
+unsigned int a [100];
+signed char b [100];
+signed char c [100];
+
+void
+init ()
+{
+ for (int i = 0; i < 100; ++i)
+ {
+ a [i] = 1000L;
+ b [i] = 10;
+ c [i] = 5;
+ }
+}
+
+void
+foo ()
+{
+ for (int i = 0; i < 100; ++i)
+ b [i] = (!b [i] ^ (a [i] >= b [i])) + c [i];
+}
+
+unsigned long long int
+checksum ()
+{
+ unsigned long long int seed = 0ULL;
+ for (int i = 0; i < 100; ++i)
+ seed = hash (seed, b[i]);
+ return seed;
+}
+
+void
+TEST ()
+{
+ init ();
+ foo ();
+ if (checksum () != 5785906989299578598ULL)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70263-2.c b/gcc/testsuite/gcc.target/i386/pr70263-2.c
new file mode 100644
index 00000000000..18ebbf05fb7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70263-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-ira" } */
+
+/* { dg-final { scan-rtl-dump "Adding REG_EQUIV to insn \[0-9\]+ for source of insn \[0-9\]+" "ira" } } */
+
+typedef float XFtype __attribute__ ((mode (XF)));
+typedef _Complex float XCtype __attribute__ ((mode (XC)));
+XCtype
+__mulxc3 (XFtype a, XFtype b, XFtype c, XFtype d)
+{
+ XFtype ac, bd, ad, bc, x, y;
+ ac = a * c;
+__asm__ ("": "=m" (ac):"m" (ac));
+ if (x != x)
+ {
+ _Bool recalc = 0;
+ if (((!(!(((ac) - (ac)) != ((ac) - (ac)))))))
+ recalc = 1;
+ if (recalc)
+ x = __builtin_huge_vall () * (a * c - b * d);
+ }
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70293.c b/gcc/testsuite/gcc.target/i386/pr70293.c
new file mode 100644
index 00000000000..4510166ead8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70293.c
@@ -0,0 +1,38 @@
+/* PR target/70293 */
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mtune=westmere -mavx512vl -O2" } */
+
+typedef short __v8hi __attribute__((__vector_size__(16)));
+typedef int __v8hu __attribute__((__vector_size__(16)));
+typedef long __m128i __attribute__((__vector_size__(16)));
+__m128i _mm_madd_epi16___B, _mm_mullo_epi16___A,
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER_xmm_b,
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER___trans_tmp_16,
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER___trans_tmp_13;
+int _mm_srli_epi16___B, scaled_bilinear_scanline_sse2_8888_8_8888_OVER_m,
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER_dst,
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER_wt;
+__m128i _mm_set_epi16();
+void _mm_cvtsi128_si32();
+void
+scaled_bilinear_scanline_sse2_8888_8_8888_OVER(int p1) {
+ __m128i __trans_tmp_12, __trans_tmp_6, __trans_tmp_5, xmm_x = _mm_set_epi16();
+ int mask;
+ __trans_tmp_5 = (__m128i){scaled_bilinear_scanline_sse2_8888_8_8888_OVER_wt};
+ __trans_tmp_6 = (__m128i)(__v8hi){p1, p1, p1, p1, p1, p1, p1, p1};
+ while (scaled_bilinear_scanline_sse2_8888_8_8888_OVER_dst) {
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER_m = mask++;
+ if (scaled_bilinear_scanline_sse2_8888_8_8888_OVER_m) {
+ __trans_tmp_12 =
+ (__m128i)((__v8hu)_mm_mullo_epi16___A * (__v8hu)__trans_tmp_6);
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER_xmm_b = __trans_tmp_12;
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER___trans_tmp_13 =
+ (__m128i)__builtin_ia32_psrlwi128((__v8hi)xmm_x, _mm_srli_epi16___B);
+ scaled_bilinear_scanline_sse2_8888_8_8888_OVER___trans_tmp_16 =
+ (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__trans_tmp_5,
+ (__v8hi)_mm_madd_epi16___B);
+ _mm_cvtsi128_si32();
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70300.c b/gcc/testsuite/gcc.target/i386/pr70300.c
new file mode 100644
index 00000000000..ddfadfb5957
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70300.c
@@ -0,0 +1,25 @@
+/* PR target/70300 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=amdfam10 -mavx512f" } */
+
+typedef _Complex A __attribute__ ((mode (SC)));
+typedef _Complex B __attribute__ ((mode (DC)));
+typedef _Complex C __attribute__ ((mode (TC)));
+
+C
+foo (A a, B b, C c, A d, B e, C f)
+{
+ b -= a;
+ d += a;
+ a += f;
+ return a + b + d + e;
+}
+
+__attribute__((target ("avx512vl"))) C
+bar (A a, B b, C c, A d, B e, C f)
+{
+ b -= a;
+ d += a;
+ a += f;
+ return a + b + d + e;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70302.c b/gcc/testsuite/gcc.target/i386/pr70302.c
new file mode 100644
index 00000000000..9b82a0c4509
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70302.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target { ia32 } } } */
+/* { dg-options "-O2 -msse2" } */
+
+long a, c, e;
+int b, d;
+unsigned long long f;
+
+extern void fn2 (const char *, int, int, int);
+
+void
+fn1(long long p1)
+{
+ unsigned long long g;
+ int i;
+ for (; i;)
+ if (e)
+ g = c;
+ if (a)
+ f = p1;
+ if (!f && !g)
+ fn2("", b, d, d);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70325.c b/gcc/testsuite/gcc.target/i386/pr70325.c
new file mode 100644
index 00000000000..e2b9342658c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70325.c
@@ -0,0 +1,12 @@
+/* PR target/70325 */
+/* { dg-do compile } */
+/* { dg-options "-mavx512vl -O2" } */
+
+typedef char C __attribute((__vector_size__(32)));
+typedef int I __attribute((__vector_size__(32)));
+
+void
+f(int a,I b)
+{
+ __builtin_ia32_storedquqi256_mask((C*)f,(C)b,a); /* { dg-warning "implicit declaration of function" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70327.c b/gcc/testsuite/gcc.target/i386/pr70327.c
new file mode 100644
index 00000000000..035bb68d458
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70327.c
@@ -0,0 +1,12 @@
+/* PR target/70327 */
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mavx512f" } */
+
+typedef unsigned __int128 v4ti __attribute__ ((vector_size (64)));
+
+void
+foo (v4ti v)
+{
+ foo(v);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70355.c b/gcc/testsuite/gcc.target/i386/pr70355.c
new file mode 100644
index 00000000000..b55f6fc5260
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70355.c
@@ -0,0 +1,14 @@
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-O2 -fno-tree-ter -funroll-loops -mavx512f -g" } */
+
+typedef unsigned __int128 v2ti __attribute__ ((vector_size (32)));
+
+unsigned
+foo (unsigned i, v2ti v)
+{
+ do {
+ i--;
+ v %= ~v;
+ } while (i);
+ return v[0] + v[1];
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70406.c b/gcc/testsuite/gcc.target/i386/pr70406.c
new file mode 100644
index 00000000000..b75a5af450e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70406.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-O -mtune=pentium2 -mavx512f" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+unsigned
+foo (unsigned char i, unsigned x, v4si u, v4si v, v4si w)
+{
+ i &= (unsigned)~x;
+ v <<= w[x];
+ return i + u[x] + v[i];
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-36.c b/gcc/testsuite/gcc.target/powerpc/altivec-36.c
new file mode 100644
index 00000000000..ce9e6a36b5d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-36.c
@@ -0,0 +1,46 @@
+/* PR target/70296 */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -std=gnu11" } */
+
+#define c(x) x
+#define f(x)
+#define i int
+#define k
+typedef int vector;
+typedef vector int V;
+vector int a;
+vector b;
+vector c(int) d;
+vector c(e);
+vector c;
+vector f(int) int g;
+vector f(int) h;
+vector i j;
+vector k int l;
+vector k m;
+#define int(x) x
+vector int n;
+vector int(int) o;
+vector int(r);
+#undef int
+
+void
+foo ()
+{
+ V *p;
+ p = &a;
+ p = &d;
+ p = &g;
+ p = &j;
+ p = &l;
+ p = &n;
+ p = &o;
+ int *q;
+ q = &b;
+ q = &e;
+ q = &c;
+ q = &h;
+ q = &m;
+ q = &r;
+}
diff --git a/gcc/testsuite/gfortran.dg/coarray_allocate_5.f08 b/gcc/testsuite/gfortran.dg/coarray_allocate_5.f08
index feb1bf3f2df..2d8785420c9 100644
--- a/gcc/testsuite/gfortran.dg/coarray_allocate_5.f08
+++ b/gcc/testsuite/gfortran.dg/coarray_allocate_5.f08
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-fcoarray=lib -lcaf_single -fdump-tree-original" }
+! { dg-additional-options "-latomic" { target libatomic_available } }
!
! Contributed by Ian Harvey <ian_harvey@bigpond.com>
! Extended by Andre Vehreschild <vehre@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/goacc/combined-directives.f90 b/gcc/testsuite/gfortran.dg/goacc/combined-directives.f90
index 69775257cbd..42a447ad06b 100644
--- a/gcc/testsuite/gfortran.dg/goacc/combined-directives.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/combined-directives.f90
@@ -1,17 +1,10 @@
! Exercise combined OpenACC directives.
-! { dg-do compile }
-! { dg-options "-fopenacc -fdump-tree-gimple" }
-
-! This error is temporary. Remove when support is added for these clauses
-! in the middle end.
-! { dg-prune-output "sorry, unimplemented" }
-
-! Update the reduction tests.
+! { dg-additional-options "-fdump-tree-gimple" }
subroutine test
implicit none
- integer a(100), i, j, z
+ integer a(100), i, j, y, z
! PARALLEL
@@ -73,10 +66,10 @@ subroutine test
end do
!$acc end parallel loop
-! !$acc parallel loop reduction (+:z) copy (z)
-! do i = 1, 100
-! end do
-! !$acc end parallel loop
+ !$acc parallel loop reduction (+:y) copy (y)
+ do i = 1, 100
+ end do
+ !$acc end parallel loop
! KERNELS
@@ -138,10 +131,10 @@ subroutine test
end do
!$acc end kernels loop
-! !$acc kernels loop reduction (+:z) copy (z)
-! do i = 1, 100
-! end do
-! !$acc end kernels loop
+ !$acc kernels loop reduction (+:y) copy (y)
+ do i = 1, 100
+ end do
+ !$acc end kernels loop
end subroutine test
! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. collapse.2." 2 "gimple" } }
@@ -153,3 +146,5 @@ end subroutine test
! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. tile.2, 3" 2 "gimple" } }
! { dg-final { scan-tree-dump-times "acc loop private.i. independent" 2 "gimple" } }
! { dg-final { scan-tree-dump-times "private.z" 2 "gimple" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_\[^ \]+ map.force_tofrom:y" 2 "gimple" } }
+! { dg-final { scan-tree-dump-times "acc loop private.i. reduction..:y." 2 "gimple" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/data-tree.f95 b/gcc/testsuite/gfortran.dg/goacc/data-tree.f95
index 23745f333d2..44efc8a670b 100644
--- a/gcc/testsuite/gfortran.dg/goacc/data-tree.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/data-tree.f95
@@ -4,7 +4,7 @@
program test
implicit none
integer :: q, i, j, k, m, n, o, p, r, s, t, u, v, w
- logical :: l
+ logical :: l = .true.
!$acc data if(l) copy(i), copyin(j), copyout(k), create(m) &
!$acc present(o), pcopy(p), pcopyin(r), pcopyout(s), pcreate(t) &
diff --git a/gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95 b/gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95
index 23aba8ca5ff..4a11b9dcbcb 100644
--- a/gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95
@@ -3,7 +3,7 @@
program test
implicit none
- integer :: i
+ integer :: i = 1
!$acc host_data use_device(i)
!$acc end host_data
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-alias-2.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-2.f95
new file mode 100644
index 00000000000..7e348dde2bd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-2.f95
@@ -0,0 +1,23 @@
+! { dg-additional-options "-O2" }
+! { dg-additional-options "-fdump-tree-ealias-all" }
+
+program main
+ implicit none
+ integer, parameter :: n = 2
+ integer :: a, b, c, d
+
+ !$acc kernels copyin (a) create (b) copyout (c) copy (d)
+ a = 0
+ b = 0
+ c = 0
+ d = 0
+ !$acc end kernels
+
+end program main
+
+! { dg-final { scan-tree-dump-times "clique 1 base 1" 4 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 2" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 3" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 4" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 5" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 8 "ealias" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-alias-3.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-3.f95
new file mode 100644
index 00000000000..56f3d598d66
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-3.f95
@@ -0,0 +1,19 @@
+! { dg-additional-options "-O2" }
+! { dg-additional-options "-fdump-tree-ealias-all" }
+
+program main
+ implicit none
+ integer, target :: a
+ integer, pointer :: ptr
+ ptr => a
+
+ !$acc kernels pcopyin (a, ptr)
+ a = 0
+ ptr = 1
+ !$acc end kernels
+
+end program main
+
+! Only the omp_data_i related loads should be annotated with cliques.
+! { dg-final { scan-tree-dump-times "clique 1 base 1" 2 "ealias" } }
+! { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 2 "ealias" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-alias-4.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-4.f95
new file mode 100644
index 00000000000..e65253b1844
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-alias-4.f95
@@ -0,0 +1,20 @@
+! { dg-additional-options "-O2" }
+! { dg-additional-options "-fdump-tree-ealias-all" }
+
+program main
+ implicit none
+ integer, parameter :: n = 2
+ integer, target, dimension (0:n-1) :: a
+ integer, pointer :: ptr(:)
+ ptr => a
+
+ !$acc kernels pcopyin (a, ptr(0:2))
+ a(0) = 0
+ ptr(0) = 1
+ !$acc end kernels
+
+end program main
+
+! Only the omp_data_i related loads should be annotated with cliques.
+! { dg-final { scan-tree-dump-times "clique 1 base 1" 3 "ealias" } }
+! { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 3 "ealias" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-alias.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-alias.f95
new file mode 100644
index 00000000000..8d6ccb338b9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-alias.f95
@@ -0,0 +1,23 @@
+! { dg-additional-options "-O2" }
+! { dg-additional-options "-fdump-tree-ealias-all" }
+
+program main
+ implicit none
+ integer, parameter :: n = 2
+ integer, dimension (0:n-1) :: a, b, c, d
+
+ !$acc kernels copyin (a) create (b) copyout (c) copy (d)
+ a(0) = 0
+ b(0) = 0
+ c(0) = 0
+ d(0) = 0
+ !$acc end kernels
+
+end program main
+
+! { dg-final { scan-tree-dump-times "clique 1 base 1" 4 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 2" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 3" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 4" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "clique 1 base 5" 1 "ealias" } }
+! { dg-final { scan-tree-dump-times "(?n)clique .* base .*" 8 "ealias" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
index fac5b85217f..4ec66de346d 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
@@ -4,7 +4,7 @@
program test
implicit none
integer :: q, i, j, k, m, n, o, p, r, s, t, u, v, w
- logical :: l
+ logical :: l = .true.
!$acc kernels if(l) async copy(i), copyin(j), copyout(k), create(m) &
!$acc present(o), pcopy(p), pcopyin(r), pcopyout(s), pcreate(t) &
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-1.f95 b/gcc/testsuite/gfortran.dg/goacc/loop-1.f95
index 817039f5ac5..b5f9e038145 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-1.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-1.f95
@@ -1,5 +1,3 @@
-! { dg-do compile }
-! { dg-additional-options "-fmax-errors=100" }
module test
implicit none
contains
@@ -29,14 +27,18 @@ subroutine test1
i = i + 1
end do
!$acc loop
- do 300 d = 1, 30, 6 ! { dg-error "integer" }
+ do 300 d = 1, 30, 6
i = d
300 a(i) = 1
+ ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 30 }
+ ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 30 }
!$acc loop
- do d = 1, 30, 5 ! { dg-error "integer" }
+ do d = 1, 30, 5
i = d
a(i) = 2
end do
+ ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 36 }
+ ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 36 }
!$acc loop
do i = 1, 30
if (i .eq. 16) exit ! { dg-error "EXIT statement" }
@@ -144,8 +146,10 @@ subroutine test1
end do
!$acc parallel loop collapse(2)
do i = 1, 3
- do r = 4, 6 ! { dg-error "integer" }
+ do r = 4, 6
end do
+ ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 149 }
+ ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 149 }
end do
! Both seq and independent are not allowed
@@ -167,4 +171,3 @@ subroutine test1
end subroutine test1
end module test
-! { dg-prune-output "Deleted" }
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-5.f95 b/gcc/testsuite/gfortran.dg/goacc/loop-5.f95
index 5cbd975bea6..d059cf7f377 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-5.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-5.f95
@@ -1,9 +1,3 @@
-! { dg-do compile }
-! { dg-additional-options "-fmax-errors=100" }
-
-! { dg-prune-output "sorry, unimplemented" }
-! { dg-prune-output "Error: work-sharing region" }
-
program test
implicit none
integer :: i, j
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-6.f95 b/gcc/testsuite/gfortran.dg/goacc/loop-6.f95
index e8444686cb0..d0855b4fa95 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-6.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-6.f95
@@ -1,11 +1,3 @@
-! { dg-do compile }
-! { dg-additional-options "-fmax-errors=100" }
-
-! This error is temporary. Remove when support is added for these clauses
-! in the middle end.
-! { dg-prune-output "sorry, unimplemented" }
-! { dg-prune-output "Error: work-sharing region" }
-
program test
implicit none
integer :: i, j
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-tree-1.f90 b/gcc/testsuite/gfortran.dg/goacc/loop-tree-1.f90
index 6cfd715e118..81bdc23e46c 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-tree-1.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-tree-1.f90
@@ -1,13 +1,7 @@
-! { dg-do compile }
! { dg-additional-options "-fdump-tree-original -std=f2008" }
! test for tree-dump-original and spaces-commas
-! This error is temporary. Remove when support is added for these clauses
-! in the middle end.
-! { dg-prune-output "sorry, unimplemented" }
-! { dg-prune-output "Error: work-sharing region" }
-
program test
implicit none
integer :: i, j, k, m, sum
diff --git a/gcc/testsuite/gfortran.dg/goacc/parallel-tree.f95 b/gcc/testsuite/gfortran.dg/goacc/parallel-tree.f95
index 9037f6c895f..5b2e01d4878 100644
--- a/gcc/testsuite/gfortran.dg/goacc/parallel-tree.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/parallel-tree.f95
@@ -6,7 +6,7 @@
program test
implicit none
integer :: q, i, j, k, m, n, o, p, r, s, t, u, v, w
- logical :: l
+ logical :: l = .true.
!$acc parallel if(l) async num_gangs(i) num_workers(i) vector_length(i) &
!$acc reduction(max:q), copy(i), copyin(j), copyout(k), create(m) &
diff --git a/gcc/testsuite/gfortran.dg/goacc/private-3.f95 b/gcc/testsuite/gfortran.dg/goacc/private-3.f95
index 349026350d4..a7c6d81ad4e 100644
--- a/gcc/testsuite/gfortran.dg/goacc/private-3.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/private-3.f95
@@ -14,6 +14,7 @@ program test
! !$acc end parallel
!$acc parallel private (k)
+ k = 0
!$acc loop reduction (+:k)
do i = 1, n
k = k + 1
diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-5.f90 b/gcc/testsuite/gfortran.dg/goacc/routine-5.f90
index 68c51496866..5037a31a6b4 100644
--- a/gcc/testsuite/gfortran.dg/goacc/routine-5.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/routine-5.f90
@@ -5,6 +5,7 @@ module param
end module param
subroutine gang (a)
+ use param
!$acc routine gang
integer, intent (inout) :: a(N)
integer :: i
@@ -31,6 +32,7 @@ subroutine gang (a)
end subroutine gang
subroutine worker (a)
+ use param
!$acc routine worker
integer, intent (inout) :: a(N)
integer :: i
@@ -57,6 +59,7 @@ subroutine worker (a)
end subroutine worker
subroutine vector (a)
+ use param
!$acc routine vector
integer, intent (inout) :: a(N)
integer :: i
@@ -83,6 +86,7 @@ subroutine vector (a)
end subroutine vector
subroutine seq (a)
+ use param
!$acc routine seq
integer, intent (inout) :: a(N)
integer :: i
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
new file mode 100644
index 00000000000..b87d26f521f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! { dg-additional-options "-Wuninitialized" }
+
+program test
+ implicit none
+ integer :: i, j, k
+
+ !$acc parallel num_gangs(i) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end parallel
+
+ !$acc parallel num_workers(j) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end parallel
+
+ !$acc parallel vector_length(k) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end parallel
+
+end program test
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95
new file mode 100644
index 00000000000..60dc53e7850
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-if-clause.f95
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-additional-options "-Wuninitialized" }
+
+program test
+ implicit none
+ logical :: b, b2, b3, b4
+ integer :: data, data2
+
+ !$acc parallel if(b) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end parallel
+
+ !$acc kernels if(b2) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end kernels
+
+ !$acc data if(b3) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end data
+
+ !$acc update if(b4) self(data2) ! { dg-warning "is used uninitialized in this function" }
+
+end program test
diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
new file mode 100644
index 00000000000..873eea70a76
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-additional-options "-Wuninitialized" }
+
+subroutine test
+ integer :: i
+
+ !$acc host_data use_device(i) ! { dg-warning "is used uninitialized in this function" }
+ !$acc end host_data
+end subroutine test
+
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr68715.f90 b/gcc/testsuite/gfortran.dg/graphite/pr68715.f90
new file mode 100644
index 00000000000..c0117569478
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr68715.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-options "-floop-nest-optimize -O1" }
+
+SUBROUTINE se_core_core_interaction(calculate_forces)
+ INTEGER, PARAMETER :: dp=8
+ LOGICAL, INTENT(in) :: calculate_forces
+ REAL(KIND=dp), DIMENSION(3) :: force_ab, rij
+ LOGICAL :: lfoo,kfoo,mfoo,nfoo,ffoo
+ INTEGER, PARAMETER :: mi2=42
+ CALL dummy(lfoo,kfoo,mfoo,nfoo,method_id,core_core)
+ IF (lfoo) THEN
+ DO WHILE (ffoo())
+ IF (lfoo) CYCLE
+ IF (kfoo) CYCLE
+ dr1 = DOT_PRODUCT(rij,rij)
+ IF (dr1 > rij_threshold) THEN
+ SELECT CASE (method_id)
+ CASE (mi2)
+ IF (calculate_forces) THEN
+ CALL dummy2(force_ab)
+ IF (nfoo) THEN
+ force_ab = force_ab + core_core*dr3inv
+ END IF
+ END IF
+ END SELECT
+ END IF
+ enuclear = enuclear + enucij
+ END DO
+ CALL dummy3(enuclear)
+ END IF
+END SUBROUTINE se_core_core_interaction
diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f90
new file mode 100644
index 00000000000..d0b2a2e32d1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_25.f90
@@ -0,0 +1,40 @@
+! { dg-do run }
+!
+! Test contributed by Valery Weber <valeryweber@hotmail.com>
+
+module mod
+
+ TYPE, PUBLIC :: base_type
+ END TYPE base_type
+
+ TYPE, PUBLIC :: dict_entry_type
+ CLASS( * ), ALLOCATABLE :: key
+ CLASS( * ), ALLOCATABLE :: val
+ END TYPE dict_entry_type
+
+
+contains
+
+ SUBROUTINE dict_put ( this, key, val )
+ CLASS(dict_entry_type), INTENT(INOUT) :: this
+ CLASS(base_type), INTENT(IN) :: key, val
+ INTEGER :: istat
+ ALLOCATE( this%key, SOURCE=key, STAT=istat )
+ end SUBROUTINE dict_put
+end module mod
+
+program test
+ use mod
+ type(dict_entry_type) :: t
+ type(base_type) :: a, b
+ call dict_put(t, a, b)
+
+ if (.NOT. allocated(t%key)) call abort()
+ select type (x => t%key)
+ type is (base_type)
+ class default
+ call abort()
+ end select
+ deallocate(t%key)
+end
+
diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_26.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_26.f90
new file mode 100644
index 00000000000..130006907a9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_26.f90
@@ -0,0 +1,47 @@
+! { dg-do run }
+!
+! Test contributed by Valery Weber <valeryweber@hotmail.com>
+
+module mod
+
+ TYPE, PUBLIC :: dict_entry_type
+ CLASS( * ), ALLOCATABLE :: key
+ CLASS( * ), ALLOCATABLE :: val
+ END TYPE dict_entry_type
+
+
+contains
+
+ SUBROUTINE dict_put ( this, key, val )
+ CLASS(dict_entry_type), INTENT(INOUT) :: this
+ CLASS(*), INTENT(IN) :: key, val
+ INTEGER :: istat
+ ALLOCATE( this%key, SOURCE=key, STAT=istat )
+ ALLOCATE( this%val, SOURCE=val, STAT=istat )
+ end SUBROUTINE dict_put
+end module mod
+
+program test
+ use mod
+ type(dict_entry_type) :: t
+ call dict_put(t, "foo", 42)
+
+ if (.NOT. allocated(t%key)) call abort()
+ select type (x => t%key)
+ type is (CHARACTER(*))
+ if (x /= "foo") call abort()
+ class default
+ call abort()
+ end select
+ deallocate(t%key)
+
+ if (.NOT. allocated(t%val)) call abort()
+ select type (x => t%val)
+ type is (INTEGER)
+ if (x /= 42) call abort()
+ class default
+ call abort()
+ end select
+ deallocate(t%val)
+end
+
diff --git a/gcc/testsuite/gnat.dg/specs/double_record_extension3.ads b/gcc/testsuite/gnat.dg/specs/double_record_extension3.ads
new file mode 100644
index 00000000000..de53655bace
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/double_record_extension3.ads
@@ -0,0 +1,22 @@
+-- { dg-do compile }
+
+package Double_Record_Extension3 is
+
+ type Rec1 is tagged record
+ Id : Integer;
+ end record;
+
+ for Rec1 use record
+ Id at 8 range 0 .. 31;
+ end record;
+
+ type Rec2 (Size : Integer) is new Rec1 with record
+ Data : String (1 .. Size);
+ end record;
+
+ type Rec3 is new Rec2 (Size => 128) with record
+ Valid : Boolean;
+ end record;
+
+end Double_Record_Extension3;
+
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index 20fa1a28717..ab6f3697ff8 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -78,12 +78,33 @@ proc prune_gcc_output { text } {
return $text
}
+# escape metacharacters in literal string, so it can be used in regex
+
+proc escape_regex_chars { line } {
+ return [string map {"^" "\\^"
+ "$" "\\$"
+ "(" "\\("
+ ")" "\\)"
+ "[" "\\["
+ "]" "\\]"
+ "{" "\\{"
+ "}" "\\}"
+ "." "\\."
+ "\\" "\\\\"
+ "?" "\\?"
+ "+" "\\+"
+ "*" "\\*"
+ "|" "\\|"} $line]
+}
+
proc prune_file_path { text } {
global srcdir
+ set safedir [escape_regex_chars $srcdir]
+ regsub -all "$safedir\/" $text "" text
+
# Truncate absolute file path into relative path.
- set topdir "[file dirname [file dirname [file dirname $srcdir]]]"
- regsub -all "$srcdir\/" $text "" text
+ set topdir "[file dirname [file dirname [file dirname $safedir]]]"
regsub -all "$topdir\/" $text "" text
return $text
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 49b82c32dae..777bff89a0d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3171,7 +3171,9 @@ proc check_effective_target_arm_fp16_ok { } {
# Creates a series of routines that return 1 if the given architecture
# can be selected and a routine to give the flags to select that architecture
# Note: Extra flags may be added to disable options from newer compilers
-# (Thumb in particular - but others may be added in the future)
+# (Thumb in particular - but others may be added in the future).
+# -march=armv7ve is special and is handled explicitly after this loop because
+# it needs more than one predefine check to identify.
# Usage: /* { dg-require-effective-target arm_arch_v5_ok } */
# /* { dg-add-options arm_arch_v5 } */
# /* { dg-require-effective-target arm_arch_v5_multilib } */
@@ -3186,7 +3188,6 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
v6z "-march=armv6z" __ARM_ARCH_6Z__
v6m "-march=armv6-m -mthumb" __ARM_ARCH_6M__
v7a "-march=armv7-a" __ARM_ARCH_7A__
- v7ve "-march=armv7ve" __ARM_ARCH_7A__
v7r "-march=armv7-r" __ARM_ARCH_7R__
v7m "-march=armv7-m -mthumb" __ARM_ARCH_7M__
v7em "-march=armv7e-m -mthumb" __ARM_ARCH_7EM__
@@ -3221,6 +3222,26 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
}]
}
+# Same functions as above but for -march=armv7ve. To uniquely identify
+# -march=armv7ve we need to check for __ARM_ARCH_7A__ as well as
+# __ARM_FEATURE_IDIV otherwise it aliases with armv7-a.
+
+proc check_effective_target_arm_arch_v7ve_ok { } {
+ if { [ string match "*-marm*" "-march=armv7ve" ] &&
+ ![check_effective_target_arm_arm_ok] } {
+ return 0
+ }
+ return [check_no_compiler_messages arm_arch_v7ve_ok assembly {
+ #if !defined (__ARM_ARCH_7A__) || !defined (__ARM_FEATURE_IDIV)
+ #error !armv7ve
+ #endif
+ } "-march=armv7ve" ]
+}
+
+proc add_options_for_arm_arch_v7ve { flags } {
+ return "$flags -march=armv7ve"
+}
+
# Return 1 if this is an ARM target where -marm causes ARM to be
# used (not Thumb)
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index d52e0c6e202..5206d202bab 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -616,7 +616,8 @@ remap_decls (tree decls, vec<tree, va_gc> **nonlocalized_list,
/* We need to add this variable to the local decls as otherwise
nothing else will do so. */
if (TREE_CODE (old_var) == VAR_DECL
- && ! DECL_EXTERNAL (old_var))
+ && ! DECL_EXTERNAL (old_var)
+ && cfun)
add_local_decl (cfun, old_var);
if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE)
&& !DECL_IGNORED_P (old_var)
@@ -3504,33 +3505,13 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
return use;
}
-/* Callback through walk_tree. Determine if a DECL_INITIAL makes reference
- to a local label. */
-
-static tree
-has_label_address_in_static_1 (tree *nodep, int *walk_subtrees, void *fnp)
-{
- tree node = *nodep;
- tree fn = (tree) fnp;
-
- if (TREE_CODE (node) == LABEL_DECL && DECL_CONTEXT (node) == fn)
- return node;
-
- if (TYPE_P (node))
- *walk_subtrees = 0;
-
- return NULL_TREE;
-}
-
/* Determine if the function can be copied. If so return NULL. If
not return a string describng the reason for failure. */
const char *
-copy_forbidden (struct function *fun, tree fndecl)
+copy_forbidden (struct function *fun)
{
const char *reason = fun->cannot_be_copied_reason;
- tree decl;
- unsigned ix;
/* Only examine the function once. */
if (fun->cannot_be_copied_set)
@@ -3549,19 +3530,12 @@ copy_forbidden (struct function *fun, tree fndecl)
goto fail;
}
- FOR_EACH_LOCAL_DECL (fun, ix, decl)
- if (TREE_CODE (decl) == VAR_DECL
- && TREE_STATIC (decl)
- && !DECL_EXTERNAL (decl)
- && DECL_INITIAL (decl)
- && walk_tree_without_duplicates (&DECL_INITIAL (decl),
- has_label_address_in_static_1,
- fndecl))
- {
- reason = G_("function %q+F can never be copied because it saves "
- "address of local label in a static variable");
- goto fail;
- }
+ if (fun->has_forced_label_in_static)
+ {
+ reason = G_("function %q+F can never be copied because it saves "
+ "address of local label in a static variable");
+ goto fail;
+ }
fail:
fun->cannot_be_copied_reason = reason;
@@ -3705,7 +3679,7 @@ inline_forbidden_p (tree fndecl)
bool forbidden_p = false;
/* First check for shared reasons not to copy the code. */
- inline_forbidden_reason = copy_forbidden (fun, fndecl);
+ inline_forbidden_reason = copy_forbidden (fun);
if (inline_forbidden_reason != NULL)
return true;
@@ -5552,7 +5526,7 @@ bool
tree_versionable_function_p (tree fndecl)
{
return (!lookup_attribute ("noclone", DECL_ATTRIBUTES (fndecl))
- && copy_forbidden (DECL_STRUCT_FUNCTION (fndecl), fndecl) == NULL);
+ && copy_forbidden (DECL_STRUCT_FUNCTION (fndecl)) == NULL);
}
/* Delete all unreachable basic blocks and update callgraph.
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 4cc1f19223a..9ca2a91f08f 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -217,7 +217,7 @@ extern tree remap_type (tree type, copy_body_data *id);
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
extern bool debug_find_tree (tree, tree);
extern tree copy_fn (tree, tree&, tree&);
-extern const char *copy_forbidden (struct function *fun, tree fndecl);
+extern const char *copy_forbidden (struct function *fun);
/* This is in tree-inline.c since the routine uses
data structures from the inliner. */
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 9c13d848829..39e3691a48f 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -621,7 +621,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
case GOMP_MAP_FORCE_PRESENT:
pp_string (pp, "force_present");
break;
- case GOMP_MAP_FORCE_DEALLOC:
+ case GOMP_MAP_DELETE:
pp_string (pp, "delete");
break;
case GOMP_MAP_FORCE_DEVICEPTR:
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index e49876eac33..93e1e2eafe9 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -51,12 +51,40 @@ struct coalesce_pair
int second_element;
int cost;
+ /* A count of the number of unique partitions this pair would conflict
+ with if coalescing was successful. This is the secondary sort key,
+ given two pairs with equal costs, we will prefer the pair with a smaller
+ conflict set.
+
+ This is lazily initialized when we discover two coalescing pairs have
+ the same primary cost.
+
+ Note this is not updated and propagated as pairs are coalesced. */
+ int conflict_count;
+
/* The order in which coalescing pairs are discovered is recorded in this
field, which is used as the final tie breaker when sorting coalesce
pairs. */
int index;
};
+/* This represents a conflict graph. Implemented as an array of bitmaps.
+ A full matrix is used for conflicts rather than just upper triangular form.
+ this makes it much simpler and faster to perform conflict merges. */
+
+struct ssa_conflicts
+{
+ bitmap_obstack obstack; /* A place to allocate our bitmaps. */
+ vec<bitmap> conflicts;
+};
+
+/* The narrow API of the qsort comparison function doesn't allow easy
+ access to additional arguments. So we have two globals (ick) to hold
+ the data we need. They're initialized before the call to qsort and
+ wiped immediately after. */
+static ssa_conflicts *conflicts_;
+static var_map map_;
+
/* Coalesce pair hashtable helpers. */
struct coalesce_pair_hasher : nofree_ptr_hash <coalesce_pair>
@@ -303,6 +331,7 @@ find_coalesce_pair (coalesce_list *cl, int p1, int p2, bool create)
pair->second_element = p.second_element;
pair->cost = 0;
pair->index = num_coalesce_pairs (cl);
+ pair->conflict_count = 0;
*slot = pair;
}
@@ -345,21 +374,66 @@ add_coalesce (coalesce_list *cl, int p1, int p2, int value)
}
}
+/* Compute and record how many unique conflicts would exist for the
+ representative partition for each coalesce pair in CL.
+
+ CONFLICTS is the conflict graph and MAP is the current partition view. */
+
+static void
+initialize_conflict_count (coalesce_pair *p,
+ ssa_conflicts *conflicts,
+ var_map map)
+{
+ int p1 = var_to_partition (map, ssa_name (p->first_element));
+ int p2 = var_to_partition (map, ssa_name (p->second_element));
+
+ /* 4 cases. If both P1 and P2 have conflicts, then build their
+ union and count the members. Else handle the degenerate cases
+ in the obvious ways. */
+ if (conflicts->conflicts[p1] && conflicts->conflicts[p2])
+ p->conflict_count = bitmap_count_unique_bits (conflicts->conflicts[p1],
+ conflicts->conflicts[p2]);
+ else if (conflicts->conflicts[p1])
+ p->conflict_count = bitmap_count_bits (conflicts->conflicts[p1]);
+ else if (conflicts->conflicts[p2])
+ p->conflict_count = bitmap_count_bits (conflicts->conflicts[p2]);
+ else
+ p->conflict_count = 0;
+}
+
/* Comparison function to allow qsort to sort P1 and P2 in Ascending order. */
static int
compare_pairs (const void *p1, const void *p2)
{
- const coalesce_pair *const *const pp1 = (const coalesce_pair *const *) p1;
- const coalesce_pair *const *const pp2 = (const coalesce_pair *const *) p2;
+ coalesce_pair *const *const pp1 = (coalesce_pair *const *) p1;
+ coalesce_pair *const *const pp2 = (coalesce_pair *const *) p2;
int result;
result = (* pp1)->cost - (* pp2)->cost;
- /* And if everything else is equal, then sort based on which
- coalesce pair was found first. */
+ /* We use the size of the resulting conflict set as the secondary sort key.
+ Given two equal costing coalesce pairs, we want to prefer the pair that
+ has the smaller conflict set. */
if (result == 0)
- result = (*pp2)->index - (*pp1)->index;
+ {
+ if (flag_expensive_optimizations)
+ {
+ /* Lazily initialize the conflict counts as it's fairly expensive
+ to compute. */
+ if ((*pp2)->conflict_count == 0)
+ initialize_conflict_count (*pp2, conflicts_, map_);
+ if ((*pp1)->conflict_count == 0)
+ initialize_conflict_count (*pp1, conflicts_, map_);
+
+ result = (*pp2)->conflict_count - (*pp1)->conflict_count;
+ }
+
+ /* And if everything else is equal, then sort based on which
+ coalesce pair was found first. */
+ if (result == 0)
+ result = (*pp2)->index - (*pp1)->index;
+ }
return result;
}
@@ -374,7 +448,7 @@ compare_pairs (const void *p1, const void *p2)
in order from most important coalesce to least important. */
static void
-sort_coalesce_list (coalesce_list *cl)
+sort_coalesce_list (coalesce_list *cl, ssa_conflicts *conflicts, var_map map)
{
unsigned x, num;
coalesce_pair *p;
@@ -400,19 +474,14 @@ sort_coalesce_list (coalesce_list *cl)
if (num == 1)
return;
- /* If there are only 2, just pick swap them if the order isn't correct. */
- if (num == 2)
- {
- if (cl->sorted[0]->cost > cl->sorted[1]->cost)
- std::swap (cl->sorted[0], cl->sorted[1]);
- return;
- }
-
- /* Only call qsort if there are more than 2 items.
- ??? Maybe std::sort will do better, provided that compare_pairs
- can be inlined. */
- if (num > 2)
- qsort (cl->sorted, num, sizeof (coalesce_pair *), compare_pairs);
+ /* We don't want to depend on qsort_r, so we have to stuff away
+ additional data into globals so it can be referenced in
+ compare_pairs. */
+ conflicts_ = conflicts;
+ map_ = map;
+ qsort (cl->sorted, num, sizeof (coalesce_pair *), compare_pairs);
+ conflicts_ = NULL;
+ map_ = NULL;
}
@@ -437,7 +506,7 @@ dump_coalesce_list (FILE *f, coalesce_list *cl)
print_generic_expr (f, var1, TDF_SLIM);
fprintf (f, " <-> ");
print_generic_expr (f, var2, TDF_SLIM);
- fprintf (f, " (%1d), ", node->cost);
+ fprintf (f, " (%1d, %1d), ", node->cost, node->conflict_count);
fprintf (f, "\n");
}
}
@@ -447,7 +516,7 @@ dump_coalesce_list (FILE *f, coalesce_list *cl)
for (x = cl->num_sorted - 1 ; x >=0; x--)
{
node = cl->sorted[x];
- fprintf (f, "(%d) ", node->cost);
+ fprintf (f, "(%d, %d) ", node->cost, node->conflict_count);
var = ssa_name (node->first_element);
print_generic_expr (f, var, TDF_SLIM);
fprintf (f, " <-> ");
@@ -459,16 +528,6 @@ dump_coalesce_list (FILE *f, coalesce_list *cl)
}
-/* This represents a conflict graph. Implemented as an array of bitmaps.
- A full matrix is used for conflicts rather than just upper triangular form.
- this make sit much simpler and faster to perform conflict merges. */
-
-struct ssa_conflicts
-{
- bitmap_obstack obstack; /* A place to allocate our bitmaps. */
- vec<bitmap> conflicts;
-};
-
/* Return an empty new conflict graph for SIZE elements. */
static inline ssa_conflicts *
@@ -1800,7 +1859,7 @@ coalesce_ssa_name (void)
if (dump_file && (dump_flags & TDF_DETAILS))
ssa_conflicts_dump (dump_file, graph);
- sort_coalesce_list (cl);
+ sort_coalesce_list (cl, graph, map);
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 1a4d6df7062..9b59b4466c3 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -298,11 +298,17 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
/* Conditionals. */
else if ((gimple_code (stmt) == GIMPLE_COND
&& constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop)
- && constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop))
+ && constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop)
+ /* We don't simplify all constant compares so make sure
+ they are not both constant already. See PR70288. */
+ && (! is_gimple_min_invariant (gimple_cond_lhs (stmt))
+ || ! is_gimple_min_invariant (gimple_cond_rhs (stmt))))
|| (gimple_code (stmt) == GIMPLE_SWITCH
&& constant_after_peeling (gimple_switch_index (
as_a <gswitch *> (stmt)),
- stmt, loop)))
+ stmt, loop)
+ && ! is_gimple_min_invariant (gimple_switch_index (
+ as_a <gswitch *> (stmt)))))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Constant conditional.\n");
@@ -929,7 +935,7 @@ try_peel_loop (struct loop *loop,
edge exit, tree niter,
HOST_WIDE_INT maxiter)
{
- int npeel;
+ HOST_WIDE_INT npeel;
struct loop_size size;
int peeled_size;
sbitmap wont_exit;
@@ -984,7 +990,7 @@ try_peel_loop (struct loop *loop,
{
if (dump_file)
fprintf (dump_file, "Not peeling: rolls too much "
- "(%i + 1 > --param max-peel-times)\n", npeel);
+ "(%i + 1 > --param max-peel-times)\n", (int) npeel);
return false;
}
npeel++;
@@ -992,7 +998,7 @@ try_peel_loop (struct loop *loop,
/* Check peeled loops size. */
tree_estimate_loop_size (loop, exit, NULL, &size,
PARAM_VALUE (PARAM_MAX_PEELED_INSNS));
- if ((peeled_size = estimated_peeled_sequence_size (&size, npeel))
+ if ((peeled_size = estimated_peeled_sequence_size (&size, (int) npeel))
> PARAM_VALUE (PARAM_MAX_PEELED_INSNS))
{
if (dump_file)
@@ -1026,7 +1032,7 @@ try_peel_loop (struct loop *loop,
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Peeled loop %d, %i times.\n",
- loop->num, npeel);
+ loop->num, (int) npeel);
}
if (loop->any_upper_bound)
loop->nb_iterations_upper_bound -= npeel;
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 5302edf9284..29c4ba4cf56 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -121,7 +121,11 @@ avg_loop_niter (struct loop *loop)
{
HOST_WIDE_INT niter = estimated_stmt_executions_int (loop);
if (niter == -1)
- return AVG_LOOP_NITER (loop);
+ {
+ niter = max_stmt_executions_int (loop);
+ if (niter == -1 || niter > AVG_LOOP_NITER (loop))
+ return AVG_LOOP_NITER (loop);
+ }
return niter;
}
@@ -3232,11 +3236,13 @@ add_iv_candidate_for_use (struct ivopts_data *data, struct iv_use *use)
basetype = sizetype;
record_common_cand (data, build_int_cst (basetype, 0), iv->step, use);
- /* Record common candidate with constant offset stripped in base. */
+ /* Record common candidate with constant offset stripped in base.
+ Like the use itself, we also add candidate directly for it. */
+ base = strip_offset (iv->base, &offset);
+ if (offset || base != iv->base)
{
- base = strip_offset (iv->base, &offset);
- if (offset || base != iv->base)
- record_common_cand (data, base, iv->step, use);
+ record_common_cand (data, base, iv->step, use);
+ add_candidate (data, base, iv->step, false, use);
}
/* Record common candidate with base_object removed in base. */
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 81689fc1aa4..c93e563e51c 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -3115,7 +3115,6 @@ idx_infer_loop_bounds (tree base, tree *idx, void *dta)
tree low, high, type, next;
bool sign, upper = true, at_end = false;
struct loop *loop = data->loop;
- bool reliable = true;
if (TREE_CODE (base) != ARRAY_REF)
return true;
@@ -3187,14 +3186,14 @@ idx_infer_loop_bounds (tree base, tree *idx, void *dta)
&& tree_int_cst_compare (next, high) <= 0)
return true;
- /* If access is not executed on every iteration, we must ensure that overlow may
- not make the access valid later. */
+ /* If access is not executed on every iteration, we must ensure that overlow
+ may not make the access valid later. */
if (!dominated_by_p (CDI_DOMINATORS, loop->latch, gimple_bb (data->stmt))
&& scev_probably_wraps_p (initial_condition_in_loop_num (ev, loop->num),
step, data->stmt, loop, true))
- reliable = false;
+ upper = false;
- record_nonwrapping_iv (loop, init, step, data->stmt, low, high, reliable, upper);
+ record_nonwrapping_iv (loop, init, step, data->stmt, low, high, false, upper);
return true;
}
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index dd6fd01256a..77acd66e997 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -223,6 +223,8 @@ tree_unswitch_single_loop (struct loop *loop, int num)
/* If the loop is not expected to iterate, there is no need
for unswitching. */
iterations = estimated_loop_iterations_int (loop);
+ if (iterations < 0)
+ iterations = max_loop_iterations_int (loop);
if (iterations >= 0 && iterations <= 1)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -439,6 +441,8 @@ tree_unswitch_outer_loop (struct loop *loop)
/* If the loop is not expected to iterate, there is no need
for unswitching. */
iterations = estimated_loop_iterations_int (loop);
+ if (iterations < 0)
+ iterations = max_loop_iterations_int (loop);
if (iterations >= 0 && iterations <= 1)
{
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 3277e4985e9..c4535a4eb2e 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -55,6 +55,8 @@
SSA_PROP_NOT_INTERESTING: Statement S produces nothing of
interest and does not affect any of the work lists.
+ The statement may be simulated again if any of its input
+ operands change in future iterations of the simulator.
SSA_PROP_VARYING: The value produced by S cannot be determined
at compile time. Further simulation of S is not required.
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 4e1251b2a94..d23dabde7b6 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -821,7 +821,7 @@ eliminate_plus_minus_pair (enum tree_code opcode,
}
ops->ordered_remove (i);
- add_to_ops_vec (ops, build_int_cst_type (op_type, -1));
+ add_to_ops_vec (ops, build_all_ones_cst (op_type));
ops->ordered_remove (currindex);
reassociate_stats.ops_eliminated ++;
@@ -2769,6 +2769,146 @@ optimize_range_tests (enum tree_code opcode,
return any_changes;
}
+/* A subroutine of optimize_vec_cond_expr to extract and canonicalize
+ the operands of the VEC_COND_EXPR. Returns ERROR_MARK on failure,
+ otherwise the comparison code. */
+
+static tree_code
+ovce_extract_ops (tree var, gassign **rets, bool *reti)
+{
+ if (TREE_CODE (var) != SSA_NAME)
+ return ERROR_MARK;
+
+ gassign *stmt = dyn_cast <gassign *> (SSA_NAME_DEF_STMT (var));
+ if (stmt == NULL)
+ return ERROR_MARK;
+
+ /* ??? If we start creating more COND_EXPR, we could perform
+ this same optimization with them. For now, simplify. */
+ if (gimple_assign_rhs_code (stmt) != VEC_COND_EXPR)
+ return ERROR_MARK;
+
+ tree cond = gimple_assign_rhs1 (stmt);
+ tree_code cmp = TREE_CODE (cond);
+ if (TREE_CODE_CLASS (cmp) != tcc_comparison)
+ return ERROR_MARK;
+
+ /* ??? For now, allow only canonical true and false result vectors.
+ We could expand this to other constants should the need arise,
+ but at the moment we don't create them. */
+ tree t = gimple_assign_rhs2 (stmt);
+ tree f = gimple_assign_rhs3 (stmt);
+ bool inv;
+ if (integer_all_onesp (t))
+ inv = false;
+ else if (integer_all_onesp (f))
+ {
+ cmp = invert_tree_comparison (cmp, false);
+ inv = true;
+ }
+ else
+ return ERROR_MARK;
+ if (!integer_zerop (f))
+ return ERROR_MARK;
+
+ /* Success! */
+ if (rets)
+ *rets = stmt;
+ if (reti)
+ *reti = inv;
+ return cmp;
+}
+
+/* Optimize the condition of VEC_COND_EXPRs which have been combined
+ with OPCODE (either BIT_AND_EXPR or BIT_IOR_EXPR). */
+
+static bool
+optimize_vec_cond_expr (tree_code opcode, vec<operand_entry *> *ops)
+{
+ unsigned int length = ops->length (), i, j;
+ bool any_changes = false;
+
+ if (length == 1)
+ return false;
+
+ for (i = 0; i < length; ++i)
+ {
+ tree elt0 = (*ops)[i]->op;
+
+ gassign *stmt0;
+ bool invert;
+ tree_code cmp0 = ovce_extract_ops (elt0, &stmt0, &invert);
+ if (cmp0 == ERROR_MARK)
+ continue;
+
+ for (j = i + 1; j < length; ++j)
+ {
+ tree &elt1 = (*ops)[j]->op;
+
+ gassign *stmt1;
+ tree_code cmp1 = ovce_extract_ops (elt1, &stmt1, NULL);
+ if (cmp1 == ERROR_MARK)
+ continue;
+
+ tree cond0 = gimple_assign_rhs1 (stmt0);
+ tree x0 = TREE_OPERAND (cond0, 0);
+ tree y0 = TREE_OPERAND (cond0, 1);
+
+ tree cond1 = gimple_assign_rhs1 (stmt1);
+ tree x1 = TREE_OPERAND (cond1, 0);
+ tree y1 = TREE_OPERAND (cond1, 1);
+
+ tree comb;
+ if (opcode == BIT_AND_EXPR)
+ comb = maybe_fold_and_comparisons (cmp0, x0, y0, cmp1, x1, y1);
+ else if (opcode == BIT_IOR_EXPR)
+ comb = maybe_fold_or_comparisons (cmp0, x0, y0, cmp1, x1, y1);
+ else
+ gcc_unreachable ();
+ if (comb == NULL)
+ continue;
+
+ /* Success! */
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Transforming ");
+ print_generic_expr (dump_file, cond0, 0);
+ fprintf (dump_file, " %c ", opcode == BIT_AND_EXPR ? '&' : '|');
+ print_generic_expr (dump_file, cond1, 0);
+ fprintf (dump_file, " into ");
+ print_generic_expr (dump_file, comb, 0);
+ fputc ('\n', dump_file);
+ }
+
+ gimple_assign_set_rhs1 (stmt0, comb);
+ if (invert)
+ std::swap (*gimple_assign_rhs2_ptr (stmt0),
+ *gimple_assign_rhs3_ptr (stmt0));
+ update_stmt (stmt0);
+
+ elt1 = error_mark_node;
+ any_changes = true;
+ }
+ }
+
+ if (any_changes)
+ {
+ operand_entry *oe;
+ j = 0;
+ FOR_EACH_VEC_ELT (*ops, i, oe)
+ {
+ if (oe->op == error_mark_node)
+ continue;
+ else if (i != j)
+ (*ops)[j] = oe;
+ j++;
+ }
+ ops->truncate (j);
+ }
+
+ return any_changes;
+}
+
/* Return true if STMT is a cast like:
<bb N>:
...
@@ -4326,7 +4466,7 @@ static bool
can_reassociate_p (tree op)
{
tree type = TREE_TYPE (op);
- if ((INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type))
+ if ((ANY_INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type))
|| NON_SAT_FIXED_POINT_TYPE_P (type)
|| (flag_associative_math && FLOAT_TYPE_P (type)))
return true;
@@ -4952,6 +5092,7 @@ reassociate_bb (basic_block bb)
{
auto_vec<operand_entry *> ops;
tree powi_result = NULL_TREE;
+ bool is_vector = VECTOR_TYPE_P (TREE_TYPE (lhs));
/* There may be no immediate uses left by the time we
get here because we may have eliminated them all. */
@@ -4970,15 +5111,21 @@ reassociate_bb (basic_block bb)
}
if (rhs_code == BIT_IOR_EXPR || rhs_code == BIT_AND_EXPR)
- optimize_range_tests (rhs_code, &ops);
+ {
+ if (is_vector)
+ optimize_vec_cond_expr (rhs_code, &ops);
+ else
+ optimize_range_tests (rhs_code, &ops);
+ }
- if (rhs_code == MULT_EXPR)
- attempt_builtin_copysign (&ops);
+ if (rhs_code == MULT_EXPR && !is_vector)
+ {
+ attempt_builtin_copysign (&ops);
- if (reassoc_insert_powi_p
- && rhs_code == MULT_EXPR
- && flag_unsafe_math_optimizations)
- powi_result = attempt_builtin_powi (stmt, &ops);
+ if (reassoc_insert_powi_p
+ && flag_unsafe_math_optimizations)
+ powi_result = attempt_builtin_powi (stmt, &ops);
+ }
/* If the operand vector is now empty, all operands were
consumed by the __builtin_powi optimization. */
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 1c237a4ec4b..8a5b641a70e 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -407,7 +407,7 @@ VN_INFO_GET (tree name)
newinfo = XOBNEW (&vn_ssa_aux_obstack, struct vn_ssa_aux);
memset (newinfo, 0, sizeof (struct vn_ssa_aux));
if (SSA_NAME_VERSION (name) >= vn_ssa_aux_table.length ())
- vn_ssa_aux_table.safe_grow (SSA_NAME_VERSION (name) + 1);
+ vn_ssa_aux_table.safe_grow_cleared (SSA_NAME_VERSION (name) + 1);
vn_ssa_aux_table[SSA_NAME_VERSION (name)] = newinfo;
return newinfo;
}
diff --git a/gcc/tree-ssa-threadbackward.c b/gcc/tree-ssa-threadbackward.c
index 88f8d5eb778..44b1b470f3a 100644
--- a/gcc/tree-ssa-threadbackward.c
+++ b/gcc/tree-ssa-threadbackward.c
@@ -451,7 +451,7 @@ fsm_find_control_statement_thread_paths (tree name,
So for that case, drastically reduce the number of statements
we are allowed to copy. */
- if (!threaded_through_latch
+ if (!(threaded_through_latch && threaded_multiway_branch)
&& (n_insns * PARAM_VALUE (PARAM_FSM_SCALE_PATH_STMTS)
>= PARAM_VALUE (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS)))
{
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index fd3dc435aaf..ce9127035ed 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -103,7 +103,8 @@ typedef tree (*elem_op_func) (gimple_stmt_iterator *,
tree);
static inline tree
-tree_vec_extract (tree type, tree t, tree bitsize, tree bitpos)
+tree_vec_extract (gimple_stmt_iterator *gsi, tree type,
+ tree t, tree bitsize, tree bitpos)
{
if (TREE_CODE (t) == SSA_NAME)
{
@@ -114,21 +115,22 @@ tree_vec_extract (tree type, tree t, tree bitsize, tree bitpos)
&& gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR)))
t = gimple_assign_rhs1 (def_stmt);
}
-
if (bitpos)
{
if (TREE_CODE (type) == BOOLEAN_TYPE)
{
tree itype
= build_nonstandard_integer_type (tree_to_uhwi (bitsize), 0);
- tree field = fold_build3 (BIT_FIELD_REF, itype, t, bitsize, bitpos);
- return fold_build2 (NE_EXPR, type, field, build_zero_cst (itype));
+ tree field = gimplify_build3 (gsi, BIT_FIELD_REF, itype, t,
+ bitsize, bitpos);
+ return gimplify_build2 (gsi, NE_EXPR, type, field,
+ build_zero_cst (itype));
}
-
- return fold_build3 (BIT_FIELD_REF, type, t, bitsize, bitpos);
+ else
+ return gimplify_build3 (gsi, BIT_FIELD_REF, type, t, bitsize, bitpos);
}
-
- return fold_build1 (VIEW_CONVERT_EXPR, type, t);
+ else
+ return gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t);
}
static tree
@@ -136,7 +138,7 @@ do_unop (gimple_stmt_iterator *gsi, tree inner_type, tree a,
tree b ATTRIBUTE_UNUSED, tree bitpos, tree bitsize,
enum tree_code code, tree type ATTRIBUTE_UNUSED)
{
- a = tree_vec_extract (inner_type, a, bitsize, bitpos);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
return gimplify_build1 (gsi, code, inner_type, a);
}
@@ -146,9 +148,9 @@ do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree type ATTRIBUTE_UNUSED)
{
if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE)
- a = tree_vec_extract (inner_type, a, bitsize, bitpos);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE)
- b = tree_vec_extract (inner_type, b, bitsize, bitpos);
+ b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
return gimplify_build2 (gsi, code, inner_type, a, b);
}
@@ -167,8 +169,8 @@ do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree cst_true = build_all_ones_cst (stype);
tree cmp;
- a = tree_vec_extract (inner_type, a, bitsize, bitpos);
- b = tree_vec_extract (inner_type, b, bitsize, bitpos);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
+ b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
cmp = build2 (code, boolean_type_node, a, b);
return gimplify_build3 (gsi, COND_EXPR, stype, cmp, cst_true, cst_false);
@@ -200,8 +202,8 @@ do_plus_minus (gimple_stmt_iterator *gsi, tree word_type, tree a, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
- a = tree_vec_extract (word_type, a, bitsize, bitpos);
- b = tree_vec_extract (word_type, b, bitsize, bitpos);
+ a = tree_vec_extract (gsi, word_type, a, bitsize, bitpos);
+ b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos);
signs = gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, a, b);
b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
@@ -233,7 +235,7 @@ do_negate (gimple_stmt_iterator *gsi, tree word_type, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
- b = tree_vec_extract (word_type, b, bitsize, bitpos);
+ b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos);
b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
signs = gimplify_build1 (gsi, BIT_NOT_EXPR, word_type, b);
@@ -889,16 +891,16 @@ expand_vector_condition (gimple_stmt_iterator *gsi)
i++, index = int_const_binop (PLUS_EXPR, index, width))
{
tree aa, result;
- tree bb = tree_vec_extract (inner_type, b, width, index);
- tree cc = tree_vec_extract (inner_type, c, width, index);
+ tree bb = tree_vec_extract (gsi, inner_type, b, width, index);
+ tree cc = tree_vec_extract (gsi, inner_type, c, width, index);
if (a_is_comparison)
{
- tree aa1 = tree_vec_extract (comp_inner_type, a1, width, index);
- tree aa2 = tree_vec_extract (comp_inner_type, a2, width, index);
- aa = build2 (TREE_CODE (a), cond_type, aa1, aa2);
+ tree aa1 = tree_vec_extract (gsi, comp_inner_type, a1, width, index);
+ tree aa2 = tree_vec_extract (gsi, comp_inner_type, a2, width, index);
+ aa = fold_build2 (TREE_CODE (a), cond_type, aa1, aa2);
}
else
- aa = tree_vec_extract (cond_type, a, width, index);
+ aa = tree_vec_extract (gsi, cond_type, a, width, index);
result = gimplify_build3 (gsi, COND_EXPR, inner_type, aa, bb, cc);
constructor_elt ce = {NULL_TREE, result};
v->quick_push (ce);
@@ -1448,9 +1450,9 @@ do_cond (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree type ATTRIBUTE_UNUSED)
{
if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE)
- a = tree_vec_extract (inner_type, a, bitsize, bitpos);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE)
- b = tree_vec_extract (inner_type, b, bitsize, bitpos);
+ b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
tree cond = gimple_assign_rhs1 (gsi_stmt (*gsi));
return gimplify_build3 (gsi, code, inner_type, unshare_expr (cond), a, b);
}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 0cd8f750dbc..f977ee9351b 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -1772,8 +1772,9 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "not vectorized: loop contains function calls"
- " or data references that cannot be analyzed\n");
+ "not vectorized: loop nest containing two "
+ "or more consecutive inner loops cannot be "
+ "vectorized\n");
return false;
}
@@ -2062,6 +2063,8 @@ start_over:
estimated_niter
= estimated_stmt_executions_int (LOOP_VINFO_LOOP (loop_vinfo));
+ if (estimated_niter != -1)
+ estimated_niter = max_niter;
if (estimated_niter != -1
&& ((unsigned HOST_WIDE_INT) estimated_niter
<= MAX (th, (unsigned)min_profitable_estimate)))
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 0ee5bbe8f46..27080d28a1d 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -2097,7 +2097,20 @@ vect_recog_vector_vector_shift_pattern (vec<gimple *> *stmts,
if (TYPE_MODE (TREE_TYPE (rhs1)) == TYPE_MODE (TREE_TYPE (oprnd0))
&& TYPE_PRECISION (TREE_TYPE (rhs1))
== TYPE_PRECISION (TREE_TYPE (oprnd0)))
- def = rhs1;
+ {
+ if (TYPE_PRECISION (TREE_TYPE (oprnd1))
+ >= TYPE_PRECISION (TREE_TYPE (rhs1)))
+ def = rhs1;
+ else
+ {
+ tree mask
+ = build_low_bits_mask (TREE_TYPE (rhs1),
+ TYPE_PRECISION (TREE_TYPE (oprnd1)));
+ def = vect_recog_temp_ssa_var (TREE_TYPE (rhs1), NULL);
+ def_stmt = gimple_build_assign (def, BIT_AND_EXPR, rhs1, mask);
+ new_pattern_def_seq (stmt_vinfo, def_stmt);
+ }
+ }
}
if (def == NULL_TREE)
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 06b1ab742c4..cd5afeafebd 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -7790,8 +7790,8 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
/* Invariant comparison. */
if (!vectype)
{
- vectype = build_vector_type (TREE_TYPE (rhs1), nunits);
- if (tree_to_shwi (TYPE_SIZE_UNIT (vectype)) != current_vector_size)
+ vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
+ if (TYPE_VECTOR_SUBPARTS (vectype) != nunits)
return false;
}
else if (nunits != TYPE_VECTOR_SUBPARTS (vectype))
@@ -8940,7 +8940,12 @@ supportable_widening_operation (enum tree_code code, gimple *stmt,
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
@@ -8991,7 +8996,9 @@ supportable_widening_operation (enum tree_code code, gimple *stmt,
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
prev_type = intermediate_type;
prev_mode = intermediate_mode;
@@ -9075,7 +9082,12 @@ supportable_narrowing_operation (enum tree_code code,
*code1 = c1;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
@@ -9140,7 +9152,9 @@ supportable_narrowing_operation (enum tree_code code,
(*multi_step_cvt)++;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
prev_mode = intermediate_mode;
prev_type = intermediate_type;
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index b5654c536f9..bbdf9ce28eb 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5310,6 +5310,27 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
if (is_gimple_assign (def_stmt))
rhs_code = gimple_assign_rhs_code (def_stmt);
+ /* In the case of NAME != CST1 where NAME = A +- CST2 we can
+ assert that A != CST1 -+ CST2. */
+ if ((comp_code == EQ_EXPR || comp_code == NE_EXPR)
+ && (rhs_code == PLUS_EXPR || rhs_code == MINUS_EXPR))
+ {
+ tree op0 = gimple_assign_rhs1 (def_stmt);
+ tree op1 = gimple_assign_rhs2 (def_stmt);
+ if (TREE_CODE (op0) == SSA_NAME
+ && TREE_CODE (op1) == INTEGER_CST
+ && live_on_edge (e, op0)
+ && !has_single_use (op0))
+ {
+ enum tree_code reverse_op = (rhs_code == PLUS_EXPR
+ ? MINUS_EXPR : PLUS_EXPR);
+ op1 = int_const_binop (reverse_op, val, op1);
+ if (TREE_OVERFLOW (op1))
+ op1 = drop_tree_overflow (op1);
+ register_new_assert_for (op0, op0, comp_code, op1, NULL, e, bsi);
+ }
+ }
+
/* Add asserts for NAME cmp CST and NAME being defined
as NAME = (int) NAME2. */
if (!TYPE_UNSIGNED (TREE_TYPE (val))
diff --git a/include/ChangeLog b/include/ChangeLog
index c48156f9887..d09d54835db 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ * gomp-constants.h (enum gomp_map_kind): Rename
+ GOMP_MAP_FORCE_DEALLOC to GOMP_MAP_DELETE. Adjust all users.
+
2016-03-03 Than McIntosh <thanm@google.com>
* plugin-api.h: Add new hooks to the plugin transfer vector to
diff --git a/include/gomp-constants.h b/include/gomp-constants.h
index a8e7723b324..e31c2e00364 100644
--- a/include/gomp-constants.h
+++ b/include/gomp-constants.h
@@ -67,7 +67,7 @@ enum gomp_map_kind
/* Must already be present. */
GOMP_MAP_FORCE_PRESENT = (GOMP_MAP_FLAG_SPECIAL_0 | 2),
/* Deallocate a mapping, without copying from device. */
- GOMP_MAP_FORCE_DEALLOC = (GOMP_MAP_FLAG_SPECIAL_0 | 3),
+ GOMP_MAP_DELETE = (GOMP_MAP_FLAG_SPECIAL_0 | 3),
/* Is a device pointer. OMP_CLAUSE_SIZE for these is unused; is implicitly
POINTER_SIZE_UNITS. */
GOMP_MAP_FORCE_DEVICEPTR = (GOMP_MAP_FLAG_SPECIAL_1 | 0),
@@ -125,11 +125,9 @@ enum gomp_map_kind
GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION
= (GOMP_MAP_FLAG_SPECIAL_2
| GOMP_MAP_FLAG_SPECIAL | 3),
- /* OpenMP 4.5 alias for forced deallocation. */
- GOMP_MAP_DELETE = GOMP_MAP_FORCE_DEALLOC,
/* Decrement usage count and deallocate if zero. */
GOMP_MAP_RELEASE = (GOMP_MAP_FLAG_SPECIAL_2
- | GOMP_MAP_FORCE_DEALLOC),
+ | GOMP_MAP_DELETE),
/* Internal to GCC, not used in libgomp. */
/* Do not map, but pointer assign a pointer instead. */
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 19b9310bb86..49b6e71abbb 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,25 @@
+2016-03-25 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR lto/69650
+ * directives.c (do_linemarker): Test for file left but not entered
+ here.
+ * line-map.c (linemap_add): Not here.
+
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70296
+ * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
+ * macro.c (cpp_fun_like_macro_p): New function.
+
+2016-03-15 Richard Henderson <rth@redhat.com>
+
+ * line-map.c (new_linemap): Make alloc_size a size_t.
+
+2016-03-14 Jason Merrill <jason@redhat.com>
+
+ * expr.c (cpp_classify_number): Hex floats are new in C++1z.
+ * init.c (lang_defaults): Likewise.
+
2016-03-09 David Malcolm <dmalcolm@redhat.com>
PR c/68473
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 63f54ef7230..6aa6bd1f86a 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1046,6 +1046,19 @@ do_linemarker (cpp_reader *pfile)
skip_rest_of_line (pfile);
+ if (reason == LC_LEAVE)
+ {
+ const line_map_ordinary *from;
+ if (MAIN_FILE_P (map)
+ || (new_file
+ && (from = INCLUDED_FROM (pfile->line_table, map)) != NULL
+ && filename_cmp (ORDINARY_MAP_FILE_NAME (from), new_file) != 0))
+ {
+ cpp_warning (pfile, CPP_W_NONE,
+ "file \"%s\" linemarker ignored due to incorrect nesting", new_file);
+ return;
+ }
+ }
/* Compensate for the increment in linemap_add that occurs in
_cpp_do_file_change. We're currently at the start of the line
*following* the #line directive. A separate source_location for this
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 5353bdeff0d..5cdca6f1bec 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -552,7 +552,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token,
{
if (CPP_OPTION (pfile, cplusplus))
cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
- "use of C++11 hexadecimal floating constant");
+ "use of C++1z hexadecimal floating constant");
else
cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
"use of C99 hexadecimal floating constant");
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 882f80cff46..35b0375c09c 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -813,6 +813,7 @@ extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
extern const cpp_token *cpp_get_token (cpp_reader *);
extern const cpp_token *cpp_get_token_with_location (cpp_reader *,
source_location *);
+extern bool cpp_fun_like_macro_p (cpp_hashnode *);
extern const unsigned char *cpp_macro_definition (cpp_reader *,
cpp_hashnode *);
extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
diff --git a/libcpp/init.c b/libcpp/init.c
index 6bc42960470..4343075ba85 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -105,9 +105,9 @@ static const struct lang_flags lang_defaults[] =
/* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
/* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0 },
/* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
- /* CXX11 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0 },
+ /* CXX11 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0 },
/* GNUCXX14 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0 },
- /* CXX14 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
+ /* CXX14 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
/* GNUCXX1Z */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1 },
/* CXX1Z */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 },
/* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 1fb634af5bf..2e61895bb35 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -376,7 +376,7 @@ new_linemap (struct line_maps *set,
if (LINEMAPS_USED (set, macro_map_p) == LINEMAPS_ALLOCATED (set, macro_map_p))
{
/* We ran out of allocated line maps. Let's allocate more. */
- unsigned alloc_size;
+ size_t alloc_size;
/* Cast away extern "C" from the type of xrealloc. */
line_map_realloc reallocator = (set->reallocator
@@ -512,43 +512,23 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
"included", this variable points the map in use right before the
#include "included", inside the same "includer" file. */
line_map_ordinary *from;
- bool error;
- if (MAIN_FILE_P (map - 1))
- {
- /* So this _should_ mean we are leaving the main file --
- effectively ending the compilation unit. But to_file not
- being NULL means the caller thinks we are leaving to
- another file. This is an erroneous behaviour but we'll
- try to recover from it. Let's pretend we are not leaving
- the main file. */
- error = true;
- reason = LC_RENAME;
- from = map - 1;
- }
- else
- {
- /* (MAP - 1) points to the map we are leaving. The
- map from which (MAP - 1) got included should be the map
- that comes right before MAP in the same file. */
- from = INCLUDED_FROM (set, map - 1);
- error = to_file && filename_cmp (ORDINARY_MAP_FILE_NAME (from),
- to_file);
- }
-
- /* Depending upon whether we are handling preprocessed input or
- not, this can be a user error or an ICE. */
- if (error)
- fprintf (stderr, "line-map.c: file \"%s\" left but not entered\n",
- to_file);
+ linemap_assert (!MAIN_FILE_P (map - 1));
+ /* (MAP - 1) points to the map we are leaving. The
+ map from which (MAP - 1) got included should be the map
+ that comes right before MAP in the same file. */
+ from = INCLUDED_FROM (set, map - 1);
/* A TO_FILE of NULL is special - we use the natural values. */
- if (error || to_file == NULL)
+ if (to_file == NULL)
{
to_file = ORDINARY_MAP_FILE_NAME (from);
to_line = SOURCE_LINE (from, from[1].start_location);
sysp = ORDINARY_MAP_IN_SYSTEM_HEADER_P (from);
}
+ else
+ linemap_assert (filename_cmp (ORDINARY_MAP_FILE_NAME (from),
+ to_file) == 0);
}
map->sysp = sysp;
diff --git a/libcpp/macro.c b/libcpp/macro.c
index cfb09ceaddd..759fbe7f028 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -3301,6 +3301,15 @@ check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro,
}
}
+/* Returns true of NODE is a function-like macro. */
+bool
+cpp_fun_like_macro_p (cpp_hashnode *node)
+{
+ return (node->type == NT_MACRO
+ && (node->flags & (NODE_BUILTIN | NODE_MACRO_ARG)) == 0
+ && node->value.macro->fun_like);
+}
+
/* Returns the name, arguments and expansion of a macro, in a format
suitable to be read back in again, and therefore also for DWARF 2
debugging info. e.g. "PASTE(X, Y) X ## Y", or "MACNAME EXPANSION".
diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog
index 4a1e264b3df..d5996646b54 100644
--- a/libcpp/po/ChangeLog
+++ b/libcpp/po/ChangeLog
@@ -1,3 +1,11 @@
+2016-03-30 Joseph Myers <joseph@codesourcery.com>
+
+ * da.po: Update.
+
+2016-03-17 Joseph Myers <joseph@codesourcery.com>
+
+ * fr.po: Update.
+
2016-03-05 Joseph Myers <joseph@codesourcery.com>
* sr.po: Update.
diff --git a/libcpp/po/da.po b/libcpp/po/da.po
index b3395bef372..3805d8fadeb 100644
--- a/libcpp/po/da.po
+++ b/libcpp/po/da.po
@@ -1,8 +1,8 @@
# Danish version of cpplib.
-# Copyright (C) 2015 Free Software Foundation, Inc.
+# Copyright (C) 2016 Free Software Foundation, Inc.
# This file is distributed under the same license as the gcc package.
# Ole Laursen <olau@hardworking.dk>, 2001, 02, 03.
-# Joe Hansen <joedalton2@yahoo.dk>, 2015.
+# Joe Hansen <joedalton2@yahoo.dk>, 2015, 2016.
#
# Konventioner:
#
@@ -128,10 +128,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: cpplib 5.1-b20150208\n"
+"Project-Id-Version: cpplib 6.1-b20160131\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2016-01-31 15:50+0000\n"
-"PO-Revision-Date: 2015-04-06 18:00+0200\n"
+"PO-Revision-Date: 2016-03-27 18:00+0200\n"
"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
"Language: da\n"
@@ -871,10 +871,8 @@ msgid "missing terminating %c character"
msgstr "manglende afsluttende %c-tegn"
#: lex.c:1932
-#, fuzzy
-#| msgid "invalid suffix on literal; C++11 requires a space between literal and string macro"
msgid "C++11 requires a space between string literal and macro"
-msgstr "ugyldig suffiks på ordret; C++11 kræver et mellemrum mellem ordret og strengmakro"
+msgstr "C++11 kræver et mellemrum mellem ordret og strengmakro"
#: lex.c:2474 lex.c:2508
msgid "C++ style comments are not allowed in ISO C90"
diff --git a/libcpp/po/fr.po b/libcpp/po/fr.po
index 2f4129e6be2..085a19f0dac 100644
--- a/libcpp/po/fr.po
+++ b/libcpp/po/fr.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the gcc package.
# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996.
# François-Xavier Coudert <fxcoudert@gcc.gnu.org>, 2008.
-# Stéphane Aulery <lkppo@free.fr>, 2015.
+# Stéphane Aulery <lkppo@free.fr>, 2015, 2016.
#
# Vocabulaire utilisé
# lvalue = membre gauche
@@ -119,10 +119,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: GNU cpplib 5.1-b20150208\n"
+"Project-Id-Version: GNU cpplib 6.1-b20160131\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2016-01-31 15:50+0000\n"
-"PO-Revision-Date: 2015-04-11 00:44+0200\n"
+"PO-Revision-Date: 2016-03-16 23:56+0100\n"
"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
"Language-Team: French <traduc@traduc.org>\n"
"Language: fr\n"
@@ -877,10 +877,8 @@ msgid "missing terminating %c character"
msgstr "caractère %c de terminaison manquant"
#: lex.c:1932
-#, fuzzy
-#| msgid "invalid suffix on literal; C++11 requires a space between literal and string macro"
msgid "C++11 requires a space between string literal and macro"
-msgstr "suffixe de chaîne invalide ; C++11 requière un espace entre une chaîne et une macro de chaîne"
+msgstr "C++11 requière un espace entre une chaîne et une macro"
#: lex.c:2474 lex.c:2508
msgid "C++ style comments are not allowed in ISO C90"
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index d6a0b51a275..50276807528 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-17 Andreas Schwab <schwab@suse.de>
+
+ * src/aarch64/ffitarget.h (FFI_SIZEOF_JAVA_RAW) [__ILP32__]:
+ Define.
+
2016-03-02 Richard Henderson <rth@redhat.com>
* libtool-version: Increase to 7:0:0.
diff --git a/libffi/src/aarch64/ffitarget.h b/libffi/src/aarch64/ffitarget.h
index 2862ec7fccc..34200ad9325 100644
--- a/libffi/src/aarch64/ffitarget.h
+++ b/libffi/src/aarch64/ffitarget.h
@@ -29,6 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef LIBFFI_ASM
#ifdef __ILP32__
#define FFI_SIZEOF_ARG 8
+#define FFI_SIZEOF_JAVA_RAW 4
typedef unsigned long long ffi_arg;
typedef signed long long ffi_sarg;
#else
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index ca47125504e..7c761b0351d 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,21 @@
+2016-03-28 James Bowman <james.bowman@ftdichip.com>
+
+ * libgcc/config/ft32/lib1funcs.S (*divsi3, *modsi3): New.
+
+2016-03-22 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR libgcc/70363
+ * config/rs6000/extendkftf2-sw.c (__extendkftf2_sw): If libgcc was
+ built with an assembler that does not support ISA 3.0
+ instructions, rename __extendkftf2_sw to __extendkftf2.
+
+2016-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/38239
+ * config/sol2/gmon.c [__i386__] (_mcount): Save and restore
+ call-clobbered registers.
+ (internal_mcount): Remove __i386__ handling.
+
2016-02-26 Joel Sherrill <joel@rtems.org>
* config.host: Add x86_64-*-rtems*.
diff --git a/libgcc/ChangeLog.ibm b/libgcc/ChangeLog.ibm
index 87699535165..3b9b0e3555b 100644
--- a/libgcc/ChangeLog.ibm
+++ b/libgcc/ChangeLog.ibm
@@ -1,3 +1,7 @@
+2016-03-30 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 234598.
+
2016-03-14 Michael Meissner <meissner@linux.vnet.ibm.com>
Merge up to 234194.
diff --git a/libgcc/config/ft32/lib1funcs.S b/libgcc/config/ft32/lib1funcs.S
index 6d52af7ca2a..a6b04789edf 100644
--- a/libgcc/config/ft32/lib1funcs.S
+++ b/libgcc/config/ft32/lib1funcs.S
@@ -25,8 +25,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# for implementation details of all except division which is detailed below
#
+#ifdef L_fp_tools
// .global __cmpsf2_
-
nan: .long 0x7FFFFFFF # also abs mask
inf: .long 0x7F800000
sign_mask: .long 0x80000000
@@ -37,6 +37,14 @@ smallest_norm: .long 0x00800000 # implicit bit
high_FF: .long 0xFF000000
high_uint: .long 0xFFFFFFFF
+ntz_table:
+ .byte 32,0,1,12,2,6,0,13,3,0,7,0,0,0,0,14
+ .byte 10,4,0,0,8,0,0,25,0,0,0,0,0,21,27,15
+ .byte 31,11,5,0,0,0,0,0,9,0,0,24,0,0,20,26
+ .byte 30,0,0,0,0,23,0,19,29,0,22,18,28,17,16,0
+
+#endif
+
# Supply a few 'missing' instructions
# not
@@ -87,12 +95,6 @@ high_uint: .long 0xFFFFFFFF
lpmi.b \x, \x, 0
.endm
-ntz_table:
- .byte 32,0,1,12,2,6,0,13,3,0,7,0,0,0,0,14
- .byte 10,4,0,0,8,0,0,25,0,0,0,0,0,21,27,15
- .byte 31,11,5,0,0,0,0,0,9,0,0,24,0,0,20,26
- .byte 30,0,0,0,0,23,0,19,29,0,22,18,28,17,16,0
-
# calculate leading zero count
.macro nlz x, scr
flip \x, \x, 31
@@ -503,6 +505,9 @@ mul_z0:
## for implementation details
+
+
+#ifdef L_divsf3
dc_1: .long 0xffffe7d7
dc_2: .long 0xffffffe8
dc_3: .long 0xffbad86f
@@ -517,9 +522,6 @@ dc_11: .long 0x0452b1bf
dc_12: .long 0xFFFFFFC0
spec_val_test: .long 0x7F7FFFFF
-
-
-#ifdef L_divsf3
.global __divsf3
__divsf3:
push $r13
@@ -869,6 +871,7 @@ float_not_zero2:
return
#endif
+#if 0
##########################################################################
##########################################################################
## float compare
@@ -913,7 +916,74 @@ cmp_is_gt:
cmp_is_eq:
ldk $r0, 0
return
+#endif
+#ifdef L_udivsi3
+.global __udivsi3
+__udivsi3:
+ # $r0 is dividend
+ # $r1 is divisor
+ ldk $r2,0
+ push $r28
+ ldk $r28,-32
+0:
+ lshr $r3,$r0,31 # Shift $r2:$r0 left one
+ ashl $r0,$r0,1
+ ashl $r2,$r2,1
+ or $r2,$r2,$r3
+ cmp $r2,$r1
+ jmpc b,1f
+2:
+ sub $r2,$r2,$r1
+ add $r0,$r0,1
+1:
+ add $r28,$r28,1
+ jmpx 31,$r28,1,0b
+ pop $r28
+ # $r0: quotient
+ # $r2: remainder
+ return
+#endif
+#ifdef L_umodsi3
+.global __umodsi3
+__umodsi3:
+ call __udivsi3
+ move $r0,$r2
+ return
+#endif
+#ifdef L_divsi3
+.global __divsi3
+__divsi3:
+ xor $r5,$r0,$r1 # $r5 is sign of result
+ ashr $r2,$r0,31 # $r0 = abs($r0)
+ xor $r0,$r0,$r2
+ sub $r0,$r0,$r2
+ ashr $r2,$r1,31 # $r1 = abs($r1)
+ xor $r1,$r1,$r2
+ sub $r1,$r1,$r2
+ call __udivsi3
+ ashr $r5,$r5,31
+ xor $r0,$r0,$r5
+ sub $r0,$r0,$r5
+ return
+
+#endif
+#ifdef L_modsi3
+.global __modsi3
+__modsi3:
+ move $r5,$r0 # $r5 is sign of result
+ ashr $r2,$r0,31 # $r0 = abs($r0)
+ xor $r0,$r0,$r2
+ sub $r0,$r0,$r2
+ ashr $r2,$r1,31 # $r1 = abs($r1)
+ xor $r1,$r1,$r2
+ sub $r1,$r1,$r2
+ call __umodsi3
+ ashr $r5,$r5,31
+ xor $r0,$r0,$r5
+ sub $r0,$r0,$r5
+ return
+#endif
diff --git a/libgcc/config/ft32/t-ft32 b/libgcc/config/ft32/t-ft32
index 8360bbffcc5..33f26dbdc77 100644
--- a/libgcc/config/ft32/t-ft32
+++ b/libgcc/config/ft32/t-ft32
@@ -1,3 +1,7 @@
+LIB1ASMSRC = ft32/lib1funcs.S
+LIB1ASMFUNCS = \
+ _udivsi3 _divsi3 _umodsi3 _modsi3
+
LIB2ADD = $(srcdir)/config/ft32/epilog.S $(srcdir)/config/ft32/prolog.S
crti-hw.o: $(srcdir)/config/ft32/crti-hw.S
diff --git a/libgcc/config/rs6000/extendkftf2-sw.c b/libgcc/config/rs6000/extendkftf2-sw.c
index 3be88bf6128..2ce2f7d550a 100644
--- a/libgcc/config/rs6000/extendkftf2-sw.c
+++ b/libgcc/config/rs6000/extendkftf2-sw.c
@@ -39,6 +39,10 @@
#include "soft-fp.h"
#include "quad-float128.h"
+#ifndef FLOAT128_HW_INSNS
+#define __extendkftf2_sw __extendkftf2
+#endif
+
IBM128_TYPE
__extendkftf2_sw (__float128 value)
{
diff --git a/libgcc/config/sol2/gmon.c b/libgcc/config/sol2/gmon.c
index 81a03468b6e..652fd1ed946 100644
--- a/libgcc/config/sol2/gmon.c
+++ b/libgcc/config/sol2/gmon.c
@@ -44,11 +44,7 @@
extern void monstartup (char *, char *);
extern void _mcleanup (void);
-#ifdef __i386__
-static void internal_mcount (void) __attribute__ ((used));
-#else
static void internal_mcount (char *, unsigned short *) __attribute__ ((used));
-#endif
static void moncontrol (int);
struct phdr {
@@ -223,8 +219,19 @@ _mcleanup (void)
/* Solaris 2 libraries use _mcount. */
#if defined __i386__
asm(".globl _mcount\n"
+ " .type _mcount, @function\n"
"_mcount:\n"
- " jmp internal_mcount\n");
+ /* Save and restore the call-clobbered registers. */
+ " pushl %eax\n"
+ " pushl %ecx\n"
+ " pushl %edx\n"
+ " movl 12(%esp), %edx\n"
+ " movl 4(%ebp), %eax\n"
+ " call internal_mcount\n"
+ " popl %edx\n"
+ " popl %ecx\n"
+ " popl %eax\n"
+ " ret\n");
#elif defined __x86_64__
/* See GLIBC for additional information about this technique. */
asm(".globl _mcount\n"
@@ -299,32 +306,13 @@ asm(".global _mcount\n"
#endif
static void
-#ifdef __i386__
-internal_mcount (void)
-#else
internal_mcount (char *selfpc, unsigned short *frompcindex)
-#endif
{
struct tostruct *top;
struct tostruct *prevtop;
long toindex;
static char already_setup;
-#ifdef __i386__
- char *selfpc;
- unsigned short *frompcindex;
-
- /* Find the return address for mcount and the return address for mcount's
- caller. */
-
- /* selfpc = pc pushed by mcount call.
- This identifies the function that was just entered. */
- selfpc = (void *) __builtin_return_address (0);
- /* frompcindex = pc in preceding frame.
- This identifies the caller of the function just entered. */
- frompcindex = (void *) __builtin_return_address (1);
-#endif
-
/* Only necessary without the Solaris CRTs or a proper gcrt1.o, otherwise
crtpg.o or gcrt1.o take care of that.
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 4d10b2779e4..6a742b50597 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+
+ * caf/libcaf.h: caf_stop_numeric and caf_stop_str prototype.
+ * caf/single.c: _gfortran_caf_stop_numeric and
+ _gfortran_caf_stop_str implementation.
+
2016-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/69456
diff --git a/libgfortran/caf/libcaf.h b/libgfortran/caf/libcaf.h
index 427c8bf3f74..01a33f9d0ee 100644
--- a/libgfortran/caf/libcaf.h
+++ b/libgfortran/caf/libcaf.h
@@ -105,6 +105,10 @@ void _gfortran_caf_sync_all (int *, char *, int);
void _gfortran_caf_sync_memory (int *, char *, int);
void _gfortran_caf_sync_images (int, int[], int *, char *, int);
+void _gfortran_caf_stop_numeric (int32_t)
+ __attribute__ ((noreturn));
+void _gfortran_caf_stop_str (const char *, int32_t)
+ __attribute__ ((noreturn));
void _gfortran_caf_error_stop_str (const char *, int32_t)
__attribute__ ((noreturn));
void _gfortran_caf_error_stop (int32_t) __attribute__ ((noreturn));
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index 23278dc5c90..f726537e788 100644
--- a/libgfortran/caf/single.c
+++ b/libgfortran/caf/single.c
@@ -204,6 +204,23 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
*stat = 0;
}
+void
+_gfortran_caf_stop_numeric(int32_t stop_code)
+{
+ fprintf (stderr, "STOP %d\n", stop_code);
+ exit (0);
+}
+
+void
+_gfortran_caf_stop_str(const char *string, int32_t len)
+{
+ fputs ("STOP ", stderr);
+ while (len--)
+ fputc (*(string++), stderr);
+ fputs ("\n", stderr);
+
+ exit (0);
+}
void
_gfortran_caf_error_stop_str (const char *string, int32_t len)
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 5a9150483ae..a1763b68c9e 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,159 @@
+2016-03-30 Thomas Schwinge <thomas@codesourcery.com>
+ James Norris <jnorris@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+ Cesar Philippidis <cesar@codesourcery.com>
+ Chung-Lin Tang <cltang@codesourcery.com>
+ Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c-c++-common/clauses-1.c: Update.
+ * testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/if-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/vector-loop.c: Likewise.
+ * testsuite/libgomp.oacc-fortran/asyncwait-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/asyncwait-2.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/asyncwait-3.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/declare-1.f90: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Likewise.
+ XFAIL.
+ * testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Update.
+ Incorporate...
+ * testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c: ... this
+ file.
+ * testsuite/libgomp.oacc-c++/template-reduction.C: New file.
+ * testsuite/libgomp.oacc-c-c++-common/gang-static-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/gang-static-2.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-loop-clauses.c:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/private-variables.c:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-4.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
+ * testsuite/libgomp.oacc-fortran/clauses-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/default-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/firstprivate-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/gang-static-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/if-1.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90:
+ Likewise.
+ * testsuite/libgomp.oacc-fortran/pr68813.f90: Likewise.
+ * testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-1.c: Merge this
+ file...
+ * testsuite/libgomp.oacc-c-c++-common/parallel-1.c: ..., and this
+ file into...
+ * testsuite/libgomp.oacc-c-c++-common/data-clauses.h: ... this new
+ file. Update.
+ * testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels.c: New
+ file.
+ * testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel.c:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-2.c: Rename to...
+ * testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c:
+ ... this new file. Update.
+ * testsuite/libgomp.oacc-c-c++-common/parallel-2.c: Rename to...
+ * testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c:
+ ... this new file. Update.
+ * testsuite/libgomp.oacc-c-c++-common/mode-transitions.c: New
+ file. Incorporate...
+ * testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c: ... this
+ file, and...
+ * testsuite/libgomp.oacc-c-c++-common/worker-single-4.c: ... this
+ file, and...
+ * testsuite/libgomp.oacc-c-c++-common/worker-single-6.c: ... this
+ file.
+ * testsuite/libgomp.oacc-c-c++-common/update-1-2.c: Remove file.
+
+2016-03-29 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c++/c++.exp [!lang_test_file_found]: Call
+ set-torture-options.
+
+2016-03-24 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c++/c++.exp: Set up torture testing, use
+ gcc-dg-runtest.
+ * testsuite/libgomp.oacc-c/c.exp: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c: Specify
+ -fno-builtin-acc_on_device instead of -O0.
+ * testsuite/libgomp.oacc-c-c++-common/acc-on-device.c: Skip for
+ -O0.
+ * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c:
+ Don't specify -O2.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c:
+ Likewise.
+ * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c:
+ Likewise.
+
+2016-03-24 Martin Liska <mliska@suse.cz>
+
+ * plugin/plugin-hsa.c (packet_store_release): New function
+ that is taken from the HSA runtime manual.
+ (GOMP_OFFLOAD_run): Use the function.
+
+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70376
+ * testsuite/libgomp.c++/pr70376.C: New test.
+
+2016-03-23 Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/reduction-2.f90: Add missing
+ initialization of lresult and lvresult.
+ * testsuite/libgomp.oacc-fortran/reduction-3.f90: Same.
+
+2016-03-23 James Norris <jnorris@codesourcery.com>
+ Daichi Fukuoka <dc-fukuoka@sgi.com>
+
+ PR libgomp/69414
+ * oacc-mem.c (delete_copyout, update_dev_host): Fix device address.
+ * testsuite/libgomp.oacc-c-c++-common/update-1.c: Additional tests.
+ * testsuite/libgomp.oacc-c-c++-common/update-1-2.c: Likewise.
+ * testsuite/libgomp.oacc-fortran/update-1.f90: New file.
+
+2016-03-23 Martin Liska <mliska@suse.cz>
+
+ PR hsa/70337
+ * plugin/plugin-hsa.c (GOMP_OFFLOAD_run): Copy shadow
+ argument just in case a dispatched kernel uses that argument.
+
+2016-03-16 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Adjust to
+ -ftree-parallelize-loops/-fopenacc changes.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95:
+ Likewise.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95:
+ Likewise.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95:
+ Likewise.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95:
+ Likewise.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Likewise.
+ * testsuite/libgomp.oacc-fortran/kernels-loop.f95: Likewise.
+
2016-03-13 Thomas Schwinge <thomas@codesourcery.com>
* testsuite/lib/libgomp.exp (libgomp_init): Potentially append to
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index f6cc373572b..ce1905cb271 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -509,7 +509,8 @@ delete_copyout (unsigned f, void *h, size_t s)
gomp_fatal ("[%p,%d] is not mapped", (void *)h, (int)s);
}
- d = (void *) (n->tgt->tgt_start + n->tgt_offset);
+ d = (void *) (n->tgt->tgt_start + n->tgt_offset
+ + (uintptr_t) h - n->host_start);
host_size = n->host_end - n->host_start;
@@ -562,7 +563,8 @@ update_dev_host (int is_dev, void *h, size_t s)
gomp_fatal ("[%p,%d] is not mapped", h, (int)s);
}
- d = (void *) (n->tgt->tgt_start + n->tgt_offset);
+ d = (void *) (n->tgt->tgt_start + n->tgt_offset
+ + (uintptr_t) h - n->host_start);
gomp_mutex_unlock (&acc_dev->lock);
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index f795bf7f92c..1fdb01d927b 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -307,7 +307,7 @@ GOACC_enter_exit_data (int device, size_t mapnum,
break;
}
- if (kind == GOMP_MAP_FORCE_DEALLOC
+ if (kind == GOMP_MAP_DELETE
|| kind == GOMP_MAP_FORCE_FROM)
break;
@@ -374,7 +374,7 @@ GOACC_enter_exit_data (int device, size_t mapnum,
== GOMP_MAP_FORCE_FROM,
async, 1);
break;
- case GOMP_MAP_FORCE_DEALLOC:
+ case GOMP_MAP_DELETE:
acc_delete (hostaddrs[i], sizes[i]);
break;
case GOMP_MAP_FORCE_FROM:
@@ -522,10 +522,10 @@ GOACC_declare (int device, size_t mapnum,
switch (kind)
{
case GOMP_MAP_FORCE_ALLOC:
- case GOMP_MAP_FORCE_DEALLOC:
case GOMP_MAP_FORCE_FROM:
case GOMP_MAP_FORCE_TO:
case GOMP_MAP_POINTER:
+ case GOMP_MAP_DELETE:
GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
&kinds[i], 0, 0);
break;
diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c
index d88849338dc..0b3b67ac01c 100644
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -1185,6 +1185,14 @@ failure:
return false;
}
+/* Atomically store pair of uint16_t values (HEADER and REST) to a PACKET. */
+
+void
+packet_store_release (uint32_t* packet, uint16_t header, uint16_t rest)
+{
+ __atomic_store_n (packet, header | (rest << 16), __ATOMIC_RELEASE);
+}
+
/* Part of the libgomp plugin interface. Run a kernel on device N and pass it
an array of pointers in VARS as a parameter. The kernel is identified by
FN_PTR which must point to a kernel_info structure. */
@@ -1232,7 +1240,6 @@ GOMP_OFFLOAD_run (int n, void *fn_ptr, void *vars, void **args)
+ index % agent->command_q->size;
memset (((uint8_t *) packet) + 4, 0, sizeof (*packet) - 4);
- packet->setup |= (uint16_t) 1 << HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS;
packet->grid_size_x = kla->gdims[0];
uint32_t wgs = kla->wdims[0];
if (wgs == 0)
@@ -1255,8 +1262,16 @@ GOMP_OFFLOAD_run (int n, void *fn_ptr, void *vars, void **args)
hsa_signal_store_relaxed (s, 1);
memcpy (shadow->kernarg_address, &vars, sizeof (vars));
- memcpy (shadow->kernarg_address + sizeof (vars), &shadow,
- sizeof (struct hsa_kernel_runtime *));
+ /* PR hsa/70337. */
+ size_t vars_size = sizeof (vars);
+ if (kernel->kernarg_segment_size > vars_size)
+ {
+ if (kernel->kernarg_segment_size != vars_size
+ + sizeof (struct hsa_kernel_runtime *))
+ GOMP_PLUGIN_fatal ("Kernel segment size has an unexpected value");
+ memcpy (packet->kernarg_address + vars_size, &shadow,
+ sizeof (struct hsa_kernel_runtime *));
+ }
HSA_DEBUG ("Copying kernel runtime pointer to kernarg_address\n");
@@ -1267,7 +1282,9 @@ GOMP_OFFLOAD_run (int n, void *fn_ptr, void *vars, void **args)
HSA_DEBUG ("Going to dispatch kernel %s\n", kernel->name);
- __atomic_store_n ((uint16_t *) (&packet->header), header, __ATOMIC_RELEASE);
+ packet_store_release ((uint32_t *) packet, header,
+ 1 << HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS);
+
hsa_signal_store_release (agent->command_q->doorbell_signal, index);
/* TODO: GPU agents in Carrizo APUs cannot properly update L2 cache for
diff --git a/libgomp/testsuite/libgomp.c++/pr70376.C b/libgomp/testsuite/libgomp.c++/pr70376.C
new file mode 100644
index 00000000000..595c2cc930c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr70376.C
@@ -0,0 +1,20 @@
+// PR c++/70376
+// { dg-do link }
+
+template <typename T>
+struct A
+{
+ A() { }
+ A(const A&) { }
+ void foo() { }
+};
+
+int
+main ()
+{
+ A<int> a;
+ #pragma omp taskloop
+ for (int i = 0; i < 64; i++)
+ a.foo();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index 88b0269e3f3..608b298d81e 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -2,6 +2,7 @@
load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp
+load_gcc_lib torture-options.exp
global shlib_ext
@@ -13,13 +14,9 @@ if [info exists lang_include_flags] then {
unset lang_include_flags
}
-# If a testcase doesn't have special options, use these.
-if ![info exists DEFAULT_CFLAGS] then {
- set DEFAULT_CFLAGS "-O2"
-}
-
# Initialize dg.
dg-init
+torture-init
# Turn on OpenACC.
lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
@@ -104,12 +101,36 @@ if { $lang_test_file_found } {
setenv ACC_DEVICE_TYPE $offload_target_openacc
- dg-runtest $tests "$tagopt" "$libstdcxx_includes $DEFAULT_CFLAGS"
+ # To get better test coverage for device-specific code that is only
+ # ever used in offloading configurations, we'd like more thorough
+ # testing for test cases that deal with offloading, which most of all
+ # OpenACC test cases are. We enable torture testing, but limit it to
+ # -O0 and -O2 only, to avoid testing times exploding too much, under
+ # the assumption that between -O0 and -O[something] there is the
+ # biggest difference in the overall structure of the generated code.
+ switch $offload_target_openacc {
+ host {
+ set-torture-options [list \
+ { -O2 } ]
+ }
+ default {
+ set-torture-options [list \
+ { -O0 } \
+ { -O2 } ]
+ }
+ }
+
+ gcc-dg-runtest $tests "$tagopt" "$libstdcxx_includes"
}
+} else {
+ # Call this once, which placates the subsequent torture-finish.
+ set-torture-options [list \
+ { INVALID } ]
}
# See above.
set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
# All done.
+torture-finish
dg-finish
diff --git a/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C b/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C
new file mode 100644
index 00000000000..fb5924c9b51
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C
@@ -0,0 +1,98 @@
+const int n = 100;
+
+// Check explicit template copy map
+
+template<typename T> T
+sum (T array[])
+{
+ T s = 0;
+
+#pragma acc parallel loop num_gangs (10) gang reduction (+:s) copy (s, array[0:n])
+ for (int i = 0; i < n; i++)
+ s += array[i];
+
+ return s;
+}
+
+// Check implicit template copy map
+
+template<typename T> T
+sum ()
+{
+ T s = 0;
+ T array[n];
+
+ for (int i = 0; i < n; i++)
+ array[i] = i+1;
+
+#pragma acc parallel loop num_gangs (10) gang reduction (+:s) copy (s)
+ for (int i = 0; i < n; i++)
+ s += array[i];
+
+ return s;
+}
+
+// Check present and async
+
+template<typename T> T
+async_sum (T array[])
+{
+ T s = 0;
+
+#pragma acc parallel loop num_gangs (10) gang async (1) present (array[0:n])
+ for (int i = 0; i < n; i++)
+ array[i] = i+1;
+
+#pragma acc parallel loop num_gangs (10) gang reduction (+:s) present (array[0:n]) copy (s) async wait (1)
+ for (int i = 0; i < n; i++)
+ s += array[i];
+
+#pragma acc wait
+
+ return s;
+}
+
+// Check present and async and an explicit firstprivate
+
+template<typename T> T
+async_sum (int c)
+{
+ T s = 0;
+
+#pragma acc parallel loop num_gangs (10) gang reduction (+:s) copy(s) firstprivate (c) async wait (1)
+ for (int i = 0; i < n; i++)
+ s += i+c;
+
+#pragma acc wait
+
+ return s;
+}
+
+int
+main()
+{
+ int a[n];
+ int result = 0;
+
+ for (int i = 0; i < n; i++)
+ {
+ a[i] = i+1;
+ result += i+1;
+ }
+
+ if (sum (a) != result)
+ __builtin_abort ();
+
+ if (sum<int> () != result)
+ __builtin_abort ();
+
+#pragma acc enter data copyin (a)
+ if (async_sum (a) != result)
+ __builtin_abort ();
+
+ if (async_sum<int> (1) != result)
+ __builtin_abort ();
+#pragma acc exit data delete (a)
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c
index e5d9c36b107..bfcb67d58b6 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device-2.c
@@ -1,9 +1,8 @@
-/* { dg-additional-options "-O0" } */
+/* Test the acc_on_device library function. */
+/* { dg-additional-options "-fno-builtin-acc_on_device" } */
#include <openacc.h>
-/* acc_on_device might not be folded at -O0, but it should work. */
-
int main ()
{
int dev;
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c
index 88c000e62f0..e0d87107d78 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/acc-on-device.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
-/* { dg-additional-options "-O2" } */
+/* We don't expect this to work with optimizations disabled.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <openacc.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c
index 22cef6db29f..f3b490a9508 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c
@@ -1,4 +1,6 @@
/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* <http://news.gmane.org/find-root.php?message_id=%3C87pp0aaksc.fsf%40kepler.schwinge.homeip.net%3E>.
+ { dg-xfail-run-if "TODO" { *-*-* } } */
/* { dg-additional-options "-lcuda" } */
#include <openacc.h>
@@ -460,6 +462,438 @@ main (int argc, char **argv)
abort ();
}
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 3.0;
+ b[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N]) copy (b[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = a[ii];
+ }
+
+#pragma acc wait
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 3.0)
+ abort ();
+
+ if (b[i] != 3.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 2.0;
+ b[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N]) copy (b[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = a[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 2.0)
+ abort ();
+
+ if (b[i] != 2.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 3.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N]) copy (b[0:N]) copy (c[0:N]) copy (d[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ d[ii] = ((a[ii] * a[ii] + a[ii]) / a[ii]) - a[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 3.0)
+ abort ();
+
+ if (b[i] != 9.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+
+ if (d[i] != 1.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 2.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ e[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N], b[0:N], c[0:N], d[0:N], e[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ d[ii] = ((a[ii] * a[ii] + a[ii]) / a[ii]) - a[ii];
+ }
+
+#pragma acc kernels wait (1) async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ e[ii] = a[ii] + b[ii] + c[ii] + d[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 2.0)
+ abort ();
+
+ if (b[i] != 4.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+
+ if (d[i] != 1.0)
+ abort ();
+
+ if (e[i] != 11.0)
+ abort ();
+ }
+
+
+ r = cuStreamCreate (&stream1, CU_STREAM_NON_BLOCKING);
+ if (r != CUDA_SUCCESS)
+ {
+ fprintf (stderr, "cuStreamCreate failed: %d\n", r);
+ abort ();
+ }
+
+ acc_set_cuda_stream (1, stream1);
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 5.0;
+ b[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N], b[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = a[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 5.0)
+ abort ();
+
+ if (b[i] != 5.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 7.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N]) copy (b[0:N]) copy (c[0:N]) copy (d[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ d[ii] = ((a[ii] * a[ii] + a[ii]) / a[ii]) - a[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 7.0)
+ abort ();
+
+ if (b[i] != 49.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+
+ if (d[i] != 1.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 3.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ e[i] = 0.0;
+ }
+
+#pragma acc data copy (a[0:N], b[0:N], c[0:N], d[0:N], e[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ d[ii] = ((a[ii] * a[ii] + a[ii]) / a[ii]) - a[ii];
+ }
+
+#pragma acc kernels wait (1) async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ e[ii] = a[ii] + b[ii] + c[ii] + d[ii];
+ }
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 3.0)
+ abort ();
+
+ if (b[i] != 9.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+
+ if (d[i] != 1.0)
+ abort ();
+
+ if (e[i] != 17.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 4.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ e[i] = 0.0;
+ }
+
+#pragma acc data copyin (a[0:N], b[0:N], c[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+#pragma acc update host (a[0:N], b[0:N], c[0:N]) wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 4.0)
+ abort ();
+
+ if (b[i] != 16.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+ }
+
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 5.0;
+ b[i] = 0.0;
+ c[i] = 0.0;
+ d[i] = 0.0;
+ e[i] = 0.0;
+ }
+
+#pragma acc data copyin (a[0:N], b[0:N], c[0:N]) copyin (N)
+ {
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = (a[ii] * a[ii] * a[ii]) / a[ii];
+ }
+
+#pragma acc kernels async (1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ c[ii] = (a[ii] + a[ii] + a[ii] + a[ii]) / a[ii];
+ }
+
+#pragma acc update host (a[0:N], b[0:N], c[0:N]) async (1)
+
+#pragma acc wait (1)
+
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 5.0)
+ abort ();
+
+ if (b[i] != 25.0)
+ abort ();
+
+ if (c[i] != 4.0)
+ abort ();
+ }
+
acc_shutdown (acc_device_nvidia);
return 0;
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/clauses-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/clauses-1.c
index 51c0cf58a90..410c46cc651 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/clauses-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/clauses-1.c
@@ -586,6 +586,32 @@ main (int argc, char **argv)
for (i = 0; i < N; i++)
{
+ a[i] = 6.0;
+ b[i] = 0.0;
+ }
+
+#pragma acc parallel pcopy (a[0:N], b[0:N])
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ b[ii] = a[ii];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 6.0)
+ abort ();
+ }
+
+ if (acc_is_present (&a[0], (N * sizeof (float))))
+ abort ();
+
+ if (acc_is_present (&b[0], (N * sizeof (float))))
+ abort ();
+
+ for (i = 0; i < N; i++)
+ {
a[i] = 5.0;
b[i] = 7.0;
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c
index d9fff6ff39b..2cd98bd9d78 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c
@@ -1,4 +1,4 @@
/* { dg-do run { target lto } } */
/* { dg-additional-options "-fipa-pta -flto -flto-partition=max" } */
-#include "parallel-1.c"
+#include "data-clauses-kernels.c"
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels.c
new file mode 100644
index 00000000000..f7f2d1c861c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels.c
@@ -0,0 +1,2 @@
+#define CONSTRUCT kernels
+#include "data-clauses.h"
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c
index f76c926a68f..ddcf4e389cb 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c
@@ -1,4 +1,4 @@
/* { dg-do run { target lto } } */
/* { dg-additional-options "-fipa-pta -flto -flto-partition=max" } */
-#include "kernels-1.c"
+#include "data-clauses-parallel.c"
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel.c
new file mode 100644
index 00000000000..e734b2f3afd
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel.c
@@ -0,0 +1,2 @@
+#define CONSTRUCT parallel
+#include "data-clauses.h"
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses.h
index fd9df33748f..d557befba35 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/data-clauses.h
@@ -1,7 +1,3 @@
-/* { dg-do run } */
-
-#include <stdlib.h>
-
int i;
int main(void)
@@ -11,145 +7,145 @@ int main(void)
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) copyin (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) copyin (i, j)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) copyout (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) copyout (i, j)
{
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) copy (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) copy (i, j)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) create (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) create (i, j)
{
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) present_or_copyin (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) present_or_copyin (i, j)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1)
- abort ();
+ __builtin_abort ();
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) present_or_copyout (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) present_or_copyout (i, j)
{
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) present_or_copy (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) present_or_copy (i, j)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
i = -1;
j = -2;
v = 0;
-#pragma acc parallel /* copyout */ present_or_copyout (v) present_or_create (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) present_or_create (i, j)
{
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
if (v != 1)
- abort ();
+ __builtin_abort ();
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
i = -1;
@@ -158,23 +154,23 @@ int main(void)
#pragma acc data copyin (i, j)
{
-#pragma acc parallel /* copyout */ present_or_copyout (v) present (i, j)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v) present (i, j)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
}
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
i = -1;
@@ -183,23 +179,23 @@ int main(void)
#pragma acc data copyin(i, j)
{
-#pragma acc parallel /* copyout */ present_or_copyout (v)
+#pragma acc CONSTRUCT /* copyout */ present_or_copyout (v)
{
if (i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
i = 2;
j = 1;
if (i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
v = 1;
}
}
#if ACC_MEM_SHARED
if (v != 1 || i != 2 || j != 1)
- abort ();
+ __builtin_abort ();
#else
if (v != 1 || i != -1 || j != -2)
- abort ();
+ __builtin_abort ();
#endif
return 0;
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
index e271a3770a1..8247e7b6bdd 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
@@ -1,5 +1,3 @@
-/* { dg-do run } */
-
#include <stdlib.h>
int main (void)
@@ -28,5 +26,26 @@ int main (void)
abort ();
#endif
+ a_1 = a_2 = 0;
+
+#pragma acc data deviceptr (a)
+#pragma acc parallel copyout (a_1, a_2)
+ {
+ a_1 = a;
+ a_2 = &a;
+ }
+
+ if (a != A)
+ abort ();
+ if (a_1 != a)
+ abort ();
+#if ACC_MEM_SHARED
+ if (a_2 != &a)
+ abort ();
+#else
+ if (a_2 == &a)
+ abort ();
+#endif
+
return 0;
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c
index 7f5d3d37617..689a443ca43 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c
@@ -1,8 +1,7 @@
-/* { dg-do run } */
-
#include <openacc.h>
-int main ()
+
+void t1 ()
{
int ok = 1;
int val = 2;
@@ -28,14 +27,115 @@ int main ()
if (ondev)
{
if (!ok)
- return 1;
+ __builtin_abort ();
if (val != 2)
- return 1;
+ __builtin_abort ();
for (int i = 0; i < 32; i++)
if (ary[i] != 2 + i)
- return 1;
+ __builtin_abort ();
}
-
+}
+
+
+void t2 ()
+{
+ int ok = 1;
+ int val = 2;
+
+#pragma acc data copy(val)
+ {
+#pragma acc parallel present (val)
+ {
+ val = 7;
+ }
+
+#pragma acc parallel firstprivate (val) copy(ok)
+ {
+ ok = val == 7;
+ val = 9;
+ }
+ }
+
+ if (!ok)
+ __builtin_abort ();
+ if (val != 7)
+ __builtin_abort ();
+}
+
+
+#define N 100
+void t3 ()
+{
+ int a, b[N], c, d, i;
+ int n = acc_get_device_type () == acc_device_nvidia ? N : 1;
+
+ a = 5;
+ for (i = 0; i < n; i++)
+ b[i] = -1;
+
+ #pragma acc parallel num_gangs (n) firstprivate (a)
+ #pragma acc loop gang
+ for (i = 0; i < n; i++)
+ {
+ a = a + i;
+ b[i] = a;
+ }
+
+ for (i = 0; i < n; i++)
+ if (a + i != b[i])
+ __builtin_abort ();
+
+ #pragma acc data copy (a)
+ {
+ #pragma acc parallel firstprivate (a) copyout (c)
+ {
+ a = 10;
+ c = a;
+ }
+
+ /* This version of 'a' should still be 5. */
+ #pragma acc parallel copyout (d) present (a)
+ {
+ d = a;
+ }
+ }
+
+ if (c != 10)
+ __builtin_abort ();
+ if (d != 5)
+ __builtin_abort ();
+}
+#undef N
+
+
+void t4 ()
+{
+ int x = 5, i, arr[32];
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 3;
+
+#pragma acc parallel firstprivate(x) copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+#pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ arr[i] += x;
+ }
+
+ for (i = 0; i < 32; i++)
+ if (arr[i] != 8)
+ __builtin_abort ();
+}
+
+
+int
+main()
+{
+ t1 ();
+ t2 ();
+ t3 ();
+ t4 ();
+
return 0;
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c
deleted file mode 100644
index 9666542fd82..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-do run } */
-
-#include <openacc.h>
-
-int main ()
-{
- int ok = 1;
- int val = 2;
-
-#pragma acc data copy(val)
- {
-#pragma acc parallel present (val)
- {
- val = 7;
- }
-
-#pragma acc parallel firstprivate (val) copy(ok)
- {
- ok = val == 7;
- val = 9;
- }
-
- }
-
- if (!ok)
- return 1;
- if(val != 7)
- return 1;
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-1.c
new file mode 100644
index 00000000000..d8ab958f334
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-1.c
@@ -0,0 +1,48 @@
+#include <assert.h>
+
+#define N 100
+
+void
+test (int *a, int *b, int sarg)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ assert (a[i] == b[i] + sarg);
+}
+
+int
+main ()
+{
+ int a[N], b[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ b[i] = i+1;
+
+#pragma acc parallel loop gang (static:*) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = b[i] + 0;
+
+ test (a, b, 0);
+
+#pragma acc parallel loop gang (static:1) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = b[i] + 1;
+
+ test (a, b, 1);
+
+#pragma acc parallel loop gang (static:5) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = b[i] + 5;
+
+ test (a, b, 5);
+
+#pragma acc parallel loop gang (static:20) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = b[i] + 20;
+
+ test (a, b, 20);
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c
new file mode 100644
index 00000000000..ce9632cf1c0
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-static-2.c
@@ -0,0 +1,100 @@
+/* { dg-do run { target openacc_nvidia_accel_selected } } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+
+#include <assert.h>
+#include <openacc.h>
+
+#define N 100
+
+#define GANG_ID(I) \
+ (acc_on_device (acc_device_nvidia) \
+ ? ({unsigned __r; \
+ __asm__ volatile ("mov.u32 %0,%%ctaid.x;" : "=r" (__r)); \
+ __r; }) : (I))
+
+int
+test_static(int *a, int num_gangs, int sarg)
+{
+ int i, j;
+
+ if (sarg == 0)
+ sarg = 1;
+
+ for (i = 0; i < N / sarg; i++)
+ for (j = 0; j < sarg; j++)
+ assert (a[i*sarg+j] == i % num_gangs);
+}
+
+int
+test_nonstatic(int *a, int gangs)
+{
+ int i, j;
+
+ for (i = 0; i < N; i+=gangs)
+ for (j = 0; j < gangs; j++)
+ assert (a[i+j] == i/gangs);
+}
+
+int
+main ()
+{
+ int a[N];
+ int i, x;
+
+#pragma acc parallel loop gang (static:*) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_nonstatic (a, 10);
+
+#pragma acc parallel loop gang (static:1) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 1);
+
+#pragma acc parallel loop gang (static:2) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 2);
+
+#pragma acc parallel loop gang (static:5) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 5);
+
+#pragma acc parallel loop gang (static:20) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 20);
+
+ /* Non-static gang. */
+#pragma acc parallel loop gang num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_nonstatic (a, 10);
+
+ /* Static arguments with a variable expression. */
+
+ x = 20;
+#pragma acc parallel loop gang (static:0+x) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 20);
+
+ x = 20;
+#pragma acc parallel loop gang (static:x) num_gangs (10)
+ for (i = 0; i < 100; i++)
+ a[i] = GANG_ID (i);
+
+ test_static (a, 10, 20);
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c
index 6aa3bb7199e..5398905f411 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/if-1.c
@@ -1,5 +1,3 @@
-/* { dg-do run } */
-
#include <openacc.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -608,5 +606,357 @@ main(int argc, char **argv)
abort ();
#endif
+ for (i = 0; i < N; i++)
+ a[i] = 4.0;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 5.0;
+#else
+ exp = 4.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 16.0;
+
+#pragma acc kernels if(0)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 17.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 8.0;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(one)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 9.0;
+#else
+ exp = 8.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 22.0;
+
+#pragma acc kernels if(zero)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 23.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 16.0;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(true)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 17.0;
+#else
+ exp = 16.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 76.0;
+
+#pragma acc kernels if(false)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 77.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 22.0;
+
+ n = 1;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(n)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 23.0;
+#else
+ exp = 22.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 18.0;
+
+ n = 0;
+
+#pragma acc kernels if(n)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 19.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 49.0;
+
+ n = 1;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(n + n)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 50.0;
+#else
+ exp = 49.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 38.0;
+
+ n = 0;
+
+#pragma acc kernels if(n + n)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 39.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 91.0;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(-2)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 92.0;
+#else
+ exp = 91.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 43.0;
+
+#pragma acc kernels copyin(a[0:N]) copyout(b[0:N]) if(one == 1)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+#if ACC_MEM_SHARED
+ exp = 44.0;
+#else
+ exp = 43.0;
+#endif
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != exp)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = 87.0;
+
+#pragma acc kernels if(one == 0)
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ {
+ if (acc_on_device (acc_device_host))
+ b[ii] = a[ii] + 1;
+ else
+ b[ii] = a[ii];
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (b[i] != 88.0)
+ abort();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 3.0;
+ b[i] = 9.0;
+ }
+
+#if ACC_MEM_SHARED
+ exp = 0.0;
+ exp2 = 0.0;
+#else
+ acc_map_data (a, d_a, N * sizeof (float));
+ acc_map_data (b, d_b, N * sizeof (float));
+ exp = 3.0;
+ exp2 = 9.0;
+#endif
+
return 0;
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-1.c
deleted file mode 100644
index 3acfdf55ef6..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-1.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* { dg-do run } */
-
-#include <stdlib.h>
-
-int i;
-
-int main (void)
-{
- int j, v;
-
-#if 0
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) copyin (i, j)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != -1 || j != -2)
- abort ();
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) copyout (i, j)
- {
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) copy (i, j)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) create (i, j)
- {
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != -1 || j != -2)
- abort ();
-#endif
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) present_or_copyin (i, j)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1)
- abort ();
-#if ACC_MEM_SHARED
- if (i != 2 || j != 1)
- abort ();
-#else
- if (i != -1 || j != -2)
- abort ();
-#endif
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) present_or_copyout (i, j)
- {
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) present_or_copy (i, j)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) present_or_create (i, j)
- {
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1)
- abort ();
-#if ACC_MEM_SHARED
- if (i != 2 || j != 1)
- abort ();
-#else
- if (i != -1 || j != -2)
- abort ();
-#endif
-
-#if 0
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v) present (i, j)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-#endif
-
-#if 0
- i = -1;
- j = -2;
- v = 0;
-#pragma acc kernels /* copyout */ present_or_copyout (v)
- {
- if (i != -1 || j != -2)
- abort ();
- i = 2;
- j = 1;
- if (i != 2 || j != 1)
- abort ();
- v = 1;
- }
- if (v != 1 || i != 2 || j != 1)
- abort ();
-#endif
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c
index 0f323c82d2c..e8d65df8208 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c
index 654e750c3b4..dd8ca871d59 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c
index 44d4fd25cd2..50e7dc14888 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O2 -fipa-pta" } */
+/* { dg-additional-options "-fipa-pta" } */
#include <stdlib.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-clauses.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-clauses.c
new file mode 100644
index 00000000000..2c424973eb1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-clauses.c
@@ -0,0 +1,62 @@
+/* Exercise the auto, independent, seq and tile loop clauses inside
+ kernels regions. */
+
+#include <assert.h>
+
+#define N 100
+
+void
+check (int *a, int *b)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ assert (a[i] == b[i]);
+}
+
+int
+main ()
+{
+ int i, a[N], b[N];
+
+#pragma acc kernels copy(a)
+ {
+#pragma acc loop auto
+ for (i = 0; i < N; i++)
+ a[i] = i;
+ }
+
+ for (i = 0; i < N; i++)
+ b[i] = i;
+
+ check (a, b);
+
+#pragma acc kernels copyout(a)
+ {
+#pragma acc loop independent
+ for (i = 0; i < N; i++)
+ a[i] = i;
+ }
+
+ check (a, b);
+
+#pragma acc kernels present_or_copy(a)
+ {
+#pragma acc loop seq
+ for (i = 0; i < N; i++)
+ a[i] = i;
+ }
+
+ check (a, b);
+
+#pragma acc kernels pcopyout(a) present_or_copyin(b)
+ {
+#pragma acc loop seq
+ for (i = 0; i < N; i++)
+ a[i] = b[i];
+ }
+
+ check (a, b);
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c
index 4922c9c00a0..622bbdffaea 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
#include <openacc.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c
index 36b882ff330..c433b80da93 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c
@@ -1,5 +1,7 @@
-
-/* { dg-additional-options "-O2 -fopenacc-dim=16:16" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+/* { dg-additional-options "-fopenacc-dim=16:16" } */
#include <openacc.h>
#include <alloca.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c
index 23c2a75f1e9..7bff6cddf84 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c
index 1a93db375bd..92b82a01eb0 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-g-2.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c
index 26b2df9259a..42b612a29d8 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c
index c14bdddef5f..a8684f9587e 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c
index 3de8b09ddc1..3b104cf2f47 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c
index bae5c66cc1f..b77ae76e321 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c
index ada92e392c1..16d8f9fbf2c 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c
index 706d0d8d736..9cc12b3add8 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c
index a073ac857ff..f0c9d8182e8 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c
index b9ec95b77c1..2974807925a 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-v-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c
index 539e41d0b31..33b6eae9e44 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c
index fcb9079d592..578cfadd4d1 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c
new file mode 100644
index 00000000000..2394ac8cbd6
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c
@@ -0,0 +1,895 @@
+/* Miscellaneous test cases for gang/worker/vector mode transitions. */
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <math.h>
+#include <openacc.h>
+
+
+/* Test basic vector-partitioned mode transitions. */
+
+void t1()
+{
+ int n = 0, arr[32], i;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(n, arr) \
+ num_gangs(1) num_workers(1) vector_length(32)
+ {
+ int j;
+ n++;
+ #pragma acc loop vector
+ for (j = 0; j < 32; j++)
+ arr[j]++;
+ n++;
+ }
+
+ assert (n == 2);
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == 1);
+}
+
+
+/* Test vector-partitioned, gang-partitioned mode. */
+
+void t2()
+{
+ int n[32], arr[1024], i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = 0;
+
+ for (i = 0; i < 32; i++)
+ n[i] = 0;
+
+ #pragma acc parallel copy(n, arr) \
+ num_gangs(32) num_workers(1) vector_length(32)
+ {
+ int j, k;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[j * 32 + k]++;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (n[i] == 2);
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == 1);
+}
+
+
+/* Test conditions inside vector-partitioned loops. */
+
+void t4()
+{
+ int n[32], arr[1024], i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ for (i = 0; i < 32; i++)
+ n[i] = 0;
+
+ #pragma acc parallel copy(n, arr) \
+ num_gangs(32) num_workers(1) vector_length(32)
+ {
+ int j, k;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ if ((arr[j * 32 + k] % 2) != 0)
+ arr[j * 32 + k] *= 2;
+ }
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (n[i] == 2);
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == ((i % 2) == 0 ? i : i * 2));
+}
+
+
+/* Test conditions inside gang-partitioned/vector-partitioned loops. */
+
+void t5()
+{
+ int n[32], arr[1024], i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ for (i = 0; i < 32; i++)
+ n[i] = 0;
+
+ #pragma acc parallel copy(n, arr) \
+ num_gangs(32) num_workers(1) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+
+ #pragma acc loop gang vector
+ for (j = 0; j < 1024; j++)
+ if ((arr[j] % 2) != 0)
+ arr[j] *= 2;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 32; j++)
+ n[j]++;
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (n[i] == 2);
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == ((i % 2) == 0 ? i : i * 2));
+}
+
+
+/* Test trivial operation of vector-single mode. */
+
+void t7()
+{
+ int n = 0;
+ #pragma acc parallel copy(n) \
+ num_gangs(1) num_workers(1) vector_length(32)
+ {
+ n++;
+ }
+ assert (n == 1);
+}
+
+
+/* Test vector-single, gang-partitioned mode. */
+
+void t8()
+{
+ int arr[1024];
+ int gangs;
+
+ for (gangs = 1; gangs <= 1024; gangs <<= 1)
+ {
+ int i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(gangs) num_workers(1) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 1024; j++)
+ arr[j]++;
+ }
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == 1);
+ }
+}
+
+
+/* Test conditions in vector-single mode. */
+
+void t9()
+{
+ int arr[1024];
+ int gangs;
+
+ for (gangs = 1; gangs <= 1024; gangs <<= 1)
+ {
+ int i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(gangs) num_workers(1) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 1024; j++)
+ if ((j % 3) == 0)
+ arr[j]++;
+ else
+ arr[j] += 2;
+ }
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == ((i % 3) == 0) ? 1 : 2);
+ }
+}
+
+
+/* Test switch in vector-single mode. */
+
+void t10()
+{
+ int arr[1024];
+ int gangs;
+
+ for (gangs = 1; gangs <= 1024; gangs <<= 1)
+ {
+ int i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(gangs) num_workers(1) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 1024; j++)
+ switch (j % 5)
+ {
+ case 0: arr[j] += 1; break;
+ case 1: arr[j] += 2; break;
+ case 2: arr[j] += 3; break;
+ case 3: arr[j] += 4; break;
+ case 4: arr[j] += 5; break;
+ default: arr[j] += 99;
+ }
+ }
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == (i % 5) + 1);
+ }
+}
+
+
+/* Test switch in vector-single mode, initialise array on device. */
+
+void t11()
+{
+ int arr[1024];
+ int i;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = 99;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(1024) num_workers(1) vector_length(32)
+ {
+ int j;
+
+ /* This loop and the one following must be distributed to available gangs
+ in the same way to ensure data dependencies are not violated (hence the
+ "static" clauses). */
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 1024; j++)
+ arr[j] = 0;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < 1024; j++)
+ switch (j % 5)
+ {
+ case 0: arr[j] += 1; break;
+ case 1: arr[j] += 2; break;
+ case 2: arr[j] += 3; break;
+ case 3: arr[j] += 4; break;
+ case 4: arr[j] += 5; break;
+ default: arr[j] += 99;
+ }
+ }
+
+ for (i = 0; i < 1024; i++)
+ assert (arr[i] == (i % 5) + 1);
+}
+
+
+/* Test multiple conditions in vector-single mode. */
+
+#define NUM_GANGS 4096
+void t12()
+{
+ bool fizz[NUM_GANGS], buzz[NUM_GANGS], fizzbuzz[NUM_GANGS];
+ int i;
+
+ #pragma acc parallel copyout(fizz, buzz, fizzbuzz) \
+ num_gangs(NUM_GANGS) num_workers(1) vector_length(32)
+ {
+ int j;
+
+ /* This loop and the one following must be distributed to available gangs
+ in the same way to ensure data dependencies are not violated (hence the
+ "static" clauses). */
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < NUM_GANGS; j++)
+ fizz[j] = buzz[j] = fizzbuzz[j] = 0;
+
+ #pragma acc loop gang(static:*)
+ for (j = 0; j < NUM_GANGS; j++)
+ {
+ if ((j % 3) == 0 && (j % 5) == 0)
+ fizzbuzz[j] = 1;
+ else
+ {
+ if ((j % 3) == 0)
+ fizz[j] = 1;
+ else if ((j % 5) == 0)
+ buzz[j] = 1;
+ }
+ }
+ }
+
+ for (i = 0; i < NUM_GANGS; i++)
+ {
+ assert (fizzbuzz[i] == ((i % 3) == 0 && (i % 5) == 0));
+ assert (fizz[i] == ((i % 3) == 0 && (i % 5) != 0));
+ assert (buzz[i] == ((i % 3) != 0 && (i % 5) == 0));
+ }
+}
+#undef NUM_GANGS
+
+
+/* Test worker-partitioned/vector-single mode. */
+
+void t13()
+{
+ int arr[32 * 8], i;
+
+ for (i = 0; i < 32 * 8; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ #pragma acc loop worker
+ for (k = 0; k < 8; k++)
+ arr[j * 8 + k] += j * 8 + k;
+ }
+ }
+
+ for (i = 0; i < 32 * 8; i++)
+ assert (arr[i] == i);
+}
+
+
+/* Test worker-single/worker-partitioned transitions. */
+
+void t16()
+{
+ int n[32], arr[32 * 32], i;
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = 0;
+
+ for (i = 0; i < 32; i++)
+ n[i] = 0;
+
+ #pragma acc parallel copy(n, arr) \
+ num_gangs(8) num_workers(16) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ n[j]++;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr[j * 32 + k]++;
+
+ n[j]++;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr[j * 32 + k]++;
+
+ n[j]++;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr[j * 32 + k]++;
+
+ n[j]++;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (n[i] == 4);
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == 3);
+}
+
+
+/* Test correct synchronisation between worker-partitioned loops. */
+
+void t17()
+{
+ int arr_a[32 * 32], arr_b[32 * 32], i;
+ int num_workers, num_gangs;
+
+ for (num_workers = 1; num_workers <= 32; num_workers <<= 1)
+ for (num_gangs = 1; num_gangs <= 32; num_gangs <<= 1)
+ {
+ for (i = 0; i < 32 * 32; i++)
+ arr_a[i] = i;
+
+ #pragma acc parallel copyin(arr_a) copyout(arr_b) \
+ num_gangs(num_gangs) num_workers(num_workers) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr_b[j * 32 + (31 - k)] = arr_a[j * 32 + k] * 2;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr_a[j * 32 + (31 - k)] = arr_b[j * 32 + k] * 2;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ arr_b[j * 32 + (31 - k)] = arr_a[j * 32 + k] * 2;
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr_b[i] == (i ^ 31) * 8);
+ }
+}
+
+
+/* Test correct synchronisation between worker+vector-partitioned loops. */
+
+void t18()
+{
+ int arr_a[32 * 32 * 32], arr_b[32 * 32 * 32], i;
+ int num_workers, num_gangs;
+
+ for (num_workers = 1; num_workers <= 32; num_workers <<= 1)
+ for (num_gangs = 1; num_gangs <= 32; num_gangs <<= 1)
+ {
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr_a[i] = i;
+
+ #pragma acc parallel copyin(arr_a) copyout(arr_b) \
+ num_gangs(num_gangs) num_workers(num_workers) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ #pragma acc loop worker vector
+ for (k = 0; k < 32 * 32; k++)
+ arr_b[j * 32 * 32 + (1023 - k)] = arr_a[j * 32 * 32 + k] * 2;
+
+ #pragma acc loop worker vector
+ for (k = 0; k < 32 * 32; k++)
+ arr_a[j * 32 * 32 + (1023 - k)] = arr_b[j * 32 * 32 + k] * 2;
+
+ #pragma acc loop worker vector
+ for (k = 0; k < 32 * 32; k++)
+ arr_b[j * 32 * 32 + (1023 - k)] = arr_a[j * 32 * 32 + k] * 2;
+ }
+ }
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ assert (arr_b[i] == (i ^ 1023) * 8);
+ }
+}
+
+
+/* Test correct synchronisation between vector-partitioned loops in
+ worker-partitioned mode. */
+
+void t19()
+{
+ int n[32 * 32], arr_a[32 * 32 * 32], arr_b[32 * 32 * 32], i;
+ int num_workers, num_gangs;
+
+ for (num_workers = 1; num_workers <= 32; num_workers <<= 1)
+ for (num_gangs = 1; num_gangs <= 32; num_gangs <<= 1)
+ {
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr_a[i] = i;
+
+ for (i = 0; i < 32 * 32; i++)
+ n[i] = 0;
+
+ #pragma acc parallel copy (n) copyin(arr_a) copyout(arr_b) \
+ num_gangs(num_gangs) num_workers(num_workers) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ #pragma acc loop worker
+ for (k = 0; k < 32; k++)
+ {
+ int m;
+
+ n[j * 32 + k]++;
+
+ #pragma acc loop vector
+ for (m = 0; m < 32; m++)
+ {
+ if (((j * 1024 + k * 32 + m) % 2) == 0)
+ arr_b[j * 1024 + k * 32 + (31 - m)]
+ = arr_a[j * 1024 + k * 32 + m] * 2;
+ else
+ arr_b[j * 1024 + k * 32 + (31 - m)]
+ = arr_a[j * 1024 + k * 32 + m] * 3;
+ }
+
+ /* Test returning to vector-single mode... */
+ n[j * 32 + k]++;
+
+ #pragma acc loop vector
+ for (m = 0; m < 32; m++)
+ {
+ if (((j * 1024 + k * 32 + m) % 3) == 0)
+ arr_a[j * 1024 + k * 32 + (31 - m)]
+ = arr_b[j * 1024 + k * 32 + m] * 5;
+ else
+ arr_a[j * 1024 + k * 32 + (31 - m)]
+ = arr_b[j * 1024 + k * 32 + m] * 7;
+ }
+
+ /* ...and back-to-back vector loops. */
+
+ #pragma acc loop vector
+ for (m = 0; m < 32; m++)
+ {
+ if (((j * 1024 + k * 32 + m) % 2) == 0)
+ arr_b[j * 1024 + k * 32 + (31 - m)]
+ = arr_a[j * 1024 + k * 32 + m] * 3;
+ else
+ arr_b[j * 1024 + k * 32 + (31 - m)]
+ = arr_a[j * 1024 + k * 32 + m] * 2;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (n[i] == 2);
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ {
+ int m = 6 * ((i % 3) == 0 ? 5 : 7);
+ assert (arr_b[i] == (i ^ 31) * m);
+ }
+ }
+}
+
+
+/* With -O0, variables are on the stack, not in registers. Check that worker
+ state propagation handles the stack frame. */
+
+void t20()
+{
+ int w0 = 0;
+ int w1 = 0;
+ int w2 = 0;
+ int w3 = 0;
+ int w4 = 0;
+ int w5 = 0;
+ int w6 = 0;
+ int w7 = 0;
+
+ int i;
+
+#pragma acc parallel copy (w0, w1, w2, w3, w4, w5, w6, w7) \
+ num_gangs (1) num_workers (8)
+ {
+ int internal = 100;
+
+#pragma acc loop worker
+ for (i = 0; i < 8; i++)
+ {
+ switch (i)
+ {
+ case 0: w0 = internal; break;
+ case 1: w1 = internal; break;
+ case 2: w2 = internal; break;
+ case 3: w3 = internal; break;
+ case 4: w4 = internal; break;
+ case 5: w5 = internal; break;
+ case 6: w6 = internal; break;
+ case 7: w7 = internal; break;
+ default: break;
+ }
+ }
+ }
+
+ if (w0 != 100
+ || w1 != 100
+ || w2 != 100
+ || w3 != 100
+ || w4 != 100
+ || w5 != 100
+ || w6 != 100
+ || w7 != 100)
+ __builtin_abort ();
+}
+
+
+/* Test worker-single/vector-single mode. */
+
+void t21()
+{
+ int arr[32], i;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ arr[j]++;
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == 1);
+}
+
+
+/* Test worker-single/vector-single mode. */
+
+void t22()
+{
+ int arr[32], i;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 0;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ #pragma acc atomic
+ arr[j]++;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == 1);
+}
+
+
+/* Test condition in worker-single/vector-single mode. */
+
+void t23()
+{
+ int arr[32], i;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ if ((arr[j] % 2) != 0)
+ arr[j]++;
+ else
+ arr[j] += 2;
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == ((i % 2) != 0) ? i + 1 : i + 2);
+}
+
+
+/* Test switch in worker-single/vector-single mode. */
+
+void t24()
+{
+ int arr[32], i;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ switch (arr[j] % 5)
+ {
+ case 0: arr[j] += 1; break;
+ case 1: arr[j] += 2; break;
+ case 2: arr[j] += 3; break;
+ case 3: arr[j] += 4; break;
+ case 4: arr[j] += 5; break;
+ default: arr[j] += 99;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == i + (i % 5) + 1);
+}
+
+
+/* Test worker-single/vector-partitioned mode. */
+
+void t25()
+{
+ int arr[32 * 32], i;
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) \
+ num_gangs(8) num_workers(8) vector_length(32)
+ {
+ int j;
+ #pragma acc loop gang
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ {
+ #pragma acc atomic
+ arr[j * 32 + k]++;
+ }
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + 1);
+}
+
+
+/* Test worker-single, vector-partitioned, gang-redundant mode. */
+
+#define ACTUAL_GANGS 8
+void t27()
+{
+ int n, arr[32], i;
+ int ondev;
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 0;
+
+ n = 0;
+
+ #pragma acc parallel copy(n, arr) copyout(ondev) \
+ num_gangs(ACTUAL_GANGS) num_workers(8) vector_length(32)
+ {
+ int j;
+
+ ondev = acc_on_device (acc_device_not_host);
+
+ #pragma acc atomic
+ n++;
+
+ #pragma acc loop vector
+ for (j = 0; j < 32; j++)
+ {
+ #pragma acc atomic
+ arr[j] += 1;
+ }
+
+ #pragma acc atomic
+ n++;
+ }
+
+ int m = ondev ? ACTUAL_GANGS : 1;
+
+ assert (n == m * 2);
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == m);
+}
+#undef ACTUAL_GANGS
+
+
+/* Check if worker-single variables get broadcastd to vectors. */
+
+#pragma acc routine
+float t28_routine ()
+{
+ return 2.71;
+}
+
+#define N 32
+void t28()
+{
+ float threads[N], v1 = 3.14;
+
+ for (int i = 0; i < N; i++)
+ threads[i] = -1;
+
+#pragma acc parallel num_gangs (1) vector_length (32) copy (v1)
+ {
+ float val = t28_routine ();
+
+#pragma acc loop vector
+ for (int i = 0; i < N; i++)
+ threads[i] = val + v1*i;
+ }
+
+ for (int i = 0; i < N; i++)
+ assert (fabs (threads[i] - (t28_routine () + v1*i)) < 0.0001);
+}
+#undef N
+
+
+int main()
+{
+ t1();
+ t2();
+ t4();
+ t5();
+ t7();
+ t8();
+ t9();
+ t10();
+ t11();
+ t12();
+ t13();
+ t16();
+ t17();
+ t18();
+ t19();
+ t20();
+ t21();
+ t22();
+ t23();
+ t24();
+ t25();
+ t27();
+ t28();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/private-variables.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/private-variables.c
new file mode 100644
index 00000000000..53f03d17bb2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/private-variables.c
@@ -0,0 +1,953 @@
+#include <assert.h>
+#include <openacc.h>
+
+typedef struct {
+ int x, y;
+} vec2;
+
+typedef struct {
+ int x, y, z;
+ int attr[13];
+} vec3_attr;
+
+
+/* Test of gang-private variables declared in local scope with parallel
+ directive. */
+
+void local_g_1()
+{
+ int i, arr[32];
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 3;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ int x;
+
+ #pragma acc loop gang(static:1)
+ for (i = 0; i < 32; i++)
+ x = i * 2;
+
+ #pragma acc loop gang(static:1)
+ for (i = 0; i < 32; i++)
+ {
+ if (acc_on_device (acc_device_host))
+ x = i * 2;
+ arr[i] += x;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == 3 + i * 2);
+}
+
+
+/* Test of worker-private variables declared in a local scope, broadcasting
+ to vector-partitioned mode. Back-to-back worker loops. */
+
+void local_w_1()
+{
+ int i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ int x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ int x = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared in a local scope, broadcasting
+ to vector-partitioned mode. Successive vector loops. */
+
+void local_w_2()
+{
+ int i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ int x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+
+ x = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared in a local scope, broadcasting
+ to vector-partitioned mode. Aggregate worker variable. */
+
+void local_w_3()
+{
+ int i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ vec2 pt;
+
+ pt.x = i ^ j * 3;
+ pt.y = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt.x * k;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt.y * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared in a local scope, broadcasting
+ to vector-partitioned mode. Addressable worker variable. */
+
+void local_w_4()
+{
+ int i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ vec2 pt, *ptp;
+
+ ptp = &pt;
+
+ pt.x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += ptp->x * k;
+
+ ptp->y = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt.y * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared in a local scope, broadcasting
+ to vector-partitioned mode. Array worker variable. */
+
+void local_w_5()
+{
+ int i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ int pt[2];
+
+ pt[0] = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt[0] * k;
+
+ pt[1] = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt[1] * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of gang-private variables declared on loop directive. */
+
+void loop_g_1()
+{
+ int x = 5, i, arr[32];
+
+ for (i = 0; i < 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(x)
+ for (i = 0; i < 32; i++)
+ {
+ x = i * 2;
+ arr[i] += x;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == i * 3);
+}
+
+
+/* Test of gang-private variables declared on loop directive, with broadcasting
+ to partitioned workers. */
+
+void loop_g_2()
+{
+ int x = 5, i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(x)
+ for (i = 0; i < 32; i++)
+ {
+ x = i * 2;
+
+ #pragma acc loop worker
+ for (int j = 0; j < 32; j++)
+ arr[i * 32 + j] += x;
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (i / 32) * 2);
+}
+
+
+/* Test of gang-private variables declared on loop directive, with broadcasting
+ to partitioned vectors. */
+
+void loop_g_3()
+{
+ int x = 5, i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(x)
+ for (i = 0; i < 32; i++)
+ {
+ x = i * 2;
+
+ #pragma acc loop vector
+ for (int j = 0; j < 32; j++)
+ arr[i * 32 + j] += x;
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (i / 32) * 2);
+}
+
+
+/* Test of gang-private addressable variable declared on loop directive, with
+ broadcasting to partitioned workers. */
+
+void loop_g_4()
+{
+ int x = 5, i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(x)
+ for (i = 0; i < 32; i++)
+ {
+ int *p = &x;
+
+ x = i * 2;
+
+ #pragma acc loop worker
+ for (int j = 0; j < 32; j++)
+ arr[i * 32 + j] += x;
+
+ (*p)--;
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (i / 32) * 2);
+}
+
+
+/* Test of gang-private array variable declared on loop directive, with
+ broadcasting to partitioned workers. */
+
+void loop_g_5()
+{
+ int x[8], i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(x)
+ for (i = 0; i < 32; i++)
+ {
+ for (int j = 0; j < 8; j++)
+ x[j] = j * 2;
+
+ #pragma acc loop worker
+ for (int j = 0; j < 32; j++)
+ arr[i * 32 + j] += x[j % 8];
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (i % 8) * 2);
+}
+
+
+/* Test of gang-private aggregate variable declared on loop directive, with
+ broadcasting to partitioned workers. */
+
+void loop_g_6()
+{
+ int i, arr[32 * 32];
+ vec3_attr pt;
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang private(pt)
+ for (i = 0; i < 32; i++)
+ {
+ pt.x = i;
+ pt.y = i * 2;
+ pt.z = i * 4;
+ pt.attr[5] = i * 6;
+
+ #pragma acc loop worker
+ for (int j = 0; j < 32; j++)
+ arr[i * 32 + j] += pt.x + pt.y + pt.z + pt.attr[5];
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (i / 32) * 13);
+}
+
+
+/* Test of vector-private variables declared on loop directive. */
+
+void loop_v_1()
+{
+ int x, i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ #pragma acc loop vector private(x)
+ for (k = 0; k < 32; k++)
+ {
+ x = i ^ j * 3;
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+
+ #pragma acc loop vector private(x)
+ for (k = 0; k < 32; k++)
+ {
+ x = i | j * 5;
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of vector-private variables declared on loop directive. Array type. */
+
+void loop_v_2()
+{
+ int pt[2], i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ #pragma acc loop vector private(pt)
+ for (k = 0; k < 32; k++)
+ {
+ pt[0] = i ^ j * 3;
+ pt[1] = i | j * 5;
+ arr[i * 1024 + j * 32 + k] += pt[0] * k;
+ arr[i * 1024 + j * 32 + k] += pt[1] * k;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on a loop directive. */
+
+void loop_w_1()
+{
+ int x = 5, i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ x = i ^ j * 3;
+ /* Try to ensure 'x' accesses doesn't get optimized into a
+ temporary. */
+ __asm__ __volatile__ ("");
+ arr[i * 32 + j] += x;
+ }
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + ((i / 32) ^ (i % 32) * 3));
+}
+
+
+/* Test of worker-private variables declared on a loop directive, broadcasting
+ to vector-partitioned mode. */
+
+void loop_w_2()
+{
+ int x = 5, i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on a loop directive, broadcasting
+ to vector-partitioned mode. Back-to-back worker loops. */
+
+void loop_w_3()
+{
+ int x = 5, i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ x = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on a loop directive, broadcasting
+ to vector-partitioned mode. Successive vector loops. */
+
+void loop_w_4()
+{
+ int x = 5, i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+
+ x = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on a loop directive, broadcasting
+ to vector-partitioned mode. Addressable worker variable. */
+
+void loop_w_5()
+{
+ int x = 5, i, arr[32 * 32 * 32];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(x)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+ int *p = &x;
+
+ x = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+
+ *p = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += x * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on a loop directive, broadcasting
+ to vector-partitioned mode. Aggregate worker variable. */
+
+void loop_w_6()
+{
+ int i, arr[32 * 32 * 32];
+ vec2 pt;
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ #pragma acc loop worker private(pt)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ pt.x = i ^ j * 3;
+ pt.y = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt.x * k;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt.y * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of worker-private variables declared on loop directive, broadcasting
+ to vector-partitioned mode. Array worker variable. */
+
+void loop_w_7()
+{
+ int i, arr[32 * 32 * 32];
+ int pt[2];
+
+ for (i = 0; i < 32 * 32 * 32; i++)
+ arr[i] = i;
+
+ /* "pt" is treated as "present_or_copy" on the parallel directive because it
+ is an array variable. */
+ #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32)
+ {
+ int j;
+
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ /* But here, it is made private per-worker. */
+ #pragma acc loop worker private(pt)
+ for (j = 0; j < 32; j++)
+ {
+ int k;
+
+ pt[0] = i ^ j * 3;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt[0] * k;
+
+ pt[1] = i | j * 5;
+
+ #pragma acc loop vector
+ for (k = 0; k < 32; k++)
+ arr[i * 1024 + j * 32 + k] += pt[1] * k;
+ }
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ for (int j = 0; j < 32; j++)
+ for (int k = 0; k < 32; k++)
+ {
+ int idx = i * 1024 + j * 32 + k;
+ assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
+ }
+}
+
+
+/* Test of gang-private variables declared on the parallel directive. */
+
+void parallel_g_1()
+{
+ int x = 5, i, arr[32];
+
+ for (i = 0; i < 32; i++)
+ arr[i] = 3;
+
+ #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ {
+ #pragma acc loop gang(static:1)
+ for (i = 0; i < 32; i++)
+ x = i * 2;
+
+ #pragma acc loop gang(static:1)
+ for (i = 0; i < 32; i++)
+ {
+ if (acc_on_device (acc_device_host))
+ x = i * 2;
+ arr[i] += x;
+ }
+ }
+
+ for (i = 0; i < 32; i++)
+ assert (arr[i] == 3 + i * 2);
+}
+
+
+/* Test of gang-private array variable declared on the parallel directive. */
+
+void parallel_g_2()
+{
+ int x[32], i, arr[32 * 32];
+
+ for (i = 0; i < 32 * 32; i++)
+ arr[i] = i;
+
+ #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(2) vector_length(32)
+ {
+ #pragma acc loop gang
+ for (i = 0; i < 32; i++)
+ {
+ int j;
+ for (j = 0; j < 32; j++)
+ x[j] = j * 2;
+
+ #pragma acc loop worker
+ for (j = 0; j < 32; j++)
+ arr[i * 32 + j] += x[31 - j];
+ }
+ }
+
+ for (i = 0; i < 32 * 32; i++)
+ assert (arr[i] == i + (31 - (i % 32)) * 2);
+}
+
+
+int main ()
+{
+ local_g_1();
+ local_w_1();
+ local_w_2();
+ local_w_3();
+ local_w_4();
+ local_w_5();
+ loop_g_1();
+ loop_g_2();
+ loop_g_3();
+ loop_g_4();
+ loop_g_5();
+ loop_g_6();
+ loop_v_1();
+ loop_v_2();
+ loop_w_1();
+ loop_w_2();
+ loop_w_3();
+ loop_w_4();
+ loop_w_5();
+ loop_w_6();
+ loop_w_7();
+ parallel_g_1();
+ parallel_g_2();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c
new file mode 100644
index 00000000000..b23c75877f8
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c
@@ -0,0 +1,129 @@
+/* Tests of reduction on loop directive. */
+
+#include <assert.h>
+
+
+/* Test of reduction on loop directive (gangs, non-private reduction
+ variable). */
+
+void g_np_1()
+{
+ int i, arr[1024], res = 0, hres = 0;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ copy(res)
+ {
+ #pragma acc loop gang reduction(+:res)
+ for (i = 0; i < 1024; i++)
+ res += arr[i];
+ }
+
+ for (i = 0; i < 1024; i++)
+ hres += arr[i];
+
+ assert (res == hres);
+
+ res = hres = 1;
+
+ #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ copy(res)
+ {
+ #pragma acc loop gang reduction(*:res)
+ for (i = 0; i < 12; i++)
+ res *= arr[i];
+ }
+
+ for (i = 0; i < 12; i++)
+ hres *= arr[i];
+
+ assert (res == hres);
+}
+
+
+/* Test of reduction on loop directive (gangs and vectors, non-private
+ reduction variable). */
+
+void gv_np_1()
+{
+ int i, arr[1024], res = 0, hres = 0;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ copy(res)
+ {
+ #pragma acc loop gang vector reduction(+:res)
+ for (i = 0; i < 1024; i++)
+ res += arr[i];
+ }
+
+ for (i = 0; i < 1024; i++)
+ hres += arr[i];
+
+ assert (res == hres);
+}
+
+
+/* Test of reduction on loop directive (gangs and workers, non-private
+ reduction variable). */
+
+void gw_np_1()
+{
+ int i, arr[1024], res = 0, hres = 0;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ copy(res)
+ {
+ #pragma acc loop gang worker reduction(+:res)
+ for (i = 0; i < 1024; i++)
+ res += arr[i];
+ }
+
+ for (i = 0; i < 1024; i++)
+ hres += arr[i];
+
+ assert (res == hres);
+}
+
+
+/* Test of reduction on loop directive (gangs, workers and vectors, non-private
+ reduction variable). */
+
+void gwv_np_1()
+{
+ int i, arr[1024], res = 0, hres = 0;
+
+ for (i = 0; i < 1024; i++)
+ arr[i] = i;
+
+ #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
+ copy(res)
+ {
+ #pragma acc loop gang worker vector reduction(+:res)
+ for (i = 0; i < 1024; i++)
+ res += arr[i];
+ }
+
+ for (i = 0; i < 1024; i++)
+ hres += arr[i];
+
+ assert (res == hres);
+}
+
+
+int main()
+{
+ g_np_1();
+ gv_np_1();
+ gw_np_1();
+ gwv_np_1();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c
new file mode 100644
index 00000000000..f112457c168
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c
@@ -0,0 +1,88 @@
+// { dg-additional-options "-fno-exceptions" }
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#pragma acc routine
+int fact(int n)
+{
+ if (n == 0 || n == 1)
+ return 1;
+ else
+ return n * fact (n - 1);
+}
+
+int main()
+{
+ int *s, *g, *w, *v, *gw, *gv, *wv, *gwv, i, n = 10;
+
+ s = (int *) malloc (sizeof (int) * n);
+ g = (int *) malloc (sizeof (int) * n);
+ w = (int *) malloc (sizeof (int) * n);
+ v = (int *) malloc (sizeof (int) * n);
+ gw = (int *) malloc (sizeof (int) * n);
+ gv = (int *) malloc (sizeof (int) * n);
+ wv = (int *) malloc (sizeof (int) * n);
+ gwv = (int *) malloc (sizeof (int) * n);
+
+#pragma acc parallel loop async copyout(s[0:n]) seq
+ for (i = 0; i < n; i++)
+ s[i] = fact (i);
+
+#pragma acc parallel loop async copyout(g[0:n]) gang
+ for (i = 0; i < n; i++)
+ g[i] = fact (i);
+
+#pragma acc parallel loop async copyout(w[0:n]) worker
+ for (i = 0; i < n; i++)
+ w[i] = fact (i);
+
+#pragma acc parallel loop async copyout(v[0:n]) vector
+ for (i = 0; i < n; i++)
+ v[i] = fact (i);
+
+#pragma acc parallel loop async copyout(gw[0:n]) gang worker
+ for (i = 0; i < n; i++)
+ gw[i] = fact (i);
+
+#pragma acc parallel loop async copyout(gv[0:n]) gang vector
+ for (i = 0; i < n; i++)
+ gv[i] = fact (i);
+
+#pragma acc parallel loop async copyout(wv[0:n]) worker vector
+ for (i = 0; i < n; i++)
+ wv[i] = fact (i);
+
+#pragma acc parallel loop async copyout(gwv[0:n]) gang worker vector
+ for (i = 0; i < n; i++)
+ gwv[i] = fact (i);
+
+#pragma acc wait
+
+ for (i = 0; i < n; i++)
+ if (s[i] != fact (i))
+ abort ();
+ for (i = 0; i < n; i++)
+ if (g[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (w[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (v[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (gw[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (gv[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (wv[i] != s[i])
+ abort ();
+ for (i = 0; i < n; i++)
+ if (gwv[i] != s[i])
+ abort ();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-4.c
new file mode 100644
index 00000000000..d6ff44df5a1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-4.c
@@ -0,0 +1,123 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#define M 8
+#define N 32
+
+#pragma acc routine vector
+void
+vector (int *a)
+{
+ int i;
+
+#pragma acc loop vector
+ for (i = 0; i < N; i++)
+ a[i] -= a[i];
+}
+
+#pragma acc routine worker
+void
+worker (int *b)
+{
+ int i, j;
+
+#pragma acc loop worker
+ for (i = 0; i < N; i++)
+ {
+#pragma acc loop vector
+ for (j = 0; j < M; j++)
+ b[i * M + j] += b[i * M + j];
+ }
+}
+
+#pragma acc routine gang
+void
+gang (int *a)
+{
+ int i;
+
+#pragma acc loop gang worker vector
+ for (i = 0; i < N; i++)
+ a[i] -= i;
+}
+
+#pragma acc routine seq
+void
+seq (int *a)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ a[i] += 1;
+}
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ int a[N];
+ int b[M * N];
+
+ i = 0;
+
+ for (i = 0; i < N; i++)
+ a[i] = 0;
+
+#pragma acc parallel copy (a[0:N])
+ {
+#pragma acc loop seq
+ for (i = 0; i < N; i++)
+ seq (&a[0]);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != N)
+ abort ();
+ }
+
+#pragma acc parallel copy (a[0:N])
+ {
+#pragma acc loop seq
+ for (i = 0; i < N; i++)
+ gang (&a[0]);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != N + (N * (-1 * i)))
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+#pragma acc parallel copy (b[0:M*N])
+ {
+ worker (&b[0]);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != i)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+#pragma acc parallel copy (a[0:N])
+ {
+#pragma acc loop
+ for (i = 0; i < N; i++)
+ vector (&a[0]);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 0)
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c
index 201dc72694c..9d14c3bd313 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c
index 8fc4cb5f66c..ace2f499b1f 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c
index fefeb934308..2503e8d7d9d 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-v-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c
index 01d1dc8676a..80cd4620b09 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c
index bd9f1df5f42..5e45fad176f 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c
@@ -1,5 +1,6 @@
-/* { dg-do run } */
-/* { dg-additional-options "-O2" } */
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
#include <stdio.h>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c
new file mode 100644
index 00000000000..b5cbc9014d6
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c
@@ -0,0 +1,76 @@
+/* This code uses nvptx inline assembly guarded with acc_on_device, which is
+ not optimized away at -O0, and then confuses the target assembler.
+ { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+
+#include <stdio.h>
+#include <openacc.h>
+
+#define NUM_WORKERS 16
+#define NUM_VECTORS 32
+#define WIDTH 64
+#define HEIGHT 32
+
+#define WORK_ID(I,N) \
+ (acc_on_device (acc_device_nvidia) \
+ ? ({unsigned __r; \
+ __asm__ volatile ("mov.u32 %0,%%tid.y;" : "=r" (__r)); \
+ __r; }) : (I % N))
+#define VEC_ID(I,N) \
+ (acc_on_device (acc_device_nvidia) \
+ ? ({unsigned __r; \
+ __asm__ volatile ("mov.u32 %0,%%tid.x;" : "=r" (__r)); \
+ __r; }) : (I % N))
+
+#pragma acc routine worker
+void __attribute__ ((noinline))
+ WorkVec (int *ptr, int w, int h, int nw, int nv)
+{
+#pragma acc loop worker
+ for (int i = 0; i < h; i++)
+#pragma acc loop vector
+ for (int j = 0; j < w; j++)
+ ptr[i*w + j] = (WORK_ID (i, nw) << 8) | VEC_ID(j, nv);
+}
+
+int DoWorkVec (int nw)
+{
+ int ary[HEIGHT][WIDTH];
+ int err = 0;
+
+ for (int ix = 0; ix != HEIGHT; ix++)
+ for (int jx = 0; jx != WIDTH; jx++)
+ ary[ix][jx] = 0xdeadbeef;
+
+ printf ("spawning %d ...", nw); fflush (stdout);
+
+#pragma acc parallel num_workers(nw) vector_length (NUM_VECTORS) copy (ary)
+ {
+ WorkVec ((int *)ary, WIDTH, HEIGHT, nw, NUM_VECTORS);
+ }
+
+ for (int ix = 0; ix != HEIGHT; ix++)
+ for (int jx = 0; jx != WIDTH; jx++)
+ {
+ int exp = ((ix % nw) << 8) | (jx % NUM_VECTORS);
+
+ if (ary[ix][jx] != exp)
+ {
+ printf ("\nary[%d][%d] = %#x expected %#x", ix, jx,
+ ary[ix][jx], exp);
+ err = 1;
+ }
+ }
+ printf (err ? " failed\n" : " ok\n");
+
+ return err;
+}
+
+int main ()
+{
+ int err = 0;
+
+ for (int W = 1; W <= NUM_WORKERS; W <<= 1)
+ err |= DoWorkVec (W);
+
+ return err;
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1-2.c
deleted file mode 100644
index c7e7257a873..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1-2.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/* Copy of update-1.c with self exchanged with host for #pragma acc update. */
-
-/* { dg-do run } */
-/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
-
-#include <openacc.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-
-int
-main (int argc, char **argv)
-{
- int N = 8;
- float *a, *b, *c;
- float *d_a, *d_b, *d_c;
- int i;
-
- a = (float *) malloc (N * sizeof (float));
- b = (float *) malloc (N * sizeof (float));
- c = (float *) malloc (N * sizeof (float));
-
- d_a = (float *) acc_malloc (N * sizeof (float));
- d_b = (float *) acc_malloc (N * sizeof (float));
- d_c = (float *) acc_malloc (N * sizeof (float));
-
- for (i = 0; i < N; i++)
- {
- a[i] = 3.0;
- b[i] = 0.0;
- }
-
- acc_map_data (a, d_a, N * sizeof (float));
- acc_map_data (b, d_b, N * sizeof (float));
- acc_map_data (c, d_c, N * sizeof (float));
-
-#pragma acc update device (a[0:N], b[0:N])
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 3.0)
- abort ();
-
- if (b[i] != 3.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- for (i = 0; i < N; i++)
- {
- a[i] = 5.0;
- b[i] = 1.0;
- }
-
-#pragma acc update device (a[0:N], b[0:N])
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 5.0)
- abort ();
-
- if (b[i] != 5.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- for (i = 0; i < N; i++)
- {
- a[i] = 5.0;
- b[i] = 1.0;
- }
-
-#pragma acc update device (a[0:N], b[0:N])
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update host (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 5.0)
- abort ();
-
- if (b[i] != 5.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- for (i = 0; i < N; i++)
- {
- a[i] = 6.0;
- b[i] = 0.0;
- }
-
-#pragma acc update device (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- a[i] = 9.0;
- }
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 6.0)
- abort ();
-
- if (b[i] != 6.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- for (i = 0; i < N; i++)
- {
- a[i] = 7.0;
- b[i] = 2.0;
- }
-
-#pragma acc update device (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- a[i] = 9.0;
- }
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 7.0)
- abort ();
-
- if (b[i] != 7.0)
- abort ();
- }
-
- for (i = 0; i < N; i++)
- {
- a[i] = 9.0;
- }
-
-#pragma acc update device (a[0:N])
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != 9.0)
- abort ();
-
- if (b[i] != 9.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- for (i = 0; i < N; i++)
- {
- a[i] = 5.0;
- }
-
-#pragma acc update device (a[0:N])
-
- for (i = 0; i < N; i++)
- {
- a[i] = 6.0;
- }
-
-#pragma acc update device (a[0:N >> 1])
-
-#pragma acc parallel present (a[0:N], b[0:N])
- {
- int ii;
-
- for (ii = 0; ii < N; ii++)
- b[ii] = a[ii];
- }
-
-#pragma acc update self (a[0:N], b[0:N])
-
- for (i = 0; i < (N >> 1); i++)
- {
- if (a[i] != 6.0)
- abort ();
-
- if (b[i] != 6.0)
- abort ();
- }
-
- for (i = (N >> 1); i < N; i++)
- {
- if (a[i] != 5.0)
- abort ();
-
- if (b[i] != 5.0)
- abort ();
- }
-
- if (!acc_is_present (&a[0], (N * sizeof (float))))
- abort ();
-
- if (!acc_is_present (&b[0], (N * sizeof (float))))
- abort ();
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1.c
index dff139f03cc..1b2a46072d6 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/update-1.c
@@ -11,6 +11,7 @@ int
main (int argc, char **argv)
{
int N = 8;
+ int NDIV2 = N / 2;
float *a, *b, *c;
float *d_a, *d_b, *d_c;
int i;
@@ -109,7 +110,7 @@ main (int argc, char **argv)
b[ii] = a[ii];
}
-#pragma acc update self (a[0:N], b[0:N])
+#pragma acc update host (a[0:N], b[0:N])
for (i = 0; i < N; i++)
{
@@ -240,7 +241,7 @@ main (int argc, char **argv)
a[i] = 6.0;
}
-#pragma acc update device (a[0:N >> 1])
+#pragma acc update device (a[0:NDIV2])
#pragma acc parallel present (a[0:N], b[0:N])
{
@@ -252,7 +253,7 @@ main (int argc, char **argv)
#pragma acc update host (a[0:N], b[0:N])
- for (i = 0; i < (N >> 1); i++)
+ for (i = 0; i < NDIV2; i++)
{
if (a[i] != 6.0)
abort ();
@@ -261,7 +262,7 @@ main (int argc, char **argv)
abort ();
}
- for (i = (N >> 1); i < N; i++)
+ for (i = NDIV2; i < N; i++)
{
if (a[i] != 5.0)
abort ();
@@ -276,5 +277,83 @@ main (int argc, char **argv)
if (!acc_is_present (&b[0], (N * sizeof (float))))
abort ();
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 0.0;
+ }
+
+#pragma acc update device (a[0:4])
+
+#pragma acc parallel present (a[0:N])
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ a[ii] = a[ii] + 1.0;
+ }
+
+#pragma acc update host (a[4:4])
+
+ for (i = 0; i < NDIV2; i++)
+ {
+ if (a[i] != 0.0)
+ abort ();
+ }
+
+ for (i = NDIV2; i < N; i++)
+ {
+ if (a[i] != 6.0)
+ abort ();
+ }
+
+#pragma acc update host (a[0:4])
+
+ for (i = 0; i < NDIV2; i++)
+ {
+ if (a[i] != 1.0)
+ abort ();
+ }
+
+ for (i = NDIV2; i < N; i++)
+ {
+ if (a[i] != 6.0)
+ abort ();
+ }
+
+ a[2] = 9;
+ a[3] = 9;
+ a[4] = 9;
+ a[5] = 9;
+
+#pragma acc update device (a[2:4])
+
+#pragma acc parallel present (a[0:N])
+ {
+ int ii;
+
+ for (ii = 0; ii < N; ii++)
+ a[ii] = a[ii] + 1.0;
+ }
+
+#pragma acc update host (a[2:4])
+
+ for (i = 0; i < 2; i++)
+ {
+ if (a[i] != 1.0)
+ abort ();
+ }
+
+ for (i = 2; i < 6; i++)
+ {
+ if (a[i] != 10.0)
+ abort ();
+ }
+
+ for (i = 6; i < N; i++)
+ {
+ if (a[i] != 6.0)
+ abort ();
+ }
+
return 0;
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
index 8a51ee36618..807347f6888 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
@@ -20,7 +20,7 @@ main (void)
#pragma acc parallel vector_length (32) copyin (a,b) copyout (c)
{
-#pragma acc loop /* vector clause is missing, since it's not yet supported. */
+#pragma acc loop vector
for (unsigned int i = 0; i < n; i++)
c[i] = a[i] + b[i];
}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c
deleted file mode 100644
index 99c6dfbf8a3..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <assert.h>
-
-/* Test worker-single/vector-single mode. */
-
-int
-main (int argc, char *argv[])
-{
- int arr[32], i;
-
- for (i = 0; i < 32; i++)
- arr[i] = 0;
-
- #pragma acc parallel copy(arr) num_gangs(8) num_workers(8) vector_length(32)
- {
- int j;
- #pragma acc loop gang
- for (j = 0; j < 32; j++)
- {
- #pragma acc atomic
- arr[j]++;
- }
- }
-
- for (i = 0; i < 32; i++)
- assert (arr[i] == 1);
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-4.c
deleted file mode 100644
index 84080d0a8e5..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-4.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <assert.h>
-
-/* Test worker-single/vector-partitioned mode. */
-
-int
-main (int argc, char *argv[])
-{
- int arr[32], i;
-
- for (i = 0; i < 32; i++)
- arr[i] = i;
-
- #pragma acc parallel copy(arr) num_gangs(1) num_workers(8) vector_length(32)
- {
- int k;
- #pragma acc loop vector
- for (k = 0; k < 32; k++)
- {
- #pragma acc atomic
- arr[k]++;
- }
- }
-
- for (i = 0; i < 32; i++)
- assert (arr[i] == i + 1);
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-6.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-6.c
deleted file mode 100644
index cbc3e37a3a0..00000000000
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/worker-single-6.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <assert.h>
-
-#if defined(ACC_DEVICE_TYPE_host)
-#define ACTUAL_GANGS 1
-#else
-#define ACTUAL_GANGS 8
-#endif
-
-/* Test worker-single, vector-partitioned, gang-redundant mode. */
-
-int
-main (int argc, char *argv[])
-{
- int n, arr[32], i;
-
- for (i = 0; i < 32; i++)
- arr[i] = 0;
-
- n = 0;
-
- #pragma acc parallel copy(n, arr) num_gangs(ACTUAL_GANGS) num_workers(8) \
- vector_length(32)
- {
- int j;
-
- #pragma acc atomic
- n++;
-
- #pragma acc loop vector
- for (j = 0; j < 32; j++)
- {
- #pragma acc atomic
- arr[j] += 1;
- }
-
- #pragma acc atomic
- n++;
- }
-
- assert (n == ACTUAL_GANGS * 2);
-
- for (i = 0; i < 32; i++)
- assert (arr[i] == ACTUAL_GANGS);
-
- return 0;
-}
diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp
index 5020e6a0691..b509a109815 100644
--- a/libgomp/testsuite/libgomp.oacc-c/c.exp
+++ b/libgomp/testsuite/libgomp.oacc-c/c.exp
@@ -13,14 +13,11 @@ if [info exists lang_include_flags] then {
load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp
-
-# If a testcase doesn't have special options, use these.
-if ![info exists DEFAULT_CFLAGS] then {
- set DEFAULT_CFLAGS "-O2"
-}
+load_gcc_lib torture-options.exp
# Initialize dg.
dg-init
+torture-init
# Turn on OpenACC.
lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
@@ -67,8 +64,28 @@ foreach offload_target_openacc $offload_targets_s_openacc {
setenv ACC_DEVICE_TYPE $offload_target_openacc
- dg-runtest $tests "$tagopt" $DEFAULT_CFLAGS
+ # To get better test coverage for device-specific code that is only
+ # ever used in offloading configurations, we'd like more thorough
+ # testing for test cases that deal with offloading, which most of all
+ # OpenACC test cases are. We enable torture testing, but limit it to
+ # -O0 and -O2 only, to avoid testing times exploding too much, under
+ # the assumption that between -O0 and -O[something] there is the
+ # biggest difference in the overall structure of the generated code.
+ switch $offload_target_openacc {
+ host {
+ set-torture-options [list \
+ { -O2 } ]
+ }
+ default {
+ set-torture-options [list \
+ { -O0 } \
+ { -O2 } ]
+ }
+ }
+
+ gcc-dg-runtest $tests "$tagopt" ""
}
# All done.
+torture-finish
dg-finish
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-1.f90
index b6e637ba43f..01728bd3f6c 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-1.f90
@@ -132,4 +132,126 @@ program asyncwait
if (d(i) .ne. 1.0) call abort
if (e(i) .ne. 11.0) call abort
end do
+
+ a(:) = 3.0
+ b(:) = 0.0
+
+ !$acc data copy (a(1:N)) copy (b(1:N))
+
+ !$acc kernels async
+ !$acc loop
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end kernels
+
+ !$acc wait
+ !$acc end data
+
+ do i = 1, N
+ if (a(i) .ne. 3.0) call abort
+ if (b(i) .ne. 3.0) call abort
+ end do
+
+ a(:) = 2.0
+ b(:) = 0.0
+
+ !$acc data copy (a(1:N)) copy (b(1:N))
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end kernels
+
+ !$acc wait (1)
+ !$acc end data
+
+ do i = 1, N
+ if (a(i) .ne. 2.0) call abort
+ if (b(i) .ne. 2.0) call abort
+ end do
+
+ a(:) = 3.0
+ b(:) = 0.0
+ c(:) = 0.0
+ d(:) = 0.0
+
+ !$acc data copy (a(1:N)) copy (b(1:N)) copy (c(1:N)) copy (d(1:N))
+
+ !$acc kernels async (1)
+ do i = 1, N
+ b(i) = (a(i) * a(i) * a(i)) / a(i)
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ do i = 1, N
+ c(i) = (a(i) * 4) / a(i)
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ d(i) = ((a(i) * a(i) + a(i)) / a(i)) - a(i)
+ end do
+ !$acc end kernels
+
+ !$acc wait (1)
+ !$acc end data
+
+ do i = 1, N
+ if (a(i) .ne. 3.0) call abort
+ if (b(i) .ne. 9.0) call abort
+ if (c(i) .ne. 4.0) call abort
+ if (d(i) .ne. 1.0) call abort
+ end do
+
+ a(:) = 2.0
+ b(:) = 0.0
+ c(:) = 0.0
+ d(:) = 0.0
+ e(:) = 0.0
+
+ !$acc data copy (a(1:N), b(1:N), c(1:N), d(1:N), e(1:N))
+
+ !$acc kernels async (1)
+ do i = 1, N
+ b(i) = (a(i) * a(i) * a(i)) / a(i)
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ c(i) = (a(i) * 4) / a(i)
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ d(i) = ((a(i) * a(i) + a(i)) / a(i)) - a(i)
+ end do
+ !$acc end kernels
+
+ !$acc kernels wait (1) async (1)
+ !$acc loop
+ do i = 1, N
+ e(i) = a(i) + b(i) + c(i) + d(i)
+ end do
+ !$acc end kernels
+
+ !$acc wait (1)
+ !$acc end data
+
+ do i = 1, N
+ if (a(i) .ne. 2.0) call abort
+ if (b(i) .ne. 4.0) call abort
+ if (c(i) .ne. 4.0) call abort
+ if (d(i) .ne. 1.0) call abort
+ if (e(i) .ne. 11.0) call abort
+ end do
end program asyncwait
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-2.f90
index bade52bdd7d..fe131b62716 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-2.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-2.f90
@@ -1,6 +1,6 @@
! { dg-do run }
-program parallel_wait
+program asyncwait
integer, parameter :: N = 64
real, allocatable :: a(:), b(:), c(:)
integer i
@@ -33,8 +33,33 @@ program parallel_wait
do i = 1, N
if (c(i) .ne. 2.0) call abort
end do
+
+ !$acc kernels async (0)
+ !$acc loop
+ do i = 1, N
+ a(i) = 1
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ b(i) = 1
+ end do
+ !$acc end kernels
+
+ !$acc kernels wait (0, 1)
+ !$acc loop
+ do i = 1, N
+ c(i) = a(i) + b(i)
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (c(i) .ne. 2.0) call abort
+ end do
deallocate (a)
deallocate (b)
deallocate (c)
-end program parallel_wait
+end program asyncwait
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-3.f90 b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-3.f90
index d48dc11bfd6..fa96a015ce1 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-3.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/asyncwait-3.f90
@@ -1,6 +1,6 @@
! { dg-do run }
-program parallel_wait
+program asyncwait
integer, parameter :: N = 64
real, allocatable :: a(:), b(:), c(:)
integer i
@@ -35,8 +35,35 @@ program parallel_wait
do i = 1, N
if (c(i) .ne. 2.0) call abort
end do
+
+ !$acc kernels async (0)
+ !$acc loop
+ do i = 1, N
+ a(i) = 1
+ end do
+ !$acc end kernels
+
+ !$acc kernels async (1)
+ !$acc loop
+ do i = 1, N
+ b(i) = 1
+ end do
+ !$acc end kernels
+
+ !$acc wait (0, 1)
+
+ !$acc kernels
+ !$acc loop
+ do i = 1, N
+ c(i) = a(i) + b(i)
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (c(i) .ne. 2.0) call abort
+ end do
deallocate (a)
deallocate (b)
deallocate (c)
-end program parallel_wait
+end program asyncwait
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/clauses-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/clauses-1.f90
new file mode 100644
index 00000000000..e6ab78dc047
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/clauses-1.f90
@@ -0,0 +1,290 @@
+! { dg-do run }
+! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
+
+program main
+ use openacc
+ implicit none
+
+ integer, parameter :: N = 32
+ real, allocatable :: a(:), b(:), c(:)
+ integer i
+
+ i = 0
+
+ allocate (a(N))
+ allocate (b(N))
+ allocate (c(N))
+
+ a(:) = 3.0
+ b(:) = 0.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 3.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 5.0
+ b(:) = 1.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 5.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 6.0
+ b(:) = 0.0
+
+ call acc_copyin (a, sizeof (a))
+
+ a(:) = 9.0
+
+ !$acc parallel present_or_copyin (a(1:N)) copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ call acc_copyout (a, sizeof (a))
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 6.0
+ b(:) = 0.0
+
+ !$acc parallel copyin (a(1:N)) present_or_copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 5.0
+ b(:) = 2.0
+
+ call acc_copyin (b, sizeof (b))
+
+ !$acc parallel copyin (a(1:N)) present_or_copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 2.0) call abort
+ end do
+
+ call acc_copyout (b, sizeof (b))
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 3.0;
+ b(:) = 4.0;
+
+ !$acc parallel copy (a(1:N)) copyout (b(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ b(i) = a(i) + 2
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 4.0) call abort
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 4.0
+ b(:) = 7.0
+
+ !$acc parallel present_or_copy (a(1:N)) present_or_copy (b(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ b(i) = b(i) + 2
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 9.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 3.0
+ b(:) = 7.0
+
+ call acc_copyin (a, sizeof (a))
+ call acc_copyin (b, sizeof (b))
+
+ !$acc parallel present_or_copy (a(1:N)) present_or_copy (b(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ b(i) = b(i) + 2
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 3.0) call abort
+ if (b(i) .ne. 7.0) call abort
+ end do
+
+ call acc_copyout (a, sizeof (a))
+ call acc_copyout (b, sizeof (b))
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 3.0
+ b(:) = 7.0
+
+ !$acc parallel copyin (a(1:N)) create (c(1:N)) copyout (b(1:N))
+ do i = 1, N
+ c(i) = a(i)
+ b(i) = c(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 3.0) call abort
+ if (b(i) .ne. 3.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+ if (acc_is_present (c) .eqv. .TRUE.) call abort
+
+ a(:) = 4.0
+ b(:) = 8.0
+
+ !$acc parallel copyin (a(1:N)) present_or_create (c(1:N)) copyout (b(1:N))
+ do i = 1, N
+ c(i) = a(i)
+ b(i) = c(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 4.0) call abort
+ if (b(i) .ne. 4.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+ if (acc_is_present (c) .eqv. .TRUE.) call abort
+
+ a(:) = 4.0
+
+ call acc_copyin (a, sizeof (a))
+ call acc_copyin (b, sizeof (b))
+ call acc_copyin (c, sizeof (c))
+
+ !$acc parallel present (a(1:N)) present (c(1:N)) present (b(1:N))
+ do i = 1, N
+ c(i) = a(i)
+ b(i) = c(i)
+ end do
+ !$acc end parallel
+
+ call acc_copyout (a, sizeof (a))
+ call acc_copyout (b, sizeof (b))
+ call acc_copyout (c, sizeof (c))
+
+ do i = 1, N
+ if (a(i) .ne. 4.0) call abort
+ if (b(i) .ne. 4.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+ if (acc_is_present (c) .eqv. .TRUE.) call abort
+
+ a(:) = 6.0
+ b(:) = 0.0
+
+ call acc_copyin (a, sizeof (a))
+
+ a(:) = 9.0
+
+ !$acc parallel pcopyin (a(1:N)) copyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ call acc_copyout (a, sizeof (a))
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 6.0
+ b(:) = 0.0
+
+ !$acc parallel copyin (a(1:N)) pcopyout (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+
+ a(:) = 5.0
+ b(:) = 7.0
+
+ !$acc parallel copyin (a(1:N)) pcreate (c(1:N)) copyout (b(1:N))
+ do i = 1, N
+ c(i) = a(i)
+ b(i) = c(i)
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 5.0) call abort
+ end do
+
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+ if (acc_is_present (c) .eqv. .TRUE.) call abort
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/declare-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/declare-1.f90
index f717d1b7626..2d4b70720e3 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/declare-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/declare-1.f90
@@ -1,29 +1,22 @@
! { dg-do run { target openacc_nvidia_accel_selected } }
+! Tests to exercise the declare directive along with
+! the clauses: copy
+! copyin
+! copyout
+! create
+! present
+! present_or_copy
+! present_or_copyin
+! present_or_copyout
+! present_or_create
+
module vars
implicit none
integer z
!$acc declare create (z)
end module vars
-subroutine subr6 (a, d)
- implicit none
- integer, parameter :: N = 8
- integer :: i
- integer :: a(N)
- !$acc declare deviceptr (a)
- integer :: d(N)
-
- i = 0
-
- !$acc parallel copy (d)
- do i = 1, N
- d(i) = a(i) + a(i)
- end do
- !$acc end parallel
-
-end subroutine
-
subroutine subr5 (a, b, c, d)
implicit none
integer, parameter :: N = 8
@@ -201,15 +194,6 @@ subroutine subr0 (a, b, c, d)
if (d(i) .ne. 13) call abort
end do
- call subr6 (a, d)
-
- call test (a, .true.)
- call test (d, .false.)
-
- do i = 1, N
- if (d(i) .ne. 16) call abort
- end do
-
end subroutine
program main
@@ -241,8 +225,7 @@ program main
if (a(i) .ne. 8) call abort
if (b(i) .ne. 8) call abort
if (c(i) .ne. 8) call abort
- if (d(i) .ne. 16) call abort
+ if (d(i) .ne. 13) call abort
end do
-
end program
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/default-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/default-1.f90
new file mode 100644
index 00000000000..10590892458
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/default-1.f90
@@ -0,0 +1,54 @@
+! { dg-do run }
+
+program main
+ implicit none
+ real a, b
+ real c
+ !$acc declare create (c)
+
+ a = 2.0
+ b = 0.0
+
+ !$acc parallel copy (a) create (b) default (none)
+ b = a
+ a = 1.0
+ a = a + b
+ !$acc end parallel
+
+ if (a .ne. 3.0) call abort
+
+ !$acc kernels copy (a) create (b) default (none)
+ b = a
+ a = 1.0
+ a = a + b
+ !$acc end kernels
+
+ if (a .ne. 4.0) call abort
+
+ !$acc parallel default (none) copy (a) create (b)
+ b = a
+ a = 1.0
+ a = a + b
+ !$acc end parallel
+
+ if (a .ne. 5.0) call abort
+
+ !$acc parallel default (none) copy (a)
+ c = a
+ a = 1.0
+ a = a + c
+ !$acc end parallel
+
+ if (a .ne. 6.0) call abort
+
+ !$acc data copy (a)
+ !$acc parallel default (none)
+ c = a
+ a = 1.0
+ a = a + c
+ !$acc end parallel
+ !$acc end data
+
+ if (a .ne. 7.0) call abort
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-1.f90
new file mode 100644
index 00000000000..d3f909361fb
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/firstprivate-1.f90
@@ -0,0 +1,42 @@
+! { dg-do run }
+
+program firstprivate
+ integer, parameter :: Nupper=100
+ integer :: a, b(Nupper), c, d, n
+ include "openacc_lib.h"
+
+ if (acc_get_device_type () .eq. acc_device_nvidia) then
+ n = Nupper
+ else
+ n = 1
+ end if
+
+ b(:) = -1
+ a = 5
+
+ !$acc parallel firstprivate (a) num_gangs (n)
+ !$acc loop gang
+ do i = 1, n
+ a = a + i
+ b(i) = a
+ end do
+ !$acc end parallel
+
+ do i = 1, n
+ if (b(i) .ne. i + a) call abort ()
+ end do
+
+ !$acc data copy (a)
+ !$acc parallel firstprivate (a) copyout (c)
+ a = 10
+ c = a
+ !$acc end parallel
+
+ !$acc parallel copyout (d) present (a)
+ d = a
+ !$acc end parallel
+ !$acc end data
+
+ if (c .ne. 10) call abort ()
+ if (d .ne. 5) call abort ()
+end program firstprivate
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/gang-static-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/gang-static-1.f90
new file mode 100644
index 00000000000..7d56060ad49
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/gang-static-1.f90
@@ -0,0 +1,79 @@
+! { dg-do run }
+
+program main
+ integer, parameter :: n = 100
+ integer i, a(n), b(n)
+ integer x
+
+ do i = 1, n
+ b(i) = i
+ end do
+
+ !$acc parallel loop gang (static:*) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 0
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 0, n)
+
+ !$acc parallel loop gang (static:1) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 1
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 1, n)
+
+ !$acc parallel loop gang (static:2) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 2
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 2, n)
+
+ !$acc parallel loop gang (static:5) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 5
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 5, n)
+
+ !$acc parallel loop gang (static:20) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 20
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 20, n)
+
+ x = 5
+ !$acc parallel loop gang (static:0+x) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 5
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 5, n)
+
+ x = 10
+ !$acc parallel loop gang (static:x) num_gangs (10)
+ do i = 1, n
+ a(i) = b(i) + 10
+ end do
+ !$acc end parallel loop
+
+ call test (a, b, 10, n)
+end program main
+
+subroutine test (a, b, sarg, n)
+ integer n
+ integer a (n), b(n), sarg
+ integer i
+
+ do i = 1, n
+ if (a(i) .ne. b(i) + sarg) call abort ()
+ end do
+end subroutine test
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/if-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/if-1.f90
new file mode 100644
index 00000000000..44055e177f8
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/if-1.f90
@@ -0,0 +1,886 @@
+! { dg-do run }
+! { dg-additional-options "-cpp" }
+
+program main
+ use openacc
+ implicit none
+
+ integer, parameter :: N = 8
+ integer, parameter :: one = 1
+ integer, parameter :: zero = 0
+ integer i, nn
+ real, allocatable :: a(:), b(:)
+ real exp, exp2
+
+ i = 0
+
+ allocate (a(N))
+ allocate (b(N))
+
+ a(:) = 4.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 5.0
+#else
+ exp = 4.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 16.0
+
+ !$acc parallel if (0 == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 17.0) call abort
+ end do
+
+ a(:) = 8.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 9.0
+#else
+ exp = 8.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 22.0
+
+ !$acc parallel if (zero == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 23.0) call abort
+ end do
+
+ a(:) = 16.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 17.0;
+#else
+ exp = 16.0;
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 76.0
+
+ !$acc parallel if (.FALSE.)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 77.0) call abort
+ end do
+
+ a(:) = 22.0
+
+ nn = 1
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (nn == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 23.0;
+#else
+ exp = 22.0;
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 18.0
+
+ nn = 0
+
+ !$acc parallel if (nn == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 19.0) call abort
+ end do
+
+ a(:) = 49.0
+
+ nn = 1
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 50.0
+#else
+ exp = 49.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 38.0
+
+ nn = 0;
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 39.0) call abort
+ end do
+
+ a(:) = 91.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 92.0) call abort
+ end do
+
+ a(:) = 43.0
+
+ !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+#if ACC_MEM_SHARED
+ exp = 44.0
+#else
+ exp = 43.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 87.0
+
+ !$acc parallel if (one == 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end parallel
+
+ do i = 1, N
+ if (b(i) .ne. 88.0) call abort
+ end do
+
+ a(:) = 3.0
+ b(:) = 9.0
+
+#if ACC_MEM_SHARED
+ exp = 0.0
+ exp2 = 0.0
+#else
+ call acc_copyin (a, sizeof (a))
+ call acc_copyin (b, sizeof (b))
+ exp = 3.0;
+ exp2 = 9.0;
+#endif
+
+ !$acc update device (a(1:N), b(1:N)) if (1 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (1 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. exp) call abort
+ if (b(i) .ne. exp2) call abort
+ end do
+
+ a(:) = 6.0
+ b(:) = 12.0
+
+ !$acc update device (a(1:N), b(1:N)) if (0 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (1 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. exp) call abort
+ if (b(i) .ne. exp2) call abort
+ end do
+
+ a(:) = 26.0
+ b(:) = 21.0
+
+ !$acc update device (a(1:N), b(1:N)) if (1 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (0 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. 0.0) call abort
+ if (b(i) .ne. 0.0) call abort
+ end do
+
+#if !ACC_MEM_SHARED
+ call acc_copyout (a, sizeof (a))
+ call acc_copyout (b, sizeof (b))
+#endif
+
+ a(:) = 4.0
+ b(:) = 0.0
+
+ !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
+
+ !$acc parallel present (a(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+ !$acc end data
+
+ do i = 1, N
+ if (b(i) .ne. 4.0) call abort
+ end do
+
+ a(:) = 8.0
+ b(:) = 1.0
+
+ !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc end data
+
+ a(:) = 18.0
+ b(:) = 21.0
+
+ !$acc data copyin (a(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (a) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc data copyout (b(1:N)) if (0 == 1)
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+ !$acc data copyout (b(1:N)) if (1 == 1)
+
+ !$acc parallel present (a(1:N)) present (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc end data
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+ !$acc end data
+ !$acc end data
+
+ do i = 1, N
+ if (b(1) .ne. 18.0) call abort
+ end do
+
+ !$acc enter data copyin (b(1:N)) if (0 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (0 == 1)
+
+ !$acc enter data copyin (b(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc enter data copyin (b(1:N)) if (zero == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (zero == 1)
+
+ !$acc enter data copyin (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc enter data copyin (b(1:N)) if (one == 0)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 0)
+
+ !$acc enter data copyin (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ a(:) = 4.0
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 5.0
+#else
+ exp = 4.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 16.0
+
+ !$acc kernels if (0 == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 17.0) call abort
+ end do
+
+ a(:) = 8.0
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 9.0
+#else
+ exp = 8.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 22.0
+
+ !$acc kernels if (zero == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 23.0) call abort
+ end do
+
+ a(:) = 16.0
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 17.0;
+#else
+ exp = 16.0;
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 76.0
+
+ !$acc kernels if (.FALSE.)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 77.0) call abort
+ end do
+
+ a(:) = 22.0
+
+ nn = 1
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (nn == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 23.0;
+#else
+ exp = 22.0;
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 18.0
+
+ nn = 0
+
+ !$acc kernels if (nn == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 19.0) call abort
+ end do
+
+ a(:) = 49.0
+
+ nn = 1
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 50.0
+#else
+ exp = 49.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 38.0
+
+ nn = 0;
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 39.0) call abort
+ end do
+
+ a(:) = 91.0
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 92.0) call abort
+ end do
+
+ a(:) = 43.0
+
+ !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+#if ACC_MEM_SHARED
+ exp = 44.0
+#else
+ exp = 43.0
+#endif
+
+ do i = 1, N
+ if (b(i) .ne. exp) call abort
+ end do
+
+ a(:) = 87.0
+
+ !$acc kernels if (one == 0)
+ do i = 1, N
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) then
+ b(i) = a(i) + 1
+ else
+ b(i) = a(i)
+ end if
+ end do
+ !$acc end kernels
+
+ do i = 1, N
+ if (b(i) .ne. 88.0) call abort
+ end do
+
+ a(:) = 3.0
+ b(:) = 9.0
+
+#if ACC_MEM_SHARED
+ exp = 0.0
+ exp2 = 0.0
+#else
+ call acc_copyin (a, sizeof (a))
+ call acc_copyin (b, sizeof (b))
+ exp = 3.0;
+ exp2 = 9.0;
+#endif
+
+ !$acc update device (a(1:N), b(1:N)) if (1 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (1 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. exp) call abort
+ if (b(i) .ne. exp2) call abort
+ end do
+
+ a(:) = 6.0
+ b(:) = 12.0
+
+ !$acc update device (a(1:N), b(1:N)) if (0 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (1 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. exp) call abort
+ if (b(i) .ne. exp2) call abort
+ end do
+
+ a(:) = 26.0
+ b(:) = 21.0
+
+ !$acc update device (a(1:N), b(1:N)) if (1 == 1)
+
+ a(:) = 0.0
+ b(:) = 0.0
+
+ !$acc update host (a(1:N), b(1:N)) if (0 == 1)
+
+ do i = 1, N
+ if (a(i) .ne. 0.0) call abort
+ if (b(i) .ne. 0.0) call abort
+ end do
+
+#if !ACC_MEM_SHARED
+ call acc_copyout (a, sizeof (a))
+ call acc_copyout (b, sizeof (b))
+#endif
+
+ a(:) = 4.0
+ b(:) = 0.0
+
+ !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
+
+ !$acc kernels present (a(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end kernels
+ !$acc end data
+
+ do i = 1, N
+ if (b(i) .ne. 4.0) call abort
+ end do
+
+ a(:) = 8.0
+ b(:) = 1.0
+
+ !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (a) .eqv. .TRUE.) call abort
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc end data
+
+ a(:) = 18.0
+ b(:) = 21.0
+
+ !$acc data copyin (a(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (a) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc data copyout (b(1:N)) if (0 == 1)
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+ !$acc data copyout (b(1:N)) if (1 == 1)
+
+ !$acc kernels present (a(1:N)) present (b(1:N))
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end kernels
+
+ !$acc end data
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+ !$acc end data
+ !$acc end data
+
+ do i = 1, N
+ if (b(1) .ne. 18.0) call abort
+ end do
+
+ !$acc enter data copyin (b(1:N)) if (0 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (0 == 1)
+
+ !$acc enter data copyin (b(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (1 == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc enter data copyin (b(1:N)) if (zero == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (zero == 1)
+
+ !$acc enter data copyin (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc enter data copyin (b(1:N)) if (one == 0)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 0)
+
+ !$acc enter data copyin (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .FALSE.) call abort
+#endif
+
+ !$acc exit data delete (b(1:N)) if (one == 1)
+
+#if !ACC_MEM_SHARED
+ if (acc_is_present (b) .eqv. .TRUE.) call abort
+#endif
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90 b/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90
new file mode 100644
index 00000000000..a5f3840f63c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90
@@ -0,0 +1,42 @@
+! This test checks if the runtime can properly handle implicit
+! firstprivate varaibles inside subroutines in modules.
+
+! { dg-do run }
+
+module test_mod
+ contains
+ subroutine test(x)
+
+ IMPLICIT NONE
+
+ INTEGER :: x, y, j
+
+ x = 5
+
+ !$ACC PARALLEL LOOP copyout (y)
+ DO j=1,10
+ y=x
+ ENDDO
+ !$ACC END PARALLEL LOOP
+
+ y = -1;
+
+ !$ACC PARALLEL LOOP firstprivate (y) copyout (x)
+ DO j=1,10
+ x=y
+ ENDDO
+ !$ACC END PARALLEL LOOP
+ end subroutine test
+end module test_mod
+
+program t
+ use test_mod
+
+ INTEGER :: x_min
+
+ x_min = 8
+
+ CALL test(x_min)
+
+ if (x_min .ne. -1) call abort
+end program t
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
index 1fb40eee722..163e8d5359b 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95
index 7b52253e6dc..4c73606571f 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
index af98efaa702..da11aafac2c 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
index bb6f8dca7fc..f4b4eb3a014 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
index cab1f2c674c..d2083e2be7b 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95
index f26671ddb4d..a908f544206 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
index b02dd57396d..6fb5ba3ae69 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
@@ -1,5 +1,4 @@
! { dg-do run }
-! { dg-options "-ftree-parallelize-loops=32" }
program main
implicit none
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/pr68813.f90 b/libgomp/testsuite/libgomp.oacc-fortran/pr68813.f90
new file mode 100644
index 00000000000..735350f6aac
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/pr68813.f90
@@ -0,0 +1,19 @@
+program foo
+ implicit none
+ integer, parameter :: n = 100
+ integer, dimension(n,n) :: a
+ integer :: i, j, sum = 0
+
+ a = 1
+
+ !$acc parallel copyin(a(1:n,1:n)) firstprivate (sum)
+ !$acc loop gang reduction(+:sum)
+ do i=1, n
+ !$acc loop vector reduction(+:sum)
+ do j=1, n
+ sum = sum + a(i, j)
+ enddo
+ enddo
+ !$acc end parallel
+
+end program foo
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/private-variables.f90 b/libgomp/testsuite/libgomp.oacc-fortran/private-variables.f90
new file mode 100644
index 00000000000..3c1940b5d85
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/private-variables.f90
@@ -0,0 +1,544 @@
+! Miscellaneous tests for private variables.
+
+! { dg-do run }
+
+
+! Test of gang-private variables declared on loop directive.
+
+subroutine t1()
+ integer :: x, i, arr(32)
+
+ do i = 1, 32
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang private(x)
+ do i = 1, 32
+ x = i * 2;
+ arr(i) = arr(i) + x
+ end do
+ !$acc end parallel
+
+ do i = 1, 32
+ if (arr(i) .ne. i * 3) call abort
+ end do
+end subroutine t1
+
+
+! Test of gang-private variables declared on loop directive, with broadcasting
+! to partitioned workers.
+
+subroutine t2()
+ integer :: x, i, j, arr(0:32*32)
+
+ do i = 0, 32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang private(x)
+ do i = 0, 31
+ x = i * 2;
+
+ !$acc loop worker
+ do j = 0, 31
+ arr(i * 32 + j) = arr(i * 32 + j) + x
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 * 32 - 1
+ if (arr(i) .ne. i + (i / 32) * 2) call abort
+ end do
+end subroutine t2
+
+
+! Test of gang-private variables declared on loop directive, with broadcasting
+! to partitioned vectors.
+
+subroutine t3()
+ integer :: x, i, j, arr(0:32*32)
+
+ do i = 0, 32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang private(x)
+ do i = 0, 31
+ x = i * 2;
+
+ !$acc loop vector
+ do j = 0, 31
+ arr(i * 32 + j) = arr(i * 32 + j) + x
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 * 32 - 1
+ if (arr(i) .ne. i + (i / 32) * 2) call abort
+ end do
+end subroutine t3
+
+
+! Test of gang-private addressable variable declared on loop directive, with
+! broadcasting to partitioned workers.
+
+subroutine t4()
+ type vec3
+ integer x, y, z, attr(13)
+ end type vec3
+
+ integer i, j, arr(0:32*32)
+ type(vec3) pt
+
+ do i = 0, 32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang private(pt)
+ do i = 0, 31
+ pt%x = i
+ pt%y = i * 2
+ pt%z = i * 4
+ pt%attr(5) = i * 6
+
+ !$acc loop vector
+ do j = 0, 31
+ arr(i * 32 + j) = arr(i * 32 + j) + pt%x + pt%y + pt%z + pt%attr(5);
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 * 32 - 1
+ if (arr(i) .ne. i + (i / 32) * 13) call abort
+ end do
+end subroutine t4
+
+
+! Test of vector-private variables declared on loop directive.
+
+subroutine t5()
+ integer :: x, i, j, k, idx, arr(0:32*32*32)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker
+ do j = 0, 31
+ !$acc loop vector private(x)
+ do k = 0, 31
+ x = ieor(i, j * 3)
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ !$acc loop vector private(x)
+ do k = 0, 31
+ x = ior(i, j * 5)
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t5
+
+
+! Test of vector-private variables declared on loop directive. Array type.
+
+subroutine t6()
+ integer :: i, j, k, idx, arr(0:32*32*32), pt(2)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker
+ do j = 0, 31
+ !$acc loop vector private(x, pt)
+ do k = 0, 31
+ pt(1) = ieor(i, j * 3)
+ pt(2) = ior(i, j * 5)
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt(1) * k
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt(2) * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t6
+
+
+! Test of worker-private variables declared on a loop directive.
+
+subroutine t7()
+ integer :: x, i, j, arr(0:32*32)
+ common x
+
+ do i = 0, 32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang private(x)
+ do i = 0, 31
+ !$acc loop worker private(x)
+ do j = 0, 31
+ x = ieor(i, j * 3)
+ arr(i * 32 + j) = arr(i * 32 + j) + x
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 * 32 - 1
+ if (arr(i) .ne. i + ieor(i / 32, mod(i, 32) * 3)) call abort
+ end do
+end subroutine t7
+
+
+! Test of worker-private variables declared on a loop directive, broadcasting
+! to vector-partitioned mode.
+
+subroutine t8()
+ integer :: x, i, j, k, idx, arr(0:32*32*32)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(x)
+ do j = 0, 31
+ x = ieor(i, j * 3)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k) call abort
+ end do
+ end do
+ end do
+end subroutine t8
+
+
+! Test of worker-private variables declared on a loop directive, broadcasting
+! to vector-partitioned mode. Back-to-back worker loops.
+
+subroutine t9()
+ integer :: x, i, j, k, idx, arr(0:32*32*32)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(x)
+ do j = 0, 31
+ x = ieor(i, j * 3)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+
+ !$acc loop worker private(x)
+ do j = 0, 31
+ x = ior(i, j * 5)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t9
+
+
+! Test of worker-private variables declared on a loop directive, broadcasting
+! to vector-partitioned mode. Successive vector loops. */
+
+subroutine t10()
+ integer :: x, i, j, k, idx, arr(0:32*32*32)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(x)
+ do j = 0, 31
+ x = ieor(i, j * 3)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+
+ x = ior(i, j * 5)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t10
+
+
+! Test of worker-private variables declared on a loop directive, broadcasting
+! to vector-partitioned mode. Addressable worker variable.
+
+subroutine t11()
+ integer :: i, j, k, idx, arr(0:32*32*32)
+ integer, target :: x
+ integer, pointer :: p
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(x, p)
+ do j = 0, 31
+ p => x
+ x = ieor(i, j * 3)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+
+ p = ior(i, j * 5)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + x * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t11
+
+
+! Test of worker-private variables declared on a loop directive, broadcasting
+! to vector-partitioned mode. Aggregate worker variable.
+
+subroutine t12()
+ type vec2
+ integer x, y
+ end type vec2
+
+ integer :: i, j, k, idx, arr(0:32*32*32)
+ type(vec2) :: pt
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(pt)
+ do j = 0, 31
+ pt%x = ieor(i, j * 3)
+ pt%y = ior(i, j * 5)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt%x * k
+ end do
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt%y * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t12
+
+
+! Test of worker-private variables declared on loop directive, broadcasting
+! to vector-partitioned mode. Array worker variable.
+
+subroutine t13()
+ integer :: i, j, k, idx, arr(0:32*32*32), pt(2)
+
+ do i = 0, 32*32*32-1
+ arr(i) = i
+ end do
+
+ !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
+ !$acc loop gang
+ do i = 0, 31
+ !$acc loop worker private(pt)
+ do j = 0, 31
+ pt(1) = ieor(i, j * 3)
+ pt(2) = ior(i, j * 5)
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt(1) * k
+ end do
+
+ !$acc loop vector
+ do k = 0, 31
+ arr(i * 1024 + j * 32 + k) = arr(i * 1024 + j * 32 + k) + pt(2) * k
+ end do
+ end do
+ end do
+ !$acc end parallel
+
+ do i = 0, 32 - 1
+ do j = 0, 32 -1
+ do k = 0, 32 - 1
+ idx = i * 1024 + j * 32 + k
+ if (arr(idx) .ne. idx + ieor(i, j * 3) * k + ior(i, j * 5) * k) then
+ call abort
+ end if
+ end do
+ end do
+ end do
+end subroutine t13
+
+
+! Test of gang-private variables declared on the parallel directive.
+
+subroutine t14()
+ use openacc
+ integer :: x = 5
+ integer, parameter :: n = 32
+ integer :: arr(n)
+
+ do i = 1, n
+ arr(i) = 3
+ end do
+
+ !$acc parallel private(x) copy(arr) num_gangs(n) num_workers(8) vector_length(32)
+ !$acc loop gang(static:1)
+ do i = 1, n
+ x = i * 2;
+ end do
+
+ !$acc loop gang(static:1)
+ do i = 1, n
+ if (acc_on_device (acc_device_host) .eqv. .TRUE.) x = i * 2
+ arr(i) = arr(i) + x
+ end do
+ !$acc end parallel
+
+ do i = 1, n
+ if (arr(i) .ne. (3 + i * 2)) call abort
+ end do
+
+end subroutine t14
+
+
+program main
+ call t1()
+ call t2()
+ call t3()
+ call t4()
+ call t5()
+ call t6()
+ call t7()
+ call t8()
+ call t9()
+ call t10()
+ call t11()
+ call t12()
+ call t13()
+ call t14()
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90
index 3d99668581f..96955ce71ba 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-2.f90
@@ -92,8 +92,8 @@ program reduction_2
if (result.ne.vresult) call abort
- result = 1
- vresult = 1
+ lresult = .true.
+ lvresult = .true.
! '.and.' reductions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90 b/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90
index d0b590e6496..ecf7fbea3b8 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/reduction-3.f90
@@ -92,8 +92,8 @@ program reduction_3
if (result.ne.vresult) call abort
- result = 1
- vresult = 1
+ lresult = .true.
+ lvresult = .true.
! '.and.' reductions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/update-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/update-1.f90
new file mode 100644
index 00000000000..4e1d2c01278
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/update-1.f90
@@ -0,0 +1,242 @@
+! { dg-do run }
+! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
+
+program update
+ use openacc
+ implicit none
+ integer, parameter :: N = 8
+ integer, parameter :: NDIV2 = N / 2
+ real :: a(N), b(N)
+ integer i
+
+ do i = 1, N
+ a(i) = 3.0
+ b(i) = 0.0
+ end do
+
+ !$acc enter data copyin (a, b)
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 3.0) call abort
+ if (b(i) .ne. 3.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ a(i) = 5.0
+ b(i) = 1.0
+ end do
+
+ !$acc update device (a, b)
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 5.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 5.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ a(i) = 6.0
+ b(i) = 0.0
+ end do
+
+ !$acc update device (a, b)
+
+ do i = 1, N
+ a(i) = 9.0
+ end do
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 6.0) call abort
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ a(i) = 7.0
+ b(i) = 2.0
+ end do
+
+ !$acc update device (a, b)
+
+ do i = 1, N
+ a(i) = 9.0
+ end do
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 7.0) call abort
+ if (b(i) .ne. 7.0) call abort
+ end do
+
+ do i = 1, N
+ a(i) = 9.0
+ end do
+
+ !$acc update device (a)
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, N
+ if (a(i) .ne. 9.0) call abort
+ if (b(i) .ne. 9.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ a(i) = 5.0
+ end do
+
+ !$acc update device (a)
+
+ do i = 1, N
+ a(i) = 6.0
+ end do
+
+ !$acc update device (a(1:NDIV2))
+
+ !$acc parallel present (a, b)
+ do i = 1, N
+ b(i) = a(i)
+ end do
+ !$acc end parallel
+
+ !$acc update host (a, b)
+
+ do i = 1, NDIV2
+ if (a(i) .ne. 6.0) call abort
+ if (b(i) .ne. 6.0) call abort
+ end do
+
+ do i = NDIV2 + 1, N
+ if (a(i) .ne. 5.0) call abort
+ if (b(i) .ne. 5.0) call abort
+ end do
+
+ if (acc_is_present (a) .neqv. .TRUE.) call abort
+ if (acc_is_present (b) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ a(i) = 0.0
+ end do
+
+ !$acc update device (a(1:4))
+
+ !$acc parallel present (a)
+ do i = 1, N
+ a(i) = a(i) + 1.0
+ end do
+ !$acc end parallel
+
+ !$acc update host (a(5:N))
+
+ do i = 1, NDIV2
+ if (a(i) .ne. 0.0) call abort
+ end do
+
+ do i = NDIV2 + 1, N
+ if (a(i) .ne. 6.0) call abort
+ end do
+
+ !$acc update host (a(1:4))
+
+ do i = 1, NDIV2
+ if (a(i) .ne. 1.0) call abort
+ end do
+
+ do i = NDIV2 + 1, N
+ if (a(i) .ne. 6.0) call abort
+ end do
+
+ a(3) = 9
+ a(4) = 9
+ a(5) = 9
+ a(6) = 9
+
+ !$acc update device (a(3:6))
+
+ !$acc parallel present (a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1.0
+ end do
+ !$acc end parallel
+
+ !$acc update host (a(3:6))
+
+ do i = 1, 2
+ if (a(i) .ne. 1.0) call abort
+ end do
+
+ do i = 3, 6
+ if (a(i) .ne. 10.0) call abort
+ end do
+
+ do i = 7, N
+ if (a(i) .ne. 6.0) call abort
+ end do
+
+ !$acc exit data delete (a, b)
+
+end program
+
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8d5312dbc9d..4e6db2ab3db 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,21 @@
+2016-03-24 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69945
+ * config/abi/pre/gnu.ver: Add new symbol.
+ * libsupc++/eh_alloc.cc (__gnu_cxx::__freeres): Define.
+ * testsuite/18_support/free_eh_pool.cc: New test.
+
+2016-03-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * include/Makefile.am (install-freestanding-headers): Add
+ concept_check.h and move.h to the installed headers.
+ * include/Makefile.in: Regenerated.
+ * include/bits/concept_check.h: Ignore _GLIBCXX_CONCEPT_CHECKS for
+ freestanding implementations.
+ * doc/xml/manual/using.xml (_GLIBCXX_CONCEPT_CHECKS): Mention
+ that this macro has no effect for freestanding implementations.
+ * doc/html/manual/using_macros.html: Likewise.
+
2016-02-24 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69939
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 41069d156a3..5c6b0feb2b3 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2148,6 +2148,8 @@ CXXABI_1.3.10 {
_ZGTtNKSt13bad_exceptionD1Ev;
_ZGTtNKSt13bad_exception4whatEv;
+ _ZN9__gnu_cxx9__freeresEv;
+
} CXXABI_1.3.9;
# Symbols in the support library (libsupc++) supporting transactional memory.
diff --git a/libstdc++-v3/doc/html/manual/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html
index 2ef05af4acd..0998b389355 100644
--- a/libstdc++-v3/doc/html/manual/using_macros.html
+++ b/libstdc++-v3/doc/html/manual/using_macros.html
@@ -66,7 +66,8 @@
<code class="code">--enable-concept-checks</code>. When defined, performs
compile-time checking on certain template instantiations to
detect violations of the requirements of the standard. This
- is described in more detail in
+ macro has no effect for freestanding implementations.
+ This is described in more detail in
<a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">Compile Time Checks</a>.
</p></dd><dt><span class="term"><code class="code">_GLIBCXX_ASSERTIONS</code></span></dt><dd><p>
Undefined by default. When defined, enables extra error checking in
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 6e022d5458a..231028e6b61 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -908,7 +908,8 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
<code>--enable-concept-checks</code>. When defined, performs
compile-time checking on certain template instantiations to
detect violations of the requirements of the standard. This
- is described in more detail in
+ macro has no effect for freestanding implementations.
+ This is described in more detail in
<link linkend="manual.ext.compile_checks">Compile Time Checks</link>.
</para>
</listitem></varlistentry>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 0b34c3c01d3..9cd6a85b9a2 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1331,7 +1331,7 @@ endif
# libsupc++, so only the others and the sub-includes are copied here.
install-freestanding-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
- for file in c++0x_warning.h atomic_base.h; do \
+ for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
$(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
$(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 3bbd3d77245..43735f9174c 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1753,7 +1753,7 @@ ${pch3_output}: ${pch3_source} ${pch2_output}
# libsupc++, so only the others and the sub-includes are copied here.
install-freestanding-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/bits
- for file in c++0x_warning.h atomic_base.h; do \
+ for file in c++0x_warning.h atomic_base.h concept_check.h move.h; do \
$(INSTALL_DATA) ${glibcxx_srcdir}/include/bits/$${file} $(DESTDIR)${gxx_include_dir}/bits; done
$(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h \
diff --git a/libstdc++-v3/include/bits/concept_check.h b/libstdc++-v3/include/bits/concept_check.h
index 5c4fb4c3506..11092c0a781 100644
--- a/libstdc++-v3/include/bits/concept_check.h
+++ b/libstdc++-v3/include/bits/concept_check.h
@@ -41,8 +41,9 @@
// Concept-checking code is off by default unless users turn it on via
// configure options or editing c++config.h.
+// It is not supported for freestanding implementations.
-#ifndef _GLIBCXX_CONCEPT_CHECKS
+#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !_GLIBCXX_HOSTED
#define __glibcxx_function_requires(...)
#define __glibcxx_class_requires(_a,_b)
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
index 6973af3d96c..d362e406cca 100644
--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -73,6 +73,10 @@ using namespace __cxxabiv1;
# define EMERGENCY_OBJ_COUNT 4
#endif
+namespace __gnu_cxx
+{
+ void __freeres();
+}
namespace
{
@@ -106,6 +110,8 @@ namespace
// to implement in_pool.
char *arena;
std::size_t arena_size;
+
+ friend void __gnu_cxx::__freeres();
};
pool::pool()
@@ -244,6 +250,19 @@ namespace
pool emergency_pool;
}
+namespace __gnu_cxx
+{
+ void
+ __freeres()
+ {
+ if (emergency_pool.arena)
+ {
+ ::free(emergency_pool.arena);
+ emergency_pool.arena = 0;
+ }
+ }
+}
+
extern "C" void *
__cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) _GLIBCXX_NOTHROW
{
diff --git a/libstdc++-v3/testsuite/18_support/free_eh_pool.cc b/libstdc++-v3/testsuite/18_support/free_eh_pool.cc
new file mode 100644
index 00000000000..9712d3d7619
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/free_eh_pool.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can 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-do run }
+
+namespace __gnu_cxx {
+ void __freeres();
+}
+
+struct X {
+ ~X() {
+ __gnu_cxx::__freeres();
+ }
+};
+
+X x;
+
+int
+main()
+{
+}