aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-09 13:30:28 +0000
committergfunck <gfunck@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-09 13:30:28 +0000
commite28c9988512d315168bf66f40720b3b7fdb37677 (patch)
tree11ea58d57ce08b61a1c1c60aaa3b26179f576245
parent547e608e270a786ebda0196eb2275375e3da1fea (diff)
parent2edea8ecb216a98a3fc6dbaba7e24badd9325553 (diff)
Merge trunk version 221876 into gupc branch.gupc-5-0-branchpoint
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gupc@221948 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog8
-rw-r--r--MAINTAINERS2
-rw-r--r--gcc/ChangeLog239
-rw-r--r--gcc/ChangeLog.upc4
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/terminals.c4
-rw-r--r--gcc/cgraph.h2
-rw-r--r--gcc/cgraphclones.c5
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--gcc/config/aarch64/aarch64-builtins.c2
-rw-r--r--gcc/config/i386/i386.c17
-rw-r--r--gcc/config/i386/i386.md6
-rw-r--r--gcc/config/i386/linux-common.h7
-rw-r--r--gcc/config/i386/sync.md109
-rw-r--r--gcc/config/pa/pa.c43
-rw-r--r--gcc/config/rs6000/predicates.md3
-rw-r--r--gcc/config/rs6000/rs6000-c.c2
-rw-r--r--gcc/config/rs6000/rs6000.md6
-rw-r--r--gcc/config/s390/s390.c53
-rw-r--r--gcc/config/spu/spu-c.c5
-rw-r--r--gcc/cp/ChangeLog50
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/constexpr.c75
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/cp/lambda.c2
-rw-r--r--gcc/cp/name-lookup.c8
-rw-r--r--gcc/cp/pt.c10
-rw-r--r--gcc/cp/tree.c7
-rw-r--r--gcc/doc/invoke.texi13
-rw-r--r--gcc/expmed.c29
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-openmp.c16
-rw-r--r--gcc/go/gofrontend/expressions.cc10
-rw-r--r--gcc/go/gofrontend/types.cc6
-rw-r--r--gcc/ipa-chkp.c3
-rw-r--r--gcc/ipa-devirt.c3
-rw-r--r--gcc/ipa-icf.c14
-rw-r--r--gcc/ipa-inline-analysis.c6
-rw-r--r--gcc/ipa-inline-transform.c8
-rw-r--r--gcc/ipa-inline.c122
-rw-r--r--gcc/ipa-inline.h3
-rw-r--r--gcc/ipa-polymorphic-call.c65
-rw-r--r--gcc/ipa-prop.c14
-rw-r--r--gcc/ipa-split.c2
-rw-r--r--gcc/ipa-utils.h1
-rw-r--r--gcc/lra-int.h9
-rw-r--r--gcc/lra-remat.c10
-rw-r--r--gcc/lra.c8
-rw-r--r--gcc/lto-cgraph.c7
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/omp-low.c4
-rw-r--r--gcc/params.def2
-rw-r--r--gcc/reg-stack.c4
-rw-r--r--gcc/symtab.c3
-rw-r--r--gcc/testsuite/ChangeLog138
-rw-r--r--gcc/testsuite/c-c++-common/pr65556.c4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-fold1.C65
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-fold2.C30
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist93.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist94.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr57101.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr65398-2.C38
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/lambda-init13.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ23.C7
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr65557.C19
-rw-r--r--gcc/testsuite/g++.dg/template/pr65390.C12
-rw-r--r--gcc/testsuite/g++.dg/template/static36.C4
-rw-r--r--gcc/testsuite/g++.dg/torture/pr65626.C19
-rw-r--r--gcc/testsuite/g++.dg/torture/pr65655.C51
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr65610.C57
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-10.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-11.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-8.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-9.C15
-rw-r--r--gcc/testsuite/gcc.dg/20141029-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20150306-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inlinehint-4.c40
-rw-r--r--gcc/testsuite/gcc.dg/pr23623.c6
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr65624.c15
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45701-1.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45701-2.c5
-rw-r--r--gcc/testsuite/gcc.target/arm/pr65647.c58
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/mpx/pr65531.cc13
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr61977-1.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr61977-2.c8
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-1.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-10.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-11.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-12.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-13.c4
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-14.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-15.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-16.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-17.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-18.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-19.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-2.c4
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-21.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-22.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-23.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-24.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-25.c33
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-3.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-4.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-5.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-6.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-7.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-8.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-9.c2
-rw-r--r--gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c4
-rw-r--r--gcc/testsuite/lib/mpx-dg.exp8
-rw-r--r--gcc/tree-cfgcleanup.c19
-rw-r--r--gcc/tree-sra.c6
-rw-r--r--gcc/tree-ssa-live.c27
-rw-r--r--gcc/tree-vect-data-refs.c10
-rw-r--r--gcc/tree-vect-loop.c83
-rw-r--r--gcc/tree-vectorizer.h6
-rw-r--r--gcc/tree.c1
-rw-r--r--libcpp/ChangeLog5
-rw-r--r--libcpp/lex.c7
-rw-r--r--libgo/go/cmd/go/build.go9
-rw-r--r--libgo/go/cmd/go/pkg.go1
-rw-r--r--libgo/go/cmd/go/test.go9
-rw-r--r--libgo/runtime/chan.c1186
-rw-r--r--libgo/runtime/cpuprof.c350
-rw-r--r--libgo/runtime/lfstack.c76
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr65597.f9021
-rw-r--r--libmpx/ChangeLog8
-rw-r--r--libmpx/configure24
-rw-r--r--libmpx/configure.ac11
-rw-r--r--libmpx/libmpx.spec.in4
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver3
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/char/65630.cc34
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/65630.cc34
142 files changed, 1903 insertions, 1949 deletions
diff --git a/ChangeLog b/ChangeLog
index e2f1060151f..e32c3bc165d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-04-02 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * MAINTAINERS: Add myself as a reviewer for the AArch64 port.
+
+2015-04-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * MAINTAINERS: Add myself as an arm port reviewer.
+
2015-03-25 Martin Liska <mliska@suse.cz>
Yury Gribov <y.gribov@samsung.com>
diff --git a/MAINTAINERS b/MAINTAINERS
index 1ba590d4b8e..15c1b053b2c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -268,6 +268,8 @@ check in changes outside of the parts of the compiler they maintain.
Reviewers
+aarch64 port James Greenhalgh <james.greenhalgh@arm.com>
+arm port Kyrylo Tkachov <kyrylo.tkachov@arm.com>
C front end Marek Polacek <polacek@redhat.com>
dataflow Paolo Bonzini <bonzini@gnu.org>
dataflow Seongbae Park <seongbae.park@gmail.com>
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e3d2a3d2af6..f9cb04c39b4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,242 @@
+2015-04-05 Martin Liska <mliska@suse.cz>
+
+ PR ipa/65665
+ * ipa-icf.c (sem_function::equals_wpa): Verify that IPA CP
+ has computed data structure.
+ (sem_item_optimizer::update_hash_by_addr_refs): Likewise.
+
+2015-04-04 Jan Hubicka <hubicka@ucw.cz>
+
+ * invoke.texi (inline-unit-growth): Increase growth to 20%
+ * params.def (PARAM_INLINE_UNIT_GROWTH): Likewise.
+
+2015-04-04 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR target/65647
+ * lra-int.h (LRA_MAX_REMATERIALIZATION_PASSES): New. Add its
+ value checking.
+ (lra_rematerialization_iter): New.
+ * lra.c (lra): Initialize lra_rematerialization_iter.
+ Stop updating lra_constraint_new_regno_start after switching of
+ inheritance and rematerialization.
+ * lra-remat.c (lra_rematerialization_iter): New.
+ (lra_remat): Add printing pass iteration. Do rematerialization
+ only first LRA_MAX_REMATERIALIZATION_PASSES iterations.
+
+2015-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/64909
+ PR tree-optimization/65660
+ * tree-vectorizer.h (vect_get_known_peeling_cost): Adjust
+ to take a cost vector for scalar iteration cost.
+ (vect_get_single_scalar_iteration_cost): Likewise.
+ * tree-vect-loop.c (vect_get_single_scalar_iteration_cost):
+ Compute the scalar iteration cost into a cost vector.
+ (vect_get_known_peeling_cost): Use the scalar cost vector to
+ account for the cost of the peeled iterations.
+ (vect_estimate_min_profitable_iters): Likewise.
+ * tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost):
+ Likewise.
+
+2015-04-04 Alan Modra <amodra@gmail.com>
+
+ PR target/65576
+ PR target/65240
+ * config/rs6000/predicates.md (zero_reg_mem_operand): Exclude
+ 0.0 constant unless TARGET_VSX.
+ * config/rs6000/rs6000.md (extenddftf2_internal): Remove last
+ alternative.
+
+2015-04-03 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65648
+ * ipa-inline-transform.c (inline_call): Skip sanity check to work
+ around the ICE
+
+2015-04-03 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65655
+ * ipa-inline-analysis.c (edge_set_predicate): Do not redirect
+ speculative indirect edges to avoid ordering issue.
+
+2015-04-03 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65076
+ * ipa-inline.c (edge_badness): Add combined size to the denominator.
+
+2015-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ * omp-low.c (scan_omp_parallel, scan_omp_task, scan_omp_target): Set
+ TYPE_ARTIFICIAL on the .omp_data* types.
+
+2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ * cgraphunit.c (cgraph_node::expand_thunk): Don't expand
+ instrumentation thunks.
+
+2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ * config/i386/i386.c (ix86_expand_call): Avoid nested
+ PARALLEL in returned call value.
+
+2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ * lto-cgraph.c (input_cgraph_1): Always link instrumented
+ assembler name with original one.
+
+2015-04-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_register_priority): Use AX_REG.
+
+2015-04-02 Uros Bizjak <ubizjak@gmail.com>
+
+ Revert parts of r216820.
+ * config/i386/i386.md (movqi_internal): Correct type calculation
+ for alternatives 3 and 5.
+
+2015-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/61977
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Don't
+ predefine __vector/__bool/__pixel macros nor context sensitive
+ macros for CLK_ASM.
+ * config/spu/spu-c.c (spu_cpu_cpp_builtins): Similarly.
+
+2015-04-02 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_output_move_double): Directly handle register
+ indexed memory operand. Simplify handling of scaled register indexed
+ memory operands.
+
+2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR driver/65444
+ * config/i386/linux-common.h (MPX_SPEC): New.
+ (CHKP_SPEC): Add MPX_SPEC.
+ * doc/invoke.texi (-fcheck-pointer-boudns): Document
+ possible issues with '-z bndplt' support in linker.
+
+2015-04-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sync.md (UNSPEC_FILD_ATOMIC, UNSPEC_FIST_ATOMIC): New.
+ (loaddi_via_fpu): Use UNSPEC_FILD_ATOMIC.
+ (storedi_via_fpu): Use UNSPEC_FIST_ATOMIC.
+ * reg-stack.c (get_true_reg): Change UNSPEC_LDA to UNSPEC_FILD_ATOMIC.
+ (subst_stack_regs_pat): Change UNSPEC_STA to UNSPEC_FIST_ATOMIC.
+
+2015-04-01 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sync.md (UNSPEC_MOVA): Remove.
+ (atomic_load<mode>): Change operand 0 predicate to
+ nonimmediate_operand and fix up the destination when needed.
+ Use UNSPEC_LDA.
+ (atomic_loaddi_fpu): Use UNSPEC_LDA.
+ (atomic_store<mode>): Change operand 1 predicate to
+ nonimmendate_operand and move the source to register when needed.
+ Use UNSPEC_STA.
+ (atomic_store<mode>_1): Use UNSPEC_STA.
+ (atomic_storedi_fpu): Change operand 1 to nonimmediate_operand.
+ Fix moves from memory operand. Use UNSPEC_STA.
+
+2015-04-01 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * expmed.c (strict_volatile_bitfield_p): Check that the access will
+ not cross a MODESIZE boundary.
+ (store_bit_field, extract_bit_field): Added assertions in the
+ strict volatile bitfields code path.
+
+2015-04-01 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ PR target/65624
+ * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin):
+ Increase args array size by one to avoid buffer overflow.
+
+2015-03-31 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto-cgraph.c (lto_output_node, input_overwrite_node): Stream
+ split_part.
+ * ipa-inline.c (edge_badness): Add wrapper penalty.
+ (sum_callers): Move up.
+ (inline_small_functions): Set single_caller.
+ * ipa-inline.h (inline_summary): Add single_caller.
+ * ipa-split.c (split_function): Set split_part.
+ (cgraph_node::create_clone): Do not shadow decl; copy split_part.
+ * cgraph.h (cgraph_node): Add split_part.
+
+2015-03-31 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/58945
+ * config/i386/sync.md (atomic_compare_and_swap<dwi>_doubleword):
+ Do not split operands 0 and operands 2 to halfmode.
+ (atomic_compare_and_swap<mode>): Update for
+ atomic_compare_and_swap<dwi>_doubleword changes.
+
+2015-03-31 Jan Hubicka <hubicka@ucw.cz>
+
+ * tree.c (need_assembler_name_p): Artificial types have no ODR names.
+ * ipa-devirt.c (warn_odr): Do not try to apply ODR cache when
+ no caching is done.
+
+2015-03-31 Martin Liska <mliska@suse.cz>
+
+ PR ipa/65557
+ * ipa-icf.c (sem_function::equals_wpa): Check if IPA CP
+ has already filled up function summary.
+ (sem_item_optimizer::update_hash_by_addr_refs): Likewise.
+
+2015-03-31 Richard Biener <rguenther@suse.de>
+
+ * tree-sra.c (create_access_replacement): Drop under-/over-alignment
+ of types.
+
+2015-03-31 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * config/s390/s390.c (s390_function_num_hotpatch_hw): Allow hotpatching
+ nested functions.
+ (s390_reorg): Adapt to new signature of s390_function_num_hotpatch_hw.
+ (s390_asm_output_function_label): Adapt to new signature of
+ s390_function_num_hotpatch_hw
+ Optimise the code generating assembler output.
+ Add comments to assembler file.
+
+2015-03-31 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65626
+ * tree-cfgcleanup.c (fixup_noreturn_call): Only split the block
+ of the noreturn call so it is last and cleanup_control_flow_bb
+ can do the CFG part.
+
+2015-03-31 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR target/65531
+ * ipa-chkp.c (chkp_maybe_create_clone): Don't set
+ same_comdat_group for external symbols.
+ * symtab.c (symtab_node::verify_symtab_nodes): Avoid
+ infinite same_comdat_group traversal loop.
+
+2015-03-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR plugins/61176
+ * Makefile.in (install-plugin): Add all gcc/*.{h,def} files
+ automatically to $headers.
+
+2015-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/65610
+ * ipa-utils.h (inlined_polymorphic_ctor_dtor_block_p): Declare.
+ * ipa-polymorphic-call.c (inlined_polymorphic_ctor_dtor_block_p): New
+ function.
+ (decl_maybe_in_construction_p, noncall_stmt_may_be_vtbl_ptr_store):
+ Use it.
+ * ipa-prop.c (param_type_may_change_p): Likewise.
+ * tree-ssa-live.c: Include ipa-utils.h and its dependencies.
+ (remove_unused_scope_block_p): Add in_ctor_dtor_block
+ argument. Before inlining, preserve
+ inlined_polymorphic_ctor_dtor_block_p blocks and the outermost block
+ with FUNCTION_DECL BLOCK_ABSTRACT_ORIGIN inside of them. Adjust
+ recursive calls.
+ (remove_unused_locals): Adjust remove_unused_scope_block_p caller.
+
2015-03-27 Jan Hubicka <hubicka@ucw.cz>
PR ipa/65076
diff --git a/gcc/ChangeLog.upc b/gcc/ChangeLog.upc
index 402011ff678..0154a7f4c79 100644
--- a/gcc/ChangeLog.upc
+++ b/gcc/ChangeLog.upc
@@ -1,3 +1,7 @@
+2015-04-06 Gary Funck <gary@intrepid.com>
+
+ Merge trunk version 221876 into gupc branch.
+
2015-03-30 Gary Funck <gary@intrepid.com>
Merge trunk version 221770 into gupc branch.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 5cd2ffc6514..af7a80b189d 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20150330
+20150406
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 4a6f9cc56cd..66a06e25c9b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3262,7 +3262,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
# We keep the directory structure for files in config or c-family and .def
# files. All other files are flattened to a single directory.
$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
- headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
+ headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
for file in $$headers; do \
if [ -f $$file ] ; then \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e7c67496c82..8b9fbe5b65f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-31 Tom de Vries <tom@codesourcery.com>
+
+ PR ada/65490
+ * terminals.c (child_setup_tty): Fix warning 'argument to sizeof in
+ bzero call is the same expression as the destination'.
+
2015-03-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Deref>: New case.
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index a46e610fbb2..e44063b049d 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2008-2014, AdaCore *
+ * Copyright (C) 2008-2015, AdaCore *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -1263,7 +1263,7 @@ child_setup_tty (int fd)
int status;
/* ensure that s is filled with 0 */
- bzero (&s, sizeof (&s));
+ bzero (&s, sizeof (s));
/* Get the current terminal settings */
status = tcgetattr (fd, &s);
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 650e68921f3..cf8c7b64b9b 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1319,6 +1319,8 @@ public:
unsigned merged : 1;
/* True if function was created to be executed in parallel. */
unsigned parallelized_function : 1;
+ /* True if function is part split out by ipa-split. */
+ unsigned split_part : 1;
private:
/* Worker for call_for_symbol_and_aliases. */
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index c74017615fd..b587ff2cb76 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -437,7 +437,7 @@ cgraph_node::expand_all_artificial_thunks ()
node is not inlined. */
cgraph_node *
-cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
+cgraph_node::create_clone (tree new_decl, gcov_type gcov_count, int freq,
bool update_original,
vec<cgraph_edge *> redirect_callers,
bool call_duplication_hook,
@@ -449,7 +449,7 @@ cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
gcov_type count_scale;
unsigned i;
- new_node->decl = decl;
+ new_node->decl = new_decl;
new_node->register_symbol ();
new_node->origin = origin;
new_node->lto_file_data = lto_file_data;
@@ -476,6 +476,7 @@ cgraph_node::create_clone (tree decl, gcov_type gcov_count, int freq,
new_node->clone.tree_map = NULL;
new_node->clone.args_to_skip = args_to_skip;
+ new_node->split_part = split_part;
if (!args_to_skip)
new_node->clone.combined_args_to_skip = clone.combined_args_to_skip;
else if (clone.combined_args_to_skip)
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 8ac92e1c0c8..77ef9edba4a 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1508,6 +1508,10 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
tree thunk_fndecl = decl;
tree a;
+ /* Instrumentation thunk is the same function with
+ a different signature. Never need to expand it. */
+ if (thunk.add_pointer_bounds_args)
+ return false;
if (!force_gimple_thunk && this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index a9b330591eb..8a9fff8720d 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -1025,7 +1025,7 @@ aarch64_simd_expand_builtin (int fcode, tree exp, rtx target)
aarch64_simd_builtin_datum *d =
&aarch64_simd_builtin_data[fcode - AARCH64_SIMD_PATTERN_START];
enum insn_code icode = d->code;
- builtin_simd_arg args[SIMD_MAX_BUILTIN_ARGS];
+ builtin_simd_arg args[SIMD_MAX_BUILTIN_ARGS + 1];
int num_args = insn_data[d->code].n_operands;
int is_void = 0;
int k;
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b70dbd370a4..82a1c7def58 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -25639,8 +25639,19 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
{
rtx b0 = gen_rtx_REG (BND64mode, FIRST_BND_REG);
rtx b1 = gen_rtx_REG (BND64mode, FIRST_BND_REG + 1);
- retval = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (3, retval, b0, b1));
- chkp_put_regs_to_expr_list (retval);
+ if (GET_CODE (retval) == PARALLEL)
+ {
+ b0 = gen_rtx_EXPR_LIST (VOIDmode, b0, const0_rtx);
+ b1 = gen_rtx_EXPR_LIST (VOIDmode, b1, const0_rtx);
+ rtx par = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, b0, b1));
+ retval = chkp_join_splitted_slot (retval, par);
+ }
+ else
+ {
+ retval = gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (3, retval, b0, b1));
+ chkp_put_regs_to_expr_list (retval);
+ }
}
call = gen_rtx_SET (VOIDmode, retval, call);
@@ -41271,7 +41282,7 @@ ix86_register_priority (int hard_regno)
if (FIRST_REX_SSE_REG <= hard_regno && hard_regno <= LAST_REX_SSE_REG)
return 2;
/* Usage of AX register results in smaller code. Prefer it. */
- if (hard_regno == 0)
+ if (hard_regno == AX_REG)
return 4;
return 3;
}
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 1129b935a17..cf63afde16e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2533,9 +2533,7 @@
}
[(set_attr "isa" "*,*,*,*,*,*,*,*,*,*,avx512dq,avx512dq")
(set (attr "type")
- (cond [(eq_attr "alternative" "3,5")
- (const_string "imovx")
- (eq_attr "alternative" "7,8,9,10,11")
+ (cond [(eq_attr "alternative" "7,8,9,10,11")
(const_string "mskmov")
(and (eq_attr "alternative" "5")
(not (match_operand:QI 1 "aligned_operand")))
@@ -2546,6 +2544,8 @@
(ior (not (match_test "TARGET_PARTIAL_REG_STALL"))
(not (match_test "TARGET_QIMODE_MATH"))))
(const_string "imov")
+ (eq_attr "alternative" "3,5")
+ (const_string "imovx")
(and (match_test "TARGET_MOVX")
(eq_attr "alternative" "2"))
(const_string "imovx")
diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
index 9c6560b695f..dd79ec663e9 100644
--- a/gcc/config/i386/linux-common.h
+++ b/gcc/config/i386/linux-common.h
@@ -59,6 +59,11 @@ along with GCC; see the file COPYING3. If not see
%:include(libmpx.spec)%(link_libmpx)"
#endif
+#ifndef MPX_SPEC
+#define MPX_SPEC "\
+ %{mmpx:%{fcheck-pointer-bounds:%{!static:%:include(libmpx.spec)%(link_mpx)}}}"
+#endif
+
#ifndef LIBMPX_SPEC
#if defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBMPX_SPEC "\
@@ -89,5 +94,5 @@ along with GCC; see the file COPYING3. If not see
#ifndef CHKP_SPEC
#define CHKP_SPEC "\
-%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}"
+%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}" MPX_SPEC
#endif
diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md
index d95589007e8..61a2a819260 100644
--- a/gcc/config/i386/sync.md
+++ b/gcc/config/i386/sync.md
@@ -21,7 +21,11 @@
UNSPEC_LFENCE
UNSPEC_SFENCE
UNSPEC_MFENCE
- UNSPEC_MOVA ; For __atomic support
+
+ UNSPEC_FILD_ATOMIC
+ UNSPEC_FIST_ATOMIC
+
+ ;; __atomic support
UNSPEC_LDA
UNSPEC_STA
])
@@ -140,10 +144,10 @@
])
(define_expand "atomic_load<mode>"
- [(set (match_operand:ATOMIC 0 "register_operand")
+ [(set (match_operand:ATOMIC 0 "nonimmediate_operand")
(unspec:ATOMIC [(match_operand:ATOMIC 1 "memory_operand")
(match_operand:SI 2 "const_int_operand")]
- UNSPEC_MOVA))]
+ UNSPEC_LDA))]
""
{
/* For DImode on 32-bit, we can use the FPU to perform the load. */
@@ -152,14 +156,25 @@
(operands[0], operands[1],
assign_386_stack_local (DImode, SLOT_TEMP)));
else
- emit_move_insn (operands[0], operands[1]);
+ {
+ rtx dst = operands[0];
+
+ if (MEM_P (dst))
+ dst = gen_reg_rtx (<MODE>mode);
+
+ emit_move_insn (dst, operands[1]);
+
+ /* Fix up the destination if needed. */
+ if (dst != operands[0])
+ emit_move_insn (operands[0], dst);
+ }
DONE;
})
(define_insn_and_split "atomic_loaddi_fpu"
[(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,?r")
(unspec:DI [(match_operand:DI 1 "memory_operand" "m,m,m")]
- UNSPEC_MOVA))
+ UNSPEC_LDA))
(clobber (match_operand:DI 2 "memory_operand" "=X,X,m"))
(clobber (match_scratch:DF 3 "=X,xf,xf"))]
"!TARGET_64BIT && (TARGET_80387 || TARGET_SSE)"
@@ -197,9 +212,9 @@
(define_expand "atomic_store<mode>"
[(set (match_operand:ATOMIC 0 "memory_operand")
- (unspec:ATOMIC [(match_operand:ATOMIC 1 "register_operand")
+ (unspec:ATOMIC [(match_operand:ATOMIC 1 "nonimmediate_operand")
(match_operand:SI 2 "const_int_operand")]
- UNSPEC_MOVA))]
+ UNSPEC_STA))]
""
{
enum memmodel model = (enum memmodel) (INTVAL (operands[2]) & MEMMODEL_MASK);
@@ -215,6 +230,8 @@
}
else
{
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+
/* For seq-cst stores, when we lack MFENCE, use XCHG. */
if (model == MEMMODEL_SEQ_CST && !(TARGET_64BIT || TARGET_SSE2))
{
@@ -238,14 +255,14 @@
[(set (match_operand:SWI 0 "memory_operand" "=m")
(unspec:SWI [(match_operand:SWI 1 "<nonmemory_operand>" "<r><i>")
(match_operand:SI 2 "const_int_operand")]
- UNSPEC_MOVA))]
+ UNSPEC_STA))]
""
"%K2mov{<imodesuffix>}\t{%1, %0|%0, %1}")
(define_insn_and_split "atomic_storedi_fpu"
[(set (match_operand:DI 0 "memory_operand" "=m,m,m")
- (unspec:DI [(match_operand:DI 1 "register_operand" "x,m,?r")]
- UNSPEC_MOVA))
+ (unspec:DI [(match_operand:DI 1 "nonimmediate_operand" "x,m,?r")]
+ UNSPEC_STA))
(clobber (match_operand:DI 2 "memory_operand" "=X,X,m"))
(clobber (match_scratch:DF 3 "=X,xf,xf"))]
"!TARGET_64BIT && (TARGET_80387 || TARGET_SSE)"
@@ -273,7 +290,7 @@
else
{
adjust_reg_mode (tmp, DImode);
- emit_move_insn (tmp, mem);
+ emit_move_insn (tmp, src);
src = tmp;
}
}
@@ -288,7 +305,8 @@
(define_insn "loaddi_via_fpu"
[(set (match_operand:DF 0 "register_operand" "=f")
- (unspec:DF [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_LDA))]
+ (unspec:DF [(match_operand:DI 1 "memory_operand" "m")]
+ UNSPEC_FILD_ATOMIC))]
"TARGET_80387"
"fild%Z1\t%1"
[(set_attr "type" "fmov")
@@ -297,7 +315,8 @@
(define_insn "storedi_via_fpu"
[(set (match_operand:DI 0 "memory_operand" "=m")
- (unspec:DI [(match_operand:DF 1 "register_operand" "f")] UNSPEC_STA))]
+ (unspec:DI [(match_operand:DF 1 "register_operand" "f")]
+ UNSPEC_FIST_ATOMIC))]
"TARGET_80387"
{
gcc_assert (find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != NULL_RTX);
@@ -351,21 +370,12 @@
else
{
machine_mode hmode = <CASHMODE>mode;
- rtx lo_o, lo_e, lo_n, hi_o, hi_e, hi_n;
-
- lo_o = operands[1];
- lo_e = operands[3];
- lo_n = operands[4];
- hi_o = gen_highpart (hmode, lo_o);
- hi_e = gen_highpart (hmode, lo_e);
- hi_n = gen_highpart (hmode, lo_n);
- lo_o = gen_lowpart (hmode, lo_o);
- lo_e = gen_lowpart (hmode, lo_e);
- lo_n = gen_lowpart (hmode, lo_n);
emit_insn
(gen_atomic_compare_and_swap<mode>_doubleword
- (lo_o, hi_o, operands[2], lo_e, hi_e, lo_n, hi_n, operands[6]));
+ (operands[1], operands[2], operands[3],
+ gen_lowpart (hmode, operands[4]), gen_highpart (hmode, operands[4]),
+ operands[6]));
}
ix86_expand_setcc (operands[0], EQ, gen_rtx_REG (CCZmode, FLAGS_REG),
@@ -373,6 +383,28 @@
DONE;
})
+;; For double-word compare and swap, we are obliged to play tricks with
+;; the input newval (op3:op4) because the Intel register numbering does
+;; not match the gcc register numbering, so the pair must be CX:BX.
+
+(define_mode_attr doublemodesuffix [(SI "8") (DI "16")])
+
+(define_insn "atomic_compare_and_swap<dwi>_doubleword"
+ [(set (match_operand:<DWI> 0 "register_operand" "=A")
+ (unspec_volatile:<DWI>
+ [(match_operand:<DWI> 1 "memory_operand" "+m")
+ (match_operand:<DWI> 2 "register_operand" "0")
+ (match_operand:DWIH 3 "register_operand" "b")
+ (match_operand:DWIH 4 "register_operand" "c")
+ (match_operand:SI 5 "const_int_operand")]
+ UNSPECV_CMPXCHG))
+ (set (match_dup 1)
+ (unspec_volatile:<DWI> [(const_int 0)] UNSPECV_CMPXCHG))
+ (set (reg:CCZ FLAGS_REG)
+ (unspec_volatile:CCZ [(const_int 0)] UNSPECV_CMPXCHG))]
+ "TARGET_CMPXCHG<doublemodesuffix>B"
+ "lock{%;} %K5cmpxchg<doublemodesuffix>b\t%1")
+
(define_insn "atomic_compare_and_swap<mode>_1"
[(set (match_operand:SWI 0 "register_operand" "=a")
(unspec_volatile:SWI
@@ -388,33 +420,6 @@
"TARGET_CMPXCHG"
"lock{%;} %K4cmpxchg{<imodesuffix>}\t{%3, %1|%1, %3}")
-;; For double-word compare and swap, we are obliged to play tricks with
-;; the input newval (op5:op6) because the Intel register numbering does
-;; not match the gcc register numbering, so the pair must be CX:BX.
-;; That said, in order to take advantage of possible lower-subreg opts,
-;; treat all of the integral operands in the same way.
-
-(define_mode_attr doublemodesuffix [(SI "8") (DI "16")])
-
-(define_insn "atomic_compare_and_swap<dwi>_doubleword"
- [(set (match_operand:DWIH 0 "register_operand" "=a")
- (unspec_volatile:DWIH
- [(match_operand:<DWI> 2 "memory_operand" "+m")
- (match_operand:DWIH 3 "register_operand" "0")
- (match_operand:DWIH 4 "register_operand" "1")
- (match_operand:DWIH 5 "register_operand" "b")
- (match_operand:DWIH 6 "register_operand" "c")
- (match_operand:SI 7 "const_int_operand")]
- UNSPECV_CMPXCHG))
- (set (match_operand:DWIH 1 "register_operand" "=d")
- (unspec_volatile:DWIH [(const_int 0)] UNSPECV_CMPXCHG))
- (set (match_dup 2)
- (unspec_volatile:<DWI> [(const_int 0)] UNSPECV_CMPXCHG))
- (set (reg:CCZ FLAGS_REG)
- (unspec_volatile:CCZ [(const_int 0)] UNSPECV_CMPXCHG))]
- "TARGET_CMPXCHG<doublemodesuffix>B"
- "lock{%;} %K7cmpxchg<doublemodesuffix>b\t%2")
-
;; For operand 2 nonmemory_operand predicate is used instead of
;; register_operand to allow combiner to better optimize atomic
;; additions of constants.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 2f2735c7c44..d5b0c5081a8 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -2595,28 +2595,29 @@ pa_output_move_double (rtx *operands)
&& GET_CODE (XEXP (addr, 0)) == MULT)
{
rtx xoperands[4];
- rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0);
- if (!reg_overlap_mentioned_p (high_reg, addr))
- {
- xoperands[0] = high_reg;
- xoperands[1] = XEXP (addr, 1);
- xoperands[2] = XEXP (XEXP (addr, 0), 0);
- xoperands[3] = XEXP (XEXP (addr, 0), 1);
- output_asm_insn ("{sh%O3addl %2,%1,%0|shladd,l %2,%O3,%1,%0}",
- xoperands);
- return "ldw 4(%0),%R0\n\tldw 0(%0),%0";
- }
- else
- {
- xoperands[0] = high_reg;
- xoperands[1] = XEXP (addr, 1);
- xoperands[2] = XEXP (XEXP (addr, 0), 0);
- xoperands[3] = XEXP (XEXP (addr, 0), 1);
- output_asm_insn ("{sh%O3addl %2,%1,%R0|shladd,l %2,%O3,%1,%R0}",
- xoperands);
- return "ldw 0(%R0),%0\n\tldw 4(%R0),%R0";
- }
+ /* Load address into left half of destination register. */
+ xoperands[0] = gen_rtx_SUBREG (SImode, operands[0], 0);
+ xoperands[1] = XEXP (addr, 1);
+ xoperands[2] = XEXP (XEXP (addr, 0), 0);
+ xoperands[3] = XEXP (XEXP (addr, 0), 1);
+ output_asm_insn ("{sh%O3addl %2,%1,%0|shladd,l %2,%O3,%1,%0}",
+ xoperands);
+ return "ldw 4(%0),%R0\n\tldw 0(%0),%0";
+ }
+ else if (GET_CODE (addr) == PLUS
+ && REG_P (XEXP (addr, 0))
+ && REG_P (XEXP (addr, 1)))
+ {
+ rtx xoperands[3];
+
+ /* Load address into left half of destination register. */
+ xoperands[0] = gen_rtx_SUBREG (SImode, operands[0], 0);
+ xoperands[1] = XEXP (addr, 0);
+ xoperands[2] = XEXP (addr, 1);
+ output_asm_insn ("{addl|add,l} %1,%2,%0",
+ xoperands);
+ return "ldw 4(%0),%R0\n\tldw 0(%0),%0";
}
}
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 6abb40b5cff..3c8dfe6032d 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -964,7 +964,8 @@
;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand.
(define_predicate "zero_reg_mem_operand"
- (ior (match_operand 0 "zero_fp_constant")
+ (ior (and (match_test "TARGET_VSX")
+ (match_operand 0 "zero_fp_constant"))
(match_operand 0 "reg_or_mem_operand")))
;; Return 1 if the operand is a CONST_INT and it is the element for 64-bit
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 10071996e96..9f22b4c428f 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -420,7 +420,7 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
if (TARGET_FRSQRTES)
builtin_define ("__RSQRTEF__");
- if (TARGET_EXTRA_BUILTINS)
+ if (TARGET_EXTRA_BUILTINS && cpp_get_options (pfile)->lang != CLK_ASM)
{
/* Define the AltiVec syntactic elements. */
builtin_define ("__vector=__attribute__((altivec(vector__)))");
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index da962877057..5025e6080a3 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8369,9 +8369,9 @@
})
(define_insn_and_split "*extenddftf2_internal"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,ws,d,&d,r")
- (float_extend:TF (match_operand:DF 1 "input_operand" "d,r,md,md,md,rm")))
- (use (match_operand:DF 2 "zero_reg_mem_operand" "d,r,j,m,d,n"))]
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,ws,d,&d")
+ (float_extend:TF (match_operand:DF 1 "input_operand" "d,r,md,md,md")))
+ (use (match_operand:DF 2 "zero_reg_mem_operand" "d,r,j,m,d"))]
"!TARGET_IEEEQUAD
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& TARGET_LONG_DOUBLE_128"
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index d2b87046b3a..7d16048db8e 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5234,21 +5234,18 @@ print_shift_count_operand (FILE *file, rtx op)
fprintf (file, "(%s)", reg_names[REGNO (base)]);
}
-/* Returns false if the function should not be made hotpatchable.
- Otherwise it assigns the number of NOP halfwords to be emitted
- before and after the function label to hw_before and hw_after.
- Both must not be NULL. */
+/* Assigns the number of NOP halfwords to be emitted before and after the
+ function label to *HW_BEFORE and *HW_AFTER. Both pointers must not be NULL.
+ If hotpatching is disabled for the function, the values are set to zero.
+*/
-static bool
+static void
s390_function_num_hotpatch_hw (tree decl,
int *hw_before,
int *hw_after)
{
tree attr;
- *hw_before = 0;
- *hw_after = 0;
-
attr = lookup_attribute ("hotpatch", DECL_ATTRIBUTES (decl));
/* Handle the arguments of the hotpatch attribute. The values
@@ -5267,18 +5264,6 @@ s390_function_num_hotpatch_hw (tree decl,
*hw_before = s390_hotpatch_hw_before_label;
*hw_after = s390_hotpatch_hw_after_label;
}
-
- if (*hw_before == 0 && *hw_after == 0)
- return false;
-
- if (decl_function_context (decl) != NULL_TREE)
- {
- warning_at (DECL_SOURCE_LOCATION (decl), OPT_mhotpatch_,
- "hotpatching is not compatible with nested functions");
- return false;
- }
-
- return true;
}
/* Write the extra assembler code needed to declare a function properly. */
@@ -5288,12 +5273,9 @@ s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
tree decl)
{
int hw_before, hw_after;
- bool hotpatch_p = (decl
- ? s390_function_num_hotpatch_hw (decl,
- &hw_before, &hw_after)
- : false);
- if (hotpatch_p)
+ s390_function_num_hotpatch_hw (decl, &hw_before, &hw_after);
+ if (hw_before > 0)
{
unsigned int function_alignment;
int i;
@@ -5301,22 +5283,35 @@ s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
/* Add a trampoline code area before the function label and initialize it
with two-byte nop instructions. This area can be overwritten with code
that jumps to a patched version of the function. */
- for (i = 0; i < hw_before; i++)
- asm_fprintf (asm_out_file, "\tnopr\t%%r7\n");
+ asm_fprintf (asm_out_file, "\tnopr\t%%r7"
+ "\t# pre-label NOPs for hotpatch (%d halfwords)\n",
+ hw_before);
+ for (i = 1; i < hw_before; i++)
+ fputs ("\tnopr\t%r7\n", asm_out_file);
+
/* Note: The function label must be aligned so that (a) the bytes of the
following nop do not cross a cacheline boundary, and (b) a jump address
(eight bytes for 64 bit targets, 4 bytes for 32 bit targets) can be
stored directly before the label without crossing a cacheline
boundary. All this is necessary to make sure the trampoline code can
- be changed atomically. */
+ be changed atomically.
+ This alignment is done automatically using the FOUNCTION_BOUNDARY, but
+ if there are NOPs before the function label, the alignment is placed
+ before them. So it is necessary to duplicate the alignment after the
+ NOPs. */
function_alignment = MAX (8, DECL_ALIGN (decl) / BITS_PER_UNIT);
if (! DECL_USER_ALIGN (decl))
function_alignment = MAX (function_alignment,
(unsigned int) align_functions);
+ fputs ("\t# alignment for hotpatch\n", asm_out_file);
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (function_alignment));
}
ASM_OUTPUT_LABEL (asm_out_file, fname);
+ if (hw_after > 0)
+ asm_fprintf (asm_out_file,
+ "\t# post-label NOPs for hotpatch (%d halfwords)\n",
+ hw_after);
}
/* Output machine-dependent UNSPECs occurring in address constant X
@@ -11491,7 +11486,7 @@ s390_reorg (void)
{
rtx_insn *insn;
- /* Inject nops for hotpatching. */
+ /* Insert NOPs for hotpatching. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG)
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index 739fa67127e..03b818c4a31 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -203,7 +203,8 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
cpp_assert (pfile, "machine=spu");
if (spu_arch == PROCESSOR_CELLEDP)
cpp_define (pfile, "__SPU_EDP__");
- cpp_define (pfile, "__vector=__attribute__((__spu_vector__))");
+ if (cpp_get_options (pfile)->lang != CLK_ASM)
+ cpp_define (pfile, "__vector=__attribute__((__spu_vector__))");
switch (spu_ea_model)
{
case 32:
@@ -216,7 +217,7 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
gcc_unreachable ();
}
- if (!flag_iso)
+ if (!flag_iso && cpp_get_options (pfile)->lang != CLK_ASM)
{
/* Define this when supporting context-sensitive keywords. */
cpp_define (pfile, "__VECTOR_KEYWORD_SUPPORTED__");
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a9f872dc5e1..b84f3374618 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,53 @@
+2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/64085
+ * lambda.c (add_capture): Use dependent_type_p for capture by
+ reference too.
+
+2015-04-02 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65642
+ * constexpr.c (cxx_eval_pointer_plus_expression): Call
+ cxx_eval_constant_expression on the first operand.
+
+2015-04-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/65625
+ * decl.c (make_typename_type): Handle seeing a variable template.
+
+2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56100
+ * pt.c (instantiating_current_function_p): New.
+ * name-lookup.c (pushdecl_maybe_friend_1): Use it.
+ * cp-tree.h (instantiating_current_function_p): Declare.
+
+2015-04-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/65646
+ * decl.c (grokvardecl): Don't call check_explicit_specialization
+ for non-template members of a class template.
+
+2015-04-01 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65554
+ * class.c (finish_struct): Require that the second field of a
+ user-defined initializer_list be of size type.
+
+2015-03-31 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65390
+ * tree.c (build_cplus_array_type): Use dependent_type_p rather than
+ checking for constness.
+
+2015-03-30 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65398
+ * constexpr.c (cxx_fold_indirect_ref): Don't perform the
+ *(&A[i] p+ j) => A[i + j] transformation here.
+ (cxx_eval_pointer_plus_expression): New function.
+ (cxx_eval_constant_expression): Use it here.
+
2015-03-27 Tobias Burnus <burnus@net-b.de>
PR c/65586
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c2d420190c4..9f189fb5eaf 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6891,7 +6891,7 @@ finish_struct (tree t, tree attributes)
if (f && TREE_CODE (TREE_TYPE (f)) == POINTER_TYPE)
{
f = next_initializable_field (DECL_CHAIN (f));
- if (f && TREE_CODE (TREE_TYPE (f)) == INTEGER_TYPE)
+ if (f && same_type_p (TREE_TYPE (f), size_type_node))
ok = true;
}
}
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 2f094721546..f5be8dfb46c 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -2427,27 +2427,6 @@ cxx_fold_indirect_ref (location_t loc, tree type, tree op0, bool *empty_base)
break;
}
}
- /* *(&A[i] p+ j) => A[i + j] */
- else if (TREE_CODE (op00) == ARRAY_REF
- && TREE_CODE (TREE_OPERAND (op00, 1)) == INTEGER_CST
- && TREE_CODE (op01) == INTEGER_CST)
- {
- tree t = fold_convert_loc (loc, ssizetype,
- TREE_OPERAND (op00, 1));
- tree nelts
- = array_type_nelts_top (TREE_TYPE (TREE_OPERAND (op00, 0)));
- /* Don't fold an out-of-bound access. */
- if (!tree_int_cst_le (t, nelts))
- return NULL_TREE;
- /* Make sure to treat the second operand of POINTER_PLUS_EXPR
- as signed. */
- op01 = fold_build2_loc (loc, EXACT_DIV_EXPR, ssizetype,
- cp_fold_convert (ssizetype, op01),
- TYPE_SIZE_UNIT (type));
- t = size_binop_loc (loc, PLUS_EXPR, op01, t);
- return build4_loc (loc, ARRAY_REF, type, TREE_OPERAND (op00, 0),
- t, NULL_TREE, NULL_TREE);
- }
}
}
/* *(foo *)fooarrptr => (*fooarrptr)[0] */
@@ -2942,6 +2921,54 @@ cxx_eval_switch_expr (const constexpr_ctx *ctx, tree t,
return NULL_TREE;
}
+/* Subroutine of cxx_eval_constant_expression.
+ Attempt to reduce a POINTER_PLUS_EXPR expression T. */
+
+static tree
+cxx_eval_pointer_plus_expression (const constexpr_ctx *ctx, tree t,
+ bool lval, bool *non_constant_p,
+ bool *overflow_p)
+{
+ tree op00 = TREE_OPERAND (t, 0);
+ tree op01 = TREE_OPERAND (t, 1);
+ location_t loc = EXPR_LOCATION (t);
+
+ op00 = cxx_eval_constant_expression (ctx, op00, lval,
+ non_constant_p, overflow_p);
+
+ STRIP_NOPS (op00);
+ if (TREE_CODE (op00) != ADDR_EXPR)
+ return NULL_TREE;
+
+ op00 = TREE_OPERAND (op00, 0);
+
+ /* &A[i] p+ j => &A[i + j] */
+ if (TREE_CODE (op00) == ARRAY_REF
+ && TREE_CODE (TREE_OPERAND (op00, 1)) == INTEGER_CST
+ && TREE_CODE (op01) == INTEGER_CST)
+ {
+ tree type = TREE_TYPE (op00);
+ t = fold_convert_loc (loc, ssizetype, TREE_OPERAND (op00, 1));
+ tree nelts = array_type_nelts_top (TREE_TYPE (TREE_OPERAND (op00, 0)));
+ /* Don't fold an out-of-bound access. */
+ if (!tree_int_cst_le (t, nelts))
+ return NULL_TREE;
+ /* Make sure to treat the second operand of POINTER_PLUS_EXPR
+ as signed. */
+ op01 = fold_build2_loc (loc, EXACT_DIV_EXPR, ssizetype,
+ cp_fold_convert (ssizetype, op01),
+ TYPE_SIZE_UNIT (type));
+ t = size_binop_loc (loc, PLUS_EXPR, op01, t);
+ t = build4_loc (loc, ARRAY_REF, type, TREE_OPERAND (op00, 0),
+ t, NULL_TREE, NULL_TREE);
+ t = cp_build_addr_expr (t, tf_warning_or_error);
+ return cxx_eval_constant_expression (ctx, t, lval, non_constant_p,
+ overflow_p);
+ }
+
+ return NULL_TREE;
+}
+
/* Attempt to reduce the expression T to a constant value.
On failure, issue diagnostic and return error_mark_node. */
/* FIXME unify with c_fully_fold */
@@ -3247,6 +3274,12 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
break;
case POINTER_PLUS_EXPR:
+ r = cxx_eval_pointer_plus_expression (ctx, t, lval, non_constant_p,
+ overflow_p);
+ if (r)
+ break;
+ /* else fall through */
+
case PLUS_EXPR:
case MINUS_EXPR:
case MULT_EXPR:
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 48d2aa8e70d..2a904a5f4f4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5732,6 +5732,7 @@ extern tree get_mostly_instantiated_function_type (tree);
extern bool problematic_instantiation_changed (void);
extern void record_last_problematic_instantiation (void);
extern struct tinst_level *current_instantiation(void);
+extern bool instantiating_current_function_p (void);
extern tree maybe_get_template_decl_from_type_decl (tree);
extern int processing_template_parmlist;
extern bool dependent_type_p (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f05aefaddfb..c4731ae2416 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3480,9 +3480,9 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
name = TREE_OPERAND (name, 0);
- if (TREE_CODE (name) == TEMPLATE_DECL)
+ if (DECL_TYPE_TEMPLATE_P (name))
name = TREE_OPERAND (fullname, 0) = DECL_NAME (name);
- else if (TREE_CODE (name) == OVERLOAD)
+ if (TREE_CODE (name) != IDENTIFIER_NODE)
{
if (complain & tf_error)
error ("%qD is not a type", name);
@@ -8210,7 +8210,9 @@ grokvardecl (tree type,
DECL_INTERFACE_KNOWN (decl) = 1;
// Handle explicit specializations and instantiations of variable templates.
- if (orig_declarator)
+ if (orig_declarator
+ /* For GCC 5 fix 65646 this way. */
+ && current_tmpl_spec_kind (template_count) != tsk_none)
decl = check_explicit_specialization (orig_declarator, decl,
template_count, 0);
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index b160c8cb7ae..dd1c2d4337a 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -506,7 +506,7 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
if (by_reference_p)
{
type = build_reference_type (type);
- if (!real_lvalue_p (initializer))
+ if (!dependent_type_p (type) && !real_lvalue_p (initializer))
error ("cannot capture %qE by reference", initializer);
}
else
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 4303ed5fb1f..e3f7cca4436 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -973,9 +973,8 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
/* If this is a locally defined typedef in a function that
is not a template instantation, record it to implement
-Wunused-local-typedefs. */
- if (current_instantiation () == NULL
- || (current_instantiation ()->decl != current_function_decl))
- record_locally_defined_typedef (x);
+ if (!instantiating_current_function_p ())
+ record_locally_defined_typedef (x);
}
/* Multiple external decls of the same identifier ought to match.
@@ -1277,7 +1276,8 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
old and new decls are type decls. */
|| (TREE_CODE (oldglobal) == TYPE_DECL
&& (!DECL_ARTIFICIAL (oldglobal)
- || TREE_CODE (x) == TYPE_DECL))))
+ || TREE_CODE (x) == TYPE_DECL)))
+ && !instantiating_current_function_p ())
/* XXX shadow warnings in outer-more namespaces */
{
if (warning_at (input_location, OPT_Wshadow,
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c649cad75bd..28a85ebeeb7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20773,6 +20773,16 @@ current_instantiation (void)
return current_tinst_level;
}
+/* Return TRUE if current_function_decl is being instantiated, false
+ otherwise. */
+
+bool
+instantiating_current_function_p (void)
+{
+ return (current_instantiation ()
+ && current_instantiation ()->decl == current_function_decl);
+}
+
/* [temp.param] Check that template non-type parm TYPE is of an allowable
type. Return zero for ok, nonzero for disallowed. Issue error and
warning messages under control of COMPLAIN. */
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index e4cd39f8ad4..f31c5f4a68a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -822,10 +822,9 @@ build_cplus_array_type (tree elt_type, tree index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- bool dependent
- = (processing_template_decl
- && (dependent_type_p (elt_type)
- || (index_type && !TREE_CONSTANT (TYPE_MAX_VALUE (index_type)))));
+ bool dependent = (processing_template_decl
+ && (dependent_type_p (elt_type)
+ || (index_type && dependent_type_p (index_type))));
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
/* Start with an array of the TYPE_MAIN_VARIANT. */
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index bf8afadfb94..22710932a66 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -5857,7 +5857,16 @@ MPX-based instrumentation requires
a runtime library to enable MPX in hardware and handle bounds
violation signals. By default when @option{-fcheck-pointer-bounds}
and @option{-mmpx} options are used to link a program, the GCC driver
-links against the @file{libmpx} runtime library. MPX-based instrumentation
+links against the @file{libmpx} runtime library and @file{libmpxwrappers}
+library. It also passes '-z bndplt' to a linker in case it supports this
+option (which is checked on libmpx configuration). Note that old versions
+of linker may ignore option. Gold linker doesn't support '-z bndplt'
+option. With no '-z bndplt' support in linker all calls to dynamic libraries
+lose passed bounds reducing overall protection level. It's highly
+recommended to use linker with '-z bndplt' support. In case such linker
+is not available it is adviced to always use @option{-static-libmpxwrappers}
+for better protection level or use @option{-static} to completely avoid
+external calls to dynamic libraries. MPX-based instrumentation
may be used for debugging and also may be included in production code
to increase program security. Depending on usage, you may
have different requirements for the runtime library. The current version
@@ -10191,7 +10200,7 @@ before applying @option{--param inline-unit-growth}. The default is 10000.
@item inline-unit-growth
Specifies maximal overall growth of the compilation unit caused by inlining.
-The default value is 15 which limits unit growth to 1.15 times the original
+The default value is 20 which limits unit growth to 1.2 times the original
size. Cold functions (either marked cold via an attribute or by profile
feedback) are not accounted into the unit size.
diff --git a/gcc/expmed.c b/gcc/expmed.c
index e0b2619034d..6327629d458 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -472,9 +472,13 @@ strict_volatile_bitfield_p (rtx op0, unsigned HOST_WIDE_INT bitsize,
return false;
/* Check for cases of unaligned fields that must be split. */
- if (bitnum % BITS_PER_UNIT + bitsize > modesize
- || (STRICT_ALIGNMENT
- && bitnum % GET_MODE_ALIGNMENT (fieldmode) + bitsize > modesize))
+ if (bitnum % modesize + bitsize > modesize)
+ return false;
+
+ /* The memory must be sufficiently aligned for a MODESIZE access.
+ This condition guarantees, that the memory access will not
+ touch anything after the end of the structure. */
+ if (MEM_ALIGN (op0) < modesize)
return false;
/* Check for cases where the C++ memory model applies. */
@@ -973,13 +977,15 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if (strict_volatile_bitfield_p (str_rtx, bitsize, bitnum, fieldmode,
bitregion_start, bitregion_end))
{
- /* Storing any naturally aligned field can be done with a simple
- store. For targets that support fast unaligned memory, any
- naturally sized, unit aligned field can be done directly. */
+ /* Storing of a full word can be done with a simple store.
+ We know here that the field can be accessed with one single
+ instruction. For targets that support unaligned memory,
+ an unaligned access may be necessary. */
if (bitsize == GET_MODE_BITSIZE (fieldmode))
{
str_rtx = adjust_bitfield_address (str_rtx, fieldmode,
bitnum / BITS_PER_UNIT);
+ gcc_assert (bitnum % BITS_PER_UNIT == 0);
emit_move_insn (str_rtx, value);
}
else
@@ -988,6 +994,7 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
str_rtx = narrow_bit_field_mem (str_rtx, fieldmode, bitsize, bitnum,
&bitnum);
+ gcc_assert (bitnum + bitsize <= GET_MODE_BITSIZE (fieldmode));
temp = copy_to_reg (str_rtx);
if (!store_bit_field_1 (temp, bitsize, bitnum, 0, 0,
fieldmode, value, true))
@@ -1790,17 +1797,21 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if (strict_volatile_bitfield_p (str_rtx, bitsize, bitnum, mode1, 0, 0))
{
- /* Extraction of a full MODE1 value can be done with a load as long as
- the field is on a byte boundary and is sufficiently aligned. */
- if (bitsize == GET_MODE_BITSIZE(mode1))
+ /* Extraction of a full MODE1 value can be done with a simple load.
+ We know here that the field can be accessed with one single
+ instruction. For targets that support unaligned memory,
+ an unaligned access may be necessary. */
+ if (bitsize == GET_MODE_BITSIZE (mode1))
{
rtx result = adjust_bitfield_address (str_rtx, mode1,
bitnum / BITS_PER_UNIT);
+ gcc_assert (bitnum % BITS_PER_UNIT == 0);
return convert_extracted_bit_field (result, mode, tmode, unsignedp);
}
str_rtx = narrow_bit_field_mem (str_rtx, mode1, bitsize, bitnum,
&bitnum);
+ gcc_assert (bitnum + bitsize <= GET_MODE_BITSIZE (mode1));
str_rtx = copy_to_reg (str_rtx);
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fb3a83d83d3..7bba9d402d6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/65597
+ * trans-openmp.c (gfc_trans_omp_do): For !simple simd with explicit
+ linear clause for the iterator set OMP_CLAUSE_LINEAR_NO_COPYIN.
+ For implcitly added !simple OMP_CLAUSE_LINEAR set it too. Use step 1
+ instead of the original step on the new iterator - count.
+
2015-03-25 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/64952
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 8da55d3b467..9642a7d6b29 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -3255,6 +3255,19 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
inits.safe_push (e);
}
+ if (dovar_found == 2
+ && op == EXEC_OMP_SIMD
+ && collapse == 1
+ && !simple)
+ {
+ for (tmp = omp_clauses; tmp; tmp = OMP_CLAUSE_CHAIN (tmp))
+ if (OMP_CLAUSE_CODE (tmp) == OMP_CLAUSE_LINEAR
+ && OMP_CLAUSE_DECL (tmp) == dovar)
+ {
+ OMP_CLAUSE_LINEAR_NO_COPYIN (tmp) = 1;
+ break;
+ }
+ }
if (!dovar_found)
{
if (op == EXEC_OMP_SIMD)
@@ -3263,6 +3276,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
{
tmp = build_omp_clause (input_location, OMP_CLAUSE_LINEAR);
OMP_CLAUSE_LINEAR_STEP (tmp) = step;
+ OMP_CLAUSE_LINEAR_NO_COPYIN (tmp) = 1;
}
else
tmp = build_omp_clause (input_location, OMP_CLAUSE_LASTPRIVATE);
@@ -3330,7 +3344,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
else if (collapse == 1)
{
tmp = build_omp_clause (input_location, OMP_CLAUSE_LINEAR);
- OMP_CLAUSE_LINEAR_STEP (tmp) = step;
+ OMP_CLAUSE_LINEAR_STEP (tmp) = build_int_cst (type, 1);
OMP_CLAUSE_LINEAR_NO_COPYIN (tmp) = 1;
OMP_CLAUSE_LINEAR_NO_COPYOUT (tmp) = 1;
}
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 0cb0938fda1..40d9aa7726b 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -7959,7 +7959,10 @@ Builtin_call_expression::do_check_types(Gogo*)
Type* arg1_type = args->front()->type();
Type* arg2_type = args->back()->type();
if (arg1_type->is_error() || arg2_type->is_error())
- break;
+ {
+ this->set_is_error();
+ break;
+ }
Type* e1;
if (arg1_type->is_slice_type())
@@ -8001,7 +8004,10 @@ Builtin_call_expression::do_check_types(Gogo*)
}
if (args->front()->type()->is_error()
|| args->back()->type()->is_error())
- break;
+ {
+ this->set_is_error();
+ break;
+ }
Array_type* at = args->front()->type()->array_type();
Type* e = at->element_type();
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 785889fb5c8..e93c6811d08 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -772,16 +772,16 @@ Type::are_convertible(const Type* lhs, const Type* rhs, std::string* reason)
}
// An unsafe.Pointer type may be converted to any pointer type or to
- // uintptr, and vice-versa.
+ // a type whose underlying type is uintptr, and vice-versa.
if (lhs->is_unsafe_pointer_type()
&& (rhs->points_to() != NULL
|| (rhs->integer_type() != NULL
- && rhs->forwarded() == Type::lookup_integer_type("uintptr"))))
+ && rhs->integer_type() == Type::lookup_integer_type("uintptr")->real_type())))
return true;
if (rhs->is_unsafe_pointer_type()
&& (lhs->points_to() != NULL
|| (lhs->integer_type() != NULL
- && lhs->forwarded() == Type::lookup_integer_type("uintptr"))))
+ && lhs->integer_type() == Type::lookup_integer_type("uintptr")->real_type())))
return true;
// Give a better error message.
diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c
index a9933e237c4..3218d42330e 100644
--- a/gcc/ipa-chkp.c
+++ b/gcc/ipa-chkp.c
@@ -574,7 +574,8 @@ chkp_maybe_create_clone (tree fndecl)
/* Clones have the same comdat group as originals. */
if (node->same_comdat_group
- || DECL_ONE_ONLY (node->decl))
+ || (DECL_ONE_ONLY (node->decl)
+ && !DECL_EXTERNAL (node->decl)))
clone->add_to_same_comdat_group (node);
if (gimple_has_body_p (fndecl))
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 534f6c0220d..6969f5a04be 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -939,7 +939,8 @@ warn_odr (tree t1, tree t2, tree st1, tree st2,
/* ODR warnings are output druing LTO streaming; we must apply location
cache for potential warnings to be output correctly. */
- lto_location_cache::current_cache->apply_location_cache ();
+ if (lto_location_cache::current_cache)
+ lto_location_cache::current_cache->apply_location_cache ();
if (!warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (t1)), OPT_Wodr,
"type %qT violates one definition rule",
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index ad868e10c04..8f8a0cf3463 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -534,8 +534,9 @@ sem_function::equals_wpa (sem_item *item,
if (opt_for_fn (decl, flag_devirtualize)
&& (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
|| TREE_CODE (TREE_TYPE (item->decl)) == METHOD_TYPE)
- && (!flag_ipa_cp
- || ipa_is_param_used (IPA_NODE_REF (dyn_cast <cgraph_node *>(node)),
+ && (ipa_node_params_sum == NULL
+ || IPA_NODE_REF (get_node ())->descriptors.is_empty ()
+ || ipa_is_param_used (IPA_NODE_REF (get_node ()),
0))
&& compare_polymorphic_p ())
{
@@ -2501,14 +2502,15 @@ sem_item_optimizer::update_hash_by_addr_refs ()
m_items[i]->update_hash_by_addr_refs (m_symtab_node_map);
if (m_items[i]->type == FUNC)
{
+ cgraph_node *cnode = dyn_cast <cgraph_node *> (m_items[i]->node);
+
if (TREE_CODE (TREE_TYPE (m_items[i]->decl)) == METHOD_TYPE
&& contains_polymorphic_type_p
(method_class_type (TREE_TYPE (m_items[i]->decl)))
&& (DECL_CXX_CONSTRUCTOR_P (m_items[i]->decl)
- || ((!flag_ipa_cp
- || ipa_is_param_used (
- IPA_NODE_REF
- (dyn_cast <cgraph_node *>(m_items[i]->node)), 0))
+ || ((ipa_node_params_sum == NULL
+ || IPA_NODE_REF (cnode)->descriptors.is_empty ()
+ || ipa_is_param_used (IPA_NODE_REF (cnode), 0))
&& static_cast<sem_function *> (m_items[i])
->compare_polymorphic_p ())))
{
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 2f4eb9fd6f2..5d998870f34 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -793,7 +793,11 @@ edge_set_predicate (struct cgraph_edge *e, struct predicate *predicate)
{
/* If the edge is determined to be never executed, redirect it
to BUILTIN_UNREACHABLE to save inliner from inlining into it. */
- if (predicate && false_predicate_p (predicate))
+ if (predicate && false_predicate_p (predicate)
+ /* When handling speculative edges, we need to do the redirection
+ just once. Do it always on the direct edge, so we do not
+ attempt to resolve speculation while duplicating the edge. */
+ && (!e->speculative || e->callee))
e = redirect_to_unreachable (e);
struct inline_edge_summary *es = inline_edge_summary (e);
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 952659c99fd..99ed512ea96 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -304,7 +304,8 @@ inline_call (struct cgraph_edge *e, bool update_original,
struct cgraph_node *callee = e->callee->ultimate_alias_target ();
bool new_edges_found = false;
-#ifdef ENABLE_CHECKING
+ /* This is used only for assert bellow. */
+#if 0
int estimated_growth = estimate_edge_growth (e);
bool predicated = inline_edge_summary (e)->predicate != NULL;
#endif
@@ -375,7 +376,10 @@ inline_call (struct cgraph_edge *e, bool update_original,
to->calls_comdat_local = false;
}
-#ifdef ENABLE_CHECKING
+ /* FIXME: This assert suffers from roundoff errors, disable it for GCC 5
+ and revisit it after conversion to sreals in GCC 6.
+ See PR 65654. */
+#if 0
/* Verify that estimated growth match real growth. Allow off-by-one
error due to INLINE_SIZE_SCALE roudoff errors. */
gcc_assert (!update_overall_summary || !overall_size || new_edges_found
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index bc328468fab..4533ea46be7 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1077,8 +1077,8 @@ edge_badness (struct cgraph_edge *edge, bool dump)
/* When profile is available. Compute badness as:
time_saved * caller_count
- goodness = ---------------------------------
- growth_of_caller * overall_growth
+ goodness = -------------------------------------------------
+ growth_of_caller * overall_growth * combined_size
badness = - goodness
@@ -1088,6 +1088,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
else if (opt_for_fn (caller->decl, flag_guess_branch_prob) || caller->count)
{
sreal numerator, denominator;
+ int overall_growth;
numerator = (compute_uninlined_call_time (callee_info, edge)
- compute_inlined_call_time (edge, edge_time));
@@ -1098,8 +1099,75 @@ edge_badness (struct cgraph_edge *edge, bool dump)
else if (opt_for_fn (caller->decl, flag_branch_probabilities))
numerator = numerator >> 11;
denominator = growth;
- if (callee_info->growth > 0)
- denominator *= callee_info->growth * callee_info->growth;
+
+ overall_growth = callee_info->growth;
+
+ /* Look for inliner wrappers of the form:
+
+ inline_caller ()
+ {
+ do_fast_job...
+ if (need_more_work)
+ noninline_callee ();
+ }
+ Withhout panilizing this case, we usually inline noninline_callee
+ into the inline_caller because overall_growth is small preventing
+ further inlining of inline_caller.
+
+ Penalize only callgraph edges to functions with small overall
+ growth ...
+ */
+ if (growth > overall_growth
+ /* ... and having only one caller which is not inlined ... */
+ && callee_info->single_caller
+ && !edge->caller->global.inlined_to
+ /* ... and edges executed only conditionally ... */
+ && edge->frequency < CGRAPH_FREQ_BASE
+ /* ... consider case where callee is not inline but caller is ... */
+ && ((!DECL_DECLARED_INLINE_P (edge->callee->decl)
+ && DECL_DECLARED_INLINE_P (caller->decl))
+ /* ... or when early optimizers decided to split and edge
+ frequency still indicates splitting is a win ... */
+ || (callee->split_part && !caller->split_part
+ && edge->frequency
+ < CGRAPH_FREQ_BASE
+ * PARAM_VALUE
+ (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY) / 100
+ /* ... and do not overwrite user specified hints. */
+ && (!DECL_DECLARED_INLINE_P (edge->callee->decl)
+ || DECL_DECLARED_INLINE_P (caller->decl)))))
+ {
+ struct inline_summary *caller_info = inline_summaries->get (caller);
+ int caller_growth = caller_info->growth;
+
+ /* Only apply the penalty when caller looks like inline candidate,
+ and it is not called once and. */
+ if (!caller_info->single_caller && overall_growth < caller_growth
+ && caller_info->inlinable
+ && caller_info->size
+ < (DECL_DECLARED_INLINE_P (caller->decl)
+ ? MAX_INLINE_INSNS_SINGLE : MAX_INLINE_INSNS_AUTO))
+ {
+ if (dump)
+ fprintf (dump_file,
+ " Wrapper penalty. Increasing growth %i to %i\n",
+ overall_growth, caller_growth);
+ overall_growth = caller_growth;
+ }
+ }
+ if (overall_growth > 0)
+ {
+ /* Strongly preffer functions with few callers that can be inlined
+ fully. The square root here leads to smaller binaries at average.
+ Watch however for extreme cases and return to linear function
+ when growth is large. */
+ if (overall_growth < 256)
+ overall_growth *= overall_growth;
+ else
+ overall_growth += 256 * 256 - 256;
+ denominator *= overall_growth;
+ }
+ denominator *= inline_summaries->get (caller)->self_size + growth;
badness = - numerator / denominator;
@@ -1109,13 +1177,15 @@ edge_badness (struct cgraph_edge *edge, bool dump)
" %f: guessed profile. frequency %f, count %"PRId64
" caller count %"PRId64
" time w/o inlining %f, time w inlining %f"
- " overall growth %i (current) %i (original)\n",
- badness.to_double (), (double)edge->frequency / CGRAPH_FREQ_BASE,
+ " overall growth %i (current) %i (original)"
+ " %i (compensated)\n",
+ badness.to_double (),
+ (double)edge->frequency / CGRAPH_FREQ_BASE,
edge->count, caller->count,
compute_uninlined_call_time (callee_info, edge).to_double (),
compute_inlined_call_time (edge, edge_time).to_double (),
estimate_growth (callee),
- callee_info->growth);
+ callee_info->growth, overall_growth);
}
}
/* When function local profile is not available or it does not give
@@ -1133,8 +1203,8 @@ edge_badness (struct cgraph_edge *edge, bool dump)
else
badness = badness << nest;
if (dump)
- fprintf (dump_file, " %f: no profile. nest %i\n", badness.to_double (),
- nest);
+ fprintf (dump_file, " %f: no profile. nest %i\n",
+ badness.to_double (), nest);
}
gcc_checking_assert (badness != 0);
@@ -1649,6 +1719,20 @@ inline_account_function_p (struct cgraph_node *node)
&& node->frequency != NODE_FREQUENCY_UNLIKELY_EXECUTED);
}
+/* Count number of callers of NODE and store it into DATA (that
+ points to int. Worker for cgraph_for_node_and_aliases. */
+
+static bool
+sum_callers (struct cgraph_node *node, void *data)
+{
+ struct cgraph_edge *e;
+ int *num_calls = (int *)data;
+
+ for (e = node->callers; e; e = e->next_caller)
+ (*num_calls)++;
+ return false;
+}
+
/* We use greedy algorithm for inlining of small functions:
All inline candidates are put into prioritized heap ordered in
increasing badness.
@@ -1693,6 +1777,12 @@ inline_small_functions (void)
if (inline_account_function_p (node))
initial_size += info->size;
info->growth = estimate_growth (node);
+
+ int num_calls = 0;
+ node->call_for_symbol_and_aliases (sum_callers, &num_calls,
+ true);
+ if (num_calls == 1)
+ info->single_caller = true;
if (dfs && dfs->next_cycle)
{
struct cgraph_node *n2;
@@ -2085,20 +2175,6 @@ flatten_function (struct cgraph_node *node, bool early)
inline_update_overall_summary (node);
}
-/* Count number of callers of NODE and store it into DATA (that
- points to int. Worker for cgraph_for_node_and_aliases. */
-
-static bool
-sum_callers (struct cgraph_node *node, void *data)
-{
- struct cgraph_edge *e;
- int *num_calls = (int *)data;
-
- for (e = node->callers; e; e = e->next_caller)
- (*num_calls)++;
- return false;
-}
-
/* Inline NODE to all callers. Worker for cgraph_for_node_and_aliases.
DATA points to number of calls originally found so we avoid infinite
recursion. */
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index ed4d66fef4a..85041f67dd7 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -129,6 +129,9 @@ struct GTY(()) inline_summary
/* True when function contains cilk spawn (and thus we can not inline
into it). */
unsigned contains_cilk_spawn : 1;
+ /* True wen there is only one caller of the function before small function
+ inlining. */
+ unsigned int single_caller : 1;
/* Information about function that will result after applying all the
inline decisions present in the callgraph. Generally kept up to
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 90303f1bcfc..e0fd31ad523 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -513,6 +513,38 @@ contains_type_p (tree outer_type, HOST_WIDE_INT offset,
}
+/* Return a FUNCTION_DECL if BLOCK represents a constructor or destructor.
+ If CHECK_CLONES is true, also check for clones of ctor/dtors. */
+
+tree
+inlined_polymorphic_ctor_dtor_block_p (tree block, bool check_clones)
+{
+ tree fn = BLOCK_ABSTRACT_ORIGIN (block);
+ if (fn == NULL || TREE_CODE (fn) != FUNCTION_DECL)
+ return NULL_TREE;
+
+ if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
+ || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn)))
+ {
+ if (!check_clones)
+ return NULL_TREE;
+
+ /* Watch for clones where we constant propagated the first
+ argument (pointer to the instance). */
+ fn = DECL_ABSTRACT_ORIGIN (fn);
+ if (!fn
+ || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
+ || (!DECL_CXX_CONSTRUCTOR_P (fn) && !DECL_CXX_DESTRUCTOR_P (fn)))
+ return NULL_TREE;
+ }
+
+ if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
+ return NULL_TREE;
+
+ return fn;
+}
+
+
/* We know that the instance is stored in variable or parameter
(not dynamically allocated) and we want to disprove the fact
that it may be in construction at invocation of CALL.
@@ -550,30 +582,11 @@ decl_maybe_in_construction_p (tree base, tree outer_type,
&& flags_from_decl_or_type (function) & (ECF_PURE | ECF_CONST))
return false;
+ bool check_clones = !base || is_global_var (base);
for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK;
block = BLOCK_SUPERCONTEXT (block))
- if (BLOCK_ABSTRACT_ORIGIN (block)
- && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
+ if (tree fn = inlined_polymorphic_ctor_dtor_block_p (block, check_clones))
{
- tree fn = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
- || (!DECL_CXX_CONSTRUCTOR_P (fn)
- && !DECL_CXX_DESTRUCTOR_P (fn)))
- {
- /* Watch for clones where we constant propagated the first
- argument (pointer to the instance). */
- fn = DECL_ABSTRACT_ORIGIN (fn);
- if (!fn
- || (base && !is_global_var (base))
- || TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
- || (!DECL_CXX_CONSTRUCTOR_P (fn)
- && !DECL_CXX_DESTRUCTOR_P (fn)))
- continue;
- }
- if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
- continue;
-
tree type = TYPE_MAIN_VARIANT (method_class_type (TREE_TYPE (fn)));
if (!outer_type || !types_odr_comparable (type, outer_type))
@@ -1163,15 +1176,7 @@ noncall_stmt_may_be_vtbl_ptr_store (gimple stmt)
block = BLOCK_SUPERCONTEXT (block))
if (BLOCK_ABSTRACT_ORIGIN (block)
&& TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
- {
- tree fn = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
- return false;
- return (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE
- && (DECL_CXX_CONSTRUCTOR_P (fn)
- || DECL_CXX_DESTRUCTOR_P (fn)));
- }
+ return inlined_polymorphic_ctor_dtor_block_p (block, false);
return (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE
&& (DECL_CXX_CONSTRUCTOR_P (current_function_decl)
|| DECL_CXX_DESTRUCTOR_P (current_function_decl)));
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index cfd9c16ed9c..89a4623e0c2 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -715,18 +715,8 @@ param_type_may_change_p (tree function, tree arg, gimple call)
/* Walk the inline stack and watch out for ctors/dtors. */
for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK;
block = BLOCK_SUPERCONTEXT (block))
- if (BLOCK_ABSTRACT_ORIGIN (block)
- && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block)) == FUNCTION_DECL)
- {
- tree fn = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (flags_from_decl_or_type (fn) & (ECF_PURE | ECF_CONST))
- continue;
- if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE
- && (DECL_CXX_CONSTRUCTOR_P (fn)
- || DECL_CXX_DESTRUCTOR_P (fn)))
- return true;
- }
+ if (inlined_polymorphic_ctor_dtor_block_p (block, false))
+ return true;
return false;
}
}
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 5d5db0e4eee..a28f3a1ad92 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1402,6 +1402,8 @@ split_function (basic_block return_bb, struct split_point *split_point,
(vNULL, NULL, args_to_skip, !split_part_return_p, split_point->split_bbs,
split_point->entry_bb, "part");
+ node->split_part = true;
+
/* Let's take a time profile for splitted function. */
node->tp_first_run = cur_node->tp_first_run + 1;
diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h
index d302456ae94..0cf654163f7 100644
--- a/gcc/ipa-utils.h
+++ b/gcc/ipa-utils.h
@@ -70,6 +70,7 @@ bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT,
const ipa_polymorphic_call_context &,
struct cgraph_node *);
tree method_class_type (const_tree);
+tree inlined_polymorphic_ctor_dtor_block_p (tree, bool);
bool decl_maybe_in_construction_p (tree, tree, gimple, tree);
tree vtable_pointer_value_to_binfo (const_tree);
bool vtable_pointer_value_to_vtable (const_tree, tree *, unsigned HOST_WIDE_INT *);
diff --git a/gcc/lra-int.h b/gcc/lra-int.h
index 735259123d6..c6b147e6f78 100644
--- a/gcc/lra-int.h
+++ b/gcc/lra-int.h
@@ -271,6 +271,14 @@ typedef struct lra_insn_recog_data *lra_insn_recog_data_t;
#error wrong LRA_MAX_INHERITANCE_PASSES value
#endif
+/* Analogous macro to the above one but for rematerialization. */
+#define LRA_MAX_REMATERIALIZATION_PASSES 2
+
+#if LRA_MAX_REMATERIALIZATION_PASSES <= 0 \
+ || LRA_MAX_REMATERIALIZATION_PASSES >= LRA_MAX_ASSIGNMENT_ITERATION_NUMBER - 8
+#error wrong LRA_MAX_REMATERIALIZATION_PASSES value
+#endif
+
/* lra.c: */
extern FILE *lra_dump_file;
@@ -392,6 +400,7 @@ extern void lra_final_code_change (void);
/* lra-remat.c: */
+extern int lra_rematerialization_iter;
extern bool lra_remat (void);
/* lra-elimination.c: */
diff --git a/gcc/lra-remat.c b/gcc/lra-remat.c
index ac827795713..36ea79282de 100644
--- a/gcc/lra-remat.c
+++ b/gcc/lra-remat.c
@@ -1259,6 +1259,9 @@ do_remat (void)
+/* Current number of rematerialization iteration. */
+int lra_rematerialization_iter;
+
/* Entry point of the rematerialization sub-pass. Return true if we
did any rematerialization. */
bool
@@ -1270,6 +1273,13 @@ lra_remat (void)
if (! flag_lra_remat)
return false;
+ lra_rematerialization_iter++;
+ if (lra_rematerialization_iter > LRA_MAX_REMATERIALIZATION_PASSES)
+ return false;
+ if (lra_dump_file != NULL)
+ fprintf (lra_dump_file,
+ "\n******** Rematerialization #%d: ********\n\n",
+ lra_rematerialization_iter);
timevar_push (TV_LRA_REMAT);
insn_to_cand = XCNEWVEC (cand_t, get_max_uid ());
regno_cands = XCNEWVEC (cand_t, max_regno);
diff --git a/gcc/lra.c b/gcc/lra.c
index 269a0f14f74..a29266e7ecc 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2260,6 +2260,7 @@ lra (FILE *f)
lra_live_range_iter = lra_coalesce_iter = lra_constraint_iter = 0;
lra_assignment_iter = lra_assignment_iter_after_spill = 0;
lra_inheritance_iter = lra_undo_inheritance_iter = 0;
+ lra_rematerialization_iter = 0;
setup_reg_spill_flag ();
@@ -2405,7 +2406,12 @@ lra (FILE *f)
/* Assignment of stack slots changes elimination offsets for
some eliminations. So update the offsets here. */
lra_eliminate (false, false);
- lra_constraint_new_regno_start = max_reg_num ();
+ /* After switching off inheritance and rematerialization passes,
+ don't forget reload pseudos after spilling sub-pass to avoid
+ LRA cycling in some complicated cases. */
+ if (lra_inheritance_iter <= LRA_MAX_INHERITANCE_PASSES
+ || lra_rematerialization_iter <= LRA_MAX_REMATERIALIZATION_PASSES)
+ lra_constraint_new_regno_start = max_reg_num ();
lra_assignment_iter_after_spill = 0;
}
restore_scratches ();
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 088de860646..ac50e4bbd24 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -578,6 +578,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_enum (&bp, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN, node->resolution);
bp_pack_value (&bp, node->instrumentation_clone, 1);
+ bp_pack_value (&bp, node->split_part, 1);
streamer_write_bitpack (&bp);
streamer_write_data_stream (ob->main_stream, section, strlen (section) + 1);
@@ -1214,6 +1215,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
node->instrumentation_clone = bp_unpack_value (bp, 1);
+ node->split_part = bp_unpack_value (bp, 1);
gcc_assert (flag_ltrans
|| (!node->in_other_partition
&& !node->used_from_other_partition));
@@ -1615,9 +1617,8 @@ input_cgraph_1 (struct lto_file_decl_data *file_data,
}
/* Restore decl names reference. */
- if (IDENTIFIER_TRANSPARENT_ALIAS (DECL_ASSEMBLER_NAME (cnode->decl))
- && !TREE_CHAIN (DECL_ASSEMBLER_NAME (cnode->decl)))
- TREE_CHAIN (DECL_ASSEMBLER_NAME (cnode->decl))
+ IDENTIFIER_TRANSPARENT_ALIAS (DECL_ASSEMBLER_NAME (cnode->decl)) = 1;
+ TREE_CHAIN (DECL_ASSEMBLER_NAME (cnode->decl))
= DECL_ASSEMBLER_NAME (cnode->orig_decl);
}
}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index bf2b51bba62..085ce9f4a04 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-27 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto.c (lto_read_decls): Move code registering odr types out
+ of TYPE_CANONICAL conditional and also register polymorphic types.
+
2015-03-26 Jan Hubicka <hubicka@ucw.cz>
* lto-symtab.c (lto_symtab_merge_decls_2): Silence warning on
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 80bddf059b1..835ff71391f 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -2351,6 +2351,7 @@ scan_omp_parallel (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
DECL_ARTIFICIAL (name) = 1;
DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->record_type) = name;
+ TYPE_ARTIFICIAL (ctx->record_type) = 1;
create_omp_child_function (ctx, false);
gimple_omp_parallel_set_child_fn (stmt, ctx->cb.dst_fn);
@@ -2391,6 +2392,7 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
DECL_ARTIFICIAL (name) = 1;
DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->record_type) = name;
+ TYPE_ARTIFICIAL (ctx->record_type) = 1;
create_omp_child_function (ctx, false);
gimple_omp_task_set_child_fn (stmt, ctx->cb.dst_fn);
@@ -2404,6 +2406,7 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
DECL_ARTIFICIAL (name) = 1;
DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->srecord_type) = name;
+ TYPE_ARTIFICIAL (ctx->srecord_type) = 1;
create_omp_child_function (ctx, true);
}
@@ -2671,6 +2674,7 @@ scan_omp_target (gomp_target *stmt, omp_context *outer_ctx)
DECL_ARTIFICIAL (name) = 1;
DECL_NAMELESS (name) = 1;
TYPE_NAME (ctx->record_type) = name;
+ TYPE_ARTIFICIAL (ctx->record_type) = 1;
if (offloaded)
{
if (is_gimple_omp_oacc (stmt))
diff --git a/gcc/params.def b/gcc/params.def
index 5e2c7695865..48b39a25041 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -190,7 +190,7 @@ DEFPARAM(PARAM_LARGE_UNIT_INSNS,
DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
"inline-unit-growth",
"How much can given compilation unit grow because of the inlining (in percent)",
- 15, 0, 0)
+ 20, 0, 0)
DEFPARAM(PARAM_IPCP_UNIT_GROWTH,
"ipcp-unit-growth",
"How much can given compilation unit grow because of the interprocedural constant propagation (in percent)",
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 5796d348c07..b040c463643 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -448,7 +448,7 @@ get_true_reg (rtx *pat)
case UNSPEC:
if (XINT (*pat, 1) == UNSPEC_TRUNC_NOOP
- || XINT (*pat, 1) == UNSPEC_LDA)
+ || XINT (*pat, 1) == UNSPEC_FILD_ATOMIC)
pat = & XVECEXP (*pat, 0, 0);
return pat;
@@ -1670,8 +1670,8 @@ subst_stack_regs_pat (rtx_insn *insn, stack_ptr regstack, rtx pat)
case UNSPEC:
switch (XINT (pat_src, 1))
{
- case UNSPEC_STA:
case UNSPEC_FIST:
+ case UNSPEC_FIST_ATOMIC:
case UNSPEC_FIST_FLOOR:
case UNSPEC_FIST_CEIL:
diff --git a/gcc/symtab.c b/gcc/symtab.c
index eb41d62a969..156fa3d9f28 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -1132,7 +1132,8 @@ symtab_node::verify_symtab_nodes (void)
*entry = node;
else if (!DECL_EXTERNAL (node->decl))
{
- for (s = (*entry)->same_comdat_group; s != NULL && s != node;
+ for (s = (*entry)->same_comdat_group;
+ s != NULL && s != node && s != *entry;
s = s->same_comdat_group)
;
if (!s || s == *entry)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 38d3a046fcf..bb7d971c96e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,141 @@
+2015-04-04 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR target/65647
+ * gcc.target/arm/pr65647.c: New.
+
+2015-04-03 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65655
+ * g++.dg/torture/pr65655.C: New testcase.
+
+2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/64085
+ * g++.dg/cpp1y/lambda-init13.C: New.
+
+2015-04-03 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/cpp0x/pr57101.C: Use proper type for size_t.
+
+2015-04-02 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65642
+ * g++.dg/cpp0x/constexpr-fold1.C: New test.
+ * g++.dg/cpp0x/constexpr-fold2.C: New test.
+
+2015-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/61977
+ * gcc.target/powerpc/pr61977-1.c: New test.
+ * gcc.target/powerpc/pr61977-2.c: New test.
+
+2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56100
+ * g++.dg/warn/Wshadow-8.C: New.
+ * g++.dg/warn/Wshadow-9.C: Likewise.
+ * g++.dg/warn/Wshadow-10.C: Likewise.
+ * g++.dg/warn/Wshadow-11.C: Likewise.
+
+2015-04-01 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * gcc.dg/pr23623.c: Added aligned attribute.
+ * gcc.dg/20141029-1.c: Likewise.
+ * gcc.dg/20150306-1.c: New test.
+
+2015-04-01 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65554
+ * g++.dg/cpp0x/initlist93.C: New test.
+ * g++.dg/cpp0x/initlist94.C: New test.
+
+2015-04-01 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ PR target/65624
+ * gcc.target/aarch64/pr65624.c: New test.
+
+2015-03-31 Jan Hubicka <hubicka@ucw.cz>
+
+ * gcc.dg/ipa/inlinehint-4.c: New testcase.
+
+2015-03-31 Alex Velenko <Alex.Velenko@arm.com>
+
+ * gcc.target/arm/pr45701-1.c (history_expand_line_internal): Add an
+ extra variable to force stack alignment.
+ * gcc.target/arm/pr45701-2.c (history_expand_line_internal): Add an
+ extra variable to force stack alignment.
+
+2015-03-31 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65390
+ * g++.dg/template/pr65390.C: New test.
+
+2015-03-31 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/ipa/pr65557.C: New test.
+
+2015-03-31 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * gcc.target/s390/hotpatch-25.c: New test.
+ * gcc.target/s390/hotpatch-1.c: Update test.
+ * gcc.target/s390/hotpatch-10.c: Update test.
+ * gcc.target/s390/hotpatch-11.c: Update test.
+ * gcc.target/s390/hotpatch-12.c: Update test.
+ * gcc.target/s390/hotpatch-13.c: Update test.
+ * gcc.target/s390/hotpatch-14.c: Update test.
+ * gcc.target/s390/hotpatch-15.c: Update test.
+ * gcc.target/s390/hotpatch-16.c: Update test.
+ * gcc.target/s390/hotpatch-17.c: Update test.
+ * gcc.target/s390/hotpatch-18.c: Update test.
+ * gcc.target/s390/hotpatch-19.c: Update test.
+ * gcc.target/s390/hotpatch-2.c: Update test.
+ * gcc.target/s390/hotpatch-21.c: Update test.
+ * gcc.target/s390/hotpatch-22.c: Update test.
+ * gcc.target/s390/hotpatch-23.c: Update test.
+ * gcc.target/s390/hotpatch-24.c: Update test.
+ * gcc.target/s390/hotpatch-3.c: Update test.
+ * gcc.target/s390/hotpatch-4.c: Update test.
+ * gcc.target/s390/hotpatch-5.c: Update test.
+ * gcc.target/s390/hotpatch-6.c: Update test.
+ * gcc.target/s390/hotpatch-7.c: Update test.
+ * gcc.target/s390/hotpatch-8.c: Update test.
+ * gcc.target/s390/hotpatch-9.c: Update test.
+ * gcc.target/s390/hotpatch-compile-16.c: Update test.
+
+2015-03-31 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65626
+ * g++.dg/torture/pr65626.C: New testcase.
+
+2015-03-31 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR target/65531
+ * gcc.target/i386/mpx/pr65531.cc: New.
+
+2015-03-31 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR target/65602
+ * gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Use
+ __builtin_alloca instead of alloca.
+ * gcc.target/i386/mpx/alloca-1-nov.c (mpx_test): Likewise.
+ * gcc.target/i386/mpx/alloca-1-ubv.c (mpx_test): Likewise.
+ * lib/mpx-dg.exp (check_effective_target_mpx): Add wrapper
+ check.
+
+2015-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/65610
+ * g++.dg/ubsan/pr65610.C: New test.
+
+2015-03-30 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65398
+ * g++.dg/cpp0x/pr65398-2.C: New test.
+
+2015-03-30 Marek Polacek <polacek@redhat.com>
+
+ * c-c++-common/pr65556.c: Change the width of bit-fields.
+
2015-03-27 Jan Hubicka <hubicka@ucw.cz>
PR ipa/65588
diff --git a/gcc/testsuite/c-c++-common/pr65556.c b/gcc/testsuite/c-c++-common/pr65556.c
index c6729a13629..8629a48fdce 100644
--- a/gcc/testsuite/c-c++-common/pr65556.c
+++ b/gcc/testsuite/c-c++-common/pr65556.c
@@ -4,9 +4,9 @@
struct S
{
long l: 1;
- long l2: 41;
+ long l2: 21;
unsigned long ul: 1;
- unsigned long ul2: 41;
+ unsigned long ul2: 21;
} s;
void
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-fold1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-fold1.C
new file mode 100644
index 00000000000..414a0dacf99
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-fold1.C
@@ -0,0 +1,65 @@
+// PR c++/65642
+// { dg-do compile { target c++11 } }
+
+// Check we're able to evaluate these.
+
+#define SA(X) static_assert((X),#X)
+
+constexpr char s[] = "abc";
+constexpr int t[] = { 'a', 'b', 'c', '\0' };
+
+constexpr char
+fn1 (const char *p)
+{
+ return *(p + 1);
+}
+
+constexpr char
+fn2 (const char *p)
+{
+ return p[1];
+}
+
+constexpr int
+fn3 (const int *p)
+{
+ return *(p + 1);
+}
+
+constexpr int
+fn4 (const int *p)
+{
+ return p[1];
+}
+
+constexpr auto c1 = fn1 (&s[0]);
+constexpr auto c2 = fn1 (&s[1]);
+constexpr auto c3 = fn1 (&s[2]);
+
+SA (c1 == 'b');
+SA (c2 == 'c');
+SA (c3 == '\0');
+
+constexpr auto d1 = fn2 (&s[0]);
+constexpr auto d2 = fn2 (&s[1]);
+constexpr auto d3 = fn2 (&s[2]);
+
+SA (d1 == 'b');
+SA (d2 == 'c');
+SA (d3 == '\0');
+
+constexpr auto e1 = fn3 (&t[0]);
+constexpr auto e2 = fn3 (&t[1]);
+constexpr auto e3 = fn3 (&t[2]);
+
+SA (e1 == 'b');
+SA (e2 == 'c');
+SA (e3 == '\0');
+
+constexpr auto f1 = fn4 (&t[0]);
+constexpr auto f2 = fn4 (&t[1]);
+constexpr auto f3 = fn4 (&t[2]);
+
+SA (f1 == 'b');
+SA (f2 == 'c');
+SA (f3 == '\0');
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-fold2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-fold2.C
new file mode 100644
index 00000000000..98aca2a2ce0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-fold2.C
@@ -0,0 +1,30 @@
+// PR c++/65642
+// { dg-do compile { target c++11 } }
+
+#define SA(X) static_assert((X),#X)
+
+constexpr char s[] = "abc";
+
+constexpr bool
+cmp (char const *a, char const *b)
+{
+ return a == b;
+}
+
+constexpr bool
+fn1 (const char *s)
+{
+ return cmp (s, s + 1);
+}
+
+constexpr bool
+fn2 (const char *s)
+{
+ return cmp (s + 1, s + 1);
+}
+
+constexpr auto c1 = fn1 (&s[0]);
+constexpr auto c2 = fn2 (&s[0]);
+
+SA (!c1);
+SA (c2);
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist93.C b/gcc/testsuite/g++.dg/cpp0x/initlist93.C
new file mode 100644
index 00000000000..84a47381f18
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist93.C
@@ -0,0 +1,13 @@
+// PR c++/65554
+// { dg-do compile { target c++11 } }
+
+namespace std
+{
+template <class> class initializer_list // { dg-error "definition of std::initializer_list does not match" }
+{
+ int *_M_array;
+ int _M_len;
+};
+}
+
+// { dg-prune-output "compilation terminated" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist94.C b/gcc/testsuite/g++.dg/cpp0x/initlist94.C
new file mode 100644
index 00000000000..f83a81d3a45
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist94.C
@@ -0,0 +1,13 @@
+// PR c++/65554
+// { dg-do compile { target c++11 } }
+
+typedef decltype (sizeof (int)) size_type;
+
+namespace std
+{
+template <class> class initializer_list
+{
+ int *_M_array;
+ size_type _M_len;
+};
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr57101.C b/gcc/testsuite/g++.dg/cpp0x/pr57101.C
index 94b576f4b87..c0fc966272c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr57101.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr57101.C
@@ -1,7 +1,7 @@
// { dg-do compile { target c++11 } }
// { dg-options "-fcompare-debug" }
-typedef long unsigned size_t;
+typedef __SIZE_TYPE__ size_t;
namespace
{
template < typename _Tp, _Tp __v > struct integral_constant
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr65398-2.C b/gcc/testsuite/g++.dg/cpp0x/pr65398-2.C
new file mode 100644
index 00000000000..f920b03ded9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr65398-2.C
@@ -0,0 +1,38 @@
+// PR c++/65398
+// { dg-do compile { target c++11 } }
+
+#define SA(X) static_assert((X),#X)
+
+constexpr char s[] = "abc";
+
+SA((&s[0] + 0) == (&s[0] + 0));
+SA((&s[0] + 1) == (&s[1] + 0));
+SA((&s[0] + 2) == (&s[1] + 1));
+SA((&s[0] + 3) == (&s[1] + 2));
+SA((&s[0] + 4) == (&s[1] + 3));
+SA((&s[2] + 0) == (&s[0] + 2));
+SA((&s[2] + 1) == (&s[3] + 0));
+SA((&s[2] + 2) == (&s[3] + 1));
+SA((&s[4] + 0) == (&s[2] + 2));
+
+SA((&s[0] + 0) != (&s[1] + 0));
+SA((&s[0] + 2) != (&s[1] + 0));
+SA((&s[2] + 0) != (&s[2] + 1));
+SA((&s[1] + 1) != (&s[0] + 1));
+
+constexpr int l[] = { 'c', 'd', 'e', '\0' };
+
+SA((&l[0] + 0) == (&l[0] + 0));
+SA((&l[0] + 1) == (&l[1] + 0));
+SA((&l[0] + 2) == (&l[1] + 1));
+SA((&l[0] + 3) == (&l[1] + 2));
+SA((&l[0] + 4) == (&l[1] + 3));
+SA((&l[2] + 0) == (&l[0] + 2));
+SA((&l[2] + 1) == (&l[3] + 0));
+SA((&l[2] + 2) == (&l[3] + 1));
+SA((&l[4] + 0) == (&l[2] + 2));
+
+SA((&l[0] + 0) != (&l[1] + 0));
+SA((&l[0] + 2) != (&l[1] + 0));
+SA((&l[2] + 0) != (&l[2] + 1));
+SA((&l[1] + 1) != (&l[0] + 1));
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-init13.C b/gcc/testsuite/g++.dg/cpp1y/lambda-init13.C
new file mode 100644
index 00000000000..9b1d139c6d4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/lambda-init13.C
@@ -0,0 +1,18 @@
+// PR c++/64085
+// { dg-do compile { target c++14 } }
+
+template<typename T>
+struct reference_wrapper
+{
+ T& get() const noexcept;
+};
+
+template<class T>
+auto make_monad(reference_wrapper<T> arg) {
+ return [&captive = arg.get()](auto&&) { return 1; };
+}
+
+int main()
+{
+ make_monad(reference_wrapper<int&>());
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ23.C b/gcc/testsuite/g++.dg/cpp1y/var-templ23.C
new file mode 100644
index 00000000000..a5b19d28d6c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ23.C
@@ -0,0 +1,7 @@
+// PR c++/65625
+// { dg-do compile { target c++14 } }
+
+namespace std {
+ template <typename T> int declval;
+ typename std::declval<> d; // { dg-error "not a type" }
+}
diff --git a/gcc/testsuite/g++.dg/ipa/pr65557.C b/gcc/testsuite/g++.dg/ipa/pr65557.C
new file mode 100644
index 00000000000..2250bb079b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr65557.C
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-icf-details" } */
+
+struct S0
+{
+ S0 ()
+ {
+ }
+};
+
+struct S1
+{
+ S1 ()
+ {
+ }
+};
+
+S0 s0;
+S1 s1;
diff --git a/gcc/testsuite/g++.dg/template/pr65390.C b/gcc/testsuite/g++.dg/template/pr65390.C
new file mode 100644
index 00000000000..299d22a7ee3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr65390.C
@@ -0,0 +1,12 @@
+// PR c++/65390
+// { dg-do compile }
+// { dg-options "" }
+
+template<typename T> struct shared_ptr { };
+
+template<typename T, typename Arg>
+shared_ptr<T> make_shared(Arg) { return shared_ptr<T>(); } // { dg-error "variably modified type|trying to instantiate" }
+
+void f(int n){
+ make_shared<int[n]>(1); // { dg-error "no matching function" }
+}
diff --git a/gcc/testsuite/g++.dg/template/static36.C b/gcc/testsuite/g++.dg/template/static36.C
new file mode 100644
index 00000000000..36c48b021b1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/static36.C
@@ -0,0 +1,4 @@
+// PR c++/65646
+
+template <typename = int> class A {};
+template <> A<> &A<>::a; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/torture/pr65626.C b/gcc/testsuite/g++.dg/torture/pr65626.C
new file mode 100644
index 00000000000..ed85ba93830
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr65626.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+class A {
+ virtual unsigned long m_fn1() const;
+ virtual int &m_fn2(unsigned long) const;
+};
+class C : A {
+public:
+ int &m_fn2(unsigned long) const;
+ unsigned long m_fn1() const;
+};
+class B {
+ void m_fn3(const A &, const int &, const C &, int &) const;
+};
+void B::m_fn3(const A &, const int &, const C &, int &) const {
+ C &a(a);
+ for (long b = 0; a.m_fn1(); b++)
+ a.m_fn2(0);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr65655.C b/gcc/testsuite/g++.dg/torture/pr65655.C
new file mode 100644
index 00000000000..7db385d384a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr65655.C
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+// { dg-additional-options "-std=c++11 -fsanitize=undefined -O2" }
+class ECoordinate { };
+class EPoint {
+public:
+ inline ECoordinate & y ();
+};
+ECoordinate & EPoint::y () { }
+template < class KEY, class CONTENT > class AVLTree;
+template < class KEY, class CONTENT > class AVLTreeNode {
+ friend class
+ AVLTree < KEY, CONTENT >;
+ KEY key;
+ void set_rthread (unsigned char b);
+ void set_lthread (unsigned char b);
+};
+template < class KEY, class CONTENT > class AVLTree {
+public:
+ AVLTree ();
+ void insert (const KEY & key, const CONTENT & c);
+AVLTreeNode < KEY, CONTENT > *root;
+ const KEY * _target_key;
+ virtual int compare (const KEY & k1, const KEY & k2) const;
+ void _add (AVLTreeNode < KEY, CONTENT > *&t);
+ virtual void _status (unsigned int) { }
+};
+template < class KEY, class CONTENT > void AVLTree < KEY, CONTENT >::_add (AVLTreeNode < KEY, CONTENT > *&t) {
+ int cmp = compare (*_target_key, t->key);
+ if (cmp == 0)
+ { _status (1); }
+}
+template < class KEY, class CONTENT > void AVLTree < KEY, CONTENT >::insert (const KEY & key, const CONTENT & c) {
+ if (root == 0) {
+ root->set_rthread (1);
+ root->set_lthread (1);
+ }
+else { _target_key = &key; _add (root); }
+}
+template < class KEY, class CONTENT > AVLTree < KEY, CONTENT >::AVLTree ()
+: root (0) { }
+class ContactRepository {
+ void insertContact (EPoint & pt, int val);
+};
+void ContactRepository::insertContact (EPoint & pt, int val) {
+ AVLTreeNode < ECoordinate, AVLTree < ECoordinate, int >*>*cont_x_node;
+ if (cont_x_node == __null)
+ {
+ AVLTree < ECoordinate, int >*insert_tree = new AVLTree < ECoordinate, int >;
+ insert_tree->insert (pt.y (), val);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/ubsan/pr65610.C b/gcc/testsuite/g++.dg/ubsan/pr65610.C
new file mode 100644
index 00000000000..ced59a87430
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr65610.C
@@ -0,0 +1,57 @@
+// PR ipa/65610
+// { dg-do compile }
+// { dg-options "-std=c++11 -fsanitize=undefined -fno-sanitize=vptr -fcompare-debug" }
+
+class A;
+class B {};
+enum C { D };
+class E;
+class F;
+class G;
+class H
+{
+ F m1 (const A &t) const;
+ G m2 () const;
+};
+class G {};
+template <class S, class T>
+class I;
+template <class S, class T>
+class J
+{
+ friend class I <S,T>;
+ J <S,T> *j;
+};
+template <class S, class T>
+struct I
+{
+ virtual ~I ();
+ virtual void m3 (void *p) {}
+ J <S,T> *i;
+ void m4 (J <S,T>*& t);
+};
+template <class S, class T>
+void I <S,T>::m4 (J <S,T> * &t)
+{
+ m4 (t->j);
+ m3 (t);
+}
+template <class S, class T>
+I <S,T>::~I ()
+{
+ m4 (i);
+}
+struct F
+{
+ explicit inline F (C v);
+ inline ~F ();
+ I <B, E> f;
+};
+inline F::F (C v) {}
+inline F::~F () {}
+F H::m1 (const A &t) const
+{
+ F q (D);
+ G r = m2 ();
+ return q;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-10.C b/gcc/testsuite/g++.dg/warn/Wshadow-10.C
new file mode 100644
index 00000000000..21d50020059
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-10.C
@@ -0,0 +1,15 @@
+// PR c++/56100
+// { dg-options "-Wshadow" }
+
+struct bar
+{
+ template <typename T>
+ void baz () { int foo; }
+};
+
+int foo;
+
+int main ()
+{
+ bar ().baz <int> ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-11.C b/gcc/testsuite/g++.dg/warn/Wshadow-11.C
new file mode 100644
index 00000000000..d3b70c39ace
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-11.C
@@ -0,0 +1,15 @@
+// PR c++/56100
+// { dg-options "-Wshadow" }
+
+int foo; // { dg-message "shadowed declaration" }
+
+struct bar
+{
+ template <typename T>
+ void baz () { int foo; } // { dg-warning "shadows a global" }
+};
+
+int main ()
+{
+ bar ().baz <int> ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-8.C b/gcc/testsuite/g++.dg/warn/Wshadow-8.C
new file mode 100644
index 00000000000..4f1ed02f31a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-8.C
@@ -0,0 +1,15 @@
+// PR c++/56100
+// { dg-options "-Wshadow" }
+
+template <typename T>
+struct bar
+{
+ void baz () { int foo; }
+};
+
+int foo;
+
+int main ()
+{
+ bar <int> ().baz ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-9.C b/gcc/testsuite/g++.dg/warn/Wshadow-9.C
new file mode 100644
index 00000000000..836bce62cf0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-9.C
@@ -0,0 +1,15 @@
+// PR c++/56100
+// { dg-options "-Wshadow" }
+
+int foo; // { dg-message "shadowed declaration" }
+
+template <typename T>
+struct bar
+{
+ void baz () { int foo; } // { dg-warning "shadows a global" }
+};
+
+int main ()
+{
+ bar <int> ().baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/20141029-1.c b/gcc/testsuite/gcc.dg/20141029-1.c
index b25af576967..1d18a1b8ac3 100644
--- a/gcc/testsuite/gcc.dg/20141029-1.c
+++ b/gcc/testsuite/gcc.dg/20141029-1.c
@@ -14,7 +14,7 @@ struct system_periph {
unsigned short :8;
} BIT;
} ALL;
-};
+} __attribute__((aligned(2)));
void
foo()
diff --git a/gcc/testsuite/gcc.dg/20150306-1.c b/gcc/testsuite/gcc.dg/20150306-1.c
new file mode 100644
index 00000000000..55caf3b93ce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20150306-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+struct s
+{
+ char x : 8;
+ unsigned int y : 31;
+} __attribute__((packed));
+
+volatile struct s global;
+
+int
+main ()
+{
+ global.y = 0x7FFFFFFF;
+ if (global.y != 0x7FFFFFFF)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c
new file mode 100644
index 00000000000..52d2f1a6763
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c
@@ -0,0 +1,40 @@
+/* { dg-options "-O3 -fdump-ipa-inline-details -fno-early-inlining --param large-unit-insns=1" } */
+/* { dg-add-options bind_pic_locally } */
+int *hashval;
+int *hash;
+int hash_size;
+
+static int
+lookup_slow (int val)
+{
+ int i = val % hash_size;
+ while (hashval[i] && hashval[i] != val)
+ i++;
+ return hash[i];
+}
+
+static inline int
+lookup (int val)
+{
+ static int cache, cache_val;
+ if (val == cache_val)
+ return cache;
+ else
+ {
+ cache_val = val;
+ cache = lookup_slow (val);
+ return cache;
+ }
+}
+
+int
+test (int i)
+{
+ return lookup (i) + lookup (2 * i) + lookup (3 * i) + lookup (4 * i) +
+ lookup (5 * i) + lookup (6 * i) + lookup (7 * i) + lookup (8 * i) +
+ lookup (9 * i);
+}
+/* { dg-final { scan-ipa-dump "Wrapper penalty" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "Inlining lookup_slow to lookup" "inline" } } */
+/* { dg-final { scan-ipa-dump "Inlining lookup to test" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/pr23623.c b/gcc/testsuite/gcc.dg/pr23623.c
index 7ba1470182d..e076b600335 100644
--- a/gcc/testsuite/gcc.dg/pr23623.c
+++ b/gcc/testsuite/gcc.dg/pr23623.c
@@ -10,19 +10,19 @@ extern struct
{
unsigned int b : 1;
unsigned int : 31;
-} bf1;
+} __attribute__((aligned(4))) bf1;
extern volatile struct
{
unsigned int b : 1;
unsigned int : 31;
-} bf2;
+} __attribute__((aligned(4))) bf2;
extern struct
{
volatile unsigned int b : 1;
volatile unsigned int : 31;
-} bf3;
+} __attribute__((aligned(4))) bf3;
void writeb(void)
{
diff --git a/gcc/testsuite/gcc.target/aarch64/pr65624.c b/gcc/testsuite/gcc.target/aarch64/pr65624.c
new file mode 100644
index 00000000000..8eb3786a4b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr65624.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+#include <arm_neon.h>
+
+int32x4_t
+foo (void)
+{
+ int32x4_t vector_int32x4;
+ int16x4_t vector3_int16x4;
+ int16x4_t vector4_int16x4;
+ static int32_t buffer_int32x4[32];
+
+ vector_int32x4 = vld1q_s32(buffer_int32x4);
+ return vqdmlsl_lane_s16(vector_int32x4, vector3_int16x4, vector4_int16x4, 0);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr45701-1.c b/gcc/testsuite/gcc.target/arm/pr45701-1.c
index 2c690d5bc9b..454a087eedb 100644
--- a/gcc/testsuite/gcc.target/arm/pr45701-1.c
+++ b/gcc/testsuite/gcc.target/arm/pr45701-1.c
@@ -5,6 +5,7 @@
/* { dg-final { scan-assembler-not "r8" } } */
extern int hist_verify;
+extern int a1;
extern char *pre_process_line (char*);
extern char* str_cpy (char*, char*);
extern int str_len (char*);
@@ -16,10 +17,10 @@ history_expand_line_internal (char* line)
{
char *new_line;
int old_verify;
-
+ int a = a1;
old_verify = hist_verify;
hist_verify = 0;
new_line = pre_process_line (line);
- hist_verify = old_verify;
+ hist_verify = old_verify + a;
return (new_line == line) ? savestring (line) : new_line;
}
diff --git a/gcc/testsuite/gcc.target/arm/pr45701-2.c b/gcc/testsuite/gcc.target/arm/pr45701-2.c
index ee1ee7df05c..afe0840d44b 100644
--- a/gcc/testsuite/gcc.target/arm/pr45701-2.c
+++ b/gcc/testsuite/gcc.target/arm/pr45701-2.c
@@ -5,6 +5,7 @@
/* { dg-final { scan-assembler-not "r8" } } */
extern int hist_verify;
+extern int a1;
extern char *pre_process_line (char*);
extern char* savestring1 (char*, char*);
extern char* str_cpy (char*, char*);
@@ -17,11 +18,11 @@ history_expand_line_internal (char* line)
{
char *new_line;
int old_verify;
-
+ int a = a1;
old_verify = hist_verify;
hist_verify = 0;
new_line = pre_process_line (line);
- hist_verify = old_verify;
+ hist_verify = old_verify + a;
/* Two tail calls here, but r3 is not used to pass values. */
return (new_line == line) ? savestring (line) : savestring1 (new_line, line);
}
diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/gcc.target/arm/pr65647.c
new file mode 100644
index 00000000000..686eb587ae3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr65647.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv6-m -mthumb -O3 -w" } */
+
+a, b, c, e, g = &e, h, i = 7, l = 1, m, n, o, q = &m, r, s = &r, u, w = 9, x,
+ y = 6, z, t6 = 7, t8, t9 = 1, t11 = 5, t12 = &t8, t13 = 3, t15,
+ t16 = &t15;
+struct {
+ long long f3;
+ char f4
+} p = {3}
+
+ ,
+ t = {4};
+
+struct S1 {
+ long long f0;
+ short f1;
+ long long f2
+} d;
+long long f = 4073709551613, t7 = 8, t14 = 4073709551610;
+j[];
+k = j;
+v = &d;
+*t10 = j;
+struct S1 fn1();
+struct S1 fn2() {
+ signed char t1;
+ struct S1 t2;
+ long t3 = x;
+ short t4 = h;
+ short *t5 = &l;
+ fn1(t2, w, 1, o);
+ if (u) {
+ l = q;
+ t1 = a < b ?: b;
+ z = c >= 2 || t1 << c;
+ }
+ *t5 = t4 &= t3;
+ fn3(y);
+}
+
+fn4() {
+ t6 = t.f3;
+ fn5(k, t7);
+}
+
+struct S1 fn1() {
+ f = 0;
+ for (; i;)
+ ;
+ t11 = 0;
+ t13 = *t10 = t14 || n;
+ t9 = t12;
+ for (; p.f4;)
+ s = t16 <= fn6();
+ if (g)
+ v = 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
index f81a5e25f32..57c05d33f89 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-lbv.c
@@ -16,7 +16,7 @@ int rd (int *p, int i)
int mpx_test (int argc, const char **argv)
{
- int *buf = (int *)alloca (100 * sizeof(int));
+ int *buf = (int *)__buitlin_alloca (100 * sizeof(int));
rd (buf, -1);
diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
index 162b4d57270..835015fc432 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-nov.c
@@ -13,7 +13,7 @@ int rd (int *p, int i)
int mpx_test (int argc, const char **argv)
{
- int *buf = (int *)alloca (100 * sizeof(int));
+ int *buf = (int *)__builtin_alloca (100 * sizeof(int));
rd (buf, 0);
rd (buf, 99);
diff --git a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
index 9af3f11ac49..c57c6c4811f 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/alloca-1-ubv.c
@@ -16,7 +16,7 @@ int rd (int *p, int i)
int mpx_test (int argc, const char **argv)
{
- int *buf = (int *)alloca (100 * sizeof(int));
+ int *buf = (int *)__builtin_alloca (100 * sizeof(int));
rd (buf, 100);
diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc b/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc
new file mode 100644
index 00000000000..049569c50b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mpx/pr65531.cc
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */
+
+#pragma interface
+
+struct S
+{
+ ~S ()
+ {
+ }
+};
+
+S s;
diff --git a/gcc/testsuite/gcc.target/powerpc/pr61977-1.c b/gcc/testsuite/gcc.target/powerpc/pr61977-1.c
new file mode 100644
index 00000000000..50e6d28161d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr61977-1.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/61977 */
+/* { dg-do preprocess } */
+/* { dg-options "-mno-altivec -mno-vsx" } */
+
+int y; vector
+int x;
+
+/* { dg-final { scan-file "pr61977-1.i" "(^|\\n)int y; vector\\n" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr61977-2.c b/gcc/testsuite/gcc.target/powerpc/pr61977-2.c
new file mode 100644
index 00000000000..305e45f6467
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr61977-2.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/61977 */
+/* { dg-do preprocess } */
+/* { dg-options "-maltivec" } */
+
+int y; vector
+int x;
+
+/* { dg-final { scan-file "pr61977-2.i" "(^|\\n)int y; __attribute__\\(\\(altivec\\(vector__\\)\\)\\)\\n" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-1.c b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
index 4e29817991e..b14fa9010a8 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-1.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-1.c
@@ -11,6 +11,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-10.c b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
index 352c9d500d7..a990c4cad6e 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-10.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-10.c
@@ -11,6 +11,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-11.c b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
index beb8738c653..6f8a52b26d3 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-11.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-11.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-12.c b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
index d109478b04f..b73ca90fd3d 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-12.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-12.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(999 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 999 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-13.c b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
index 9ac9f842d63..150667a1c66 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-13.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-13.c
@@ -12,6 +12,10 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler "alignment for hotpatch" } } */
+/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-14.c b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
index 209e4ac5e47..c5f118c1cc6 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-14.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-14.c
@@ -12,6 +12,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-15.c b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
index 109034ef019..ef0fb746227 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-15.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-15.c
@@ -12,6 +12,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
index b01c1c32254..a34bf95c3cb 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-16.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-16.c
@@ -12,6 +12,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-17.c b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
index ce0b950f8d3..66ac725d16a 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-17.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-17.c
@@ -12,6 +12,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-18.c b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
index 9a24d5e6a77..8b076a4e175 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-18.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-18.c
@@ -11,6 +11,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-19.c b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
index 3586da29a89..6993c7e855c 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-19.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-19.c
@@ -18,6 +18,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-2.c b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
index 18be5aa2383..67189f8a28b 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-2.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-2.c
@@ -11,7 +11,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
-/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-21.c b/gcc/testsuite/gcc.target/s390/hotpatch-21.c
index d72dee318cf..e9099900855 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-21.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-21.c
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(512))) hp1(void)
}
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "\.align\t512" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-22.c b/gcc/testsuite/gcc.target/s390/hotpatch-22.c
index 65074661023..d89d7790426 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-22.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-22.c
@@ -11,4 +11,4 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "\.align\t1024" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-23.c b/gcc/testsuite/gcc.target/s390/hotpatch-23.c
index 7dce5b8b0fa..1e05d123c22 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-23.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-23.c
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(2048))) hp1(void)
}
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "\.align\t2048" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-24.c b/gcc/testsuite/gcc.target/s390/hotpatch-24.c
index 4d6815cb516..fc6427479d8 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-24.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-24.c
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(4096))) hp1(void)
}
/* Check number of occurences of certain instructions. */
-/* { dg-final { scan-assembler-times "\.align\t4096" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-25.c b/gcc/testsuite/gcc.target/s390/hotpatch-25.c
new file mode 100644
index 00000000000..e9257e3744e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-25.c
@@ -0,0 +1,33 @@
+/* Functional tests for the function hotpatching feature. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+typedef long (*fn_t)(void);
+
+__attribute__ ((hotpatch(1,2)))
+fn_t outer(void)
+{
+ __attribute__ ((hotpatch(4,8)))
+ long nested1(void)
+ {
+ __attribute__ ((hotpatch(16,32)))
+ long nested2(void)
+ {
+ return 2;
+ }
+ return (long)(void *)nested2;
+ }
+
+ return nested1;
+}
+
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "pre-label.*(4 halfwords)" } } */
+/* { dg-final { scan-assembler "pre-label.*(16 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(8 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(32 halfwords)" } } */
+/* { dg-final { scan-assembler-times "alignment for hotpatch" 3 } } */
+/* { dg-final { scan-assembler-times "\.align\t8" 6 } } */
+/* { dg-final { scan-assembler "nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-3.c b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
index 8a2ab538e8d..ec4a978f72e 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-3.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-3.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-4.c b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
index 9a69459797e..d55e71d3d69 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-4.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-4.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-5.c b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
index b3d990f499a..f77d83aea07 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-5.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-5.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-6.c b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
index 10ba5580b0d..330cf5d011f 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-6.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-6.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(5 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-7.c b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
index edf67d3e22e..2f24e3cc152 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-7.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-7.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(6 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 2 } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
index a179c4a633c..7b266bd463e 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-8.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-8.c
@@ -11,6 +11,9 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
index c4e21f2d3de..c0ad319c0bb 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-9.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-9.c
@@ -11,6 +11,8 @@ void hp1(void)
}
/* Check number of occurences of certain instructions. */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 2 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c
index 3c5c7827206..2e8291ede34 100644
--- a/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c
+++ b/gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c
@@ -1,4 +1,4 @@
-/* A warning will be issued when requesting hotpatching on a nested function. */
+/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
@@ -17,7 +17,7 @@ fn_t hp1(void)
fn_t hp2(void)
{
__attribute__ ((hotpatch(1,2)))
- int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
+ int nested2(void)
{ return 2; }
return nested2;
diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp
index 0b731a7ee46..c8f64cddd27 100644
--- a/gcc/testsuite/lib/mpx-dg.exp
+++ b/gcc/testsuite/lib/mpx-dg.exp
@@ -20,7 +20,13 @@
proc check_effective_target_mpx {} {
return [check_no_compiler_messages mpx executable {
int *foo (int *arg) { return arg; }
- int main (void) { return foo ((void *)0) == 0; }
+ int main (void)
+ {
+ int *p = __builtin_malloc (sizeof (int));
+ int res = foo (p) == 0;
+ __builtin_free (p);
+ return res;
+ }
} "-fcheck-pointer-bounds -mmpx"]
}
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index e7122e33c28..26258aad1ef 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -579,13 +579,15 @@ remove_forwarder_block (basic_block bb)
return true;
}
-/* STMT is a call that has been discovered noreturn. Fixup the CFG
- and remove LHS. Return true if something changed. */
+/* STMT is a call that has been discovered noreturn. Split the
+ block to prepare fixing up the CFG and remove LHS.
+ Return true if cleanup-cfg needs to run. */
bool
fixup_noreturn_call (gimple stmt)
{
basic_block bb = gimple_bb (stmt);
+ bool changed = false;
if (gimple_call_builtin_p (stmt, BUILT_IN_RETURN))
return false;
@@ -604,7 +606,10 @@ fixup_noreturn_call (gimple stmt)
gsi_remove (&gsi, true);
}
else
- split_block (bb, stmt);
+ {
+ split_block (bb, stmt);
+ changed = true;
+ }
}
/* If there is an LHS, remove it. */
@@ -626,9 +631,13 @@ fixup_noreturn_call (gimple stmt)
}
/* Mark the call as altering control flow. */
- gimple_call_set_ctrl_altering (stmt, true);
+ if (!gimple_call_ctrl_altering_p (stmt))
+ {
+ gimple_call_set_ctrl_altering (stmt, true);
+ changed = true;
+ }
- return remove_fallthru_edge (bb->succs);
+ return changed;
}
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index a1cbd6418db..260e7f5bde2 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2012,7 +2012,11 @@ create_access_replacement (struct access *access)
DECL_CONTEXT (repl) = current_function_decl;
}
else
- repl = create_tmp_var (access->type, "SR");
+ /* Drop any special alignment on the type if it's not on the main
+ variant. This avoids issues with weirdo ABIs like AAPCS. */
+ repl = create_tmp_var (build_qualified_type
+ (TYPE_MAIN_VARIANT (access->type),
+ TYPE_QUALS (access->type)), "SR");
if (TREE_CODE (access->type) == COMPLEX_TYPE
|| TREE_CODE (access->type) == VECTOR_TYPE)
{
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index e0c4266938f..df902292596 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -76,6 +76,10 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "debug.h"
#include "tree-ssa.h"
+#include "lto-streamer.h"
+#include "ipa-ref.h"
+#include "cgraph.h"
+#include "ipa-utils.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@@ -509,12 +513,29 @@ mark_scope_block_unused (tree scope)
done by the inliner. */
static bool
-remove_unused_scope_block_p (tree scope)
+remove_unused_scope_block_p (tree scope, bool in_ctor_dtor_block)
{
tree *t, *next;
bool unused = !TREE_USED (scope);
int nsubblocks = 0;
+ /* For ipa-polymorphic-call.c purposes, preserve blocks:
+ 1) with BLOCK_ABSTRACT_ORIGIN of a ctor/dtor or their clones */
+ if (inlined_polymorphic_ctor_dtor_block_p (scope, true))
+ {
+ in_ctor_dtor_block = true;
+ unused = false;
+ }
+ /* 2) inside such blocks, the outermost block with BLOCK_ABSTRACT_ORIGIN
+ being a FUNCTION_DECL. */
+ else if (in_ctor_dtor_block
+ && BLOCK_ABSTRACT_ORIGIN (scope)
+ && TREE_CODE (BLOCK_ABSTRACT_ORIGIN (scope)) == FUNCTION_DECL)
+ {
+ in_ctor_dtor_block = false;
+ unused = false;
+ }
+
for (t = &BLOCK_VARS (scope); *t; t = next)
{
next = &DECL_CHAIN (*t);
@@ -594,7 +615,7 @@ remove_unused_scope_block_p (tree scope)
}
for (t = &BLOCK_SUBBLOCKS (scope); *t ;)
- if (remove_unused_scope_block_p (*t))
+ if (remove_unused_scope_block_p (*t, in_ctor_dtor_block))
{
if (BLOCK_SUBBLOCKS (*t))
{
@@ -959,7 +980,7 @@ remove_unused_locals (void)
cfun->local_decls->truncate (dstidx);
}
- remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
+ remove_unused_scope_block_p (DECL_INITIAL (current_function_decl), false);
clear_unused_block_pointer ();
BITMAP_FREE (usedvars);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 094275e8439..3913862eb6c 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1152,7 +1152,6 @@ vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot,
vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
struct data_reference *dr;
stmt_vector_for_cost prologue_cost_vec, body_cost_vec, epilogue_cost_vec;
- int single_iter_cost;
prologue_cost_vec.create (2);
body_cost_vec.create (2);
@@ -1175,14 +1174,11 @@ vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot,
SET_DR_MISALIGNMENT (dr, save_misalignment);
}
- single_iter_cost = vect_get_single_scalar_iteration_cost (loop_vinfo);
+ auto_vec<stmt_info_for_cost> scalar_cost_vec;
+ vect_get_single_scalar_iteration_cost (loop_vinfo, &scalar_cost_vec);
outside_cost += vect_get_known_peeling_cost
(loop_vinfo, elem->npeel, &dummy,
- /* ??? We use this cost as number of stmts with scalar_stmt cost,
- thus divide by that. This introduces rounding errors, thus better
- introduce a new cost kind (raw_cost? scalar_iter_cost?). */
- single_iter_cost / vect_get_stmt_cost (scalar_stmt),
- &prologue_cost_vec, &epilogue_cost_vec);
+ &scalar_cost_vec, &prologue_cost_vec, &epilogue_cost_vec);
/* Prologue and epilogue costs are added to the target model later.
These costs depend only on the scalar iteration cost, the
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index dd4ada2d09d..88ef251e91a 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2653,12 +2653,13 @@ vect_force_simple_reduction (loop_vec_info loop_info, gimple phi,
/* Calculate the cost of one scalar iteration of the loop. */
int
-vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
+vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo,
+ stmt_vector_for_cost *scalar_cost_vec)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes, factor, scalar_single_iter_cost = 0;
- int innerloop_iters, i, stmt_cost;
+ int innerloop_iters, i;
/* Count statements in scalar loop. Using this as scalar cost for a single
iteration for now.
@@ -2699,17 +2700,20 @@ vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
&& !STMT_VINFO_IN_PATTERN_P (stmt_info))
continue;
+ vect_cost_for_stmt kind;
if (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt)))
{
if (DR_IS_READ (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))))
- stmt_cost = vect_get_stmt_cost (scalar_load);
+ kind = scalar_load;
else
- stmt_cost = vect_get_stmt_cost (scalar_store);
+ kind = scalar_store;
}
else
- stmt_cost = vect_get_stmt_cost (scalar_stmt);
+ kind = scalar_stmt;
- scalar_single_iter_cost += stmt_cost * factor;
+ scalar_single_iter_cost
+ += record_stmt_cost (scalar_cost_vec, factor, kind,
+ NULL, 0, vect_prologue);
}
}
return scalar_single_iter_cost;
@@ -2719,7 +2723,7 @@ vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
int
vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
int *peel_iters_epilogue,
- int scalar_single_iter_cost,
+ stmt_vector_for_cost *scalar_cost_vec,
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *epilogue_cost_vec)
{
@@ -2736,8 +2740,10 @@ vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
/* If peeled iterations are known but number of scalar loop
iterations are unknown, count a taken branch per peeled loop. */
- retval = record_stmt_cost (prologue_cost_vec, 2, cond_branch_taken,
+ retval = record_stmt_cost (prologue_cost_vec, 1, cond_branch_taken,
NULL, 0, vect_prologue);
+ retval = record_stmt_cost (prologue_cost_vec, 1, cond_branch_taken,
+ NULL, 0, vect_epilogue);
}
else
{
@@ -2751,14 +2757,21 @@ vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
*peel_iters_epilogue = vf;
}
+ stmt_info_for_cost *si;
+ int j;
if (peel_iters_prologue)
- retval += record_stmt_cost (prologue_cost_vec,
- peel_iters_prologue * scalar_single_iter_cost,
- scalar_stmt, NULL, 0, vect_prologue);
+ FOR_EACH_VEC_ELT (*scalar_cost_vec, j, si)
+ retval += record_stmt_cost (prologue_cost_vec,
+ si->count * peel_iters_prologue,
+ si->kind, NULL, si->misalign,
+ vect_prologue);
if (*peel_iters_epilogue)
- retval += record_stmt_cost (epilogue_cost_vec,
- *peel_iters_epilogue * scalar_single_iter_cost,
- scalar_stmt, NULL, 0, vect_epilogue);
+ FOR_EACH_VEC_ELT (*scalar_cost_vec, j, si)
+ retval += record_stmt_cost (epilogue_cost_vec,
+ si->count * *peel_iters_epilogue,
+ si->kind, NULL, si->misalign,
+ vect_epilogue);
+
return retval;
}
@@ -2833,12 +2846,9 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
TODO: Consider assigning different costs to different scalar
statements. */
- scalar_single_iter_cost = vect_get_single_scalar_iteration_cost (loop_vinfo);
- /* ??? Below we use this cost as number of stmts with scalar_stmt cost,
- thus divide by that. This introduces rounding errors, thus better
- introduce a new cost kind (raw_cost? scalar_iter_cost?). */
- int scalar_single_iter_stmts
- = scalar_single_iter_cost / vect_get_stmt_cost (scalar_stmt);
+ auto_vec<stmt_info_for_cost> scalar_cost_vec;
+ scalar_single_iter_cost
+ = vect_get_single_scalar_iteration_cost (loop_vinfo, &scalar_cost_vec);
/* Add additional cost for the peeled instructions in prologue and epilogue
loop.
@@ -2866,18 +2876,29 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
branch per peeled loop. Even if scalar loop iterations are known,
vector iterations are not known since peeled prologue iterations are
not known. Hence guards remain the same. */
- (void) add_stmt_cost (target_cost_data, 2, cond_branch_taken,
+ (void) add_stmt_cost (target_cost_data, 1, cond_branch_taken,
NULL, 0, vect_prologue);
- (void) add_stmt_cost (target_cost_data, 2, cond_branch_not_taken,
+ (void) add_stmt_cost (target_cost_data, 1, cond_branch_not_taken,
NULL, 0, vect_prologue);
- /* FORNOW: Don't attempt to pass individual scalar instructions to
- the model; just assume linear cost for scalar iterations. */
- (void) add_stmt_cost (target_cost_data,
- peel_iters_prologue * scalar_single_iter_stmts,
- scalar_stmt, NULL, 0, vect_prologue);
- (void) add_stmt_cost (target_cost_data,
- peel_iters_epilogue * scalar_single_iter_stmts,
- scalar_stmt, NULL, 0, vect_epilogue);
+ (void) add_stmt_cost (target_cost_data, 1, cond_branch_taken,
+ NULL, 0, vect_epilogue);
+ (void) add_stmt_cost (target_cost_data, 1, cond_branch_not_taken,
+ NULL, 0, vect_epilogue);
+ stmt_info_for_cost *si;
+ int j;
+ FOR_EACH_VEC_ELT (scalar_cost_vec, j, si)
+ {
+ struct _stmt_vec_info *stmt_info
+ = si->stmt ? vinfo_for_stmt (si->stmt) : NULL;
+ (void) add_stmt_cost (target_cost_data,
+ si->count * peel_iters_prologue,
+ si->kind, stmt_info, si->misalign,
+ vect_prologue);
+ (void) add_stmt_cost (target_cost_data,
+ si->count * peel_iters_epilogue,
+ si->kind, stmt_info, si->misalign,
+ vect_epilogue);
+ }
}
else
{
@@ -2892,7 +2913,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
(void) vect_get_known_peeling_cost (loop_vinfo, peel_iters_prologue,
&peel_iters_epilogue,
- scalar_single_iter_stmts,
+ &scalar_cost_vec,
&prologue_cost_vec,
&epilogue_cost_vec);
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 0ede62390f6..66d592d523a 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1101,10 +1101,12 @@ extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *,
extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *);
extern tree get_initial_def_for_reduction (gimple, tree, tree *);
extern int vect_min_worthwhile_factor (enum tree_code);
-extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, int,
+extern int vect_get_known_peeling_cost (loop_vec_info, int, int *,
+ stmt_vector_for_cost *,
stmt_vector_for_cost *,
stmt_vector_for_cost *);
-extern int vect_get_single_scalar_iteration_cost (loop_vec_info);
+extern int vect_get_single_scalar_iteration_cost (loop_vec_info,
+ stmt_vector_for_cost *);
/* In tree-vect-slp.c. */
extern void vect_free_slp_instance (slp_instance);
diff --git a/gcc/tree.c b/gcc/tree.c
index 19770af5912..8e68f4620ec 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5185,6 +5185,7 @@ need_assembler_name_p (tree decl)
&& decl == TYPE_NAME (TREE_TYPE (decl))
&& !is_lang_specific (TREE_TYPE (decl))
&& AGGREGATE_TYPE_P (TREE_TYPE (decl))
+ && !TYPE_ARTIFICIAL (TREE_TYPE (decl))
&& !variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)
&& !type_in_anonymous_namespace_p (TREE_TYPE (decl)))
return !DECL_ASSEMBLER_NAME_SET_P (decl);
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index daaa11ea127..829abba8cf9 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/61977
+ * lex.c (cpp_peek_token): Temporarily clear pfile->cb.line_change.
+
2015-03-23 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/65238
diff --git a/libcpp/lex.c b/libcpp/lex.c
index bca56299132..d1e221110fc 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -2080,6 +2080,12 @@ cpp_peek_token (cpp_reader *pfile, int index)
count = index;
pfile->keep_tokens++;
+ /* For peeked tokens temporarily disable line_change reporting,
+ until the tokens are parsed for real. */
+ void (*line_change) (cpp_reader *, const cpp_token *, int)
+ = pfile->cb.line_change;
+ pfile->cb.line_change = NULL;
+
do
{
peektok = _cpp_lex_token (pfile);
@@ -2090,6 +2096,7 @@ cpp_peek_token (cpp_reader *pfile, int index)
_cpp_backup_tokens_direct (pfile, count + 1);
pfile->keep_tokens--;
+ pfile->cb.line_change = line_change;
return peektok;
}
diff --git a/libgo/go/cmd/go/build.go b/libgo/go/cmd/go/build.go
index 22d37f3fa3b..781a43b5d99 100644
--- a/libgo/go/cmd/go/build.go
+++ b/libgo/go/cmd/go/build.go
@@ -1921,6 +1921,7 @@ func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []
// and all LDFLAGS from cgo dependencies.
apackagesSeen := make(map[*Package]bool)
afiles := []string{}
+ xfiles := []string{}
ldflags := b.gccArchArgs()
cgoldflags := []string{}
usesCgo := false
@@ -1936,7 +1937,12 @@ func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []
if !a.p.Standard {
if a.p != nil && !apackagesSeen[a.p] {
apackagesSeen[a.p] = true
- if a.p.fake {
+ if a.p.fake && a.p.external {
+ // external _tests, if present must come before
+ // internal _tests. Store these on a seperate list
+ // and place them at the head after this loop.
+ xfiles = append(xfiles, a.target)
+ } else if a.p.fake {
// move _test files to the top of the link order
afiles = append([]string{a.target}, afiles...)
} else {
@@ -1945,6 +1951,7 @@ func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []
}
}
}
+ afiles = append(xfiles, afiles...)
for _, a := range allactions {
if a.p != nil {
diff --git a/libgo/go/cmd/go/pkg.go b/libgo/go/cmd/go/pkg.go
index 62f6b4adf57..ef440dd3b74 100644
--- a/libgo/go/cmd/go/pkg.go
+++ b/libgo/go/cmd/go/pkg.go
@@ -83,6 +83,7 @@ type Package struct {
allgofiles []string // gofiles + IgnoredGoFiles, absolute paths
target string // installed file for this package (may be executable)
fake bool // synthesized package
+ external bool // synthesized external test package
forceBuild bool // this package must be rebuilt
forceLibrary bool // this package is a library (even if named "main")
cmdline bool // defined by files listed on command line
diff --git a/libgo/go/cmd/go/test.go b/libgo/go/cmd/go/test.go
index cc0a9acf45d..5cf7aaf0716 100644
--- a/libgo/go/cmd/go/test.go
+++ b/libgo/go/cmd/go/test.go
@@ -692,10 +692,11 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
build: &build.Package{
ImportPos: p.build.XTestImportPos,
},
- imports: ximports,
- pkgdir: testDir,
- fake: true,
- Stale: true,
+ imports: ximports,
+ pkgdir: testDir,
+ fake: true,
+ external: true,
+ Stale: true,
}
if pxtestNeedsPtest {
pxtest.imports = append(pxtest.imports, ptest)
diff --git a/libgo/runtime/chan.c b/libgo/runtime/chan.c
deleted file mode 100644
index 4559c0f2d0d..00000000000
--- a/libgo/runtime/chan.c
+++ /dev/null
@@ -1,1186 +0,0 @@
-// AUTO-GENERATED by autogen.sh; DO NOT EDIT
-
-#include "runtime.h"
-#include "arch.h"
-#include "go-type.h"
-#include "race.h"
-#include "malloc.h"
-#include "chan.h"
-
-#line 13 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-uint32 runtime_Hchansize = sizeof ( Hchan ) ;
-#line 15 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void dequeueg ( WaitQ* ) ;
-static SudoG* dequeue ( WaitQ* ) ;
-static void enqueue ( WaitQ* , SudoG* ) ;
-static void racesync ( Hchan* , SudoG* ) ;
-#line 20 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static Hchan*
-makechan ( ChanType *t , int64 hint )
-{
-Hchan *c;
-uintptr n;
-const Type *elem;
-#line 27 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-elem = t->__element_type;
-#line 30 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( elem->__size >= ( 1<<16 ) )
-runtime_throw ( "makechan: invalid channel element type" ) ;
-#line 33 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( hint < 0 || ( intgo ) hint != hint || ( elem->__size > 0 && ( uintptr ) hint > ( MaxMem - sizeof ( *c ) ) / elem->__size ) )
-runtime_panicstring ( "makechan: size out of range" ) ;
-#line 36 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-n = sizeof ( *c ) ;
-n = ROUND ( n , elem->__align ) ;
-#line 40 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-c = ( Hchan* ) runtime_mallocgc ( sizeof ( *c ) + hint*elem->__size , ( uintptr ) t | TypeInfo_Chan , 0 ) ;
-c->elemsize = elem->__size;
-c->elemtype = elem;
-c->dataqsiz = hint;
-#line 45 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "makechan: chan=%p; elemsize=%D; dataqsiz=%D\n" ,
-c , ( int64 ) elem->__size , ( int64 ) c->dataqsiz ) ;
-#line 49 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-return c;
-}
-Hchan* reflect_makechan(ChanType* t, uint64 size) __asm__ (GOSYM_PREFIX "reflect.makechan");
-Hchan* reflect_makechan(ChanType* t, uint64 size)
-{
- Hchan* c;
-#line 52 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- c = makechan(t, size);
-return c;
-}
-
-#line 56 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-Hchan*
-__go_new_channel ( ChanType *t , uintptr hint )
-{
-return makechan ( t , hint ) ;
-}
-#line 62 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-Hchan*
-__go_new_channel_big ( ChanType *t , uint64 hint )
-{
-return makechan ( t , hint ) ;
-}
-#line 82 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static bool
-chansend ( ChanType *t , Hchan *c , byte *ep , bool block , void *pc )
-{
-SudoG *sg;
-SudoG mysg;
-G* gp;
-int64 t0;
-G* g;
-#line 91 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-g = runtime_g ( ) ;
-#line 93 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled )
-runtime_racereadobjectpc ( ep , t->__element_type , runtime_getcallerpc ( &t ) , chansend ) ;
-#line 96 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c == nil ) {
-USED ( t ) ;
-if ( !block )
-return false;
-runtime_park ( nil , nil , "chan send (nil chan)" ) ;
-return false;
-}
-#line 104 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( runtime_gcwaiting ( ) )
-runtime_gosched ( ) ;
-#line 107 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug ) {
-runtime_printf ( "chansend: chan=%p\n" , c ) ;
-}
-#line 111 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-t0 = 0;
-mysg.releasetime = 0;
-if ( runtime_blockprofilerate > 0 ) {
-t0 = runtime_cputicks ( ) ;
-mysg.releasetime = -1;
-}
-#line 118 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_lock ( c ) ;
-if ( raceenabled )
-runtime_racereadpc ( c , pc , chansend ) ;
-if ( c->closed )
-goto closed;
-#line 124 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c->dataqsiz > 0 )
-goto asynch;
-#line 127 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sg = dequeue ( &c->recvq ) ;
-if ( sg != nil ) {
-if ( raceenabled )
-racesync ( c , sg ) ;
-runtime_unlock ( c ) ;
-#line 133 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-gp = sg->g;
-gp->param = sg;
-if ( sg->elem != nil )
-runtime_memmove ( sg->elem , ep , c->elemsize ) ;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-return true;
-}
-#line 143 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( !block ) {
-runtime_unlock ( c ) ;
-return false;
-}
-#line 148 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-mysg.elem = ep;
-mysg.g = g;
-mysg.selectdone = nil;
-g->param = nil;
-enqueue ( &c->sendq , &mysg ) ;
-runtime_parkunlock ( c , "chan send" ) ;
-#line 155 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( g->param == nil ) {
-runtime_lock ( c ) ;
-if ( !c->closed )
-runtime_throw ( "chansend: spurious wakeup" ) ;
-goto closed;
-}
-#line 162 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( mysg.releasetime > 0 )
-runtime_blockevent ( mysg.releasetime - t0 , 2 ) ;
-#line 165 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-return true;
-#line 167 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-asynch:
-if ( c->closed )
-goto closed;
-#line 171 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c->qcount >= c->dataqsiz ) {
-if ( !block ) {
-runtime_unlock ( c ) ;
-return false;
-}
-mysg.g = g;
-mysg.elem = nil;
-mysg.selectdone = nil;
-enqueue ( &c->sendq , &mysg ) ;
-runtime_parkunlock ( c , "chan send" ) ;
-#line 182 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_lock ( c ) ;
-goto asynch;
-}
-#line 186 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled )
-runtime_racerelease ( chanbuf ( c , c->sendx ) ) ;
-#line 189 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_memmove ( chanbuf ( c , c->sendx ) , ep , c->elemsize ) ;
-if ( ++c->sendx == c->dataqsiz )
-c->sendx = 0;
-c->qcount++;
-#line 194 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sg = dequeue ( &c->recvq ) ;
-if ( sg != nil ) {
-gp = sg->g;
-runtime_unlock ( c ) ;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-} else
-runtime_unlock ( c ) ;
-if ( mysg.releasetime > 0 )
-runtime_blockevent ( mysg.releasetime - t0 , 2 ) ;
-return true;
-#line 207 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-closed:
-runtime_unlock ( c ) ;
-runtime_panicstring ( "send on closed channel" ) ;
-return false;
-}
-#line 214 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static bool
-chanrecv ( ChanType *t , Hchan* c , byte *ep , bool block , bool *received )
-{
-SudoG *sg;
-SudoG mysg;
-G *gp;
-int64 t0;
-G *g;
-#line 223 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( runtime_gcwaiting ( ) )
-runtime_gosched ( ) ;
-#line 228 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "chanrecv: chan=%p\n" , c ) ;
-#line 231 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-g = runtime_g ( ) ;
-#line 233 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c == nil ) {
-USED ( t ) ;
-if ( !block )
-return false;
-runtime_park ( nil , nil , "chan receive (nil chan)" ) ;
-return false;
-}
-#line 241 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-t0 = 0;
-mysg.releasetime = 0;
-if ( runtime_blockprofilerate > 0 ) {
-t0 = runtime_cputicks ( ) ;
-mysg.releasetime = -1;
-}
-#line 248 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_lock ( c ) ;
-if ( c->dataqsiz > 0 )
-goto asynch;
-#line 252 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c->closed )
-goto closed;
-#line 255 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sg = dequeue ( &c->sendq ) ;
-if ( sg != nil ) {
-if ( raceenabled )
-racesync ( c , sg ) ;
-runtime_unlock ( c ) ;
-#line 261 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( ep != nil )
-runtime_memmove ( ep , sg->elem , c->elemsize ) ;
-gp = sg->g;
-gp->param = sg;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-#line 269 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( received != nil )
-*received = true;
-return true;
-}
-#line 274 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( !block ) {
-runtime_unlock ( c ) ;
-return false;
-}
-#line 279 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-mysg.elem = ep;
-mysg.g = g;
-mysg.selectdone = nil;
-g->param = nil;
-enqueue ( &c->recvq , &mysg ) ;
-runtime_parkunlock ( c , "chan receive" ) ;
-#line 286 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( g->param == nil ) {
-runtime_lock ( c ) ;
-if ( !c->closed )
-runtime_throw ( "chanrecv: spurious wakeup" ) ;
-goto closed;
-}
-#line 293 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( received != nil )
-*received = true;
-if ( mysg.releasetime > 0 )
-runtime_blockevent ( mysg.releasetime - t0 , 2 ) ;
-return true;
-#line 299 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-asynch:
-if ( c->qcount <= 0 ) {
-if ( c->closed )
-goto closed;
-#line 304 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( !block ) {
-runtime_unlock ( c ) ;
-if ( received != nil )
-*received = false;
-return false;
-}
-mysg.g = g;
-mysg.elem = nil;
-mysg.selectdone = nil;
-enqueue ( &c->recvq , &mysg ) ;
-runtime_parkunlock ( c , "chan receive" ) ;
-#line 316 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_lock ( c ) ;
-goto asynch;
-}
-#line 320 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled )
-runtime_raceacquire ( chanbuf ( c , c->recvx ) ) ;
-#line 323 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( ep != nil )
-runtime_memmove ( ep , chanbuf ( c , c->recvx ) , c->elemsize ) ;
-runtime_memclr ( chanbuf ( c , c->recvx ) , c->elemsize ) ;
-if ( ++c->recvx == c->dataqsiz )
-c->recvx = 0;
-c->qcount--;
-#line 330 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sg = dequeue ( &c->sendq ) ;
-if ( sg != nil ) {
-gp = sg->g;
-runtime_unlock ( c ) ;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-} else
-runtime_unlock ( c ) ;
-#line 340 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( received != nil )
-*received = true;
-if ( mysg.releasetime > 0 )
-runtime_blockevent ( mysg.releasetime - t0 , 2 ) ;
-return true;
-#line 346 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-closed:
-if ( ep != nil )
-runtime_memclr ( ep , c->elemsize ) ;
-if ( received != nil )
-*received = false;
-if ( raceenabled )
-runtime_raceacquire ( c ) ;
-runtime_unlock ( c ) ;
-if ( mysg.releasetime > 0 )
-runtime_blockevent ( mysg.releasetime - t0 , 2 ) ;
-return true;
-}
-#line 361 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-void
-__go_send_small ( ChanType *t , Hchan* c , uint64 val )
-{
-union
-{
-byte b[sizeof ( uint64 ) ];
-uint64 v;
-} u;
-byte *v;
-#line 371 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-u.v = val;
-#ifndef WORDS_BIGENDIAN
-v = u.b;
-#else
-v = u.b + sizeof ( uint64 ) - t->__element_type->__size;
-#endif
-chansend ( t , c , v , true , runtime_getcallerpc ( &t ) ) ;
-}
-#line 382 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-void
-__go_send_big ( ChanType *t , Hchan* c , byte* v )
-{
-chansend ( t , c , v , true , runtime_getcallerpc ( &t ) ) ;
-}
-#line 390 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-void
-__go_receive ( ChanType *t , Hchan* c , byte* v )
-{
-chanrecv ( t , c , v , true , nil ) ;
-}
-#line 396 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-_Bool runtime_chanrecv2 ( ChanType *t , Hchan* c , byte* v )
-__asm__ ( GOSYM_PREFIX "runtime.chanrecv2" ) ;
-#line 399 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-_Bool
-runtime_chanrecv2 ( ChanType *t , Hchan* c , byte* v )
-{
-bool received = false;
-#line 404 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-chanrecv ( t , c , v , true , &received ) ;
-return received;
-}
-bool runtime_selectnbsend(ChanType* t, Hchan* c, byte* elem) __asm__ (GOSYM_PREFIX "runtime.selectnbsend");
-bool runtime_selectnbsend(ChanType* t, Hchan* c, byte* elem)
-{
- bool selected;
-#line 425 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- selected = chansend(t, c, elem, false, runtime_getcallerpc(&t));
-return selected;
-}
-bool runtime_selectnbrecv(ChanType* t, byte* elem, Hchan* c) __asm__ (GOSYM_PREFIX "runtime.selectnbrecv");
-bool runtime_selectnbrecv(ChanType* t, byte* elem, Hchan* c)
-{
- bool selected;
-#line 446 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- selected = chanrecv(t, c, elem, false, nil);
-return selected;
-}
-bool runtime_selectnbrecv2(ChanType* t, byte* elem, bool* received, Hchan* c) __asm__ (GOSYM_PREFIX "runtime.selectnbrecv2");
-bool runtime_selectnbrecv2(ChanType* t, byte* elem, bool* received, Hchan* c)
-{
- bool selected;
-#line 467 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- bool r;
-
- selected = chanrecv(t, c, elem, false, received == nil ? nil : &r);
- if(received != nil)
- *received = r;
-return selected;
-}
-bool reflect_chansend(ChanType* t, Hchan* c, byte* elem, bool nb) __asm__ (GOSYM_PREFIX "reflect.chansend");
-bool reflect_chansend(ChanType* t, Hchan* c, byte* elem, bool nb)
-{
- bool selected;
-#line 475 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- selected = chansend(t, c, elem, !nb, runtime_getcallerpc(&t));
-return selected;
-}
-struct reflect_chanrecv_ret {
- bool selected;
- bool received;
-};
-struct reflect_chanrecv_ret reflect_chanrecv(ChanType* t, Hchan* c, bool nb, byte* elem) __asm__ (GOSYM_PREFIX "reflect.chanrecv");
-struct reflect_chanrecv_ret reflect_chanrecv(ChanType* t, Hchan* c, bool nb, byte* elem)
-{
- bool selected;
- bool received;
-#line 479 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- received = false;
- selected = chanrecv(t, c, elem, !nb, &received);
- {
- struct reflect_chanrecv_ret __ret;
- __ret.selected = selected;
- __ret.received = received;
- return __ret;
- }
-}
-
-#line 484 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static Select* newselect ( int32 ) ;
-byte* runtime_newselect(int32 size) __asm__ (GOSYM_PREFIX "runtime.newselect");
-byte* runtime_newselect(int32 size)
-{
- byte* sel;
-#line 486 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- sel = (byte*)newselect(size);
-return sel;
-}
-
-#line 490 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static Select*
-newselect ( int32 size )
-{
-int32 n;
-Select *sel;
-#line 496 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-n = 0;
-if ( size > 1 )
-n = size-1;
-#line 504 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sel = runtime_mal ( sizeof ( *sel ) +
-n*sizeof ( sel->scase[0] ) +
-size*sizeof ( sel->lockorder[0] ) +
-size*sizeof ( sel->pollorder[0] ) ) ;
-#line 509 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sel->tcase = size;
-sel->ncase = 0;
-sel->lockorder = ( void* ) ( sel->scase + size ) ;
-sel->pollorder = ( void* ) ( sel->lockorder + size ) ;
-#line 514 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "newselect s=%p size=%d\n" , sel , size ) ;
-return sel;
-}
-#line 520 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void selectsend ( Select *sel , Hchan *c , int index , void *elem ) ;
-void runtime_selectsend(Select* sel, Hchan* c, byte* elem, int32 index) __asm__ (GOSYM_PREFIX "runtime.selectsend");
-void runtime_selectsend(Select* sel, Hchan* c, byte* elem, int32 index)
-{
-#line 522 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- // nil cases do not compete
- if(c != nil)
- selectsend(sel, c, index, elem);
-}
-
-#line 528 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-selectsend ( Select *sel , Hchan *c , int index , void *elem )
-{
-int32 i;
-Scase *cas;
-#line 534 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-i = sel->ncase;
-if ( i >= sel->tcase )
-runtime_throw ( "selectsend: too many cases" ) ;
-sel->ncase = i+1;
-cas = &sel->scase[i];
-#line 540 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-cas->index = index;
-cas->chan = c;
-cas->kind = CaseSend;
-cas->sg.elem = elem;
-#line 545 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "selectsend s=%p index=%d chan=%p\n" ,
-sel , cas->index , cas->chan ) ;
-}
-#line 551 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void selectrecv ( Select *sel , Hchan *c , int index , void *elem , bool* ) ;
-void runtime_selectrecv(Select* sel, Hchan* c, byte* elem, int32 index) __asm__ (GOSYM_PREFIX "runtime.selectrecv");
-void runtime_selectrecv(Select* sel, Hchan* c, byte* elem, int32 index)
-{
-#line 553 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- // nil cases do not compete
- if(c != nil)
- selectrecv(sel, c, index, elem, nil);
-}
-void runtime_selectrecv2(Select* sel, Hchan* c, byte* elem, bool* received, int32 index) __asm__ (GOSYM_PREFIX "runtime.selectrecv2");
-void runtime_selectrecv2(Select* sel, Hchan* c, byte* elem, bool* received, int32 index)
-{
-#line 559 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- // nil cases do not compete
- if(c != nil)
- selectrecv(sel, c, index, elem, received);
-}
-
-#line 565 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-selectrecv ( Select *sel , Hchan *c , int index , void *elem , bool *received )
-{
-int32 i;
-Scase *cas;
-#line 571 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-i = sel->ncase;
-if ( i >= sel->tcase )
-runtime_throw ( "selectrecv: too many cases" ) ;
-sel->ncase = i+1;
-cas = &sel->scase[i];
-cas->index = index;
-cas->chan = c;
-#line 579 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-cas->kind = CaseRecv;
-cas->sg.elem = elem;
-cas->receivedp = received;
-#line 583 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "selectrecv s=%p index=%d chan=%p\n" ,
-sel , cas->index , cas->chan ) ;
-}
-#line 589 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void selectdefault ( Select* , int ) ;
-void runtime_selectdefault(Select* sel, int32 index) __asm__ (GOSYM_PREFIX "runtime.selectdefault");
-void runtime_selectdefault(Select* sel, int32 index)
-{
-#line 591 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- selectdefault(sel, index);
-}
-
-#line 595 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-selectdefault ( Select *sel , int32 index )
-{
-int32 i;
-Scase *cas;
-#line 601 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-i = sel->ncase;
-if ( i >= sel->tcase )
-runtime_throw ( "selectdefault: too many cases" ) ;
-sel->ncase = i+1;
-cas = &sel->scase[i];
-cas->index = index;
-cas->chan = nil;
-#line 609 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-cas->kind = CaseDefault;
-#line 611 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "selectdefault s=%p index=%d\n" ,
-sel , cas->index ) ;
-}
-#line 616 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-sellock ( Select *sel )
-{
-uint32 i;
-Hchan *c , *c0;
-#line 622 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-c = nil;
-for ( i=0; i<sel->ncase; i++ ) {
-c0 = sel->lockorder[i];
-if ( c0 && c0 != c ) {
-c = sel->lockorder[i];
-runtime_lock ( c ) ;
-}
-}
-}
-#line 632 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-selunlock ( Select *sel )
-{
-int32 i , n , r;
-Hchan *c;
-#line 646 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-n = ( int32 ) sel->ncase;
-r = 0;
-#line 649 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( n>0 && sel->lockorder[0] == nil )
-r = 1;
-for ( i = n-1; i >= r; i-- ) {
-c = sel->lockorder[i];
-if ( i>0 && sel->lockorder[i-1] == c )
-continue;
-runtime_unlock ( c ) ;
-}
-}
-#line 659 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static bool
-selparkcommit ( G *gp , void *sel )
-{
-USED ( gp ) ;
-selunlock ( sel ) ;
-return true;
-}
-void runtime_block() __asm__ (GOSYM_PREFIX "runtime.block");
-void runtime_block()
-{
-#line 667 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- runtime_park(nil, nil, "select (no cases)"); // forever
-}
-
-#line 671 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static int selectgo ( Select** ) ;
-int32 runtime_selectgo(Select* sel) __asm__ (GOSYM_PREFIX "runtime.selectgo");
-int32 runtime_selectgo(Select* sel)
-{
- int32 ret;
-#line 675 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- return selectgo(&sel);
-return ret;
-}
-
-#line 679 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static int
-selectgo ( Select **selp )
-{
-Select *sel;
-uint32 o , i , j , k , done;
-int64 t0;
-Scase *cas , *dfl;
-Hchan *c;
-SudoG *sg;
-G *gp;
-int index;
-G *g;
-#line 692 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sel = *selp;
-if ( runtime_gcwaiting ( ) )
-runtime_gosched ( ) ;
-#line 696 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "select: sel=%p\n" , sel ) ;
-#line 699 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-g = runtime_g ( ) ;
-#line 701 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-t0 = 0;
-if ( runtime_blockprofilerate > 0 ) {
-t0 = runtime_cputicks ( ) ;
-for ( i=0; i<sel->ncase; i++ )
-sel->scase[i].sg.releasetime = -1;
-}
-#line 717 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-for ( i=0; i<sel->ncase; i++ )
-sel->pollorder[i] = i;
-for ( i=1; i<sel->ncase; i++ ) {
-o = sel->pollorder[i];
-j = runtime_fastrand1 ( ) % ( i+1 ) ;
-sel->pollorder[i] = sel->pollorder[j];
-sel->pollorder[j] = o;
-}
-#line 728 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-for ( i=0; i<sel->ncase; i++ ) {
-j = i;
-c = sel->scase[j].chan;
-while ( j > 0 && sel->lockorder[k= ( j-1 ) /2] < c ) {
-sel->lockorder[j] = sel->lockorder[k];
-j = k;
-}
-sel->lockorder[j] = c;
-}
-for ( i=sel->ncase; i-->0; ) {
-c = sel->lockorder[i];
-sel->lockorder[i] = sel->lockorder[0];
-j = 0;
-for ( ;; ) {
-k = j*2+1;
-if ( k >= i )
-break;
-if ( k+1 < i && sel->lockorder[k] < sel->lockorder[k+1] )
-k++;
-if ( c < sel->lockorder[k] ) {
-sel->lockorder[j] = sel->lockorder[k];
-j = k;
-continue;
-}
-break;
-}
-sel->lockorder[j] = c;
-}
-#line 763 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sellock ( sel ) ;
-#line 765 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-loop:
-#line 767 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-dfl = nil;
-for ( i=0; i<sel->ncase; i++ ) {
-o = sel->pollorder[i];
-cas = &sel->scase[o];
-c = cas->chan;
-#line 773 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-switch ( cas->kind ) {
-case CaseRecv:
-if ( c->dataqsiz > 0 ) {
-if ( c->qcount > 0 )
-goto asyncrecv;
-} else {
-sg = dequeue ( &c->sendq ) ;
-if ( sg != nil )
-goto syncrecv;
-}
-if ( c->closed )
-goto rclose;
-break;
-#line 787 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-case CaseSend:
-if ( raceenabled )
-runtime_racereadpc ( c , runtime_selectgo , chansend ) ;
-if ( c->closed )
-goto sclose;
-if ( c->dataqsiz > 0 ) {
-if ( c->qcount < c->dataqsiz )
-goto asyncsend;
-} else {
-sg = dequeue ( &c->recvq ) ;
-if ( sg != nil )
-goto syncsend;
-}
-break;
-#line 802 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-case CaseDefault:
-dfl = cas;
-break;
-}
-}
-#line 808 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( dfl != nil ) {
-selunlock ( sel ) ;
-cas = dfl;
-goto retc;
-}
-#line 816 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-done = 0;
-for ( i=0; i<sel->ncase; i++ ) {
-o = sel->pollorder[i];
-cas = &sel->scase[o];
-c = cas->chan;
-sg = &cas->sg;
-sg->g = g;
-sg->selectdone = &done;
-#line 825 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-switch ( cas->kind ) {
-case CaseRecv:
-enqueue ( &c->recvq , sg ) ;
-break;
-#line 830 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-case CaseSend:
-enqueue ( &c->sendq , sg ) ;
-break;
-}
-}
-#line 836 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-g->param = nil;
-runtime_park ( selparkcommit , sel , "select" ) ;
-#line 839 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sellock ( sel ) ;
-sg = g->param;
-#line 844 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-for ( i=0; i<sel->ncase; i++ ) {
-cas = &sel->scase[i];
-if ( cas != ( Scase* ) sg ) {
-c = cas->chan;
-if ( cas->kind == CaseSend )
-dequeueg ( &c->sendq ) ;
-else
-dequeueg ( &c->recvq ) ;
-}
-}
-#line 855 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( sg == nil )
-goto loop;
-#line 858 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-cas = ( Scase* ) sg;
-c = cas->chan;
-#line 861 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c->dataqsiz > 0 )
-runtime_throw ( "selectgo: shouldn't happen" ) ;
-#line 864 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( debug )
-runtime_printf ( "wait-return: sel=%p c=%p cas=%p kind=%d\n" ,
-sel , c , cas , cas->kind ) ;
-#line 868 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( cas->kind == CaseRecv ) {
-if ( cas->receivedp != nil )
-*cas->receivedp = true;
-}
-#line 873 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-if ( cas->kind == CaseRecv && cas->sg.elem != nil )
-runtime_racewriteobjectpc ( cas->sg.elem , c->elemtype , selectgo , chanrecv ) ;
-else if ( cas->kind == CaseSend )
-runtime_racereadobjectpc ( cas->sg.elem , c->elemtype , selectgo , chansend ) ;
-}
-#line 880 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-selunlock ( sel ) ;
-goto retc;
-#line 883 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-asyncrecv:
-#line 885 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-if ( cas->sg.elem != nil )
-runtime_racewriteobjectpc ( cas->sg.elem , c->elemtype , selectgo , chanrecv ) ;
-runtime_raceacquire ( chanbuf ( c , c->recvx ) ) ;
-}
-if ( cas->receivedp != nil )
-*cas->receivedp = true;
-if ( cas->sg.elem != nil )
-runtime_memmove ( cas->sg.elem , chanbuf ( c , c->recvx ) , c->elemsize ) ;
-runtime_memclr ( chanbuf ( c , c->recvx ) , c->elemsize ) ;
-if ( ++c->recvx == c->dataqsiz )
-c->recvx = 0;
-c->qcount--;
-sg = dequeue ( &c->sendq ) ;
-if ( sg != nil ) {
-gp = sg->g;
-selunlock ( sel ) ;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-} else {
-selunlock ( sel ) ;
-}
-goto retc;
-#line 910 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-asyncsend:
-#line 912 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-runtime_racerelease ( chanbuf ( c , c->sendx ) ) ;
-runtime_racereadobjectpc ( cas->sg.elem , c->elemtype , selectgo , chansend ) ;
-}
-runtime_memmove ( chanbuf ( c , c->sendx ) , cas->sg.elem , c->elemsize ) ;
-if ( ++c->sendx == c->dataqsiz )
-c->sendx = 0;
-c->qcount++;
-sg = dequeue ( &c->recvq ) ;
-if ( sg != nil ) {
-gp = sg->g;
-selunlock ( sel ) ;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-} else {
-selunlock ( sel ) ;
-}
-goto retc;
-#line 932 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-syncrecv:
-#line 934 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-if ( cas->sg.elem != nil )
-runtime_racewriteobjectpc ( cas->sg.elem , c->elemtype , selectgo , chanrecv ) ;
-racesync ( c , sg ) ;
-}
-selunlock ( sel ) ;
-if ( debug )
-runtime_printf ( "syncrecv: sel=%p c=%p o=%d\n" , sel , c , o ) ;
-if ( cas->receivedp != nil )
-*cas->receivedp = true;
-if ( cas->sg.elem != nil )
-runtime_memmove ( cas->sg.elem , sg->elem , c->elemsize ) ;
-gp = sg->g;
-gp->param = sg;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-goto retc;
-#line 953 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-rclose:
-#line 955 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-selunlock ( sel ) ;
-if ( cas->receivedp != nil )
-*cas->receivedp = false;
-if ( cas->sg.elem != nil )
-runtime_memclr ( cas->sg.elem , c->elemsize ) ;
-if ( raceenabled )
-runtime_raceacquire ( c ) ;
-goto retc;
-#line 964 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-syncsend:
-#line 966 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-runtime_racereadobjectpc ( cas->sg.elem , c->elemtype , selectgo , chansend ) ;
-racesync ( c , sg ) ;
-}
-selunlock ( sel ) ;
-if ( debug )
-runtime_printf ( "syncsend: sel=%p c=%p o=%d\n" , sel , c , o ) ;
-if ( sg->elem != nil )
-runtime_memmove ( sg->elem , cas->sg.elem , c->elemsize ) ;
-gp = sg->g;
-gp->param = sg;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-#line 981 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-retc:
-#line 983 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-index = cas->index;
-if ( cas->sg.releasetime > 0 )
-runtime_blockevent ( cas->sg.releasetime - t0 , 2 ) ;
-runtime_free ( sel ) ;
-return index;
-#line 989 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-sclose:
-#line 991 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-selunlock ( sel ) ;
-runtime_panicstring ( "send on closed channel" ) ;
-return 0;
-}
-#line 997 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-typedef struct runtimeSelect runtimeSelect;
-struct runtimeSelect
-{
-uintptr dir;
-ChanType *typ;
-Hchan *ch;
-byte *val;
-} ;
-#line 1007 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-enum SelectDir {
-SelectSend = 1 ,
-SelectRecv ,
-SelectDefault ,
-} ;
-struct reflect_rselect_ret {
- intgo chosen;
- bool recvOK;
-};
-struct reflect_rselect_ret reflect_rselect(Slice cases) __asm__ (GOSYM_PREFIX "reflect.rselect");
-struct reflect_rselect_ret reflect_rselect(Slice cases)
-{
- intgo chosen;
- bool recvOK;
-#line 1013 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- int32 i;
- Select *sel;
- runtimeSelect* rcase, *rc;
-
- chosen = -1;
- recvOK = false;
-
- rcase = (runtimeSelect*)cases.__values;
-
- sel = newselect(cases.__count);
- for(i=0; i<cases.__count; i++) {
- rc = &rcase[i];
- switch(rc->dir) {
- case SelectDefault:
- selectdefault(sel, i);
- break;
- case SelectSend:
- if(rc->ch == nil)
- break;
- selectsend(sel, rc->ch, i, rc->val);
- break;
- case SelectRecv:
- if(rc->ch == nil)
- break;
- selectrecv(sel, rc->ch, i, rc->val, &recvOK);
- break;
- }
- }
-
- chosen = (intgo)(uintptr)selectgo(&sel);
- {
- struct reflect_rselect_ret __ret;
- __ret.chosen = chosen;
- __ret.recvOK = recvOK;
- return __ret;
- }
-}
-
-#line 1046 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void closechan ( Hchan *c , void *pc ) ;
-void runtime_closechan(Hchan* c) __asm__ (GOSYM_PREFIX "runtime.closechan");
-void runtime_closechan(Hchan* c)
-{
-#line 1048 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- closechan(c, runtime_getcallerpc(&c));
-}
-void reflect_chanclose(Hchan* c) __asm__ (GOSYM_PREFIX "reflect.chanclose");
-void reflect_chanclose(Hchan* c)
-{
-#line 1052 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- closechan(c, runtime_getcallerpc(&c));
-}
-
-#line 1056 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-closechan ( Hchan *c , void *pc )
-{
-SudoG *sg;
-G* gp;
-#line 1062 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( c == nil )
-runtime_panicstring ( "close of nil channel" ) ;
-#line 1065 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( runtime_gcwaiting ( ) )
-runtime_gosched ( ) ;
-#line 1068 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_lock ( c ) ;
-if ( c->closed ) {
-runtime_unlock ( c ) ;
-runtime_panicstring ( "close of closed channel" ) ;
-}
-#line 1074 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( raceenabled ) {
-runtime_racewritepc ( c , pc , runtime_closechan ) ;
-runtime_racerelease ( c ) ;
-}
-#line 1079 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-c->closed = true;
-#line 1082 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-for ( ;; ) {
-sg = dequeue ( &c->recvq ) ;
-if ( sg == nil )
-break;
-gp = sg->g;
-gp->param = nil;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-}
-#line 1094 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-for ( ;; ) {
-sg = dequeue ( &c->sendq ) ;
-if ( sg == nil )
-break;
-gp = sg->g;
-gp->param = nil;
-if ( sg->releasetime )
-sg->releasetime = runtime_cputicks ( ) ;
-runtime_ready ( gp ) ;
-}
-#line 1105 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-runtime_unlock ( c ) ;
-}
-#line 1108 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-void
-__go_builtin_close ( Hchan *c )
-{
-runtime_closechan ( c ) ;
-}
-intgo reflect_chanlen(Hchan* c) __asm__ (GOSYM_PREFIX "reflect.chanlen");
-intgo reflect_chanlen(Hchan* c)
-{
- intgo len;
-#line 1114 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- if(c == nil)
- len = 0;
- else
- len = c->qcount;
-return len;
-}
-
-#line 1121 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-intgo
-__go_chan_len ( Hchan *c )
-{
-return reflect_chanlen ( c ) ;
-}
-intgo reflect_chancap(Hchan* c) __asm__ (GOSYM_PREFIX "reflect.chancap");
-intgo reflect_chancap(Hchan* c)
-{
- intgo cap;
-#line 1127 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-
- if(c == nil)
- cap = 0;
- else
- cap = c->dataqsiz;
-return cap;
-}
-
-#line 1134 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-intgo
-__go_chan_cap ( Hchan *c )
-{
-return reflect_chancap ( c ) ;
-}
-#line 1140 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static SudoG*
-dequeue ( WaitQ *q )
-{
-SudoG *sgp;
-#line 1145 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-loop:
-sgp = q->first;
-if ( sgp == nil )
-return nil;
-q->first = sgp->link;
-#line 1152 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( sgp->selectdone != nil ) {
-#line 1154 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-if ( *sgp->selectdone != 0 || !runtime_cas ( sgp->selectdone , 0 , 1 ) )
-goto loop;
-}
-#line 1158 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-return sgp;
-}
-#line 1161 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-dequeueg ( WaitQ *q )
-{
-SudoG **l , *sgp , *prevsgp;
-G *g;
-#line 1167 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-g = runtime_g ( ) ;
-prevsgp = nil;
-for ( l=&q->first; ( sgp=*l ) != nil; l=&sgp->link , prevsgp=sgp ) {
-if ( sgp->g == g ) {
-*l = sgp->link;
-if ( q->last == sgp )
-q->last = prevsgp;
-break;
-}
-}
-}
-#line 1179 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-enqueue ( WaitQ *q , SudoG *sgp )
-{
-sgp->link = nil;
-if ( q->first == nil ) {
-q->first = sgp;
-q->last = sgp;
-return;
-}
-q->last->link = sgp;
-q->last = sgp;
-}
-#line 1192 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/chan.goc"
-static void
-racesync ( Hchan *c , SudoG *sg )
-{
-runtime_racerelease ( chanbuf ( c , 0 ) ) ;
-runtime_raceacquireg ( sg->g , chanbuf ( c , 0 ) ) ;
-runtime_racereleaseg ( sg->g , chanbuf ( c , 0 ) ) ;
-runtime_raceacquire ( chanbuf ( c , 0 ) ) ;
-} \ No newline at end of file
diff --git a/libgo/runtime/cpuprof.c b/libgo/runtime/cpuprof.c
deleted file mode 100644
index 3398a92ea82..00000000000
--- a/libgo/runtime/cpuprof.c
+++ /dev/null
@@ -1,350 +0,0 @@
-// AUTO-GENERATED by autogen.sh; DO NOT EDIT
-
-#include "runtime.h"
-#include "arch.h"
-#include "malloc.h"
-#include "array.h"
-
-#line 57 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-typedef struct __go_open_array Slice;
-#define array __values
-#define len __count
-#define cap __capacity
-#line 62 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-enum
-{
-HashSize = 1<<10 ,
-LogSize = 1<<17 ,
-Assoc = 4 ,
-MaxStack = 64 ,
-} ;
-#line 70 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-typedef struct Profile Profile;
-typedef struct Bucket Bucket;
-typedef struct Entry Entry;
-#line 74 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-struct Entry {
-uintptr count;
-uintptr depth;
-uintptr stack[MaxStack];
-} ;
-#line 80 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-struct Bucket {
-Entry entry[Assoc];
-} ;
-#line 84 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-struct Profile {
-bool on;
-Note wait;
-uintptr count;
-uintptr evicts;
-uintptr lost;
-uintptr totallost;
-#line 93 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-Bucket hash[HashSize];
-#line 98 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-uintptr log[2][LogSize/2];
-uintptr nlog;
-int32 toggle;
-uint32 handoff;
-#line 106 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-uint32 wtoggle;
-bool wholding;
-bool flushing;
-bool eod_sent;
-} ;
-#line 112 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static Lock lk;
-static Profile *prof;
-#line 115 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static void tick ( uintptr* , int32 ) ;
-static void add ( Profile* , uintptr* , int32 ) ;
-static bool evict ( Profile* , Entry* ) ;
-static bool flushlog ( Profile* ) ;
-#line 120 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static uintptr eod[3] = { 0 , 1 , 0 } ;
-#line 125 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static void
-LostProfileData ( void )
-{
-}
-#line 130 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-extern void runtime_SetCPUProfileRate ( intgo )
-__asm__ ( GOSYM_PREFIX "runtime.SetCPUProfileRate" ) ;
-#line 135 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-void
-runtime_SetCPUProfileRate ( intgo hz )
-{
-uintptr *p;
-uintptr n;
-#line 142 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( hz < 0 )
-hz = 0;
-if ( hz > 1000000 )
-hz = 1000000;
-#line 147 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-runtime_lock ( &lk ) ;
-if ( hz > 0 ) {
-if ( prof == nil ) {
-prof = runtime_SysAlloc ( sizeof *prof , &mstats.other_sys ) ;
-if ( prof == nil ) {
-runtime_printf ( "runtime: cpu profiling cannot allocate memory\n" ) ;
-runtime_unlock ( &lk ) ;
-return;
-}
-}
-if ( prof->on || prof->handoff != 0 ) {
-runtime_printf ( "runtime: cannot set cpu profile rate until previous profile has finished.\n" ) ;
-runtime_unlock ( &lk ) ;
-return;
-}
-#line 163 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-prof->on = true;
-p = prof->log[0];
-#line 167 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-*p++ = 0;
-*p++ = 3;
-*p++ = 0;
-*p++ = 1000000 / hz;
-*p++ = 0;
-prof->nlog = p - prof->log[0];
-prof->toggle = 0;
-prof->wholding = false;
-prof->wtoggle = 0;
-prof->flushing = false;
-prof->eod_sent = false;
-runtime_noteclear ( &prof->wait ) ;
-#line 180 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-runtime_setcpuprofilerate ( tick , hz ) ;
-} else if ( prof != nil && prof->on ) {
-runtime_setcpuprofilerate ( nil , 0 ) ;
-prof->on = false;
-#line 187 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-for ( ;; ) {
-n = prof->handoff;
-if ( n&0x80000000 )
-runtime_printf ( "runtime: setcpuprofile(off) twice" ) ;
-if ( runtime_cas ( &prof->handoff , n , n|0x80000000 ) )
-break;
-}
-if ( n == 0 ) {
-#line 196 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-runtime_notewakeup ( &prof->wait ) ;
-}
-}
-runtime_unlock ( &lk ) ;
-}
-#line 202 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static void
-tick ( uintptr *pc , int32 n )
-{
-add ( prof , pc , n ) ;
-}
-#line 213 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static void
-add ( Profile *p , uintptr *pc , int32 n )
-{
-int32 i , j;
-uintptr h , x;
-Bucket *b;
-Entry *e;
-#line 221 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( n > MaxStack )
-n = MaxStack;
-#line 225 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-h = 0;
-for ( i=0; i<n; i++ ) {
-h = h<<8 | ( h>> ( 8* ( sizeof ( h ) -1 ) ) ) ;
-x = pc[i];
-h += x*31 + x*7 + x*3;
-}
-p->count++;
-#line 234 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-b = &p->hash[h%HashSize];
-for ( i=0; i<Assoc; i++ ) {
-e = &b->entry[i];
-if ( e->depth != ( uintptr ) n )
-continue;
-for ( j=0; j<n; j++ )
-if ( e->stack[j] != pc[j] )
-goto ContinueAssoc;
-e->count++;
-return;
-ContinueAssoc:;
-}
-#line 248 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-e = &b->entry[0];
-for ( i=1; i<Assoc; i++ )
-if ( b->entry[i].count < e->count )
-e = &b->entry[i];
-if ( e->count > 0 ) {
-if ( !evict ( p , e ) ) {
-#line 255 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-p->lost++;
-p->totallost++;
-return;
-}
-p->evicts++;
-}
-#line 263 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-e->depth = n;
-e->count = 1;
-for ( i=0; i<n; i++ )
-e->stack[i] = pc[i];
-}
-#line 275 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static bool
-evict ( Profile *p , Entry *e )
-{
-int32 i , d , nslot;
-uintptr *log , *q;
-#line 281 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-d = e->depth;
-nslot = d+2;
-log = p->log[p->toggle];
-if ( p->nlog+nslot > nelem ( p->log[0] ) ) {
-if ( !flushlog ( p ) )
-return false;
-log = p->log[p->toggle];
-}
-#line 290 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-q = log+p->nlog;
-*q++ = e->count;
-*q++ = d;
-for ( i=0; i<d; i++ )
-*q++ = e->stack[i];
-p->nlog = q - log;
-e->count = 0;
-return true;
-}
-#line 304 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-static bool
-flushlog ( Profile *p )
-{
-uintptr *log , *q;
-#line 309 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( !runtime_cas ( &p->handoff , 0 , p->nlog ) )
-return false;
-runtime_notewakeup ( &p->wait ) ;
-#line 313 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-p->toggle = 1 - p->toggle;
-log = p->log[p->toggle];
-q = log;
-if ( p->lost > 0 ) {
-*q++ = p->lost;
-*q++ = 1;
-*q++ = ( uintptr ) LostProfileData;
-}
-p->nlog = q - log;
-return true;
-}
-#line 327 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-Slice
-getprofile ( Profile *p )
-{
-uint32 i , j , n;
-Slice ret;
-Bucket *b;
-Entry *e;
-#line 335 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-ret.array = nil;
-ret.len = 0;
-ret.cap = 0;
-#line 339 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( p == nil )
-return ret;
-#line 342 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( p->wholding ) {
-#line 345 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-for ( ;; ) {
-n = p->handoff;
-if ( n == 0 ) {
-runtime_printf ( "runtime: phase error during cpu profile handoff\n" ) ;
-return ret;
-}
-if ( n & 0x80000000 ) {
-p->wtoggle = 1 - p->wtoggle;
-p->wholding = false;
-p->flushing = true;
-goto flush;
-}
-if ( runtime_cas ( &p->handoff , n , 0 ) )
-break;
-}
-p->wtoggle = 1 - p->wtoggle;
-p->wholding = false;
-}
-#line 364 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( p->flushing )
-goto flush;
-#line 367 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( !p->on && p->handoff == 0 )
-return ret;
-#line 371 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-runtime_notetsleepg ( &p->wait , -1 ) ;
-runtime_noteclear ( &p->wait ) ;
-#line 374 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-n = p->handoff;
-if ( n == 0 ) {
-runtime_printf ( "runtime: phase error during cpu profile wait\n" ) ;
-return ret;
-}
-if ( n == 0x80000000 ) {
-p->flushing = true;
-goto flush;
-}
-n &= ~0x80000000;
-#line 386 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-p->wholding = true;
-#line 388 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-ret.array = ( byte* ) p->log[p->wtoggle];
-ret.len = n*sizeof ( uintptr ) ;
-ret.cap = ret.len;
-return ret;
-#line 393 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-flush:
-#line 398 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-for ( i=0; i<HashSize; i++ ) {
-b = &p->hash[i];
-for ( j=0; j<Assoc; j++ ) {
-e = &b->entry[j];
-if ( e->count > 0 && !evict ( p , e ) ) {
-#line 404 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-goto breakflush;
-}
-}
-}
-breakflush:
-#line 411 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( p->nlog > 0 ) {
-#line 414 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-ret.array = ( byte* ) p->log[p->toggle];
-ret.len = p->nlog*sizeof ( uintptr ) ;
-ret.cap = ret.len;
-p->nlog = 0;
-return ret;
-}
-#line 422 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-if ( !p->eod_sent ) {
-#line 425 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-p->eod_sent = true;
-ret.array = ( byte* ) eod;
-ret.len = sizeof eod;
-ret.cap = ret.len;
-return ret;
-}
-#line 433 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-p->flushing = false;
-if ( !runtime_cas ( &p->handoff , p->handoff , 0 ) )
-runtime_printf ( "runtime: profile flush racing with something\n" ) ;
-return ret;
-}
-Slice runtime_CPUProfile() __asm__ (GOSYM_PREFIX "runtime.CPUProfile");
-Slice runtime_CPUProfile()
-{
- Slice ret;
-#line 441 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/cpuprof.goc"
-
- ret = getprofile(prof);
-return ret;
-}
diff --git a/libgo/runtime/lfstack.c b/libgo/runtime/lfstack.c
deleted file mode 100644
index cefe7b8fb38..00000000000
--- a/libgo/runtime/lfstack.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// AUTO-GENERATED by autogen.sh; DO NOT EDIT
-
-#include "runtime.h"
-#include "arch.h"
-#if __SIZEOF_POINTER__ == 8
-# define PTR_BITS 47
-#else
-# define PTR_BITS 32
-#endif
-#define PTR_MASK ((1ull<<PTR_BITS)-1)
-#define CNT_MASK (0ull-1)
-#if __SIZEOF_POINTER__ == 8 && (defined(__sparc__) || (defined(__sun__) && defined(__amd64__)))
-#undef PTR_BITS
-#undef CNT_MASK
-#undef PTR_MASK
-#define PTR_BITS 0
-#define CNT_MASK 7
-#define PTR_MASK ((0ull-1)<<3)
-#endif
-
-#line 33 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-void
-runtime_lfstackpush ( uint64 *head , LFNode *node )
-{
-uint64 old , new;
-#line 38 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-if ( ( uintptr ) node != ( ( uintptr ) node&PTR_MASK ) ) {
-runtime_printf ( "p=%p\n" , node ) ;
-runtime_throw ( "runtime_lfstackpush: invalid pointer" ) ;
-}
-#line 43 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-node->pushcnt++;
-new = ( uint64 ) ( uintptr ) node| ( ( ( uint64 ) node->pushcnt&CNT_MASK ) <<PTR_BITS ) ;
-for ( ;; ) {
-old = runtime_atomicload64 ( head ) ;
-node->next = ( LFNode* ) ( uintptr ) ( old&PTR_MASK ) ;
-if ( runtime_cas64 ( head , old , new ) )
-break;
-}
-}
-#line 53 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-LFNode*
-runtime_lfstackpop ( uint64 *head )
-{
-LFNode *node , *node2;
-uint64 old , new;
-#line 59 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-for ( ;; ) {
-old = runtime_atomicload64 ( head ) ;
-if ( old == 0 )
-return nil;
-node = ( LFNode* ) ( uintptr ) ( old&PTR_MASK ) ;
-node2 = runtime_atomicloadp ( &node->next ) ;
-new = 0;
-if ( node2 != nil )
-new = ( uint64 ) ( uintptr ) node2| ( ( ( uint64 ) node2->pushcnt&CNT_MASK ) <<PTR_BITS ) ;
-if ( runtime_cas64 ( head , old , new ) )
-return node;
-}
-}
-void runtime_lfstackpush_go(uint64* head, LFNode* node) __asm__ (GOSYM_PREFIX "runtime.lfstackpush_go");
-void runtime_lfstackpush_go(uint64* head, LFNode* node)
-{
-#line 73 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-
- runtime_lfstackpush(head, node);
-}
-LFNode* runtime_lfstackpop_go(uint64* head) __asm__ (GOSYM_PREFIX "runtime.lfstackpop_go");
-LFNode* runtime_lfstackpop_go(uint64* head)
-{
- LFNode* node;
-#line 77 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
-
- node = runtime_lfstackpop(head);
-return node;
-}
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index b2e7892b0ef..74a28258e2f 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/65597
+ * testsuite/libgomp.fortran/pr65597.f90: New test.
+
2015-03-27 Tom de Vries <tom@codesourcery.com>
PR testsuite/65594
diff --git a/libgomp/testsuite/libgomp.fortran/pr65597.f90 b/libgomp/testsuite/libgomp.fortran/pr65597.f90
new file mode 100644
index 00000000000..c19f077753d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr65597.f90
@@ -0,0 +1,21 @@
+! PR fortran/65597
+! { dg-do run }
+
+ integer :: i, a(151)
+ a(:) = 0
+ !$omp do simd
+ do i = 1, 151, 31
+ a(i) = a(i) + 1
+ end do
+ !$omp do simd linear (i: 31)
+ do i = 1, 151, 31
+ a(i) = a(i) + 1
+ end do
+ do i = 1, 151
+ if (mod (i, 31) .eq. 1) then
+ if (a(i) .ne. 2) call abort
+ else
+ if (a(i) .ne. 0) call abort
+ end if
+ end do
+end
diff --git a/libmpx/ChangeLog b/libmpx/ChangeLog
index 35bdeab35ee..6b05278b0d0 100644
--- a/libmpx/ChangeLog
+++ b/libmpx/ChangeLog
@@ -1,3 +1,11 @@
+2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR driver/65444
+ * configure.ac: Add check for '-z bndplt' support
+ by linker. Add link_mpx output variable.
+ * libmpx.spec.in (link_mpx): New.
+ * configure: Regenerate.
+
2015-03-12 Ilya Enkovich <ilya.enkovich@intel.com>
PR other/65384
diff --git a/libmpx/configure b/libmpx/configure
index 3bbb54c2987..aeaa4839352 100644
--- a/libmpx/configure
+++ b/libmpx/configure
@@ -670,6 +670,7 @@ am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
+link_mpx
link_libmpx
LIBMPX_SUPPORTED_FALSE
LIBMPX_SUPPORTED_TRUE
@@ -2523,6 +2524,25 @@ fi
link_libmpx="-lpthread"
+link_mpx=""
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld accepts -z bndplt" >&5
+$as_echo_n "checking whether ld accepts -z bndplt... " >&6; }
+echo "int main() {};" > conftest.c
+if { ac_try='${CC} ${CFLAGS} -Wl,-z,bndplt -o conftest conftest.c 1>&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ link_mpx="$link_mpx -z bndplt"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
am__api_version='1.11'
@@ -11648,7 +11668,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11651 "configure"
+#line 11671 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11754,7 +11774,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11757 "configure"
+#line 11777 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/libmpx/configure.ac b/libmpx/configure.ac
index fe0d3f2266e..3f8b50f8eba 100644
--- a/libmpx/configure.ac
+++ b/libmpx/configure.ac
@@ -40,7 +40,18 @@ AC_MSG_RESULT($LIBMPX_SUPPORTED)
AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
link_libmpx="-lpthread"
+link_mpx=""
+AC_MSG_CHECKING([whether ld accepts -z bndplt])
+echo "int main() {};" > conftest.c
+if AC_TRY_COMMAND([${CC} ${CFLAGS} -Wl,-z,bndplt -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+ AC_MSG_RESULT([yes])
+ link_mpx="$link_mpx -z bndplt"
+else
+ AC_MSG_RESULT([no])
+fi
AC_SUBST(link_libmpx)
+AC_SUBST(link_mpx)
AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
AM_ENABLE_MULTILIB(, ..)
diff --git a/libmpx/libmpx.spec.in b/libmpx/libmpx.spec.in
index a265e286b4f..34d0bdf165a 100644
--- a/libmpx/libmpx.spec.in
+++ b/libmpx/libmpx.spec.in
@@ -1,3 +1,5 @@
# This spec file is read by gcc when linking. It is used to specify the
-# standard libraries we need in order to link with libcilkrts.
+# standard libraries we need in order to link with libmpx.
*link_libmpx: @link_libmpx@
+
+*link_mpx: @link_mpx@
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 3183a085bef..89041ab029d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-30 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/65630
+ * config/abi/pre/gnu.ver: Export operator+ for new strings.
+ * testsuite/21_strings/basic_string/operators/char/65630.cc: New.
+ * testsuite/21_strings/basic_string/operators/wchar_t/65630.cc: New.
+
2015-03-28 Tim Shen <timshen@google.com>
PR libstdc++/65420
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 6028acfaab9..d2116fa256e 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -1675,6 +1675,9 @@ GLIBCXX_3.4.21 {
_ZNSt7__cxx1112basic_string*;
_ZNKSt7__cxx1112basic_string*;
+ # operator+ for ABI-tagged std::basic_string
+ _ZStplI[cw]St11char_traitsI[cw]ESaI[cw]EENSt7__cxx1112basic_stringIT_T0_T1_EE*;
+
# ABI-tagged stringstreams
_ZNSt7__cxx1115basic_stringbuf*;
_ZNSt7__cxx1118basic_stringstream*;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/65630.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/65630.cc
new file mode 100644
index 00000000000..04be5127104
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/65630.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11 -fno-implicit-templates -O0" }
+// { dg-do link }
+
+#include <string>
+
+void test01()
+{
+ std::string t;
+ t = t + t;
+ t = "" + t;
+ t = 't' + t;
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/65630.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/65630.cc
new file mode 100644
index 00000000000..a07e599ba60
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/65630.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11 -fno-implicit-templates -O0" }
+// { dg-do link }
+
+#include <string>
+
+void test01()
+{
+ std::wstring t;
+ t = t + t;
+ t = L"" + t;
+ t = L't' + t;
+}
+
+int main()
+{
+ test01();
+}