aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-02-12 10:13:58 +0000
committerJakub Jelinek <jakub@redhat.com>2015-02-12 10:13:58 +0000
commit70a0fe566ad0f94ff9cdf98bb230135c6d75f683 (patch)
treeb049bced061eb1c69d160aaee2452dbc3d15ec49
parentf17e41c12d71ca74fe59bcf3ea59fe7410918673 (diff)
parent00087f8041b7e9708c37eb315ebf25999043f3c9 (diff)
svn merge -r219311:220635 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branchredhat/gcc-4_9-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_9-branch@220644 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog340
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c9
-rw-r--r--gcc/alias.c14
-rw-r--r--gcc/c-family/ChangeLog28
-rw-r--r--gcc/c-family/c-common.c3
-rw-r--r--gcc/c-family/c-omp.c5
-rw-r--r--gcc/c-family/c-opts.c6
-rw-r--r--gcc/c/ChangeLog28
-rw-r--r--gcc/c/c-parser.c5
-rw-r--r--gcc/c/c-typeck.c5
-rw-r--r--gcc/cfgrtl.c16
-rw-r--r--gcc/config/aarch64/aarch64-simd.md35
-rw-r--r--gcc/config/alpha/alpha.md4
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/i386/avx2intrin.h18
-rw-r--r--gcc/config/i386/driver-i386.c14
-rw-r--r--gcc/config/i386/emmintrin.h16
-rw-r--r--gcc/config/i386/i386.c12
-rw-r--r--gcc/config/i386/i386.md10
-rw-r--r--gcc/config/i386/predicates.md9
-rw-r--r--gcc/config/i386/sse.md2
-rw-r--r--gcc/config/nios2/nios2.c15
-rw-r--r--gcc/config/rs6000/rs6000-cpus.def1
-rw-r--r--gcc/config/rs6000/rs6000.c35
-rw-r--r--gcc/config/rs6000/rs6000.md12
-rw-r--r--gcc/config/rs6000/rtems.h3
-rw-r--r--gcc/config/rs6000/t-rtems73
-rw-r--r--gcc/config/s390/s390.c262
-rw-r--r--gcc/config/s390/s390.md2
-rw-r--r--gcc/config/s390/s390.opt12
-rw-r--r--gcc/cp/ChangeLog27
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/parser.c1
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/cp/repo.c6
-rw-r--r--gcc/cse.c40
-rw-r--r--gcc/doc/extend.texi17
-rw-r--r--gcc/doc/invoke.texi16
-rw-r--r--gcc/dse.c8
-rw-r--r--gcc/dwarf2out.c16
-rw-r--r--gcc/dwarf2out.h2
-rw-r--r--gcc/expr.c18
-rw-r--r--gcc/fortran/ChangeLog64
-rw-r--r--gcc/fortran/class.c37
-rw-r--r--gcc/fortran/dependency.c37
-rw-r--r--gcc/fortran/interface.c110
-rw-r--r--gcc/fortran/intrinsic.texi4
-rw-r--r--gcc/fortran/resolve.c125
-rw-r--r--gcc/fortran/trans-array.c7
-rw-r--r--gcc/fortran/trans-decl.c5
-rw-r--r--gcc/go/gofrontend/export.cc16
-rw-r--r--gcc/go/gofrontend/export.h5
-rw-r--r--gcc/go/gofrontend/gogo.cc79
-rw-r--r--gcc/go/gofrontend/gogo.h16
-rw-r--r--gcc/go/gofrontend/import.cc10
-rw-r--r--gcc/go/gofrontend/unsafe.cc2
-rw-r--r--gcc/ipa-inline-transform.c2
-rw-r--r--gcc/ipa.c14
-rw-r--r--gcc/jump.c25
-rw-r--r--gcc/lto-cgraph.c3
-rw-r--r--gcc/omp-low.c11
-rw-r--r--gcc/ree.c75
-rw-r--r--gcc/rtlanal.c13
-rw-r--r--gcc/testsuite/ChangeLog273
-rw-r--r--gcc/testsuite/c-c++-common/pr57653-2.c4
-rw-r--r--gcc/testsuite/c-c++-common/pr57653-2.h1
-rw-r--r--gcc/testsuite/c-c++-common/pr57653.c6
-rw-r--r--gcc/testsuite/c-c++-common/pr57653.h1
-rw-r--r--gcc/testsuite/c-c++-common/pr61553.c8
-rw-r--r--gcc/testsuite/c-c++-common/tsan/atomic_stack.c8
-rw-r--r--gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c9
-rw-r--r--gcc/testsuite/c-c++-common/tsan/mutexset1.c9
-rw-r--r--gcc/testsuite/c-c++-common/tsan/race_on_barrier.c10
-rw-r--r--gcc/testsuite/c-c++-common/tsan/race_on_mutex.c12
-rw-r--r--gcc/testsuite/c-c++-common/tsan/race_on_mutex2.c11
-rw-r--r--gcc/testsuite/c-c++-common/tsan/simple_race.c11
-rw-r--r--gcc/testsuite/c-c++-common/tsan/simple_stack.c25
-rw-r--r--gcc/testsuite/c-c++-common/tsan/sleep_sync.c6
-rw-r--r--gcc/testsuite/c-c++-common/tsan/tiny_race.c8
-rw-r--r--gcc/testsuite/c-c++-common/tsan/tls_race.c8
-rw-r--r--gcc/testsuite/c-c++-common/tsan/tsan_barrier.h14
-rw-r--r--gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/override1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic165.C17
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr64068.C49
-rw-r--r--gcc/testsuite/g++.dg/pr54442.C12
-rw-r--r--gcc/testsuite/g++.dg/template/repo11.C31
-rw-r--r--gcc/testsuite/g++.dg/tsan/atomic_free.C9
-rw-r--r--gcc/testsuite/g++.dg/tsan/atomic_free2.C9
-rw-r--r--gcc/testsuite/g++.dg/tsan/cond_race.C9
-rw-r--r--gcc/testsuite/g++.dg/tsan/tsan_barrier.h14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr64979.c36
-rw-r--r--gcc/testsuite/gcc.dg/ipa/PR64559.c39
-rw-r--r--gcc/testsuite/gcc.dg/pr61058.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-3.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-4.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-5.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr63637-6.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr64536.c67
-rw-r--r--gcc/testsuite/gcc.dg/pr64563.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr64663.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr64766.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr64778.c10
-rw-r--r--gcc/testsuite/gcc.dg/tm/pr64391.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c22
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr64421.c36
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr63424.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/avx2-pr64286.c37
-rw-r--r--gcc/testsuite/gcc.target/i386/builtin_target.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-1.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-2.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-3.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-4.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-5.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr63637-6.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr64513.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-14.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr64505.c231
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-1.c14
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-10.c15
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-11.c12
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-12.c14
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-13.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-14.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-15.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-16.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-17.c17
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-18.c16
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-19.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-2.c12
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-20.c20
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-3.c10
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-4.c18
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-5.c15
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-6.c13
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-7.c13
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-8.c24
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-9.c15
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c24
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-10.c12
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-11.c12
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-12.c12
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-13.c29
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-14.c11
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c43
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c24
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c24
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c24
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c4
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c66
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-9.c12
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_with_mold_1.f9047
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_17.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/class_allocate_18.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_36.f347
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_37.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/dependency_45.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/internal_pack_15.f9077
-rw-r--r--gcc/testsuite/gfortran.dg/pr64528.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_operator_20.f9053
-rw-r--r--gcc/testsuite/gnat.dg/opt47.adb31
-rw-r--r--gcc/testsuite/gnat.dg/unchecked_convert1.adb4
-rw-r--r--gcc/trans-mem.c9
-rw-r--r--gcc/tree-stdarg.c45
-rw-r--r--gcc/tree-vrp.c2
-rw-r--r--gcc/tree.c7
-rw-r--r--libatomic/ChangeLog5
-rw-r--r--libatomic/fop_n.c12
-rw-r--r--libbacktrace/ChangeLog5
-rwxr-xr-xlibbacktrace/configure133
-rw-r--r--libbacktrace/configure.ac5
-rw-r--r--libcilkrts/ChangeLog5
-rw-r--r--libcilkrts/configure105
-rw-r--r--libcilkrts/configure.ac3
-rw-r--r--libgcc/ChangeLog30
-rw-r--r--libgcc/config/i386/cpuinfo.c12
-rw-r--r--libgcc/config/nios2/linux-unwind.h3
-rw-r--r--libgcc/config/pa/linux-atomic.c42
-rw-r--r--libgomp/ChangeLog21
-rw-r--r--libgomp/testsuite/libgomp.c++/atomic-16.C5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr64824.C5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr64868.C5
-rw-r--r--libgomp/testsuite/libgomp.c/atomic-18.c61
-rw-r--r--libgomp/testsuite/libgomp.c/pr64734.c55
-rw-r--r--libgomp/testsuite/libgomp.c/pr64824.c16
-rw-r--r--libgomp/testsuite/libgomp.c/pr64868.c87
-rw-r--r--libquadmath/ChangeLog5
-rwxr-xr-xlibquadmath/configure131
-rw-r--r--libquadmath/configure.ac3
-rw-r--r--libsanitizer/ChangeLog5
-rwxr-xr-xlibsanitizer/configure105
-rw-r--r--libsanitizer/configure.ac3
-rw-r--r--libstdc++-v3/ChangeLog76
-rw-r--r--libstdc++-v3/include/bits/regex.h61
-rw-r--r--libstdc++-v3/include/bits/regex.tcc92
-rw-r--r--libstdc++-v3/include/bits/regex_compiler.tcc2
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h3
-rw-r--r--libstdc++-v3/include/bits/stl_uninitialized.h5
-rw-r--r--libstdc++-v3/include/std/future3
-rw-r--r--libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc65
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/is_permutation/64646.cc35
-rw-r--r--libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc13
-rw-r--r--libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc20
-rw-r--r--libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc44
-rw-r--r--libstdc++-v3/testsuite/28_regex/match_results/swap.cc43
-rw-r--r--libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc22
-rw-r--r--libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc12
-rw-r--r--libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc24
216 files changed, 4853 insertions, 1140 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 273bfcf3c34..1f26fea2321 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,343 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64979
+ * tree-stdarg.c (pass_stdarg::execute): Scan phi node args for
+ va_list escapes.
+
+2015-02-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/alpha.md (reload_out<mode>_aligned): Make operands 2
+ and 3 earlyclobber operands.
+
+2015-02-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * doc/extend.texi: s/390: Update documentation of hotpatch attribute.
+ * doc/invoke.texi (-mhotpatch): s/390: Update documentation of
+ -mhotpatch= option.
+ * config/s390/s390.opt (mhotpatch): s/390: Remove -mhotpatch and
+ -mno-hotpatch options. Change syntax of -mhotpatch= option.
+ * config/s390/s390.c (s390_hotpatch_trampoline_halfwords_default):
+ Renamed.
+ (s390_hotpatch_trampoline_halfwords_max): Renamed.
+ (s390_hotpatch_hw_max): New name.
+ (s390_hotpatch_trampoline_halfwords): Renamed.
+ (s390_hotpatch_hw_before_label): New name.
+ (get_hotpatch_attribute): Removed.
+ (s390_hotpatch_hw_after_label): New name.
+ (s390_handle_hotpatch_attribute): Add second parameter to hotpatch
+ attribute.
+ (s390_attribute_table): Ditto.
+ (s390_function_num_hotpatch_trampoline_halfwords): Renamed.
+ (s390_function_num_hotpatch_hw): New name.
+ Remove special handling of inline functions and hotpatching.
+ Return number of nops before and after the function label.
+ (s390_can_inline_p): Removed.
+ (s390_asm_output_function_label): Emit a configurable number of nops
+ after the function label.
+ (s390_option_override): Update -mhotpatch= syntax and remove -mhotpatch.
+ (TARGET_CAN_INLINE_P) Removed.
+ (TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): New.
+
+2015-02-05 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/64580
+ Backport from mainline
+ * config.rs6000/rs6000.c (compute_vrsave_mask): Reverse loop order.
+ (rs6000_stack_info): Add assert.
+ (rs6000_output_savres_externs): New function, split off from...
+ (rs6000_output_function_prologue): ... here. Do not call it for
+ thunks.
+
+2015-02-04 Matthias Klose <doko@ubuntu.com>
+
+ PR target/64938
+ Backport from mainline
+ 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/64068
+ PR ipa/64559
+ * ipa.c (symbol_table::remove_unreachable_nodes):
+ Do not put abstract origins into boundary.
+
+2015-02-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64882
+ * config/i386/predicates.md (address_no_seg_operand): Reject
+ non-CONST_INT_P operands in invalid mode.
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*prefetch_prefetchw1): Remove mode of
+ address_operand 0. Rename from *prefetch_prefetchwt1_<mode>.
+ * config/i386/predicates.md (address_no_seg_operand): Call
+ address_operand with VOIDmode.
+ (vsib_address_operand): Ditto.
+
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Check new
+ Silvermont, Haswell, Broadwell and Knights Landing model numbers.
+ * config/i386/i386.c (processor_model): Add
+ M_INTEL_COREI7_BROADWELL.
+ (arch_names_table): Add "broadwell".
+
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/61058
+ * jump.c (cleanup_barriers): Update basic block boundaries
+ if BLOCK_FOR_INSN is non-NULL on PREV.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64421
+ * omp-low.c (simd_clone_mangle): If DECL_ASSEMBLER_NAME starts
+ with asterisk, skip the first character.
+
+ * config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add
+ OPTION_MASK_QUAD_MEMORY_ATOMIC.
+
+ 2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/63637
+ PR rtl-optimization/60663
+ * cse.c (merge_equiv_classes): Set new_elt->cost to MAX_COST
+ if elt->cost is MAX_COST for ASM_OPERANDS.
+ (find_sets_in_insn): Fix up comment typo.
+ (cse_insn): Don't set src_volatile for all non-volatile
+ ASM_OPERANDS in PARALLELs, but just those with multiple outputs
+ or with "memory" clobber. Set elt->cost to MAX_COST
+ for ASM_OPERANDS in PARALLEL. Set src_elt->cost to MAX_COST
+ if new_src is ASM_OPERANDS and elt->cost is MAX_COST.
+
+ PR debug/64511
+ * dwarf2out.c (struct dw_loc_descr_node): Add chain_next
+ GTY markup.
+
+ 2015-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/64663
+ * dwarf2out.c (decl_piece_node): Don't put bitsize into
+ mode if bitsize <= 0.
+ (decl_piece_bitsize, adjust_piece_list, add_var_loc_to_decl,
+ dw_sra_loc_expr): Use HOST_WIDE_INT instead of int for bit
+ sizes and positions.
+
+2015-01-29 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/avx2intrin.h (_mm256_bslli_epi128,
+ _mm256_bsrli_epi128): New.
+ * config/i386/emmintrin.h (_mm_bsrli_si128, _mm_bslli_si128): Ditto.
+
+2015-01-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_memory_move_cost): Increase costs for
+ memory accesses.
+
+2015-01-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_register_move_cost): Increase costs for
+ FPR->GPR moves.
+
+2015-01-26 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-26 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64795
+ * config/i386/i386.md (*movdi_internal): Also check operand 0
+ to determine TYPE_LEA operand.
+ (*movsi_internal): Ditto.
+
+ Backport from mainline
+ 2015-01-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sse.md (sse2_loadld): Set attribute isa to sse2 for
+ alternative 1.
+
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * omp-low.c (scan_sharing_clauses): Don't ignore
+ OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses
+ on target data/update constructs.
+
+2015-01-23 Wei Mi <wmi@google.com>
+
+ Backported from trunk.
+ 2015-01-22 Wei Mi <wmi@google.com>
+
+ PR rtl-optimization/64557
+ * dse.c (record_store): Call get_addr for mem_addr.
+ (check_mem_read_rtx): Likewise.
+
+2015-01-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.md (atomic code attribute): Fix typo "ior" ->
+ "or".
+
+2015-01-21 Wei Mi <wmi@google.com>
+
+ Backported from trunk.
+ 2014-11-22 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/63970
+ * ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones
+ as having abstract origin used.
+ * ipa-inline-transform.c (can_remove_node_now_p_1): Drop abstract origin check.
+ (clone_inlined_nodes): Copy abstract originflag.
+ * lto-cgraph.c (compute_ltrans_boundary): Use get_create to get abstract origin node.
+
+2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline
+ * config/nios2/nios2.c (nios2_asm_file_end): Implement
+ TARGET_ASM_FILE_END hook for adding .note.GNU-stack section when
+ needed.
+ (TARGET_ASM_FILE_END): Define.
+
+2015-01-15 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2014-11-27 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/63704
+ * alias.c (mems_in_disjoint_alias_sets_p): Remove assert
+ and instead return false when !fstrict-aliasing.
+
+2015-01-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (expand_expr_real_1) <normal_inner_ref>: Use the expression to
+ set the memory attributes in all cases but clear MEM_EXPR if need be.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64513
+ * config/i386/i386.c (ix86_expand_prologue): Add
+ REG_FRAME_RELATED_EXPR to %rax and %r10 pushes.
+
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64286
+ * ree.c (combine_reaching_defs): Move part of comment earlier,
+ remove !SCALAR_INT_MODE_P check.
+ (add_removable_extension): Don't add vector mode
+ extensions if all uses of the source register aren't the same
+ vector extensions.
+
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/64563
+ * tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE
+ instead of != VR_VARYING.
+
+2015-01-14 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2015-01-13 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/64391
+ * trans-mem.c (get_attrs_for): Return NULL_TREE if X is NULL_TREE.
+
+2015-01-13 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54442
+ * tree.c (build_qualified_type): Use a canonical type for
+ TYPE_CANONICAL.
+
+2015-01-13 Pat Haugen <pthaugen@us.ibm.com>
+
+ Backport from mainline
+ 2014-12-20 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/64358
+ * config/rs6000/rs6000.c (rs6000_split_logical_inner): Swap the
+ input operands if only the second is inverted.
+ * config/rs6000/rs6000.md (*boolc<mode>3_internal1 for BOOL_128):
+ Swap BOOL_REGS_OP1 and BOOL_REGS_OP2. Correct arguments to
+ rs6000_split_logical.
+ (*boolc<mode>3_internal2 for TI2): Swap operands[1] and operands[2].
+
+2015-01-13 Renlin Li <renlin.li@arm.com>
+
+ Backport from mainline:
+ 2014-11-19 Renlin Li <renlin.li@arm.com>
+
+ PR target/63424
+ * config/aarch64/aarch64-simd.md (<su><maxmin>v2di3): New.
+
+2015-01-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport form mainline
+ 2015-01-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/64479
+ * rtlanal.c (set_reg_p): Handle SEQUENCE constructs.
+
+2015-01-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64536
+ * cfgrtl.c (rtl_tidy_fallthru_edge): Handle removal of degenerate
+ tablejumps.
+
+2015-01-09 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline:
+ 2015-01-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/64505
+ * config/rs6000/rs6000.c (rs6000_secondary_reload): Return the
+ correct reload handler if -m32 -mpowerpc64 is used.
+
+2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline:
+ 2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rs6000/rtems.h (CPP_OS_RTEMS_SPEC): Define __PPC_CPU_E6500__
+ for -mcpu=e6500.
+ * config/rs6000/t-rtems: Add e6500 multilibs.
+
+2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline:
+ 2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rs6000/t-rtems: Add -mno-spe to soft-float multilib for
+ MPC8540.
+
+2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline:
+ 2015-01-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rs6000/t-rtems: Use MULTILIB_REQUIRED instead of
+ MULTILIB_EXCEPTIONS.
+
+2015-01-09 Renlin Li <renlin.li@arm.com>
+
+ Backport from mainline:
+ 2014-08-12 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ PR target/61413
+ * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Fix definition
+ of __ARM_SIZEOF_WCHAR_T.
+
2014-12-18 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_expand_call): Skip setting up RAX
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index df8c9e6618f..96020354944 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20150107
+20150212
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e9eb8462bb0..54a66629b0a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (is_cplusplus_method): Use Is_Primitive flag to
+ detect primitive operations of tagged and untagged types.
+
2015-01-05 Eric Botcazou <ebotcazou@adacore.com>
PR ada/64492
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 95bc778b4bd..0f62af7a4f3 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -5510,16 +5510,17 @@ is_cplusplus_method (Entity_Id gnat_entity)
if (Convention (gnat_entity) != Convention_CPP)
return false;
- /* This is the main case: C++ method imported as a primitive operation. */
- if (Is_Dispatching_Operation (gnat_entity))
+ /* This is the main case: C++ method imported as a primitive operation.
+ Note that a C++ class with no virtual functions can be imported as a
+ limited record type so the operation is not necessarily dispatching. */
+ if (Is_Primitive (gnat_entity))
return true;
/* A thunk needs to be handled like its associated primitive operation. */
if (Is_Subprogram (gnat_entity) && Is_Thunk (gnat_entity))
return true;
- /* C++ classes with no virtual functions can be imported as limited
- record types, but we need to return true for the constructors. */
+ /* A constructor is a method on the C++ side. */
if (Is_Constructor (gnat_entity))
return true;
diff --git a/gcc/alias.c b/gcc/alias.c
index 99add2627d0..9956306ae29 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -383,17 +383,9 @@ get_alias_set_entry (alias_set_type alias_set)
static inline int
mems_in_disjoint_alias_sets_p (const_rtx mem1, const_rtx mem2)
{
-/* Perform a basic sanity check. Namely, that there are no alias sets
- if we're not using strict aliasing. This helps to catch bugs
- whereby someone uses PUT_CODE, but doesn't clear MEM_ALIAS_SET, or
- where a MEM is allocated in some way other than by the use of
- gen_rtx_MEM, and the MEM_ALIAS_SET is not cleared. If we begin to
- use alias sets to indicate that spilled registers cannot alias each
- other, we might need to remove this check. */
- gcc_assert (flag_strict_aliasing
- || (!MEM_ALIAS_SET (mem1) && !MEM_ALIAS_SET (mem2)));
-
- return ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1), MEM_ALIAS_SET (mem2));
+ return (flag_strict_aliasing
+ && ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1),
+ MEM_ALIAS_SET (mem2)));
}
/* Insert the NODE into the splay tree given by DATA. Used by
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 98da804a1d2..65f8c48f5a0 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,31 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ PR c/64868
+ * c-omp.c (c_finish_omp_atomic): Use TRUNC_DIV_EXPR
+ instead of RDIV_EXPR. Use build_binary_op instead of
+ build2_loc.
+
+2015-02-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-24 Marek Polacek <polacek@redhat.com>
+
+ PR c/57653
+ * c-opts.c (c_finish_options): If -imacros is in effect, return.
+
+2015-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2014-06-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/61553
+ * c-common.c (get_atomic_generic_size): Don't segfault if the
+ type doesn't have a size.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3991e7a9856..f012f26ddb4 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -10380,7 +10380,8 @@ get_atomic_generic_size (location_t loc, tree function,
function);
return 0;
}
- size = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (type)));
+ tree type_size = TYPE_SIZE_UNIT (TREE_TYPE (type));
+ size = type_size ? tree_to_uhwi (type_size) : 0;
if (size != size_0)
{
error_at (loc, "size mismatch in argument %d of %qE", x + 1,
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 6a0e41988a7..bdcedb22e81 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -156,6 +156,9 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
return error_mark_node;
}
+ if (opcode == RDIV_EXPR)
+ opcode = TRUNC_DIV_EXPR;
+
/* ??? Validate that rhs does not overlap lhs. */
/* Take and save the address of the lhs. From then on we'll reference it
@@ -190,7 +193,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
to do this, and then take it apart again. */
if (swapped)
{
- rhs = build2_loc (loc, opcode, TREE_TYPE (lhs), rhs, lhs);
+ rhs = build_binary_op (loc, opcode, rhs, lhs, 1);
opcode = NOP_EXPR;
}
bool save = in_late_binary_op;
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 29e9a355bee..dd5fd230782 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1363,6 +1363,12 @@ c_finish_options (void)
static void
push_command_line_include (void)
{
+ /* This can happen if disabled by -imacros for example.
+ Punt so that we don't set "<command-line>" as the filename for
+ the header. */
+ if (include_cursor > deferred_count)
+ return;
+
if (!done_preinclude)
{
done_preinclude = true;
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 78cb3607423..b7bd03339ac 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,31 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ * c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
+ check in the POP macro.
+
+ Backported from mainline
+ 2015-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ PR c/64868
+ * c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
+
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64766
+ * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
+ of FUNCTION_DECLs with error_mark_node.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64778
+ * c-typeck.c (convert_arguments): Return -1 if there are
+ error_args, even if we've diagnosed too many arguments.
+
2015-01-05 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64344
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 264c17026eb..09e7a28dcee 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -6103,8 +6103,8 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after,
if (__builtin_expect (omp_atomic_lhs != NULL_TREE, 0) && sp == 1 \
&& c_parser_peek_token (parser)->type == CPP_SEMICOLON \
&& ((1 << stack[sp].prec) \
- & (1 << (PREC_BITOR | PREC_BITXOR | PREC_BITAND | PREC_SHIFT \
- | PREC_ADD | PREC_MULT))) \
+ & ((1 << PREC_BITOR) | (1 << PREC_BITXOR) | (1 << PREC_BITAND) \
+ | (1 << PREC_SHIFT) | (1 << PREC_ADD) | (1 << PREC_MULT))) \
&& stack[sp].op != TRUNC_MOD_EXPR \
&& stack[0].expr.value != error_mark_node \
&& stack[1].expr.value != error_mark_node \
@@ -11423,6 +11423,7 @@ restart:
{
case MULT_EXPR:
case TRUNC_DIV_EXPR:
+ case RDIV_EXPR:
case PLUS_EXPR:
case MINUS_EXPR:
case LSHIFT_EXPR:
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 9154c0d8a2e..aecc9ec83ff 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -3085,7 +3085,7 @@ convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
else
error_at (loc, "too many arguments to function %qE", function);
inform_declaration (fundecl);
- return parmnum;
+ return error_args ? -1 : (int) parmnum;
}
if (selector && argnum > 2)
@@ -6251,7 +6251,8 @@ store_init_value (location_t init_loc, tree decl, tree init, tree origtype)
warning (OPT_Wtraditional, "traditional C rejects automatic "
"aggregate initialization");
- DECL_INITIAL (decl) = value;
+ if (value != error_mark_node || TREE_CODE (decl) != FUNCTION_DECL)
+ DECL_INITIAL (decl) = value;
/* ANSI wants warnings about out-of-range constant initializers. */
STRIP_TYPE_NOPS (value);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 60b0c069f44..f0e31671b8d 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1761,6 +1761,22 @@ rtl_tidy_fallthru_edge (edge e)
&& (any_uncondjump_p (q)
|| single_succ_p (b)))
{
+ rtx label, table;
+
+ if (tablejump_p (q, &label, &table))
+ {
+ /* The label is likely mentioned in some instruction before
+ the tablejump and might not be DCEd, so turn it into
+ a note instead and move before the tablejump that is going to
+ be deleted. */
+ const char *name = LABEL_NAME (label);
+ PUT_CODE (label, NOTE);
+ NOTE_KIND (label) = NOTE_INSN_DELETED_LABEL;
+ NOTE_DELETED_LABEL_NAME (label) = name;
+ reorder_insns (label, label, PREV_INSN (q));
+ delete_insn (table);
+ }
+
#ifdef HAVE_cc0
/* If this was a conditional jump, we need to also delete
the insn that set cc0. */
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index f644901f35c..0173fa1c445 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -934,6 +934,41 @@
[(set_attr "type" "neon_minmax<q>")]
)
+(define_expand "<su><maxmin>v2di3"
+ [(parallel [
+ (set (match_operand:V2DI 0 "register_operand" "")
+ (MAXMIN:V2DI (match_operand:V2DI 1 "register_operand" "")
+ (match_operand:V2DI 2 "register_operand" "")))
+ (clobber (reg:CC CC_REGNUM))])]
+ "TARGET_SIMD"
+{
+ enum rtx_code cmp_operator;
+ rtx cmp_fmt;
+
+ switch (<CODE>)
+ {
+ case UMIN:
+ cmp_operator = LTU;
+ break;
+ case SMIN:
+ cmp_operator = LT;
+ break;
+ case UMAX:
+ cmp_operator = GTU;
+ break;
+ case SMAX:
+ cmp_operator = GT;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ cmp_fmt = gen_rtx_fmt_ee (cmp_operator, V2DImode, operands[1], operands[2]);
+ emit_insn (gen_aarch64_vcond_internalv2div2di (operands[0], operands[1],
+ operands[2], cmp_fmt, operands[1], operands[2]));
+ DONE;
+})
+
;; vec_concat gives a new vector with the low elements from operand 1, and
;; the high elements from operand 2. That is to say, given op1 = { a, b }
;; op2 = { c, d }, vec_concat (op1, op2) = { a, b, c, d }.
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 1179d572da6..3eabba2e3fc 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4496,8 +4496,8 @@
(define_insn_and_split "reload_out<mode>_aligned"
[(set (match_operand:I12MODE 0 "memory_operand" "=m")
(match_operand:I12MODE 1 "register_operand" "r"))
- (clobber (match_operand:SI 2 "register_operand" "=r"))
- (clobber (match_operand:SI 3 "register_operand" "=r"))]
+ (clobber (match_operand:SI 2 "register_operand" "=&r"))
+ (clobber (match_operand:SI 3 "register_operand" "=&r"))]
"!TARGET_BWX && (reload_in_progress || reload_completed)"
"#"
"!TARGET_BWX && reload_completed"
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index c0f218470c3..23333eb6df5 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -74,8 +74,8 @@ extern char arm_arch_name[];
builtin_define_with_int_value ( \
"__ARM_SIZEOF_MINIMAL_ENUM", \
flag_short_enums ? 1 : 4); \
- builtin_define_with_int_value ( \
- "__ARM_SIZEOF_WCHAR_T", WCHAR_TYPE_SIZE); \
+ builtin_define_type_sizeof ("__ARM_SIZEOF_WCHAR_T", \
+ wchar_type_node); \
if (TARGET_ARM_ARCH_PROFILE) \
builtin_define_with_int_value ( \
"__ARM_ARCH_PROFILE", TARGET_ARM_ARCH_PROFILE); \
diff --git a/gcc/config/i386/avx2intrin.h b/gcc/config/i386/avx2intrin.h
index d04c972ed89..76233b524ff 100644
--- a/gcc/config/i386/avx2intrin.h
+++ b/gcc/config/i386/avx2intrin.h
@@ -648,11 +648,20 @@ _mm256_sign_epi32 (__m256i __X, __m256i __Y)
#ifdef __OPTIMIZE__
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_bslli_epi128 (__m256i __A, const int __N)
+{
+ return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
+}
+
+extern __inline __m256i
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_slli_si256 (__m256i __A, const int __N)
{
return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
}
#else
+#define _mm256_bslli_epi128(A, N) \
+ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
#define _mm256_slli_si256(A, N) \
((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
#endif
@@ -730,11 +739,20 @@ _mm256_sra_epi32 (__m256i __A, __m128i __B)
#ifdef __OPTIMIZE__
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_bsrli_epi128 (__m256i __A, const int __N)
+{
+ return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
+}
+
+extern __inline __m256i
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_srli_si256 (__m256i __A, const int __N)
{
return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
}
#else
+#define _mm256_bsrli_epi128(A, N) \
+ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
#define _mm256_srli_si256(A, N) \
((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
#endif
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 722c5469255..992f91f8a57 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -670,7 +670,10 @@ const char *host_detect_local_cpu (int argc, const char **argv)
cpu = "bonnell";
break;
case 0x37:
+ case 0x4a:
case 0x4d:
+ case 0x5a:
+ case 0x5d:
/* Silvermont. */
cpu = "silvermont";
break;
@@ -705,11 +708,22 @@ const char *host_detect_local_cpu (int argc, const char **argv)
cpu = "ivybridge";
break;
case 0x3c:
+ case 0x3f:
case 0x45:
case 0x46:
/* Haswell. */
cpu = "haswell";
break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ cpu = "broadwell";
+ break;
+ case 0x57:
+ /* Knights Landing. */
+ cpu = "knl";
+ break;
default:
if (arch)
{
diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h
index a2bdf0edade..8eb5cabdee2 100644
--- a/gcc/config/i386/emmintrin.h
+++ b/gcc/config/i386/emmintrin.h
@@ -1161,6 +1161,18 @@ _mm_srai_epi32 (__m128i __A, int __B)
#ifdef __OPTIMIZE__
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bsrli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bslli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_srli_si128 (__m128i __A, const int __N)
{
return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
@@ -1172,6 +1184,10 @@ _mm_slli_si128 (__m128i __A, const int __N)
return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
}
#else
+#define _mm_bsrli_si128(A, N) \
+ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
+#define _mm_bslli_si128(A, N) \
+ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8))
#define _mm_srli_si128(A, N) \
((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
#define _mm_slli_si128(A, N) \
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 39468d5038f..eb84030a174 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -11076,6 +11076,10 @@ ix86_expand_prologue (void)
if (sp_is_cfa_reg)
m->fs.cfa_offset += UNITS_PER_WORD;
RTX_FRAME_RELATED_P (insn) = 1;
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+ -UNITS_PER_WORD)));
}
}
@@ -11089,6 +11093,10 @@ ix86_expand_prologue (void)
if (sp_is_cfa_reg)
m->fs.cfa_offset += UNITS_PER_WORD;
RTX_FRAME_RELATED_P (insn) = 1;
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+ -UNITS_PER_WORD)));
}
}
@@ -32364,7 +32372,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
M_AMDFAM15H_BDVER3,
M_AMDFAM15H_BDVER4,
M_INTEL_COREI7_IVYBRIDGE,
- M_INTEL_COREI7_HASWELL
+ M_INTEL_COREI7_HASWELL,
+ M_INTEL_COREI7_BROADWELL
};
static struct _arch_names_table
@@ -32385,6 +32394,7 @@ fold_builtin_cpu (tree fndecl, tree *args)
{"sandybridge", M_INTEL_COREI7_SANDYBRIDGE},
{"ivybridge", M_INTEL_COREI7_IVYBRIDGE},
{"haswell", M_INTEL_COREI7_HASWELL},
+ {"broadwell", M_INTEL_COREI7_BROADWELL},
{"bonnell", M_INTEL_BONNELL},
{"silvermont", M_INTEL_SILVERMONT},
{"amdfam10h", M_AMDFAM10H},
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index cd7eadb55d9..2f76305d23e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2110,7 +2110,8 @@
(const_string "ssemov")
(eq_attr "alternative" "19,20")
(const_string "ssecvt")
- (match_operand 1 "pic_32bit_operand")
+ (and (match_operand 0 "register_operand")
+ (match_operand 1 "pic_32bit_operand"))
(const_string "lea")
]
(const_string "imov")))
@@ -2254,7 +2255,8 @@
(const_string "sselog1")
(eq_attr "alternative" "7,8,9,10,12")
(const_string "ssemov")
- (match_operand 1 "pic_32bit_operand")
+ (and (match_operand 0 "register_operand")
+ (match_operand 1 "pic_32bit_operand"))
(const_string "lea")
]
(const_string "imov")))
@@ -17621,8 +17623,8 @@
(symbol_ref "memory_address_length (operands[0], false)"))
(set_attr "memory" "none")])
-(define_insn "*prefetch_prefetchwt1_<mode>"
- [(prefetch (match_operand:P 0 "address_operand" "p")
+(define_insn "*prefetch_prefetchwt1"
+ [(prefetch (match_operand 0 "address_operand" "p")
(const_int 1)
(const_int 2))]
"TARGET_PREFETCHWT1"
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 2ef1384246e..4ba2e6fbbca 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -968,11 +968,16 @@
;; a segment override. Defined as a special predicate to allow
;; mode-less const_int operands pass to address_operand.
(define_special_predicate "address_no_seg_operand"
- (match_operand 0 "address_operand")
+ (match_test "address_operand (op, VOIDmode)")
{
struct ix86_address parts;
int ok;
+ if (!CONST_INT_P (op)
+ && mode != VOIDmode
+ && GET_MODE (op) != mode)
+ return false;
+
ok = ix86_decompose_address (op, &parts);
gcc_assert (ok);
return parts.seg == SEG_DEFAULT;
@@ -981,7 +986,7 @@
;; Return true if op if a valid base register, displacement or
;; sum of base register and displacement for VSIB addressing.
(define_predicate "vsib_address_operand"
- (match_operand 0 "address_operand")
+ (match_test "address_operand (op, VOIDmode)")
{
struct ix86_address parts;
int ok;
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index c700425dc2c..5a62572b0cd 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -10303,7 +10303,7 @@
movss\t{%2, %0|%0, %2}
movss\t{%2, %0|%0, %2}
vmovss\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "sse2,*,noavx,noavx,avx")
+ [(set_attr "isa" "sse2,sse2,noavx,noavx,avx")
(set_attr "type" "ssemov")
(set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex")
(set_attr "mode" "TI,TI,V4SF,SF,SF")])
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index cdd2e6bc98b..047b615bab9 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -2135,6 +2135,18 @@ nios2_output_dwarf_dtprel (FILE *file, int size, rtx x)
fprintf (file, ")");
}
+/* Implemet TARGET_ASM_FILE_END. */
+
+static void
+nios2_asm_file_end (void)
+{
+ /* The Nios II Linux stack is mapped non-executable by default, so add a
+ .note.GNU-stack section for switching to executable stacks only when
+ trampolines are generated. */
+ if (TARGET_LINUX_ABI && trampolines_created)
+ file_end_indicate_exec_stack ();
+}
+
/* Implement TARGET_ASM_FUNCTION_PROLOGUE. */
static void
nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
@@ -3313,6 +3325,9 @@ nios2_merge_decl_attributes (tree olddecl, tree newdecl)
#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA nios2_output_addr_const_extra
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END nios2_asm_file_end
+
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE nios2_option_override
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index b17fd0d7207..ba56df83dd1 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -91,6 +91,7 @@
| OPTION_MASK_PPC_GFXOPT \
| OPTION_MASK_PPC_GPOPT \
| OPTION_MASK_QUAD_MEMORY \
+ | OPTION_MASK_QUAD_MEMORY_ATOMIC \
| OPTION_MASK_RECIP_PRECISION \
| OPTION_MASK_SOFT_FLOAT \
| OPTION_MASK_STRICT_ALIGN_OPTIONAL \
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 824e2d308e0..b36cd655aa8 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -16636,10 +16636,13 @@ rs6000_secondary_reload (bool in_p,
: (offset + 0x8000 < 0x10000 - extra /* legitimate_address_p */
&& (offset & 3) != 0))
{
+ /* -m32 -mpowerpc64 needs to use a 32-bit scratch register. */
if (in_p)
- sri->icode = CODE_FOR_reload_di_load;
+ sri->icode = ((TARGET_32BIT) ? CODE_FOR_reload_si_load
+ : CODE_FOR_reload_di_load);
else
- sri->icode = CODE_FOR_reload_di_store;
+ sri->icode = ((TARGET_32BIT) ? CODE_FOR_reload_si_store
+ : CODE_FOR_reload_di_store);
sri->extra_cost = 2;
ret = NO_REGS;
}
@@ -20688,7 +20691,7 @@ compute_vrsave_mask (void)
them in again. More importantly, the mask we compute here is
used to generate CLOBBERs in the set_vrsave insn, and we do not
wish the argument registers to die. */
- for (i = crtl->args.info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i)
+ for (i = ALTIVEC_ARG_MIN_REG; i < (unsigned) crtl->args.info.vregno; i++)
mask &= ~ALTIVEC_REG_BIT (i);
/* Similarly, remove the return value from the set. */
@@ -21097,6 +21100,9 @@ rs6000_savres_strategy (rs6000_stack_t *info,
static rs6000_stack_t *
rs6000_stack_info (void)
{
+ /* We should never be called for thunks, we are not set up for that. */
+ gcc_assert (!cfun->is_thunk);
+
rs6000_stack_t *info_ptr = &stack_info;
int reg_size = TARGET_32BIT ? 4 : 8;
int ehrd_size;
@@ -23818,11 +23824,10 @@ rs6000_emit_prologue (void)
}
}
-/* Write function prologue. */
+/* Output .extern statements for the save/restore routines we use. */
static void
-rs6000_output_function_prologue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_savres_externs (FILE *file)
{
rs6000_stack_t *info = rs6000_stack_info ();
@@ -23854,6 +23859,16 @@ rs6000_output_function_prologue (FILE *file,
fprintf (file, "\t.extern %s\n", name);
}
}
+}
+
+/* Write function prologue. */
+
+static void
+rs6000_output_function_prologue (FILE *file,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+{
+ if (!cfun->is_thunk)
+ rs6000_output_savres_externs (file);
/* ELFv2 ABI r2 setup code and local entry point. This must follow
immediately after the global entry point label. */
@@ -32567,6 +32582,14 @@ rs6000_split_logical_inner (rtx dest,
if (complement_op2_p)
op2 = gen_rtx_NOT (mode, op2);
+ /* For canonical RTL, if only one arm is inverted it is the first. */
+ if (!complement_op1_p && complement_op2_p)
+ {
+ rtx temp = op1;
+ op1 = op2;
+ op2 = temp;
+ }
+
bool_rtx = ((code == NOT)
? gen_rtx_NOT (mode, op1)
: gen_rtx_fmt_ee (code, mode, op1, op2));
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 46837e15389..f77754aa110 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8600,8 +8600,8 @@
[(set (match_operand:BOOL_128 0 "vlogical_operand" "=<BOOL_REGS_OUTPUT>")
(match_operator:BOOL_128 3 "boolean_operator"
[(not:BOOL_128
- (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP1>"))
- (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP2>")]))]
+ (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP2>"))
+ (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP1>")]))]
"TARGET_P8_VECTOR || (GET_CODE (operands[3]) == AND)"
{
if (TARGET_VSX && vsx_register_operand (operands[0], <MODE>mode))
@@ -8616,7 +8616,7 @@
&& reload_completed && int_reg_operand (operands[0], <MODE>mode)"
[(const_int 0)]
{
- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
+ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
NULL_RTX);
DONE;
}
@@ -8638,14 +8638,14 @@
[(set (match_operand:TI2 0 "int_reg_operand" "=&r,r,r")
(match_operator:TI2 3 "boolean_operator"
[(not:TI2
- (match_operand:TI2 1 "int_reg_operand" "r,0,r"))
- (match_operand:TI2 2 "int_reg_operand" "r,r,0")]))]
+ (match_operand:TI2 2 "int_reg_operand" "r,0,r"))
+ (match_operand:TI2 1 "int_reg_operand" "r,r,0")]))]
"!TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
"#"
"reload_completed && !TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
[(const_int 0)]
{
- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
+ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
NULL_RTX);
DONE;
}
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index 2402d53364e..04648803499 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -52,7 +52,8 @@
%{mcpu=750: %{!Dppc*: %{!Dmpc*: -Dmpc750} } } \
%{mcpu=821: %{!Dppc*: %{!Dmpc*: -Dmpc821} } } \
%{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } } \
-%{mcpu=8540: %{!Dppc*: %{!Dmpc*: -Dppc8540} } }"
+%{mcpu=8540: %{!Dppc*: %{!Dmpc*: -Dppc8540} } } \
+%{mcpu=e6500: -D__PPC_CPU_E6500__}"
#undef SUBSUBTARGET_EXTRA_SPECS
#define SUBSUBTARGET_EXTRA_SPECS \
diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems
index 426f75ac564..eadda0d20fe 100644
--- a/gcc/config/rs6000/t-rtems
+++ b/gcc/config/rs6000/t-rtems
@@ -18,16 +18,24 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-MULTILIB_OPTIONS = \
-mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 \
-msoft-float/mfloat-gprs=double
+MULTILIB_OPTIONS =
+MULTILIB_DIRNAMES =
+MULTILIB_MATCHES =
+MULTILIB_EXCEPTIONS =
+MULTILIB_REQUIRED =
+
+MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540/mcpu=e6500
+MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 me6500
+
+MULTILIB_OPTIONS += m32
+MULTILIB_DIRNAMES += m32
-MULTILIB_DIRNAMES = \
-m403 m505 m603e m604 m860 m7400 m8540 \
-nof gprsdouble
+MULTILIB_OPTIONS += msoft-float/mfloat-gprs=double
+MULTILIB_DIRNAMES += nof gprsdouble
+
+MULTILIB_OPTIONS += mno-spe/mno-altivec
+MULTILIB_DIRNAMES += nospe noaltivec
-# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
-MULTILIB_MATCHES =
MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN}
MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV}
# Map 405 to 403
@@ -52,37 +60,20 @@ MULTILIB_MATCHES += mcpu?8540=mcpu?8548
# (mfloat-gprs=single is implicit default)
MULTILIB_MATCHES += mcpu?8540=mcpu?8540/mfloat-gprs?single
-# Soft-float only, default implies msoft-float
-# NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES
-MULTILIB_SOFTFLOAT_ONLY = \
-*mcpu=401/*msoft-float* \
-*mcpu=403/*msoft-float* \
-*mcpu=405/*msoft-float* \
-*mcpu=801/*msoft-float* \
-*mcpu=821/*msoft-float* \
-*mcpu=823/*msoft-float* \
-*mcpu=860/*msoft-float*
-
-# Hard-float only, take out msoft-float
-MULTILIB_HARDFLOAT_ONLY = \
-*mcpu=505/*msoft-float*
-
-# Targets which do not support gprs
-MULTILIB_NOGPRS = \
-mfloat-gprs=* \
-*mcpu=403/*mfloat-gprs=* \
-*mcpu=505/*mfloat-gprs=* \
-*mcpu=603e/*mfloat-gprs=* \
-*mcpu=604/*mfloat-gprs=* \
-*mcpu=860/*mfloat-gprs=* \
-*mcpu=7400/*mfloat-gprs=*
-
-MULTILIB_EXCEPTIONS =
-
-# Disallow -Dppc and -Dmpc without other options
-MULTILIB_EXCEPTIONS += Dppc* Dmpc*
+# Enumeration of multilibs
-MULTILIB_EXCEPTIONS += \
-${MULTILIB_SOFTFLOAT_ONLY} \
-${MULTILIB_HARDFLOAT_ONLY} \
-${MULTILIB_NOGPRS}
+MULTILIB_REQUIRED += msoft-float
+MULTILIB_REQUIRED += mcpu=403
+MULTILIB_REQUIRED += mcpu=505
+MULTILIB_REQUIRED += mcpu=603e
+MULTILIB_REQUIRED += mcpu=603e/msoft-float
+MULTILIB_REQUIRED += mcpu=604
+MULTILIB_REQUIRED += mcpu=604/msoft-float
+MULTILIB_REQUIRED += mcpu=7400
+MULTILIB_REQUIRED += mcpu=7400/msoft-float
+MULTILIB_REQUIRED += mcpu=8540
+MULTILIB_REQUIRED += mcpu=8540/msoft-float/mno-spe
+MULTILIB_REQUIRED += mcpu=8540/mfloat-gprs=double
+MULTILIB_REQUIRED += mcpu=860
+MULTILIB_REQUIRED += mcpu=e6500/m32
+MULTILIB_REQUIRED += mcpu=e6500/m32/msoft-float/mno-altivec
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 866de858cf0..0c120924c90 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -436,24 +436,9 @@ struct GTY(()) machine_function
bytes on a z10 (or higher) CPU. */
#define PREDICT_DISTANCE (TARGET_Z10 ? 384 : 2048)
-static const int s390_hotpatch_trampoline_halfwords_default = 12;
-static const int s390_hotpatch_trampoline_halfwords_max = 1000000;
-static int s390_hotpatch_trampoline_halfwords = -1;
-
-/* Return the argument of the given hotpatch attribute or the default value if
- no argument is present. */
-
-static inline int
-get_hotpatch_attribute (tree hotpatch_attr)
-{
- const_tree args;
-
- args = TREE_VALUE (hotpatch_attr);
-
- return (args) ?
- TREE_INT_CST_LOW (TREE_VALUE (args)):
- s390_hotpatch_trampoline_halfwords_default;
-}
+static const int s390_hotpatch_hw_max = 1000000;
+static int s390_hotpatch_hw_before_label = 0;
+static int s390_hotpatch_hw_after_label = 0;
/* Check whether the hotpatch attribute is applied to a function and, if it has
an argument, the argument is valid. */
@@ -462,34 +447,48 @@ static tree
s390_handle_hotpatch_attribute (tree *node, tree name, tree args,
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
+ tree expr;
+ tree expr2;
+ int err;
+
if (TREE_CODE (*node) != FUNCTION_DECL)
{
warning (OPT_Wattributes, "%qE attribute only applies to functions",
name);
*no_add_attrs = true;
}
- else if (args)
+ if (args != NULL && TREE_CHAIN (args) != NULL)
+ {
+ expr = TREE_VALUE (args);
+ expr2 = TREE_VALUE (TREE_CHAIN (args));
+ }
+ if (args == NULL || TREE_CHAIN (args) == NULL)
+ err = 1;
+ else if (TREE_CODE (expr) != INTEGER_CST
+ || !INTEGRAL_TYPE_P (TREE_TYPE (expr))
+ || TREE_INT_CST_HIGH (expr) != 0
+ || TREE_INT_CST_LOW (expr) > (unsigned int)s390_hotpatch_hw_max)
+ err = 1;
+ else if (TREE_CODE (expr2) != INTEGER_CST
+ || !INTEGRAL_TYPE_P (TREE_TYPE (expr2))
+ || TREE_INT_CST_HIGH (expr2) != 0
+ || TREE_INT_CST_LOW (expr2) > (unsigned int)s390_hotpatch_hw_max)
+ err = 1;
+ else
+ err = 0;
+ if (err)
{
- tree expr = TREE_VALUE (args);
-
- if (TREE_CODE (expr) != INTEGER_CST
- || !INTEGRAL_TYPE_P (TREE_TYPE (expr))
- || TREE_INT_CST_HIGH (expr) != 0
- || TREE_INT_CST_LOW (expr) > (unsigned int)
- s390_hotpatch_trampoline_halfwords_max)
- {
- error ("requested %qE attribute is not a non-negative integer"
- " constant or too large (max. %d)", name,
- s390_hotpatch_trampoline_halfwords_max);
- *no_add_attrs = true;
- }
+ error ("requested %qE attribute is not a comma separated pair of"
+ " non-negative integer constants or too large (max. %d)", name,
+ s390_hotpatch_hw_max);
+ *no_add_attrs = true;
}
return NULL_TREE;
}
static const struct attribute_spec s390_attribute_table[] = {
- { "hotpatch", 0, 1, true, false, false, s390_handle_hotpatch_attribute, false
+ { "hotpatch", 2, 2, true, false, false, s390_handle_hotpatch_attribute, false
},
/* End element. */
{ NULL, 0, 0, false, false, false, NULL, false }
@@ -2384,16 +2383,29 @@ s390_float_const_zero_p (rtx value)
/* Implement TARGET_REGISTER_MOVE_COST. */
static int
-s390_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+s390_register_move_cost (enum machine_mode mode,
reg_class_t from, reg_class_t to)
{
- /* On s390, copy between fprs and gprs is expensive as long as no
- ldgr/lgdr can be used. */
- if ((!TARGET_Z10 || GET_MODE_SIZE (mode) != 8)
- && ((reg_classes_intersect_p (from, GENERAL_REGS)
- && reg_classes_intersect_p (to, FP_REGS))
- || (reg_classes_intersect_p (from, FP_REGS)
- && reg_classes_intersect_p (to, GENERAL_REGS))))
+ /* On s390, copy between fprs and gprs is expensive. */
+
+ /* It becomes somewhat faster having ldgr/lgdr. */
+ if (TARGET_Z10 && GET_MODE_SIZE (mode) == 8)
+ {
+ /* ldgr is single cycle. */
+ if (reg_classes_intersect_p (from, GENERAL_REGS)
+ && reg_classes_intersect_p (to, FP_REGS))
+ return 1;
+ /* lgdr needs 3 cycles. */
+ if (reg_classes_intersect_p (to, GENERAL_REGS)
+ && reg_classes_intersect_p (from, FP_REGS))
+ return 3;
+ }
+
+ /* Otherwise copying is done via memory. */
+ if ((reg_classes_intersect_p (from, GENERAL_REGS)
+ && reg_classes_intersect_p (to, FP_REGS))
+ || (reg_classes_intersect_p (from, FP_REGS)
+ && reg_classes_intersect_p (to, GENERAL_REGS)))
return 10;
return 1;
@@ -2406,7 +2418,7 @@ s390_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
reg_class_t rclass ATTRIBUTE_UNUSED,
bool in ATTRIBUTE_UNUSED)
{
- return 1;
+ return 2;
}
/* Compute a (partial) cost for rtx X. Return true if the complete
@@ -5241,53 +5253,51 @@ get_some_local_dynamic_name (void)
gcc_unreachable ();
}
-/* Returns -1 if the function should not be made hotpatchable. Otherwise it
- returns a number >= 0 that is the desired size of the hotpatch trampoline
- in halfwords. */
+/* Returns false if the function should not be made hotpatchable.
+ Otherwise it assigns the number of NOP halfwords to be emitted
+ before and after the function label to hw_before and hw_after.
+ Both must not be NULL. */
-static int s390_function_num_hotpatch_trampoline_halfwords (tree decl,
- bool do_warn)
+static bool
+s390_function_num_hotpatch_hw (tree decl,
+ int *hw_before,
+ int *hw_after)
{
tree attr;
- if (DECL_DECLARED_INLINE_P (decl)
- || DECL_ARTIFICIAL (decl)
- || MAIN_NAME_P (DECL_NAME (decl)))
+ *hw_before = 0;
+ *hw_after = 0;
+
+ attr = lookup_attribute ("hotpatch", DECL_ATTRIBUTES (decl));
+
+ /* Handle the arguments of the hotpatch attribute. The values
+ specified via attribute might override the cmdline argument
+ values. */
+ if (attr)
{
- /* - Explicitly inlined functions cannot be hotpatched.
- - Artificial functions need not be hotpatched.
- - Making the main function hotpatchable is useless. */
- return -1;
+ tree args = TREE_VALUE (attr);
+
+ *hw_before = TREE_INT_CST_LOW (TREE_VALUE (args));
+ *hw_after = TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (args)));
}
- attr = lookup_attribute ("hotpatch", DECL_ATTRIBUTES (decl));
- if (attr || s390_hotpatch_trampoline_halfwords >= 0)
+ else
{
- if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (decl)))
- {
- if (do_warn)
- warning (OPT_Wattributes, "function %qE with the %qs attribute"
- " is not hotpatchable", DECL_NAME (decl), "always_inline");
- return -1;
- }
- else
- {
- return (attr) ?
- get_hotpatch_attribute (attr) : s390_hotpatch_trampoline_halfwords;
- }
+ /* Use the values specified by the cmdline arguments. */
+ *hw_before = s390_hotpatch_hw_before_label;
+ *hw_after = s390_hotpatch_hw_after_label;
}
- return -1;
-}
-
-/* Hook to determine if one function can safely inline another. */
-
-static bool
-s390_can_inline_p (tree caller, tree callee)
-{
- if (s390_function_num_hotpatch_trampoline_halfwords (callee, false) >= 0)
+ if (*hw_before == 0 && *hw_after == 0)
return false;
- return default_target_can_inline_p (caller, callee);
+ if (decl_function_context (decl) != NULL_TREE)
+ {
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_mhotpatch_,
+ "hotpatching is not compatible with nested functions");
+ return false;
+ }
+
+ return true;
}
/* Write the extra assembler code needed to declare a function properly. */
@@ -5296,29 +5306,20 @@ void
s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
tree decl)
{
- int hotpatch_trampoline_halfwords = -1;
-
- if (decl)
- {
- hotpatch_trampoline_halfwords =
- s390_function_num_hotpatch_trampoline_halfwords (decl, true);
- if (hotpatch_trampoline_halfwords >= 0
- && decl_function_context (decl) != NULL_TREE)
- {
- warning_at (DECL_SOURCE_LOCATION (decl), OPT_mhotpatch,
- "hotpatching is not compatible with nested functions");
- hotpatch_trampoline_halfwords = -1;
- }
- }
+ int hw_before, hw_after;
+ bool hotpatch_p = (decl
+ ? s390_function_num_hotpatch_hw (decl,
+ &hw_before, &hw_after)
+ : false);
- if (hotpatch_trampoline_halfwords > 0)
+ if (hotpatch_p)
{
int i;
/* Add a trampoline code area before the function label and initialize it
with two-byte nop instructions. This area can be overwritten with code
that jumps to a patched version of the function. */
- for (i = 0; i < hotpatch_trampoline_halfwords; i++)
+ for (i = 0; i < hw_before; i++)
asm_fprintf (asm_out_file, "\tnopr\t%%r7\n");
/* Note: The function label must be aligned so that (a) the bytes of the
following nop do not cross a cacheline boundary, and (b) a jump address
@@ -5330,10 +5331,30 @@ s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
ASM_OUTPUT_LABEL (asm_out_file, fname);
- /* Output a four-byte nop if hotpatching is enabled. This can be overwritten
- atomically with a relative backwards jump to the trampoline area. */
- if (hotpatch_trampoline_halfwords >= 0)
- asm_fprintf (asm_out_file, "\tnop\t0\n");
+ /* Output a series of NOPs after the function label. */
+ if (hotpatch_p)
+ {
+ while (hw_after > 0)
+ {
+ if (hw_after >= 3 && TARGET_CPU_ZARCH)
+ {
+ asm_fprintf (asm_out_file, "\tbrcl\t\t0,0\n");
+ hw_after -= 3;
+ }
+ else if (hw_after >= 2)
+ {
+ gcc_assert (hw_after == 2 || !TARGET_CPU_ZARCH);
+ asm_fprintf (asm_out_file, "\tnop\t0\n");
+ hw_after -= 2;
+ }
+ else
+ {
+ gcc_assert (hw_after == 1);
+ asm_fprintf (asm_out_file, "\tnopr\t%%r7\n");
+ hw_after -= 1;
+ }
+ }
+ }
}
/* Output machine-dependent UNSPECs occurring in address constant X
@@ -11850,29 +11871,44 @@ s390_option_override (void)
{
switch (opt->opt_index)
{
- case OPT_mhotpatch:
- s390_hotpatch_trampoline_halfwords = (opt->value) ?
- s390_hotpatch_trampoline_halfwords_default : -1;
- break;
case OPT_mhotpatch_:
{
- int val;
-
- val = integral_argument (opt->arg);
- if (val == -1)
+ int val1;
+ int val2;
+ char s[256];
+ char *t;
+
+ strncpy (s, opt->arg, 256);
+ s[255] = 0;
+ t = strchr (s, ',');
+ if (t != NULL)
+ {
+ *t = 0;
+ t++;
+ val1 = integral_argument (s);
+ val2 = integral_argument (t);
+ }
+ else
+ {
+ val1 = -1;
+ val2 = -1;
+ }
+ if (val1 == -1 || val2 == -1)
{
/* argument is not a plain number */
- error ("argument to %qs should be a non-negative integer",
- "-mhotpatch=");
+ error ("arguments to %qs should be non-negative integers",
+ "-mhotpatch=n,m");
break;
}
- else if (val > s390_hotpatch_trampoline_halfwords_max)
+ else if (val1 > s390_hotpatch_hw_max
+ || val2 > s390_hotpatch_hw_max)
{
error ("argument to %qs is too large (max. %d)",
- "-mhotpatch=", s390_hotpatch_trampoline_halfwords_max);
+ "-mhotpatch=n,m", s390_hotpatch_hw_max);
break;
}
- s390_hotpatch_trampoline_halfwords = val;
+ s390_hotpatch_hw_before_label = val1;
+ s390_hotpatch_hw_after_label = val2;
break;
}
default:
@@ -12242,8 +12278,8 @@ s390_option_override (void)
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE s390_attribute_table
-#undef TARGET_CAN_INLINE_P
-#define TARGET_CAN_INLINE_P s390_can_inline_p
+#undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
+#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P hook_bool_const_tree_true
#undef TARGET_SET_UP_BY_PROLOGUE
#define TARGET_SET_UP_BY_PROLOGUE s300_set_up_by_prologue
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index b17c1fac875..10d7a5a6d74 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -460,7 +460,7 @@
;; This iterator and attribute allow to combine most atomic operations.
(define_code_iterator ATOMIC [and ior xor plus minus mult])
(define_code_iterator ATOMIC_Z196 [and ior xor plus])
-(define_code_attr atomic [(and "and") (ior "ior") (xor "xor")
+(define_code_attr atomic [(and "and") (ior "or") (xor "xor")
(plus "add") (minus "sub") (mult "nand")])
(define_code_attr noxa [(and "n") (ior "o") (xor "x") (plus "a")])
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index 7780f877c7a..c4b5269206f 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -96,13 +96,15 @@ mhard-float
Target Report RejectNegative Negative(msoft-float) InverseMask(SOFT_FLOAT, HARD_FLOAT)
Enable hardware floating point
-mhotpatch
-Target Report Var(s390_deferred_options) Defer
-Prepend the function label with 12 two-byte Nop instructions, and add a four byte Nop instruction after the label for hotpatching.
-
mhotpatch=
Target RejectNegative Report Joined Var(s390_deferred_options) Defer
-Prepend the function label with the given number of two-byte Nop instructions, and add a four byte Nop instruction after the label for hotpatching.
+Takes two non-negative integer numbers separated by a comma.
+Prepend the function label with the number of two-byte Nop
+instructions indicated by the first. Append Nop instructions
+covering the number of halfwords indicated by the second after the
+label. Nop instructions of the largest possible size are used
+(six, four or two bytes), beginning with the largest possible
+size. Using 0 for both values disables hotpatching.
mlong-double-128
Target Report RejectNegative Negative(mlong-double-64) Mask(LONG_DOUBLE_128)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1c9dae489c6..c861ac04eb5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,30 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ PR c/64868
+ * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
+
+2015-02-04 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR c++/64901
+ * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
+ DECL_OVERRIDE_P.
+
+2015-01-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/64521
+ * repo.c (repo_emit_p): It's OK for a clone to be extern at this
+ point.
+
+2015-01-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/64514
+ * pt.c (coerce_template_parameter_pack): Return NULL for a
+ zero-length fixed parameter pack with a pack expansion arg.
+
2015-01-07 Jason Merrill <jason@redhat.com>
PR c++/64487
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a355d6e84ba..a2999c20b11 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1788,6 +1788,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl);
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
DECL_INVALID_OVERRIDER_P (newdecl) |= DECL_INVALID_OVERRIDER_P (olddecl);
+ DECL_FINAL_P (newdecl) |= DECL_FINAL_P (olddecl);
+ DECL_OVERRIDE_P (newdecl) |= DECL_OVERRIDE_P (olddecl);
DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl);
if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK)
SET_OVERLOADED_OPERATOR_CODE
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 93f94d260c1..18c706846ba 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -28748,6 +28748,7 @@ restart:
{
case MULT_EXPR:
case TRUNC_DIV_EXPR:
+ case RDIV_EXPR:
case PLUS_EXPR:
case MINUS_EXPR:
case LSHIFT_EXPR:
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 699ae69175c..2abfc70ef6d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6671,6 +6671,9 @@ coerce_template_parameter_pack (tree parms,
if (invalid_nontype_parm_type_p (t, complain))
return error_mark_node;
}
+ /* We don't know how many args we have yet, just
+ use the unconverted ones for now. */
+ return NULL_TREE;
}
packed_args = make_tree_vec (TREE_VEC_LENGTH (packed_parms));
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index f076f23c8f2..2b571c5d459 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -293,7 +293,11 @@ repo_emit_p (tree decl)
int ret = 0;
gcc_assert (TREE_PUBLIC (decl));
gcc_assert (VAR_OR_FUNCTION_DECL_P (decl));
- gcc_assert (!DECL_REALLY_EXTERN (decl));
+ gcc_assert (!DECL_REALLY_EXTERN (decl)
+ /* A clone might not have its linkage flags updated yet
+ because we call import_export_decl before
+ maybe_clone_body. */
+ || DECL_ABSTRACT_ORIGIN (decl));
/* When not using the repository, emit everything. */
if (!flag_use_repository)
diff --git a/gcc/cse.c b/gcc/cse.c
index ec9aff4195a..9b8b8160c41 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1805,6 +1805,8 @@ merge_equiv_classes (struct table_elt *class1, struct table_elt *class2)
}
new_elt = insert (exp, class1, hash, mode);
new_elt->in_memory = hash_arg_in_memory;
+ if (GET_CODE (exp) == ASM_OPERANDS && elt->cost == MAX_COST)
+ new_elt->cost = MAX_COST;
}
}
}
@@ -4266,7 +4268,7 @@ find_sets_in_insn (rtx insn, struct set **psets)
{
int i, lim = XVECLEN (x, 0);
- /* Go over the epressions of the PARALLEL in forward order, to
+ /* Go over the expressions of the PARALLEL in forward order, to
put them in the same order in the SETS array. */
for (i = 0; i < lim; i++)
{
@@ -4642,12 +4644,27 @@ cse_insn (rtx insn)
&& REGNO (dest) >= FIRST_PSEUDO_REGISTER)
sets[i].src_volatile = 1;
- /* Also do not record result of a non-volatile inline asm with
- more than one result or with clobbers, we do not want CSE to
- break the inline asm apart. */
else if (GET_CODE (src) == ASM_OPERANDS
&& GET_CODE (x) == PARALLEL)
- sets[i].src_volatile = 1;
+ {
+ /* Do not record result of a non-volatile inline asm with
+ more than one result. */
+ if (n_sets > 1)
+ sets[i].src_volatile = 1;
+
+ int j, lim = XVECLEN (x, 0);
+ for (j = 0; j < lim; j++)
+ {
+ rtx y = XVECEXP (x, 0, j);
+ /* And do not record result of a non-volatile inline asm
+ with "memory" clobber. */
+ if (GET_CODE (y) == CLOBBER && MEM_P (XEXP (y, 0)))
+ {
+ sets[i].src_volatile = 1;
+ break;
+ }
+ }
+ }
#if 0
/* It is no longer clear why we used to do this, but it doesn't
@@ -5238,8 +5255,8 @@ cse_insn (rtx insn)
;
/* Look for a substitution that makes a valid insn. */
- else if (validate_unshare_change
- (insn, &SET_SRC (sets[i].rtl), trial, 0))
+ else if (validate_unshare_change (insn, &SET_SRC (sets[i].rtl),
+ trial, 0))
{
rtx new_rtx = canon_reg (SET_SRC (sets[i].rtl), insn);
@@ -5600,6 +5617,12 @@ cse_insn (rtx insn)
}
elt = insert (src, classp, sets[i].src_hash, mode);
elt->in_memory = sets[i].src_in_memory;
+ /* If inline asm has any clobbers, ensure we only reuse
+ existing inline asms and never try to put the ASM_OPERANDS
+ into an insn that isn't inline asm. */
+ if (GET_CODE (src) == ASM_OPERANDS
+ && GET_CODE (x) == PARALLEL)
+ elt->cost = MAX_COST;
sets[i].src_elt = classp = elt;
}
if (sets[i].src_const && sets[i].src_const_elt == 0
@@ -5913,6 +5936,9 @@ cse_insn (rtx insn)
}
src_elt = insert (new_src, classp, src_hash, new_mode);
src_elt->in_memory = elt->in_memory;
+ if (GET_CODE (new_src) == ASM_OPERANDS
+ && elt->cost == MAX_COST)
+ src_elt->cost = MAX_COST;
}
else if (classp && classp != src_elt->first_same_value)
/* Show that two things that we've seen before are
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index c42add7f16f..67d03c32d33 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3323,16 +3323,19 @@ this function attribute to make GCC generate the ``hot-patching'' function
prologue used in Win32 API functions in Microsoft Windows XP Service Pack 2
and newer.
-@item hotpatch [(@var{prologue-halfwords})]
+@item hotpatch (@var{halfwords-before-function-label},@var{halfwords-after-function-label})
@cindex @code{hotpatch} attribute
On S/390 System z targets, you can use this function attribute to
-make GCC generate a ``hot-patching'' function prologue. The
-@code{hotpatch} has no effect on funtions that are explicitly
-inline. If the @option{-mhotpatch} or @option{-mno-hotpatch}
-command-line option is used at the same time, the @code{hotpatch}
-attribute takes precedence. If an argument is given, the maximum
-allowed value is 1000000.
+make GCC generate a ``hot-patching'' function prologue. If the
+@option{-mhotpatch=} command-line option is used at the same time,
+the @code{hotpatch} attribute takes precedence. The first of the
+two arguments specifies the number of halfwords to be added before
+the function label. A second argument can be used to specify the
+number of halfwords to be added after the function label. For
+both arguments the maximum allowed value is 1000000.
+
+If both ar guments are zero, hotpatching is disabled.
@item naked
@cindex function without a prologue/epilogue code
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 74418d69597..4e8ce86ba17 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -949,7 +949,7 @@ See RS/6000 and PowerPC Options.
-m64 -m31 -mdebug -mno-debug -mesa -mzarch @gol
-mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd @gol
-mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard @gol
--mhotpatch[=@var{halfwords}] -mno-hotpatch}
+-mhotpatch=@var{halfwords},@var{halfwords}}
@emph{Score Options}
@gccoptlist{-meb -mel @gol
@@ -20371,17 +20371,17 @@ In order to be efficient the extra code makes the assumption that the stack star
at an address aligned to the value given by @var{stack-size}.
The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
-@item -mhotpatch[=@var{halfwords}]
-@itemx -mno-hotpatch
+@item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
@opindex mhotpatch
If the hotpatch option is enabled, a ``hot-patching'' function
prologue is generated for all functions in the compilation unit.
The funtion label is prepended with the given number of two-byte
-Nop instructions (@var{halfwords}, maximum 1000000) or 12 Nop
-instructions if no argument is present. Functions with a
-hot-patching prologue are never inlined automatically, and a
-hot-patching prologue is never generated for functions functions
-that are explicitly inline.
+Nop instructions (@var{pre-halfwords}, maximum 1000000). After
+the label, 2 * @var{post-halfwords} bytes are appended, using the
+larges nop like instructions the architecture allows (maximum
+1000000).
+
+If both arguments are zero, hotpatching is disabled.
This option can be overridden for individual functions with the
@code{hotpatch} attribute.
diff --git a/gcc/dse.c b/gcc/dse.c
index 09dc5df6e93..878fedcec3b 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1549,6 +1549,10 @@ record_store (rtx body, bb_info_t bb_info)
= rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
+ /* get_addr can only handle VALUE but cannot handle expr like:
+ VALUE + OFFSET, so call get_addr to get original addr for
+ mem_addr before plus_constant. */
+ mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
@@ -2166,6 +2170,10 @@ check_mem_read_rtx (rtx *loc, void *data)
= rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
+ /* get_addr can only handle VALUE but cannot handle expr like:
+ VALUE + OFFSET, so call get_addr to get original addr for
+ mem_addr before plus_constant. */
+ mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d48895cde6e..23319d0d17d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4930,7 +4930,7 @@ equate_decl_number_to_die (tree decl, dw_die_ref decl_die)
/* Return how many bits covers PIECE EXPR_LIST. */
-static int
+static HOST_WIDE_INT
decl_piece_bitsize (rtx piece)
{
int ret = (int) GET_MODE (piece);
@@ -4958,7 +4958,7 @@ decl_piece_varloc_ptr (rtx piece)
static rtx
decl_piece_node (rtx loc_note, HOST_WIDE_INT bitsize, rtx next)
{
- if (bitsize <= (int) MAX_MACHINE_MODE)
+ if (bitsize > 0 && bitsize <= (int) MAX_MACHINE_MODE)
return alloc_EXPR_LIST (bitsize, loc_note, next);
else
return alloc_EXPR_LIST (0, gen_rtx_CONCAT (VOIDmode,
@@ -4997,7 +4997,7 @@ adjust_piece_list (rtx *dest, rtx *src, rtx *inner,
HOST_WIDE_INT bitpos, HOST_WIDE_INT piece_bitpos,
HOST_WIDE_INT bitsize, rtx loc_note)
{
- int diff;
+ HOST_WIDE_INT diff;
bool copy = inner != NULL;
if (copy)
@@ -5137,7 +5137,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
{
struct var_loc_node *last = temp->last, *unused = NULL;
rtx *piece_loc = NULL, last_loc_note;
- int piece_bitpos = 0;
+ HOST_WIDE_INT piece_bitpos = 0;
if (last->next)
{
last = last->next;
@@ -5148,7 +5148,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
piece_loc = &last->loc;
do
{
- int cur_bitsize = decl_piece_bitsize (*piece_loc);
+ HOST_WIDE_INT cur_bitsize = decl_piece_bitsize (*piece_loc);
if (piece_bitpos + cur_bitsize > bitpos)
break;
piece_bitpos += cur_bitsize;
@@ -13573,7 +13573,7 @@ static dw_loc_descr_ref
dw_sra_loc_expr (tree decl, rtx loc)
{
rtx p;
- unsigned int padsize = 0;
+ unsigned HOST_WIDE_INT padsize = 0;
dw_loc_descr_ref descr, *descr_tail;
unsigned HOST_WIDE_INT decl_size;
rtx varloc;
@@ -13589,11 +13589,11 @@ dw_sra_loc_expr (tree decl, rtx loc)
for (p = loc; p; p = XEXP (p, 1))
{
- unsigned int bitsize = decl_piece_bitsize (p);
+ unsigned HOST_WIDE_INT bitsize = decl_piece_bitsize (p);
rtx loc_note = *decl_piece_varloc_ptr (p);
dw_loc_descr_ref cur_descr;
dw_loc_descr_ref *tail, last = NULL;
- unsigned int opsize = 0;
+ unsigned HOST_WIDE_INT opsize = 0;
if (loc_note == NULL_RTX
|| NOTE_VAR_LOCATION_LOC (loc_note) == NULL_RTX)
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index 696fef938f1..a8e6452c3f2 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -201,7 +201,7 @@ struct GTY(()) dw_val_node {
/* Locations in memory are described using a sequence of stack machine
operations. */
-struct GTY(()) dw_loc_descr_node {
+struct GTY((chain_next ("%h.dw_loc_next"))) dw_loc_descr_node {
dw_loc_descr_ref dw_loc_next;
ENUM_BITFIELD (dwarf_location_atom) dw_loc_opc : 8;
/* Used to distinguish DW_OP_addr with a direct symbol relocation
diff --git a/gcc/expr.c b/gcc/expr.c
index 6d68d37e95f..8d1844aa886 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9992,7 +9992,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset,
&mode1, &unsignedp, &volatilep, true);
rtx orig_op0, memloc;
- bool mem_attrs_from_type = false;
+ bool clear_mem_expr = false;
/* If we got back the original object, something is wrong. Perhaps
we are evaluating an expression too early. In any event, don't
@@ -10088,7 +10088,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
memloc = assign_temp (TREE_TYPE (tem), 1, 1);
emit_move_insn (memloc, op0);
op0 = memloc;
- mem_attrs_from_type = true;
+ clear_mem_expr = true;
}
if (offset)
@@ -10273,17 +10273,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (op0 == orig_op0)
op0 = copy_rtx (op0);
- /* If op0 is a temporary because of forcing to memory, pass only the
- type to set_mem_attributes so that the original expression is never
- marked as ADDRESSABLE through MEM_EXPR of the temporary. */
- if (mem_attrs_from_type)
- set_mem_attributes (op0, type, 0);
- else
- set_mem_attributes (op0, exp, 0);
+ set_mem_attributes (op0, exp, 0);
if (REG_P (XEXP (op0, 0)))
mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0));
+ /* If op0 is a temporary because the original expressions was forced
+ to memory, clear MEM_EXPR so that the original expression cannot
+ be marked as addressable through MEM_EXPR of the temporary. */
+ if (clear_mem_expr)
+ set_mem_expr (op0, NULL_TREE);
+
MEM_VOLATILE_P (op0) |= volatilep;
if (mode == mode1 || mode1 == BLKmode || mode1 == tmode
|| modifier == EXPAND_CONST_ADDRESS
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3c00314aa72..1685f5e5cb5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,67 @@
+2015-02-03 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * intrinsic.texi (CO_ASSOCIATED): c_prt_1 should be c_ptr_1.
+
+2015-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/62044
+ * resolve.c (resolve_allocate_expr): If the default initializer
+ is NULL, keep the original MOLD expression so that the correct
+ typespec is available.
+
+2015-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/64771
+ * interface.c (check_dummy_characteristics): Fix coarray handling.
+
+2015-01-26 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * class.c (finalize_component): New argument 'sub_ns'. Insert code to
+ check if 'expr' is associated.
+ (generate_finalization_wrapper): Rename 'ptr' symbols to 'ptr1' and
+ 'ptr2'. Pass 'sub_ns' to finalize_component.
+
+2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
+
+ Backport from trunk
+ PR fortran/57023
+ * dependency.c (callback_dummy_intent_not_int): New function.
+ (dummy_intent_not_in): New function.
+ (gfc_full_array_ref_p): Use dummy_intent_not_in.
+
+2015-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/60922
+ * class.c (finalize_component): Apply the check for 'fini_coarray' only
+ to coarray components.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/64528
+ * trans-decl.c (create_function_arglist): Don't set TREE_READONLY
+ on dummy args with VALUE attribute.
+
+2015-01-12 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/63733
+ * interface.c (gfc_extend_expr): Look for type-bound operators before
+ non-typebound ones.
+
+2015-01-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/56867
+ * trans-array.c (gfc_conv_resolve_dependencies): Also check
+ dependencies when there may be substrings of character arrays.
+
2014-12-15 Steven Bosscher <steven@gcc.gnu.org>
PR fortran/61669
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 346aee65205..aee96666ed9 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -828,7 +828,8 @@ comp_is_finalizable (gfc_component *comp)
static void
finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
- gfc_symbol *stat, gfc_symbol *fini_coarray, gfc_code **code)
+ gfc_symbol *stat, gfc_symbol *fini_coarray, gfc_code **code,
+ gfc_namespace *sub_ns)
{
gfc_expr *e;
gfc_ref *ref;
@@ -875,7 +876,7 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
/* Add IF (fini_coarray). */
if (comp->attr.codimension
|| (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
- && CLASS_DATA (comp)->attr.allocatable))
+ && CLASS_DATA (comp)->attr.codimension))
{
block = gfc_get_code (EXEC_IF);
if (*code)
@@ -897,15 +898,32 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
dealloc->ext.alloc.list->expr = e;
dealloc->expr1 = gfc_lval_expr_from_sym (stat);
+ gfc_code *cond = gfc_get_code (EXEC_IF);
+ cond->block = gfc_get_code (EXEC_IF);
+ cond->block->expr1 = gfc_get_expr ();
+ cond->block->expr1->expr_type = EXPR_FUNCTION;
+ gfc_get_sym_tree ("associated", sub_ns, &cond->block->expr1->symtree, false);
+ cond->block->expr1->symtree->n.sym->attr.flavor = FL_PROCEDURE;
+ cond->block->expr1->symtree->n.sym->attr.intrinsic = 1;
+ cond->block->expr1->symtree->n.sym->result = cond->block->expr1->symtree->n.sym;
+ gfc_commit_symbol (cond->block->expr1->symtree->n.sym);
+ cond->block->expr1->ts.type = BT_LOGICAL;
+ cond->block->expr1->ts.kind = gfc_default_logical_kind;
+ cond->block->expr1->value.function.isym = gfc_intrinsic_function_by_id (GFC_ISYM_ASSOCIATED);
+ cond->block->expr1->value.function.actual = gfc_get_actual_arglist ();
+ cond->block->expr1->value.function.actual->expr = gfc_copy_expr (expr);
+ cond->block->expr1->value.function.actual->next = gfc_get_actual_arglist ();
+ cond->block->next = dealloc;
+
if (block)
- block->next = dealloc;
+ block->next = cond;
else if (*code)
{
- (*code)->next = dealloc;
+ (*code)->next = cond;
(*code) = (*code)->next;
}
else
- (*code) = dealloc;
+ (*code) = cond;
}
else if (comp->ts.type == BT_DERIVED
&& comp->ts.u.derived->f2k_derived
@@ -941,7 +959,8 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
gfc_component *c;
for (c = comp->ts.u.derived->components; c; c = c->next)
- finalize_component (e, comp->ts.u.derived, c, stat, fini_coarray, code);
+ finalize_component (e, comp->ts.u.derived, c, stat, fini_coarray, code,
+ sub_ns);
gfc_free_expr (e);
}
}
@@ -1874,7 +1893,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
{
gfc_finalizer *fini, *fini_elem = NULL;
- gfc_get_symbol ("ptr", sub_ns, &ptr);
+ gfc_get_symbol ("ptr1", sub_ns, &ptr);
ptr->ts.type = BT_DERIVED;
ptr->ts.u.derived = derived;
ptr->attr.flavor = FL_VARIABLE;
@@ -1998,7 +2017,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
if (!ptr)
{
- gfc_get_symbol ("ptr", sub_ns, &ptr);
+ gfc_get_symbol ("ptr2", sub_ns, &ptr);
ptr->ts.type = BT_DERIVED;
ptr->ts.u.derived = derived;
ptr->attr.flavor = FL_VARIABLE;
@@ -2047,7 +2066,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
continue;
finalize_component (gfc_lval_expr_from_sym (ptr), derived, comp,
- stat, fini_coarray, &block);
+ stat, fini_coarray, &block, sub_ns);
if (!last_code->block->next)
last_code->block->next = block;
}
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index f9b975ad9c5..3c7d57913c3 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -1848,11 +1848,40 @@ gfc_check_element_vs_element (gfc_ref *lref, gfc_ref *rref, int n)
return GFC_DEP_EQUAL;
}
+/* Callback function for checking if an expression depends on a
+ dummy variable which is any other than INTENT(IN). */
+
+static int
+callback_dummy_intent_not_in (gfc_expr **ep,
+ int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ gfc_expr *e = *ep;
+
+ if (e->expr_type == EXPR_VARIABLE && e->symtree
+ && e->symtree->n.sym->attr.dummy)
+ return e->symtree->n.sym->attr.intent != INTENT_IN;
+ else
+ return 0;
+}
+
+/* Auxiliary function to check if subexpressions have dummy variables which
+ are not intent(in).
+*/
+
+static bool
+dummy_intent_not_in (gfc_expr **ep)
+{
+ return gfc_expr_walker (ep, callback_dummy_intent_not_in, NULL);
+}
/* Determine if an array ref, usually an array section specifies the
entire array. In addition, if the second, pointer argument is
provided, the function will return true if the reference is
- contiguous; eg. (:, 1) gives true but (1,:) gives false. */
+ contiguous; eg. (:, 1) gives true but (1,:) gives false.
+ If one of the bounds depends on a dummy variable which is
+ not INTENT(IN), also return false, because the user may
+ have changed the variable. */
bool
gfc_full_array_ref_p (gfc_ref *ref, bool *contiguous)
@@ -1916,14 +1945,16 @@ gfc_full_array_ref_p (gfc_ref *ref, bool *contiguous)
&& (!ref->u.ar.as
|| !ref->u.ar.as->lower[i]
|| gfc_dep_compare_expr (ref->u.ar.start[i],
- ref->u.ar.as->lower[i])))
+ ref->u.ar.as->lower[i])
+ || dummy_intent_not_in (&ref->u.ar.start[i])))
lbound_OK = false;
/* Check the upper bound. */
if (ref->u.ar.end[i]
&& (!ref->u.ar.as
|| !ref->u.ar.as->upper[i]
|| gfc_dep_compare_expr (ref->u.ar.end[i],
- ref->u.ar.as->upper[i])))
+ ref->u.ar.as->upper[i])
+ || dummy_intent_not_in (&ref->u.ar.end[i])))
ubound_OK = false;
/* Check the stride. */
if (ref->u.ar.stride[i]
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 21af23b7f57..db20475af1e 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1204,8 +1204,15 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
return false;
}
+ if (s1->as->corank != s2->as->corank)
+ {
+ snprintf (errmsg, err_len, "Corank mismatch in argument '%s' (%i/%i)",
+ s1->name, s1->as->corank, s2->as->corank);
+ return false;
+ }
+
if (s1->as->type == AS_EXPLICIT)
- for (i = 0; i < s1->as->rank + s1->as->corank; i++)
+ for (i = 0; i < s1->as->rank + MAX (0, s1->as->corank-1); i++)
{
shape1 = gfc_subtract (gfc_copy_expr (s1->as->upper[i]),
gfc_copy_expr (s1->as->lower[i]));
@@ -1219,8 +1226,12 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
case -1:
case 1:
case -3:
- snprintf (errmsg, err_len, "Shape mismatch in dimension %i of "
- "argument '%s'", i + 1, s1->name);
+ if (i < s1->as->rank)
+ snprintf (errmsg, err_len, "Shape mismatch in dimension %i of"
+ " argument '%s'", i + 1, s1->name);
+ else
+ snprintf (errmsg, err_len, "Shape mismatch in codimension %i "
+ "of argument '%s'", i - s1->as->rank + 1, s1->name);
return false;
case -2:
@@ -3675,6 +3686,8 @@ gfc_extend_expr (gfc_expr *e)
gfc_user_op *uop;
gfc_intrinsic_op i;
const char *gname;
+ gfc_typebound_proc* tbo;
+ gfc_expr* tb_base;
sym = NULL;
@@ -3691,6 +3704,48 @@ gfc_extend_expr (gfc_expr *e)
i = fold_unary_intrinsic (e->value.op.op);
+ /* See if we find a matching type-bound operator. */
+ if (i == INTRINSIC_USER)
+ tbo = matching_typebound_op (&tb_base, actual,
+ i, e->value.op.uop->name, &gname);
+ else
+ switch (i)
+ {
+#define CHECK_OS_COMPARISON(comp) \
+ case INTRINSIC_##comp: \
+ case INTRINSIC_##comp##_OS: \
+ tbo = matching_typebound_op (&tb_base, actual, \
+ INTRINSIC_##comp, NULL, &gname); \
+ if (!tbo) \
+ tbo = matching_typebound_op (&tb_base, actual, \
+ INTRINSIC_##comp##_OS, NULL, &gname); \
+ break;
+ CHECK_OS_COMPARISON(EQ)
+ CHECK_OS_COMPARISON(NE)
+ CHECK_OS_COMPARISON(GT)
+ CHECK_OS_COMPARISON(GE)
+ CHECK_OS_COMPARISON(LT)
+ CHECK_OS_COMPARISON(LE)
+#undef CHECK_OS_COMPARISON
+
+ default:
+ tbo = matching_typebound_op (&tb_base, actual, i, NULL, &gname);
+ break;
+ }
+
+ /* If there is a matching typebound-operator, replace the expression with
+ a call to it and succeed. */
+ if (tbo)
+ {
+ gcc_assert (tb_base);
+ build_compcall_for_operator (e, actual, tb_base, tbo, gname);
+
+ if (!gfc_resolve_expr (e))
+ return MATCH_ERROR;
+ else
+ return MATCH_YES;
+ }
+
if (i == INTRINSIC_USER)
{
for (ns = gfc_current_ns; ns; ns = ns->parent)
@@ -3741,58 +3796,9 @@ gfc_extend_expr (gfc_expr *e)
if (sym == NULL)
{
- gfc_typebound_proc* tbo;
- gfc_expr* tb_base;
-
- /* See if we find a matching type-bound operator. */
- if (i == INTRINSIC_USER)
- tbo = matching_typebound_op (&tb_base, actual,
- i, e->value.op.uop->name, &gname);
- else
- switch (i)
- {
-#define CHECK_OS_COMPARISON(comp) \
- case INTRINSIC_##comp: \
- case INTRINSIC_##comp##_OS: \
- tbo = matching_typebound_op (&tb_base, actual, \
- INTRINSIC_##comp, NULL, &gname); \
- if (!tbo) \
- tbo = matching_typebound_op (&tb_base, actual, \
- INTRINSIC_##comp##_OS, NULL, &gname); \
- break;
- CHECK_OS_COMPARISON(EQ)
- CHECK_OS_COMPARISON(NE)
- CHECK_OS_COMPARISON(GT)
- CHECK_OS_COMPARISON(GE)
- CHECK_OS_COMPARISON(LT)
- CHECK_OS_COMPARISON(LE)
-#undef CHECK_OS_COMPARISON
-
- default:
- tbo = matching_typebound_op (&tb_base, actual, i, NULL, &gname);
- break;
- }
-
- /* If there is a matching typebound-operator, replace the expression with
- a call to it and succeed. */
- if (tbo)
- {
- bool result;
-
- gcc_assert (tb_base);
- build_compcall_for_operator (e, actual, tb_base, tbo, gname);
-
- result = gfc_resolve_expr (e);
- if (!result)
- return MATCH_ERROR;
-
- return MATCH_YES;
- }
-
/* Don't use gfc_free_actual_arglist(). */
free (actual->next);
free (actual);
-
return MATCH_NO;
}
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index eb6924c8176..8d003d6377c 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -2231,7 +2231,7 @@ end program test_btest
@table @asis
@item @emph{Description}:
-@code{C_ASSOCIATED(c_prt_1[, c_ptr_2])} determines the status of the C pointer
+@code{C_ASSOCIATED(c_ptr_1[, c_ptr_2])} determines the status of the C pointer
@var{c_ptr_1} or if @var{c_ptr_1} is associated with the target @var{c_ptr_2}.
@item @emph{Standard}:
@@ -2241,7 +2241,7 @@ Fortran 2003 and later
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = C_ASSOCIATED(c_prt_1[, c_ptr_2])}
+@code{RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a23f6d44cea..54d71763e2c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1815,7 +1815,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
&& sym->ns->proc_name->attr.flavor != FL_MODULE)
{
if (!gfc_notify_std (GFC_STD_F2008, "Internal procedure '%s' is"
- " used as actual argument at %L",
+ " used as actual argument at %L",
sym->name, &e->where))
goto cleanup;
}
@@ -2435,7 +2435,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1,
reason, sizeof(reason), NULL, NULL))
- {
+ {
gfc_error ("Interface mismatch in global procedure '%s' at %L: %s ",
sym->name, &sym->declared_at, reason);
goto done;
@@ -2449,7 +2449,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (sym->attr.if_source != IFSRC_IFBODY)
gfc_procedure_use (def_sym, actual, where);
}
-
+
done:
gfc_errors_to_warnings (0);
@@ -2551,7 +2551,7 @@ generic:
if (intr)
{
- if (!gfc_convert_to_structure_constructor (expr, intr->sym, NULL,
+ if (!gfc_convert_to_structure_constructor (expr, intr->sym, NULL,
NULL, false))
return false;
return resolve_structure_cons (expr, 0);
@@ -2853,7 +2853,7 @@ resolve_function (gfc_expr *expr)
no_formal_args = sym && is_external_proc (sym)
&& gfc_sym_get_dummy_args (sym) == NULL;
- if (!resolve_actual_arglist (expr->value.function.actual,
+ if (!resolve_actual_arglist (expr->value.function.actual,
p, no_formal_args))
{
inquiry_argument = false;
@@ -4122,7 +4122,7 @@ gfc_resolve_index_1 (gfc_expr *index, int check_scalar,
}
if (index->ts.type == BT_REAL)
- if (!gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
+ if (!gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
&index->where))
return false;
@@ -5782,7 +5782,7 @@ resolve_typebound_function (gfc_expr* e)
/* Get the CLASS declared type. */
declared = get_declared_from_expr (&class_ref, &new_ref, e, true);
-
+
if (!resolve_fl_derived (declared))
return false;
@@ -5982,8 +5982,8 @@ resolve_ppc_call (gfc_code* c)
c->ext.actual = c->expr1->value.compcall.actual;
- if (!resolve_actual_arglist (c->ext.actual, comp->attr.proc,
- !(comp->ts.interface
+ if (!resolve_actual_arglist (c->ext.actual, comp->attr.proc,
+ !(comp->ts.interface
&& comp->ts.interface->formal)))
return false;
@@ -6017,8 +6017,8 @@ resolve_expr_ppc (gfc_expr* e)
if (!resolve_ref (e))
return false;
- if (!resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
- !(comp->ts.interface
+ if (!resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
+ !(comp->ts.interface
&& comp->ts.interface->formal)))
return false;
@@ -6230,19 +6230,19 @@ gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
if (!gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable"))
return false;
- if (!gfc_check_vardef_context (iter->var, false, false, own_scope,
+ if (!gfc_check_vardef_context (iter->var, false, false, own_scope,
_("iterator variable")))
return false;
- if (!gfc_resolve_iterator_expr (iter->start, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->start, real_ok,
"Start expression in DO loop"))
return false;
- if (!gfc_resolve_iterator_expr (iter->end, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->end, real_ok,
"End expression in DO loop"))
return false;
- if (!gfc_resolve_iterator_expr (iter->step, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->step, real_ok,
"Step expression in DO loop"))
return false;
@@ -6500,10 +6500,10 @@ resolve_deallocate_expr (gfc_expr *e)
}
if (pointer
- && !gfc_check_vardef_context (e, true, true, false,
+ && !gfc_check_vardef_context (e, true, true, false,
_("DEALLOCATE object")))
return false;
- if (!gfc_check_vardef_context (e, false, true, false,
+ if (!gfc_check_vardef_context (e, false, true, false,
_("DEALLOCATE object")))
return false;
@@ -6853,10 +6853,10 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
e2 = remove_last_array_ref (e);
t = true;
if (t && pointer)
- t = gfc_check_vardef_context (e2, true, true, false,
+ t = gfc_check_vardef_context (e2, true, true, false,
_("ALLOCATE object"));
if (t)
- t = gfc_check_vardef_context (e2, false, true, false,
+ t = gfc_check_vardef_context (e2, false, true, false,
_("ALLOCATE object"));
gfc_free_expr (e2);
if (!t)
@@ -6899,9 +6899,12 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
{
/* Default initialization via MOLD (non-polymorphic). */
gfc_expr *rhs = gfc_default_initializer (&code->expr3->ts);
- gfc_resolve_expr (rhs);
- gfc_free_expr (code->expr3);
- code->expr3 = rhs;
+ if (rhs != NULL)
+ {
+ gfc_resolve_expr (rhs);
+ gfc_free_expr (code->expr3);
+ code->expr3 = rhs;
+ }
}
if (e->ts.type == BT_CLASS && !unlimited && !UNLIMITED_POLY (code->expr3))
@@ -7055,7 +7058,7 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
/* Check the stat variable. */
if (stat)
{
- gfc_check_vardef_context (stat, false, false, false,
+ gfc_check_vardef_context (stat, false, false, false,
_("STAT variable"));
if ((stat->ts.type != BT_INTEGER
@@ -8268,7 +8271,7 @@ resolve_transfer (gfc_code *code)
code->ext.dt may be NULL if the TRANSFER is related to
an INQUIRE statement -- but in this case, we are not reading, either. */
if (code->ext.dt && code->ext.dt->dt_io_kind->value.iokind == M_READ
- && !gfc_check_vardef_context (exp, false, false, false,
+ && !gfc_check_vardef_context (exp, false, false, false,
_("item in READ")))
return;
@@ -8398,7 +8401,7 @@ resolve_lock_unlock (gfc_code *code)
&code->expr2->where);
if (code->expr2
- && !gfc_check_vardef_context (code->expr2, false, false, false,
+ && !gfc_check_vardef_context (code->expr2, false, false, false,
_("STAT variable")))
return;
@@ -8410,7 +8413,7 @@ resolve_lock_unlock (gfc_code *code)
&code->expr3->where);
if (code->expr3
- && !gfc_check_vardef_context (code->expr3, false, false, false,
+ && !gfc_check_vardef_context (code->expr3, false, false, false,
_("ERRMSG variable")))
return;
@@ -8422,7 +8425,7 @@ resolve_lock_unlock (gfc_code *code)
"variable", &code->expr4->where);
if (code->expr4
- && !gfc_check_vardef_context (code->expr4, false, false, false,
+ && !gfc_check_vardef_context (code->expr4, false, false, false,
_("ACQUIRED_LOCK variable")))
return;
}
@@ -9081,7 +9084,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
if (rhs->is_boz
&& !gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
- "a DATA statement and outside INT/REAL/DBLE/CMPLX",
+ "a DATA statement and outside INT/REAL/DBLE/CMPLX",
&code->loc))
return false;
@@ -9882,7 +9885,7 @@ gfc_resolve_code (gfc_code *code, gfc_namespace *ns)
if (!t)
break;
- if (!gfc_check_vardef_context (code->expr1, false, false, false,
+ if (!gfc_check_vardef_context (code->expr1, false, false, false,
_("assignment")))
break;
@@ -10690,7 +10693,7 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
return false;
}
else if (!gfc_notify_std (GFC_STD_F2003, "Scalar object "
- "'%s' at %L may not be ALLOCATABLE",
+ "'%s' at %L may not be ALLOCATABLE",
sym->name, &sym->declared_at))
return false;
}
@@ -11021,8 +11024,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& !gfc_check_symbol_access (arg->sym->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "'%s' is of a PRIVATE type "
"and cannot be a dummy argument"
- " of '%s', which is PUBLIC at %L",
- arg->sym->name, sym->name,
+ " of '%s', which is PUBLIC at %L",
+ arg->sym->name, sym->name,
&sym->declared_at))
{
/* Stop this message from recurring. */
@@ -11044,8 +11047,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
"PUBLIC interface '%s' at %L "
"takes dummy arguments of '%s' which "
- "is PRIVATE", iface->sym->name,
- sym->name, &iface->sym->declared_at,
+ "is PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
@@ -11068,8 +11071,8 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
&& !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
"PUBLIC interface '%s' at %L takes "
"dummy arguments of '%s' which is "
- "PRIVATE", iface->sym->name,
- sym->name, &iface->sym->declared_at,
+ "PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
@@ -11180,7 +11183,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
gfc_formal_arglist *curr_arg;
int has_non_interop_arg = 0;
- if (!verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
+ if (!verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
sym->common_block))
{
/* Clear these to prevent looking at them again if there was an
@@ -12023,7 +12026,7 @@ resolve_typebound_procedures (gfc_symbol* derived)
for (op = 0; op != GFC_INTRINSIC_OPS; ++op)
{
gfc_typebound_proc* p = derived->f2k_derived->tb_op[op];
- if (p && !resolve_typebound_intrinsic_op (derived,
+ if (p && !resolve_typebound_intrinsic_op (derived,
(gfc_intrinsic_op)op, p))
resolve_bindings_result = false;
}
@@ -12475,7 +12478,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
&& !gfc_check_symbol_access (c->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "the component '%s' is a "
"PRIVATE type and cannot be a component of "
- "'%s', which is PUBLIC at %L", c->name,
+ "'%s', which is PUBLIC at %L", c->name,
sym->name, &sym->declared_at))
return false;
@@ -12549,8 +12552,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
&& sym != c->ts.u.derived)
add_dt_to_dt_list (c->ts.u.derived);
- if (!gfc_resolve_array_spec (c->as,
- !(c->attr.pointer || c->attr.proc_pointer
+ if (!gfc_resolve_array_spec (c->as,
+ !(c->attr.pointer || c->attr.proc_pointer
|| c->attr.allocatable)))
return false;
@@ -12599,13 +12602,13 @@ resolve_fl_derived (gfc_symbol *sym)
|| gen_dt->generic->sym->module != gen_dt->generic->next->sym->module)
&& !gfc_notify_std (GFC_STD_F2003, "Generic name '%s' of function "
"'%s' at %L being the same name as derived "
- "type at %L", sym->name,
- gen_dt->generic->sym == sym
- ? gen_dt->generic->next->sym->name
- : gen_dt->generic->sym->name,
- gen_dt->generic->sym == sym
- ? &gen_dt->generic->next->sym->declared_at
- : &gen_dt->generic->sym->declared_at,
+ "type at %L", sym->name,
+ gen_dt->generic->sym == sym
+ ? gen_dt->generic->next->sym->name
+ : gen_dt->generic->sym->name,
+ gen_dt->generic->sym == sym
+ ? &gen_dt->generic->next->sym->declared_at
+ : &gen_dt->generic->sym->declared_at,
&sym->declared_at))
return false;
@@ -12660,13 +12663,13 @@ resolve_fl_namelist (gfc_symbol *sym)
if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SHAPE
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
- "with assumed shape in namelist '%s' at %L",
+ "with assumed shape in namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at))
return false;
if (is_non_constant_shape_array (nl->sym)
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
- "with nonconstant shape in namelist '%s' at %L",
+ "with nonconstant shape in namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at))
return false;
@@ -12675,7 +12678,7 @@ resolve_fl_namelist (gfc_symbol *sym)
|| !gfc_is_constant_expr (nl->sym->ts.u.cl->length))
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' with "
"nonconstant character length in "
- "namelist '%s' at %L", nl->sym->name,
+ "namelist '%s' at %L", nl->sym->name,
sym->name, &sym->declared_at))
return false;
@@ -12695,7 +12698,7 @@ resolve_fl_namelist (gfc_symbol *sym)
{
if (!gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' in "
"namelist '%s' at %L with ALLOCATABLE "
- "or POINTER components", nl->sym->name,
+ "or POINTER components", nl->sym->name,
sym->name, &sym->declared_at))
return false;
@@ -13265,10 +13268,10 @@ resolve_symbol (gfc_symbol *sym)
&& gfc_check_symbol_access (sym)
&& !gfc_check_symbol_access (sym->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "PUBLIC %s '%s' at %L of PRIVATE "
- "derived type '%s'",
- (sym->attr.flavor == FL_PARAMETER)
- ? "parameter" : "variable",
- sym->name, &sym->declared_at,
+ "derived type '%s'",
+ (sym->attr.flavor == FL_PARAMETER)
+ ? "parameter" : "variable",
+ sym->name, &sym->declared_at,
sym->ts.u.derived->name))
return;
@@ -13411,15 +13414,15 @@ resolve_symbol (gfc_symbol *sym)
if (!gfc_logical_kinds[i].c_bool && sym->attr.dummy
&& !gfc_notify_std (GFC_STD_GNU, "LOGICAL dummy argument '%s' at "
"%L with non-C_Bool kind in BIND(C) procedure "
- "'%s'", sym->name, &sym->declared_at,
+ "'%s'", sym->name, &sym->declared_at,
sym->ns->proc_name->name))
return;
else if (!gfc_logical_kinds[i].c_bool
&& !gfc_notify_std (GFC_STD_GNU, "LOGICAL result variable "
"'%s' at %L with non-C_Bool kind in "
- "BIND(C) procedure '%s'", sym->name,
- &sym->declared_at,
- sym->attr.function ? sym->name
+ "BIND(C) procedure '%s'", sym->name,
+ &sym->declared_at,
+ sym->attr.function ? sym->name
: sym->ns->proc_name->name))
return;
}
@@ -14622,7 +14625,7 @@ resolve_types (gfc_namespace *ns)
unsigned letter;
for (letter = 0; letter != GFC_LETTERS; ++letter)
if (ns->set_flag[letter]
- && !resolve_typespec_used (&ns->default_type[letter],
+ && !resolve_typespec_used (&ns->default_type[letter],
&ns->implicit_loc[letter], NULL))
return;
}
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index a36db45c0a7..8e5bea1917a 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4350,6 +4350,13 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
&& ss_expr->rank)
nDepend = gfc_check_dependency (dest_expr, ss_expr, true);
+ /* Check for cases like c(:)(1:2) = c(2)(2:3) */
+ if (!nDepend && dest_expr->rank > 0
+ && dest_expr->ts.type == BT_CHARACTER
+ && ss_expr->expr_type == EXPR_VARIABLE)
+
+ nDepend = gfc_check_dependency (dest_expr, ss_expr, false);
+
continue;
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 2b0667960f3..4b3e89b7910 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -2262,8 +2262,9 @@ create_function_arglist (gfc_symbol * sym)
/* Fill in arg stuff. */
DECL_CONTEXT (parm) = fndecl;
DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
- /* All implementation args are read-only. */
- TREE_READONLY (parm) = 1;
+ /* All implementation args except for VALUE are read-only. */
+ if (!f->sym->attr.value)
+ TREE_READONLY (parm) = 1;
if (POINTER_TYPE_P (type)
&& (!f->sym->attr.proc_pointer
&& f->sym->attr.flavor != FL_PROCEDURE))
diff --git a/gcc/go/gofrontend/export.cc b/gcc/go/gofrontend/export.cc
index 13c61a589fe..e37f03446c1 100644
--- a/gcc/go/gofrontend/export.cc
+++ b/gcc/go/gofrontend/export.cc
@@ -91,6 +91,7 @@ should_export(Named_object* no)
void
Export::export_globals(const std::string& package_name,
+ const std::string& prefix,
const std::string& pkgpath,
int package_priority,
const std::map<std::string, Package*>& imports,
@@ -140,9 +141,18 @@ Export::export_globals(const std::string& package_name,
this->write_string(package_name);
this->write_c_string(";\n");
- // The package path, used for all global symbols.
- this->write_c_string("pkgpath ");
- this->write_string(pkgpath);
+ // The prefix or package path, used for all global symbols.
+ if (prefix.empty())
+ {
+ go_assert(!pkgpath.empty());
+ this->write_c_string("pkgpath ");
+ this->write_string(pkgpath);
+ }
+ else
+ {
+ this->write_c_string("prefix ");
+ this->write_string(prefix);
+ }
this->write_c_string(";\n");
// The package priority.
diff --git a/gcc/go/gofrontend/export.h b/gcc/go/gofrontend/export.h
index c6a4810510a..c010a14686c 100644
--- a/gcc/go/gofrontend/export.h
+++ b/gcc/go/gofrontend/export.h
@@ -117,14 +117,17 @@ class Export : public String_dump
// Export the identifiers in BINDINGS which are marked for export.
// The exporting is done via a series of calls to THIS->STREAM_. If
// is nothing to export, this->stream_->write will not be called.
- // PKGPATH is the package path.
+ // PREFIX is the package prefix. PKGPATH is the package path.
+ // Only one of PREFIX and PKGPATH will be non-empty.
// PACKAGE_PRIORITY is the priority to use for this package.
+ // IMPORTS is the explicitly imported packages.
// IMPORT_INIT_FN is the name of the import initialization function
// for this package; it will be empty if none is needed.
// IMPORTED_INIT_FNS is the list of initialization functions for
// imported packages.
void
export_globals(const std::string& package_name,
+ const std::string& prefix,
const std::string& pkgpath,
int package_priority,
const std::map<std::string, Package*>& imports,
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index f042f64d492..699456dd4ee 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -338,22 +338,28 @@ Gogo::set_package_name(const std::string& package_name,
// Now that we know the name of the package we are compiling, set
// the package path to use for reflect.Type.PkgPath and global
// symbol names.
- if (!this->pkgpath_set_)
+ if (this->pkgpath_set_)
+ this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(this->pkgpath_);
+ else
{
if (!this->prefix_from_option_ && package_name == "main")
- this->pkgpath_ = package_name;
+ {
+ this->pkgpath_ = package_name;
+ this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(package_name);
+ }
else
{
if (!this->prefix_from_option_)
this->prefix_ = "go";
this->pkgpath_ = this->prefix_ + '.' + package_name;
+ this->pkgpath_symbol_ = (Gogo::pkgpath_for_symbol(this->prefix_) + '.'
+ + Gogo::pkgpath_for_symbol(package_name));
}
this->pkgpath_set_ = true;
}
- this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(this->pkgpath_);
-
- this->package_ = this->register_package(this->pkgpath_, location);
+ this->package_ = this->register_package(this->pkgpath_,
+ this->pkgpath_symbol_, location);
this->package_->set_package_name(package_name, location);
if (this->is_main_package())
@@ -656,10 +662,11 @@ Gogo::add_imported_package(const std::string& real_name,
const std::string& alias_arg,
bool is_alias_exported,
const std::string& pkgpath,
+ const std::string& pkgpath_symbol,
Location location,
bool* padd_to_globals)
{
- Package* ret = this->register_package(pkgpath, location);
+ Package* ret = this->register_package(pkgpath, pkgpath_symbol, location);
ret->set_package_name(real_name, location);
*padd_to_globals = false;
@@ -688,10 +695,13 @@ Gogo::add_imported_package(const std::string& real_name,
// Register a package. This package may or may not be imported. This
// returns the Package structure for the package, creating if it
// necessary. LOCATION is the location of the import statement that
-// led us to see this package.
+// led us to see this package. PKGPATH_SYMBOL is the symbol to use
+// for names in the package; it may be the empty string, in which case
+// we either get it later or make a guess when we need it.
Package*
-Gogo::register_package(const std::string& pkgpath, Location location)
+Gogo::register_package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location location)
{
Package* package = NULL;
std::pair<Packages::iterator, bool> ins =
@@ -701,13 +711,15 @@ Gogo::register_package(const std::string& pkgpath, Location location)
// We have seen this package name before.
package = ins.first->second;
go_assert(package != NULL && package->pkgpath() == pkgpath);
+ if (!pkgpath_symbol.empty())
+ package->set_pkgpath_symbol(pkgpath_symbol);
if (Linemap::is_unknown_location(package->location()))
package->set_location(location);
}
else
{
// First time we have seen this package name.
- package = new Package(pkgpath, location);
+ package = new Package(pkgpath, pkgpath_symbol, location);
go_assert(ins.first->second == NULL);
ins.first->second = package;
}
@@ -3424,10 +3436,24 @@ Gogo::do_exports()
// support streaming to a separate file.
Stream_to_section stream;
+ // Write out either the prefix or pkgpath depending on how we were
+ // invoked.
+ std::string prefix;
+ std::string pkgpath;
+ if (this->pkgpath_from_option_)
+ pkgpath = this->pkgpath_;
+ else if (this->prefix_from_option_)
+ prefix = this->prefix_;
+ else if (this->is_main_package())
+ pkgpath = "main";
+ else
+ prefix = "go";
+
Export exp(&stream);
exp.register_builtin_types(this);
exp.export_globals(this->package_name(),
- this->pkgpath(),
+ prefix,
+ pkgpath,
this->package_priority(),
this->imports_,
(this->need_init_fn_ && !this->is_main_package()
@@ -6030,8 +6056,9 @@ Unnamed_label::get_goto(Translate_context* context, Location location)
// Class Package.
-Package::Package(const std::string& pkgpath, Location location)
- : pkgpath_(pkgpath), pkgpath_symbol_(Gogo::pkgpath_for_symbol(pkgpath)),
+Package::Package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location location)
+ : pkgpath_(pkgpath), pkgpath_symbol_(pkgpath_symbol),
package_name_(), bindings_(new Bindings(NULL)), priority_(0),
location_(location), used_(false), is_imported_(false),
uses_sink_alias_(false)
@@ -6055,6 +6082,34 @@ Package::set_package_name(const std::string& package_name, Location location)
package_name.c_str());
}
+// Return the pkgpath symbol, which is a prefix for symbols defined in
+// this package.
+
+std::string
+Package::pkgpath_symbol() const
+{
+ if (this->pkgpath_symbol_.empty())
+ {
+ // In the general case, this is wrong, because the package might
+ // have been compiled with -fprefix. However, it is what we
+ // used to do, so it is no more wrong than we were before.
+ return Gogo::pkgpath_for_symbol(this->pkgpath_);
+ }
+ return this->pkgpath_symbol_;
+}
+
+// Set the package path symbol.
+
+void
+Package::set_pkgpath_symbol(const std::string& pkgpath_symbol)
+{
+ go_assert(!pkgpath_symbol.empty());
+ if (this->pkgpath_symbol_.empty())
+ this->pkgpath_symbol_ = pkgpath_symbol;
+ else
+ go_assert(this->pkgpath_symbol_ == pkgpath_symbol);
+}
+
// Set the priority. We may see multiple priorities for an imported
// package; we want to use the largest one.
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h
index 3f2808781b7..2e378b456c8 100644
--- a/gcc/go/gofrontend/gogo.h
+++ b/gcc/go/gofrontend/gogo.h
@@ -255,6 +255,7 @@ class Gogo
add_imported_package(const std::string& real_name, const std::string& alias,
bool is_alias_exported,
const std::string& pkgpath,
+ const std::string& pkgpath_symbol,
Location location,
bool* padd_to_globals);
@@ -262,7 +263,8 @@ class Gogo
// This returns the Package structure for the package, creating if
// it necessary.
Package*
- register_package(const std::string& pkgpath, Location);
+ register_package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location);
// Start compiling a function. ADD_METHOD_TO_TYPE is true if a
// method function should be added to the type of its receiver.
@@ -2597,7 +2599,8 @@ class Unnamed_label
class Package
{
public:
- Package(const std::string& pkgpath, Location location);
+ Package(const std::string& pkgpath, const std::string& pkgpath_symbol,
+ Location location);
// Get the package path used for all symbols exported from this
// package.
@@ -2606,9 +2609,12 @@ class Package
{ return this->pkgpath_; }
// Return the package path to use for a symbol name.
- const std::string&
- pkgpath_symbol() const
- { return this->pkgpath_symbol_; }
+ std::string
+ pkgpath_symbol() const;
+
+ // Set the package path symbol.
+ void
+ set_pkgpath_symbol(const std::string&);
// Return the location of the import statement.
Location
diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc
index 4913100b5fd..daeb42f7bbe 100644
--- a/gcc/go/gofrontend/import.cc
+++ b/gcc/go/gofrontend/import.cc
@@ -301,23 +301,27 @@ Import::import(Gogo* gogo, const std::string& local_name,
this->require_c_string(";\n");
std::string pkgpath;
+ std::string pkgpath_symbol;
if (this->match_c_string("prefix "))
{
this->advance(7);
std::string unique_prefix = this->read_identifier();
this->require_c_string(";\n");
pkgpath = unique_prefix + '.' + package_name;
+ pkgpath_symbol = (Gogo::pkgpath_for_symbol(unique_prefix) + '.'
+ + Gogo::pkgpath_for_symbol(package_name));
}
else
{
this->require_c_string("pkgpath ");
pkgpath = this->read_identifier();
this->require_c_string(";\n");
+ pkgpath_symbol = Gogo::pkgpath_for_symbol(pkgpath);
}
this->package_ = gogo->add_imported_package(package_name, local_name,
is_local_name_exported,
- pkgpath,
+ pkgpath, pkgpath_symbol,
this->location_,
&this->add_to_globals_);
if (this->package_ == NULL)
@@ -392,7 +396,7 @@ Import::read_one_import()
stream->advance(1);
this->require_c_string("\";\n");
- Package* p = this->gogo_->register_package(pkgpath,
+ Package* p = this->gogo_->register_package(pkgpath, "",
Linemap::unknown_location());
p->set_package_name(package_name, this->location());
}
@@ -649,7 +653,7 @@ Import::read_type()
package = this->package_;
else
{
- package = this->gogo_->register_package(pkgpath,
+ package = this->gogo_->register_package(pkgpath, "",
Linemap::unknown_location());
if (!package_name.empty())
package->set_package_name(package_name, this->location());
diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc
index e7c61f02303..e9409b274b9 100644
--- a/gcc/go/gofrontend/unsafe.cc
+++ b/gcc/go/gofrontend/unsafe.cc
@@ -22,7 +22,7 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported,
bool add_to_globals;
Package* package = this->add_imported_package("unsafe", local_name,
is_local_name_exported,
- "unsafe", location,
+ "unsafe", "unsafe", location,
&add_to_globals);
if (package == NULL)
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 6f68631a12a..a9be22f6572 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -87,7 +87,6 @@ can_remove_node_now_p_1 (struct cgraph_node *node)
the callgraph so references can point to it. */
return (!node->address_taken
&& !ipa_ref_has_aliases_p (&node->ref_list)
- && !node->used_as_abstract_origin
&& cgraph_can_remove_if_no_direct_calls_p (node)
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
@@ -185,6 +184,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
n = cgraph_clone_node (e->callee, e->callee->decl,
e->count, freq_scale, update_original,
vNULL, true, inlining_into, NULL);
+ n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
cgraph_redirect_edge_callee (e, n);
}
}
diff --git a/gcc/ipa.c b/gcc/ipa.c
index ebaa82dbfe4..fe4d0fbf160 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -364,9 +364,17 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
&& DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
- origin_node->used_as_abstract_origin = true;
- enqueue_node (origin_node, &first, reachable);
+ = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ if (origin_node && !origin_node->used_as_abstract_origin)
+ {
+ origin_node->used_as_abstract_origin = true;
+ gcc_assert (!origin_node->prev_sibling_clone);
+ gcc_assert (!origin_node->next_sibling_clone);
+ for (cgraph_node *n = origin_node->clones; n;
+ n = n->next_sibling_clone)
+ if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
+ n->used_as_abstract_origin = true;
+ }
}
/* If any symbol in a comdat group is reachable, force
all externally visible symbols in the same comdat
diff --git a/gcc/jump.c b/gcc/jump.c
index e6dabd05c5c..d41373b9406 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -133,7 +133,30 @@ cleanup_barriers (void)
if (BARRIER_P (prev))
delete_insn (insn);
else if (prev != PREV_INSN (insn))
- reorder_insns_nobb (insn, insn, prev);
+ {
+ basic_block bb = BLOCK_FOR_INSN (prev);
+ rtx end = PREV_INSN (insn);
+ reorder_insns_nobb (insn, insn, prev);
+ if (bb)
+ {
+ /* If the backend called in machine reorg compute_bb_for_insn
+ and didn't free_bb_for_insn again, preserve basic block
+ boundaries. Move the end of basic block to PREV since
+ it is followed by a barrier now, and clear BLOCK_FOR_INSN
+ on the following notes.
+ ??? Maybe the proper solution for the targets that have
+ cfg around after machine reorg is not to run cleanup_barriers
+ pass at all. */
+ BB_END (bb) = prev;
+ do
+ {
+ prev = NEXT_INSN (prev);
+ if (prev != insn && BLOCK_FOR_INSN (prev) == bb)
+ BLOCK_FOR_INSN (prev) = NULL;
+ }
+ while (prev != end);
+ }
+ }
}
}
return 0;
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 173067f65cf..9e6915f39cf 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -793,7 +793,8 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
if (DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ = cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ origin_node->used_as_abstract_origin = true;
add_node_to (encoder, origin_node, true);
}
}
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index ea45e205bb9..f0059be6b5d 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1633,7 +1633,8 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
#pragma omp target data, there is nothing to map for
those. */
if (gimple_omp_target_kind (ctx->stmt) == GF_OMP_TARGET_KIND_DATA
- && !POINTER_TYPE_P (TREE_TYPE (decl)))
+ && !POINTER_TYPE_P (TREE_TYPE (decl))
+ && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c))
break;
}
if (DECL_P (decl))
@@ -11105,9 +11106,11 @@ simd_clone_mangle (struct cgraph_node *node,
}
pp_underscore (&pp);
- pp_string (&pp,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)));
- const char *str = pp_formatted_text (&pp);
+ const char *str = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl));
+ if (*str == '*')
+ ++str;
+ pp_string (&pp, str);
+ str = pp_formatted_text (&pp);
/* If there already is a SIMD clone with the same mangled name, don't
add another one. This can happen e.g. for
diff --git a/gcc/ree.c b/gcc/ree.c
index a3bd5610592..67fc9c3b0fb 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -767,6 +767,17 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
!= REGNO (get_extended_src_reg (SET_SRC (PATTERN (cand->insn)))));
if (copy_needed)
{
+ /* Considering transformation of
+ (set (reg1) (expression))
+ ...
+ (set (reg2) (any_extend (reg1)))
+
+ into
+
+ (set (reg2) (any_extend (expression)))
+ (set (reg1) (reg2))
+ ... */
+
/* In theory we could handle more than one reaching def, it
just makes the code to update the insn stream more complex. */
if (state->defs_list.length () != 1)
@@ -782,18 +793,6 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
if (state->modified[INSN_UID (cand->insn)].kind != EXT_MODIFIED_NONE)
return false;
- /* Transformation of
- (set (reg1) (expression))
- (set (reg2) (any_extend (reg1)))
- into
- (set (reg2) (any_extend (expression)))
- (set (reg1) (reg2))
- is only valid for scalar integral modes, as it relies on the low
- subreg of reg1 to have the value of (expression), which is not true
- e.g. for vector modes. */
- if (!SCALAR_INT_MODE_P (GET_MODE (SET_DEST (PATTERN (cand->insn)))))
- return false;
-
/* There's only one reaching def. */
rtx def_insn = state->defs_list[0];
@@ -1002,6 +1001,7 @@ add_removable_extension (const_rtx expr, rtx insn,
different extension. FIXME: this obviously can be improved. */
for (def = defs; def; def = def->next)
if ((idx = def_map[INSN_UID (DF_REF_INSN (def->ref))])
+ && idx != -1U
&& (cand = &(*insn_list)[idx - 1])
&& cand->code != code)
{
@@ -1013,6 +1013,57 @@ add_removable_extension (const_rtx expr, rtx insn,
}
return;
}
+ /* For vector mode extensions, ensure that all uses of the
+ XEXP (src, 0) register are the same extension (both code
+ and to which mode), as unlike integral extensions lowpart
+ subreg of the sign/zero extended register are not equal
+ to the original register, so we have to change all uses or
+ none. */
+ else if (VECTOR_MODE_P (GET_MODE (XEXP (src, 0))))
+ {
+ if (idx == 0)
+ {
+ struct df_link *ref_chain, *ref_link;
+
+ ref_chain = DF_REF_CHAIN (def->ref);
+ for (ref_link = ref_chain; ref_link; ref_link = ref_link->next)
+ {
+ if (ref_link->ref == NULL
+ || DF_REF_INSN_INFO (ref_link->ref) == NULL)
+ {
+ idx = -1U;
+ break;
+ }
+ rtx use_insn = DF_REF_INSN (ref_link->ref);
+ const_rtx use_set;
+ if (use_insn == insn || DEBUG_INSN_P (use_insn))
+ continue;
+ if (!(use_set = single_set (use_insn))
+ || !REG_P (SET_DEST (use_set))
+ || GET_MODE (SET_DEST (use_set)) != GET_MODE (dest)
+ || GET_CODE (SET_SRC (use_set)) != code
+ || !rtx_equal_p (XEXP (SET_SRC (use_set), 0),
+ XEXP (src, 0)))
+ {
+ idx = -1U;
+ break;
+ }
+ }
+ if (idx == -1U)
+ def_map[INSN_UID (DF_REF_INSN (def->ref))] = idx;
+ }
+ if (idx == -1U)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Cannot eliminate extension:\n");
+ print_rtl_single (dump_file, insn);
+ fprintf (dump_file,
+ " because some vector uses aren't extension\n");
+ }
+ return;
+ }
+ }
/* Then add the candidate to the list and insert the reaching definitions
into the definition map. */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 98fbacce4a2..e99ef7bf772 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -873,6 +873,17 @@ reg_set_between_p (const_rtx reg, const_rtx from_insn, const_rtx to_insn)
int
reg_set_p (const_rtx reg, const_rtx insn)
{
+ /* After delay slot handling, call and branch insns might be in a
+ sequence. Check all the elements there. */
+ if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ {
+ for (int i = 0; i < XVECLEN (PATTERN (insn), 0); ++i)
+ if (reg_set_p (reg, XVECEXP (PATTERN (insn), 0, i)))
+ return true;
+
+ return false;
+ }
+
/* We can be passed an insn or part of one. If we are passed an insn,
check if a side-effect of the insn clobbers REG. */
if (INSN_P (insn)
@@ -884,7 +895,7 @@ reg_set_p (const_rtx reg, const_rtx insn)
GET_MODE (reg), REGNO (reg)))
|| MEM_P (reg)
|| find_reg_fusage (insn, CLOBBER, reg)))))
- return 1;
+ return true;
return set_of (reg, insn) != NULL_RTX;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b56977d37ce..70b3bdd2ada 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,276 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64979
+ * gcc.dg/tree-ssa/stdarg-7.c: New test.
+ * gcc.c-torture/execute/pr64979.c: New test.
+
+2015-02-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-07-24 Marek Polacek <polacek@redhat.com>
+
+ PR c/57653
+ * c-c++-common/pr57653.c: New test.
+ * c-c++-common/pr57653.h: New file.
+ * c-c++-common/pr57653-2.c: New test.
+ * c-c++-common/pr57653-2.h: New file.
+
+2015-02-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * gcc/testsuite/gcc.target/s390/hotpatch-13.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-14.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-15.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-16.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-17.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-18.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-19.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-20.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-10.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-11.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-12.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-13.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-14.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c: New testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-9.c: New
+ testcase.
+ * gcc/testsuite/gcc.target/s390/hotpatch-1.c: Testcase adjusted to
+ new -mhotpatch.
+ * gcc/testsuite/gcc.target/s390/hotpatch-10.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-11.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-12.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-2.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-3.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-4.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-5.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-6.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-7.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-8.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-9.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c: Likewise.
+ * gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c: Likewise.
+
+2015-02-04 Matthias Klose <doko@ubuntu.com>
+
+ Backport from mainline
+ 2015-01-15 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/ipa/pr64068.C: New test.
+ * gcc.dg/ipa/PR64559.c: New test.
+
+2015-02-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64882
+ * gcc.dg/torture/pr64882.c: New test.
+
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add
+ Silvermont, Ivy Bridge, Haswell and Broadwell tests. Update Sandy
+ Bridge test.
+
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/61058
+ * gcc.dg/pr61058.c: New test.
+
+ PR c/64766
+ * gcc.dg/pr64766.c: New test.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64778
+ * gcc.dg/pr64778.c: New test.
+
+ PR middle-end/64421
+ * gcc.dg/vect/pr64421.c: New test.
+
+ 2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/63637
+ PR rtl-optimization/60663
+ * gcc.dg/pr63637-1.c: New test.
+ * gcc.dg/pr63637-2.c: New test.
+ * gcc.dg/pr63637-3.c: New test.
+ * gcc.dg/pr63637-4.c: New test.
+ * gcc.dg/pr63637-5.c: New test.
+ * gcc.dg/pr63637-6.c: New test.
+ * gcc.target/i386/pr63637-1.c: New test.
+ * gcc.target/i386/pr63637-2.c: New test.
+ * gcc.target/i386/pr63637-3.c: New test.
+ * gcc.target/i386/pr63637-4.c: New test.
+ * gcc.target/i386/pr63637-5.c: New test.
+ * gcc.target/i386/pr63637-6.c: New test.
+
+ 2015-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/64663
+ * gcc.dg/pr64663.c: New test.
+
+2015-01-29 Ilya Tocar <ilya.tocar@intel.com>
+
+ * gcc.target/i386/sse-14.c: Test new intrinsic.
+ * gcc.target/i386/sse-22.c: Ditto.
+
+2015-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/62044
+ * gfortran.dg/allocate_with_mold_1.f90: New test
+
+2015-01-27 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * gfortran.dg/class_allocate_18.f90: Remove -fsanitize option to
+ prevent linking errors.
+
+2015-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/64771
+ * gfortran.dg/coarray_36.f: New.
+ * gfortran.dg/coarray_37.f90: New.
+
+2015-01-26 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * gfortran.dg/class_allocate_18.f90: New.
+
+2015-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR testsuite/64712
+ * gnat.dg/unchecked_convert1.adb (Unchecked_Convert1): Initialize A.
+
+2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
+
+ Backport from trunk
+ PR fortran/57023
+ * gfortran.dg/internal_pack_15.f90: New test.
+
+2015-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/60922
+ * gfortran.dg/class_allocate_17.f90: New.
+
+2015-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2014-06-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/61553
+ * c-c++-common/pr61553.c: New test.
+
+2015-01-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * c-c++-common/tsan/tsan_barrier.h: New.
+ * c-c++-common/tsan/atomic_stack.c: Reworked to not depend on sleep.
+ * c-c++-common/tsan/fd_pipe_race.c: Likewise.
+ * c-c++-common/tsan/mutexset1.c: Likewise.
+ * c-c++-common/tsan/race_on_barrier.c: Likewise.
+ * c-c++-common/tsan/race_on_mutex.c: Likewise.
+ * c-c++-common/tsan/race_on_mutex2.c: Likewise.
+ * c-c++-common/tsan/simple_race.c: Likewise.
+ * c-c++-common/tsan/simple_stack.c: Likewise.
+ * c-c++-common/tsan/sleep_sync.c: Likewise.
+ * c-c++-common/tsan/tiny_race.c: Likewise.
+ * c-c++-common/tsan/tls_race.c: Likewise.
+ * c-c++-common/tsan/write_in_reader_lock.c: Likewise.
+ * g++.dg/tsan/atomic_free.C: Likewise.
+ * g++.dg/tsan/atomic_free2.C: Likewise.
+ * g++.dg/tsan/cond_race.C: Likewise.
+ * g++.dg/tsan/tsan_barrier.h: Copied from c-c++-common/tsan.
+
+2015-01-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt47.adb: New test.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64513
+ * gcc.target/i386/pr64513.c: New test.
+
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64286
+ * gcc.target/i386/avx2-pr64286.c: New test.
+
+ PR fortran/64528
+ * gfortran.dg/pr64528.f90: New test.
+
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/64563
+ * gcc.dg/pr64563.c: New test.
+
+2015-01-14 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2015-01-13 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/64391
+ * gcc.dg/tm/pr64391.c: New test.
+
+2015-01-13 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54442
+ * g++.dg/pr54442.C: New file.
+
+2015-01-13 Renlin Li <renlin.li@arm.com>
+
+ Backported from mainline
+ 2014-11-19 Renlin Li <renlin.li@arm.com>
+
+ PR target/63424
+ * gcc.target/aarch64/pr63424.c: New Test.
+
+2015-01-12 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/63733
+ * gfortran.dg/typebound_operator_20.f90: New.
+
+2015-01-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64536
+ * gcc.dg/pr64536.c: New test.
+
+2015-01-09 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline:
+ 2015-01-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/64505
+ * gcc.target/powerpc/pr64505.c: New file to test -m32 -mpowerpc64
+ fix is correct.
+
+2014-01-08 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56867
+ * gfortran.dg/dependency_45.f90: New test.
+
2014-12-15 Steven Bosscher <steven@gcc.gnu.org>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/c-c++-common/pr57653-2.c b/gcc/testsuite/c-c++-common/pr57653-2.c
new file mode 100644
index 00000000000..086f6be5ce1
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr57653-2.c
@@ -0,0 +1,4 @@
+/* { dg-do preprocess } */
+/* { dg-options "-imacros ${srcdir}/c-c++-common/pr57653-2.h" } */
+
+/* Empty. */
diff --git a/gcc/testsuite/c-c++-common/pr57653-2.h b/gcc/testsuite/c-c++-common/pr57653-2.h
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr57653-2.h
@@ -0,0 +1 @@
+
diff --git a/gcc/testsuite/c-c++-common/pr57653.c b/gcc/testsuite/c-c++-common/pr57653.c
new file mode 100644
index 00000000000..620471e2419
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr57653.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-imacros ${srcdir}/c-c++-common/pr57653.h" } */
+
+__attribute__((used)) static const char s[] = F;
+
+/* { dg-final { scan-assembler-not "command-line" } } */
diff --git a/gcc/testsuite/c-c++-common/pr57653.h b/gcc/testsuite/c-c++-common/pr57653.h
new file mode 100644
index 00000000000..5a93388e9fd
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr57653.h
@@ -0,0 +1 @@
+#define F __FILE__
diff --git a/gcc/testsuite/c-c++-common/pr61553.c b/gcc/testsuite/c-c++-common/pr61553.c
new file mode 100644
index 00000000000..8a3b699ee70
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr61553.c
@@ -0,0 +1,8 @@
+/* PR c/61553 */
+/* { dg-do compile } */
+
+void
+foo (char *s)
+{
+ __atomic_store (s, (void *) 0, __ATOMIC_SEQ_CST); /* { dg-error "size mismatch" } */
+}
diff --git a/gcc/testsuite/c-c++-common/tsan/atomic_stack.c b/gcc/testsuite/c-c++-common/tsan/atomic_stack.c
index 6a379512010..746afa7b466 100644
--- a/gcc/testsuite/c-c++-common/tsan/atomic_stack.c
+++ b/gcc/testsuite/c-c++-common/tsan/atomic_stack.c
@@ -1,22 +1,26 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
__atomic_fetch_add(&Global, 1, __ATOMIC_RELAXED);
return NULL;
}
void *Thread2(void *x) {
Global++;
+ barrier_wait(&barrier);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
diff --git a/gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c b/gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c
index 28cd630d2c1..e2176da4b62 100644
--- a/gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c
+++ b/gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c
@@ -1,30 +1,35 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int fds[2];
void *Thread1(void *x) {
write(fds[1], "a", 1);
+ barrier_wait(&barrier);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
close(fds[0]);
close(fds[1]);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pipe(fds);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
+ return 0;
}
/* { dg-output "WARNING: ThreadSanitizer: data race.*\n" } */
diff --git a/gcc/testsuite/c-c++-common/tsan/mutexset1.c b/gcc/testsuite/c-c++-common/tsan/mutexset1.c
index 7c32a8524b4..084f5141dea 100644
--- a/gcc/testsuite/c-c++-common/tsan/mutexset1.c
+++ b/gcc/testsuite/c-c++-common/tsan/mutexset1.c
@@ -1,14 +1,15 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
pthread_mutex_t mtx;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_lock(&mtx);
Global++;
pthread_mutex_unlock(&mtx);
@@ -17,11 +18,13 @@ void *Thread1(void *x) {
void *Thread2(void *x) {
Global--;
+ barrier_wait(&barrier);
return NULL;/* { dg-output ".*" } */
}
int main() {
+ barrier_init(&barrier, 2);
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_barrier.c b/gcc/testsuite/c-c++-common/tsan/race_on_barrier.c
index 0a0e5faba02..3de3ff2257f 100644
--- a/gcc/testsuite/c-c++-common/tsan/race_on_barrier.c
+++ b/gcc/testsuite/c-c++-common/tsan/race_on_barrier.c
@@ -1,26 +1,28 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_barrier_t B;
int Global;
void *Thread1(void *x) {
pthread_barrier_init(&B, 0, 2);
+ barrier_wait(&barrier);
pthread_barrier_wait(&B);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_barrier_wait(&B);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, NULL, Thread1, NULL);
Thread2(0);
diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
index 5dad345d85b..ae30d053c92 100644
--- a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
+++ b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
@@ -1,10 +1,10 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_mutex_t Mtx;
int Global;
@@ -13,11 +13,12 @@ void *Thread1(void *x) {
pthread_mutex_lock(&Mtx);
Global = 42;
pthread_mutex_unlock(&Mtx);
+ barrier_wait(&barrier);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_lock(&Mtx);
Global = 43;
pthread_mutex_unlock(&Mtx);
@@ -25,6 +26,7 @@ void *Thread2(void *x) {
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
@@ -37,7 +39,7 @@ int main() {
/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */
/* { dg-output " Atomic read of size 1 at .* by thread T2:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_mutex_lock.*" } */
-/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:21|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:22|\\?{2}:0) (.*)" } */
/* { dg-output " Previous write of size 1 at .* by thread T1:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_mutex_init .* (.)*" } */
/* { dg-output " #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_mutex2.c b/gcc/testsuite/c-c++-common/tsan/race_on_mutex2.c
index 80a6fb6c0eb..57d7e21e76a 100644
--- a/gcc/testsuite/c-c++-common/tsan/race_on_mutex2.c
+++ b/gcc/testsuite/c-c++-common/tsan/race_on_mutex2.c
@@ -1,22 +1,25 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *x) {
pthread_mutex_lock((pthread_mutex_t*)x);
pthread_mutex_unlock((pthread_mutex_t*)x);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_mutex_t Mtx;
pthread_mutex_init(&Mtx, 0);
pthread_t t;
pthread_create(&t, 0, Thread, &Mtx);
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_destroy(&Mtx);
pthread_join(t, 0);
return 0;
diff --git a/gcc/testsuite/c-c++-common/tsan/simple_race.c b/gcc/testsuite/c-c++-common/tsan/simple_race.c
index a40accd40a2..c1a369b4590 100644
--- a/gcc/testsuite/c-c++-common/tsan/simple_race.c
+++ b/gcc/testsuite/c-c++-common/tsan/simple_race.c
@@ -1,13 +1,15 @@
/* { dg-set-target-env-var TSAN_OPTIONS "halt_on_error=1" } */
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
#include <unistd.h>
+#include "tsan_barrier.h"
-#define MAX_ITERATIONS_NUMBER 100
-#define SLEEP_STEP 128000
+#define MAX_ITERATIONS_NUMBER 1
+#define SLEEP_STEP 128000
+static pthread_barrier_t barrier;
unsigned int delay_time = 1000;
static inline void delay () {
@@ -17,6 +19,7 @@ static inline void delay () {
extern int main_1();
int main() {
+ barrier_init(&barrier, 2);
int i;
for (i = 0; i < MAX_ITERATIONS_NUMBER; i++) {
main_1();
@@ -28,6 +31,7 @@ int main() {
int Global;
void *Thread1(void *x) {
+ barrier_wait(&barrier);
delay();
Global = 42;
return NULL;
@@ -35,6 +39,7 @@ void *Thread1(void *x) {
void *Thread2(void *x) {
Global = 43;
+ barrier_wait(&barrier);
return NULL;
}
diff --git a/gcc/testsuite/c-c++-common/tsan/simple_stack.c b/gcc/testsuite/c-c++-common/tsan/simple_stack.c
index b66a67085ca..a4d0aba6928 100644
--- a/gcc/testsuite/c-c++-common/tsan/simple_stack.c
+++ b/gcc/testsuite/c-c++-common/tsan/simple_stack.c
@@ -1,9 +1,10 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void __attribute__((noinline)) foo1() {
@@ -25,13 +26,14 @@ void __attribute__((noinline)) bar2() {
}
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
bar1();
return NULL;
}
void *Thread2(void *x) {
bar2();
+ barrier_wait(&barrier);
return NULL;
}
@@ -40,6 +42,7 @@ void StartThread(pthread_t *t, void *(*f)(void*)) {
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
StartThread(&t[0], Thread1);
StartThread(&t[1], Thread2);
@@ -50,16 +53,16 @@ int main() {
/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */
/* { dg-output " Write of size 4 at .* by thread T1:(\n|\r\n|\r)" } */
-/* { dg-output " #0 foo1.* .*(simple_stack.c:10|\\?{2}:0) (.*)" } */
-/* { dg-output " #1 bar1.* .*(simple_stack.c:15|\\?{2}:0) (.*)" } */
-/* { dg-output " #2 Thread1.* .*(simple_stack.c:29|\\?{2}:0) (.*)" } */
+/* { dg-output " #0 foo1.* .*(simple_stack.c:11|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 bar1.* .*(simple_stack.c:16|\\?{2}:0) (.*)" } */
+/* { dg-output " #2 Thread1.* .*(simple_stack.c:30|\\?{2}:0) (.*)" } */
/* { dg-output " Previous read of size 4 at .* by thread T2:(\n|\r\n|\r)" } */
-/* { dg-output " #0 foo2.* .*(simple_stack.c:19|\\?{2}:0) (.*)" } */
-/* { dg-output " #1 bar2.* .*(simple_stack.c:24|\\?{2}:0) (.*)" } */
-/* { dg-output " #2 Thread2.* .*(simple_stack.c:34|\\?{2}:0) (.*)" } */
+/* { dg-output " #0 foo2.* .*(simple_stack.c:20|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 bar2.* .*(simple_stack.c:25|\\?{2}:0) (.*)" } */
+/* { dg-output " #2 Thread2.* .*(simple_stack.c:35|\\?{2}:0) (.*)" } */
/* { dg-output " Thread T1 \\(tid=.*, running\\) created by main thread at:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_create .* (.*)" } */
-/* { dg-output " #1 StartThread.* .*(simple_stack.c:39|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */
/* { dg-output " Thread T2 (.*) created by main thread at:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_create .* (.*)" } */
-/* { dg-output " #1 StartThread.* .*(simple_stack.c:39|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */
diff --git a/gcc/testsuite/c-c++-common/tsan/sleep_sync.c b/gcc/testsuite/c-c++-common/tsan/sleep_sync.c
index 44d44554c2e..c681dcef1bf 100644
--- a/gcc/testsuite/c-c++-common/tsan/sleep_sync.c
+++ b/gcc/testsuite/c-c++-common/tsan/sleep_sync.c
@@ -1,8 +1,11 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int X = 0;
void MySleep() {
@@ -10,15 +13,18 @@ void MySleep() {
}
void *Thread(void *p) {
+ barrier_wait(&barrier);
MySleep(); // Assume the main thread has done the write.
X = 42;
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, 0, Thread, 0);
X = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
return 0;
}
diff --git a/gcc/testsuite/c-c++-common/tsan/tiny_race.c b/gcc/testsuite/c-c++-common/tsan/tiny_race.c
index 962497b2821..10a3feb9b33 100644
--- a/gcc/testsuite/c-c++-common/tsan/tiny_race.c
+++ b/gcc/testsuite/c-c++-common/tsan/tiny_race.c
@@ -1,20 +1,24 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
Global = 42;
return x;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, 0, Thread1, 0);
Global = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
return Global;
}
diff --git a/gcc/testsuite/c-c++-common/tsan/tls_race.c b/gcc/testsuite/c-c++-common/tsan/tls_race.c
index 423867e382d..4dd6506043e 100644
--- a/gcc/testsuite/c-c++-common/tsan/tls_race.c
+++ b/gcc/testsuite/c-c++-common/tsan/tls_race.c
@@ -1,18 +1,24 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stddef.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
+ barrier_wait(&barrier);
*(int*)a = 43;
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
static __thread int Var = 42;
pthread_t t;
pthread_create(&t, 0, Thread, &Var);
Var = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
}
diff --git a/gcc/testsuite/c-c++-common/tsan/tsan_barrier.h b/gcc/testsuite/c-c++-common/tsan/tsan_barrier.h
new file mode 100644
index 00000000000..5d37a647585
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/tsan_barrier.h
@@ -0,0 +1,14 @@
+/* TSAN-invisible barriers. Link with -ldl. */
+#include <pthread.h>
+#include <dlfcn.h>
+
+static __typeof(pthread_barrier_wait) *barrier_wait;
+
+static
+void barrier_init (pthread_barrier_t *barrier, unsigned count)
+{
+ void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
+ barrier_wait = (__typeof (pthread_barrier_wait) *)
+ dlsym (h, "pthread_barrier_wait");
+ pthread_barrier_init (barrier, NULL, count);
+}
diff --git a/gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c b/gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c
index 898d23d50b7..df32632bfea 100644
--- a/gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c
+++ b/gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c
@@ -1,8 +1,10 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_rwlock_t rwlock;
int GLOB;
@@ -10,13 +12,14 @@ void *Thread1(void *p) {
(void)p;
pthread_rwlock_rdlock(&rwlock);
// Write under reader lock.
- sleep(1);
+ barrier_wait(&barrier);
GLOB++;
pthread_rwlock_unlock(&rwlock);
return 0;
}
int main(int argc, char *argv[]) {
+ barrier_init(&barrier, 2);
pthread_rwlock_init(&rwlock, NULL);
pthread_rwlock_rdlock(&rwlock);
pthread_t t;
@@ -24,6 +27,7 @@ int main(int argc, char *argv[]) {
volatile int x = GLOB;
(void)x;
pthread_rwlock_unlock(&rwlock);
+ barrier_wait(&barrier);
pthread_join(t, 0);
pthread_rwlock_destroy(&rwlock);
return 0;
diff --git a/gcc/testsuite/g++.dg/cpp0x/override1.C b/gcc/testsuite/g++.dg/cpp0x/override1.C
index e05693fc590..77f6034b835 100644
--- a/gcc/testsuite/g++.dg/cpp0x/override1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/override1.C
@@ -4,8 +4,11 @@ struct B
virtual void f() final {}
virtual void g() {}
virtual void x() const {}
+ virtual void y() final;
};
+void B::y() {} // { dg-error "overriding" }
+
struct B2
{
virtual void h() {}
@@ -14,6 +17,7 @@ struct B2
struct D : B
{
virtual void g() override final {} // { dg-error "overriding" }
+ virtual void y() override final {} // { dg-error "virtual" }
};
template <class T> struct D2 : T
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic165.C b/gcc/testsuite/g++.dg/cpp0x/variadic165.C
new file mode 100644
index 00000000000..862931f6619
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic165.C
@@ -0,0 +1,17 @@
+// PR c++/64514
+// { dg-do compile { target c++11 } }
+
+template<typename... T>
+struct Functor
+{
+ template <T...>
+ struct Inner
+ {};
+};
+
+template struct Functor<>::Inner<>;
+
+int main()
+{
+
+}
diff --git a/gcc/testsuite/g++.dg/ipa/pr64068.C b/gcc/testsuite/g++.dg/ipa/pr64068.C
new file mode 100644
index 00000000000..95288836c36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr64068.C
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int PROV_ENUMALGS_EX, PCCRYPT_OID_INFO;
+class A {
+ int m_fn2();
+ virtual bool m_fn1(PCCRYPT_OID_INFO);
+};
+int fn1();
+void fn2();
+int A::m_fn2() { m_fn1(0); }
+
+bool fn3() {
+ for (;;) {
+ if (fn1()) {
+ if (fn1() != 259)
+ fn2();
+ break;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+class B {
+public:
+ B() { fn3(); }
+};
+class C : A {
+ bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); }
+ int isSupportedByProvider_algId;
+ PROV_ENUMALGS_EX isSupportedByProvider_outEnumAlgs;
+ PROV_ENUMALGS_EX isSupportedByProvider_enumAlgs;
+ bool m_fn3() {
+ while (1) {
+ if (fn1()) {
+ if (fn1() != 259)
+ fn2();
+ break;
+ }
+ if (isSupportedByProvider_algId)
+ isSupportedByProvider_outEnumAlgs = isSupportedByProvider_enumAlgs;
+ return 1;
+ }
+ return 0;
+ }
+};
+
+void fn4() { B(); }
diff --git a/gcc/testsuite/g++.dg/pr54442.C b/gcc/testsuite/g++.dg/pr54442.C
new file mode 100644
index 00000000000..a489565616e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr54442.C
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+struct S
+{
+ void s (int) const throw ();
+ void s (int) throw ();
+};
+
+typedef int index_t;
+
+void (S::*f) (index_t) = &S::s;
+void (S::*g) (index_t) const = &S::s;
diff --git a/gcc/testsuite/g++.dg/template/repo11.C b/gcc/testsuite/g++.dg/template/repo11.C
new file mode 100644
index 00000000000..5cabfd452ed
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/repo11.C
@@ -0,0 +1,31 @@
+// PR c++/64521
+// { dg-options "-frepo -std=c++11" }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+// { dg-final cleanup-repo-files }
+
+template <typename H> struct J { J(H) {} };
+template <unsigned long, typename...> struct K;
+template <unsigned long I> struct K<I> {};
+template <unsigned long I, typename H, typename... T>
+struct K<I, H, T...> : K<I + 1, T...>, J<H> {
+ K(const H &p1, const T &... p2) : K<I + 1, T...>(p2...), J<H>(p1) {}
+};
+template <typename... E> struct C : K<0, E...> {
+ C(const E &... p1) : K<0, E...>(p1...) {}
+};
+template <typename> struct A {
+ A() = default;
+};
+struct M;
+template <typename> struct L {
+ struct B {
+ template <typename> static M *__test(...);
+ typedef A<int> _Del;
+ typedef decltype(__test<_Del>()) type;
+ };
+ C<typename B::type, A<M>> _M_t;
+ L(typename B::type) : _M_t(0, A<M>()) {}
+};
+struct M {};
+int main() { L<int>(new M); }
diff --git a/gcc/testsuite/g++.dg/tsan/atomic_free.C b/gcc/testsuite/g++.dg/tsan/atomic_free.C
index 26d01ae3fdd..20429f159b8 100644
--- a/gcc/testsuite/g++.dg/tsan/atomic_free.C
+++ b/gcc/testsuite/g++.dg/tsan/atomic_free.C
@@ -1,18 +1,23 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
__atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
int *a = new int(0);
pthread_t t;
pthread_create(&t, 0, Thread, a);
- sleep(1);
+ barrier_wait(&barrier);
delete a;
pthread_join(t, 0);
}
diff --git a/gcc/testsuite/g++.dg/tsan/atomic_free2.C b/gcc/testsuite/g++.dg/tsan/atomic_free2.C
index 1fe512cde93..3b6a8e3af99 100644
--- a/gcc/testsuite/g++.dg/tsan/atomic_free2.C
+++ b/gcc/testsuite/g++.dg/tsan/atomic_free2.C
@@ -1,19 +1,24 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
- sleep(1);
+ barrier_wait(&barrier);
__atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
int *a = new int(0);
pthread_t t;
pthread_create(&t, 0, Thread, a);
delete a;
+ barrier_wait(&barrier);
pthread_join(t, 0);
}
diff --git a/gcc/testsuite/g++.dg/tsan/cond_race.C b/gcc/testsuite/g++.dg/tsan/cond_race.C
index a9376147763..d72d0fb54f6 100644
--- a/gcc/testsuite/g++.dg/tsan/cond_race.C
+++ b/gcc/testsuite/g++.dg/tsan/cond_race.C
@@ -1,10 +1,12 @@
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
/* { dg-output "ThreadSanitizer: data race.*" } */
/* { dg-output "pthread_cond_signal.*" } */
-#include <stdio.h>
-#include <stdlib.h>
#include <pthread.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
struct Ctx {
pthread_mutex_t m;
@@ -18,10 +20,12 @@ void *thr(void *p) {
c->done = true;
pthread_mutex_unlock(&c->m);
pthread_cond_signal(&c->c);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
Ctx *c = new Ctx();
pthread_mutex_init(&c->m, 0);
pthread_cond_init(&c->c, 0);
@@ -31,6 +35,7 @@ int main() {
while (!c->done)
pthread_cond_wait(&c->c, &c->m);
pthread_mutex_unlock(&c->m);
+ barrier_wait(&barrier);
delete c;
pthread_join(th, 0);
}
diff --git a/gcc/testsuite/g++.dg/tsan/tsan_barrier.h b/gcc/testsuite/g++.dg/tsan/tsan_barrier.h
new file mode 100644
index 00000000000..5d37a647585
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tsan/tsan_barrier.h
@@ -0,0 +1,14 @@
+/* TSAN-invisible barriers. Link with -ldl. */
+#include <pthread.h>
+#include <dlfcn.h>
+
+static __typeof(pthread_barrier_wait) *barrier_wait;
+
+static
+void barrier_init (pthread_barrier_t *barrier, unsigned count)
+{
+ void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
+ barrier_wait = (__typeof (pthread_barrier_wait) *)
+ dlsym (h, "pthread_barrier_wait");
+ pthread_barrier_init (barrier, NULL, count);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr64979.c b/gcc/testsuite/gcc.c-torture/execute/pr64979.c
new file mode 100644
index 00000000000..ccb46087e02
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr64979.c
@@ -0,0 +1,36 @@
+/* PR target/64979 */
+
+#include <stdarg.h>
+
+void __attribute__((noinline, noclone))
+bar (int x, va_list *ap)
+{
+ if (ap)
+ {
+ int i;
+ for (i = 0; i < 10; i++)
+ if (i != va_arg (*ap, int))
+ __builtin_abort ();
+ if (va_arg (*ap, double) != 0.5)
+ __builtin_abort ();
+ }
+}
+
+void __attribute__((noinline, noclone))
+foo (int x, ...)
+{
+ va_list ap;
+ int n;
+
+ va_start (ap, x);
+ n = va_arg (ap, int);
+ bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
+ va_end (ap);
+}
+
+int
+main ()
+{
+ foo (100, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.5);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/PR64559.c b/gcc/testsuite/gcc.dg/ipa/PR64559.c
new file mode 100644
index 00000000000..463afdc2630
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/PR64559.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int a, b, c, d;
+
+struct S
+{
+ int f0;
+};
+
+static int
+fn1 (int p)
+{
+ return p == 0 || a;
+}
+
+static int
+fn2 ()
+{
+ d = fn1 (c);
+ return 0;
+}
+
+static int
+fn3 (struct S p)
+{
+ p.f0 || fn2 ();
+ if (fn1 (1))
+ b = 0;
+ return 0;
+}
+
+int
+main ()
+{
+ struct S e = { 1 };
+ fn3 (e);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr61058.c b/gcc/testsuite/gcc.dg/pr61058.c
new file mode 100644
index 00000000000..6f840f418fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr61058.c
@@ -0,0 +1,10 @@
+/* PR rtl-optimization/61058 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-additional-options "-fno-asynchronous-unwind-tables -mtune=atom" { target i?86-*-* x86_64-*-* } } */
+
+void
+foo (void)
+{
+ __builtin_unreachable ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr63637-1.c b/gcc/testsuite/gcc.dg/pr63637-1.c
new file mode 100644
index 00000000000..7a716f98c5f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-1.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a));
+ asm ("# Magic instruction" : "=r" (b));
+ asm ("# Magic instruction" : "=r" (c));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
diff --git a/gcc/testsuite/gcc.dg/pr63637-2.c b/gcc/testsuite/gcc.dg/pr63637-2.c
new file mode 100644
index 00000000000..44e9d7c96ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-2.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0));
+ asm ("# Magic instruction" : "=r" (b) : "r" (0));
+ asm ("# Magic instruction" : "=r" (c) : "r" (0));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
diff --git a/gcc/testsuite/gcc.dg/pr63637-3.c b/gcc/testsuite/gcc.dg/pr63637-3.c
new file mode 100644
index 00000000000..51a2ff707e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-3.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "memory");
+ asm ("# Magic instruction" : "=r" (b) : : "memory");
+ asm ("# Magic instruction" : "=r" (c) : : "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/pr63637-4.c b/gcc/testsuite/gcc.dg/pr63637-4.c
new file mode 100644
index 00000000000..1a914830c1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-4.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "memory");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "memory");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/pr63637-5.c b/gcc/testsuite/gcc.dg/pr63637-5.c
new file mode 100644
index 00000000000..fce8593adb4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-5.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d));
+ asm ("# Magic instruction" : "=r" (b), "=r" (e));
+ asm ("# Magic instruction" : "=r" (c), "=r" (f));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/pr63637-6.c b/gcc/testsuite/gcc.dg/pr63637-6.c
new file mode 100644
index 00000000000..1b997c43049
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63637-6.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : "r" (0));
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : "r" (0));
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : "r" (0));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/pr64536.c b/gcc/testsuite/gcc.dg/pr64536.c
new file mode 100644
index 00000000000..9a798299787
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64536.c
@@ -0,0 +1,67 @@
+/* PR rtl-optimization/64536 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fPIC" { target fpic } } */
+
+struct S { long q; } *h;
+long a, b, g, j, k, *c, *d, *e, *f, *i;
+long *baz (void)
+{
+ asm volatile ("" : : : "memory");
+ return e;
+}
+
+void
+bar (int x)
+{
+ int y;
+ for (y = 0; y < x; y++)
+ {
+ switch (b)
+ {
+ case 0:
+ case 2:
+ a++;
+ break;
+ case 3:
+ a++;
+ break;
+ case 1:
+ a++;
+ }
+ if (d)
+ {
+ f = baz ();
+ g = k++;
+ if (&h->q)
+ {
+ j = *f;
+ h->q = *f;
+ }
+ else
+ i = (long *) (h->q = *f);
+ *c++ = (long) f;
+ e += 6;
+ }
+ else
+ {
+ f = baz ();
+ g = k++;
+ if (&h->q)
+ {
+ j = *f;
+ h->q = *f;
+ }
+ else
+ i = (long *) (h->q = *f);
+ *c++ = (long) f;
+ e += 6;
+ }
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr64563.c b/gcc/testsuite/gcc.dg/pr64563.c
new file mode 100644
index 00000000000..7223349c41f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64563.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/64563 */
+/* { dg-do compile } */
+/* { dg-options "-Os -Wtype-limits" } */
+
+int a, b, c, d, f;
+unsigned int e;
+
+void
+foo (void)
+{
+ d = b = (a != (e | 4294967288UL));
+ if (!d)
+ c = f || b;
+}
diff --git a/gcc/testsuite/gcc.dg/pr64663.c b/gcc/testsuite/gcc.dg/pr64663.c
new file mode 100644
index 00000000000..9a0bf0d2330
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64663.c
@@ -0,0 +1,17 @@
+/* PR debug/64663 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -w" } */
+
+void
+foo (void)
+{
+ int a[9];
+ a[-8] = 0;
+}
+
+void
+bar (void)
+{
+ int a[9];
+ a[-9] = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr64766.c b/gcc/testsuite/gcc.dg/pr64766.c
new file mode 100644
index 00000000000..bf6fb2d5905
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64766.c
@@ -0,0 +1,9 @@
+/* PR c/64766 */
+/* { dg-do compile } */
+
+void
+foo ()
+{
+}
+
+void foo () = 0; /* { dg-error "is initialized like a variable|invalid initializer" } */
diff --git a/gcc/testsuite/gcc.dg/pr64778.c b/gcc/testsuite/gcc.dg/pr64778.c
new file mode 100644
index 00000000000..71a2607e79c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64778.c
@@ -0,0 +1,10 @@
+/* PR c/64778 */
+/* { dg-do compile } */
+
+int
+foo (int p)
+{
+ int a;
+ a ^= foo (,); /* { dg-error "expected expression before|too many arguments" } */
+ return a;
+}
diff --git a/gcc/testsuite/gcc.dg/tm/pr64391.c b/gcc/testsuite/gcc.dg/tm/pr64391.c
new file mode 100644
index 00000000000..235118aa363
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/pr64391.c
@@ -0,0 +1,10 @@
+/* PR middle-end/64391 */
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+void
+foo (void)
+{
+#pragma GCC ivdep
+ while (1);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c b/gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c
new file mode 100644
index 00000000000..9b497c07270
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c
@@ -0,0 +1,22 @@
+/* PR target/64979 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+void bar (int x, va_list *ap);
+
+void
+foo (int x, ...)
+{
+ va_list ap;
+ int n;
+
+ va_start (ap, x);
+ n = va_arg (ap, int);
+ bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
+ va_end (ap);
+}
+
+/* { dg-final { scan-tree-dump "foo: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr64421.c b/gcc/testsuite/gcc.dg/vect/pr64421.c
new file mode 100644
index 00000000000..7e48a8bea47
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr64421.c
@@ -0,0 +1,36 @@
+/* PR middle-end/64421 */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#pragma omp declare simd linear (y) notinbranch
+int foo (int x, int y) __asm ("bar");
+
+#pragma omp declare simd linear (y) notinbranch
+int
+foo (int x, int y)
+{
+ return x + y;
+}
+
+int a[1024] = { 1, 2 };
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ #pragma omp simd
+ for (i = 0; i < 1024; i++)
+ a[i] = foo (a[i], i);
+ if (a[0] != 1 || a[1] != 3)
+ abort ();
+ for (i = 2; i < 1024; i++)
+ if (a[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/pr63424.c b/gcc/testsuite/gcc.target/aarch64/pr63424.c
new file mode 100644
index 00000000000..c6bd7626f82
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr63424.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+#include <stdint.h>
+
+uint32_t
+truncate_int (const unsigned long long value)
+{
+ if ( value < 0 )
+ {
+ return 0;
+ }
+ else if ( value > UINT32_MAX )
+ {
+ return UINT32_MAX;
+ }
+ else
+ return (uint32_t)value;
+}
+
+uint32_t
+mul (const unsigned long long x, const unsigned long long y)
+{
+ uint32_t value = truncate_int (x * y);
+ return value;
+}
+
+uint32_t *
+test(unsigned size, uint32_t *a, uint32_t s)
+{
+ unsigned i;
+
+ for (i = 0; i < size; i++)
+ {
+ a[i] = mul (a[i], s);
+ }
+
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx2-pr64286.c b/gcc/testsuite/gcc.target/i386/avx2-pr64286.c
new file mode 100644
index 00000000000..2edb3210c4b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx2-pr64286.c
@@ -0,0 +1,37 @@
+/* PR rtl-optimization/64286 */
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx2" } */
+/* { dg-require-effective-target avx2 } */
+
+#include <string.h>
+#include <stdlib.h>
+#include <x86intrin.h>
+#include "avx2-check.h"
+
+__m128i v;
+__m256i w;
+
+__attribute__((noinline, noclone)) void
+foo (__m128i *p, __m128i *q)
+{
+ __m128i a = _mm_loadu_si128 (p);
+ __m128i b = _mm_xor_si128 (a, v);
+ w = _mm256_cvtepu8_epi16 (a);
+ *q = b;
+}
+
+static void
+avx2_test (void)
+{
+ v = _mm_set1_epi8 (0x40);
+ __m128i c = _mm_set_epi8 (16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ __m128i d;
+ foo (&c, &d);
+ __m128i e = _mm_set_epi8 (0x50, 0x4f, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49,
+ 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41);
+ __m256i f = _mm256_set_epi16 (16, 15, 14, 13, 12, 11, 10, 9,
+ 8, 7, 6, 5, 4, 3, 2, 1);
+ if (memcmp (&w, &f, sizeof (w)) != 0
+ || memcmp (&d, &e, sizeof (d)) != 0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c
index c40983e6b3c..af733380cee 100644
--- a/gcc/testsuite/gcc.target/i386/builtin_target.c
+++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
@@ -30,6 +30,14 @@ check_intel_cpu_model (unsigned int family, unsigned int model,
/* Atom. */
assert (__builtin_cpu_is ("atom"));
break;
+ case 0x37:
+ case 0x4a:
+ case 0x4d:
+ case 0x5a:
+ case 0x5d:
+ /* Silvermont. */
+ assert (__builtin_cpu_is ("silvermont"));
+ break;
case 0x1a:
case 0x1e:
case 0x1f:
@@ -46,10 +54,32 @@ check_intel_cpu_model (unsigned int family, unsigned int model,
assert (__builtin_cpu_is ("westmere"));
break;
case 0x2a:
+ case 0x2d:
/* Sandy Bridge. */
assert (__builtin_cpu_is ("corei7"));
assert (__builtin_cpu_is ("sandybridge"));
break;
+ case 0x3a:
+ case 0x3e:
+ /* Ivy Bridge. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("ivybridge"));
+ break;
+ case 0x3c:
+ case 0x3f:
+ case 0x45:
+ case 0x46:
+ /* Haswell. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("haswell"));
+ break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("broadwell"));
+ break;
case 0x17:
case 0x1d:
/* Penryn. */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-1.c b/gcc/testsuite/gcc.target/i386/pr63637-1.c
new file mode 100644
index 00000000000..9cc9750dd13
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-1.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "eax");
+ asm ("# Magic instruction" : "=r" (b) : : "edx");
+ asm ("# Magic instruction" : "=r" (c) : : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-2.c b/gcc/testsuite/gcc.target/i386/pr63637-2.c
new file mode 100644
index 00000000000..fc549000e8e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-2.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "eax");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "edx");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-3.c b/gcc/testsuite/gcc.target/i386/pr63637-3.c
new file mode 100644
index 00000000000..4b631ce0f81
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-3.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "eax", "memory");
+ asm ("# Magic instruction" : "=r" (b) : : "edx", "memory");
+ asm ("# Magic instruction" : "=r" (c) : : "ecx", "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-4.c b/gcc/testsuite/gcc.target/i386/pr63637-4.c
new file mode 100644
index 00000000000..7b36690bbcf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-4.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "eax", "memory");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "edx", "memory");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "ecx", "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-5.c b/gcc/testsuite/gcc.target/i386/pr63637-5.c
new file mode 100644
index 00000000000..f0c79b76d0a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-5.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : : "eax");
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : : "edx");
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63637-6.c b/gcc/testsuite/gcc.target/i386/pr63637-6.c
new file mode 100644
index 00000000000..4b0b3ba5f4b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr63637-6.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : "r" (0) : "eax");
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : "r" (0) : "edx");
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : "r" (0) : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr64513.c b/gcc/testsuite/gcc.target/i386/pr64513.c
new file mode 100644
index 00000000000..02364960999
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr64513.c
@@ -0,0 +1,17 @@
+/* PR target/64513 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mstack-arg-probe" } */
+
+struct A {};
+struct B { struct A y; };
+int foo (struct A);
+
+int
+bar (int x)
+{
+ struct B b;
+ int c;
+ while (x--)
+ c = foo (b.y);
+ return c;
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c
index d9a5feddaea..ca0745e5232 100644
--- a/gcc/testsuite/gcc.target/i386/sse-14.c
+++ b/gcc/testsuite/gcc.target/i386/sse-14.c
@@ -600,6 +600,8 @@ test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1)
/* emmintrin.h */
test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
+test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
+test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
test_1 (_mm_srli_si128, __m128i, __m128i, 1)
test_1 (_mm_slli_si128, __m128i, __m128i, 1)
test_1 (_mm_extract_epi16, int, __m128i, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index e9f227a2a81..e6a1d31e46d 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -137,6 +137,8 @@ test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA)
#endif
#include <emmintrin.h>
test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
+test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
+test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
test_1 (_mm_srli_si128, __m128i, __m128i, 1)
test_1 (_mm_slli_si128, __m128i, __m128i, 1)
test_1 (_mm_extract_epi16, int, __m128i, 1)
@@ -268,6 +270,8 @@ test_2 ( _mm256_blend_epi16, __m256i, __m256i, __m256i, 1)
test_1 ( _mm256_shuffle_epi32, __m256i, __m256i, 1)
test_1 ( _mm256_shufflehi_epi16, __m256i, __m256i, 1)
test_1 ( _mm256_shufflelo_epi16, __m256i, __m256i, 1)
+test_1 ( _mm256_bslli_epi128, __m256i, __m256i, 8)
+test_1 ( _mm256_bsrli_epi128, __m256i, __m256i, 8)
test_1 ( _mm256_slli_si256, __m256i, __m256i, 8)
test_1 ( _mm256_srli_si256, __m256i, __m256i, 8)
test_2 ( _mm_blend_epi32, __m128i, __m128i, __m128i, 1)
diff --git a/gcc/testsuite/gcc.target/powerpc/pr64505.c b/gcc/testsuite/gcc.target/powerpc/pr64505.c
new file mode 100644
index 00000000000..99916216aee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr64505.c
@@ -0,0 +1,231 @@
+/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
+/* { dg-options "-O2 -mpowerpc64" } */
+
+/*
+ * (below is inlined and simplified from previously included headers)
+ */
+
+struct fltcom_st {
+ short fltbuf[950];
+} fltcom_ __attribute__((common)) ;
+#define CM_PLIBOR (*(((double *)&fltcom_ + 1)))
+#define CM_QMRG (*(((double *)&fltcom_ + 2)))
+
+struct fltcom2_st {
+ short fltbuf2[56];
+} fltcom2_ __attribute__((common)) ;
+#define CM_FLPRV ((short *)&fltcom2_ + 17)
+#define CM_FLNXT ((short *)&fltcom2_ + 20)
+#define CM_FLCPN (*(((double *)&fltcom2_)))
+#define CM_FLCNT (*(((short *)&fltcom2_ + 12)))
+
+struct aidatcm_st {
+ double cm_aid, cm_ext, cm_basis;
+ short cm_aiday, cm_exday, cm_dperd, cm_aiexf, cm_aidex, cm_aiok,
+ cm_aigdo, cm_aildo, cm_prev[3], cm_next[3], cm_aid_pad[2];
+ double cm_rvgfact, cm_ai1st, cm_ai2nd;
+ int cm_aieurok;
+} aidatcm_ __attribute__((common)) ;
+#define CM_EXDAY aidatcm_.cm_exday
+#define CM_BASIS aidatcm_.cm_basis
+#define CM_PREV aidatcm_.cm_prev
+
+struct cshfcm_st {
+ short bufff[10862];
+} cshfcm_ __attribute__((common)) ;
+#define CM_FNUM (*(((short *)&cshfcm_ + 9038)))
+#define CM_FIFLX ((double *)&cshfcm_ + 1)
+#define CM_FEXTX ((double *)&cshfcm_ + 1201)
+#define CM_FSHDT ((short *)&cshfcm_ + 7230)
+
+struct calctsdb_st {
+ short calctsdbbuff[115];
+} calctsdb_ __attribute__((common)) ;
+#define CM_CTUP_GOOD_TO_GO (*(((short *)&calctsdb_ + 16)))
+#define CM_PAYMENT_FREQUENCY (*(((short *)&calctsdb_ + 61)))
+#define CM_DISCOUNTING_DAYTYP (*(((short *)&calctsdb_ + 59)))
+
+struct cf600cm_st {
+ short bufcf[14404];
+} cf600cm_ __attribute__((common)) ;
+#define CM_FLT_RFIXRATES ((double *)&cf600cm_ + 600)
+
+typedef struct { int id; int type; const char *name; } bregdb_bitinfo_t;
+
+int
+bregdb_eval_bbitcxt_bool_rv(const bregdb_bitinfo_t * const bbit,
+ const int bbit_default,
+ const void * const bregucxt);
+
+static const bregdb_bitinfo_t bbit_calc_dr_d33 =
+ { 160667, 5, "bbit_calc_dr_d33" };
+#define bbit_calc_dr_d33__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d33, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_sx_b24 =
+ { 158854, 5, "bbit_calc_sx_b24" };
+#define bbit_calc_sx_b24__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_sx_b24, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_dr_d36 =
+ { 161244, 5, "bbit_calc_dr_d36" };
+#define bbit_calc_dr_d36__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d36, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_dr_d37 =
+ { 161315, 5, "bbit_calc_dr_d37" };
+#define bbit_calc_dr_d37__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d37, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_dr_d47 =
+ { 163259, 5, "bbit_calc_dr_d47" };
+#define bbit_calc_dr_d47__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d47, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_dr_d46 =
+ { 163239, 5, "bbit_calc_dr_d46" };
+#define bbit_calc_dr_d46__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d46, 0, 0)
+static const bregdb_bitinfo_t bbit_calc_dr_d62 =
+ { 166603, 5, "bbit_calc_dr_d62" };
+#define bbit_calc_dr_d62__value() \
+ bregdb_eval_bbitcxt_bool_rv(&bbit_calc_dr_d62, 0, 0)
+
+
+
+int dtyp_is_actact_(short *daytyp);
+double rnd_trunc_numb(double in, short num_digits, short rnd_or_trunc);
+void datetrn_(const short* dt, short* dt2);
+short difday_(short* daytyp_in, short* srtdti, short* enddti, short* ercode);
+
+
+double pow(double x, double y);
+
+
+/*
+ * (above is inlined and simplified from previously included headers)
+ */
+
+
+void calc_1566(
+ short sCalcType,
+ short sDayType,
+ short sFreq,
+ short asSettleDt[3],
+ short asMtyDt[3],
+ short asIssueDt[3],
+ short asFCpnDt[3],
+ double dCpn,
+ short *psNoPer,
+ double *pdExt,
+ double *pdAI,
+ double *pdAI2,
+ double *pdFCpn,
+ short *psRcode)
+{
+
+ short ercode = 0;
+ int isactact;
+ short days_to_next_cpn = 0;
+ const short discDaytype = CM_DISCOUNTING_DAYTYP;
+ int j;
+
+ if(bbit_calc_sx_b24__value())
+ isactact = (dtyp_is_actact_(&sDayType) != 0);
+ else
+ isactact = (sDayType == 1 || sDayType == 10);
+
+ short days_in_current_period = difday_(&sDayType,CM_FLPRV,CM_FLNXT,&ercode);
+ const short sfreq1 = (CM_CTUP_GOOD_TO_GO == 1 && CM_PAYMENT_FREQUENCY == 1);
+
+ for (j = 0; j < CM_FNUM; j++) {
+
+ if(j == 0) {
+ days_to_next_cpn = difday_(&sDayType,asSettleDt,CM_FLNXT,&ercode);
+
+ if(isactact) {
+ CM_FIFLX[j] = CM_FLCPN / sFreq;
+ CM_FEXTX[j] = (double)days_to_next_cpn / (double)days_in_current_period;
+ }
+ else {
+ CM_FIFLX[j] = CM_FLCPN * days_in_current_period;
+ CM_FEXTX[j] = (double)days_to_next_cpn / (double)(1/sfreq1);
+ }
+
+ if(CM_FNUM == 1) {
+ CM_FEXTX[j] = (double)days_to_next_cpn / ((double)1/sfreq1);
+ }
+ }
+ else {
+
+ short days_from_settle, days_in_period;
+
+ if(bbit_calc_dr_d46__value()){
+ days_from_settle = difday_(&sDayType,asSettleDt,
+ &CM_FSHDT[j*3],&ercode);
+ days_in_period = difday_(&sDayType,&CM_FSHDT[(j-1)*3],
+ &CM_FSHDT[j*3],&ercode);
+ }
+
+ double cpn_rate = CM_PLIBOR;
+
+ if(bbit_calc_dr_d62__value()) {
+ if(j < CM_FLCNT && CM_FLT_RFIXRATES[j] != 0) cpn_rate = CM_FLT_RFIXRATES[j];
+ }
+ else {
+ if(j < CM_FLCNT ) cpn_rate = CM_FLT_RFIXRATES[j];
+ }
+
+ if(bbit_calc_dr_d37__value()&& j >= CM_FLCNT && sCalcType == 1570) {
+ cpn_rate = CM_PLIBOR + CM_QMRG;
+
+ if(bbit_calc_dr_d36__value()){
+ double projected_rate = pow((1 + CM_PLIBOR/100.0),
+ (days_in_period)) - 1;
+
+ projected_rate = projected_rate + CM_QMRG/100.0 * days_in_period;
+ cpn_rate = 100 * projected_rate * (1/days_in_period);
+ }
+ }
+
+
+ if(isactact) {
+ CM_FIFLX[j] = cpn_rate / sFreq;
+ CM_FEXTX[j] = CM_FEXTX[j-1] + 1;
+
+ if(bbit_calc_dr_d46__value() && discDaytype != 0) {
+ CM_FEXTX[j] = (double)days_from_settle / (double)(1/sfreq1);
+ }
+ }
+ else {
+ if(!bbit_calc_dr_d46__value()){
+ days_from_settle = difday_(&sDayType,asSettleDt,
+ &CM_FSHDT[j*3],&ercode);
+ days_in_period = difday_(&sDayType,&CM_FSHDT[(j-1)*3],
+ &CM_FSHDT[j*3],&ercode);
+
+ }
+
+ CM_FIFLX[j] = cpn_rate * days_in_period;
+ CM_FEXTX[j] = (double)days_from_settle / (double)(1/sfreq1);
+ }
+
+ }
+
+ if(bbit_calc_dr_d33__value() && CM_CTUP_GOOD_TO_GO != 0) {
+ CM_FIFLX[j] = rnd_trunc_numb (CM_FIFLX[j], 0, 0);
+ }
+
+ }
+
+
+ short accrued_days = difday_(&sDayType,CM_FLPRV,asSettleDt,&ercode);
+
+ if(!bbit_calc_dr_d47__value()) {
+ if(isactact) {
+ *pdAI = (CM_FLCPN / sFreq)* accrued_days / ((double)days_in_current_period);
+ }
+ else{
+ *pdAI = (CM_FLCPN / sFreq)* accrued_days / ((double)1/sFreq);
+ }
+ }
+
+ CM_EXDAY = days_to_next_cpn;
+ CM_BASIS = days_in_current_period;
+ datetrn_(CM_FLPRV,CM_PREV);
+}
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-1.c b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
index b9d6139b080..e7e90585ebb 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-1.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch --save-temps" } */
#include <stdio.h>
@@ -10,11 +10,7 @@ void hp1(void)
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 12 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-10.c b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
index b91b3478ee3..78afb8cc406 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-10.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
@@ -1,21 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mno-hotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,0 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch(2)))
void hp1(void)
{
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 2 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-11.c b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
index 49167734253..d4c577e65af 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-11.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch -mno-hotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1,0 --save-temps" } */
#include <stdio.h>
@@ -10,11 +10,7 @@ void hp1(void)
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-12.c b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
index b3e9427d4e2..cc32e7c3f71 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-12.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mno-hotpatch -mhotpatch=1 --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=999,0 --save-temps" } */
#include <stdio.h>
@@ -10,11 +10,7 @@ void hp1(void)
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 999 } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-13.c b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
new file mode 100644
index 00000000000..8d4adcadf0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
@@ -0,0 +1,17 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch --save-temps" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(1,0)))
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-14.c b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
new file mode 100644
index 00000000000..f1b2325e29c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
@@ -0,0 +1,17 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch --save-temps" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(0,2)))
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-15.c b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
new file mode 100644
index 00000000000..dd158d355eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
@@ -0,0 +1,17 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch --save-temps" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(1,2)))
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
new file mode 100644
index 00000000000..592de2c38d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
@@ -0,0 +1,17 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,0 --save-temps" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(1,2)))
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-17.c b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
new file mode 100644
index 00000000000..a1c94db882a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
@@ -0,0 +1,17 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1,2 --save-temps" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(0,0)))
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-18.c b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
new file mode 100644
index 00000000000..19c5ce35408
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
@@ -0,0 +1,16 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1,2 -mhotpatch=0,0 --save-temps" } */
+
+#include <stdio.h>
+
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-19.c b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
new file mode 100644
index 00000000000..993d04dab94
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
@@ -0,0 +1,23 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1,2 --save-temps" } */
+
+#include <stdio.h>
+
+/* { dg-prune-output "always_inline function might not be inlinable" } */
+__attribute__ ((always_inline))
+static void hp2(void)
+{
+ printf("hello, world!\n");
+}
+
+void hp1(void)
+{
+ hp2();
+}
+
+/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-2.c b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
index 6cc29447de4..af8f59243ef 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-2.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch=1 --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,1 --save-temps" } */
#include <stdio.h>
@@ -10,11 +10,7 @@ void hp1(void)
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-20.c b/gcc/testsuite/gcc.target/s390/hotpatch-20.c
new file mode 100644
index 00000000000..88721391d24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-20.c
@@ -0,0 +1,20 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch --save-temps" } */
+
+#include <stdio.h>
+
+/* { dg-prune-output "always_inline function might not be inlinable" } */
+__attribute__ ((hotpatch(1,2)))
+__attribute__ ((always_inline))
+static void hp2(void)
+{
+ printf("hello, world!\n");
+}
+
+/* { dg-prune-output "called from here" } */
+void hp1(void)
+{
+ hp2();
+}
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-3.c b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
index 9f0b2b756a4..4138d632684 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-3.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch=0 --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,2 --save-temps" } */
#include <stdio.h>
@@ -10,11 +10,7 @@ void hp1(void)
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-4.c b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
index c1dba20a379..afe1ad67383 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-4.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
@@ -1,26 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,3 --save-temps" } */
#include <stdio.h>
-inline void hp1(void)
+void hp1(void)
{
printf("hello, world!\n");
}
-__attribute__ ((always_inline))
-void hp2(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp2' with the 'always_inline' attribute is not hotpatchable" } */
-
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-times "brcl\t\t0,0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-5.c b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
index ec267d65aae..ea3e29ee795 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-5.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
@@ -1,21 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,4 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch))
void hp1(void)
{
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 12 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-times "brcl\t\t0,0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-6.c b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
index 5af090d03a6..e91a2a6ad03 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-6.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
@@ -1,21 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,5 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch(1)))
void hp1(void)
{
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-times "brcl\t\t0,0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-7.c b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
index e73a510b4d6..fe4b069e582 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-7.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
@@ -1,21 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,6 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch(0)))
void hp1(void)
{
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-times "brcl\t\t0,0" 2 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
index 399aa7260b4..8edcfccb62f 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-8.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
@@ -1,28 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mesa -m31 -mhotpatch=0,3 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch))
-inline void hp1(void)
+void hp1(void)
{
printf("hello, world!\n");
}
-__attribute__ ((hotpatch))
-__attribute__ ((always_inline))
-void hp2(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp2' with the 'always_inline' attribute is not hotpatchable" } */
-
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
-/* { dg-final { scan-assembler-not "nop\t0" } } */
+/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
+/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
index 5da675866b3..25b377180d6 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-9.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
@@ -1,21 +1,16 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch=1 --save-temps" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mesa -m31 -mhotpatch=0,4 --save-temps" } */
#include <stdio.h>
-__attribute__ ((hotpatch(2)))
void hp1(void)
{
printf("hello, world!\n");
}
-int main (void)
-{
- return 0;
-}
-
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "nopr\t%r7" 2 } } */
-/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
+/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
+/* { dg-final { scan-assembler-times "nop\t0" 2 } } */
+/* { dg-final { scan-assembler-not "brcl\t\t0,0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c
index 45a2cc5dc20..d88e07eb2d6 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-1.c
@@ -1,27 +1,11 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch" } */
-
-#include <stdio.h>
-
-void hp1(void)
-{
- printf("hello, world!\n");
-}
-
-inline void hp2(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((always_inline))
-void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=-1,0" } */
int main (void)
{
return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-10.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-10.c
new file mode 100644
index 00000000000..7bbdc374e1d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-10.c
@@ -0,0 +1,12 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+__attribute__((hotpatch(0,0,0)))
+int main (void)
+{
+ return 0;
+}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-11.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-11.c
new file mode 100644
index 00000000000..df01230cf55
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-11.c
@@ -0,0 +1,12 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+__attribute__((hotpatch(a,0)))
+int main (void)
+{
+ return 0;
+}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-12.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-12.c
new file mode 100644
index 00000000000..d91e8feb15b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-12.c
@@ -0,0 +1,12 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+__attribute__((hotpatch(0,a)))
+int main (void)
+{
+ return 0;
+}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-13.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-13.c
new file mode 100644
index 00000000000..72f13a04428
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-13.c
@@ -0,0 +1,29 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1000000,1000000" } */
+
+#include <stdio.h>
+
+void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(1000000,1000000)))
+void hp2(void)
+{
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(1000001,1000000)))
+void hp3(void)
+{ /* { dg-error " requested 'hotpatch' attribute is not a comma separated pair" } */
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(1000000,1000001)))
+void hp4(void)
+{ /* { dg-error " requested 'hotpatch' attribute is not a comma separated pair" } */
+ printf("hello, world!\n");
+}
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-14.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-14.c
new file mode 100644
index 00000000000..f3343d33e96
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-14.c
@@ -0,0 +1,11 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=1000001,1000000" } */
+
+viod main(void)
+{
+ return 0;
+}
+
+/* { dg-excess-errors "argument to '-mhotpatch=n,m' is too large" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c
new file mode 100644
index 00000000000..4ce7375a7c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-15.c
@@ -0,0 +1,43 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+/* { dg-prune-output "always_inline function might not be inlinable" } */
+/* { dg-prune-output "called from here" } */
+
+#include <stdio.h>
+
+__attribute__ ((hotpatch(1,2)))
+static void hp1(void)
+{
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(1,2)))
+static inline void hp2(void)
+{
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(0,0)))
+__attribute__ ((always_inline))
+static void hp3(void)
+{
+ printf("hello, world!\n");
+}
+
+__attribute__ ((hotpatch(1,2)))
+__attribute__ ((always_inline))
+static void hp4(void)
+{
+ printf("hello, world!\n");
+}
+
+void main(void)
+{
+ hp1();
+ hp2();
+ hp3();
+ hp4();
+}
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c
new file mode 100644
index 00000000000..3c5c7827206
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c
@@ -0,0 +1,24 @@
+/* A warning will be issued when requesting hotpatching on a nested function. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+typedef int (*fn_t)(void);
+
+fn_t hp1(void)
+{
+ __attribute__((hotpatch(0,0)))
+ int nested1(void)
+ { return 1; }
+
+ return nested1;
+}
+
+fn_t hp2(void)
+{
+ __attribute__ ((hotpatch(1,2)))
+ int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
+ { return 2; }
+
+ return nested2;
+}
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c
index 5947f564f53..95820e493fc 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-2.c
@@ -1,27 +1,11 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch=0" } */
-
-#include <stdio.h>
-
-void hp1(void)
-{
- printf("hello, world!\n");
-}
-
-inline void hp2(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((always_inline))
-void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,-1" } */
int main (void)
{
return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c
index e0c7f6f52c1..bbed9759fbd 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-3.c
@@ -1,27 +1,11 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch=1" } */
-
-#include <stdio.h>
-
-void hp1(void)
-{
- printf("hello, world!\n");
-}
-
-inline void hp2(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((always_inline))
-void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0" } */
int main (void)
{
return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c
index d9f13425adc..4d926594a5c 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-4.c
@@ -1,7 +1,7 @@
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
-/* { dg-options "-O3 -mzarch -mhotpatch=-1" } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,0,0" } */
int main (void)
{
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c
index 53f7eac9e54..46c9004d3e8 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-5.c
@@ -1,28 +1,11 @@
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
-/* { dg-options "-O3 -mzarch -mhotpatch=1000000" } */
-
-#include <stdio.h>
-
-void hp1(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(1000000)))
-void hp2(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(1000001)))
-void hp3(void)
-{ /* { dg-error "requested 'hotpatch' attribute is not a non-negative integer constant or too large .max. 1000000." } */
- printf("hello, world!\n");
-}
+/* { dg-options "-O3 -mzarch -mhotpatch=a,0" } */
int main (void)
{
return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c
index cb10b66f0d3..b28e2055122 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-6.c
@@ -1,11 +1,11 @@
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
-/* { dg-options "-O3 -mzarch -mhotpatch=1000001" } */
+/* { dg-options "-O3 -mzarch -mhotpatch=0,a" } */
int main (void)
{
return 0;
}
-/* { dg-excess-errors "argument to '-mhotpatch=' is too large .max. 1000000." } */
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c
index 98ccb42c003..2080eb1f94a 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-7.c
@@ -1,68 +1,12 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mno-hotpatch" } */
-
-#include <stdio.h>
-
-__attribute__ ((hotpatch))
-void hp1(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch))
-inline void hp2(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch))
-__attribute__ ((always_inline))
-void hp3(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp3' with the 'always_inline' attribute is not hotpatchable" } */
-
-__attribute__ ((hotpatch(0)))
-void hp4(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(0)))
-inline void hp5(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(0)))
-__attribute__ ((always_inline))
-void hp6(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp6' with the 'always_inline' attribute is not hotpatchable" } */
-
-__attribute__ ((hotpatch(1)))
-void hp7(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(1)))
-inline void hp8(void)
-{
- printf("hello, world!\n");
-}
-
-__attribute__ ((hotpatch(1)))
-__attribute__ ((always_inline))
-void hp9(void) /* { dg-warning "always_inline function might not be inlinable" } */
-{
- printf("hello, world!\n");
-} /* { dg-warning "function 'hp9' with the 'always_inline' attribute is not hotpatchable" } */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+__attribute__((hotpatch(-1,0)))
int main (void)
{
return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c
index 489fc5dd9f0..46a38c860c2 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-8.c
@@ -1,23 +1,12 @@
/* Functional tests for the function hotpatching feature. */
-/* { dg-do run } */
-/* { dg-options "-O3 -mzarch -mhotpatch" } */
-
-#include <stdio.h>
-
-int hp1(void)
-{
- int nested1(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
- { return 1; }
-
- __attribute__ ((hotpatch))
- int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
- { return 1; }
-
- return nested1() - nested2();
-}
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+__attribute__((hotpatch(0,-1)))
int main (void)
{
- return hp1();
+ return 0;
}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-9.c
new file mode 100644
index 00000000000..24226eb3547
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-9.c
@@ -0,0 +1,12 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+__attribute__((hotpatch(0)))
+int main (void)
+{
+ return 0;
+}
+
+/* { dg-excess-errors "argument to '-mhotpatch=' should be a non-negative integer" } */
diff --git a/gcc/testsuite/gfortran.dg/allocate_with_mold_1.f90 b/gcc/testsuite/gfortran.dg/allocate_with_mold_1.f90
new file mode 100644
index 00000000000..2ea6d22b452
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_with_mold_1.f90
@@ -0,0 +1,47 @@
+! { dg-do run }
+!
+! Fixes a bug that emerged from the fix of PR62044 - see the PR. When
+! there was no default initializer, code-expr3 was set null and so the
+! vpointer was set to the vtable of the declared type, rather than that
+! of the MOLD expression.
+!
+! Contributed by but based on the original PR62044 testcase by
+! Paul Thomas <pault@gcc.gnu.org>
+!
+module GridImageSilo_Template
+ implicit none
+ type, public, abstract :: GridImageSiloTemplate
+ end type GridImageSiloTemplate
+end module GridImageSilo_Template
+
+module UnstructuredGridImageSilo_Form
+ use GridImageSilo_Template
+ implicit none
+ type, public, extends ( GridImageSiloTemplate ) :: &
+ UnstructuredGridImageSiloForm
+ end type UnstructuredGridImageSiloForm
+end module UnstructuredGridImageSilo_Form
+
+module UnstructuredGridImages
+ use UnstructuredGridImageSilo_Form
+! 5.0 branch contains UnstructuredGridImageForm => UnstructuredGridImageSiloForm
+contains
+ subroutine foo
+ class (GridImageSiloTemplate), allocatable :: a
+ type (UnstructuredGridImageSiloForm) :: b
+ integer :: i = 0
+ allocate (a, mold = b)
+ select type (a)
+ type is (UnstructuredGridImageSiloForm)
+ i = 1
+ class default
+ i = 2
+ end select
+ if (i .ne. 1) call abort
+ end subroutine
+end module UnstructuredGridImages
+
+ use UnstructuredGridImages
+ call foo
+end
+
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_17.f90 b/gcc/testsuite/gfortran.dg/class_allocate_17.f90
new file mode 100644
index 00000000000..639ba80ea60
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_17.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 60922: [4.9/5 regression] Memory leak with allocatable CLASS components
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+program test_leak
+ implicit none
+
+ type d_base_vect_type
+ end type
+
+ type d_vect_type
+ class(d_base_vect_type), allocatable :: v
+ end type
+
+ call test()
+
+contains
+
+ subroutine test()
+ class(d_vect_type), allocatable :: x
+ allocate(x)
+ allocate(x%v)
+ print *,"allocated!"
+ end subroutine
+
+end
+
+! { dg-final { scan-tree-dump-times "fini_coarray" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/class_allocate_18.f90 b/gcc/testsuite/gfortran.dg/class_allocate_18.f90
new file mode 100644
index 00000000000..ad3f76c3083
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_allocate_18.f90
@@ -0,0 +1,21 @@
+! { dg-do run }
+!
+! PR 64230: [4.9/5 Regression] Invalid memory reference in a compiler-generated finalizer for allocatable component
+!
+! Contributed by Mat Cross <mathewc@nag.co.uk>
+
+Program main
+ Implicit None
+ Type :: t1
+ End Type
+ Type, Extends (t1) :: t2
+ Integer, Allocatable :: i
+ End Type
+ Type, Extends (t2) :: t3
+ Integer, Allocatable :: j
+ End Type
+ Class (t1), Allocatable :: t
+ Allocate (t3 :: t)
+ print *,"allocated!"
+ Deallocate (t)
+End
diff --git a/gcc/testsuite/gfortran.dg/coarray_36.f b/gcc/testsuite/gfortran.dg/coarray_36.f
new file mode 100644
index 00000000000..d06a01ec6bc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_36.f
@@ -0,0 +1,347 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+!
+! PR fortran/64771
+!
+! Contributed by Alessandro Fanfarill
+!
+! Reduced version of the full NAS CG benchmark
+!
+
+!-------------------------------------------------------------------------!
+! !
+! N A S P A R A L L E L B E N C H M A R K S 3.3 !
+! !
+! C G !
+! !
+!-------------------------------------------------------------------------!
+! !
+! This benchmark is part of the NAS Parallel Benchmark 3.3 suite. !
+! It is described in NAS Technical Reports 95-020 and 02-007 !
+! !
+! Permission to use, copy, distribute and modify this software !
+! for any purpose with or without fee is hereby granted. We !
+! request, however, that all derived work reference the NAS !
+! Parallel Benchmarks 3.3. This software is provided "as is" !
+! without express or implied warranty. !
+! !
+! Information on NPB 3.3, including the technical report, the !
+! original specifications, source code, results and information !
+! on how to submit new results, is available at: !
+! !
+! http://www.nas.nasa.gov/Software/NPB/ !
+! !
+! Send comments or suggestions to npb@nas.nasa.gov !
+! !
+! NAS Parallel Benchmarks Group !
+! NASA Ames Research Center !
+! Mail Stop: T27A-1 !
+! Moffett Field, CA 94035-1000 !
+! !
+! E-mail: npb@nas.nasa.gov !
+! Fax: (650) 604-3957 !
+! !
+!-------------------------------------------------------------------------!
+
+
+c---------------------------------------------------------------------
+c
+c Authors: M. Yarrow
+c C. Kuszmaul
+c R. F. Van der Wijngaart
+c H. Jin
+c
+c---------------------------------------------------------------------
+
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ program cg
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ implicit none
+
+ integer na, nonzer, niter
+ double precision shift, rcond
+ parameter( na=75000,
+ > nonzer=13,
+ > niter=75,
+ > shift=60.,
+ > rcond=1.0d-1 )
+
+
+
+ integer num_proc_rows, num_proc_cols
+ parameter( num_proc_rows = 2, num_proc_cols = 2)
+ integer num_procs
+ parameter( num_procs = num_proc_cols * num_proc_rows )
+
+ integer nz
+ parameter( nz = na*(nonzer+1)/num_procs*(nonzer+1)+nonzer
+ > + na*(nonzer+2+num_procs/256)/num_proc_cols )
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+
+ common / main_int_mem / colidx, rowstr,
+ > iv, arow, acol
+ integer colidx(nz), rowstr(na+1),
+ > iv(2*na+1), arow(nz), acol(nz)
+
+
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ double precision v(na+1)[0:*], aelt(nz)[0:*], a(nz)[0:*],
+ > x(na/num_proc_rows+2)[0:*],
+ > z(na/num_proc_rows+2)[0:*],
+ > p(na/num_proc_rows+2)[0:*],
+ > q(na/num_proc_rows+2)[0:*],
+ > r(na/num_proc_rows+2)[0:*],
+ > w(na/num_proc_rows+2)[0:*]
+
+
+ common /urando/ amult, tran
+ double precision amult, tran
+
+
+
+ integer l2npcols
+ integer reduce_exch_proc(num_proc_cols)
+ integer reduce_send_starts(num_proc_cols)
+ integer reduce_send_lengths(num_proc_cols)
+ integer reduce_recv_lengths(num_proc_cols)
+ integer reduce_rrecv_starts(num_proc_cols)
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ integer reduce_recv_starts(num_proc_cols)[0:*]
+
+ integer i, j, k, it, me, nprocs, root
+
+ double precision zeta, randlc
+ external randlc
+ double precision rnorm
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ double precision norm_temp1(2)[0:*], norm_temp2(2)[0:*]
+
+ double precision t, tmax, mflops
+ double precision u(1), umax(1)
+ external timer_read
+ double precision timer_read
+ character class
+ logical verified
+ double precision zeta_verify_value, epsilon, err
+
+c---------------------------------------------------------------------
+c Explicit interface for conj_grad, due to coarray args
+c---------------------------------------------------------------------
+ interface
+
+ subroutine conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+ double precision x(*),
+ > z(*),
+ > a(nzz)
+ integer colidx(nzz), rowstr(naa+1)
+
+ double precision p(*),
+ > q(*)[0:*],
+ > r(*)[0:*],
+ > w(*)[0:*] ! used as work temporary
+
+ integer l2npcols
+ integer reduce_exch_proc(l2npcols)
+ integer reduce_send_starts(l2npcols)
+ integer reduce_send_lengths(l2npcols)
+ integer reduce_recv_starts(l2npcols)[0:*]
+ integer reduce_recv_lengths(l2npcols)
+ integer reduce_rrecv_starts(l2npcols)
+
+ double precision rnorm
+
+ end subroutine
+
+ end interface
+
+c---------------------------------------------------------------------
+c The call to the conjugate gradient routine:
+c---------------------------------------------------------------------
+ call conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+
+
+ sync all
+
+ end ! end main
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ subroutine conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+
+c---------------------------------------------------------------------
+c Floaging point arrays here are named as in NPB1 spec discussion of
+c CG algorithm
+c---------------------------------------------------------------------
+
+ implicit none
+
+c include 'cafnpb.h'
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+
+
+ double precision x(*),
+ > z(*),
+ > a(nzz)
+ integer colidx(nzz), rowstr(naa+1)
+
+ double precision p(*),
+ > q(*)[0:*],
+ > r(*)[0:*],
+ > w(*)[0:*] ! used as work temporary
+
+ integer l2npcols
+ integer reduce_exch_proc(l2npcols)
+ integer reduce_send_starts(l2npcols)
+ integer reduce_send_lengths(l2npcols)
+ integer reduce_recv_starts(l2npcols)[0:*]
+ integer reduce_recv_lengths(l2npcols)
+ integer reduce_rrecv_starts(l2npcols)
+
+ integer recv_start_idx, recv_end_idx, send_start_idx,
+ > send_end_idx, recv_length
+
+ integer i, j, k, ierr
+ integer cgit, cgitmax
+
+ double precision, save :: d[0:*], rho[0:*]
+ double precision sum, rho0, alpha, beta, rnorm
+
+ external timer_read
+ double precision timer_read
+
+ data cgitmax / 25 /
+
+
+ return
+ end ! end of routine conj_grad
+
diff --git a/gcc/testsuite/gfortran.dg/coarray_37.f90 b/gcc/testsuite/gfortran.dg/coarray_37.f90
new file mode 100644
index 00000000000..6f56c323d2e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray_37.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+ program cg
+ implicit none
+ integer reduce_recv_starts(2)[1,0:*]
+ interface
+ subroutine conj_grad (reduce_recv_starts) ! { dg-warning "Interface mismatch in global procedure 'conj_grad' at \\(1\\): Corank mismatch in argument 'reduce_recv_starts' \\(2/1\\)" }
+ integer reduce_recv_starts(2)[2, 2:*]
+ end subroutine
+ end interface
+ call conj_grad (reduce_recv_starts) ! Corank mismatch is okay
+ end
+
+ subroutine conj_grad (reduce_recv_starts)
+ implicit none
+ integer reduce_recv_starts(2)[2:*]
+ end
diff --git a/gcc/testsuite/gfortran.dg/dependency_45.f90 b/gcc/testsuite/gfortran.dg/dependency_45.f90
new file mode 100644
index 00000000000..8b43f7507b6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dependency_45.f90
@@ -0,0 +1,12 @@
+! { dg-do run }
+! { dg-options "-Warray-temporaries" }
+! PR 56867 - substrings were not checked for dependency.
+program main
+ character(len=4) :: a
+ character(len=4) :: c(3)
+ c(1) = 'abcd'
+ c(2) = '1234'
+ c(3) = 'wxyz'
+ c(:)(1:2) = c(2)(2:3) ! { dg-warning "array temporary" }
+ if (c(3) .ne. '23yz') call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/internal_pack_15.f90 b/gcc/testsuite/gfortran.dg/internal_pack_15.f90
new file mode 100644
index 00000000000..13e33047e48
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/internal_pack_15.f90
@@ -0,0 +1,77 @@
+! { dg-do run }
+! { dg-options "-Warray-temporaries" }
+! PR 57023
+! This used to cause wrong packing because a(1:n,1:n) was
+! assumed to be a full array.
+module mymod
+ implicit none
+contains
+ subroutine foo1(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n
+ n = n - 1
+ call baz(a(1:n,1:n),n) ! { dg-warning "array temporary" }
+ end subroutine foo1
+
+ subroutine foo2(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n
+ call decrement(n)
+ call baz(a(1:n,1:n),n) ! { dg-warning "array temporary" }
+ end subroutine foo2
+
+ subroutine foo3(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n, m
+ m = n - 1
+ call baz(a(1:m,1:m),m) ! { dg-warning "array temporary" }
+ end subroutine foo3
+
+ subroutine foo4(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer, intent(in) :: n
+ a(1:n,1:n) = 1
+ end subroutine foo4
+
+ subroutine baz(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer, intent(in) :: n
+ a = 1
+ end subroutine baz
+
+ subroutine decrement(n)
+ integer, intent(inout) :: n
+ n = n - 1
+ end subroutine decrement
+
+end module mymod
+
+program main
+ use mymod
+ implicit none
+ integer, dimension(5,5) :: a, b
+ integer :: n
+
+ b = 0
+ b(1:4,1:4) = 1
+
+ n = 5
+ a = 0
+ call foo1(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo2(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo3(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo4(a,n)
+ if (any(a /= 1)) call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/pr64528.f90 b/gcc/testsuite/gfortran.dg/pr64528.f90
new file mode 100644
index 00000000000..f6cca4f73e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr64528.f90
@@ -0,0 +1,20 @@
+! PR fortran/64528
+! { dg-do compile }
+! { dg-options "-O -fno-tree-dce -fno-tree-ccp" }
+
+program pr64528
+ interface
+ subroutine foo(x)
+ integer, value :: x
+ end subroutine foo
+ end interface
+ integer :: x
+ x = 10
+ call foo(x)
+ if(x .ne. 10) then
+ endif
+end program pr64528
+subroutine foo(x)
+ integer, value :: x
+ x = 11
+end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_20.f90 b/gcc/testsuite/gfortran.dg/typebound_operator_20.f90
new file mode 100644
index 00000000000..26c49a188eb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_operator_20.f90
@@ -0,0 +1,53 @@
+! { dg-do run }
+!
+! PR 63733: [4.8/4.9/5 Regression] [OOP] wrong resolution for OPERATOR generics
+!
+! Original test case from Alberto F. Martín Huertas <amartin@cimne.upc.edu>
+! Slightly modified by Salvatore Filippone <sfilippone@uniroma2.it>
+! Further modified by Janus Weil <janus@gcc.gnu.org>
+
+module overwrite
+ type parent
+ contains
+ procedure :: sum => sum_parent
+ generic :: operator(+) => sum
+ end type
+
+ type, extends(parent) :: child
+ contains
+ procedure :: sum => sum_child
+ end type
+
+contains
+
+ integer function sum_parent(op1,op2)
+ implicit none
+ class(parent), intent(in) :: op1, op2
+ sum_parent = 0
+ end function
+
+ integer function sum_child(op1,op2)
+ implicit none
+ class(child) , intent(in) :: op1
+ class(parent), intent(in) :: op2
+ sum_child = 1
+ end function
+
+end module
+
+program drive
+ use overwrite
+ implicit none
+
+ type(parent) :: m1, m2
+ class(parent), pointer :: mres
+ type(child) :: h1, h2
+ class(parent), pointer :: hres
+
+ if (m1 + m2 /= 0) call abort()
+ if (h1 + m2 /= 1) call abort()
+ if (h1%sum(h2) /= 1) call abort()
+
+end
+
+! { dg-final { cleanup-modules "overwrite" } }
diff --git a/gcc/testsuite/gnat.dg/opt47.adb b/gcc/testsuite/gnat.dg/opt47.adb
new file mode 100644
index 00000000000..cfe44eb1e65
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt47.adb
@@ -0,0 +1,31 @@
+-- { dg-do run { target i?86-*-* x86_64-*-* alpha*-*-* ia64-*-* } }
+-- { dg-options "-O2" }
+
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Interfaces; use Interfaces;
+with Ada.Unchecked_Conversion;
+
+procedure Opt47 is
+
+ subtype String4 is String (1 .. 4);
+ function To_String4 is new Ada.Unchecked_Conversion (Unsigned_32, String4);
+ type Arr is array (Integer range <>) of Unsigned_32;
+ Leaf : Arr (1 .. 4) := (1349478766, 1948272498, 1702436946, 1702061409);
+ Value : Unsigned_32;
+ Result : String (1 .. 32);
+ Last : Integer := 0;
+
+begin
+ for I in 1 .. 4 loop
+ Value := Leaf (I);
+ for J in reverse String4'Range loop
+ if Is_Graphic (To_String4 (Value)(J)) then
+ Last := Last + 1;
+ Result (Last) := To_String4 (Value)(J);
+ end if;
+ end loop;
+ end loop;
+ if Result (1) /= 'P' then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/unchecked_convert1.adb b/gcc/testsuite/gnat.dg/unchecked_convert1.adb
index eb63d59a884..1a02c195b7c 100644
--- a/gcc/testsuite/gnat.dg/unchecked_convert1.adb
+++ b/gcc/testsuite/gnat.dg/unchecked_convert1.adb
@@ -4,6 +4,7 @@
with Ada.Unchecked_Conversion;
procedure Unchecked_Convert1 is
+
type Byte is mod 2**8;
type Stream is array (Natural range <>) of Byte;
@@ -24,9 +25,10 @@ procedure Unchecked_Convert1 is
return Do_Sum (To_Chunk (S(S'First .. S'First + Rec'Size / 8 - 1)));
end;
- A : Stream (1..9);
+ A : Stream (1..9) := (others => 0);
I : Integer;
begin
+ A (9) := 1;
I := Sum (A(1..8));
end;
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index fe6dc2886d6..73afb2384ea 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -164,6 +164,9 @@ static void *expand_regions (struct tm_region *,
static tree
get_attrs_for (const_tree x)
{
+ if (x == NULL_TREE)
+ return NULL_TREE;
+
switch (TREE_CODE (x))
{
case FUNCTION_DECL:
@@ -172,16 +175,16 @@ get_attrs_for (const_tree x)
default:
if (TYPE_P (x))
- return NULL;
+ return NULL_TREE;
x = TREE_TYPE (x);
if (TREE_CODE (x) != POINTER_TYPE)
- return NULL;
+ return NULL_TREE;
/* FALLTHRU */
case POINTER_TYPE:
x = TREE_TYPE (x);
if (TREE_CODE (x) != FUNCTION_TYPE && TREE_CODE (x) != METHOD_TYPE)
- return NULL;
+ return NULL_TREE;
/* FALLTHRU */
case FUNCTION_TYPE:
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index feb6eced014..21f77c4285c 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -823,21 +823,22 @@ execute_optimize_stdarg (void)
/* For va_list_simple_ptr, we have to check PHI nodes too. We treat
them as assignments for the purpose of escape analysis. This is
not needed for non-simple va_list because virtual phis don't perform
- any real data movement. */
- if (va_list_simple_ptr)
- {
- tree lhs, rhs;
- use_operand_p uop;
- ssa_op_iter soi;
+ any real data movement. Also, check PHI nodes for taking address of
+ the va_list vars. */
+ tree lhs, rhs;
+ use_operand_p uop;
+ ssa_op_iter soi;
- for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
- {
- gimple phi = gsi_stmt (i);
- lhs = PHI_RESULT (phi);
+ for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
+ {
+ gimple phi = gsi_stmt (i);
+ lhs = PHI_RESULT (phi);
- if (virtual_operand_p (lhs))
- continue;
+ if (virtual_operand_p (lhs))
+ continue;
+ if (va_list_simple_ptr)
+ {
FOR_EACH_PHI_ARG (uop, phi, soi, SSA_OP_USE)
{
rhs = USE_FROM_PTR (uop);
@@ -860,6 +861,22 @@ execute_optimize_stdarg (void)
}
}
}
+
+ for (unsigned j = 0; !va_list_escapes
+ && j < gimple_phi_num_args (phi); ++j)
+ if ((!va_list_simple_ptr
+ || TREE_CODE (gimple_phi_arg_def (phi, j)) != SSA_NAME)
+ && walk_tree (gimple_phi_arg_def_ptr (phi, j),
+ find_va_list_reference, &wi, NULL))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fputs ("va_list escapes in ", dump_file);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
+ fputc ('\n', dump_file);
+ }
+ va_list_escapes = true;
+ }
}
for (i = gsi_start_bb (bb);
@@ -882,8 +899,8 @@ execute_optimize_stdarg (void)
if (is_gimple_assign (stmt))
{
- tree lhs = gimple_assign_lhs (stmt);
- tree rhs = gimple_assign_rhs1 (stmt);
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
if (va_list_simple_ptr)
{
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 57a58b152db..2f93c7e9593 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -7172,7 +7172,7 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt)
tree type = TREE_TYPE (op0);
value_range_t *vr0 = get_value_range (op0);
- if (vr0->type != VR_VARYING
+ if (vr0->type == VR_RANGE
&& INTEGRAL_TYPE_P (type)
&& vrp_val_is_min (vr0->min)
&& vrp_val_is_max (vr0->max)
diff --git a/gcc/tree.c b/gcc/tree.c
index ab95b0909fb..bcd32a395d4 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6215,8 +6215,11 @@ build_qualified_type (tree type, int type_quals)
else if (TYPE_CANONICAL (type) != type)
/* Build the underlying canonical type, since it is different
from TYPE. */
- TYPE_CANONICAL (t) = build_qualified_type (TYPE_CANONICAL (type),
- type_quals);
+ {
+ tree c = build_qualified_type (TYPE_CANONICAL (type),
+ type_quals);
+ TYPE_CANONICAL (t) = TYPE_CANONICAL (c);
+ }
else
/* T is its own canonical type. */
TYPE_CANONICAL (t) = t;
diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog
index 6be97eaa556..de4c8f519fa 100644
--- a/libatomic/ChangeLog
+++ b/libatomic/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-21 Andrew Waterman <waterman@cs.berkeley.edu>
+
+ * fop_n.c (libat_fetch_op): Align address to word boundary.
+ (libat_op_fetch): Likewise.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/libatomic/fop_n.c b/libatomic/fop_n.c
index 4a18da97cc5..9739b9cf4b3 100644
--- a/libatomic/fop_n.c
+++ b/libatomic/fop_n.c
@@ -112,9 +112,9 @@ SIZE(C2(libat_fetch_,NAME)) (UTYPE *mptr, UTYPE opval, int smodel)
pre_barrier (smodel);
- wptr = (UWORD *)mptr;
- shift = 0;
- mask = -1;
+ wptr = (UWORD *)((uintptr_t)mptr & -WORDSIZE);
+ shift = (((uintptr_t)mptr % WORDSIZE) * CHAR_BIT) ^ SIZE(INVERT_MASK);
+ mask = SIZE(MASK) << shift;
wopval = (UWORD)opval << shift;
woldval = __atomic_load_n (wptr, __ATOMIC_RELAXED);
@@ -136,9 +136,9 @@ SIZE(C3(libat_,NAME,_fetch)) (UTYPE *mptr, UTYPE opval, int smodel)
pre_barrier (smodel);
- wptr = (UWORD *)mptr;
- shift = 0;
- mask = -1;
+ wptr = (UWORD *)((uintptr_t)mptr & -WORDSIZE);
+ shift = (((uintptr_t)mptr % WORDSIZE) * CHAR_BIT) ^ SIZE(INVERT_MASK);
+ mask = SIZE(MASK) << shift;
wopval = (UWORD)opval << shift;
woldval = __atomic_load_n (wptr, __ATOMIC_RELAXED);
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index f73ab03b73d..90826b5b4d6 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/libbacktrace/configure b/libbacktrace/configure
index f4f9d058ec8..57a0f940f34 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -614,7 +614,6 @@ PIC_FLAG
WARN_FLAGS
EXTRA_FLAGS
BACKTRACE_FILE
-multi_basedir
OTOOL64
OTOOL
LIPO
@@ -680,6 +679,7 @@ build_os
build_vendor
build_cpu
build
+multi_basedir
target_alias
host_alias
build_alias
@@ -721,6 +721,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_maintainer_mode
with_target_subdir
enable_shared
@@ -729,7 +730,6 @@ with_pic
enable_fast_install
with_gnu_ld
enable_libtool_lock
-enable_multilib
with_system_libunwind
enable_host_shared
'
@@ -1362,6 +1362,7 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-shared[=PKGS] build shared libraries [default=no]
@@ -1369,7 +1370,6 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
- --enable-multilib build many library versions (default)
--enable-host-shared build host code as shared libraries
Optional Packages:
@@ -2453,6 +2453,46 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
+if test -n "${with_target_subdir}"; then
+ # Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+fi
+
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
for ac_t in install-sh install.sh shtool; do
@@ -11089,7 +11129,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11092 "configure"
+#line 11132 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11195,7 +11235,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11198 "configure"
+#line 11238 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11439,43 +11479,6 @@ backtrace_supported=yes
if test -n "${with_target_subdir}"; then
# We are compiling a GCC library. We can assume that the unwind
# library exists.
- # Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
BACKTRACE_FILE="backtrace.lo simple.lo"
else
ac_fn_c_check_header_mongrel "$LINENO" "unwind.h" "ac_cv_header_unwind_h" "$ac_includes_default"
@@ -13174,6 +13177,20 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# INIT-COMMANDS
#
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
@@ -13434,20 +13451,6 @@ fi
-srcdir="$srcdir"
-host="$host"
-target="$target"
-with_multisubdir="$with_multisubdir"
-with_multisrctop="$with_multisrctop"
-with_target_subdir="$with_target_subdir"
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-multi_basedir="$multi_basedir"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="$CC"
-CXX="$CXX"
-GFORTRAN="$GFORTRAN"
-GCJ="$GCJ"
-
GCC="$GCC"
CC="$CC"
acx_cv_header_stdint="$acx_cv_header_stdint"
@@ -13480,8 +13483,8 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"backtrace-supported.h") CONFIG_FILES="$CONFIG_FILES backtrace-supported.h" ;;
@@ -14070,6 +14073,14 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
@@ -14709,14 +14720,6 @@ _LT_EOF
chmod +x "$ofile"
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"gstdint.h":C)
if test "$GCC" = yes; then
echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 878bd2c1580..40b4d547c96 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -34,6 +34,10 @@ AC_INIT(package-unused, version-unused,, libbacktrace)
AC_CONFIG_SRCDIR(backtrace.h)
AC_CONFIG_HEADER(config.h)
+if test -n "${with_target_subdir}"; then
+ AM_ENABLE_MULTILIB(, ..)
+fi
+
AC_CANONICAL_SYSTEM
target_alias=${target_alias-$host_alias}
@@ -83,7 +87,6 @@ backtrace_supported=yes
if test -n "${with_target_subdir}"; then
# We are compiling a GCC library. We can assume that the unwind
# library exists.
- AM_ENABLE_MULTILIB(, ..)
BACKTRACE_FILE="backtrace.lo simple.lo"
else
AC_CHECK_HEADER([unwind.h],
diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
index 2b7bc436797..375085cb345 100644
--- a/libcilkrts/ChangeLog
+++ b/libcilkrts/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/libcilkrts/configure b/libcilkrts/configure
index 0dadbbda035..31f848ec46c 100644
--- a/libcilkrts/configure
+++ b/libcilkrts/configure
@@ -634,7 +634,6 @@ EGREP
GREP
CPP
ALLOCA
-multi_basedir
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
@@ -657,6 +656,7 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
+multi_basedir
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -737,8 +737,8 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_maintainer_mode
-enable_dependency_tracking
enable_multilib
+enable_dependency_tracking
enable_version_specific_runtime_libs
enable_shared
enable_static
@@ -1383,9 +1383,9 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --enable-multilib build many library versions (default)
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
- --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs
Specify that runtime libraries should be installed
in a compi ler-specific directory
@@ -2873,6 +2873,44 @@ fi
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
# Build a DLL on Windows
# AC_LIBTOOL_WIN32_DLL
ac_ext=c
@@ -4217,43 +4255,6 @@ fi
# AC_CONFIG_MACRO_DIR([..])
ac_config_files="$ac_config_files Makefile libcilkrts.spec"
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -11057,7 +11058,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11060 "configure"
+#line 11061 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11163,7 +11164,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11166 "configure"
+#line 11167 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15232,7 +15233,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
srcdir="$srcdir"
host="$host"
@@ -15247,6 +15247,7 @@ CC="$CC"
CXX="$CXX"
GFORTRAN="$GFORTRAN"
GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -15616,10 +15617,10 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
+ "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"libcilkrts.spec") CONFIG_FILES="$CONFIG_FILES libcilkrts.spec" ;;
- "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -16039,6 +16040,14 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
@@ -16134,14 +16143,6 @@ $as_echo X"$file" |
done
}
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
diff --git a/libcilkrts/configure.ac b/libcilkrts/configure.ac
index fb215052dd6..369d94ab2f0 100644
--- a/libcilkrts/configure.ac
+++ b/libcilkrts/configure.ac
@@ -43,6 +43,8 @@ AM_INIT_AUTOMAKE(foreign no-dist)
AM_MAINTAINER_MODE
+AM_ENABLE_MULTILIB(, ..)
+
# Build a DLL on Windows
# AC_LIBTOOL_WIN32_DLL
AC_PROG_CC
@@ -50,7 +52,6 @@ AC_PROG_CXX
# AC_PROG_LIBTOOL
# AC_CONFIG_MACRO_DIR([..])
AC_CONFIG_FILES([Makefile libcilkrts.spec])
-AM_ENABLE_MULTILIB(, ..)
AC_FUNC_ALLOCA
# Check whether the target supports protected visibility.
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index ba651b902db..c67bd863eda 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,33 @@
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/cpuinfo.c (processor_subtypes): Add
+ INTEL_COREI7_BROADWELL.
+ (get_intel_cpu): Support new Silvermont, Haswell and Broadwell
+ model numbers.
+
+2015-01-31 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/linux-atomic.c (__kernel_cmpxchg2): Change declaration of
+ oldval and newval to const void *. Fix typo.
+ (FETCH_AND_OP_2): Use __atomic_load_n to load value.
+ (FETCH_AND_OP_WORD): Likewise.
+ (OP_AND_FETCH_WORD): Likewise.
+ (COMPARE_AND_SWAP_2): Likewise.
+ (__sync_val_compare_and_swap_4): Likewise.
+ (__sync_lock_test_and_set_4): Likewise.
+ (SYNC_LOCK_RELEASE_2): Likewise.
+ Remove support for long long atomic operations.
+
+2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline
+ * config/nios2/linux-unwind.h (nios2_fallback_frame_state):
+ Update rt_sigframe format and address for current Nios II
+ Linux conventions.
+
2014-12-09 John David Anglin <danglin@gcc.gnu.org>
Backport from mainline
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 6ff7502bb9a..7972cedaa11 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -75,6 +75,7 @@ enum processor_subtypes
AMDFAM15H_BDVER4,
INTEL_COREI7_IVYBRIDGE,
INTEL_COREI7_HASWELL,
+ INTEL_COREI7_BROADWELL,
CPU_SUBTYPE_MAX
};
@@ -184,7 +185,10 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id)
__cpu_model.__cpu_type = INTEL_BONNELL;
break;
case 0x37:
+ case 0x4a:
case 0x4d:
+ case 0x5a:
+ case 0x5d:
/* Silvermont. */
__cpu_model.__cpu_type = INTEL_SILVERMONT;
break;
@@ -216,12 +220,20 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id)
__cpu_model.__cpu_subtype = INTEL_COREI7_IVYBRIDGE;
break;
case 0x3c:
+ case 0x3f:
case 0x45:
case 0x46:
/* Haswell. */
__cpu_model.__cpu_type = INTEL_COREI7;
__cpu_model.__cpu_subtype = INTEL_COREI7_HASWELL;
break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ __cpu_model.__cpu_type = INTEL_COREI7;
+ __cpu_model.__cpu_subtype = INTEL_COREI7_BROADWELL;
+ break;
case 0x17:
case 0x1d:
/* Penryn. */
diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
index 92ff1f62982..ba4bd801dee 100644
--- a/libgcc/config/nios2/linux-unwind.h
+++ b/libgcc/config/nios2/linux-unwind.h
@@ -67,10 +67,9 @@ nios2_fallback_frame_state (struct _Unwind_Context *context,
if (pc[0] == (0x00800004 | (__NR_rt_sigreturn << 6)))
{
struct rt_sigframe {
- char retcode[12];
siginfo_t info;
struct nios2_ucontext uc;
- } *rt_ = context->ra;
+ } *rt_ = context->cfa;
struct nios2_mcontext *regs = &rt_->uc.uc_mcontext;
int i;
diff --git a/libgcc/config/pa/linux-atomic.c b/libgcc/config/pa/linux-atomic.c
index 19e37b6f3c4..2554f4607eb 100644
--- a/libgcc/config/pa/linux-atomic.c
+++ b/libgcc/config/pa/linux-atomic.c
@@ -73,7 +73,8 @@ __kernel_cmpxchg (int oldval, int newval, int *mem)
}
static inline long
-__kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size)
+__kernel_cmpxchg2 (const void *oldval, const void *newval, void *mem,
+ int val_size)
{
register unsigned long lws_mem asm("r26") = (unsigned long) (mem);
register long lws_ret asm("r28");
@@ -90,7 +91,7 @@ __kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size)
if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0))
__builtin_trap ();
- /* If the kernel LWS call fails, retrun EBUSY */
+ /* If the kernel LWS call fails, return EBUSY */
if (!lws_errno && lws_ret)
lws_errno = -EBUSY;
@@ -113,7 +114,7 @@ __kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size)
int failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
newval = PFX_OP (tmp INF_OP val); \
failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \
} while (failure != 0); \
@@ -121,13 +122,6 @@ __kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size)
return tmp; \
}
-FETCH_AND_OP_2 (add, , +, long long, 8, 3)
-FETCH_AND_OP_2 (sub, , -, long long, 8, 3)
-FETCH_AND_OP_2 (or, , |, long long, 8, 3)
-FETCH_AND_OP_2 (and, , &, long long, 8, 3)
-FETCH_AND_OP_2 (xor, , ^, long long, 8, 3)
-FETCH_AND_OP_2 (nand, ~, &, long long, 8, 3)
-
FETCH_AND_OP_2 (add, , +, short, 2, 1)
FETCH_AND_OP_2 (sub, , -, short, 2, 1)
FETCH_AND_OP_2 (or, , |, short, 2, 1)
@@ -150,7 +144,7 @@ FETCH_AND_OP_2 (nand, ~, &, signed char, 1, 0)
int failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
newval = PFX_OP (tmp INF_OP val); \
failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \
} while (failure != 0); \
@@ -158,13 +152,6 @@ FETCH_AND_OP_2 (nand, ~, &, signed char, 1, 0)
return PFX_OP (tmp INF_OP val); \
}
-OP_AND_FETCH_2 (add, , +, long long, 8, 3)
-OP_AND_FETCH_2 (sub, , -, long long, 8, 3)
-OP_AND_FETCH_2 (or, , |, long long, 8, 3)
-OP_AND_FETCH_2 (and, , &, long long, 8, 3)
-OP_AND_FETCH_2 (xor, , ^, long long, 8, 3)
-OP_AND_FETCH_2 (nand, ~, &, long long, 8, 3)
-
OP_AND_FETCH_2 (add, , +, short, 2, 1)
OP_AND_FETCH_2 (sub, , -, short, 2, 1)
OP_AND_FETCH_2 (or, , |, short, 2, 1)
@@ -186,7 +173,7 @@ OP_AND_FETCH_2 (nand, ~, &, signed char, 1, 0)
int failure, tmp; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
} while (failure != 0); \
\
@@ -207,7 +194,7 @@ FETCH_AND_OP_WORD (nand, ~, &)
int tmp, failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
} while (failure != 0); \
\
@@ -233,7 +220,7 @@ typedef unsigned char bool;
\
while (1) \
{ \
- actual_oldval = *ptr; \
+ actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
\
if (__builtin_expect (oldval != actual_oldval, 0)) \
return actual_oldval; \
@@ -242,7 +229,7 @@ typedef unsigned char bool;
\
if (__builtin_expect (!fail, 1)) \
return actual_oldval; \
- } \
+ } \
} \
\
bool HIDDEN \
@@ -253,7 +240,6 @@ typedef unsigned char bool;
return (failure != 0); \
}
-COMPARE_AND_SWAP_2 (long long, 8, 3)
COMPARE_AND_SWAP_2 (short, 2, 1)
COMPARE_AND_SWAP_2 (char, 1, 0)
@@ -264,7 +250,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
while (1)
{
- actual_oldval = *ptr;
+ actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST);
if (__builtin_expect (oldval != actual_oldval, 0))
return actual_oldval;
@@ -291,14 +277,13 @@ TYPE HIDDEN \
int failure; \
\
do { \
- oldval = *ptr; \
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg2 (&oldval, &val, ptr, INDEX); \
} while (failure != 0); \
\
return oldval; \
}
-SYNC_LOCK_TEST_AND_SET_2 (long long, 8, 3)
SYNC_LOCK_TEST_AND_SET_2 (short, 2, 1)
SYNC_LOCK_TEST_AND_SET_2 (signed char, 1, 0)
@@ -308,7 +293,7 @@ __sync_lock_test_and_set_4 (int *ptr, int val)
int failure, oldval;
do {
- oldval = *ptr;
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST);
failure = __kernel_cmpxchg (oldval, val, ptr);
} while (failure != 0);
@@ -322,12 +307,11 @@ __sync_lock_test_and_set_4 (int *ptr, int val)
TYPE failure, oldval, zero = 0; \
\
do { \
- oldval = *ptr; \
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg2 (&oldval, &zero, ptr, INDEX); \
} while (failure != 0); \
}
-SYNC_LOCK_RELEASE_2 (long long, 8, 3)
SYNC_LOCK_RELEASE_2 (short, 2, 1)
SYNC_LOCK_RELEASE_2 (signed char, 1, 0)
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 0c5042774e9..c1a983a5094 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,24 @@
+2015-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ * testsuite/libgomp.c/atomic-18.c: New test.
+ * testsuite/libgomp.c++/atomic-16.C: New test.
+
+ Backported from mainline
+ 2015-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64824
+ PR c/64868
+ * testsuite/libgomp.c/pr64824.c: New test.
+ * testsuite/libgomp.c/pr64868.c: New test.
+ * testsuite/libgomp.c++/pr64824.C: New test.
+ * testsuite/libgomp.c++/pr64868.C: New test.
+
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * libgomp.c/pr64734.c: New test.
+
2014-12-03 Uros Bizjak <ubizjak@gmail.com>
* configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.
diff --git a/libgomp/testsuite/libgomp.c++/atomic-16.C b/libgomp/testsuite/libgomp.c++/atomic-16.C
new file mode 100644
index 00000000000..afccd52bb66
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/atomic-16.C
@@ -0,0 +1,5 @@
+// PR c/64824
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/atomic-18.c"
diff --git a/libgomp/testsuite/libgomp.c++/pr64824.C b/libgomp/testsuite/libgomp.c++/pr64824.C
new file mode 100644
index 00000000000..348f6d6e0c2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr64824.C
@@ -0,0 +1,5 @@
+// PR c/64824
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/pr64824.c"
diff --git a/libgomp/testsuite/libgomp.c++/pr64868.C b/libgomp/testsuite/libgomp.c++/pr64868.C
new file mode 100644
index 00000000000..2d730ac4924
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr64868.C
@@ -0,0 +1,5 @@
+// PR c/64868
+// { dg-do run }
+// { dg-options "-O2 -fopenmp" }
+
+#include "../libgomp.c/pr64868.c"
diff --git a/libgomp/testsuite/libgomp.c/atomic-18.c b/libgomp/testsuite/libgomp.c/atomic-18.c
new file mode 100644
index 00000000000..bd048c1094c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/atomic-18.c
@@ -0,0 +1,61 @@
+/* PR c/64824 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+void
+f1 (void)
+{
+ short a;
+ short b = 1;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6 || a != 6)
+ __builtin_abort ();
+}
+
+void
+f2 (void)
+{
+ short a;
+ short b = 1;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c + b;
+ if (b != 4 || a != 4)
+ __builtin_abort ();
+}
+
+void
+f3 (void)
+{
+ short a;
+ short b = 1;
+ long long int c = 3;
+#pragma omp atomic capture
+ a = b = c + b;
+ if (b != 4 || a != 4)
+ __builtin_abort ();
+}
+
+void
+f4 (void)
+{
+ char a;
+ char b = 1;
+ long long int c = 3LL;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6 || a != 6)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr64734.c b/libgomp/testsuite/libgomp.c/pr64734.c
new file mode 100644
index 00000000000..457f481ae0b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64734.c
@@ -0,0 +1,55 @@
+/* PR middle-end/64734 */
+
+#include <stdlib.h>
+
+void
+foo (int *x, int *y)
+{
+ #pragma omp target map (alloc:x[0]) map (alloc:y[0:8])
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ if (y[i] != 2 + i)
+ break;
+ if (i != 8 || *x != 1)
+ *x = 6;
+ else
+ {
+ *x = 8;
+ for (i = 0; i < 8; i++)
+ y[i] = 9 + i;
+ }
+ }
+ #pragma omp target update from (y[0:8]) from (x[0])
+}
+
+void
+bar (void)
+{
+ int x = 1, y[32] = { 0 };
+ #pragma omp target data map (to:y[0:32]) map (to:x)
+ ;
+}
+
+int
+main ()
+{
+ int x = 1, y[8] = { 2, 3, 4, 5, 6, 7, 8, 9 }, i;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ ;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ {
+ #pragma omp target update from (y[0:8]) from (x)
+ }
+
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ foo (&x, &y[0]);
+
+ if (x != 8)
+ abort ();
+ for (i = 0; i < 8; i++)
+ if (y[i] != 9 + i)
+ abort ();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr64824.c b/libgomp/testsuite/libgomp.c/pr64824.c
new file mode 100644
index 00000000000..544d0b0fc1f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64824.c
@@ -0,0 +1,16 @@
+/* PR c/64824 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+int
+main ()
+{
+ long long a;
+ long long b = 1LL;
+ int c = 3;
+#pragma omp atomic capture
+ a = b = c << b;
+ if (b != 6LL || a != 6LL)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr64868.c b/libgomp/testsuite/libgomp.c/pr64868.c
new file mode 100644
index 00000000000..acdf9984108
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64868.c
@@ -0,0 +1,87 @@
+/* PR c/64868 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+float f = 2.0f;
+double d = 4.0;
+long double ld = 8.0L;
+
+void
+foo ()
+{
+#pragma omp atomic
+ f = 1.0f / f;
+#pragma omp atomic
+ f = 1 / f;
+#pragma omp atomic
+ f = f / 2.0f;
+#pragma omp atomic
+ f = f / 2;
+#pragma omp atomic
+ f /= 2.0f;
+#pragma omp atomic
+ f /= 2;
+#pragma omp atomic
+ d = 1.0 / d;
+#pragma omp atomic
+ d = 1 / d;
+#pragma omp atomic
+ d = d / 2.0;
+#pragma omp atomic
+ d = d / 2;
+#pragma omp atomic
+ d /= 2.0;
+#pragma omp atomic
+ d /= 2;
+#pragma omp atomic
+ ld = 1.0L / ld;
+#pragma omp atomic
+ ld = 1 / ld;
+#pragma omp atomic
+ ld = ld / 2.0L;
+#pragma omp atomic
+ ld = ld / 2;
+#pragma omp atomic
+ ld /= 2.0L;
+#pragma omp atomic
+ ld /= 2;
+ if (f != 0.125f || d != 0.25 || ld != 0.5L)
+ __builtin_abort ();
+}
+
+#ifdef __cplusplus
+template <typename T, int N1, int N2>
+void
+bar ()
+{
+ T v = ::d;
+#pragma omp atomic
+ v *= 16;
+#pragma omp atomic
+ v = 1.0 / v;
+#pragma omp atomic
+ v = N1 / v;
+#pragma omp atomic
+ v = v / 2.0;
+#pragma omp atomic
+ v = v / N2;
+#pragma omp atomic
+ v /= 2.0;
+#pragma omp atomic
+ v /= N2;
+ if (v != 0.25)
+ __builtin_abort ();
+}
+#endif
+
+int
+main ()
+{
+ foo ();
+#ifdef __cplusplus
+ bar<float, 1, 2> ();
+ bar<double, 1, 2> ();
+ bar<long double, 1, 2> ();
+#endif
+ return 0;
+}
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 2722ed3fc34..a37072996c7 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/libquadmath/configure b/libquadmath/configure
index 907e0cf05cd..8b8ca499d7d 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -613,7 +613,6 @@ LIBQUAD_USE_SYMVER_FALSE
LIBQUAD_USE_SYMVER_TRUE
toolexeclibdir
toolexecdir
-multi_basedir
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
@@ -682,6 +681,7 @@ am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
+multi_basedir
target_noncanonical
target_os
target_vendor
@@ -736,6 +736,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_version_specific_runtime_libs
enable_dependency_tracking
with_bugurl
@@ -746,7 +747,6 @@ enable_fast_install
with_gnu_ld
enable_libtool_lock
enable_maintainer_mode
-enable_multilib
enable_symvers
enable_generated_files_in_srcdir
'
@@ -1379,6 +1379,7 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@@ -1391,7 +1392,6 @@ Optional Features:
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
- --enable-multilib build many library versions (default)
--disable-symvers disable symbol versioning for libquadmath
--enable-generated-files-in-srcdir
put copies of generated files in source dir intended
@@ -2370,6 +2370,44 @@ esac
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
target_alias=${target_alias-$host_alias}
@@ -10527,7 +10565,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10530 "configure"
+#line 10568 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10633,7 +10671,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10636 "configure"
+#line 10674 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10918,43 +10956,6 @@ fi
MAINT=$MAINTAINER_MODE_TRUE
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -13644,6 +13645,20 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
@@ -13906,20 +13921,6 @@ fi
-srcdir="$srcdir"
-host="$host"
-target="$target"
-with_multisubdir="$with_multisubdir"
-with_multisrctop="$with_multisrctop"
-with_target_subdir="$with_target_subdir"
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-multi_basedir="$multi_basedir"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="$CC"
-CXX="$CXX"
-GFORTRAN="$GFORTRAN"
-GCJ="$GCJ"
-
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -13929,9 +13930,9 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14517,6 +14518,14 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
@@ -15251,14 +15260,6 @@ _LT_EOF
chmod +x "$ofile"
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
esac
done # for ac_tag
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
index c547da8dc20..eb4fe8c8dfc 100644
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -23,6 +23,8 @@ AC_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
ACX_NONCANONICAL_TARGET
+AM_ENABLE_MULTILIB(, ..)
+
target_alias=${target_alias-$host_alias}
AC_SUBST(target_alias)
@@ -60,7 +62,6 @@ AC_SUBST(enable_shared)
AC_SUBST(enable_static)
AM_MAINTAINER_MODE
-AM_ENABLE_MULTILIB(, ..)
AC_LANG_C
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 6e3a6c7b3e0..135b297d1c8 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-27 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
diff --git a/libsanitizer/configure b/libsanitizer/configure
index 5e4840ffea4..c550ad61057 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -659,7 +659,6 @@ toolexecdir
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
-multi_basedir
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
@@ -717,6 +716,7 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
+multi_basedir
target_alias
host_alias
build_alias
@@ -758,9 +758,9 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_version_specific_runtime_libs
enable_dependency_tracking
-enable_multilib
enable_maintainer_mode
enable_shared
enable_static
@@ -1404,10 +1404,10 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
- --enable-multilib build many library versions (default)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-shared[=PKGS] build shared libraries [default=yes]
@@ -2625,6 +2625,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
# Check whether --enable-version-specific-runtime-libs was given.
@@ -4701,43 +4739,6 @@ fi
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
@@ -12019,7 +12020,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12022 "configure"
+#line 12023 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12125,7 +12126,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12128 "configure"
+#line 12129 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17090,7 +17091,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
srcdir="$srcdir"
host="$host"
@@ -17105,6 +17105,7 @@ CC="$CC"
CXX="$CXX"
GFORTRAN="$GFORTRAN"
GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -17492,8 +17493,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -18091,6 +18092,14 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
@@ -18186,14 +18195,6 @@ $as_echo X"$file" |
done
}
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index e6721312d0c..eb8b3ba0d41 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -5,6 +5,8 @@ AC_PREREQ([2.64])
AC_INIT(package-unused, version-unused, libsanitizer)
AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
+AM_ENABLE_MULTILIB(, ..)
+
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
@@ -26,7 +28,6 @@ AC_SUBST(target_alias)
GCC_LIBSTDCXX_RAW_CXX_FLAGS
AM_INIT_AUTOMAKE(foreign no-dist)
-AM_ENABLE_MULTILIB(, ..)
AM_MAINTAINER_MODE
# Calculate toolexeclibdir
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 68550703831..3c8b9e81263 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,79 @@
+2015-02-03 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64680
+ Backported from mainline
+ 2015-01-22 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.h (basic_regex<>::basic_regex,
+ basic_regex<>::operator=, basic_regex<>::imbue): Conform to the
+ standard interface.
+ * testsuite/28_regex/basic_regex/assign/char/cstring.cc: New testcase.
+
+2015-02-03 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64649
+ Backported from mainline
+ 2015-01-22 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
+ regex_traits<>::lookup_classname): Correctly narrow input chars.
+ * testsuite/28_regex/traits/wchar_t/user_defined.cc: New testcase.
+
+2015-01-19 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64649
+ Backported from mainline
+ 2015-01-19 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
+ regex_traits<>::lookup_classname): Support forward iterators.
+ * testsuite/28_regex/traits/char/lookup_classname.cc: New testcases.
+ * testsuite/28_regex/traits/char/lookup_collatename.cc: New testcase.
+
+2015-01-19 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64584
+ PR libstdc++/64585
+ * include/bits/regex.h (basic_regex<>::basic_regex,
+ basic_regex<>::assign, basic_regex<>::imbue,
+ basic_regex<>::swap, basic_regex<>::mark_count): Drop NFA after
+ imbuing basic_regex; Make assign() transactional against exception.
+ * testsuite/28_regex/basic_regex/assign/char/string.cc: New testcase.
+ * testsuite/28_regex/basic_regex/imbue/string.cc: New testcase.
+
+2015-01-18 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/64646
+ * include/bits/stl_algo.h (__is_permutation): Also test for reaching
+ end of the second range.
+ * testsuite/25_algorithms/is_permutation/64646.cc: New.
+
+2015-01-09 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/64476
+ * include/bits/stl_uninitialized.h (uninitialized_copy): Fix
+ is_assignable arguments.
+ * testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc:
+ New.
+
+2015-01-09 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/60966
+ * include/std/future (packaged_task::operator()): Increment the
+ reference count on the shared state until the function returns.
+
+2015-01-09 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64239
+ Backported form mainline
+ 2015-01-09 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.h (match_results<>::swap): Use std::swap
+ instead of swap.
+ * include/bits/regex_compiler.tcc (_Compiler<>::_M_quantifier):
+ Likewise.
+ * testsuite/28_regex/match_results/swap.cc: New testcase.
+
2014-12-17 Tim Shen <timshen@google.com>
PR libstdc++/64302
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index 6853cb6982a..ea706799ed6 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -449,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
explicit
basic_regex(const _Ch_type* __p, flag_type __f = ECMAScript)
- : basic_regex(__p, __p + _Rx_traits::length(__p), __f)
+ : basic_regex(__p, __p + char_traits<_Ch_type>::length(__p), __f)
{ }
/**
@@ -476,7 +476,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
basic_regex(const basic_regex& __rhs)
: _M_flags(__rhs._M_flags), _M_original_str(__rhs._M_original_str)
- { this->imbue(__rhs.getloc()); }
+ {
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
+ }
/**
* @brief Move-constructs a basic regular expression.
@@ -490,7 +493,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_flags(__rhs._M_flags),
_M_original_str(std::move(__rhs._M_original_str))
{
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
__rhs._M_automaton.reset();
}
@@ -580,7 +584,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
basic_regex&
operator=(const _Ch_type* __p)
- { return this->assign(__p, flags()); }
+ { return this->assign(__p); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * an initializer list.
+ *
+ * @param __l The initializer list.
+ *
+ * @throws regex_error if @p __l is not a valid regular expression.
+ */
+ basic_regex&
+ operator=(initializer_list<_Ch_type> __l)
+ { return this->assign(__l.begin(), __l.end()); }
/**
* @brief Replaces a regular expression with a new one constructed from
@@ -591,7 +607,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Ch_typeraits, typename _Alloc>
basic_regex&
operator=(const basic_string<_Ch_type, _Ch_typeraits, _Alloc>& __s)
- { return this->assign(__s, flags()); }
+ { return this->assign(__s); }
// [7.8.3] assign
/**
@@ -604,7 +620,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_M_flags = __rhs._M_flags;
_M_original_str = __rhs._M_original_str;
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
return *this;
}
@@ -622,7 +639,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_flags = __rhs._M_flags;
_M_original_str = std::move(__rhs._M_original_str);
__rhs._M_automaton.reset();
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
+ return *this;
}
/**
@@ -675,12 +694,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
assign(const basic_string<_Ch_type, _Ch_typeraits, _Alloc>& __s,
flag_type __flags = ECMAScript)
{
+ _M_automaton = __detail::__compile_nfa(
+ __s.data(), __s.data() + __s.size(), _M_traits, __flags);
+ _M_original_str = __s;
_M_flags = __flags;
- _M_original_str.assign(__s.begin(), __s.end());
- auto __p = _M_original_str.c_str();
- _M_automaton = __detail::__compile_nfa(__p,
- __p + _M_original_str.size(),
- _M_traits, _M_flags);
return *this;
}
@@ -725,7 +742,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
unsigned int
mark_count() const
- { return _M_automaton->_M_sub_count() - 1; }
+ {
+ if (_M_automaton)
+ return _M_automaton->_M_sub_count() - 1;
+ return 0;
+ }
/**
* @brief Gets the flags used to construct the regular expression
@@ -744,9 +765,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
locale_type
imbue(locale_type __loc)
{
- auto __ret = _M_traits.imbue(__loc);
- this->assign(_M_original_str, _M_flags);
- return __ret;
+ _M_automaton.reset();
+ return _M_traits.imbue(__loc);
}
/**
@@ -767,8 +787,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(basic_regex& __rhs)
{
std::swap(_M_flags, __rhs._M_flags);
- std::swap(_M_original_str, __rhs._M_original_str);
- this->imbue(__rhs.imbue(this->getloc()));
+ std::swap(_M_traits, __rhs._M_traits);
+ auto __tmp = std::move(_M_original_str);
+ this->assign(__rhs._M_original_str, _M_flags);
+ __rhs.assign(__tmp, __rhs._M_flags);
}
#ifdef _GLIBCXX_DEBUG
@@ -777,7 +799,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ _M_automaton->_M_dot(__ostr); }
#endif
- protected:
+ private:
typedef std::shared_ptr<__detail::_NFA<_Rx_traits>> _AutomatonPtr;
template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
@@ -1865,6 +1887,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void
swap(match_results& __that)
{
+ using std::swap;
_Base_type::swap(__that);
swap(_M_begin, __that._M_begin);
}
diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc
index 369245b1323..792ed9206ce 100644
--- a/libstdc++-v3/include/bits/regex.tcc
+++ b/libstdc++-v3/include/bits/regex.tcc
@@ -275,53 +275,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"right-curly-bracket",
"tilde",
"DEL",
- ""
};
- // same as boost
- //static const char* __digraphs[] =
- // {
- // "ae",
- // "Ae",
- // "AE",
- // "ch",
- // "Ch",
- // "CH",
- // "ll",
- // "Ll",
- // "LL",
- // "ss",
- // "Ss",
- // "SS",
- // "nj",
- // "Nj",
- // "NJ",
- // "dz",
- // "Dz",
- // "DZ",
- // "lj",
- // "Lj",
- // "LJ",
- // ""
- // };
-
- std::string __s(__last - __first, '?');
- __fctyp.narrow(__first, __last, '?', &*__s.begin());
-
- for (unsigned int __i = 0; *__collatenames[__i]; __i++)
- if (__s == __collatenames[__i])
- return string_type(1, __fctyp.widen(static_cast<char>(__i)));
-
- //for (unsigned int __i = 0; *__digraphs[__i]; __i++)
- // {
- // const char* __now = __digraphs[__i];
- // if (__s == __now)
- // {
- // string_type ret(__s.size(), __fctyp.widen('?'));
- // __fctyp.widen(__now, __now + 2/* ouch */, &*ret.begin());
- // return ret;
- // }
- // }
+ string __s;
+ for (; __first != __last; ++__first)
+ __s += __fctyp.narrow(*__first, 0);
+
+ for (const auto& __it : __collatenames)
+ if (__s == __it)
+ return string_type(1, __fctyp.widen(
+ static_cast<char>(&__it - __collatenames)));
+
+ // TODO Add digraph support:
+ // http://boost.sourceforge.net/libs/regex/doc/collating_names.html
+
return string_type();
}
@@ -332,12 +299,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lookup_classname(_Fwd_iter __first, _Fwd_iter __last, bool __icase) const
{
typedef std::ctype<char_type> __ctype_type;
- typedef std::ctype<char> __cctype_type;
- typedef const pair<const char*, char_class_type> _ClassnameEntry;
const __ctype_type& __fctyp(use_facet<__ctype_type>(_M_locale));
- const __cctype_type& __cctyp(use_facet<__cctype_type>(_M_locale));
- static _ClassnameEntry __classnames[] =
+ // Mappings from class name to class mask.
+ static const pair<const char*, char_class_type> __classnames[] =
{
{"d", ctype_base::digit},
{"w", {ctype_base::alnum, _RegexMask::_S_under}},
@@ -356,22 +321,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{"xdigit", ctype_base::xdigit},
};
- std::string __s(__last - __first, '?');
- __fctyp.narrow(__first, __last, '?', &__s[0]);
- __cctyp.tolower(&*__s.begin(), &*__s.begin() + __s.size());
- for (_ClassnameEntry* __it = __classnames;
- __it < *(&__classnames + 1);
- ++__it)
- {
- if (__s == __it->first)
- {
- if (__icase
- && ((__it->second
- & (ctype_base::lower | ctype_base::upper)) != 0))
- return ctype_base::alpha;
- return __it->second;
- }
- }
+ string __s;
+ for (; __first != __last; ++__first)
+ __s += __fctyp.narrow(__fctyp.tolower(*__first), 0);
+
+ for (const auto& __it : __classnames)
+ if (__s == __it.first)
+ {
+ if (__icase
+ && ((__it.second
+ & (ctype_base::lower | ctype_base::upper)) != 0))
+ return ctype_base::alpha;
+ return __it.second;
+ }
return 0;
}
diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc
index 14e40c0cd19..ffe01705fe6 100644
--- a/libstdc++-v3/include/bits/regex_compiler.tcc
+++ b/libstdc++-v3/include/bits/regex_compiler.tcc
@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
auto& __tmp = _M_nfa[__stack.top()];
__stack.pop();
- swap(__tmp._M_next, __tmp._M_alt);
+ std::swap(__tmp._M_next, __tmp._M_alt);
}
}
_M_stack.push(__e);
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index cfb50a92884..c9980e55414 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -3595,7 +3595,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Efficiently compare identical prefixes: O(N) if sequences
// have the same elements in the same order.
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
if (!__pred(__first1, __first2))
break;
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index cd2a4828361..42b40267a6c 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -115,8 +115,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const bool __assignable = true;
#else
// trivial types can have deleted assignment
- typedef typename iterator_traits<_InputIterator>::reference _RefType;
- const bool __assignable = is_assignable<_ValueType1, _RefType>::value;
+ typedef typename iterator_traits<_InputIterator>::reference _RefType1;
+ typedef typename iterator_traits<_ForwardIterator>::reference _RefType2;
+ const bool __assignable = is_assignable<_RefType2, _RefType1>::value;
#endif
return std::__uninitialized_copy<__is_trivial(_ValueType1)
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index d446b9d55cb..6523cea8e86 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -1450,7 +1450,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_ArgTypes... __args)
{
__future_base::_State_base::_S_check(_M_state);
- _M_state->_M_run(std::forward<_ArgTypes>(__args)...);
+ auto __state = _M_state;
+ __state->_M_run(std::forward<_ArgTypes>(__args)...);
}
void
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc
new file mode 100644
index 00000000000..6369b17af1e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc
@@ -0,0 +1,65 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct X
+{
+ X() = default;
+ X(X const &) = default;
+ X& operator=(X const&) = delete;
+};
+
+static_assert(__is_trivial(X), "X is trivial");
+
+int constructed = 0;
+int assigned = 0;
+
+struct Y
+{
+ Y() = default;
+ Y(Y const &) = default;
+ Y& operator=(Y const&) = default;
+
+ Y(const X&) { ++constructed; }
+ Y& operator=(const X&)& { ++assigned; return *this; }
+ Y& operator=(const X&)&& = delete;
+ Y& operator=(X&&) = delete;
+};
+
+static_assert(__is_trivial(Y), "Y is trivial");
+
+void
+test01()
+{
+ X a[100];
+ Y b[100];
+
+ std::uninitialized_copy(a, a+10, b);
+
+ VERIFY(constructed == 0);
+ VERIFY(assigned == 10);
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/64646.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/64646.cc
new file mode 100644
index 00000000000..799a18c5d7f
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/64646.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++14" }
+
+#include <algorithm>
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::forward_list<int> l1{0}, l2;
+ VERIFY( !std::is_permutation(l1.begin(), l1.end(), l2.begin(), l2.end()) );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc
index 16dae9a16a6..7011d1c8529 100644
--- a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc
+++ b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc
@@ -1,5 +1,4 @@
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-options "-std=c++11" }
// 2009-06-05 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
@@ -36,9 +35,19 @@ void test01()
re.assign(cs);
}
+// basic_regex::operator=() resets flags. libstdc++/64680
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::regex re("[[:alnum:]]", std::regex_constants::basic);
+ re = "\\w+";
+}
+
int
main()
{
test01();
+ test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc
index 0a32ab5e61f..7d4db8f10af 100644
--- a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc
+++ b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc
@@ -1,4 +1,3 @@
-// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
@@ -29,6 +28,7 @@
// Tests C++ string assignment of the basic_regex class.
void test01()
{
+ bool test __attribute__((unused)) = true;
typedef std::basic_regex<char> test_type;
std::string s("a*b");
@@ -36,9 +36,27 @@ void test01()
re.assign(s);
}
+// libstdc++/64584
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ std::regex re("", std::regex_constants::extended);
+ auto flags = re.flags();
+ try
+ {
+ re.assign("(", std::regex_constants::icase);
+ VERIFY(false);
+ }
+ catch (const std::regex_error& e)
+ {
+ VERIFY(flags == re.flags());
+ }
+}
+
int
main()
{
test01();
+ test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc
new file mode 100644
index 00000000000..d4d4f470547
--- /dev/null
+++ b/libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2015 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/>.
+
+// [28.8.5] class template basic_regex locale
+
+#include <string>
+#include <regex>
+#include <testsuite_hooks.h>
+
+// libstdc++/64585
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ static const char s[] = "a";
+ std::regex re("a");
+ VERIFY(std::regex_search(s, re));
+
+ auto loc = re.imbue(re.getloc());
+ VERIFY(!std::regex_search(s, re));
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/28_regex/match_results/swap.cc b/libstdc++-v3/testsuite/28_regex/match_results/swap.cc
new file mode 100644
index 00000000000..18248c1c575
--- /dev/null
+++ b/libstdc++-v3/testsuite/28_regex/match_results/swap.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11" }
+
+//
+// Copyright (C) 2015 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 <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::cmatch m;
+ std::regex_match("a", m, std::regex("a"));
+ std::cmatch mm1 = m, mm2;
+ mm1.swap(mm2);
+ VERIFY(m == mm2);
+ std::swap(mm1, mm2);
+ VERIFY(m == mm1);
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc
index 48ab04375ec..f2a99ab4a16 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_classname.cc
@@ -26,6 +26,7 @@
// 28.7(9) Class template regex_traits [re.traits]
#include <regex>
+#include <forward_list>
#include <testsuite_hooks.h>
void
@@ -47,8 +48,29 @@ test01()
VERIFY( c2 == c3 );
}
+// Test forward iterator
+void
+test02()
+{
+ const char strlit[] = "upper";
+ std::forward_list<char> s(strlit, strlit + strlen(strlit));
+ std::regex_traits<char> traits;
+ VERIFY(traits.isctype('C', traits.lookup_classname(s.begin(), s.end(), false)));
+}
+
+// icase
+void
+test03()
+{
+ std::string s("lower");
+ std::regex_traits<char> traits;
+ VERIFY(traits.isctype('C', traits.lookup_classname(s.begin(), s.end(), true)));
+}
+
int main()
{
test01();
+ test02();
+ test03();
return 0;
}
diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc
index 825f2ba2bc5..698c18df747 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/char/lookup_collatename.cc
@@ -26,6 +26,7 @@
// 28.7 (8) Class template regex_traits [re.traits]
#include <regex>
+#include <forward_list>
#include <testsuite_hooks.h>
void
@@ -40,8 +41,19 @@ test01()
VERIFY(t.lookup_collatename(name, name+sizeof(name)-1) == "~");
}
+// Test forward iterator.
+void
+test02()
+{
+ const char strlit[] = "tilde";
+ std::forward_list<char> s(strlit, strlit + strlen(strlit));
+ std::regex_traits<char> traits;
+ VERIFY(traits.lookup_collatename(s.begin(), s.end()) == "~");
+}
+
int main()
{
test01();
+ test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc
index 7eca2d5474d..975a943f74c 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/user_defined.cc
@@ -55,8 +55,32 @@ test01()
VERIFY(!regex_match(L"\u2029", re));
}
+struct MyCtype : std::ctype<wchar_t>
+{
+ char
+ do_narrow(wchar_t c, char dflt) const override
+ {
+ if (c >= 256)
+ return dflt;
+ return ((char)c)+1;
+ }
+};
+
+void
+test02()
+{
+ std::locale loc(std::locale(), new MyCtype);
+ std::regex_traits<wchar_t> traits;
+ traits.imbue(loc);
+ wchar_t wch = L'p';
+ VERIFY(traits.lookup_collatename(&wch, &wch+1) == L"q");
+ std::wstring ws = L"chfhs"; // chars of "digit" shifted by 1.
+ VERIFY(traits.lookup_classname(ws.begin(), ws.end()) != 0);
+}
+
int main()
{
test01();
+ test02();
return 0;
}