aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2017-03-15 09:59:42 +0100
committerYvan Roux <yvan.roux@linaro.org>2017-03-15 09:59:42 +0100
commit604b17d50dd0d0d8ecfcee70d1eea2ab70378176 (patch)
treeda5476fb9d9bdeb48b7445d1b26b99a3cdba867b
parentfb60fe3619726587a74136b5e941481af6a51b40 (diff)
Merge branches/gcc-6-branch rev 246148.
Change-Id: I706269373548f876b7f0d205507817f52ee8a2df
-rw-r--r--gcc/ChangeLog425
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog37
-rw-r--r--gcc/ada/gcc-interface/Makefile.in28
-rw-r--r--gcc/ada/gcc-interface/decl.c13
-rw-r--r--gcc/ada/gcc-interface/trans.c8
-rw-r--r--gcc/ada/gcc-interface/utils.c55
-rw-r--r--gcc/ada/socket.c2
-rw-r--r--gcc/ada/system-linux-ppc.ads5
-rw-r--r--gcc/c-family/ChangeLog16
-rw-r--r--gcc/c-family/c-common.c4
-rw-r--r--gcc/c/ChangeLog9
-rw-r--r--gcc/c/c-parser.c7
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/config/i386/avx512fintrin.h128
-rw-r--r--gcc/config/i386/avx512pfintrin.h72
-rw-r--r--gcc/config/i386/avx512vlintrin.h192
-rw-r--r--gcc/config/i386/cpuid.h2
-rw-r--r--gcc/config/i386/i386-builtin-types.def104
-rw-r--r--gcc/config/i386/i386.c114
-rw-r--r--gcc/config/i386/i386.md44
-rw-r--r--gcc/config/i386/x86-64.h2
-rw-r--r--gcc/config/pa/pa-64.h5
-rw-r--r--gcc/config/rs6000/predicates.md3
-rw-r--r--gcc/config/rs6000/rs6000-c.c4
-rw-r--r--gcc/config/rs6000/rs6000.c3
-rw-r--r--gcc/config/rs6000/rs6000.md17
-rw-r--r--gcc/config/rs6000/rs6000.opt4
-rw-r--r--gcc/config/rs6000/vsx.md42
-rw-r--r--gcc/config/sparc/sparc.c5
-rw-r--r--gcc/cp/ChangeLog84
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/cp/constexpr.c5
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl2.c41
-rw-r--r--gcc/cp/init.c7
-rw-r--r--gcc/cp/lambda.c69
-rw-r--r--gcc/cp/parser.c26
-rw-r--r--gcc/cp/pt.c45
-rw-r--r--gcc/cp/semantics.c6
-rw-r--r--gcc/cp/tree.c55
-rw-r--r--gcc/fold-const.c34
-rw-r--r--gcc/fortran/ChangeLog25
-rw-r--r--gcc/fortran/module.c21
-rw-r--r--gcc/fortran/trans-types.c29
-rw-r--r--gcc/fortran/trans.c4
-rw-r--r--gcc/gimple-expr.c2
-rw-r--r--gcc/gimple.c11
-rw-r--r--gcc/gimplify.c12
-rw-r--r--gcc/graphite-scop-detection.c33
-rw-r--r--gcc/graphite-sese-to-poly.c11
-rw-r--r--gcc/internal-fn.c20
-rw-r--r--gcc/ipa-prop.c2
-rw-r--r--gcc/ira-costs.c2
-rw-r--r--gcc/ira-int.h2
-rw-r--r--gcc/omp-low.c4
-rw-r--r--gcc/params.def2
-rw-r--r--gcc/testsuite/ChangeLog231
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c3
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79428-2.c7
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79428-5.c3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79428-6.c3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79429.c3
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr79431.c8
-rw-r--r--gcc/testsuite/c-c++-common/nonnull-3.c11
-rw-r--r--gcc/testsuite/c-c++-common/pr79428-3.c3
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/bounds-14.c13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi13.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr79296.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-union1.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr61636-1.C36
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr61636-2.C72
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr61636-3.C25
-rw-r--r--gcc/testsuite/g++.dg/expr/ptrmem8.C15
-rw-r--r--gcc/testsuite/g++.dg/expr/ptrmem9.C19
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr79429.C3
-rw-r--r--gcc/testsuite/g++.dg/lookup/pr79377.C36
-rw-r--r--gcc/testsuite/g++.dg/opt/pr79267.C69
-rw-r--r--gcc/testsuite/g++.dg/template/bitfield3.C20
-rw-r--r--gcc/testsuite/g++.dg/warn/Wnonnull3.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wpadded-1.C22
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr79197.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr79411.c22
-rw-r--r--gcc/testsuite/gcc.dg/comp-goto-4.c21
-rw-r--r--gcc/testsuite/gcc.dg/fixed-point/pr79971.c14
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr71824-2.c34
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr71824-3.c19
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr71824.c17
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr79977.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr79536.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr79666.c30
-rw-r--r--gcc/testsuite/gcc.dg/vector-1.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr49095.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/pr79495.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr79514.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr79197.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr79268.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr79439.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr79544.c21
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-xxpermdi.c68
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c23
-rw-r--r--gcc/testsuite/gcc.target/sparc/20170228-1.c20
-rw-r--r--gcc/testsuite/gfortran.dg/submodule_21.f0819
-rw-r--r--gcc/testsuite/gfortran.dg/submodule_22.f0847
-rw-r--r--gcc/testsuite/gnat.dg/opt63.adb19
-rw-r--r--gcc/tree-parloops.c76
-rw-r--r--gcc/tree-ssa-reassoc.c15
-rw-r--r--gcc/tree-vrp.c26
-rw-r--r--gcc/ubsan.c4
-rw-r--r--gcc/value-prof.c8
-rw-r--r--libatomic/ChangeLog8
-rw-r--r--libatomic/config/arm/exch_n.c4
-rw-r--r--libsanitizer/ChangeLog9
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc7
-rw-r--r--libstdc++-v3/ChangeLog188
-rw-r--r--libstdc++-v3/acinclude.m43
-rwxr-xr-xlibstdc++-v3/configure1
-rw-r--r--libstdc++-v3/include/bits/alloc_traits.h72
-rw-r--r--libstdc++-v3/include/bits/ios_base.h8
-rw-r--r--libstdc++-v3/include/bits/list.tcc8
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h5
-rw-r--r--libstdc++-v3/include/bits/mask_array.h4
-rw-r--r--libstdc++-v3/include/bits/ptr_traits.h15
-rw-r--r--libstdc++-v3/include/bits/regex.h4
-rw-r--r--libstdc++-v3/include/bits/slice_array.h4
-rw-r--r--libstdc++-v3/include/bits/stl_map.h30
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h28
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h24
-rw-r--r--libstdc++-v3/include/bits/stl_set.h26
-rw-r--r--libstdc++-v3/include/experimental/any5
-rw-r--r--libstdc++-v3/include/experimental/memory4
-rw-r--r--libstdc++-v3/include/ext/pointer.h8
-rw-r--r--libstdc++-v3/include/std/atomic36
-rw-r--r--libstdc++-v3/include/std/memory6
-rw-r--r--libstdc++-v3/include/std/type_traits6
-rw-r--r--libstdc++-v3/libsupc++/nested_exception.h2
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py45
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/xmethods.py145
-rw-r--r--libstdc++-v3/src/c++11/cxx11-shim_facets.cc20
-rw-r--r--libstdc++-v3/testsuite/17_intro/names.cc110
-rw-r--r--libstdc++-v3/testsuite/18_support/nested_exception/79114.cc28
-rw-r--r--libstdc++-v3/testsuite/20_util/allocator_traits/members/pointers.cc52
-rw-r--r--libstdc++-v3/testsuite/20_util/allocator_traits/members/rebind_alloc.cc81
-rw-r--r--libstdc++-v3/testsuite/20_util/pointer_traits/rebind.cc68
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/operations/80034.cc32
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/operations/2.cc49
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/operations/2.cc27
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/operations/2.cc27
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/operations/2.cc50
-rw-r--r--libstdc++-v3/testsuite/29_atomics/atomic/69301.cc57
-rw-r--r--libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc13
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc70
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc27
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc27
-rw-r--r--libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc52
-rw-r--r--libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc19
157 files changed, 3975 insertions, 744 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ac448c35c0f..9a9858ce86e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,418 @@
+2017-03-14 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-02-28 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
+
+ PR target/79752
+ * config/rs6000/rs6000.md (peephole2 for udiv/umod): Should emit
+ udiv rather than div since input pattern is unsigned.
+
+2017-03-14 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-05-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/80004
+ PR target/49244
+ * gimple.c (gimple_builtin_call_types_compatible_p): Allow
+ char/short arguments promoted to int because of promote_prototypes.
+
+ 2017-03-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79977
+ * graphite-scop-detection.c (scop_detection::merge_sese):
+ Handle the case of extra exits to blocks dominating the entry.
+
+ 2017-03-09 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/79971
+ * gimple-expr.c (useless_type_conversion_p): Preserve
+ TYPE_SATURATING for fixed-point types.
+
+ 2017-02-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79666
+ * tree-vrp.c (extract_range_from_binary_expr_1): Make sure
+ to not symbolically negate if that may introduce undefined
+ overflow.
+
+ 2017-02-17 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/79576
+ * params.def (max-ssa-name-query-depth): Limit to 10.
+
+2017-03-07 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2017-03-07 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/i386/i386.c (ix86_local_alignment): Align most aggregates
+ of 16 bytes and more to 16 bytes, not those of 16 bits and more.
+
+2017-03-06 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/77850
+ * config/pa/pa-64.h (PAD_VARARGS_DOWN): Don't pad down complex and
+ vector types.
+
+2017-03-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Back port from trunk
+ 2017-03-01 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/79439
+ * config/rs6000/predicates.md (current_file_function_operand): Do
+ not allow self calls to be local if the function is replaceable.
+
+2017-03-02 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/79514
+ * config/i386/i386.md (*pushxf_rounded): New insn_and_split pattern.
+
+2017-03-01 Pat Haugen <pthaugen@us.ibm.com>
+
+ Backport from mainline:
+ 2017-02-27 Pat Haugen <pthaugen@us.ibm.com>
+
+ PR target/79544
+ * rs6000/rs6000-c.c (struct altivec_builtin_types): Use VSRAD for
+ arithmetic shift of unsigned V2DI.
+
+2017-03-01 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2017-02-21 Martin Jambor <mjambor@suse.cz>
+
+ PR lto/79579
+ * ipa-prop.c (ipa_prop_write_jump_functions): Bail out if no edges
+ have been analyzed.
+
+2017-02-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/79749
+ * config/sparc/sparc.c (sparc_frame_pointer_required): Add missing
+ condition on optimize for the leaf function test.
+
+2017-02-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79261
+ * config/rs6000/rs6000.c (rs6000_expand_ternop_builtin): Add
+ support for CODE_FOR_vsx_xxpermdi_v2d[fi]_be.
+ * config/rs6000/rs6000.md (reload_gpr_from_vsx<mode>): Call
+ generator for vsx_xxpermdi_<mode>_be.
+ * config/rs6000/vsx.md (vsx_xxpermdi_<mode>): Remove logic to
+ force big-endian semantics.
+ (vsx_xxpermdi_<mode>_be): New define_expand with same
+ implementation as previous version of vsx_xxpermdi_<mode>.
+
+2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/79537
+ * gimplify.c (gimplify_expr): Handle unused *&&L;.
+
+ PR sanitizer/79558
+ * ubsan.c (ubsan_type_descriptor): Check if TYPE_MAX_VALUE is null.
+
+2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2017-02-17 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/79536
+ * fold-const.c (fold_negate_expr_1): Renamed from fold_negate_expr.
+ (fold_negate_expr): New wrapper.
+
+2017-02-17 Carl Love <cel@us.ibm.com>
+
+ Backport from mainline commit r245460 on 2017-02-14
+
+ PR 79545
+ * config/rs6000/rs6000.c: Add case statement entry to make the xvcvuxdsp
+ built-in argument unsigned.
+ * config/rs6000/vsx.md: Fix the source and return operand types so they
+ match the instruction definitions from the ISA document. Fix typo
+ in the instruction generation for the (define_insn "vsx_xvcvuxdsp"
+ statement.
+
+2017-01-17 Julia Koval <julia.koval@intel.com>
+
+ PR target/76731
+ * config/i386/avx512fintrin.h
+ (_mm512_i32gather_ps): Change __addr type to void const*.
+ (_mm512_mask_i32gather_ps): Ditto.
+ (_mm512_i32gather_pd): Ditto.
+ (_mm512_mask_i32gather_pd): Ditto.
+ (_mm512_i64gather_ps): Ditto.
+ (_mm512_mask_i64gather_ps): Ditto.
+ (_mm512_i64gather_pd): Ditto.
+ (_mm512_mask_i64gather_pd): Ditto.
+ (_mm512_i32gather_epi32): Ditto.
+ (_mm512_mask_i32gather_epi32): Ditto.
+ (_mm512_i32gather_epi64): Ditto.
+ (_mm512_mask_i32gather_epi64): Ditto.
+ (_mm512_i64gather_epi32): Ditto.
+ (_mm512_mask_i64gather_epi32): Ditto.
+ (_mm512_i64gather_epi64): Ditto.
+ (_mm512_mask_i64gather_epi64): Ditto.
+ (_mm512_i32scatter_ps): Change __addr type to void*.
+ (_mm512_mask_i32scatter_ps): Ditto.
+ (_mm512_i32scatter_pd): Ditto.
+ (_mm512_mask_i32scatter_pd): Ditto.
+ (_mm512_i64scatter_ps): Ditto.
+ (_mm512_mask_i64scatter_ps): Ditto.
+ (_mm512_i64scatter_pd): Ditto.
+ (_mm512_mask_i64scatter_pd): Ditto.
+ (_mm512_i32scatter_epi32): Ditto.
+ (_mm512_mask_i32scatter_epi32): Ditto.
+ (_mm512_i32scatter_epi64): Ditto.
+ (_mm512_mask_i32scatter_epi64): Ditto.
+ (_mm512_i64scatter_epi32): Ditto.
+ (_mm512_mask_i64scatter_epi32): Ditto.
+ (_mm512_i64scatter_epi64): Ditto.
+ (_mm512_mask_i64scatter_epi64): Ditto.
+ * config/i386/avx512pfintrin.h
+ (_mm512_mask_prefetch_i32gather_pd): Change addr type to void const*.
+ (_mm512_mask_prefetch_i32gather_ps): Ditto.
+ (_mm512_mask_prefetch_i64gather_pd): Ditto.
+ (_mm512_mask_prefetch_i64gather_ps): Ditto.
+ (_mm512_prefetch_i32scatter_pd): Change addr type to void*.
+ (_mm512_prefetch_i32scatter_ps): Ditto.
+ (_mm512_mask_prefetch_i32scatter_pd): Ditto.
+ (_mm512_mask_prefetch_i32scatter_ps): Ditto.
+ (_mm512_prefetch_i64scatter_pd): Ditto.
+ (_mm512_prefetch_i64scatter_ps): Ditto.
+ (_mm512_mask_prefetch_i64scatter_pd): Ditto.
+ (_mm512_mask_prefetch_i64scatter_ps): Ditto.
+ * config/i386/avx512vlintrin.h
+ (_mm256_mmask_i32gather_ps): Change __addr type to void const*.
+ (_mm_mmask_i32gather_ps): Ditto.
+ (_mm256_mmask_i32gather_pd): Ditto.
+ (_mm_mmask_i32gather_pd): Ditto.
+ (_mm256_mmask_i64gather_ps): Ditto.
+ (_mm_mmask_i64gather_ps): Ditto.
+ (_mm256_mmask_i64gather_pd): Ditto.
+ (_mm_mmask_i64gather_pd): Ditto.
+ (_mm256_mmask_i32gather_epi32): Ditto.
+ (_mm_mmask_i32gather_epi32): Ditto.
+ (_mm256_mmask_i32gather_epi64): Ditto.
+ (_mm_mmask_i32gather_epi64): Ditto.
+ (_mm256_mmask_i64gather_epi32): Ditto.
+ (_mm_mmask_i64gather_epi32): Ditto.
+ (_mm256_mmask_i64gather_epi64): Ditto.
+ (_mm_mmask_i64gather_epi64): Ditto.
+ (_mm256_i32scatter_ps): Change __addr type to void*.
+ (_mm256_mask_i32scatter_ps): Ditto.
+ (_mm_i32scatter_ps): Ditto.
+ (_mm_mask_i32scatter_ps): Ditto.
+ (_mm256_i32scatter_pd): Ditto.
+ (_mm256_mask_i32scatter_pd): Ditto.
+ (_mm_i32scatter_pd): Ditto.
+ (_mm_mask_i32scatter_pd): Ditto.
+ (_mm256_i64scatter_ps): Ditto.
+ (_mm256_mask_i64scatter_ps): Ditto.
+ (_mm_i64scatter_ps): Ditto.
+ (_mm_mask_i64scatter_ps): Ditto.
+ (_mm256_i64scatter_pd): Ditto.
+ (_mm256_mask_i64scatter_pd): Ditto.
+ (_mm_i64scatter_pd): Ditto.
+ (_mm_mask_i64scatter_pd): Ditto.
+ (_mm256_i32scatter_epi32): Ditto.
+ (_mm256_mask_i32scatter_epi32): Ditto.
+ (_mm_i32scatter_epi32): Ditto.
+ (_mm_mask_i32scatter_epi32): Ditto.
+ (_mm256_i32scatter_epi64): Ditto.
+ (_mm256_mask_i32scatter_epi64): Ditto.
+ (_mm_i32scatter_epi64): Ditto.
+ (_mm_mask_i32scatter_epi64): Ditto.
+ (_mm256_i64scatter_epi32): Ditto.
+ (_mm256_mask_i64scatter_epi32): Ditto.
+ (_mm_i64scatter_epi32): Ditto.
+ (_mm_mask_i64scatter_epi32): Ditto.
+ (_mm256_i64scatter_epi64): Ditto.
+ (_mm256_mask_i64scatter_epi64): Ditto.
+ (_mm_i64scatter_epi64): Ditto.
+ (_mm_mask_i64scatter_epi64): Ditto.
+ * config/i386/i386-builtin-types.def (V16SF_V16SF_PCFLOAT_V16SI_HI_INT)
+ (V8DF_V8DF_PCDOUBLE_V8SI_QI_INT, V8SF_V8SF_PCFLOAT_V8DI_QI_INT)
+ (V8DF_V8DF_PCDOUBLE_V8DI_QI_INT, V16SI_V16SI_PCINT_V16SI_HI_INT)
+ (V8DI_V8DI_PCINT64_V8SI_QI_INT, V8SI_V8SI_PCINT_V8DI_QI_INT)
+ (V8DI_V8DI_PCINT64_V8DI_QI_INT, V2DF_V2DF_PCDOUBLE_V4SI_QI_INT)
+ (V4DF_V4DF_PCDOUBLE_V4SI_QI_INT, V2DF_V2DF_PCDOUBLE_V2DI_QI_INT)
+ (V4DF_V4DF_PCDOUBLE_V4DI_QI_INT, V4SF_V4SF_PCFLOAT_V4SI_QI_INT)
+ (V8SF_V8SF_PCFLOAT_V8SI_QI_INT, V4SF_V4SF_PCFLOAT_V2DI_QI_INT)
+ (V4SF_V4SF_PCFLOAT_V4DI_QI_INT, V2DI_V2DI_PCINT64_V4SI_QI_INT)
+ (V4DI_V4DI_PCINT64_V4SI_QI_INT, V2DI_V2DI_PCINT64_V2DI_QI_INT)
+ (V4DI_V4DI_PCINT64_V4DI_QI_INT, V4SI_V4SI_PCINT_V4SI_QI_INT)
+ (V8SI_V8SI_PCINT_V8SI_QI_INT, V4SI_V4SI_PCINT_V2DI_QI_INT)
+ (V4SI_V4SI_PCINT_V4DI_QI_INT, VOID_PFLOAT_HI_V16SI_V16SF_INT)
+ (VOID_PFLOAT_QI_V8SI_V8SF_INT, VOID_PFLOAT_QI_V4SI_V4SF_INT)
+ (VOID_PDOUBLE_QI_V8SI_V8DF_INT, VOID_PDOUBLE_QI_V4SI_V4DF_INT)
+ (VOID_PDOUBLE_QI_V4SI_V2DF_INT, VOID_PFLOAT_QI_V8DI_V8SF_INT)
+ (VOID_PFLOAT_QI_V4DI_V4SF_INT, VOID_PFLOAT_QI_V2DI_V4SF_INT)
+ (VOID_PDOUBLE_QI_V8DI_V8DF_INT, VOID_PDOUBLE_QI_V4DI_V4DF_INT)
+ (VOID_PDOUBLE_QI_V2DI_V2DF_INT, VOID_PINT_HI_V16SI_V16SI_INT)
+ (VOID_PINT_QI_V8SI_V8SI_INT, VOID_PINT_QI_V4SI_V4SI_INT)
+ (VOID_PLONGLONG_QI_V8SI_V8DI_INT, VOID_PLONGLONG_QI_V4SI_V4DI_INT)
+ (VOID_PLONGLONG_QI_V4SI_V2DI_INT, VOID_PINT_QI_V8DI_V8SI_INT)
+ (VOID_PINT_QI_V4DI_V4SI_INT, VOID_PINT_QI_V2DI_V4SI_INT)
+ (VOID_PLONGLONG_QI_V8DI_V8DI_INT, VOID_QI_V8SI_PCINT64_INT_INT)
+ (VOID_PLONGLONG_QI_V4DI_V4DI_INT, VOID_PLONGLONG_QI_V2DI_V2DI_INT)
+ (VOID_HI_V16SI_PCINT_INT_INT, VOID_QI_V8DI_PCINT64_INT_INT)
+ (VOID_QI_V8DI_PCINT_INT_INT): Remove.
+ (V16SF_V16SF_PCVOID_V16SI_HI_INT, V8DF_V8DF_PCVOID_V8SI_QI_INT)
+ (V8SF_V8SF_PCVOID_V8DI_QI_INT, V8DF_V8DF_PCVOID_V8DI_QI_INT)
+ (V16SI_V16SI_PCVOID_V16SI_HI_INT, V8DI_V8DI_PCVOID_V8SI_QI_INT)
+ (V8SI_V8SI_PCVOID_V8DI_QI_INT, V8DI_V8DI_PCVOID_V8DI_QI_INT)
+ (VOID_PVOID_HI_V16SI_V16SF_INT, VOID_PVOID_QI_V8SI_V8DF_INT)
+ (VOID_PVOID_QI_V8DI_V8SF_INT, VOID_PVOID_QI_V8DI_V8DF_INT)
+ (VOID_PVOID_HI_V16SI_V16SI_INT, VOID_PVOID_QI_V8SI_V8DI_INT)
+ (VOID_PVOID_QI_V8DI_V8SI_INT, VOID_PVOID_QI_V8DI_V8DI_INT)
+ (V2DF_V2DF_PCVOID_V4SI_QI_INT, V4DF_V4DF_PCVOID_V4SI_QI_INT)
+ (V2DF_V2DF_PCVOID_V2DI_QI_INT, V4DF_V4DF_PCVOID_V4DI_QI_INT
+ (V4SF_V4SF_PCVOID_V4SI_QI_INT, V8SF_V8SF_PCVOID_V8SI_QI_INT)
+ (V4SF_V4SF_PCVOID_V2DI_QI_INT, V4SF_V4SF_PCVOID_V4DI_QI_INT)
+ (V2DI_V2DI_PCVOID_V4SI_QI_INT, V4DI_V4DI_PCVOID_V4SI_QI_INT)
+ (V2DI_V2DI_PCVOID_V2DI_QI_INT, V4DI_V4DI_PCVOID_V4DI_QI_INT)
+ (V4SI_V4SI_PCVOID_V4SI_QI_INT, V8SI_V8SI_PCVOID_V8SI_QI_INT)
+ (V4SI_V4SI_PCVOID_V2DI_QI_INT, V4SI_V4SI_PCVOID_V4DI_QI_INT)
+ (VOID_PVOID_QI_V8SI_V8SF_INT, VOID_PVOID_QI_V4SI_V4SF_INT)
+ (VOID_PVOID_QI_V4SI_V4DF_INT, VOID_PVOID_QI_V4SI_V2DF_INT)
+ (VOID_PVOID_QI_V4DI_V4SF_INT, VOID_PVOID_QI_V2DI_V4SF_INT)
+ (VOID_PVOID_QI_V4DI_V4DF_INT, VOID_PVOID_QI_V2DI_V2DF_INT)
+ (VOID_PVOID_QI_V8SI_V8SI_INT, VOID_PVOID_QI_V4SI_V4SI_INT)
+ (VOID_PVOID_QI_V4SI_V4DI_INT, VOID_PVOID_QI_V4SI_V2DI_INT)
+ (VOID_PVOID_QI_V4DI_V4SI_INT, VOID_PVOID_QI_V2DI_V4SI_INT)
+ (VOID_PVOID_QI_V4DI_V4DI_INT, VOID_PVOID_QI_V2DI_V2DI_INT)
+ (VOID_QI_V8SI_PCVOID_INT_INT, VOID_HI_V16SI_PCVOID_INT_INT)
+ (VOID_QI_V8DI_PCVOID_INT_INT): Add.
+ * config/i386/i386.c (ix86_init_mmx_sse_builtins): Adjust builtin
+ definitions accordingly.
+
+2017-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-09 Marek Polacek <polacek@redhat.com>
+
+ PR c/79428
+ * c-parser.c (c_parser_omp_ordered): Call c_parser_skip_to_pragma_eol
+ instead of c_parser_skip_until_found.
+
+2017-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/79411
+ * tree-ssa-reassoc.c (is_reassociable_op): Return false if
+ stmt operands are SSA_NAMEs used in abnormal phis.
+ (can_reassociate_p): Return false if op is SSA_NAME used in abnormal
+ phis.
+
+ 2017-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/79431
+ * gimplify.c (gimplify_adjust_omp_clauses): Ignore
+ "omp declare target link" attribute unless is_global_var.
+ * omp-low.c (find_link_var_op): Likewise.
+
+ 2017-02-07 Jakub Jelinek <jakub@redhat.com>
+ Richard Biener <rguenther@suse.de>
+
+ PR middle-end/79399
+ * ira-int.h (struct target_ira_int): Change x_max_struct_costs_size
+ type from int to size_t.
+ * ira-costs.c (struct_costs_size): Change type from int to size_t.
+
+ 2017-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/79338
+ * tree-parloops.c (gather_scalar_reductions): Don't call
+ vect_analyze_loop_form for loop->inner before destroying loop's
+ loop_vinfo.
+
+ 2017-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/79197
+ * config/rs6000/rs6000.md (*fixuns_trunc<mode>di2_fctiduz): Rename to ...
+ (fixuns_trunc<mode>di2): ... this, remove previous expander. Put all
+ conditions on a single line.
+
+ 2017-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/79267
+ * value-prof.c (gimple_ic): Only drop lhs for noreturn calls
+ if should_remove_lhs_p is true.
+
+ 2017-01-17 Kito Cheng <kito.cheng@gmail.com>
+ Kuan-Lin Chen <kuanlinchentw@gmail.com>
+
+ PR target/79079
+ * internal-fn.c (expand_mul_overflow): Use convert_modes instead of
+ gen_lowpart.
+
+2017-02-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/79495
+ * config/i386/i386.md (*movxf_internal): Add (o,rC) alternative.
+
+2017-02-14 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-02-13 Martin Liska <mliska@suse.cz>
+
+ PR c/79471
+ * calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC.
+
+2017-02-13 Gerald Pfeifer <gerald@pfeifer.com>
+
+ Backport from mainline
+ 2016-12-11 Roger Pau Monné <roger.pau@citrix.com>
+
+ * config/i386/x86-64.h: Append --32 to the assembler options when
+ -m16 is used on non-glibc systems as well.
+
+2017-02-08 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR translation/79397
+ * config/rs6000/rs6000.opt (maltivec=le, maltivec=be): Fix spelling
+ of AltiVec.
+
+2017-02-08 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2017-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * graphite-scop-detection.c (scop_detection::build_scop_breadth):
+ Check all loops contained in the merged region.
+
+ 2017-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * graphite-scop-detection.c (scop_detection::build_scop_breadth):
+ Verify the loops are valid in the merged SESE region.
+ (scop_detection::can_represent_loop_1): Check analyzing the
+ evolution of the number of iterations in the region succeeds.
+
+ 2017-01-31 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/77318
+ * graphite-sese-to-poly.c (extract_affine): Fix assert.
+ (create_pw_aff_from_tree): Take loop parameter.
+ (add_condition_to_pbb): Pass loop of the condition to
+ create_pw_aff_from_tree.
+
+2017-02-06 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR target/71017
+ * config/i386/cpuid.h: Fix undefined behavior.
+
2017-02-03 Carl Love <cel@us.ibm.com>
Backport of two commits from mainline, r244943 and r244904,
@@ -493,11 +908,11 @@
Backport from mainline
2016-11-07 Bernd Schmidt <bschmidt@redhat.com>
- PR rtl-optimization/77309
- * combine.c (make_compound_operation): Allow EQ for IN_CODE, and
- don't assume an equality comparison for plain COMPARE.
- (simplify_comparison): Pass a more accurate code to
- make_compound_operation.
+ PR rtl-optimization/77309
+ * combine.c (make_compound_operation): Allow EQ for IN_CODE, and
+ don't assume an equality comparison for plain COMPARE.
+ (simplify_comparison): Pass a more accurate code to
+ make_compound_operation.
2016-12-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index ee1e9c32829..2e38bf7671a 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20170206
+20170315
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 803e9c50ab0..46ce3934d12 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,40 @@
+2017-03-08 Thanassis Tsiodras <ttsiodras@gmail.com>
+
+ PR ada/79903
+ * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
+
+2017-03-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/79945
+ * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
+
+2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
+ around a justified modular type if it doesn't have the same scalar
+ storage order as the enclosing record type.
+
+2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
+ of boolean rvalues to function calls.
+
+2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (fold_bit_position): New function.
+ (rest_of_record_type_compilation): Call it instead of bit_position to
+ compute the field position and remove the call to remove_conversions.
+ (compute_related_constant): Factor out the multiplication in both
+ operands, if any, and streamline the final test.
+
+2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
+
+2017-02-12 John Marino <gnugcc@marino.st>
+
+ * gcc-interface/Makefile.in: Support aarch64-freebsd.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index a722a77618f..b1b7e9ac447 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -1475,6 +1475,34 @@ ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(target_cpu) $(target_os))),)
LIBRARY_VERSION := $(LIB_VERSION)
endif
+# aarch64 FreeBSD
+ifeq ($(strip $(filter-out %aarch64 freebsd%,$(target_cpu) $(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-mudido.adb<s-mudido-affinity.adb \
+ s-osinte.adb<s-osinte-freebsd.adb \
+ s-osinte.ads<s-osinte-freebsd.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.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+ system.ads<system-freebsd-x86_64.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+ GNATLIB_SHARED = gnatlib-shared-dual
+
+ EH_MECHANISM=-gcc
+ THREADSLIB= -lpthread
+ GMEM_LIB = gmemlib
+ LIBRARY_VERSION := $(LIB_VERSION)
+ MISCLIB = -lutil
+endif
+
# x86 FreeBSD
ifeq ($(strip $(filter-out %86 freebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4290e9b9a0e..2e57beae2f5 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -6685,6 +6685,7 @@ static tree
gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
bool definition, bool debug_info_p)
{
+ const Entity_Id gnat_record_type = Underlying_Type (Scope (gnat_field));
const Entity_Id gnat_field_type = Etype (gnat_field);
const bool is_aliased
= Is_Aliased (gnat_field);
@@ -6771,8 +6772,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
if (Present (Component_Clause (gnat_field)))
{
Node_Id gnat_clause = Component_Clause (gnat_field);
- Entity_Id gnat_parent
- = Parent_Subtype (Underlying_Type (Scope (gnat_field)));
+ Entity_Id gnat_parent = Parent_Subtype (gnat_record_type);
gnu_pos = UI_To_gnu (Component_Bit_Offset (gnat_field), bitsizetype);
gnu_size = validate_size (Esize (gnat_field), gnu_field_type,
@@ -6891,7 +6891,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
/* If the record has rep clauses and this is the tag field, make a rep
clause for it as well. */
- else if (Has_Specified_Layout (Scope (gnat_field))
+ else if (Has_Specified_Layout (gnat_record_type)
&& Chars (gnat_field) == Name_uTag)
{
gnu_pos = bitsize_zero_node;
@@ -6928,11 +6928,14 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
/* If the field's type is justified modular, we would need to remove
the wrapper to (better) meet the layout requirements. However we
can do so only if the field is not aliased to preserve the unique
- layout and if the prescribed size is not greater than that of the
- packed array to preserve the justification. */
+ layout, if it has the same storage order as the enclosing record
+ and if the prescribed size is not greater than that of the packed
+ array to preserve the justification. */
if (!needs_strict_alignment
&& TREE_CODE (gnu_field_type) == RECORD_TYPE
&& TYPE_JUSTIFIED_MODULAR_P (gnu_field_type)
+ && TYPE_REVERSE_STORAGE_ORDER (gnu_field_type)
+ == Reverse_Storage_Order (gnat_record_type)
&& tree_int_cst_compare (gnu_size, TYPE_ADA_SIZE (gnu_field_type))
<= 0)
gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type));
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index cf64d229a5b..5583903b5cd 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3600,9 +3600,16 @@ return_value_ok_for_nrv_p (tree ret_obj, tree ret_val)
if (TREE_ADDRESSABLE (ret_val))
return false;
+ /* For the constrained case, test for overalignment. */
if (ret_obj && DECL_ALIGN (ret_val) > DECL_ALIGN (ret_obj))
return false;
+ /* For the unconstrained case, test for bogus initialization. */
+ if (!ret_obj
+ && DECL_INITIAL (ret_val)
+ && TREE_CODE (DECL_INITIAL (ret_val)) == NULL_EXPR)
+ return false;
+
return true;
}
@@ -7696,7 +7703,6 @@ gnat_to_gnu (Node_Id gnat_node)
&& (kind == N_Identifier
|| kind == N_Expanded_Name
|| kind == N_Explicit_Dereference
- || kind == N_Function_Call
|| kind == N_Indexed_Component
|| kind == N_Selected_Component)
&& TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index c47be7d2951..86848ac4bc2 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -238,6 +238,7 @@ static GTY ((cache))
hash_table<pad_type_hasher> *pad_type_hash_table;
static tree merge_sizes (tree, tree, tree, bool, bool);
+static tree fold_bit_position (const_tree);
static tree compute_related_constant (tree, tree);
static tree split_plus (tree, tree *);
static tree float_type_for_precision (int, machine_mode);
@@ -2021,15 +2022,11 @@ rest_of_record_type_compilation (tree record_type)
{
tree field_type = TREE_TYPE (old_field);
tree field_name = DECL_NAME (old_field);
- tree curpos = bit_position (old_field);
+ tree curpos = fold_bit_position (old_field);
tree pos, new_field;
bool var = false;
unsigned int align = 0;
- /* We're going to do some pattern matching below so remove as many
- conversions as possible. */
- curpos = remove_conversions (curpos, true);
-
/* See how the position was modified from the last position.
There are two basic cases we support: a value was added
@@ -2126,7 +2123,7 @@ rest_of_record_type_compilation (tree record_type)
is when there are other components at fixed positions after
it (meaning there was a rep clause for every field) and we
want to be able to encode them. */
- last_pos = size_binop (PLUS_EXPR, bit_position (old_field),
+ last_pos = size_binop (PLUS_EXPR, curpos,
(TREE_CODE (TREE_TYPE (old_field))
== QUAL_UNION_TYPE)
? bitsize_zero_node
@@ -2181,23 +2178,51 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special,
return new_size;
}
+/* Return the bit position of FIELD, in bits from the start of the record,
+ and fold it as much as possible. This is a tree of type bitsizetype. */
+
+static tree
+fold_bit_position (const_tree field)
+{
+ tree offset = DECL_FIELD_OFFSET (field);
+ if (TREE_CODE (offset) == MULT_EXPR || TREE_CODE (offset) == PLUS_EXPR)
+ offset = size_binop (TREE_CODE (offset),
+ fold_convert (bitsizetype, TREE_OPERAND (offset, 0)),
+ fold_convert (bitsizetype, TREE_OPERAND (offset, 1)));
+ else
+ offset = fold_convert (bitsizetype, offset);
+ return size_binop (PLUS_EXPR, DECL_FIELD_BIT_OFFSET (field),
+ size_binop (MULT_EXPR, offset, bitsize_unit_node));
+}
+
/* Utility function of above to see if OP0 and OP1, both of SIZETYPE, are
related by the addition of a constant. Return that constant if so. */
static tree
compute_related_constant (tree op0, tree op1)
{
- tree op0_var, op1_var;
- tree op0_con = split_plus (op0, &op0_var);
- tree op1_con = split_plus (op1, &op1_var);
- tree result = size_binop (MINUS_EXPR, op0_con, op1_con);
+ tree factor, op0_var, op1_var, op0_cst, op1_cst, result;
- if (operand_equal_p (op0_var, op1_var, 0))
- return result;
- else if (operand_equal_p (op0, size_binop (PLUS_EXPR, op1_var, result), 0))
- return result;
+ if (TREE_CODE (op0) == MULT_EXPR
+ && TREE_CODE (op1) == MULT_EXPR
+ && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST
+ && TREE_OPERAND (op1, 1) == TREE_OPERAND (op0, 1))
+ {
+ factor = TREE_OPERAND (op0, 1);
+ op0 = TREE_OPERAND (op0, 0);
+ op1 = TREE_OPERAND (op1, 0);
+ }
else
- return 0;
+ factor = NULL_TREE;
+
+ op0_cst = split_plus (op0, &op0_var);
+ op1_cst = split_plus (op1, &op1_var);
+ result = size_binop (MINUS_EXPR, op0_cst, op1_cst);
+
+ if (operand_equal_p (op0_var, op1_var, 0))
+ return factor ? size_binop (MULT_EXPR, factor, result) : result;
+
+ return NULL_TREE;
}
/* Utility function of above to split a tree OP which may be a sum, into a
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index f5fb6635ee2..5cdd656e34b 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -202,7 +202,7 @@ __gnat_gethostbyaddr (const char *addr, int len, int type,
struct hostent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) gethostbyaddr_r (addr, len, type, ret, buf, buflen, &rh, h_errnop);
#else
rh = gethostbyaddr_r (addr, len, type, ret, buf, buflen, h_errnop);
diff --git a/gcc/ada/system-linux-ppc.ads b/gcc/ada/system-linux-ppc.ads
index a2f36ea9da5..367d09fb83e 100644
--- a/gcc/ada/system-linux-ppc.ads
+++ b/gcc/ada/system-linux-ppc.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU-Linux/PPC Version) --
-- --
--- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -89,7 +89,8 @@ package System is
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
- Default_Bit_Order : constant Bit_Order := High_Order_First;
+ Default_Bit_Order : constant Bit_Order :=
+ Bit_Order'Val (Standard'Default_Bit_Order);
pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-- Priority-related Declarations (RM D.1)
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index bdd4e9e273c..b5ae22d9a17 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,19 @@
+2017-03-14 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79962
+ PR c++/79984
+ * c-common.c (handle_nonnull_attribute): Save the result of default
+ conversion to the attribute list.
+
+2017-03-14 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2017-03-02 Richard Biener <rguenther@suse.de>
+
+ PR c/79756
+ * c-common.c (c_common_mark_addressable_vec): Look through
+ C_MAYBE_CONST_EXPR.
+
2017-01-10 Martin Liska <mliska@suse.cz>
Backport from mainline
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index c6eecaf60b7..f900dfaf8fd 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -9062,7 +9062,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
tree arg = TREE_VALUE (args);
if (arg && TREE_CODE (arg) != IDENTIFIER_NODE
&& TREE_CODE (arg) != FUNCTION_DECL)
- arg = default_conversion (arg);
+ TREE_VALUE (args) = arg = default_conversion (arg);
if (!get_nonnull_operand (arg, &arg_num))
{
@@ -10678,6 +10678,8 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
void
c_common_mark_addressable_vec (tree t)
{
+ if (TREE_CODE (t) == C_MAYBE_CONST_EXPR)
+ t = C_MAYBE_CONST_EXPR_EXPR (t);
while (handled_component_p (t))
t = TREE_OPERAND (t, 0);
if (!VAR_P (t)
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 2b1f71855ad..05254583ae1 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,12 @@
+2017-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/79431
+ * c-parser.c (c_parser_omp_declare_target): Don't invoke
+ symtab_node::get on automatic variables.
+
2016-12-21 Jakub Jelinek <jakub@redhat.com>
PR c/77767
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index c9eb8ddbae3..a59d29bab5f 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -15180,7 +15180,7 @@ c_parser_omp_ordered (c_parser *parser, enum pragma_context context,
if (context != pragma_stmt && context != pragma_compound)
{
c_parser_error (parser, "expected declaration specifiers");
- c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
+ c_parser_skip_to_pragma_eol (parser, false);
return false;
}
@@ -16560,8 +16560,11 @@ c_parser_omp_declare_target (c_parser *parser)
}
if (!at1)
{
- symtab_node *node = symtab_node::get (t);
DECL_ATTRIBUTES (t) = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (t));
+ if (TREE_CODE (t) != FUNCTION_DECL && !is_global_var (t))
+ continue;
+
+ symtab_node *node = symtab_node::get (t);
if (node != NULL)
{
node->offloadable = 1;
diff --git a/gcc/calls.c b/gcc/calls.c
index 8de22f35b07..64c918b6627 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2704,8 +2704,7 @@ expand_call (tree exp, rtx target, int ignore)
n_named_args = num_actuals;
/* Make a vector to hold all the information about each arg. */
- args = XALLOCAVEC (struct arg_data, num_actuals);
- memset (args, 0, num_actuals * sizeof (struct arg_data));
+ args = XCNEWVEC (struct arg_data, num_actuals);
/* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */
@@ -3719,6 +3718,7 @@ expand_call (tree exp, rtx target, int ignore)
currently_expanding_call--;
free (stack_usage_map_buf);
+ free (args);
/* Join result with returned bounds so caller may use them if needed. */
target = chkp_join_splitted_slot (target, valbnd);
diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h
index 305ed555d45..f89330b55c9 100644
--- a/gcc/config/i386/avx512fintrin.h
+++ b/gcc/config/i386/avx512fintrin.h
@@ -9209,7 +9209,7 @@ _mm_mask_cmp_round_ss_mask (__mmask8 __M, __m128 __X, __m128 __Y,
#ifdef __OPTIMIZE__
extern __inline __m512
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32gather_ps (__m512i __index, float const *__addr, int __scale)
+_mm512_i32gather_ps (__m512i __index, void const *__addr, int __scale)
{
__m512 v1_old = _mm512_undefined_ps ();
__mmask16 mask = 0xFFFF;
@@ -9223,7 +9223,7 @@ _mm512_i32gather_ps (__m512i __index, float const *__addr, int __scale)
extern __inline __m512
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i32gather_ps (__m512 v1_old, __mmask16 __mask,
- __m512i __index, float const *__addr, int __scale)
+ __m512i __index, void const *__addr, int __scale)
{
return (__m512) __builtin_ia32_gathersiv16sf ((__v16sf) v1_old,
__addr,
@@ -9233,7 +9233,7 @@ _mm512_mask_i32gather_ps (__m512 v1_old, __mmask16 __mask,
extern __inline __m512d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32gather_pd (__m256i __index, double const *__addr, int __scale)
+_mm512_i32gather_pd (__m256i __index, void const *__addr, int __scale)
{
__m512d v1_old = _mm512_undefined_pd ();
__mmask8 mask = 0xFF;
@@ -9247,7 +9247,7 @@ _mm512_i32gather_pd (__m256i __index, double const *__addr, int __scale)
extern __inline __m512d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i32gather_pd (__m512d __v1_old, __mmask8 __mask,
- __m256i __index, double const *__addr, int __scale)
+ __m256i __index, void const *__addr, int __scale)
{
return (__m512d) __builtin_ia32_gathersiv8df ((__v8df) __v1_old,
__addr,
@@ -9257,7 +9257,7 @@ _mm512_mask_i32gather_pd (__m512d __v1_old, __mmask8 __mask,
extern __inline __m256
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64gather_ps (__m512i __index, float const *__addr, int __scale)
+_mm512_i64gather_ps (__m512i __index, void const *__addr, int __scale)
{
__m256 v1_old = _mm256_undefined_ps ();
__mmask8 mask = 0xFF;
@@ -9271,7 +9271,7 @@ _mm512_i64gather_ps (__m512i __index, float const *__addr, int __scale)
extern __inline __m256
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i64gather_ps (__m256 __v1_old, __mmask8 __mask,
- __m512i __index, float const *__addr, int __scale)
+ __m512i __index, void const *__addr, int __scale)
{
return (__m256) __builtin_ia32_gatherdiv16sf ((__v8sf) __v1_old,
__addr,
@@ -9281,7 +9281,7 @@ _mm512_mask_i64gather_ps (__m256 __v1_old, __mmask8 __mask,
extern __inline __m512d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64gather_pd (__m512i __index, double const *__addr, int __scale)
+_mm512_i64gather_pd (__m512i __index, void const *__addr, int __scale)
{
__m512d v1_old = _mm512_undefined_pd ();
__mmask8 mask = 0xFF;
@@ -9295,7 +9295,7 @@ _mm512_i64gather_pd (__m512i __index, double const *__addr, int __scale)
extern __inline __m512d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i64gather_pd (__m512d __v1_old, __mmask8 __mask,
- __m512i __index, double const *__addr, int __scale)
+ __m512i __index, void const *__addr, int __scale)
{
return (__m512d) __builtin_ia32_gatherdiv8df ((__v8df) __v1_old,
__addr,
@@ -9305,7 +9305,7 @@ _mm512_mask_i64gather_pd (__m512d __v1_old, __mmask8 __mask,
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32gather_epi32 (__m512i __index, int const *__addr, int __scale)
+_mm512_i32gather_epi32 (__m512i __index, void const *__addr, int __scale)
{
__m512i v1_old = _mm512_undefined_epi32 ();
__mmask16 mask = 0xFFFF;
@@ -9319,7 +9319,7 @@ _mm512_i32gather_epi32 (__m512i __index, int const *__addr, int __scale)
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i32gather_epi32 (__m512i __v1_old, __mmask16 __mask,
- __m512i __index, int const *__addr, int __scale)
+ __m512i __index, void const *__addr, int __scale)
{
return (__m512i) __builtin_ia32_gathersiv16si ((__v16si) __v1_old,
__addr,
@@ -9329,7 +9329,7 @@ _mm512_mask_i32gather_epi32 (__m512i __v1_old, __mmask16 __mask,
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32gather_epi64 (__m256i __index, long long const *__addr, int __scale)
+_mm512_i32gather_epi64 (__m256i __index, void const *__addr, int __scale)
{
__m512i v1_old = _mm512_undefined_epi32 ();
__mmask8 mask = 0xFF;
@@ -9343,7 +9343,7 @@ _mm512_i32gather_epi64 (__m256i __index, long long const *__addr, int __scale)
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i32gather_epi64 (__m512i __v1_old, __mmask8 __mask,
- __m256i __index, long long const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m512i) __builtin_ia32_gathersiv8di ((__v8di) __v1_old,
@@ -9354,7 +9354,7 @@ _mm512_mask_i32gather_epi64 (__m512i __v1_old, __mmask8 __mask,
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64gather_epi32 (__m512i __index, int const *__addr, int __scale)
+_mm512_i64gather_epi32 (__m512i __index, void const *__addr, int __scale)
{
__m256i v1_old = _mm256_undefined_si256 ();
__mmask8 mask = 0xFF;
@@ -9368,7 +9368,7 @@ _mm512_i64gather_epi32 (__m512i __index, int const *__addr, int __scale)
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i64gather_epi32 (__m256i __v1_old, __mmask8 __mask,
- __m512i __index, int const *__addr, int __scale)
+ __m512i __index, void const *__addr, int __scale)
{
return (__m256i) __builtin_ia32_gatherdiv16si ((__v8si) __v1_old,
__addr,
@@ -9378,7 +9378,7 @@ _mm512_mask_i64gather_epi32 (__m256i __v1_old, __mmask8 __mask,
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64gather_epi64 (__m512i __index, long long const *__addr, int __scale)
+_mm512_i64gather_epi64 (__m512i __index, void const *__addr, int __scale)
{
__m512i v1_old = _mm512_undefined_epi32 ();
__mmask8 mask = 0xFF;
@@ -9392,7 +9392,7 @@ _mm512_i64gather_epi64 (__m512i __index, long long const *__addr, int __scale)
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_i64gather_epi64 (__m512i __v1_old, __mmask8 __mask,
- __m512i __index, long long const *__addr,
+ __m512i __index, void const *__addr,
int __scale)
{
return (__m512i) __builtin_ia32_gatherdiv8di ((__v8di) __v1_old,
@@ -9403,7 +9403,7 @@ _mm512_mask_i64gather_epi64 (__m512i __v1_old, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32scatter_ps (float *__addr, __m512i __index, __m512 __v1, int __scale)
+_mm512_i32scatter_ps (void *__addr, __m512i __index, __m512 __v1, int __scale)
{
__builtin_ia32_scattersiv16sf (__addr, (__mmask16) 0xFFFF,
(__v16si) __index, (__v16sf) __v1, __scale);
@@ -9411,7 +9411,7 @@ _mm512_i32scatter_ps (float *__addr, __m512i __index, __m512 __v1, int __scale)
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i32scatter_ps (float *__addr, __mmask16 __mask,
+_mm512_mask_i32scatter_ps (void *__addr, __mmask16 __mask,
__m512i __index, __m512 __v1, int __scale)
{
__builtin_ia32_scattersiv16sf (__addr, __mask, (__v16si) __index,
@@ -9420,7 +9420,7 @@ _mm512_mask_i32scatter_ps (float *__addr, __mmask16 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32scatter_pd (double *__addr, __m256i __index, __m512d __v1,
+_mm512_i32scatter_pd (void *__addr, __m256i __index, __m512d __v1,
int __scale)
{
__builtin_ia32_scattersiv8df (__addr, (__mmask8) 0xFF,
@@ -9429,7 +9429,7 @@ _mm512_i32scatter_pd (double *__addr, __m256i __index, __m512d __v1,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
+_mm512_mask_i32scatter_pd (void *__addr, __mmask8 __mask,
__m256i __index, __m512d __v1, int __scale)
{
__builtin_ia32_scattersiv8df (__addr, __mask, (__v8si) __index,
@@ -9438,7 +9438,7 @@ _mm512_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64scatter_ps (float *__addr, __m512i __index, __m256 __v1, int __scale)
+_mm512_i64scatter_ps (void *__addr, __m512i __index, __m256 __v1, int __scale)
{
__builtin_ia32_scatterdiv16sf (__addr, (__mmask8) 0xFF,
(__v8di) __index, (__v8sf) __v1, __scale);
@@ -9446,7 +9446,7 @@ _mm512_i64scatter_ps (float *__addr, __m512i __index, __m256 __v1, int __scale)
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
+_mm512_mask_i64scatter_ps (void *__addr, __mmask8 __mask,
__m512i __index, __m256 __v1, int __scale)
{
__builtin_ia32_scatterdiv16sf (__addr, __mask, (__v8di) __index,
@@ -9455,7 +9455,7 @@ _mm512_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64scatter_pd (double *__addr, __m512i __index, __m512d __v1,
+_mm512_i64scatter_pd (void *__addr, __m512i __index, __m512d __v1,
int __scale)
{
__builtin_ia32_scatterdiv8df (__addr, (__mmask8) 0xFF,
@@ -9464,7 +9464,7 @@ _mm512_i64scatter_pd (double *__addr, __m512i __index, __m512d __v1,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
+_mm512_mask_i64scatter_pd (void *__addr, __mmask8 __mask,
__m512i __index, __m512d __v1, int __scale)
{
__builtin_ia32_scatterdiv8df (__addr, __mask, (__v8di) __index,
@@ -9473,7 +9473,7 @@ _mm512_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32scatter_epi32 (int *__addr, __m512i __index,
+_mm512_i32scatter_epi32 (void *__addr, __m512i __index,
__m512i __v1, int __scale)
{
__builtin_ia32_scattersiv16si (__addr, (__mmask16) 0xFFFF,
@@ -9482,7 +9482,7 @@ _mm512_i32scatter_epi32 (int *__addr, __m512i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i32scatter_epi32 (int *__addr, __mmask16 __mask,
+_mm512_mask_i32scatter_epi32 (void *__addr, __mmask16 __mask,
__m512i __index, __m512i __v1, int __scale)
{
__builtin_ia32_scattersiv16si (__addr, __mask, (__v16si) __index,
@@ -9491,7 +9491,7 @@ _mm512_mask_i32scatter_epi32 (int *__addr, __mmask16 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i32scatter_epi64 (long long *__addr, __m256i __index,
+_mm512_i32scatter_epi64 (void *__addr, __m256i __index,
__m512i __v1, int __scale)
{
__builtin_ia32_scattersiv8di (__addr, (__mmask8) 0xFF,
@@ -9500,7 +9500,7 @@ _mm512_i32scatter_epi64 (long long *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm512_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask,
__m256i __index, __m512i __v1, int __scale)
{
__builtin_ia32_scattersiv8di (__addr, __mask, (__v8si) __index,
@@ -9509,7 +9509,7 @@ _mm512_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64scatter_epi32 (int *__addr, __m512i __index,
+_mm512_i64scatter_epi32 (void *__addr, __m512i __index,
__m256i __v1, int __scale)
{
__builtin_ia32_scatterdiv16si (__addr, (__mmask8) 0xFF,
@@ -9518,7 +9518,7 @@ _mm512_i64scatter_epi32 (int *__addr, __m512i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
+_mm512_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask,
__m512i __index, __m256i __v1, int __scale)
{
__builtin_ia32_scatterdiv16si (__addr, __mask, (__v8di) __index,
@@ -9527,7 +9527,7 @@ _mm512_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_i64scatter_epi64 (long long *__addr, __m512i __index,
+_mm512_i64scatter_epi64 (void *__addr, __m512i __index,
__m512i __v1, int __scale)
{
__builtin_ia32_scatterdiv8di (__addr, (__mmask8) 0xFF,
@@ -9536,7 +9536,7 @@ _mm512_i64scatter_epi64 (long long *__addr, __m512i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm512_mask_i64scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm512_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask,
__m512i __index, __m512i __v1, int __scale)
{
__builtin_ia32_scatterdiv8di (__addr, __mask, (__v8di) __index,
@@ -9545,177 +9545,177 @@ _mm512_mask_i64scatter_epi64 (long long *__addr, __mmask8 __mask,
#else
#define _mm512_i32gather_ps(INDEX, ADDR, SCALE) \
(__m512) __builtin_ia32_gathersiv16sf ((__v16sf)_mm512_undefined_ps(),\
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v16si)(__m512i)INDEX, \
(__mmask16)0xFFFF, (int)SCALE)
#define _mm512_mask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512) __builtin_ia32_gathersiv16sf ((__v16sf)(__m512)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v16si)(__m512i)INDEX, \
(__mmask16)MASK, (int)SCALE)
#define _mm512_i32gather_pd(INDEX, ADDR, SCALE) \
(__m512d) __builtin_ia32_gathersiv8df ((__v8df)_mm512_undefined_pd(), \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512d) __builtin_ia32_gathersiv8df ((__v8df)(__m512d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i64gather_ps(INDEX, ADDR, SCALE) \
(__m256) __builtin_ia32_gatherdiv16sf ((__v8sf)_mm256_undefined_ps(), \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256) __builtin_ia32_gatherdiv16sf ((__v8sf)(__m256)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i64gather_pd(INDEX, ADDR, SCALE) \
(__m512d) __builtin_ia32_gatherdiv8df ((__v8df)_mm512_undefined_pd(), \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512d) __builtin_ia32_gatherdiv8df ((__v8df)(__m512d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i32gather_epi32(INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gathersiv16si ((__v16si)_mm512_undefined_epi32 (), \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v16si)(__m512i)INDEX, \
(__mmask16)0xFFFF, (int)SCALE)
#define _mm512_mask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gathersiv16si ((__v16si)(__m512i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v16si)(__m512i)INDEX, \
(__mmask16)MASK, (int)SCALE)
#define _mm512_i32gather_epi64(INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gathersiv8di ((__v8di)_mm512_undefined_epi32 (), \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gathersiv8di ((__v8di)(__m512i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i64gather_epi32(INDEX, ADDR, SCALE) \
(__m256i) __builtin_ia32_gatherdiv16si ((__v8si)_mm256_undefined_si256(), \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256i) __builtin_ia32_gatherdiv16si ((__v8si)(__m256i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i64gather_epi64(INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gatherdiv8di ((__v8di)_mm512_undefined_epi32 (), \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)0xFF, (int)SCALE)
#define _mm512_mask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m512i) __builtin_ia32_gatherdiv8di ((__v8di)(__m512i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v8di)(__m512i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm512_i32scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv16sf ((float *)ADDR, (__mmask16)0xFFFF, \
+ __builtin_ia32_scattersiv16sf ((void *)ADDR, (__mmask16)0xFFFF, \
(__v16si)(__m512i)INDEX, \
(__v16sf)(__m512)V1, (int)SCALE)
#define _mm512_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv16sf ((float *)ADDR, (__mmask16)MASK, \
+ __builtin_ia32_scattersiv16sf ((void *)ADDR, (__mmask16)MASK, \
(__v16si)(__m512i)INDEX, \
(__v16sf)(__m512)V1, (int)SCALE)
#define _mm512_i32scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv8df ((void *)ADDR, (__mmask8)0xFF, \
(__v8si)(__m256i)INDEX, \
(__v8df)(__m512d)V1, (int)SCALE)
#define _mm512_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv8df ((void *)ADDR, (__mmask8)MASK, \
(__v8si)(__m256i)INDEX, \
(__v8df)(__m512d)V1, (int)SCALE)
#define _mm512_i64scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv16sf ((float *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv16sf ((void *)ADDR, (__mmask8)0xFF, \
(__v8di)(__m512i)INDEX, \
(__v8sf)(__m256)V1, (int)SCALE)
#define _mm512_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv16sf ((float *)ADDR, (__mmask16)MASK, \
+ __builtin_ia32_scatterdiv16sf ((void *)ADDR, (__mmask16)MASK, \
(__v8di)(__m512i)INDEX, \
(__v8sf)(__m256)V1, (int)SCALE)
#define _mm512_i64scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv8df ((void *)ADDR, (__mmask8)0xFF, \
(__v8di)(__m512i)INDEX, \
(__v8df)(__m512d)V1, (int)SCALE)
#define _mm512_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv8df ((void *)ADDR, (__mmask8)MASK, \
(__v8di)(__m512i)INDEX, \
(__v8df)(__m512d)V1, (int)SCALE)
#define _mm512_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv16si ((int *)ADDR, (__mmask16)0xFFFF, \
+ __builtin_ia32_scattersiv16si ((void *)ADDR, (__mmask16)0xFFFF, \
(__v16si)(__m512i)INDEX, \
(__v16si)(__m512i)V1, (int)SCALE)
#define _mm512_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv16si ((int *)ADDR, (__mmask16)MASK, \
+ __builtin_ia32_scattersiv16si ((void *)ADDR, (__mmask16)MASK, \
(__v16si)(__m512i)INDEX, \
(__v16si)(__m512i)V1, (int)SCALE)
#define _mm512_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv8di ((void *)ADDR, (__mmask8)0xFF, \
(__v8si)(__m256i)INDEX, \
(__v8di)(__m512i)V1, (int)SCALE)
#define _mm512_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv8di ((void *)ADDR, (__mmask8)MASK, \
(__v8si)(__m256i)INDEX, \
(__v8di)(__m512i)V1, (int)SCALE)
#define _mm512_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv16si ((int *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv16si ((void *)ADDR, (__mmask8)0xFF, \
(__v8di)(__m512i)INDEX, \
(__v8si)(__m256i)V1, (int)SCALE)
#define _mm512_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv16si ((int *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv16si ((void *)ADDR, (__mmask8)MASK, \
(__v8di)(__m512i)INDEX, \
(__v8si)(__m256i)V1, (int)SCALE)
#define _mm512_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv8di ((void *)ADDR, (__mmask8)0xFF, \
(__v8di)(__m512i)INDEX, \
(__v8di)(__m512i)V1, (int)SCALE)
#define _mm512_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv8di ((void *)ADDR, (__mmask8)MASK, \
(__v8di)(__m512i)INDEX, \
(__v8di)(__m512i)V1, (int)SCALE)
#endif
diff --git a/gcc/config/i386/avx512pfintrin.h b/gcc/config/i386/avx512pfintrin.h
index 06599c3082d..3162fefc220 100644
--- a/gcc/config/i386/avx512pfintrin.h
+++ b/gcc/config/i386/avx512pfintrin.h
@@ -49,37 +49,33 @@ typedef unsigned short __mmask16;
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i32gather_pd (__m256i index, __mmask8 mask,
- void *addr, int scale, int hint)
+ void const *addr, int scale, int hint)
{
- __builtin_ia32_gatherpfdpd (mask, (__v8si) index, (long long const *) addr,
- scale, hint);
+ __builtin_ia32_gatherpfdpd (mask, (__v8si) index, addr, scale, hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i32gather_ps (__m512i index, __mmask16 mask,
- void *addr, int scale, int hint)
+ void const *addr, int scale, int hint)
{
- __builtin_ia32_gatherpfdps (mask, (__v16si) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_gatherpfdps (mask, (__v16si) index, addr, scale, hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i64gather_pd (__m512i index, __mmask8 mask,
- void *addr, int scale, int hint)
+ void const *addr, int scale, int hint)
{
- __builtin_ia32_gatherpfqpd (mask, (__v8di) index, (long long const *) addr,
- scale, hint);
+ __builtin_ia32_gatherpfqpd (mask, (__v8di) index, addr, scale, hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i64gather_ps (__m512i index, __mmask8 mask,
- void *addr, int scale, int hint)
+ void const *addr, int scale, int hint)
{
- __builtin_ia32_gatherpfqps (mask, (__v8di) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_gatherpfqps (mask, (__v8di) index, addr, scale, hint);
}
extern __inline void
@@ -87,8 +83,8 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i32scatter_pd (void *addr, __m256i index, int scale,
int hint)
{
- __builtin_ia32_scatterpfdpd ((__mmask8) 0xFF, (__v8si) index,
- (long long const *)addr, scale, hint);
+ __builtin_ia32_scatterpfdpd ((__mmask8) 0xFF, (__v8si) index, addr, scale,
+ hint);
}
extern __inline void
@@ -96,8 +92,8 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i32scatter_ps (void *addr, __m512i index, int scale,
int hint)
{
- __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, addr, scale,
+ hint);
}
extern __inline void
@@ -105,8 +101,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i32scatter_pd (void *addr, __mmask8 mask,
__m256i index, int scale, int hint)
{
- __builtin_ia32_scatterpfdpd (mask, (__v8si) index, (long long const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfdpd (mask, (__v8si) index, addr, scale, hint);
}
extern __inline void
@@ -114,8 +109,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i32scatter_ps (void *addr, __mmask16 mask,
__m512i index, int scale, int hint)
{
- __builtin_ia32_scatterpfdps (mask, (__v16si) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfdps (mask, (__v16si) index, addr, scale, hint);
}
extern __inline void
@@ -123,8 +117,8 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i64scatter_pd (void *addr, __m512i index, int scale,
int hint)
{
- __builtin_ia32_scatterpfqpd ((__mmask8) 0xFF, (__v8di) index, (long long const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfqpd ((__mmask8) 0xFF, (__v8di) index, addr, scale,
+ hint);
}
extern __inline void
@@ -132,8 +126,8 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i64scatter_ps (void *addr, __m512i index, int scale,
int hint)
{
- __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, addr, scale,
+ hint);
}
extern __inline void
@@ -141,8 +135,7 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i64scatter_pd (void *addr, __mmask16 mask,
__m512i index, int scale, int hint)
{
- __builtin_ia32_scatterpfqpd (mask, (__v8di) index, (long long const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfqpd (mask, (__v8di) index, addr, scale, hint);
}
extern __inline void
@@ -150,58 +143,57 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i64scatter_ps (void *addr, __mmask16 mask,
__m512i index, int scale, int hint)
{
- __builtin_ia32_scatterpfqps (mask, (__v8di) index, (int const *) addr,
- scale, hint);
+ __builtin_ia32_scatterpfqps (mask, (__v8di) index, addr, scale, hint);
}
#else
#define _mm512_mask_prefetch_i32gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void const *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i32gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void const *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i64gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i64gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i32scatter_pd(ADDR, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfdpd ((__mmask8)0xFF, (__v8si)(__m256i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i32scatter_ps(ADDR, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i32scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i32scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i64scatter_pd(ADDR, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfqpd ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i64scatter_ps(ADDR, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfqps ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i64scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
- (long long const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i64scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
__builtin_ia32_scatterpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
- (int const *)ADDR, (int)SCALE, (int)HINT)
+ (void *)ADDR, (int)SCALE, (int)HINT)
#endif
#ifdef __DISABLE_AVX512PF__
diff --git a/gcc/config/i386/avx512vlintrin.h b/gcc/config/i386/avx512vlintrin.h
index d627ad86da2..ce2832efef4 100644
--- a/gcc/config/i386/avx512vlintrin.h
+++ b/gcc/config/i386/avx512vlintrin.h
@@ -10216,7 +10216,7 @@ _mm_maskz_getmant_pd (__mmask8 __U, __m128d __A,
extern __inline __m256
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i32gather_ps (__m256 __v1_old, __mmask8 __mask,
- __m256i __index, float const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m256) __builtin_ia32_gather3siv8sf ((__v8sf) __v1_old,
@@ -10228,7 +10228,7 @@ _mm256_mmask_i32gather_ps (__m256 __v1_old, __mmask8 __mask,
extern __inline __m128
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i32gather_ps (__m128 __v1_old, __mmask8 __mask,
- __m128i __index, float const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128) __builtin_ia32_gather3siv4sf ((__v4sf) __v1_old,
@@ -10240,7 +10240,7 @@ _mm_mmask_i32gather_ps (__m128 __v1_old, __mmask8 __mask,
extern __inline __m256d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i32gather_pd (__m256d __v1_old, __mmask8 __mask,
- __m128i __index, double const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m256d) __builtin_ia32_gather3siv4df ((__v4df) __v1_old,
@@ -10252,7 +10252,7 @@ _mm256_mmask_i32gather_pd (__m256d __v1_old, __mmask8 __mask,
extern __inline __m128d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i32gather_pd (__m128d __v1_old, __mmask8 __mask,
- __m128i __index, double const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128d) __builtin_ia32_gather3siv2df ((__v2df) __v1_old,
@@ -10264,7 +10264,7 @@ _mm_mmask_i32gather_pd (__m128d __v1_old, __mmask8 __mask,
extern __inline __m128
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask,
- __m256i __index, float const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m128) __builtin_ia32_gather3div8sf ((__v4sf) __v1_old,
@@ -10276,7 +10276,7 @@ _mm256_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask,
extern __inline __m128
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask,
- __m128i __index, float const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128) __builtin_ia32_gather3div4sf ((__v4sf) __v1_old,
@@ -10288,7 +10288,7 @@ _mm_mmask_i64gather_ps (__m128 __v1_old, __mmask8 __mask,
extern __inline __m256d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i64gather_pd (__m256d __v1_old, __mmask8 __mask,
- __m256i __index, double const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m256d) __builtin_ia32_gather3div4df ((__v4df) __v1_old,
@@ -10300,7 +10300,7 @@ _mm256_mmask_i64gather_pd (__m256d __v1_old, __mmask8 __mask,
extern __inline __m128d
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i64gather_pd (__m128d __v1_old, __mmask8 __mask,
- __m128i __index, double const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128d) __builtin_ia32_gather3div2df ((__v2df) __v1_old,
@@ -10312,7 +10312,7 @@ _mm_mmask_i64gather_pd (__m128d __v1_old, __mmask8 __mask,
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i32gather_epi32 (__m256i __v1_old, __mmask8 __mask,
- __m256i __index, int const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m256i) __builtin_ia32_gather3siv8si ((__v8si) __v1_old,
@@ -10324,7 +10324,7 @@ _mm256_mmask_i32gather_epi32 (__m256i __v1_old, __mmask8 __mask,
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i32gather_epi32 (__m128i __v1_old, __mmask8 __mask,
- __m128i __index, int const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128i) __builtin_ia32_gather3siv4si ((__v4si) __v1_old,
@@ -10336,7 +10336,7 @@ _mm_mmask_i32gather_epi32 (__m128i __v1_old, __mmask8 __mask,
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i32gather_epi64 (__m256i __v1_old, __mmask8 __mask,
- __m128i __index, long long const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m256i) __builtin_ia32_gather3siv4di ((__v4di) __v1_old,
@@ -10348,7 +10348,7 @@ _mm256_mmask_i32gather_epi64 (__m256i __v1_old, __mmask8 __mask,
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i32gather_epi64 (__m128i __v1_old, __mmask8 __mask,
- __m128i __index, long long const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128i) __builtin_ia32_gather3siv2di ((__v2di) __v1_old,
@@ -10360,7 +10360,7 @@ _mm_mmask_i32gather_epi64 (__m128i __v1_old, __mmask8 __mask,
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask,
- __m256i __index, int const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m128i) __builtin_ia32_gather3div8si ((__v4si) __v1_old,
@@ -10372,7 +10372,7 @@ _mm256_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask,
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask,
- __m128i __index, int const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128i) __builtin_ia32_gather3div4si ((__v4si) __v1_old,
@@ -10384,7 +10384,7 @@ _mm_mmask_i64gather_epi32 (__m128i __v1_old, __mmask8 __mask,
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_mmask_i64gather_epi64 (__m256i __v1_old, __mmask8 __mask,
- __m256i __index, long long const *__addr,
+ __m256i __index, void const *__addr,
int __scale)
{
return (__m256i) __builtin_ia32_gather3div4di ((__v4di) __v1_old,
@@ -10396,7 +10396,7 @@ _mm256_mmask_i64gather_epi64 (__m256i __v1_old, __mmask8 __mask,
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mmask_i64gather_epi64 (__m128i __v1_old, __mmask8 __mask,
- __m128i __index, long long const *__addr,
+ __m128i __index, void const *__addr,
int __scale)
{
return (__m128i) __builtin_ia32_gather3div2di ((__v2di) __v1_old,
@@ -10407,7 +10407,7 @@ _mm_mmask_i64gather_epi64 (__m128i __v1_old, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i32scatter_ps (float *__addr, __m256i __index,
+_mm256_i32scatter_ps (void *__addr, __m256i __index,
__m256 __v1, const int __scale)
{
__builtin_ia32_scattersiv8sf (__addr, (__mmask8) 0xFF,
@@ -10417,7 +10417,7 @@ _mm256_i32scatter_ps (float *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i32scatter_ps (float *__addr, __mmask8 __mask,
+_mm256_mask_i32scatter_ps (void *__addr, __mmask8 __mask,
__m256i __index, __m256 __v1,
const int __scale)
{
@@ -10427,7 +10427,7 @@ _mm256_mask_i32scatter_ps (float *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i32scatter_ps (float *__addr, __m128i __index, __m128 __v1,
+_mm_i32scatter_ps (void *__addr, __m128i __index, __m128 __v1,
const int __scale)
{
__builtin_ia32_scattersiv4sf (__addr, (__mmask8) 0xFF,
@@ -10437,7 +10437,7 @@ _mm_i32scatter_ps (float *__addr, __m128i __index, __m128 __v1,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i32scatter_ps (float *__addr, __mmask8 __mask,
+_mm_mask_i32scatter_ps (void *__addr, __mmask8 __mask,
__m128i __index, __m128 __v1,
const int __scale)
{
@@ -10447,7 +10447,7 @@ _mm_mask_i32scatter_ps (float *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i32scatter_pd (double *__addr, __m128i __index,
+_mm256_i32scatter_pd (void *__addr, __m128i __index,
__m256d __v1, const int __scale)
{
__builtin_ia32_scattersiv4df (__addr, (__mmask8) 0xFF,
@@ -10457,7 +10457,7 @@ _mm256_i32scatter_pd (double *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
+_mm256_mask_i32scatter_pd (void *__addr, __mmask8 __mask,
__m128i __index, __m256d __v1,
const int __scale)
{
@@ -10467,7 +10467,7 @@ _mm256_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i32scatter_pd (double *__addr, __m128i __index,
+_mm_i32scatter_pd (void *__addr, __m128i __index,
__m128d __v1, const int __scale)
{
__builtin_ia32_scattersiv2df (__addr, (__mmask8) 0xFF,
@@ -10477,7 +10477,7 @@ _mm_i32scatter_pd (double *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
+_mm_mask_i32scatter_pd (void *__addr, __mmask8 __mask,
__m128i __index, __m128d __v1,
const int __scale)
{
@@ -10487,7 +10487,7 @@ _mm_mask_i32scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i64scatter_ps (float *__addr, __m256i __index,
+_mm256_i64scatter_ps (void *__addr, __m256i __index,
__m128 __v1, const int __scale)
{
__builtin_ia32_scatterdiv8sf (__addr, (__mmask8) 0xFF,
@@ -10497,7 +10497,7 @@ _mm256_i64scatter_ps (float *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
+_mm256_mask_i64scatter_ps (void *__addr, __mmask8 __mask,
__m256i __index, __m128 __v1,
const int __scale)
{
@@ -10507,7 +10507,7 @@ _mm256_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i64scatter_ps (float *__addr, __m128i __index, __m128 __v1,
+_mm_i64scatter_ps (void *__addr, __m128i __index, __m128 __v1,
const int __scale)
{
__builtin_ia32_scatterdiv4sf (__addr, (__mmask8) 0xFF,
@@ -10517,7 +10517,7 @@ _mm_i64scatter_ps (float *__addr, __m128i __index, __m128 __v1,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
+_mm_mask_i64scatter_ps (void *__addr, __mmask8 __mask,
__m128i __index, __m128 __v1,
const int __scale)
{
@@ -10527,7 +10527,7 @@ _mm_mask_i64scatter_ps (float *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i64scatter_pd (double *__addr, __m256i __index,
+_mm256_i64scatter_pd (void *__addr, __m256i __index,
__m256d __v1, const int __scale)
{
__builtin_ia32_scatterdiv4df (__addr, (__mmask8) 0xFF,
@@ -10537,7 +10537,7 @@ _mm256_i64scatter_pd (double *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
+_mm256_mask_i64scatter_pd (void *__addr, __mmask8 __mask,
__m256i __index, __m256d __v1,
const int __scale)
{
@@ -10547,7 +10547,7 @@ _mm256_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i64scatter_pd (double *__addr, __m128i __index,
+_mm_i64scatter_pd (void *__addr, __m128i __index,
__m128d __v1, const int __scale)
{
__builtin_ia32_scatterdiv2df (__addr, (__mmask8) 0xFF,
@@ -10557,7 +10557,7 @@ _mm_i64scatter_pd (double *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
+_mm_mask_i64scatter_pd (void *__addr, __mmask8 __mask,
__m128i __index, __m128d __v1,
const int __scale)
{
@@ -10567,7 +10567,7 @@ _mm_mask_i64scatter_pd (double *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i32scatter_epi32 (int *__addr, __m256i __index,
+_mm256_i32scatter_epi32 (void *__addr, __m256i __index,
__m256i __v1, const int __scale)
{
__builtin_ia32_scattersiv8si (__addr, (__mmask8) 0xFF,
@@ -10577,7 +10577,7 @@ _mm256_i32scatter_epi32 (int *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i32scatter_epi32 (int *__addr, __mmask8 __mask,
+_mm256_mask_i32scatter_epi32 (void *__addr, __mmask8 __mask,
__m256i __index, __m256i __v1,
const int __scale)
{
@@ -10587,7 +10587,7 @@ _mm256_mask_i32scatter_epi32 (int *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i32scatter_epi32 (int *__addr, __m128i __index,
+_mm_i32scatter_epi32 (void *__addr, __m128i __index,
__m128i __v1, const int __scale)
{
__builtin_ia32_scattersiv4si (__addr, (__mmask8) 0xFF,
@@ -10597,7 +10597,7 @@ _mm_i32scatter_epi32 (int *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i32scatter_epi32 (int *__addr, __mmask8 __mask,
+_mm_mask_i32scatter_epi32 (void *__addr, __mmask8 __mask,
__m128i __index, __m128i __v1,
const int __scale)
{
@@ -10607,7 +10607,7 @@ _mm_mask_i32scatter_epi32 (int *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i32scatter_epi64 (long long *__addr, __m128i __index,
+_mm256_i32scatter_epi64 (void *__addr, __m128i __index,
__m256i __v1, const int __scale)
{
__builtin_ia32_scattersiv4di (__addr, (__mmask8) 0xFF,
@@ -10617,7 +10617,7 @@ _mm256_i32scatter_epi64 (long long *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm256_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask,
__m128i __index, __m256i __v1,
const int __scale)
{
@@ -10627,7 +10627,7 @@ _mm256_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i32scatter_epi64 (long long *__addr, __m128i __index,
+_mm_i32scatter_epi64 (void *__addr, __m128i __index,
__m128i __v1, const int __scale)
{
__builtin_ia32_scattersiv2di (__addr, (__mmask8) 0xFF,
@@ -10637,7 +10637,7 @@ _mm_i32scatter_epi64 (long long *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm_mask_i32scatter_epi64 (void *__addr, __mmask8 __mask,
__m128i __index, __m128i __v1,
const int __scale)
{
@@ -10647,7 +10647,7 @@ _mm_mask_i32scatter_epi64 (long long *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i64scatter_epi32 (int *__addr, __m256i __index,
+_mm256_i64scatter_epi32 (void *__addr, __m256i __index,
__m128i __v1, const int __scale)
{
__builtin_ia32_scatterdiv8si (__addr, (__mmask8) 0xFF,
@@ -10657,7 +10657,7 @@ _mm256_i64scatter_epi32 (int *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
+_mm256_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask,
__m256i __index, __m128i __v1,
const int __scale)
{
@@ -10667,7 +10667,7 @@ _mm256_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i64scatter_epi32 (int *__addr, __m128i __index,
+_mm_i64scatter_epi32 (void *__addr, __m128i __index,
__m128i __v1, const int __scale)
{
__builtin_ia32_scatterdiv4si (__addr, (__mmask8) 0xFF,
@@ -10677,7 +10677,7 @@ _mm_i64scatter_epi32 (int *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
+_mm_mask_i64scatter_epi32 (void *__addr, __mmask8 __mask,
__m128i __index, __m128i __v1,
const int __scale)
{
@@ -10687,7 +10687,7 @@ _mm_mask_i64scatter_epi32 (int *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_i64scatter_epi64 (long long *__addr, __m256i __index,
+_mm256_i64scatter_epi64 (void *__addr, __m256i __index,
__m256i __v1, const int __scale)
{
__builtin_ia32_scatterdiv4di (__addr, (__mmask8) 0xFF,
@@ -10697,7 +10697,7 @@ _mm256_i64scatter_epi64 (long long *__addr, __m256i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_mask_i64scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm256_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask,
__m256i __index, __m256i __v1,
const int __scale)
{
@@ -10707,7 +10707,7 @@ _mm256_mask_i64scatter_epi64 (long long *__addr, __mmask8 __mask,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_i64scatter_epi64 (long long *__addr, __m128i __index,
+_mm_i64scatter_epi64 (void *__addr, __m128i __index,
__m128i __v1, const int __scale)
{
__builtin_ia32_scatterdiv2di (__addr, (__mmask8) 0xFF,
@@ -10717,7 +10717,7 @@ _mm_i64scatter_epi64 (long long *__addr, __m128i __index,
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
-_mm_mask_i64scatter_epi64 (long long *__addr, __mmask8 __mask,
+_mm_mask_i64scatter_epi64 (void *__addr, __mmask8 __mask,
__m128i __index, __m128i __v1,
const int __scale)
{
@@ -12868,257 +12868,257 @@ _mm_cmple_epi64_mask (__m128i __X, __m128i __Y)
#define _mm256_mmask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256) __builtin_ia32_gather3siv8sf ((__v8sf)(__m256)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i32gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128) __builtin_ia32_gather3siv4sf ((__v4sf)(__m128)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256d) __builtin_ia32_gather3siv4df ((__v4df)(__m256d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i32gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128d) __builtin_ia32_gather3siv2df ((__v2df)(__m128d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128) __builtin_ia32_gather3div8sf ((__v4sf)(__m128)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v4di)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i64gather_ps(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128) __builtin_ia32_gather3div4sf ((__v4sf)(__m128)V1OLD, \
- (float const *)ADDR, \
+ (void const *)ADDR, \
(__v2di)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256d) __builtin_ia32_gather3div4df ((__v4df)(__m256d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v4di)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i64gather_pd(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128d) __builtin_ia32_gather3div2df ((__v2df)(__m128d)V1OLD, \
- (double const *)ADDR, \
+ (void const *)ADDR, \
(__v2di)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256i) __builtin_ia32_gather3siv8si ((__v8si)(__m256i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v8si)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i32gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128i) __builtin_ia32_gather3siv4si ((__v4si)(__m128i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256i) __builtin_ia32_gather3siv4di ((__v4di)(__m256i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i32gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128i) __builtin_ia32_gather3siv2di ((__v2di)(__m128i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v4si)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128i) __builtin_ia32_gather3div8si ((__v4si)(__m128i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v4di)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i64gather_epi32(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128i) __builtin_ia32_gather3div4si ((__v4si)(__m128i)V1OLD, \
- (int const *)ADDR, \
+ (void const *)ADDR, \
(__v2di)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_mmask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m256i) __builtin_ia32_gather3div4di ((__v4di)(__m256i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v4di)(__m256i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm_mmask_i64gather_epi64(V1OLD, MASK, INDEX, ADDR, SCALE) \
(__m128i) __builtin_ia32_gather3div2di ((__v2di)(__m128i)V1OLD, \
- (long long const *)ADDR, \
+ (void const *)ADDR, \
(__v2di)(__m128i)INDEX, \
(__mmask8)MASK, (int)SCALE)
#define _mm256_i32scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8sf ((float *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv8sf ((void *)ADDR, (__mmask8)0xFF, \
(__v8si)(__m256i)INDEX, \
(__v8sf)(__m256)V1, (int)SCALE)
#define _mm256_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8sf ((float *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv8sf ((void *)ADDR, (__mmask8)MASK, \
(__v8si)(__m256i)INDEX, \
(__v8sf)(__m256)V1, (int)SCALE)
#define _mm_i32scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4sf ((float *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv4sf ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm_mask_i32scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4sf ((float *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv4sf ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm256_i32scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv4df ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v4df)(__m256d)V1, (int)SCALE)
#define _mm256_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv4df ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v4df)(__m256d)V1, (int)SCALE)
#define _mm_i32scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv2df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv2df ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v2df)(__m128d)V1, (int)SCALE)
#define _mm_mask_i32scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv2df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv2df ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v2df)(__m128d)V1, (int)SCALE)
#define _mm256_i64scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8sf ((float *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv8sf ((void *)ADDR, (__mmask8)0xFF, \
(__v4di)(__m256i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm256_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8sf ((float *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv8sf ((void *)ADDR, (__mmask8)MASK, \
(__v4di)(__m256i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm_i64scatter_ps(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4sf ((float *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv4sf ((void *)ADDR, (__mmask8)0xFF, \
(__v2di)(__m128i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm_mask_i64scatter_ps(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4sf ((float *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv4sf ((void *)ADDR, (__mmask8)MASK, \
(__v2di)(__m128i)INDEX, \
(__v4sf)(__m128)V1, (int)SCALE)
#define _mm256_i64scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv4df ((void *)ADDR, (__mmask8)0xFF, \
(__v4di)(__m256i)INDEX, \
(__v4df)(__m256d)V1, (int)SCALE)
#define _mm256_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv4df ((void *)ADDR, (__mmask8)MASK, \
(__v4di)(__m256i)INDEX, \
(__v4df)(__m256d)V1, (int)SCALE)
#define _mm_i64scatter_pd(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv2df ((double *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv2df ((void *)ADDR, (__mmask8)0xFF, \
(__v2di)(__m128i)INDEX, \
(__v2df)(__m128d)V1, (int)SCALE)
#define _mm_mask_i64scatter_pd(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv2df ((double *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv2df ((void *)ADDR, (__mmask8)MASK, \
(__v2di)(__m128i)INDEX, \
(__v2df)(__m128d)V1, (int)SCALE)
#define _mm256_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8si ((int *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv8si ((void *)ADDR, (__mmask8)0xFF, \
(__v8si)(__m256i)INDEX, \
(__v8si)(__m256i)V1, (int)SCALE)
#define _mm256_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv8si ((int *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv8si ((void *)ADDR, (__mmask8)MASK, \
(__v8si)(__m256i)INDEX, \
(__v8si)(__m256i)V1, (int)SCALE)
#define _mm_i32scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4si ((int *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv4si ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm_mask_i32scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4si ((int *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv4si ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm256_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv4di ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v4di)(__m256i)V1, (int)SCALE)
#define _mm256_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv4di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv4di ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v4di)(__m256i)V1, (int)SCALE)
#define _mm_i32scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv2di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scattersiv2di ((void *)ADDR, (__mmask8)0xFF, \
(__v4si)(__m128i)INDEX, \
(__v2di)(__m128i)V1, (int)SCALE)
#define _mm_mask_i32scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scattersiv2di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scattersiv2di ((void *)ADDR, (__mmask8)MASK, \
(__v4si)(__m128i)INDEX, \
(__v2di)(__m128i)V1, (int)SCALE)
#define _mm256_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8si ((int *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv8si ((void *)ADDR, (__mmask8)0xFF, \
(__v4di)(__m256i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm256_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv8si ((int *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv8si ((void *)ADDR, (__mmask8)MASK, \
(__v4di)(__m256i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm_i64scatter_epi32(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4si ((int *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv4si ((void *)ADDR, (__mmask8)0xFF, \
(__v2di)(__m128i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm_mask_i64scatter_epi32(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4si ((int *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv4si ((void *)ADDR, (__mmask8)MASK, \
(__v2di)(__m128i)INDEX, \
(__v4si)(__m128i)V1, (int)SCALE)
#define _mm256_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv4di ((void *)ADDR, (__mmask8)0xFF, \
(__v4di)(__m256i)INDEX, \
(__v4di)(__m256i)V1, (int)SCALE)
#define _mm256_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv4di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv4di ((void *)ADDR, (__mmask8)MASK, \
(__v4di)(__m256i)INDEX, \
(__v4di)(__m256i)V1, (int)SCALE)
#define _mm_i64scatter_epi64(ADDR, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv2di ((long long *)ADDR, (__mmask8)0xFF, \
+ __builtin_ia32_scatterdiv2di ((void *)ADDR, (__mmask8)0xFF, \
(__v2di)(__m128i)INDEX, \
(__v2di)(__m128i)V1, (int)SCALE)
#define _mm_mask_i64scatter_epi64(ADDR, MASK, INDEX, V1, SCALE) \
- __builtin_ia32_scatterdiv2di ((long long *)ADDR, (__mmask8)MASK, \
+ __builtin_ia32_scatterdiv2di ((void *)ADDR, (__mmask8)MASK, \
(__v2di)(__m128i)INDEX, \
(__v2di)(__m128i)V1, (int)SCALE)
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index 2a946bf611a..3cf9b18edfa 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -89,7 +89,7 @@
#define bit_AVX512CD (1 << 28)
#define bit_SHA (1 << 29)
#define bit_AVX512BW (1 << 30)
-#define bit_AVX512VL (1 << 31)
+#define bit_AVX512VL (1u << 31)
/* %ecx */
#define bit_PREFETCHWT1 (1 << 0)
diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def
index e055232a44c..70f6b9cbcb2 100644
--- a/gcc/config/i386/i386-builtin-types.def
+++ b/gcc/config/i386/i386-builtin-types.def
@@ -969,72 +969,72 @@ DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V2DI, V4SI, INT)
DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V4DI, V4SI, INT)
DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V4DI, V8SI, INT)
-DEF_FUNCTION_TYPE (V16SF, V16SF, PCFLOAT, V16SI, HI, INT)
DEF_FUNCTION_TYPE (V16SF, V16SF, PCFLOAT, V8DI, HI, INT)
-DEF_FUNCTION_TYPE (V8DF, V8DF, PCDOUBLE, V8SI, QI, INT)
DEF_FUNCTION_TYPE (V8DF, V8DF, PCDOUBLE, V16SI, QI, INT)
-DEF_FUNCTION_TYPE (V8SF, V8SF, PCFLOAT, V8DI, QI, INT)
-DEF_FUNCTION_TYPE (V8DF, V8DF, PCDOUBLE, V8DI, QI, INT)
-DEF_FUNCTION_TYPE (V16SI, V16SI, PCINT, V16SI, HI, INT)
DEF_FUNCTION_TYPE (V16SI, V16SI, PCINT, V8DI, HI, INT)
-DEF_FUNCTION_TYPE (V8DI, V8DI, PCINT64, V8SI, QI, INT)
DEF_FUNCTION_TYPE (V8DI, V8DI, PCINT64, V16SI, QI, INT)
-DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V8DI, QI, INT)
-DEF_FUNCTION_TYPE (V8DI, V8DI, PCINT64, V8DI, QI, INT)
-DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE, V4SI, QI, INT)
-DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V4SI, QI, INT)
DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V8SI, QI, INT)
-DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE, V2DI, QI, INT)
-DEF_FUNCTION_TYPE (V4DF, V4DF, PCDOUBLE, V4DI, QI, INT)
-DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V4SI, QI, INT)
-DEF_FUNCTION_TYPE (V8SF, V8SF, PCFLOAT, V8SI, QI, INT)
-DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V2DI, QI, INT)
-DEF_FUNCTION_TYPE (V4SF, V4SF, PCFLOAT, V4DI, QI, INT)
DEF_FUNCTION_TYPE (V8SF, V8SF, PCFLOAT, V4DI, QI, INT)
-DEF_FUNCTION_TYPE (V2DI, V2DI, PCINT64, V4SI, QI, INT)
-DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V4SI, QI, INT)
DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V8SI, QI, INT)
-DEF_FUNCTION_TYPE (V2DI, V2DI, PCINT64, V2DI, QI, INT)
-DEF_FUNCTION_TYPE (V4DI, V4DI, PCINT64, V4DI, QI, INT)
-DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V4SI, QI, INT)
-DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V8SI, QI, INT)
-DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V2DI, QI, INT)
-DEF_FUNCTION_TYPE (V4SI, V4SI, PCINT, V4DI, QI, INT)
DEF_FUNCTION_TYPE (V8SI, V8SI, PCINT, V4DI, QI, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, HI, V16SI, V16SF, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, QI, V8SI, V8SF, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, QI, V4SI, V4SF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V8SI, V8DF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V4SI, V4DF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V4SI, V2DF, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, QI, V8DI, V8SF, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, QI, V4DI, V4SF, INT)
-DEF_FUNCTION_TYPE (VOID, PFLOAT, QI, V2DI, V4SF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V8DI, V8DF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V4DI, V4DF, INT)
-DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V2DI, V2DF, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, HI, V16SI, V16SI, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, QI, V8SI, V8SI, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, QI, V4SI, V4SI, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V8SI, V8DI, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V4SI, V4DI, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V4SI, V2DI, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, QI, V8DI, V8SI, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, QI, V4DI, V4SI, INT)
-DEF_FUNCTION_TYPE (VOID, PINT, QI, V2DI, V4SI, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V8DI, V8DI, INT)
DEF_FUNCTION_TYPE (VOID, PFLOAT, HI, V8DI, V16SF, INT)
DEF_FUNCTION_TYPE (VOID, PDOUBLE, QI, V16SI, V8DF, INT)
DEF_FUNCTION_TYPE (VOID, PINT, HI, V8DI, V16SI, INT)
DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V16SI, V8DI, INT)
-DEF_FUNCTION_TYPE (VOID, QI, V8SI, PCINT64, INT, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V4DI, V4DI, INT)
-DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V2DI, V2DI, INT)
-DEF_FUNCTION_TYPE (VOID, HI, V16SI, PCINT, INT, INT)
-DEF_FUNCTION_TYPE (VOID, QI, V8DI, PCINT64, INT, INT)
-DEF_FUNCTION_TYPE (VOID, QI, V8DI, PCINT, INT, INT)
+
+DEF_FUNCTION_TYPE (V16SF, V16SF, PCVOID, V16SI, HI, INT)
+DEF_FUNCTION_TYPE (V8DF, V8DF, PCVOID, V8SI, QI, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, PCVOID, V8DI, QI, INT)
+DEF_FUNCTION_TYPE (V8DF, V8DF, PCVOID, V8DI, QI, INT)
+DEF_FUNCTION_TYPE (V16SI, V16SI, PCVOID, V16SI, HI, INT)
+DEF_FUNCTION_TYPE (V8DI, V8DI, PCVOID, V8SI, QI, INT)
+DEF_FUNCTION_TYPE (V8SI, V8SI, PCVOID, V8DI, QI, INT)
+DEF_FUNCTION_TYPE (V8DI, V8DI, PCVOID, V8DI, QI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, HI, V16SI, V16SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8SI, V8DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8DI, V8SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8DI, V8DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, HI, V16SI, V16SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8SI, V8DI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8DI, V8SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8DI, V8DI, INT)
+DEF_FUNCTION_TYPE (V2DF, V2DF, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V2DF, V2DF, PCVOID, V2DI, QI, INT)
+DEF_FUNCTION_TYPE (V4DF, V4DF, PCVOID, V4DI, QI, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V8SF, V8SF, PCVOID, V8SI, QI, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, PCVOID, V2DI, QI, INT)
+DEF_FUNCTION_TYPE (V4SF, V4SF, PCVOID, V4DI, QI, INT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V4DI, V4DI, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V2DI, V2DI, PCVOID, V2DI, QI, INT)
+DEF_FUNCTION_TYPE (V4DI, V4DI, PCVOID, V4DI, QI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, PCVOID, V4SI, QI, INT)
+DEF_FUNCTION_TYPE (V8SI, V8SI, PCVOID, V8SI, QI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, PCVOID, V2DI, QI, INT)
+DEF_FUNCTION_TYPE (V4SI, V4SI, PCVOID, V4DI, QI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8SI, V8SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V4SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V4DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V2DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4DI, V4SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V2DI, V4SF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4DI, V4DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V2DI, V2DF, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V8SI, V8SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V4SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V4DI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4SI, V2DI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4DI, V4SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V2DI, V4SI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V4DI, V4DI, INT)
+DEF_FUNCTION_TYPE (VOID, PVOID, QI, V2DI, V2DI, INT)
+DEF_FUNCTION_TYPE (VOID, QI, V8SI, PCVOID, INT, INT)
+DEF_FUNCTION_TYPE (VOID, HI, V16SI, PCVOID, INT, INT)
+DEF_FUNCTION_TYPE (VOID, QI, V8DI, PCVOID, INT, INT)
DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF, ROUND)
DEF_FUNCTION_TYPE_ALIAS (V4DF_FTYPE_V4DF, ROUND)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6cb5decdadd..371b84e3f6f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29373,7 +29373,7 @@ ix86_local_alignment (tree exp, machine_mode mode,
!= TYPE_MAIN_VARIANT (va_list_type_node)))
&& TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && wi::geu_p (TYPE_SIZE (type), 16)
+ && wi::geu_p (TYPE_SIZE (type), 128)
&& align < 128)
return 128;
}
@@ -35720,35 +35720,35 @@ ix86_init_mmx_sse_builtins (void)
/* AVX512F */
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gathersiv16sf",
- V16SF_FTYPE_V16SF_PCFLOAT_V16SI_HI_INT,
+ V16SF_FTYPE_V16SF_PCVOID_V16SI_HI_INT,
IX86_BUILTIN_GATHER3SIV16SF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gathersiv8df",
- V8DF_FTYPE_V8DF_PCDOUBLE_V8SI_QI_INT,
+ V8DF_FTYPE_V8DF_PCVOID_V8SI_QI_INT,
IX86_BUILTIN_GATHER3SIV8DF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gatherdiv16sf",
- V8SF_FTYPE_V8SF_PCFLOAT_V8DI_QI_INT,
+ V8SF_FTYPE_V8SF_PCVOID_V8DI_QI_INT,
IX86_BUILTIN_GATHER3DIV16SF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gatherdiv8df",
- V8DF_FTYPE_V8DF_PCDOUBLE_V8DI_QI_INT,
+ V8DF_FTYPE_V8DF_PCVOID_V8DI_QI_INT,
IX86_BUILTIN_GATHER3DIV8DF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gathersiv16si",
- V16SI_FTYPE_V16SI_PCINT_V16SI_HI_INT,
+ V16SI_FTYPE_V16SI_PCVOID_V16SI_HI_INT,
IX86_BUILTIN_GATHER3SIV16SI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gathersiv8di",
- V8DI_FTYPE_V8DI_PCINT64_V8SI_QI_INT,
+ V8DI_FTYPE_V8DI_PCVOID_V8SI_QI_INT,
IX86_BUILTIN_GATHER3SIV8DI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gatherdiv16si",
- V8SI_FTYPE_V8SI_PCINT_V8DI_QI_INT,
+ V8SI_FTYPE_V8SI_PCVOID_V8DI_QI_INT,
IX86_BUILTIN_GATHER3DIV16SI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gatherdiv8di",
- V8DI_FTYPE_V8DI_PCINT64_V8DI_QI_INT,
+ V8DI_FTYPE_V8DI_PCVOID_V8DI_QI_INT,
IX86_BUILTIN_GATHER3DIV8DI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_gatheraltsiv8df ",
@@ -35768,100 +35768,100 @@ ix86_init_mmx_sse_builtins (void)
IX86_BUILTIN_GATHER3ALTDIV16SI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scattersiv16sf",
- VOID_FTYPE_PFLOAT_HI_V16SI_V16SF_INT,
+ VOID_FTYPE_PVOID_HI_V16SI_V16SF_INT,
IX86_BUILTIN_SCATTERSIV16SF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scattersiv8df",
- VOID_FTYPE_PDOUBLE_QI_V8SI_V8DF_INT,
+ VOID_FTYPE_PVOID_QI_V8SI_V8DF_INT,
IX86_BUILTIN_SCATTERSIV8DF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scatterdiv16sf",
- VOID_FTYPE_PFLOAT_QI_V8DI_V8SF_INT,
+ VOID_FTYPE_PVOID_QI_V8DI_V8SF_INT,
IX86_BUILTIN_SCATTERDIV16SF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scatterdiv8df",
- VOID_FTYPE_PDOUBLE_QI_V8DI_V8DF_INT,
+ VOID_FTYPE_PVOID_QI_V8DI_V8DF_INT,
IX86_BUILTIN_SCATTERDIV8DF);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scattersiv16si",
- VOID_FTYPE_PINT_HI_V16SI_V16SI_INT,
+ VOID_FTYPE_PVOID_HI_V16SI_V16SI_INT,
IX86_BUILTIN_SCATTERSIV16SI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scattersiv8di",
- VOID_FTYPE_PLONGLONG_QI_V8SI_V8DI_INT,
+ VOID_FTYPE_PVOID_QI_V8SI_V8DI_INT,
IX86_BUILTIN_SCATTERSIV8DI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scatterdiv16si",
- VOID_FTYPE_PINT_QI_V8DI_V8SI_INT,
+ VOID_FTYPE_PVOID_QI_V8DI_V8SI_INT,
IX86_BUILTIN_SCATTERDIV16SI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scatterdiv8di",
- VOID_FTYPE_PLONGLONG_QI_V8DI_V8DI_INT,
+ VOID_FTYPE_PVOID_QI_V8DI_V8DI_INT,
IX86_BUILTIN_SCATTERDIV8DI);
/* AVX512VL */
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv2df",
- V2DF_FTYPE_V2DF_PCDOUBLE_V4SI_QI_INT,
+ V2DF_FTYPE_V2DF_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV2DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv4df",
- V4DF_FTYPE_V4DF_PCDOUBLE_V4SI_QI_INT,
+ V4DF_FTYPE_V4DF_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV4DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div2df",
- V2DF_FTYPE_V2DF_PCDOUBLE_V2DI_QI_INT,
+ V2DF_FTYPE_V2DF_PCVOID_V2DI_QI_INT,
IX86_BUILTIN_GATHER3DIV2DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div4df",
- V4DF_FTYPE_V4DF_PCDOUBLE_V4DI_QI_INT,
+ V4DF_FTYPE_V4DF_PCVOID_V4DI_QI_INT,
IX86_BUILTIN_GATHER3DIV4DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv4sf",
- V4SF_FTYPE_V4SF_PCFLOAT_V4SI_QI_INT,
+ V4SF_FTYPE_V4SF_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV4SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv8sf",
- V8SF_FTYPE_V8SF_PCFLOAT_V8SI_QI_INT,
+ V8SF_FTYPE_V8SF_PCVOID_V8SI_QI_INT,
IX86_BUILTIN_GATHER3SIV8SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div4sf",
- V4SF_FTYPE_V4SF_PCFLOAT_V2DI_QI_INT,
+ V4SF_FTYPE_V4SF_PCVOID_V2DI_QI_INT,
IX86_BUILTIN_GATHER3DIV4SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div8sf",
- V4SF_FTYPE_V4SF_PCFLOAT_V4DI_QI_INT,
+ V4SF_FTYPE_V4SF_PCVOID_V4DI_QI_INT,
IX86_BUILTIN_GATHER3DIV8SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv2di",
- V2DI_FTYPE_V2DI_PCINT64_V4SI_QI_INT,
+ V2DI_FTYPE_V2DI_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV2DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv4di",
- V4DI_FTYPE_V4DI_PCINT64_V4SI_QI_INT,
+ V4DI_FTYPE_V4DI_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV4DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div2di",
- V2DI_FTYPE_V2DI_PCINT64_V2DI_QI_INT,
+ V2DI_FTYPE_V2DI_PCVOID_V2DI_QI_INT,
IX86_BUILTIN_GATHER3DIV2DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div4di",
- V4DI_FTYPE_V4DI_PCINT64_V4DI_QI_INT,
+ V4DI_FTYPE_V4DI_PCVOID_V4DI_QI_INT,
IX86_BUILTIN_GATHER3DIV4DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv4si",
- V4SI_FTYPE_V4SI_PCINT_V4SI_QI_INT,
+ V4SI_FTYPE_V4SI_PCVOID_V4SI_QI_INT,
IX86_BUILTIN_GATHER3SIV4SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3siv8si",
- V8SI_FTYPE_V8SI_PCINT_V8SI_QI_INT,
+ V8SI_FTYPE_V8SI_PCVOID_V8SI_QI_INT,
IX86_BUILTIN_GATHER3SIV8SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div4si",
- V4SI_FTYPE_V4SI_PCINT_V2DI_QI_INT,
+ V4SI_FTYPE_V4SI_PCVOID_V2DI_QI_INT,
IX86_BUILTIN_GATHER3DIV4SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3div8si",
- V4SI_FTYPE_V4SI_PCINT_V4DI_QI_INT,
+ V4SI_FTYPE_V4SI_PCVOID_V4DI_QI_INT,
IX86_BUILTIN_GATHER3DIV8SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_gather3altsiv4df ",
@@ -35881,67 +35881,67 @@ ix86_init_mmx_sse_builtins (void)
IX86_BUILTIN_GATHER3ALTDIV8SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv8sf",
- VOID_FTYPE_PFLOAT_QI_V8SI_V8SF_INT,
+ VOID_FTYPE_PVOID_QI_V8SI_V8SF_INT,
IX86_BUILTIN_SCATTERSIV8SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv4sf",
- VOID_FTYPE_PFLOAT_QI_V4SI_V4SF_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V4SF_INT,
IX86_BUILTIN_SCATTERSIV4SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv4df",
- VOID_FTYPE_PDOUBLE_QI_V4SI_V4DF_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V4DF_INT,
IX86_BUILTIN_SCATTERSIV4DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv2df",
- VOID_FTYPE_PDOUBLE_QI_V4SI_V2DF_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V2DF_INT,
IX86_BUILTIN_SCATTERSIV2DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv8sf",
- VOID_FTYPE_PFLOAT_QI_V4DI_V4SF_INT,
+ VOID_FTYPE_PVOID_QI_V4DI_V4SF_INT,
IX86_BUILTIN_SCATTERDIV8SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv4sf",
- VOID_FTYPE_PFLOAT_QI_V2DI_V4SF_INT,
+ VOID_FTYPE_PVOID_QI_V2DI_V4SF_INT,
IX86_BUILTIN_SCATTERDIV4SF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv4df",
- VOID_FTYPE_PDOUBLE_QI_V4DI_V4DF_INT,
+ VOID_FTYPE_PVOID_QI_V4DI_V4DF_INT,
IX86_BUILTIN_SCATTERDIV4DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv2df",
- VOID_FTYPE_PDOUBLE_QI_V2DI_V2DF_INT,
+ VOID_FTYPE_PVOID_QI_V2DI_V2DF_INT,
IX86_BUILTIN_SCATTERDIV2DF);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv8si",
- VOID_FTYPE_PINT_QI_V8SI_V8SI_INT,
+ VOID_FTYPE_PVOID_QI_V8SI_V8SI_INT,
IX86_BUILTIN_SCATTERSIV8SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv4si",
- VOID_FTYPE_PINT_QI_V4SI_V4SI_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V4SI_INT,
IX86_BUILTIN_SCATTERSIV4SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv4di",
- VOID_FTYPE_PLONGLONG_QI_V4SI_V4DI_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V4DI_INT,
IX86_BUILTIN_SCATTERSIV4DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scattersiv2di",
- VOID_FTYPE_PLONGLONG_QI_V4SI_V2DI_INT,
+ VOID_FTYPE_PVOID_QI_V4SI_V2DI_INT,
IX86_BUILTIN_SCATTERSIV2DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv8si",
- VOID_FTYPE_PINT_QI_V4DI_V4SI_INT,
+ VOID_FTYPE_PVOID_QI_V4DI_V4SI_INT,
IX86_BUILTIN_SCATTERDIV8SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv4si",
- VOID_FTYPE_PINT_QI_V2DI_V4SI_INT,
+ VOID_FTYPE_PVOID_QI_V2DI_V4SI_INT,
IX86_BUILTIN_SCATTERDIV4SI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv4di",
- VOID_FTYPE_PLONGLONG_QI_V4DI_V4DI_INT,
+ VOID_FTYPE_PVOID_QI_V4DI_V4DI_INT,
IX86_BUILTIN_SCATTERDIV4DI);
def_builtin (OPTION_MASK_ISA_AVX512VL, "__builtin_ia32_scatterdiv2di",
- VOID_FTYPE_PLONGLONG_QI_V2DI_V2DI_INT,
+ VOID_FTYPE_PVOID_QI_V2DI_V2DI_INT,
IX86_BUILTIN_SCATTERDIV2DI);
def_builtin (OPTION_MASK_ISA_AVX512F, "__builtin_ia32_scatteraltsiv8df ",
VOID_FTYPE_PDOUBLE_QI_V16SI_V8DF_INT,
@@ -35961,28 +35961,28 @@ ix86_init_mmx_sse_builtins (void)
/* AVX512PF */
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfdpd",
- VOID_FTYPE_QI_V8SI_PCINT64_INT_INT,
+ VOID_FTYPE_QI_V8SI_PCVOID_INT_INT,
IX86_BUILTIN_GATHERPFDPD);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfdps",
- VOID_FTYPE_HI_V16SI_PCINT_INT_INT,
+ VOID_FTYPE_HI_V16SI_PCVOID_INT_INT,
IX86_BUILTIN_GATHERPFDPS);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfqpd",
- VOID_FTYPE_QI_V8DI_PCINT64_INT_INT,
+ VOID_FTYPE_QI_V8DI_PCVOID_INT_INT,
IX86_BUILTIN_GATHERPFQPD);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfqps",
- VOID_FTYPE_QI_V8DI_PCINT_INT_INT,
+ VOID_FTYPE_QI_V8DI_PCVOID_INT_INT,
IX86_BUILTIN_GATHERPFQPS);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfdpd",
- VOID_FTYPE_QI_V8SI_PCINT64_INT_INT,
+ VOID_FTYPE_QI_V8SI_PCVOID_INT_INT,
IX86_BUILTIN_SCATTERPFDPD);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfdps",
- VOID_FTYPE_HI_V16SI_PCINT_INT_INT,
+ VOID_FTYPE_HI_V16SI_PCVOID_INT_INT,
IX86_BUILTIN_SCATTERPFDPS);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfqpd",
- VOID_FTYPE_QI_V8DI_PCINT64_INT_INT,
+ VOID_FTYPE_QI_V8DI_PCVOID_INT_INT,
IX86_BUILTIN_SCATTERPFQPD);
def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfqps",
- VOID_FTYPE_QI_V8DI_PCINT_INT_INT,
+ VOID_FTYPE_QI_V8DI_PCVOID_INT_INT,
IX86_BUILTIN_SCATTERPFQPS);
/* SHA */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 46987d370ad..6818ba0d725 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2938,6 +2938,36 @@
operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);
})
+(define_insn_and_split "*pushxf_rounded"
+ [(set (mem:XF
+ (pre_modify:P
+ (reg:P SP_REG)
+ (plus:P (reg:P SP_REG) (const_int -16))))
+ (match_operand:XF 0 "nonmemory_no_elim_operand" "f,r,*r,C"))]
+ "TARGET_64BIT"
+ "#"
+ "&& 1"
+ [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -16)))
+ (set (match_dup 1) (match_dup 0))]
+{
+ rtx pat = PATTERN (curr_insn);
+ operands[1] = SET_DEST (pat);
+
+ /* Preserve memory attributes. */
+ operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
+}
+ [(set_attr "type" "multi")
+ (set_attr "unit" "i387,*,*,*")
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "1,2,3")
+ (const_string "DI")
+ ]
+ (const_string "XF")))
+ (set (attr "preferred_for_size")
+ (cond [(eq_attr "alternative" "1")
+ (symbol_ref "false")]
+ (symbol_ref "true")))])
+
(define_insn "*pushxf"
[(set (match_operand:XF 0 "push_operand" "=<,<,<,<")
(match_operand:XF 1 "general_no_elim_operand" "f,r,*r,oF"))]
@@ -3172,9 +3202,9 @@
;; in alternatives 4, 6, 7 and 8.
(define_insn "*movxf_internal"
[(set (match_operand:XF 0 "nonimmediate_operand"
- "=f,m,f,?r ,!o,?*r ,!o,!o,!o,r ,o")
+ "=f,m,f,?r ,!o,?*r ,!o,!o,!o,r ,o ,o")
(match_operand:XF 1 "general_operand"
- "fm,f,G,roF,r , *roF,*r,F ,C,roF,rF"))]
+ "fm,f,G,roF,r ,*roF,*r,F ,C ,roF,rF,rC"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (lra_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
@@ -3201,19 +3231,19 @@
}
}
[(set (attr "isa")
- (cond [(eq_attr "alternative" "7")
+ (cond [(eq_attr "alternative" "7,10")
(const_string "nox64")
- (eq_attr "alternative" "8")
+ (eq_attr "alternative" "8,11")
(const_string "x64")
]
(const_string "*")))
(set (attr "type")
- (cond [(eq_attr "alternative" "3,4,5,6,7,8,9,10")
+ (cond [(eq_attr "alternative" "3,4,5,6,7,8,9,10,11")
(const_string "multi")
]
(const_string "fmov")))
(set (attr "mode")
- (cond [(eq_attr "alternative" "3,4,5,6,7,8,9,10")
+ (cond [(eq_attr "alternative" "3,4,5,6,7,8,9,10,11")
(if_then_else (match_test "TARGET_64BIT")
(const_string "DI")
(const_string "SI"))
@@ -3224,7 +3254,7 @@
(symbol_ref "false")]
(symbol_ref "true")))
(set (attr "enabled")
- (cond [(eq_attr "alternative" "9,10")
+ (cond [(eq_attr "alternative" "9,10,11")
(if_then_else
(match_test "TARGET_HARD_XF_REGS")
(symbol_ref "false")
diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
index 204f128d5b0..8dfd2543bd1 100644
--- a/gcc/config/i386/x86-64.h
+++ b/gcc/config/i386/x86-64.h
@@ -49,7 +49,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define WCHAR_TYPE_SIZE 32
#undef ASM_SPEC
-#define ASM_SPEC "%{m32:--32} %{m64:--64} %{mx32:--x32}"
+#define ASM_SPEC "%{m16|m32:--32} %{m64:--64} %{mx32:--x32}"
#undef ASM_OUTPUT_ALIGNED_BSS
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
diff --git a/gcc/config/pa/pa-64.h b/gcc/config/pa/pa-64.h
index afe001b4228..1d3089ed9c4 100644
--- a/gcc/config/pa/pa-64.h
+++ b/gcc/config/pa/pa-64.h
@@ -83,7 +83,10 @@ along with GCC; see the file COPYING3. If not see
arguments are padded down when BYTES_BIG_ENDIAN is true. We don't
want aggregates padded down. */
-#define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
+#define PAD_VARARGS_DOWN \
+ (!AGGREGATE_TYPE_P (type) \
+ && TREE_CODE (type) != COMPLEX_TYPE \
+ && TREE_CODE (type) != VECTOR_TYPE)
/* In the PA architecture, it is not possible to directly move data
between GENERAL_REGS and FP_REGS. On the 32-bit port, we use the
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index b64cbd0e8b9..9dfff6a156d 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -1000,7 +1000,8 @@
(and (match_code "symbol_ref")
(match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))
&& (SYMBOL_REF_LOCAL_P (op)
- || op == XEXP (DECL_RTL (current_function_decl), 0))
+ || (op == XEXP (DECL_RTL (current_function_decl), 0)
+ && !decl_replaceable_p (current_function_decl)))
&& !((DEFAULT_ABI == ABI_AIX
|| DEFAULT_ABI == ABI_ELFv2)
&& (SYMBOL_REF_EXTERNAL_P (op)
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 474b48cc41d..9f5ec462438 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -2411,7 +2411,7 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRAD,
RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
- { ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRD,
+ { ALTIVEC_BUILTIN_VEC_SRA, P8V_BUILTIN_VSRAD,
RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
{ ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW,
RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
@@ -4512,7 +4512,7 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRAD,
RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
- { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRD,
+ { P8V_BUILTIN_VEC_VSRAD, P8V_BUILTIN_VSRAD,
RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
{ P8V_BUILTIN_VEC_VSUBCUQ, P8V_BUILTIN_VSUBCUQ,
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index b0b1b3a245d..7df09a3cab0 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -14181,6 +14181,8 @@ rs6000_expand_ternop_builtin (enum insn_code icode, tree exp, rtx target)
}
else if (icode == CODE_FOR_vsx_xxpermdi_v2df
|| icode == CODE_FOR_vsx_xxpermdi_v2di
+ || icode == CODE_FOR_vsx_xxpermdi_v2df_be
+ || icode == CODE_FOR_vsx_xxpermdi_v2di_be
|| icode == CODE_FOR_vsx_xxsldwi_v16qi
|| icode == CODE_FOR_vsx_xxsldwi_v8hi
|| icode == CODE_FOR_vsx_xxsldwi_v4si
@@ -17081,6 +17083,7 @@ builtin_function_type (machine_mode mode_ret, machine_mode mode_arg0,
break;
/* unsigned args, signed return. */
+ case VSX_BUILTIN_XVCVUXDSP:
case VSX_BUILTIN_XVCVUXDDP_UNS:
case ALTIVEC_BUILTIN_UNSFLOAT_V4SI_V4SF:
h.uns_p[1] = 1;
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index a73c4a2ff1e..c54e7271302 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -3063,8 +3063,8 @@
&& ! reg_mentioned_p (operands[3], operands[1])
&& ! reg_mentioned_p (operands[3], operands[2])"
[(set (match_dup 0)
- (div:GPR (match_dup 1)
- (match_dup 2)))
+ (udiv:GPR (match_dup 1)
+ (match_dup 2)))
(set (match_dup 3)
(mult:GPR (match_dup 0)
(match_dup 2)))
@@ -5429,17 +5429,10 @@
[(set_attr "length" "12")
(set_attr "type" "fp")])
-(define_expand "fixuns_trunc<mode>di2"
- [(set (match_operand:DI 0 "register_operand" "")
- (unsigned_fix:DI (match_operand:SFDF 1 "register_operand" "")))]
- "TARGET_HARD_FLOAT && (TARGET_FCTIDUZ || VECTOR_UNIT_VSX_P (<MODE>mode))"
- "")
-
-(define_insn "*fixuns_trunc<mode>di2_fctiduz"
+(define_insn "fixuns_trunc<mode>di2"
[(set (match_operand:DI 0 "gpc_reg_operand" "=d,wi")
(unsigned_fix:DI (match_operand:SFDF 1 "gpc_reg_operand" "<Ff>,<Fa>")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS
- && TARGET_FCTIDUZ"
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS && TARGET_FCTIDUZ"
"@
fctiduz %0,%1
xscvdpuxds %x0,%x1"
@@ -7734,7 +7727,7 @@
rtx gpr_lo_reg = gen_lowpart (DFmode, dest);
emit_insn (gen_p8_mfvsrd_3_<mode> (gpr_hi_reg, src));
- emit_insn (gen_vsx_xxpermdi_<mode> (tmp, src, src, GEN_INT (3)));
+ emit_insn (gen_vsx_xxpermdi_<mode>_be (tmp, src, src, GEN_INT (3)));
emit_insn (gen_p8_mfvsrd_3_<mode> (gpr_lo_reg, tmp));
DONE;
}
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 8ac92ace449..9a25a86640b 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -142,11 +142,11 @@ Use AltiVec instructions.
maltivec=le
Target Report RejectNegative Var(rs6000_altivec_element_order, 1) Save
-Generate Altivec instructions using little-endian element order.
+Generate AltiVec instructions using little-endian element order.
maltivec=be
Target Report RejectNegative Var(rs6000_altivec_element_order, 2)
-Generate Altivec instructions using big-endian element order.
+Generate AltiVec instructions using big-endian element order.
mhard-dfp
Target Report Mask(DFP) Var(rs6000_isa_flags)
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index f9717f1a05a..2745e445ff4 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -1827,19 +1827,19 @@
[(set_attr "type" "vecdouble")])
(define_insn "vsx_xvcvsxdsp"
- [(set (match_operand:V4SI 0 "vsx_register_operand" "=wd,?wa")
- (unspec:V4SI [(match_operand:V2DF 1 "vsx_register_operand" "wf,wa")]
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wd,?wa")
+ (unspec:V4SF [(match_operand:V2DI 1 "vsx_register_operand" "wf,wa")]
UNSPEC_VSX_CVSXDSP))]
"VECTOR_UNIT_VSX_P (V2DFmode)"
"xvcvsxdsp %x0,%x1"
[(set_attr "type" "vecfloat")])
(define_insn "vsx_xvcvuxdsp"
- [(set (match_operand:V4SI 0 "vsx_register_operand" "=wd,?wa")
- (unspec:V4SI [(match_operand:V2DF 1 "vsx_register_operand" "wf,wa")]
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wd,?wa")
+ (unspec:V4SF [(match_operand:V2DI 1 "vsx_register_operand" "wf,wa")]
UNSPEC_VSX_CVUXDSP))]
"VECTOR_UNIT_VSX_P (V2DFmode)"
- "xvcvuxwdp %x0,%x1"
+ "xvcvuxdsp %x0,%x1"
[(set_attr "type" "vecdouble")])
;; Convert from 32-bit to 64-bit types
@@ -2276,6 +2276,38 @@
op1 = gen_lowpart (V2DImode, op1);
}
}
+ emit_insn (gen (target, op0, op1, perm0, perm1));
+ DONE;
+})
+
+;; Special version of xxpermdi that retains big-endian semantics.
+(define_expand "vsx_xxpermdi_<mode>_be"
+ [(match_operand:VSX_L 0 "vsx_register_operand" "")
+ (match_operand:VSX_L 1 "vsx_register_operand" "")
+ (match_operand:VSX_L 2 "vsx_register_operand" "")
+ (match_operand:QI 3 "u5bit_cint_operand" "")]
+ "VECTOR_MEM_VSX_P (<MODE>mode)"
+{
+ rtx target = operands[0];
+ rtx op0 = operands[1];
+ rtx op1 = operands[2];
+ int mask = INTVAL (operands[3]);
+ rtx perm0 = GEN_INT ((mask >> 1) & 1);
+ rtx perm1 = GEN_INT ((mask & 1) + 2);
+ rtx (*gen) (rtx, rtx, rtx, rtx, rtx);
+
+ if (<MODE>mode == V2DFmode)
+ gen = gen_vsx_xxpermdi2_v2df_1;
+ else
+ {
+ gen = gen_vsx_xxpermdi2_v2di_1;
+ if (<MODE>mode != V2DImode)
+ {
+ target = gen_lowpart (V2DImode, target);
+ op0 = gen_lowpart (V2DImode, op0);
+ op1 = gen_lowpart (V2DImode, op1);
+ }
+ }
/* In little endian mode, vsx_xxpermdi2_<mode>_1 will perform a
transformation we don't want; it is necessary for
rs6000_expand_vec_perm_const_1 but not for this use. So we
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f1969fe53d5..19ee7773648 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -11971,8 +11971,9 @@ sparc_frame_pointer_required (void)
if (TARGET_FLAT)
return false;
- /* Otherwise, the frame pointer is required if the function isn't leaf. */
- return !(crtl->is_leaf && only_leaf_regs_used ());
+ /* Otherwise, the frame pointer is required if the function isn't leaf, but
+ we cannot use sparc_leaf_function_p since it hasn't been computed yet. */
+ return !(optimize > 0 && crtl->is_leaf && only_leaf_regs_used ());
}
/* The way this is structured, we can't eliminate SFP in favor of SP
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a7f94b35a29..81583850b01 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,87 @@
+2017-03-14 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-03-09 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79900 - ICE in strip_typedefs
+ * tree.c (strip_typedefs): Skip the attribute handling if T is
+ a variant type which hasn't been updated yet.
+
+ PR c++/79687
+ * init.c (constant_value_1): Break if the variable has a dynamic
+ initializer.
+
+ Backported from mainline
+ 2017-01-31 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79264
+ * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
+ * semantics.c (finish_member_declaration): Assert class is being
+ defined.
+
+ Backported from mainline
+ 2017-01-17 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/61636
+ * cp-tree.h (maybe_generic_this_capture): Declare.
+ * lambda.c (resolvable_dummy_lambda): New, broken out of ...
+ (maybe_resolve_dummy): ... here. Call it.
+ (maybe_generic_this_capture): New.
+ * parser.c (cp_parser_postfix_expression): Speculatively capture
+ this in generic lambda in unresolved member function call.
+ * pt.c (tsubst_copy_and_build): Force hard error from failed
+ member function lookup in generic lambda.
+
+2017-03-07 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-03-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79796 - ICE with NSDMI and this pointer
+ * call.c (build_over_call): Handle NSDMI with a 'this' by calling
+ replace_placeholders.
+
+2017-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79429
+ * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
+ non-pragma_compound context here.
+ (cp_parser_omp_target): Likewise.
+ (cp_parser_pragma): Don't call push_omp_privatization_clauses and
+ parsing for ordered and target omp pragmas in non-pragma_stmt
+ non-pragma_compound contexts.
+
+ PR c/79431
+ * parser.c (cp_parser_oacc_declare): Formatting fix.
+ (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
+ automatic variables.
+
+ 2017-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79377
+ * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
+ allow one fewer than expected arguments if flag_permissive.
+
+2017-02-13 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79296 - ICE mangling localized template instantiation
+ * decl2.c (determine_visibility): Use template fn context for
+ local class instantiations.
+
+2017-02-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/78908 - template ops and bitfields
+ * tree.c (build_min_non_dep): Use unlowered_expr_type.
+
+2017-02-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/78897 - constexpr union
+ * constexpr.c (cxx_eval_store_expression): A store to a union member
+ erases a previous store to another member.
+
2017-01-26 Jason Merrill <jason@redhat.com>
PR c++/79176 - lambda ICE with -flto -Os
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a7d35b946fc..51af503daf9 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7667,6 +7667,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
{
arg = cp_build_indirect_ref (arg, RO_NULL, complain);
val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg);
+ if (cxx_dialect >= cxx14)
+ /* Handle NSDMI that refer to the object being initialized. */
+ replace_placeholders (arg, to);
}
else
{
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index a6ac3c1468d..8213ef29bc8 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -3239,6 +3239,11 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
tree fields = TYPE_FIELDS (DECL_CONTEXT (index));
unsigned HOST_WIDE_INT idx;
+ if (code == UNION_TYPE && CONSTRUCTOR_NELTS (*valp)
+ && CONSTRUCTOR_ELT (*valp, 0)->index != index)
+ /* Changing active member. */
+ vec_safe_truncate (CONSTRUCTOR_ELTS (*valp), 0);
+
for (idx = 0;
vec_safe_iterate (CONSTRUCTOR_ELTS (*valp), idx, &cep);
idx++, fields = DECL_CHAIN (fields))
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 8a8c845c645..9bd9afa41cb 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -6447,6 +6447,7 @@ extern bool is_capture_proxy (tree);
extern bool is_normal_capture_proxy (tree);
extern void register_capture_members (tree);
extern tree lambda_expr_this_capture (tree, bool);
+extern void maybe_generic_this_capture (tree, tree);
extern tree maybe_resolve_dummy (tree, bool);
extern tree current_nonlambda_function (void);
extern tree nonlambda_method_basetype (void);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index c4a0e854228..a9511dece51 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2280,11 +2280,6 @@ constrain_visibility_for_template (tree decl, tree targs)
void
determine_visibility (tree decl)
{
- tree class_type = NULL_TREE;
- bool use_template;
- bool orig_visibility_specified;
- enum symbol_visibility orig_visibility;
-
/* Remember that all decls get VISIBILITY_DEFAULT when built. */
/* Only relevant for names with external linkage. */
@@ -2296,25 +2291,28 @@ determine_visibility (tree decl)
maybe_clone_body. */
gcc_assert (!DECL_CLONED_FUNCTION_P (decl));
- orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl);
- orig_visibility = DECL_VISIBILITY (decl);
+ bool orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl);
+ enum symbol_visibility orig_visibility = DECL_VISIBILITY (decl);
+ /* The decl may be a template instantiation, which could influence
+ visibilty. */
+ tree template_decl = NULL_TREE;
if (TREE_CODE (decl) == TYPE_DECL)
{
if (CLASS_TYPE_P (TREE_TYPE (decl)))
- use_template = CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl));
+ {
+ if (CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl)))
+ template_decl = decl;
+ }
else if (TYPE_TEMPLATE_INFO (TREE_TYPE (decl)))
- use_template = 1;
- else
- use_template = 0;
+ template_decl = decl;
}
- else if (DECL_LANG_SPECIFIC (decl))
- use_template = DECL_USE_TEMPLATE (decl);
- else
- use_template = 0;
+ else if (DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl))
+ template_decl = decl;
/* If DECL is a member of a class, visibility specifiers on the
class can influence the visibility of the DECL. */
+ tree class_type = NULL_TREE;
if (DECL_CLASS_SCOPE_P (decl))
class_type = DECL_CONTEXT (decl);
else
@@ -2357,8 +2355,11 @@ determine_visibility (tree decl)
}
/* Local classes in templates have CLASSTYPE_USE_TEMPLATE set,
- but have no TEMPLATE_INFO, so don't try to check it. */
- use_template = 0;
+ but have no TEMPLATE_INFO. Their containing template
+ function does, and the local class could be constrained
+ by that. */
+ if (template_decl)
+ template_decl = fn;
}
else if (VAR_P (decl) && DECL_TINFO_P (decl)
&& flag_visibility_ms_compat)
@@ -2388,7 +2389,7 @@ determine_visibility (tree decl)
&& !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl))))
targetm.cxx.determine_class_data_visibility (decl);
}
- else if (use_template)
+ else if (template_decl)
/* Template instantiations and specializations get visibility based
on their template unless they override it with an attribute. */;
else if (! DECL_VISIBILITY_SPECIFIED (decl))
@@ -2405,11 +2406,11 @@ determine_visibility (tree decl)
}
}
- if (use_template)
+ if (template_decl)
{
/* If the specialization doesn't specify visibility, use the
visibility from the template. */
- tree tinfo = get_template_info (decl);
+ tree tinfo = get_template_info (template_decl);
tree args = TI_ARGS (tinfo);
tree attribs = (TREE_CODE (decl) == TYPE_DECL
? TYPE_ATTRIBUTES (TREE_TYPE (decl))
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 8479f3b7ef1..1cd6a866d3d 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2110,6 +2110,13 @@ constant_value_1 (tree decl, bool strict_p, bool return_aggregate_cst_ok_p)
if (TREE_CODE (init) == CONSTRUCTOR
&& !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
break;
+ /* If the variable has a dynamic initializer, don't use its
+ DECL_INITIAL which doesn't reflect the real value. */
+ if (VAR_P (decl)
+ && TREE_STATIC (decl)
+ && !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)
+ && DECL_NONTRIVIALLY_INITIALIZED_P (decl))
+ break;
decl = unshare_expr (init);
}
return decl;
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 7a5220ce857..7c57d67a150 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -746,16 +746,14 @@ lambda_expr_this_capture (tree lambda, bool add_capture_p)
return result;
}
-/* We don't want to capture 'this' until we know we need it, i.e. after
- overload resolution has chosen a non-static member function. At that
- point we call this function to turn a dummy object into a use of the
- 'this' capture. */
+/* Return the current LAMBDA_EXPR, if this is a resolvable dummy
+ object. NULL otherwise.. */
-tree
-maybe_resolve_dummy (tree object, bool add_capture_p)
+static tree
+resolvable_dummy_lambda (tree object)
{
if (!is_dummy_object (object))
- return object;
+ return NULL_TREE;
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (object));
gcc_assert (!TYPE_PTR_P (type));
@@ -765,18 +763,63 @@ maybe_resolve_dummy (tree object, bool add_capture_p)
&& LAMBDA_TYPE_P (current_class_type)
&& lambda_function (current_class_type)
&& DERIVED_FROM_P (type, current_nonlambda_class_type ()))
- {
- /* In a lambda, need to go through 'this' capture. */
- tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type);
- tree cap = lambda_expr_this_capture (lam, add_capture_p);
- if (cap && cap != error_mark_node)
+ return CLASSTYPE_LAMBDA_EXPR (current_class_type);
+
+ return NULL_TREE;
+}
+
+/* We don't want to capture 'this' until we know we need it, i.e. after
+ overload resolution has chosen a non-static member function. At that
+ point we call this function to turn a dummy object into a use of the
+ 'this' capture. */
+
+tree
+maybe_resolve_dummy (tree object, bool add_capture_p)
+{
+ if (tree lam = resolvable_dummy_lambda (object))
+ if (tree cap = lambda_expr_this_capture (lam, add_capture_p))
+ if (cap != error_mark_node)
object = build_x_indirect_ref (EXPR_LOCATION (object), cap,
RO_NULL, tf_warning_or_error);
- }
return object;
}
+/* When parsing a generic lambda containing an argument-dependent
+ member function call we defer overload resolution to instantiation
+ time. But we have to know now whether to capture this or not.
+ Do that if FNS contains any non-static fns.
+ The std doesn't anticipate this case, but I expect this to be the
+ outcome of discussion. */
+
+void
+maybe_generic_this_capture (tree object, tree fns)
+{
+ if (tree lam = resolvable_dummy_lambda (object))
+ if (!LAMBDA_EXPR_THIS_CAPTURE (lam))
+ {
+ /* We've not yet captured, so look at the function set of
+ interest. */
+ if (BASELINK_P (fns))
+ fns = BASELINK_FUNCTIONS (fns);
+ bool id_expr = TREE_CODE (fns) == TEMPLATE_ID_EXPR;
+ if (id_expr)
+ fns = TREE_OPERAND (fns, 0);
+ for (; fns; fns = OVL_NEXT (fns))
+ {
+ tree fn = OVL_CURRENT (fns);
+
+ if ((!id_expr || TREE_CODE (fn) == TEMPLATE_DECL)
+ && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ {
+ /* Found a non-static member. Capture this. */
+ lambda_expr_this_capture (lam, true);
+ break;
+ }
+ }
+ }
+}
+
/* Returns the innermost non-lambda function. */
tree
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 390f7d0d16f..2f74bb0146b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6867,6 +6867,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|| type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (args)))
{
+ maybe_generic_this_capture (instance, fn);
postfix_expression
= build_nt_call_vec (postfix_expression, args);
release_tree_vector (args);
@@ -34058,13 +34059,6 @@ cp_parser_omp_ordered (cp_parser *parser, cp_token *pragma_tok,
{
location_t loc = pragma_tok->location;
- if (context != pragma_stmt && context != pragma_compound)
- {
- cp_parser_error (parser, "expected declaration specifiers");
- cp_parser_skip_to_pragma_eol (parser, pragma_tok);
- return false;
- }
-
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
{
tree id = cp_lexer_peek_token (parser->lexer)->u.value;
@@ -34957,13 +34951,6 @@ cp_parser_omp_target (cp_parser *parser, cp_token *pragma_tok,
{
tree *pc = NULL, stmt;
- if (context != pragma_stmt && context != pragma_compound)
- {
- cp_parser_error (parser, "expected declaration specifiers");
- cp_parser_skip_to_pragma_eol (parser, pragma_tok);
- return false;
- }
-
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
{
tree id = cp_lexer_peek_token (parser->lexer)->u.value;
@@ -35345,7 +35332,7 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok)
id = get_identifier ("omp declare target");
DECL_ATTRIBUTES (decl)
- = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl));
+ = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl));
if (global_bindings_p ())
{
symtab_node *node = symtab_node::get (decl);
@@ -35885,8 +35872,11 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
}
if (!at1)
{
- symtab_node *node = symtab_node::get (t);
DECL_ATTRIBUTES (t) = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (t));
+ if (TREE_CODE (t) != FUNCTION_DECL && !is_global_var (t))
+ continue;
+
+ symtab_node *node = symtab_node::get (t);
if (node != NULL)
{
node->offloadable = 1;
@@ -37402,12 +37392,16 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
return true;
case PRAGMA_OMP_ORDERED:
+ if (context != pragma_stmt && context != pragma_compound)
+ goto bad_stmt;
stmt = push_omp_privatization_clauses (false);
ret = cp_parser_omp_ordered (parser, pragma_tok, context, if_p);
pop_omp_privatization_clauses (stmt);
return ret;
case PRAGMA_OMP_TARGET:
+ if (context != pragma_stmt && context != pragma_compound)
+ goto bad_stmt;
stmt = push_omp_privatization_clauses (false);
ret = cp_parser_omp_target (parser, pragma_tok, context, if_p);
pop_omp_privatization_clauses (stmt);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 744b4617b2d..f95c951de2e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -16613,19 +16613,34 @@ tsubst_copy_and_build (tree t,
if (unq != function)
{
- tree fn = unq;
- if (INDIRECT_REF_P (fn))
- fn = TREE_OPERAND (fn, 0);
- if (TREE_CODE (fn) == COMPONENT_REF)
- fn = TREE_OPERAND (fn, 1);
- if (is_overloaded_fn (fn))
- fn = get_first_fn (fn);
- if (permerror (EXPR_LOC_OR_LOC (t, input_location),
- "%qD was not declared in this scope, "
- "and no declarations were found by "
- "argument-dependent lookup at the point "
- "of instantiation", function))
+ /* In a lambda fn, we have to be careful to not
+ introduce new this captures. Legacy code can't
+ be using lambdas anyway, so it's ok to be
+ stricter. */
+ bool in_lambda = (current_class_type
+ && LAMBDA_TYPE_P (current_class_type));
+ char const *msg = "%qD was not declared in this scope, "
+ "and no declarations were found by "
+ "argument-dependent lookup at the point "
+ "of instantiation";
+
+ bool diag = true;
+ if (in_lambda)
+ error_at (EXPR_LOC_OR_LOC (t, input_location),
+ msg, function);
+ else
+ diag = permerror (EXPR_LOC_OR_LOC (t, input_location),
+ msg, function);
+ if (diag)
{
+ tree fn = unq;
+ if (INDIRECT_REF_P (fn))
+ fn = TREE_OPERAND (fn, 0);
+ if (TREE_CODE (fn) == COMPONENT_REF)
+ fn = TREE_OPERAND (fn, 1);
+ if (is_overloaded_fn (fn))
+ fn = get_first_fn (fn);
+
if (!DECL_P (fn))
/* Can't say anything more. */;
else if (DECL_CLASS_SCOPE_P (fn))
@@ -16648,7 +16663,13 @@ tsubst_copy_and_build (tree t,
inform (DECL_SOURCE_LOCATION (fn),
"%qD declared here, later in the "
"translation unit", fn);
+ if (in_lambda)
+ {
+ release_tree_vector (call_args);
+ RETURN (error_mark_node);
+ }
}
+
function = unq;
}
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index a44b820429c..cbb25b555a2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2965,6 +2965,12 @@ finish_member_declaration (tree decl)
/* We should see only one DECL at a time. */
gcc_assert (DECL_CHAIN (decl) == NULL_TREE);
+ /* Don't add decls after definition. */
+ gcc_assert (TYPE_BEING_DEFINED (current_class_type)
+ /* We can add lambda types when late parsing default
+ arguments. */
+ || LAMBDA_TYPE_P (TREE_TYPE (decl)));
+
/* Set up access control for DECL. */
TREE_PRIVATE (decl)
= (current_access_specifier == access_private_node);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 5e8bb742bf4..dcfb0f58c43 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1463,29 +1463,40 @@ strip_typedefs (tree t, bool *remove_attributes)
result = TYPE_MAIN_VARIANT (t);
}
gcc_assert (!typedef_variant_p (result));
- if (TYPE_USER_ALIGN (t) != TYPE_USER_ALIGN (result)
- || TYPE_ALIGN (t) != TYPE_ALIGN (result))
+
+ if (COMPLETE_TYPE_P (result) && !COMPLETE_TYPE_P (t))
+ /* If RESULT is complete and T isn't, it's likely the case that T
+ is a variant of RESULT which hasn't been updated yet. Skip the
+ attribute handling. */;
+ else
{
- gcc_assert (TYPE_USER_ALIGN (t));
- if (remove_attributes)
- *remove_attributes = true;
- else
+ if (TYPE_USER_ALIGN (t) != TYPE_USER_ALIGN (result)
+ || TYPE_ALIGN (t) != TYPE_ALIGN (result))
{
- if (TYPE_ALIGN (t) == TYPE_ALIGN (result))
- result = build_variant_type_copy (result);
+ gcc_assert (TYPE_USER_ALIGN (t));
+ if (remove_attributes)
+ *remove_attributes = true;
else
- result = build_aligned_type (result, TYPE_ALIGN (t));
- TYPE_USER_ALIGN (result) = true;
+ {
+ if (TYPE_ALIGN (t) == TYPE_ALIGN (result))
+ result = build_variant_type_copy (result);
+ else
+ result = build_aligned_type (result, TYPE_ALIGN (t));
+ TYPE_USER_ALIGN (result) = true;
+ }
+ }
+
+ if (TYPE_ATTRIBUTES (t))
+ {
+ if (remove_attributes)
+ result = apply_identity_attributes (result, TYPE_ATTRIBUTES (t),
+ remove_attributes);
+ else
+ result = cp_build_type_attribute_variant (result,
+ TYPE_ATTRIBUTES (t));
}
}
- if (TYPE_ATTRIBUTES (t))
- {
- if (remove_attributes)
- result = apply_identity_attributes (result, TYPE_ATTRIBUTES (t),
- remove_attributes);
- else
- result = cp_build_type_attribute_variant (result, TYPE_ATTRIBUTES (t));
- }
+
return cp_build_qualified_type (result, cp_type_quals (t));
}
@@ -2775,7 +2786,7 @@ build_min_non_dep (enum tree_code code, tree non_dep, ...)
t = make_node (code);
length = TREE_CODE_LENGTH (code);
- TREE_TYPE (t) = TREE_TYPE (non_dep);
+ TREE_TYPE (t) = unlowered_expr_type (non_dep);
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (non_dep);
for (i = 0; i < length; i++)
@@ -2830,8 +2841,10 @@ build_min_non_dep_op_overload (enum tree_code op,
nargs = call_expr_nargs (non_dep);
expected_nargs = cp_tree_code_length (op);
- if (op == POSTINCREMENT_EXPR
- || op == POSTDECREMENT_EXPR)
+ if ((op == POSTINCREMENT_EXPR
+ || op == POSTDECREMENT_EXPR)
+ /* With -fpermissive non_dep could be operator++(). */
+ && (!flag_permissive || nargs != expected_nargs))
expected_nargs += 1;
gcc_assert (nargs == expected_nargs);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 9ef49512f92..4f2f8417e7d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -143,6 +143,7 @@ static tree fold_relational_const (enum tree_code, tree, tree, tree);
static tree fold_convert_const (enum tree_code, tree, tree);
static tree fold_view_convert_expr (tree, tree);
static bool vec_cst_ctor_to_array (tree, tree *);
+static tree fold_negate_expr (location_t, tree);
/* Return EXPR_LOCATION of T if it is not UNKNOWN_LOCATION.
@@ -530,7 +531,7 @@ negate_expr_p (tree t)
returned. */
static tree
-fold_negate_expr (location_t loc, tree t)
+fold_negate_expr_1 (location_t loc, tree t)
{
tree type = TREE_TYPE (t);
tree tem;
@@ -541,7 +542,7 @@ fold_negate_expr (location_t loc, tree t)
case BIT_NOT_EXPR:
if (INTEGRAL_TYPE_P (type))
return fold_build2_loc (loc, PLUS_EXPR, type, TREE_OPERAND (t, 0),
- build_one_cst (type));
+ build_one_cst (type));
break;
case INTEGER_CST:
@@ -589,14 +590,14 @@ fold_negate_expr (location_t loc, tree t)
case COMPLEX_EXPR:
if (negate_expr_p (t))
return fold_build2_loc (loc, COMPLEX_EXPR, type,
- fold_negate_expr (loc, TREE_OPERAND (t, 0)),
- fold_negate_expr (loc, TREE_OPERAND (t, 1)));
+ fold_negate_expr (loc, TREE_OPERAND (t, 0)),
+ fold_negate_expr (loc, TREE_OPERAND (t, 1)));
break;
case CONJ_EXPR:
if (negate_expr_p (t))
return fold_build1_loc (loc, CONJ_EXPR, type,
- fold_negate_expr (loc, TREE_OPERAND (t, 0)));
+ fold_negate_expr (loc, TREE_OPERAND (t, 0)));
break;
case NEGATE_EXPR:
@@ -615,7 +616,7 @@ fold_negate_expr (location_t loc, tree t)
{
tem = negate_expr (TREE_OPERAND (t, 1));
return fold_build2_loc (loc, MINUS_EXPR, type,
- tem, TREE_OPERAND (t, 0));
+ tem, TREE_OPERAND (t, 0));
}
/* -(A + B) -> (-A) - B. */
@@ -623,7 +624,7 @@ fold_negate_expr (location_t loc, tree t)
{
tem = negate_expr (TREE_OPERAND (t, 0));
return fold_build2_loc (loc, MINUS_EXPR, type,
- tem, TREE_OPERAND (t, 1));
+ tem, TREE_OPERAND (t, 1));
}
}
break;
@@ -634,7 +635,7 @@ fold_negate_expr (location_t loc, tree t)
&& !HONOR_SIGNED_ZEROS (element_mode (type))
&& reorder_operands_p (TREE_OPERAND (t, 0), TREE_OPERAND (t, 1)))
return fold_build2_loc (loc, MINUS_EXPR, type,
- TREE_OPERAND (t, 1), TREE_OPERAND (t, 0));
+ TREE_OPERAND (t, 1), TREE_OPERAND (t, 0));
break;
case MULT_EXPR:
@@ -649,11 +650,11 @@ fold_negate_expr (location_t loc, tree t)
tem = TREE_OPERAND (t, 1);
if (negate_expr_p (tem))
return fold_build2_loc (loc, TREE_CODE (t), type,
- TREE_OPERAND (t, 0), negate_expr (tem));
+ TREE_OPERAND (t, 0), negate_expr (tem));
tem = TREE_OPERAND (t, 0);
if (negate_expr_p (tem))
return fold_build2_loc (loc, TREE_CODE (t), type,
- negate_expr (tem), TREE_OPERAND (t, 1));
+ negate_expr (tem), TREE_OPERAND (t, 1));
}
break;
@@ -726,6 +727,19 @@ fold_negate_expr (location_t loc, tree t)
return NULL_TREE;
}
+/* A wrapper for fold_negate_expr_1. */
+
+static tree
+fold_negate_expr (location_t loc, tree t)
+{
+ tree type = TREE_TYPE (t);
+ STRIP_SIGN_NOPS (t);
+ tree tem = fold_negate_expr_1 (loc, t);
+ if (tem == NULL_TREE)
+ return NULL_TREE;
+ return fold_convert_loc (loc, type, tem);
+}
+
/* Like fold_negate_expr, but return a NEGATE_EXPR tree, if T can not be
negated in a simpler way. Also allow for T to be NULL_TREE, in which case
return NULL_TREE. */
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 18b2d3c219f..d2db3c7f8c5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,28 @@
+2017-03-14 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2017-03-06 Richard Biener <rguenther@suse.de>
+
+ PR fortran/79894
+ * trans.c (gfc_add_modify_loc): Weaken assert.
+
+2017-02-25 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/78474
+ * module.c (gfc_match_submodule): If there is more than one
+ colon, it is a syntax error.
+
+ PR fortran/78331
+ * module.c (gfc_use_module): If an smod file does not exist it
+ is either because the module does not have a module procedure
+ interface or there is an error in the module.
+
+2017-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * trans-types.c (gfc_get_int_kind_from_width_isofortranen): Choose
+ REAL type with the widest precision if two (or more) have the same
+ storage size.
+
2017-01-29 Andre Vehreschild <vehre@gcc.gnu.org>
Backported from trunk
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 6d3860ef826..8ebd3e08569 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -740,6 +740,7 @@ gfc_match_submodule (void)
match m;
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_use_list *use_list;
+ bool seen_colon = false;
if (!gfc_notify_std (GFC_STD_F2008, "SUBMODULE declaration at %C"))
return MATCH_ERROR;
@@ -772,7 +773,7 @@ gfc_match_submodule (void)
}
else
{
- module_list = use_list;
+ module_list = use_list;
use_list->module_name = gfc_get_string (name);
use_list->submodule_name = use_list->module_name;
}
@@ -780,8 +781,11 @@ gfc_match_submodule (void)
if (gfc_match_char (')') == MATCH_YES)
break;
- if (gfc_match_char (':') != MATCH_YES)
+ if (gfc_match_char (':') != MATCH_YES
+ || seen_colon)
goto syntax;
+
+ seen_colon = true;
}
m = gfc_match (" %s%t", &gfc_new_block);
@@ -6917,8 +6921,17 @@ gfc_use_module (gfc_use_list *module)
}
if (module_fp == NULL)
- gfc_fatal_error ("Can't open module file %qs for reading at %C: %s",
- filename, xstrerror (errno));
+ {
+ if (gfc_state_stack->state != COMP_SUBMODULE
+ && module->submodule_name == NULL)
+ gfc_fatal_error ("Can't open module file %qs for reading at %C: %s",
+ filename, xstrerror (errno));
+ else
+ gfc_fatal_error ("Module file %qs has not been generated, either "
+ "because the module does not contain a MODULE "
+ "PROCEDURE or there is an error in the module.",
+ filename);
+ }
/* Check that we haven't already USEd an intrinsic module with the
same name. */
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 831c84fe28e..e00487526cf 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -234,27 +234,42 @@ gfc_get_int_kind_from_width_isofortranenv (int size)
return -1;
}
-/* Get the kind number corresponding to a real of given storage size,
- following the required return values for ISO_FORTRAN_ENV REAL* constants:
- -2 is returned if we support a kind of larger size, -1 otherwise. */
+
+/* Get the kind number corresponding to a real of a given storage size.
+ If two real's have the same storage size, then choose the real with
+ the largest precision. If a kind type is unavailable and a real
+ exists with wider storage, then return -2; otherwise, return -1. */
+
int
gfc_get_real_kind_from_width_isofortranenv (int size)
{
- int i;
+ int digits, i, kind;
size /= 8;
+ kind = -1;
+ digits = 0;
+
/* Look for a kind with matching storage size. */
for (i = 0; gfc_real_kinds[i].kind != 0; i++)
if (int_size_in_bytes (gfc_get_real_type (gfc_real_kinds[i].kind)) == size)
- return gfc_real_kinds[i].kind;
+ {
+ if (gfc_real_kinds[i].digits > digits)
+ {
+ digits = gfc_real_kinds[i].digits;
+ kind = gfc_real_kinds[i].kind;
+ }
+ }
+
+ if (kind != -1)
+ return kind;
/* Look for a kind with larger storage size. */
for (i = 0; gfc_real_kinds[i].kind != 0; i++)
if (int_size_in_bytes (gfc_get_real_type (gfc_real_kinds[i].kind)) > size)
- return -2;
+ kind = -2;
- return -1;
+ return kind;
}
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index c6688d351a7..0c312bd4bab 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -151,11 +151,11 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs)
tree t1, t2;
t1 = TREE_TYPE (rhs);
t2 = TREE_TYPE (lhs);
- /* Make sure that the types of the rhs and the lhs are the same
+ /* Make sure that the types of the rhs and the lhs are compatible
for scalar assignments. We should probably have something
similar for aggregates, but right now removing that check just
breaks everything. */
- gcc_checking_assert (t1 == t2
+ gcc_checking_assert (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2)
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs,
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index 29e9c0a33dc..5c6e456ac12 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -123,7 +123,7 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
/* Fixed point types with the same mode are compatible. */
else if (FIXED_POINT_TYPE_P (inner_type)
&& FIXED_POINT_TYPE_P (outer_type))
- return true;
+ return TYPE_SATURATING (inner_type) == TYPE_SATURATING (outer_type);
/* We need to take special care recursing to pointed-to types. */
else if (POINTER_TYPE_P (inner_type)
diff --git a/gcc/gimple.c b/gcc/gimple.c
index b06e62ce274..1a22e8235f1 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2487,7 +2487,16 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl)
if (!targs)
return true;
tree arg = gimple_call_arg (stmt, i);
- if (!useless_type_conversion_p (TREE_VALUE (targs), TREE_TYPE (arg)))
+ tree type = TREE_VALUE (targs);
+ if (!useless_type_conversion_p (type, TREE_TYPE (arg))
+ /* char/short integral arguments are promoted to int
+ by several frontends if targetm.calls.promote_prototypes
+ is true. Allow such promotion too. */
+ && !(INTEGRAL_TYPE_P (type)
+ && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)
+ && targetm.calls.promote_prototypes (TREE_TYPE (fndecl))
+ && useless_type_conversion_p (integer_type_node,
+ TREE_TYPE (arg))))
return false;
targs = TREE_CHAIN (targs);
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 7c5cead076d..00182a460b3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8136,8 +8136,9 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p,
if ((ctx->region_type & ORT_TARGET) != 0
&& !(n->value & GOVD_SEEN)
&& GOMP_MAP_ALWAYS_P (OMP_CLAUSE_MAP_KIND (c)) == 0
- && !lookup_attribute ("omp declare target link",
- DECL_ATTRIBUTES (decl)))
+ && (!is_global_var (decl)
+ || !lookup_attribute ("omp declare target link",
+ DECL_ATTRIBUTES (decl))))
{
remove = true;
/* For struct element mapping, if struct is never referenced
@@ -11156,8 +11157,11 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
{
/* We aren't looking for a value, and we don't have a valid
- statement. If it doesn't have side-effects, throw it away. */
- if (!TREE_SIDE_EFFECTS (*expr_p))
+ statement. If it doesn't have side-effects, throw it away.
+ We can also get here with code such as "*&&L;", where L is
+ a LABEL_DECL that is marked as FORCED_LABEL. */
+ if (TREE_CODE (*expr_p) == LABEL_DECL
+ || !TREE_SIDE_EFFECTS (*expr_p))
*expr_p = NULL;
else if (!TREE_THIS_VOLATILE (*expr_p))
{
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index dd50a1e4ec0..044abf43acb 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -817,6 +817,25 @@ scop_detection::merge_sese (sese_l first, sese_l second) const
!= loop_depth (exit->dest->loop_father))
return invalid_sese;
+ /* For now we just bail out when there is a loop exit in the region
+ that is not also the exit of the region. We could enlarge the
+ region to cover the loop that region exits to. See PR79977. */
+ if (loop_outer (entry->src->loop_father))
+ {
+ vec<edge> exits = get_loop_exit_edges (entry->src->loop_father);
+ for (unsigned i = 0; i < exits.length (); ++i)
+ {
+ if (exits[i] != exit
+ && bb_in_region (exits[i]->src, entry->dest, exit->src))
+ {
+ DEBUG_PRINT (dp << "[scop-detection-fail] cannot merge seses.\n");
+ exits.release ();
+ return invalid_sese;
+ }
+ }
+ exits.release ();
+ }
+
/* For now we just want to bail out when exit does not post-dominate entry.
TODO: We might just add a basic_block at the exit to make exit
post-dominate entry (the entire region). */
@@ -905,6 +924,18 @@ scop_detection::build_scop_breadth (sese_l s1, loop_p loop)
sese_l combined = merge_sese (s1, s2);
+ /* Combining adjacent loops may add unrelated loops into the
+ region so we have to check all sub-loops of the outer loop
+ that are in the combined region. */
+ if (combined)
+ for (l = loop_outer (loop)->inner; l; l = l->next)
+ if (bb_in_sese_p (l->header, combined)
+ && ! loop_is_valid_in_scop (l, combined))
+ {
+ combined = invalid_sese;
+ break;
+ }
+
if (combined)
s1 = combined;
else
@@ -931,6 +962,8 @@ scop_detection::can_represent_loop_1 (loop_p loop, sese_l scop)
&& niter_desc.control.no_overflow
&& (niter = number_of_latch_executions (loop))
&& !chrec_contains_undetermined (niter)
+ && !chrec_contains_undetermined (scalar_evolution_in_region (scop,
+ loop, niter))
&& graphite_can_represent_expr (scop, loop, niter);
}
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 22a09a1782f..163eef41f2c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -407,7 +407,7 @@ extract_affine (scop_p s, tree e, __isl_take isl_space *space)
case SSA_NAME:
gcc_assert (-1 != parameter_index_in_region_1 (e, s->scop_info)
- || !invariant_in_sese_p_rec (e, s->scop_info->region, NULL));
+ || defined_in_sese_p (e, s->scop_info->region));
res = extract_affine_name (s, e, space);
break;
@@ -436,11 +436,11 @@ extract_affine (scop_p s, tree e, __isl_take isl_space *space)
/* Returns a linear expression for tree T evaluated in PBB. */
static isl_pw_aff *
-create_pw_aff_from_tree (poly_bb_p pbb, tree t)
+create_pw_aff_from_tree (poly_bb_p pbb, loop_p loop, tree t)
{
scop_p scop = PBB_SCOP (pbb);
- t = scalar_evolution_in_region (scop->scop_info->region, pbb_loop (pbb), t);
+ t = scalar_evolution_in_region (scop->scop_info->region, loop, t);
gcc_assert (!chrec_contains_undetermined (t));
gcc_assert (!automatically_generated_chrec_p (t));
@@ -455,8 +455,9 @@ create_pw_aff_from_tree (poly_bb_p pbb, tree t)
static void
add_condition_to_pbb (poly_bb_p pbb, gcond *stmt, enum tree_code code)
{
- isl_pw_aff *lhs = create_pw_aff_from_tree (pbb, gimple_cond_lhs (stmt));
- isl_pw_aff *rhs = create_pw_aff_from_tree (pbb, gimple_cond_rhs (stmt));
+ loop_p loop = gimple_bb (stmt)->loop_father;
+ isl_pw_aff *lhs = create_pw_aff_from_tree (pbb, loop, gimple_cond_lhs (stmt));
+ isl_pw_aff *rhs = create_pw_aff_from_tree (pbb, loop, gimple_cond_rhs (stmt));
isl_set *cond;
switch (code)
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index f6805d0412e..81109730ed7 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -1271,8 +1271,8 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
res = expand_expr_real_2 (&ops, NULL_RTX, wmode, EXPAND_NORMAL);
rtx hipart = expand_shift (RSHIFT_EXPR, wmode, res, prec,
NULL_RTX, uns);
- hipart = gen_lowpart (mode, hipart);
- res = gen_lowpart (mode, res);
+ hipart = convert_modes (mode, wmode, hipart, uns);
+ res = convert_modes (mode, wmode, res, uns);
if (uns)
/* For the unsigned multiplication, there was overflow if
HIPART is non-zero. */
@@ -1305,16 +1305,16 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
unsigned int hprec = GET_MODE_PRECISION (hmode);
rtx hipart0 = expand_shift (RSHIFT_EXPR, mode, op0, hprec,
NULL_RTX, uns);
- hipart0 = gen_lowpart (hmode, hipart0);
- rtx lopart0 = gen_lowpart (hmode, op0);
+ hipart0 = convert_modes (hmode, mode, hipart0, uns);
+ rtx lopart0 = convert_modes (hmode, mode, op0, uns);
rtx signbit0 = const0_rtx;
if (!uns)
signbit0 = expand_shift (RSHIFT_EXPR, hmode, lopart0, hprec - 1,
NULL_RTX, 0);
rtx hipart1 = expand_shift (RSHIFT_EXPR, mode, op1, hprec,
NULL_RTX, uns);
- hipart1 = gen_lowpart (hmode, hipart1);
- rtx lopart1 = gen_lowpart (hmode, op1);
+ hipart1 = convert_modes (hmode, mode, hipart1, uns);
+ rtx lopart1 = convert_modes (hmode, mode, op1, uns);
rtx signbit1 = const0_rtx;
if (!uns)
signbit1 = expand_shift (RSHIFT_EXPR, hmode, lopart1, hprec - 1,
@@ -1505,11 +1505,12 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
if (loxhi >> (bitsize / 2) == 0 (if uns). */
rtx hipartloxhi = expand_shift (RSHIFT_EXPR, mode, loxhi, hprec,
NULL_RTX, 0);
- hipartloxhi = gen_lowpart (hmode, hipartloxhi);
+ hipartloxhi = convert_modes (hmode, mode, hipartloxhi, 0);
rtx signbitloxhi = const0_rtx;
if (!uns)
signbitloxhi = expand_shift (RSHIFT_EXPR, hmode,
- gen_lowpart (hmode, loxhi),
+ convert_modes (hmode, mode,
+ loxhi, 0),
hprec - 1, NULL_RTX, 0);
do_compare_rtx_and_jump (signbitloxhi, hipartloxhi, NE, true, hmode,
@@ -1519,7 +1520,8 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
/* res = (loxhi << (bitsize / 2)) | (hmode) lo0xlo1; */
rtx loxhishifted = expand_shift (LSHIFT_EXPR, mode, loxhi, hprec,
NULL_RTX, 1);
- tem = convert_modes (mode, hmode, gen_lowpart (hmode, lo0xlo1), 1);
+ tem = convert_modes (mode, hmode,
+ convert_modes (hmode, mode, lo0xlo1, 1), 1);
tem = expand_simple_binop (mode, IOR, loxhishifted, tem, res,
1, OPTAB_DIRECT);
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 92fc9ab361d..258117d165b 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -4745,7 +4745,7 @@ ipa_prop_write_jump_functions (void)
lto_symtab_encoder_iterator lsei;
lto_symtab_encoder_t encoder;
- if (!ipa_node_params_sum)
+ if (!ipa_node_params_sum || !ipa_edge_args_vector)
return;
ob = create_output_block (LTO_section_jump_functions);
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index f3d31e178af..fb3d2608b1d 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -73,7 +73,7 @@ static struct costs *costs;
static struct costs *total_allocno_costs;
/* It is the current size of struct costs. */
-static int struct_costs_size;
+static size_t struct_costs_size;
/* Return pointer to structure containing costs of allocno or pseudo
with given NUM in array ARR. */
diff --git a/gcc/ira-int.h b/gcc/ira-int.h
index 52ec0900558..8d3c1df0665 100644
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@@ -782,7 +782,7 @@ struct target_ira_int {
/* Initialized once. It is a maximal possible size of the allocated
struct costs. */
- int x_max_struct_costs_size;
+ size_t x_max_struct_costs_size;
/* Allocated and initialized once, and used to initialize cost values
for each insn. */
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 57a03df8355..f6395d8fb5a 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -19890,7 +19890,9 @@ find_link_var_op (tree *tp, int *walk_subtrees, void *)
{
tree t = *tp;
- if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t)
+ if (TREE_CODE (t) == VAR_DECL
+ && DECL_HAS_VALUE_EXPR_P (t)
+ && is_global_var (t)
&& lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (t)))
{
*walk_subtrees = 0;
diff --git a/gcc/params.def b/gcc/params.def
index 9e05401f028..7ae89243b48 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -1196,7 +1196,7 @@ DEFPARAM (PARAM_MAX_SSA_NAME_QUERY_DEPTH,
"max-ssa-name-query-depth",
"Maximum recursion depth allowed when querying a property of an"
" SSA name.",
- 3, 1, 0)
+ 3, 1, 10)
DEFPARAM (PARAM_MAX_RTL_IF_CONVERSION_INSNS,
"max-rtl-if-conversion-insns",
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 63e81e8608c..e9572b10dcd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,228 @@
+2017-03-14 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-03-09 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79900 - ICE in strip_typedefs
+ * g++.dg/warn/Wpadded-1.C: New test.
+
+ PR c++/79687
+ * g++.dg/expr/ptrmem8.C: New test.
+ * g++.dg/expr/ptrmem9.C: New test.
+
+ Backported from mainline
+ 2017-01-31 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79264
+ * g++.dg/cpp1y/pr61636-1.C: Augment.
+
+ Backported from mainline
+ 2017-01-17 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/61636
+ * g++.dg/cpp1y/pr61636-1.C: New.
+ * g++.dg/cpp1y/pr61636-2.C: New.
+ * g++.dg/cpp1y/pr61636-3.C: New.
+
+2017-03-14 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79962
+ PR c++/79984
+ * c-c++-common/nonnull-3.c: New test.
+ * g++.dg/warn/Wnonnull3.C: New test.
+
+2017-03-14 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2017-03-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79977
+ * gcc.dg/graphite/pr79977.c: New testcase.
+
+ 2017-03-09 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/79971
+ * gcc.dg/fixed-point/pr79971.c: New testcase.
+
+ 2017-03-02 Richard Biener <rguenther@suse.de>
+
+ PR c/79756
+ * gcc.dg/vector-1.c: New testcase.
+
+ 2017-02-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79666
+ * gcc.dg/torture/pr79666.c: New testcase.
+
+2017-03-07 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-03-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79796 - ICE with NSDMI and this pointer
+ * g++.dg/cpp0x/nsdmi13.C: New test.
+
+2017-03-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Back port from trunk
+ 2017-03-01 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/79439
+ * gcc.target/powerpc/pr79439.c: New test.
+
+2017-03-02 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/79514
+ * gcc.target/i386/pr79514.c: New test.
+
+2017-03-01 Pat Haugen <pthaugen@us.ibm.com>
+
+ Backport from mainline:
+ 2017-03-01 Pat Haugen <pthaugen@us.ibm.com>
+
+ * gcc.target/powerpc/pr79544.c: Add test for vec_vsrad and fix up
+ scan string.
+
+ 2017-02-27 Pat Haugen <pthaugen@us.ibm.com>
+
+ PR target/79544
+ * gcc.target/powerpc/pr79544.c: New.
+
+2017-02-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/20170228-1.c: New test.
+
+2017-02-25 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/78474
+ * gfortran.dg/submodule_22.f08: New test.
+
+ PR fortran/78331
+ * gfortran.dg/submodule_21.f08: New test.
+
+2017-02-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt63.adb: New test.
+
+2017-02-23 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79268
+ * gcc.target/powerpc/pr79268.c: Enable for BE targets also.
+
+2017-02-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79261
+ * gcc.target/powerpc/vec-xxpermdi.c: New file.
+
+2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/79537
+ * gcc.dg/comp-goto-4.c: New.
+
+ PR sanitizer/79558
+ * c-c++-common/ubsan/bounds-14.c: New test.
+
+2017-02-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2017-02-17 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/79536
+ * gcc.dg/torture/pr79536.c: New test.
+
+2017-01-17 Carl Love <cel@us.ibm.com>
+
+ Backport from mainline commit r245460 on 2017-02-14
+
+ PR 79545
+ * gcc.target/powerpc/vsx-builtin-3.c: Add missing test case for the
+ xvcvsxdsp and xvcvuxdsp instructions.
+
+2017-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-09 Marek Polacek <polacek@redhat.com>
+
+ PR c/79428
+ * c-c++-common/cilk-plus/CK/pr79428-4.c: New test.
+ * c-c++-common/cilk-plus/CK/pr79428-7.c: New test.
+ * c-c++-common/gomp/pr79428-2.c: New test.
+ * c-c++-common/gomp/pr79428-5.c: New test.
+ * c-c++-common/gomp/pr79428-6.c: New test.
+ * c-c++-common/pr79428-3.c: New test.
+
+2017-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/79411
+ * gcc.c-torture/compile/pr79411.c: New test.
+
+ 2017-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79429
+ * c-c++-common/gomp/pr79429.c: New test.
+ * g++.dg/gomp/pr79429.C: New test.
+
+ PR c/79431
+ * c-c++-common/gomp/pr79431.c: New test.
+
+ 2017-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79377
+ * g++.dg/lookup/pr79377.C: New test.
+
+ 2017-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/79197
+ * gcc.target/powerpc/pr79197.c: New test.
+ * gcc.c-torture/compile/pr79197.c: New test.
+
+ 2017-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/79267
+ * g++.dg/opt/pr79267.C: New test.
+
+2017-02-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/79495
+ * gcc.target/i386/pr79495.c: New test.
+
+ PR middle-end/61225
+ * gcc.target/i386/pr49095.c: Add -fno-shrink-wrap to dg-options.
+ Use dg-additional-options for ia32 target. Remove XFAIL.
+
+2017-02-13 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79296
+ * g++.dg/cpp0x/pr79296.C: New.
+
+2017-02-08 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2017-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ PR tree-optimization/79409
+ * gcc.dg/graphite/pr71824-3.c: New testcase.
+
+ 2017-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * gcc.dg/graphite/pr71824-2.c: New testcase.
+
+ 2017-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * gcc.dg/graphite/pr71824.c: New testcase.
+
2017-02-03 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3-p8.c: Add new testfile for missing
@@ -338,8 +563,8 @@
Backport from mainline
2016-11-07 Bernd Schmidt <bschmidt@redhat.com>
- PR rtl-optimization/77309
- * gcc.dg/torture/pr77309.c: New test.
+ PR rtl-optimization/77309
+ * gcc.dg/torture/pr77309.c: New test.
2016-12-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
@@ -748,7 +973,7 @@
* g++.dg/torture/pr77822.C: New test.
2016-11-20 Harald Anlauf <anlauf@gmx.de>
-
+
PR fortran/69741
* gfortran.dg/forall_18.f90: New testcase.
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c
new file mode 100644
index 00000000000..cd4d40686a5
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c
@@ -0,0 +1,3 @@
+/* PR c/79428 */
+/* { dg-options "-fcilkplus" } */
+#pragma cilk grainsize /* { dg-error "must be inside a function" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c
new file mode 100644
index 00000000000..bc36f51d914
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c
@@ -0,0 +1,3 @@
+/* PR c/79428 */
+/* { dg-options "-fcilkplus" } */
+#pragma simd /* { dg-error "must be inside a function" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79428-2.c b/gcc/testsuite/c-c++-common/gomp/pr79428-2.c
new file mode 100644
index 00000000000..a26c462dbbd
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr79428-2.c
@@ -0,0 +1,7 @@
+/* PR c/79428 */
+/* { dg-options "-fopenmp" } */
+void
+foo ()
+{
+#pragma omp sections
+#pragma omp section /* { dg-error "'#pragma omp section' may only be used in '#pragma omp sections' construct|not allowed|expected" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79428-5.c b/gcc/testsuite/c-c++-common/gomp/pr79428-5.c
new file mode 100644
index 00000000000..4f2127bccdf
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr79428-5.c
@@ -0,0 +1,3 @@
+/* PR c/79428 */
+/* { dg-options "-fopenmp" } */
+#pragma omp ordered /* { dg-error "expected declaration specifiers before end of line" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79428-6.c b/gcc/testsuite/c-c++-common/gomp/pr79428-6.c
new file mode 100644
index 00000000000..7e833e27dca
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr79428-6.c
@@ -0,0 +1,3 @@
+/* PR c/79428 */
+/* { dg-options "-fopenmp" } */
+#pragma omp target /* { dg-error "expected declaration specifiers before end of line" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79429.c b/gcc/testsuite/c-c++-common/gomp/pr79429.c
new file mode 100644
index 00000000000..c9a54d5e08d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr79429.c
@@ -0,0 +1,3 @@
+/* PR c++/79429 */
+
+#pragma omp target /* { dg-error "expected declaration specifiers" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr79431.c b/gcc/testsuite/c-c++-common/gomp/pr79431.c
new file mode 100644
index 00000000000..62f7a059a74
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr79431.c
@@ -0,0 +1,8 @@
+/* PR c/79431 */
+
+void
+foo (void)
+{
+ int a;
+ #pragma omp declare target (a)
+}
diff --git a/gcc/testsuite/c-c++-common/nonnull-3.c b/gcc/testsuite/c-c++-common/nonnull-3.c
new file mode 100644
index 00000000000..d2ccb24f4fd
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/nonnull-3.c
@@ -0,0 +1,11 @@
+/* PR c++/79984 */
+/* { dg-do compile } */
+/* { dg-options "-Wnonnull-compare" } */
+
+enum { r = 1 };
+
+__attribute__ ((nonnull (r))) int
+f (int *p)
+{
+ return p == 0; /* { dg-warning "nonnull argument 'p' compared to NULL" } */
+}
diff --git a/gcc/testsuite/c-c++-common/pr79428-3.c b/gcc/testsuite/c-c++-common/pr79428-3.c
new file mode 100644
index 00000000000..ec7077de55f
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr79428-3.c
@@ -0,0 +1,3 @@
+/* PR c/79428 */
+int i;
+#pragma GCC pch_preprocess /* { dg-error "'#pragma GCC pch_preprocess' must be first" } */
diff --git a/gcc/testsuite/c-c++-common/ubsan/bounds-14.c b/gcc/testsuite/c-c++-common/ubsan/bounds-14.c
new file mode 100644
index 00000000000..ddb52516235
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/ubsan/bounds-14.c
@@ -0,0 +1,13 @@
+/* PR sanitizer/79558 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=bounds" } */
+
+void
+fn1 (int n)
+{
+ int i, j;
+ int x[2][0];
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ x[i][j] = 5;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi13.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi13.C
new file mode 100644
index 00000000000..2751da3b5cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi13.C
@@ -0,0 +1,13 @@
+// PR c++/79796
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ A* p = this;
+};
+
+void foo()
+{
+ A a;
+ a = A({});
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr79296.C b/gcc/testsuite/g++.dg/cpp0x/pr79296.C
new file mode 100644
index 00000000000..00dc2be1019
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr79296.C
@@ -0,0 +1,18 @@
+// { dg-require-effective-target lto }
+// { dg-additional-options "-flto" }
+// { dg-do compile { target c++11 } }
+
+// PR 79296 ICE mangling local class of localized instantiation
+
+struct X {
+ template <typename T> X (T const *) {
+ struct Z {};
+ }
+};
+
+void Baz ()
+{
+ struct Y { } y;
+
+ 0, X (&y);
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-union1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-union1.C
new file mode 100644
index 00000000000..8aed6d9bf55
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-union1.C
@@ -0,0 +1,11 @@
+// PR c++/78897
+// { dg-do compile { target c++14 } }
+
+struct Optional {
+ constexpr Optional() : _dummy{} { _value = 1; }
+ union {
+ int _dummy;
+ int _value;
+ };
+};
+Optional opt{};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr61636-1.C b/gcc/testsuite/g++.dg/cpp1y/pr61636-1.C
new file mode 100644
index 00000000000..5cc8ca1d274
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/pr61636-1.C
@@ -0,0 +1,36 @@
+// PR c++/61636
+// PR c++/79264
+// { dg-do compile { target c++14 } }
+
+// ICE because we figure this capture too late.
+
+struct Base
+{
+ void Bar (int);
+};
+
+struct A : Base {
+ void b ();
+ void Foo (int);
+ using Base::Bar;
+ template <typename T> void Baz (T);
+};
+
+void A::b() {
+
+ auto lam = [&](auto asdf) { Foo (asdf); };
+
+ lam (0);
+
+ auto lam1 = [&](auto asdf) { Bar (asdf); };
+
+ lam1 (0);
+
+ auto lam2 = [&](auto asdf) { Baz (asdf); };
+
+ lam2 (0);
+
+ auto lam3 = [&](auto asdf) { Baz<int> (asdf); };
+
+ lam3 (0);
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr61636-2.C b/gcc/testsuite/g++.dg/cpp1y/pr61636-2.C
new file mode 100644
index 00000000000..a1bd597295a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/pr61636-2.C
@@ -0,0 +1,72 @@
+// PR c++/61636
+// { dg-do run { target c++14 } }
+
+// Check we don't capture this (too) unnecessarily
+
+struct A {
+ int b ();
+ void f (int) {}
+ static void f (double) {}
+
+ static void g (int) {}
+ static void g (double) {}
+};
+
+struct O {
+ void x (int) {}
+ static void x (double) {}
+};
+
+namespace N {
+ void y (double) {}
+}
+
+int Check (bool expect, unsigned size)
+{
+ return (expect ? sizeof (void *) : 1) != size;
+}
+
+int A::b() {
+ int r = 0;
+
+ // one of the functions is non-static
+ auto l0 = [&](auto z) { f (z); };
+ r += Check (true, sizeof l0);
+ l0(0.0); // doesn't need this capture for A::f(double), but too late
+ l0 (0); // Needs this capture for A::f(int)
+
+ // no fn is non-static.
+ auto l00 = [&](auto z) { g (z); };
+ r += Check (false, sizeof l00);
+ l00(0.0);
+ l00 (0);
+
+ // sizeof isn't an evaluation context, so no this capture
+ auto l1 = [&](auto z) { sizeof (f (z), 1); };
+ r += Check (false, sizeof l1);
+ l1(0.0); l1 (0);
+
+ auto l2 = [&](auto) { f (2.4); };
+ auto l3 = [&](auto) { f (0); };
+ l2(0); l3(0); l2(0.0); l3 (0.0);
+ r += Check (false, sizeof l2);
+ r += Check (true, sizeof l3);
+
+ auto l4 = [&](auto) { O::x (2.4); };
+ auto l5 = [&](auto) { N::y (2.4); };
+ auto l6 = [&](auto) { };
+ l4(0); l5(0); l6(0);
+ l4(0.0); l5(0.0); l6(0.0);
+ r += Check (false, sizeof l4);
+ r += Check (false, sizeof l5);
+ r += Check (false, sizeof l6);
+
+ return r;
+}
+
+int main ()
+{
+ A a;
+
+ return a.b () ? 1 : 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr61636-3.C b/gcc/testsuite/g++.dg/cpp1y/pr61636-3.C
new file mode 100644
index 00000000000..18f83fe435e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/pr61636-3.C
@@ -0,0 +1,25 @@
+// PR c++/61636
+// { dg-do compile { target c++14 } }
+// permissiveness doesn't make this permitted
+// { dg-additional-options "-fpermissive" }
+
+// ICE because we attempt to use dependent Foo during error recovery
+// and die with an unexpected this capture need.
+
+template <typename T> struct Base
+{
+ void Foo (int);
+};
+
+template <typename T> struct A : Base<T> {
+ void b ();
+};
+
+template <typename T> void A<T>::b() {
+
+ auto lam = [&](auto asdf) { Foo (asdf); }; // { dg-error "not declared" }
+
+ lam (T(0));
+}
+
+template void A<int>::b ();
diff --git a/gcc/testsuite/g++.dg/expr/ptrmem8.C b/gcc/testsuite/g++.dg/expr/ptrmem8.C
new file mode 100644
index 00000000000..c5a766aa5b5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptrmem8.C
@@ -0,0 +1,15 @@
+// PR c++/79687
+// { dg-do run }
+
+struct A
+{
+ char c;
+};
+
+int main()
+{
+ char A::* p = &A::c;
+ static char A::* const q = p;
+ A a;
+ return &(a.*q) - &a.c;
+}
diff --git a/gcc/testsuite/g++.dg/expr/ptrmem9.C b/gcc/testsuite/g++.dg/expr/ptrmem9.C
new file mode 100644
index 00000000000..32ce777aeb8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/ptrmem9.C
@@ -0,0 +1,19 @@
+// PR c++/79687
+// { dg-do run }
+
+struct A
+{
+ char c;
+};
+
+int main()
+{
+ static char A::* p1 = &A::c;
+ char A::* const q1 = p1;
+
+ char A::* p2 = &A::c;
+ static char A::* const q2 = p2;
+
+ A a;
+ return (&(a.*q1) - &a.c) || (&(a.*q2) - &a.c);
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr79429.C b/gcc/testsuite/g++.dg/gomp/pr79429.C
new file mode 100644
index 00000000000..8ecbcd38963
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr79429.C
@@ -0,0 +1,3 @@
+// PR c++/79429
+
+#pragma omp ordered // { dg-error "expected declaration specifiers" }
diff --git a/gcc/testsuite/g++.dg/lookup/pr79377.C b/gcc/testsuite/g++.dg/lookup/pr79377.C
new file mode 100644
index 00000000000..baf9a256c7c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/pr79377.C
@@ -0,0 +1,36 @@
+// PR c++/79377
+// { dg-do run }
+// { dg-options "-fpermissive" }
+
+struct A
+{
+ A () : a (0) {}
+ A& operator++ () { ++a; ++c; return *this; }
+ int a;
+ static int c;
+};
+
+int A::c = 0;
+
+template <typename>
+void
+foo (A& a)
+{
+ a++; // { dg-warning "trying prefix operator instead" }
+ if (A::c != 3 || a.a != 3) __builtin_abort ();
+ ++a;
+ if (A::c != 4 || a.a != 4) __builtin_abort ();
+}
+
+int
+main ()
+{
+ A a;
+ if (A::c != 0 || a.a != 0) __builtin_abort ();
+ ++a;
+ if (A::c != 1 || a.a != 1) __builtin_abort ();
+ a++; // { dg-warning "trying prefix operator instead" }
+ if (A::c != 2 || a.a != 2) __builtin_abort ();
+ foo<int> (a);
+ if (A::c != 4 || a.a != 4) __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr79267.C b/gcc/testsuite/g++.dg/opt/pr79267.C
new file mode 100644
index 00000000000..177eee6c6f7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr79267.C
@@ -0,0 +1,69 @@
+// PR tree-optimization/79267
+// { dg-do compile }
+// { dg-options "-O3" }
+
+struct A { A (int); };
+struct B
+{
+ virtual void av () = 0;
+ void aw ();
+ void h () { av (); aw (); }
+};
+template <class T> struct G : B
+{
+ T ba;
+ G (int, T) : ba (0) {}
+ void av () { ba (0); }
+};
+struct I
+{
+ B *bc;
+ template <class j, class T> I (j, T) try { G<T> (0, 0); } catch (...) {}
+ ~I () { bc->h (); }
+};
+template <class M> struct C { typedef M *i; };
+template <class M> struct J
+{
+ J ();
+ template <class O, class T> J (O, T p2) : be (0, p2) {}
+ typename C<M>::i operator-> ();
+ I be;
+};
+struct H : A { H () : A (0) {} };
+struct D { J<int> d; void q (); };
+template <typename = int> class bs;
+int z;
+
+void
+foo (int p1, int *, int)
+{
+ if (p1 == 0)
+ throw H ();
+}
+
+D bar ();
+template <typename T> struct L
+{
+ struct K { K (int); void operator() (int *) { bar ().q (); } };
+ static J<T> bp () { bq (0); }
+ template <typename br> static void bq (br) { J<T> (0, K (0)); }
+};
+struct F
+{
+ virtual J<int> x (int) { foo (0, 0, 0); J<bs<> > (L<bs<> >::bp ()); }
+};
+
+void
+baz ()
+{
+ if (z)
+ {
+ J<F> d, e;
+ d->x (0);
+ e->x (0);
+ }
+ J<F> v, i, j;
+ v->x (0);
+ i->x (0);
+ j->x (0);
+}
diff --git a/gcc/testsuite/g++.dg/template/bitfield3.C b/gcc/testsuite/g++.dg/template/bitfield3.C
new file mode 100644
index 00000000000..8f1125537e9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/bitfield3.C
@@ -0,0 +1,20 @@
+// PR c++/78908
+
+struct A { int a : 1; };
+struct F { int foo (A const &); };
+template <typename> struct O : F { int foo (A const &); };
+struct S {} b;
+template <typename L, typename T> int operator<< (L, T) { return (T) 123; }
+template <typename T> int O<T>::foo (A const &x) { return b << x.a; }
+
+int
+main ()
+{
+ A a = { 0 };
+ O<int> o;
+ if (o.foo (a) != 123)
+ __builtin_abort ();
+ signed char d = 2;
+ if ((b << d) != 123)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull3.C b/gcc/testsuite/g++.dg/warn/Wnonnull3.C
new file mode 100644
index 00000000000..d1918ef8e90
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wnonnull3.C
@@ -0,0 +1,15 @@
+// PR c++/79962
+// { dg-options "-Wnonnull" }
+
+template <class T>
+__attribute__ ((__nonnull__ (T::i))) void f (typename T::U) { }
+
+struct S1 { enum { i = 1 }; typedef void* U; };
+struct S2 { static const int i = 1; typedef void* U; };
+
+void
+g ()
+{
+ f<S1>(0); // { dg-warning "null argument where non-null required" }
+ f<S2>(0); // { dg-warning "null argument where non-null required" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wpadded-1.C b/gcc/testsuite/g++.dg/warn/Wpadded-1.C
new file mode 100644
index 00000000000..af375a4d055
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wpadded-1.C
@@ -0,0 +1,22 @@
+// PR c++/79900 - ICE in strip_typedefs
+// { dg-do compile }
+// { dg-options "-Wpadded" }
+
+template <class> struct A;
+template <typename> struct B { // { dg-warning "padding struct size to alignment boundary" }
+ long long _M_off;
+ char _M_state;
+};
+template <> struct A<char> { typedef B<int> pos_type; };
+enum _Ios_Openmode {};
+struct C {
+ typedef _Ios_Openmode openmode;
+};
+template <typename, typename _Traits> struct D {
+ typedef typename _Traits::pos_type pos_type;
+ pos_type m_fn1(pos_type, C::openmode);
+};
+template class D<char, A<char> >;
+template <typename _CharT, typename _Traits>
+typename D<_CharT, _Traits>::pos_type D<_CharT, _Traits>::m_fn1(pos_type x,
+ C::openmode) { return x; }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr79197.c b/gcc/testsuite/gcc.c-torture/compile/pr79197.c
new file mode 100644
index 00000000000..f3ac71abdb3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr79197.c
@@ -0,0 +1,10 @@
+/* PR target/79197 */
+
+unsigned long b;
+
+unsigned long
+foo (float *a, float *x)
+{
+ __builtin_memcpy (a, x, sizeof (float));
+ return *a;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr79411.c b/gcc/testsuite/gcc.c-torture/compile/pr79411.c
new file mode 100644
index 00000000000..7bd545bc4c5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr79411.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/79411 */
+
+typedef struct __jmp_buf_tag { char buf[1024]; } jmp_buf[1];
+extern int setjmp (jmp_buf);
+extern int bar (unsigned int *);
+extern jmp_buf *baz (void);
+struct C { int c1; unsigned int c2, c3, c4; };
+
+void
+foo (struct C *x, const int *y, unsigned int *z, unsigned int e, unsigned int g)
+{
+ unsigned int d = 0;
+ unsigned long f;
+ setjmp (*baz ());
+ f = 1 + d;
+ if ((x->c1 || x->c2) && g && (!e || d >= 8))
+ d = 16;
+ else
+ d = 8;
+ if ((!x->c3 && !x->c4 || *y == 0) && !e && bar (z))
+ *z = 1 + f;
+}
diff --git a/gcc/testsuite/gcc.dg/comp-goto-4.c b/gcc/testsuite/gcc.dg/comp-goto-4.c
new file mode 100644
index 00000000000..51a6a867706
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/comp-goto-4.c
@@ -0,0 +1,21 @@
+/* PR middle-end/79537 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-require-effective-target indirect_jumps } */
+/* { dg-require-effective-target label_values } */
+
+void
+f (void)
+{
+L:
+ *&&L;
+}
+
+void
+f2 (void)
+{
+ void *p;
+L:
+ p = &&L;
+ *p; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+}
diff --git a/gcc/testsuite/gcc.dg/fixed-point/pr79971.c b/gcc/testsuite/gcc.dg/fixed-point/pr79971.c
new file mode 100644
index 00000000000..cccea1f5dc8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fixed-point/pr79971.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void
+a ()
+{
+ unsigned _Accum b;
+ for (b = 0.1; b; b += 0.1uk)
+ {
+ _Sat unsigned _Accum b;
+ for (b = 0; b <= 0.8; b = 0.1)
+ ;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr71824-2.c b/gcc/testsuite/gcc.dg/graphite/pr71824-2.c
new file mode 100644
index 00000000000..18176568d4a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr71824-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+typedef struct { float x1; } bx;
+typedef struct {
+ int w;
+ short o;
+} T2P;
+T2P a;
+int b;
+void fn2();
+void fn3(bx*,short);
+void fn1() {
+ unsigned i = 0;
+ int c;
+ bx *d;
+ bx **h;
+ if (b == 0) {
+ fn2();
+ return;
+ }
+ for (; c; c++)
+ for (; i < 100; i++) {
+ d = h[i];
+ d->x1 = a.w;
+ }
+ for (; i < 100; i++) {
+ d = h[i];
+ d->x1 = a.w;
+ }
+ if (a.o)
+ for (; b;)
+ fn3(d, a.o);
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr71824-3.c b/gcc/testsuite/gcc.dg/graphite/pr71824-3.c
new file mode 100644
index 00000000000..37e5c3ba34d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr71824-3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -floop-nest-optimize" } */
+
+struct
+{
+ int bz;
+} od, ka[2];
+
+int fw;
+
+void
+pc (void)
+{
+ for (od.bz = 0; od.bz < 2; ++od.bz)
+ {
+ ++fw;
+ ka[0] = ka[1];
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr71824.c b/gcc/testsuite/gcc.dg/graphite/pr71824.c
new file mode 100644
index 00000000000..2a90e30e50f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr71824.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int a, b, d;
+int **c;
+int fn1() {
+ while (a)
+ if (d) {
+ int e = -d;
+ for (; b < e; b++)
+ c[b] = &a;
+ } else {
+ for (; b; b++)
+ c[b] = &b;
+ d = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr79977.c b/gcc/testsuite/gcc.dg/graphite/pr79977.c
new file mode 100644
index 00000000000..09606b0739b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr79977.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int uo[3];
+int di;
+
+void
+i7 (int mp)
+{
+ int l4;
+
+wh:
+ while (l4 > 1)
+ {
+ for (di = 0; di < 2; ++di)
+ uo[di] = 0;
+
+ for (di = 0; di < 3; ++di)
+ {
+ uo[di] = 0;
+ if (mp != 0)
+ goto wh;
+ }
+
+ --l4;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr79536.c b/gcc/testsuite/gcc.dg/torture/pr79536.c
new file mode 100644
index 00000000000..6f05ca7d134
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr79536.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+typedef int A;
+int
+fn1 (A x, A y)
+{
+ if ((x + (x - y) * 1i) != -(-x + (y - x) * 1i))
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr79666.c b/gcc/testsuite/gcc.dg/torture/pr79666.c
new file mode 100644
index 00000000000..3d83229521c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr79666.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+struct
+{
+ unsigned a:6;
+} b;
+
+int c, e, g = 7;
+signed char d, f = 6, h = -10;
+
+void fn1 ()
+{
+ for (; c < 9; c++)
+ {
+ if (f)
+ g = ~(~0 / (g ^ e));
+ b.a = ~0;
+ d = ~((h ^ b.a) & 132 & (~(f && g) | (d && 1)));
+ e = ~0;
+ if (d < 127 || f < 1)
+ continue;
+ g = 0;
+ }
+}
+
+int main ()
+{
+ fn1 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vector-1.c b/gcc/testsuite/gcc.dg/vector-1.c
new file mode 100644
index 00000000000..a5eaa2a8c2d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vector-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu90" } */
+
+typedef int V __attribute__ ((vector_size(4)));
+void fn1 ()
+{
+ (V){(1,0)}[0] = 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr49095.c b/gcc/testsuite/gcc.target/i386/pr49095.c
index 5fde08bb286..73758f8c523 100644
--- a/gcc/testsuite/gcc.target/i386/pr49095.c
+++ b/gcc/testsuite/gcc.target/i386/pr49095.c
@@ -1,7 +1,7 @@
/* PR rtl-optimization/49095 */
/* { dg-do compile } */
-/* { dg-options "-Os" } */
-/* { dg-options "-Os -mregparm=2" { target ia32 } } */
+/* { dg-options "-Os -fno-shrink-wrap" } */
+/* { dg-additional-options "-mregparm=2" { target ia32 } } */
void foo (void *);
@@ -70,5 +70,4 @@ G (short)
G (int)
G (long)
-/* See PR61225 for the XFAIL. */
-/* { dg-final { scan-assembler-not "test\[lq\]" { xfail { ia32 } } } } */
+/* { dg-final { scan-assembler-not "test\[lq\]" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr79495.c b/gcc/testsuite/gcc.target/i386/pr79495.c
new file mode 100644
index 00000000000..27f48facbd2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr79495.c
@@ -0,0 +1,11 @@
+/* PR target/79495 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msoft-float" } */
+
+long double dnan = 1.0l/0.0l - 1.0l/0.0l;
+long double x = 1.0l;
+void fn1 (void)
+{
+ if (dnan != x)
+ x = 1.0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr79514.c b/gcc/testsuite/gcc.target/i386/pr79514.c
new file mode 100644
index 00000000000..c5b7bf8ef67
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr79514.c
@@ -0,0 +1,12 @@
+/* PR target/79514 */
+/* { dg-do compile } */
+/* { dg-options "-m96bit-long-double" } */
+
+extern void bar (long double);
+
+extern long double x;
+
+void foo (void)
+{
+ bar (x);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79197.c b/gcc/testsuite/gcc.target/powerpc/pr79197.c
new file mode 100644
index 00000000000..659d76c15c1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr79197.c
@@ -0,0 +1,11 @@
+/* PR target/79197 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -mno-popcntd" } */
+
+unsigned a;
+
+void
+foo (void)
+{
+ a = *(double *) (__UINTPTR_TYPE__) 0x400000;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79268.c b/gcc/testsuite/gcc.target/powerpc/pr79268.c
index 4624736422c..8451356f46e 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr79268.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr79268.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { powerpc64le-*-* } } } */
+/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-*-aix* } } */
/* { dg-options "-mcpu=power8 -O3 " } */
/* Verify that vec_xl and vec_xst accept vector pixel parameters. */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79439.c b/gcc/testsuite/gcc.target/powerpc/pr79439.c
new file mode 100644
index 00000000000..c9b99871a5e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr79439.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target { powerpc64*-*-linux* && lp64 } } } */
+/* { dg-options "-O2 -fpic" } */
+
+/* On the Linux 64-bit ABIs, we should not eliminate NOP in the 'rec' call if
+ -fpic is used because rec can be interposed at link time (since it is
+ external), and the recursive call should call the interposed function. The
+ Linux 32-bit ABIs do not require NOPs after the BL instruction. */
+
+int f (void);
+
+void
+g (void)
+{
+}
+
+int
+rec (int a)
+{
+ int ret = 0;
+ if (a > 10 && f ())
+ ret += rec (a - 1);
+ g ();
+ return a + ret;
+}
+
+/* { dg-final { scan-assembler-times {\mbl f\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mbl g\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mbl rec\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mnop\M} 4 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79544.c b/gcc/testsuite/gcc.target/powerpc/pr79544.c
new file mode 100644
index 00000000000..1016fbdb482
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr79544.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O2" } */
+
+#include <altivec.h>
+
+vector unsigned long long
+test_sra (vector unsigned long long x, vector unsigned long long y)
+{
+ return vec_sra (x, y);
+}
+
+vector unsigned long long
+test_vsrad (vector unsigned long long x, vector unsigned long long y)
+{
+ return vec_vsrad (x, y);
+}
+
+/* { dg-final { scan-assembler-times {\mvsrad\M} 2 } } */
+
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-xxpermdi.c b/gcc/testsuite/gcc.target/powerpc/vec-xxpermdi.c
new file mode 100644
index 00000000000..d56276a3dd9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-xxpermdi.c
@@ -0,0 +1,68 @@
+/* { dg-do run { target { powerpc64*-*-* && vsx_hw } } } */
+/* { dg-options "-O2 -mvsx" } */
+
+/* Added for PR79261 to test that vec_xxpermdi works correctly for
+ both BE and LE targets. */
+
+#include <altivec.h>
+void abort (void);
+
+vector double vdx = { 0.0, 1.0 };
+vector double vdy = { 2.0, 3.0 };
+vector double vdz;
+
+vector signed long long vsllx = { 0, 1 };
+vector signed long long vslly = { 2, 3 };
+vector signed long long vsllz;
+
+vector float vfx = { 0.0, 1.0, 2.0, 3.0 };
+vector float vfy = { 4.0, 5.0, 6.0, 7.0 };
+vector float vfz;
+
+vector signed int vsix = { 0, 1, 2, 3 };
+vector signed int vsiy = { 4, 5, 6, 7 };
+vector signed int vsiz;
+
+vector signed short vssx = { 0, 1, 2, 3, 4, 5, 6, 7 };
+vector signed short vssy = { 8, 9, 10, 11, 12, 13, 14, 15 };
+vector signed short vssz;
+
+vector signed char vscx = { 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15 };
+vector signed char vscy = { 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31 };
+vector signed char vscz;
+
+int
+main ()
+{
+ vdz = vec_xxpermdi (vdx, vdy, 0b01);
+ if (vdz[0] != 0.0 || vdz[1] != 3.0)
+ abort ();
+
+ vsllz = vec_xxpermdi (vsllx, vslly, 0b10);
+ if (vsllz[0] != 1 || vsllz[1] != 2)
+ abort ();
+
+ vfz = vec_xxpermdi (vfx, vfy, 0b01);
+ if (vfz[0] != 0.0 || vfz[1] != 1.0 || vfz[2] != 6.0 || vfz[3] != 7.0)
+ abort ();
+
+ vsiz = vec_xxpermdi (vsix, vsiy, 0b10);
+ if (vsiz[0] != 2 || vsiz[1] != 3 || vsiz[2] != 4 || vsiz[3] != 5)
+ abort ();
+
+ vssz = vec_xxpermdi (vssx, vssy, 0b00);
+ if (vssz[0] != 0 || vssz[1] != 1 || vssz[2] != 2 || vssz[3] != 3
+ || vssz[4] != 8 || vssz[5] != 9 || vssz[6] != 10 || vssz[7] != 11)
+ abort ();
+
+ vscz = vec_xxpermdi (vscx, vscy, 0b11);
+ if (vscz[0] != 8 || vscz[1] != 9 || vscz[2] != 10 || vscz[3] != 11
+ || vscz[4] != 12 || vscz[5] != 13 || vscz[6] != 14 || vscz[7] != 15
+ || vscz[8] != 24 || vscz[9] != 25 || vscz[10] != 26 || vscz[11] != 27
+ || vscz[12] != 28 || vscz[13] != 29 || vscz[14] != 30 || vscz[15] != 31)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c
index f337c1c745b..ff5296c87e2 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c
@@ -35,6 +35,8 @@
/* { dg-final { scan-assembler "xvcmpgesp" } } */
/* { dg-final { scan-assembler "xxsldwi" } } */
/* { dg-final { scan-assembler-not "call" } } */
+/* { dg-final { scan-assembler "xvcvsxdsp" } } */
+/* { dg-final { scan-assembler "xvcvuxdsp" } } */
extern __vector int si[][4];
extern __vector short ss[][4];
@@ -50,7 +52,9 @@ extern __vector __pixel p[][4];
#ifdef __VSX__
extern __vector double d[][4];
extern __vector long sl[][4];
+extern __vector long long sll[][4];
extern __vector unsigned long ul[][4];
+extern __vector unsigned long long ull[][4];
extern __vector __bool long bl[][4];
#endif
@@ -211,3 +215,22 @@ int do_xxsldwi (void)
d[i][0] = __builtin_vsx_xxsldwi (d[i][1], d[i][2], 3); i++;
return i;
}
+
+int do_xvcvsxdsp (void)
+{
+ int i = 0;
+
+ f[i][0] = __builtin_vsx_xvcvsxdsp (sll[i][1]); i++;
+
+ return i;
+}
+
+int do_xvcvuxdsp (void)
+{
+ int i = 0;
+
+ f[i][0] = __builtin_vsx_xvcvuxdsp (ull[i][1]); i++;
+
+ return i;
+}
+
diff --git a/gcc/testsuite/gcc.target/sparc/20170228-1.c b/gcc/testsuite/gcc.target/sparc/20170228-1.c
new file mode 100644
index 00000000000..575fbce528d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/20170228-1.c
@@ -0,0 +1,20 @@
+/* PR target/79749 */
+/* Reported by Rainer Orth <ro@gcc.gnu.org> */
+
+/* { dg-do run } */
+/* { dg-options "-fomit-frame-pointer" } */
+
+extern void abort (void);
+
+int foo (int x1, int x2, int x3, int x4, int x5, int x6, int x7)
+{
+ return x7;
+}
+
+int main (void)
+{
+ if (foo (100, 200, 300, 400, 500, 600, 700) != 700)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/submodule_21.f08 b/gcc/testsuite/gfortran.dg/submodule_21.f08
new file mode 100644
index 00000000000..c96acb2e856
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/submodule_21.f08
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! Test the fix for PR78331.
+!
+! Reported on https://groups.google.com/forum/#!topic/comp.lang.fortran/NFCF9brKksg
+!
+MODULE MainModule
+END MODULE MainModule
+
+SUBMODULE (MainModule) MySub1
+ IMPLICIT NONE
+ INTEGER, PARAMETER :: a = 17
+END SUBMODULE MySub1
+
+PROGRAM MyProg
+ USE MainModule
+ WRITE(*,*) a
+END PROGRAM MyProg
+! { dg-excess-errors "does not contain a MODULE PROCEDURE" }
diff --git a/gcc/testsuite/gfortran.dg/submodule_22.f08 b/gcc/testsuite/gfortran.dg/submodule_22.f08
new file mode 100644
index 00000000000..8ff5421c77e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/submodule_22.f08
@@ -0,0 +1,47 @@
+! { dg-do compile }
+!
+! Test the fix for PR78474.
+!
+! Contributed by Nicholas Brearly <nick.brealey@cobham.com>
+!
+module mtop
+ implicit none
+ real :: r
+ interface
+ module subroutine sub1()
+ end subroutine
+ end interface
+ interface
+ module subroutine sub2()
+ end subroutine
+ end interface
+ interface
+ module subroutine sub3()
+ end subroutine
+ end interface
+end module mtop
+
+submodule (mtop) submod
+ implicit none
+ real :: s
+contains
+ module subroutine sub1
+ r = 0.0
+ end subroutine sub1
+end
+
+submodule (mtop:submod) subsubmod
+contains
+ module subroutine sub2
+ r = 1.0
+ s = 1.0
+ end subroutine sub2
+end
+
+submodule (mtop:submod:subsubmod) subsubsubmod ! { dg-error "Syntax error in SUBMODULE statement" }
+contains
+ module subroutine sub3
+ r = 2.0
+ s = 2.0
+ end subroutine sub3
+end
diff --git a/gcc/testsuite/gnat.dg/opt63.adb b/gcc/testsuite/gnat.dg/opt63.adb
new file mode 100644
index 00000000000..6471be40bbd
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt63.adb
@@ -0,0 +1,19 @@
+-- { dg-do compile }
+-- { dg-options "-O -gnatws" }
+
+procedure Opt63 is
+
+ type T_MOD is mod 2**32;
+ subtype T_INDEX is T_MOD range 3_000_000_000 .. 4_000_000_000;
+ type T_ARRAY is array(T_INDEX range <>) of INTEGER;
+
+ function Build_Crash(First : T_INDEX; Length : NATURAL) return T_ARRAY is
+ R : T_ARRAY(First .. T_Index'Val (T_Index'Pos (First) + Length))
+ := (others => -1); -- Crash here
+ begin
+ return R;
+ end;
+
+begin
+ null;
+end;
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 2e55b7961d8..bd43af6dff7 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2511,8 +2511,8 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
{
gphi_iterator gsi;
loop_vec_info simple_loop_info;
- loop_vec_info simple_inner_loop_info = NULL;
- bool allow_double_reduc = true;
+ auto_vec<gphi *, 4> double_reduc_phis;
+ auto_vec<gimple *, 4> double_reduc_stmts;
if (!stmt_vec_info_vec.exists ())
init_stmt_vec_info_vec ();
@@ -2542,43 +2542,55 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
if (double_reduc)
{
- if (!allow_double_reduc
- || loop->inner->inner != NULL)
+ if (loop->inner->inner != NULL)
continue;
- if (!simple_inner_loop_info)
- {
- simple_inner_loop_info = vect_analyze_loop_form (loop->inner);
- if (!simple_inner_loop_info)
- {
- allow_double_reduc = false;
- continue;
- }
- }
-
- use_operand_p use_p;
- gimple *inner_stmt;
- bool single_use_p = single_imm_use (res, &use_p, &inner_stmt);
- gcc_assert (single_use_p);
- if (gimple_code (inner_stmt) != GIMPLE_PHI)
- continue;
- gphi *inner_phi = as_a <gphi *> (inner_stmt);
- if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi),
- &iv, true))
- continue;
-
- gimple *inner_reduc_stmt
- = vect_force_simple_reduction (simple_inner_loop_info, inner_phi,
- true, &double_reduc, true);
- gcc_assert (!double_reduc);
- if (inner_reduc_stmt == NULL)
- continue;
+ double_reduc_phis.safe_push (phi);
+ double_reduc_stmts.safe_push (reduc_stmt);
+ continue;
}
build_new_reduction (reduction_list, reduc_stmt, phi);
}
destroy_loop_vec_info (simple_loop_info, true);
- destroy_loop_vec_info (simple_inner_loop_info, true);
+
+ if (!double_reduc_phis.is_empty ())
+ {
+ simple_loop_info = vect_analyze_loop_form (loop->inner);
+ if (simple_loop_info)
+ {
+ gphi *phi;
+ unsigned int i;
+
+ FOR_EACH_VEC_ELT (double_reduc_phis, i, phi)
+ {
+ affine_iv iv;
+ tree res = PHI_RESULT (phi);
+ bool double_reduc;
+
+ use_operand_p use_p;
+ gimple *inner_stmt;
+ bool single_use_p = single_imm_use (res, &use_p, &inner_stmt);
+ gcc_assert (single_use_p);
+ if (gimple_code (inner_stmt) != GIMPLE_PHI)
+ continue;
+ gphi *inner_phi = as_a <gphi *> (inner_stmt);
+ if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi),
+ &iv, true))
+ continue;
+
+ gimple *inner_reduc_stmt
+ = vect_force_simple_reduction (simple_loop_info, inner_phi,
+ true, &double_reduc, true);
+ gcc_assert (!double_reduc);
+ if (inner_reduc_stmt == NULL)
+ continue;
+
+ build_new_reduction (reduction_list, double_reduc_stmts[i], phi);
+ }
+ destroy_loop_vec_info (simple_loop_info, true);
+ }
+ }
gather_done:
/* Release the claim on gimple_uid. */
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index d23dabde7b6..db4718b24da 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -599,7 +599,18 @@ is_reassociable_op (gimple *stmt, enum tree_code code, struct loop *loop)
if (is_gimple_assign (stmt)
&& gimple_assign_rhs_code (stmt) == code
&& has_single_use (gimple_assign_lhs (stmt)))
- return true;
+ {
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs1 (stmt);
+ if (TREE_CODE (rhs1) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs1))
+ return false;
+ if (rhs2
+ && TREE_CODE (rhs2) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs2))
+ return false;
+ return true;
+ }
return false;
}
@@ -4466,6 +4477,8 @@ static bool
can_reassociate_p (tree op)
{
tree type = TREE_TYPE (op);
+ if (TREE_CODE (op) == SSA_NAME && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op))
+ return false;
if ((ANY_INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type))
|| NON_SAT_FIXED_POINT_TYPE_P (type)
|| (flag_associative_math && FLOAT_TYPE_P (type)))
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 8ce43d05842..32c5e3b798d 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -2651,8 +2651,17 @@ extract_range_from_binary_expr_1 (value_range *vr,
min = build_symbolic_expr (expr_type, sym_min_op0,
neg_min_op0, min);
else if (sym_min_op1)
- min = build_symbolic_expr (expr_type, sym_min_op1,
- neg_min_op1 ^ minus_p, min);
+ {
+ /* We may not negate if that might introduce
+ undefined overflow. */
+ if (! minus_p
+ || neg_min_op1
+ || TYPE_OVERFLOW_WRAPS (expr_type))
+ min = build_symbolic_expr (expr_type, sym_min_op1,
+ neg_min_op1 ^ minus_p, min);
+ else
+ min = NULL_TREE;
+ }
/* Likewise for the upper bound. */
if (sym_max_op0 == sym_max_op1)
@@ -2661,8 +2670,17 @@ extract_range_from_binary_expr_1 (value_range *vr,
max = build_symbolic_expr (expr_type, sym_max_op0,
neg_max_op0, max);
else if (sym_max_op1)
- max = build_symbolic_expr (expr_type, sym_max_op1,
- neg_max_op1 ^ minus_p, max);
+ {
+ /* We may not negate if that might introduce
+ undefined overflow. */
+ if (! minus_p
+ || neg_max_op1
+ || TYPE_OVERFLOW_WRAPS (expr_type))
+ max = build_symbolic_expr (expr_type, sym_max_op1,
+ neg_max_op1 ^ minus_p, max);
+ else
+ max = NULL_TREE;
+ }
}
else
{
diff --git a/gcc/ubsan.c b/gcc/ubsan.c
index 109382498fd..2ee908c490b 100644
--- a/gcc/ubsan.c
+++ b/gcc/ubsan.c
@@ -408,7 +408,9 @@ ubsan_type_descriptor (tree type, enum ubsan_print_style pstyle)
{
pp_left_bracket (&pretty_name);
tree dom = TYPE_DOMAIN (t);
- if (dom && TREE_CODE (TYPE_MAX_VALUE (dom)) == INTEGER_CST)
+ if (dom != NULL_TREE
+ && TYPE_MAX_VALUE (dom) != NULL_TREE
+ && TREE_CODE (TYPE_MAX_VALUE (dom)) == INTEGER_CST)
{
if (tree_fits_uhwi_p (TYPE_MAX_VALUE (dom))
&& tree_to_uhwi (TYPE_MAX_VALUE (dom)) + 1 != 0)
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index f9574b679bd..89f6b865766 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1376,7 +1376,13 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
dflags = flags_from_decl_or_type (direct_call->decl);
if ((dflags & ECF_NORETURN) != 0)
- gimple_call_set_lhs (dcall_stmt, NULL_TREE);
+ {
+ tree lhs = gimple_call_lhs (dcall_stmt);
+ if (lhs
+ && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST
+ && !TREE_ADDRESSABLE (TREE_TYPE (lhs)))
+ gimple_call_set_lhs (dcall_stmt, NULL_TREE);
+ }
gsi_insert_before (&gsi, dcall_stmt, GSI_SAME_STMT);
/* Fix CFG. */
diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog
index 5aa7218f7b3..c6a929383a9 100644
--- a/libatomic/ChangeLog
+++ b/libatomic/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-07 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ Backport from mainline:
+ 2017-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR target/78945
+ * config/arm/exch_n.c (libat_exchange): Check __ARM_FEATURE_SIMD32.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
diff --git a/libatomic/config/arm/exch_n.c b/libatomic/config/arm/exch_n.c
index 3b20a974fc8..c521e494561 100644
--- a/libatomic/config/arm/exch_n.c
+++ b/libatomic/config/arm/exch_n.c
@@ -29,7 +29,7 @@
/* When using STREX to implement sub-word exchange, we can do much better
than the compiler by using the APSR.GE and APSR.C flags. */
-#if !DONE && HAVE_STREX && !HAVE_STREXBH && N == 2
+#if !DONE && __ARM_FEATURE_SIMD32 && HAVE_STREX && !HAVE_STREXBH && N == 2
UTYPE
SIZE(libat_exchange) (UTYPE *mptr, UTYPE newval, int smodel)
{
@@ -79,7 +79,7 @@ SIZE(libat_exchange) (UTYPE *mptr, UTYPE newval, int smodel)
#endif /* !HAVE_STREXBH && N == 2 */
-#if !DONE && HAVE_STREX && !HAVE_STREXBH && N == 1
+#if !DONE && __ARM_FEATURE_SIMD32 && HAVE_STREX && !HAVE_STREXBH && N == 1
UTYPE
SIZE(libat_exchange) (UTYPE *mptr, UTYPE newval, int smodel)
{
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 505e58db363..3d116719924 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,12 @@
+2017-02-17 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backported from mainline
+ 2017-02-16 Andreas Tobler <andreast@gcc.gnu.org>
+
+ PR sanitizer/79562
+ * sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick
+ upstream r294806.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
index 9866cc9e17a..6992f2cd8ac 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -21,11 +21,6 @@
#ifdef _FILE_OFFSET_BITS
#undef _FILE_OFFSET_BITS
#endif
-#if SANITIZER_FREEBSD
-#define _WANT_RTENTRY
-#include <sys/param.h>
-#include <sys/socketvar.h>
-#endif
#include <arpa/inet.h>
#include <dirent.h>
#include <errno.h>
@@ -411,6 +406,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo);
unsigned struct_input_id_sz = sizeof(struct input_id);
unsigned struct_mtpos_sz = sizeof(struct mtpos);
+ unsigned struct_rtentry_sz = sizeof(struct rtentry);
unsigned struct_termio_sz = sizeof(struct termio);
unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
@@ -430,7 +426,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_midi_info_sz = sizeof(struct midi_info);
unsigned struct_mtget_sz = sizeof(struct mtget);
unsigned struct_mtop_sz = sizeof(struct mtop);
- unsigned struct_rtentry_sz = sizeof(struct rtentry);
unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
unsigned struct_synth_info_sz = sizeof(struct synth_info);
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8785436171c..67bf7fb83a7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,191 @@
+2017-03-14 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/17_intro/names.cc: Undefine macros that clash with
+ identifiers in AIX system headers.
+
+2017-03-13 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR libstdc++/80034
+ * include/bits/list.tcc (merge(list&&)): Use const for the size_t
+ in the function and in the catch-block, qualify uses of std::distance.
+ (merge(list&&, _StrictWeakOrdering)): Likewise.
+ * testsuite/23_containers/list/operations/80034.cc: New.
+
+2017-03-10 George Lander <george.lander@arm.com>
+
+ * acinclude.m4 (glibcxx_cv_obsolete_isnan): Define
+ _GLIBCXX_INCLUDE_NEXT_C_HEADERS before including math.h.
+ * configure: Regenerate.
+
+2017-03-02 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/79789
+ * include/bits/ios_base.h (make_error_code, make_error_condition):
+ Likewise.
+ * include/bits/mask_array.h (mask_array): Likewise.
+ * include/bits/regex.h (regex_token_iterator): Likewise.
+ * include/bits/slice_array.h (slice_array): Likewise.
+ * include/std/memory (undeclare_no_pointers): Likewise.
+ * testsuite/17_intro/names.cc: New test.
+
+2017-02-15 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/79114
+ * testsuite/18_support/nested_exception/79114.cc: Add dg-require.
+
+ Backport from mainline
+ 2016-12-15 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/59170
+ * python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
+ (StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
+ (StdRbtreeIteratorPrinter.to_string)
+ (StdDequeIteratorPrinter.to_string): Add check for value-initialized
+ iterators.
+ * testsuite/libstdc++-prettyprinters/simple.cc: Test them.
+ * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
+
+ Backport from mainline
+ 2016-12-15 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/59161
+ * python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
+ (StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
+ (StdRbtreeIteratorPrinter.to_string, StdDequeIteratorPrinter.to_string)
+ (StdDebugIteratorPrinter.to_string): Return string instead of
+ gdb.Value.
+ * testsuite/libstdc++-prettyprinters/59161.cc: New test.
+
+ Backport from mainline
+ 2016-12-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * python/libstdcxx/v6/printers.py (UniquePointerPrinter.to_string):
+ Remove redundant parentheses.
+ (RbtreeIterator, StdRbtreeIteratorPrinter): Add docstrings.
+ (StdForwardListPrinter.to_string): Remove redundant parentheses.
+ (StdExpOptionalPrinter.to_string): Use string formatting instead of
+ concatenation.
+ (TemplateTypePrinter): Adjust whitespace.
+
+ Backport from mainline
+ 2016-12-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker.__init__): Use
+ correct element type for unique_ptr<T[]>.
+ (UniquePtrGetWorker._supports, UniquePtrDerefWorker._supports): New
+ functions to disable unsupported operators for unique_ptr<T[]>.
+ (UniquePtrSubscriptWorker): New worker for operator[].
+ (UniquePtrMethodsMatcher.__init__): Register UniquePtrSubscriptWorker.
+ (UniquePtrMethodsMatcher.match): Call _supports on the chosen worker.
+ (SharedPtrGetWorker, SharedPtrDerefWorker, SharedPtrSubscriptWorker)
+ (SharedPtrUseCountWorker, SharedPtrUniqueWorker): New workers.
+ (SharedPtrMethodsMatcher): New matcher for shared_ptr.
+ (register_libstdcxx_xmethods): Register SharedPtrMethodsMatcher.
+ * testsuite/libstdc++-xmethods/unique_ptr.cc: Test arrays.
+ * testsuite/libstdc++-xmethods/shared_ptr.cc: New test.
+
+2017-02-14 Jonathan Wakely <jwakely@redhat.com>
+
+ Backport from mainline
+ 2017-01-20 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/72792
+ * include/bits/alloc_traits.h (__allocator_traits_base::__diff_type)
+ (__allocator_traits_base::__size_type): Remove.
+ (allocator_traits::_Ptr): New class template to detect const and void
+ pointer types without instantiating pointer_traits::rebind
+ unnecessarily.
+ (allocator_traits::_Diff): Likewise for detecting difference_type.
+ (allocator_traits::_Size): New class template to detect size_type
+ without instantiating make_unsigned unnecessarily.
+ * include/bits/ptr_traits.h (pointer_traits::element_type): Use
+ __detected_or_t instead of __detected_or_t_.
+ * include/std/type_traits (__detected_or_t_): Remove.
+ * testsuite/20_util/allocator_traits/members/pointers.cc: New test.
+
+ Backport from mainline
+ 2017-01-20 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/72792
+ PR libstdc++/72793
+ * include/bits/alloc_traits.h (__allocator_traits_base::__rebind):
+ Replace with class template using void_t.
+ (__alloc_rebind): Define in terms of
+ __allocator_traits_base::__rebind.
+ (allocator_traits): Remove unconditional static_assert for
+ rebind_alloc.
+ * include/bits/ptr_traits.h (__replace_first_arg): Remove type member.
+ (pointer_traits::__rebind): Replace with class template using void_t.
+ (pointer_traits::rebind): Define in terms of __rebind.
+ (pointer_traits): Remove unconditional static_assert for rebind.
+ * testsuite/20_util/allocator_traits/members/rebind_alloc.cc: New test.
+ * testsuite/20_util/pointer_traits/rebind.cc: New test.
+
+ Backport from mainline
+ 2017-01-20 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69321
+ * include/experimental/any (__any_caster): Avoid instantiating
+ manager function for types that can't be stored in any.
+ * testsuite/experimental/any/misc/any_cast.cc: Test non-copyable type.
+
+ Backport from mainline
+ 2017-01-18 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69301
+ * include/std/atomic (atomic<T>::load, atomic<T>::exchange): Use
+ aligned buffer instead of default-initialized variable.
+ * testsuite/29_atomics/atomic/69301.cc: New test.
+ * include/experimental/memory (observer_ptr::release): Use reserved
+ name.
+ * include/ext/pointer.h (_Pointer_adapter::operator++(int))
+ (_Pointer_adapter::operator--(int)): Likewise.
+
+ Backport from mainline
+ 2017-01-17 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/79114
+ * libsupc++/nested_exception.h (throw_with_nested): Use decay instead
+ of remove_reference.
+ * testsuite/18_support/nested_exception/79114.cc: New test.
+
+ Backport from mainline
+ 2017-01-16 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/78702
+ * include/bits/locale_classes.h (locale::facet::__shim): Change from
+ private to protected.
+ * src/c++11/cxx11-shim_facets.cc (__shim_accessor): Define helper to
+ make locale::facet::__shim accessible.
+
+ Backport from mainline
+ 2017-01-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/78134
+ * include/bits/stl_map.h (map::lower_bound, map::upper_bound)
+ (map::equal_range): Fix return type of heterogeneous overloads.
+ * include/bits/stl_multimap.h (multimap::lower_bound)
+ (multimap::upper_bound, multimap::equal_range): Likewise.
+ * include/bits/stl_multiset.h (multiset::lower_bound)
+ (multiset::upper_bound, multiset::equal_range): Likewise.
+ * include/bits/stl_set.h (set::lower_bound, set::upper_bound)
+ (set::equal_range): Likewise.
+ * testsuite/23_containers/map/operations/2.cc: Check return types.
+ * testsuite/23_containers/multimap/operations/2.cc: Likewise.
+ * testsuite/23_containers/multiset/operations/2.cc: Likewise.
+ * testsuite/23_containers/set/operations/2.cc: Likewise.
+
+ Backport from mainline
+ 2017-01-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/78273
+ * include/bits/stl_map.h (map::count<_Kt>(const _Kt&)): Don't assume
+ the heterogeneous comparison can only find one match.
+ * include/bits/stl_set.h (set::count<_Kt>(const _Kt&)): Likewise.
+ * testsuite/23_containers/map/operations/2.cc: Test count works with
+ comparison function that just partitions rather than sorting.
+ * testsuite/23_containers/set/operations/2.cc: Likewise.
+
2017-02-01 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/78346
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index d507c390451..42bd5724b0b 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2304,7 +2304,8 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
AC_MSG_CHECKING([for obsolete isnan function in <math.h>])
AC_CACHE_VAL(glibcxx_cv_obsolete_isnan, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [#include <math.h>
+ [#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+ #include <math.h>
#undef isnan
namespace std {
using ::isnan;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index ffbfdd5f3ca..0bc9126d03c 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -18385,6 +18385,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include <math.h>
#undef isnan
namespace std {
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index d2d13c692af..25ad9486a5b 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -44,8 +44,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __allocator_traits_base
{
- template<typename _Alloc, typename _Up>
- using __rebind = typename _Alloc::template rebind<_Up>::other;
+ template<typename _Tp, typename _Up, typename = void>
+ struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+ template<typename _Tp, typename _Up>
+ struct __rebind<_Tp, _Up,
+ __void_t<typename _Tp::template rebind<_Up>::other>>
+ { using type = typename _Tp::template rebind<_Up>::other; };
protected:
template<typename _Tp>
@@ -57,10 +62,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
using __cv_pointer = typename _Tp::const_void_pointer;
template<typename _Tp>
- using __diff_type = typename _Tp::difference_type;
- template<typename _Tp>
- using __size_type = typename _Tp::size_type;
- template<typename _Tp>
using __pocca = typename _Tp::propagate_on_container_copy_assignment;
template<typename _Tp>
using __pocma = typename _Tp::propagate_on_container_move_assignment;
@@ -71,9 +72,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _Alloc, typename _Up>
- using __alloc_rebind = __detected_or_t_<__replace_first_arg_t,
- __allocator_traits_base::__rebind,
- _Alloc, _Up>;
+ using __alloc_rebind
+ = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type;
/**
* @brief Uniform interface to all allocator types.
@@ -94,15 +94,45 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
using pointer = __detected_or_t<value_type*, __pointer, _Alloc>;
+ private:
+ // Select _Func<_Alloc> or pointer_traits<pointer>::rebind<_Tp>
+ template<template<typename> class _Func, typename _Tp, typename = void>
+ struct _Ptr
+ {
+ using type = typename pointer_traits<pointer>::template rebind<_Tp>;
+ };
+
+ template<template<typename> class _Func, typename _Tp>
+ struct _Ptr<_Func, _Tp, __void_t<_Func<_Alloc>>>
+ {
+ using type = _Func<_Alloc>;
+ };
+
+ // Select _A2::difference_type or pointer_traits<_Ptr>::difference_type
+ template<typename _A2, typename _PtrT, typename = void>
+ struct _Diff
+ { using type = typename pointer_traits<_PtrT>::difference_type; };
+
+ template<typename _A2, typename _PtrT>
+ struct _Diff<_A2, _PtrT, __void_t<typename _A2::difference_type>>
+ { using type = typename _A2::difference_type; };
+
+ // Select _A2::size_type or make_unsigned<_DiffT>::type
+ template<typename _A2, typename _DiffT, typename = void>
+ struct _Size : make_unsigned<_DiffT> { };
+
+ template<typename _A2, typename _DiffT>
+ struct _Size<_A2, _DiffT, __void_t<typename _A2::size_type>>
+ { using type = typename _A2::size_type; };
+
+ public:
/**
* @brief The allocator's const pointer type.
*
* @c Alloc::const_pointer if that type exists, otherwise
* <tt> pointer_traits<pointer>::rebind<const value_type> </tt>
*/
- using const_pointer
- = __detected_or_t<__ptr_rebind<pointer, const value_type>,
- __c_pointer, _Alloc>;
+ using const_pointer = typename _Ptr<__c_pointer, const value_type>::type;
/**
* @brief The allocator's void pointer type.
@@ -110,8 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @c Alloc::void_pointer if that type exists, otherwise
* <tt> pointer_traits<pointer>::rebind<void> </tt>
*/
- using void_pointer
- = __detected_or_t<__ptr_rebind<pointer, void>, __v_pointer, _Alloc>;
+ using void_pointer = typename _Ptr<__v_pointer, void>::type;
/**
* @brief The allocator's const void pointer type.
@@ -119,9 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @c Alloc::const_void_pointer if that type exists, otherwise
* <tt> pointer_traits<pointer>::rebind<const void> </tt>
*/
- using const_void_pointer
- = __detected_or_t<__ptr_rebind<pointer, const void>, __cv_pointer,
- _Alloc>;
+ using const_void_pointer = typename _Ptr<__cv_pointer, const void>::type;
/**
* @brief The allocator's difference type
@@ -129,9 +156,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @c Alloc::difference_type if that type exists, otherwise
* <tt> pointer_traits<pointer>::difference_type </tt>
*/
- using difference_type
- = __detected_or_t<typename pointer_traits<pointer>::difference_type,
- __diff_type, _Alloc>;
+ using difference_type = typename _Diff<_Alloc, pointer>::type;
/**
* @brief The allocator's size type
@@ -139,9 +164,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @c Alloc::size_type if that type exists, otherwise
* <tt> make_unsigned<difference_type>::type </tt>
*/
- using size_type
- = __detected_or_t<typename make_unsigned<difference_type>::type,
- __size_type, _Alloc>;
+ using size_type = typename _Size<_Alloc, difference_type>::type;
/**
* @brief How the allocator is propagated on copy assignment
@@ -184,9 +207,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
- static_assert(!is_same<rebind_alloc<value_type>, __undefined>::value,
- "allocator defines rebind or is like Alloc<T, Args>");
-
private:
template<typename _Alloc2>
static auto
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 97210d28f99..84c03a94f6a 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -207,12 +207,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const error_category& iostream_category() noexcept;
inline error_code
- make_error_code(io_errc e) noexcept
- { return error_code(static_cast<int>(e), iostream_category()); }
+ make_error_code(io_errc __e) noexcept
+ { return error_code(static_cast<int>(__e), iostream_category()); }
inline error_condition
- make_error_condition(io_errc e) noexcept
- { return error_condition(static_cast<int>(e), iostream_category()); }
+ make_error_condition(io_errc __e) noexcept
+ { return error_condition(static_cast<int>(__e), iostream_category()); }
#endif
// 27.4.2 Class ios_base
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index 81b8be2a61e..81f6f0ad4e7 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -386,7 +386,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
- size_t __orig_size = __x.size();
+ const size_t __orig_size = __x.size();
__try {
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
@@ -405,7 +405,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
__catch(...)
{
- size_t __dist = distance(__first2, __last2);
+ const size_t __dist = std::distance(__first2, __last2);
this->_M_inc_size(__orig_size - __dist);
__x._M_set_size(__dist);
__throw_exception_again;
@@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
- size_t __orig_size = __x.size();
+ const size_t __orig_size = __x.size();
__try
{
while (__first1 != __last1 && __first2 != __last2)
@@ -453,7 +453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
__catch(...)
{
- size_t __dist = distance(__first2, __last2);
+ const size_t __dist = std::distance(__first2, __last2);
this->_M_inc_size(__orig_size - __dist);
__x._M_set_size(__dist);
__throw_exception_again;
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index 04b4ab3b1d3..16ed623ccc7 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -461,10 +461,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
}
- class __shim;
-
const facet* _M_sso_shim(const id*) const;
const facet* _M_cow_shim(const id*) const;
+
+ protected:
+ class __shim; // For internal use only.
};
diff --git a/libstdc++-v3/include/bits/mask_array.h b/libstdc++-v3/include/bits/mask_array.h
index ba7828266c7..26d821cfd41 100644
--- a/libstdc++-v3/include/bits/mask_array.h
+++ b/libstdc++-v3/include/bits/mask_array.h
@@ -136,8 +136,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _Tp>
- inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a)
- : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
+ inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& __a)
+ : _M_sz(__a._M_sz), _M_mask(__a._M_mask), _M_array(__a._M_array) {}
template<typename _Tp>
inline
diff --git a/libstdc++-v3/include/bits/ptr_traits.h b/libstdc++-v3/include/bits/ptr_traits.h
index 023f21efc77..98cc9c59e89 100644
--- a/libstdc++-v3/include/bits/ptr_traits.h
+++ b/libstdc++-v3/include/bits/ptr_traits.h
@@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Given Template<T, ...> and U return Template<U, ...>, otherwise invalid.
template<typename _Tp, typename _Up>
struct __replace_first_arg
- { using type = __undefined; };
+ { };
template<template<typename, typename...> class _Template, typename _Up,
typename _Tp, typename... _Types>
@@ -84,8 +84,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
using __difference_type = typename _Tp::difference_type;
+ template<typename _Tp, typename _Up, typename = void>
+ struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
template<typename _Tp, typename _Up>
- using __rebind = typename _Tp::template rebind<_Up>;
+ struct __rebind<_Tp, _Up, __void_t<typename _Tp::template rebind<_Up>>>
+ { using type = typename _Tp::template rebind<_Up>; };
public:
/// The pointer type.
@@ -93,7 +97,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// The type pointed to.
using element_type
- = __detected_or_t_<__get_first_arg_t, __element_type, _Ptr>;
+ = __detected_or_t<__get_first_arg_t<_Ptr>, __element_type, _Ptr>;
/// The type used to represent the difference between two pointers.
using difference_type
@@ -101,8 +105,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// A pointer to a different type.
template<typename _Up>
- using rebind
- = __detected_or_t_<__replace_first_arg_t, __rebind, _Ptr, _Up>;
+ using rebind = typename __rebind<_Ptr, _Up>::type;
static _Ptr
pointer_to(__make_not_void<element_type>& __e)
@@ -110,8 +113,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static_assert(!is_same<element_type, __undefined>::value,
"pointer type defines element_type or is like SomePointer<T, Args>");
- static_assert(!is_same<rebind<element_type>, __undefined>::value,
- "pointer type defines rebind<U> or is like SomePointer<T, Args>");
};
/**
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index a7d45e6edc4..d8cfcb10143 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -2672,9 +2672,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
initializer_list<int>,
regex_constants::match_flag_type =
regex_constants::match_default) = delete;
- template <std::size_t N>
+ template <std::size_t _Nm>
regex_token_iterator(_Bi_iter, _Bi_iter, const regex_type&&,
- const int (&)[N],
+ const int (&)[_Nm],
regex_constants::match_flag_type =
regex_constants::match_default) = delete;
diff --git a/libstdc++-v3/include/bits/slice_array.h b/libstdc++-v3/include/bits/slice_array.h
index 2efa1997553..9a07e72cd49 100644
--- a/libstdc++-v3/include/bits/slice_array.h
+++ b/libstdc++-v3/include/bits/slice_array.h
@@ -204,8 +204,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
inline
- slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
- : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
+ slice_array<_Tp>::slice_array(const slice_array<_Tp>& __a)
+ : _M_sz(__a._M_sz), _M_stride(__a._M_stride), _M_array(__a._M_array) {}
// template<typename _Tp>
// inline slice_array<_Tp>::~slice_array () {}
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index f2934838098..48c591ce7cf 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -1129,7 +1129,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
- { return _M_t._M_find_tr(__x) == _M_t.end() ? 0 : 1; }
+ { return _M_t._M_count_tr(__x); }
#endif
//@}
@@ -1153,8 +1153,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x)
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
+ { return iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -1178,8 +1178,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x) const
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
+ { return const_iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -1198,8 +1198,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x)
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -1218,8 +1218,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x) const
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
+ { return const_iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -1247,8 +1247,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x)
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
#endif
//@}
@@ -1276,8 +1276,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x) const
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<const_iterator, const_iterator>(
+ _M_t._M_equal_range_tr(__x)))
+ {
+ return pair<const_iterator, const_iterator>(
+ _M_t._M_equal_range_tr(__x));
+ }
#endif
//@}
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index d48935e56d3..eb6b24bcbc1 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -822,8 +822,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x)
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
+ { return iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -847,8 +847,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x) const
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
+ { return const_iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -867,8 +867,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x)
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -887,8 +887,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x) const
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
+ { return const_iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -914,8 +914,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x)
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
#endif
//@}
@@ -941,8 +941,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x) const
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<const_iterator, const_iterator>(
+ _M_t._M_equal_range_tr(__x)))
+ {
+ return pair<const_iterator, const_iterator>(
+ _M_t._M_equal_range_tr(__x));
+ }
#endif
//@}
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 03a3e7dc861..b45e0be962b 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -716,14 +716,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x)
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
+ { return iterator(_M_t._M_lower_bound_tr(__x)); }
template<typename _Kt>
auto
lower_bound(const _Kt& __x) const
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
+ { return iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -746,14 +746,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x)
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return iterator(_M_t._M_upper_bound_tr(__x)); }
template<typename _Kt>
auto
upper_bound(const _Kt& __x) const
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -785,14 +785,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x)
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
template<typename _Kt>
auto
equal_range(const _Kt& __x) const
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
#endif
//@}
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index d8cdcc5b292..2b5a787e26b 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -670,7 +670,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
auto
count(const _Kt& __x) const
-> decltype(_M_t._M_count_tr(__x))
- { return _M_t._M_find_tr(__x) == _M_t.end() ? 0 : 1; }
+ { return _M_t._M_count_tr(__x); }
#endif
//@}
@@ -735,14 +735,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
lower_bound(const _Kt& __x)
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
+ { return iterator(_M_t._M_lower_bound_tr(__x)); }
template<typename _Kt>
auto
lower_bound(const _Kt& __x) const
- -> decltype(_M_t._M_lower_bound_tr(__x))
- { return _M_t._M_lower_bound_tr(__x); }
+ -> decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
+ { return const_iterator(_M_t._M_lower_bound_tr(__x)); }
#endif
//@}
@@ -765,14 +765,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
upper_bound(const _Kt& __x)
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return iterator(_M_t._M_upper_bound_tr(__x)); }
template<typename _Kt>
auto
upper_bound(const _Kt& __x) const
- -> decltype(_M_t._M_upper_bound_tr(__x))
- { return _M_t._M_upper_bound_tr(__x); }
+ -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
+ { return const_iterator(_M_t._M_upper_bound_tr(__x)); }
#endif
//@}
@@ -804,14 +804,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Kt>
auto
equal_range(const _Kt& __x)
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
template<typename _Kt>
auto
equal_range(const _Kt& __x) const
- -> decltype(_M_t._M_equal_range_tr(__x))
- { return _M_t._M_equal_range_tr(__x); }
+ -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
+ { return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
#endif
//@}
diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any
index 5e091a45dda..1695f103b5c 100644
--- a/libstdc++-v3/include/experimental/any
+++ b/libstdc++-v3/include/experimental/any
@@ -425,7 +425,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
void* __any_caster(const any* __any)
{
- if (__any->_M_manager != &any::_Manager<decay_t<_Tp>>::_S_manage)
+ struct _None { };
+ using _Up = decay_t<_Tp>;
+ using _Vp = conditional_t<is_copy_constructible<_Up>::value, _Up, _None>;
+ if (__any->_M_manager != &any::_Manager<_Vp>::_S_manage)
return nullptr;
any::_Arg __arg;
__any->_M_manager(any::_Op_access, __any, &__arg);
diff --git a/libstdc++-v3/include/experimental/memory b/libstdc++-v3/include/experimental/memory
index 885d11cb351..8b3b8844a03 100644
--- a/libstdc++-v3/include/experimental/memory
+++ b/libstdc++-v3/include/experimental/memory
@@ -124,9 +124,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr __pointer
release() noexcept
{
- __pointer tmp = get();
+ __pointer __tmp = get();
reset();
- return tmp;
+ return __tmp;
}
constexpr void
diff --git a/libstdc++-v3/include/ext/pointer.h b/libstdc++-v3/include/ext/pointer.h
index c3c98a19182..75c8fbeae45 100644
--- a/libstdc++-v3/include/ext/pointer.h
+++ b/libstdc++-v3/include/ext/pointer.h
@@ -449,9 +449,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Pointer_adapter
operator++(int)
{
- _Pointer_adapter tmp(*this);
+ _Pointer_adapter __tmp(*this);
_Storage_policy::set(_Storage_policy::get() + 1);
- return tmp;
+ return __tmp;
}
inline _Pointer_adapter&
@@ -464,9 +464,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Pointer_adapter
operator--(int)
{
- _Pointer_adapter tmp(*this);
+ _Pointer_adapter __tmp(*this);
_Storage_policy::set(_Storage_policy::get() - 1);
- return tmp;
+ return __tmp;
}
}; // class _Pointer_adapter
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic
index bdc1f25e542..a218a4dcc2d 100644
--- a/libstdc++-v3/include/std/atomic
+++ b/libstdc++-v3/include/std/atomic
@@ -230,35 +230,39 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Tp
load(memory_order __m = memory_order_seq_cst) const noexcept
- {
- _Tp tmp;
- __atomic_load(&_M_i, &tmp, __m);
- return tmp;
+ {
+ alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_load(&_M_i, __ptr, __m);
+ return *__ptr;
}
_Tp
load(memory_order __m = memory_order_seq_cst) const volatile noexcept
- {
- _Tp tmp;
- __atomic_load(&_M_i, &tmp, __m);
- return tmp;
+ {
+ alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_load(&_M_i, __ptr, __m);
+ return *__ptr;
}
_Tp
exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
- {
- _Tp tmp;
- __atomic_exchange(&_M_i, &__i, &tmp, __m);
- return tmp;
+ {
+ alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_exchange(&_M_i, &__i, __ptr, __m);
+ return *__ptr;
}
_Tp
exchange(_Tp __i,
memory_order __m = memory_order_seq_cst) volatile noexcept
- {
- _Tp tmp;
- __atomic_exchange(&_M_i, &__i, &tmp, __m);
- return tmp;
+ {
+ alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_exchange(&_M_i, &__i, __ptr, __m);
+ return *__ptr;
}
bool
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index beee91a79ad..4d5a1456e7f 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -133,9 +133,9 @@ enum class pointer_safety { relaxed, preferred, strict };
inline void
declare_reachable(void*) { }
-template <class T>
- inline T*
- undeclare_reachable(T* __p) { return __p; }
+template <typename _Tp>
+ inline _Tp*
+ undeclare_reachable(_Tp* __p) { return __p; }
inline void
declare_no_pointers(char*, size_t) { }
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 584b842edcd..15deb90b2ef 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -2576,12 +2576,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __detected_or_t
= typename __detected_or<_Default, _Op, _Args...>::type;
- // _Op<_Args...> if that is a valid type, otherwise _Default<_Args...>.
- template<template<typename...> class _Default,
- template<typename...> class _Op, typename... _Args>
- using __detected_or_t_ =
- __detected_or_t<_Default<_Args...>, _Op, _Args...>;
-
/// @} group metaprogramming
/**
diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
index 078af0ea16f..e2314dbd011 100644
--- a/libstdc++-v3/libsupc++/nested_exception.h
+++ b/libstdc++-v3/libsupc++/nested_exception.h
@@ -115,7 +115,7 @@ namespace std
inline void
throw_with_nested(_Tp&& __t)
{
- using _Up = typename remove_reference<_Tp>::type;
+ using _Up = typename decay<_Tp>::type;
using _CopyConstructible
= __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>;
static_assert(_CopyConstructible::value,
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 6245713fe96..ca4b92487dd 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -127,8 +127,8 @@ class UniquePointerPrinter:
def to_string (self):
v = self.val['_M_t']['_M_head_impl']
- return ('std::unique_ptr<%s> containing %s' % (str(v.type.target()),
- str(v)))
+ return 'std::unique_ptr<%s> containing %s' % (str(v.type.target()),
+ str(v))
def get_value_from_list_node(node):
"""Returns the value held in an _List_node<_Val>"""
@@ -191,10 +191,12 @@ class StdListIteratorPrinter:
self.typename = typename
def to_string(self):
+ if not self.val['_M_node']:
+ return 'non-dereferenceable iterator for std::list'
nodetype = find_type(self.val.type, '_Node')
nodetype = nodetype.strip_typedefs().pointer()
node = self.val['_M_node'].cast(nodetype).dereference()
- return get_value_from_list_node(node)
+ return str(get_value_from_list_node(node))
class StdSlistPrinter:
"Print a __gnu_cxx::slist"
@@ -237,9 +239,11 @@ class StdSlistIteratorPrinter:
self.val = val
def to_string(self):
+ if not self.val['_M_node']:
+ return 'non-dereferenceable iterator for __gnu_cxx::slist'
nodetype = find_type(self.val.type, '_Node')
nodetype = nodetype.strip_typedefs().pointer()
- return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
+ return str(self.val['_M_node'].cast(nodetype).dereference()['_M_data'])
class StdVectorPrinter:
"Print a std::vector"
@@ -324,7 +328,9 @@ class StdVectorIteratorPrinter:
self.val = val
def to_string(self):
- return self.val['_M_current'].dereference()
+ if not self.val['_M_current']:
+ return 'non-dereferenceable iterator for std::vector'
+ return str(self.val['_M_current'].dereference())
class StdTuplePrinter:
"Print a std::tuple"
@@ -419,6 +425,11 @@ class StdStackOrQueuePrinter:
return None
class RbtreeIterator(Iterator):
+ """
+ Turn an RB-tree-based container (std::map, std::set etc.) into
+ a Python iterable object.
+ """
+
def __init__(self, rbtree):
self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
@@ -472,7 +483,7 @@ def get_value_from_Rb_tree_node(node):
# std::map::iterator), and has nothing to do with the RbtreeIterator
# class above.
class StdRbtreeIteratorPrinter:
- "Print std::map::iterator"
+ "Print std::map::iterator, std::set::iterator, etc."
def __init__ (self, typename, val):
self.val = val
@@ -481,8 +492,10 @@ class StdRbtreeIteratorPrinter:
self.link_type = nodetype.strip_typedefs().pointer()
def to_string (self):
+ if not self.val['_M_node']:
+ return 'non-dereferenceable iterator for associative container'
node = self.val['_M_node'].cast(self.link_type).dereference()
- return get_value_from_Rb_tree_node(node)
+ return str(get_value_from_Rb_tree_node(node))
class StdDebugIteratorPrinter:
"Print a debug enabled version of an iterator"
@@ -494,7 +507,7 @@ class StdDebugIteratorPrinter:
# and return the wrapped iterator value.
def to_string (self):
itype = self.val.type.template_argument(0)
- return self.val.cast(itype)
+ return str(self.val.cast(itype))
class StdMapPrinter:
"Print a std::map or std::multimap"
@@ -687,7 +700,9 @@ class StdDequeIteratorPrinter:
self.val = val
def to_string(self):
- return self.val['_M_cur'].dereference()
+ if not self.val['_M_cur']:
+ return 'non-dereferenceable iterator for std::deque'
+ return str(self.val['_M_cur'].dereference())
class StdStringPrinter:
"Print a std::basic_string of some kind"
@@ -873,8 +888,8 @@ class StdForwardListPrinter:
def to_string(self):
if self.val['_M_impl']['_M_head']['_M_next'] == 0:
- return 'empty %s' % (self.typename)
- return '%s' % (self.typename)
+ return 'empty %s' % self.typename
+ return '%s' % self.typename
class SingleObjContainerPrinter(object):
"Base class for printers of containers of single objects"
@@ -975,9 +990,10 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter):
def to_string (self):
if self.contained_value is None:
- return self.typename + " [no contained value]"
+ return "%s [no contained value]" % self.typename
if hasattr (self.visualizer, 'children'):
- return self.typename + " containing " + self.visualizer.to_string ()
+ return "%s containing %s" % (self.typename,
+ self.visualizer.to_string())
return self.typename
class StdExpStringViewPrinter:
@@ -1133,7 +1149,8 @@ class Printer(object):
libstdcxx_printer = None
class TemplateTypePrinter(object):
- r"""A type printer for class templates.
+ r"""
+ A type printer for class templates.
Recognizes type names that match a regular expression.
Replaces them with a formatted string which can use replacement field
diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
index 605cda11761..91c2613dc1a 100644
--- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py
+++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py
@@ -565,8 +565,14 @@ class AssociativeContainerMethodsMatcher(gdb.xmethod.XMethodMatcher):
# Xmethods for std::unique_ptr
class UniquePtrGetWorker(gdb.xmethod.XMethodWorker):
+ "Implements std::unique_ptr<T>::get() and std::unique_ptr<T>::operator->()"
+
def __init__(self, elem_type):
- self._elem_type = elem_type
+ self._is_array = elem_type.code == gdb.TYPE_CODE_ARRAY
+ if self._is_array:
+ self._elem_type = elem_type.target()
+ else:
+ self._elem_type = elem_type
def get_arg_types(self):
return None
@@ -574,19 +580,48 @@ class UniquePtrGetWorker(gdb.xmethod.XMethodWorker):
def get_result_type(self, obj):
return self._elem_type.pointer()
+ def _supports(self, method_name):
+ "operator-> is not supported for unique_ptr<T[]>"
+ return method_name == 'get' or not self._is_array
+
def __call__(self, obj):
return obj['_M_t']['_M_head_impl']
class UniquePtrDerefWorker(UniquePtrGetWorker):
+ "Implements std::unique_ptr<T>::operator*()"
+
def __init__(self, elem_type):
UniquePtrGetWorker.__init__(self, elem_type)
def get_result_type(self, obj):
return self._elem_type
+ def _supports(self, method_name):
+ "operator* is not supported for unique_ptr<T[]>"
+ return not self._is_array
+
def __call__(self, obj):
return UniquePtrGetWorker.__call__(self, obj).dereference()
+class UniquePtrSubscriptWorker(UniquePtrGetWorker):
+ "Implements std::unique_ptr<T>::operator[](size_t)"
+
+ def __init__(self, elem_type):
+ UniquePtrGetWorker.__init__(self, elem_type)
+
+ def get_arg_types(self):
+ return get_std_size_type()
+
+ def get_result_type(self, obj, index):
+ return self._elem_type
+
+ def _supports(self, method_name):
+ "operator[] is only supported for unique_ptr<T[]>"
+ return self._is_array
+
+ def __call__(self, obj, index):
+ return UniquePtrGetWorker.__call__(self, obj)[index]
+
class UniquePtrMethodsMatcher(gdb.xmethod.XMethodMatcher):
def __init__(self):
gdb.xmethod.XMethodMatcher.__init__(self,
@@ -595,6 +630,7 @@ class UniquePtrMethodsMatcher(gdb.xmethod.XMethodMatcher):
'get': LibStdCxxXMethod('get', UniquePtrGetWorker),
'operator->': LibStdCxxXMethod('operator->', UniquePtrGetWorker),
'operator*': LibStdCxxXMethod('operator*', UniquePtrDerefWorker),
+ 'operator[]': LibStdCxxXMethod('operator[]', UniquePtrSubscriptWorker),
}
self.methods = [self._method_dict[m] for m in self._method_dict]
@@ -604,6 +640,112 @@ class UniquePtrMethodsMatcher(gdb.xmethod.XMethodMatcher):
method = self._method_dict.get(method_name)
if method is None or not method.enabled:
return None
+ worker = method.worker_class(class_type.template_argument(0))
+ if worker._supports(method_name):
+ return worker
+ return None
+
+# Xmethods for std::shared_ptr
+
+class SharedPtrGetWorker(gdb.xmethod.XMethodWorker):
+ "Implements std::shared_ptr<T>::get() and std::shared_ptr<T>::operator->()"
+
+ def __init__(self, elem_type):
+ self._is_array = elem_type.code == gdb.TYPE_CODE_ARRAY
+ if self._is_array:
+ self._elem_type = elem_type.target()
+ else:
+ self._elem_type = elem_type
+
+ def get_arg_types(self):
+ return None
+
+ def get_result_type(self, obj):
+ return self._elem_type.pointer()
+
+ def __call__(self, obj):
+ return obj['_M_ptr']
+
+class SharedPtrDerefWorker(SharedPtrGetWorker):
+ "Implements std::shared_ptr<T>::operator*()"
+
+ def __init__(self, elem_type):
+ SharedPtrGetWorker.__init__(self, elem_type)
+
+ def get_result_type(self, obj):
+ return self._elem_type
+
+ def __call__(self, obj):
+ return SharedPtrGetWorker.__call__(self, obj).dereference()
+
+class SharedPtrSubscriptWorker(SharedPtrGetWorker):
+ "Implements std::shared_ptr<T>::operator[](size_t)"
+
+ def __init__(self, elem_type):
+ SharedPtrGetWorker.__init__(self, elem_type)
+
+ def get_arg_types(self):
+ return get_std_size_type()
+
+ def get_result_type(self, obj, index):
+ return self._elem_type
+
+ def __call__(self, obj, index):
+ # Check bounds if _elem_type is an array of known bound
+ m = re.match('.*\[(\d+)]$', str(self._elem_type))
+ if m and index >= int(m.group(1)):
+ raise IndexError('shared_ptr<%s> index "%d" should not be >= %d.' %
+ (self._elem_type, int(index), int(m.group(1))))
+ return SharedPtrGetWorker.__call__(self, obj)[index]
+
+class SharedPtrUseCountWorker(gdb.xmethod.XMethodWorker):
+ "Implements std::shared_ptr<T>::use_count()"
+
+ def __init__(self, elem_type):
+ SharedPtrUseCountWorker.__init__(self, elem_type)
+
+ def get_arg_types(self):
+ return None
+
+ def get_result_type(self, obj):
+ return gdb.lookup_type('long')
+
+ def __call__(self, obj):
+ refcounts = ['_M_refcount']['_M_pi']
+ return refcounts['_M_use_count'] if refcounts else 0
+
+class SharedPtrUniqueWorker(SharedPtrUseCountWorker):
+ "Implements std::shared_ptr<T>::unique()"
+
+ def __init__(self, elem_type):
+ SharedPtrUseCountWorker.__init__(self, elem_type)
+
+ def get_result_type(self, obj):
+ return gdb.lookup_type('bool')
+
+ def __call__(self, obj):
+ return SharedPtrUseCountWorker.__call__(self, obj) == 1
+
+class SharedPtrMethodsMatcher(gdb.xmethod.XMethodMatcher):
+ def __init__(self):
+ gdb.xmethod.XMethodMatcher.__init__(self,
+ matcher_name_prefix + 'shared_ptr')
+ self._method_dict = {
+ 'get': LibStdCxxXMethod('get', SharedPtrGetWorker),
+ 'operator->': LibStdCxxXMethod('operator->', SharedPtrGetWorker),
+ 'operator*': LibStdCxxXMethod('operator*', SharedPtrDerefWorker),
+ 'operator[]': LibStdCxxXMethod('operator[]', SharedPtrSubscriptWorker),
+ 'use_count': LibStdCxxXMethod('use_count', SharedPtrUseCountWorker),
+ 'unique': LibStdCxxXMethod('unique', SharedPtrUniqueWorker),
+ }
+ self.methods = [self._method_dict[m] for m in self._method_dict]
+
+ def match(self, class_type, method_name):
+ if not re.match('^std::shared_ptr<.*>$', class_type.tag):
+ return None
+ method = self._method_dict.get(method_name)
+ if method is None or not method.enabled:
+ return None
return method.worker_class(class_type.template_argument(0))
def register_libstdcxx_xmethods(locus):
@@ -629,3 +771,4 @@ def register_libstdcxx_xmethods(locus):
gdb.xmethod.register_xmethod_matcher(
locus, AssociativeContainerMethodsMatcher('unordered_multimap'))
gdb.xmethod.register_xmethod_matcher(locus, UniquePtrMethodsMatcher())
+ gdb.xmethod.register_xmethod_matcher(locus, SharedPtrMethodsMatcher())
diff --git a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
index bc4b4ba1c32..47bce5445fc 100644
--- a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
+++ b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
@@ -226,8 +226,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace // unnamed
{
+ struct __shim_accessor : facet
+ {
+ using facet::__shim; // Redeclare protected member as public.
+ };
+ using __shim = __shim_accessor::__shim;
+
template<typename _CharT>
- struct numpunct_shim : std::numpunct<_CharT>, facet::__shim
+ struct numpunct_shim : std::numpunct<_CharT>, __shim
{
typedef typename numpunct<_CharT>::__cache_type __cache_type;
@@ -251,7 +257,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT>
- struct collate_shim : std::collate<_CharT>, facet::__shim
+ struct collate_shim : std::collate<_CharT>, __shim
{
typedef basic_string<_CharT> string_type;
@@ -276,7 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT>
- struct time_get_shim : std::time_get<_CharT>, facet::__shim
+ struct time_get_shim : std::time_get<_CharT>, __shim
{
typedef typename std::time_get<_CharT>::iter_type iter_type;
typedef typename std::time_get<_CharT>::char_type char_type;
@@ -330,7 +336,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT, bool _Intl>
- struct moneypunct_shim : std::moneypunct<_CharT, _Intl>, facet::__shim
+ struct moneypunct_shim : std::moneypunct<_CharT, _Intl>, __shim
{
typedef typename moneypunct<_CharT, _Intl>::__cache_type __cache_type;
@@ -357,7 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT>
- struct money_get_shim : std::money_get<_CharT>, facet::__shim
+ struct money_get_shim : std::money_get<_CharT>, __shim
{
typedef typename std::money_get<_CharT>::iter_type iter_type;
typedef typename std::money_get<_CharT>::char_type char_type;
@@ -398,7 +404,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT>
- struct money_put_shim : std::money_put<_CharT>, facet::__shim
+ struct money_put_shim : std::money_put<_CharT>, __shim
{
typedef typename std::money_put<_CharT>::iter_type iter_type;
typedef typename std::money_put<_CharT>::char_type char_type;
@@ -427,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
template<typename _CharT>
- struct messages_shim : std::messages<_CharT>, facet::__shim
+ struct messages_shim : std::messages<_CharT>, __shim
{
typedef messages_base::catalog catalog;
typedef basic_string<_CharT> string_type;
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
new file mode 100644
index 00000000000..c5258615663
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -0,0 +1,110 @@
+// Copyright (C) 2017 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 compile }
+
+// Define macros for some common variables names that we must not use for
+// naming variables, parameters etc. in the library.
+#define tmp (
+#define A (
+#define B (
+#define C (
+#define D (
+#define E (
+#define F (
+#define G (
+#define H (
+#define I (
+#define J (
+#define K (
+#define L (
+#define M (
+#define N (
+#define O (
+#define P (
+#define Q (
+#define R (
+#define S (
+#define T (
+#define U (
+#define V (
+#define W (
+#define X (
+#define Y (
+#define Z (
+#if __cplusplus >= 201103L
+// <random> defines member functions called a() and b()
+#else
+#define a (
+#define b (
+#endif
+// <queue> and <stack> defined data members called c
+#define d (
+#define e (
+#define f (
+#define g (
+#if __cplusplus >= 201402L
+// <chrono> defines operator ""h in C++14
+// <complex> defines operator ""i in C++14
+#else
+#define h (
+#define i (
+#endif
+#define j (
+#if __cplusplus >= 201103L
+// <random> defines member functions called k()
+#else
+#define k (
+#endif
+#define l (
+#if __cplusplus >= 201103L
+// <random> defines member functions called m() and n()
+#else
+#define m (
+#define n (
+#endif
+#define o (
+#if __cplusplus >= 201103L
+// <random> defines member functions called p()
+#else
+#define p (
+#endif
+#define q (
+#define r (
+#if __cplusplus >= 201103L
+// <random> defines member functions called s() and t()
+// <chrono> and <string> define operator ""s in C++14
+#else
+#define s (
+#define t (
+#endif
+#define u (
+#define v (
+#define w (
+#define x (
+#define y (
+#define z (
+
+#ifdef _AIX
+// See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html
+#undef f
+#undef r
+#undef x
+#undef y
+#endif
+
+#include <bits/stdc++.h>
diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/79114.cc b/libstdc++-v3/testsuite/18_support/nested_exception/79114.cc
new file mode 100644
index 00000000000..b2694147faf
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/nested_exception/79114.cc
@@ -0,0 +1,28 @@
+// Copyright (C) 2017 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 compile { target c++11 } }
+// { dg-require-atomic-builtins "" }
+
+#include <exception>
+
+void
+test01()
+{
+ std::throw_with_nested("");
+ std::throw_with_nested(test01);
+}
diff --git a/libstdc++-v3/testsuite/20_util/allocator_traits/members/pointers.cc b/libstdc++-v3/testsuite/20_util/allocator_traits/members/pointers.cc
new file mode 100644
index 00000000000..f25c54ff07e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/allocator_traits/members/pointers.cc
@@ -0,0 +1,52 @@
+// Copyright (C) 2017 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 compile { target c++11 } }
+
+#include <memory>
+
+// Non-type template param means pointer_traits::rebind can't be instantiated.
+template<typename T, int = 0>
+ struct Pointer
+ {
+ using element_type = T;
+ Pointer(T* p = nullptr) : ptr(p) { }
+ T* ptr;
+ };
+
+template<typename T>
+ struct Alloc
+ {
+ using value_type = T;
+ using pointer = Pointer<T>;
+ using const_pointer = Pointer<const T>;
+ using void_pointer = Pointer<void>;
+ using const_void_pointer = Pointer<const void>;
+
+ pointer allocate(std::size_t n)
+ { return std::allocator<T>().allocate(n); }
+
+ void allocate(pointer p, std::size_t n)
+ { return std::allocator<T>().deallocate(p, n); }
+ };
+
+// The nested pointer types in Alloc should be found without attempting to
+// instantiate pointer_traits::rebind (which would fail):
+std::allocator_traits<Alloc<int>>::pointer p;
+std::allocator_traits<Alloc<int>>::const_pointer cp;
+std::allocator_traits<Alloc<int>>::void_pointer vp;
+std::allocator_traits<Alloc<int>>::const_void_pointer cvp;
diff --git a/libstdc++-v3/testsuite/20_util/allocator_traits/members/rebind_alloc.cc b/libstdc++-v3/testsuite/20_util/allocator_traits/members/rebind_alloc.cc
new file mode 100644
index 00000000000..60a62491143
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/allocator_traits/members/rebind_alloc.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2017 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 compile { target c++11 } }
+
+#include <memory>
+
+using std::is_same;
+
+template<typename T, typename U>
+ using Rebind = typename std::allocator_traits<T>::template rebind_alloc<U>;
+
+template<typename T>
+ struct HasRebind {
+ using value_type = T;
+ template<typename U> struct rebind { using other = std::allocator<U>; };
+ };
+
+static_assert(is_same<Rebind<HasRebind<int>, long>,
+ std::allocator<long>>::value,
+ "nested alias template is used");
+
+template<typename T>
+ struct NoRebind0 {
+ using value_type = T;
+ };
+
+static_assert(is_same<Rebind<NoRebind0<int>, long>,
+ NoRebind0<long>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename>
+ struct NoRebind1 {
+ using value_type = T;
+ };
+
+static_assert(is_same<Rebind<NoRebind1<int, void>, long>,
+ NoRebind1<long, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename, typename>
+ struct NoRebind2 {
+ using value_type = T;
+ };
+
+static_assert(is_same<Rebind<NoRebind2<int, void, void>, long>,
+ NoRebind2<long, void, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename...>
+ struct NoRebindN {
+ using value_type = T;
+ };
+
+static_assert(is_same<Rebind<NoRebindN<int>, long>,
+ NoRebindN<long>>::value,
+ "first template argument is replaced");
+static_assert(is_same<Rebind<NoRebindN<int, void>, long>,
+ NoRebindN<long, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, int = 0>
+ struct CannotRebind {
+ using value_type = T;
+ };
+// PR libstdc++/72792 specialization of allocator_traits is still well-formed:
+std::allocator_traits<CannotRebind<int>>::value_type v;
diff --git a/libstdc++-v3/testsuite/20_util/pointer_traits/rebind.cc b/libstdc++-v3/testsuite/20_util/pointer_traits/rebind.cc
new file mode 100644
index 00000000000..a62815988ed
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/pointer_traits/rebind.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2017 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 compile { target c++11 } }
+
+#include <memory>
+
+using std::is_same;
+
+template<typename T, typename U>
+ using Rebind = typename std::pointer_traits<T>::template rebind<U>;
+
+template<typename T>
+ struct HasRebind {
+ template<typename U> using rebind = U*;
+ };
+
+static_assert(is_same<Rebind<HasRebind<int>, long>,
+ long*>::value,
+ "nested alias template is used");
+
+template<typename T> struct NoRebind0 { };
+
+static_assert(is_same<Rebind<NoRebind0<int>, long>,
+ NoRebind0<long>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename> struct NoRebind1 { };
+
+static_assert(is_same<Rebind<NoRebind1<int, void>, long>,
+ NoRebind1<long, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename, typename> struct NoRebind2 { };
+
+static_assert(is_same<Rebind<NoRebind2<int, void, void>, long>,
+ NoRebind2<long, void, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, typename...> struct NoRebindN { };
+
+static_assert(is_same<Rebind<NoRebindN<int>, long>,
+ NoRebindN<long>>::value,
+ "first template argument is replaced");
+static_assert(is_same<Rebind<NoRebindN<int, void>, long>,
+ NoRebindN<long, void>>::value,
+ "first template argument is replaced");
+
+template<typename T, int = 0>
+ struct CannotRebind {
+ using element_type = T;
+ };
+// PR libstdc++/72793 specialization of pointer_traits is still well-formed:
+std::pointer_traits<CannotRebind<int>>::element_type e;
diff --git a/libstdc++-v3/testsuite/23_containers/list/operations/80034.cc b/libstdc++-v3/testsuite/23_containers/list/operations/80034.cc
new file mode 100644
index 00000000000..5c3decd9dff
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/list/operations/80034.cc
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <list>
+
+namespace X {
+ struct Y { };
+ bool operator<(Y, Y) { return false; }
+ template<typename T>
+ void distance(T, T) { }
+}
+
+int main()
+{
+ std::list<X::Y> l;
+ l.sort();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/map/operations/2.cc b/libstdc++-v3/testsuite/23_containers/map/operations/2.cc
index ea73d6ee2f5..bfdc36d223c 100644
--- a/libstdc++-v3/testsuite/23_containers/map/operations/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/operations/2.cc
@@ -53,7 +53,7 @@ test01()
cit = cx.find(2L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
static_assert(std::is_same<decltype(it), test_type::iterator>::value,
"find returns iterator");
@@ -76,7 +76,7 @@ test02()
cn = cx.count(2L);
VERIFY( cn == 0 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
}
void
@@ -94,7 +94,12 @@ test03()
cit = cx.lower_bound(2L);
VERIFY( cit != cx.end() && cit->second == '4' );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "lower_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const lower_bound returns const_iterator");
}
void
@@ -112,7 +117,12 @@ test04()
cit = cx.upper_bound(3L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "upper_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const upper_bound returns const_iterator");
}
void
@@ -130,9 +140,37 @@ test05()
cit = cx.equal_range(2L);
VERIFY( cit.first == cit.second && cit.first != cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ using pair = std::pair<test_type::iterator, test_type::iterator>;
+ static_assert(std::is_same<decltype(it), pair>::value,
+ "equal_range returns pair<iterator, iterator>");
+ using cpair = std::pair<test_type::const_iterator, test_type::const_iterator>;
+ static_assert(std::is_same<decltype(cit), cpair>::value,
+ "const equal_range returns pair<const_iterator, const_iterator>");
}
+void
+test06()
+{
+ // PR libstdc++/78273
+
+ struct C {
+ bool operator()(int l, int r) const { return l < r; }
+
+ struct Partition { };
+
+ bool operator()(int l, Partition) const { return l < 2; }
+ bool operator()(Partition, int r) const { return 4 < r; }
+
+ using is_transparent = void;
+ };
+
+ std::map<int, int, C> m{ {1,0}, {2,0}, {3,0}, {4, 0}, {5, 0} };
+
+ auto n = m.count(C::Partition{});
+ VERIFY( n == 3 );
+}
int
main()
@@ -142,4 +180,5 @@ main()
test03();
test04();
test05();
+ test06();
}
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/operations/2.cc b/libstdc++-v3/testsuite/23_containers/multimap/operations/2.cc
index 11d03a27cca..2e17d34d183 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/operations/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/operations/2.cc
@@ -53,7 +53,7 @@ test01()
cit = cx.find(2L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
static_assert(std::is_same<decltype(it), test_type::iterator>::value,
"find returns iterator");
@@ -76,7 +76,7 @@ test02()
cn = cx.count(2L);
VERIFY( cn == 0 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
}
void
@@ -94,7 +94,12 @@ test03()
cit = cx.lower_bound(2L);
VERIFY( cit != cx.end() && cit->second == '4' );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "lower_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const lower_bound returns const_iterator");
}
void
@@ -112,7 +117,12 @@ test04()
cit = cx.upper_bound(3L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "upper_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const upper_bound returns const_iterator");
}
void
@@ -131,7 +141,14 @@ test05()
cit = cx.equal_range(2L);
VERIFY( cit.first == cit.second && cit.first != cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ using pair = std::pair<test_type::iterator, test_type::iterator>;
+ static_assert(std::is_same<decltype(it), pair>::value,
+ "equal_range returns pair<iterator, iterator>");
+ using cpair = std::pair<test_type::const_iterator, test_type::const_iterator>;
+ static_assert(std::is_same<decltype(cit), cpair>::value,
+ "const equal_range returns pair<const_iterator, const_iterator>");
}
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/operations/2.cc b/libstdc++-v3/testsuite/23_containers/multiset/operations/2.cc
index 974a97ade3a..cedc344a6df 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset/operations/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset/operations/2.cc
@@ -53,7 +53,7 @@ test01()
cit = cx.find(2L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
static_assert(std::is_same<decltype(it), test_type::iterator>::value,
"find returns iterator");
@@ -76,7 +76,7 @@ test02()
cn = cx.count(2L);
VERIFY( cn == 0 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
}
void
@@ -94,7 +94,12 @@ test03()
cit = cx.lower_bound(2L);
VERIFY( cit != cx.end() && *cit == 3 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "lower_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const lower_bound returns const_iterator");
}
void
@@ -112,7 +117,12 @@ test04()
cit = cx.upper_bound(5L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "upper_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const upper_bound returns const_iterator");
}
void
@@ -131,7 +141,14 @@ test05()
cit = cx.equal_range(2L);
VERIFY( cit.first == cit.second && cit.first != cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ using pair = std::pair<test_type::iterator, test_type::iterator>;
+ static_assert(std::is_same<decltype(it), pair>::value,
+ "equal_range returns pair<iterator, iterator>");
+ using cpair = std::pair<test_type::const_iterator, test_type::const_iterator>;
+ static_assert(std::is_same<decltype(cit), cpair>::value,
+ "const equal_range returns pair<const_iterator, const_iterator>");
}
diff --git a/libstdc++-v3/testsuite/23_containers/set/operations/2.cc b/libstdc++-v3/testsuite/23_containers/set/operations/2.cc
index 36d39a71f89..610f12acfd3 100644
--- a/libstdc++-v3/testsuite/23_containers/set/operations/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/operations/2.cc
@@ -53,7 +53,7 @@ test01()
cit = cx.find(2L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
static_assert(std::is_same<decltype(it), test_type::iterator>::value,
"find returns iterator");
@@ -76,7 +76,7 @@ test02()
cn = cx.count(2L);
VERIFY( cn == 0 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
}
void
@@ -94,7 +94,12 @@ test03()
cit = cx.lower_bound(2L);
VERIFY( cit != cx.end() && *cit == 3 );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "lower_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const lower_bound returns const_iterator");
}
void
@@ -112,7 +117,12 @@ test04()
cit = cx.upper_bound(5L);
VERIFY( cit == cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ static_assert(std::is_same<decltype(it), test_type::iterator>::value,
+ "upper_bound returns iterator");
+ static_assert(std::is_same<decltype(cit), test_type::const_iterator>::value,
+ "const upper_bound returns const_iterator");
}
void
@@ -130,7 +140,14 @@ test05()
cit = cx.equal_range(2L);
VERIFY( cit.first == cit.second && cit.first != cx.end() );
- VERIFY( Cmp::count == 0);
+ VERIFY( Cmp::count == 0 );
+
+ using pair = std::pair<test_type::iterator, test_type::iterator>;
+ static_assert(std::is_same<decltype(it), pair>::value,
+ "equal_range returns pair<iterator, iterator>");
+ using cpair = std::pair<test_type::const_iterator, test_type::const_iterator>;
+ static_assert(std::is_same<decltype(cit), cpair>::value,
+ "const equal_range returns pair<const_iterator, const_iterator>");
}
void
@@ -150,6 +167,28 @@ test06()
s.find(i);
}
+void
+test07()
+{
+ // PR libstdc++/78273
+
+ struct C {
+ bool operator()(int l, int r) const { return l < r; }
+
+ struct Partition { };
+
+ bool operator()(int l, Partition) const { return l < 2; }
+ bool operator()(Partition, int r) const { return 4 < r; }
+
+ using is_transparent = void;
+ };
+
+ std::set<int, C> s{ 1, 2, 3, 4, 5 };
+
+ auto n = s.count(C::Partition{});
+ VERIFY( n == 3 );
+}
+
int
main()
{
@@ -159,4 +198,5 @@ main()
test04();
test05();
test06();
+ test07();
}
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/69301.cc b/libstdc++-v3/testsuite/29_atomics/atomic/69301.cc
new file mode 100644
index 00000000000..29d19d57d70
--- /dev/null
+++ b/libstdc++-v3/testsuite/29_atomics/atomic/69301.cc
@@ -0,0 +1,57 @@
+// Copyright (C) 2017 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 { target c++11 } }
+// { dg-require-atomic-builtins "" }
+
+#include <atomic>
+#include <testsuite_hooks.h>
+
+struct NonDefaultConstructible
+{
+ NonDefaultConstructible(int i) : val(i) { }
+ int val;
+};
+
+template class std::atomic<NonDefaultConstructible>;
+
+void
+test01()
+{
+ std::atomic<NonDefaultConstructible> a(1);
+ const auto n1 = a.exchange(2);
+ VERIFY( n1.val == 1 );
+ const auto n2 = a.load();
+ VERIFY( n2.val == 2 );
+}
+
+void
+test02()
+{
+ volatile std::atomic<NonDefaultConstructible> a(1);
+ const auto n1 = a.exchange(2);
+ VERIFY( n1.val == 1 );
+ const auto n2 = a.load();
+ VERIFY( n2.val == 2 );
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc b/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc
index bb0f754f549..5d8e7fbfc95 100644
--- a/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc
+++ b/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc
@@ -106,9 +106,22 @@ void test03()
MoveDeleted&& md3 = any_cast<MoveDeleted&&>(any(std::move(md)));
}
+void test04()
+{
+ // PR libstdc++/69321
+ struct noncopyable {
+ noncopyable(noncopyable const&) = delete;
+ };
+
+ any a;
+ auto p = any_cast<noncopyable>(&a);
+ VERIFY( p == nullptr );
+}
+
int main()
{
test01();
test02();
test03();
+ test04();
}
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc
new file mode 100644
index 00000000000..d8fef27bbb5
--- /dev/null
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/59161.cc
@@ -0,0 +1,70 @@
+// { dg-do run }
+// { dg-options "-g -O0" }
+
+// Copyright (C) 2011-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/>.
+
+#include <deque>
+#include <list>
+#include <ext/slist>
+#include <set>
+#include <vector>
+#include <debug/vector>
+#include <iostream>
+
+struct C {
+ C(int& i) : ref(i) { }
+ int& ref;
+ bool operator<(const C& c) const { return ref < c.ref; }
+};
+
+int main()
+{
+ int i = 1;
+ C c(i);
+
+ std::deque<C> d;
+ d.push_back(c);
+ std::deque<C>::iterator diter = d.begin();
+// { dg-final { regexp-test diter {ref = @0x.*} } }
+
+ std::list<C> l;
+ l.push_back(c);
+ std::list<C>::iterator liter = l.begin();
+ // Need to ensure the list<C>::iterator::_Node typedef is in the debuginfo:
+ int tmp __attribute__((unused)) = (*liter).ref;
+// { dg-final { regexp-test liter {ref = @0x.*} } }
+
+ __gnu_cxx::slist<C> sl;
+ sl.push_front(c);
+ __gnu_cxx::slist<C>::iterator sliter = sl.begin();
+// { dg-final { regexp-test sliter {ref = @0x.*} } }
+
+ std::set<C> s;
+ s.insert(c);
+ std::set<C>::iterator siter = s.begin();
+// { dg-final { regexp-test siter {ref = @0x.*} } }
+
+ std::vector<C> v;
+ v.push_back(c);
+ std::vector<C>::iterator viter = v.begin();
+// { dg-final { regexp-test viter {ref = @0x.*} } }
+
+ std::cout << "\n";
+ return 0; // Mark SPOT
+}
+// { dg-final { gdb-test SPOT } }
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
index 5f98b259be1..e351353554f 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
@@ -30,6 +30,7 @@
#include <list>
#include <map>
#include <set>
+#include <vector>
#include <ext/slist>
int
@@ -50,6 +51,9 @@ main()
deq.push_back("two");
// { dg-final { note-test deq {std::deque with 2 elements = {"one", "two"}} } }
+ std::deque<int>::iterator deqiter0;
+// { dg-final { note-test deqiter0 {non-dereferenceable iterator for std::deque} } }
+
std::deque<std::string>::iterator deqiter = deq.begin();
// { dg-final { note-test deqiter {"one"} } }
@@ -58,6 +62,9 @@ main()
lst.push_back("two");
// { dg-final { note-test lst {std::list = {[0] = "one", [1] = "two"}} } }
+ std::list<int>::iterator lstiter0;
+// { dg-final { note-test lstiter0 {non-dereferenceable iterator for std::list} } }
+
std::list<std::string>::iterator lstiter = lst.begin();
tem = *lstiter;
// { dg-final { note-test lstiter {"one"}} }
@@ -73,6 +80,9 @@ main()
std::map<std::string, int>::iterator mpiter = mp.begin();
// { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
+ std::map<std::string, int>::iterator mpiter0;
+// { dg-final { note-test mpiter0 {non-dereferenceable iterator for associative container} } }
+
// PR 67440
std::set<int> intset;
intset.insert(2);
@@ -88,6 +98,20 @@ main()
std::set<std::string>::const_iterator spciter = sp.begin();
// { dg-final { note-test spciter {"barrel"} } }
+ std::set<int>::iterator spiter0;
+// { dg-final { note-test spiter0 {non-dereferenceable iterator for associative container} } }
+
+ std::vector<int> v;
+ v.push_back(1);
+ v.push_back(2);
+ v.erase(v.begin());
+// { dg-final { note-test v {std::vector of length 1, capacity 2 = {2}} } }
+ std::vector<int>::iterator viter3 = v.begin();
+// { dg-final { note-test viter3 {2} } }
+
+ std::vector<int>::iterator viter0;
+// { dg-final { note-test viter0 {non-dereferenceable iterator for std::vector} } }
+
__gnu_cxx::slist<int> sll;
sll.push_front(23);
sll.push_front(47);
@@ -96,6 +120,9 @@ main()
__gnu_cxx::slist<int>::iterator slliter = sll.begin();
// { dg-final { note-test slliter {47} } }
+ __gnu_cxx::slist<int>::iterator slliter0;
+// { dg-final { note-test slliter0 {non-dereferenceable iterator for __gnu_cxx::slist} } }
+
std::cout << "\n";
return 0; // Mark SPOT
}
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
index 86a3de5d1a8..eef7020c8cc 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
@@ -30,6 +30,7 @@
#include <list>
#include <map>
#include <set>
+#include <vector>
#include <ext/slist>
int
@@ -53,6 +54,9 @@ main()
std::deque<std::string>::iterator deqiter = deq.begin();
// { dg-final { note-test deqiter {"one"} } }
+ std::deque<int>::iterator deqiter0;
+// { dg-final { note-test deqiter0 {non-dereferenceable iterator for std::deque} } }
+
std::list<std::string> lst;
lst.push_back("one");
lst.push_back("two");
@@ -66,6 +70,9 @@ main()
tem = *lstciter;
// { dg-final { note-test lstciter {"one"}} }
+ std::list<int>::iterator lstiter0;
+// { dg-final { note-test lstiter0 {non-dereferenceable iterator for std::list} } }
+
std::map<std::string, int> mp;
mp["zardoz"] = 23;
// { dg-final { note-test mp {std::map with 1 elements = {["zardoz"] = 23}} } }
@@ -73,6 +80,9 @@ main()
std::map<std::string, int>::iterator mpiter = mp.begin();
// { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
+ std::map<std::string, int>::iterator mpiter0;
+// { dg-final { note-test mpiter0 {non-dereferenceable iterator for associative container} } }
+
// PR 67440
const std::set<int> const_intset = {2, 3};
// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
@@ -85,6 +95,20 @@ main()
std::set<std::string>::const_iterator spciter = sp.begin();
// { dg-final { note-test spciter {"barrel"} } }
+ std::set<int>::iterator spiter0;
+// { dg-final { note-test spiter0 {non-dereferenceable iterator for associative container} } }
+
+ std::vector<int> v;
+ v.push_back(1);
+ v.push_back(2);
+ v.erase(v.begin());
+// { dg-final { note-test v {std::vector of length 1, capacity 2 = {2}} } }
+ std::vector<int>::iterator viter3 = v.begin();
+// { dg-final { note-test viter3 {2} } }
+
+ std::vector<int>::iterator viter0;
+// { dg-final { note-test viter0 {non-dereferenceable iterator for std::vector} } }
+
__gnu_cxx::slist<int> sll;
sll.push_front(23);
sll.push_front(47);
@@ -93,6 +117,9 @@ main()
__gnu_cxx::slist<int>::iterator slliter = sll.begin();
// { dg-final { note-test slliter {47} } }
+ __gnu_cxx::slist<int>::iterator slliter0;
+// { dg-final { note-test slliter0 {non-dereferenceable iterator for __gnu_cxx::slist} } }
+
std::cout << "\n";
return 0; // Mark SPOT
}
diff --git a/libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc b/libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc
new file mode 100644
index 00000000000..f27aa5df9aa
--- /dev/null
+++ b/libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc
@@ -0,0 +1,52 @@
+// { dg-do run { target c++11 } }
+// { dg-options "-g -O0" }
+
+// 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/>.
+
+#include <memory>
+
+struct x_struct
+{
+ int y;
+};
+
+int
+main ()
+{
+ std::shared_ptr<int> p(new int(10));
+
+ std::shared_ptr<x_struct> q(new x_struct{23});
+
+// { dg-final { note-test *p 10 } }
+// { dg-final { regexp-test p.get() 0x.* } }
+
+// { dg-final { whatis-test *p int } }
+// { dg-final { whatis-test p.get() "int \*" } }
+
+// { dg-final { note-test *q {\{y = 23\}} } }
+// { dg-final { regexp-test q.get() 0x.* } }
+// { dg-final { note-test q->y 23 } }
+
+// { dg-final { whatis-test *q x_struct } }
+// { dg-final { whatis-test q.get() "x_struct \*" } }
+// { dg-final { whatis-test q->y int } }
+
+ return 0; // Mark SPOT
+}
+
+// { dg-final { gdb-test SPOT {} 1 } }
diff --git a/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc b/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc
index 11d172b3021..c9d67cb26b4 100644
--- a/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc
+++ b/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc
@@ -28,13 +28,11 @@ struct x_struct
int
main ()
{
- int *i = new int;
- *i = 10;
- std::unique_ptr<int> p(i);
+ std::unique_ptr<int> p(new int(10));
- x_struct *x = new x_struct;
- x->y = 23;
- std::unique_ptr<x_struct> q(x);
+ std::unique_ptr<x_struct> q(new x_struct{23});
+
+ std::unique_ptr<x_struct[]> r(new x_struct[2]{ {46}, {69} });
// { dg-final { note-test *p 10 } }
// { dg-final { regexp-test p.get() 0x.* } }
@@ -50,6 +48,15 @@ main ()
// { dg-final { whatis-test q.get() "x_struct \*" } }
// { dg-final { whatis-test q->y int } }
+// { dg-final { note-test r\[1] {\{y = 69\}} } }
+// { dg-final { regexp-test r.get() 0x.* } }
+// { dg-final { note-test r\[1].y 69 } }
+
+// { dg-final { whatis-test r\[1] x_struct } }
+// { dg-final { whatis-test r.get() "x_struct \*" } }
+// { dg-final { whatis-test r\[1].y int } }
+
+
return 0; // Mark SPOT
}