aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc-4.9/config/mh-alpha-linux3
-rw-r--r--gcc-4.9/gcc/ChangeLog412
-rw-r--r--gcc-4.9/gcc/DATESTAMP2
-rw-r--r--gcc-4.9/gcc/Makefile.in9
-rw-r--r--gcc-4.9/gcc/ada/ChangeLog9
-rw-r--r--gcc-4.9/gcc/ada/gsocket.h5
-rw-r--r--gcc-4.9/gcc/ada/s-osinte-rtems.adb2
-rw-r--r--gcc-4.9/gcc/ada/socket.c2
-rw-r--r--gcc-4.9/gcc/auto-profile.c2
-rw-r--r--gcc-4.9/gcc/bb-reorder.c3
-rw-r--r--gcc-4.9/gcc/c-family/ChangeLog12
-rw-r--r--gcc-4.9/gcc/c-family/array-notation-common.c13
-rw-r--r--gcc-4.9/gcc/c-family/c-common.c2
-rw-r--r--gcc-4.9/gcc/c/ChangeLog12
-rw-r--r--gcc-4.9/gcc/c/c-array-notation.c19
-rw-r--r--gcc-4.9/gcc/c/c-parser.c7
-rw-r--r--gcc-4.9/gcc/cgraphunit.c1
-rw-r--r--gcc-4.9/gcc/config/arm/vfp.md10
-rw-r--r--gcc-4.9/gcc/config/i386/driver-i386.c5
-rw-r--r--gcc-4.9/gcc/config/i386/i386.c15
-rw-r--r--gcc-4.9/gcc/config/i386/i386.h2
-rw-r--r--gcc-4.9/gcc/config/i386/i386.md175
-rw-r--r--gcc-4.9/gcc/config/i386/sse.md4
-rw-r--r--gcc-4.9/gcc/config/i386/x86-tune.def5
-rw-r--r--gcc-4.9/gcc/config/nios2/rtems.h34
-rw-r--r--gcc-4.9/gcc/config/nios2/t-rtems133
-rw-r--r--gcc-4.9/gcc/config/pa/pa-protos.h2
-rw-r--r--gcc-4.9/gcc/config/pa/pa.c87
-rw-r--r--gcc-4.9/gcc/config/pa/pa.h10
-rw-r--r--gcc-4.9/gcc/config/pa/pa.md30
-rw-r--r--gcc-4.9/gcc/config/rs6000/constraints.md16
-rw-r--r--gcc-4.9/gcc/config/rs6000/rs6000.c149
-rw-r--r--gcc-4.9/gcc/config/rs6000/rs6000.h171
-rw-r--r--gcc-4.9/gcc/config/rs6000/rs6000.md28
-rw-r--r--gcc-4.9/gcc/config/rs6000/vsx.md331
-rw-r--r--gcc-4.9/gcc/config/sh/sh.c6
-rw-r--r--gcc-4.9/gcc/config/sh/sh.opt2
-rw-r--r--gcc-4.9/gcc/coverage.c2
-rw-r--r--gcc-4.9/gcc/cp/ChangeLog74
-rw-r--r--gcc-4.9/gcc/cp/call.c5
-rw-r--r--gcc-4.9/gcc/cp/class.c23
-rw-r--r--gcc-4.9/gcc/cp/cp-array-notation.c30
-rw-r--r--gcc-4.9/gcc/cp/cp-tree.h1
-rw-r--r--gcc-4.9/gcc/cp/decl.c24
-rw-r--r--gcc-4.9/gcc/cp/decl2.c5
-rw-r--r--gcc-4.9/gcc/cp/expr.c8
-rw-r--r--gcc-4.9/gcc/cp/init.c57
-rw-r--r--gcc-4.9/gcc/cp/lambda.c5
-rw-r--r--gcc-4.9/gcc/cp/parser.c2
-rw-r--r--gcc-4.9/gcc/cp/pt.c18
-rw-r--r--gcc-4.9/gcc/cp/semantics.c5
-rw-r--r--gcc-4.9/gcc/cp/tree.c4
-rw-r--r--gcc-4.9/gcc/cp/typeck2.c3
-rw-r--r--gcc-4.9/gcc/cprop.c7
-rw-r--r--gcc-4.9/gcc/doc/invoke.texi128
-rw-r--r--gcc-4.9/gcc/doc/md.texi14
-rw-r--r--gcc-4.9/gcc/dwarf2out.c55
-rw-r--r--gcc-4.9/gcc/emit-rtl.c2
-rw-r--r--gcc-4.9/gcc/emit-rtl.h3
-rw-r--r--gcc-4.9/gcc/final.c2
-rw-r--r--gcc-4.9/gcc/fortran/ChangeLog56
-rw-r--r--gcc-4.9/gcc/fortran/frontend-passes.c30
-rw-r--r--gcc-4.9/gcc/fortran/gfortran.h2
-rw-r--r--gcc-4.9/gcc/fortran/openmp.c9
-rw-r--r--gcc-4.9/gcc/fortran/simplify.c11
-rw-r--r--gcc-4.9/gcc/fortran/trans-expr.c4
-rw-r--r--gcc-4.9/gcc/fortran/trans-openmp.c32
-rw-r--r--gcc-4.9/gcc/gcov-tool.c13
-rw-r--r--gcc-4.9/gcc/genconfig.c18
-rw-r--r--gcc-4.9/gcc/gimple-fold.c4
-rw-r--r--gcc-4.9/gcc/gimple.h24
-rw-r--r--gcc-4.9/gcc/gimplify.c2
-rw-r--r--gcc-4.9/gcc/go/gofrontend/parse.cc5
-rw-r--r--gcc-4.9/gcc/haifa-sched.c8
-rw-r--r--gcc-4.9/gcc/ifcvt.c31
-rw-r--r--gcc-4.9/gcc/l-ipo.c44
-rw-r--r--gcc-4.9/gcc/l-ipo.h1
-rw-r--r--gcc-4.9/gcc/lra-constraints.c14
-rw-r--r--gcc-4.9/gcc/lto/ChangeLog8
-rw-r--r--gcc-4.9/gcc/lto/lto-lang.c6
-rw-r--r--gcc-4.9/gcc/optabs.c5
-rw-r--r--gcc-4.9/gcc/sched-deps.c18
-rw-r--r--gcc-4.9/gcc/simplify-rtx.c2
-rw-r--r--gcc-4.9/gcc/testsuite/ChangeLog217
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c9
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c14
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c9
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c10
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/pr61741.c22
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array7.C13
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem3.C16
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array4.C9
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C7
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C13
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/expr/cond12.C12
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ext/restrict2.C8
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/init/explicit2.C8
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-39.C28
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/opt/pr62146.C51
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local10.C23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-3.x2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr23135.x2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/frame-pointer-1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/neon-vext-execute.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/pr56184.C1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/pr58784.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/pr59896.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/pr59985.C1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/stack-red-zone.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmpd-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmps-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmsd-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmss-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2d-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2pd-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2ps-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2q-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2d-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2pd-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2ps-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2q-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/pr61794.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/pr61801.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/pr61855.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/pr61923.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/mips/pr62030-octeon.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60102.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/sh/pr61996.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/array_assignment_5.f9016
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/array_constructor_49.f9013
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/bessel_7.f902
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/dependency_44.f9036
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/dot_product_3.f9015
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr62131.f9019
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/pr45636.f902
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/realloc_on_assign_24.f9010
-rw-r--r--gcc-4.9/gcc/testsuite/gnat.dg/pack20.adb9
-rw-r--r--gcc-4.9/gcc/testsuite/gnat.dg/pack20.ads15
-rw-r--r--gcc-4.9/gcc/testsuite/gnat.dg/pack20_pkg.ads7
-rw-r--r--gcc-4.9/gcc/testsuite/lib/target-supports.exp7
-rw-r--r--gcc-4.9/gcc/toplev.c5
-rw-r--r--gcc-4.9/gcc/toplev.h5
-rw-r--r--gcc-4.9/gcc/tree-cfg.c106
-rw-r--r--gcc-4.9/gcc/tree-cfgcleanup.c61
-rw-r--r--gcc-4.9/gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc-4.9/gcc/tree-ssa-math-opts.c6
-rw-r--r--gcc-4.9/gcc/tree-ssa-operands.c6
-rw-r--r--gcc-4.9/gcc/tree-ssa-tail-merge.c14
-rw-r--r--gcc-4.9/gcc/tree-ssanames.h1
-rw-r--r--gcc-4.9/gcc/tree-vect-loop.c3
-rw-r--r--gcc-4.9/gcc/tree-vectorizer.h4
-rw-r--r--gcc-4.9/gcc/tree.h5
-rw-r--r--gcc-4.9/libada/ChangeLog4
-rw-r--r--gcc-4.9/libada/Makefile.in2
-rw-r--r--gcc-4.9/libgcc/ChangeLog6
-rw-r--r--gcc-4.9/libgcc/config/rs6000/linux-unwind.h4
-rw-r--r--gcc-4.9/libgcc/libgcov-merge.c15
-rw-r--r--gcc-4.9/libgfortran/ChangeLog9
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r10.c2
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r16.c2
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r4.c2
-rw-r--r--gcc-4.9/libgfortran/generated/bessel_r8.c2
-rw-r--r--gcc-4.9/libgfortran/m4/bessel.m42
-rw-r--r--gcc-4.9/libgo/runtime/go-caller.c12
-rw-r--r--gcc-4.9/libgo/runtime/malloc.goc7
-rw-r--r--gcc-4.9/libgo/runtime/mgc0.c1
-rw-r--r--gcc-4.9/libgomp/ChangeLog41
-rw-r--r--gcc-4.9/libgomp/libgomp.h17
-rw-r--r--gcc-4.9/libgomp/task.c354
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-10.c3
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-5.c98
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-6.c3
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-7.c3
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-8.c3
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/depend-9.c3
-rw-r--r--gcc-4.9/libitm/config/aarch64/sjlj.S92
-rw-r--r--gcc-4.9/libitm/config/aarch64/target.h45
-rw-r--r--gcc-4.9/libstdc++-v3/ChangeLog111
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/atomic_base.h4
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/basic_string.h18
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/hashtable.h8
-rw-r--r--gcc-4.9/libstdc++-v3/include/experimental/string_view112
-rw-r--r--gcc-4.9/libstdc++-v3/include/experimental/string_view.tcc4
-rw-r--r--gcc-4.9/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/traits.hpp4
-rw-r--r--gcc-4.9/libstdc++-v3/include/ext/rope7
-rw-r--r--gcc-4.9/libstdc++-v3/include/std/condition_variable9
-rw-r--r--gcc-4.9/libstdc++-v3/include/std/future20
-rw-r--r--gcc-4.9/libstdc++-v3/include/std/mutex3
-rw-r--r--gcc-4.9/libstdc++-v3/libsupc++/atexit_thread.cc6
-rw-r--r--gcc-4.9/libstdc++-v3/python/libstdcxx/v6/printers.py120
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/12.cc38
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc38
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/61667.cc44
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc15
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc45
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc48
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/char/1.cc7
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/wchar_t/1.cc7
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/char/1.cc3
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/wchar_t/1.cc3
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/char/1.cc5
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/wchar_t/1.cc5
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/to_string/1.cc53
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/pr60037.cc23
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/ext/rope/61946.cc31
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/lib/gdb-test.exp4
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/util/testsuite_iterators.h2
232 files changed, 4660 insertions, 932 deletions
diff --git a/gcc-4.9/config/mh-alpha-linux b/gcc-4.9/config/mh-alpha-linux
new file mode 100644
index 000000000..9a9244baa
--- /dev/null
+++ b/gcc-4.9/config/mh-alpha-linux
@@ -0,0 +1,3 @@
+# Prevent GPREL16 relocation truncation
+LDFLAGS += -Wl,--no-relax
+BOOT_LDFLAGS += -Wl,--no-relax
diff --git a/gcc-4.9/gcc/ChangeLog b/gcc-4.9/gcc/ChangeLog
index df98072de..44fa3612c 100644
--- a/gcc-4.9/gcc/ChangeLog
+++ b/gcc-4.9/gcc/ChangeLog
@@ -1,3 +1,415 @@
+2014-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * doc/invoke.texi: -fno-cxa-atexit should be -fno-use-cxa-atexit.
+
+2014-08-26 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2014-08-26 Marek Polacek <polacek@redhat.com>
+
+ PR c/61271
+ * tree-vectorizer.h (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT,
+ LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Wrap in parens.
+
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/61996
+ * config/sh/sh.opt (musermode): Allow negative form.
+ * config/sh/sh.c (sh_option_override): Disable TARGET_USERMODE for
+ targets that don't support it.
+ * doc/invoke.texi (SH Options): Rename sh-*-linux* to sh*-*-linux*.
+ Document -mno-usermode option.
+
+2014-08-23 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/62038
+ * config/pa/pa.c (pa_output_function_epilogue): Don't set
+ last_address when the current function is a thunk.
+ (pa_asm_output_mi_thunk): When we don't have named sections or they
+ are not being used, check that thunk can reach the stub table with a
+ short branch.
+
+2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2014-08-22 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/62195
+ * doc/md.texi (Machine Constraints): Update PowerPC wi constraint
+ documentation to state it is only for VSX operations.
+
+ * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Make wi
+ constraint only active if VSX.
+
+ * config/rs6000/rs6000.md (lfiwax): Use wj constraint instead of
+ wi cosntraint for ISA 2.07 lxsiwax/lxsiwzx instructions.
+ (lfiwzx): Likewise.
+
+2014-08-21 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2014-08-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md (*ctz<mode>2_falsedep_1): Don't clear
+ destination if it is used in source.
+ (*clz<mode>2_lzcnt_falsedep_1): Likewise.
+ (*popcount<mode>2_falsedep_1): Likewise.
+
+ Backport from mainline
+ 2014-08-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/62011
+ * config/i386/x86-tune.def (X86_TUNE_AVOID_FALSE_DEP_FOR_BMI):
+ New tune flag.
+ * config/i386/i386.h (TARGET_AVOID_FALSE_DEP_FOR_BMI): New define.
+ * config/i386/i386.md (unspec) <UNSPEC_INSN_FALSE_DEP>: New unspec.
+ (ffs<mode>2): Do not expand with tzcnt for
+ TARGET_AVOID_FALSE_DEP_FOR_BMI.
+ (ffssi2_no_cmove): Ditto.
+ (*tzcnt<mode>_1): Disable for TARGET_AVOID_FALSE_DEP_FOR_BMI.
+ (ctz<mode>2): New expander.
+ (*ctz<mode>2_falsedep_1): New insn_and_split pattern.
+ (*ctz<mode>2_falsedep): New insn.
+ (*ctz<mode>2): Rename from ctz<mode>2.
+ (clz<mode>2_lzcnt): New expander.
+ (*clz<mode>2_lzcnt_falsedep_1): New insn_and_split pattern.
+ (*clz<mode>2_lzcnt_falsedep): New insn.
+ (*clz<mode>2): Rename from ctz<mode>2.
+ (popcount<mode>2): New expander.
+ (*popcount<mode>2_falsedep_1): New insn_and_split pattern.
+ (*popcount<mode>2_falsedep): New insn.
+ (*popcount<mode>2): Rename from ctz<mode>2.
+ (*popcount<mode>2_cmp): Remove.
+ (*popcountsi2_cmp_zext): Ditto.
+
+2014-08-20 Martin Jambor <mjambor@suse.cz>
+ Wei Mi <wmi@google.com>
+
+ PR ipa/60449
+ PR middle-end/61776
+ * tree-ssa-operands.c (update_stmt_operands): Remove
+ MODIFIED_NORETURN_CALLS.
+ * tree-cfgcleanup.c (cleanup_call_ctrl_altering_flag): New func.
+ (cleanup_control_flow_bb): Use cleanup_call_ctrl_altering_flag.
+ (split_bb_on_noreturn_calls): Renamed from split_bbs_on_noreturn_calls.
+ (cleanup_tree_cfg_1): Use split_bb_on_noreturn_calls.
+ * tree-ssanames.h: Remove MODIFIED_NORETURN_CALLS.
+ * gimple.h (enum gf_mask): Add GF_CALL_CTRL_ALTERING.
+ (gimple_call_set_ctrl_altering): New func.
+ (gimple_call_ctrl_altering_p): Ditto.
+ * tree-cfg.c (gimple_call_initialize_ctrl_altering): Ditto.
+ (make_blocks): Use gimple_call_initialize_ctrl_altering.
+ (is_ctrl_altering_stmt): Use gimple_call_ctrl_altering_p.
+ (execute_fixup_cfg): Use gimple_call_ctrl_altering_p and
+ remove MODIFIED_NORETURN_CALLS.
+
+2014-08-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ Backport from mainline.
+ 2014-08-12 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+ PR target/62098
+ * config/arm/vfp.md (*combine_vcvtf2i): Fix constraint.
+ Remove unnecessary attributes.
+
+2014-08-16 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/61641
+ * config/pa/pa-protos.h (pa_output_addr_vec, pa_output_addr_diff_vec):
+ Declare.
+ * config/pa/pa.c (pa_reorg): Remove code to insert brtab marker insns.
+ (pa_output_addr_vec, pa_output_addr_diff_vec): New.
+ * config/pa/pa.h (ASM_OUTPUT_ADDR_VEC, ASM_OUTPUT_ADDR_DIFF_VEC):
+ Define.
+ * config/pa/pa.md (begin_brtab): Delete insn.
+ (end_brtab): Likewise.
+
+2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline:
+ 2014-08-15 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * doc/invoke.texi (SH options): Document missing processor variant
+ options. Remove references to Hitachi. Undocument deprecated mspace
+ option.
+
+2014-08-15 Tom de Vries <tom@codesourcery.com>
+
+ Backport from mainline:
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
+
+ PR rtl-optimization/62004
+ PR rtl-optimization/62030
+ * ifcvt.c (rtx_interchangeable_p): New function.
+ (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p.
+
+ 2014-08-05 Richard Biener <rguenther@suse.de>
+
+ * emit-rtl.h (mem_attrs_eq_p): Declare.
+ * emit-rtl.c (mem_attrs_eq_p): Export.
+
+2014-08-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/62092
+ * gimplify.c (gimplify_adjust_omp_clauses_1): Don't remove
+ OMP_CLAUSE_SHARED for global vars if the global var is mentioned
+ in OMP_CLAUSE_MAP in some outer target region.
+
+>>>>>>> .r214216
+2014-08-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/61713
+ * gcc/optabs.c (expand_atomic_test_and_set): Do not try to emit
+ move to subtarget in serial version if result is ignored.
+
+2014-08-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR middle-end/62103
+ * gimple-fold.c (fold_ctor_reference): Don't fold in presence of
+ bitfields, that is when size doesn't match the size of type or the
+ size of the constructor.
+
+2014-08-12 Felix Yang <fei.yang0953@gmail.com>
+
+ PR tree-optimization/62073
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Check that DEF1 has
+ a basic block.
+
+2014-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/62025
+ * sched-deps.c (find_inc): Check if inc_insn doesn't clobber
+ any registers that are used in mem_insn.
+
+2014-08-12 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport patch from mainline
+ 2014-08-11 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * config/rs6000/constraints.md (wh constraint): New constraint,
+ for FP registers if direct move is available.
+ (wi constraint): New constraint, for VSX/FP registers that can
+ handle 64-bit integers.
+ (wj constraint): New constraint for VSX/FP registers that can
+ handle 64-bit integers for direct moves.
+ (wk constraint): New constraint for VSX/FP registers that can
+ handle 64-bit doubles for direct moves.
+ (wy constraint): Make documentation match implementation.
+
+ * config/rs6000/rs6000.c (struct rs6000_reg_addr): Add
+ scalar_in_vmx_p field to simplify tests of whether SFmode or
+ DFmode can go in the Altivec registers.
+ (rs6000_hard_regno_mode_ok): Use scalar_in_vmx_p field.
+ (rs6000_setup_reg_addr_masks): Likewise.
+ (rs6000_debug_print_mode): Add debug support for scalar_in_vmx_p
+ field, and wh/wi/wj/wk constraints.
+ (rs6000_init_hard_regno_mode_ok): Setup scalar_in_vmx_p field, and
+ the wh/wi/wj/wk constraints.
+ (rs6000_preferred_reload_class): If SFmode/DFmode can go in the
+ upper registers, prefer VSX registers unless the operation is a
+ memory operation with REG+OFFSET addressing.
+
+ * config/rs6000/vsx.md (VSr mode attribute): Add support for
+ DImode. Change SFmode to use ww constraint instead of d to allow
+ SF registers in the upper registers.
+ (VSr2): Likewise.
+ (VSr3): Likewise.
+ (VSr5): Fix thinko in comment.
+ (VSa): New mode attribute that is an alternative to wa, that
+ returns the VSX register class that a mode can go in, but may not
+ be the preferred register class.
+ (VS_64dm): New mode attribute for appropriate register classes for
+ referencing 64-bit elements of vectors for direct moves and normal
+ moves.
+ (VS_64reg): Likewise.
+ (vsx_mov<mode>): Change wa constraint to <VSa> to limit the
+ register allocator to only registers the data type can handle.
+ (vsx_le_perm_load_<mode>): Likewise.
+ (vsx_le_perm_store_<mode>): Likewise.
+ (vsx_xxpermdi2_le_<mode>): Likewise.
+ (vsx_xxpermdi4_le_<mode>): Likewise.
+ (vsx_lxvd2x2_le_<mode>): Likewise.
+ (vsx_lxvd2x4_le_<mode>): Likewise.
+ (vsx_stxvd2x2_le_<mode>): Likewise.
+ (vsx_add<mode>3): Likewise.
+ (vsx_sub<mode>3): Likewise.
+ (vsx_mul<mode>3): Likewise.
+ (vsx_div<mode>3): Likewise.
+ (vsx_tdiv<mode>3_internal): Likewise.
+ (vsx_fre<mode>2): Likewise.
+ (vsx_neg<mode>2): Likewise.
+ (vsx_abs<mode>2): Likewise.
+ (vsx_nabs<mode>2): Likewise.
+ (vsx_smax<mode>3): Likewise.
+ (vsx_smin<mode>3): Likewise.
+ (vsx_sqrt<mode>2): Likewise.
+ (vsx_rsqrte<mode>2): Likewise.
+ (vsx_tsqrt<mode>2_internal): Likewise.
+ (vsx_fms<mode>4): Likewise.
+ (vsx_nfma<mode>4): Likewise.
+ (vsx_eq<mode>): Likewise.
+ (vsx_gt<mode>): Likewise.
+ (vsx_ge<mode>): Likewise.
+ (vsx_eq<mode>_p): Likewise.
+ (vsx_gt<mode>_p): Likewise.
+ (vsx_ge<mode>_p): Likewise.
+ (vsx_xxsel<mode>): Likewise.
+ (vsx_xxsel<mode>_uns): Likewise.
+ (vsx_copysign<mode>3): Likewise.
+ (vsx_float<VSi><mode>2): Likewise.
+ (vsx_floatuns<VSi><mode>2): Likewise.
+ (vsx_fix_trunc<mode><VSi>2): Likewise.
+ (vsx_fixuns_trunc<mode><VSi>2): Likewise.
+ (vsx_x<VSv>r<VSs>i): Likewise.
+ (vsx_x<VSv>r<VSs>ic): Likewise.
+ (vsx_btrunc<mode>2): Likewise.
+ (vsx_b2trunc<mode>2): Likewise.
+ (vsx_floor<mode>2): Likewise.
+ (vsx_ceil<mode>2): Likewise.
+ (vsx_<VS_spdp_insn>): Likewise.
+ (vsx_xscvspdp): Likewise.
+ (vsx_xvcvspuxds): Likewise.
+ (vsx_float_fix_<mode>2): Likewise.
+ (vsx_set_<mode>): Likewise.
+ (vsx_extract_<mode>_internal1): Likewise.
+ (vsx_extract_<mode>_internal2): Likewise.
+ (vsx_extract_<mode>_load): Likewise.
+ (vsx_extract_<mode>_store): Likewise.
+ (vsx_splat_<mode>): Likewise.
+ (vsx_xxspltw_<mode>): Likewise.
+ (vsx_xxspltw_<mode>_direct): Likewise.
+ (vsx_xxmrghw_<mode>): Likewise.
+ (vsx_xxmrglw_<mode>): Likewise.
+ (vsx_xxsldwi_<mode>): Likewise.
+ (vsx_xscvdpspn): Tighten constraints to only use register classes
+ the types use.
+ (vsx_xscvspdpn): Likewise.
+ (vsx_xscvdpspn_scalar): Likewise.
+
+ * config/rs6000/rs6000.h (enum rs6000_reg_class_enum): Add wh, wi,
+ wj, and wk constraints.
+ (GPR_REG_CLASS_P): New helper macro for register classes targeting
+ general purpose registers.
+
+ * config/rs6000/rs6000.md (f32_dm): Use wh constraint for SDmode
+ direct moves.
+ (zero_extendsidi2_lfiwz): Use wj constraint for direct move of
+ DImode instead of wm. Use wk constraint for direct move of DFmode
+ instead of wm.
+ (extendsidi2_lfiwax): Likewise.
+ (lfiwax): Likewise.
+ (lfiwzx): Likewise.
+ (movdi_internal64): Likewise.
+
+ * doc/md.texi (PowerPC and IBM RS6000): Document wh, wi, wj, and
+ wk constraints. Make the wy constraint documentation match them
+ implementation.
+
+2014-08-12 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
+
+ Backport from mainline
+ 2014-08-04 Ganesh Gopalasubramanian
+ <Ganesh.Gopalasubramanian@amd.com>
+
+ * config/i386/i386.c (ix86_option_override_internal): Add
+ PTA_RDRND and PTA_MOVBE for bdver4.
+
+2014-08-12 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
+
+ Backport from mainline
+ 2014-08-04 Ganesh Gopalasubramanian
+ <Ganesh.Gopalasubramanian@amd.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Handle AMD's extended
+ family information. Handle BTVER2 cpu with cpuid family value.
+
+2014-08-12 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
+
+ Backport from mainline
+ 2014-06-16 Ganesh Gopalasubramanian
+ <Ganesh.Gopalasubramanian@amd.com>
+
+ * config/i386/i386.c (ix86_expand_sse2_mulvxdi3): Issue
+ instructions "vpmuludq" and "vpaddq" instead of "vpmacsdql" for
+ handling 32-bit multiplication.
+
+2014-08-08 Guozhi Wei <carrot@google.com>
+
+ * config/rs6000/rs6000.md (*movdi_internal64): Add a new constraint.
+
+2014-08-07 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/sse.md (vec_extract_lo_<mode><mask_name>): Fix
+ constraint.
+
+2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR debug/61923
+ * haifa-sched.c (advance_one_cycle): Fix dump.
+ (schedule_block): Don't advance cycle if we are already at the
+ beginning of the cycle.
+
+2014-08-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/61320
+ * tree-ssa-loop-ivopts.c (may_be_unaligned_p): Properly
+ handle misaligned loads.
+
+2014-08-04 Rohit <rohitarulraj@freescale.com>
+
+ PR target/60102
+ * config/rs6000/rs6000.c
+ (rs6000_reg_names): Add SPE high register names.
+ (alt_reg_names): Likewise.
+ (rs6000_dwarf_register_span): For SPE high registers, replace
+ dwarf register numbers with GCC hard register numbers.
+ (rs6000_init_dwarf_reg_sizes_extra): Likewise.
+ (rs6000_dbx_register_number): For SPE high registers, return dwarf
+ register number for the corresponding GCC hard register number.
+ * config/rs6000/rs6000.h
+ (FIRST_PSEUDO_REGISTER): Update based on 32 newly added GCC hard
+ register numbers for SPE high registers.
+ (DWARF_FRAME_REGISTERS): Likewise.
+ (DWARF_REG_TO_UNWIND_COLUMN): Likewise.
+ (DWARF_FRAME_REGNUM): Likewise.
+ (FIXED_REGISTERS): Likewise.
+ (CALL_USED_REGISTERS): Likewise.
+ (CALL_REALLY_USED_REGISTERS): Likewise.
+ (REG_ALLOC_ORDER): Likewise.
+ (enum reg_class): Likewise.
+ (REG_CLASS_NAMES): Likewise.
+ (REG_CLASS_CONTENTS): Likewise.
+ (SPE_HIGH_REGNO_P): New macro to identify SPE high registers.
+
+2014-08-01 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra-constraints.c (remove_inheritance_pseudos): Process
+ destination pseudo too.
+
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR tree-optimization/61375
+ * tree-ssa-math-opts.c (find_bswap_or_nop_1): Cancel optimization if
+ symbolic number cannot be represented in an unsigned HOST_WIDE_INT.
+ (execute_optimize_bswap): Cancel optimization if CHAR_BIT != 8.
+
+2014-08-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/61964
+ * tree-ssa-tail-merge.c (gimple_equal_p): Handle non-SSA LHS solely
+ by structural equality.
+
2014-07-31 Oleg Endo <olegendo@gcc.gnu.org>
Backport from mainline
diff --git a/gcc-4.9/gcc/DATESTAMP b/gcc-4.9/gcc/DATESTAMP
index 06fdc7792..2cd35d408 100644
--- a/gcc-4.9/gcc/DATESTAMP
+++ b/gcc-4.9/gcc/DATESTAMP
@@ -1 +1 @@
-20140801
+20140827
diff --git a/gcc-4.9/gcc/Makefile.in b/gcc-4.9/gcc/Makefile.in
index f94b35a1e..868054981 100644
--- a/gcc-4.9/gcc/Makefile.in
+++ b/gcc-4.9/gcc/Makefile.in
@@ -773,7 +773,7 @@ GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
-PROFILE_TOOL_INSTALL_NAME := $(shell echo profile_tool|sed '$(program_transform_name)')
+GCOV_TOOL_INSTALL_NAME := $(shell echo gcov-tool|sed '$(program_transform_name)')
# Setup the testing framework, if you have one
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
@@ -3243,13 +3243,6 @@ install-common: native lang.install-common installdirs
rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
fi
-# Install profile_tool if it is available.
- -if [ -f $(srcdir)/../contrib/profile_tool ]; \
- then \
- rm -f $(DESTDIR)$(bindir)/$(PROFILE_TOOL_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) $(srcdir)/../contrib/profile_tool \
- $(DESTDIR)$(bindir)/$(PROFILE_TOOL_INSTALL_NAME)$(exeext); \
- fi
# Install gcov-tool if it was compiled.
-if [ -f gcov-tool$(exeext) ]; \
then \
diff --git a/gcc-4.9/gcc/ada/ChangeLog b/gcc-4.9/gcc/ada/ChangeLog
index 27d4ad7cb..c8c4d807b 100644
--- a/gcc-4.9/gcc/ada/ChangeLog
+++ b/gcc-4.9/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
+ * gsocket.h Add include of <unistd.h> on RTEMS.
+
+2014-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * s-osinte-rtems.adb: Correct formatting of line in license block.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/gcc/ada/gsocket.h b/gcc-4.9/gcc/ada/gsocket.h
index e21d71427..1d9235f4a 100644
--- a/gcc-4.9/gcc/ada/gsocket.h
+++ b/gcc-4.9/gcc/ada/gsocket.h
@@ -183,6 +183,11 @@
#include <sys/time.h>
#endif
+#if defined(__rtems__)
+#include <unistd.h>
+/* Required, for read(), write(), and close() */
+#endif
+
/*
* RTEMS has these .h files but not until you have built and installed RTEMS.
* When building a C/C++ toolset, you also build the newlib C library, so the
diff --git a/gcc-4.9/gcc/ada/s-osinte-rtems.adb b/gcc-4.9/gcc/ada/s-osinte-rtems.adb
index de2178594..9f01128c9 100644
--- a/gcc-4.9/gcc/ada/s-osinte-rtems.adb
+++ b/gcc-4.9/gcc/ada/s-osinte-rtems.adb
@@ -22,7 +22,7 @@
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
--- <http://www.gnu.org/licenses/>.
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. It is --
-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
diff --git a/gcc-4.9/gcc/ada/socket.c b/gcc-4.9/gcc/ada/socket.c
index 18999b394..e65845628 100644
--- a/gcc-4.9/gcc/ada/socket.c
+++ b/gcc-4.9/gcc/ada/socket.c
@@ -212,7 +212,7 @@ __gnat_gethostbyname (const char *name,
struct hostent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
#else
rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
diff --git a/gcc-4.9/gcc/auto-profile.c b/gcc-4.9/gcc/auto-profile.c
index ddc2d5e9f..11c20164e 100644
--- a/gcc-4.9/gcc/auto-profile.c
+++ b/gcc-4.9/gcc/auto-profile.c
@@ -958,6 +958,7 @@ read_aux_modules (void)
module_infos = XCNEWVEC (gcov_module_info *, num_aux_modules + 1);
module_infos[0] = module;
primary_module_id = module->ident;
+ record_module_name (module->ident, lbasename (in_fnames[0]));
if (aux_modules == NULL)
return;
unsigned curr_module = 1, max_group = PARAM_VALUE (PARAM_MAX_LIPO_GROUP);
@@ -1004,6 +1005,7 @@ read_aux_modules (void)
}
module_infos[curr_module++] = aux_module;
add_input_filename (*iter);
+ record_module_name (aux_module->ident, lbasename (*iter));
}
}
diff --git a/gcc-4.9/gcc/bb-reorder.c b/gcc-4.9/gcc/bb-reorder.c
index fa6f62fbe..b9a829e40 100644
--- a/gcc-4.9/gcc/bb-reorder.c
+++ b/gcc-4.9/gcc/bb-reorder.c
@@ -95,7 +95,6 @@
#include "expr.h"
#include "params.h"
#include "diagnostic-core.h"
-#include "toplev.h" /* user_defined_section_attribute */
#include "tree-pass.h"
#include "df.h"
#include "bb-reorder.h"
@@ -2555,7 +2554,7 @@ gate_handle_partition_blocks (void)
we are going to omit the reordering. */
&& optimize_function_for_speed_p (cfun)
&& !DECL_ONE_ONLY (current_function_decl)
- && !user_defined_section_attribute);
+ && !DECL_HAS_EXPLICIT_SECTION_NAME_P(current_function_decl));
}
/* This function is the main 'entrance' for the optimization that
diff --git a/gcc-4.9/gcc/c-family/ChangeLog b/gcc-4.9/gcc/c-family/ChangeLog
index cbe8b06cf..e3c8c8300 100644
--- a/gcc-4.9/gcc/c-family/ChangeLog
+++ b/gcc-4.9/gcc/c-family/ChangeLog
@@ -1,3 +1,15 @@
+2014-08-12 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/61962
+ * array-notation-common.c (find_rank): Added handling for other
+ types of references.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR middle-end/61455
+ * array-notation-common.c (extract_array_notation_exprs): Handling
+ of DECL_EXPR added.
+
2014-07-17 Richard Biener <rguenther@suse.de>
Backport from mainline
diff --git a/gcc-4.9/gcc/c-family/array-notation-common.c b/gcc-4.9/gcc/c-family/array-notation-common.c
index c0100398a..f8bce04bb 100644
--- a/gcc-4.9/gcc/c-family/array-notation-common.c
+++ b/gcc-4.9/gcc/c-family/array-notation-common.c
@@ -221,11 +221,14 @@ find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn,
current_rank++;
ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
}
- else if (TREE_CODE (ii_tree) == ARRAY_REF)
+ else if (handled_component_p (ii_tree)
+ || TREE_CODE (ii_tree) == INDIRECT_REF)
ii_tree = TREE_OPERAND (ii_tree, 0);
else if (TREE_CODE (ii_tree) == PARM_DECL
|| TREE_CODE (ii_tree) == VAR_DECL)
break;
+ else
+ gcc_unreachable ();
}
if (*rank == 0)
/* In this case, all the expressions this function has encountered thus
@@ -329,6 +332,14 @@ extract_array_notation_exprs (tree node, bool ignore_builtin_fn,
vec_safe_push (*array_list, node);
return;
}
+ if (TREE_CODE (node) == DECL_EXPR)
+ {
+ tree x = DECL_EXPR_DECL (node);
+ if (DECL_INITIAL (x))
+ extract_array_notation_exprs (DECL_INITIAL (x),
+ ignore_builtin_fn,
+ array_list);
+ }
else if (TREE_CODE (node) == STATEMENT_LIST)
{
tree_stmt_iterator ii_tsi;
diff --git a/gcc-4.9/gcc/c-family/c-common.c b/gcc-4.9/gcc/c-family/c-common.c
index 65c25bf17..9923928fe 100644
--- a/gcc-4.9/gcc/c-family/c-common.c
+++ b/gcc-4.9/gcc/c-family/c-common.c
@@ -7378,8 +7378,6 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
if (targetm_common.have_named_sections)
{
- user_defined_section_attribute = true;
-
if ((TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL)
&& TREE_CODE (TREE_VALUE (args)) == STRING_CST)
diff --git a/gcc-4.9/gcc/c/ChangeLog b/gcc-4.9/gcc/c/ChangeLog
index 4816d5c67..6fb49c62c 100644
--- a/gcc-4.9/gcc/c/ChangeLog
+++ b/gcc-4.9/gcc/c/ChangeLog
@@ -1,3 +1,15 @@
+2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/62008
+ * c-parser.c (c_parser_array_notation): Check for correct
+ type of an array added.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR middle-end/61455
+ * c-array-notation.c (expand_array_notations): Handling
+ of DECL_EXPR added.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/gcc/c/c-array-notation.c b/gcc-4.9/gcc/c/c-array-notation.c
index 2305e1e03..be08f532e 100644
--- a/gcc-4.9/gcc/c/c-array-notation.c
+++ b/gcc-4.9/gcc/c/c-array-notation.c
@@ -1265,6 +1265,25 @@ expand_array_notations (tree *tp, int *walk_subtrees, void *)
rhs_loc, rhs, TREE_TYPE (rhs));
}
break;
+ case DECL_EXPR:
+ {
+ tree x = DECL_EXPR_DECL (*tp);
+ if (DECL_INITIAL (x))
+ {
+ location_t loc = DECL_SOURCE_LOCATION (x);
+ tree lhs = x;
+ tree rhs = DECL_INITIAL (x);
+ DECL_INITIAL (x) = NULL;
+ tree new_modify_expr = build_modify_expr (loc, lhs,
+ TREE_TYPE (lhs),
+ NOP_EXPR,
+ loc, rhs,
+ TREE_TYPE(rhs));
+ expand_array_notations (&new_modify_expr, walk_subtrees, NULL);
+ *tp = new_modify_expr;
+ }
+ }
+ break;
case CALL_EXPR:
*tp = fix_array_notation_call_expr (*tp);
break;
diff --git a/gcc-4.9/gcc/c/c-parser.c b/gcc-4.9/gcc/c/c-parser.c
index a51af2e30..6ce277c9b 100644
--- a/gcc-4.9/gcc/c/c-parser.c
+++ b/gcc-4.9/gcc/c/c-parser.c
@@ -14074,6 +14074,13 @@ c_parser_array_notation (location_t loc, c_parser *parser, tree initial_index,
array_type = TREE_TYPE (array_value);
gcc_assert (array_type);
+ if (TREE_CODE (array_type) != ARRAY_TYPE
+ && TREE_CODE (array_type) != POINTER_TYPE)
+ {
+ error_at (loc, "base of array section must be pointer or array type");
+ c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
+ return error_mark_node;
+ }
type = TREE_TYPE (array_type);
token = c_parser_peek_token (parser);
diff --git a/gcc-4.9/gcc/cgraphunit.c b/gcc-4.9/gcc/cgraphunit.c
index 83e436f76..bff2833a1 100644
--- a/gcc-4.9/gcc/cgraphunit.c
+++ b/gcc-4.9/gcc/cgraphunit.c
@@ -1051,6 +1051,7 @@ analyze_functions (void)
struct cgraph_node *origin_node
= cgraph_get_node (DECL_ABSTRACT_ORIGIN (decl));
origin_node->used_as_abstract_origin = true;
+ enqueue_node (origin_node);
}
}
else
diff --git a/gcc-4.9/gcc/config/arm/vfp.md b/gcc-4.9/gcc/config/arm/vfp.md
index e1a48eeea..76464849d 100644
--- a/gcc-4.9/gcc/config/arm/vfp.md
+++ b/gcc-4.9/gcc/config/arm/vfp.md
@@ -1254,17 +1254,15 @@
)
(define_insn "*combine_vcvtf2i"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (fix:SI (fix:SF (mult:SF (match_operand:SF 1 "s_register_operand" "t")
+ [(set (match_operand:SI 0 "s_register_operand" "=t")
+ (fix:SI (fix:SF (mult:SF (match_operand:SF 1 "s_register_operand" "0")
(match_operand 2
"const_double_vcvt_power_of_two" "Dp")))))]
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math"
- "vcvt%?.s32.f32\\t%1, %1, %v2\;vmov%?\\t%0, %1"
+ "vcvt%?.s32.f32\\t%0, %1, %v2"
[(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "no")
- (set_attr "ce_count" "2")
- (set_attr "type" "f_cvtf2i")
- (set_attr "length" "8")]
+ (set_attr "type" "f_cvtf2i")]
)
;; Store multiple insn used in function prologue.
diff --git a/gcc-4.9/gcc/config/i386/driver-i386.c b/gcc-4.9/gcc/config/i386/driver-i386.c
index 80f6a0879..722c54692 100644
--- a/gcc-4.9/gcc/config/i386/driver-i386.c
+++ b/gcc-4.9/gcc/config/i386/driver-i386.c
@@ -431,7 +431,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
model = (eax >> 4) & 0x0f;
family = (eax >> 8) & 0x0f;
- if (vendor == signature_INTEL_ebx)
+ if (vendor == signature_INTEL_ebx
+ || vendor == signature_AMD_ebx)
{
unsigned int extended_model, extended_family;
@@ -570,7 +571,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (name == signature_NSC_ebx)
processor = PROCESSOR_GEODE;
- else if (has_movbe)
+ else if (has_movbe && family == 22)
processor = PROCESSOR_BTVER2;
else if (has_avx2)
processor = PROCESSOR_BDVER4;
diff --git a/gcc-4.9/gcc/config/i386/i386.c b/gcc-4.9/gcc/config/i386/i386.c
index 70f18ad7b..85ceff337 100644
--- a/gcc-4.9/gcc/config/i386/i386.c
+++ b/gcc-4.9/gcc/config/i386/i386.c
@@ -3259,12 +3259,13 @@ ix86_option_override_internal (bool main_args_p,
| PTA_FMA | PTA_PRFCHW | PTA_FXSR | PTA_XSAVE
| PTA_XSAVEOPT | PTA_FSGSBASE},
{"bdver4", PROCESSOR_BDVER4, CPU_BDVER4,
- PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
- | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_AVX2
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
+ | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_AVX2
| PTA_FMA4 | PTA_XOP | PTA_LWP | PTA_BMI | PTA_BMI2
| PTA_TBM | PTA_F16C | PTA_FMA | PTA_PRFCHW | PTA_FXSR
- | PTA_XSAVE | PTA_XSAVEOPT | PTA_FSGSBASE},
+ | PTA_XSAVE | PTA_XSAVEOPT | PTA_FSGSBASE | PTA_RDRND
+ | PTA_MOVBE},
{"btver1", PROCESSOR_BTVER1, CPU_GENERIC,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSSE3 | PTA_SSE4A |PTA_ABM | PTA_CX16 | PTA_PRFCHW
@@ -45348,8 +45349,10 @@ ix86_expand_sse2_mulvxdi3 (rtx op0, rtx op1, rtx op2)
/* t4: ((B*E)+(A*F))<<32, ((D*G)+(C*H))<<32 */
emit_insn (gen_ashlv2di3 (t4, t3, GEN_INT (32)));
- /* op0: (((B*E)+(A*F))<<32)+(B*F), (((D*G)+(C*H))<<32)+(D*H) */
- emit_insn (gen_xop_pmacsdql (op0, op1, op2, t4));
+ /* Multiply lower parts and add all */
+ t5 = gen_reg_rtx (V2DImode);
+ emit_insn (gen_vec_widen_umult_even_v4si (t5, gen_lowpart (V4SImode, op1), gen_lowpart (V4SImode, op2)));
+ op0 = expand_binop (mode, add_optab, t5, t4, op0, 1, OPTAB_DIRECT);
}
else
{
diff --git a/gcc-4.9/gcc/config/i386/i386.h b/gcc-4.9/gcc/config/i386/i386.h
index 51659deb3..b3b7c8d30 100644
--- a/gcc-4.9/gcc/config/i386/i386.h
+++ b/gcc-4.9/gcc/config/i386/i386.h
@@ -457,6 +457,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
ix86_tune_features[X86_TUNE_SPLIT_MEM_OPND_FOR_FP_CONVERTS]
#define TARGET_ADJUST_UNROLL \
ix86_tune_features[X86_TUNE_ADJUST_UNROLL]
+#define TARGET_AVOID_FALSE_DEP_FOR_BMI \
+ ix86_tune_features[X86_TUNE_AVOID_FALSE_DEP_FOR_BMI]
/* Feature tests against the various architecture variations. */
enum ix86_arch_indices {
diff --git a/gcc-4.9/gcc/config/i386/i386.md b/gcc-4.9/gcc/config/i386/i386.md
index 058702904..39d395875 100644
--- a/gcc-4.9/gcc/config/i386/i386.md
+++ b/gcc-4.9/gcc/config/i386/i386.md
@@ -111,6 +111,7 @@
UNSPEC_LEA_ADDR
UNSPEC_XBEGIN_ABORT
UNSPEC_STOS
+ UNSPEC_INSN_FALSE_DEP
;; For SSE/MMX support:
UNSPEC_FIX_NOTRUNC
@@ -11878,7 +11879,8 @@
DONE;
}
- flags_mode = TARGET_BMI ? CCCmode : CCZmode;
+ flags_mode
+ = (TARGET_BMI && !TARGET_AVOID_FALSE_DEP_FOR_BMI) ? CCCmode : CCZmode;
operands[2] = gen_reg_rtx (<MODE>mode);
operands[3] = gen_rtx_REG (flags_mode, FLAGS_REG);
@@ -11904,7 +11906,8 @@
(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (const_int 1)))
(clobber (reg:CC FLAGS_REG))])]
{
- enum machine_mode flags_mode = TARGET_BMI ? CCCmode : CCZmode;
+ enum machine_mode flags_mode
+ = (TARGET_BMI && !TARGET_AVOID_FALSE_DEP_FOR_BMI) ? CCCmode : CCZmode;
operands[3] = gen_lowpart (QImode, operands[2]);
operands[4] = gen_rtx_REG (flags_mode, FLAGS_REG);
@@ -11919,7 +11922,7 @@
(const_int 0)))
(set (match_operand:SWI48 0 "register_operand" "=r")
(ctz:SWI48 (match_dup 1)))]
- "TARGET_BMI"
+ "TARGET_BMI && !TARGET_AVOID_FALSE_DEP_FOR_BMI"
"tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
(set_attr "prefix_0f" "1")
@@ -11940,7 +11943,58 @@
(set_attr "btver2_decode" "double")
(set_attr "mode" "<MODE>")])
-(define_insn "ctz<mode>2"
+(define_expand "ctz<mode>2"
+ [(parallel
+ [(set (match_operand:SWI248 0 "register_operand")
+ (ctz:SWI248
+ (match_operand:SWI248 1 "nonimmediate_operand")))
+ (clobber (reg:CC FLAGS_REG))])])
+
+; False dependency happens when destination is only updated by tzcnt,
+; lzcnt or popcnt. There is no false dependency when destination is
+; also used in source.
+(define_insn_and_split "*ctz<mode>2_falsedep_1"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (ctz:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "(TARGET_BMI || TARGET_GENERIC)
+ && TARGET_AVOID_FALSE_DEP_FOR_BMI && optimize_function_for_speed_p (cfun)"
+ "#"
+ "&& reload_completed"
+ [(parallel
+ [(set (match_dup 0)
+ (ctz:SWI48 (match_dup 1)))
+ (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
+ (clobber (reg:CC FLAGS_REG))])]
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
+
+(define_insn "*ctz<mode>2_falsedep"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (ctz:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (unspec [(match_operand:SWI48 2 "register_operand" "0")]
+ UNSPEC_INSN_FALSE_DEP)
+ (clobber (reg:CC FLAGS_REG))]
+ ""
+{
+ if (TARGET_BMI)
+ return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
+ else if (TARGET_GENERIC)
+ /* tzcnt expands to 'rep bsf' and we can use it even if !TARGET_BMI. */
+ return "rep%; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
+ else
+ gcc_unreachable ();
+}
+ [(set_attr "type" "alu1")
+ (set_attr "prefix_0f" "1")
+ (set_attr "prefix_rep" "1")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "*ctz<mode>2"
[(set (match_operand:SWI248 0 "register_operand" "=r")
(ctz:SWI248 (match_operand:SWI248 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
@@ -11987,7 +12041,47 @@
operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode)-1);
})
-(define_insn "clz<mode>2_lzcnt"
+(define_expand "clz<mode>2_lzcnt"
+ [(parallel
+ [(set (match_operand:SWI248 0 "register_operand")
+ (clz:SWI248
+ (match_operand:SWI248 1 "nonimmediate_operand")))
+ (clobber (reg:CC FLAGS_REG))])]
+ "TARGET_LZCNT")
+
+(define_insn_and_split "*clz<mode>2_lzcnt_falsedep_1"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (clz:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_LZCNT
+ && TARGET_AVOID_FALSE_DEP_FOR_BMI && optimize_function_for_speed_p (cfun)"
+ "#"
+ "&& reload_completed"
+ [(parallel
+ [(set (match_dup 0)
+ (clz:SWI48 (match_dup 1)))
+ (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
+ (clobber (reg:CC FLAGS_REG))])]
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
+
+(define_insn "*clz<mode>2_lzcnt_falsedep"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (clz:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (unspec [(match_operand:SWI48 2 "register_operand" "0")]
+ UNSPEC_INSN_FALSE_DEP)
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_LZCNT"
+ "lzcnt{<imodesuffix>}\t{%1, %0|%0, %1}"
+ [(set_attr "prefix_rep" "1")
+ (set_attr "type" "bitmanip")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "*clz<mode>2_lzcnt"
[(set (match_operand:SWI248 0 "register_operand" "=r")
(clz:SWI248 (match_operand:SWI248 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
@@ -12270,10 +12364,39 @@
(set_attr "prefix_0f" "1")
(set_attr "mode" "HI")])
-(define_insn "popcount<mode>2"
- [(set (match_operand:SWI248 0 "register_operand" "=r")
- (popcount:SWI248
- (match_operand:SWI248 1 "nonimmediate_operand" "rm")))
+(define_expand "popcount<mode>2"
+ [(parallel
+ [(set (match_operand:SWI248 0 "register_operand")
+ (popcount:SWI248
+ (match_operand:SWI248 1 "nonimmediate_operand")))
+ (clobber (reg:CC FLAGS_REG))])]
+ "TARGET_POPCNT")
+
+(define_insn_and_split "*popcount<mode>2_falsedep_1"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (popcount:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_POPCNT
+ && TARGET_AVOID_FALSE_DEP_FOR_BMI && optimize_function_for_speed_p (cfun)"
+ "#"
+ "&& reload_completed"
+ [(parallel
+ [(set (match_dup 0)
+ (popcount:SWI48 (match_dup 1)))
+ (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
+ (clobber (reg:CC FLAGS_REG))])]
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
+
+(define_insn "*popcount<mode>2_falsedep"
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
+ (popcount:SWI48
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))
+ (unspec [(match_operand:SWI48 2 "register_operand" "0")]
+ UNSPEC_INSN_FALSE_DEP)
(clobber (reg:CC FLAGS_REG))]
"TARGET_POPCNT"
{
@@ -12287,15 +12410,12 @@
(set_attr "type" "bitmanip")
(set_attr "mode" "<MODE>")])
-(define_insn "*popcount<mode>2_cmp"
- [(set (reg FLAGS_REG)
- (compare
- (popcount:SWI248
- (match_operand:SWI248 1 "nonimmediate_operand" "rm"))
- (const_int 0)))
- (set (match_operand:SWI248 0 "register_operand" "=r")
- (popcount:SWI248 (match_dup 1)))]
- "TARGET_POPCNT && ix86_match_ccmode (insn, CCZmode)"
+(define_insn "*popcount<mode>2"
+ [(set (match_operand:SWI248 0 "register_operand" "=r")
+ (popcount:SWI248
+ (match_operand:SWI248 1 "nonimmediate_operand" "rm")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_POPCNT"
{
#if TARGET_MACHO
return "popcnt\t{%1, %0|%0, %1}";
@@ -12307,25 +12427,6 @@
(set_attr "type" "bitmanip")
(set_attr "mode" "<MODE>")])
-(define_insn "*popcountsi2_cmp_zext"
- [(set (reg FLAGS_REG)
- (compare
- (popcount:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))
- (const_int 0)))
- (set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI(popcount:SI (match_dup 1))))]
- "TARGET_64BIT && TARGET_POPCNT && ix86_match_ccmode (insn, CCZmode)"
-{
-#if TARGET_MACHO
- return "popcnt\t{%1, %0|%0, %1}";
-#else
- return "popcnt{l}\t{%1, %0|%0, %1}";
-#endif
-}
- [(set_attr "prefix_rep" "1")
- (set_attr "type" "bitmanip")
- (set_attr "mode" "SI")])
-
(define_expand "bswapdi2"
[(set (match_operand:DI 0 "register_operand")
(bswap:DI (match_operand:DI 1 "nonimmediate_operand")))]
diff --git a/gcc-4.9/gcc/config/i386/sse.md b/gcc-4.9/gcc/config/i386/sse.md
index b60a8226d..8d061da95 100644
--- a/gcc-4.9/gcc/config/i386/sse.md
+++ b/gcc-4.9/gcc/config/i386/sse.md
@@ -5994,9 +5994,9 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "vec_extract_lo_<mode><mask_name>"
- [(set (match_operand:<ssehalfvecmode> 0 "<store_mask_predicate>" "=<store_mask_constraint>")
+ [(set (match_operand:<ssehalfvecmode> 0 "<store_mask_predicate>" "=<store_mask_constraint>,v")
(vec_select:<ssehalfvecmode>
- (match_operand:V8FI 1 "nonimmediate_operand" "vm")
+ (match_operand:V8FI 1 "nonimmediate_operand" "v,m")
(parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)])))]
"TARGET_AVX512F && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
diff --git a/gcc-4.9/gcc/config/i386/x86-tune.def b/gcc-4.9/gcc/config/i386/x86-tune.def
index 839910267..c36174855 100644
--- a/gcc-4.9/gcc/config/i386/x86-tune.def
+++ b/gcc-4.9/gcc/config/i386/x86-tune.def
@@ -500,6 +500,11 @@ DEF_TUNE (X86_TUNE_NOT_VECTORMODE, "not_vectormode", m_K6)
DEF_TUNE (X86_TUNE_AVOID_VECTOR_DECODE, "avoid_vector_decode",
m_K8)
+/* X86_TUNE_AVOID_FALSE_DEP_FOR_BMI: Avoid false dependency
+ for bit-manipulation instructions. */
+DEF_TUNE (X86_TUNE_AVOID_FALSE_DEP_FOR_BMI, "avoid_false_dep_for_bmi",
+ m_SANDYBRIDGE | m_HASWELL | m_INTEL | m_GENERIC)
+
/*****************************************************************************/
/* This never worked well before. */
/*****************************************************************************/
diff --git a/gcc-4.9/gcc/config/nios2/rtems.h b/gcc-4.9/gcc/config/nios2/rtems.h
new file mode 100644
index 000000000..18caa5809
--- /dev/null
+++ b/gcc-4.9/gcc/config/nios2/rtems.h
@@ -0,0 +1,34 @@
+/* Definitions for rtems targeting a NIOS2 using ELF.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
+
+ Contributed by Chris Johns (chrisj@rtems.org).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Specify predefined symbols in preprocessor. */
+#define TARGET_OS_CPP_BUILTINS() \
+do { \
+ builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+} while (0)
+
+/* This toolchain implements the ABI for Linux Systems documented in the
+ Nios II Processor Reference Handbook.
+
+ This is done so RTEMS targets have Thread Local Storage like Linux. */
+#define TARGET_LINUX_ABI 1
diff --git a/gcc-4.9/gcc/config/nios2/t-rtems b/gcc-4.9/gcc/config/nios2/t-rtems
new file mode 100644
index 000000000..f95fa3c47
--- /dev/null
+++ b/gcc-4.9/gcc/config/nios2/t-rtems
@@ -0,0 +1,133 @@
+# Custom RTEMS multilibs
+
+MULTILIB_OPTIONS = mhw-mul mhw-mulx mhw-div mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254
+
+# Enumeration of multilibs
+
+# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fsubs=254
+# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mhw-div
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mul/mcustom-fsubs=254
+# MULTILIB_EXCEPTIONS += mhw-mul
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mhw-div
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-mulx/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-mulx
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mhw-div/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mhw-div
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mcustom-fadds=253/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fadds=253
+MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mcustom-fdivs=255/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fdivs=255
+MULTILIB_EXCEPTIONS += mcustom-fmuls=252/mcustom-fsubs=254
+MULTILIB_EXCEPTIONS += mcustom-fmuls=252
+MULTILIB_EXCEPTIONS += mcustom-fsubs=254
diff --git a/gcc-4.9/gcc/config/pa/pa-protos.h b/gcc-4.9/gcc/config/pa/pa-protos.h
index 2659dcdf0..1e48da512 100644
--- a/gcc-4.9/gcc/config/pa/pa-protos.h
+++ b/gcc-4.9/gcc/config/pa/pa-protos.h
@@ -49,6 +49,8 @@ extern const char *pa_output_mul_insn (int, rtx);
extern const char *pa_output_div_insn (rtx *, int, rtx);
extern const char *pa_output_mod_insn (int, rtx);
extern const char *pa_singlemove_string (rtx *);
+extern void pa_output_addr_vec (rtx, rtx);
+extern void pa_output_addr_diff_vec (rtx, rtx);
extern void pa_output_arg_descriptor (rtx);
extern void pa_output_global_address (FILE *, rtx, int);
extern void pa_print_operand (FILE *, rtx, int);
diff --git a/gcc-4.9/gcc/config/pa/pa.c b/gcc-4.9/gcc/config/pa/pa.c
index 871e4e5c6..5a7598ca7 100644
--- a/gcc-4.9/gcc/config/pa/pa.c
+++ b/gcc-4.9/gcc/config/pa/pa.c
@@ -4155,8 +4155,7 @@ static void
pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
rtx insn = get_last_insn ();
-
- last_address = 0;
+ bool extra_nop;
/* pa_expand_epilogue does the dirty work now. We just need
to output the assembler directives which denote the end
@@ -4180,8 +4179,10 @@ pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
if (insn && CALL_P (insn))
{
fputs ("\tnop\n", file);
- last_address += 4;
+ extra_nop = true;
}
+ else
+ extra_nop = false;
fputs ("\t.EXIT\n\t.PROCEND\n", file);
@@ -4194,12 +4195,13 @@ pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
cfun->machine->in_nsubspa = 2;
}
- /* Thunks do their own accounting. */
+ /* Thunks do their own insn accounting. */
if (cfun->is_thunk)
return;
if (INSN_ADDRESSES_SET_P ())
{
+ last_address = extra_nop ? 4 : 0;
insn = get_last_nonnote_insn ();
last_address += INSN_ADDRESSES (INSN_UID (insn));
if (INSN_P (insn))
@@ -8293,12 +8295,16 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
|| ((DECL_SECTION_NAME (thunk_fndecl)
== DECL_SECTION_NAME (function))
&& last_address < 262132)))
+ /* In this case, we need to be able to reach the start of
+ the stub table even though the function is likely closer
+ and can be jumped to directly. */
|| (targetm_common.have_named_sections
&& DECL_SECTION_NAME (thunk_fndecl) == NULL
&& DECL_SECTION_NAME (function) == NULL
- && last_address < 262132)
+ && total_code_bytes < MAX_PCREL17F_OFFSET)
+ /* Likewise. */
|| (!targetm_common.have_named_sections
- && last_address < 262132))))
+ && total_code_bytes < MAX_PCREL17F_OFFSET))))
{
if (!val_14)
output_asm_insn ("addil L'%2,%%r26", xoperands);
@@ -8944,40 +8950,15 @@ pa_following_call (rtx insn)
}
/* We use this hook to perform a PA specific optimization which is difficult
- to do in earlier passes.
-
- We surround the jump table itself with BEGIN_BRTAB and END_BRTAB
- insns. Those insns mark where we should emit .begin_brtab and
- .end_brtab directives when using GAS. This allows for better link
- time optimizations. */
+ to do in earlier passes. */
static void
pa_reorg (void)
{
- rtx insn;
-
remove_useless_addtr_insns (1);
if (pa_cpu < PROCESSOR_8000)
pa_combine_instructions ();
-
- /* Still need brtab marker insns. FIXME: the presence of these
- markers disables output of the branch table to readonly memory,
- and any alignment directives that might be needed. Possibly,
- the begin_brtab insn should be output before the label for the
- table. This doesn't matter at the moment since the tables are
- always output in the text section. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- /* Find an ADDR_VEC insn. */
- if (! JUMP_TABLE_DATA_P (insn))
- continue;
-
- /* Now generate markers for the beginning and end of the
- branch table. */
- emit_insn_before (gen_begin_brtab (), insn);
- emit_insn_after (gen_end_brtab (), insn);
- }
}
/* The PA has a number of odd instructions which can perform multiple
@@ -10572,4 +10553,46 @@ pa_legitimize_reload_address (rtx ad, enum machine_mode mode,
return NULL_RTX;
}
+/* Output address vector. */
+
+void
+pa_output_addr_vec (rtx lab, rtx body)
+{
+ int idx, vlen = XVECLEN (body, 0);
+
+ targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
+ if (TARGET_GAS)
+ fputs ("\t.begin_brtab\n", asm_out_file);
+ for (idx = 0; idx < vlen; idx++)
+ {
+ ASM_OUTPUT_ADDR_VEC_ELT
+ (asm_out_file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0)));
+ }
+ if (TARGET_GAS)
+ fputs ("\t.end_brtab\n", asm_out_file);
+}
+
+/* Output address difference vector. */
+
+void
+pa_output_addr_diff_vec (rtx lab, rtx body)
+{
+ rtx base = XEXP (XEXP (body, 0), 0);
+ int idx, vlen = XVECLEN (body, 1);
+
+ targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (lab));
+ if (TARGET_GAS)
+ fputs ("\t.begin_brtab\n", asm_out_file);
+ for (idx = 0; idx < vlen; idx++)
+ {
+ ASM_OUTPUT_ADDR_DIFF_ELT
+ (asm_out_file,
+ body,
+ CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)),
+ CODE_LABEL_NUMBER (base));
+ }
+ if (TARGET_GAS)
+ fputs ("\t.end_brtab\n", asm_out_file);
+}
+
#include "gt-pa.h"
diff --git a/gcc-4.9/gcc/config/pa/pa.h b/gcc-4.9/gcc/config/pa/pa.h
index ac3f0ebe7..f6c9751a2 100644
--- a/gcc-4.9/gcc/config/pa/pa.h
+++ b/gcc-4.9/gcc/config/pa/pa.h
@@ -1193,6 +1193,16 @@ do { \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
fprintf (FILE, "\t.word L$%04d-L$%04d\n", VALUE, REL)
+/* This is how to output an absolute case-vector. */
+
+#define ASM_OUTPUT_ADDR_VEC(LAB,BODY) \
+ pa_output_addr_vec ((LAB),(BODY))
+
+/* This is how to output a relative case-vector. */
+
+#define ASM_OUTPUT_ADDR_DIFF_VEC(LAB,BODY) \
+ pa_output_addr_diff_vec ((LAB),(BODY))
+
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
diff --git a/gcc-4.9/gcc/config/pa/pa.md b/gcc-4.9/gcc/config/pa/pa.md
index e55d0b86b..a9421ac2e 100644
--- a/gcc-4.9/gcc/config/pa/pa.md
+++ b/gcc-4.9/gcc/config/pa/pa.md
@@ -8508,36 +8508,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(set_attr "type" "move")
(set_attr "length" "4")])
-;; These are just placeholders so we know where branch tables
-;; begin and end.
-(define_insn "begin_brtab"
- [(const_int 1)]
- ""
- "*
-{
- /* Only GAS actually supports this pseudo-op. */
- if (TARGET_GAS)
- return \".begin_brtab\";
- else
- return \"\";
-}"
- [(set_attr "type" "move")
- (set_attr "length" "0")])
-
-(define_insn "end_brtab"
- [(const_int 2)]
- ""
- "*
-{
- /* Only GAS actually supports this pseudo-op. */
- if (TARGET_GAS)
- return \".end_brtab\";
- else
- return \"\";
-}"
- [(set_attr "type" "move")
- (set_attr "length" "0")])
-
;;; EH does longjmp's from and within the data section. Thus,
;;; an interspace branch is required for the longjmp implementation.
;;; Registers r1 and r2 are used as scratch registers for the jump
diff --git a/gcc-4.9/gcc/config/rs6000/constraints.md b/gcc-4.9/gcc/config/rs6000/constraints.md
index 9d6a3bbe7..78a3ff0d2 100644
--- a/gcc-4.9/gcc/config/rs6000/constraints.md
+++ b/gcc-4.9/gcc/config/rs6000/constraints.md
@@ -68,6 +68,20 @@
(define_register_constraint "wg" "rs6000_constraints[RS6000_CONSTRAINT_wg]"
"If -mmfpgpr was used, a floating point register or NO_REGS.")
+(define_register_constraint "wh" "rs6000_constraints[RS6000_CONSTRAINT_wh]"
+ "Floating point register if direct moves are available, or NO_REGS.")
+
+;; At present, DImode is not allowed in the Altivec registers. If in the
+;; future it is allowed, wi/wj can be set to VSX_REGS instead of FLOAT_REGS.
+(define_register_constraint "wi" "rs6000_constraints[RS6000_CONSTRAINT_wi]"
+ "FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.")
+
+(define_register_constraint "wj" "rs6000_constraints[RS6000_CONSTRAINT_wj]"
+ "FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.")
+
+(define_register_constraint "wk" "rs6000_constraints[RS6000_CONSTRAINT_wk]"
+ "FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.")
+
(define_register_constraint "wl" "rs6000_constraints[RS6000_CONSTRAINT_wl]"
"Floating point register if the LFIWAX instruction is enabled or NO_REGS.")
@@ -101,7 +115,7 @@
"Floating point register if the STFIWX instruction is enabled or NO_REGS.")
(define_register_constraint "wy" "rs6000_constraints[RS6000_CONSTRAINT_wy]"
- "VSX vector register to hold scalar float values or NO_REGS.")
+ "FP or VSX register to perform ISA 2.07 float ops or NO_REGS.")
(define_register_constraint "wz" "rs6000_constraints[RS6000_CONSTRAINT_wz]"
"Floating point register if the LFIWZX instruction is enabled or NO_REGS.")
diff --git a/gcc-4.9/gcc/config/rs6000/rs6000.c b/gcc-4.9/gcc/config/rs6000/rs6000.c
index d7cbc6cde..28ccf86df 100644
--- a/gcc-4.9/gcc/config/rs6000/rs6000.c
+++ b/gcc-4.9/gcc/config/rs6000/rs6000.c
@@ -388,6 +388,7 @@ struct rs6000_reg_addr {
enum insn_code reload_gpr_vsx; /* INSN to move from GPR to VSX. */
enum insn_code reload_vsx_gpr; /* INSN to move from VSX to GPR. */
addr_mask_type addr_mask[(int)N_RELOAD_REG]; /* Valid address masks. */
+ bool scalar_in_vmx_p; /* Scalar value can go in VMX. */
};
static struct rs6000_reg_addr reg_addr[NUM_MACHINE_MODES];
@@ -1221,7 +1222,12 @@ char rs6000_reg_names[][8] =
/* Soft frame pointer. */
"sfp",
/* HTM SPR registers. */
- "tfhar", "tfiar", "texasr"
+ "tfhar", "tfiar", "texasr",
+ /* SPE High registers. */
+ "0", "1", "2", "3", "4", "5", "6", "7",
+ "8", "9", "10", "11", "12", "13", "14", "15",
+ "16", "17", "18", "19", "20", "21", "22", "23",
+ "24", "25", "26", "27", "28", "29", "30", "31"
};
#ifdef TARGET_REGNAMES
@@ -1249,7 +1255,12 @@ static const char alt_reg_names[][8] =
/* Soft frame pointer. */
"sfp",
/* HTM SPR registers. */
- "tfhar", "tfiar", "texasr"
+ "tfhar", "tfiar", "texasr",
+ /* SPE High registers. */
+ "%rh0", "%rh1", "%rh2", "%rh3", "%rh4", "%rh5", "%rh6", "%rh7",
+ "%rh8", "%rh9", "%rh10", "%r11", "%rh12", "%rh13", "%rh14", "%rh15",
+ "%rh16", "%rh17", "%rh18", "%rh19", "%rh20", "%rh21", "%rh22", "%rh23",
+ "%rh24", "%rh25", "%rh26", "%rh27", "%rh28", "%rh29", "%rh30", "%rh31"
};
#endif
@@ -1723,8 +1734,7 @@ rs6000_hard_regno_mode_ok (int regno, enum machine_mode mode)
asked for it. */
if (TARGET_VSX && VSX_REGNO_P (regno)
&& (VECTOR_MEM_VSX_P (mode)
- || (TARGET_VSX_SCALAR_FLOAT && mode == SFmode)
- || (TARGET_VSX_SCALAR_DOUBLE && (mode == DFmode || mode == DImode))
+ || reg_addr[mode].scalar_in_vmx_p
|| (TARGET_VSX_TIMODE && mode == TImode)
|| (TARGET_VADDUQM && mode == V1TImode)))
{
@@ -1733,10 +1743,7 @@ rs6000_hard_regno_mode_ok (int regno, enum machine_mode mode)
if (ALTIVEC_REGNO_P (regno))
{
- if (mode == SFmode && !TARGET_UPPER_REGS_SF)
- return 0;
-
- if ((mode == DFmode || mode == DImode) && !TARGET_UPPER_REGS_DF)
+ if (GET_MODE_SIZE (mode) != 16 && !reg_addr[mode].scalar_in_vmx_p)
return 0;
return ALTIVEC_REGNO_P (last_regno);
@@ -1916,14 +1923,16 @@ rs6000_debug_print_mode (ssize_t m)
if (rs6000_vector_unit[m] != VECTOR_NONE
|| rs6000_vector_mem[m] != VECTOR_NONE
|| (reg_addr[m].reload_store != CODE_FOR_nothing)
- || (reg_addr[m].reload_load != CODE_FOR_nothing))
+ || (reg_addr[m].reload_load != CODE_FOR_nothing)
+ || reg_addr[m].scalar_in_vmx_p)
{
fprintf (stderr,
- " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c",
+ " Vector-arith=%-10s Vector-mem=%-10s Reload=%c%c Upper=%c",
rs6000_debug_vector_unit (rs6000_vector_unit[m]),
rs6000_debug_vector_unit (rs6000_vector_mem[m]),
(reg_addr[m].reload_store != CODE_FOR_nothing) ? 's' : '*',
- (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*');
+ (reg_addr[m].reload_load != CODE_FOR_nothing) ? 'l' : '*',
+ (reg_addr[m].scalar_in_vmx_p) ? 'y' : 'n');
}
fputs ("\n", stderr);
@@ -2040,6 +2049,10 @@ rs6000_debug_reg_global (void)
"wd reg_class = %s\n"
"wf reg_class = %s\n"
"wg reg_class = %s\n"
+ "wh reg_class = %s\n"
+ "wi reg_class = %s\n"
+ "wj reg_class = %s\n"
+ "wk reg_class = %s\n"
"wl reg_class = %s\n"
"wm reg_class = %s\n"
"wr reg_class = %s\n"
@@ -2059,6 +2072,10 @@ rs6000_debug_reg_global (void)
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wd]],
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wf]],
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wg]],
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wh]],
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wi]],
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wj]],
+ reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wk]],
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wl]],
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wm]],
reg_class_names[rs6000_constraints[RS6000_CONSTRAINT_wr]],
@@ -2347,6 +2364,8 @@ rs6000_setup_reg_addr_masks (void)
for (m = 0; m < NUM_MACHINE_MODES; ++m)
{
+ enum machine_mode m2 = (enum machine_mode)m;
+
/* SDmode is special in that we want to access it only via REG+REG
addressing on power7 and above, since we want to use the LFIWZX and
STFIWZX instructions to load it. */
@@ -2381,13 +2400,12 @@ rs6000_setup_reg_addr_masks (void)
if (TARGET_UPDATE
&& (rc == RELOAD_REG_GPR || rc == RELOAD_REG_FPR)
- && GET_MODE_SIZE (m) <= 8
- && !VECTOR_MODE_P (m)
- && !COMPLEX_MODE_P (m)
+ && GET_MODE_SIZE (m2) <= 8
+ && !VECTOR_MODE_P (m2)
+ && !COMPLEX_MODE_P (m2)
&& !indexed_only_p
- && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m) == 8)
- && !(m == DFmode && TARGET_UPPER_REGS_DF)
- && !(m == SFmode && TARGET_UPPER_REGS_SF))
+ && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (m2) == 8)
+ && !reg_addr[m2].scalar_in_vmx_p)
{
addr_mask |= RELOAD_REG_PRE_INCDEC;
@@ -2618,37 +2636,44 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
f - Register class to use with traditional SFmode instructions.
v - Altivec register.
wa - Any VSX register.
+ wc - Reserved to represent individual CR bits (used in LLVM).
wd - Preferred register class for V2DFmode.
wf - Preferred register class for V4SFmode.
wg - Float register for power6x move insns.
+ wh - FP register for direct move instructions.
+ wi - FP or VSX register to hold 64-bit integers for VSX insns.
+ wj - FP or VSX register to hold 64-bit integers for direct moves.
+ wk - FP or VSX register to hold 64-bit doubles for direct moves.
wl - Float register if we can do 32-bit signed int loads.
wm - VSX register for ISA 2.07 direct move operations.
+ wn - always NO_REGS.
wr - GPR if 64-bit mode is permitted.
ws - Register class to do ISA 2.06 DF operations.
+ wt - VSX register for TImode in VSX registers.
wu - Altivec register for ISA 2.07 VSX SF/SI load/stores.
wv - Altivec register for ISA 2.06 VSX DF/DI load/stores.
- wt - VSX register for TImode in VSX registers.
ww - Register class to do SF conversions in with VSX operations.
wx - Float register if we can do 32-bit int stores.
wy - Register class to do ISA 2.07 SF operations.
wz - Float register if we can do 32-bit unsigned int loads. */
if (TARGET_HARD_FLOAT && TARGET_FPRS)
- rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_f] = FLOAT_REGS; /* SFmode */
if (TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
- rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_d] = FLOAT_REGS; /* DFmode */
if (TARGET_VSX)
{
rs6000_constraints[RS6000_CONSTRAINT_wa] = VSX_REGS;
- rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS;
- rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wd] = VSX_REGS; /* V2DFmode */
+ rs6000_constraints[RS6000_CONSTRAINT_wf] = VSX_REGS; /* V4SFmode */
+ rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS; /* DImode */
if (TARGET_VSX_TIMODE)
- rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wt] = VSX_REGS; /* TImode */
- if (TARGET_UPPER_REGS_DF)
+ if (TARGET_UPPER_REGS_DF) /* DFmode */
{
rs6000_constraints[RS6000_CONSTRAINT_ws] = VSX_REGS;
rs6000_constraints[RS6000_CONSTRAINT_wv] = ALTIVEC_REGS;
@@ -2662,19 +2687,26 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
if (TARGET_ALTIVEC)
rs6000_constraints[RS6000_CONSTRAINT_v] = ALTIVEC_REGS;
- if (TARGET_MFPGPR)
+ if (TARGET_MFPGPR) /* DFmode */
rs6000_constraints[RS6000_CONSTRAINT_wg] = FLOAT_REGS;
if (TARGET_LFIWAX)
- rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wl] = FLOAT_REGS; /* DImode */
if (TARGET_DIRECT_MOVE)
- rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
+ {
+ rs6000_constraints[RS6000_CONSTRAINT_wh] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wj] /* DImode */
+ = rs6000_constraints[RS6000_CONSTRAINT_wi];
+ rs6000_constraints[RS6000_CONSTRAINT_wk] /* DFmode */
+ = rs6000_constraints[RS6000_CONSTRAINT_ws];
+ rs6000_constraints[RS6000_CONSTRAINT_wm] = VSX_REGS;
+ }
if (TARGET_POWERPC64)
rs6000_constraints[RS6000_CONSTRAINT_wr] = GENERAL_REGS;
- if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF)
+ if (TARGET_P8_VECTOR && TARGET_UPPER_REGS_SF) /* SFmode */
{
rs6000_constraints[RS6000_CONSTRAINT_wu] = ALTIVEC_REGS;
rs6000_constraints[RS6000_CONSTRAINT_wy] = VSX_REGS;
@@ -2689,10 +2721,10 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
rs6000_constraints[RS6000_CONSTRAINT_ww] = FLOAT_REGS;
if (TARGET_STFIWX)
- rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS; /* DImode */
if (TARGET_LFIWZX)
- rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS;
+ rs6000_constraints[RS6000_CONSTRAINT_wz] = FLOAT_REGS; /* DImode */
/* Set up the reload helper and direct move functions. */
if (TARGET_VSX || TARGET_ALTIVEC)
@@ -2715,10 +2747,11 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_di_load;
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
{
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_di_store;
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_di_load;
+ reg_addr[DFmode].scalar_in_vmx_p = true;
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_di_store;
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_di_load;
}
if (TARGET_P8_VECTOR)
{
@@ -2726,6 +2759,8 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_di_load;
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_di_store;
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_di_load;
+ if (TARGET_UPPER_REGS_SF)
+ reg_addr[SFmode].scalar_in_vmx_p = true;
}
if (TARGET_VSX_TIMODE)
{
@@ -2782,10 +2817,11 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
reg_addr[V2DFmode].reload_load = CODE_FOR_reload_v2df_si_load;
if (TARGET_VSX && TARGET_UPPER_REGS_DF)
{
- reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
- reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
- reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
- reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
+ reg_addr[DFmode].reload_store = CODE_FOR_reload_df_si_store;
+ reg_addr[DFmode].reload_load = CODE_FOR_reload_df_si_load;
+ reg_addr[DFmode].scalar_in_vmx_p = true;
+ reg_addr[DDmode].reload_store = CODE_FOR_reload_dd_si_store;
+ reg_addr[DDmode].reload_load = CODE_FOR_reload_dd_si_load;
}
if (TARGET_P8_VECTOR)
{
@@ -2793,6 +2829,8 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
reg_addr[SFmode].reload_load = CODE_FOR_reload_sf_si_load;
reg_addr[SDmode].reload_store = CODE_FOR_reload_sd_si_store;
reg_addr[SDmode].reload_load = CODE_FOR_reload_sd_si_load;
+ if (TARGET_UPPER_REGS_SF)
+ reg_addr[SFmode].scalar_in_vmx_p = true;
}
if (TARGET_VSX_TIMODE)
{
@@ -2833,6 +2871,7 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
for (m = 0; m < NUM_MACHINE_MODES; ++m)
{
+ enum machine_mode m2 = (enum machine_mode)m;
int reg_size2 = reg_size;
/* TFmode/TDmode always takes 2 registers, even in VSX. */
@@ -2841,7 +2880,7 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
reg_size2 = UNITS_PER_FP_WORD;
rs6000_class_max_nregs[m][c]
- = (GET_MODE_SIZE (m) + reg_size2 - 1) / reg_size2;
+ = (GET_MODE_SIZE (m2) + reg_size2 - 1) / reg_size2;
}
}
@@ -17167,7 +17206,14 @@ rs6000_preferred_reload_class (rtx x, enum reg_class rclass)
prefer Altivec loads.. */
if (rclass == VSX_REGS)
{
- if (GET_MODE_SIZE (mode) <= 8)
+ if (MEM_P (x) && reg_addr[mode].scalar_in_vmx_p)
+ {
+ rtx addr = XEXP (x, 0);
+ if (rs6000_legitimate_offset_address_p (mode, addr, false, true)
+ || legitimate_lo_sum_address_p (mode, addr, false))
+ return FLOAT_REGS;
+ }
+ else if (GET_MODE_SIZE (mode) <= 8 && !reg_addr[mode].scalar_in_vmx_p)
return FLOAT_REGS;
if (VECTOR_UNIT_ALTIVEC_P (mode) || VECTOR_MEM_ALTIVEC_P (mode)
@@ -31171,13 +31217,13 @@ rs6000_dwarf_register_span (rtx reg)
{
if (BYTES_BIG_ENDIAN)
{
- parts[2 * i] = gen_rtx_REG (SImode, regno + 1200);
+ parts[2 * i] = gen_rtx_REG (SImode, regno + FIRST_SPE_HIGH_REGNO);
parts[2 * i + 1] = gen_rtx_REG (SImode, regno);
}
else
{
parts[2 * i] = gen_rtx_REG (SImode, regno);
- parts[2 * i + 1] = gen_rtx_REG (SImode, regno + 1200);
+ parts[2 * i + 1] = gen_rtx_REG (SImode, regno + FIRST_SPE_HIGH_REGNO);
}
}
@@ -31197,11 +31243,11 @@ rs6000_init_dwarf_reg_sizes_extra (tree address)
rtx mem = gen_rtx_MEM (BLKmode, addr);
rtx value = gen_int_mode (4, mode);
- for (i = 1201; i < 1232; i++)
+ for (i = FIRST_SPE_HIGH_REGNO; i < LAST_SPE_HIGH_REGNO+1; i++)
{
- int column = DWARF_REG_TO_UNWIND_COLUMN (i);
- HOST_WIDE_INT offset
- = DWARF_FRAME_REGNUM (column) * GET_MODE_SIZE (mode);
+ int column = DWARF_REG_TO_UNWIND_COLUMN
+ (DWARF2_FRAME_REG_OUT (DWARF_FRAME_REGNUM (i), true));
+ HOST_WIDE_INT offset = column * GET_MODE_SIZE (mode);
emit_move_insn (adjust_address (mem, mode, offset), value);
}
@@ -31220,9 +31266,9 @@ rs6000_init_dwarf_reg_sizes_extra (tree address)
for (i = FIRST_ALTIVEC_REGNO; i < LAST_ALTIVEC_REGNO+1; i++)
{
- int column = DWARF_REG_TO_UNWIND_COLUMN (i);
- HOST_WIDE_INT offset
- = DWARF_FRAME_REGNUM (column) * GET_MODE_SIZE (mode);
+ int column = DWARF_REG_TO_UNWIND_COLUMN
+ (DWARF2_FRAME_REG_OUT (DWARF_FRAME_REGNUM (i), true));
+ HOST_WIDE_INT offset = column * GET_MODE_SIZE (mode);
emit_move_insn (adjust_address (mem, mode, offset), value);
}
@@ -31254,9 +31300,8 @@ rs6000_dbx_register_number (unsigned int regno)
return 99;
if (regno == SPEFSCR_REGNO)
return 612;
- /* SPE high reg number. We get these values of regno from
- rs6000_dwarf_register_span. */
- gcc_assert (regno >= 1200 && regno < 1232);
+ if (SPE_HIGH_REGNO_P (regno))
+ return regno - FIRST_SPE_HIGH_REGNO + 1200;
return regno;
}
diff --git a/gcc-4.9/gcc/config/rs6000/rs6000.h b/gcc-4.9/gcc/config/rs6000/rs6000.h
index 2b5d033f8..f36386770 100644
--- a/gcc-4.9/gcc/config/rs6000/rs6000.h
+++ b/gcc-4.9/gcc/config/rs6000/rs6000.h
@@ -930,35 +930,36 @@ enum data_align { align_abi, align_opt, align_both };
The 3 HTM registers aren't also included in DWARF_FRAME_REGISTERS. */
-#define FIRST_PSEUDO_REGISTER 117
+#define FIRST_PSEUDO_REGISTER 149
/* This must be included for pre gcc 3.0 glibc compatibility. */
#define PRE_GCC3_DWARF_FRAME_REGISTERS 77
-/* Add 32 dwarf columns for synthetic SPE registers. */
-#define DWARF_FRAME_REGISTERS ((FIRST_PSEUDO_REGISTER - 4) + 32)
+/* True if register is an SPE High register. */
+#define SPE_HIGH_REGNO_P(N) \
+ ((N) >= FIRST_SPE_HIGH_REGNO && (N) <= LAST_SPE_HIGH_REGNO)
+
+/* SPE high registers added as hard regs.
+ The sfp register and 3 HTM registers
+ aren't included in DWARF_FRAME_REGISTERS. */
+#define DWARF_FRAME_REGISTERS (FIRST_PSEUDO_REGISTER - 4)
/* The SPE has an additional 32 synthetic registers, with DWARF debug
info numbering for these registers starting at 1200. While eh_frame
register numbering need not be the same as the debug info numbering,
- we choose to number these regs for eh_frame at 1200 too. This allows
- future versions of the rs6000 backend to add hard registers and
- continue to use the gcc hard register numbering for eh_frame. If the
- extra SPE registers in eh_frame were numbered starting from the
- current value of FIRST_PSEUDO_REGISTER, then if FIRST_PSEUDO_REGISTER
- changed we'd need to introduce a mapping in DWARF_FRAME_REGNUM to
- avoid invalidating older SPE eh_frame info.
+ we choose to number these regs for eh_frame at 1200 too.
We must map them here to avoid huge unwinder tables mostly consisting
of unused space. */
#define DWARF_REG_TO_UNWIND_COLUMN(r) \
- ((r) > 1200 ? ((r) - 1200 + (DWARF_FRAME_REGISTERS - 32)) : (r))
+ ((r) >= 1200 ? ((r) - 1200 + (DWARF_FRAME_REGISTERS - 32)) : (r))
/* Use standard DWARF numbering for DWARF debugging information. */
#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
/* Use gcc hard register numbering for eh_frame. */
-#define DWARF_FRAME_REGNUM(REGNO) (REGNO)
+#define DWARF_FRAME_REGNUM(REGNO) \
+ (SPE_HIGH_REGNO_P (REGNO) ? ((REGNO) - FIRST_SPE_HIGH_REGNO + 1200) : (REGNO))
/* Map register numbers held in the call frame info that gcc has
collected using DWARF_FRAME_REGNUM to those that should be output in
@@ -992,7 +993,10 @@ enum data_align { align_abi, align_opt, align_both };
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
1, 1 \
- , 1, 1, 1, 1, 1, 1 \
+ , 1, 1, 1, 1, 1, 1, \
+ /* SPE High registers. */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
}
/* 1 for registers not available across function calls.
@@ -1012,7 +1016,10 @@ enum data_align { align_abi, align_opt, align_both };
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
1, 1 \
- , 1, 1, 1, 1, 1, 1 \
+ , 1, 1, 1, 1, 1, 1, \
+ /* SPE High registers. */ \
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
}
/* Like `CALL_USED_REGISTERS' except this macro doesn't require that
@@ -1031,7 +1038,10 @@ enum data_align { align_abi, align_opt, align_both };
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0 \
- , 0, 0, 0, 0, 0, 0 \
+ , 0, 0, 0, 0, 0, 0, \
+ /* SPE High registers. */ \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
}
#define TOTAL_ALTIVEC_REGS (LAST_ALTIVEC_REGNO - FIRST_ALTIVEC_REGNO + 1)
@@ -1114,7 +1124,10 @@ enum data_align { align_abi, align_opt, align_both };
96, 95, 94, 93, 92, 91, \
108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, \
109, 110, \
- 111, 112, 113, 114, 115, 116 \
+ 111, 112, 113, 114, 115, 116, \
+ 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, \
+ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, \
+ 141, 142, 143, 144, 145, 146, 147, 148 \
}
/* True if register is floating-point. */
@@ -1349,6 +1362,7 @@ enum reg_class
CR_REGS,
NON_FLOAT_REGS,
CA_REGS,
+ SPE_HIGH_REGS,
ALL_REGS,
LIM_REG_CLASSES
};
@@ -1380,6 +1394,7 @@ enum reg_class
"CR_REGS", \
"NON_FLOAT_REGS", \
"CA_REGS", \
+ "SPE_HIGH_REGS", \
"ALL_REGS" \
}
@@ -1387,30 +1402,54 @@ enum reg_class
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
-#define REG_CLASS_CONTENTS \
-{ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
- { 0xfffffffe, 0x00000000, 0x00000008, 0x00020000 }, /* BASE_REGS */ \
- { 0xffffffff, 0x00000000, 0x00000008, 0x00020000 }, /* GENERAL_REGS */ \
- { 0x00000000, 0xffffffff, 0x00000000, 0x00000000 }, /* FLOAT_REGS */ \
- { 0x00000000, 0x00000000, 0xffffe000, 0x00001fff }, /* ALTIVEC_REGS */ \
- { 0x00000000, 0xffffffff, 0xffffe000, 0x00001fff }, /* VSX_REGS */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00002000 }, /* VRSAVE_REGS */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00004000 }, /* VSCR_REGS */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00008000 }, /* SPE_ACC_REGS */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00010000 }, /* SPEFSCR_REGS */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00040000 }, /* SPR_REGS */ \
- { 0xffffffff, 0xffffffff, 0x00000008, 0x00020000 }, /* NON_SPECIAL_REGS */ \
- { 0x00000000, 0x00000000, 0x00000002, 0x00000000 }, /* LINK_REGS */ \
- { 0x00000000, 0x00000000, 0x00000004, 0x00000000 }, /* CTR_REGS */ \
- { 0x00000000, 0x00000000, 0x00000006, 0x00000000 }, /* LINK_OR_CTR_REGS */ \
- { 0x00000000, 0x00000000, 0x00000006, 0x00002000 }, /* SPECIAL_REGS */ \
- { 0xffffffff, 0x00000000, 0x0000000e, 0x00022000 }, /* SPEC_OR_GEN_REGS */ \
- { 0x00000000, 0x00000000, 0x00000010, 0x00000000 }, /* CR0_REGS */ \
- { 0x00000000, 0x00000000, 0x00000ff0, 0x00000000 }, /* CR_REGS */ \
- { 0xffffffff, 0x00000000, 0x00000ffe, 0x00020000 }, /* NON_FLOAT_REGS */ \
- { 0x00000000, 0x00000000, 0x00001000, 0x00000000 }, /* CA_REGS */ \
- { 0xffffffff, 0xffffffff, 0xfffffffe, 0x0007ffff } /* ALL_REGS */ \
+#define REG_CLASS_CONTENTS \
+{ \
+ /* NO_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, \
+ /* BASE_REGS. */ \
+ { 0xfffffffe, 0x00000000, 0x00000008, 0x00020000, 0x00000000 }, \
+ /* GENERAL_REGS. */ \
+ { 0xffffffff, 0x00000000, 0x00000008, 0x00020000, 0x00000000 }, \
+ /* FLOAT_REGS. */ \
+ { 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000 }, \
+ /* ALTIVEC_REGS. */ \
+ { 0x00000000, 0x00000000, 0xffffe000, 0x00001fff, 0x00000000 }, \
+ /* VSX_REGS. */ \
+ { 0x00000000, 0xffffffff, 0xffffe000, 0x00001fff, 0x00000000 }, \
+ /* VRSAVE_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00002000, 0x00000000 }, \
+ /* VSCR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000 }, \
+ /* SPE_ACC_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000 }, \
+ /* SPEFSCR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000 }, \
+ /* SPR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0x00000000 }, \
+ /* NON_SPECIAL_REGS. */ \
+ { 0xffffffff, 0xffffffff, 0x00000008, 0x00020000, 0x00000000 }, \
+ /* LINK_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000 }, \
+ /* CTR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000 }, \
+ /* LINK_OR_CTR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000000 }, \
+ /* SPECIAL_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000006, 0x00002000, 0x00000000 }, \
+ /* SPEC_OR_GEN_REGS. */ \
+ { 0xffffffff, 0x00000000, 0x0000000e, 0x00022000, 0x00000000 }, \
+ /* CR0_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0x00000000 }, \
+ /* CR_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000ff0, 0x00000000, 0x00000000 }, \
+ /* NON_FLOAT_REGS. */ \
+ { 0xffffffff, 0x00000000, 0x00000ffe, 0x00020000, 0x00000000 }, \
+ /* CA_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00001000, 0x00000000, 0x00000000 }, \
+ /* SPE_HIGH_REGS. */ \
+ { 0x00000000, 0x00000000, 0x00000000, 0xffe00000, 0x001fffff }, \
+ /* ALL_REGS. */ \
+ { 0xffffffff, 0xffffffff, 0xfffffffe, 0xffe7ffff, 0x001fffff } \
}
/* The same information, inverted:
@@ -1439,6 +1478,10 @@ enum r6000_reg_class_enum {
RS6000_CONSTRAINT_wd, /* VSX register for V2DF */
RS6000_CONSTRAINT_wf, /* VSX register for V4SF */
RS6000_CONSTRAINT_wg, /* FPR register for -mmfpgpr */
+ RS6000_CONSTRAINT_wh, /* FPR register for direct moves. */
+ RS6000_CONSTRAINT_wi, /* FPR/VSX register to hold DImode */
+ RS6000_CONSTRAINT_wj, /* FPR/VSX register for DImode direct moves. */
+ RS6000_CONSTRAINT_wk, /* FPR/VSX register for DFmode direct moves. */
RS6000_CONSTRAINT_wl, /* FPR register for LFIWAX */
RS6000_CONSTRAINT_wm, /* VSX register for direct move */
RS6000_CONSTRAINT_wr, /* GPR register if 64-bit */
@@ -1463,6 +1506,9 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX];
#define VSX_REG_CLASS_P(CLASS) \
((CLASS) == VSX_REGS || (CLASS) == FLOAT_REGS || (CLASS) == ALTIVEC_REGS)
+/* Return whether a given register class targets general purpose registers. */
+#define GPR_REG_CLASS_P(CLASS) ((CLASS) == GENERAL_REGS || (CLASS) == BASE_REGS)
+
/* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use.
In general this is just CLASS; but on some machines
@@ -2349,6 +2395,39 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
&rs6000_reg_names[114][0], /* tfhar */ \
&rs6000_reg_names[115][0], /* tfiar */ \
&rs6000_reg_names[116][0], /* texasr */ \
+ \
+ &rs6000_reg_names[117][0], /* SPE rh0. */ \
+ &rs6000_reg_names[118][0], /* SPE rh1. */ \
+ &rs6000_reg_names[119][0], /* SPE rh2. */ \
+ &rs6000_reg_names[120][0], /* SPE rh3. */ \
+ &rs6000_reg_names[121][0], /* SPE rh4. */ \
+ &rs6000_reg_names[122][0], /* SPE rh5. */ \
+ &rs6000_reg_names[123][0], /* SPE rh6. */ \
+ &rs6000_reg_names[124][0], /* SPE rh7. */ \
+ &rs6000_reg_names[125][0], /* SPE rh8. */ \
+ &rs6000_reg_names[126][0], /* SPE rh9. */ \
+ &rs6000_reg_names[127][0], /* SPE rh10. */ \
+ &rs6000_reg_names[128][0], /* SPE rh11. */ \
+ &rs6000_reg_names[129][0], /* SPE rh12. */ \
+ &rs6000_reg_names[130][0], /* SPE rh13. */ \
+ &rs6000_reg_names[131][0], /* SPE rh14. */ \
+ &rs6000_reg_names[132][0], /* SPE rh15. */ \
+ &rs6000_reg_names[133][0], /* SPE rh16. */ \
+ &rs6000_reg_names[134][0], /* SPE rh17. */ \
+ &rs6000_reg_names[135][0], /* SPE rh18. */ \
+ &rs6000_reg_names[136][0], /* SPE rh19. */ \
+ &rs6000_reg_names[137][0], /* SPE rh20. */ \
+ &rs6000_reg_names[138][0], /* SPE rh21. */ \
+ &rs6000_reg_names[139][0], /* SPE rh22. */ \
+ &rs6000_reg_names[140][0], /* SPE rh22. */ \
+ &rs6000_reg_names[141][0], /* SPE rh24. */ \
+ &rs6000_reg_names[142][0], /* SPE rh25. */ \
+ &rs6000_reg_names[143][0], /* SPE rh26. */ \
+ &rs6000_reg_names[144][0], /* SPE rh27. */ \
+ &rs6000_reg_names[145][0], /* SPE rh28. */ \
+ &rs6000_reg_names[146][0], /* SPE rh29. */ \
+ &rs6000_reg_names[147][0], /* SPE rh30. */ \
+ &rs6000_reg_names[148][0], /* SPE rh31. */ \
}
/* Table of additional register names to use in user input. */
@@ -2404,7 +2483,17 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
{"vs56", 101},{"vs57", 102},{"vs58", 103},{"vs59", 104}, \
{"vs60", 105},{"vs61", 106},{"vs62", 107},{"vs63", 108}, \
/* Transactional Memory Facility (HTM) Registers. */ \
- {"tfhar", 114}, {"tfiar", 115}, {"texasr", 116} }
+ {"tfhar", 114}, {"tfiar", 115}, {"texasr", 116}, \
+ /* SPE high registers. */ \
+ {"rh0", 117}, {"rh1", 118}, {"rh2", 119}, {"rh3", 120}, \
+ {"rh4", 121}, {"rh5", 122}, {"rh6", 123}, {"rh7", 124}, \
+ {"rh8", 125}, {"rh9", 126}, {"rh10", 127}, {"rh11", 128}, \
+ {"rh12", 129}, {"rh13", 130}, {"rh14", 131}, {"rh15", 132}, \
+ {"rh16", 133}, {"rh17", 134}, {"rh18", 135}, {"rh19", 136}, \
+ {"rh20", 137}, {"rh21", 138}, {"rh22", 139}, {"rh23", 140}, \
+ {"rh24", 141}, {"rh25", 142}, {"rh26", 143}, {"rh27", 144}, \
+ {"rh28", 145}, {"rh29", 146}, {"rh30", 147}, {"rh31", 148}, \
+}
/* This is how to output an element of a case-vector that is relative. */
diff --git a/gcc-4.9/gcc/config/rs6000/rs6000.md b/gcc-4.9/gcc/config/rs6000/rs6000.md
index 26d0d1530..d078491e1 100644
--- a/gcc-4.9/gcc/config/rs6000/rs6000.md
+++ b/gcc-4.9/gcc/config/rs6000/rs6000.md
@@ -56,6 +56,8 @@
(TFHAR_REGNO 114)
(TFIAR_REGNO 115)
(TEXASR_REGNO 116)
+ (FIRST_SPE_HIGH_REGNO 117)
+ (LAST_SPE_HIGH_REGNO 148)
])
;;
@@ -326,7 +328,7 @@
(define_mode_attr f32_sv [(SF "stxsspx %x1,%y0") (SD "stxsiwzx %x1,%y0")])
; Definitions for 32-bit fpr direct move
-(define_mode_attr f32_dm [(SF "wn") (SD "wm")])
+(define_mode_attr f32_dm [(SF "wn") (SD "wh")])
; These modes do not fit in integer registers in 32-bit mode.
; but on e500v2, the gpr are 64 bit registers
@@ -575,7 +577,7 @@
"")
(define_insn "*zero_extendsidi2_lfiwzx"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wz,!wu")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wz,!wu")
(zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r,r,Z,Z")))]
"TARGET_POWERPC64 && TARGET_LFIWZX"
"@
@@ -745,7 +747,7 @@
"")
(define_insn "*extendsidi2_lfiwax"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wj,!wl,!wu")
(sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
"TARGET_POWERPC64 && TARGET_LFIWAX"
"@
@@ -5623,7 +5625,7 @@
; We don't define lfiwax/lfiwzx with the normal definition, because we
; don't want to support putting SImode in FPR registers.
(define_insn "lfiwax"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
UNSPEC_LFIWAX))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWAX"
@@ -5703,7 +5705,7 @@
(set_attr "type" "fpload")])
(define_insn "lfiwzx"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wm,!wm")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=d,wj,!wj")
(unspec:DI [(match_operand:SI 1 "reg_or_indexed_operand" "Z,Z,r")]
UNSPEC_LFIWZX))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_LFIWZX"
@@ -9457,8 +9459,8 @@
; ld/std require word-aligned displacements -> 'Y' constraint.
; List Y->r and r->Y before r->r for reload.
(define_insn "*mov<mode>_hardfloat64"
- [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wm")
- (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wm,r"))]
+ [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=m,d,d,wv,Z,wa,wa,Y,r,!r,*c*l,!r,*h,!r,!r,!r,r,wg,r,wk")
+ (match_operand:FMOVE64 1 "input_operand" "d,m,d,Z,wv,wa,j,r,Y,r,r,h,0,G,H,F,wg,r,wk,r"))]
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& (gpc_reg_operand (operands[0], <MODE>mode)
|| gpc_reg_operand (operands[1], <MODE>mode))"
@@ -10237,8 +10239,8 @@
{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_insn "*movdi_internal64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm")
- (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wj,?*wi")
+ (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wj,r,O"))]
"TARGET_POWERPC64
&& (gpc_reg_operand (operands[0], DImode)
|| gpc_reg_operand (operands[1], DImode))"
@@ -10258,7 +10260,8 @@
mftgpr %0,%1
mffgpr %0,%1
mfvsrd %0,%x1
- mtvsrd %x0,%1"
+ mtvsrd %x0,%1
+ xxlxor %x0,%x0,%x0"
[(set_attr_alternative "type"
[(if_then_else
(match_test "update_indexed_address_mem (operands[0], VOIDmode)")
@@ -10299,8 +10302,9 @@
(const_string "mftgpr")
(const_string "mffgpr")
(const_string "mftgpr")
- (const_string "mffgpr")])
- (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4")])
+ (const_string "mffgpr")
+ (const_string "vecsimple")])
+ (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4,4,4")])
;; Generate all one-bits and clear left or right.
;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
diff --git a/gcc-4.9/gcc/config/rs6000/vsx.md b/gcc-4.9/gcc/config/rs6000/vsx.md
index 6d20eab11..2cf5e7a94 100644
--- a/gcc-4.9/gcc/config/rs6000/vsx.md
+++ b/gcc-4.9/gcc/config/rs6000/vsx.md
@@ -86,19 +86,26 @@
(V4SF "wf")
(V2DI "wd")
(V2DF "wd")
+ (DI "wi")
(DF "ws")
- (SF "d")
+ (SF "ww")
(V1TI "v")
(TI "wt")])
-;; Map the register class used for float<->int conversions
+;; Map the register class used for float<->int conversions (floating point side)
+;; VSr2 is the preferred register class, VSr3 is any register class that will
+;; hold the data
(define_mode_attr VSr2 [(V2DF "wd")
(V4SF "wf")
- (DF "ws")])
+ (DF "ws")
+ (SF "ww")
+ (DI "wi")])
(define_mode_attr VSr3 [(V2DF "wa")
(V4SF "wa")
- (DF "ws")])
+ (DF "ws")
+ (SF "ww")
+ (DI "wi")])
;; Map the register class for sp<->dp float conversions, destination
(define_mode_attr VSr4 [(SF "ws")
@@ -106,12 +113,27 @@
(V2DF "wd")
(V4SF "v")])
-;; Map the register class for sp<->dp float conversions, destination
+;; Map the register class for sp<->dp float conversions, source
(define_mode_attr VSr5 [(SF "ws")
(DF "f")
(V2DF "v")
(V4SF "wd")])
+;; The VSX register class that a type can occupy, even if it is not the
+;; preferred register class (VSr is the preferred register class that will get
+;; allocated first).
+(define_mode_attr VSa [(V16QI "wa")
+ (V8HI "wa")
+ (V4SI "wa")
+ (V4SF "wa")
+ (V2DI "wa")
+ (V2DF "wa")
+ (DI "wi")
+ (DF "ws")
+ (SF "ww")
+ (V1TI "wa")
+ (TI "wt")])
+
;; Same size integer type for floating point data
(define_mode_attr VSi [(V4SF "v4si")
(V2DF "v2di")
@@ -207,6 +229,16 @@
(V2DF "V4DF")
(V1TI "V2TI")])
+;; Map register class for 64-bit element in 128-bit vector for direct moves
+;; to/from gprs
+(define_mode_attr VS_64dm [(V2DF "wk")
+ (V2DI "wj")])
+
+;; Map register class for 64-bit element in 128-bit vector for normal register
+;; to register moves
+(define_mode_attr VS_64reg [(V2DF "ws")
+ (V2DI "wi")])
+
;; Constants for creating unspecs
(define_c_enum "unspec"
[UNSPEC_VSX_CONCAT
@@ -235,7 +267,7 @@
;; The patterns for LE permuted loads and stores come before the general
;; VSX moves so they match first.
(define_insn_and_split "*vsx_le_perm_load_<mode>"
- [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
(match_operand:VSX_LE 1 "memory_operand" "Z"))]
"!BYTES_BIG_ENDIAN && TARGET_VSX"
"#"
@@ -258,7 +290,7 @@
(set_attr "length" "8")])
(define_insn_and_split "*vsx_le_perm_load_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
(match_operand:VSX_W 1 "memory_operand" "Z"))]
"!BYTES_BIG_ENDIAN && TARGET_VSX"
"#"
@@ -350,7 +382,7 @@
(define_insn "*vsx_le_perm_store_<mode>"
[(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
- (match_operand:VSX_LE 1 "vsx_register_operand" "+wa"))]
+ (match_operand:VSX_LE 1 "vsx_register_operand" "+<VSa>"))]
"!BYTES_BIG_ENDIAN && TARGET_VSX"
"#"
[(set_attr "type" "vecstore")
@@ -395,7 +427,7 @@
(define_insn "*vsx_le_perm_store_<mode>"
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
- (match_operand:VSX_W 1 "vsx_register_operand" "+wa"))]
+ (match_operand:VSX_W 1 "vsx_register_operand" "+<VSa>"))]
"!BYTES_BIG_ENDIAN && TARGET_VSX"
"#"
[(set_attr "type" "vecstore")
@@ -585,8 +617,8 @@
(define_insn "*vsx_mov<mode>"
- [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?wa,?wa,wQ,?&r,??Y,??r,??r,<VSr>,?wa,*r,v,wZ, v")
- (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,wa,Z,wa,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
+ [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=Z,<VSr>,<VSr>,?Z,?<VSa>,?<VSa>,wQ,?&r,??Y,??r,??r,<VSr>,?<VSa>,*r,v,wZ, v")
+ (match_operand:VSX_M 1 "input_operand" "<VSr>,Z,<VSr>,<VSa>,Z,<VSa>,r,wQ,r,Y,r,j,j,j,W,v,wZ"))]
"VECTOR_MEM_VSX_P (<MODE>mode)
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
@@ -688,36 +720,36 @@
;; instructions are now combined with the insn for the traditional floating
;; point unit.
(define_insn "*vsx_add<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (plus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvadd<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_sub<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (minus:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvsub<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_mul<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (mult:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvmul<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_mul>")])
(define_insn "*vsx_div<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (div:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvdiv<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_div>")
@@ -753,8 +785,8 @@
(define_insn "*vsx_tdiv<mode>3_internal"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,wa")]
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_B 2 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_VSX_TDIV))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>tdiv<VSs> %0,%x1,%x2"
@@ -762,8 +794,8 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_fre<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_FRES))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvre<VSs> %x0,%x1"
@@ -771,60 +803,60 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_neg<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (neg:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvneg<VSs> %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_abs<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (abs:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvabs<VSs> %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_nabs<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(neg:VSX_F
(abs:VSX_F
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa"))))]
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>"))))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvnabs<VSs> %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_smax<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (smax:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvmax<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_smin<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (smin:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvmin<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_sqrt<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (sqrt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvsqrt<VSs> %x0,%x1"
[(set_attr "type" "<VStype_sqrt>")
(set_attr "fp_type" "<VSfptype_sqrt>")])
(define_insn "*vsx_rsqrte<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_RSQRT))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvrsqrte<VSs> %x0,%x1"
@@ -859,7 +891,7 @@
(define_insn "*vsx_tsqrt<mode>2_internal"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=x,x")
- (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
+ (unspec:CCFP [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_VSX_TSQRT))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>tsqrt<VSs> %0,%x1"
@@ -901,12 +933,12 @@
[(set_attr "type" "vecdouble")])
(define_insn "*vsx_fms<mode>4"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
(fma:VSX_F
- (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
+ (match_operand:VSX_F 1 "vsx_register_operand" "%<VSr>,<VSr>,<VSa>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
(neg:VSX_F
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"@
xvmsuba<VSs> %x0,%x1,%x2
@@ -916,12 +948,12 @@
[(set_attr "type" "<VStype_mul>")])
(define_insn "*vsx_nfma<mode>4"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?wa,?wa")
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,<VSr>,?<VSa>,?<VSa>")
(neg:VSX_F
(fma:VSX_F
- (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,wa,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,wa,0")
- (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,wa"))))]
+ (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSr>,<VSa>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,0,<VSa>,0")
+ (match_operand:VSX_F 3 "vsx_register_operand" "0,<VSr>,0,<VSa>"))))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"@
xvnmadda<VSs> %x0,%x1,%x2
@@ -966,27 +998,27 @@
;; Vector conditional expressions (no scalar version for these instructions)
(define_insn "vsx_eq<mode>"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (eq:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvcmpeq<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_gt<mode>"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (gt:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvcmpgt<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_ge<mode>"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (ge:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvcmpge<VSs> %x0,%x1,%x2"
[(set_attr "type" "<VStype_simple>")
@@ -997,10 +1029,10 @@
(define_insn "*vsx_eq_<mode>_p"
[(set (reg:CC 74)
(unspec:CC
- [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
+ [(eq:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
UNSPEC_PREDICATE))
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(eq:VSX_F (match_dup 1)
(match_dup 2)))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
@@ -1010,10 +1042,10 @@
(define_insn "*vsx_gt_<mode>_p"
[(set (reg:CC 74)
(unspec:CC
- [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
+ [(gt:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
UNSPEC_PREDICATE))
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(gt:VSX_F (match_dup 1)
(match_dup 2)))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
@@ -1023,10 +1055,10 @@
(define_insn "*vsx_ge_<mode>_p"
[(set (reg:CC 74)
(unspec:CC
- [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?wa"))]
+ [(ge:CC (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,?<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,?<VSa>"))]
UNSPEC_PREDICATE))
- (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
+ (set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(ge:VSX_F (match_dup 1)
(match_dup 2)))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
@@ -1035,33 +1067,33 @@
;; Vector select
(define_insn "*vsx_xxsel<mode>"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(if_then_else:VSX_L
- (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
+ (ne:CC (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
(match_operand:VSX_L 4 "zero_constant" ""))
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
"xxsel %x0,%x3,%x2,%x1"
[(set_attr "type" "vecperm")])
(define_insn "*vsx_xxsel<mode>_uns"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(if_then_else:VSX_L
- (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,wa")
+ (ne:CCUNS (match_operand:VSX_L 1 "vsx_register_operand" "<VSr>,<VSa>")
(match_operand:VSX_L 4 "zero_constant" ""))
- (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,wa")))]
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_L 3 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
"xxsel %x0,%x3,%x2,%x1"
[(set_attr "type" "vecperm")])
;; Copy sign
(define_insn "vsx_copysign<mode>3"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(unspec:VSX_F
- [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")
- (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,wa")]
+ [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")
+ (match_operand:VSX_F 2 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_COPYSIGN))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvcpsgn<VSs> %x0,%x2,%x1"
@@ -1074,7 +1106,7 @@
;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
(define_insn "vsx_float<VSi><mode>2"
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
(float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cvsx<VSc><VSs> %x0,%x1"
@@ -1082,7 +1114,7 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_floatuns<VSi><mode>2"
- [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?<VSa>")
(unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cvux<VSc><VSs> %x0,%x1"
@@ -1091,7 +1123,7 @@
(define_insn "vsx_fix_trunc<mode><VSi>2"
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
- (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
+ (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
[(set_attr "type" "<VStype_simple>")
@@ -1099,7 +1131,7 @@
(define_insn "vsx_fixuns_trunc<mode><VSi>2"
[(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
- (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
+ (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
[(set_attr "type" "<VStype_simple>")
@@ -1107,8 +1139,8 @@
;; Math rounding functions
(define_insn "vsx_x<VSv>r<VSs>i"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_VSX_ROUND_I))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>r<VSs>i %x0,%x1"
@@ -1116,8 +1148,8 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_x<VSv>r<VSs>ic"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_VSX_ROUND_IC))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>r<VSs>ic %x0,%x1"
@@ -1125,16 +1157,16 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_btrunc<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (fix:VSX_F (match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvr<VSs>iz %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "*vsx_b2trunc<mode>2"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_B [(match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_FRIZ))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>r<VSs>iz %x0,%x1"
@@ -1142,8 +1174,8 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_floor<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_FRIM))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvr<VSs>im %x0,%x1"
@@ -1151,8 +1183,8 @@
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_ceil<mode>2"
- [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?wa")
- (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,wa")]
+ [(set (match_operand:VSX_F 0 "vsx_register_operand" "=<VSr>,?<VSa>")
+ (unspec:VSX_F [(match_operand:VSX_F 1 "vsx_register_operand" "<VSr>,<VSa>")]
UNSPEC_FRIP))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"xvr<VSs>ip %x0,%x1"
@@ -1167,8 +1199,8 @@
;; scalar single precision instructions internally use the double format.
;; Prefer the altivec registers, since we likely will need to do a vperm
(define_insn "vsx_<VS_spdp_insn>"
- [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?wa")
- (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,wa")]
+ [(set (match_operand:<VS_spdp_res> 0 "vsx_register_operand" "=<VSr4>,?<VSa>")
+ (unspec:<VS_spdp_res> [(match_operand:VSX_SPDP 1 "vsx_register_operand" "<VSr5>,<VSa>")]
UNSPEC_VSX_CVSPDP))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"<VS_spdp_insn> %x0,%x1"
@@ -1176,8 +1208,8 @@
;; xscvspdp, represent the scalar SF type as V4SF
(define_insn "vsx_xscvspdp"
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws")
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa")]
UNSPEC_VSX_CVSPDP))]
"VECTOR_UNIT_VSX_P (V4SFmode)"
"xscvspdp %x0,%x1"
@@ -1204,7 +1236,7 @@
;; ISA 2.07 xscvdpspn/xscvspdpn that does not raise an error on signalling NaNs
(define_insn "vsx_xscvdpspn"
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=ws,?wa")
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=ww,?ww")
(unspec:V4SF [(match_operand:DF 1 "vsx_register_operand" "wd,wa")]
UNSPEC_VSX_CVDPSPN))]
"TARGET_XSCVDPSPN"
@@ -1212,16 +1244,16 @@
[(set_attr "type" "fp")])
(define_insn "vsx_xscvspdpn"
- [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?wa")
- (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wa,wa")]
+ [(set (match_operand:DF 0 "vsx_register_operand" "=ws,?ws")
+ (unspec:DF [(match_operand:V4SF 1 "vsx_register_operand" "wf,wa")]
UNSPEC_VSX_CVSPDPN))]
"TARGET_XSCVSPDPN"
"xscvspdpn %x0,%x1"
[(set_attr "type" "fp")])
(define_insn "vsx_xscvdpspn_scalar"
- [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa")
- (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")]
+ [(set (match_operand:V4SF 0 "vsx_register_operand" "=wf,?wa")
+ (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww,ww")]
UNSPEC_VSX_CVDPSPN))]
"TARGET_XSCVDPSPN"
"xscvdpspn %x0,%x1"
@@ -1309,10 +1341,10 @@
;; since the xsrdpiz instruction does not truncate the value if the floating
;; point value is < LONG_MIN or > LONG_MAX.
(define_insn "*vsx_float_fix_<mode>2"
- [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_DF 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(float:VSX_DF
(fix:<VSI>
- (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?wa"))))]
+ (match_operand:VSX_DF 1 "vsx_register_operand" "<VSr>,?<VSa>"))))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& VECTOR_UNIT_VSX_P (<MODE>mode) && flag_unsafe_math_optimizations
&& !flag_trapping_math && TARGET_FRIZ"
@@ -1325,10 +1357,10 @@
;; Build a V2DF/V2DI vector from two scalars
(define_insn "vsx_concat_<mode>"
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?wa")
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSr>,?<VSa>")
(vec_concat:VSX_D
- (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,wa")
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")))]
+ (match_operand:<VS_scalar> 1 "vsx_register_operand" "ws,<VSa>")
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,<VSa>")))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
{
if (BYTES_BIG_ENDIAN)
@@ -1359,18 +1391,18 @@
;; xxpermdi for little endian loads and stores. We need several of
;; these since the form of the PARALLEL differs by mode.
(define_insn "*vsx_xxpermdi2_le_<mode>"
- [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
(vec_select:VSX_LE
- (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
(parallel [(const_int 1) (const_int 0)])))]
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
"xxpermdi %x0,%x1,%x1,2"
[(set_attr "type" "vecperm")])
(define_insn "*vsx_xxpermdi4_le_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
(vec_select:VSX_W
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
(parallel [(const_int 2) (const_int 3)
(const_int 0) (const_int 1)])))]
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1408,7 +1440,7 @@
;; lxvd2x for little endian loads. We need several of
;; these since the form of the PARALLEL differs by mode.
(define_insn "*vsx_lxvd2x2_le_<mode>"
- [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_LE 0 "vsx_register_operand" "=<VSa>")
(vec_select:VSX_LE
(match_operand:VSX_LE 1 "memory_operand" "Z")
(parallel [(const_int 1) (const_int 0)])))]
@@ -1417,7 +1449,7 @@
[(set_attr "type" "vecload")])
(define_insn "*vsx_lxvd2x4_le_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=<VSa>")
(vec_select:VSX_W
(match_operand:VSX_W 1 "memory_operand" "Z")
(parallel [(const_int 2) (const_int 3)
@@ -1459,7 +1491,7 @@
(define_insn "*vsx_stxvd2x2_le_<mode>"
[(set (match_operand:VSX_LE 0 "memory_operand" "=Z")
(vec_select:VSX_LE
- (match_operand:VSX_LE 1 "vsx_register_operand" "wa")
+ (match_operand:VSX_LE 1 "vsx_register_operand" "<VSa>")
(parallel [(const_int 1) (const_int 0)])))]
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
"stxvd2x %x1,%y0"
@@ -1468,7 +1500,7 @@
(define_insn "*vsx_stxvd2x4_le_<mode>"
[(set (match_operand:VSX_W 0 "memory_operand" "=Z")
(vec_select:VSX_W
- (match_operand:VSX_W 1 "vsx_register_operand" "wa")
+ (match_operand:VSX_W 1 "vsx_register_operand" "<VSa>")
(parallel [(const_int 2) (const_int 3)
(const_int 0) (const_int 1)])))]
"!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1520,11 +1552,12 @@
;; Set the element of a V2DI/VD2F mode
(define_insn "vsx_set_<mode>"
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?wa")
- (unspec:VSX_D [(match_operand:VSX_D 1 "vsx_register_operand" "wd,wa")
- (match_operand:<VS_scalar> 2 "vsx_register_operand" "ws,wa")
- (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
- UNSPEC_VSX_SET))]
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,?<VSa>")
+ (unspec:VSX_D
+ [(match_operand:VSX_D 1 "vsx_register_operand" "wd,<VSa>")
+ (match_operand:<VS_scalar> 2 "vsx_register_operand" "<VS_64reg>,<VSa>")
+ (match_operand:QI 3 "u5bit_cint_operand" "i,i")]
+ UNSPEC_VSX_SET))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
{
int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
@@ -1549,11 +1582,11 @@
;; Optimize cases were we can do a simple or direct move.
;; Or see if we can avoid doing the move at all
(define_insn "*vsx_extract_<mode>_internal1"
- [(set (match_operand:<VS_scalar> 0 "register_operand" "=d,ws,?wa,r")
+ [(set (match_operand:<VS_scalar> 0 "register_operand" "=d,<VS_64reg>,r")
(vec_select:<VS_scalar>
- (match_operand:VSX_D 1 "register_operand" "d,wd,wa,wm")
+ (match_operand:VSX_D 1 "register_operand" "d,<VS_64reg>,<VS_64dm>")
(parallel
- [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD,wD")])))]
+ [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD")])))]
"VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
{
int op0_regno = REGNO (operands[0]);
@@ -1570,14 +1603,14 @@
return "xxlor %x0,%x1,%x1";
}
- [(set_attr "type" "fp,vecsimple,vecsimple,mftgpr")
+ [(set_attr "type" "fp,vecsimple,mftgpr")
(set_attr "length" "4")])
(define_insn "*vsx_extract_<mode>_internal2"
- [(set (match_operand:<VS_scalar> 0 "vsx_register_operand" "=d,ws,ws,?wa")
+ [(set (match_operand:<VS_scalar> 0 "vsx_register_operand" "=d,<VS_64reg>,<VS_64reg>")
(vec_select:<VS_scalar>
- (match_operand:VSX_D 1 "vsx_register_operand" "d,wd,wd,wa")
- (parallel [(match_operand:QI 2 "u5bit_cint_operand" "wD,wD,i,i")])))]
+ (match_operand:VSX_D 1 "vsx_register_operand" "d,wd,wd")
+ (parallel [(match_operand:QI 2 "u5bit_cint_operand" "wD,wD,i")])))]
"VECTOR_MEM_VSX_P (<MODE>mode)
&& (!TARGET_POWERPC64 || !TARGET_DIRECT_MOVE
|| INTVAL (operands[2]) != VECTOR_ELEMENT_SCALAR_64BIT)"
@@ -1605,7 +1638,7 @@
operands[3] = GEN_INT (fldDM);
return "xxpermdi %x0,%x1,%x1,%3";
}
- [(set_attr "type" "fp,vecsimple,vecperm,vecperm")
+ [(set_attr "type" "fp,vecsimple,vecperm")
(set_attr "length" "4")])
;; Optimize extracting a single scalar element from memory if the scalar is in
@@ -1643,7 +1676,7 @@
(define_insn "*vsx_extract_<mode>_store"
[(set (match_operand:<VS_scalar> 0 "memory_operand" "=m,Z,?Z")
(vec_select:<VS_scalar>
- (match_operand:VSX_D 1 "register_operand" "d,wd,wa")
+ (match_operand:VSX_D 1 "register_operand" "d,wd,<VSa>")
(parallel [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD")])))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
"@
@@ -1666,7 +1699,7 @@
(define_insn_and_split "vsx_extract_v4sf"
[(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
(vec_select:SF
- (match_operand:V4SF 1 "vsx_register_operand" "wa,wa")
+ (match_operand:V4SF 1 "vsx_register_operand" "<VSa>,<VSa>")
(parallel [(match_operand:QI 2 "u5bit_cint_operand" "O,i")])))
(clobber (match_scratch:V4SF 3 "=X,0"))]
"VECTOR_UNIT_VSX_P (V4SFmode)"
@@ -1849,9 +1882,9 @@
;; V2DF/V2DI splat
(define_insn "vsx_splat_<mode>"
- [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?wa,?wa,?wa")
+ [(set (match_operand:VSX_D 0 "vsx_register_operand" "=wd,wd,wd,?<VSa>,?<VSa>,?<VSa>")
(vec_duplicate:VSX_D
- (match_operand:<VS_scalar> 1 "splat_input_operand" "ws,f,Z,wa,wa,Z")))]
+ (match_operand:<VS_scalar> 1 "splat_input_operand" "<VS_64reg>,f,Z,<VSa>,<VSa>,Z")))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
"@
xxpermdi %x0,%x1,%x1,0
@@ -1864,10 +1897,10 @@
;; V4SF/V4SI splat
(define_insn "vsx_xxspltw_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
(vec_duplicate:VSX_W
(vec_select:<VS_scalar>
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
(parallel
[(match_operand:QI 2 "u5bit_cint_operand" "i,i")]))))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1880,8 +1913,8 @@
[(set_attr "type" "vecperm")])
(define_insn "vsx_xxspltw_<mode>_direct"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
- (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
+ (unspec:VSX_W [(match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
(match_operand:QI 2 "u5bit_cint_operand" "i,i")]
UNSPEC_VSX_XXSPLTW))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1890,11 +1923,11 @@
;; V4SF/V4SI interleave
(define_insn "vsx_xxmrghw_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
(vec_select:VSX_W
(vec_concat:<VS_double>
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,wa"))
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,<VSa>"))
(parallel [(const_int 0) (const_int 4)
(const_int 1) (const_int 5)])))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1907,11 +1940,11 @@
[(set_attr "type" "vecperm")])
(define_insn "vsx_xxmrglw_<mode>"
- [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?wa")
+ [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wf,?<VSa>")
(vec_select:VSX_W
(vec_concat:<VS_double>
- (match_operand:VSX_W 1 "vsx_register_operand" "wf,wa")
- (match_operand:VSX_W 2 "vsx_register_operand" "wf,?wa"))
+ (match_operand:VSX_W 1 "vsx_register_operand" "wf,<VSa>")
+ (match_operand:VSX_W 2 "vsx_register_operand" "wf,?<VSa>"))
(parallel [(const_int 2) (const_int 6)
(const_int 3) (const_int 7)])))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
@@ -1925,9 +1958,9 @@
;; Shift left double by word immediate
(define_insn "vsx_xxsldwi_<mode>"
- [(set (match_operand:VSX_L 0 "vsx_register_operand" "=wa")
- (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "wa")
- (match_operand:VSX_L 2 "vsx_register_operand" "wa")
+ [(set (match_operand:VSX_L 0 "vsx_register_operand" "=<VSa>")
+ (unspec:VSX_L [(match_operand:VSX_L 1 "vsx_register_operand" "<VSa>")
+ (match_operand:VSX_L 2 "vsx_register_operand" "<VSa>")
(match_operand:QI 3 "u5bit_cint_operand" "i")]
UNSPEC_VSX_SLDWI))]
"VECTOR_MEM_VSX_P (<MODE>mode)"
diff --git a/gcc-4.9/gcc/config/sh/sh.c b/gcc-4.9/gcc/config/sh/sh.c
index 62dcf0cb3..3d4553a6e 100644
--- a/gcc-4.9/gcc/config/sh/sh.c
+++ b/gcc-4.9/gcc/config/sh/sh.c
@@ -861,6 +861,12 @@ sh_option_override (void)
targetm.asm_out.aligned_op.di = NULL;
targetm.asm_out.unaligned_op.di = NULL;
}
+
+ /* User/priviledged mode is supported only on SH3*, SH4* and SH5*.
+ Disable it for everything else. */
+ if (! (TARGET_SH3 || TARGET_SH5) && TARGET_USERMODE)
+ TARGET_USERMODE = false;
+
if (TARGET_SH1)
{
if (! strcmp (sh_div_str, "call-div1"))
diff --git a/gcc-4.9/gcc/config/sh/sh.opt b/gcc-4.9/gcc/config/sh/sh.opt
index 1834c6bde..bb6d39581 100644
--- a/gcc-4.9/gcc/config/sh/sh.opt
+++ b/gcc-4.9/gcc/config/sh/sh.opt
@@ -343,7 +343,7 @@ Target RejectNegative Joined UInteger Var(sh_multcost) Init(-1)
Cost to assume for a multiply insn
musermode
-Target Report RejectNegative Var(TARGET_USERMODE)
+Target Var(TARGET_USERMODE)
Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate if the inline code would not work in user mode.
;; We might want to enable this by default for TARGET_HARD_SH4, because
diff --git a/gcc-4.9/gcc/coverage.c b/gcc-4.9/gcc/coverage.c
index 6b1d0d6cd..bfc5731ff 100644
--- a/gcc-4.9/gcc/coverage.c
+++ b/gcc-4.9/gcc/coverage.c
@@ -658,7 +658,7 @@ typedef struct {
static vec<mod_id_to_name_t> *mod_names;
-static void
+void
record_module_name (unsigned int mod_id, const char *name)
{
mod_id_to_name_t t;
diff --git a/gcc-4.9/gcc/cp/ChangeLog b/gcc-4.9/gcc/cp/ChangeLog
index b0a474daf..0c7ab3320 100644
--- a/gcc-4.9/gcc/cp/ChangeLog
+++ b/gcc-4.9/gcc/cp/ChangeLog
@@ -1,3 +1,77 @@
+2014-08-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/58624
+ * pt.c (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
+ * semantics.c (finish_id_expression): Don't call TLS wrapper in a
+ template.
+
+2014-08-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/62129
+ * class.c (outermost_open_class): New.
+ * cp-tree.h: Declare it.
+ * decl.c (maybe_register_incomplete_var): Use it.
+ (complete_vars): Handle any constant variable.
+ * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
+
+2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/62008
+ * cp-array-notation.c (build_array_notation_ref): Added correct
+ handling of case with incorrect array.
+
+2014-08-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/61214
+ PR tree-optimization/62091
+ * decl2.c (decl_needed_p): Return true for virtual functions when
+ devirtualizing.
+
+ Backport:
+ PR c++/61566
+ * pt.c (instantiate_class_template_1): Ignore lambda on
+ CLASSTYPE_DECL_LIST.
+ (push_template_decl_real): A lambda is not primary.
+ * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
+ currently in a function and the lambda living in a function.
+
+ Backport:
+ PR c++/60417
+ * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
+ init-list for trailing elements.
+ * typeck2.c (process_init_constructor_array): Likewise.
+
+2014-08-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/61959
+ * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
+
+ PR c++/61994
+ * init.c (build_vec_init): Leave atype an ARRAY_TYPE
+ if we're just returning an INIT_EXPR.
+
+ PR c++/60872
+ * call.c (standard_conversion): Don't try to apply restrict to void.
+
+ PR c++/58714
+ * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
+ in error output.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/61963
+ * parser.c (cp_parser_array_notation): Added check for array_type.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR middle-end/61455
+ * cp-array-notation.c (expand_array_notation_exprs): Handling of
+ DECL_EXPR improved. Changed handling for INIT_EXPR.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/gcc/cp/call.c b/gcc-4.9/gcc/cp/call.c
index 2c67c03e4..223188a51 100644
--- a/gcc-4.9/gcc/cp/call.c
+++ b/gcc-4.9/gcc/cp/call.c
@@ -1208,9 +1208,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
&& TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
{
tree nfrom = TREE_TYPE (from);
+ /* Don't try to apply restrict to void. */
+ int quals = cp_type_quals (nfrom) & ~TYPE_QUAL_RESTRICT;
from = build_pointer_type
- (cp_build_qualified_type (void_type_node,
- cp_type_quals (nfrom)));
+ (cp_build_qualified_type (void_type_node, quals));
conv = build_conv (ck_ptr, from, conv);
}
else if (TYPE_PTRDATAMEM_P (from))
diff --git a/gcc-4.9/gcc/cp/class.c b/gcc-4.9/gcc/cp/class.c
index 265afc486..711a567cb 100644
--- a/gcc-4.9/gcc/cp/class.c
+++ b/gcc-4.9/gcc/cp/class.c
@@ -7251,6 +7251,29 @@ currently_open_derived_class (tree t)
return NULL_TREE;
}
+/* Return the outermost enclosing class type that is still open, or
+ NULL_TREE. */
+
+tree
+outermost_open_class (void)
+{
+ if (!current_class_type)
+ return NULL_TREE;
+ tree r = NULL_TREE;
+ if (TYPE_BEING_DEFINED (current_class_type))
+ r = current_class_type;
+ for (int i = current_class_depth - 1; i > 0; --i)
+ {
+ if (current_class_stack[i].hidden)
+ break;
+ tree t = current_class_stack[i].type;
+ if (!TYPE_BEING_DEFINED (t))
+ break;
+ r = t;
+ }
+ return r;
+}
+
/* Returns the innermost class type which is not a lambda closure type. */
tree
diff --git a/gcc-4.9/gcc/cp/cp-array-notation.c b/gcc-4.9/gcc/cp/cp-array-notation.c
index fed60c953..a50ff1dc9 100644
--- a/gcc-4.9/gcc/cp/cp-array-notation.c
+++ b/gcc-4.9/gcc/cp/cp-array-notation.c
@@ -607,7 +607,7 @@ expand_an_in_modify_expr (location_t location, tree lhs,
if (lhs_rank == 0 && rhs_rank != 0)
{
- error_at (location, "%qD cannot be scalar when %qD is not", lhs, rhs);
+ error_at (location, "%qE cannot be scalar when %qE is not", lhs, rhs);
return error_mark_node;
}
if (lhs_rank != 0 && rhs_rank != 0 && lhs_rank != rhs_rank)
@@ -1147,13 +1147,13 @@ expand_array_notation_exprs (tree t)
case PARM_DECL:
case NON_LVALUE_EXPR:
case NOP_EXPR:
- case INIT_EXPR:
case ADDR_EXPR:
case ARRAY_REF:
case BIT_FIELD_REF:
case VECTOR_CST:
case COMPLEX_CST:
return t;
+ case INIT_EXPR:
case MODIFY_EXPR:
if (contains_array_notation_expr (t))
t = expand_an_in_modify_expr (loc, TREE_OPERAND (t, 0), NOP_EXPR,
@@ -1175,13 +1175,24 @@ expand_array_notation_exprs (tree t)
return t;
}
case DECL_EXPR:
- {
- tree x = DECL_EXPR_DECL (t);
- if (t && TREE_CODE (x) != FUNCTION_DECL)
+ if (contains_array_notation_expr (t))
+ {
+ tree x = DECL_EXPR_DECL (t);
if (DECL_INITIAL (x))
- t = expand_unary_array_notation_exprs (t);
+ {
+ location_t loc = DECL_SOURCE_LOCATION (x);
+ tree lhs = x;
+ tree rhs = DECL_INITIAL (x);
+ DECL_INITIAL (x) = NULL;
+ tree new_modify_expr = build_modify_expr (loc, lhs,
+ TREE_TYPE (lhs),
+ NOP_EXPR,
+ loc, rhs,
+ TREE_TYPE(rhs));
+ t = expand_array_notation_exprs (new_modify_expr);
+ }
+ }
return t;
- }
case STATEMENT_LIST:
{
tree_stmt_iterator i;
@@ -1392,7 +1403,10 @@ build_array_notation_ref (location_t loc, tree array, tree start, tree length,
if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == POINTER_TYPE)
TREE_TYPE (array_ntn_expr) = TREE_TYPE (type);
else
- gcc_unreachable ();
+ {
+ error_at (loc, "base of array section must be pointer or array type");
+ return error_mark_node;
+ }
SET_EXPR_LOCATION (array_ntn_expr, loc);
return array_ntn_expr;
diff --git a/gcc-4.9/gcc/cp/cp-tree.h b/gcc-4.9/gcc/cp/cp-tree.h
index e6323e7eb..b062b9733 100644
--- a/gcc-4.9/gcc/cp/cp-tree.h
+++ b/gcc-4.9/gcc/cp/cp-tree.h
@@ -5113,6 +5113,7 @@ extern void resort_type_method_vec (void *, void *,
extern bool add_method (tree, tree, tree);
extern bool currently_open_class (tree);
extern tree currently_open_derived_class (tree);
+extern tree outermost_open_class (void);
extern tree current_nonlambda_class_type (void);
extern tree finish_struct (tree, tree);
extern void finish_struct_1 (tree);
diff --git a/gcc-4.9/gcc/cp/decl.c b/gcc-4.9/gcc/cp/decl.c
index 4dd0ec09f..df4813deb 100644
--- a/gcc-4.9/gcc/cp/decl.c
+++ b/gcc-4.9/gcc/cp/decl.c
@@ -14211,8 +14211,8 @@ grokmethod (cp_decl_specifier_seq *declspecs,
/* VAR is a VAR_DECL. If its type is incomplete, remember VAR so that
we can lay it out later, when and if its type becomes complete.
- Also handle constexpr pointer to member variables where the initializer
- is an unlowered PTRMEM_CST because the class isn't complete yet. */
+ Also handle constexpr variables where the initializer involves
+ an unlowered PTRMEM_CST because the class isn't complete yet. */
void
maybe_register_incomplete_var (tree var)
@@ -14237,12 +14237,13 @@ maybe_register_incomplete_var (tree var)
incomplete_var iv = {var, inner_type};
vec_safe_push (incomplete_vars, iv);
}
- else if (TYPE_PTRMEM_P (inner_type)
- && DECL_INITIAL (var)
- && TREE_CODE (DECL_INITIAL (var)) == PTRMEM_CST)
+ else if (!(DECL_LANG_SPECIFIC (var) && DECL_TEMPLATE_INFO (var))
+ && decl_constant_var_p (var)
+ && (TYPE_PTRMEM_P (inner_type) || CLASS_TYPE_P (inner_type)))
{
- tree context = TYPE_PTRMEM_CLASS_TYPE (inner_type);
- gcc_assert (TYPE_BEING_DEFINED (context));
+ /* When the outermost open class is complete we can resolve any
+ pointers-to-members. */
+ tree context = outermost_open_class ();
incomplete_var iv = {var, context};
vec_safe_push (incomplete_vars, iv);
}
@@ -14266,9 +14267,8 @@ complete_vars (tree type)
tree var = iv->decl;
tree type = TREE_TYPE (var);
- if (TYPE_PTRMEM_P (type))
- DECL_INITIAL (var) = cplus_expand_constant (DECL_INITIAL (var));
- else
+ if (TYPE_MAIN_VARIANT (strip_array_types (type))
+ == iv->incomplete_type)
{
/* Complete the type of the variable. The VAR_DECL itself
will be laid out in expand_expr. */
@@ -14276,6 +14276,10 @@ complete_vars (tree type)
cp_apply_type_quals_to_decl (cp_type_quals (type), var);
}
+ if (DECL_INITIAL (var)
+ && decl_constant_var_p (var))
+ DECL_INITIAL (var) = cplus_expand_constant (DECL_INITIAL (var));
+
/* Remove this entry from the list. */
incomplete_vars->unordered_remove (ix);
}
diff --git a/gcc-4.9/gcc/cp/decl2.c b/gcc-4.9/gcc/cp/decl2.c
index 3088918cd..4fc03e912 100644
--- a/gcc-4.9/gcc/cp/decl2.c
+++ b/gcc-4.9/gcc/cp/decl2.c
@@ -1931,6 +1931,11 @@ decl_needed_p (tree decl)
if (flag_keep_inline_dllexport
&& lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
return true;
+ /* Virtual functions might be needed for devirtualization. */
+ if (flag_devirtualize
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_VIRTUAL_P (decl))
+ return true;
/* Otherwise, DECL does not need to be emitted -- yet. A subsequent
reference to DECL might cause it to be emitted later. */
return false;
diff --git a/gcc-4.9/gcc/cp/expr.c b/gcc-4.9/gcc/cp/expr.c
index a62e0f9b5..99f8006fb 100644
--- a/gcc-4.9/gcc/cp/expr.c
+++ b/gcc-4.9/gcc/cp/expr.c
@@ -74,6 +74,14 @@ cplus_expand_constant (tree cst)
}
break;
+ case CONSTRUCTOR:
+ {
+ constructor_elt *elt;
+ unsigned HOST_WIDE_INT idx;
+ FOR_EACH_VEC_SAFE_ELT (CONSTRUCTOR_ELTS (cst), idx, elt)
+ elt->value = cplus_expand_constant (elt->value);
+ }
+
default:
/* There's nothing to do. */
break;
diff --git a/gcc-4.9/gcc/cp/init.c b/gcc-4.9/gcc/cp/init.c
index ecb103a99..283843ae9 100644
--- a/gcc-4.9/gcc/cp/init.c
+++ b/gcc-4.9/gcc/cp/init.c
@@ -3565,19 +3565,11 @@ build_vec_init (tree base, tree maxindex, tree init,
try_block = begin_try_block ();
}
- /* If the initializer is {}, then all elements are initialized from {}.
- But for non-classes, that's the same as value-initialization. */
+ bool empty_list = false;
if (init && BRACE_ENCLOSED_INITIALIZER_P (init)
&& CONSTRUCTOR_NELTS (init) == 0)
- {
- if (CLASS_TYPE_P (type))
- /* Leave init alone. */;
- else
- {
- init = NULL_TREE;
- explicit_value_init_p = true;
- }
- }
+ /* Skip over the handling of non-empty init lists. */
+ empty_list = true;
/* Maybe pull out constant value when from_array? */
@@ -3697,14 +3689,8 @@ build_vec_init (tree base, tree maxindex, tree init,
vec_free (new_vec);
}
- /* Any elements without explicit initializers get {}. */
- if (cxx_dialect >= cxx11 && AGGREGATE_TYPE_P (type))
- init = build_constructor (init_list_type_node, NULL);
- else
- {
- init = NULL_TREE;
- explicit_value_init_p = true;
- }
+ /* Any elements without explicit initializers get T{}. */
+ empty_list = true;
}
else if (from_array)
{
@@ -3750,6 +3736,26 @@ build_vec_init (tree base, tree maxindex, tree init,
to = build1 (INDIRECT_REF, type, base);
+ /* If the initializer is {}, then all elements are initialized from T{}.
+ But for non-classes, that's the same as value-initialization. */
+ if (empty_list)
+ {
+ if (cxx_dialect >= cxx11 && AGGREGATE_TYPE_P (type))
+ {
+ if (BRACE_ENCLOSED_INITIALIZER_P (init)
+ && CONSTRUCTOR_NELTS (init) == 0)
+ /* Reuse it. */;
+ else
+ init = build_constructor (init_list_type_node, NULL);
+ CONSTRUCTOR_IS_DIRECT_INIT (init) = true;
+ }
+ else
+ {
+ init = NULL_TREE;
+ explicit_value_init_p = true;
+ }
+ }
+
if (from_array)
{
tree from;
@@ -3854,6 +3860,13 @@ build_vec_init (tree base, tree maxindex, tree init,
stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt);
+ current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
+
+ if (errors)
+ return error_mark_node;
+ if (const_init)
+ return build2 (INIT_EXPR, atype, obase, const_init);
+
/* Now make the result have the correct type. */
if (TREE_CODE (atype) == ARRAY_TYPE)
{
@@ -3863,12 +3876,6 @@ build_vec_init (tree base, tree maxindex, tree init,
TREE_NO_WARNING (stmt_expr) = 1;
}
- current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
-
- if (const_init)
- return build2 (INIT_EXPR, atype, obase, const_init);
- if (errors)
- return error_mark_node;
return stmt_expr;
}
diff --git a/gcc-4.9/gcc/cp/lambda.c b/gcc-4.9/gcc/cp/lambda.c
index 7bd0de15f..6acbdd9ee 100644
--- a/gcc-4.9/gcc/cp/lambda.c
+++ b/gcc-4.9/gcc/cp/lambda.c
@@ -820,6 +820,7 @@ void
maybe_add_lambda_conv_op (tree type)
{
bool nested = (current_function_decl != NULL_TREE);
+ bool nested_def = decl_function_context (TYPE_MAIN_DECL (type));
tree callop = lambda_function (type);
if (LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (type)) != NULL_TREE)
@@ -972,7 +973,7 @@ maybe_add_lambda_conv_op (tree type)
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_ARGUMENTS (fn) = build_this_parm (fntype, TYPE_QUAL_CONST);
- if (nested)
+ if (nested_def)
DECL_INTERFACE_KNOWN (fn) = 1;
if (generic_lambda_p)
@@ -1012,7 +1013,7 @@ maybe_add_lambda_conv_op (tree type)
DECL_NAME (arg) = NULL_TREE;
DECL_CONTEXT (arg) = fn;
}
- if (nested)
+ if (nested_def)
DECL_INTERFACE_KNOWN (fn) = 1;
if (generic_lambda_p)
diff --git a/gcc-4.9/gcc/cp/parser.c b/gcc-4.9/gcc/cp/parser.c
index 706f6c020..88478bf13 100644
--- a/gcc-4.9/gcc/cp/parser.c
+++ b/gcc-4.9/gcc/cp/parser.c
@@ -6306,7 +6306,7 @@ cp_parser_array_notation (location_t loc, cp_parser *parser, tree *init_index,
parser->colon_corrects_to_scope_p = saved_colon_corrects;
if (*init_index == error_mark_node || length_index == error_mark_node
- || stride == error_mark_node)
+ || stride == error_mark_node || array_type == error_mark_node)
{
if (cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_SQUARE)
cp_lexer_consume_token (parser->lexer);
diff --git a/gcc-4.9/gcc/cp/pt.c b/gcc-4.9/gcc/cp/pt.c
index 54676afcc..a049a1e21 100644
--- a/gcc-4.9/gcc/cp/pt.c
+++ b/gcc-4.9/gcc/cp/pt.c
@@ -4706,6 +4706,9 @@ push_template_decl_real (tree decl, bool is_friend)
template <typename T> friend void A<T>::f();
is not primary. */
is_primary = false;
+ else if (TREE_CODE (decl) == TYPE_DECL
+ && LAMBDA_TYPE_P (TREE_TYPE (decl)))
+ is_primary = false;
else
is_primary = template_parm_scope_p ();
@@ -9144,6 +9147,11 @@ instantiate_class_template_1 (tree type)
&& DECL_OMP_DECLARE_REDUCTION_P (r))
cp_check_omp_declare_reduction (r);
}
+ else if (DECL_CLASS_TEMPLATE_P (t)
+ && LAMBDA_TYPE_P (TREE_TYPE (t)))
+ /* A closure type for a lambda in a default argument for a
+ member template. Ignore it; it will be instantiated with
+ the default argument. */;
else
{
/* Build new TYPE_FIELDS. */
@@ -15190,6 +15198,16 @@ tsubst_copy_and_build (tree t,
case PARM_DECL:
{
tree r = tsubst_copy (t, args, complain, in_decl);
+ if (TREE_CODE (r) == VAR_DECL
+ && !processing_template_decl
+ && !cp_unevaluated_operand
+ && DECL_THREAD_LOCAL_P (r))
+ {
+ if (tree wrap = get_tls_wrapper_fn (r))
+ /* Replace an evaluated use of the thread_local variable with
+ a call to its wrapper. */
+ r = build_cxx_call (wrap, 0, NULL, tf_warning_or_error);
+ }
if (TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE)
/* If the original type was a reference, we'll be wrapped in
diff --git a/gcc-4.9/gcc/cp/semantics.c b/gcc-4.9/gcc/cp/semantics.c
index de5e536f5..db4f9fdcd 100644
--- a/gcc-4.9/gcc/cp/semantics.c
+++ b/gcc-4.9/gcc/cp/semantics.c
@@ -3496,6 +3496,7 @@ finish_id_expression (tree id_expression,
tree wrap;
if (VAR_P (decl)
&& !cp_unevaluated_operand
+ && !processing_template_decl
&& DECL_THREAD_LOCAL_P (decl)
&& (wrap = get_tls_wrapper_fn (decl)))
{
@@ -8982,7 +8983,9 @@ cxx_eval_bare_aggregate (const constexpr_call *call, tree t,
constructor_elt *inner = base_field_constructor_elt (n, ce->index);
inner->value = elt;
}
- else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
+ else if (ce->index
+ && (TREE_CODE (ce->index) == NOP_EXPR
+ || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
{
/* This is an initializer for an empty base; now that we've
checked that it's constant, we can ignore it. */
diff --git a/gcc-4.9/gcc/cp/tree.c b/gcc-4.9/gcc/cp/tree.c
index 622ba99f7..2820ba0f9 100644
--- a/gcc-4.9/gcc/cp/tree.c
+++ b/gcc-4.9/gcc/cp/tree.c
@@ -3795,6 +3795,10 @@ stabilize_expr (tree exp, tree* initp)
{
init_expr = get_target_expr (exp);
exp = TARGET_EXPR_SLOT (init_expr);
+ if (CLASS_TYPE_P (TREE_TYPE (exp)))
+ exp = move (exp);
+ else
+ exp = rvalue (exp);
}
else
{
diff --git a/gcc-4.9/gcc/cp/typeck2.c b/gcc-4.9/gcc/cp/typeck2.c
index 0bdad2a51..f8af0964c 100644
--- a/gcc-4.9/gcc/cp/typeck2.c
+++ b/gcc-4.9/gcc/cp/typeck2.c
@@ -1237,8 +1237,9 @@ process_init_constructor_array (tree type, tree init,
{
/* If this type needs constructors run for default-initialization,
we can't rely on the back end to do it for us, so make the
- initialization explicit by list-initializing from {}. */
+ initialization explicit by list-initializing from T{}. */
next = build_constructor (init_list_type_node, NULL);
+ CONSTRUCTOR_IS_DIRECT_INIT (next) = true;
next = massage_init_elt (TREE_TYPE (type), next, complain);
if (initializer_zerop (next))
/* The default zero-initialization is fine for us; don't
diff --git a/gcc-4.9/gcc/cprop.c b/gcc-4.9/gcc/cprop.c
index c3acb05c1..6a3429e19 100644
--- a/gcc-4.9/gcc/cprop.c
+++ b/gcc-4.9/gcc/cprop.c
@@ -790,8 +790,11 @@ try_replace_reg (rtx from, rtx to, rtx insn)
/* REG_EQUAL may get simplified into register.
We don't allow that. Remove that note. This code ought
not to happen, because previous code ought to synthesize
- reg-reg move, but be on the safe side. */
- if (note && REG_NOTE_KIND (note) == REG_EQUAL && REG_P (XEXP (note, 0)))
+ reg-reg move, but be on the safe side. The REG_EQUAL note is
+ also removed when the source is a constant. */
+ if (note && REG_NOTE_KIND (note) == REG_EQUAL
+ && (REG_P (XEXP (note, 0))
+ || (set && CONSTANT_P (SET_SRC (set)))))
remove_note (insn, note);
return success;
diff --git a/gcc-4.9/gcc/doc/invoke.texi b/gcc-4.9/gcc/doc/invoke.texi
index d4ced8484..2fb008d42 100644
--- a/gcc-4.9/gcc/doc/invoke.texi
+++ b/gcc-4.9/gcc/doc/invoke.texi
@@ -13808,7 +13808,7 @@ are compatible with as many systems and code bases as possible.
@item -mkernel
@opindex mkernel
Enable kernel development mode. The @option{-mkernel} option sets
-@option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
+@option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
@option{-fno-exceptions}, @option{-fno-non-call-exceptions},
@option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
applicable. This mode also sets @option{-mno-altivec},
@@ -20741,6 +20741,72 @@ single-precision mode by default.
@opindex m4
Generate code for the SH4.
+@item -m4-100
+@opindex m4-100
+Generate code for SH4-100.
+
+@item -m4-100-nofpu
+@opindex m4-100-nofpu
+Generate code for SH4-100 in such a way that the
+floating-point unit is not used.
+
+@item -m4-100-single
+@opindex m4-100-single
+Generate code for SH4-100 assuming the floating-point unit is in
+single-precision mode by default.
+
+@item -m4-100-single-only
+@opindex m4-100-single-only
+Generate code for SH4-100 in such a way that no double-precision
+floating-point operations are used.
+
+@item -m4-200
+@opindex m4-200
+Generate code for SH4-200.
+
+@item -m4-200-nofpu
+@opindex m4-200-nofpu
+Generate code for SH4-200 without in such a way that the
+floating-point unit is not used.
+
+@item -m4-200-single
+@opindex m4-200-single
+Generate code for SH4-200 assuming the floating-point unit is in
+single-precision mode by default.
+
+@item -m4-200-single-only
+@opindex m4-200-single-only
+Generate code for SH4-200 in such a way that no double-precision
+floating-point operations are used.
+
+@item -m4-300
+@opindex m4-300
+Generate code for SH4-300.
+
+@item -m4-300-nofpu
+@opindex m4-300-nofpu
+Generate code for SH4-300 without in such a way that the
+floating-point unit is not used.
+
+@item -m4-300-single
+@opindex m4-300-single
+Generate code for SH4-300 in such a way that no double-precision
+floating-point operations are used.
+
+@item -m4-300-single-only
+@opindex m4-300-single-only
+Generate code for SH4-300 in such a way that no double-precision
+floating-point operations are used.
+
+@item -m4-340
+@opindex m4-340
+Generate code for SH4-340 (no MMU, no FPU).
+
+@item -m4-500
+@opindex m4-500
+Generate code for SH4-500 (no FPU). Passes @option{-isa=sh4-nofpu} to the
+assembler.
+
@item -m4a-nofpu
@opindex m4a-nofpu
Generate code for the SH4al-dsp, or for a SH4a in such a way that the
@@ -20766,6 +20832,33 @@ Same as @option{-m4a-nofpu}, except that it implicitly passes
@option{-dsp} to the assembler. GCC doesn't generate any DSP
instructions at the moment.
+@item -m5-32media
+@opindex m5-32media
+Generate 32-bit code for SHmedia.
+
+@item -m5-32media-nofpu
+@opindex m5-32media-nofpu
+Generate 32-bit code for SHmedia in such a way that the
+floating-point unit is not used.
+
+@item -m5-64media
+@opindex m5-64media
+Generate 64-bit code for SHmedia.
+
+@item -m5-64media-nofpu
+@opindex m5-64media-nofpu
+Generate 64-bit code for SHmedia in such a way that the
+floating-point unit is not used.
+
+@item -m5-compact
+@opindex m5-compact
+Generate code for SHcompact.
+
+@item -m5-compact-nofpu
+@opindex m5-compact-nofpu
+Generate code for SHcompact in such a way that the
+floating-point unit is not used.
+
@item -mb
@opindex mb
Compile code for the processor in big-endian mode.
@@ -20799,16 +20892,12 @@ Enable the use of bit manipulation instructions on SH2A.
Enable the use of the instruction @code{fmovd}. Check @option{-mdalign} for
alignment constraints.
-@item -mhitachi
-@opindex mhitachi
-Comply with the calling conventions defined by Renesas.
-
@item -mrenesas
-@opindex mhitachi
+@opindex mrenesas
Comply with the calling conventions defined by Renesas.
@item -mno-renesas
-@opindex mhitachi
+@opindex mno-renesas
Comply with the calling conventions defined for GCC before the Renesas
conventions were available. This option is the default for all
targets of the SH toolchain.
@@ -20816,12 +20905,12 @@ targets of the SH toolchain.
@item -mnomacsave
@opindex mnomacsave
Mark the @code{MAC} register as call-clobbered, even if
-@option{-mhitachi} is given.
+@option{-mrenesas} is given.
@item -mieee
@itemx -mno-ieee
@opindex mieee
-@opindex mnoieee
+@opindex mno-ieee
Control the IEEE compliance of floating-point comparisons, which affects the
handling of cases where the result of a comparison is unordered. By default
@option{-mieee} is implicitly enabled. If @option{-ffinite-math-only} is
@@ -20861,14 +20950,14 @@ separated list. For details on the atomic built-in functions see
@item none
Disable compiler generated atomic sequences and emit library calls for atomic
-operations. This is the default if the target is not @code{sh-*-linux*}.
+operations. This is the default if the target is not @code{sh*-*-linux*}.
@item soft-gusa
Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
built-in functions. The generated atomic sequences require additional support
from the interrupt/exception handling code of the system and are only suitable
for SH3* and SH4* single-core systems. This option is enabled by default when
-the target is @code{sh-*-linux*} and SH3* or SH4*. When the target is SH4A,
+the target is @code{sh*-*-linux*} and SH3* or SH4*. When the target is SH4A,
this option will also partially utilize the hardware atomic instructions
@code{movli.l} and @code{movco.l} to create more efficient code, unless
@samp{strict} is specified.
@@ -20887,7 +20976,7 @@ setting @code{SR.IMASK = 1111}. This model works only when the program runs
in privileged mode and is only suitable for single-core systems. Additional
support from the interrupt/exception handling code of the system is not
required. This model is enabled by default when the target is
-@code{sh-*-linux*} and SH1* or SH2*.
+@code{sh*-*-linux*} and SH1* or SH2*.
@item hard-llcs
Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
@@ -20922,21 +21011,20 @@ that are implied by the @code{tas.b} instruction. On multi-core SH4A
processors the @code{tas.b} instruction must be used with caution since it
can result in data corruption for certain cache configurations.
-@item -mspace
-@opindex mspace
-Optimize for space instead of speed. Implied by @option{-Os}.
-
@item -mprefergot
@opindex mprefergot
When generating position-independent code, emit function calls using
the Global Offset Table instead of the Procedure Linkage Table.
@item -musermode
+@itemx -mno-usermode
@opindex musermode
-Don't generate privileged mode only code. This option
-implies @option{-mno-inline-ic_invalidate}
-if the inlined code would not work in user mode.
-This is the default when the target is @code{sh-*-linux*}.
+@opindex mno-usermode
+Don't allow (allow) the compiler generating privileged mode code. Specifying
+@option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
+inlined code would not work in user mode. @option{-musermode} is the default
+when the target is @code{sh*-*-linux*}. If the target is SH1* or SH2*
+@option{-musermode} has no effect, since there is no user mode.
@item -multcost=@var{number}
@opindex multcost=@var{number}
diff --git a/gcc-4.9/gcc/doc/md.texi b/gcc-4.9/gcc/doc/md.texi
index 8e30aca94..60ca79986 100644
--- a/gcc-4.9/gcc/doc/md.texi
+++ b/gcc-4.9/gcc/doc/md.texi
@@ -2126,6 +2126,18 @@ VSX vector register to hold vector float data or NO_REGS.
@item wg
If @option{-mmfpgpr} was used, a floating point register or NO_REGS.
+@item wh
+Floating point register if direct moves are available, or NO_REGS.
+
+@item wi
+FP or VSX register to hold 64-bit integers for VSX insns or NO_REGS.
+
+@item wj
+FP or VSX register to hold 64-bit integers for direct moves or NO_REGS.
+
+@item wk
+FP or VSX register to hold 64-bit doubles for direct moves or NO_REGS.
+
@item wl
Floating point register if the LFIWAX instruction is enabled or NO_REGS.
@@ -2157,7 +2169,7 @@ FP or VSX register to perform float operations under @option{-mvsx} or NO_REGS.
Floating point register if the STFIWX instruction is enabled or NO_REGS.
@item wy
-VSX vector register to hold scalar float values or NO_REGS.
+FP or VSX register to perform ISA 2.07 float ops or NO_REGS.
@item wz
Floating point register if the LFIWZX instruction is enabled or NO_REGS.
diff --git a/gcc-4.9/gcc/dwarf2out.c b/gcc-4.9/gcc/dwarf2out.c
index 088e522c7..ca4bd16e0 100644
--- a/gcc-4.9/gcc/dwarf2out.c
+++ b/gcc-4.9/gcc/dwarf2out.c
@@ -8966,26 +8966,6 @@ add_top_level_skeleton_die_attrs (dw_die_ref die)
add_AT_lineptr (die, DW_AT_GNU_addr_base, debug_addr_section_label);
}
-/* Return the single type-unit die for skeleton type units. */
-
-static dw_die_ref
-get_skeleton_type_unit (void)
-{
- /* For dwarf_split_debug_sections with use_type info, all type units in the
- skeleton sections have identical dies (but different headers). This
- single die will be output many times. */
-
- static dw_die_ref skeleton_type_unit = NULL;
-
- if (skeleton_type_unit == NULL)
- {
- skeleton_type_unit = new_die (DW_TAG_type_unit, NULL, NULL);
- add_top_level_skeleton_die_attrs (skeleton_type_unit);
- skeleton_type_unit->die_abbrev = SKELETON_TYPE_DIE_ABBREV;
- }
- return skeleton_type_unit;
-}
-
/* Output skeleton debug sections that point to the dwo file. */
static void
@@ -9024,8 +9004,6 @@ output_skeleton_debug_sections (dw_die_ref comp_unit)
ASM_OUTPUT_LABEL (asm_out_file, debug_skeleton_abbrev_section_label);
output_die_abbrevs (SKELETON_COMP_DIE_ABBREV, comp_unit);
- if (use_debug_types)
- output_die_abbrevs (SKELETON_TYPE_DIE_ABBREV, get_skeleton_type_unit ());
dw2_asm_output_data (1, 0, "end of skeleton .debug_abbrev");
}
@@ -9087,38 +9065,6 @@ output_comdat_type_unit (comdat_type_node *node)
output_die (node->root_die);
unmark_dies (node->root_die);
-
-#if defined (OBJECT_FORMAT_ELF)
- if (dwarf_split_debug_info)
- {
- /* Produce the skeleton type-unit header. */
- const char *secname = ".debug_types";
-
- targetm.asm_out.named_section (secname,
- SECTION_DEBUG | SECTION_LINKONCE,
- comdat_key);
- if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
- dw2_asm_output_data (4, 0xffffffff,
- "Initial length escape value indicating 64-bit DWARF extension");
-
- dw2_asm_output_data (DWARF_OFFSET_SIZE,
- DWARF_COMPILE_UNIT_HEADER_SIZE
- - DWARF_INITIAL_LENGTH_SIZE
- + size_of_die (get_skeleton_type_unit ())
- + DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE,
- "Length of Type Unit Info");
- dw2_asm_output_data (2, dwarf_version, "DWARF version number");
- dw2_asm_output_offset (DWARF_OFFSET_SIZE,
- debug_skeleton_abbrev_section_label,
- debug_abbrev_section,
- "Offset Into Abbrev. Section");
- dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
- output_signature (node->signature, "Type Signature");
- dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "Offset to Type DIE");
-
- output_die (get_skeleton_type_unit ());
- }
-#endif
}
/* Return the DWARF2/3 pubname associated with a decl. */
@@ -24331,7 +24277,6 @@ dwarf2out_finish (const char *filename)
skeleton die attrs are added when the skeleton type unit is
created, so ensure it is created by this point. */
add_top_level_skeleton_die_attrs (main_comp_unit_die);
- (void) get_skeleton_type_unit ();
htab_traverse_noresize (debug_str_hash, index_string, &index);
}
diff --git a/gcc-4.9/gcc/emit-rtl.c b/gcc-4.9/gcc/emit-rtl.c
index 4736f8d0d..89b676837 100644
--- a/gcc-4.9/gcc/emit-rtl.c
+++ b/gcc-4.9/gcc/emit-rtl.c
@@ -245,7 +245,7 @@ const_fixed_htab_eq (const void *x, const void *y)
/* Return true if the given memory attributes are equal. */
-static bool
+bool
mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
{
return (p->alias == q->alias
diff --git a/gcc-4.9/gcc/emit-rtl.h b/gcc-4.9/gcc/emit-rtl.h
index fe68de947..36eb0c8b1 100644
--- a/gcc-4.9/gcc/emit-rtl.h
+++ b/gcc-4.9/gcc/emit-rtl.h
@@ -20,6 +20,9 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_EMIT_RTL_H
#define GCC_EMIT_RTL_H
+/* Return whether two MEM_ATTRs are equal. */
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
+
/* Set the alias set of MEM to SET. */
extern void set_mem_alias_set (rtx, alias_set_type);
diff --git a/gcc-4.9/gcc/final.c b/gcc-4.9/gcc/final.c
index 9af0b2bec..38c90b281 100644
--- a/gcc-4.9/gcc/final.c
+++ b/gcc-4.9/gcc/final.c
@@ -4501,8 +4501,6 @@ rest_of_handle_final (void)
assemble_end_function (current_function_decl, fnname);
- user_defined_section_attribute = false;
-
/* Free up reg info memory. */
free_reg_info ();
diff --git a/gcc-4.9/gcc/fortran/ChangeLog b/gcc-4.9/gcc/fortran/ChangeLog
index d2e070b78..9f4bec74e 100644
--- a/gcc-4.9/gcc/fortran/ChangeLog
+++ b/gcc-4.9/gcc/fortran/ChangeLog
@@ -1,3 +1,59 @@
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62214
+ * frontend-passes.c (optimize_binop_array_assignment):
+ Do not try to optimize the array assignment for string
+ concatenation.
+
+2014-08-16 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62142
+ * trans-expr.c (is_runtime_conformable): Add NULL pointer checks.
+
+2014-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62106
+ * gfortran.h (symbol_attribute): Add fe_temp flag.
+ * frontend-passes.c (is_fe_temp): New function.
+ (create_var): Don't add a temporary for an already
+ created variable or for a constant.
+ (combine_ARRAY_constructor): Remove special handling
+ for constants.
+
+2014-08-15 Jakub Jelinek <jakub@redhat.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/62131
+ * openmp.c (resolve_omp_atomic): Only complain if code->expr1's attr
+ is allocatable, rather than whenever var->attr.allocatable.
+
+2014-08-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/62107
+ * trans-openmp.c (gfc_omp_finish_clause): Handle scalar pointer
+ or allocatable passed by reference.
+ (gfc_trans_omp_clauses) <case OMP_LIST_MAP>: Likewise.
+
+2014-08-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/62076
+ * openmp.c (gfc_match_omp_clauses): When failed to match
+ operator name, defined op name or name, set buffer to
+ empty string. Don't call gfc_find_omp_udr if buffer is empty
+ string.
+ (gfc_match_omp_declare_reduction): Call gfc_undo_symbols ()
+ before calling gfc_free_omp_udr.
+
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/61999
+ * simplify.c (gfc_simplify_dot_product): Convert types of
+ vectors before calculating the result.
+
2014-07-19 Paul Thomas <pault@gcc.gnu.org>
Backport from mainline
diff --git a/gcc-4.9/gcc/fortran/frontend-passes.c b/gcc-4.9/gcc/fortran/frontend-passes.c
index 4646cc33f..23a8ece17 100644
--- a/gcc-4.9/gcc/fortran/frontend-passes.c
+++ b/gcc-4.9/gcc/fortran/frontend-passes.c
@@ -430,11 +430,26 @@ cfe_register_funcs (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED,
return 0;
}
+/* Auxiliary function to check if an expression is a temporary created by
+ create var. */
+
+static bool
+is_fe_temp (gfc_expr *e)
+{
+ if (e->expr_type != EXPR_VARIABLE)
+ return false;
+
+ return e->symtree->n.sym->attr.fe_temp;
+}
+
+
/* Returns a new expression (a variable) to be used in place of the old one,
with an assignment statement before the current statement to set
the value of the variable. Creates a new BLOCK for the statement if
that hasn't already been done and puts the statement, plus the
- newly created variables, in that block. */
+ newly created variables, in that block. Special cases: If the
+ expression is constant or a temporary which has already
+ been created, just copy it. */
static gfc_expr*
create_var (gfc_expr * e)
@@ -448,6 +463,9 @@ create_var (gfc_expr * e)
gfc_namespace *ns;
int i;
+ if (e->expr_type == EXPR_CONSTANT || is_fe_temp (e))
+ return gfc_copy_expr (e);
+
/* If the block hasn't already been created, do so. */
if (inserted_block == NULL)
{
@@ -522,6 +540,7 @@ create_var (gfc_expr * e)
symbol->attr.flavor = FL_VARIABLE;
symbol->attr.referenced = 1;
symbol->attr.dimension = e->rank > 0;
+ symbol->attr.fe_temp = 1;
gfc_commit_symbol (symbol);
result = gfc_get_expr ();
@@ -884,6 +903,10 @@ optimize_binop_array_assignment (gfc_code *c, gfc_expr **rhs, bool seen_op)
return true;
break;
+ case INTRINSIC_CONCAT:
+ /* Do not do string concatenations. */
+ break;
+
default:
/* Binary operators. */
if (optimize_binop_array_assignment (c, &e->value.op.op1, true))
@@ -1082,10 +1105,7 @@ combine_array_constructor (gfc_expr *e)
if (op2->ts.type == BT_CHARACTER)
return false;
- if (op2->expr_type == EXPR_CONSTANT)
- scalar = gfc_copy_expr (op2);
- else
- scalar = create_var (gfc_copy_expr (op2));
+ scalar = create_var (gfc_copy_expr (op2));
oldbase = op1->value.constructor;
newbase = NULL;
diff --git a/gcc-4.9/gcc/fortran/gfortran.h b/gcc-4.9/gcc/fortran/gfortran.h
index 6b88aec38..a193f53fe 100644
--- a/gcc-4.9/gcc/fortran/gfortran.h
+++ b/gcc-4.9/gcc/fortran/gfortran.h
@@ -724,7 +724,7 @@ typedef struct
optional:1, pointer:1, target:1, value:1, volatile_:1, temporary:1,
dummy:1, result:1, assign:1, threadprivate:1, not_always_present:1,
implied_index:1, subref_array_pointer:1, proc_pointer:1, asynchronous:1,
- contiguous:1;
+ contiguous:1, fe_temp: 1;
/* For CLASS containers, the pointer attribute is sometimes set internally
even though it was not directly specified. In this case, keep the
diff --git a/gcc-4.9/gcc/fortran/openmp.c b/gcc-4.9/gcc/fortran/openmp.c
index 68ba70f7e..58aaf6623 100644
--- a/gcc-4.9/gcc/fortran/openmp.c
+++ b/gcc-4.9/gcc/fortran/openmp.c
@@ -464,7 +464,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, unsigned int mask,
|| !gfc_add_intrinsic (&sym->attr, NULL)))
rop = OMP_REDUCTION_NONE;
}
- gfc_omp_udr *udr = gfc_find_omp_udr (gfc_current_ns, buffer, NULL);
+ else
+ buffer[0] = '\0';
+ gfc_omp_udr *udr
+ = (buffer[0]
+ ? gfc_find_omp_udr (gfc_current_ns, buffer, NULL) : NULL);
gfc_omp_namelist **head = NULL;
if (rop == OMP_REDUCTION_NONE && udr)
rop = OMP_REDUCTION_USER;
@@ -1240,6 +1244,7 @@ gfc_match_omp_declare_reduction (void)
syntax:
gfc_current_locus = old_loc;
gfc_current_ns = combiner_ns->parent;
+ gfc_undo_symbols ();
gfc_free_omp_udr (omp_udr);
return MATCH_ERROR;
}
@@ -2739,7 +2744,7 @@ resolve_omp_atomic (gfc_code *code)
break;
}
- if (var->attr.allocatable)
+ if (gfc_expr_attr (code->expr1).allocatable)
{
gfc_error ("!$OMP ATOMIC with ALLOCATABLE variable at %L",
&code->loc);
diff --git a/gcc-4.9/gcc/fortran/simplify.c b/gcc-4.9/gcc/fortran/simplify.c
index 96d0f21f3..d20552327 100644
--- a/gcc-4.9/gcc/fortran/simplify.c
+++ b/gcc-4.9/gcc/fortran/simplify.c
@@ -1878,13 +1878,22 @@ gfc_simplify_dim (gfc_expr *x, gfc_expr *y)
gfc_expr*
gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
{
+
+ gfc_expr temp;
+
if (!is_constant_array_expr (vector_a)
|| !is_constant_array_expr (vector_b))
return NULL;
gcc_assert (vector_a->rank == 1);
gcc_assert (vector_b->rank == 1);
- gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));
+
+ temp.expr_type = EXPR_OP;
+ gfc_clear_ts (&temp.ts);
+ temp.value.op.op = INTRINSIC_NONE;
+ temp.value.op.op1 = vector_a;
+ temp.value.op.op2 = vector_b;
+ gfc_type_convert_binary (&temp, 1);
return compute_dot_product (vector_a, 1, 0, vector_b, 1, 0, true);
}
diff --git a/gcc-4.9/gcc/fortran/trans-expr.c b/gcc-4.9/gcc/fortran/trans-expr.c
index dbfde1bdc..824ab785b 100644
--- a/gcc-4.9/gcc/fortran/trans-expr.c
+++ b/gcc-4.9/gcc/fortran/trans-expr.c
@@ -7842,7 +7842,7 @@ is_runtime_conformable (gfc_expr *expr1, gfc_expr *expr2)
for (a = expr2->value.function.actual; a != NULL; a = a->next)
{
e1 = a->expr;
- if (e1->rank > 0 && !is_runtime_conformable (expr1, e1))
+ if (e1 && e1->rank > 0 && !is_runtime_conformable (expr1, e1))
return false;
}
return true;
@@ -7853,7 +7853,7 @@ is_runtime_conformable (gfc_expr *expr1, gfc_expr *expr2)
for (a = expr2->value.function.actual; a != NULL; a = a->next)
{
e1 = a->expr;
- if (e1->rank > 0 && !is_runtime_conformable (expr1, e1))
+ if (e1 && e1->rank > 0 && !is_runtime_conformable (expr1, e1))
return false;
}
return true;
diff --git a/gcc-4.9/gcc/fortran/trans-openmp.c b/gcc-4.9/gcc/fortran/trans-openmp.c
index da01a9034..548b5d3a4 100644
--- a/gcc-4.9/gcc/fortran/trans-openmp.c
+++ b/gcc-4.9/gcc/fortran/trans-openmp.c
@@ -1022,6 +1022,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
&& !GFC_DECL_CRAY_POINTEE (decl)
&& !GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
return;
+ tree orig_decl = decl;
c4 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
OMP_CLAUSE_MAP_KIND (c4) = OMP_CLAUSE_MAP_POINTER;
OMP_CLAUSE_DECL (c4) = decl;
@@ -1029,6 +1030,17 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
decl = build_fold_indirect_ref (decl);
OMP_CLAUSE_DECL (c) = decl;
OMP_CLAUSE_SIZE (c) = NULL_TREE;
+ if (TREE_CODE (TREE_TYPE (orig_decl)) == REFERENCE_TYPE
+ && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)
+ || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
+ {
+ c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
+ OMP_CLAUSE_MAP_KIND (c3) = OMP_CLAUSE_MAP_POINTER;
+ OMP_CLAUSE_DECL (c3) = unshare_expr (decl);
+ OMP_CLAUSE_SIZE (c3) = size_int (0);
+ decl = build_fold_indirect_ref (decl);
+ OMP_CLAUSE_DECL (c) = decl;
+ }
}
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
{
@@ -1884,14 +1896,32 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
TREE_ADDRESSABLE (decl) = 1;
if (n->expr == NULL || n->expr->ref->u.ar.type == AR_FULL)
{
- if (POINTER_TYPE_P (TREE_TYPE (decl)))
+ if (POINTER_TYPE_P (TREE_TYPE (decl))
+ && (gfc_omp_privatize_by_reference (decl)
+ || GFC_DECL_GET_SCALAR_POINTER (decl)
+ || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)
+ || GFC_DECL_CRAY_POINTEE (decl)
+ || GFC_DESCRIPTOR_TYPE_P
+ (TREE_TYPE (TREE_TYPE (decl)))))
{
+ tree orig_decl = decl;
node4 = build_omp_clause (input_location,
OMP_CLAUSE_MAP);
OMP_CLAUSE_MAP_KIND (node4) = OMP_CLAUSE_MAP_POINTER;
OMP_CLAUSE_DECL (node4) = decl;
OMP_CLAUSE_SIZE (node4) = size_int (0);
decl = build_fold_indirect_ref (decl);
+ if (TREE_CODE (TREE_TYPE (orig_decl)) == REFERENCE_TYPE
+ && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)
+ || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
+ {
+ node3 = build_omp_clause (input_location,
+ OMP_CLAUSE_MAP);
+ OMP_CLAUSE_MAP_KIND (node3) = OMP_CLAUSE_MAP_POINTER;
+ OMP_CLAUSE_DECL (node3) = decl;
+ OMP_CLAUSE_SIZE (node3) = size_int (0);
+ decl = build_fold_indirect_ref (decl);
+ }
}
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
{
diff --git a/gcc-4.9/gcc/gcov-tool.c b/gcc-4.9/gcc/gcov-tool.c
index e7b551e3b..37d15620d 100644
--- a/gcc-4.9/gcc/gcov-tool.c
+++ b/gcc-4.9/gcc/gcov-tool.c
@@ -54,7 +54,6 @@ extern void set_use_existing_grouping (void);
extern void set_use_modu_list (void);
extern void lipo_set_substitute_string (const char *);
-#if !defined(_WIN32)
/* The following defines are needed by dyn-ipa.c.
They will also be emitted by the compiler with -fprofile-generate,
which means this file cannot be compiled with -fprofile-generate
@@ -77,18 +76,6 @@ WEAK_ATTR gcov_unsigned_t __gcov_lipo_cutoff;
WEAK_ATTR gcov_unsigned_t __gcov_lipo_random_seed;
WEAK_ATTR gcov_unsigned_t __gcov_lipo_dump_cgraph;
WEAK_ATTR gcov_unsigned_t __gcov_lipo_propagate_scale;
-#else
-gcov_unsigned_t __gcov_lipo_grouping_algorithm;
-gcov_unsigned_t __gcov_lipo_merge_modu_edges;
-gcov_unsigned_t __gcov_lipo_weak_inclusion;
-gcov_unsigned_t __gcov_lipo_max_mem;
-gcov_unsigned_t __gcov_lipo_comdat_algorithm;
-gcov_unsigned_t __gcov_lipo_random_group_size;
-gcov_unsigned_t __gcov_lipo_cutoff;
-gcov_unsigned_t __gcov_lipo_random_seed;
-gcov_unsigned_t __gcov_lipo_dump_cgraph;
-gcov_unsigned_t __gcov_lipo_propagate_scale;
-#endif
#undef WEAK_ATTR
diff --git a/gcc-4.9/gcc/genconfig.c b/gcc-4.9/gcc/genconfig.c
index cafa8d304..d1996c3af 100644
--- a/gcc-4.9/gcc/genconfig.c
+++ b/gcc-4.9/gcc/genconfig.c
@@ -36,6 +36,8 @@ static int have_cc0_flag;
static int have_cmove_flag;
static int have_cond_exec_flag;
static int have_lo_sum_flag;
+static int have_rotate_flag;
+static int have_rotatert_flag;
static int have_peephole_flag;
static int have_peephole2_flag;
@@ -117,6 +119,16 @@ walk_insn_part (rtx part, int recog_p, int non_pc_set_src)
have_lo_sum_flag = 1;
return;
+ case ROTATE:
+ if (recog_p)
+ have_rotate_flag = 1;
+ return;
+
+ case ROTATERT:
+ if (recog_p)
+ have_rotatert_flag = 1;
+ return;
+
case SET:
walk_insn_part (SET_DEST (part), 0, recog_p);
walk_insn_part (SET_SRC (part), recog_p,
@@ -346,6 +358,12 @@ main (int argc, char **argv)
if (have_lo_sum_flag)
printf ("#define HAVE_lo_sum 1\n");
+ if (have_rotate_flag)
+ printf ("#define HAVE_rotate 1\n");
+
+ if (have_rotatert_flag)
+ printf ("#define HAVE_rotatert 1\n");
+
if (have_peephole_flag)
printf ("#define HAVE_peephole 1\n");
diff --git a/gcc-4.9/gcc/gimple-fold.c b/gcc-4.9/gcc/gimple-fold.c
index 57ab8584c..ab38bde7c 100644
--- a/gcc-4.9/gcc/gimple-fold.c
+++ b/gcc-4.9/gcc/gimple-fold.c
@@ -3106,8 +3106,8 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset,
result. */
if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
/* VIEW_CONVERT_EXPR is defined only for matching sizes. */
- && operand_equal_p (TYPE_SIZE (type),
- TYPE_SIZE (TREE_TYPE (ctor)), 0))
+ && !compare_tree_int (TYPE_SIZE (type), size)
+ && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
{
ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
ret = fold_unary (VIEW_CONVERT_EXPR, type, ret);
diff --git a/gcc-4.9/gcc/gimple.h b/gcc-4.9/gcc/gimple.h
index 11959a82e..50a5a8620 100644
--- a/gcc-4.9/gcc/gimple.h
+++ b/gcc-4.9/gcc/gimple.h
@@ -90,6 +90,7 @@ enum gf_mask {
GF_CALL_NOTHROW = 1 << 4,
GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
GF_CALL_INTERNAL = 1 << 6,
+ GF_CALL_CTRL_ALTERING = 1 << 7,
GF_OMP_PARALLEL_COMBINED = 1 << 0,
GF_OMP_FOR_KIND_MASK = 3 << 0,
GF_OMP_FOR_KIND_FOR = 0 << 0,
@@ -2447,6 +2448,29 @@ gimple_call_internal_fn (const_gimple gs)
return static_cast <const gimple_statement_call *> (gs)->u.internal_fn;
}
+/* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
+ that could alter control flow. */
+
+static inline void
+gimple_call_set_ctrl_altering (gimple s, bool ctrl_altering_p)
+{
+ GIMPLE_CHECK (s, GIMPLE_CALL);
+ if (ctrl_altering_p)
+ s->subcode |= GF_CALL_CTRL_ALTERING;
+ else
+ s->subcode &= ~GF_CALL_CTRL_ALTERING;
+}
+
+/* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
+ flag is set. Such call could not be a stmt in the middle of a bb. */
+
+static inline bool
+gimple_call_ctrl_altering_p (const_gimple gs)
+{
+ GIMPLE_CHECK (gs, GIMPLE_CALL);
+ return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
+}
+
/* Return the function type of the function called by GS. */
diff --git a/gcc-4.9/gcc/gimplify.c b/gcc-4.9/gcc/gimplify.c
index a550544a0..bcf6f0912 100644
--- a/gcc-4.9/gcc/gimplify.c
+++ b/gcc-4.9/gcc/gimplify.c
@@ -6273,7 +6273,7 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
= splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
if (on && (on->value & (GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE
| GOVD_PRIVATE | GOVD_REDUCTION
- | GOVD_LINEAR)) != 0)
+ | GOVD_LINEAR | GOVD_MAP)) != 0)
break;
ctx = ctx->outer_context;
}
diff --git a/gcc-4.9/gcc/go/gofrontend/parse.cc b/gcc-4.9/gcc/go/gofrontend/parse.cc
index 7614e6fc7..7a9faaa72 100644
--- a/gcc-4.9/gcc/go/gofrontend/parse.cc
+++ b/gcc-4.9/gcc/go/gofrontend/parse.cc
@@ -2865,7 +2865,10 @@ Parse::function_lit()
// For a function literal, the next token must be a '{'. If we
// don't see that, then we may have a type expression.
if (!this->peek_token()->is_op(OPERATOR_LCURLY))
- return Expression::make_type(type, location);
+ {
+ hold_enclosing_vars.swap(this->enclosing_vars_);
+ return Expression::make_type(type, location);
+ }
bool hold_is_erroneous_function = this->is_erroneous_function_;
if (fntype_is_error)
diff --git a/gcc-4.9/gcc/haifa-sched.c b/gcc-4.9/gcc/haifa-sched.c
index 2d66e5cab..653cb8272 100644
--- a/gcc-4.9/gcc/haifa-sched.c
+++ b/gcc-4.9/gcc/haifa-sched.c
@@ -2972,7 +2972,7 @@ advance_one_cycle (void)
{
advance_state (curr_state);
if (sched_verbose >= 6)
- fprintf (sched_dump, ";;\tAdvanced a state.\n");
+ fprintf (sched_dump, ";;\tAdvance the current state.\n");
}
/* Update register pressure after scheduling INSN. */
@@ -6007,6 +6007,7 @@ schedule_block (basic_block *target_bb, state_t init_state)
modulo_insns_scheduled = 0;
ls.modulo_epilogue = false;
+ ls.first_cycle_insn_p = true;
/* Loop until all the insns in BB are scheduled. */
while ((*current_sched_info->schedule_more_p) ())
@@ -6077,7 +6078,6 @@ schedule_block (basic_block *target_bb, state_t init_state)
if (must_backtrack)
goto do_backtrack;
- ls.first_cycle_insn_p = true;
ls.shadows_only_p = false;
cycle_issued_insns = 0;
ls.can_issue_more = issue_rate;
@@ -6363,11 +6363,13 @@ schedule_block (basic_block *target_bb, state_t init_state)
break;
}
}
+ ls.first_cycle_insn_p = true;
}
if (ls.modulo_epilogue)
success = true;
end_schedule:
- advance_one_cycle ();
+ if (!ls.first_cycle_insn_p)
+ advance_one_cycle ();
perform_replacements_new_cycle ();
if (modulo_ii > 0)
{
diff --git a/gcc-4.9/gcc/ifcvt.c b/gcc-4.9/gcc/ifcvt.c
index 0d1adce95..49ff85c7f 100644
--- a/gcc-4.9/gcc/ifcvt.c
+++ b/gcc-4.9/gcc/ifcvt.c
@@ -306,6 +306,28 @@ block_fallthru (basic_block bb)
return (e) ? e->dest : NULL_BLOCK;
}
+
+/* Return true if RTXs A and B can be safely interchanged. */
+
+static bool
+rtx_interchangeable_p (const_rtx a, const_rtx b)
+{
+ if (!rtx_equal_p (a, b))
+ return false;
+
+ if (GET_CODE (a) != MEM)
+ return true;
+
+ /* A dead type-unsafe memory reference is legal, but a live type-unsafe memory
+ reference is not. Interchanging a dead type-unsafe memory reference with
+ a live type-safe one creates a live type-unsafe memory reference, in other
+ words, it makes the program illegal.
+ We check here conservatively whether the two memory references have equal
+ memory attributes. */
+
+ return mem_attrs_eq_p (get_mem_attrs (a), get_mem_attrs (b));
+}
+
/* Go through a bunch of insns, converting them to conditional
execution format if possible. Return TRUE if all of the non-note
@@ -1034,6 +1056,9 @@ noce_try_move (struct noce_if_info *if_info)
|| (rtx_equal_p (if_info->a, XEXP (cond, 1))
&& rtx_equal_p (if_info->b, XEXP (cond, 0))))
{
+ if (!rtx_interchangeable_p (if_info->a, if_info->b))
+ return FALSE;
+
y = (code == EQ) ? if_info->a : if_info->b;
/* Avoid generating the move if the source is the destination. */
@@ -2504,7 +2529,7 @@ noce_process_if_block (struct noce_if_info *if_info)
if (! insn_b
|| insn_b != last_active_insn (else_bb, FALSE)
|| (set_b = single_set (insn_b)) == NULL_RTX
- || ! rtx_equal_p (x, SET_DEST (set_b)))
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b)))
return FALSE;
}
else
@@ -2517,7 +2542,7 @@ noce_process_if_block (struct noce_if_info *if_info)
|| BLOCK_FOR_INSN (insn_b) != BLOCK_FOR_INSN (if_info->cond_earliest)
|| !NONJUMP_INSN_P (insn_b)
|| (set_b = single_set (insn_b)) == NULL_RTX
- || ! rtx_equal_p (x, SET_DEST (set_b))
+ || ! rtx_interchangeable_p (x, SET_DEST (set_b))
|| ! noce_operand_ok (SET_SRC (set_b))
|| reg_overlap_mentioned_p (x, SET_SRC (set_b))
|| modified_between_p (SET_SRC (set_b), insn_b, jump)
@@ -2583,7 +2608,7 @@ noce_process_if_block (struct noce_if_info *if_info)
/* Look and see if A and B are really the same. Avoid creating silly
cmove constructs that no one will fix up later. */
- if (rtx_equal_p (a, b))
+ if (rtx_interchangeable_p (a, b))
{
/* If we have an INSN_B, we don't have to create any new rtl. Just
move the instruction that we already have. If we don't have an
diff --git a/gcc-4.9/gcc/l-ipo.c b/gcc-4.9/gcc/l-ipo.c
index 59a9636d2..59dbd33fd 100644
--- a/gcc-4.9/gcc/l-ipo.c
+++ b/gcc-4.9/gcc/l-ipo.c
@@ -1564,6 +1564,15 @@ resolve_cgraph_node (struct cgraph_sym **slot, struct cgraph_node *node)
(*slot)->rep_decl = decl2;
return;
}
+ /* Similarly, pick the non-external symbol, since external
+ symbols may be eliminated by symtab_remove_unreachable_nodes
+ after ipa inlining (see process_references). */
+ if (DECL_EXTERNAL (decl1) && !DECL_EXTERNAL (decl2))
+ {
+ (*slot)->rep_node = node;
+ (*slot)->rep_decl = decl2;
+ return;
+ }
has_prof1 = has_profile_info (decl1);
bool is_aux1 = cgraph_is_auxiliary (decl1);
@@ -2304,31 +2313,44 @@ fixup_reference_list (struct varpool_node *node)
int i;
struct ipa_ref *ref;
struct ipa_ref_list *list = &node->ref_list;
- vec<cgraph_node_ptr> new_refered;
+ vec<symtab_node *> new_refered;
vec<int> new_refered_type;
- struct cgraph_node *c;
+ struct symtab_node *sym_node;
enum ipa_ref_use use_type = IPA_REF_LOAD;
new_refered.create (10);
new_refered_type.create (10);
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
{
- if (!is_a <cgraph_node> (ref->referred))
- continue;
-
- struct cgraph_node *cnode = ipa_ref_node (ref);
- struct cgraph_node *r_cnode
- = cgraph_lipo_get_resolved_node (cnode->decl);
- if (r_cnode != cnode)
+ if (is_a <cgraph_node> (ref->referred))
{
+ struct cgraph_node *cnode = ipa_ref_node (ref);
+ struct cgraph_node *r_cnode
+ = cgraph_lipo_get_resolved_node (cnode->decl);
new_refered.safe_push (r_cnode);
use_type = ref->use;
new_refered_type.safe_push ((int) use_type);
+ gcc_assert (use_type != IPA_REF_ADDR
+ || cnode->global.inlined_to
+ || cnode->address_taken);
+ if (use_type == IPA_REF_ADDR)
+ cgraph_mark_address_taken_node (r_cnode);
+ }
+ else if (is_a <varpool_node> (ref->referred))
+ {
+ struct varpool_node *var = ipa_ref_varpool_node (ref);
+ struct varpool_node *r_var = real_varpool_node (var->decl);
+ new_refered.safe_push (r_var);
+ use_type = ref->use;
+ new_refered_type.safe_push ((int) use_type);
}
+ else
+ gcc_assert (false);
}
- for (i = 0; new_refered.iterate (i, &c); ++i)
+ ipa_remove_all_references (&node->ref_list);
+ for (i = 0; new_refered.iterate (i, &sym_node); ++i)
{
- ipa_record_reference (node, c,
+ ipa_record_reference (node, sym_node,
(enum ipa_ref_use) new_refered_type[i], NULL);
}
}
diff --git a/gcc-4.9/gcc/l-ipo.h b/gcc-4.9/gcc/l-ipo.h
index e9c661b78..a4ff3d5fd 100644
--- a/gcc-4.9/gcc/l-ipo.h
+++ b/gcc-4.9/gcc/l-ipo.h
@@ -63,6 +63,7 @@ int equivalent_struct_types_for_tbaa (const_tree t1, const_tree t2);
void lipo_link_and_fixup (void);
extern void copy_defined_module_set (tree, tree);
extern bool is_parsing_done_p (void);
+extern void record_module_name (unsigned int, const char *);
extern const char* get_module_name (unsigned int);
#endif
diff --git a/gcc-4.9/gcc/lra-constraints.c b/gcc-4.9/gcc/lra-constraints.c
index ec28b7ff8..f967d71da 100644
--- a/gcc-4.9/gcc/lra-constraints.c
+++ b/gcc-4.9/gcc/lra-constraints.c
@@ -5851,6 +5851,20 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
SUBREG_REG (SET_SRC (set)) = SET_SRC (prev_set);
else
SET_SRC (set) = SET_SRC (prev_set);
+ /* As we are finishing with processing the insn
+ here, check the destination too as it might
+ inheritance pseudo for another pseudo. */
+ if (bitmap_bit_p (remove_pseudos, dregno)
+ && bitmap_bit_p (&lra_inheritance_pseudos, dregno)
+ && (restore_regno
+ = lra_reg_info[dregno].restore_regno) >= 0)
+ {
+ if (GET_CODE (SET_DEST (set)) == SUBREG)
+ SUBREG_REG (SET_DEST (set))
+ = regno_reg_rtx[restore_regno];
+ else
+ SET_DEST (set) = regno_reg_rtx[restore_regno];
+ }
lra_push_insn_and_update_insn_regno_info (curr_insn);
lra_set_used_insn_alternative_by_uid
(INSN_UID (curr_insn), -1);
diff --git a/gcc-4.9/gcc/lto/ChangeLog b/gcc-4.9/gcc/lto/ChangeLog
index c029da671..6c6ea2bdd 100644
--- a/gcc-4.9/gcc/lto/ChangeLog
+++ b/gcc-4.9/gcc/lto/ChangeLog
@@ -1,3 +1,11 @@
+2014-08-15 Bin Cheng <bin.cheng@arm.com>
+
+ Backport from mainline
+ 2014-08-08 Bin Cheng <bin.cheng@arm.com>
+
+ PR lto/62032
+ * lto-lang.c (lto_init): Switch mis-matched arguments.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/gcc/lto/lto-lang.c b/gcc-4.9/gcc/lto/lto-lang.c
index f60d2127b..1a4da916f 100644
--- a/gcc-4.9/gcc/lto/lto-lang.c
+++ b/gcc-4.9/gcc/lto/lto-lang.c
@@ -1186,10 +1186,10 @@ lto_init (void)
}
else
{
- lto_define_builtins (va_list_type_node,
- build_reference_type (va_list_type_node));
+ lto_define_builtins (build_reference_type (va_list_type_node),
+ va_list_type_node);
}
-
+
if (flag_cilkplus)
cilk_init_builtins ();
diff --git a/gcc-4.9/gcc/optabs.c b/gcc-4.9/gcc/optabs.c
index cd31b0e63..39e8cd4f6 100644
--- a/gcc-4.9/gcc/optabs.c
+++ b/gcc-4.9/gcc/optabs.c
@@ -7337,7 +7337,10 @@ expand_atomic_test_and_set (rtx target, rtx mem, enum memmodel model)
perform the operation. */
if (!ret)
{
- emit_move_insn (subtarget, mem);
+ /* If the result is ignored skip the move to target. */
+ if (subtarget != const0_rtx)
+ emit_move_insn (subtarget, mem);
+
emit_move_insn (mem, trueval);
ret = subtarget;
}
diff --git a/gcc-4.9/gcc/sched-deps.c b/gcc-4.9/gcc/sched-deps.c
index df29bd30b..1d4700733 100644
--- a/gcc-4.9/gcc/sched-deps.c
+++ b/gcc-4.9/gcc/sched-deps.c
@@ -4747,6 +4747,24 @@ find_inc (struct mem_inc_info *mii, bool backwards)
goto next;
}
}
+
+ /* The inc instruction could have clobbers, make sure those
+ registers are not used in mem insn. */
+ for (def_rec = DF_INSN_DEFS (mii->inc_insn); *def_rec; def_rec++)
+ if (!reg_overlap_mentioned_p (DF_REF_REG (*def_rec), mii->mem_reg0))
+ {
+ df_ref *use_rec;
+ for (use_rec = DF_INSN_USES (mii->mem_insn); *use_rec; use_rec++)
+ if (reg_overlap_mentioned_p (DF_REF_REG (*def_rec),
+ DF_REF_REG (*use_rec)))
+ {
+ if (sched_verbose >= 5)
+ fprintf (sched_dump,
+ "inc clobber used in store failure.\n");
+ goto next;
+ }
+ }
+
newaddr = mii->inc_input;
if (mii->mem_index != NULL_RTX)
newaddr = gen_rtx_PLUS (GET_MODE (newaddr), newaddr,
diff --git a/gcc-4.9/gcc/simplify-rtx.c b/gcc-4.9/gcc/simplify-rtx.c
index 04af01e6e..c64de3178 100644
--- a/gcc-4.9/gcc/simplify-rtx.c
+++ b/gcc-4.9/gcc/simplify-rtx.c
@@ -3330,6 +3330,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
prefer left rotation, if op1 is from bitsize / 2 + 1 to
bitsize - 1, use other direction of rotate with 1 .. bitsize / 2 - 1
amount instead. */
+#if defined(HAVE_rotate) && defined(HAVE_rotatert)
if (CONST_INT_P (trueop1)
&& IN_RANGE (INTVAL (trueop1),
GET_MODE_BITSIZE (mode) / 2 + (code == ROTATE),
@@ -3337,6 +3338,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
return simplify_gen_binary (code == ROTATE ? ROTATERT : ROTATE,
mode, op0, GEN_INT (GET_MODE_BITSIZE (mode)
- INTVAL (trueop1)));
+#endif
/* FALLTHRU */
case ASHIFTRT:
if (trueop1 == CONST0_RTX (mode))
diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog
index 790319955..4a7de28b3 100644
--- a/gcc-4.9/gcc/testsuite/ChangeLog
+++ b/gcc-4.9/gcc/testsuite/ChangeLog
@@ -1,3 +1,220 @@
+2014-08-26 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid
+ failure on s390*-*-linux-gnu.
+
+2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2014-08-24 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/61996
+ * gcc.target/sh/pr61996.c: New.
+
+2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/62008
+ * c-c++-common/cilk-plus/AN/pr62008.c: New test.
+
+2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62214
+ * gfortran.dg/array_assignment_5.f90: New test.
+
+2014-08-20 Martin Jambor <mjambor@suse.cz>
+ Wei Mi <wmi@google.com>
+
+ PR ipa/60449
+ PR middle-end/61776
+ * testsuite/gcc.dg/lto/pr60449_1.c: New test.
+ * testsuite/gcc.dg/lto/pr60449_0.c: New test.
+ * testsuite/gcc.dg/pr61776.c: New test.
+
+2014-08-19 Janis Johnson <janisjo@codesourcery.com>
+
+ Backport from mainline:
+ 2014-08-19 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/target-supports.exp
+ (check_effective_target_arm_v8_neon_ok_nocache): Add
+ "-march-armv8-a" to compile flags.
+
+2014-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62142
+ * gfortran.dg/realloc_on_assign_24.f90: New test.
+
+2014-08-15 Tom de Vries <tom@codesourcery.com>
+
+ Backport from mainline:
+ 2014-08-14 Tom de Vries <tom@codesourcery.com>
+
+ PR rtl-optimization/62004
+ PR rtl-optimization/62030
+ * gcc.dg/pr62004.c: New test.
+ * gcc.dg/pr62030.c: Same.
+ * gcc.target/mips/pr62030-octeon.c: Same.
+
+2014-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/62106
+ * gfortran.dg/array_constructor_49.f90: New test.
+
+2014-08-15 Jakub Jelinek <jakub@redhat.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/62131
+ * gfortran.dg/gomp/pr62131.f90: New test.
+
+2014-08-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2014-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/61713
+ * gcc.dg/pr61756.c: New test.
+
+2014-08-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR middle-end/62103
+ * gcc.c-torture/execute/bitfld-6.c: New test.
+
+2014-08-12 Felix Yang <fei.yang0953@gmail.com>
+
+ PR tree-optimization/62073
+ * gcc.dg/vect/pr62073.c: New test.
+
+2014-08-12 Janis Johnson <janisjo@codesourcery.com>
+
+ Backport from mainline
+ 2014-08-12 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/target/supports.exp
+ (check_effective_target_arm_v8_neon_ok_nocache): Check for armv8
+ or later.
+
+ * gcc.dg/pr59418.c: Don't add ARM options for a Thumb1 multilib.
+
+ * gcc.target/arm/neon-vext-execute.c: Skip if the test won't run
+ on Neon hardware.
+
+ * gcc.target/arm/pr48784.c: Skip for thumb1 multilib.
+ * gcc.target/arm/pr59985.c: Likewise.
+
+2014-08-12 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/61962
+ * c-c++-common/cilk-plus/AN/pr61962.c: New test.
+
+2014-08-12 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
+
+ Backport from mainline
+ 2014-06-16 Ganesh Gopalasubramanian
+ <Ganesh.Gopalasubramanian@amd.com>
+
+ * gcc.target/i386/xop-imul64-vector.c: Remove the check for
+ vpmacsdql instruction.
+
+2014-08-11 Janis Johnson <janisjo@codesourcery.com>
+
+ Backport from mainline
+ 2014-08-11 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/target-supports.exp (check_effective_target_arm_thumb1_ok,
+ check_effective_target_arm_thumb2_ok): Test with code that passes
+ an argument and returns a result.
+
+ * gcc.target/arm/frame-pointer-1.c: Skip if Thumb is not supported.
+ * gcc.target/arm/pr56184.C: Likewise.
+ * gcc.target/arm/pr59896.c: Likewise.
+ * gcc.target/arm/stack-red-zone.c: Likewise.
+ * gcc.target/arm/thumb-find-work-register.c: Likewise.
+
+2014-08-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/61999
+ * gfortran.dg/dot_product_3.f90: New test case.
+
+2014-08-07 John David Anglin <danglin@gcc.gnu.org>
+
+ PR tree-optimization/60707
+ * gfortran.dg/pr45636.f90: xfail on 32-bit hppa*-*-*.
+
+ * gcc.dg/atomic/c11-atomic-exec-4.c: Undefine _POSIX_C_SOURCE before
+ defining in dg-options.
+ * gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
+
+ * gcc.dg/atomic/stdatomic-flag.c: Add xfail comment.
+
+ * gcc.c-torture/compile/pr60655-1.c: Don't add -fdata-sections option
+ on 32-bit hppa-hpux.
+
+ * gcc.dg/pr57233.c: Add -fno-common option on hppa*-*-hpux*.
+
+2014-08-07 Petr Murzin <petr.murzin@intel.com>
+
+ * gcc.target/i386/avx512f-vfixupimmpd-2.c: Include float.h instead of
+ values.h, change MAXDOUBLE for DBL_MAX.
+ * gcc.target/i386/avx512f-vfixupimmsd-2.c: Ditto.
+ * gcc.target/i386/avx512f-vfixupimmps-2.c: Include float.h instead of
+ values.h, change MAXFLOAT for FLT_MAX.
+ * gcc.target/i386/avx512f-vfixupimmss-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermi2d-2.c: Do not include values.h.
+ * gcc.target/i386/avx512f-vpermi2pd-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermi2ps-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermi2q-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermt2d-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermt2pd-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermt2ps-2.c: Ditto.
+ * gcc.target/i386/avx512f-vpermt2q-2.c: Ditto.
+
+2014-08-06 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR debug/61923
+ * gcc.target/i386/pr61923.c: New test.
+
+2014-08-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/61801
+ * gcc.target/i386/pr61801.c: Rewritten.
+
+2014-08-04 Rohit <rohitarulraj@freescale.com>
+
+ PR target/60102
+ * gcc.target/powerpc/pr60102.c: New testcase.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR other/61963
+ * c-c++-common/cilk-plus/AN/pr61963.c: New test.
+
+2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
+
+ PR middle-end/61455
+ * c-c++-common/cilk-plus/AN/pr61455.c: New test.
+ * c-c++-common/cilk-plus/AN/pr61455-2.c: Likewise.
+
+2014-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR tree-optimization/61375
+ * gcc.c-torture/execute/pr61375-1.c: New test.
+
+2014-08-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/61964
+ * gcc.dg/torture/pr61964.c: New testcase.
+ * gcc.dg/pr51879-18.c: XFAIL.
+
2014-07-28 Richard Biener <rguenther@suse.de>
PR rtl-optimization/61801
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
new file mode 100644
index 000000000..60b424873
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
@@ -0,0 +1,13 @@
+/* PR c++/61455 */
+/* { dg-options "-fcilkplus" } */
+
+int a[3] = {2, 3, 4};
+
+int main ()
+{
+ int c = 10;
+ int b = __sec_reduce_add(a[:]);
+ if (b+c != 19)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
new file mode 100644
index 000000000..35a11b66c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
@@ -0,0 +1,9 @@
+/* PR c++/61455 */
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+void foo ()
+{
+ int a[2];
+ int b = a[:]; /* { dg-error "cannot be scalar" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c
new file mode 100644
index 000000000..08d4fe236
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c
@@ -0,0 +1,14 @@
+/* PR other/61962 */
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+struct FloatStruct
+{
+ float *f;
+};
+
+/* Either SRC or DST must be a struct, otherwise the bug does not occur. */
+void f (struct FloatStruct* dst, float *src, unsigned int length)
+{
+ dst->f[0:length] = src[0:length];
+}
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
new file mode 100644
index 000000000..dfa713c4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
@@ -0,0 +1,9 @@
+/* PR other/61963 */
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+void f (int * int *a) /* { dg-error "expected" } */
+{
+ a[0:64] = 0; /* { dg-error "was not declared" "" { target c++ } 7 } */
+ a[0:64] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c
new file mode 100644
index 000000000..05734c560
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c
@@ -0,0 +1,10 @@
+/* PR other/62008 */
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+void f(int *a, int w, int h)
+{
+ int tmp[w][h];
+ tmp[:][:] = a[0:w][0:h]; /* { dg-error "base of array section must be pointer or array type" } */
+ /* { dg-error "start-index and length fields necessary" "" { target c } 8 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/pr61741.c b/gcc-4.9/gcc/testsuite/c-c++-common/pr61741.c
new file mode 100644
index 000000000..a2bc4bda3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/pr61741.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+int a = 1, b;
+
+void
+foo (void)
+{
+ signed char c = 0;
+ for (; a; a--)
+ for (; c >= 0; c++);
+ if (!c)
+ b = 1;
+}
+
+int
+main ()
+{
+ foo ();
+ if (b != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array7.C
new file mode 100644
index 000000000..8f74675f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array7.C
@@ -0,0 +1,13 @@
+// PR c++/61994
+// { dg-do compile { target c++11 } }
+
+struct A { int i,j; };
+
+struct X {
+ A a = {1,1};
+};
+
+constexpr X table[1][1] = {{ {} }};
+
+#define SA(X) static_assert(X,#X)
+SA(table[0][0].a.i == 1);
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
new file mode 100644
index 000000000..f491994a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty7.C
@@ -0,0 +1,28 @@
+// PR c++/61959
+// { dg-do compile { target c++11 } }
+
+template <class Coord> struct BasePoint
+{
+ Coord x, y;
+ constexpr BasePoint (Coord, Coord) : x (0), y (0) {}
+};
+template <class T> struct BaseCoord
+{
+ int value;
+ constexpr BaseCoord (T) : value (1) {}
+};
+template <class units> struct IntCoordTyped : BaseCoord<int>, units
+{
+ typedef BaseCoord Super;
+ constexpr IntCoordTyped (int) : Super (0) {}
+};
+template <class units>
+struct IntPointTyped : BasePoint<IntCoordTyped<units> >, units
+{
+ typedef BasePoint<IntCoordTyped<units> > Super;
+ constexpr IntPointTyped (int, int) : Super (0, 0) {}
+};
+struct A
+{
+};
+IntPointTyped<A> a (0, 0);
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem3.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem3.C
new file mode 100644
index 000000000..c5e2101c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem3.C
@@ -0,0 +1,16 @@
+// PR c++/62129
+// { dg-do compile { target c++11 } }
+
+class Evaluator
+{
+ int MakeChangelist ();
+ typedef int (Evaluator::*fac_t)();
+ struct CreatorEntry
+ {
+ const char *type;
+ fac_t factory;
+ };
+ static constexpr CreatorEntry kCreators[] = { "", &Evaluator::MakeChangelist };
+};
+
+constexpr Evaluator::CreatorEntry Evaluator::kCreators[];
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array4.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array4.C
new file mode 100644
index 000000000..af2045d9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array4.C
@@ -0,0 +1,9 @@
+// PR c++/58636
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+// { dg-error "pointer to reference" "" { target *-*-* } 0 }
+int foo(std::initializer_list<int&&>);
+
+int i = foo({ 0 }); // { dg-error "std::initializer_list" }
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C
index adbb4dbca..79ab4107d 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C
@@ -1,5 +1,6 @@
// PR c++/61566
// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
struct function
{
@@ -7,6 +8,7 @@ struct function
function (_Functor);
};
+template <class U>
struct C
{
template <typename T>
@@ -15,6 +17,9 @@ struct C
void bar ()
{
- C c;
+ C<int> c;
c.foo (1);
}
+
+// { dg-final { scan-assembler "_ZN8functionC1IZN1CIiE3fooIiEEvT_S_Ed_UlvE_EET_" } }
+// { dg-final { scan-assembler-not "_ZZN1CIiE3fooIiEEvT_8functionEd_NKUlvE_clEv" } }
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
new file mode 100644
index 000000000..a8f598f17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
@@ -0,0 +1,13 @@
+// PR c++/58714
+// { dg-do compile { target c++11 } }
+
+struct X {
+ X& operator=(const X&) = delete;
+ X& operator=(X&& ) = default;
+};
+
+void f(bool t) {
+ X a, b;
+ *(t ? &a : &b) = X();
+ (t ? a : b) = X();
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/expr/cond12.C b/gcc-4.9/gcc/testsuite/g++.dg/expr/cond12.C
new file mode 100644
index 000000000..9134f8166
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/expr/cond12.C
@@ -0,0 +1,12 @@
+// PR c++/58714
+// { dg-do run }
+
+struct X {
+ X& operator=(const X&){}
+ X& operator=(X&){__builtin_abort();}
+};
+
+int main(int argv,char**) {
+ X a, b;
+ ((argv > 2) ? a : b) = X();
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ext/restrict2.C b/gcc-4.9/gcc/testsuite/g++.dg/ext/restrict2.C
new file mode 100644
index 000000000..f05321002
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ext/restrict2.C
@@ -0,0 +1,8 @@
+// PR c++/60872
+// { dg-options "" }
+
+typedef double *__restrict T;
+void f(T* p)
+{
+ void *p2 = p;
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/init/explicit2.C b/gcc-4.9/gcc/testsuite/g++.dg/init/explicit2.C
new file mode 100644
index 000000000..d1dbb39fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/init/explicit2.C
@@ -0,0 +1,8 @@
+// PR c++/60417
+
+struct A { explicit A(int = 0); };
+
+int main()
+{
+ A a[1] = { };
+}
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-39.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-39.C
new file mode 100644
index 000000000..fbeea126e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-39.C
@@ -0,0 +1,28 @@
+// PR c++/61214
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct Base
+{
+ virtual ~Base();
+ virtual Base* clone() {
+ return 0;
+ }
+};
+
+struct Foo : Base
+{
+ virtual ~Foo();
+ virtual Base* clone() {
+ return new Foo();
+ }
+};
+
+int main()
+{
+ Base* f = new Foo();
+ f->clone();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "OBJ_TYPE_REF" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/pr62146.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr62146.C
new file mode 100644
index 000000000..dbe417434
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr62146.C
@@ -0,0 +1,51 @@
+/* PR rtl-optimization/62146 */
+/* { dg-do compile } */
+/* { dg-options "-O2 " } */
+class F
+{
+public:
+ virtual ~ F ();
+};
+template < class CL > class G:public F
+{
+ int *member_;
+public:
+ G ( int *b): member_ (0)
+ {
+ }
+};
+
+class D
+{
+public:
+ template < class CL > void RegisterNonTagCallback (int,
+ void (CL::
+ *p3) ())
+ {
+ InternalRegisterNonTag (p3 ? new G < CL > ( 0) : 0);
+ } void InternalRegisterNonTag (F *);
+};
+
+void fn1 ();
+class C1
+{
+ void foo();
+ class TokenType
+ {
+ public:
+ void AddToken ()
+ {
+ }
+ };
+ C1::TokenType bar_t;
+};
+D a;
+void C1::foo()
+{
+ if (&bar_t)
+ fn1 ();
+ for (int i = 0; i < sizeof 0; ++i)
+ a.RegisterNonTagCallback (0, &TokenType::AddToken);
+}
+
+/* { dg-final { scan-assembler-not "mov.*_ZN2C19TokenType8AddTokenEv, .\\\(" } } */
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local10.C b/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local10.C
new file mode 100644
index 000000000..48c1b861c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local10.C
@@ -0,0 +1,23 @@
+// PR c++/58624
+
+// { dg-do run { target c++11 } }
+// { dg-add-options tls }
+// { dg-require-effective-target tls_runtime }
+
+int i;
+
+template <typename> struct A
+{
+ static thread_local int s;
+
+ A () { i = s; }
+};
+
+int f() { return 42; }
+template <typename T> thread_local int A<T>::s = f();
+
+int main () {
+ A<void> a;
+ if (i != 42)
+ __builtin_abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c
index 6f84f6e4e..1e1e46073 100644
--- a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr60655-1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fdata-sections" } */
+/* { dg-options "-fdata-sections" { target { ! { { hppa*-*-hpux* } && { ! lp64 } } } } } */
typedef unsigned char unit;
typedef unit *unitptr;
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-3.x b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
new file mode 100644
index 000000000..cb7b119b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
new file mode 100644
index 000000000..50927dc1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/bitfld-6.c
@@ -0,0 +1,23 @@
+union U
+{
+ const int a;
+ unsigned b : 20;
+};
+
+static union U u = { 0x12345678 };
+
+/* Constant folding used to fail to account for endianness when folding a
+ union. */
+
+int
+main (void)
+{
+#ifdef __BYTE_ORDER__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ return u.b - 0x45678;
+#else
+ return u.b - 0x12345;
+#endif
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr23135.x b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr23135.x
new file mode 100644
index 000000000..cb7b119b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr23135.x
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c
new file mode 100644
index 000000000..6fb46939e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c
@@ -0,0 +1,35 @@
+#ifdef __UINT64_TYPE__
+typedef __UINT64_TYPE__ uint64_t;
+#else
+typedef unsigned long long uint64_t;
+#endif
+
+#ifndef __SIZEOF_INT128__
+#define __int128 long long
+#endif
+
+/* Some version of bswap optimization would ICE when analyzing a mask constant
+ too big for an HOST_WIDE_INT (PR61375). */
+
+__attribute__ ((noinline, noclone)) uint64_t
+uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
+{
+ __int128 mask = (__int128)0xffff << 56;
+ return ((in1 & mask) >> 56) | in2;
+}
+
+int
+main (int argc)
+{
+ __int128 in = 1;
+#ifdef __SIZEOF_INT128__
+ in <<= 64;
+#endif
+ if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
+ return 0;
+ if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
+ return 0;
+ if (uint128_central_bitsi_ior (in, 2) != 0x102)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
index 1558200db..b03d2c88d 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
@@ -2,7 +2,7 @@
operating properly when operations on the same variable are carried
out in two threads. */
/* { dg-do run } */
-/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L" } */
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target pthread } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
index bc87de4cc..e3e0aae4d 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
@@ -3,7 +3,7 @@
iterations of the compare-and-exchange loop are needed, exceptions
get properly cleared). */
/* { dg-do run } */
-/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L" } */
/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
/* { dg-require-effective-target fenv_exceptions } */
/* { dg-require-effective-target pthread } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
index c1a63f1b3..515d5d8dd 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
@@ -1,4 +1,5 @@
/* Test atomic_flag routines for existence and execution. */
+/* The test needs a lockless atomic implementation. */
/* { dg-do run { xfail hppa*-*-hpux* } } */
/* { dg-options "-std=c11 -pedantic-errors" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c
new file mode 100644
index 000000000..a430830cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_0.c
@@ -0,0 +1,30 @@
+/* { dg-lto-do link } */
+
+extern int printf (const char *__restrict __format, ...);
+typedef long int __time_t;
+typedef long int __suseconds_t;
+
+struct timeval
+ {
+ __time_t tv_sec;
+ __suseconds_t tv_usec;
+ };
+
+struct timezone
+ {
+ int tz_minuteswest;
+ int tz_dsttime;
+ };
+typedef struct timezone *__restrict __timezone_ptr_t;
+
+extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz);
+
+int bar (void)
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ gettimeofday (&tv, &tz);
+ printf ("This is from bar %i\n", tz.tz_dsttime);
+ return 5;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c
new file mode 100644
index 000000000..ddc25296d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c
@@ -0,0 +1,76 @@
+extern int printf (const char *__restrict __format, ...);
+typedef long int __time_t;
+typedef long int __suseconds_t;
+struct timeval
+ {
+ __time_t tv_sec;
+ __suseconds_t tv_usec;
+ };
+struct timezone
+ {
+ int tz_minuteswest;
+ int tz_dsttime;
+ };
+typedef struct timezone *__restrict __timezone_ptr_t;
+extern int gettimeofday (struct timeval *__restrict __tv,
+ __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
+
+typedef long int __jmp_buf[8];
+typedef struct
+ {
+ unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+ } __sigset_t;
+struct __jmp_buf_tag
+ {
+ __jmp_buf __jmpbuf;
+ int __mask_was_saved;
+ __sigset_t __saved_mask;
+ };
+typedef struct __jmp_buf_tag jmp_buf[1];
+
+extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));
+extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
+
+extern int bar (void);
+
+int __attribute__ ((noinline, noclone))
+get_input (void)
+{
+ return 0;
+}
+
+static jmp_buf buf;
+
+int foo (void)
+{
+ if (get_input ())
+ longjmp(buf, 1);
+ return 0;
+}
+
+volatile int z;
+
+
+int main (void)
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ bar();
+ if (setjmp (buf))
+ return 1;
+
+ if (!get_input ())
+ {
+ gettimeofday (&tv, &tz);
+ z = 0;
+ printf ("This is from main %i\n", tz.tz_dsttime);
+ }
+
+ foo ();
+ bar ();
+ bar ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
index 95629f122..9b3cb80a4 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
@@ -13,5 +13,5 @@ void bar (int c, int *p)
*q = foo ();
}
-/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
index 58c05348b..484844e49 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c
@@ -1,6 +1,7 @@
/* PR tree-optimization/57233 */
/* { dg-do run { target { ilp32 || lp64 } } } */
/* { dg-options "-O2" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
typedef unsigned V4 __attribute__((vector_size(4 * sizeof (int))));
typedef unsigned V8 __attribute__((vector_size(8 * sizeof (int))));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
index 114c1d383..257ce79f1 100644
--- a/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
@@ -3,7 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-Os -g" } */
-/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target arm*-*-* } } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target { arm*-*-* && { ! arm_thumb1 } } } } */
extern int printf (const char *__format, ...);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c
new file mode 100644
index 000000000..4ca90448f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61756.c
@@ -0,0 +1,14 @@
+/* PR target/61756 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <stdatomic.h>
+
+static volatile atomic_flag guard = ATOMIC_FLAG_INIT;
+
+void
+try_atomic_flag_test_and_set (void)
+{
+ atomic_flag_test_and_set (&guard);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c
new file mode 100644
index 000000000..8768c546b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61776.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-generate" } */
+
+#include <setjmp.h>
+
+int cond1, cond2;
+
+int goo() __attribute__((noinline));
+
+int goo() {
+ if (cond1)
+ return 1;
+ else
+ return 2;
+}
+
+jmp_buf env;
+int foo() {
+ int a;
+
+ setjmp(env);
+ if (cond2)
+ a = goo();
+ else
+ a = 3;
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c
new file mode 100644
index 000000000..c994a411b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr62004.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-tail-merge" } */
+
+struct node
+{
+ struct node *next;
+ struct node *prev;
+};
+
+struct node node;
+
+struct head
+{
+ struct node *first;
+};
+
+struct head heads[5];
+
+int k = 2;
+
+struct head *head = &heads[2];
+
+int
+main ()
+{
+ struct node *p;
+
+ node.next = (void*)0;
+
+ node.prev = (void *)head;
+
+ head->first = &node;
+
+ struct node *n = head->first;
+
+ struct head *h = &heads[k];
+
+ heads[2].first = n->next;
+
+ if ((void*)n->prev == (void *)h)
+ p = h->first;
+ else
+ /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */
+ p = n->prev->next;
+
+ return !(p == (void*)0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c
new file mode 100644
index 000000000..b8baf9343
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr62030.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct node
+{
+ struct node *next;
+ struct node *prev;
+};
+
+struct node node;
+
+struct head
+{
+ struct node *first;
+};
+
+struct head heads[5];
+
+int k = 2;
+
+struct head *head = &heads[2];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ node.prev = (void *)head;
+ head->first = &node;
+
+ struct node *n = head->first;
+ struct head *h = &heads[k];
+ struct node *next = n->next;
+
+ if (n->prev == (void *)h)
+ h->first = next;
+ else
+ n->prev->next = next;
+
+ n->next = h->first;
+ return n->next == &node;
+}
+
+int
+main (void)
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c
new file mode 100644
index 000000000..a03cfdc37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61964.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct node { struct node *next, *prev; } node;
+struct head { struct node *first; } heads[5];
+int k = 2;
+struct head *head = &heads[2];
+
+static int __attribute__((noinline))
+foo()
+{
+ node.prev = (void *)head;
+ head->first = &node;
+
+ struct node *n = head->first;
+ struct head *h = &heads[k];
+
+ if (n->prev == (void *)h)
+ h->first = n->next;
+ else
+ n->prev->next = n->next;
+
+ n->next = h->first;
+ return n->next == &node;
+}
+
+int main()
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c
new file mode 100644
index 000000000..975701391
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Og -fdump-tree-optimized" } */
+
+extern long long __sdt_unsp;
+void
+f(void)
+{
+ for (;;)
+ __asm__ ("%0" :: "i" (((!__extension__ (__builtin_constant_p ((((unsigned long long) (__typeof (__builtin_choose_expr (((__builtin_classify_type (0) + 3) & -4) == 4, (0), 0U))) __sdt_unsp) ) == 0) )) ? 1 : -1) ));
+}
+
+/* { dg-final { scan-tree-dump-not "PHI" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c
new file mode 100644
index 000000000..15f2ad66b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr62073.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1" } */
+
+struct S0
+{
+ int f7;
+};
+struct S0 g_50;
+int g_70;
+int g_76;
+
+int foo (long long p_56, int * p_57)
+{
+ int *l_77;
+ int l_101;
+
+ for (; g_70;)
+ {
+ int **l_78 = &l_77;
+ if (g_50.f7)
+ continue;
+ *l_78 = 0;
+ }
+ for (g_76 = 1; g_76 >= 0; g_76--)
+ {
+ int *l_90;
+ for (l_101 = 4; l_101 >= 0; l_101--)
+ if (l_101)
+ *l_90 = 0;
+ else
+ {
+ int **l_113 = &l_77;
+ *l_113 = p_57;
+ }
+ }
+
+ return *l_77;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/frame-pointer-1.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/frame-pointer-1.c
index bb1888e38..c288fef83 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/frame-pointer-1.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/frame-pointer-1.c
@@ -1,6 +1,7 @@
/* Check local register variables using a register conventionally
used as the frame pointer aren't clobbered under high register pressure. */
/* { dg-do run } */
+/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } { "*" } { "" } } */
/* { dg-options "-Os -mthumb -fomit-frame-pointer" } */
#include <stdlib.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/neon-vext-execute.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/neon-vext-execute.c
index 3d6c28cca..8e44d9ad5 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/neon-vext-execute.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/neon-vext-execute.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-require-effective-target arm_neon_hw } */
/* { dg-require-effective-target arm_little_endian } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_neon } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr56184.C b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr56184.C
index d44c1b432..5d23c40c5 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr56184.C
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr56184.C
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } { "*" } { "" } } */
/* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors" } */
typedef unsigned int size_t;
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr58784.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr58784.c
index e3ef950b4..9a1fcff1c 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr58784.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr58784.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm_thumb1 } { "*" } { "" } } */
/* { dg-options "-march=armv7-a -mfloat-abi=hard -mfpu=neon -marm -O2" } */
typedef struct __attribute__ ((__packed__))
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59896.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59896.c
index 5896e7379..ea6dc248b 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59896.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59896.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } { "*" } { "" } } */
/* { dg-options "-mthumb -O2" } */
typedef unsigned int size_t;
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59985.C b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59985.C
index cc688a965..1351c486f 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59985.C
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr59985.C
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm_thumb1 } { "*" } { "" } } */
/* { dg-options "-g -fcompare-debug -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard" } */
extern void *f1 (unsigned long, unsigned long);
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/stack-red-zone.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/stack-red-zone.c
index b9f0f9937..8db2e2c09 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/stack-red-zone.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/stack-red-zone.c
@@ -1,4 +1,5 @@
/* No stack red zone. PR38644. */
+/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } { "*" } { "" } } */
/* { dg-options "-mthumb -O2" } */
/* { dg-final { scan-assembler "ldrb\[^\n\]*\\n\[\t \]*add\[\t \]*sp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c
index f2c0225a4..e67a627ea 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c
@@ -1,5 +1,6 @@
/* Wrong method to get number of arg reg will cause argument corruption. */
/* { dg-do run } */
+/* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } { "*" } { "" } } */
/* { dg-require-effective-target arm_eabi } */
/* { dg-options "-mthumb -O1" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmpd-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmpd-2.c
index d4ddd3214..995b446d8 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmpd-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmpd-2.c
@@ -10,7 +10,8 @@
#define SIZE (AVX512F_LEN / 64)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
+#include "float.h"
+
static void
CALC (double *r, double src, long long tbl)
@@ -60,10 +61,10 @@ CALC (double *r, double src, long long tbl)
*r = M_PI_2;
break;
case 14:
- *r = MAXDOUBLE;
+ *r = DBL_MAX;
break;
case 15:
- *r = -MAXDOUBLE;
+ *r = -DBL_MAX;
break;
default:
abort ();
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmps-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmps-2.c
index 6c2539d0f..edb149cf5 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmps-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmps-2.c
@@ -10,7 +10,7 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
+#include "float.h"
static void
CALC (float *r, float src, int tbl)
@@ -60,10 +60,10 @@ CALC (float *r, float src, int tbl)
*r = M_PI_2;
break;
case 14:
- *r = MAXFLOAT;
+ *r = FLT_MAX;
break;
case 15:
- *r = -MAXFLOAT;
+ *r = -FLT_MAX;
break;
default:
abort ();
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmsd-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmsd-2.c
index 1344c7fd1..1b66a9821 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmsd-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmsd-2.c
@@ -6,7 +6,7 @@
#include "avx512f-check.h"
#include "avx512f-helper.h"
#include <math.h>
-#include <values.h>
+#include <float.h>
#include "avx512f-mask-type.h"
void
@@ -57,10 +57,10 @@ compute_fixupimmpd (double *r, double src, long long tbl)
*r = M_PI_2;
break;
case 14:
- *r = MAXDOUBLE;
+ *r = DBL_MAX;
break;
case 15:
- *r = -MAXDOUBLE;
+ *r = -DBL_MAX;
break;
default:
abort ();
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmss-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmss-2.c
index 25e165ff5..87883ba6a 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmss-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vfixupimmss-2.c
@@ -6,7 +6,7 @@
#include "avx512f-check.h"
#include "avx512f-helper.h"
#include <math.h>
-#include <values.h>
+#include <float.h>
#include "avx512f-mask-type.h"
void
@@ -57,10 +57,10 @@ compute_fixupimmps (float *r, float src, int tbl)
*r = M_PI_2;
break;
case 14:
- *r = MAXFLOAT;
+ *r = FLT_MAX;
break;
case 15:
- *r = -MAXFLOAT;
+ *r = -FLT_MAX;
break;
default:
abort ();
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2d-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2d-2.c
index 9aa104bbf..6205cc530 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2d-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2d-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (int *dst, int *src1, int *ind, int *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2pd-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2pd-2.c
index a2daca0bd..0bb5b4c52 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2pd-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2pd-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 64)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (double *dst, double *src1, long long *ind, double *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2ps-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2ps-2.c
index 56215cfca..f8038ef15 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2ps-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2ps-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (float *dst, float *src1, int *ind, float *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2q-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2q-2.c
index 9d7b9bec3..0268afbce 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2q-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermi2q-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 64)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (long long *dst, long long *src1, long long *ind, long long *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2d-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2d-2.c
index ef8d1951b..bba108abd 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2d-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2d-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (int *dst, int *src1, int *ind, int *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2pd-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2pd-2.c
index 511a47015..4891c8553 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2pd-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2pd-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 64)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (double *dst, double *src1, long long *ind, double *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2ps-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2ps-2.c
index cd35d1237..a3d57c41d 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2ps-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2ps-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (float *dst, float *src1, int *ind, float *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2q-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2q-2.c
index 5f449adec..57fe3d4b1 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2q-2.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-vpermt2q-2.c
@@ -9,7 +9,6 @@
#define SIZE (AVX512F_LEN / 64)
#include "avx512f-mask-type.h"
#include "math.h"
-#include "values.h"
static void
CALC (long long *dst, long long *src1, long long *ind, long long *src2)
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61794.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61794.c
new file mode 100644
index 000000000..5f8e7d06c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61794.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512f" } */
+
+#include <x86intrin.h>
+
+__m512i zmm;
+__m128i xmm;
+
+void test (void)
+{
+ xmm = _mm512_extracti32x4_epi32 (zmm, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61801.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61801.c
new file mode 100644
index 000000000..d0d08ccb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61801.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/61801 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fcompare-debug" } */
+
+int a, c;
+int bar (void);
+void baz (void);
+
+void
+foo (void)
+{
+ int d;
+ if (bar ())
+ {
+ int e;
+ baz ();
+ asm volatile ("" : "=a" (e) : "0" (a), "i" (0));
+ d = e;
+ }
+ c = d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61855.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61855.c
new file mode 100644
index 000000000..09c62aebb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61855.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512f" } */
+
+#include <x86intrin.h>
+
+__m512 test (__m512 x)
+{
+ return _mm512_getmant_ps(x, _MM_MANT_NORM_1_2, _MM_MANT_SIGN_zero);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61923.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61923.c
new file mode 100644
index 000000000..458158cc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61923.c
@@ -0,0 +1,36 @@
+/* PR debug/61923 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+typedef struct
+{
+ struct
+ {
+ struct
+ {
+ char head;
+ } tickets;
+ };
+} arch_spinlock_t;
+struct ext4_map_blocks
+{
+ int m_lblk;
+ int m_len;
+ int m_flags;
+};
+int ext4_da_map_blocks_ei_0;
+void fn1 (int p1, struct ext4_map_blocks *p2)
+{
+ int ret;
+ if (p2->m_flags)
+ {
+ ext4_da_map_blocks_ei_0++;
+ arch_spinlock_t *lock;
+ switch (sizeof *&lock->tickets.head)
+ case 1:
+ asm("" : "+m"(*&lock->tickets.head) : ""(0));
+ __asm__("");
+ ret = 0;
+ }
+ fn2 (p2->m_lblk, p2->m_len);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c
index 382677e60..97ef3935a 100644
--- a/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-imul64-vector.c
@@ -33,4 +33,3 @@ int main ()
/* { dg-final { scan-assembler "vpmulld" } } */
/* { dg-final { scan-assembler "vphadddq" } } */
-/* { dg-final { scan-assembler "vpmacsdql" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/mips/pr62030-octeon.c b/gcc-4.9/gcc/testsuite/gcc.target/mips/pr62030-octeon.c
new file mode 100644
index 000000000..5e3d3b3b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/mips/pr62030-octeon.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-options "-march=octeon" } */
+
+extern void abort (void);
+
+struct node
+{
+ struct node *next;
+ struct node *prev;
+};
+
+struct node node;
+
+struct head
+{
+ struct node *first;
+};
+
+struct head heads[5];
+
+int k = 2;
+
+struct head *head = &heads[2];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ node.prev = (void *)head;
+ head->first = &node;
+
+ struct node *n = head->first;
+ struct head *h = &heads[k];
+ struct node *next = n->next;
+
+ if (n->prev == (void *)h)
+ h->first = next;
+ else
+ n->prev->next = next;
+
+ n->next = h->first;
+ return n->next == &node;
+}
+
+int
+main (void)
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
new file mode 100644
index 000000000..6e0d54883
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-options "-mabi=elfv2" } */
+
+struct f8
+ {
+ float x[8];
+ };
+
+void test (struct f8 a, struct f8 b) /* { dg-message "note: the ABI of passing homogeneous float aggregates will change" } */
+{
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
new file mode 100644
index 000000000..c4820e925
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+
+struct test
+ {
+ long a __attribute__((aligned (16)));
+ };
+
+void test (struct test a) /* { dg-message "note: the ABI of passing aggregates with 16-byte alignment will change" } */
+{
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
new file mode 100644
index 000000000..830de6bcc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+
+struct test
+ {
+ int a __attribute__((vector_size (8)));
+ }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment will change" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60102.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60102.c
new file mode 100644
index 000000000..d32e41d68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60102.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
+/* { dg-options "-mcpu=8548 -mspe -mabi=spe -g -mfloat-gprs=double" } */
+
+double
+pr60102 (double x, int m)
+{
+ double y;
+ y = m % 2 ? x : 1;
+ return y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/sh/pr61996.c b/gcc-4.9/gcc/testsuite/gcc.target/sh/pr61996.c
new file mode 100644
index 000000000..51a5f929d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/sh/pr61996.c
@@ -0,0 +1,12 @@
+/* Check that the option -musermode has no effect on targets that do not
+ support user/privileged mode and that it does not interfere with option
+ -matomic-model=soft-imask. */
+/* { dg-do compile } */
+/* { dg-options "-matomic-model=soft-imask" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1*" "-m2*" } } */
+
+int
+test (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/array_assignment_5.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/array_assignment_5.f90
new file mode 100644
index 000000000..6d585270c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/array_assignment_5.f90
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-ffrontend-optimize" }
+! PR 62214 - this used to give the wrong result.
+! Original test case by Oliver Fuhrer
+PROGRAM test
+ IMPLICIT NONE
+ CHARACTER(LEN=20) :: fullNames(2)
+ CHARACTER(LEN=255) :: pathName
+ CHARACTER(LEN=5) :: fileNames(2)
+
+ pathName = "/dir1/dir2/"
+ fileNames = (/ "file1", "file2" /)
+ fullNames = SPREAD(TRIM(pathName),1,2) // fileNames
+ if (fullNames(1) /= '/dir1/dir2/file1' .or. &
+ & fullnames(2) /= '/dir1/dir2/file2') call abort
+END PROGRAM test
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/array_constructor_49.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/array_constructor_49.f90
new file mode 100644
index 000000000..6a198d676
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/array_constructor_49.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! { dg-options "-ffrontend-optimize -fdump-tree-original" }
+! PR 62106 - this used to give wrong results because
+! of a bogus extra temporary variable.
+! Original test case by Martien Hulsen
+program t
+ integer :: ndim=2, ndfp=4, i
+ character (len=8) :: line
+ write (unit=line,fmt='(4I2)'), (/ ( i, i = 1, ndfp ) /) + ndim
+ if (line /= ' 3 4 5 6') call abort
+end program t
+! { dg-final { scan-tree-dump-times "__var" 3 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/bessel_7.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/bessel_7.f90
index 7e63ed1e8..c6b5f7407 100644
--- a/gcc-4.9/gcc/testsuite/gfortran.dg/bessel_7.f90
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/bessel_7.f90
@@ -16,7 +16,7 @@
implicit none
real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78]
real,parameter :: myeps(size(values)) = epsilon(0.0) &
- * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ]
+ * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ]
! The following is sufficient for me - the values above are a bit
! more tolerant
! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_44.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_44.f90
new file mode 100644
index 000000000..ebfeec64c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_44.f90
@@ -0,0 +1,36 @@
+! { dg-do run }
+! Tests fix for PR61780 in which the loop reversal mechanism was
+! not accounting for the first index being an element so that no
+! loop in this dimension is created.
+!
+! Contributed by Manfred Tietze on clf.
+!
+program prgm3
+ implicit none
+ integer, parameter :: n = 10, k = 3
+ integer :: i, j
+ integer, dimension(n,n) :: y
+ integer :: res1(n), res2(n)
+
+1 format(10i5)
+
+!initialize
+ do i=1,n
+ do j=1,n
+ y(i,j) = n*i + j
+ end do
+ end do
+ res2 = y(k,:)
+
+!shift right
+ y(k,4:n) = y(k,3:n-1)
+ y(k,3) = 0
+ res1 = y(k,:)
+ y(k,:) = res2
+ y(k,n:4:-1) = y(k,n-1:3:-1)
+ y(k,3) = 0
+ res2 = y(k,:)
+! print *, res1
+! print *, res2
+ if (any(res1 /= res2)) call abort ()
+end program prgm3
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/dot_product_3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/dot_product_3.f90
new file mode 100644
index 000000000..6e11556ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/dot_product_3.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+! PR 61999 - this used to ICE.
+! Original test case by A. Kasahara
+program main
+ use, intrinsic:: iso_fortran_env, only: output_unit
+
+ implicit none
+
+ write(output_unit, *) dot_product([1, 2], [2.0, 3.0])
+
+ stop
+end program main
+! { dg-final { scan-tree-dump-times "8\\.0e\\+0" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr62131.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr62131.f90
new file mode 100644
index 000000000..8e88cd70b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/pr62131.f90
@@ -0,0 +1,19 @@
+! PR fortran/62131
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+program pr62131
+ integer,allocatable :: nerrs(:,:)
+ allocate(nerrs(10,10))
+ nerrs(:,:) = 0
+!$omp parallel do
+ do k=1,10
+ call uperrs(k,1)
+ end do
+contains
+ subroutine uperrs(i,io)
+ integer,intent(in) :: i,io
+!$omp atomic
+ nerrs(i,io)=nerrs(i,io)+1
+ end subroutine
+end
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/pr45636.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/pr45636.f90
index ee7cf3863..c80dda45b 100644
--- a/gcc-4.9/gcc/testsuite/gfortran.dg/pr45636.f90
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/pr45636.f90
@@ -10,5 +10,5 @@ program main
b = y
call sub(a, b)
end program main
-! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { mips*-*-* && { ! nomips16 } } } } }
+! { dg-final { scan-tree-dump-times "memset" 0 "forwprop2" { xfail { { hppa*-*-* && { ! lp64 } } || { mips*-*-* && { ! nomips16 } } } } } }
! { dg-final { cleanup-tree-dump "forwprop2" } }
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/realloc_on_assign_24.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/realloc_on_assign_24.f90
new file mode 100644
index 000000000..6f88c2bf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/realloc_on_assign_24.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR 62142 - this used to segfault
+! Original test case by Ondřej Čertík .
+program test_segfault
+ implicit none
+ real, allocatable :: X(:)
+ allocate (x(1))
+ x = 1.
+ X = floor(X)
+end program
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/pack20.adb b/gcc-4.9/gcc/testsuite/gnat.dg/pack20.adb
new file mode 100644
index 000000000..5ec3e93a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gnat.dg/pack20.adb
@@ -0,0 +1,9 @@
+package body Pack20 is
+
+ procedure Proc (A : Rec) is
+ Local : Rec := A;
+ begin
+ Modify (Local.Fixed);
+ end;
+
+end Pack20;
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/pack20.ads b/gcc-4.9/gcc/testsuite/gnat.dg/pack20.ads
new file mode 100644
index 000000000..ddfb9d8a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gnat.dg/pack20.ads
@@ -0,0 +1,15 @@
+-- { dg-do compile }
+
+with Pack20_Pkg; use Pack20_Pkg;
+
+package Pack20 is
+
+ type Rec is record
+ Simple_Type : Integer;
+ Fixed : String_Ptr;
+ end record;
+ pragma Pack (Rec);
+
+ procedure Proc (A : Rec);
+
+end Pack20;
diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/pack20_pkg.ads b/gcc-4.9/gcc/testsuite/gnat.dg/pack20_pkg.ads
new file mode 100644
index 000000000..8f3c554a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gnat.dg/pack20_pkg.ads
@@ -0,0 +1,7 @@
+package Pack20_Pkg is
+
+ type String_Ptr is access all String;
+
+ procedure Modify (Fixed : in out String_Ptr);
+
+end Pack20_Pkg;
diff --git a/gcc-4.9/gcc/testsuite/lib/target-supports.exp b/gcc-4.9/gcc/testsuite/lib/target-supports.exp
index 902771bd5..0e226a2d6 100644
--- a/gcc-4.9/gcc/testsuite/lib/target-supports.exp
+++ b/gcc-4.9/gcc/testsuite/lib/target-supports.exp
@@ -2652,13 +2652,16 @@ proc check_effective_target_arm_v8_neon_ok_nocache { } {
if { [check_effective_target_arm32] } {
foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp-armv8" "-mfpu=neon-fp-armv8 -mfloat-abi=softfp"} {
if { [check_no_compiler_messages_nocache arm_v8_neon_ok object {
+ #if __ARM_ARCH < 8
+ #error not armv8 or later
+ #endif
#include "arm_neon.h"
void
foo ()
{
__asm__ volatile ("vrintn.f32 q0, q0");
}
- } "$flags"] } {
+ } "$flags -march=armv8-a"] } {
set et_arm_v8_neon_flags $flags
return 1
}
@@ -2835,6 +2838,7 @@ proc check_effective_target_arm_thumb1_ok { } {
#if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
#error FOO
#endif
+ int foo (int i) { return i; }
} "-mthumb"]
}
@@ -2846,6 +2850,7 @@ proc check_effective_target_arm_thumb2_ok { } {
#if !defined(__thumb2__)
#error FOO
#endif
+ int foo (int i) { return i; }
} "-mthumb"]
}
diff --git a/gcc-4.9/gcc/toplev.c b/gcc-4.9/gcc/toplev.c
index 9b8d31342..4c8c965d2 100644
--- a/gcc-4.9/gcc/toplev.c
+++ b/gcc-4.9/gcc/toplev.c
@@ -153,11 +153,6 @@ HOST_WIDE_INT random_seed;
the support provided depends on the backend. */
rtx stack_limit_rtx;
-/* True if the user has tagged the function with the 'section'
- attribute. */
-
-bool user_defined_section_attribute = false;
-
struct target_flag_state default_target_flag_state;
#if SWITCHABLE_TARGET
struct target_flag_state *this_target_flag_state = &default_target_flag_state;
diff --git a/gcc-4.9/gcc/toplev.h b/gcc-4.9/gcc/toplev.h
index 0290be38d..65e38e726 100644
--- a/gcc-4.9/gcc/toplev.h
+++ b/gcc-4.9/gcc/toplev.h
@@ -53,11 +53,6 @@ extern void target_reinit (void);
/* A unique local time stamp, might be zero if none is available. */
extern unsigned local_tick;
-/* True if the user has tagged the function with the 'section'
- attribute. */
-
-extern bool user_defined_section_attribute;
-
/* See toplev.c. */
extern int flag_rerun_cse_after_global_opts;
diff --git a/gcc-4.9/gcc/tree-cfg.c b/gcc-4.9/gcc/tree-cfg.c
index d9896e76f..29aa8c7a7 100644
--- a/gcc-4.9/gcc/tree-cfg.c
+++ b/gcc-4.9/gcc/tree-cfg.c
@@ -112,7 +112,14 @@ static struct cfg_stats_d cfg_stats;
struct locus_discrim_map
{
location_t locus;
- int discriminator;
+ /* Different calls belonging to the same source line will be assigned
+ different discriminators. But we want to keep the discriminator of
+ the first call in the same source line to be 0, in order to reduce
+ the .debug_line section size. needs_increment is used for this
+ purpose. It is initialized as false and will be set to true after
+ the first call is seen. */
+ bool needs_increment:1;
+ int discriminator:31;
};
/* Hashtable helpers. */
@@ -164,6 +171,7 @@ static int gimple_verify_flow_info (void);
static void gimple_make_forwarder_block (edge);
static gimple first_non_label_stmt (basic_block);
static bool verify_gimple_transaction (gimple);
+static bool call_can_make_abnormal_goto (gimple);
/* Flowgraph optimization and cleanup. */
static void gimple_merge_blocks (basic_block, basic_block);
@@ -426,6 +434,32 @@ assert_unreachable_fallthru_edge_p (edge e)
}
+/* Initialize GF_CALL_CTRL_ALTERING flag, which indicates the call
+ could alter control flow except via eh. We initialize the flag at
+ CFG build time and only ever clear it later. */
+
+static void
+gimple_call_initialize_ctrl_altering (gimple stmt)
+{
+ int flags = gimple_call_flags (stmt);
+
+ /* A call alters control flow if it can make an abnormal goto. */
+ if (call_can_make_abnormal_goto (stmt)
+ /* A call also alters control flow if it does not return. */
+ || flags & ECF_NORETURN
+ /* TM ending statements have backedges out of the transaction.
+ Return true so we split the basic block containing them.
+ Note that the TM_BUILTIN test is merely an optimization. */
+ || ((flags & ECF_TM_BUILTIN)
+ && is_tm_ending_fndecl (gimple_call_fndecl (stmt)))
+ /* BUILT_IN_RETURN call is same as return statement. */
+ || gimple_call_builtin_p (stmt, BUILT_IN_RETURN))
+ gimple_call_set_ctrl_altering (stmt, true);
+ else
+ gimple_call_set_ctrl_altering (stmt, false);
+}
+
+
/* Build a flowgraph for the sequence of stmts SEQ. */
static void
@@ -444,6 +478,9 @@ make_blocks (gimple_seq seq)
prev_stmt = stmt;
stmt = gsi_stmt (i);
+ if (stmt && is_gimple_call (stmt))
+ gimple_call_initialize_ctrl_altering (stmt);
+
/* If the statement starts a new basic block or if we have determined
in a previous pass that we need to create a new block for STMT, do
so now. */
@@ -914,10 +951,15 @@ make_edges (void)
/* Find the next available discriminator value for LOCUS. The
discriminator distinguishes among several basic blocks that
share a common locus, allowing for more accurate sample-based
- profiling. */
+ profiling. If RETURN_NEXT is true, return the next discriminator
+ anyway. If RETURN_NEXT is not true, we may not increase the
+ discriminator if locus_discrim_map::needs_increment is false,
+ which is used when the stmt is the first call stmt in current
+ source line. locus_discrim_map::needs_increment will be set to
+ true after the first call is seen. */
static int
-next_discriminator_for_locus (location_t locus)
+next_discriminator_for_locus (location_t locus, bool return_next)
{
struct locus_discrim_map item;
struct locus_discrim_map **slot;
@@ -932,9 +974,13 @@ next_discriminator_for_locus (location_t locus)
*slot = XNEW (struct locus_discrim_map);
gcc_assert (*slot);
(*slot)->locus = locus;
+ (*slot)->needs_increment = false;
(*slot)->discriminator = 0;
}
- (*slot)->discriminator++;
+ if (return_next || (*slot)->needs_increment)
+ (*slot)->discriminator++;
+ else
+ (*slot)->needs_increment = true;
return (*slot)->discriminator;
}
@@ -974,7 +1020,7 @@ assign_discriminator (location_t locus, basic_block bb)
if (locus == UNKNOWN_LOCATION)
return;
- discriminator = next_discriminator_for_locus (locus);
+ discriminator = next_discriminator_for_locus (locus, true);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -1009,23 +1055,13 @@ assign_discriminators (void)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
- if (curr_locus == UNKNOWN_LOCATION)
- {
+ if (gimple_code (stmt) == GIMPLE_CALL)
+ {
curr_locus = gimple_location (stmt);
- }
- else if (!same_line_p (curr_locus, gimple_location (stmt)))
- {
- curr_locus = gimple_location (stmt);
- curr_discr = 0;
- }
- else if (curr_discr != 0)
- {
+ curr_discr = next_discriminator_for_locus (curr_locus, false);
gimple_set_location (stmt, location_with_discriminator (
- gimple_location (stmt), curr_discr));
+ curr_locus, curr_discr));
}
- /* Allocate a new discriminator for CALL stmt. */
- if (gimple_code (stmt) == GIMPLE_CALL)
- curr_discr = next_discriminator_for_locus (curr_locus);
}
if (locus == UNKNOWN_LOCATION)
@@ -2416,28 +2452,10 @@ is_ctrl_altering_stmt (gimple t)
switch (gimple_code (t))
{
case GIMPLE_CALL:
- {
- int flags = gimple_call_flags (t);
-
- /* A call alters control flow if it can make an abnormal goto. */
- if (call_can_make_abnormal_goto (t))
- return true;
-
- /* A call also alters control flow if it does not return. */
- if (flags & ECF_NORETURN)
- return true;
-
- /* TM ending statements have backedges out of the transaction.
- Return true so we split the basic block containing them.
- Note that the TM_BUILTIN test is merely an optimization. */
- if ((flags & ECF_TM_BUILTIN)
- && is_tm_ending_fndecl (gimple_call_fndecl (t)))
- return true;
-
- /* BUILT_IN_RETURN call is same as return statement. */
- if (gimple_call_builtin_p (t, BUILT_IN_RETURN))
- return true;
- }
+ /* Per stmt call flag indicates whether the call could alter
+ controlflow. */
+ if (gimple_call_ctrl_altering_p (t))
+ return true;
break;
case GIMPLE_EH_DISPATCH:
@@ -8579,6 +8597,8 @@ execute_fixup_cfg (void)
&& (!is_gimple_call (stmt)
|| (gimple_call_flags (stmt) & ECF_NORETURN) == 0)))
{
+ if (stmt && is_gimple_call (stmt))
+ gimple_call_set_ctrl_altering (stmt, false);
stmt = gimple_build_call
(builtin_decl_implicit (BUILT_IN_UNREACHABLE), 0);
gimple_stmt_iterator gsi = gsi_last_bb (bb);
@@ -8589,10 +8609,6 @@ execute_fixup_cfg (void)
if (count_scale != REG_BR_PROB_BASE)
compute_function_frequency ();
- /* We just processed all calls. */
- if (cfun->gimple_df)
- vec_free (MODIFIED_NORETURN_CALLS (cfun));
-
/* Dump a textual representation of the flowgraph. */
if (dump_file)
gimple_dump_cfg (dump_file, dump_flags);
diff --git a/gcc-4.9/gcc/tree-cfgcleanup.c b/gcc-4.9/gcc/tree-cfgcleanup.c
index b7882cf67..51b764f81 100644
--- a/gcc-4.9/gcc/tree-cfgcleanup.c
+++ b/gcc-4.9/gcc/tree-cfgcleanup.c
@@ -162,6 +162,23 @@ cleanup_control_expr_graph (basic_block bb, gimple_stmt_iterator gsi)
return retval;
}
+/* Cleanup the GF_CALL_CTRL_ALTERING flag according to
+ to updated gimple_call_flags. */
+
+static void
+cleanup_call_ctrl_altering_flag (gimple bb_end)
+{
+ if (!is_gimple_call (bb_end)
+ || !gimple_call_ctrl_altering_p (bb_end))
+ return;
+
+ int flags = gimple_call_flags (bb_end);
+ if (((flags & (ECF_CONST | ECF_PURE))
+ && !(flags & ECF_LOOPING_CONST_OR_PURE))
+ || (flags & ECF_LEAF))
+ gimple_call_set_ctrl_altering (bb_end, false);
+}
+
/* Try to remove superfluous control structures in basic block BB. Returns
true if anything changes. */
@@ -182,6 +199,9 @@ cleanup_control_flow_bb (basic_block bb)
stmt = gsi_stmt (gsi);
+ /* Try to cleanup ctrl altering flag for call which ends bb. */
+ cleanup_call_ctrl_altering_flag (stmt);
+
if (gimple_code (stmt) == GIMPLE_COND
|| gimple_code (stmt) == GIMPLE_SWITCH)
retval |= cleanup_control_expr_graph (bb, gsi);
@@ -594,30 +614,24 @@ fixup_noreturn_call (gimple stmt)
known not to return, and remove the unreachable code. */
static bool
-split_bbs_on_noreturn_calls (void)
+split_bb_on_noreturn_calls (basic_block bb)
{
bool changed = false;
- gimple stmt;
- basic_block bb;
+ gimple_stmt_iterator gsi;
- /* Detect cases where a mid-block call is now known not to return. */
- if (cfun->gimple_df)
- while (vec_safe_length (MODIFIED_NORETURN_CALLS (cfun)))
- {
- stmt = MODIFIED_NORETURN_CALLS (cfun)->pop ();
- bb = gimple_bb (stmt);
- /* BB might be deleted at this point, so verify first
- BB is present in the cfg. */
- if (bb == NULL
- || bb->index < NUM_FIXED_BLOCKS
- || bb->index >= last_basic_block_for_fn (cfun)
- || BASIC_BLOCK_FOR_FN (cfun, bb->index) != bb
- || !gimple_call_noreturn_p (stmt))
- continue;
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!is_gimple_call (stmt))
+ continue;
+
+ if (gimple_call_noreturn_p (stmt))
changed |= fixup_noreturn_call (stmt);
- }
+ }
+ if (changed)
+ bitmap_set_bit (cfgcleanup_altered_bbs, bb->index);
return changed;
}
@@ -655,8 +669,6 @@ cleanup_tree_cfg_1 (void)
basic_block bb;
unsigned i, n;
- retval |= split_bbs_on_noreturn_calls ();
-
/* Prepare the worklists of altered blocks. */
cfgcleanup_altered_bbs = BITMAP_ALLOC (NULL);
@@ -672,7 +684,10 @@ cleanup_tree_cfg_1 (void)
{
bb = BASIC_BLOCK_FOR_FN (cfun, i);
if (bb)
- retval |= cleanup_tree_cfg_bb (bb);
+ {
+ retval |= cleanup_tree_cfg_bb (bb);
+ retval |= split_bb_on_noreturn_calls (bb);
+ }
}
/* Now process the altered blocks, as long as any are available. */
@@ -689,9 +704,9 @@ cleanup_tree_cfg_1 (void)
retval |= cleanup_tree_cfg_bb (bb);
- /* Rerun split_bbs_on_noreturn_calls, in case we have altered any noreturn
+ /* Rerun split_bb_on_noreturn_calls, in case we have altered any noreturn
calls. */
- retval |= split_bbs_on_noreturn_calls ();
+ retval |= split_bb_on_noreturn_calls (bb);
}
end_recording_case_labels ();
diff --git a/gcc-4.9/gcc/tree-ssa-loop-ivopts.c b/gcc-4.9/gcc/tree-ssa-loop-ivopts.c
index 8bc4e8fc7..78f036ebd 100644
--- a/gcc-4.9/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc-4.9/gcc/tree-ssa-loop-ivopts.c
@@ -1679,6 +1679,8 @@ may_be_unaligned_p (tree ref, tree step)
return false;
unsigned int align = TYPE_ALIGN (TREE_TYPE (ref));
+ if (GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref))) > align)
+ align = GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref)));
unsigned HOST_WIDE_INT bitpos;
unsigned int ref_align;
diff --git a/gcc-4.9/gcc/tree-ssa-math-opts.c b/gcc-4.9/gcc/tree-ssa-math-opts.c
index 292ced1d0..0e8d54d34 100644
--- a/gcc-4.9/gcc/tree-ssa-math-opts.c
+++ b/gcc-4.9/gcc/tree-ssa-math-opts.c
@@ -1749,6 +1749,8 @@ find_bswap_1 (gimple stmt, struct symbolic_number *n, int limit)
size = TYPE_PRECISION (n->type);
if (size % BITS_PER_UNIT != 0)
return NULL_TREE;
+ if (size > HOST_BITS_PER_WIDEST_INT)
+ return NULL_TREE;
size /= BITS_PER_UNIT;
n->n = (sizeof (HOST_WIDEST_INT) < 8 ? 0 :
(unsigned HOST_WIDEST_INT)0x08070605 << 32 | 0x04030201);
@@ -1792,6 +1794,8 @@ find_bswap_1 (gimple stmt, struct symbolic_number *n, int limit)
type_size = TYPE_PRECISION (type);
if (type_size % BITS_PER_UNIT != 0)
return NULL_TREE;
+ if (type_size > (int) HOST_BITS_PER_WIDEST_INT)
+ return NULL_TREE;
/* Sign extension: result is dependent on the value. */
old_type_size = TYPE_PRECISION (n->type);
@@ -1932,7 +1936,7 @@ execute_optimize_bswap (void)
bool changed = false;
tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
- if (BITS_PER_UNIT != 8)
+ if (BITS_PER_UNIT != 8 || CHAR_BIT != 8)
return 0;
if (sizeof (HOST_WIDEST_INT) < 8)
diff --git a/gcc-4.9/gcc/tree-ssa-operands.c b/gcc-4.9/gcc/tree-ssa-operands.c
index 6647801aa..c3d7158cf 100644
--- a/gcc-4.9/gcc/tree-ssa-operands.c
+++ b/gcc-4.9/gcc/tree-ssa-operands.c
@@ -1092,12 +1092,6 @@ update_stmt_operands (struct function *fn, gimple stmt)
timevar_push (TV_TREE_OPS);
- /* If the stmt is a noreturn call queue it to be processed by
- split_bbs_on_noreturn_calls during cfg cleanup. */
- if (is_gimple_call (stmt)
- && gimple_call_noreturn_p (stmt))
- vec_safe_push (MODIFIED_NORETURN_CALLS (fn), stmt);
-
gcc_assert (gimple_modified_p (stmt));
build_ssa_operands (fn, stmt);
gimple_set_modified (stmt, false);
diff --git a/gcc-4.9/gcc/tree-ssa-tail-merge.c b/gcc-4.9/gcc/tree-ssa-tail-merge.c
index aa7f829d1..09e9b242c 100644
--- a/gcc-4.9/gcc/tree-ssa-tail-merge.c
+++ b/gcc-4.9/gcc/tree-ssa-tail-merge.c
@@ -1159,17 +1159,9 @@ gimple_equal_p (same_succ same_succ, gimple s1, gimple s2)
lhs2 = gimple_get_lhs (s2);
if (TREE_CODE (lhs1) != SSA_NAME
&& TREE_CODE (lhs2) != SSA_NAME)
- {
- /* If the vdef is the same, it's the same statement. */
- if (vn_valueize (gimple_vdef (s1))
- == vn_valueize (gimple_vdef (s2)))
- return true;
-
- /* Test for structural equality. */
- return (operand_equal_p (lhs1, lhs2, 0)
- && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
- gimple_assign_rhs1 (s2)));
- }
+ return (operand_equal_p (lhs1, lhs2, 0)
+ && gimple_operand_equal_value_p (gimple_assign_rhs1 (s1),
+ gimple_assign_rhs1 (s2)));
else if (TREE_CODE (lhs1) == SSA_NAME
&& TREE_CODE (lhs2) == SSA_NAME)
return vn_valueize (lhs1) == vn_valueize (lhs2);
diff --git a/gcc-4.9/gcc/tree-ssanames.h b/gcc-4.9/gcc/tree-ssanames.h
index bb3b5e6c1..b8729ad12 100644
--- a/gcc-4.9/gcc/tree-ssanames.h
+++ b/gcc-4.9/gcc/tree-ssanames.h
@@ -58,7 +58,6 @@ struct GTY (()) range_info_def {
#define SSANAMES(fun) (fun)->gimple_df->ssa_names
-#define MODIFIED_NORETURN_CALLS(fun) (fun)->gimple_df->modified_noreturn_calls
#define DEFAULT_DEFS(fun) (fun)->gimple_df->default_defs
#define num_ssa_names (vec_safe_length (cfun->gimple_df->ssa_names))
diff --git a/gcc-4.9/gcc/tree-vect-loop.c b/gcc-4.9/gcc/tree-vect-loop.c
index 4e579043d..2ebb90bfb 100644
--- a/gcc-4.9/gcc/tree-vect-loop.c
+++ b/gcc-4.9/gcc/tree-vect-loop.c
@@ -2321,7 +2321,8 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
}
def1 = SSA_NAME_DEF_STMT (op1);
- if (flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
+ if (gimple_bb (def1)
+ && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
&& loop->inner
&& flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
&& is_gimple_assign (def1))
diff --git a/gcc-4.9/gcc/tree-vectorizer.h b/gcc-4.9/gcc/tree-vectorizer.h
index 7733faa8f..f84bec56b 100644
--- a/gcc-4.9/gcc/tree-vectorizer.h
+++ b/gcc-4.9/gcc/tree-vectorizer.h
@@ -414,9 +414,9 @@ typedef struct _loop_vec_info {
#define LOOP_VINFO_SCALAR_LOOP(L) (L)->scalar_loop
#define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
- (L)->may_misalign_stmts.length () > 0
+ ((L)->may_misalign_stmts.length () > 0)
#define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \
- (L)->may_alias_ddrs.length () > 0
+ ((L)->may_alias_ddrs.length () > 0)
#define LOOP_VINFO_NITERS_KNOWN_P(L) \
(tree_fits_shwi_p ((L)->num_iters) && tree_to_shwi ((L)->num_iters) > 0)
diff --git a/gcc-4.9/gcc/tree.h b/gcc-4.9/gcc/tree.h
index b656b7b46..f13366f9e 100644
--- a/gcc-4.9/gcc/tree.h
+++ b/gcc-4.9/gcc/tree.h
@@ -2405,6 +2405,11 @@ extern void decl_value_expr_insert (tree, tree);
#define DECL_HAS_IMPLICIT_SECTION_NAME_P(NODE) \
(DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.implicit_section_name_p)
+/* Specify whether the section name was explicitly set with decl_attributes. */
+#define DECL_HAS_EXPLICIT_SECTION_NAME_P(NODE) \
+ (DECL_SECTION_NAME(NODE) != NULL_TREE \
+ && !DECL_HAS_IMPLICIT_SECTION_NAME_P(NODE))
+
extern tree decl_debug_expr_lookup (tree);
extern void decl_debug_expr_insert (tree, tree);
diff --git a/gcc-4.9/libada/ChangeLog b/gcc-4.9/libada/ChangeLog
index 94ea2e00a..38ba63c2d 100644
--- a/gcc-4.9/libada/ChangeLog
+++ b/gcc-4.9/libada/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/libada/Makefile.in b/gcc-4.9/libada/Makefile.in
index c307b9970..93da74063 100644
--- a/gcc-4.9/libada/Makefile.in
+++ b/gcc-4.9/libada/Makefile.in
@@ -60,7 +60,7 @@ CFLAGS=-g
PICFLAG = @PICFLAG@
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
GNATLIBCFLAGS= -g -O2
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
-fexceptions -DIN_RTS @have_getipinfo@
host_subdir = @host_subdir@
diff --git a/gcc-4.9/libgcc/ChangeLog b/gcc-4.9/libgcc/ChangeLog
index 1edf552db..d17c8c8a9 100644
--- a/gcc-4.9/libgcc/ChangeLog
+++ b/gcc-4.9/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-08-04 Rohit <rohitarulraj@freescale.com>
+
+ PR target/60102
+ * config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Update
+ based on change in SPE high register numbers and 3 HTM registers.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/libgcc/config/rs6000/linux-unwind.h b/gcc-4.9/libgcc/config/rs6000/linux-unwind.h
index c5b006ee9..ffb4f07ee 100644
--- a/gcc-4.9/libgcc/config/rs6000/linux-unwind.h
+++ b/gcc-4.9/libgcc/config/rs6000/linux-unwind.h
@@ -274,8 +274,8 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
#ifdef __SPE__
for (i = 14; i < 32; i++)
{
- fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET;
- fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset
+ fs->regs.reg[i + FIRST_SPE_HIGH_REGNO - 4].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + FIRST_SPE_HIGH_REGNO - 4].loc.offset
= (long) &regs->vregs - new_cfa + 4 * i;
}
#endif
diff --git a/gcc-4.9/libgcc/libgcov-merge.c b/gcc-4.9/libgcc/libgcov-merge.c
index 09d5769ff..ddbf06aaf 100644
--- a/gcc-4.9/libgcc/libgcov-merge.c
+++ b/gcc-4.9/libgcc/libgcov-merge.c
@@ -95,8 +95,8 @@ __gcov_merge_dc (gcov_type *counters, unsigned n_counters)
gcc_assert (!(n_counters % 2));
for (i = 0; i < n_counters; i += 2)
{
- gcov_type global_id = gcov_read_counter ();
- gcov_type call_count = gcov_read_counter ();
+ gcov_type global_id = gcov_get_counter_target ();
+ gcov_type call_count = gcov_get_counter ();
/* Note that global id counter may never have been set if no calls were
made from this call-site. */
@@ -108,7 +108,10 @@ __gcov_merge_dc (gcov_type *counters, unsigned n_counters)
else if (__gcov_is_gid_insane (global_id))
global_id = counters[i];
- gcc_assert (counters[i] == global_id);
+ /* In the case of inconsistency, use the src's target. */
+ if (counters[i] != global_id)
+ fprintf (stderr, "Warning: Inconsistent call targets in"
+ " direct-call profile.\n");
}
else if (global_id)
counters[i] = global_id;
@@ -158,12 +161,12 @@ __gcov_merge_icall_topn (gcov_type *counters, unsigned n_counters)
}
/* Skip the number_of_eviction entry. */
- gcov_read_counter ();
+ gcov_get_counter ();
for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2)
{
int found = 0;
- gcov_type global_id = gcov_read_counter ();
- gcov_type call_count = gcov_read_counter ();
+ gcov_type global_id = gcov_get_counter_target ();
+ gcov_type call_count = gcov_get_counter ();
for (m = 0; m < j; m += 2)
{
if (tmp_array[m] == global_id)
diff --git a/gcc-4.9/libgfortran/ChangeLog b/gcc-4.9/libgfortran/ChangeLog
index 89f2c8a10..e0a003cb2 100644
--- a/gcc-4.9/libgfortran/ChangeLog
+++ b/gcc-4.9/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-20 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR libgfortran/62188
+ * m4/bessel.m4: Avoid indexing off the end of an array.
+ * generated/bessel_r10.c: Regenerated.
+ * generated/bessel_r16.c: Ditto.
+ * generated/bessel_r4.c: Ditto.
+ * generated/bessel_r8.c: Ditto.
+
2014-07-31 Janne Blomqvist <jb@gcc.gnu.org>
Backport from mainline
diff --git a/gcc-4.9/libgfortran/generated/bessel_r10.c b/gcc-4.9/libgfortran/generated/bessel_r10.c
index 14b93e910..e6977560d 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r10.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r10.c
@@ -162,7 +162,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
x2rev = GFC_REAL_10_LITERAL(2.)/x;
- for (i = 2; i <= n1+n2; i++)
+ for (i = 2; i <= n2 - n1; i++)
{
#if defined(GFC_REAL_10_INFINITY)
if (unlikely (last2 == -GFC_REAL_10_INFINITY))
diff --git a/gcc-4.9/libgfortran/generated/bessel_r16.c b/gcc-4.9/libgfortran/generated/bessel_r16.c
index d64fa9c13..67dea307e 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r16.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r16.c
@@ -166,7 +166,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
x2rev = GFC_REAL_16_LITERAL(2.)/x;
- for (i = 2; i <= n1+n2; i++)
+ for (i = 2; i <= n2 - n1; i++)
{
#if defined(GFC_REAL_16_INFINITY)
if (unlikely (last2 == -GFC_REAL_16_INFINITY))
diff --git a/gcc-4.9/libgfortran/generated/bessel_r4.c b/gcc-4.9/libgfortran/generated/bessel_r4.c
index a86bb5fa9..7bdf07b3d 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r4.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r4.c
@@ -162,7 +162,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
x2rev = GFC_REAL_4_LITERAL(2.)/x;
- for (i = 2; i <= n1+n2; i++)
+ for (i = 2; i <= n2 - n1; i++)
{
#if defined(GFC_REAL_4_INFINITY)
if (unlikely (last2 == -GFC_REAL_4_INFINITY))
diff --git a/gcc-4.9/libgfortran/generated/bessel_r8.c b/gcc-4.9/libgfortran/generated/bessel_r8.c
index 84018872e..313bf179c 100644
--- a/gcc-4.9/libgfortran/generated/bessel_r8.c
+++ b/gcc-4.9/libgfortran/generated/bessel_r8.c
@@ -162,7 +162,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
x2rev = GFC_REAL_8_LITERAL(2.)/x;
- for (i = 2; i <= n1+n2; i++)
+ for (i = 2; i <= n2 - n1; i++)
{
#if defined(GFC_REAL_8_INFINITY)
if (unlikely (last2 == -GFC_REAL_8_INFINITY))
diff --git a/gcc-4.9/libgfortran/m4/bessel.m4 b/gcc-4.9/libgfortran/m4/bessel.m4
index 36ffd3356..6a865448e 100644
--- a/gcc-4.9/libgfortran/m4/bessel.m4
+++ b/gcc-4.9/libgfortran/m4/bessel.m4
@@ -163,7 +163,7 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
- for (i = 2; i <= n1+n2; i++)
+ for (i = 2; i <= n2 - n1; i++)
{
#if defined('rtype_name`_INFINITY)
if (unlikely (last2 == -'rtype_name`_INFINITY))
diff --git a/gcc-4.9/libgo/runtime/go-caller.c b/gcc-4.9/libgo/runtime/go-caller.c
index e97b85097..a3e04240d 100644
--- a/gcc-4.9/libgo/runtime/go-caller.c
+++ b/gcc-4.9/libgo/runtime/go-caller.c
@@ -7,6 +7,9 @@
/* Implement runtime.Caller. */
#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "backtrace.h"
@@ -99,6 +102,7 @@ __go_get_backtrace_state ()
if (back_state == NULL)
{
const char *filename;
+ struct stat s;
filename = (const char *) runtime_progname ();
@@ -108,6 +112,14 @@ __go_get_backtrace_state ()
if (__builtin_strchr (filename, '/') == NULL)
filename = NULL;
+ /* If the file is small, then it's not the real executable.
+ This is specifically to deal with Docker, which uses a bogus
+ argv[0] (http://gcc.gnu.org/PR61895). It would be nice to
+ have a better check for whether this file is the real
+ executable. */
+ if (stat (filename, &s) < 0 || s.st_size < 1024)
+ filename = NULL;
+
back_state = backtrace_create_state (filename, 1, error_callback, NULL);
}
runtime_unlock (&back_state_lock);
diff --git a/gcc-4.9/libgo/runtime/malloc.goc b/gcc-4.9/libgo/runtime/malloc.goc
index 7120457a5..37bbf5ef6 100644
--- a/gcc-4.9/libgo/runtime/malloc.goc
+++ b/gcc-4.9/libgo/runtime/malloc.goc
@@ -79,6 +79,7 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
MSpan *s;
MLink *v;
bool incallback;
+ void *closure;
if(size == 0) {
// All 0-length allocations use this pointer.
@@ -90,6 +91,10 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
m = runtime_m();
g = runtime_g();
+ // We should not be called in between __go_set_closure and the
+ // actual function call, but cope with it if we are.
+ closure = g->closure;
+
incallback = false;
if(m->mcache == nil && g->ncgo > 0) {
// For gccgo this case can occur when a cgo or SWIG function
@@ -206,6 +211,8 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
if(incallback)
runtime_entersyscall();
+ g->closure = closure;
+
return v;
}
diff --git a/gcc-4.9/libgo/runtime/mgc0.c b/gcc-4.9/libgo/runtime/mgc0.c
index f963686e3..b5a39d962 100644
--- a/gcc-4.9/libgo/runtime/mgc0.c
+++ b/gcc-4.9/libgo/runtime/mgc0.c
@@ -2000,6 +2000,7 @@ runtime_gc(int32 force)
runtime_mcall(mgc);
// record a new start time in case we're going around again
a.start_time = runtime_nanotime();
+ m = runtime_m();
}
// all done
diff --git a/gcc-4.9/libgomp/ChangeLog b/gcc-4.9/libgomp/ChangeLog
index f84950d94..d9d5db7c3 100644
--- a/gcc-4.9/libgomp/ChangeLog
+++ b/gcc-4.9/libgomp/ChangeLog
@@ -1,3 +1,44 @@
+2014-08-04 Jakub Jelinek <jakub@redhat.com>
+
+ * task.c (GOMP_taskgroup_end): If taskgroup->num_children
+ is not zero, but taskgroup->children is NULL and there are
+ any task->children, schedule those instead of waiting.
+ * testsuite/libgomp.c/depend-6.c: New test.
+ * testsuite/libgomp.c/depend-7.c: New test.
+ * testsuite/libgomp.c/depend-8.c: New test.
+ * testsuite/libgomp.c/depend-9.c: New test.
+ * testsuite/libgomp.c/depend-10.c: New test.
+
+2014-08-01 Jakub Jelinek <jakub@redhat.com>
+
+ * libgomp.h (struct gomp_task_depend_entry): Add redundant_out field.
+ (struct gomp_taskwait): New type.
+ (struct gomp_task): Add taskwait and parent_depends_on, remove
+ in_taskwait and taskwait_sem fields.
+ (gomp_finish_task): Don't destroy taskwait_sem.
+ * task.c (gomp_init_task): Don't init in_taskwait, instead init
+ taskwait and parent_depends_on.
+ (GOMP_task): For if (0) tasks with depend clause that depend on
+ earlier tasks don't defer them, instead call
+ gomp_task_maybe_wait_for_dependencies to wait for the dependencies.
+ Initialize redundant_out field, for redundant out entries just
+ move them at the end of linked list instead of removing them
+ completely, and set redundant_out flag instead of redundant.
+ (gomp_task_run_pre): Update last_parent_depends_on if scheduling
+ that task.
+ (gomp_task_run_post_handle_dependers): If parent is in
+ gomp_task_maybe_wait_for_dependencies and newly runnable task
+ is not parent_depends_on, queue it in parent->children linked
+ list after all runnable tasks with parent_depends_on set.
+ Adjust for addition of taskwait indirection.
+ (gomp_task_run_post_remove_parent): If parent is in
+ gomp_task_maybe_wait_for_dependencies and task to be removed
+ is parent_depends_on, decrement n_depend and if needed awake
+ parent. Adjust for addition of taskwait indirection.
+ (GOMP_taskwait): Adjust for addition of taskwait indirection.
+ (gomp_task_maybe_wait_for_dependencies): New function.
+ * testsuite/libgomp.c/depend-5.c: New test.
+
2014-07-16 Release Manager
* GCC 4.9.1 released.
diff --git a/gcc-4.9/libgomp/libgomp.h b/gcc-4.9/libgomp/libgomp.h
index bcd5b3448..a1482ccfb 100644
--- a/gcc-4.9/libgomp/libgomp.h
+++ b/gcc-4.9/libgomp/libgomp.h
@@ -274,6 +274,7 @@ struct gomp_task_depend_entry
struct gomp_task *task;
bool is_in;
bool redundant;
+ bool redundant_out;
};
struct gomp_dependers_vec
@@ -283,6 +284,17 @@ struct gomp_dependers_vec
struct gomp_task *elem[];
};
+/* Used when in GOMP_taskwait or in gomp_task_maybe_wait_for_dependencies. */
+
+struct gomp_taskwait
+{
+ bool in_taskwait;
+ bool in_depend_wait;
+ size_t n_depend;
+ struct gomp_task *last_parent_depends_on;
+ gomp_sem_t taskwait_sem;
+};
+
/* This structure describes a "task" to be run by a thread. */
struct gomp_task
@@ -298,17 +310,17 @@ struct gomp_task
struct gomp_taskgroup *taskgroup;
struct gomp_dependers_vec *dependers;
struct htab *depend_hash;
+ struct gomp_taskwait *taskwait;
size_t depend_count;
size_t num_dependees;
struct gomp_task_icv icv;
void (*fn) (void *);
void *fn_data;
enum gomp_task_kind kind;
- bool in_taskwait;
bool in_tied_task;
bool final_task;
bool copy_ctors_done;
- gomp_sem_t taskwait_sem;
+ bool parent_depends_on;
struct gomp_task_depend_entry depend[];
};
@@ -582,7 +594,6 @@ gomp_finish_task (struct gomp_task *task)
{
if (__builtin_expect (task->depend_hash != NULL, 0))
free (task->depend_hash);
- gomp_sem_destroy (&task->taskwait_sem);
}
/* team.c */
diff --git a/gcc-4.9/libgomp/task.c b/gcc-4.9/libgomp/task.c
index be2df3f2f..7d3233c6e 100644
--- a/gcc-4.9/libgomp/task.c
+++ b/gcc-4.9/libgomp/task.c
@@ -66,16 +66,16 @@ gomp_init_task (struct gomp_task *task, struct gomp_task *parent_task,
task->parent = parent_task;
task->icv = *prev_icv;
task->kind = GOMP_TASK_IMPLICIT;
- task->in_taskwait = false;
+ task->taskwait = NULL;
task->in_tied_task = false;
task->final_task = false;
task->copy_ctors_done = false;
+ task->parent_depends_on = false;
task->children = NULL;
task->taskgroup = NULL;
task->dependers = NULL;
task->depend_hash = NULL;
task->depend_count = 0;
- gomp_sem_init (&task->taskwait_sem, 0);
}
/* Clean up a task, after completing it. */
@@ -104,6 +104,8 @@ gomp_clear_parent (struct gomp_task *children)
while (task != children);
}
+static void gomp_task_maybe_wait_for_dependencies (void **depend);
+
/* Called when encountering an explicit task directive. If IF_CLAUSE is
false, then we must not delay in executing the task. If UNTIED is true,
then the task may be executed by any member of the team. */
@@ -141,35 +143,12 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
/* If there are depend clauses and earlier deferred sibling tasks
with depend clauses, check if there isn't a dependency. If there
- is, fall through to the deferred task handling, as we can't
- schedule such tasks right away. There is no need to handle
+ is, we need to wait for them. There is no need to handle
depend clauses for non-deferred tasks other than this, because
the parent task is suspended until the child task finishes and thus
it can't start further child tasks. */
if ((flags & 8) && thr->task && thr->task->depend_hash)
- {
- struct gomp_task *parent = thr->task;
- struct gomp_task_depend_entry elem, *ent = NULL;
- size_t ndepend = (uintptr_t) depend[0];
- size_t nout = (uintptr_t) depend[1];
- size_t i;
- gomp_mutex_lock (&team->task_lock);
- for (i = 0; i < ndepend; i++)
- {
- elem.addr = depend[i + 2];
- ent = htab_find (parent->depend_hash, &elem);
- for (; ent; ent = ent->next)
- if (i >= nout && ent->is_in)
- continue;
- else
- break;
- if (ent)
- break;
- }
- gomp_mutex_unlock (&team->task_lock);
- if (ent)
- goto defer;
- }
+ gomp_task_maybe_wait_for_dependencies (depend);
gomp_init_task (&task, thr->task, gomp_icv (false));
task.kind = GOMP_TASK_IFFALSE;
@@ -209,7 +188,6 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
}
else
{
- defer:;
struct gomp_task *task;
struct gomp_task *parent = thr->task;
struct gomp_taskgroup *taskgroup = parent->taskgroup;
@@ -275,11 +253,12 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
task->depend[i].task = task;
task->depend[i].is_in = i >= nout;
task->depend[i].redundant = false;
+ task->depend[i].redundant_out = false;
hash_entry_type *slot
= htab_find_slot (&parent->depend_hash, &task->depend[i],
INSERT);
- hash_entry_type out = NULL;
+ hash_entry_type out = NULL, last = NULL;
if (*slot)
{
/* If multiple depends on the same task are the
@@ -294,6 +273,11 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
}
for (ent = *slot; ent; ent = ent->next)
{
+ if (ent->redundant_out)
+ break;
+
+ last = ent;
+
/* depend(in:...) doesn't depend on earlier
depend(in:...). */
if (i >= nout && ent->is_in)
@@ -341,21 +325,31 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
*slot = &task->depend[i];
/* There is no need to store more than one depend({,in}out:)
- task per address in the hash table chain, because each out
+ task per address in the hash table chain for the purpose
+ of creation of deferred tasks, because each out
depends on all earlier outs, thus it is enough to record
just the last depend({,in}out:). For depend(in:), we need
to keep all of the previous ones not terminated yet, because
a later depend({,in}out:) might need to depend on all of
them. So, if the new task's clause is depend({,in}out:),
we know there is at most one other depend({,in}out:) clause
- in the list (out) and to maintain the invariant we now
- need to remove it from the list. */
+ in the list (out). For non-deferred tasks we want to see
+ all outs, so they are moved to the end of the chain,
+ after first redundant_out entry all following entries
+ should be redundant_out. */
if (!task->depend[i].is_in && out)
{
- if (out->next)
- out->next->prev = out->prev;
- out->prev->next = out->next;
- out->redundant = true;
+ if (out != last)
+ {
+ out->next->prev = out->prev;
+ out->prev->next = out->next;
+ out->next = last->next;
+ out->prev = last;
+ last->next = out;
+ if (out->next)
+ out->next->prev = out;
+ }
+ out->redundant_out = true;
}
}
if (task->num_dependees)
@@ -421,8 +415,20 @@ static inline bool
gomp_task_run_pre (struct gomp_task *child_task, struct gomp_task *parent,
struct gomp_taskgroup *taskgroup, struct gomp_team *team)
{
- if (parent && parent->children == child_task)
- parent->children = child_task->next_child;
+ if (parent)
+ {
+ if (parent->children == child_task)
+ parent->children = child_task->next_child;
+ if (__builtin_expect (child_task->parent_depends_on, 0)
+ && parent->taskwait->last_parent_depends_on == child_task)
+ {
+ if (child_task->prev_child->kind == GOMP_TASK_WAITING
+ && child_task->prev_child->parent_depends_on)
+ parent->taskwait->last_parent_depends_on = child_task->prev_child;
+ else
+ parent->taskwait->last_parent_depends_on = NULL;
+ }
+ }
if (taskgroup && taskgroup->children == child_task)
taskgroup->children = child_task->next_taskgroup;
child_task->prev_queue->next_queue = child_task->next_queue;
@@ -489,8 +495,23 @@ gomp_task_run_post_handle_dependers (struct gomp_task *child_task,
{
if (parent->children)
{
- task->next_child = parent->children;
- task->prev_child = parent->children->prev_child;
+ /* If parent is in gomp_task_maybe_wait_for_dependencies
+ and it doesn't need to wait for this task, put it after
+ all ready to run tasks it needs to wait for. */
+ if (parent->taskwait && parent->taskwait->last_parent_depends_on
+ && !task->parent_depends_on)
+ {
+ struct gomp_task *last_parent_depends_on
+ = parent->taskwait->last_parent_depends_on;
+ task->next_child = last_parent_depends_on->next_child;
+ task->prev_child = last_parent_depends_on;
+ }
+ else
+ {
+ task->next_child = parent->children;
+ task->prev_child = parent->children->prev_child;
+ parent->children = task;
+ }
task->next_child->prev_child = task;
task->prev_child->next_child = task;
}
@@ -498,12 +519,23 @@ gomp_task_run_post_handle_dependers (struct gomp_task *child_task,
{
task->next_child = task;
task->prev_child = task;
+ parent->children = task;
}
- parent->children = task;
- if (parent->in_taskwait)
+ if (parent->taskwait)
{
- parent->in_taskwait = false;
- gomp_sem_post (&parent->taskwait_sem);
+ if (parent->taskwait->in_taskwait)
+ {
+ parent->taskwait->in_taskwait = false;
+ gomp_sem_post (&parent->taskwait->taskwait_sem);
+ }
+ else if (parent->taskwait->in_depend_wait)
+ {
+ parent->taskwait->in_depend_wait = false;
+ gomp_sem_post (&parent->taskwait->taskwait_sem);
+ }
+ if (parent->taskwait->last_parent_depends_on == NULL
+ && task->parent_depends_on)
+ parent->taskwait->last_parent_depends_on = task;
}
}
if (taskgroup)
@@ -575,6 +607,13 @@ gomp_task_run_post_remove_parent (struct gomp_task *child_task)
struct gomp_task *parent = child_task->parent;
if (parent == NULL)
return;
+ if (__builtin_expect (child_task->parent_depends_on, 0)
+ && --parent->taskwait->n_depend == 0
+ && parent->taskwait->in_depend_wait)
+ {
+ parent->taskwait->in_depend_wait = false;
+ gomp_sem_post (&parent->taskwait->taskwait_sem);
+ }
child_task->prev_child->next_child = child_task->next_child;
child_task->next_child->prev_child = child_task->prev_child;
if (parent->children != child_task)
@@ -589,10 +628,10 @@ gomp_task_run_post_remove_parent (struct gomp_task *child_task)
written by child_task->fn above is flushed
before the NULL is written. */
__atomic_store_n (&parent->children, NULL, MEMMODEL_RELEASE);
- if (parent->in_taskwait)
+ if (parent->taskwait && parent->taskwait->in_taskwait)
{
- parent->in_taskwait = false;
- gomp_sem_post (&parent->taskwait_sem);
+ parent->taskwait->in_taskwait = false;
+ gomp_sem_post (&parent->taskwait->taskwait_sem);
}
}
}
@@ -736,6 +775,7 @@ GOMP_taskwait (void)
struct gomp_task *task = thr->task;
struct gomp_task *child_task = NULL;
struct gomp_task *to_free = NULL;
+ struct gomp_taskwait taskwait;
int do_wake = 0;
/* The acquire barrier on load of task->children here synchronizes
@@ -748,18 +788,194 @@ GOMP_taskwait (void)
|| __atomic_load_n (&task->children, MEMMODEL_ACQUIRE) == NULL)
return;
+ memset (&taskwait, 0, sizeof (taskwait));
gomp_mutex_lock (&team->task_lock);
while (1)
{
bool cancelled = false;
if (task->children == NULL)
{
+ bool destroy_taskwait = task->taskwait != NULL;
+ task->taskwait = NULL;
gomp_mutex_unlock (&team->task_lock);
if (to_free)
{
gomp_finish_task (to_free);
free (to_free);
}
+ if (destroy_taskwait)
+ gomp_sem_destroy (&taskwait.taskwait_sem);
+ return;
+ }
+ if (task->children->kind == GOMP_TASK_WAITING)
+ {
+ child_task = task->children;
+ cancelled
+ = gomp_task_run_pre (child_task, task, child_task->taskgroup,
+ team);
+ if (__builtin_expect (cancelled, 0))
+ {
+ if (to_free)
+ {
+ gomp_finish_task (to_free);
+ free (to_free);
+ to_free = NULL;
+ }
+ goto finish_cancelled;
+ }
+ }
+ else
+ {
+ /* All tasks we are waiting for are already running
+ in other threads. Wait for them. */
+ if (task->taskwait == NULL)
+ {
+ taskwait.in_depend_wait = false;
+ gomp_sem_init (&taskwait.taskwait_sem, 0);
+ task->taskwait = &taskwait;
+ }
+ taskwait.in_taskwait = true;
+ }
+ gomp_mutex_unlock (&team->task_lock);
+ if (do_wake)
+ {
+ gomp_team_barrier_wake (&team->barrier, do_wake);
+ do_wake = 0;
+ }
+ if (to_free)
+ {
+ gomp_finish_task (to_free);
+ free (to_free);
+ to_free = NULL;
+ }
+ if (child_task)
+ {
+ thr->task = child_task;
+ child_task->fn (child_task->fn_data);
+ thr->task = task;
+ }
+ else
+ gomp_sem_wait (&taskwait.taskwait_sem);
+ gomp_mutex_lock (&team->task_lock);
+ if (child_task)
+ {
+ finish_cancelled:;
+ size_t new_tasks
+ = gomp_task_run_post_handle_depend (child_task, team);
+ child_task->prev_child->next_child = child_task->next_child;
+ child_task->next_child->prev_child = child_task->prev_child;
+ if (task->children == child_task)
+ {
+ if (child_task->next_child != child_task)
+ task->children = child_task->next_child;
+ else
+ task->children = NULL;
+ }
+ gomp_clear_parent (child_task->children);
+ gomp_task_run_post_remove_taskgroup (child_task);
+ to_free = child_task;
+ child_task = NULL;
+ team->task_count--;
+ if (new_tasks > 1)
+ {
+ do_wake = team->nthreads - team->task_running_count
+ - !task->in_tied_task;
+ if (do_wake > new_tasks)
+ do_wake = new_tasks;
+ }
+ }
+ }
+}
+
+/* This is like GOMP_taskwait, but we only wait for tasks that the
+ upcoming task depends on. */
+
+static void
+gomp_task_maybe_wait_for_dependencies (void **depend)
+{
+ struct gomp_thread *thr = gomp_thread ();
+ struct gomp_task *task = thr->task;
+ struct gomp_team *team = thr->ts.team;
+ struct gomp_task_depend_entry elem, *ent = NULL;
+ struct gomp_taskwait taskwait;
+ struct gomp_task *last_parent_depends_on = NULL;
+ size_t ndepend = (uintptr_t) depend[0];
+ size_t nout = (uintptr_t) depend[1];
+ size_t i;
+ size_t num_awaited = 0;
+ struct gomp_task *child_task = NULL;
+ struct gomp_task *to_free = NULL;
+ int do_wake = 0;
+
+ gomp_mutex_lock (&team->task_lock);
+ for (i = 0; i < ndepend; i++)
+ {
+ elem.addr = depend[i + 2];
+ ent = htab_find (task->depend_hash, &elem);
+ for (; ent; ent = ent->next)
+ if (i >= nout && ent->is_in)
+ continue;
+ else
+ {
+ struct gomp_task *tsk = ent->task;
+ if (!tsk->parent_depends_on)
+ {
+ tsk->parent_depends_on = true;
+ ++num_awaited;
+ if (tsk->num_dependees == 0 && tsk->kind == GOMP_TASK_WAITING)
+ {
+ /* If a task we need to wait for is not already
+ running and is ready to be scheduled, move it
+ to front, so that we run it as soon as possible. */
+ if (last_parent_depends_on)
+ {
+ tsk->prev_child->next_child = tsk->next_child;
+ tsk->next_child->prev_child = tsk->prev_child;
+ tsk->prev_child = last_parent_depends_on;
+ tsk->next_child = last_parent_depends_on->next_child;
+ tsk->prev_child->next_child = tsk;
+ tsk->next_child->prev_child = tsk;
+ }
+ else if (tsk != task->children)
+ {
+ tsk->prev_child->next_child = tsk->next_child;
+ tsk->next_child->prev_child = tsk->prev_child;
+ tsk->prev_child = task->children;
+ tsk->next_child = task->children->next_child;
+ task->children = tsk;
+ tsk->prev_child->next_child = tsk;
+ tsk->next_child->prev_child = tsk;
+ }
+ last_parent_depends_on = tsk;
+ }
+ }
+ }
+ }
+ if (num_awaited == 0)
+ {
+ gomp_mutex_unlock (&team->task_lock);
+ return;
+ }
+
+ memset (&taskwait, 0, sizeof (taskwait));
+ taskwait.n_depend = num_awaited;
+ taskwait.last_parent_depends_on = last_parent_depends_on;
+ gomp_sem_init (&taskwait.taskwait_sem, 0);
+ task->taskwait = &taskwait;
+
+ while (1)
+ {
+ bool cancelled = false;
+ if (taskwait.n_depend == 0)
+ {
+ task->taskwait = NULL;
+ gomp_mutex_unlock (&team->task_lock);
+ if (to_free)
+ {
+ gomp_finish_task (to_free);
+ free (to_free);
+ }
+ gomp_sem_destroy (&taskwait.taskwait_sem);
return;
}
if (task->children->kind == GOMP_TASK_WAITING)
@@ -782,7 +998,7 @@ GOMP_taskwait (void)
else
/* All tasks we are waiting for are already running
in other threads. Wait for them. */
- task->in_taskwait = true;
+ taskwait.in_depend_wait = true;
gomp_mutex_unlock (&team->task_lock);
if (do_wake)
{
@@ -802,13 +1018,15 @@ GOMP_taskwait (void)
thr->task = task;
}
else
- gomp_sem_wait (&task->taskwait_sem);
+ gomp_sem_wait (&taskwait.taskwait_sem);
gomp_mutex_lock (&team->task_lock);
if (child_task)
{
finish_cancelled:;
size_t new_tasks
= gomp_task_run_post_handle_depend (child_task, team);
+ if (child_task->parent_depends_on)
+ --taskwait.n_depend;
child_task->prev_child->next_child = child_task->next_child;
child_task->next_child->prev_child = child_task->prev_child;
if (task->children == child_task)
@@ -897,18 +1115,26 @@ GOMP_taskgroup_end (void)
if (taskgroup->children == NULL)
{
if (taskgroup->num_children)
- goto do_wait;
- gomp_mutex_unlock (&team->task_lock);
- if (to_free)
{
- gomp_finish_task (to_free);
- free (to_free);
+ if (task->children == NULL)
+ goto do_wait;
+ child_task = task->children;
+ }
+ else
+ {
+ gomp_mutex_unlock (&team->task_lock);
+ if (to_free)
+ {
+ gomp_finish_task (to_free);
+ free (to_free);
+ }
+ goto finish;
}
- goto finish;
}
- if (taskgroup->children->kind == GOMP_TASK_WAITING)
+ else
+ child_task = taskgroup->children;
+ if (child_task->kind == GOMP_TASK_WAITING)
{
- child_task = taskgroup->children;
cancelled
= gomp_task_run_pre (child_task, child_task->parent, taskgroup,
team);
@@ -925,6 +1151,7 @@ GOMP_taskgroup_end (void)
}
else
{
+ child_task = NULL;
do_wait:
/* All tasks we are waiting for are already running
in other threads. Wait for them. */
@@ -956,20 +1183,9 @@ GOMP_taskgroup_end (void)
finish_cancelled:;
size_t new_tasks
= gomp_task_run_post_handle_depend (child_task, team);
- child_task->prev_taskgroup->next_taskgroup
- = child_task->next_taskgroup;
- child_task->next_taskgroup->prev_taskgroup
- = child_task->prev_taskgroup;
- --taskgroup->num_children;
- if (taskgroup->children == child_task)
- {
- if (child_task->next_taskgroup != child_task)
- taskgroup->children = child_task->next_taskgroup;
- else
- taskgroup->children = NULL;
- }
gomp_task_run_post_remove_parent (child_task);
gomp_clear_parent (child_task->children);
+ gomp_task_run_post_remove_taskgroup (child_task);
to_free = child_task;
child_task = NULL;
team->task_count--;
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-10.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-10.c
new file mode 100644
index 000000000..2137bf947
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-10.c
@@ -0,0 +1,3 @@
+/* { dg-set-target-env-var OMP_NUM_THREADS "1" } */
+
+#include "depend-5.c"
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-5.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-5.c
new file mode 100644
index 000000000..192c6ddfe
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-5.c
@@ -0,0 +1,98 @@
+#include <stdlib.h>
+
+__attribute__((noinline, noclone)) void
+f1 (int ifval)
+{
+ int x = 1, y = 2, z = 3;
+ #pragma omp parallel
+ #pragma omp single
+ {
+ #pragma omp task shared (x) depend(out: x)
+ x = 2;
+ #pragma omp task shared (x) depend(inout: x)
+ {
+ if (x != 2)
+ abort ();
+ x = 3;
+ }
+ #pragma omp task shared (x) depend(inout: x)
+ {
+ if (x != 3)
+ abort ();
+ x = 4;
+ }
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (z) depend(in: z)
+ if (z != 3)
+ abort ();
+ #pragma omp task shared (y) depend(in: y)
+ if (y != 2)
+ abort ();
+ #pragma omp task shared (y) depend(in: y)
+ if (y != 2)
+ abort ();
+ #pragma omp task shared (y) depend(in: y)
+ if (y != 2)
+ abort ();
+ #pragma omp task shared (y) depend(in: y)
+ if (y != 2)
+ abort ();
+ #pragma omp task if (ifval) shared (x, y) depend(in: x) depend(inout: y)
+ {
+ if (x != 4 || y != 2)
+ abort ();
+ y = 3;
+ }
+ if (ifval == 0)
+ {
+ /* The above if (0) task should have waited till all
+ the tasks with x and y dependencies finish. */
+ if (x != 4 || y != 3)
+ abort ();
+ x = 5;
+ y = 4;
+ }
+ #pragma omp task shared (z) depend(inout: z)
+ {
+ if (z != 3)
+ abort ();
+ z = 4;
+ }
+ #pragma omp task shared (z) depend(inout: z)
+ {
+ if (z != 4)
+ abort ();
+ z = 5;
+ }
+ #pragma omp taskwait
+ if (x != (ifval ? 4 : 5) || y != (ifval ? 3 : 4) || z != 5)
+ abort ();
+ #pragma omp task if (ifval) shared (x, y) depend(in: x) depend(inout: y)
+ {
+ if (x != (ifval ? 4 : 5) || y != (ifval ? 3 : 4))
+ abort ();
+ }
+ }
+}
+
+int
+main ()
+{
+ f1 (0);
+ f1 (1);
+ return 0;
+}
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-6.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-6.c
new file mode 100644
index 000000000..d30e6e9dd
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-6.c
@@ -0,0 +1,3 @@
+/* { dg-set-target-env-var OMP_NUM_THREADS "1" } */
+
+#include "depend-1.c"
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-7.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-7.c
new file mode 100644
index 000000000..bd4a3f9de
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-7.c
@@ -0,0 +1,3 @@
+/* { dg-set-target-env-var OMP_NUM_THREADS "1" } */
+
+#include "depend-2.c"
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-8.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-8.c
new file mode 100644
index 000000000..4dcce671c
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-8.c
@@ -0,0 +1,3 @@
+/* { dg-set-target-env-var OMP_NUM_THREADS "1" } */
+
+#include "depend-3.c"
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/depend-9.c b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-9.c
new file mode 100644
index 000000000..a52c47ac6
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/depend-9.c
@@ -0,0 +1,3 @@
+/* { dg-set-target-env-var OMP_NUM_THREADS "1" } */
+
+#include "depend-4.c"
diff --git a/gcc-4.9/libitm/config/aarch64/sjlj.S b/gcc-4.9/libitm/config/aarch64/sjlj.S
new file mode 100644
index 000000000..77118dd47
--- /dev/null
+++ b/gcc-4.9/libitm/config/aarch64/sjlj.S
@@ -0,0 +1,92 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU Transactional Memory Library (libitm).
+
+ Libitm is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "asmcfi.h"
+
+ .text
+ .align 2
+ .global _ITM_beginTransaction
+ .type _ITM_beginTransaction, %function
+
+_ITM_beginTransaction:
+ cfi_startproc
+ mov x1, sp
+ stp x29, x30, [sp, -11*16]!
+ cfi_adjust_cfa_offset(11*16)
+ cfi_rel_offset(x29, 0)
+ cfi_rel_offset(x30, 8)
+ mov x29, sp
+ stp x19, x20, [sp, 1*16]
+ stp x21, x22, [sp, 2*16]
+ stp x23, x24, [sp, 3*16]
+ stp x25, x26, [sp, 4*16]
+ stp x27, x28, [sp, 5*16]
+ stp d8, d9, [sp, 6*16]
+ stp d10, d11, [sp, 7*16]
+ stp d12, d13, [sp, 8*16]
+ stp d14, d15, [sp, 9*16]
+ str x1, [sp, 10*16]
+
+ /* Invoke GTM_begin_transaction with the struct we just built. */
+ mov x1, sp
+ bl GTM_begin_transaction
+
+ /* Return; we don't need to restore any of the call-saved regs. */
+ ldp x29, x30, [sp], 11*16
+ cfi_adjust_cfa_offset(-11*16)
+ cfi_restore(x29)
+ cfi_restore(x30)
+ ret
+ cfi_endproc
+ .size _ITM_beginTransaction, . - _ITM_beginTransaction
+
+ .align 2
+ .global GTM_longjmp
+ .hidden GTM_longjmp
+ .type GTM_longjmp, %function
+
+GTM_longjmp:
+ /* The first parameter becomes the return value (x0).
+ The third parameter is ignored for now. */
+ cfi_startproc
+ ldp x19, x20, [x1, 1*16]
+ ldp x21, x22, [x1, 2*16]
+ ldp x23, x24, [x1, 3*16]
+ ldp x25, x26, [x1, 4*16]
+ ldp x27, x28, [x1, 5*16]
+ ldp d8, d9, [x1, 6*16]
+ ldp d10, d11, [x1, 7*16]
+ ldp d12, d13, [x1, 8*16]
+ ldp d14, d15, [x1, 9*16]
+ ldr x3, [x1, 10*16]
+ ldp x29, x30, [x1]
+ cfi_def_cfa(x1, 0)
+ mov sp, x3
+ br x30
+ cfi_endproc
+ .size GTM_longjmp, . - GTM_longjmp
+
+#ifdef __linux__
+.section .note.GNU-stack, "", %progbits
+#endif
diff --git a/gcc-4.9/libitm/config/aarch64/target.h b/gcc-4.9/libitm/config/aarch64/target.h
new file mode 100644
index 000000000..cb0f33621
--- /dev/null
+++ b/gcc-4.9/libitm/config/aarch64/target.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU Transactional Memory Library (libitm).
+
+ Libitm is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+namespace GTM HIDDEN {
+
+typedef struct gtm_jmpbuf
+{
+ unsigned long long fp; /* x29 */
+ unsigned long long pc; /* x30 */
+ unsigned long long gr[10]; /* x19-x28 */
+ unsigned long long vr[8]; /* d8-d15 */
+ void *cfa;
+} gtm_jmpbuf;
+
+/* ??? The size of one line in hardware caches (in bytes). */
+#define HW_CACHELINE_SIZE 128
+
+static inline void
+cpu_relax (void)
+{
+ __asm volatile ("" : : : "memory");
+}
+
+} // namespace GTM
diff --git a/gcc-4.9/libstdc++-v3/ChangeLog b/gcc-4.9/libstdc++-v3/ChangeLog
index 09b7017cd..4e7f236d8 100644
--- a/gcc-4.9/libstdc++-v3/ChangeLog
+++ b/gcc-4.9/libstdc++-v3/ChangeLog
@@ -1,3 +1,114 @@
+2014-08-26 Jonathan Wakely <jwakely@redhat.com>
+
+ Backported from mainline
+ 2014-08-12 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/basic_string.h (getline): Qualify call to prevent ADL
+ and add overloads for rvalue streams.
+ * testsuite/21_strings/basic_string/inserters_extractors/char/12.cc:
+ New.
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc:
+ New.
+
+2014-08-26 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/62264
+ * include/experimental/string_view: Fix inconsistent exception specs.
+
+2014-08-09 François Dumont <fdumont@gcc.gnu.org>
+
+ PR libstdc++/61667
+ * include/bits/hashtable.h (_Hashtable<>::__rehash_policy): Use
+ _M_need_rehash to initialize the rehash policy and check if a rehash is
+ needed.
+ * testsuite/23_containers/unordered_map/modifiers/61667.cc: New.
+
+2014-08-04 Jonathan Wakely <jwakely@redhat.com>
+
+ Backported from mainline
+ 2014-07-29 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/61946
+ * include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
+ const allocator_type&)): Pass non-const allocator to
+ _S_new_RopeFunction.
+ * testsuite/ext/rope/61946.cc: New.
+
+2014-08-04 Zifei Tong <zifeitong@gmail.com>
+
+ * libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
+ _GLIBCXX_ prefix to macro.
+
+2014-08-04 Samuel Bronson <naesten@gmail.com>
+
+ Backport r212453 from trunk
+ 2014-07-11 Samuel Bronson <naesten@gmail.com>
+ Matthias Klose <doko@ubuntu.com>
+
+ PR libstdc++/58962
+ * python/libstdcxx/v6/printers.py: Port to Python 2+3
+ (imap): New compat function.
+ (izip): Likewise.
+ (Iterator): New mixin to allow writing iterators in Python 3 style
+ regardless of which version we're running on.
+ [Python3] (long) New compat alias for "int".
+ * testsuite/lib/gdb-test.exp: Port to Python 2+3 (print syntax)
+
+ Backport r210625 from trunk
+ 2014-05-19 Jonathan Wakely <jwakely@redhat.com>
+
+ * python/libstdcxx/v6/printers.py: Use Python3 raise syntax.
+
+2014-08-04 Jonathan Wakely <jwakely@redhat.com>
+
+ Backported from mainline
+ 2014-06-10 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/61390
+ * include/ext/pb_ds/detail/bin_search_tree_/traits.hpp
+ (bin_search_tree_traits): Do not redeclare template-parameters.
+ * testsuite/util/testsuite_iterators.h (test_container): Likewise.
+
+ Backported from mainline
+ 2014-06-02 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/condition_variable (condition_variable_any::_Unlock): Do
+ not swallow __forced_unwind.
+ * include/std/future (__future_base::_Task_setter): Likewise.
+ (__future_base::_Async_state_impl): Turn __forced_unwind into broken
+ promise and rethrow.
+ * include/std/mutex (try_lock): Likewise.
+ * testsuite/30_threads/async/forced_unwind.cc: New.
+ * testsuite/30_threads/packaged_task/forced_unwind.cc: New.
+
+ Backported from mainline
+ 2014-06-01 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/61374
+ * include/experimental/string_view (operator basic_string): Correct
+ order of arguments.
+ (to_string): Replace with member function.
+ Add inline specifiers. Remove unused header. Remove _S_empty_rep and
+ allow _M_str to be null.
+ * testsuite/experimental/string_view/cons/char/1.cc: Adjust to new
+ default constructor semantics.
+ * testsuite/experimental/string_view/cons/wchar_t/1.cc: Likewise.
+ * testsuite/experimental/string_view/operations/copy/char/1.cc: Fix
+ copyright dates. Remove unused header.
+ * testsuite/experimental/string_view/operations/copy/wchar_t/1.cc:
+ Likewise.
+ * testsuite/experimental/string_view/operations/data/char/1.cc:
+ Fix copyright dates. Adjust to new default constructor semantics.
+ * testsuite/experimental/string_view/operations/data/wchar_t/1.cc:
+ Likewise.
+ * testsuite/experimental/string_view/operations/to_string/1.cc: New.
+
+ Backported from mainline
+ 2014-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/atomic_base.h (__atomic_base<_PTp*>::_M_type_size): Add
+ const to constexpr member functions.
+
2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>
diff --git a/gcc-4.9/libstdc++-v3/include/bits/atomic_base.h b/gcc-4.9/libstdc++-v3/include/bits/atomic_base.h
index 242459ad0..1fc0ebb7e 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/atomic_base.h
+++ b/gcc-4.9/libstdc++-v3/include/bits/atomic_base.h
@@ -675,10 +675,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Factored out to facilitate explicit specialization.
constexpr ptrdiff_t
- _M_type_size(ptrdiff_t __d) { return __d * sizeof(_PTp); }
+ _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); }
constexpr ptrdiff_t
- _M_type_size(ptrdiff_t __d) volatile { return __d * sizeof(_PTp); }
+ _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); }
public:
__atomic_base() noexcept = default;
diff --git a/gcc-4.9/libstdc++-v3/include/bits/basic_string.h b/gcc-4.9/libstdc++-v3/include/bits/basic_string.h
index cd6037677..93ceb6dae 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/basic_string.h
+++ b/gcc-4.9/libstdc++-v3/include/bits/basic_string.h
@@ -2811,7 +2811,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str)
- { return getline(__is, __str, __is.widen('\n')); }
+ { return std::getline(__is, __str, __is.widen('\n')); }
+
+#if __cplusplus >= 201103L
+ /// Read a line from an rvalue stream into a string.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>&& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+ { return std::getline(__is, __str, __delim); }
+
+ /// Read a line from an rvalue stream into a string.
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_istream<_CharT, _Traits>&
+ getline(basic_istream<_CharT, _Traits>&& __is,
+ basic_string<_CharT, _Traits, _Alloc>& __str)
+ { return std::getline(__is, __str); }
+#endif
template<>
basic_istream<char>&
diff --git a/gcc-4.9/libstdc++-v3/include/bits/hashtable.h b/gcc-4.9/libstdc++-v3/include/bits/hashtable.h
index 9b6394c4e..588e69c9d 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/hashtable.h
+++ b/gcc-4.9/libstdc++-v3/include/bits/hashtable.h
@@ -1281,10 +1281,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
__rehash_policy(const _RehashPolicy& __pol)
{
- size_type __n_bkt = __pol._M_bkt_for_elements(_M_element_count);
- __n_bkt = __pol._M_next_bkt(__n_bkt);
- if (__n_bkt != _M_bucket_count)
- _M_rehash(__n_bkt, _M_rehash_policy._M_state());
+ auto __do_rehash =
+ __pol._M_need_rehash(_M_bucket_count, _M_element_count, 0);
+ if (__do_rehash.first)
+ _M_rehash(__do_rehash.second, _M_rehash_policy._M_state());
_M_rehash_policy = __pol;
}
diff --git a/gcc-4.9/libstdc++-v3/include/experimental/string_view b/gcc-4.9/libstdc++-v3/include/experimental/string_view
index bebeb6b62..49f46af54 100644
--- a/gcc-4.9/libstdc++-v3/include/experimental/string_view
+++ b/gcc-4.9/libstdc++-v3/include/experimental/string_view
@@ -39,7 +39,6 @@
# include <bits/c++14_warning.h>
#else
-#include <debug/debug.h>
#include <string>
#include <limits>
@@ -66,18 +65,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* _CharT* _M_str
* size_t _M_len
* @endcode
- *
- * A basic_string_view represents an empty string with a static constexpr
- * length one string:
- *
- * @code
- * static constexpr value_type _S_empty_str[1]{0};
- * @endcode
*/
- template<typename _CharT, typename _Traits = char_traits<_CharT>>
+ template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class basic_string_view
{
-
public:
// types
@@ -99,7 +90,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr
basic_string_view() noexcept
- : _M_len{0}, _M_str{_S_empty_str}
+ : _M_len{0}, _M_str{nullptr}
{ }
constexpr basic_string_view(const basic_string_view&) noexcept = default;
@@ -112,12 +103,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr basic_string_view(const _CharT* __str)
: _M_len{__str == nullptr ? 0 : traits_type::length(__str)},
- _M_str{__str == nullptr ? _S_empty_str : __str}
+ _M_str{__str}
{ }
constexpr basic_string_view(const _CharT* __str, size_type __len)
- : _M_len{__str == nullptr ? 0 :__len},
- _M_str{__str == nullptr ? _S_empty_str : __str}
+ : _M_len{__len},
+ _M_str{__str}
{ }
basic_string_view&
@@ -143,19 +134,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const_reverse_iterator
rbegin() const noexcept
- { return std::reverse_iterator<const_iterator>(this->end()); }
+ { return const_reverse_iterator(this->end()); }
const_reverse_iterator
rend() const noexcept
- { return std::reverse_iterator<const_iterator>(this->begin()); }
+ { return const_reverse_iterator(this->begin()); }
const_reverse_iterator
crbegin() const noexcept
- { return std::reverse_iterator<const_iterator>(this->end()); }
+ { return const_reverse_iterator(this->end()); }
const_reverse_iterator
crend() const noexcept
- { return std::reverse_iterator<const_iterator>(this->begin()); }
+ { return const_reverse_iterator(this->begin()); }
// [string.view.capacity], capacity
@@ -169,8 +160,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr size_type
max_size() const noexcept
- { return ((npos - sizeof(size_type) - sizeof(void*))
- / sizeof(value_type) / 4); }
+ {
+ return (npos - sizeof(size_type) - sizeof(void*))
+ / sizeof(value_type) / 4;
+ }
constexpr bool
empty() const noexcept
@@ -195,7 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"(which is %zu) >= this->size() "
"(which is %zu)"),
__pos, this->size()),
- _S_empty_str[0]);
+ *this->_M_str);
}
constexpr const _CharT&
@@ -219,11 +212,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return this->_M_str; }
// [string.view.modifiers], modifiers:
+
void
clear() noexcept
{
this->_M_len = 0;
- this->_M_str = _S_empty_str;
+ this->_M_str = nullptr;
}
void
@@ -251,8 +245,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Allocator>
explicit operator basic_string<_CharT, _Traits, _Allocator>() const
{
- return basic_string<_CharT, _Traits, _Allocator>
- (this->_M_len, this->_M_str);
+ return { this->_M_str, this->_M_len };
+ }
+
+ template<typename _Allocator = std::allocator<_CharT>>
+ basic_string<_CharT, _Traits, _Allocator>
+ to_string(const _Allocator& __alloc = _Allocator()) const
+ {
+ return { this->_M_str, this->_M_len, __alloc };
}
size_type
@@ -329,7 +329,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
find(_CharT __c, size_type __pos=0) const noexcept;
size_type
- find(const _CharT* __str, size_type __pos, size_type __n) const;
+ find(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
size_type
find(const _CharT* __str, size_type __pos=0) const noexcept
@@ -343,7 +343,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
rfind(_CharT __c, size_type __pos = npos) const noexcept;
size_type
- rfind(const _CharT* __str, size_type __pos, size_type __n) const;
+ rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
size_type
rfind(const _CharT* __str, size_type __pos = npos) const noexcept
@@ -431,8 +431,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: static_cast<int>(difference_type{__n1 - __n2});
}
- static constexpr value_type _S_empty_str[1]{};
-
size_t _M_len;
const _CharT* _M_str;
};
@@ -456,131 +454,119 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator==(basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) == 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator==(basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return __x.compare(__y) == 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator==(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) == 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator!=(basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return !(__x == __y); }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator!=(basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return !(__x == __y); }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator!=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return !(__x == __y); }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator< (basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) < 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator< (basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return __x.compare(__y) < 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator< (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) < 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator> (basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) > 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator> (basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return __x.compare(__y) > 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator> (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) > 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator<=(basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) <= 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator<=(basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return __x.compare(__y) <= 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator<=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) <= 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator>=(basic_string_view<_CharT, _Traits> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) >= 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator>=(basic_string_view<_CharT, _Traits> __x,
__detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
{ return __x.compare(__y) >= 0; }
template<typename _CharT, typename _Traits>
- bool
+ inline bool
operator>=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
basic_string_view<_CharT, _Traits> __y) noexcept
{ return __x.compare(__y) >= 0; }
- // [string.view.comparison], sufficient additional overloads of comparison functions
-
- // [string.view.nonmem], other non-member basic_string_view functions
- template<typename _CharT, typename _Traits = char_traits<_CharT>,
- typename _Allocator = allocator<_CharT>>
- basic_string<_CharT, _Traits, _Allocator>
- to_string(basic_string_view<_CharT, _Traits> __str,
- const _Allocator& __alloc = _Allocator())
- {
- return basic_string<_CharT, _Traits, _Allocator>
- (__str.begin(), __str.end(), __alloc);
- }
-
+ // [string.view.io], Inserters and extractors
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os,
- basic_string_view<_CharT,_Traits> __str)
- { return __ostream_insert(__os, __str.data(), __str.size()); }
+ inline basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os,
+ basic_string_view<_CharT,_Traits> __str)
+ { return __ostream_insert(__os, __str.data(), __str.size()); }
// basic_string_view typedef names
diff --git a/gcc-4.9/libstdc++-v3/include/experimental/string_view.tcc b/gcc-4.9/libstdc++-v3/include/experimental/string_view.tcc
index 1af3a4d9b..44562665a 100644
--- a/gcc-4.9/libstdc++-v3/include/experimental/string_view.tcc
+++ b/gcc-4.9/libstdc++-v3/include/experimental/string_view.tcc
@@ -47,10 +47,6 @@ namespace experimental
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _CharT, typename _Traits>
- constexpr _CharT
- basic_string_view<_CharT, _Traits>::_S_empty_str[1];
-
- template<typename _CharT, typename _Traits>
typename basic_string_view<_CharT, _Traits>::size_type
basic_string_view<_CharT, _Traits>::
find(const _CharT* __str, size_type __pos, size_type __n) const noexcept
diff --git a/gcc-4.9/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/traits.hpp b/gcc-4.9/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/traits.hpp
index d97b4326a..7ada3656d 100644
--- a/gcc-4.9/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/traits.hpp
+++ b/gcc-4.9/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/traits.hpp
@@ -55,7 +55,7 @@ namespace __gnu_pbds
class Cmp_Fn,
template<typename Node_CItr,
class Node_Itr,
- class Cmp_Fn,
+ class _Cmp_Fn,
typename _Alloc>
class Node_Update,
class Node,
@@ -161,7 +161,7 @@ namespace __gnu_pbds
class Cmp_Fn,
template<typename Node_CItr,
class Node_Itr,
- class Cmp_Fn,
+ class _Cmp_Fn,
typename _Alloc>
class Node_Update,
class Node,
diff --git a/gcc-4.9/libstdc++-v3/include/ext/rope b/gcc-4.9/libstdc++-v3/include/ext/rope
index df3d4bb31..147b335a8 100644
--- a/gcc-4.9/libstdc++-v3/include/ext/rope
+++ b/gcc-4.9/libstdc++-v3/include/ext/rope
@@ -1544,7 +1544,7 @@ protected:
typedef typename _Base::allocator_type allocator_type;
using _Base::_M_tree_ptr;
using _Base::get_allocator;
- using _Base::_M_get_allocator;
+ using _Base::_M_get_allocator;
typedef __GC_CONST _CharT* _Cstrptr;
static _CharT _S_empty_c_str[1];
@@ -1876,8 +1876,9 @@ protected:
const allocator_type& __a = allocator_type())
: _Base(__a)
{
- this->_M_tree_ptr = (0 == __len) ?
- 0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a);
+ this->_M_tree_ptr = (0 == __len)
+ ? 0
+ : _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
}
rope(const rope& __x, const allocator_type& __a = allocator_type())
diff --git a/gcc-4.9/libstdc++-v3/include/std/condition_variable b/gcc-4.9/libstdc++-v3/include/std/condition_variable
index fc111dd3d..921cb837d 100644
--- a/gcc-4.9/libstdc++-v3/include/std/condition_variable
+++ b/gcc-4.9/libstdc++-v3/include/std/condition_variable
@@ -189,7 +189,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
~_Unlock() noexcept(false)
{
if (uncaught_exception())
- __try { _M_lock.lock(); } __catch(...) { }
+ {
+ __try
+ { _M_lock.lock(); }
+ __catch(const __cxxabiv1::__forced_unwind&)
+ { __throw_exception_again; }
+ __catch(...)
+ { }
+ }
else
_M_lock.lock();
}
diff --git a/gcc-4.9/libstdc++-v3/include/std/future b/gcc-4.9/libstdc++-v3/include/std/future
index 998e90a98..d446b9d55 100644
--- a/gcc-4.9/libstdc++-v3/include/std/future
+++ b/gcc-4.9/libstdc++-v3/include/std/future
@@ -1240,6 +1240,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_M_result->_M_set(_M_fn());
}
+ __catch(const __cxxabiv1::__forced_unwind&)
+ {
+ __throw_exception_again; // will cause broken_promise
+ }
__catch(...)
{
_M_result->_M_error = current_exception();
@@ -1259,6 +1263,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_M_fn();
}
+ __catch(const __cxxabiv1::__forced_unwind&)
+ {
+ __throw_exception_again; // will cause broken_promise
+ }
__catch(...)
{
_M_result->_M_error = current_exception();
@@ -1519,7 +1527,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_result(new _Result<_Res>()), _M_fn(std::move(__fn))
{
_M_thread = std::thread{ [this] {
- _M_set_result(_S_task_setter(_M_result, _M_fn));
+ __try
+ {
+ _M_set_result(_S_task_setter(_M_result, _M_fn));
+ }
+ __catch (const __cxxabiv1::__forced_unwind&)
+ {
+ // make the shared state ready on thread cancellation
+ if (static_cast<bool>(_M_result))
+ this->_M_break_promise(std::move(_M_result));
+ __throw_exception_again;
+ }
} };
}
diff --git a/gcc-4.9/libstdc++-v3/include/std/mutex b/gcc-4.9/libstdc++-v3/include/std/mutex
index 0b481d609..8e9dd27e2 100644
--- a/gcc-4.9/libstdc++-v3/include/std/mutex
+++ b/gcc-4.9/libstdc++-v3/include/std/mutex
@@ -44,6 +44,7 @@
#include <bits/functexcept.h>
#include <bits/gthr.h>
#include <bits/move.h> // for std::swap
+#include <bits/cxxabi_forced.h>
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
@@ -649,6 +650,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
auto __locks = std::tie(__l1, __l2, __l3...);
__try
{ __try_lock_impl<0>::__do_try_lock(__locks, __idx); }
+ __catch(const __cxxabiv1::__forced_unwind&)
+ { __throw_exception_again; }
__catch(...)
{ }
return __idx;
diff --git a/gcc-4.9/libstdc++-v3/libsupc++/atexit_thread.cc b/gcc-4.9/libstdc++-v3/libsupc++/atexit_thread.cc
index db2020002..dff08e924 100644
--- a/gcc-4.9/libstdc++-v3/libsupc++/atexit_thread.cc
+++ b/gcc-4.9/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -26,7 +26,7 @@
#include <new>
#include "bits/gthr.h"
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
void *arg, void *d);
@@ -38,7 +38,7 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *),
return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
}
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
namespace {
// One element in a singly-linked stack of cleanups.
@@ -142,4 +142,4 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void *obj, void */*dso_ha
return 0;
}
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
diff --git a/gcc-4.9/libstdc++-v3/python/libstdcxx/v6/printers.py b/gcc-4.9/libstdc++-v3/python/libstdcxx/v6/printers.py
index 1f1f860a5..1fa08fbd5 100644
--- a/gcc-4.9/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/gcc-4.9/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1,4 +1,4 @@
-# Pretty-printers for libstc++.
+# Pretty-printers for libstdc++.
# Copyright (C) 2008-2014 Free Software Foundation, Inc.
@@ -18,6 +18,50 @@
import gdb
import itertools
import re
+import sys
+
+### Python 2 + Python 3 compatibility code
+
+# Resources about compatibility:
+#
+# * <http://pythonhosted.org/six/>: Documentation of the "six" module
+
+# FIXME: The handling of e.g. std::basic_string (at least on char)
+# probably needs updating to work with Python 3's new string rules.
+#
+# In particular, Python 3 has a separate type (called byte) for
+# bytestrings, and a special b"" syntax for the byte literals; the old
+# str() type has been redefined to always store Unicode text.
+#
+# We probably can't do much about this until this GDB PR is addressed:
+# <https://sourceware.org/bugzilla/show_bug.cgi?id=17138>
+
+if sys.version_info[0] > 2:
+ ### Python 3 stuff
+ Iterator = object
+ # Python 3 folds these into the normal functions.
+ imap = map
+ izip = zip
+ # Also, int subsumes long
+ long = int
+else:
+ ### Python 2 stuff
+ class Iterator:
+ """Compatibility mixin for iterators
+
+ Instead of writing next() methods for iterators, write
+ __next__() methods and use this mixin to make them work in
+ Python 2 as well as Python 3.
+
+ Idea stolen from the "six" documentation:
+ <http://pythonhosted.org/six/#six.Iterator>
+ """
+
+ def next(self):
+ return self.__next__()
+
+ # In Python 2, we still need these from itertools
+ from itertools import imap, izip
# Try to use the new-style pretty-printing if available.
_use_gdb_pp = True
@@ -51,7 +95,7 @@ def find_type(orig, name):
# anything fancier here.
field = typ.fields()[0]
if not field.is_base_class:
- raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
+ raise ValueError("Cannot find type %s::%s" % (str(orig), name))
typ = field.type
class SharedPointerPrinter:
@@ -87,7 +131,7 @@ class UniquePointerPrinter:
class StdListPrinter:
"Print a std::list"
- class _iterator:
+ class _iterator(Iterator):
def __init__(self, nodetype, head):
self.nodetype = nodetype
self.base = head['_M_next']
@@ -97,7 +141,7 @@ class StdListPrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.base == self.head:
raise StopIteration
elt = self.base.cast(self.nodetype).dereference()
@@ -135,7 +179,7 @@ class StdListIteratorPrinter:
class StdSlistPrinter:
"Print a __gnu_cxx::slist"
- class _iterator:
+ class _iterator(Iterator):
def __init__(self, nodetype, head):
self.nodetype = nodetype
self.base = head['_M_head']['_M_next']
@@ -144,7 +188,7 @@ class StdSlistPrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.base == 0:
raise StopIteration
elt = self.base.cast(self.nodetype).dereference()
@@ -180,7 +224,7 @@ class StdSlistIteratorPrinter:
class StdVectorPrinter:
"Print a std::vector"
- class _iterator:
+ class _iterator(Iterator):
def __init__ (self, start, finish, bitvec):
self.bitvec = bitvec
if bitvec:
@@ -198,7 +242,7 @@ class StdVectorPrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
count = self.count
self.count = self.count + 1
if self.bitvec:
@@ -265,7 +309,7 @@ class StdVectorIteratorPrinter:
class StdTuplePrinter:
"Print a std::tuple"
- class _iterator:
+ class _iterator(Iterator):
def __init__ (self, head):
self.head = head
@@ -276,20 +320,20 @@ class StdTuplePrinter:
# Set the actual head to the first pair.
self.head = self.head.cast (nodes[0].type)
elif len (nodes) != 0:
- raise ValueError, "Top of tuple tree does not consist of a single node."
+ raise ValueError("Top of tuple tree does not consist of a single node.")
self.count = 0
def __iter__ (self):
return self
- def next (self):
+ def __next__ (self):
nodes = self.head.type.fields ()
# Check for further recursions in the inheritance tree.
if len (nodes) == 0:
raise StopIteration
# Check that this iteration has an expected structure.
if len (nodes) != 2:
- raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
+ raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
# - Left node is the next recursion parent.
# - Right node is the actual class contained in the tuple.
@@ -341,7 +385,7 @@ class StdStackOrQueuePrinter:
return self.visualizer.display_hint ()
return None
-class RbtreeIterator:
+class RbtreeIterator(Iterator):
def __init__(self, rbtree):
self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
@@ -353,7 +397,7 @@ class RbtreeIterator:
def __len__(self):
return int (self.size)
- def next(self):
+ def __next__(self):
if self.count == self.size:
raise StopIteration
result = self.node
@@ -389,7 +433,7 @@ def get_value_from_Rb_tree_node(node):
return p.dereference()
except:
pass
- raise ValueError, "Unsupported implementation for %s" % str(node.type)
+ raise ValueError("Unsupported implementation for %s" % str(node.type))
# This is a pretty printer for std::_Rb_tree_iterator (which is
# std::map::iterator), and has nothing to do with the RbtreeIterator
@@ -422,7 +466,7 @@ class StdMapPrinter:
"Print a std::map or std::multimap"
# Turn an RbtreeIterator into a pretty-print iterator.
- class _iter:
+ class _iter(Iterator):
def __init__(self, rbiter, type):
self.rbiter = rbiter
self.count = 0
@@ -431,9 +475,9 @@ class StdMapPrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.count % 2 == 0:
- n = self.rbiter.next()
+ n = next(self.rbiter)
n = n.cast(self.type).dereference()
n = get_value_from_Rb_tree_node(n)
self.pair = n
@@ -465,7 +509,7 @@ class StdSetPrinter:
"Print a std::set or std::multiset"
# Turn an RbtreeIterator into a pretty-print iterator.
- class _iter:
+ class _iter(Iterator):
def __init__(self, rbiter, type):
self.rbiter = rbiter
self.count = 0
@@ -474,8 +518,8 @@ class StdSetPrinter:
def __iter__(self):
return self
- def next(self):
- item = self.rbiter.next()
+ def __next__(self):
+ item = next(self.rbiter)
item = item.cast(self.type).dereference()
item = get_value_from_Rb_tree_node(item)
# FIXME: this is weird ... what to do?
@@ -541,7 +585,7 @@ class StdBitsetPrinter:
class StdDequePrinter:
"Print a std::deque"
- class _iter:
+ class _iter(Iterator):
def __init__(self, node, start, end, last, buffer_size):
self.node = node
self.p = start
@@ -553,7 +597,7 @@ class StdDequePrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.p == self.last:
raise StopIteration
@@ -638,7 +682,7 @@ class StdStringPrinter:
def display_hint (self):
return 'string'
-class Tr1HashtableIterator:
+class Tr1HashtableIterator(Iterator):
def __init__ (self, hash):
self.buckets = hash['_M_buckets']
self.bucket = 0
@@ -654,7 +698,7 @@ class Tr1HashtableIterator:
def __iter__ (self):
return self
- def next (self):
+ def __next__ (self):
if self.node == 0:
raise StopIteration
node = self.node.cast(self.node_type)
@@ -669,7 +713,7 @@ class Tr1HashtableIterator:
self.bucket = self.bucket + 1
return result
-class StdHashtableIterator:
+class StdHashtableIterator(Iterator):
def __init__(self, hash):
self.node = hash['_M_before_begin']['_M_nxt']
self.node_type = find_type(hash.type, '__node_type').pointer()
@@ -677,7 +721,7 @@ class StdHashtableIterator:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.node == 0:
raise StopIteration
elt = self.node.cast(self.node_type).dereference()
@@ -706,10 +750,10 @@ class Tr1UnorderedSetPrinter:
return '[%d]' % i
def children (self):
- counter = itertools.imap (self.format_count, itertools.count())
+ counter = imap (self.format_count, itertools.count())
if self.typename.startswith('std::tr1'):
- return itertools.izip (counter, Tr1HashtableIterator (self.hashtable()))
- return itertools.izip (counter, StdHashtableIterator (self.hashtable()))
+ return izip (counter, Tr1HashtableIterator (self.hashtable()))
+ return izip (counter, StdHashtableIterator (self.hashtable()))
class Tr1UnorderedMapPrinter:
"Print a tr1::unordered_map"
@@ -741,15 +785,15 @@ class Tr1UnorderedMapPrinter:
return '[%d]' % i
def children (self):
- counter = itertools.imap (self.format_count, itertools.count())
+ counter = imap (self.format_count, itertools.count())
# Map over the hash table and flatten the result.
if self.typename.startswith('std::tr1'):
- data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
+ data = self.flatten (imap (self.format_one, Tr1HashtableIterator (self.hashtable())))
# Zip the two iterators together.
- return itertools.izip (counter, data)
- data = self.flatten (itertools.imap (self.format_one, StdHashtableIterator (self.hashtable())))
+ return izip (counter, data)
+ data = self.flatten (imap (self.format_one, StdHashtableIterator (self.hashtable())))
# Zip the two iterators together.
- return itertools.izip (counter, data)
+ return izip (counter, data)
def display_hint (self):
@@ -758,7 +802,7 @@ class Tr1UnorderedMapPrinter:
class StdForwardListPrinter:
"Print a std::forward_list"
- class _iterator:
+ class _iterator(Iterator):
def __init__(self, nodetype, head):
self.nodetype = nodetype
self.base = head['_M_next']
@@ -767,7 +811,7 @@ class StdForwardListPrinter:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.base == 0:
raise StopIteration
elt = self.base.cast(self.nodetype).dereference()
@@ -827,7 +871,7 @@ class Printer(object):
# A small sanity check.
# FIXME
if not self.compiled_rx.match(name + '<>'):
- raise ValueError, 'libstdc++ programming error: "%s" does not match' % name
+ raise ValueError('libstdc++ programming error: "%s" does not match' % name)
printer = RxPrinter(name, function)
self.subprinters.append(printer)
self.lookup[name] = printer
diff --git a/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/12.cc b/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/12.cc
new file mode 100644
index 000000000..a0dda5f63
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/12.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <string>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::string s;
+ getline(std::istringstream("First line\nSecond line\n"), s);
+ VERIFY( s == "First line" );
+ getline(std::istringstream("Third line\nFourth line\n"), s, 'r');
+ VERIFY( s == "Thi" );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc b/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc
new file mode 100644
index 000000000..db20c0293
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <string>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::wstring s;
+ getline(std::wistringstream(L"First line\nSecond line\n"), s);
+ VERIFY( s == L"First line" );
+ getline(std::wistringstream(L"Third line\nFourth line\n"), s, L'r');
+ VERIFY( s == L"Thi" );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/61667.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/61667.cc
new file mode 100644
index 000000000..cb4ad8ecb
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/61667.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2011-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+bool test __attribute__((unused)) = true;
+
+void test01()
+{
+ std::unordered_map<int, int> um(20);
+
+ std::size_t bkt_count = um.bucket_count();
+
+ um.max_load_factor(um.max_load_factor());
+
+ VERIFY( um.bucket_count() >= bkt_count );
+
+ um.max_load_factor(um.max_load_factor() * 2.f);
+
+ VERIFY( um.bucket_count() >= bkt_count );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc b/gcc-4.9/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
new file mode 100644
index 000000000..11d553910
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+#include <random>
+
+std::mt19937 urng;
+
+std::__detail::_Adaptor<std::mt19937, unsigned long> aurng(urng);
+
+auto x = std::generate_canonical<std::size_t,
+ std::numeric_limits<std::size_t>::digits>(urng);
+
+// { dg-error "static assertion failed: template argument not a floating point type" "" { target *-*-* } 167 }
+
+// { dg-error "static assertion failed: template argument not a floating point type" "" { target *-*-* } 3466 }
diff --git a/gcc-4.9/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc b/gcc-4.9/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
new file mode 100644
index 000000000..7b0a49280
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
@@ -0,0 +1,45 @@
+// { dg-do run { target *-*-linux* *-*-gnu* } }
+// { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2014 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/>.
+
+// Test (non-standard) handling of __forced_unwind exception.
+
+#include <future>
+#include <stdexcept>
+#include <pthread.h>
+#include <testsuite_hooks.h>
+
+void f() { pthread_exit(nullptr); }
+
+int main()
+{
+ auto fut = std::async(std::launch::async, f);
+ try
+ {
+ fut.get();
+ throw std::logic_error("Unreachable");
+ }
+ catch (const std::future_error& e)
+ {
+ VERIFY( e.code() == std::future_errc::broken_promise );
+ }
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc b/gcc-4.9/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
new file mode 100644
index 000000000..235ab178f
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
@@ -0,0 +1,48 @@
+// { dg-do run { target *-*-linux* *-*-gnu* } }
+// { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2014 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/>.
+
+// Test (non-standard) handling of __forced_unwind exception.
+
+#include <future>
+#include <stdexcept>
+#include <pthread.h>
+#include <testsuite_hooks.h>
+
+void f() { pthread_exit(nullptr); }
+
+int main()
+{
+ std::packaged_task<void()> p(f);
+ auto fut = p.get_future();
+ std::thread t(std::move(p));
+ try
+ {
+ fut.get();
+ throw std::logic_error("Unreachable");
+ }
+ catch (const std::future_error& e)
+ {
+ VERIFY( e.code() == std::future_errc::broken_promise );
+ }
+ t.join();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/char/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/char/1.cc
index c879cc7e0..a443b0ac7 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/char/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/char/1.cc
@@ -33,7 +33,7 @@ test01()
// basic_string_view()
const std::experimental::string_view str00{};
VERIFY( str00.length() == 0 );
- VERIFY( str00.data() != nullptr );
+ VERIFY( str00.data() == nullptr );
// basic_string_view(const char*)
const char str_lit01[] = "rodeo beach, marin";
@@ -54,11 +54,6 @@ test01()
VERIFY( str05.length() == len_lit01 );
VERIFY( str05.data() == str_lit01 );
- // basic_string_view(const char* s, std::size_t l)
- std::experimental::string_view str06{nullptr, len_lit01};
- VERIFY( str06.length() == 0 );
- VERIFY( str06.data() != nullptr );
-
// basic_string_view(basic_string& s)
std::string istr07(10, 'z');
std::experimental::string_view str07{istr07};
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/wchar_t/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/wchar_t/1.cc
index 12db72f28..9ba9b84a1 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/wchar_t/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/cons/wchar_t/1.cc
@@ -33,7 +33,7 @@ test01()
// basic_string_view()
const std::experimental::wstring_view str00{};
VERIFY( str00.length() == 0 );
- VERIFY( str00.data() != nullptr );
+ VERIFY( str00.data() == nullptr );
// basic_string_view(const char*)
const wchar_t str_lit01[] = L"rodeo beach, marin";
@@ -54,11 +54,6 @@ test01()
VERIFY( str05.length() == len_lit01 );
VERIFY( str05.data() == str_lit01 );
- // basic_string_view(const wchar_t* s, std::size_t l)
- std::experimental::wstring_view str06{nullptr, len_lit01};
- VERIFY( str06.length() == 0 );
- VERIFY( str06.data() != nullptr );
-
// basic_string_view(basic_string& s)
std::wstring istr07(10, L'z');
std::experimental::wstring_view str07{istr07};
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/char/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/char/1.cc
index 25b2af133..d0f3e8d69 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/char/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/char/1.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++1y" }
-// Copyright (C) 2013 Free Software Foundation, Inc.
+// Copyright (C) 2013-2014 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
@@ -20,7 +20,6 @@
// basic_string_view::copy
#include <experimental/string_view>
-#include <stdexcept>
#include <testsuite_hooks.h>
bool
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/wchar_t/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/wchar_t/1.cc
index 0348e1f98..bf3f14b14 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/wchar_t/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/copy/wchar_t/1.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++1y" }
-// Copyright (C) 2013 Free Software Foundation, Inc.
+// Copyright (C) 2013-2014 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
@@ -20,7 +20,6 @@
// basic_string_view::copy
#include <experimental/string_view>
-#include <stdexcept>
#include <testsuite_hooks.h>
bool
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/char/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/char/1.cc
index be75de917..a34492606 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/char/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/char/1.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++1y" }
-// Copyright (C) 2013 Free Software Foundation, Inc.
+// Copyright (C) 2013-2014 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
@@ -29,10 +29,9 @@ test01()
std::experimental::string_view empty;
- // data() for size == 0 is non-NULL.
VERIFY( empty.size() == 0 );
const std::experimental::string_view::value_type* p = empty.data();
- VERIFY( p );
+ VERIFY( p == nullptr );
return 0;
}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/wchar_t/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/wchar_t/1.cc
index 5e00b00b6..41d2d1411 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/wchar_t/1.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/data/wchar_t/1.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++1y" }
-// Copyright (C) 2013 Free Software Foundation, Inc.
+// Copyright (C) 2013-2014 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
@@ -29,10 +29,9 @@ test01()
std::experimental::wstring_view empty;
- // data() for size == 0 is non-NULL.
VERIFY( empty.size() == 0 );
const std::experimental::wstring_view::value_type* p = empty.data();
- VERIFY( p );
+ VERIFY( p == nullptr );
return 0;
}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/to_string/1.cc b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/to_string/1.cc
new file mode 100644
index 000000000..c0a5734c6
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/experimental/string_view/operations/to_string/1.cc
@@ -0,0 +1,53 @@
+// { dg-options "-std=gnu++1y" }
+
+// Copyright (C) 2014 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/>.
+
+// basic_string_view::to_string
+
+#include <experimental/string_view>
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+bool
+test01()
+{
+ bool test [[gnu::unused]] = true;
+
+ const char str_lit[] = "123456789A";
+ const std::experimental::string_view sv(str_lit);
+ char buffer[4] = { 0 };
+
+ auto s1 = sv.to_string();
+ VERIFY( s1 == str_lit );
+ using test_alloc = __gnu_test::tracker_allocator<char>;
+ auto s2 = sv.to_string( test_alloc{} );
+ static_assert( std::is_same<decltype(s2)::allocator_type, test_alloc>::value,
+ "to_string() uses custom allocator" );
+ VERIFY( std::equal(s1.begin(), s1.end(), s2.begin(), s2.end()) );
+ auto s3 = static_cast<std::string>(sv);
+ VERIFY( s3 == s1 );
+
+ return test;
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/pr60037.cc b/gcc-4.9/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/pr60037.cc
new file mode 100644
index 000000000..d3088a6ec
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/pr60037.cc
@@ -0,0 +1,23 @@
+// { dg-options "-std=gnu++11 -O0" }
+// { dg-require-cstdint "" }
+// { dg-require-cmath "" }
+
+#include <ext/random>
+#include <functional>
+
+void
+hyperplot(unsigned int N, unsigned int K, unsigned int n)
+{
+ std::mt19937 re; // the default engine
+ __gnu_cxx::hypergeometric_distribution<> hd(N, K, n);
+ auto gen = std::bind(hd, re);
+ gen();
+}
+
+int
+main()
+{
+ hyperplot(15, 3, 2);
+ hyperplot(500, 50, 30);
+ hyperplot(100, 20, 5);
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/ext/rope/61946.cc b/gcc-4.9/libstdc++-v3/testsuite/ext/rope/61946.cc
new file mode 100644
index 000000000..ba73b4856
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/ext/rope/61946.cc
@@ -0,0 +1,31 @@
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+#include <ext/rope>
+
+struct empty_char_prod : __gnu_cxx::char_producer<char>
+{
+ virtual void operator()(size_t, size_t, char*) {}
+};
+
+int main ()
+{
+ empty_char_prod* ecp = new empty_char_prod;
+ __gnu_cxx::crope excrope( ecp, 10L, true );
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/lib/gdb-test.exp b/gcc-4.9/libstdc++-v3/testsuite/lib/gdb-test.exp
index 1a72a4430..2169f26d2 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/gcc-4.9/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -91,7 +91,7 @@ proc gdb-test { marker {selector {}} } {
}
}
- set do_whatis_tests [gdb_batch_check "python print gdb.type_printers" \
+ set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
"\\\[\\\]"]
if {!$do_whatis_tests} {
send_log "skipping 'whatis' tests - gdb too old"
@@ -252,6 +252,6 @@ proc gdb_batch_check {command pattern} {
# but not earlier versions.
# Return 1 if the version is ok, 0 otherwise.
proc gdb_version_check {} {
- return [gdb_batch_check "python print gdb.lookup_global_symbol" \
+ return [gdb_batch_check "python print(gdb.lookup_global_symbol)" \
"<built-in function lookup_global_symbol>"]
}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/util/testsuite_iterators.h b/gcc-4.9/libstdc++-v3/testsuite/util/testsuite_iterators.h
index c6905811c..6cf18b400 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/gcc-4.9/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -518,7 +518,7 @@ namespace __gnu_test
* It takes two pointers representing a range and presents them as
* a container of iterators.
*/
- template <class T, template<class T> class ItType>
+ template <class T, template<class TT> class ItType>
struct test_container
{
typename ItType<T>::ContainerType bounds;