aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2016-06-08 17:06:06 +0000
committerMichael Meissner <meissner@linux.vnet.ibm.com>2016-06-08 17:06:06 +0000
commit80f0fd648192ebb80a3e6f8b71c9c9de9d2cb4e8 (patch)
tree29f6890c80e9644ced85a4c93b43acd9a52bc350
parent6a7b0fc9e2d2202032244bdde309bb3aa6b68ec0 (diff)
parentce32615550f10f134793af051b3e07eca8c06080 (diff)
Merge up to 237222
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/power9@237226 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--contrib/ChangeLog8
-rwxr-xr-xcontrib/update-copyright.py22
-rw-r--r--gcc/ChangeLog354
-rw-r--r--gcc/ChangeLog.meissner5
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/REVISION2
-rw-r--r--gcc/c-family/ChangeLog10
-rw-r--r--gcc/c-family/c-common.c27
-rw-r--r--gcc/c/ChangeLog28
-rw-r--r--gcc/c/c-decl.c8
-rw-r--r--gcc/c/c-parser.c35
-rw-r--r--gcc/c/c-tree.h2
-rw-r--r--gcc/c/c-typeck.c26
-rw-r--r--gcc/common.opt2
-rw-r--r--gcc/config/aarch64/aarch64-builtins.c8
-rw-r--r--gcc/config/aarch64/aarch64-simd-builtins.def18
-rw-r--r--gcc/config/aarch64/aarch64-simd.md72
-rw-r--r--gcc/config/aarch64/aarch64.c20
-rw-r--r--gcc/config/aarch64/aarch64.md34
-rw-r--r--gcc/config/aarch64/arm_neon.h724
-rw-r--r--gcc/config/aarch64/iterators.md23
-rw-r--r--gcc/config/i386/i386.c65
-rw-r--r--gcc/config/i386/i386.h34
-rw-r--r--gcc/config/i386/i386.md35
-rw-r--r--gcc/config/i386/sse.md42
-rw-r--r--gcc/config/mips/p5600.md4
-rw-r--r--gcc/config/pa/pa.md10
-rw-r--r--gcc/config/rs6000/altivec.h1
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def2
-rw-r--r--gcc/config/rs6000/rs6000-c.c59
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/cp-gimplify.c14
-rw-r--r--gcc/diagnostic.c208
-rw-r--r--gcc/doc/invoke.texi16
-rw-r--r--gcc/expmed.c55
-rw-r--r--gcc/fold-const.c9
-rw-r--r--gcc/gimple.c14
-rw-r--r--gcc/gimple.h1
-rw-r--r--gcc/match.pd8
-rw-r--r--gcc/objc/ChangeLog5
-rw-r--r--gcc/objc/objc-act.c3
-rw-r--r--gcc/params.def7
-rw-r--r--gcc/predict.c8
-rw-r--r--gcc/predict.def64
-rw-r--r--gcc/pretty-print.c164
-rw-r--r--gcc/selftest-run-tests.c1
-rw-r--r--gcc/selftest.h1
-rw-r--r--gcc/simplify-rtx.c7
-rw-r--r--gcc/spellcheck.c23
-rw-r--r--gcc/testsuite/ChangeLog154
-rw-r--r--gcc/testsuite/ChangeLog.meissner4
-rw-r--r--gcc/testsuite/g++.dg/debug/pr71432.C140
-rw-r--r--gcc/testsuite/g++.dg/opt/pr70847.C11
-rw-r--r--gcc/testsuite/g++.dg/torture/pr71281.C63
-rw-r--r--gcc/testsuite/g++.dg/torture/pr71448.C27
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr70847.C11
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr71393.C14
-rw-r--r--gcc/testsuite/gcc.dg/Wattributes-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wpragmas-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/ipa/inlinehint-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr70646.c4
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr71418.c4
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr71426.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr71362.c10
-rw-r--r--gcc/testsuite/gcc.dg/predict-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/predict-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/predict-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/predict-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/predict-9.c2
-rw-r--r--gcc/testsuite/gcc.dg/spellcheck-fields-2.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71423.c20
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71428.c20
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71452.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr71408.c30
-rw-r--r--gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-70.c (renamed from gcc/testsuite/gcc.dg/vect/section-anchors-vect-70.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-71.c (renamed from gcc/testsuite/gcc.dg/vect/section-anchors-vect-71.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-72.c (renamed from gcc/testsuite/gcc.dg/vect/section-anchors-vect-72.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-43.c78
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-44.c25
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-live-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/p64_p128.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-mul.c86
-rw-r--r--gcc/testsuite/lib/target-supports.exp3
-rw-r--r--gcc/tree-ssa-loop-ch.c16
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c41
-rw-r--r--gcc/tree-ssa-math-opts.c6
-rw-r--r--gcc/tree-ssa-reassoc.c7
-rw-r--r--gcc/tree-ssa-strlen.c2
-rw-r--r--gcc/tree-ssa.c8
-rw-r--r--gcc/tree-vect-data-refs.c8
-rw-r--r--gcc/tree-vect-loop-manip.c3
-rw-r--r--gcc/tree-vect-loop.c28
-rw-r--r--gcc/tree-vect-patterns.c6
-rw-r--r--gcc/tree-vect-slp.c12
-rw-r--r--gcc/tree-vect-stmts.c94
-rw-r--r--gotools/ChangeLog4
-rw-r--r--gotools/Makefile.am2
-rw-r--r--gotools/configure.ac2
-rw-r--r--libcc1/ChangeLog4
-rw-r--r--libcc1/Makefile.am2
-rw-r--r--libcc1/callbacks.cc2
-rw-r--r--libcc1/callbacks.hh2
-rw-r--r--libcc1/configure.ac2
-rw-r--r--libcc1/connection.cc2
-rw-r--r--libcc1/connection.hh2
-rw-r--r--libcc1/findcomp.cc2
-rw-r--r--libcc1/findcomp.hh2
-rw-r--r--libcc1/libcc1.cc2
-rw-r--r--libcc1/marshall.cc2
-rw-r--r--libcc1/marshall.hh2
-rw-r--r--libcc1/names.cc2
-rw-r--r--libcc1/names.hh2
-rw-r--r--libcc1/plugin.cc2
-rw-r--r--libcc1/rpc.hh2
-rw-r--r--libcc1/status.hh2
-rw-r--r--libgcc/ChangeLog.meissner4
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/std/tuple43
122 files changed, 2394 insertions, 1021 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 2559db408a8..edb1df7b311 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,11 @@
+2016-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * update-copyright.py (LibMudflapFilter): Remove.
+ (GCCCmdLine.__init__): Add gotools, libcc1.
+ Remove libmudflap.
+ List unhandled intl, libcilkrts, libgo, liboffloadmic,
+ maintainer-scripts.
+
2016-05-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* download_prerequisites: Adjust gmp/mpfr/mpc versions.
diff --git a/contrib/update-copyright.py b/contrib/update-copyright.py
index 5f93d01ac8c..ebefa4627c3 100755
--- a/contrib/update-copyright.py
+++ b/contrib/update-copyright.py
@@ -631,15 +631,6 @@ class LibJavaFilter (GenericFilter):
return re.compile ('.*icSigCopyrightTag')
return GenericFilter.get_line_filter (self, dir, filename)
-class LibMudflapFilter (GenericFilter):
- def __init__ (self):
- GenericFilter.__init__ (self)
-
- self.skip_dirs |= set ([
- # Handled separately.
- 'testsuite',
- ])
-
class LibStdCxxFilter (GenericFilter):
def __init__ (self):
GenericFilter.__init__ (self)
@@ -724,30 +715,34 @@ class GCCCmdLine (CmdLine):
self.add_dir ('gcc', GCCFilter())
self.add_dir (os.path.join ('gcc', 'testsuite'), TestsuiteFilter())
self.add_dir ('gnattools')
+ self.add_dir ('gotools')
self.add_dir ('include')
+ # intl is imported from upstream.
self.add_dir ('libada')
self.add_dir ('libatomic')
self.add_dir ('libbacktrace')
+ self.add_dir ('libcc1')
+ # libcilkrts is imported from upstream.
self.add_dir ('libcpp', LibCppFilter())
self.add_dir ('libdecnumber')
# libffi is imported from upstream.
self.add_dir ('libgcc', LibGCCFilter())
self.add_dir ('libgfortran')
+ # libgo is imported from upstream.
self.add_dir ('libgomp')
self.add_dir ('libiberty')
self.add_dir ('libitm')
self.add_dir ('libjava', LibJavaFilter())
self.add_dir (os.path.join ('libjava', 'testsuite'), TestsuiteFilter())
- self.add_dir ('libmudflap', LibMudflapFilter())
- self.add_dir (os.path.join ('libmudflap', 'testsuite'),
- TestsuiteFilter())
self.add_dir ('libobjc')
+ # liboffloadmic is imported from upstream.
self.add_dir ('libquadmath')
- # libsanitiser is imported from upstream.
+ # libsanitizer is imported from upstream.
self.add_dir ('libssp')
self.add_dir ('libstdc++-v3', LibStdCxxFilter())
self.add_dir ('libvtv')
self.add_dir ('lto-plugin')
+ # maintainer-scripts maintainer-scripts
# zlib is imported from upstream.
self.default_dirs = [
@@ -761,7 +756,6 @@ class GCCCmdLine (CmdLine):
'libgfortran',
'libgomp',
'libitm',
- 'libmudflap',
'libobjc',
'libstdc++-v3',
]
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ccabd6f6f42..8c1a79cb90d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,355 @@
+2016-06-08 David Malcolm <dmalcolm@redhat.com>
+
+ * pretty-print.c: Include "selftest.h".
+ (pp_format): Fix comment.
+ (identifier_to_locale): Likewise.
+ (selftest::test_basic_printing): New function.
+ (selftest::assert_pp_format): New function.
+ (selftest::test_pp_format): New function.
+ (selftest::pretty_print_c_tests): New function.
+ * selftest-run-tests.c (selftest::run_tests): Call
+ selftest::pretty_print_c_tests.
+ * selftest.h (pretty_print_c_tests): New declaration.
+
+2016-06-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * invoke.texi (max-loop-headers-insns): Document.
+ * params.def (PARAM_MAX_LOOP_HEADER_INSNS): New.
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Update comment.
+ (ch_base::copy_headers): Use PARAM_MAX_LOOP_HEADER_INSNS.
+
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-stmts.c (vectorizable_load): Remove restrictions
+ on strided SLP loads and fall back to scalar loads in case
+ we can't chunk them.
+
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71452
+ * tree-ssa.c (non_rewritable_lvalue_p): Make sure that the
+ type used for the SSA rewrite has enough precision to cover
+ the dynamic type of the location.
+
+2016-06-08 Jakub Jelinek <jakub@redhat.com>
+ Richard Biener <rguenther@suse.de>
+
+ PR c++/71448
+ * fold-const.c (fold_comparison): Handle CONSTANT_CLASS_P (base0)
+ the same as DECL_P (base0) for indirect_base0. Use equality_code
+ in one further place.
+
+2016-06-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ * expmed.c (store_bit_field_1): Do not restrict a multiword op0
+ to one word if the field is known to overlap other words.
+ (extract_bit_field_1): Likewise.
+ (store_split_bit_field): Remove compensating code.
+ (extract_split_bit_field): Likewise.
+
+2016-06-08 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR debug/71432
+ PR ada/71413
+ * tree-ssa-strlen.c (handle_builtin_memcmp): Ignore debug insns.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.def (faddp): New builtins for modes in
+ VDQF.
+ * config/aarch64/aarch64-simd.md (aarch64_faddp<mode>): New.
+ (arch64_addpv4sf): Delete.
+ (reduc_plus_scal_v4sf): Use "gen_aarch64_faddpv4sf" instead of
+ "gen_aarch64_addpv4sf".
+ * config/aarch64/arm_neon.h (vpadd_f32): Remove inline assembly. Use
+ builtin.
+ (vpadds_f32): Likewise.
+ (vpaddq_f32): Likewise.
+ (vpaddq_f64): Likewise.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.def (fabd): New builtins for modes
+ VALLF.
+ * config/aarch64/aarch64-simd.md (fabd<mode>_3): Extend modes from VDQF
+ to VALLF. Rename to "fabd<mode>3".
+ "*fabd_scalar<mode>3): Delete.
+ * config/aarch64/arm_neon.h (vabds_f32): Remove inline assembly.
+ Use builtin.
+ (vabdd_f64): Likewise.
+ (vabd_f32): Likewise.
+ (vabd_f64): Likewise.
+ (vabdq_f32): Likewise.
+ (vabdq_f64): Likewise.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.def (rsqrts): New builtins for modes
+ VALLF.
+ * config/aarch64/aarch64-simd.md (aarch64_rsqrts_<mode>3): Rename to
+ "aarch64_rsqrts<mode>".
+ * config/aarch64/aarch64.c (get_rsqrts_type): Update gen* name.
+ * config/aarch64/arm_neon.h (vrsqrtss_f32): Remove inline assembly. Use
+ builtin.
+ (vrsqrtsd_f64): Likewise.
+ (vrsqrts_f32): Likewise.
+ (vrsqrts_f64): Likewise.
+ (vrsqrtsq_f32): Likewise.
+ (vrsqrtsq_f64): Likewise.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.def (rsqrte): New builtins for modes
+ VALLF.
+ * config/aarch64/aarch64-simd.md (aarch64_rsqrte_<mode>2): Rename to
+ "aarch64_rsqrte<mode>".
+ * config/aarch64/aarch64.c (get_rsqrte_type): Update gen* name.
+ * config/aarch64/arm_neon.h (vrsqrts_f32): Remove inline assembly. Use
+ builtin.
+ (vrsqrted_f64): Likewise.
+ (vrsqrte_f32): Likewise.
+ (vrsqrte_f64): Likewise.
+ (vrsqrteq_f32): Likewise.
+ (vrsqrteq_f64): Likewise.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.def (scvtf): Register vector modes.
+ (ucvtf): Likewise.
+ (fcvtzs): Likewise.
+ (fcvtzu): Likewise.
+ * config/aarch64/aarch64-simd.md
+ (<FCVT_F2FIXED:fcvt_fixed_insn><VDQF:mode>3): New.
+ (<FCVT_FIXED2F:fcvt_fixed_insn><VDQ_SDI:mode>3): Likewise.
+ * config/aarch64/arm_neon.h (vcvt_n_f32_s32): Remove inline assembly.
+ Use builtin.
+ (vcvt_n_f32_u32): Likewise.
+ (vcvt_n_s32_f32): Likewise.
+ (vcvt_n_u32_f32): Likewise.
+ (vcvtq_n_f32_s32): Likewise.
+ (vcvtq_n_f32_u32): Likewise.
+ (vcvtq_n_f64_s64): Likewise.
+ (vcvtq_n_f64_u64): Likewise.
+ (vcvtq_n_s32_f32): Likewise.
+ (vcvtq_n_s64_f64): Likewise.
+ (vcvtq_n_u32_f32): Likewise.
+ (vcvtq_n_u64_f64): Likewise.
+ * config/aarch64/iterators.md (VDQ_SDI): New mode iterator.
+ (VSDQ_SDI): Likewise.
+ (fcvt_target): Support V4DI, V4SI and V2SI.
+ (FCVT_TARGET): Likewise.
+
+2016-06-08 Jiong Wang <jiong.wang@arm.com>
+
+ * config/aarch64/aarch64-builtins.c (TYPES_BINOP_USS): New
+ (TYPES_BINOP_SUS): Likewise.
+ (aarch64_simd_builtin_data): Update include file name.
+ (aarch64_builtins): Likewise.
+ * config/aarch64/aarch64-simd-builtins.def (scvtf): New entries
+ for conversion between scalar float-point and fixed-point.
+ (ucvtf): Likewise.
+ (fcvtzs): Likewise.
+ (fcvtzu): Likewise.
+ * config/aarch64/aarch64.md
+ (<FCVT_F2FIXED:fcvt_fixed_insn><GPF:mode>3: New
+ pattern for conversion between scalar float to fixed-pointer.
+ (<FCVT_FIXED2F:fcvt_fixed_insn><GPI:mode>: Likewise.
+ (UNSPEC_FCVTZS): New UNSPEC enumeration.
+ (UNSPEC_FCVTZU): Likewise.
+ (UNSPEC_SCVTF): Likewise.
+ (UNSPEC_UCVTF): Likewise.
+ * config/aarch64/arm_neon.h (vcvtd_n_f64_s64): Remove inline assembly.
+ Use builtin.
+ (vcvtd_n_f64_u64): Likewise.
+ (vcvtd_n_s64_f64): Likewise.
+ (vcvtd_n_u64_f64): Likewise.
+ (vcvtd_n_f32_s32): Likewise.
+ (vcvts_n_f32_u32): Likewise.
+ (vcvtd_n_s32_f32): Likewise.
+ (vcvts_n_u32_f32): Likewise.
+ * config/aarch64/iterators.md (fcvt_target): Support integer to float
+ mapping.
+ (FCVT_TARGET): Likewise.
+ (FCVT_FIXED2F): New iterator.
+ (FCVT_F2FIXED): Likewise.
+ (fcvt_fixed_insn): New define_int_attr.
+
+2016-06-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * predict.c (pass_strip_predict_hints::execute): Cleanup CFG if
+ some statements was removed.
+
+2016-06-08 Alan Hayward <alan.hayward@arm.com>
+
+ * tree-vect-data-refs.c (vect_analyze_data_refs): Remove debug newline.
+ * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): likewise.
+ (vect_can_advance_ivs_p): likewise.
+ (vect_update_ivs_after_vectorizer): likewise.
+ * tree-vect-loop.c (vect_determine_vectorization_factor): likewise.
+ (vect_analyze_scalar_cycles_1): likewise.
+ (vect_analyze_loop_operations): likewise.
+ (report_vect_op): likewise.
+ (vect_is_slp_reduction): likewise.
+ (vect_is_simple_reduction): likewise.
+ (get_initial_def_for_induction): likewise.
+ (vect_transform_loop): likewise.
+ * tree-vect-patterns.c (vect_recog_dot_prod_pattern): likewise.
+ (vect_recog_sad_pattern): likewise.
+ (vect_recog_widen_sum_pattern): likewise.
+ (vect_recog_widening_pattern): likewise.
+ (vect_recog_divmod_pattern): likewise.
+ * tree-vect-slp.c (vect-build-slp_tree_1): likewise.
+ (vect_analyze_slp_instance): likewise.
+ (vect_transform_slp_perm_load): likewise.
+ (vect_schedule_slp_instance): likewise.
+
+2016-06-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * predict.c (predict_iv_comparison): Mention that heuristics is broken.
+ (return_prediction): PRED_CONST_RETURN predict return as not taken.
+ * predict.def (PRED_CONTINUE): Change hitrate 50->67
+ (PRED_LOOP_BRANCH): Document predictor as broken.
+ (PRED_LOOP_EXIT): Change hitrate 91->92.
+ (PRED_LOOP_EXTRA_EXIT): Change hitrate 91->83.
+ (PRED_POINTER, PRED_TREE_POINTER): Change hitrate 85->70.
+ (PRED_OPCODE_POSITIVE): Change hitrate 79->64.
+ (PRED_OPCODE_NONEQUAL): Change hitrate 91->66.
+ (PRED_TREE_OPCODE_POSITIVE): Change hitrate 73->64
+ (PRED_TREE_OPCODE_NONEQUAL): Chnage hitrate 72->66
+ (PRED_CALL): Chane hitrate 71->67.
+ (PRED_TREE_EARLY_RETURN): Document issues, change hitrate 61->54.
+ (PRED_GOTO): Document as unused right now.
+ (PRED_CONST_RETURN): Change hitrate 67->69
+ (PRED_NEGATIVE_RETURN): Change hitrate 96->98
+ (PRED_NULL_RETURN): Change hitrate 91->90.
+ (PRED_LOOP_IV_COMPARE_GUESS): Change hitrate to 98.
+ (PRED_FORTRAN_FAIL_ALLOC): Change hitrate to 62; document issues.
+ (PRED_FORTRAN_SIZE_ZERO): Change hitrate to 99.
+
+2016-06-07 Bill Seurer <seurer@linux.vnet.ibm.com>
+
+ * config/rs6000/altivec.h: Add __builtin_vec_mul.
+ * config/rs6000/rs6000-builtin.def (vec_mul): Change vec_mul to a
+ special case Altivec builtin.
+ * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Remove
+ VSX_BUILTIN_VEC_MUL (replaced with special case code).
+ * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add
+ code for ALTIVEC_BUILTIN_VEC_MUL.
+ * config/rs6000/rs6000.c (altivec_init_builtins): Add definition
+ for __builtin_vec_mul.
+
+2016-06-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mhtm and
+ -mno-htm.
+
+2016-06-07 David Malcolm <dmalcolm@redhat.com>
+
+ * spellcheck.c (selftest::test_find_closest_string): New function.
+ (spellcheck_c_tests): Call the above.
+
+2016-06-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * simplify-rtx.c (simplify_cond_clz_ctz): Delete 'mode' local
+ variable.
+
+2016-06-07 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/sse.md (avx_vec_concat<mode>): Add v=v,vm and
+ Yv=Yv,C alternatives.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR c/61564
+ * common.opt (ffast-math): Make Optimization.
+
+2016-06-07 Simon Dardis <simon.dardis@imgtec.com>
+ Prachi Godbole <prachi.godbole@imgtec.com>
+
+ * config/mips/p5600.md (p5600_fpu_fadd): Remove checking for
+ `fabs' and `fneg' type attributes.
+ (p5600_fpu_fabs): Add `fmove' to the comment.
+
+2016-06-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * gimple.c: Include builtins.h
+ (gimple_inexpensive_call_p): New function.
+ * gimple.h (gimple_inexpensive_call_p): Declare.
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use it.
+ * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise;
+ fix formatting.
+
+2016-06-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * diagnostic.c (diagnostic_impl, diagnostic_n_impl): New.
+ (inform, inform_at_rich_loc, inform_n, warning, warning_at,
+ warning_at_rich_loc, warning_n, pedwarn, permerror,
+ permerror_at_rich_loc, error, error_n, error_at, error_at_rich_loc,
+ sorry, fatal_error, internal_error, internal_error_no_backtrace):
+ Use the above.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71428
+ * tree-ssa-math-opts.c (perform_symbolic_merge): Properly distinguish
+ BIT_FIELD_REF op vs. load.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/71423
+ * match.pd ((X | ~Y) -> Y <= X): Properly invert the comparison
+ for signed ops.
+
+2016-06-06 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.md (call): Generate indirect long calls to non-local
+ functions on TARGET_64BIT.
+ (call_value): Likewise.
+
+2016-06-06 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.md (call_val_reg_64bit): Remove "reg: DI " clobber from
+ pattern and subsequent splitters.
+ (call_val_reg_64bit_post_reload): Likewise.
+
+2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR middle-end/71408
+ * tree-ssa-reassoc.c (zero_one_operation): Fix NEGATE_EXPR operand for
+ propagate_op_to_single_use.
+
+2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR middle-end/71281
+ * tree-ssa-reassoc.c (reassociate_bb): Set uid for negate stmt.
+
+2016-06-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.h (enum ix86_enitity): Add X86_DIRFLAG.
+ (enum x86_dirflag_state): New enum.
+ (NUM_MODES_FOR_MODE_SWITCHING): Add X86_DIRFLAG_ANY.
+ (machine_function): Remove needs_cld.
+ (ix86_current_function_needs_cld): Remove.
+ * config/i386/i386.c (ix86_set_func_type): Set
+ ix86_optimize_mode_switching[X86_DIRFLAG] to 1.
+ (ix86_expand_prologue): Do not emit CLD here.
+ (ix86_dirflag_mode_needed): New function.
+ (ix86_dirflag_mode_entry): Ditto.
+ (ix86_mode_needed): Handle X86_DIRFLAG entity.
+ (ix86_mode_after): Ditto.
+ (ix86_mode_entry): Ditto.
+ (ix86_mode_exit): Ditto.
+ (ix86_emit_mode_set): Ditto.
+ * config/i386/i386.md (strmov_singleop): Set
+ ix86_optimize_mode_switching[X86_DIRFLAG] to 1 for TARGET_CLD.
+ Do not set ix86_current_function_needs_cld.
+ (rep_mov): Ditto.
+ (strset_singleop): Ditto.
+ (rep_stos): Ditto.
+ (cmpstrnqi_nz_1): Ditto.
+ (cmpstrnqi_1): Ditto.
+ (strlenqi_1): Ditto.
+
2016-06-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71259
@@ -229,7 +581,7 @@
* config/ft32/ft32.c (ft32_setup_incoming_varargs,
ft32_expand_prolog, ft32_expand_epilogue):
- Handle pretend_args.
+ Handle pretend_args.
* config/ft32/ft32.h: Remove OUTGOING_REG_PARM_STACK_SPACE.
* config/ft32/ft32.md: Add pretend_returner.
diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner
index b207fd1bd37..6c97fcaddf2 100644
--- a/gcc/ChangeLog.meissner
+++ b/gcc/ChangeLog.meissner
@@ -1,3 +1,8 @@
+2016-06-08 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 237222.
+ * REVISION: Update subversion id.
+
2016-06-07 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/predicates.md (xxspltib_constant_split): Update
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 602e5397582..67def45676b 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20160606
+20160608
diff --git a/gcc/REVISION b/gcc/REVISION
index a9a62948b76..e8ace3fecd1 100644
--- a/gcc/REVISION
+++ b/gcc/REVISION
@@ -1 +1 @@
-power9 branch, based on subversion id 237150.
+power9 branch, based on subversion id 237222.
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 7c589acf20c..1cd8aa7ad32 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,13 @@
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ * c-common.c (parse_optimize_options): Improve diagnostic messages.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR c/61564
+ * c-common.c (parse_optimize_options): Only apply CL_OPTIMIZATION
+ options and warn about others.
+
2016-06-01 Eduard Sanou <dhole@openmailbox.org>
* c-common.c (get_source_date_epoch): Rename to
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 93ca274e7c8..4e75e51c013 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -9542,10 +9542,10 @@ parse_optimize_options (tree args, bool attr_p)
ret = false;
if (attr_p)
warning (OPT_Wattributes,
- "bad option %s to optimize attribute", p);
+ "bad option %qs to attribute %<optimize%>", p);
else
warning (OPT_Wpragmas,
- "bad option %s to pragma attribute", p);
+ "bad option %qs to pragma %<optimize%>", p);
continue;
}
@@ -9580,6 +9580,29 @@ parse_optimize_options (tree args, bool attr_p)
decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv,
&decoded_options,
&decoded_options_count);
+ /* Drop non-Optimization options. */
+ unsigned j = 1;
+ for (i = 1; i < decoded_options_count; ++i)
+ {
+ if (! (cl_options[decoded_options[i].opt_index].flags & CL_OPTIMIZATION))
+ {
+ ret = false;
+ if (attr_p)
+ warning (OPT_Wattributes,
+ "bad option %qs to attribute %<optimize%>",
+ decoded_options[i].orig_option_with_args_text);
+ else
+ warning (OPT_Wpragmas,
+ "bad option %qs to pragma %<optimize%>",
+ decoded_options[i].orig_option_with_args_text);
+ continue;
+ }
+ if (i != j)
+ decoded_options[j] = decoded_options[i];
+ j++;
+ }
+ decoded_options_count = j;
+ /* And apply them. */
decode_options (&global_options, &global_options_set,
decoded_options, decoded_options_count,
input_location, global_dc);
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index f0b03d2c8d7..9f0b91afb6a 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,31 @@
+2016-06-08 Marek Polacek <polacek@redhat.com>
+
+ PR c/71418
+ * c-decl.c (grokdeclarator): Check TYPE_P.
+
+ PR c/71426
+ * c-decl.c (get_parm_info): Don't crash on an assert on invalid
+ code.
+
+2016-06-07 David Malcolm <dmalcolm@redhat.com>
+
+ * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
+ and structure element reference, capture the location of the
+ element name token and pass it to build_component_ref.
+ (c_parser_postfix_expression_after_primary): Likewise for
+ structure element dereference.
+ (c_parser_omp_variable_list): Likewise for
+ OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
+ * c-tree.h (build_component_ref): Add location_t param.
+ * c-typeck.c (build_component_ref): Add location_t param
+ COMPONENT_LOC. Use it, if available, when issuing hints about
+ mispelled member names to provide a fixit replacement hint.
+
+2016-06-06 Marek Polacek <polacek@redhat.com>
+
+ PR c/71362
+ * c-parser.c (c_parser_direct_declarator): Set location.
+
2016-06-06 Marek Polacek <polacek@redhat.com>
* c-typeck.c (comptypes_internal): Handle comparisons of
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index d79802ee72c..5c08c5947c0 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -6313,7 +6313,7 @@ grokdeclarator (const struct c_declarator *declarator,
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
error_at (loc, "alignment specified for function %qE", name);
- else if (declspecs->align_log != -1)
+ else if (declspecs->align_log != -1 && TYPE_P (type))
{
alignas_align = 1U << declspecs->align_log;
if (alignas_align < min_align_of_type (type))
@@ -7054,9 +7054,9 @@ get_parm_info (bool ellipsis, tree expr)
break;
case FUNCTION_DECL:
- /* FUNCTION_DECLs appear when there is an implicit function
- declaration in the parameter list. */
- gcc_assert (b->nested);
+ /* FUNCTION_DECLs appear when there is an implicit function
+ declaration in the parameter list. */
+ gcc_assert (b->nested || seen_error ());
goto set_shadowed;
case CONST_DECL:
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index bca8653f8d8..2fef1acebd1 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -3430,6 +3430,7 @@ c_parser_direct_declarator (c_parser *parser, bool type_seen_p, c_dtr_syn kind,
&& c_parser_next_token_is (parser, CPP_OPEN_SQUARE))
{
struct c_declarator *inner = build_id_declarator (NULL_TREE);
+ inner->id_loc = c_parser_peek_token (parser)->location;
return c_parser_direct_declarator_inner (parser, *seen_id, inner);
}
@@ -7707,8 +7708,9 @@ c_parser_postfix_expression (c_parser *parser)
accept sub structure and sub array references. */
if (c_parser_next_token_is (parser, CPP_NAME))
{
+ c_token *comp_tok = c_parser_peek_token (parser);
offsetof_ref = build_component_ref
- (loc, offsetof_ref, c_parser_peek_token (parser)->value);
+ (loc, offsetof_ref, comp_tok->value, comp_tok->location);
c_parser_consume_token (parser);
while (c_parser_next_token_is (parser, CPP_DOT)
|| c_parser_next_token_is (parser,
@@ -7734,9 +7736,10 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_error (parser, "expected identifier");
break;
}
+ c_token *comp_tok = c_parser_peek_token (parser);
offsetof_ref = build_component_ref
- (loc, offsetof_ref,
- c_parser_peek_token (parser)->value);
+ (loc, offsetof_ref, comp_tok->value,
+ comp_tok->location);
c_parser_consume_token (parser);
}
else
@@ -8213,7 +8216,7 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
{
struct c_expr orig_expr;
tree ident, idx;
- location_t sizeof_arg_loc[3];
+ location_t sizeof_arg_loc[3], comp_loc;
tree sizeof_arg[3];
unsigned int literal_zero_mask;
unsigned int i;
@@ -8327,7 +8330,11 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
c_parser_consume_token (parser);
expr = default_function_array_conversion (expr_loc, expr);
if (c_parser_next_token_is (parser, CPP_NAME))
- ident = c_parser_peek_token (parser)->value;
+ {
+ c_token *comp_tok = c_parser_peek_token (parser);
+ ident = comp_tok->value;
+ comp_loc = comp_tok->location;
+ }
else
{
c_parser_error (parser, "expected identifier");
@@ -8339,7 +8346,8 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
start = expr.get_start ();
finish = c_parser_peek_token (parser)->get_finish ();
c_parser_consume_token (parser);
- expr.value = build_component_ref (op_loc, expr.value, ident);
+ expr.value = build_component_ref (op_loc, expr.value, ident,
+ comp_loc);
set_c_expr_source_range (&expr, start, finish);
expr.original_code = ERROR_MARK;
if (TREE_CODE (expr.value) != COMPONENT_REF)
@@ -8359,7 +8367,11 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
c_parser_consume_token (parser);
expr = convert_lvalue_to_rvalue (expr_loc, expr, true, false);
if (c_parser_next_token_is (parser, CPP_NAME))
- ident = c_parser_peek_token (parser)->value;
+ {
+ c_token *comp_tok = c_parser_peek_token (parser);
+ ident = comp_tok->value;
+ comp_loc = comp_tok->location;
+ }
else
{
c_parser_error (parser, "expected identifier");
@@ -8375,7 +8387,7 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
build_indirect_ref (op_loc,
expr.value,
RO_ARROW),
- ident);
+ ident, comp_loc);
set_c_expr_source_range (&expr, start, finish);
expr.original_code = ERROR_MARK;
if (TREE_CODE (expr.value) != COMPONENT_REF)
@@ -10621,9 +10633,12 @@ c_parser_omp_variable_list (c_parser *parser,
t = error_mark_node;
break;
}
- tree ident = c_parser_peek_token (parser)->value;
+
+ c_token *comp_tok = c_parser_peek_token (parser);
+ tree ident = comp_tok->value;
+ location_t comp_loc = comp_tok->location;
c_parser_consume_token (parser);
- t = build_component_ref (op_loc, t, ident);
+ t = build_component_ref (op_loc, t, ident, comp_loc);
}
/* FALLTHROUGH */
case OMP_CLAUSE_DEPEND:
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index 444e9a4777e..b4374e3e4bf 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -614,7 +614,7 @@ extern struct c_expr convert_lvalue_to_rvalue (location_t, struct c_expr,
bool, bool);
extern void mark_exp_read (tree);
extern tree composite_type (tree, tree);
-extern tree build_component_ref (location_t, tree, tree);
+extern tree build_component_ref (location_t, tree, tree, location_t);
extern tree build_array_ref (location_t, tree, tree);
extern tree build_external_ref (location_t, tree, int, tree *);
extern void pop_maybe_used (bool);
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index cee566f8322..cd8e9e57b3a 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -2329,10 +2329,12 @@ should_suggest_deref_p (tree datum_type)
/* Make an expression to refer to the COMPONENT field of structure or
union value DATUM. COMPONENT is an IDENTIFIER_NODE. LOC is the
- location of the COMPONENT_REF. */
+ location of the COMPONENT_REF. COMPONENT_LOC is the location
+ of COMPONENT. */
tree
-build_component_ref (location_t loc, tree datum, tree component)
+build_component_ref (location_t loc, tree datum, tree component,
+ location_t component_loc)
{
tree type = TREE_TYPE (datum);
enum tree_code code = TREE_CODE (type);
@@ -2364,8 +2366,24 @@ build_component_ref (location_t loc, tree datum, tree component)
{
tree guessed_id = lookup_field_fuzzy (type, component);
if (guessed_id)
- error_at (loc, "%qT has no member named %qE; did you mean %qE?",
- type, component, guessed_id);
+ {
+ /* Attempt to provide a fixit replacement hint, if
+ we have a valid range for the component. */
+ location_t reported_loc
+ = (component_loc != UNKNOWN_LOCATION) ? component_loc : loc;
+ rich_location rich_loc (line_table, reported_loc);
+ if (component_loc != UNKNOWN_LOCATION)
+ {
+ source_range component_range =
+ get_range_from_loc (line_table, component_loc);
+ rich_loc.add_fixit_replace (component_range,
+ IDENTIFIER_POINTER (guessed_id));
+ }
+ error_at_rich_loc
+ (&rich_loc,
+ "%qT has no member named %qE; did you mean %qE?",
+ type, component, guessed_id);
+ }
else
error_at (loc, "%qT has no member named %qE", type, component);
return error_mark_node;
diff --git a/gcc/common.opt b/gcc/common.opt
index 632dd311fba..f0d71966cdf 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1287,7 +1287,7 @@ EnumValue
Enum(excess_precision) String(standard) Value(EXCESS_PRECISION_STANDARD)
ffast-math
-Common
+Common Optimization
ffat-lto-objects
Common Var(flag_fat_lto_objects)
diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index 5573903fe0a..262ea1c519f 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -139,6 +139,14 @@ aarch64_types_binop_ssu_qualifiers[SIMD_MAX_BUILTIN_ARGS]
= { qualifier_none, qualifier_none, qualifier_unsigned };
#define TYPES_BINOP_SSU (aarch64_types_binop_ssu_qualifiers)
static enum aarch64_type_qualifiers
+aarch64_types_binop_uss_qualifiers[SIMD_MAX_BUILTIN_ARGS]
+ = { qualifier_unsigned, qualifier_none, qualifier_none };
+#define TYPES_BINOP_USS (aarch64_types_binop_uss_qualifiers)
+static enum aarch64_type_qualifiers
+aarch64_types_binop_sus_qualifiers[SIMD_MAX_BUILTIN_ARGS]
+ = { qualifier_none, qualifier_unsigned, qualifier_none };
+#define TYPES_BINOP_SUS (aarch64_types_binop_sus_qualifiers)
+static enum aarch64_type_qualifiers
aarch64_types_binopp_qualifiers[SIMD_MAX_BUILTIN_ARGS]
= { qualifier_poly, qualifier_poly, qualifier_poly };
#define TYPES_BINOPP (aarch64_types_binopp_qualifiers)
diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def
index dd045792b21..1332734ce01 100644
--- a/gcc/config/aarch64/aarch64-simd-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-builtins.def
@@ -445,3 +445,21 @@
/* Implemented by aarch64_sqrdml<SQRDMLH_AS:rdma_as>h_laneq<mode>. */
BUILTIN_VSDQ_HSI (QUADOP_LANE, sqrdmlah_laneq, 0)
BUILTIN_VSDQ_HSI (QUADOP_LANE, sqrdmlsh_laneq, 0)
+
+ /* Implemented by <FCVT_F2FIXED/FIXED2F:fcvt_fixed_insn><*><*>3. */
+ BUILTIN_VSDQ_SDI (BINOP, scvtf, 3)
+ BUILTIN_VSDQ_SDI (BINOP_SUS, ucvtf, 3)
+ BUILTIN_VALLF (BINOP, fcvtzs, 3)
+ BUILTIN_VALLF (BINOP_USS, fcvtzu, 3)
+
+ /* Implemented by aarch64_rsqrte<mode>. */
+ BUILTIN_VALLF (UNOP, rsqrte, 0)
+
+ /* Implemented by aarch64_rsqrts<mode>. */
+ BUILTIN_VALLF (BINOP, rsqrts, 0)
+
+ /* Implemented by fabd<mode>3. */
+ BUILTIN_VALLF (BINOP, fabd, 3)
+
+ /* Implemented by aarch64_faddp<mode>. */
+ BUILTIN_VDQF (BINOP, faddp, 0)
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index 6ea35bf487e..c8a5e3e82bb 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -382,7 +382,7 @@
[(set_attr "type" "neon<fp>_mul_<Vetype>_scalar<q>")]
)
-(define_insn "aarch64_rsqrte_<mode>2"
+(define_insn "aarch64_rsqrte<mode>"
[(set (match_operand:VALLF 0 "register_operand" "=w")
(unspec:VALLF [(match_operand:VALLF 1 "register_operand" "w")]
UNSPEC_RSQRTE))]
@@ -390,7 +390,7 @@
"frsqrte\\t%<v>0<Vmtype>, %<v>1<Vmtype>"
[(set_attr "type" "neon_fp_rsqrte_<Vetype><q>")])
-(define_insn "aarch64_rsqrts_<mode>3"
+(define_insn "aarch64_rsqrts<mode>"
[(set (match_operand:VALLF 0 "register_operand" "=w")
(unspec:VALLF [(match_operand:VALLF 1 "register_operand" "w")
(match_operand:VALLF 2 "register_operand" "w")]
@@ -474,23 +474,14 @@
[(set_attr "type" "neon_arith_acc<q>")]
)
-(define_insn "fabd<mode>_3"
- [(set (match_operand:VDQF 0 "register_operand" "=w")
- (abs:VDQF (minus:VDQF
- (match_operand:VDQF 1 "register_operand" "w")
- (match_operand:VDQF 2 "register_operand" "w"))))]
- "TARGET_SIMD"
- "fabd\t%0.<Vtype>, %1.<Vtype>, %2.<Vtype>"
- [(set_attr "type" "neon_fp_abd_<Vetype><q>")]
-)
-
-(define_insn "*fabd_scalar<mode>3"
- [(set (match_operand:GPF 0 "register_operand" "=w")
- (abs:GPF (minus:GPF
- (match_operand:GPF 1 "register_operand" "w")
- (match_operand:GPF 2 "register_operand" "w"))))]
+(define_insn "fabd<mode>3"
+ [(set (match_operand:VALLF 0 "register_operand" "=w")
+ (abs:VALLF
+ (minus:VALLF
+ (match_operand:VALLF 1 "register_operand" "w")
+ (match_operand:VALLF 2 "register_operand" "w"))))]
"TARGET_SIMD"
- "fabd\t%<s>0, %<s>1, %<s>2"
+ "fabd\t%<v>0<Vmtype>, %<v>1<Vmtype>, %<v>2<Vmtype>"
[(set_attr "type" "neon_fp_abd_<Vetype><q>")]
)
@@ -1778,6 +1769,28 @@
[(set_attr "type" "neon_fp_cvt_widen_s")]
)
+;; Convert between fixed-point and floating-point (vector modes)
+
+(define_insn "<FCVT_F2FIXED:fcvt_fixed_insn><VDQF:mode>3"
+ [(set (match_operand:<VDQF:FCVT_TARGET> 0 "register_operand" "=w")
+ (unspec:<VDQF:FCVT_TARGET> [(match_operand:VDQF 1 "register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
+ FCVT_F2FIXED))]
+ "TARGET_SIMD"
+ "<FCVT_F2FIXED:fcvt_fixed_insn>\t%<v>0<Vmtype>, %<v>1<Vmtype>, #%2"
+ [(set_attr "type" "neon_fp_to_int_<VDQF:Vetype><q>")]
+)
+
+(define_insn "<FCVT_FIXED2F:fcvt_fixed_insn><VDQ_SDI:mode>3"
+ [(set (match_operand:<VDQ_SDI:FCVT_TARGET> 0 "register_operand" "=w")
+ (unspec:<VDQ_SDI:FCVT_TARGET> [(match_operand:VDQ_SDI 1 "register_operand" "w")
+ (match_operand:SI 2 "immediate_operand" "i")]
+ FCVT_FIXED2F))]
+ "TARGET_SIMD"
+ "<FCVT_FIXED2F:fcvt_fixed_insn>\t%<v>0<Vmtype>, %<v>1<Vmtype>, #%2"
+ [(set_attr "type" "neon_int_to_fp_<VDQ_SDI:Vetype><q>")]
+)
+
;; ??? Note that the vectorizer usage of the vec_unpacks_[lo/hi] patterns
;; is inconsistent with vector ordering elsewhere in the compiler, in that
;; the meaning of HI and LO changes depending on the target endianness.
@@ -1979,6 +1992,16 @@
}
)
+(define_insn "aarch64_faddp<mode>"
+ [(set (match_operand:VDQF 0 "register_operand" "=w")
+ (unspec:VDQF [(match_operand:VDQF 1 "register_operand" "w")
+ (match_operand:VDQF 2 "register_operand" "w")]
+ UNSPEC_FADDV))]
+ "TARGET_SIMD"
+ "faddp\t%0.<Vtype>, %1.<Vtype>, %2.<Vtype>"
+ [(set_attr "type" "neon_fp_reduc_add_<Vetype><q>")]
+)
+
(define_insn "aarch64_reduc_plus_internal<mode>"
[(set (match_operand:VDQV 0 "register_operand" "=w")
(unspec:VDQV [(match_operand:VDQV 1 "register_operand" "w")]
@@ -2006,15 +2029,6 @@
[(set_attr "type" "neon_fp_reduc_add_<Vetype><q>")]
)
-(define_insn "aarch64_addpv4sf"
- [(set (match_operand:V4SF 0 "register_operand" "=w")
- (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "w")]
- UNSPEC_FADDV))]
- "TARGET_SIMD"
- "faddp\\t%0.4s, %1.4s, %1.4s"
- [(set_attr "type" "neon_fp_reduc_add_s_q")]
-)
-
(define_expand "reduc_plus_scal_v4sf"
[(set (match_operand:SF 0 "register_operand")
(unspec:V4SF [(match_operand:V4SF 1 "register_operand")]
@@ -2023,8 +2037,8 @@
{
rtx elt = GEN_INT (ENDIAN_LANE_N (V4SFmode, 0));
rtx scratch = gen_reg_rtx (V4SFmode);
- emit_insn (gen_aarch64_addpv4sf (scratch, operands[1]));
- emit_insn (gen_aarch64_addpv4sf (scratch, scratch));
+ emit_insn (gen_aarch64_faddpv4sf (scratch, operands[1], operands[1]));
+ emit_insn (gen_aarch64_faddpv4sf (scratch, scratch, scratch));
emit_insn (gen_aarch64_get_lanev4sf (operands[0], scratch, elt));
DONE;
})
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ad07fe196a8..b60e5c52df6 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -7349,11 +7349,11 @@ get_rsqrte_type (machine_mode mode)
{
switch (mode)
{
- case DFmode: return gen_aarch64_rsqrte_df2;
- case SFmode: return gen_aarch64_rsqrte_sf2;
- case V2DFmode: return gen_aarch64_rsqrte_v2df2;
- case V2SFmode: return gen_aarch64_rsqrte_v2sf2;
- case V4SFmode: return gen_aarch64_rsqrte_v4sf2;
+ case DFmode: return gen_aarch64_rsqrtedf;
+ case SFmode: return gen_aarch64_rsqrtesf;
+ case V2DFmode: return gen_aarch64_rsqrtev2df;
+ case V2SFmode: return gen_aarch64_rsqrtev2sf;
+ case V4SFmode: return gen_aarch64_rsqrtev4sf;
default: gcc_unreachable ();
}
}
@@ -7368,11 +7368,11 @@ get_rsqrts_type (machine_mode mode)
{
switch (mode)
{
- case DFmode: return gen_aarch64_rsqrts_df3;
- case SFmode: return gen_aarch64_rsqrts_sf3;
- case V2DFmode: return gen_aarch64_rsqrts_v2df3;
- case V2SFmode: return gen_aarch64_rsqrts_v2sf3;
- case V4SFmode: return gen_aarch64_rsqrts_v4sf3;
+ case DFmode: return gen_aarch64_rsqrtsdf;
+ case SFmode: return gen_aarch64_rsqrtssf;
+ case V2DFmode: return gen_aarch64_rsqrtsv2df;
+ case V2SFmode: return gen_aarch64_rsqrtsv2sf;
+ case V4SFmode: return gen_aarch64_rsqrtsv4sf;
default: gcc_unreachable ();
}
}
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index dbc52c3286f..926f2da53b6 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -75,6 +75,8 @@
UNSPEC_CRC32H
UNSPEC_CRC32W
UNSPEC_CRC32X
+ UNSPEC_FCVTZS
+ UNSPEC_FCVTZU
UNSPEC_URECPE
UNSPEC_FRECPE
UNSPEC_FRECPS
@@ -105,6 +107,7 @@
UNSPEC_NOP
UNSPEC_PRLG_STK
UNSPEC_RBIT
+ UNSPEC_SCVTF
UNSPEC_SISD_NEG
UNSPEC_SISD_SSHL
UNSPEC_SISD_USHL
@@ -122,6 +125,7 @@
UNSPEC_TLSLE24
UNSPEC_TLSLE32
UNSPEC_TLSLE48
+ UNSPEC_UCVTF
UNSPEC_USHL_2S
UNSPEC_VSTRUCTDUMMY
UNSPEC_SP_SET
@@ -4627,6 +4631,36 @@
[(set_attr "type" "f_cvti2f")]
)
+;; Convert between fixed-point and floating-point (scalar modes)
+
+(define_insn "<FCVT_F2FIXED:fcvt_fixed_insn><GPF:mode>3"
+ [(set (match_operand:<GPF:FCVT_TARGET> 0 "register_operand" "=r, w")
+ (unspec:<GPF:FCVT_TARGET> [(match_operand:GPF 1 "register_operand" "w, w")
+ (match_operand:SI 2 "immediate_operand" "i, i")]
+ FCVT_F2FIXED))]
+ ""
+ "@
+ <FCVT_F2FIXED:fcvt_fixed_insn>\t%<w1>0, %<s>1, #%2
+ <FCVT_F2FIXED:fcvt_fixed_insn>\t%<s>0, %<s>1, #%2"
+ [(set_attr "type" "f_cvtf2i, neon_fp_to_int_<GPF:Vetype>")
+ (set_attr "fp" "yes, *")
+ (set_attr "simd" "*, yes")]
+)
+
+(define_insn "<FCVT_FIXED2F:fcvt_fixed_insn><GPI:mode>3"
+ [(set (match_operand:<GPI:FCVT_TARGET> 0 "register_operand" "=w, w")
+ (unspec:<GPI:FCVT_TARGET> [(match_operand:GPI 1 "register_operand" "r, w")
+ (match_operand:SI 2 "immediate_operand" "i, i")]
+ FCVT_FIXED2F))]
+ ""
+ "@
+ <FCVT_FIXED2F:fcvt_fixed_insn>\t%<s>0, %<w1>1, #%2
+ <FCVT_FIXED2F:fcvt_fixed_insn>\t%<s>0, %<s>1, #%2"
+ [(set_attr "type" "f_cvti2f, neon_int_to_fp_<GPI:Vetype>")
+ (set_attr "fp" "yes, *")
+ (set_attr "simd" "*, yes")]
+)
+
;; -------------------------------------------------------------------
;; Floating-point arithmetic
;; -------------------------------------------------------------------
diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
index d20caf09193..f70b6d367c5 100644
--- a/gcc/config/aarch64/arm_neon.h
+++ b/gcc/config/aarch64/arm_neon.h
@@ -5440,17 +5440,6 @@ vabaq_u32 (uint32x4_t a, uint32x4_t b, uint32x4_t c)
return result;
}
-__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
-vabd_f32 (float32x2_t a, float32x2_t b)
-{
- float32x2_t result;
- __asm__ ("fabd %0.2s, %1.2s, %2.2s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
vabd_s8 (int8x8_t a, int8x8_t b)
{
@@ -5517,17 +5506,6 @@ vabd_u32 (uint32x2_t a, uint32x2_t b)
return result;
}
-__extension__ static __inline float64_t __attribute__ ((__always_inline__))
-vabdd_f64 (float64_t a, float64_t b)
-{
- float64_t result;
- __asm__ ("fabd %d0, %d1, %d2"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int16x8_t __attribute__ ((__always_inline__))
vabdl_high_s8 (int8x16_t a, int8x16_t b)
{
@@ -5660,28 +5638,6 @@ vabdl_u32 (uint32x2_t a, uint32x2_t b)
return result;
}
-__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
-vabdq_f32 (float32x4_t a, float32x4_t b)
-{
- float32x4_t result;
- __asm__ ("fabd %0.4s, %1.4s, %2.4s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
-vabdq_f64 (float64x2_t a, float64x2_t b)
-{
- float64x2_t result;
- __asm__ ("fabd %0.2d, %1.2d, %2.2d"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int8x16_t __attribute__ ((__always_inline__))
vabdq_s8 (int8x16_t a, int8x16_t b)
{
@@ -5748,17 +5704,6 @@ vabdq_u32 (uint32x4_t a, uint32x4_t b)
return result;
}
-__extension__ static __inline float32_t __attribute__ ((__always_inline__))
-vabds_f32 (float32_t a, float32_t b)
-{
- float32_t result;
- __asm__ ("fabd %s0, %s1, %s2"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int16_t __attribute__ ((__always_inline__))
vaddlv_s8 (int8x8_t a)
{
@@ -6025,246 +5970,6 @@ vaddlvq_u32 (uint32x4_t a)
result; \
})
-#define vcvt_n_f32_s32(a, b) \
- __extension__ \
- ({ \
- int32x2_t a_ = (a); \
- float32x2_t result; \
- __asm__ ("scvtf %0.2s, %1.2s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvt_n_f32_u32(a, b) \
- __extension__ \
- ({ \
- uint32x2_t a_ = (a); \
- float32x2_t result; \
- __asm__ ("ucvtf %0.2s, %1.2s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvt_n_s32_f32(a, b) \
- __extension__ \
- ({ \
- float32x2_t a_ = (a); \
- int32x2_t result; \
- __asm__ ("fcvtzs %0.2s, %1.2s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvt_n_u32_f32(a, b) \
- __extension__ \
- ({ \
- float32x2_t a_ = (a); \
- uint32x2_t result; \
- __asm__ ("fcvtzu %0.2s, %1.2s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtd_n_f64_s64(a, b) \
- __extension__ \
- ({ \
- int64_t a_ = (a); \
- float64_t result; \
- __asm__ ("scvtf %d0,%d1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtd_n_f64_u64(a, b) \
- __extension__ \
- ({ \
- uint64_t a_ = (a); \
- float64_t result; \
- __asm__ ("ucvtf %d0,%d1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtd_n_s64_f64(a, b) \
- __extension__ \
- ({ \
- float64_t a_ = (a); \
- int64_t result; \
- __asm__ ("fcvtzs %d0,%d1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtd_n_u64_f64(a, b) \
- __extension__ \
- ({ \
- float64_t a_ = (a); \
- uint64_t result; \
- __asm__ ("fcvtzu %d0,%d1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_f32_s32(a, b) \
- __extension__ \
- ({ \
- int32x4_t a_ = (a); \
- float32x4_t result; \
- __asm__ ("scvtf %0.4s, %1.4s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_f32_u32(a, b) \
- __extension__ \
- ({ \
- uint32x4_t a_ = (a); \
- float32x4_t result; \
- __asm__ ("ucvtf %0.4s, %1.4s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_f64_s64(a, b) \
- __extension__ \
- ({ \
- int64x2_t a_ = (a); \
- float64x2_t result; \
- __asm__ ("scvtf %0.2d, %1.2d, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_f64_u64(a, b) \
- __extension__ \
- ({ \
- uint64x2_t a_ = (a); \
- float64x2_t result; \
- __asm__ ("ucvtf %0.2d, %1.2d, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_s32_f32(a, b) \
- __extension__ \
- ({ \
- float32x4_t a_ = (a); \
- int32x4_t result; \
- __asm__ ("fcvtzs %0.4s, %1.4s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_s64_f64(a, b) \
- __extension__ \
- ({ \
- float64x2_t a_ = (a); \
- int64x2_t result; \
- __asm__ ("fcvtzs %0.2d, %1.2d, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_u32_f32(a, b) \
- __extension__ \
- ({ \
- float32x4_t a_ = (a); \
- uint32x4_t result; \
- __asm__ ("fcvtzu %0.4s, %1.4s, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvtq_n_u64_f64(a, b) \
- __extension__ \
- ({ \
- float64x2_t a_ = (a); \
- uint64x2_t result; \
- __asm__ ("fcvtzu %0.2d, %1.2d, #%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvts_n_f32_s32(a, b) \
- __extension__ \
- ({ \
- int32_t a_ = (a); \
- float32_t result; \
- __asm__ ("scvtf %s0,%s1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvts_n_f32_u32(a, b) \
- __extension__ \
- ({ \
- uint32_t a_ = (a); \
- float32_t result; \
- __asm__ ("ucvtf %s0,%s1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvts_n_s32_f32(a, b) \
- __extension__ \
- ({ \
- float32_t a_ = (a); \
- int32_t result; \
- __asm__ ("fcvtzs %s0,%s1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
-#define vcvts_n_u32_f32(a, b) \
- __extension__ \
- ({ \
- float32_t a_ = (a); \
- uint32_t result; \
- __asm__ ("fcvtzu %s0,%s1,%2" \
- : "=w"(result) \
- : "w"(a_), "i"(b) \
- : /* No clobbers */); \
- result; \
- })
-
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
vcvtx_f32_f64 (float64x2_t a)
{
@@ -8520,17 +8225,6 @@ vpadalq_u32 (uint64x2_t a, uint32x4_t b)
return result;
}
-__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
-vpadd_f32 (float32x2_t a, float32x2_t b)
-{
- float32x2_t result;
- __asm__ ("faddp %0.2s,%1.2s,%2.2s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
vpaddl_s8 (int8x8_t a)
{
@@ -8663,28 +8357,6 @@ vpaddlq_u32 (uint32x4_t a)
return result;
}
-__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
-vpaddq_f32 (float32x4_t a, float32x4_t b)
-{
- float32x4_t result;
- __asm__ ("faddp %0.4s,%1.4s,%2.4s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
-vpaddq_f64 (float64x2_t a, float64x2_t b)
-{
- float64x2_t result;
- __asm__ ("faddp %0.2d,%1.2d,%2.2d"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int8x16_t __attribute__ ((__always_inline__))
vpaddq_s8 (int8x16_t a, int8x16_t b)
{
@@ -8773,17 +8445,6 @@ vpaddq_u64 (uint64x2_t a, uint64x2_t b)
return result;
}
-__extension__ static __inline float32_t __attribute__ ((__always_inline__))
-vpadds_f32 (float32x2_t a)
-{
- float32_t result;
- __asm__ ("faddp %s0,%1.2s"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline int16x4_t __attribute__ ((__always_inline__))
vqdmulh_n_s16 (int16x4_t a, int16_t b)
{
@@ -9403,28 +9064,6 @@ vqrdmulhq_n_s32 (int32x4_t a, int32_t b)
result; \
})
-__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
-vrsqrte_f32 (float32x2_t a)
-{
- float32x2_t result;
- __asm__ ("frsqrte %0.2s,%1.2s"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
-vrsqrte_f64 (float64x1_t a)
-{
- float64x1_t result;
- __asm__ ("frsqrte %d0,%d1"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
vrsqrte_u32 (uint32x2_t a)
{
@@ -9436,39 +9075,6 @@ vrsqrte_u32 (uint32x2_t a)
return result;
}
-__extension__ static __inline float64_t __attribute__ ((__always_inline__))
-vrsqrted_f64 (float64_t a)
-{
- float64_t result;
- __asm__ ("frsqrte %d0,%d1"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
-vrsqrteq_f32 (float32x4_t a)
-{
- float32x4_t result;
- __asm__ ("frsqrte %0.4s,%1.4s"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
-vrsqrteq_f64 (float64x2_t a)
-{
- float64x2_t result;
- __asm__ ("frsqrte %0.2d,%1.2d"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
__extension__ static __inline uint32x4_t __attribute__ ((__always_inline__))
vrsqrteq_u32 (uint32x4_t a)
{
@@ -9480,72 +9086,6 @@ vrsqrteq_u32 (uint32x4_t a)
return result;
}
-__extension__ static __inline float32_t __attribute__ ((__always_inline__))
-vrsqrtes_f32 (float32_t a)
-{
- float32_t result;
- __asm__ ("frsqrte %s0,%s1"
- : "=w"(result)
- : "w"(a)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
-vrsqrts_f32 (float32x2_t a, float32x2_t b)
-{
- float32x2_t result;
- __asm__ ("frsqrts %0.2s,%1.2s,%2.2s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64_t __attribute__ ((__always_inline__))
-vrsqrtsd_f64 (float64_t a, float64_t b)
-{
- float64_t result;
- __asm__ ("frsqrts %d0,%d1,%d2"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
-vrsqrtsq_f32 (float32x4_t a, float32x4_t b)
-{
- float32x4_t result;
- __asm__ ("frsqrts %0.4s,%1.4s,%2.4s"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
-vrsqrtsq_f64 (float64x2_t a, float64x2_t b)
-{
- float64x2_t result;
- __asm__ ("frsqrts %0.2d,%1.2d,%2.2d"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
-__extension__ static __inline float32_t __attribute__ ((__always_inline__))
-vrsqrtss_f32 (float32_t a, float32_t b)
-{
- float32_t result;
- __asm__ ("frsqrts %s0,%s1,%s2"
- : "=w"(result)
- : "w"(a), "w"(b)
- : /* No clobbers */);
- return result;
-}
-
#define vshrn_high_n_s16(a, b, c) \
__extension__ \
({ \
@@ -10596,6 +10136,45 @@ vtbx2_p8 (poly8x8_t r, poly8x8x2_t tab, uint8x8_t idx)
/* Start of optimal implementations in approved order. */
+/* vabd. */
+
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vabds_f32 (float32_t __a, float32_t __b)
+{
+ return __builtin_aarch64_fabdsf (__a, __b);
+}
+
+__extension__ static __inline float64_t __attribute__ ((__always_inline__))
+vabdd_f64 (float64_t __a, float64_t __b)
+{
+ return __builtin_aarch64_fabddf (__a, __b);
+}
+
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vabd_f32 (float32x2_t __a, float32x2_t __b)
+{
+ return __builtin_aarch64_fabdv2sf (__a, __b);
+}
+
+__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
+vabd_f64 (float64x1_t __a, float64x1_t __b)
+{
+ return (float64x1_t) {vabdd_f64 (vget_lane_f64 (__a, 0),
+ vget_lane_f64 (__b, 0))};
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vabdq_f32 (float32x4_t __a, float32x4_t __b)
+{
+ return __builtin_aarch64_fabdv4sf (__a, __b);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vabdq_f64 (float64x2_t __a, float64x2_t __b)
+{
+ return __builtin_aarch64_fabdv2df (__a, __b);
+}
+
/* vabs */
__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
@@ -12830,6 +12409,130 @@ vcvt_high_f64_f32 (float32x4_t __a)
return __builtin_aarch64_vec_unpacks_hi_v4sf (__a);
}
+/* vcvt (<u>fixed-point -> float). */
+
+__extension__ static __inline float64_t __attribute__ ((__always_inline__))
+vcvtd_n_f64_s64 (int64_t __a, const int __b)
+{
+ return __builtin_aarch64_scvtfdi (__a, __b);
+}
+
+__extension__ static __inline float64_t __attribute__ ((__always_inline__))
+vcvtd_n_f64_u64 (uint64_t __a, const int __b)
+{
+ return __builtin_aarch64_ucvtfdi_sus (__a, __b);
+}
+
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vcvts_n_f32_s32 (int32_t __a, const int __b)
+{
+ return __builtin_aarch64_scvtfsi (__a, __b);
+}
+
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vcvts_n_f32_u32 (uint32_t __a, const int __b)
+{
+ return __builtin_aarch64_ucvtfsi_sus (__a, __b);
+}
+
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vcvt_n_f32_s32 (int32x2_t __a, const int __b)
+{
+ return __builtin_aarch64_scvtfv2si (__a, __b);
+}
+
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vcvt_n_f32_u32 (uint32x2_t __a, const int __b)
+{
+ return __builtin_aarch64_ucvtfv2si_sus (__a, __b);
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vcvtq_n_f32_s32 (int32x4_t __a, const int __b)
+{
+ return __builtin_aarch64_scvtfv4si (__a, __b);
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vcvtq_n_f32_u32 (uint32x4_t __a, const int __b)
+{
+ return __builtin_aarch64_ucvtfv4si_sus (__a, __b);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vcvtq_n_f64_s64 (int64x2_t __a, const int __b)
+{
+ return __builtin_aarch64_scvtfv2di (__a, __b);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vcvtq_n_f64_u64 (uint64x2_t __a, const int __b)
+{
+ return __builtin_aarch64_ucvtfv2di_sus (__a, __b);
+}
+
+/* vcvt (float -> <u>fixed-point). */
+
+__extension__ static __inline int64_t __attribute__ ((__always_inline__))
+vcvtd_n_s64_f64 (float64_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzsdf (__a, __b);
+}
+
+__extension__ static __inline uint64_t __attribute__ ((__always_inline__))
+vcvtd_n_u64_f64 (float64_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzudf_uss (__a, __b);
+}
+
+__extension__ static __inline int32_t __attribute__ ((__always_inline__))
+vcvts_n_s32_f32 (float32_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzssf (__a, __b);
+}
+
+__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
+vcvts_n_u32_f32 (float32_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzusf_uss (__a, __b);
+}
+
+__extension__ static __inline int32x2_t __attribute__ ((__always_inline__))
+vcvt_n_s32_f32 (float32x2_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzsv2sf (__a, __b);
+}
+
+__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__))
+vcvt_n_u32_f32 (float32x2_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzuv2sf_uss (__a, __b);
+}
+
+__extension__ static __inline int32x4_t __attribute__ ((__always_inline__))
+vcvtq_n_s32_f32 (float32x4_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzsv4sf (__a, __b);
+}
+
+__extension__ static __inline uint32x4_t __attribute__ ((__always_inline__))
+vcvtq_n_u32_f32 (float32x4_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzuv4sf_uss (__a, __b);
+}
+
+__extension__ static __inline int64x2_t __attribute__ ((__always_inline__))
+vcvtq_n_s64_f64 (float64x2_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzsv2df (__a, __b);
+}
+
+__extension__ static __inline uint64x2_t __attribute__ ((__always_inline__))
+vcvtq_n_u64_f64 (float64x2_t __a, const int __b)
+{
+ return __builtin_aarch64_fcvtzuv2df_uss (__a, __b);
+}
+
/* vcvt (<u>int -> float) */
__extension__ static __inline float64_t __attribute__ ((__always_inline__))
@@ -18878,6 +18581,24 @@ vnegq_s64 (int64x2_t __a)
/* vpadd */
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vpadd_f32 (float32x2_t __a, float32x2_t __b)
+{
+ return __builtin_aarch64_faddpv2sf (__a, __b);
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vpaddq_f32 (float32x4_t __a, float32x4_t __b)
+{
+ return __builtin_aarch64_faddpv4sf (__a, __b);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vpaddq_f64 (float64x2_t __a, float64x2_t __b)
+{
+ return __builtin_aarch64_faddpv2df (__a, __b);
+}
+
__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
vpadd_s8 (int8x8_t __a, int8x8_t __b)
{
@@ -18917,6 +18638,12 @@ vpadd_u32 (uint32x2_t __a, uint32x2_t __b)
(int32x2_t) __b);
}
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vpadds_f32 (float32x2_t __a)
+{
+ return __builtin_aarch64_reduc_plus_scal_v2sf (__a);
+}
+
__extension__ static __inline float64_t __attribute__ ((__always_inline__))
vpaddd_f64 (float64x2_t __a)
{
@@ -21620,6 +21347,83 @@ vrshrd_n_u64 (uint64_t __a, const int __b)
return __builtin_aarch64_urshr_ndi_uus (__a, __b);
}
+/* vrsqrte. */
+
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vrsqrtes_f32 (float32_t __a)
+{
+ return __builtin_aarch64_rsqrtesf (__a);
+}
+
+__extension__ static __inline float64_t __attribute__ ((__always_inline__))
+vrsqrted_f64 (float64_t __a)
+{
+ return __builtin_aarch64_rsqrtedf (__a);
+}
+
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vrsqrte_f32 (float32x2_t __a)
+{
+ return __builtin_aarch64_rsqrtev2sf (__a);
+}
+
+__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
+vrsqrte_f64 (float64x1_t __a)
+{
+ return (float64x1_t) {vrsqrted_f64 (vget_lane_f64 (__a, 0))};
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vrsqrteq_f32 (float32x4_t __a)
+{
+ return __builtin_aarch64_rsqrtev4sf (__a);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vrsqrteq_f64 (float64x2_t __a)
+{
+ return __builtin_aarch64_rsqrtev2df (__a);
+}
+
+/* vrsqrts. */
+
+__extension__ static __inline float32_t __attribute__ ((__always_inline__))
+vrsqrtss_f32 (float32_t __a, float32_t __b)
+{
+ return __builtin_aarch64_rsqrtssf (__a, __b);
+}
+
+__extension__ static __inline float64_t __attribute__ ((__always_inline__))
+vrsqrtsd_f64 (float64_t __a, float64_t __b)
+{
+ return __builtin_aarch64_rsqrtsdf (__a, __b);
+}
+
+__extension__ static __inline float32x2_t __attribute__ ((__always_inline__))
+vrsqrts_f32 (float32x2_t __a, float32x2_t __b)
+{
+ return __builtin_aarch64_rsqrtsv2sf (__a, __b);
+}
+
+__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
+vrsqrts_f64 (float64x1_t __a, float64x1_t __b)
+{
+ return (float64x1_t) {vrsqrtsd_f64 (vget_lane_f64 (__a, 0),
+ vget_lane_f64 (__b, 0))};
+}
+
+__extension__ static __inline float32x4_t __attribute__ ((__always_inline__))
+vrsqrtsq_f32 (float32x4_t __a, float32x4_t __b)
+{
+ return __builtin_aarch64_rsqrtsv4sf (__a, __b);
+}
+
+__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))
+vrsqrtsq_f64 (float64x2_t __a, float64x2_t __b)
+{
+ return __builtin_aarch64_rsqrtsv2df (__a, __b);
+}
+
/* vrsra */
__extension__ static __inline int8x8_t __attribute__ ((__always_inline__))
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md
index 43b22d81cda..e8fbb1281de 100644
--- a/gcc/config/aarch64/iterators.md
+++ b/gcc/config/aarch64/iterators.md
@@ -154,6 +154,12 @@
;; Vector modes for S type.
(define_mode_iterator VDQ_SI [V2SI V4SI])
+;; Vector modes for S and D
+(define_mode_iterator VDQ_SDI [V2SI V4SI V2DI])
+
+;; Scalar and Vector modes for S and D
+(define_mode_iterator VSDQ_SDI [V2SI V4SI V2DI SI DI])
+
;; Vector modes for Q and H types.
(define_mode_iterator VDQQH [V8QI V16QI V4HI V8HI])
@@ -648,8 +654,13 @@
(define_mode_attr atomic_sfx
[(QI "b") (HI "h") (SI "") (DI "")])
-(define_mode_attr fcvt_target [(V2DF "v2di") (V4SF "v4si") (V2SF "v2si") (SF "si") (DF "di")])
-(define_mode_attr FCVT_TARGET [(V2DF "V2DI") (V4SF "V4SI") (V2SF "V2SI") (SF "SI") (DF "DI")])
+(define_mode_attr fcvt_target [(V2DF "v2di") (V4SF "v4si") (V2SF "v2si")
+ (V2DI "v2df") (V4SI "v4sf") (V2SI "v2sf")
+ (SF "si") (DF "di") (SI "sf") (DI "df")])
+(define_mode_attr FCVT_TARGET [(V2DF "V2DI") (V4SF "V4SI") (V2SF "V2SI")
+ (V2DI "V2DF") (V4SI "V4SF") (V2SI "V2SF")
+ (SF "SI") (DF "DI") (SI "SF") (DI "DF")])
+
;; for the inequal width integer to fp conversions
(define_mode_attr fcvt_iesize [(SF "di") (DF "si")])
@@ -1002,6 +1013,9 @@
(define_int_iterator FCVT [UNSPEC_FRINTZ UNSPEC_FRINTP UNSPEC_FRINTM
UNSPEC_FRINTA UNSPEC_FRINTN])
+(define_int_iterator FCVT_F2FIXED [UNSPEC_FCVTZS UNSPEC_FCVTZU])
+(define_int_iterator FCVT_FIXED2F [UNSPEC_SCVTF UNSPEC_UCVTF])
+
(define_int_iterator FRECP [UNSPEC_FRECPE UNSPEC_FRECPX])
(define_int_iterator CRC [UNSPEC_CRC32B UNSPEC_CRC32H UNSPEC_CRC32W
@@ -1138,6 +1152,11 @@
(UNSPEC_FRINTP "ceil") (UNSPEC_FRINTM "floor")
(UNSPEC_FRINTN "frintn")])
+(define_int_attr fcvt_fixed_insn [(UNSPEC_SCVTF "scvtf")
+ (UNSPEC_UCVTF "ucvtf")
+ (UNSPEC_FCVTZS "fcvtzs")
+ (UNSPEC_FCVTZU "fcvtzu")])
+
(define_int_attr perm_insn [(UNSPEC_ZIP1 "zip") (UNSPEC_ZIP2 "zip")
(UNSPEC_TRN1 "trn") (UNSPEC_TRN2 "trn")
(UNSPEC_UZP1 "uzp") (UNSPEC_UZP2 "uzp")])
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c191eebc09d..b807a9a0004 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6823,6 +6823,8 @@ ix86_set_func_type (tree fndecl)
cfun->machine->func_type
= nargs == 2 ? TYPE_EXCEPTION : TYPE_INTERRUPT;
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+
/* Only dwarf2out.c can handle -WORD(AP) as a pointer argument. */
if (write_symbols != NO_DEBUG && write_symbols != DWARF2_DEBUG)
sorry ("Only DWARF debug format is supported for interrupt "
@@ -13817,16 +13819,6 @@ ix86_expand_prologue (void)
if (frame_pointer_needed && frame.red_zone_size)
emit_insn (gen_memory_blockage ());
- /* Emit cld instruction if stringops are used in the function. Since
- we can't assume the direction flag in interrupt handler, we must
- emit cld instruction if stringops are used in interrupt handler or
- interrupt handler isn't a leaf function. */
- if ((TARGET_CLD && ix86_current_function_needs_cld)
- || (!TARGET_CLD
- && cfun->machine->func_type != TYPE_NORMAL
- && (ix86_current_function_needs_cld || !crtl->is_leaf)))
- emit_insn (gen_cld ());
-
/* SEH requires that the prologue end within 256 bytes of the start of
the function. Prevent instruction schedules that would extend that.
Further, prevent alloca modifications to the stack pointer from being
@@ -18600,6 +18592,35 @@ output_387_binary_op (rtx insn, rtx *operands)
return buf;
}
+/* Return needed mode for entity in optimize_mode_switching pass. */
+
+static int
+ix86_dirflag_mode_needed (rtx_insn *insn)
+{
+ if (CALL_P (insn))
+ {
+ if (cfun->machine->func_type == TYPE_NORMAL)
+ return X86_DIRFLAG_ANY;
+ else
+ /* No need to emit CLD in interrupt handler for TARGET_CLD. */
+ return TARGET_CLD ? X86_DIRFLAG_ANY : X86_DIRFLAG_RESET;
+ }
+
+ if (recog_memoized (insn) < 0)
+ return X86_DIRFLAG_ANY;
+
+ if (get_attr_type (insn) == TYPE_STR)
+ {
+ /* Emit cld instruction if stringops are used in the function. */
+ if (cfun->machine->func_type == TYPE_NORMAL)
+ return TARGET_CLD ? X86_DIRFLAG_RESET : X86_DIRFLAG_ANY;
+ else
+ return X86_DIRFLAG_RESET;
+ }
+
+ return X86_DIRFLAG_ANY;
+}
+
/* Check if a 256bit AVX register is referenced inside of EXP. */
static bool
@@ -18712,6 +18733,8 @@ ix86_mode_needed (int entity, rtx_insn *insn)
{
switch (entity)
{
+ case X86_DIRFLAG:
+ return ix86_dirflag_mode_needed (insn);
case AVX_U128:
return ix86_avx_u128_mode_needed (insn);
case I387_TRUNC:
@@ -18771,6 +18794,8 @@ ix86_mode_after (int entity, int mode, rtx_insn *insn)
{
switch (entity)
{
+ case X86_DIRFLAG:
+ return mode;
case AVX_U128:
return ix86_avx_u128_mode_after (mode, insn);
case I387_TRUNC:
@@ -18784,6 +18809,18 @@ ix86_mode_after (int entity, int mode, rtx_insn *insn)
}
static int
+ix86_dirflag_mode_entry (void)
+{
+ /* For TARGET_CLD or in the interrupt handler we can't assume
+ direction flag state at function entry. */
+ if (TARGET_CLD
+ || cfun->machine->func_type != TYPE_NORMAL)
+ return X86_DIRFLAG_ANY;
+
+ return X86_DIRFLAG_RESET;
+}
+
+static int
ix86_avx_u128_mode_entry (void)
{
tree arg;
@@ -18810,6 +18847,8 @@ ix86_mode_entry (int entity)
{
switch (entity)
{
+ case X86_DIRFLAG:
+ return ix86_dirflag_mode_entry ();
case AVX_U128:
return ix86_avx_u128_mode_entry ();
case I387_TRUNC:
@@ -18843,6 +18882,8 @@ ix86_mode_exit (int entity)
{
switch (entity)
{
+ case X86_DIRFLAG:
+ return X86_DIRFLAG_ANY;
case AVX_U128:
return ix86_avx_u128_mode_exit ();
case I387_TRUNC:
@@ -18986,6 +19027,10 @@ ix86_emit_mode_set (int entity, int mode, int prev_mode ATTRIBUTE_UNUSED,
{
switch (entity)
{
+ case X86_DIRFLAG:
+ if (mode == X86_DIRFLAG_RESET)
+ emit_insn (gen_cld ());
+ break;
case AVX_U128:
if (mode == AVX_U128_CLEAN)
ix86_avx_emit_vzeroupper (regs_live);
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f1fa02c3302..cab0a5d013b 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2376,9 +2376,21 @@ enum ix86_fpcmp_strategy {
Post-reload pass may be later used to eliminate the redundant fildcw if
needed. */
+enum ix86_stack_slot
+{
+ SLOT_TEMP = 0,
+ SLOT_CW_STORED,
+ SLOT_CW_TRUNC,
+ SLOT_CW_FLOOR,
+ SLOT_CW_CEIL,
+ SLOT_CW_MASK_PM,
+ MAX_386_STACK_LOCALS
+};
+
enum ix86_entity
{
- AVX_U128 = 0,
+ X86_DIRFLAG = 0,
+ AVX_U128,
I387_TRUNC,
I387_FLOOR,
I387_CEIL,
@@ -2386,15 +2398,10 @@ enum ix86_entity
MAX_386_ENTITIES
};
-enum ix86_stack_slot
+enum x86_dirflag_state
{
- SLOT_TEMP = 0,
- SLOT_CW_STORED,
- SLOT_CW_TRUNC,
- SLOT_CW_FLOOR,
- SLOT_CW_CEIL,
- SLOT_CW_MASK_PM,
- MAX_386_STACK_LOCALS
+ X86_DIRFLAG_RESET,
+ X86_DIRFLAG_ANY
};
enum avx_u128_state
@@ -2418,8 +2425,9 @@ enum avx_u128_state
starting counting at zero - determines the integer that is used to
refer to the mode-switched entity in question. */
-#define NUM_MODES_FOR_MODE_SWITCHING \
- { AVX_U128_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY }
+#define NUM_MODES_FOR_MODE_SWITCHING \
+ { X86_DIRFLAG_ANY, AVX_U128_ANY, \
+ I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY }
/* Avoid renaming of stack registers, as doing so in combination with
@@ -2516,9 +2524,6 @@ struct GTY(()) machine_function {
/* Nonzero if the function accesses a previous frame. */
BOOL_BITFIELD accesses_prev_frame : 1;
- /* Nonzero if the function requires a CLD in the prologue. */
- BOOL_BITFIELD needs_cld : 1;
-
/* Set by ix86_compute_frame_layout and used by prologue/epilogue
expander to determine the style used. */
BOOL_BITFIELD use_fast_prologue_epilogue : 1;
@@ -2572,7 +2577,6 @@ struct GTY(()) machine_function {
#define ix86_varargs_gpr_size (cfun->machine->varargs_gpr_size)
#define ix86_varargs_fpr_size (cfun->machine->varargs_fpr_size)
#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
-#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
#define ix86_pc_thunk_call_expanded (cfun->machine->pc_thunk_call_expanded)
#define ix86_tls_descriptor_calls_expanded_in_cfun \
(cfun->machine->tls_descriptor_call_expanded_p)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a32c4e204ce..416cdcd9129 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -16350,7 +16350,10 @@
(set (match_operand 2 "register_operand")
(match_operand 5))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*strmovdi_rex_1"
[(set (mem:DI (match_operand:P 2 "register_operand" "0"))
@@ -16432,7 +16435,10 @@
(match_operand 3 "memory_operand"))
(use (match_dup 4))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*rep_movdi_rex64"
[(set (match_operand:P 2 "register_operand" "=c") (const_int 0))
@@ -16555,7 +16561,10 @@
(match_operand 3))
(unspec [(const_int 0)] UNSPEC_STOS)])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*strsetdi_rex_1"
[(set (mem:DI (match_operand:P 1 "register_operand" "0"))
@@ -16627,7 +16636,10 @@
(use (match_operand 3 "register_operand"))
(use (match_dup 1))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*rep_stosdi_rex64"
[(set (match_operand:P 1 "register_operand" "=c") (const_int 0))
@@ -16786,7 +16798,10 @@
(clobber (match_operand 1 "register_operand"))
(clobber (match_dup 2))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*cmpstrnqi_nz_1"
[(set (reg:CC FLAGS_REG)
@@ -16824,7 +16839,10 @@
(clobber (match_operand 1 "register_operand"))
(clobber (match_dup 2))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*cmpstrnqi_1"
[(set (reg:CC FLAGS_REG)
@@ -16870,7 +16888,10 @@
(clobber (match_operand 1 "register_operand"))
(clobber (reg:CC FLAGS_REG))])]
""
- "ix86_current_function_needs_cld = 1;")
+{
+ if (TARGET_CLD)
+ ix86_optimize_mode_switching[X86_DIRFLAG] = 1;
+})
(define_insn "*strlenqi_1"
[(set (match_operand:P 0 "register_operand" "=&c")
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5e7460841a0..82ef04a2a03 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -18414,10 +18414,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "avx_vec_concat<mode>"
- [(set (match_operand:V_256_512 0 "register_operand" "=x,x")
+ [(set (match_operand:V_256_512 0 "register_operand" "=x,v,x,Yv")
(vec_concat:V_256_512
- (match_operand:<ssehalfvecmode> 1 "register_operand" "x,x")
- (match_operand:<ssehalfvecmode> 2 "vector_move_operand" "xm,C")))]
+ (match_operand:<ssehalfvecmode> 1 "register_operand" "x,v,x,v")
+ (match_operand:<ssehalfvecmode> 2 "vector_move_operand" "xm,vm,C,C")))]
"TARGET_AVX"
{
switch (which_alternative)
@@ -18425,6 +18425,22 @@
case 0:
return "vinsert<i128>\t{$0x1, %2, %<concat_tg_mode>1, %0|%0, %<concat_tg_mode>1, %2, 0x1}";
case 1:
+ if (<MODE_SIZE> == 64)
+ {
+ if (TARGET_AVX512DQ && GET_MODE_SIZE (<ssescalarmode>mode) == 4)
+ return "vinsert<shuffletype>32x8\t{$0x1, %2, %<concat_tg_mode>1, %0|%0, %<concat_tg_mode>1, %2, 0x1}";
+ else
+ return "vinsert<shuffletype>64x4\t{$0x1, %2, %<concat_tg_mode>1, %0|%0, %<concat_tg_mode>1, %2, 0x1}";
+ }
+ else
+ {
+ if (TARGET_AVX512DQ && GET_MODE_SIZE (<ssescalarmode>mode) == 8)
+ return "vinsert<shuffletype>64x2\t{$0x1, %2, %<concat_tg_mode>1, %0|%0, %<concat_tg_mode>1, %2, 0x1}";
+ else
+ return "vinsert<shuffletype>32x4\t{$0x1, %2, %<concat_tg_mode>1, %0|%0, %<concat_tg_mode>1, %2, 0x1}";
+ }
+ case 2:
+ case 3:
switch (get_attr_mode (insn))
{
case MODE_V16SF:
@@ -18436,9 +18452,19 @@
case MODE_V4DF:
return "vmovapd\t{%1, %x0|%x0, %1}";
case MODE_XI:
- return "vmovdqa\t{%1, %t0|%t0, %1}";
+ if (which_alternative == 2)
+ return "vmovdqa\t{%1, %t0|%t0, %1}";
+ else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
+ return "vmovdqa64\t{%1, %t0|%t0, %1}";
+ else
+ return "vmovdqa32\t{%1, %t0|%t0, %1}";
case MODE_OI:
- return "vmovdqa\t{%1, %x0|%x0, %1}";
+ if (which_alternative == 2)
+ return "vmovdqa\t{%1, %x0|%x0, %1}";
+ else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
+ return "vmovdqa64\t{%1, %x0|%x0, %1}";
+ else
+ return "vmovdqa32\t{%1, %x0|%x0, %1}";
default:
gcc_unreachable ();
}
@@ -18446,9 +18472,9 @@
gcc_unreachable ();
}
}
- [(set_attr "type" "sselog,ssemov")
- (set_attr "prefix_extra" "1,*")
- (set_attr "length_immediate" "1,*")
+ [(set_attr "type" "sselog,sselog,ssemov,ssemov")
+ (set_attr "prefix_extra" "1,1,*,*")
+ (set_attr "length_immediate" "1,1,*,*")
(set_attr "prefix" "maybe_evex")
(set_attr "mode" "<sseinsnmode>")])
diff --git a/gcc/config/mips/p5600.md b/gcc/config/mips/p5600.md
index 694a745a926..4500ceb6f9b 100644
--- a/gcc/config/mips/p5600.md
+++ b/gcc/config/mips/p5600.md
@@ -163,10 +163,10 @@
;; fadd, fsub
(define_insn_reservation "p5600_fpu_fadd" 4
(and (eq_attr "cpu" "p5600")
- (eq_attr "type" "fadd,fabs,fneg"))
+ (eq_attr "type" "fadd"))
"p5600_fpu_long, p5600_fpu_apu")
-;; fabs, fneg, fcmp
+;; fabs, fneg, fcmp, fmove
(define_insn_reservation "p5600_fpu_fabs" 2
(and (eq_attr "cpu" "p5600")
(eq_attr "type" "fabs,fneg,fcmp,fmove"))
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 75100d2d69f..493b764ee69 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -7014,7 +7014,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
op = XEXP (operands[0], 0);
/* Generate indirect long calls to non-local functions. */
- if (!TARGET_64BIT && TARGET_LONG_CALLS && GET_CODE (op) == SYMBOL_REF)
+ if (TARGET_LONG_CALLS && GET_CODE (op) == SYMBOL_REF)
{
tree call_decl = SYMBOL_REF_DECL (op);
if (!(call_decl && targetm.binds_local_p (call_decl)))
@@ -7517,7 +7517,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
call_powf = true;
/* Generate indirect long calls to non-local functions. */
- else if (!TARGET_64BIT && TARGET_LONG_CALLS)
+ else if (TARGET_LONG_CALLS)
{
tree call_decl = SYMBOL_REF_DECL (op);
if (!(call_decl && targetm.binds_local_p (call_decl)))
@@ -8133,7 +8133,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "r"))
(match_operand 2 "" "i")))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(clobber (match_operand 3))
(use (reg:DI 27))
@@ -8155,7 +8154,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(parallel [(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" ""))
(match_operand 2 "" "")))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(clobber (match_operand 3))
(use (reg:DI 27))
@@ -8167,7 +8165,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
@@ -8178,7 +8175,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(parallel [(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" ""))
(match_operand 2 "" "")))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(clobber (match_operand 3))
(use (reg:DI 27))
@@ -8189,7 +8185,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
@@ -8201,7 +8196,6 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "r"))
(match_operand 2 "" "i")))
- (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 7e42aefe4c6..3ce74ab9144 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -229,6 +229,7 @@
#define vec_mladd __builtin_vec_mladd
#define vec_msum __builtin_vec_msum
#define vec_msums __builtin_vec_msums
+#define vec_mul __builtin_vec_mul
#define vec_mule __builtin_vec_mule
#define vec_mulo __builtin_vec_mulo
#define vec_nor __builtin_vec_nor
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 35a2e130ef4..606d7ae2840 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1300,6 +1300,7 @@ BU_ALTIVEC_OVERLOAD_X (LVRX, "lvrx")
BU_ALTIVEC_OVERLOAD_X (LVRXL, "lvrxl")
BU_ALTIVEC_OVERLOAD_X (LVSL, "lvsl")
BU_ALTIVEC_OVERLOAD_X (LVSR, "lvsr")
+BU_ALTIVEC_OVERLOAD_X (MUL, "mul")
BU_ALTIVEC_OVERLOAD_X (PROMOTE, "promote")
BU_ALTIVEC_OVERLOAD_X (SLD, "sld")
BU_ALTIVEC_OVERLOAD_X (SPLAT, "splat")
@@ -1600,7 +1601,6 @@ BU_VSX_OVERLOAD_3V (XXPERMDI, "xxpermdi")
BU_VSX_OVERLOAD_3V (XXSLDWI, "xxsldwi")
/* 2 argument VSX overloaded builtin functions. */
-BU_VSX_OVERLOAD_2 (MUL, "mul")
BU_VSX_OVERLOAD_2 (DIV, "div")
BU_VSX_OVERLOAD_2 (XXMRGHW, "xxmrghw")
BU_VSX_OVERLOAD_2 (XXMRGLW, "xxmrglw")
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 9e479a98eab..d313e9b20fb 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -1941,14 +1941,6 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 },
- { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_XVMULSP,
- RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 },
- { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_XVMULDP,
- RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 },
- { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_MUL_V2DI,
- RS6000_BTI_V2DI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
- { VSX_BUILTIN_VEC_MUL, VSX_BUILTIN_MUL_V2DI,
- RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
{ ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULEUB,
RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULESB,
@@ -4683,6 +4675,57 @@ assignment for unaligned loads and stores");
warning (OPT_Wdeprecated, "vec_lvsr is deprecated for little endian; use \
assignment for unaligned loads and stores");
+ if (fcode == ALTIVEC_BUILTIN_VEC_MUL)
+ {
+ /* vec_mul needs to be special cased because there are no instructions
+ for it for the {un}signed char, {un}signed short, and {un}signed int
+ types. */
+ if (nargs != 2)
+ {
+ error ("vec_mul only accepts 2 arguments");
+ return error_mark_node;
+ }
+
+ tree arg0 = (*arglist)[0];
+ tree arg0_type = TREE_TYPE (arg0);
+ tree arg1 = (*arglist)[1];
+ tree arg1_type = TREE_TYPE (arg1);
+
+ /* Both arguments must be vectors and the types must match. */
+ if (arg0_type != arg1_type)
+ goto bad;
+ if (TREE_CODE (arg0_type) != VECTOR_TYPE)
+ goto bad;
+
+ switch (TYPE_MODE (TREE_TYPE (arg0_type)))
+ {
+ case QImode:
+ case HImode:
+ case SImode:
+ case DImode:
+ case TImode:
+ {
+ /* For scalar types just use a multiply expression. */
+ return fold_build2_loc (loc, MULT_EXPR, TREE_TYPE (arg0),
+ arg0, arg1);
+ }
+ case SFmode:
+ {
+ /* For floats use the xvmulsp instruction directly. */
+ tree call = rs6000_builtin_decls[VSX_BUILTIN_XVMULSP];
+ return build_call_expr (call, 2, arg0, arg1);
+ }
+ case DFmode:
+ {
+ /* For doubles use the xvmuldp instruction directly. */
+ tree call = rs6000_builtin_decls[VSX_BUILTIN_XVMULDP];
+ return build_call_expr (call, 2, arg0, arg1);
+ }
+ /* Other types are errors. */
+ default:
+ goto bad;
+ }
+ }
if (fcode == ALTIVEC_BUILTIN_VEC_CMPNE)
{
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index bf02509cfe1..ddb174528f2 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -16648,6 +16648,8 @@ altivec_init_builtins (void)
ALTIVEC_BUILTIN_VEC_ADDEC);
def_builtin ("__builtin_vec_cmpne", opaque_ftype_opaque_opaque,
ALTIVEC_BUILTIN_VEC_CMPNE);
+ def_builtin ("__builtin_vec_mul", opaque_ftype_opaque_opaque,
+ ALTIVEC_BUILTIN_VEC_MUL);
/* Cell builtins. */
def_builtin ("__builtin_altivec_lvlx", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_LVLX);
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b6c0c98310b..86dddd210d7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+2016-06-06 Jakub Jelinek <jakub@redhat.com>
+ Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70847
+ PR c++/71330
+ PR c++/71393
+ * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
+ right after cp_fold call if cp_fold has returned the same stmt
+ already in some earlier cp_fold_r call.
+ (cp_fold_function): Add pset automatic variable, pass its address
+ to cp_walk_tree.
+
2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70202
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 72ba50ee723..dcb0fa6215b 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -940,6 +940,17 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data)
*stmt_p = stmt = cp_fold (*stmt_p);
+ if (((hash_set<tree> *) data)->add (stmt))
+ {
+ /* Don't walk subtrees of stmts we've already walked once, otherwise
+ we can have exponential complexity with e.g. lots of nested
+ SAVE_EXPRs or TARGET_EXPRs. cp_fold uses a cache and will return
+ always the same tree, which the first time cp_fold_r has been
+ called on it had the subtrees walked. */
+ *walk_subtrees = 0;
+ return NULL;
+ }
+
code = TREE_CODE (stmt);
if (code == OMP_FOR || code == OMP_SIMD || code == OMP_DISTRIBUTE
|| code == OMP_TASKLOOP || code == CILK_FOR || code == CILK_SIMD
@@ -997,7 +1008,8 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data)
void
cp_fold_function (tree fndecl)
{
- cp_walk_tree (&DECL_SAVED_TREE (fndecl), cp_fold_r, NULL, NULL);
+ hash_set<tree> pset;
+ cp_walk_tree (&DECL_SAVED_TREE (fndecl), cp_fold_r, &pset, NULL);
}
/* Perform any pre-gimplification lowering of C++ front end trees to
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 810617243f2..8467aaa377d 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -46,8 +46,12 @@ along with GCC; see the file COPYING3. If not see
#define permissive_error_option(DC) ((DC)->opt_permissive)
/* Prototypes. */
+static bool diagnostic_impl (rich_location *, int, const char *,
+ va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(3,0);
+static bool diagnostic_n_impl (location_t, int, int, const char *,
+ const char *, va_list *,
+ diagnostic_t) ATTRIBUTE_GCC_DIAG(5,0);
static void error_recursion (diagnostic_context *) ATTRIBUTE_NORETURN;
-
static void real_abort (void) ATTRIBUTE_NORETURN;
/* Name of program invoked, sans directories. */
@@ -913,29 +917,57 @@ diagnostic_append_note (diagnostic_context *context,
va_end (ap);
}
-bool
-emit_diagnostic (diagnostic_t kind, location_t location, int opt,
- const char *gmsgid, ...)
+/* Implement emit_diagnostic, inform, inform_at_rich_loc, warning, warning_at,
+ warning_at_rich_loc, pedwarn, permerror, permerror_at_rich_loc, error,
+ error_at, error_at_rich_loc, sorry, fatal_error, internal_error, and
+ internal_error_no_backtrace, as documented and defined below. */
+static bool
+diagnostic_impl (rich_location *richloc, int opt,
+ const char *gmsgid,
+ va_list *ap, diagnostic_t kind)
{
diagnostic_info diagnostic;
- va_list ap;
- bool ret;
- rich_location richloc (line_table, location);
-
- va_start (ap, gmsgid);
if (kind == DK_PERMERROR)
{
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc,
+ diagnostic_set_info (&diagnostic, gmsgid, ap, richloc,
permissive_error_kind (global_dc));
diagnostic.option_index = permissive_error_option (global_dc);
}
- else {
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, kind);
+ else
+ {
+ diagnostic_set_info (&diagnostic, gmsgid, ap, richloc, kind);
if (kind == DK_WARNING || kind == DK_PEDWARN)
diagnostic.option_index = opt;
- }
+ }
+ return report_diagnostic (&diagnostic);
+}
+
+/* Implement inform_n, warning_n, and error_n, as documented and
+ defined below. */
+static bool
+diagnostic_n_impl (location_t location, int opt, int n,
+ const char *singular_gmsgid,
+ const char *plural_gmsgid,
+ va_list *ap, diagnostic_t kind)
+{
+ diagnostic_info diagnostic;
+ rich_location richloc (line_table, location);
+ diagnostic_set_info_translated (&diagnostic,
+ ngettext (singular_gmsgid, plural_gmsgid, n),
+ ap, &richloc, kind);
+ if (kind == DK_WARNING)
+ diagnostic.option_index = opt;
+ return report_diagnostic (&diagnostic);
+}
- ret = report_diagnostic (&diagnostic);
+bool
+emit_diagnostic (diagnostic_t kind, location_t location, int opt,
+ const char *gmsgid, ...)
+{
+ va_list ap;
+ va_start (ap, gmsgid);
+ rich_location richloc (line_table, location);
+ bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, kind);
va_end (ap);
return ret;
}
@@ -945,13 +977,10 @@ emit_diagnostic (diagnostic_t kind, location_t location, int opt,
void
inform (location_t location, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_NOTE);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, location);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_NOTE);
va_end (ap);
}
@@ -959,12 +988,9 @@ inform (location_t location, const char *gmsgid, ...)
void
inform_at_rich_loc (rich_location *richloc, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, richloc, DK_NOTE);
- report_diagnostic (&diagnostic);
+ diagnostic_impl (richloc, -1, gmsgid, &ap, DK_NOTE);
va_end (ap);
}
@@ -974,15 +1000,10 @@ void
inform_n (location_t location, int n, const char *singular_gmsgid,
const char *plural_gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, location);
-
va_start (ap, plural_gmsgid);
- diagnostic_set_info_translated (&diagnostic,
- ngettext (singular_gmsgid, plural_gmsgid, n),
- &ap, &richloc, DK_NOTE);
- report_diagnostic (&diagnostic);
+ diagnostic_n_impl (location, -1, n, singular_gmsgid, plural_gmsgid,
+ &ap, DK_NOTE);
va_end (ap);
}
@@ -992,16 +1013,10 @@ inform_n (location_t location, int n, const char *singular_gmsgid,
bool
warning (int opt, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
- rich_location richloc (line_table, input_location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_WARNING);
- diagnostic.option_index = opt;
-
- ret = report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, input_location);
+ bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
va_end (ap);
return ret;
}
@@ -1013,15 +1028,10 @@ warning (int opt, const char *gmsgid, ...)
bool
warning_at (location_t location, int opt, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
- rich_location richloc (line_table, location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_WARNING);
- diagnostic.option_index = opt;
- ret = report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, location);
+ bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_WARNING);
va_end (ap);
return ret;
}
@@ -1031,14 +1041,9 @@ warning_at (location_t location, int opt, const char *gmsgid, ...)
bool
warning_at_rich_loc (rich_location *richloc, int opt, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, richloc, DK_WARNING);
- diagnostic.option_index = opt;
- ret = report_diagnostic (&diagnostic);
+ bool ret = diagnostic_impl (richloc, opt, gmsgid, &ap, DK_WARNING);
va_end (ap);
return ret;
}
@@ -1051,18 +1056,11 @@ bool
warning_n (location_t location, int opt, int n, const char *singular_gmsgid,
const char *plural_gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
- rich_location richloc (line_table, location);
-
va_start (ap, plural_gmsgid);
- diagnostic_set_info_translated (&diagnostic,
- ngettext (singular_gmsgid, plural_gmsgid, n),
- &ap, &richloc, DK_WARNING
-);
- diagnostic.option_index = opt;
- ret = report_diagnostic (&diagnostic);
+ bool ret = diagnostic_n_impl (location, opt, n,
+ singular_gmsgid, plural_gmsgid,
+ &ap, DK_WARNING);
va_end (ap);
return ret;
}
@@ -1083,15 +1081,10 @@ warning_n (location_t location, int opt, int n, const char *singular_gmsgid,
bool
pedwarn (location_t location, int opt, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
- rich_location richloc (line_table, location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_PEDWARN);
- diagnostic.option_index = opt;
- ret = report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, location);
+ bool ret = diagnostic_impl (&richloc, opt, gmsgid, &ap, DK_PEDWARN);
va_end (ap);
return ret;
}
@@ -1106,16 +1099,10 @@ pedwarn (location_t location, int opt, const char *gmsgid, ...)
bool
permerror (location_t location, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
- rich_location richloc (line_table, location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc,
- permissive_error_kind (global_dc));
- diagnostic.option_index = permissive_error_option (global_dc);
- ret = report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, location);
+ bool ret = diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_PERMERROR);
va_end (ap);
return ret;
}
@@ -1125,15 +1112,9 @@ permerror (location_t location, const char *gmsgid, ...)
bool
permerror_at_rich_loc (rich_location *richloc, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- bool ret;
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, richloc,
- permissive_error_kind (global_dc));
- diagnostic.option_index = permissive_error_option (global_dc);
- ret = report_diagnostic (&diagnostic);
+ bool ret = diagnostic_impl (richloc, -1, gmsgid, &ap, DK_PERMERROR);
va_end (ap);
return ret;
}
@@ -1143,13 +1124,10 @@ permerror_at_rich_loc (rich_location *richloc, const char *gmsgid, ...)
void
error (const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, input_location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_ERROR);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, input_location);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_ERROR);
va_end (ap);
}
@@ -1159,44 +1137,32 @@ void
error_n (location_t location, int n, const char *singular_gmsgid,
const char *plural_gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, location);
-
va_start (ap, plural_gmsgid);
- diagnostic_set_info_translated (&diagnostic,
- ngettext (singular_gmsgid, plural_gmsgid, n),
- &ap, &richloc, DK_ERROR);
- report_diagnostic (&diagnostic);
+ diagnostic_n_impl (location, -1, n, singular_gmsgid, plural_gmsgid,
+ &ap, DK_ERROR);
va_end (ap);
}
-/* Same as ebove, but use location LOC instead of input_location. */
+/* Same as above, but use location LOC instead of input_location. */
void
error_at (location_t loc, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, loc);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_ERROR);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, loc);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_ERROR);
va_end (ap);
}
/* Same as above, but use RICH_LOC. */
void
-error_at_rich_loc (rich_location *rich_loc, const char *gmsgid, ...)
+error_at_rich_loc (rich_location *richloc, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, rich_loc,
- DK_ERROR);
- report_diagnostic (&diagnostic);
+ diagnostic_impl (richloc, -1, gmsgid, &ap, DK_ERROR);
va_end (ap);
}
@@ -1206,13 +1172,10 @@ error_at_rich_loc (rich_location *rich_loc, const char *gmsgid, ...)
void
sorry (const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, input_location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_SORRY);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, input_location);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_SORRY);
va_end (ap);
}
@@ -1230,13 +1193,10 @@ seen_error (void)
void
fatal_error (location_t loc, const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, loc);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_FATAL);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, loc);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_FATAL);
va_end (ap);
gcc_unreachable ();
@@ -1249,13 +1209,10 @@ fatal_error (location_t loc, const char *gmsgid, ...)
void
internal_error (const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, input_location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_ICE);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, input_location);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_ICE);
va_end (ap);
gcc_unreachable ();
@@ -1267,13 +1224,10 @@ internal_error (const char *gmsgid, ...)
void
internal_error_no_backtrace (const char *gmsgid, ...)
{
- diagnostic_info diagnostic;
va_list ap;
- rich_location richloc (line_table, input_location);
-
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_ICE_NOBT);
- report_diagnostic (&diagnostic);
+ rich_location richloc (line_table, input_location);
+ diagnostic_impl (&richloc, -1, gmsgid, &ap, DK_ICE_NOBT);
va_end (ap);
gcc_unreachable ();
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e2647ebb461..15bb42a5a7b 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1000,7 +1000,7 @@ See RS/6000 and PowerPC Options.
-mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
-msave-toc-indirect -mno-save-toc-indirect @gol
-mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
--mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
+-mcrypto -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move @gol
-mquad-memory -mno-quad-memory @gol
-mquad-memory-atomic -mno-quad-memory-atomic @gol
-mcompat-align-parm -mno-compat-align-parm @gol
@@ -9067,6 +9067,10 @@ The maximum number of insns of an unswitched loop.
@item max-unswitch-level
The maximum number of branches unswitched in a single loop.
+@item max-loop-headers-insns
+The maximum number of insns in loop header duplicated by he copy loop headers
+pass.
+
@item lim-expensive
The minimum cost of an expensive expression in the loop invariant motion.
@@ -19992,7 +19996,7 @@ following options:
-mpopcntb -mpopcntd -mpowerpc64 @gol
-mpowerpc-gpopt -mpowerpc-gfxopt -msingle-float -mdouble-float @gol
-msimple-fpu -mstring -mmulhw -mdlmzb -mmfpgpr -mvsx @gol
--mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
+-mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
-mquad-memory -mquad-memory-atomic -mmodulo -mfloat128 -mfloat128-hardware @gol
-mpower9-fusion -mpower9-vector -mpower9-dform}
@@ -20166,6 +20170,14 @@ Generate code that uses (does not use) the instructions to move data
between the general purpose registers and the vector/scalar (VSX)
registers that were added in version 2.07 of the PowerPC ISA.
+@item -mhtm
+@itemx -mno-htm
+@opindex mhtm
+@opindex mno-htm
+Enable (disable) the use of the built-in functions that allow direct
+access to the Hardware Transactional Memory (HTM) instructions that
+were added in version 2.07 of the PowerPC ISA.
+
@item -mpower8-fusion
@itemx -mno-power8-fusion
@opindex mpower8-fusion
diff --git a/gcc/expmed.c b/gcc/expmed.c
index ec968da6333..6645a535b3e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -967,11 +967,7 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
If the region spans two words, defer to store_split_bit_field. */
if (!MEM_P (op0) && GET_MODE_SIZE (GET_MODE (op0)) > UNITS_PER_WORD)
{
- op0 = simplify_gen_subreg (word_mode, op0, GET_MODE (op0),
- bitnum / BITS_PER_WORD * UNITS_PER_WORD);
- gcc_assert (op0);
- bitnum %= BITS_PER_WORD;
- if (bitnum + bitsize > BITS_PER_WORD)
+ if (bitnum % BITS_PER_WORD + bitsize > BITS_PER_WORD)
{
if (!fallback_p)
return false;
@@ -980,6 +976,10 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
bitregion_end, value, reverse);
return true;
}
+ op0 = simplify_gen_subreg (word_mode, op0, GET_MODE (op0),
+ bitnum / BITS_PER_WORD * UNITS_PER_WORD);
+ gcc_assert (op0);
+ bitnum %= BITS_PER_WORD;
}
/* From here on we can assume that the field to be stored in fits
@@ -1383,25 +1383,8 @@ store_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize,
bitsdone, NULL_RTX, 1, false);
}
- /* If OP0 is a register, then handle OFFSET here.
-
- When handling multiword bitfields, extract_bit_field may pass
- down a word_mode SUBREG of a larger REG for a bitfield that actually
- crosses a word boundary. Thus, for a SUBREG, we must find
- the current word starting from the base register. */
- if (GET_CODE (op0) == SUBREG)
- {
- int word_offset = (SUBREG_BYTE (op0) / UNITS_PER_WORD)
- + (offset * unit / BITS_PER_WORD);
- machine_mode sub_mode = GET_MODE (SUBREG_REG (op0));
- if (sub_mode != BLKmode && GET_MODE_SIZE (sub_mode) < UNITS_PER_WORD)
- word = word_offset ? const0_rtx : op0;
- else
- word = operand_subword_force (SUBREG_REG (op0), word_offset,
- GET_MODE (SUBREG_REG (op0)));
- offset &= BITS_PER_WORD / unit - 1;
- }
- else if (REG_P (op0))
+ /* If OP0 is a register, then handle OFFSET here. */
+ if (SUBREG_P (op0) || REG_P (op0))
{
machine_mode op0_mode = GET_MODE (op0);
if (op0_mode != BLKmode && GET_MODE_SIZE (op0_mode) < UNITS_PER_WORD)
@@ -1787,10 +1770,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
If the region spans two words, defer to extract_split_bit_field. */
if (!MEM_P (op0) && GET_MODE_SIZE (GET_MODE (op0)) > UNITS_PER_WORD)
{
- op0 = simplify_gen_subreg (word_mode, op0, GET_MODE (op0),
- bitnum / BITS_PER_WORD * UNITS_PER_WORD);
- bitnum %= BITS_PER_WORD;
- if (bitnum + bitsize > BITS_PER_WORD)
+ if (bitnum % BITS_PER_WORD + bitsize > BITS_PER_WORD)
{
if (!fallback_p)
return NULL_RTX;
@@ -1798,6 +1778,9 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
reverse);
return convert_extracted_bit_field (target, mode, tmode, unsignedp);
}
+ op0 = simplify_gen_subreg (word_mode, op0, GET_MODE (op0),
+ bitnum / BITS_PER_WORD * UNITS_PER_WORD);
+ bitnum %= BITS_PER_WORD;
}
/* From here on we know the desired field is smaller than a word.
@@ -2109,20 +2092,8 @@ extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize,
thissize = MIN (bitsize - bitsdone, BITS_PER_WORD);
thissize = MIN (thissize, unit - thispos);
- /* If OP0 is a register, then handle OFFSET here.
-
- When handling multiword bitfields, extract_bit_field may pass
- down a word_mode SUBREG of a larger REG for a bitfield that actually
- crosses a word boundary. Thus, for a SUBREG, we must find
- the current word starting from the base register. */
- if (GET_CODE (op0) == SUBREG)
- {
- int word_offset = (SUBREG_BYTE (op0) / UNITS_PER_WORD) + offset;
- word = operand_subword_force (SUBREG_REG (op0), word_offset,
- GET_MODE (SUBREG_REG (op0)));
- offset = 0;
- }
- else if (REG_P (op0))
+ /* If OP0 is a register, then handle OFFSET here. */
+ if (SUBREG_P (op0) || REG_P (op0))
{
word = operand_subword_force (op0, offset, GET_MODE (op0));
offset = 0;
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0efa9d5b0b1..0b7ea82c034 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8527,9 +8527,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
if ((offset0 == offset1
|| (offset0 && offset1
&& operand_equal_p (offset0, offset1, 0)))
- && (code == EQ_EXPR
- || code == NE_EXPR
- || (indirect_base0 && DECL_P (base0))
+ && (equality_code
+ || (indirect_base0
+ && (DECL_P (base0) || CONSTANT_CLASS_P (base0)))
|| POINTER_TYPE_OVERFLOW_UNDEFINED))
{
@@ -8568,7 +8568,8 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
6.5.6/8 and /9 with respect to the signed ptrdiff_t. */
else if (bitpos0 == bitpos1
&& (equality_code
- || (indirect_base0 && DECL_P (base0))
+ || (indirect_base0
+ && (DECL_P (base0) || CONSTANT_CLASS_P (base0)))
|| POINTER_TYPE_OVERFLOW_UNDEFINED))
{
/* By converting to signed sizetype we cover middle-end pointer
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 178c1d3a517..677c5607090 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-walk.h"
#include "gimplify.h"
#include "target.h"
+#include "builtins.h"
#include "selftest.h"
#include "gimple-pretty-print.h"
@@ -3025,6 +3026,19 @@ maybe_remove_unused_call_args (struct function *fn, gimple *stmt)
}
}
+/* Return false if STMT will likely expand to real function call. */
+
+bool
+gimple_inexpensive_call_p (gcall *stmt)
+{
+ if (gimple_call_internal_p (stmt))
+ return true;
+ tree decl = gimple_call_fndecl (stmt);
+ if (decl && is_inexpensive_builtin (decl))
+ return true;
+ return false;
+}
+
#if CHECKING_P
namespace selftest {
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 063e29d7897..1da719c52e0 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1525,6 +1525,7 @@ extern void preprocess_case_label_vec_for_gimple (vec<tree>, tree, tree *);
extern void gimple_seq_set_location (gimple_seq, location_t);
extern void gimple_seq_discard (gimple_seq);
extern void maybe_remove_unused_call_args (struct function *, gimple *);
+extern bool gimple_inexpensive_call_p (gcall *);
/* Formal (expression) temporary table handling: multiple occurrences of
the same scalar expression are evaluated into the same temporary. */
diff --git a/gcc/match.pd b/gcc/match.pd
index 4d66243d78e..fe711159df9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -900,12 +900,16 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(ne (bit_and:c (bit_not @0) @1) integer_zerop)
(if (INTEGRAL_TYPE_P (TREE_TYPE (@1))
&& TYPE_PRECISION (TREE_TYPE (@1)) == 1)
- (lt @0 @1)))
+ (if (TYPE_UNSIGNED (TREE_TYPE (@1)))
+ (lt @0 @1)
+ (gt @0 @1))))
(simplify
(ne (bit_ior:c (bit_not @0) @1) integer_zerop)
(if (INTEGRAL_TYPE_P (TREE_TYPE (@1))
&& TYPE_PRECISION (TREE_TYPE (@1)) == 1)
- (le @0 @1)))
+ (if (TYPE_UNSIGNED (TREE_TYPE (@1)))
+ (le @0 @1)
+ (ge @0 @1))))
/* ~~x -> x */
(simplify
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 3b3f0f5c616..ddc670a4375 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-07 David Malcolm <dmalcolm@redhat.com>
+
+ * objc-act.c (objc_build_component_ref): Update call
+ to build_component_ref for added param, passing UNKNOWN_LOCATION.
+
2016-04-18 Michael Matz <matz@suse.de>
* objc-act.c (objc_build_struct): Use SET_DECL_ALIGN.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 48564572fa6..44f01d2c9fe 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -2654,7 +2654,8 @@ objc_build_component_ref (tree datum, tree component)
return finish_class_member_access_expr (datum, component, false,
tf_warning_or_error);
#else
- return build_component_ref (input_location, datum, component);
+ return build_component_ref (input_location, datum, component,
+ UNKNOWN_LOCATION);
#endif
}
diff --git a/gcc/params.def b/gcc/params.def
index 62a1e404a1a..2f552eb4abf 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -344,6 +344,13 @@ DEFPARAM(PARAM_MAX_UNSWITCH_LEVEL,
"The maximum number of unswitchings in a single loop.",
3, 0, 0)
+/* The maximum number of insns in loop header duplicated by he copy loop
+ headers pass. */
+DEFPARAM(PARAM_MAX_LOOP_HEADER_INSNS,
+ "max-loop-header-insns",
+ "The maximum number of insns in loop header duplicated by he copy loop headers pass.",
+ 20, 0, 0)
+
/* The maximum number of iterations of a loop the brute force algorithm
for analysis of # of iterations of the loop tries to evaluate. */
DEFPARAM(PARAM_MAX_ITERATIONS_TO_TRACK,
diff --git a/gcc/predict.c b/gcc/predict.c
index 32d45678f25..837c2f3274f 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -1357,6 +1357,7 @@ predict_iv_comparison (struct loop *loop, basic_block bb,
probability = tem.to_uhwi ();
}
+ /* FIXME: The branch prediction seems broken. It has only 20% hitrate. */
if (!overall_overflow)
predict_edge (then_edge, PRED_LOOP_IV_COMPARE, probability);
@@ -2159,7 +2160,7 @@ return_prediction (tree val, enum prediction *prediction)
if (TREE_CONSTANT (val)
&& (!integer_zerop (val) && !integer_onep (val)))
{
- *prediction = TAKEN;
+ *prediction = NOT_TAKEN;
return PRED_CONST_RETURN;
}
}
@@ -3165,6 +3166,7 @@ pass_strip_predict_hints::execute (function *fun)
basic_block bb;
gimple *ass_stmt;
tree var;
+ bool changed = false;
FOR_EACH_BB_FN (bb, fun)
{
@@ -3176,6 +3178,7 @@ pass_strip_predict_hints::execute (function *fun)
if (gimple_code (stmt) == GIMPLE_PREDICT)
{
gsi_remove (&bi, true);
+ changed = true;
continue;
}
else if (is_gimple_call (stmt))
@@ -3190,6 +3193,7 @@ pass_strip_predict_hints::execute (function *fun)
&& gimple_call_internal_fn (stmt) == IFN_BUILTIN_EXPECT))
{
var = gimple_call_lhs (stmt);
+ changed = true;
if (var)
{
ass_stmt
@@ -3206,7 +3210,7 @@ pass_strip_predict_hints::execute (function *fun)
gsi_next (&bi);
}
}
- return 0;
+ return changed ? TODO_cleanup_cfg : 0;
}
} // anon namespace
diff --git a/gcc/predict.def b/gcc/predict.def
index 9c7db7ab072..e1c5faee258 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -78,7 +78,7 @@ DEF_PREDICTOR (PRED_LOOP_ITERATIONS_MAX, "guessed loop iterations",
PROB_ALWAYS, PRED_FLAG_FIRST_MATCH)
/* Branch containing goto is probably not taken. */
-DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (50), 0)
+DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (67), 0)
/* Branch to basic block containing call marked by noreturn attribute. */
DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_VERY_LIKELY,
@@ -88,53 +88,66 @@ DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_VERY_LIKELY,
DEF_PREDICTOR (PRED_COLD_FUNCTION, "cold function call", PROB_VERY_LIKELY,
PRED_FLAG_FIRST_MATCH)
-/* Loopback edge is taken. */
+/* Loopback edge is taken.
+ FIXME: This is currently disabled because loop_optimizer_init force
+ loops to have simple latches. */
DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (86),
PRED_FLAG_FIRST_MATCH)
/* Edge causing loop to terminate is probably not taken. */
-DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (91),
+DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (92),
PRED_FLAG_FIRST_MATCH)
-/* Edge causing loop to terminate by computing value used by later conditional.
- */
-DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (91),
+/* Edge causing loop to terminate by computing value used by later
+ conditional. */
+DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (83),
PRED_FLAG_FIRST_MATCH)
/* Pointers are usually not NULL. */
-DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (85), 0)
-DEF_PREDICTOR (PRED_TREE_POINTER, "pointer (on trees)", HITRATE (85), 0)
+DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (70), 0)
+DEF_PREDICTOR (PRED_TREE_POINTER, "pointer (on trees)", HITRATE (70), 0)
/* NE is probable, EQ not etc... */
-DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (79), 0)
-DEF_PREDICTOR (PRED_OPCODE_NONEQUAL, "opcode values nonequal", HITRATE (71), 0)
+DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (64), 0)
+DEF_PREDICTOR (PRED_OPCODE_NONEQUAL, "opcode values nonequal", HITRATE (66), 0)
DEF_PREDICTOR (PRED_FPOPCODE, "fp_opcode", HITRATE (90), 0)
-DEF_PREDICTOR (PRED_TREE_OPCODE_POSITIVE, "opcode values positive (on trees)", HITRATE (73), 0)
-DEF_PREDICTOR (PRED_TREE_OPCODE_NONEQUAL, "opcode values nonequal (on trees)", HITRATE (72), 0)
+DEF_PREDICTOR (PRED_TREE_OPCODE_POSITIVE, "opcode values positive (on trees)", HITRATE (64), 0)
+DEF_PREDICTOR (PRED_TREE_OPCODE_NONEQUAL, "opcode values nonequal (on trees)", HITRATE (66), 0)
DEF_PREDICTOR (PRED_TREE_FPOPCODE, "fp_opcode (on trees)", HITRATE (90), 0)
/* Branch guarding call is probably taken. */
-DEF_PREDICTOR (PRED_CALL, "call", HITRATE (71), 0)
-
-/* Branch causing function to terminate is probably not taken. */
-DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (61), 0)
-
-/* Branch containing goto is probably not taken. */
+DEF_PREDICTOR (PRED_CALL, "call", HITRATE (67), 0)
+
+/* Branch causing function to terminate is probably not taken.
+ FIXME: early return currently predicts code:
+ int foo (int a)
+ {
+ if (a)
+ bar();
+ else
+ bar2();
+ }
+ even though there is no return statement involved. We probably want to track
+ this from FE or retire the predictor. */
+DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (54), 0)
+
+/* Branch containing goto is probably not taken.
+ FIXME: Currently not used. */
DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (70), 0)
/* Branch ending with return constant is probably not taken. */
-DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (67), 0)
+DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (69), 0)
/* Branch ending with return negative constant is probably not taken. */
-DEF_PREDICTOR (PRED_NEGATIVE_RETURN, "negative return", HITRATE (96), 0)
+DEF_PREDICTOR (PRED_NEGATIVE_RETURN, "negative return", HITRATE (98), 0)
/* Branch ending with return; is probably not taken */
-DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (90), 0)
+DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (91), 0)
/* Branches to compare induction variable to a loop bound is
extremely likely. */
DEF_PREDICTOR (PRED_LOOP_IV_COMPARE_GUESS, "guess loop iv compare",
- PROB_VERY_LIKELY, 0)
+ HITRATE (98), 0)
/* Use number of loop iterations determined by # of iterations analysis
to set probability of branches that compares IV to loop bound variable. */
@@ -159,8 +172,9 @@ DEF_PREDICTOR (PRED_FORTRAN_OVERFLOW, "overflow", PROB_ALWAYS,
of memory or when trying to allocate an already allocated allocated or
deallocating an already deallocated allocatable. This predictor only
occurs when the user explicitly asked for a return status. By default,
- the code aborts, which is handled via PRED_NORETURN. */
-DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", PROB_VERY_LIKELY, 0)
+ the code aborts, which is handled via PRED_NORETURN.
+ FIXME: the hitrate really ought to be close to 100%. */
+DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", HITRATE (62), 0)
/* Branch leading to an I/O failure status are unlikely. This predictor is
used for I/O failures such as for invalid unit numbers. This predictor
@@ -173,7 +187,7 @@ DEF_PREDICTOR (PRED_FORTRAN_FAIL_IO, "fail IO", HITRATE (85), 0)
DEF_PREDICTOR (PRED_FORTRAN_WARN_ONCE, "warn once", HITRATE (75), 0)
/* Branch belonging to a zero-sized array. */
-DEF_PREDICTOR (PRED_FORTRAN_SIZE_ZERO, "zero-sized array", HITRATE(70), 0)
+DEF_PREDICTOR (PRED_FORTRAN_SIZE_ZERO, "zero-sized array", HITRATE(99), 0)
/* Branch belonging to an invalid bound index, in a context where it is
standard conform and well defined but rather pointless and, hence, rather
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index cc2b8cc0eda..d805da4178c 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "pretty-print.h"
#include "diagnostic-color.h"
+#include "selftest.h"
#if HAVE_ICONV
#include <iconv.h>
@@ -304,7 +305,7 @@ pp_indent (pretty_printer *pp)
/* Formatting phases 1 and 2: render TEXT->format_spec plus
TEXT->args_ptr into a series of chunks in pp_buffer (PP)->args[].
- Phase 3 is in pp_format_text. */
+ Phase 3 is in pp_output_formatted_text. */
void
pp_format (pretty_printer *pp, text_info *text)
@@ -1203,3 +1204,164 @@ identifier_to_locale (const char *ident)
return ret;
}
}
+
+#if CHECKING_P
+
+namespace selftest {
+
+/* Smoketest for pretty_printer. */
+
+static void
+test_basic_printing ()
+{
+ pretty_printer pp;
+ pp_string (&pp, "hello");
+ pp_space (&pp);
+ pp_string (&pp, "world");
+
+ ASSERT_STREQ ("hello world", pp_formatted_text (&pp));
+}
+
+/* Helper function for testing pp_format.
+ Verify that pp_format (FMT, ...) followed by pp_output_formatted_text
+ prints EXPECTED, assuming that pp_show_color is SHOW_COLOR. */
+
+static void
+assert_pp_format_va (const char *expected, bool show_color, const char *fmt,
+ va_list *ap)
+{
+ pretty_printer pp;
+ text_info ti;
+ rich_location rich_loc (line_table, UNKNOWN_LOCATION);
+
+ ti.format_spec = fmt;
+ ti.args_ptr = ap;
+ ti.err_no = 0;
+ ti.x_data = NULL;
+ ti.m_richloc = &rich_loc;
+
+ pp_show_color (&pp) = show_color;
+ pp_format (&pp, &ti);
+ pp_output_formatted_text (&pp);
+ ASSERT_STREQ (expected, pp_formatted_text (&pp));
+}
+
+/* Verify that pp_format (FMT, ...) followed by pp_output_formatted_text
+ prints EXPECTED, with show_color disabled. */
+
+static void
+assert_pp_format (const char *expected, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ assert_pp_format_va (expected, false, fmt, &ap);
+ va_end (ap);
+}
+
+/* As above, but with colorization enabled. */
+
+static void
+assert_pp_format_colored (const char *expected, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ assert_pp_format_va (expected, true, fmt, &ap);
+ va_end (ap);
+}
+
+/* Verify that pp_format works, for various format codes. */
+
+static void
+test_pp_format ()
+{
+ /* Avoid introducing locale-specific differences in the results
+ by hardcoding open_quote and close_quote. */
+ const char *old_open_quote = open_quote;
+ const char *old_close_quote = close_quote;
+ open_quote = "`";
+ close_quote = "'";
+
+ /* Verify that plain text is passed through unchanged. */
+ assert_pp_format ("unformatted", "unformatted");
+
+ /* Verify various individual format codes, in the order listed in the
+ comment for pp_format above. For each code, we append a second
+ argument with a known bit pattern (0x12345678), to ensure that we
+ are consuming arguments correctly. */
+ assert_pp_format ("-27 12345678", "%d %x", -27, 0x12345678);
+ assert_pp_format ("-5 12345678", "%i %x", -5, 0x12345678);
+ assert_pp_format ("10 12345678", "%u %x", 10, 0x12345678);
+ assert_pp_format ("17 12345678", "%o %x", 15, 0x12345678);
+ assert_pp_format ("cafebabe 12345678", "%x %x", 0xcafebabe, 0x12345678);
+ assert_pp_format ("-27 12345678", "%ld %x", (long)-27, 0x12345678);
+ assert_pp_format ("-5 12345678", "%li %x", (long)-5, 0x12345678);
+ assert_pp_format ("10 12345678", "%lu %x", (long)10, 0x12345678);
+ assert_pp_format ("17 12345678", "%lo %x", (long)15, 0x12345678);
+ assert_pp_format ("cafebabe 12345678", "%lx %x", (long)0xcafebabe,
+ 0x12345678);
+ assert_pp_format ("-27 12345678", "%lld %x", (long long)-27, 0x12345678);
+ assert_pp_format ("-5 12345678", "%lli %x", (long long)-5, 0x12345678);
+ assert_pp_format ("10 12345678", "%llu %x", (long long)10, 0x12345678);
+ assert_pp_format ("17 12345678", "%llo %x", (long long)15, 0x12345678);
+ assert_pp_format ("cafebabe 12345678", "%llx %x", (long long)0xcafebabe,
+ 0x12345678);
+ assert_pp_format ("-27 12345678", "%wd %x", (HOST_WIDE_INT)-27, 0x12345678);
+ assert_pp_format ("-5 12345678", "%wi %x", (HOST_WIDE_INT)-5, 0x12345678);
+ assert_pp_format ("10 12345678", "%wu %x", (unsigned HOST_WIDE_INT)10,
+ 0x12345678);
+ assert_pp_format ("17 12345678", "%wo %x", (HOST_WIDE_INT)15, 0x12345678);
+ assert_pp_format ("0xcafebabe 12345678", "%wx %x", (HOST_WIDE_INT)0xcafebabe,
+ 0x12345678);
+ assert_pp_format ("A 12345678", "%c %x", 'A', 0x12345678);
+ assert_pp_format ("hello world 12345678", "%s %x", "hello world",
+ 0x12345678);
+ assert_pp_format ("0xcafebabe 12345678", "%p %x", (void *)0xcafebabe,
+ 0x12345678);
+ assert_pp_format ("normal colored normal 12345678",
+ "normal %rcolored%R normal %x",
+ "error", 0x12345678);
+ /* The following assumes an empty value for GCC_COLORS. */
+ assert_pp_format_colored
+ ("normal \33[01;31m\33[Kcolored\33[m\33[K normal 12345678",
+ "normal %rcolored%R normal %x", "error", 0x12345678);
+ /* TODO:
+ %m: strerror(text->err_no) - does not consume a value from args_ptr. */
+ assert_pp_format ("% 12345678", "%% %x", 0x12345678);
+ assert_pp_format ("` 12345678", "%< %x", 0x12345678);
+ assert_pp_format ("' 12345678", "%> %x", 0x12345678);
+ assert_pp_format ("' 12345678", "%' %x", 0x12345678);
+ assert_pp_format ("abc 12345678", "%.*s %x", 3, "abcdef", 0x12345678);
+ assert_pp_format ("abc 12345678", "%.3s %x", "abcdef", 0x12345678);
+
+ /* Verify flag 'q'. */
+ assert_pp_format ("`foo' 12345678", "%qs %x", "foo", 0x12345678);
+ assert_pp_format_colored ("`\33[01m\33[Kfoo\33[m\33[K' 12345678", "%qs %x",
+ "foo", 0x12345678);
+
+ /* Verify that combinations work, along with unformatted text. */
+ assert_pp_format ("the quick brown fox jumps over the lazy dog",
+ "the %s %s %s jumps over the %s %s",
+ "quick", "brown", "fox", "lazy", "dog");
+ assert_pp_format ("item 3 of 7", "item %i of %i", 3, 7);
+ assert_pp_format ("problem with `bar' at line 10",
+ "problem with %qs at line %i", "bar", 10);
+
+ /* Restore old values of open_quote and close_quote. */
+ open_quote = old_open_quote;
+ close_quote = old_close_quote;
+}
+
+/* Run all of the selftests within this file. */
+
+void
+pretty_print_c_tests ()
+{
+ test_basic_printing ();
+ test_pp_format ();
+}
+
+} // namespace selftest
+
+#endif /* CHECKING_P */
diff --git a/gcc/selftest-run-tests.c b/gcc/selftest-run-tests.c
index ab334aac640..e9121b89338 100644
--- a/gcc/selftest-run-tests.c
+++ b/gcc/selftest-run-tests.c
@@ -46,6 +46,7 @@ selftest::run_tests ()
hash_map_tests_c_tests ();
hash_set_tests_c_tests ();
vec_c_tests ();
+ pretty_print_c_tests ();
wide_int_cc_tests ();
/* Mid-level data structures. */
diff --git a/gcc/selftest.h b/gcc/selftest.h
index a1d3074b7de..dba4bb7624f 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -50,6 +50,7 @@ extern void gimple_c_tests ();
extern void hash_map_tests_c_tests ();
extern void hash_set_tests_c_tests ();
extern void input_c_tests ();
+extern void pretty_print_c_tests ();
extern void rtl_tests_c_tests ();
extern void spellcheck_c_tests ();
extern void tree_c_tests ();
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 2b649fa405b..2203ff703ea 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -5301,9 +5301,10 @@ simplify_cond_clz_ctz (rtx x, rtx_code cmp_code, rtx true_val, rtx false_val)
return NULL_RTX;
HOST_WIDE_INT op_val;
- machine_mode mode = GET_MODE (on_nonzero);
- if (((op_code == CLZ && CLZ_DEFINED_VALUE_AT_ZERO (mode, op_val))
- || (op_code == CTZ && CTZ_DEFINED_VALUE_AT_ZERO (mode, op_val)))
+ if (((op_code == CLZ
+ && CLZ_DEFINED_VALUE_AT_ZERO (GET_MODE (on_nonzero), op_val))
+ || (op_code == CTZ
+ && CTZ_DEFINED_VALUE_AT_ZERO (GET_MODE (on_nonzero), op_val)))
&& op_val == INTVAL (on_zero))
return on_nonzero;
diff --git a/gcc/spellcheck.c b/gcc/spellcheck.c
index ceb60168bf1..11018f0710e 100644
--- a/gcc/spellcheck.c
+++ b/gcc/spellcheck.c
@@ -198,6 +198,27 @@ levenshtein_distance_unit_test (const char *a, const char *b,
levenshtein_distance_unit_test_oneway (b, a, expected);
}
+/* Verify that find_closest_string is sane. */
+
+static void
+test_find_closest_string ()
+{
+ auto_vec<const char *> candidates;
+
+ /* Verify that it can handle an empty vec. */
+ ASSERT_EQ (NULL, find_closest_string ("", &candidates));
+
+ /* Verify that it works sanely for non-empty vecs. */
+ candidates.safe_push ("apple");
+ candidates.safe_push ("banana");
+ candidates.safe_push ("cherry");
+
+ ASSERT_STREQ ("apple", find_closest_string ("app", &candidates));
+ ASSERT_STREQ ("banana", find_closest_string ("banyan", &candidates));
+ ASSERT_STREQ ("cherry", find_closest_string ("berry", &candidates));
+ ASSERT_EQ (NULL, find_closest_string ("not like the others", &candidates));
+}
+
/* Verify levenshtein_distance for a variety of pairs of pre-canned
inputs, comparing against known-good values. */
@@ -218,6 +239,8 @@ spellcheck_c_tests ()
("Lorem ipsum dolor sit amet, consectetur adipiscing elit,",
"All your base are belong to us",
44);
+
+ test_find_closest_string ();
}
} // namespace selftest
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa5d7009d16..6c78af3a7f6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,114 @@
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/68558
+ * gcc.dg/vect/slp-44.c: New testcase.
+
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/vect/slp-43.c: New testcase.
+
+2016-06-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71452
+ * gcc.dg/torture/pr71452.c: New testcase.
+
+2016-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/71448
+ * g++.dg/torture/pr71448.C: New test.
+
+2016-06-08 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR debug/71432
+ PR ada/71413
+ * g++.dg/debug/pr71432.C: New test.
+
+2016-06-08 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gcc.dg/vect/section-anchors-vect-70.c: Rename to aligned-section-anchors-vect-71.c.
+ * gcc.dg/vect/section-anchors-vect-71.c: Rename to aligned-section-anchors-vect-72.c.
+ * gcc.dg/vect/section-anchors-vect-72.c: Rename to aligned-section-anchors-vect-72.c.
+
+2016-06-08 Alan Hayward <alan.hayward@arm.com>
+
+ * gcc.dg/vect/vect-live-2.c: Update effective target.
+ * gcc.dg/vect/vect-live-slp-3.c: Likewise.
+ * lib/target-supports.exp: Add aarch64 to vect_long.
+
+2016-06-08 Marek Polacek <polacek@redhat.com>
+
+ PR c/71418
+ * gcc.dg/noncompile/pr71418.c: New test.
+
+ PR c/71426
+ * gcc.dg/noncompile/pr71426.c: New test.
+
+2016-06-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * gcc.dg/ipa/inlinehint-4.c: Disable partial inlining.
+ * gcc.dg/predict-1.c: Update template for new predictor hitrates.
+ * gcc.dg/predict-3.c: Update template.
+ * gcc.dg/predict-5.c: Update template.
+ * gcc.dg/predict-6.c: Update template.
+ * gcc.dg/predict-9.c: Update template.
+ * gcc.dg/tree-ssa/attr-hotcold-2.c: Update template.
+
+2016-06-07 Bill Seurer <seurer@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/vec-mul.c: New test.
+
+2016-06-07 David Malcolm <dmalcolm@redhat.com>
+
+ * gcc.dg/spellcheck-fields-2.c: New test case.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR c/61564
+ * gcc.dg/Wpragmas-1.c: New testcase.
+ * gcc.dg/Wattributes-4.c: Likewise.
+ * gcc.dg/ipa/pr70646.c: Drop optimize pragma in favor of dg-option
+ entry.
+
+2016-06-07 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/aarch64/advsimd-intrinsics/p64_p128.c: Remove
+ spurious debug code.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71428
+ * gcc.dg/torture/pr71428.c: New testcase.
+
+2016-06-07 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/71423
+ * gcc.dg/torture/pr71423.c: New testcase.
+
+2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR middle-end/71408
+ * gcc.dg/tree-ssa/pr71408.c: New test.
+
+2016-06-07 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR middle-end/71281
+ * g++.dg/torture/pr71281.C: New test.
+
+2016-06-06 Marek Polacek <polacek@redhat.com>
+
+ PR c/71362
+ * gcc.dg/pr71362.c: New test.
+
+2016-06-06 Jakub Jelinek <jakub@redhat.com>
+ Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70847
+ PR c++/71330
+ PR c++/71393
+ * g++.dg/opt/pr70847.C: New test.
+ * g++.dg/ubsan/pr70847.C: New test.
+ * g++.dg/ubsan/pr71393.C: New test.
+
2016-06-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71259
@@ -208,7 +319,7 @@
2016-06-03 Alan Hayward <alan.hayward@arm.com>
* gcc.dg/tree-ssa/pr64183.c: Ensure test does not vectorize.
- * testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c: Remove xfail.
+ * gcc.dg/vect/no-scevccp-vect-iv-2.c: Remove xfail.
* gcc.dg/vect/vect-live-1.c: New test.
* gcc.dg/vect/vect-live-2.c: New test.
* gcc.dg/vect/vect-live-3.c: New test.
@@ -772,8 +883,8 @@
2016-05-25 Richard Biener <rguenther@suse.de>
- * gcc/testsuite/gcc.dg/vect/pr58135.c: Rename to ...
- * gcc/testsuite/gcc.dg/vect/bb-slp-pr58135.c: ... this.
+ * gcc.dg/vect/pr58135.c: Rename to ...
+ * gcc.dg/vect/bb-slp-pr58135.c: ... this.
2016-05-25 Marek Polacek <polacek@redhat.com>
@@ -2216,13 +2327,12 @@
2016-04-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
- * gcc/testsuite/gcc.dg/cpp/mac-dir-2.c: Remove pointless duplicate
- dg-do.
- * gcc/testsuite/gcc.dg/pr27003.c: Likewise.
- * gcc/testsuite/gcc.dg/tree-ssa/cswtch.c: Likewise.
- * gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c: Likewise.
- * gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c: Likewise.
- * gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c: Likewise.
+ * gcc.dg/cpp/mac-dir-2.c: Remove pointless duplicate dg-do.
+ * gcc.dg/pr27003.c: Likewise.
+ * gcc.dg/tree-ssa/cswtch.c: Likewise.
+ * gcc.dg/tree-ssa/predcom-2.c: Likewise.
+ * gcc.dg/tree-ssa/predcom-4.c: Likewise.
+ * gcc.dg/tree-ssa/predcom-5.c: Likewise.
* gcc.target/arc/mxy.c: Likewise.
* gcc.target/arc/mswape.c: Likewise.
* gcc.target/arc/mrtsc.c: Likewise.
@@ -2546,12 +2656,12 @@
2016-04-25 Michael Collison <michael.collison@arm.com>
- * testsuite/gcc.target/arm/neon-vaddws16.c: New test.
- * testsuite/gcc.target/arm/neon-vaddws32.c: New test.
- * testsuite/gcc.target/arm/neon-vaddwu16.c: New test.
- * testsuite/gcc.target/arm/neon-vaddwu32.c: New test.
- * testsuite/gcc.target/arm/neon-vaddwu8.c: New test.
- * testsuite/lib/target-supports.exp
+ * gcc.target/arm/neon-vaddws16.c: New test.
+ * gcc.target/arm/neon-vaddws32.c: New test.
+ * gcc.target/arm/neon-vaddwu16.c: New test.
+ * gcc.target/arm/neon-vaddwu32.c: New test.
+ * gcc.target/arm/neon-vaddwu8.c: New test.
+ * lib/target-supports.exp
(check_effective_target_vect_widen_sum_hi_to_si_pattern): Indicate
that arm neon support vector widen sum of HImode TO SImode.
@@ -2731,7 +2841,7 @@
2016-04-18 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/70689
- * testsuite/gcc.target/i386/pr70689.c: New.
+ * gcc.target/i386/pr70689.c: New.
2016-04-18 H.J. Lu <hongjiu.lu@intel.com>
@@ -2852,7 +2962,7 @@
* g++.dg/cpp1y/vla13.C: Same.
* g++.dg/cpp1y/vla14.C: Same.
* g++.dg/cpp1y/vla3.C: Same.
- * gcc/testsuite/g++.dg/init/array24.C: Same.
+ * g++.dg/init/array24.C: Same.
* g++.dg/ubsan/vla-1.C: Same.
2016-04-14 Marek Polacek <polacek@redhat.com>
@@ -2884,7 +2994,7 @@
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
- * gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
+ * g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.
2016-04-13 Jakub Jelinek <jakub@redhat.com>
@@ -2912,8 +3022,8 @@
2016-04-13 Marek Polacek <polacek@redhat.com>
PR c/70436
- * testsuite/gcc.dg/Wparentheses-12.c: New test.
- * testsuite/gcc.dg/Wparentheses-13.c: New test.
+ * gcc.dg/Wparentheses-12.c: New test.
+ * gcc.dg/Wparentheses-13.c: New test.
2016-04-13 Ilya Enkovich <ilya.enkovich@intel.com>
@@ -3160,7 +3270,7 @@
2016-04-06 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/70398
- * testsuite/gcc.target/aarch64/pr70398.c: New.
+ * gcc.target/aarch64/pr70398.c: New.
2016-04-06 Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/testsuite/ChangeLog.meissner b/gcc/testsuite/ChangeLog.meissner
index b679af83422..baebcf28eeb 100644
--- a/gcc/testsuite/ChangeLog.meissner
+++ b/gcc/testsuite/ChangeLog.meissner
@@ -1,3 +1,7 @@
+2016-06-08 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 237222.
+
2016-06-07 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/p9-dimode1.c: New test for using XXSPLTIB and
diff --git a/gcc/testsuite/g++.dg/debug/pr71432.C b/gcc/testsuite/g++.dg/debug/pr71432.C
new file mode 100644
index 00000000000..63563310a3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr71432.C
@@ -0,0 +1,140 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+namespace std
+{
+ typedef long unsigned int size_t;
+ inline namespace __cxx11
+ {
+ } }
+
+extern "C++"
+{
+ namespace std
+ {
+ template < typename _Tp > struct __is_char
+ {
+ };
+ template <> struct __is_char <char >
+ {
+ enum
+ { __value = 1 };
+ };
+ } namespace __gnu_cxx
+ {
+ template < bool, typename > struct __enable_if
+ {
+ };
+ template < typename _Tp > struct __enable_if <true, _Tp >
+ {
+ typedef _Tp __type;
+ };
+ }
+}
+
+namespace __gnu_cxx
+{
+ template < typename _Tp > class new_allocator
+ {
+ };
+}
+
+namespace std
+{
+ template < typename _Tp > using __allocator_base =
+ __gnu_cxx::new_allocator < _Tp >;
+template < typename _Tp > class allocator:public __allocator_base < _Tp >
+ {
+ };
+ template < typename _Alloc > struct allocator_traits
+ {
+ };
+ template < typename _Tp > struct allocator_traits <allocator < _Tp >>
+ {
+ using size_type = std::size_t;
+ template < typename _Up > using rebind_alloc = allocator < _Up >;
+ };
+}
+
+namespace __gnu_cxx
+{
+ template < typename _Alloc > struct __alloc_traits:std::allocator_traits <_Alloc >
+ {
+ typedef std::allocator_traits < _Alloc > _Base_type;
+ template < typename _Tp > struct rebind
+ {
+ typedef typename _Base_type::template rebind_alloc < _Tp > other;
+ };
+ };
+}
+
+namespace std
+{
+ template < class _CharT > struct char_traits;
+ namespace __cxx11
+ {
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT >, typename _Alloc =
+ allocator < _CharT > >class basic_string;
+ typedef basic_string < char >string;
+ }
+}
+
+namespace std
+{
+ template <> struct char_traits <char >
+ {
+ typedef char char_type;
+ static int compare (const char_type * __s1, const char_type * __s2,
+ size_t __n)
+ {
+ return __builtin_memcmp (__s1, __s2, __n);
+ }
+ };
+
+ namespace __cxx11
+ {
+ template < typename _CharT, typename _Traits, typename _Alloc >
+ class basic_string
+ {
+ typedef typename __gnu_cxx::__alloc_traits <_Alloc >::template rebind < _CharT >::other _Char_alloc_type;
+ typedef __gnu_cxx::__alloc_traits < _Char_alloc_type > _Alloc_traits;
+ typedef typename _Alloc_traits::size_type size_type;
+
+ public:
+ size_type size ()const noexcept
+ {
+ }
+ const _CharT *data () const noexcept
+ {
+ }
+ };
+ }
+
+ template < typename _CharT > inline typename __gnu_cxx::__enable_if <
+ __is_char < _CharT >::__value,
+ bool >::__type operator== (const basic_string < _CharT > &__lhs,
+ const basic_string < _CharT > &__rhs) noexcept
+ {
+ return !std::char_traits < _CharT >::compare (__lhs.data (),
+ __rhs.data (),
+ __lhs.size ());
+ }
+};
+
+class CLIParameterType
+{
+ const std::string & getSwitchOption (unsigned int i) const
+ {
+ } unsigned int getSwitchOptionCount () const
+ {
+ } int checkSwitched (const std::string & value) const;
+};
+
+int
+CLIParameterType::checkSwitched (const std::string & value) const
+{
+ int contains = false;
+ for (unsigned int i = 0; !contains && i < getSwitchOptionCount () ;)
+ contains = getSwitchOption (i) == value;
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr70847.C b/gcc/testsuite/g++.dg/opt/pr70847.C
new file mode 100644
index 00000000000..2b5435317cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr70847.C
@@ -0,0 +1,11 @@
+// PR c++/70847
+// { dg-do compile }
+
+struct D { virtual D& f(); };
+
+void
+g()
+{
+ D d;
+ d.f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f();
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr71281.C b/gcc/testsuite/g++.dg/torture/pr71281.C
new file mode 100644
index 00000000000..7d429a95b1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr71281.C
@@ -0,0 +1,63 @@
+// PR middle-end/71281
+// { dg-do compile }
+// { dg-additional-options "-std=c++11 -Ofast" }
+
+
+template <typename> struct A;
+template <typename _Tp> struct A<_Tp *> { typedef _Tp reference; };
+
+template <typename _Iterator> class B {
+public:
+ typename A<_Iterator>::reference operator*();
+};
+
+template <typename> class C;
+template <typename> struct D;
+
+template <typename _Tp> struct D<C<_Tp>> {
+ using value_type = _Tp;
+ using const_pointer = _Tp *;
+ template <typename _Up> using rebind_alloc = C<_Up>;
+};
+
+template <typename _Alloc> struct __alloc_traits : D<_Alloc> {
+ typedef D<_Alloc> _Base_type;
+ typedef typename _Base_type::value_type &reference;
+ template <typename _Tp> struct F {
+ typedef typename _Base_type::template rebind_alloc<_Tp> other;
+ };
+};
+
+template <typename _Tp, typename _Alloc> struct G {
+ typedef typename __alloc_traits<_Alloc>::template F<_Tp>::other
+ _Tp_alloc_type;
+};
+
+int a, b;
+long d[1][1][1];
+void fn1() __attribute__((__noreturn__));
+template <typename _Tp, typename _Alloc = C<_Tp>> class H {
+ typedef __alloc_traits<typename G<_Tp, _Alloc>::_Tp_alloc_type> _Alloc_traits;
+ typedef typename _Alloc_traits::reference reference;
+
+public:
+ B<typename _Alloc_traits::const_pointer> m_fn1();
+ long m_fn2();
+ reference operator[](unsigned);
+ reference m_fn3(unsigned){
+ if (m_fn2())
+ fn1();
+ }
+};
+
+H<H<H<unsigned>>> c;
+void fn2() {
+ H<unsigned, C<int>> e;
+ for (int f = 1;;)
+ for (int g = 0;;)
+ for (int h = 0;;)
+ {
+ *d[0][h] =
+ c.m_fn3(f)[0][g] * a + -*(e).m_fn1() * b + (*c[f].m_fn1()).m_fn3(g);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr71448.C b/gcc/testsuite/g++.dg/torture/pr71448.C
new file mode 100644
index 00000000000..ca00ca83b36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr71448.C
@@ -0,0 +1,27 @@
+// PR c++/71448
+// { dg-do compile }
+// { dg-additional-options "-std=c++11" }
+
+static constexpr const char foo[] = "foo";
+static constexpr const char *bar = "bar";
+
+static_assert ((foo + 3 - foo) == 3, "check");
+static_assert (foo + 2 != foo, "check");
+static_assert (foo + 2 >= foo, "check");
+static_assert (3 + foo >= foo, "check");
+static_assert (foo <= foo + 2, "check");
+static_assert (foo <= 3 + foo, "check");
+static_assert (foo + 2 > foo, "check");
+static_assert (3 + foo > foo, "check");
+static_assert (foo < 2 + foo, "check");
+static_assert (foo < foo + 3, "check");
+static_assert ((bar + 3 - bar) == 3, "check");
+static_assert (bar + 2 != bar, "check");
+static_assert (2 + bar >= bar, "check");
+static_assert (bar + 3 >= bar, "check");
+static_assert (bar <= bar + 2, "check");
+static_assert (bar <= 3 + bar, "check");
+static_assert (bar + 2 > bar, "check");
+static_assert (3 + bar > bar, "check");
+static_assert (bar < 2 + bar, "check");
+static_assert (bar < bar + 3, "check");
diff --git a/gcc/testsuite/g++.dg/ubsan/pr70847.C b/gcc/testsuite/g++.dg/ubsan/pr70847.C
new file mode 100644
index 00000000000..2b5435317cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr70847.C
@@ -0,0 +1,11 @@
+// PR c++/70847
+// { dg-do compile }
+
+struct D { virtual D& f(); };
+
+void
+g()
+{
+ D d;
+ d.f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f().f();
+}
diff --git a/gcc/testsuite/g++.dg/ubsan/pr71393.C b/gcc/testsuite/g++.dg/ubsan/pr71393.C
new file mode 100644
index 00000000000..6011e3a8de0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr71393.C
@@ -0,0 +1,14 @@
+// PR c++/71393
+// { dg-do compile }
+// { dg-options "-fsanitize=undefined" }
+
+struct B { B &operator << (long); };
+struct A { A (); long a, b, c, d, e, f; };
+
+A::A ()
+{
+ B q;
+ q << 0 << a << 0 << b << 0 << (b / a) << 0 << c << 0 << (c / a) << 0
+ << d << 0 << (d / a) << 0 << e << 0 << (e / a) << 0 << f << 0
+ << (f / a) << 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Wattributes-4.c b/gcc/testsuite/gcc.dg/Wattributes-4.c
new file mode 100644
index 00000000000..abda5a30b00
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wattributes-4.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+
+int __attribute__((optimize("no-lto"))) main(void){return 0;} /* { dg-warning "bad option" } */
diff --git a/gcc/testsuite/gcc.dg/Wpragmas-1.c b/gcc/testsuite/gcc.dg/Wpragmas-1.c
new file mode 100644
index 00000000000..139519ea172
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wpragmas-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+#pragma GCC push_options
+#pragma GCC optimize ("-fno-lto") /* { dg-warning "bad option" } */
+int main(void){return 0;}
+#pragma GCC pop_options
+
+/* ??? The FEs still apply the pragma string as optimize attribute to
+ all functions thus the diagnostic will be repeated for each function
+ affected. */
+/* { dg-message "bad option" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c
index 1939bb68f83..441a0c70855 100644
--- a/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/inlinehint-4.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O3 -fdump-ipa-inline-details -fno-early-inlining --param large-unit-insns=1" } */
+/* { dg-options "-O3 -fdump-ipa-inline-details -fno-early-inlining --param large-unit-insns=1 -fno-partial-inlining" } */
/* { dg-add-options bind_pic_locally } */
int *hashval;
int *hash;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr70646.c b/gcc/testsuite/gcc.dg/ipa/pr70646.c
index f85816e7303..ba6f781a145 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr70646.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr70646.c
@@ -1,7 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-O2" } */
-
-#pragma GCC optimize("no-unit-at-a-time")
+/* { dg-options "-O2 -fno-unit-at-a-time" } */
typedef unsigned char u8;
typedef unsigned long long u64;
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71418.c b/gcc/testsuite/gcc.dg/noncompile/pr71418.c
new file mode 100644
index 00000000000..e3243f30c38
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71418.c
@@ -0,0 +1,4 @@
+/* PR c/71418 */
+/* { dg-do compile } */
+
+_Alignas (int) int a[7++]; /* { dg-error "lvalue required" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71426.c b/gcc/testsuite/gcc.dg/noncompile/pr71426.c
new file mode 100644
index 00000000000..874e18976e9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71426.c
@@ -0,0 +1,5 @@
+/* PR c/71426 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+int f (int x[x - x ()]); /* { dg-error "undeclared" } */
diff --git a/gcc/testsuite/gcc.dg/pr71362.c b/gcc/testsuite/gcc.dg/pr71362.c
new file mode 100644
index 00000000000..fd9cd6a20d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr71362.c
@@ -0,0 +1,10 @@
+/* PR c/71362 */
+/* { dg-do compile } */
+
+extern void foo (int[-1]); /* { dg-error "21:size of unnamed array is negative" } */
+
+int
+bar (void)
+{
+ 123 + sizeof (int[-1]); /* { dg-error "20:size of unnamed array is negative" } */
+}
diff --git a/gcc/testsuite/gcc.dg/predict-1.c b/gcc/testsuite/gcc.dg/predict-1.c
index a2a06044384..94f6b0190a1 100644
--- a/gcc/testsuite/gcc.dg/predict-1.c
+++ b/gcc/testsuite/gcc.dg/predict-1.c
@@ -23,4 +23,4 @@ void foo (int bound)
}
}
-/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 5 "profile_estimate"} } */
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 2.0%" 5 "profile_estimate"} } */
diff --git a/gcc/testsuite/gcc.dg/predict-3.c b/gcc/testsuite/gcc.dg/predict-3.c
index e1be7cc3c95..08db59a559f 100644
--- a/gcc/testsuite/gcc.dg/predict-3.c
+++ b/gcc/testsuite/gcc.dg/predict-3.c
@@ -25,4 +25,4 @@ void foo (int bound)
}
}
-/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 3 "profile_estimate"} } */
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 98.0%" 3 "profile_estimate"} } */
diff --git a/gcc/testsuite/gcc.dg/predict-5.c b/gcc/testsuite/gcc.dg/predict-5.c
index 3e7cc6fdfc0..32178a8ea5f 100644
--- a/gcc/testsuite/gcc.dg/predict-5.c
+++ b/gcc/testsuite/gcc.dg/predict-5.c
@@ -21,4 +21,4 @@ void foo (int base, int bound)
}
}
-/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 98.0%" 4 "profile_estimate"} } */
diff --git a/gcc/testsuite/gcc.dg/predict-6.c b/gcc/testsuite/gcc.dg/predict-6.c
index cda30e26e30..16ad16fdb25 100644
--- a/gcc/testsuite/gcc.dg/predict-6.c
+++ b/gcc/testsuite/gcc.dg/predict-6.c
@@ -21,4 +21,4 @@ void foo (int base, int bound)
}
}
-/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 4 "profile_estimate"} } */
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 2.0%" 4 "profile_estimate"} } */
diff --git a/gcc/testsuite/gcc.dg/predict-9.c b/gcc/testsuite/gcc.dg/predict-9.c
index 3cba9f9da2b..a613961091d 100644
--- a/gcc/testsuite/gcc.dg/predict-9.c
+++ b/gcc/testsuite/gcc.dg/predict-9.c
@@ -20,4 +20,4 @@ void foo (int base)
}
/* { dg-final { scan-tree-dump-times "first match heuristics: 2.0%" 3 "profile_estimate"} } */
-/* { dg-final { scan-tree-dump-times "first match heuristics: 4.5%" 1 "profile_estimate"} } */
+/* { dg-final { scan-tree-dump-times "first match heuristics: 4.0%" 1 "profile_estimate"} } */
diff --git a/gcc/testsuite/gcc.dg/spellcheck-fields-2.c b/gcc/testsuite/gcc.dg/spellcheck-fields-2.c
new file mode 100644
index 00000000000..d6ebff1ea79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/spellcheck-fields-2.c
@@ -0,0 +1,19 @@
+/* { dg-options "-fdiagnostics-show-caret" } */
+
+union u
+{
+ int color;
+ int shape;
+};
+
+int test (union u *ptr)
+{
+ return ptr->colour; /* { dg-error "did you mean .color.?" } */
+}
+
+/* Verify that we get an underline and a fixit hint. */
+/* { dg-begin-multiline-output "" }
+ return ptr->colour;
+ ^~~~~~
+ color
+ { dg-end-multiline-output "" } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr71423.c b/gcc/testsuite/gcc.dg/torture/pr71423.c
new file mode 100644
index 00000000000..06a613f11fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71423.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+struct S1
+{
+ int f1:1;
+};
+
+volatile struct S1 b = { 0 };
+
+int
+main ()
+{
+ char c = b.f1;
+ b.f1 = 1;
+
+ if (b.f1 > -1 || c)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr71428.c b/gcc/testsuite/gcc.dg/torture/pr71428.c
new file mode 100644
index 00000000000..b951fcd36c8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71428.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fno-tree-forwprop -Wno-psabi -w" } */
+
+typedef unsigned short v64u16 __attribute__ ((vector_size (64)));
+
+v64u16
+foo (v64u16 p1)
+{
+ p1[31] |= p1[1];
+ return p1;
+}
+
+int
+main ()
+{
+ v64u16 x = foo ((v64u16){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
+ if (x[31] != 1)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr71452.c b/gcc/testsuite/gcc.dg/torture/pr71452.c
new file mode 100644
index 00000000000..8948d39fdaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71452.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+
+int main()
+{
+ _Bool b;
+ *(char *)&b = 123;
+ if (*(char *)&b != 123)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
index 10b8f0edb19..6623d9ee61e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-profile_estimate-blocks-details" } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate-blocks-details" } */
void g(void);
void h(void);
@@ -18,10 +18,12 @@ void f(int x, int y)
return;
}
-/* { dg-final { scan-ipa-dump-times "block 4, loop depth 0, count 0, freq 1\[^0-9\]" 1 "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times 1 "hot label heuristics" 1 "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times 1 "cold label heuristics" 1 "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times "block 4, loop depth 0, count 0, freq \[1-4\]\[^0-9\]" 1 "profile_estimate" } } */
/* Note: we're attempting to match some number > 6000, i.e. > 60%.
The exact number ought to be tweekable without having to juggle
the testcase around too much. */
-/* { dg-final { scan-ipa-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 1 "profile_estimate" } } */
+/* { dg-final { scan-tree-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 1 "profile_estimate" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr71408.c b/gcc/testsuite/gcc.dg/tree-ssa/pr71408.c
new file mode 100644
index 00000000000..896a42869e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr71408.c
@@ -0,0 +1,30 @@
+/* PR middle-end/71408 */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+unsigned a, b;
+
+struct S0
+{
+ int f1:18;
+ unsigned f3:4;
+};
+
+void fn1 ()
+{
+ struct S0 c = { 7, 0 };
+ if (c.f1)
+ c.f3 = 3;
+ a = -~c.f3;
+ c.f3 = ~(c.f1 && c.f1);
+ c.f1 = c.f3 * (c.f1 - (c.f1 - a % c.f1)) + ~c.f3 * -a;
+ b = ~(c.f1 & a);
+ if (b >= 4294967295)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ fn1 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-70.c b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-70.c
index 7010a52b58d..7010a52b58d 100644
--- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-70.c
+++ b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-70.c
diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-71.c b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-71.c
index 7cbd1dcf304..7cbd1dcf304 100644
--- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-71.c
+++ b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-71.c
diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-72.c b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-72.c
index 873fabe9f52..873fabe9f52 100644
--- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-72.c
+++ b/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-72.c
diff --git a/gcc/testsuite/gcc.dg/vect/slp-43.c b/gcc/testsuite/gcc.dg/vect/slp-43.c
new file mode 100644
index 00000000000..4e8df46c863
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-43.c
@@ -0,0 +1,78 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-O3" } */
+
+#include <string.h>
+#include "tree-vect.h"
+
+#define FOO(T,N) \
+void __attribute__((noinline,noclone)) \
+foo_ ## T ## _ ## N (T * __restrict__ in_, T * __restrict__ out_, int s) \
+{ \
+ T *in = __builtin_assume_aligned (in_, __BIGGEST_ALIGNMENT__); \
+ T *out = __builtin_assume_aligned (out_, __BIGGEST_ALIGNMENT__); \
+ for (int i = 0; i < 16; i++) \
+ { \
+ for (int j = 0; j < N; ++j) \
+ out[j] = in[j]; \
+ in += s*N; \
+ out += N; \
+ } \
+}
+
+#define TEST(T,N) \
+ do { \
+ memset (out, 0, 4096); \
+ foo_ ## T ## _ ## N ((T *)in, (T *)out, 1); \
+ if (memcmp (in, out, sizeof (T) * 16 * N) != 0) \
+ __builtin_abort (); \
+ for (int i = sizeof (T) * 16 * N; i < 4096; ++i) \
+ if (out[i] != 0) \
+ __builtin_abort (); \
+ } while (0)
+
+FOO(char, 1)
+FOO(char, 2)
+FOO(char, 3)
+FOO(char, 4)
+FOO(char, 6)
+FOO(char, 8)
+FOO(int, 1)
+FOO(int, 2)
+FOO(int, 3)
+FOO(int, 4)
+FOO(int, 6)
+FOO(int, 8)
+FOO(int, 16)
+
+char in[4096] __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
+char out[4096] __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
+
+int main()
+{
+ check_vect ();
+
+ for (int i = 0; i < 4096; ++i)
+ {
+ in[i] = i;
+ __asm__ volatile ("" : : : "memory");
+ }
+
+ TEST(char, 1);
+ TEST(char, 2);
+ TEST(char, 3);
+ TEST(char, 4);
+ TEST(char, 6);
+ TEST(char, 8);
+ TEST(int, 1);
+ TEST(int, 2);
+ TEST(int, 3);
+ TEST(int, 4);
+ TEST(int, 6);
+ TEST(int, 8);
+ TEST(int, 16);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 13 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-44.c b/gcc/testsuite/gcc.dg/vect/slp-44.c
new file mode 100644
index 00000000000..445440bd45f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-44.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void IMB_double_fast_x (int * __restrict__ destf,
+ int * __restrict__ dest, int y,
+ int * __restrict__ p1f)
+{
+ int i;
+ for (i = y; i > 0; i--)
+ {
+ *dest++ = 0;
+ destf[0] = p1f[0];
+ destf[1] = p1f[1];
+ destf[2] = p1f[2];
+ destf[3] = p1f[3];
+ destf[4] = p1f[8];
+ destf[5] = p1f[9];
+ destf[6] = p1f[10];
+ destf[7] = p1f[11];
+ destf += 8;
+ p1f += 12;
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { vect_hw_misalign && vect_perm } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-live-2.c b/gcc/testsuite/gcc.dg/vect/vect-live-2.c
index 53adc3fee00..9460624a515 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-live-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-live-2.c
@@ -1,4 +1,5 @@
-/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_long } */
+/* { dg-require-effective-target vect_shift } */
/* { dg-additional-options "-fno-tree-scev-cprop" } */
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c b/gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c
index aacf5cb9807..70947afcc45 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_long } */
/* { dg-additional-options "-fno-tree-scev-cprop" } */
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/p64_p128.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/p64_p128.c
index ced3884de52..519cffb0125 100644
--- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/p64_p128.c
+++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/p64_p128.c
@@ -174,11 +174,9 @@ int main (void)
VDUP(vceq_vector2, , poly, p, 64, 1, 0x88);
- fprintf(stderr, "toto\n");
TEST_VCOMP(vceq, , poly, p, uint, 64, 1);
CHECK(TEST_MSG, uint, 64, 1, PRIx64, vceq_expected, "");
- fprintf(stderr, "toto\n");
/* vcombine_p64 tests. */
#undef TEST_MSG
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-mul.c b/gcc/testsuite/gcc.target/powerpc/vec-mul.c
new file mode 100644
index 00000000000..db573287da9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-mul.c
@@ -0,0 +1,86 @@
+/* { dg-do run { target { powerpc64*-*-* } } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-mvsx -O3" } */
+
+/* Test that the vec_mul builtin works as expected. */
+
+#include "altivec.h"
+
+#define N 4096
+
+void abort ();
+
+#define define_test_functions(STYPE, NAMESUFFIX) \
+\
+STYPE result_##NAMESUFFIX[N]; \
+STYPE operand1_##NAMESUFFIX[N]; \
+STYPE operand2_##NAMESUFFIX[N]; \
+STYPE expected_##NAMESUFFIX[N]; \
+\
+__attribute__((noinline)) void vector_tests_##NAMESUFFIX () \
+{ \
+ int i; \
+ vector STYPE v1, v2, tmp; \
+ for (i = 0; i < N; i+=16/sizeof (STYPE)) \
+ { \
+ /* result=operand1*operand2. */ \
+ v1 = vec_vsx_ld (0, &operand1_##NAMESUFFIX[i]); \
+ v2 = vec_vsx_ld (0, &operand2_##NAMESUFFIX[i]); \
+\
+ tmp = vec_mul (v1, v2); \
+ vec_vsx_st (tmp, 0, &result_##NAMESUFFIX[i]); \
+ } \
+} \
+\
+__attribute__((noinline)) void init_##NAMESUFFIX () \
+{ \
+ int i; \
+ for (i = 0; i < N; ++i) \
+ { \
+ result_##NAMESUFFIX[i] = 0; \
+ operand1_##NAMESUFFIX[i] = (i+1) % 31; \
+ operand2_##NAMESUFFIX[i] = (i*2) % 15; \
+ expected_##NAMESUFFIX[i] = operand1_##NAMESUFFIX[i] * \
+ operand2_##NAMESUFFIX[i]; \
+ } \
+} \
+\
+__attribute__((noinline)) void verify_results_##NAMESUFFIX () \
+{ \
+ int i; \
+ for (i = 0; i < N; ++i) \
+ { \
+ if (result_##NAMESUFFIX[i] != expected_##NAMESUFFIX[i]) \
+ abort (); \
+ } \
+}
+
+
+#define execute_test_functions(STYPE, NAMESUFFIX) \
+{ \
+ init_##NAMESUFFIX (); \
+ vector_tests_##NAMESUFFIX (); \
+ verify_results_##NAMESUFFIX (); \
+}
+
+
+define_test_functions (signed int, si);
+define_test_functions (unsigned int, ui);
+define_test_functions (signed short, ss);
+define_test_functions (unsigned short, us);
+define_test_functions (signed char, sc);
+define_test_functions (unsigned char, uc);
+define_test_functions (float, f);
+
+int main ()
+{
+ execute_test_functions (signed int, si);
+ execute_test_functions (unsigned int, ui);
+ execute_test_functions (signed short, ss);
+ execute_test_functions (unsigned short, us);
+ execute_test_functions (signed char, sc);
+ execute_test_functions (unsigned char, uc);
+ execute_test_functions (float, f);
+
+ return 0;
+}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f4cb276ed97..0b991a5c419 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4124,7 +4124,8 @@ proc check_effective_target_vect_long { } {
&& ![istarget powerpc-*-linux*paired*])
&& [check_effective_target_ilp32])
|| [check_effective_target_arm32]
- || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
+ || ([istarget sparc*-*-*] && [check_effective_target_ilp32])
+ || [istarget aarch64*-*-*] } {
set answer 1
} else {
set answer 0
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 3af09ece39e..9a8136968de 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-ssa-scopedtables.h"
#include "tree-ssa-threadedge.h"
+#include "params.h"
/* Duplicates headers of loops if they are small enough, so that the statements
in the loop body are always executed when the loop is entered. This
@@ -106,8 +107,7 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
return false;
}
- /* Approximately copy the conditions that used to be used in jump.c --
- at most 20 insns and no calls. */
+ /* Count number of instructions and punt on calls. */
for (bsi = gsi_start_bb (header); !gsi_end_p (bsi); gsi_next (&bsi))
{
last = gsi_stmt (bsi);
@@ -118,7 +118,8 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
if (is_gimple_debug (last))
continue;
- if (is_gimple_call (last))
+ if (gimple_code (last) == GIMPLE_CALL
+ && !gimple_inexpensive_call_p (as_a <gcall *> (last)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
@@ -289,8 +290,8 @@ ch_base::copy_headers (function *fun)
FOR_EACH_LOOP (loop, 0)
{
- /* Copy at most 20 insns. */
- int limit = 20;
+ int initial_limit = PARAM_VALUE (PARAM_MAX_LOOP_HEADER_INSNS);
+ int remaining_limit = initial_limit;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"Analyzing loop %i\n", loop->num);
@@ -312,7 +313,7 @@ ch_base::copy_headers (function *fun)
exit = NULL;
n_bbs = 0;
- while (should_duplicate_loop_header_p (header, loop, &limit))
+ while (should_duplicate_loop_header_p (header, loop, &remaining_limit))
{
/* Find a successor of header that is inside a loop; i.e. the new
header after the condition is copied. */
@@ -332,7 +333,8 @@ ch_base::copy_headers (function *fun)
fprintf (dump_file,
"Duplicating header of the loop %d up to edge %d->%d,"
" %i insns.\n",
- loop->num, exit->src->index, exit->dest->index, 20 - limit);
+ loop->num, exit->src->index, exit->dest->index,
+ initial_limit - remaining_limit);
/* Ensure that the header will have just the latch as a predecessor
inside the loop. */
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 5a7c378a975..fff28ee8712 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -207,8 +207,8 @@ constant_after_peeling (tree op, gimple *stmt, struct loop *loop)
Stop estimating after UPPER_BOUND is met. Return true in this case. */
static bool
-tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, struct loop_size *size,
- int upper_bound)
+tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel,
+ struct loop_size *size, int upper_bound)
{
basic_block *body = get_loop_body (loop);
gimple_stmt_iterator gsi;
@@ -236,7 +236,8 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
else
after_exit = false;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " BB: %i, after_exit: %i\n", body[i]->index, after_exit);
+ fprintf (dump_file, " BB: %i, after_exit: %i\n", body[i]->index,
+ after_exit);
for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -285,20 +286,24 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
/* Assignments of IV variables. */
else if (gimple_code (stmt) == GIMPLE_ASSIGN
&& TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
- && constant_after_peeling (gimple_assign_rhs1 (stmt), stmt, loop)
+ && constant_after_peeling (gimple_assign_rhs1 (stmt), stmt,
+ loop)
&& (gimple_assign_rhs_class (stmt) != GIMPLE_BINARY_RHS
|| constant_after_peeling (gimple_assign_rhs2 (stmt),
stmt, loop)))
{
size->constant_iv = true;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " Constant expression will be folded away.\n");
+ fprintf (dump_file,
+ " Constant expression will be folded away.\n");
likely_eliminated = true;
}
/* Conditionals. */
else if ((gimple_code (stmt) == GIMPLE_COND
- && constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop)
- && constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop)
+ && constant_after_peeling (gimple_cond_lhs (stmt), stmt,
+ loop)
+ && constant_after_peeling (gimple_cond_rhs (stmt), stmt,
+ loop)
/* We don't simplify all constant compares so make sure
they are not both constant already. See PR70288. */
&& (! is_gimple_min_invariant (gimple_cond_lhs (stmt))
@@ -307,8 +312,8 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
&& constant_after_peeling (gimple_switch_index (
as_a <gswitch *> (stmt)),
stmt, loop)
- && ! is_gimple_min_invariant (gimple_switch_index (
- as_a <gswitch *> (stmt)))))
+ && ! is_gimple_min_invariant
+ (gimple_switch_index (as_a <gswitch *> (stmt)))))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Constant conditional.\n");
@@ -339,26 +344,24 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
- if (gimple_code (stmt) == GIMPLE_CALL)
+ if (gimple_code (stmt) == GIMPLE_CALL
+ && !gimple_inexpensive_call_p (as_a <gcall *> (stmt)))
{
int flags = gimple_call_flags (stmt);
- tree decl = gimple_call_fndecl (stmt);
-
- if (decl && DECL_IS_BUILTIN (decl)
- && is_inexpensive_builtin (decl))
- ;
- else if (flags & (ECF_PURE | ECF_CONST))
+ if (flags & (ECF_PURE | ECF_CONST))
size->num_pure_calls_on_hot_path++;
else
size->num_non_pure_calls_on_hot_path++;
size->num_branches_on_hot_path ++;
}
- else if (gimple_code (stmt) != GIMPLE_CALL
- && gimple_code (stmt) != GIMPLE_DEBUG)
+ /* Count inexpensive calls as non-calls, because they will likely
+ expand inline. */
+ else if (gimple_code (stmt) != GIMPLE_DEBUG)
size->non_call_stmts_on_hot_path++;
if (((gimple_code (stmt) == GIMPLE_COND
&& (!constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop)
- || constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop)))
+ || constant_after_peeling (gimple_cond_rhs (stmt), stmt,
+ loop)))
|| (gimple_code (stmt) == GIMPLE_SWITCH
&& !constant_after_peeling (gimple_switch_index (
as_a <gswitch *> (stmt)),
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 0b0c86674f4..513ef0b3f4e 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2164,10 +2164,12 @@ perform_symbolic_merge (gimple *source_stmt1, struct symbolic_number *n1,
struct symbolic_number *n_start;
tree rhs1 = gimple_assign_rhs1 (source_stmt1);
- if (TREE_CODE (rhs1) == BIT_FIELD_REF)
+ if (TREE_CODE (rhs1) == BIT_FIELD_REF
+ && TREE_CODE (TREE_OPERAND (rhs1, 0)) == SSA_NAME)
rhs1 = TREE_OPERAND (rhs1, 0);
tree rhs2 = gimple_assign_rhs1 (source_stmt2);
- if (TREE_CODE (rhs2) == BIT_FIELD_REF)
+ if (TREE_CODE (rhs2) == BIT_FIELD_REF
+ && TREE_CODE (TREE_OPERAND (rhs2, 0)) == SSA_NAME)
rhs2 = TREE_OPERAND (rhs2, 0);
/* Sources are different, cancel bswap if they are not memory location with
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 1973077db7c..36b34d37380 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1203,7 +1203,8 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op)
{
if (gimple_assign_rhs1 (stmt) == op)
{
- propagate_op_to_single_use (op, stmt, def);
+ tree cst = build_minus_one_cst (TREE_TYPE (op));
+ propagate_op_to_single_use (cst, stmt, def);
return;
}
else if (integer_minus_onep (op)
@@ -1251,7 +1252,8 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op)
{
if (gimple_assign_rhs1 (stmt2) == op)
{
- propagate_op_to_single_use (op, stmt2, def);
+ tree cst = build_minus_one_cst (TREE_TYPE (op));
+ propagate_op_to_single_use (cst, stmt2, def);
return;
}
else if (integer_minus_onep (op)
@@ -5387,6 +5389,7 @@ reassociate_bb (basic_block bb)
gimple_set_lhs (stmt, tmp);
gassign *neg_stmt = gimple_build_assign (lhs, NEGATE_EXPR,
tmp);
+ gimple_set_uid (neg_stmt, gimple_uid (stmt));
gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
gsi_insert_after (&gsi, neg_stmt, GSI_NEW_STMT);
update_stmt (stmt);
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 5e2d7dbe7b1..700d6ce2bdb 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1867,6 +1867,8 @@ handle_builtin_memcmp (gimple_stmt_iterator *gsi)
{
gimple *ustmt = USE_STMT (use_p);
+ if (is_gimple_debug (ustmt))
+ continue;
if (gimple_code (ustmt) == GIMPLE_ASSIGN)
{
gassign *asgn = as_a <gassign *> (ustmt);
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 2f3caf341dd..30c6269e345 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1292,6 +1292,14 @@ non_rewritable_lvalue_p (tree lhs)
if (integer_zerop (TREE_OPERAND (lhs, 1))
&& DECL_P (decl)
&& DECL_SIZE (decl) == TYPE_SIZE (TREE_TYPE (lhs))
+ /* If the dynamic type of the decl has larger precision than
+ the decl itself we can't use the decls type for SSA rewriting. */
+ && ((! INTEGRAL_TYPE_P (TREE_TYPE (decl))
+ || compare_tree_int (DECL_SIZE (decl),
+ TYPE_PRECISION (TREE_TYPE (decl))) == 0)
+ || (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ && (TYPE_PRECISION (TREE_TYPE (decl))
+ >= TYPE_PRECISION (TREE_TYPE (lhs)))))
&& (TREE_THIS_VOLATILE (decl) == TREE_THIS_VOLATILE (lhs)))
return false;
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 36d302a056c..e640bbda790 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -3557,7 +3557,6 @@ again:
"not vectorized: data ref analysis "
"failed ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3589,7 +3588,6 @@ again:
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not vectorized: volatile type ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3606,7 +3604,6 @@ again:
"not vectorized: statement can throw an "
"exception ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3626,7 +3623,6 @@ again:
"not vectorized: statement is bitfield "
"access ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3651,7 +3647,6 @@ again:
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not vectorized: dr in a call ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3798,7 +3793,6 @@ again:
"not vectorized: more than one data ref "
"in stmt: ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
if (is_a <bb_vec_info> (vinfo))
@@ -3887,7 +3881,6 @@ again:
"not vectorized: not suitable for scatter "
"store ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -3908,7 +3901,6 @@ again:
"not vectorized: not suitable for strided "
"load ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 7ec6daec0e6..508bbf0b281 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -710,7 +710,6 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
dump_printf (MSG_NOTE, "\nloop at %s:%d: ", LOCATION_FILE (loop_loc),
LOCATION_LINE (loop_loc));
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, cond_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
loop->nb_iterations = niters;
}
@@ -1557,7 +1556,6 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
{
dump_printf_loc (MSG_NOTE, vect_location, "Analyze phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
/* Skip virtual phi's. The data dependences that are associated with
@@ -1678,7 +1676,6 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_update_ivs_after_vectorizer: phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
/* Skip virtual phi's. */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index bc1257c86d4..1f61c83deaf 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -212,7 +212,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
{
dump_printf_loc (MSG_NOTE, vect_location, "==> examining phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
gcc_assert (stmt_info);
@@ -282,7 +281,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_NOTE, vect_location,
"==> examining statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
gcc_assert (stmt_info);
@@ -304,7 +302,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_NOTE, vect_location,
"==> examining pattern statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
}
else
@@ -355,7 +352,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"==> examining pattern def stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
pattern_def_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
stmt = pattern_def_stmt;
@@ -396,7 +392,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"not vectorized: irregular stmt.");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt,
0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -408,7 +403,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"not vectorized: vector stmt in loop:");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -625,7 +619,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"for statement, ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt,
0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -695,7 +688,6 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"for statement, ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt,
0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -799,7 +791,6 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
{
dump_printf_loc (MSG_NOTE, vect_location, "Analyze phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
/* Skip virtual phi's. The data dependences that are associated with
@@ -859,7 +850,6 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
{
dump_printf_loc (MSG_NOTE, vect_location, "Analyze phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
gcc_assert (!virtual_operand_p (def)
@@ -1623,7 +1613,6 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
{
dump_printf_loc (MSG_NOTE, vect_location, "examining phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
if (virtual_operand_p (gimple_phi_result (phi)))
continue;
@@ -1705,7 +1694,6 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
"not vectorized: relevant phi not "
"supported: ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, phi, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -2337,7 +2325,6 @@ report_vect_op (int msg_type, gimple *stmt, const char *msg)
{
dump_printf_loc (msg_type, vect_location, "%s", msg);
dump_gimple_stmt (msg_type, TDF_SLIM, stmt, 0);
- dump_printf (msg_type, "\n");
}
@@ -2508,7 +2495,6 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple *phi,
{
dump_printf_loc (MSG_NOTE, vect_location, "swapping oprnds: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, next_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
swap_ssa_operands (next_stmt,
@@ -2667,10 +2653,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple *phi,
if (!is_gimple_assign (def_stmt) && gimple_code (def_stmt) != GIMPLE_PHI)
{
if (dump_enabled_p ())
- {
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, def_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
- }
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, def_stmt, 0);
return NULL;
}
@@ -3978,7 +3961,6 @@ get_initial_def_for_induction (gimple *iv_phi)
dump_printf_loc (MSG_NOTE, vect_location,
"vector of inductions after inner-loop:");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, new_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
}
}
@@ -3989,10 +3971,8 @@ get_initial_def_for_induction (gimple *iv_phi)
dump_printf_loc (MSG_NOTE, vect_location,
"transform induction: created def-use cycle: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, induction_phi, 0);
- dump_printf (MSG_NOTE, "\n");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
SSA_NAME_DEF_STMT (vec_def), 0);
- dump_printf (MSG_NOTE, "\n");
}
STMT_VINFO_VEC_STMT (phi_info) = induction_phi;
@@ -4414,9 +4394,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
dump_printf_loc (MSG_NOTE, vect_location,
"transform reduction: created def-use cycle: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, SSA_NAME_DEF_STMT (def), 0);
- dump_printf (MSG_NOTE, "\n");
}
}
}
@@ -5166,7 +5144,6 @@ vect_finalize_reduction:
dump_printf_loc (MSG_NOTE, vect_location,
"created double reduction phi node: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, vect_phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
vect_phi_res = PHI_RESULT (vect_phi);
@@ -6719,7 +6696,6 @@ vect_transform_loop (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_NOTE, vect_location,
"------>vectorizing phi: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
- dump_printf (MSG_NOTE, "\n");
}
stmt_info = vinfo_for_stmt (phi);
if (!stmt_info)
@@ -6772,7 +6748,6 @@ vect_transform_loop (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_NOTE, vect_location,
"------>vectorizing statement: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
stmt_info = vinfo_for_stmt (stmt);
@@ -6847,7 +6822,6 @@ vect_transform_loop (loop_vec_info loop_vinfo)
"stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
pattern_def_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
stmt = pattern_def_stmt;
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index e1622a81b91..8a2221f9350 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -431,7 +431,6 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_recog_dot_prod_pattern: detected: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
return pattern_stmt;
@@ -667,7 +666,6 @@ vect_recog_sad_pattern (vec<gimple *> *stmts, tree *type_in,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_recog_sad_pattern: detected: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
return pattern_stmt;
@@ -1210,7 +1208,6 @@ vect_recog_widen_sum_pattern (vec<gimple *> *stmts, tree *type_in,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_recog_widen_sum_pattern: detected: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
return pattern_stmt;
@@ -1510,7 +1507,6 @@ vect_recog_over_widening_pattern (vec<gimple *> *stmts,
dump_printf_loc (MSG_NOTE, vect_location,
"created pattern stmt: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
type = gimple_expr_type (stmt);
@@ -1578,7 +1574,6 @@ vect_recog_over_widening_pattern (vec<gimple *> *stmts,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_recog_over_widening_pattern: detected: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
return pattern_stmt;
@@ -2717,7 +2712,6 @@ vect_recog_divmod_pattern (vec<gimple *> *stmts,
dump_printf_loc (MSG_NOTE, vect_location,
"vect_recog_divmod_pattern: detected: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
stmts->safe_push (last_stmt);
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 91120948114..0239e12d482 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -498,7 +498,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Build SLP failed: unvectorizable statement ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Fatal mismatch. */
matches[0] = false;
@@ -514,7 +513,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"Build SLP failed: not GIMPLE_ASSIGN nor "
"GIMPLE_CALL ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Fatal mismatch. */
matches[0] = false;
@@ -570,7 +568,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"Build SLP failed: unsupported call type ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
call_stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Fatal mismatch. */
matches[0] = false;
@@ -686,7 +683,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"Build SLP failed: different shift "
"arguments in ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Mismatch. */
continue;
@@ -707,7 +703,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"Build SLP failed: different calls in ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Mismatch. */
continue;
@@ -741,7 +736,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"interleaving chains in one node ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Mismatch. */
continue;
@@ -761,7 +755,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Build SLP failed: not grouped load ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* FORNOW: Not grouped loads are not supported. */
@@ -783,7 +776,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
"Build SLP failed: operation");
dump_printf (MSG_MISSED_OPTIMIZATION, " unsupported ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Fatal mismatch. */
matches[0] = false;
@@ -805,7 +797,6 @@ vect_build_slp_tree_1 (vec_info *vinfo,
" operation");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Mismatch. */
continue;
@@ -1876,7 +1867,6 @@ vect_analyze_slp_instance (vec_info *vinfo,
"permutation ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION,
TDF_SLIM, stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
vect_free_slp_instance (new_instance);
return false;
@@ -3446,7 +3436,6 @@ vect_transform_slp_perm_load (slp_tree node, vec<tree> dr_chain,
"least three vectors ");
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
stmt, 0);
- dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
return false;
}
@@ -3567,7 +3556,6 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance,
dump_printf_loc (MSG_NOTE,vect_location,
"------>vectorizing SLP node starting from: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
- dump_printf (MSG_NOTE, "\n");
}
/* Vectorized stmts go before the last scalar stmt which is where
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 373ecd7278d..bee064ef38e 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6440,17 +6440,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
}
}
else if (STMT_VINFO_STRIDED_P (stmt_info))
- {
- if (grouped_load
- && slp
- && (group_size > nunits
- || nunits % group_size != 0))
- {
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "unhandled strided group load\n");
- return false;
- }
- }
+ ;
else
{
negative = tree_int_cst_compare (nested_in_vect_loop
@@ -6744,16 +6734,29 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
running_off = offvar;
alias_off = build_int_cst (reference_alias_ptr_type (DR_REF (first_dr)), 0);
int nloads = nunits;
+ int lnel = 1;
tree ltype = TREE_TYPE (vectype);
auto_vec<tree> dr_chain;
if (slp)
{
- nloads = nunits / group_size;
- if (group_size < nunits)
- ltype = build_vector_type (TREE_TYPE (vectype), group_size);
- else
- ltype = vectype;
- ltype = build_aligned_type (ltype, TYPE_ALIGN (TREE_TYPE (vectype)));
+ if (group_size < nunits
+ && nunits % group_size == 0)
+ {
+ nloads = nunits / group_size;
+ lnel = group_size;
+ ltype = build_vector_type (TREE_TYPE (vectype), group_size);
+ ltype = build_aligned_type (ltype,
+ TYPE_ALIGN (TREE_TYPE (vectype)));
+ }
+ else if (group_size >= nunits
+ && group_size % nunits == 0)
+ {
+ nloads = 1;
+ lnel = nunits;
+ ltype = vectype;
+ ltype = build_aligned_type (ltype,
+ TYPE_ALIGN (TREE_TYPE (vectype)));
+ }
/* For SLP permutation support we need to load the whole group,
not only the number of vector stmts the permutation result
fits in. */
@@ -6765,48 +6768,43 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
else
ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
}
+ int group_el = 0;
+ unsigned HOST_WIDE_INT
+ elsz = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (vectype)));
for (j = 0; j < ncopies; j++)
{
- tree vec_inv;
-
if (nloads > 1)
+ vec_alloc (v, nloads);
+ for (i = 0; i < nloads; i++)
{
- vec_alloc (v, nloads);
- for (i = 0; i < nloads; i++)
+ tree this_off = build_int_cst (TREE_TYPE (alias_off),
+ group_el * elsz);
+ new_stmt = gimple_build_assign (make_ssa_name (ltype),
+ build2 (MEM_REF, ltype,
+ running_off, this_off));
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ if (nloads > 1)
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ gimple_assign_lhs (new_stmt));
+
+ group_el += lnel;
+ if (! slp
+ || group_el == group_size)
{
- tree newref, newoff;
- gimple *incr;
- newref = build2 (MEM_REF, ltype, running_off, alias_off);
-
- newref = force_gimple_operand_gsi (gsi, newref, true,
- NULL_TREE, true,
- GSI_SAME_STMT);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, newref);
- newoff = copy_ssa_name (running_off);
- incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
- running_off, stride_step);
+ tree newoff = copy_ssa_name (running_off);
+ gimple *incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
+ running_off, stride_step);
vect_finish_stmt_generation (stmt, incr, gsi);
running_off = newoff;
+ group_el = 0;
}
-
- vec_inv = build_constructor (vectype, v);
- new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi);
- new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
- else
+ if (nloads > 1)
{
- new_stmt = gimple_build_assign (make_ssa_name (ltype),
- build2 (MEM_REF, ltype,
- running_off, alias_off));
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
-
- tree newoff = copy_ssa_name (running_off);
- gimple *incr = gimple_build_assign (newoff, POINTER_PLUS_EXPR,
- running_off, stride_step);
- vect_finish_stmt_generation (stmt, incr, gsi);
-
- running_off = newoff;
+ tree vec_inv = build_constructor (vectype, v);
+ new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi);
+ new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
if (slp)
diff --git a/gotools/ChangeLog b/gotools/ChangeLog
index 2d2d042ed6c..d89ecda2400 100644
--- a/gotools/ChangeLog
+++ b/gotools/ChangeLog
@@ -1,3 +1,7 @@
+2016-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Update copyrights.
+
2016-02-03 Ian Lance Taylor <iant@google.com>
* Makefile.am (go_cmd_gofmt_files): Update to Go 1.6rc1 by adding
diff --git a/gotools/Makefile.am b/gotools/Makefile.am
index 48d7c0d1025..d58fed5ae8f 100644
--- a/gotools/Makefile.am
+++ b/gotools/Makefile.am
@@ -1,5 +1,5 @@
# Makefile for gotools
-# Copyright 2015 Free Software Foundation, Inc.
+# Copyright (C) 2015-2016 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/gotools/configure.ac b/gotools/configure.ac
index e4528a4f31e..fcc68536296 100644
--- a/gotools/configure.ac
+++ b/gotools/configure.ac
@@ -1,5 +1,5 @@
# Configure script for gotools.
-# Copyright 2015 Free Software Foundation, Inc.
+# Copyright (C) 2015-2016 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog
index 1ce7671b201..fd1d85c38a7 100644
--- a/libcc1/ChangeLog
+++ b/libcc1/ChangeLog
@@ -1,3 +1,7 @@
+2016-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Update copyrights.
+
2016-04-18 Michael Matz <matz@suse.de>
* plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN.
diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
index b40820b2189..40e262c73d5 100644
--- a/libcc1/Makefile.am
+++ b/libcc1/Makefile.am
@@ -1,4 +1,4 @@
-## Copyright (C) 2014 Free Software Foundation, Inc.
+## Copyright (C) 2014-2016 Free Software Foundation, Inc.
## This file is part of GCC.
diff --git a/libcc1/callbacks.cc b/libcc1/callbacks.cc
index 3c4eda67ad0..bad28e1ad39 100644
--- a/libcc1/callbacks.cc
+++ b/libcc1/callbacks.cc
@@ -1,5 +1,5 @@
/* Callback management.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/callbacks.hh b/libcc1/callbacks.hh
index bde1100fd06..89ba2d044b0 100644
--- a/libcc1/callbacks.hh
+++ b/libcc1/callbacks.hh
@@ -1,5 +1,5 @@
/* Callback management
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/configure.ac b/libcc1/configure.ac
index e2e3fdae0b4..311431c7daf 100644
--- a/libcc1/configure.ac
+++ b/libcc1/configure.ac
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2014 Free Software Foundation, Inc.
+dnl Copyright (C) 2014-2016 Free Software Foundation, Inc.
dnl
dnl This file is part of GCC.
dnl
diff --git a/libcc1/connection.cc b/libcc1/connection.cc
index 5db42046ae7..89ae0bda1c7 100644
--- a/libcc1/connection.cc
+++ b/libcc1/connection.cc
@@ -1,5 +1,5 @@
/* Connect implementation
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/connection.hh b/libcc1/connection.hh
index 242deec311d..0e0b12b2c02 100644
--- a/libcc1/connection.hh
+++ b/libcc1/connection.hh
@@ -1,5 +1,5 @@
/* Plugin connection declarations
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/findcomp.cc b/libcc1/findcomp.cc
index f02b1dfe425..f2e05321659 100644
--- a/libcc1/findcomp.cc
+++ b/libcc1/findcomp.cc
@@ -1,5 +1,5 @@
/* Find the correct compiler.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/findcomp.hh b/libcc1/findcomp.hh
index a55a28379c6..76b3b1e77d6 100644
--- a/libcc1/findcomp.hh
+++ b/libcc1/findcomp.hh
@@ -1,5 +1,5 @@
/* Find the correct compiler.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/libcc1.cc b/libcc1/libcc1.cc
index 7d7d2c190c7..5295396b656 100644
--- a/libcc1/libcc1.cc
+++ b/libcc1/libcc1.cc
@@ -1,5 +1,5 @@
/* The library used by gdb.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/marshall.cc b/libcc1/marshall.cc
index 9119de652b7..ea54a6cc056 100644
--- a/libcc1/marshall.cc
+++ b/libcc1/marshall.cc
@@ -1,5 +1,5 @@
/* Marshalling and unmarshalling.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/marshall.hh b/libcc1/marshall.hh
index 3f936e7a754..48261f2eb57 100644
--- a/libcc1/marshall.hh
+++ b/libcc1/marshall.hh
@@ -1,5 +1,5 @@
/* Marshalling and unmarshalling.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/names.cc b/libcc1/names.cc
index 5ddfa7bbc17..6023be7df36 100644
--- a/libcc1/names.cc
+++ b/libcc1/names.cc
@@ -1,5 +1,5 @@
/* String definitions.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/names.hh b/libcc1/names.hh
index 9bda8d542c4..8e04147bf0b 100644
--- a/libcc1/names.hh
+++ b/libcc1/names.hh
@@ -1,5 +1,5 @@
/* String declarations.
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/plugin.cc b/libcc1/plugin.cc
index 44d0d607022..0ea912f3759 100644
--- a/libcc1/plugin.cc
+++ b/libcc1/plugin.cc
@@ -1,5 +1,5 @@
/* Library interface to C front end
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/rpc.hh b/libcc1/rpc.hh
index 58758d3d39e..560d27c9fdb 100644
--- a/libcc1/rpc.hh
+++ b/libcc1/rpc.hh
@@ -1,5 +1,5 @@
/* RPC call and callback templates
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libcc1/status.hh b/libcc1/status.hh
index 764c7ffd0b5..85d434aaf6c 100644
--- a/libcc1/status.hh
+++ b/libcc1/status.hh
@@ -1,5 +1,5 @@
/* status type definition
- Copyright (C) 2014 Free Software Foundation, Inc.
+ Copyright (C) 2014-2016 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/libgcc/ChangeLog.meissner b/libgcc/ChangeLog.meissner
index 407d1b183fa..d56b85c119c 100644
--- a/libgcc/ChangeLog.meissner
+++ b/libgcc/ChangeLog.meissner
@@ -1,3 +1,7 @@
+2016-06-08 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Merge up to 237222.
+
2016-06-06 Michael Meissner <meissner@linux.vnet.ibm.com>
Merge up to 237150.
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index eebbb27c566..f6d7dd2a808 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/reduction-8.f90: New testcase.
+ * testsuite/libgomp.oacc-c-c++-common/reduction-8.c: New testcase.
+
2016-06-01 Cesar Philippidis <cesar@codesourcery.com>
PR c/70688
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f550c35eb15..7166f394891 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-07 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/std/tuple (_Head_base<>): Default specialization condition at
+ type declaration.
+
2016-06-06 Ville Voutilainen <ville.voutilainen@gmail.com>
Support allocators in tuples of zero size.
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index e64f6bfc5f5..6c124048df1 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -48,7 +48,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{
*/
- template<std::size_t _Idx, typename _Head, bool _IsEmptyNotFinal>
+ template<typename... _Elements>
+ class tuple;
+
+ template<typename _Tp>
+ struct __is_empty_non_tuple : is_empty<_Tp> { };
+
+ // Using EBO for elements that are tuples causes ambiguous base errors.
+ template<typename _El0, typename... _El>
+ struct __is_empty_non_tuple<tuple<_El0, _El...>> : false_type { };
+
+ // Use the Empty Base-class Optimization for empty, non-final types.
+ template<typename _Tp>
+ using __empty_not_final
+ = typename conditional<__is_final(_Tp), false_type,
+ __is_empty_non_tuple<_Tp>>::type;
+
+ template<std::size_t _Idx, typename _Head,
+ bool = __empty_not_final<_Head>::value>
struct _Head_base;
template<std::size_t _Idx, typename _Head>
@@ -158,19 +175,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<std::size_t _Idx, typename... _Elements>
struct _Tuple_impl;
- template<typename _Tp>
- struct __is_empty_non_tuple : is_empty<_Tp> { };
-
- // Using EBO for elements that are tuples causes ambiguous base errors.
- template<typename _El0, typename... _El>
- struct __is_empty_non_tuple<tuple<_El0, _El...>> : false_type { };
-
- // Use the Empty Base-class Optimization for empty, non-final types.
- template<typename _Tp>
- using __empty_not_final
- = typename conditional<__is_final(_Tp), false_type,
- __is_empty_non_tuple<_Tp>>::type;
-
/**
* Recursive tuple implementation. Here we store the @c Head element
* and derive from a @c Tuple_impl containing the remaining elements
@@ -179,12 +183,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<std::size_t _Idx, typename _Head, typename... _Tail>
struct _Tuple_impl<_Idx, _Head, _Tail...>
: public _Tuple_impl<_Idx + 1, _Tail...>,
- private _Head_base<_Idx, _Head, __empty_not_final<_Head>::value>
+ private _Head_base<_Idx, _Head>
{
template<std::size_t, typename...> friend class _Tuple_impl;
typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
- typedef _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> _Base;
+ typedef _Head_base<_Idx, _Head> _Base;
static constexpr _Head&
_M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
@@ -336,11 +340,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Basis case of inheritance recursion.
template<std::size_t _Idx, typename _Head>
struct _Tuple_impl<_Idx, _Head>
- : private _Head_base<_Idx, _Head, __empty_not_final<_Head>::value>
+ : private _Head_base<_Idx, _Head>
{
template<std::size_t, typename...> friend class _Tuple_impl;
- typedef _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> _Base;
+ typedef _Head_base<_Idx, _Head> _Base;
static constexpr _Head&
_M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
@@ -457,9 +461,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
};
- template<typename... _Elements>
- class tuple;
-
// Concept utility functions, reused in conditionally-explicit
// constructors.
template<bool, typename... _Elements>