aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-01-20 13:37:42 +0100
committerMartin Liska <mliska@suse.cz>2022-01-20 13:37:42 +0100
commit60af3ff91f0c1f7436624f2e2c8f6fe110c36bb6 (patch)
tree78ac35e9445342da5e74a6eda6a2bf3f26a5ea67 /gcc
parent929c31a9d1f9741115465d7591f29ef31f96f362 (diff)
parent109f8af3d3c5424f103ceef5d77f5a447fb931ce (diff)
downloadgcc-60af3ff91f0c1f7436624f2e2c8f6fe110c36bb6.zip
gcc-60af3ff91f0c1f7436624f2e2c8f6fe110c36bb6.tar.gz
gcc-60af3ff91f0c1f7436624f2e2c8f6fe110c36bb6.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog553
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog96
-rw-r--r--gcc/ada/Makefile.rtl5
-rw-r--r--gcc/ada/gcc-interface/Makefile.in7
-rw-r--r--gcc/analyzer/ChangeLog16
-rw-r--r--gcc/analyzer/region-model-manager.cc22
-rw-r--r--gcc/attribs.cc2
-rw-r--r--gcc/bitmap.cc2
-rw-r--r--gcc/c-family/ChangeLog18
-rw-r--r--gcc/c-family/c-common.cc10
-rw-r--r--gcc/c-family/c-common.h6
-rw-r--r--gcc/c-family/c-format.cc2
-rw-r--r--gcc/c-family/c-indentation.cc2
-rw-r--r--gcc/c-family/c-pretty-print.cc2
-rw-r--r--gcc/cgraph.cc4
-rw-r--r--gcc/cgraph.h4
-rw-r--r--gcc/cgraphunit.cc2
-rw-r--r--gcc/collect2.cc2
-rw-r--r--gcc/common/config/riscv/riscv-common.cc18
-rw-r--r--gcc/config/aarch64/aarch64-builtins.cc2
-rw-r--r--gcc/config/arc/arc.md2
-rw-r--r--gcc/config/arm/arm-cpus.in9
-rw-r--r--gcc/config/arm/arm.cc9
-rw-r--r--gcc/config/arm/arm.opt10
-rw-r--r--gcc/config/arm/crypto.md227
-rw-r--r--gcc/config/arm/unspecs.md1
-rw-r--r--gcc/config/avr/avr.cc2
-rw-r--r--gcc/config/bfin/bfin.cc8
-rw-r--r--gcc/config/bpf/coreout.cc28
-rw-r--r--gcc/config/bpf/coreout.h1
-rw-r--r--gcc/config/cris/cris.h2
-rw-r--r--gcc/config/frv/frv.cc6
-rw-r--r--gcc/config/i386/sse.md22
-rw-r--r--gcc/config/ia64/ia64-c.cc2
-rw-r--r--gcc/config/iq2000/iq2000.cc8
-rw-r--r--gcc/config/m32c/m32c-pragma.cc12
-rw-r--r--gcc/config/m68k/m68k.cc2
-rw-r--r--gcc/config/mips/mips.cc6
-rw-r--r--gcc/config/mmix/mmix.cc8
-rw-r--r--gcc/config/msp430/driver-msp430.cc6
-rw-r--r--gcc/config/msp430/msp430.cc30
-rw-r--r--gcc/config/nds32/nds32-intrinsic.cc6
-rw-r--r--gcc/config/nds32/nds32-intrinsic.md28
-rw-r--r--gcc/config/nds32/nds32-isr.cc2
-rw-r--r--gcc/config/nds32/nds32.cc14
-rw-r--r--gcc/config/nvptx/nvptx.cc8
-rw-r--r--gcc/config/nvptx/nvptx.md6
-rw-r--r--gcc/config/riscv/riscv.cc4
-rw-r--r--gcc/config/rs6000/aix73.h2
-rw-r--r--gcc/config/rs6000/rs6000-call.cc2
-rw-r--r--gcc/config/rs6000/rs6000.cc34
-rw-r--r--gcc/config/rs6000/rtems.h2
-rw-r--r--gcc/config/rx/rx.cc4
-rw-r--r--gcc/config/sh/sh.cc6
-rw-r--r--gcc/config/stormy16/stormy16.cc6
-rw-r--r--gcc/config/v850/v850-c.cc22
-rw-r--r--gcc/config/vms/vms-c.cc8
-rw-r--r--gcc/config/xtensa/xtensa.cc6
-rwxr-xr-xgcc/configure4
-rw-r--r--gcc/configure.ac4
-rw-r--r--gcc/convert.cc2
-rw-r--r--gcc/cp/ChangeLog40
-rw-r--r--gcc/cp/constexpr.cc6
-rw-r--r--gcc/cp/cp-lang.cc4
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/error.cc18
-rw-r--r--gcc/cp/parser.cc12
-rw-r--r--gcc/cp/pt.cc16
-rw-r--r--gcc/cp/tree.cc2
-rw-r--r--gcc/dbgcnt.cc2
-rw-r--r--gcc/diagnostic-show-locus.cc2
-rw-r--r--gcc/diagnostic.cc2
-rw-r--r--gcc/doc/invoke.texi14
-rw-r--r--gcc/dumpfile.cc2
-rw-r--r--gcc/dwarf2out.cc7
-rw-r--r--gcc/dwarf2out.h2
-rw-r--r--gcc/edit-context.cc2
-rw-r--r--gcc/emit-rtl.cc16
-rw-r--r--gcc/et-forest.cc2
-rw-r--r--gcc/expmed.cc8
-rw-r--r--gcc/expr.cc10
-rw-r--r--gcc/fibonacci_heap.cc2
-rw-r--r--gcc/fold-const.cc11
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/array.cc3
-rw-r--r--gcc/function-tests.cc2
-rw-r--r--gcc/gcse.cc2
-rw-r--r--gcc/gcse.h2
-rw-r--r--gcc/ggc-tests.cc2
-rw-r--r--gcc/gimple-ssa-store-merging.cc2
-rw-r--r--gcc/gimple-ssa-warn-access.cc9
-rw-r--r--gcc/gimple.cc2
-rw-r--r--gcc/gimplify.cc1
-rw-r--r--gcc/hash-map-tests.cc2
-rw-r--r--gcc/hash-set-tests.cc2
-rw-r--r--gcc/ifcvt.cc543
-rw-r--r--gcc/input.cc2
-rw-r--r--gcc/ipa-cp.cc2
-rw-r--r--gcc/ipa-fnsummary.cc2
-rw-r--r--gcc/ipa-fnsummary.h2
-rw-r--r--gcc/ipa-inline.cc7
-rw-r--r--gcc/ipa-modref-tree.cc2
-rw-r--r--gcc/ipa-modref-tree.h2
-rw-r--r--gcc/ipa-modref.cc2
-rw-r--r--gcc/ipa-modref.h2
-rw-r--r--gcc/ipa-prop.h2
-rw-r--r--gcc/ipa-reference.cc2
-rw-r--r--gcc/ipa-reference.h2
-rw-r--r--gcc/ipa-split.cc4
-rw-r--r--gcc/ira-costs.cc2
-rw-r--r--gcc/ira.h2
-rw-r--r--gcc/match.pd15
-rw-r--r--gcc/opt-suggestions.cc2
-rw-r--r--gcc/optabs-tree.cc21
-rw-r--r--gcc/optabs.cc140
-rw-r--r--gcc/optabs.h4
-rw-r--r--gcc/opts.cc2
-rw-r--r--gcc/params.opt4
-rw-r--r--gcc/passes.def5
-rw-r--r--gcc/predict.cc2
-rw-r--r--gcc/pretty-print.cc2
-rw-r--r--gcc/read-rtl-function.cc2
-rw-r--r--gcc/rtl-tests.cc2
-rw-r--r--gcc/rtl.cc13
-rw-r--r--gcc/rtl.h11
-rw-r--r--gcc/sbitmap.cc2
-rw-r--r--gcc/selftest-run-tests.cc74
-rw-r--r--gcc/selftest.cc2
-rw-r--r--gcc/selftest.h74
-rw-r--r--gcc/simplify-rtx.cc2
-rw-r--r--gcc/spellcheck-tree.cc2
-rw-r--r--gcc/spellcheck.cc2
-rw-r--r--gcc/sreal.cc2
-rw-r--r--gcc/testsuite/ChangeLog204
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype-auto20.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval27.C18
-rw-r--r--gcc/testsuite/g++.dg/eh/new2.C10
-rw-r--r--gcc/testsuite/g++.dg/ext/boolcomplex-1.C (renamed from gcc/testsuite/g++.dg/ext/boolcomplex-1.c)0
-rw-r--r--gcc/testsuite/g++.dg/gcov/pr16855-priority.C6
-rw-r--r--gcc/testsuite/g++.dg/gcov/pr16855.C4
-rw-r--r--gcc/testsuite/g++.dg/opt/pr103989.C30
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47639.C (renamed from gcc/testsuite/g++.dg/opt/pr47639.c)2
-rw-r--r--gcc/testsuite/g++.dg/parse/no-typename1.C2
-rw-r--r--gcc/testsuite/g++.dg/pr83979.C (renamed from gcc/testsuite/g++.dg/pr83979.c)0
-rw-r--r--gcc/testsuite/g++.dg/template/nested7.C12
-rw-r--r--gcc/testsuite/g++.dg/tm/asm-1.C (renamed from gcc/testsuite/g++.dg/tm/asm-1.c)0
-rw-r--r--gcc/testsuite/g++.dg/vect/pr71483.cc (renamed from gcc/testsuite/g++.dg/vect/pr71483.c)0
-rw-r--r--gcc/testsuite/g++.dg/warn/Wdangling-pointer-3.C39
-rw-r--r--gcc/testsuite/g++.dg/warn/pr104025.C20
-rw-r--r--gcc/testsuite/gcc.dg/Wuse-after-free.c41
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr104062.c13
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr104089.c9
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr103874.c12
-rw-r--r--gcc/testsuite/gcc.dg/ifcvt-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57147-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/evrp-trans2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr89074.c12
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-17.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr104112-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr104112-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-perm-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h4
-rw-r--r--gcc/testsuite/gcc.target/arm/crypto-vaese-erratum1.c28
-rw-r--r--gcc/testsuite/gcc.target/bpf/core-section-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/mask-pack-prefer128.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/mask-pack-prefer256.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr103771.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/pr104104.c10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-5.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-11.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr104015-1.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr104015-2.c29
-rw-r--r--gcc/testsuite/gcc.target/powerpc/sldoi_to_mov.c3
-rw-r--r--gcc/testsuite/gcc.target/s390/ifcvt-two-insns-bool.c39
-rw-r--r--gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c39
-rw-r--r--gcc/testsuite/gcc.target/s390/ifcvt-two-insns-long.c39
-rw-r--r--gcc/testsuite/gfortran.dg/pr102520.f906
-rw-r--r--gcc/testsuite/gfortran.dg/pr102860.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr103692.f9023
-rw-r--r--gcc/testsuite/lib/g++-dg.exp2
-rw-r--r--gcc/testsuite/lib/gcov.exp5
-rw-r--r--gcc/toplev.cc20
-rw-r--r--gcc/tree-cfg.cc2
-rw-r--r--gcc/tree-vect-generic.cc5
-rw-r--r--gcc/tree-vect-loop.cc120
-rw-r--r--gcc/tree-vect-stmts.cc11
-rw-r--r--gcc/tree-vectorizer.h25
-rw-r--r--gcc/tree.cc2
-rw-r--r--gcc/typed-splay-tree.cc2
-rw-r--r--gcc/value-relation.cc15
-rw-r--r--gcc/value-relation.h1
-rw-r--r--gcc/vec-perm-indices.cc2
-rw-r--r--gcc/vec.cc2
195 files changed, 2915 insertions, 624 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea92724..a8837ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,556 @@
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * ifcvt.cc (noce_convert_multiple_sets_1): New function.
+ (noce_convert_multiple_sets): Call function a second time if we can
+ improve the first try.
+
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * ifcvt.cc (cond_exec_get_condition): New parameter to allow getting the
+ reversed comparison.
+ (try_emit_cmove_seq): New function to facilitate creating a cmov
+ sequence.
+ (noce_convert_multiple_sets): Create two sequences and use the less
+ expensive one.
+
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * rtl.h (struct rtx_comparison): New struct that holds an rtx
+ comparison.
+ * config/rs6000/rs6000.cc (rs6000_emit_minmax): Use struct instead of
+ single parameters.
+ (rs6000_emit_swsqrt): Likewise.
+ * expmed.cc (expand_sdiv_pow2): Likewise.
+ (emit_store_flag): Likewise.
+ * expr.cc (expand_cond_expr_using_cmove): Likewise.
+ (expand_expr_real_2): Likewise.
+ * ifcvt.cc (noce_emit_cmove): Add compare and reversed compare
+ parameters.
+ * optabs.cc (emit_conditional_move_1): New function.
+ (expand_doubleword_shift_condmove): Use struct.
+ (emit_conditional_move): Use struct and allow to call directly
+ without going through preparation steps.
+ * optabs.h (emit_conditional_move): Use struct.
+
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * ifcvt.cc (bb_ok_for_noce_convert_multiple_sets): Estimate insns costs.
+ (noce_process_if_block): Use potential costs.
+
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * ifcvt.cc (noce_convert_multiple_sets): Allow constants.
+ (bb_ok_for_noce_convert_multiple_sets): Likewise.
+
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * ifcvt.cc (need_cmov_or_rewire): New function.
+ (noce_convert_multiple_sets): Call it.
+
+2022-01-19 David Malcolm <dmalcolm@redhat.com>
+
+ * attribs.cc (attribute_c_tests): Rename to...
+ (attribs_cc_tests): ...this.
+ * bitmap.cc (bitmap_c_tests): Rename to...
+ (bitmap_cc_tests): ...this.
+ * cgraph.cc (cgraph_c_finalize): Rename to...
+ (cgraph_cc_finalize): ...this.
+ (cgraph_c_tests): Rename to...
+ (cgraph_cc_tests): ...this.
+ * cgraph.h (cgraph_c_finalize): Rename to...
+ (cgraph_cc_finalize): ...this.
+ (cgraphunit_c_finalize): Rename to...
+ (cgraphunit_cc_finalize): ...this.
+ * cgraphunit.cc (cgraphunit_c_finalize): Rename to...
+ (cgraphunit_cc_finalize): ...this.
+ * convert.cc (convert_c_tests): Rename to...
+ (convert_cc_tests): ...this.
+ * dbgcnt.cc (dbgcnt_c_tests): Rename to...
+ (dbgcnt_cc_tests): ...this.
+ * diagnostic-show-locus.cc (diagnostic_show_locus_c_tests): Rename to...
+ (diagnostic_show_locus_cc_tests): ...this.
+ * diagnostic.cc (diagnostic_c_tests): Rename to...
+ (diagnostic_cc_tests): ...this.
+ * dumpfile.cc (dumpfile_c_tests): Rename to...
+ (dumpfile_cc_tests): ...this.
+ * dwarf2out.cc (dwarf2out_c_finalize): Rename to...
+ (dwarf2out_cc_finalize): ...this.
+ * dwarf2out.h (dwarf2out_c_finalize): Rename to...
+ (dwarf2out_cc_finalize): ...this.
+ * edit-context.cc (edit_context_c_tests): Rename to...
+ (edit_context_cc_tests): ...this.
+ * et-forest.cc (et_forest_c_tests): Rename to...
+ (et_forest_cc_tests): ...this.
+ * fibonacci_heap.cc (fibonacci_heap_c_tests): Rename to...
+ (fibonacci_heap_cc_tests): ...this.
+ * fold-const.cc (fold_const_c_tests): Rename to...
+ (fold_const_cc_tests): ...this.
+ * function-tests.cc (function_tests_c_tests): Rename to...
+ (function_tests_cc_tests): ...this.
+ * gcse.cc (gcse_c_finalize): Rename to...
+ (gcse_cc_finalize): ...this.
+ * gcse.h (gcse_c_finalize): Rename to...
+ (gcse_cc_finalize): ...this.
+ * ggc-tests.cc (ggc_tests_c_tests): Rename to...
+ (ggc_tests_cc_tests): ...this.
+ * gimple-ssa-store-merging.cc (store_merging_c_tests): Rename to...
+ (store_merging_cc_tests): ...this.
+ * gimple.cc (gimple_c_tests): Rename to...
+ (gimple_cc_tests): ...this.
+ * hash-map-tests.cc (hash_map_tests_c_tests): Rename to...
+ (hash_map_tests_cc_tests): ...this.
+ * hash-set-tests.cc (hash_set_tests_c_tests): Rename to...
+ (hash_set_tests_cc_tests): ...this.
+ * input.cc (input_c_tests): Rename to...
+ (input_cc_tests): ...this.
+ * ipa-cp.cc (ipa_cp_c_finalize): Rename to...
+ (ipa_cp_cc_finalize): ...this.
+ * ipa-fnsummary.cc (ipa_fnsummary_c_finalize): Rename to...
+ (ipa_fnsummary_cc_finalize): ...this.
+ * ipa-fnsummary.h (ipa_fnsummary_c_finalize): Rename to...
+ (ipa_fnsummary_cc_finalize): ...this.
+ * ipa-modref-tree.cc (ipa_modref_tree_c_tests): Rename to...
+ (ipa_modref_tree_cc_tests): ...this.
+ * ipa-modref-tree.h (modref_c_tests): Delete bogus decl.
+ * ipa-modref.cc (ipa_modref_c_finalize): Rename to...
+ (ipa_modref_cc_finalize): ...this.
+ * ipa-modref.h (ipa_modref_c_finalize): Rename to...
+ (ipa_modref_cc_finalize): ...this.
+ * ipa-prop.h (ipa_cp_c_finalize): Rename to...
+ (ipa_cp_cc_finalize): ...this.
+ * ipa-reference.cc (ipa_reference_c_finalize): Rename to...
+ (ipa_reference_cc_finalize): ...this.
+ * ipa-reference.h (ipa_reference_c_finalize): Rename to...
+ (ipa_reference_cc_finalize): ...this.
+ * ira-costs.cc (ira_costs_c_finalize): Rename to...
+ (ira_costs_cc_finalize): ...this.
+ * ira.h (ira_costs_c_finalize): Rename to...
+ (ira_costs_cc_finalize): ...this.
+ * opt-suggestions.cc (opt_proposer_c_tests): Rename to...
+ (opt_suggestions_cc_tests): ...this.
+ * opts.cc (opts_c_tests): Rename to...
+ (opts_cc_tests): ...this.
+ * predict.cc (predict_c_tests): Rename to...
+ (predict_cc_tests): ...this.
+ * pretty-print.cc (pretty_print_c_tests): Rename to...
+ (pretty_print_cc_tests): ...this.
+ * read-rtl-function.cc (read_rtl_function_c_tests): Rename to...
+ (read_rtl_function_cc_tests): ...this.
+ * rtl-tests.cc (rtl_tests_c_tests): Rename to...
+ (rtl_tests_cc_tests): ...this.
+ * sbitmap.cc (sbitmap_c_tests): Rename to...
+ (sbitmap_cc_tests): ...this.
+ * selftest-run-tests.cc (selftest::run_tests): Update calls for
+ _c_ to _cc_ function renamings; fix names of attribs and
+ opt-suggestions tests.
+ * selftest.cc (selftest_c_tests): Rename to...
+ (selftest_cc_tests): ...this.
+ * selftest.h (attribute_c_tests): Rename to...
+ (attribs_cc_tests): ...this.
+ (bitmap_c_tests): Rename to...
+ (bitmap_cc_tests): ...this.
+ (cgraph_c_tests): Rename to...
+ (cgraph_cc_tests): ...this.
+ (convert_c_tests): Rename to...
+ (convert_cc_tests): ...this.
+ (diagnostic_c_tests): Rename to...
+ (diagnostic_cc_tests): ...this.
+ (diagnostic_show_locus_c_tests): Rename to...
+ (diagnostic_show_locus_cc_tests): ...this.
+ (dumpfile_c_tests): Rename to...
+ (dumpfile_cc_tests): ...this.
+ (edit_context_c_tests): Rename to...
+ (edit_context_cc_tests): ...this.
+ (et_forest_c_tests): Rename to...
+ (et_forest_cc_tests): ...this.
+ (fibonacci_heap_c_tests): Rename to...
+ (fibonacci_heap_cc_tests): ...this.
+ (fold_const_c_tests): Rename to...
+ (fold_const_cc_tests): ...this.
+ (function_tests_c_tests): Rename to...
+ (function_tests_cc_tests): ...this.
+ (ggc_tests_c_tests): Rename to...
+ (ggc_tests_cc_tests): ...this.
+ (gimple_c_tests): Rename to...
+ (gimple_cc_tests): ...this.
+ (hash_map_tests_c_tests): Rename to...
+ (hash_map_tests_cc_tests): ...this.
+ (hash_set_tests_c_tests): Rename to...
+ (hash_set_tests_cc_tests): ...this.
+ (input_c_tests): Rename to...
+ (input_cc_tests): ...this.
+ (opts_c_tests): Rename to...
+ (opts_cc_tests): ...this.
+ (predict_c_tests): Rename to...
+ (predict_cc_tests): ...this.
+ (pretty_print_c_tests): Rename to...
+ (pretty_print_cc_tests): ...this.
+ (read_rtl_function_c_tests): Rename to...
+ (read_rtl_function_cc_tests): ...this.
+ (rtl_tests_c_tests): Rename to...
+ (rtl_tests_cc_tests): ...this.
+ (sbitmap_c_tests): Rename to...
+ (sbitmap_cc_tests): ...this.
+ (selftest_c_tests): Rename to...
+ (selftest_cc_tests): ...this.
+ (simplify_rtx_c_tests): Rename to...
+ (simplify_rtx_cc_tests): ...this.
+ (spellcheck_c_tests): Rename to...
+ (spellcheck_cc_tests): ...this.
+ (spellcheck_tree_c_tests): Rename to...
+ (spellcheck_tree_cc_tests): ...this.
+ (sreal_c_tests): Rename to...
+ (sreal_cc_tests): ...this.
+ (store_merging_c_tests): Rename to...
+ (store_merging_cc_tests): ...this.
+ (tree_c_tests): Rename to...
+ (tree_cc_tests): ...this.
+ (tree_cfg_c_tests): Rename to...
+ (tree_cfg_cc_tests): ...this.
+ (typed_splay_tree_c_tests): Rename to...
+ (typed_splay_tree_cc_tests): ...this.
+ (vec_c_tests): Rename to...
+ (vec_cc_tests): ...this.
+ (vec_perm_indices_c_tests): Rename to...
+ (vec_perm_indices_cc_tests): ..this.
+ (opt_proposer_c_tests): Rename to...
+ (opt_suggestions_cc_tests): ...this.
+ (dbgcnt_c_tests): Rename to...
+ (dbgcnt_cc_tests): ...this.
+ (ipa_modref_tree_c_tests): Rename to...
+ (ipa_modref_tree_cc_tests): ...this.
+ * simplify-rtx.cc (simplify_rtx_c_tests): Rename to...
+ (simplify_rtx_cc_tests): ...this.
+ * spellcheck-tree.cc (spellcheck_tree_c_tests): Rename to...
+ (spellcheck_tree_cc_tests): ...this.
+ * spellcheck.cc (spellcheck_c_tests): Rename to...
+ (spellcheck_cc_tests): ...this.
+ * sreal.cc (sreal_c_tests): Rename to...
+ (sreal_cc_tests): ...this.
+ * toplev.cc (toplev::finalize): Update calls for _c_ to _cc_
+ function renamings.
+ * tree-cfg.cc (tree_cfg_c_tests): Rename to...
+ (tree_cfg_cc_tests): ...this.
+ * tree.cc (tree_c_tests): Rename to...
+ (tree_cc_tests): ...this.
+ * typed-splay-tree.cc (typed_splay_tree_c_tests): Rename to...
+ (typed_splay_tree_cc_tests): ...this.
+ * vec-perm-indices.cc (vec_perm_indices_c_tests): Rename to...
+ (vec_perm_indices_cc_tests): ...this.
+ * vec.cc (vec_c_tests): Rename to...
+ (vec_cc_tests): ...this.
+
+2022-01-19 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ PR tree-optimization/103997
+ * tree-vect-loop.cc (vect_analyze_loop): Fix mode skipping for epilogue
+ vectorization.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/102860
+ * match.pd (x %[fl] y -> x % y): New simplification for
+ unsigned integral types.
+ * optabs-tree.cc (optab_for_tree_code): Return unknown_optab
+ for {CEIL,FLOOR,ROUND}_{DIV,MOD}_EXPR with VECTOR_TYPE.
+
+2022-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/104112
+ * tree-vect-loop.cc (vect_find_reusable_accumulator): Check
+ for required intermediate vector types.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/rs6000.cc (rs6000_machine_from_flags): Add default:.
+
+2022-01-19 Martin Liska <mliska@suse.cz>
+
+ * configure.ac: Remove -Wno-error=format-diag.
+ * configure: Regenerate.
+
+2022-01-19 Martin Liska <mliska@suse.cz>
+
+ * config/riscv/riscv.cc (riscv_handle_type_attribute):
+ Update one -Wformat-diag string in warning message.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/104103
+ * gimple-ssa-warn-access.cc (pass_waccess::check_call): Don't check
+ .ASAN_MARK calls.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/89074
+ * fold-const.cc (address_compare): Consider different STRING_CSTs
+ with the same lengths that memcmp the same as equal, not different.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/sse.md (*aes<aeswideklvariant>u*): Use %0 instead of
+ {%0}.
+
+2022-01-19 Martin Liska <mliska@suse.cz>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * config/nvptx/nvptx.cc (nvptx_goacc_validate_dims_1): Update
+ warning messages.
+
+2022-01-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ PR target/104090
+ * config/rs6000/rs6000.cc (rs6000_machine_from_flags): Use also
+ rs6000_cpu.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/104104
+ * config/i386/sse.md
+ (<avx512>_<complexopname>_<mode><maskc_name><round_name>,
+ avx512fp16_<complexopname>sh_v8hf<mask_scalarc_name><round_scalarcz_name>,
+ avx512dq_mul<mode>3<mask_name>, <avx2_avx512>_permvar<mode><mask_name>,
+ avx2_perm<mode>_1<mask_name>, avx512f_perm<mode>_1<mask_name>,
+ avx512dq_rangep<mode><mask_name><round_saeonly_name>,
+ avx512dq_ranges<mode><mask_scalar_name><round_saeonly_scalar_name>,
+ <avx512>_getmant<mode><mask_name><round_saeonly_name>,
+ avx512f_vgetmant<mode><mask_scalar_name><round_saeonly_scalar_name>):
+ Use vxorps\t%x0, %x0, %x0 instead of vxorps\t{%x0, %x0, %x0}.
+
+2022-01-19 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/104069
+ * gimple-ssa-warn-access.cc (pointers_related_p): Return false for
+ an unknown result as documented.
+
+2022-01-18 Andrew Pinski <apinski@marvell.com>
+
+ * ipa-split.cc (visit_bb): Fix comment before the
+ warning/error attribute checking code.
+
+2022-01-18 David Faust <david.faust@oracle.com>
+
+ * config/bpf/coreout.cc (bpf_core_reloc_add): Do not account
+ for base strtab offset yet as it may change.
+ (output_asm_btfext_core_reloc): Do so here instead.
+ (output_btfext_core_sections): Likewise.
+
+2022-01-18 David Faust <david.faust@oracle.com>
+
+ * config/bpf/coreout.cc (output_btfext_header): Account for
+ 4-byte record size in core_relo_len.
+ (output_btfext_core_sections): Only write record size once.
+ * config/bpf/coreout.h (btf_ext_section_header): Delete unused
+ member.
+
+2022-01-18 Maciej W. Rozycki <macro@embecosm.com>
+
+ * common/config/riscv/riscv-common.cc
+ (riscv_subset_list::parse_multiletter_ext): Move pointer
+ arithmetic ahead of `free'.
+
+2022-01-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/104007
+ * gimplify.cc (gimple_push_cleanup): Handle eh_only in conditional
+ context.
+
+2022-01-18 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR middle-end/103163
+ * emit-rtl.cc (init_emit_regs): Initialize stack_limit_rtx here...
+ (init_emit_once): ...not here.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * collect2.cc (scan_libraries): Fix -Wformat-diag issues.
+ * config/aarch64/aarch64-builtins.cc (aarch64_simd_expand_builtin): Likewise.
+ * config/arc/arc.md: Likewise.
+ * config/avr/avr.cc (avr_section_type_flags): Likewise.
+ * config/bfin/bfin.cc (bfin_option_override): Likewise.
+ (bfin_handle_longcall_attribute): Likewise.
+ * config/cris/cris.h (FUNCTION_PROFILER): Likewise.
+ * config/frv/frv.cc (frv_expand_builtin): Likewise.
+ * config/ia64/ia64-c.cc (ia64_hpux_handle_builtin_pragma): Likewise.
+ * config/iq2000/iq2000.cc (save_restore_insns): Likewise.
+ (iq2000_print_operand_address): Likewise.
+ (iq2000_print_operand): Likewise.
+ * config/m32c/m32c-pragma.cc (m32c_pragma_memregs): Likewise.
+ (m32c_pragma_address): Likewise.
+ * config/m68k/m68k.cc (m68k_handle_fndecl_attribute): Likewise.
+ * config/mips/mips.cc (mips_handle_interrupt_attr): Likewise.
+ (mips_set_compression_mode): Likewise.
+ * config/mmix/mmix.cc (mmix_function_profiler): Likewise.
+ (mmix_print_operand): Likewise.
+ (mmix_output_shiftvalue_op_from_str): Likewise.
+ (mmix_output_shifted_value): Likewise.
+ * config/msp430/driver-msp430.cc (msp430_select_hwmult_lib): Likewise.
+ * config/msp430/msp430.cc (msp430_option_override): Likewise.
+ (msp430_attr): Likewise.
+ (msp430_expand_delay_cycles): Likewise.
+ (msp430_expand_builtin): Likewise.
+ * config/rs6000/aix73.h: Likewise.
+ * config/rs6000/rtems.h (INVALID_64BIT): Likewise.
+ * config/rx/rx.cc (rx_expand_builtin_mvtc): Likewise.
+ (valid_psw_flag): Likewise.
+ * config/sh/sh.cc (parse_validate_atomic_model_option): Likewise.
+ * config/stormy16/stormy16.cc (xstormy16_function_profiler): Likewise.
+ (xstormy16_expand_builtin_va_start): Likewise.
+ (xstormy16_handle_below100_attribute): Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/vms/vms-c.cc (vms_pragma_nostandard): Fix -Wformat-diag
+ warning.
+ (vms_pragma_standard): Likewise.
+ (vms_pragma_extern_prefix): Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/xtensa/xtensa.cc (print_operand): Fix warnings.
+ (print_operand_address): Likewise.
+ (xtensa_multibss_section_type_flags): Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/rs6000/rs6000-call.cc (rs6000_invalid_builtin): Change
+ wording of an error message.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/v850/v850-c.cc (pop_data_area): Fix -Wformat-diag
+ warning.
+ (ghs_pragma_section): Likewise.
+ (ghs_pragma_interrupt): Likewise.
+ (ghs_pragma_starttda): Likewise.
+ (ghs_pragma_startsda): Likewise.
+ (ghs_pragma_startzda): Likewise.
+ (ghs_pragma_endtda): Likewise.
+ (ghs_pragma_endsda): Likewise.
+ (ghs_pragma_endzda): Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/nds32/nds32-intrinsic.cc (nds32_expand_builtin_impl):
+ Fix warnings.
+ * config/nds32/nds32-intrinsic.md: Likewise.
+ * config/nds32/nds32-isr.cc (nds32_check_isr_attrs_conflict): Likewise.
+ * config/nds32/nds32.cc (nds32_print_operand): Likewise.
+ (nds32_insert_attributes): Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/nvptx/nvptx.cc (nvptx_goacc_validate_dims_1): Wrap
+ keyword.
+ * config/nvptx/nvptx.md: Remove trailing dot.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * common/config/riscv/riscv-common.cc (riscv_subset_list::add):
+ Wrap keywords with quotes and remove trailing dots.
+ (riscv_subset_list::parsing_subset_version): Likewise.
+ (riscv_subset_list::parse_std_ext): Likewise.
+ (riscv_subset_list::parse_multiletter_ext): Likewise.
+ * config/riscv/riscv.cc (riscv_handle_type_attribute): Likewise.
+
+2022-01-18 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * tree-vect-loop.cc (vect_estimate_min_profitable_iters): Pass new
+ argument suggested_unroll_factor.
+ (vect_analyze_loop_costing): Likewise.
+ (_loop_vec_info::_loop_vec_info): Initialize new member
+ suggested_unroll_factor.
+ (vect_determine_partial_vectors_and_peeling): Make epilogue of unrolled
+ main loop use partial vectors.
+ (vect_analyze_loop_2): Pass and use new argument
+ suggested_unroll_factor.
+ (vect_analyze_loop_1): Change to intialize local
+ suggested_unroll_factor and use it.
+ (vectorizable_reduction): Don't use single_defuse_cycle when unrolling.
+ * tree-vectorizer.h (_loop_vec_info::_loop_vec_info): Add new member
+ suggested_unroll_factor.
+ (vector_costs::vector_costs): Add new member m_suggested_unroll_factor.
+ (vector_costs::suggested_unroll_factor): New getter function.
+ (finish_cost): Set return argument suggested_unroll_factor.
+
+2022-01-18 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/104038
+ * doc/invoke.texi (relation-block-limit): New.
+ * params.opt (relation-block-limit): New.
+ * value-relation.cc (dom_oracle::register_relation): Check for NULL
+ record before invoking transitive registery.
+ (dom_oracle::set_one_relation): Check limit before creating record.
+ (dom_oracle::register_transitives): Stop when no record created.
+ * value-relation.h (relation_chain_head::m_num_relations): New.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR ipa/103989
+ * ipa-inline.cc (inline_small_functions): Do not enqueue call
+ edges originating in functions compiled with -Og.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR ipa/103989
+ * passes.def (pass_all_optimizations_g): Remove pass_modref
+ and pass_local_pure_const.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/s390/s390.cc: Fix -Wformat-diag warnings.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/s390/s390-c.cc (s390_expand_overloaded_builtin): Wrap
+ keyword in quotes.
+ (s390_resolve_overloaded_builtin): Remove trailing dot.
+ * config/s390/s390.cc (s390_const_operand_ok): Use - for range.
+ (s390_expand_builtin): Remove trailing dot.
+ (s390_emit_prologue): Likewise, use semicolon.
+ (s390_option_override_internal): Update keyword.
+ * varasm.cc (do_assemble_alias): Wrap keyword in quotes.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * config/rs6000/rs6000-call.cc (rs6000_expand_builtin): Wrap
+ keywords and use %qs instead of %<%s%>.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/103987
+ * tree-ssa-dse.cc (dse_optimize_call): Properly guard modref
+ query with a pointer check.
+
+2022-01-18 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/104005
+ * config/aarch64/aarch64.cc (aarch64_check_consecutive_mems):
+ When using MEM_EXPR, require the base to be a decl.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ * cgraph.h (struct cgraph_simd_clone_arg): Re-arrange fields to
+ avoid padding.
+ * function.h (struct function): Likewise.
+
+2022-01-18 Arnaud Charlet <charlet@adacore.com>
+
+ * doc/install.texi: Update prerequisites for GNAT
+
+2022-01-18 Andrew Pinski <apinski@marvell.com>
+
+ PR tree-optimization/101941
+ * ipa-split.cc (visit_bb): Disallow function calls where
+ the function has either error or warning attribute.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/104064
+ * tree-vect-data-refs.cc (vect_analyze_data_ref_accesses): Check
+ DR_INIT fits in a signed HWI, represent the difference from the
+ first DR in unsigned.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* Makefile.in: Rename .c names to .cc.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index bd33f30..261c631 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20220118
+20220120
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e82b786..c79cbd1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,99 @@
+2022-01-19 H.J. Lu <hjl.tools@gmail.com>
+
+ PR ada/103538
+ * gcc-interface/Makefile.in (target_cpu): Set to x32 for
+ x86_64-linux-gnux32.
+
+2022-01-19 H.J. Lu <hjl.tools@gmail.com>
+
+ PR ada/103538
+ * Makefile.rtl (LIBGNAT_TARGET_PAIRS): Add
+ $(TRASYM_DWARF_UNIX_PAIRS),
+ s-tsmona.adb<libgnat/s-tsmona__linux.adb,
+ $(GNATRTL_128BIT_PAIRS).
+ (EXTRA_GNATRTL_NONTASKING_OBJS): Add $(TRASYM_DWARF_UNIX_OBJS)
+ and $(GNATRTL_128BIT_OBJS).
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * adaint.c: Revert filename changes in comments.
+ * ctrl_c.c (dummy_handler): Likewise.
+ * gsocket.h: Likewise.
+ * init.c (__gnat_error_handler): Likewise.
+ * libgnarl/s-intman.ads: Likewise.
+ * libgnarl/s-osinte__android.ads: Likewise.
+ * libgnarl/s-osinte__darwin.ads: Likewise.
+ * libgnarl/s-osinte__hpux.ads: Likewise.
+ * libgnarl/s-osinte__linux.ads: Likewise.
+ * libgnarl/s-osinte__qnx.ads: Likewise.
+ * libgnarl/s-taskin.ads: Likewise.
+ * rtfinal.c: Likewise.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * Make-generated.in: Revert renaming changes.
+ * Makefile.rtl: Likewise.
+ * adadecode.cc: Moved to...
+ * adadecode.c: ...here.
+ * affinity.cc: Moved to...
+ * affinity.c: ...here.
+ * argv-lynxos178-raven-cert.cc: Moved to...
+ * argv-lynxos178-raven-cert.c: ...here.
+ * argv.cc: Moved to...
+ * argv.c: ...here.
+ * aux-io.cc: Moved to...
+ * aux-io.c: ...here.
+ * cio.cc: Moved to...
+ * cio.c: ...here.
+ * cstreams.cc: Moved to...
+ * cstreams.c: ...here.
+ * env.cc: Moved to...
+ * env.c: ...here.
+ * exit.cc: Moved to...
+ * exit.c: ...here.
+ * expect.cc: Moved to...
+ * expect.c: ...here.
+ * final.cc: Moved to...
+ * final.c: ...here.
+ * gcc-interface/Makefile.in:
+ * init.cc: Moved to...
+ * init.c: ...here.
+ * initialize.cc: Moved to...
+ * initialize.c: ...here.
+ * libgnarl/thread.cc: Moved to...
+ * libgnarl/thread.c: ...here.
+ * link.cc: Moved to...
+ * link.c: ...here.
+ * locales.cc: Moved to...
+ * locales.c: ...here.
+ * mkdir.cc: Moved to...
+ * mkdir.c: ...here.
+ * raise.cc: Moved to...
+ * raise.c: ...here.
+ * rtfinal.cc: Moved to...
+ * rtfinal.c: ...here.
+ * rtinit.cc: Moved to...
+ * rtinit.c: ...here.
+ * s-oscons-tmplt.c (CND): Revert renaming changes.
+ * seh_init.cc: Moved to...
+ * seh_init.c: ...here.
+ * sigtramp-armdroid.cc: Moved to...
+ * sigtramp-armdroid.c: ...here.
+ * sigtramp-ios.cc: Moved to...
+ * sigtramp-ios.c: ...here.
+ * sigtramp-qnx.cc: Moved to...
+ * sigtramp-qnx.c: ...here.
+ * sigtramp-vxworks.cc: Moved to...
+ * sigtramp-vxworks.c: ...here.
+ * socket.cc: Moved to...
+ * socket.c: ...here.
+ * tracebak.cc: Moved to...
+ * tracebak.c: ...here.
+ * version.cc: Moved to...
+ * version.c: ...here.
+ * vx_stack_info.cc: Moved to...
+ * vx_stack_info.c: ...here.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* Makefile.rtl: Rename .c names to .cc.
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 1b066ad..6d60aea 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -2650,13 +2650,18 @@ ifeq ($(strip $(filter-out %x32 linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
+ $(TRASYM_DWARF_UNIX_PAIRS) \
+ s-tsmona.adb<libgnat/s-tsmona__linux.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
+ $(GNATRTL_128BIT_PAIRS) \
system.ads<libgnat/system-linux-x86.ads
TOOLS_TARGET_PAIRS = indepsw.adb<indepsw-gnu.adb
EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
+ EXTRA_GNATRTL_NONTASKING_OBJS+=$(TRASYM_DWARF_UNIX_OBJS)
+ EXTRA_GNATRTL_NONTASKING_OBJS+=$(GNATRTL_128BIT_OBJS)
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
EH_MECHANISM=-gcc
THREADSLIB=-lpthread -lrt
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 53d0739..b8a2470 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -350,6 +350,13 @@ ifeq ($(strip $(filter-out x86_64, $(target_cpu))),)
endif
endif
+# The x86_64-linux-gnux32 compiler is actually an x32 compiler
+ifeq ($(strip $(filter-out x86_64 linux-gnux32%, $(target_cpu) $(target_os))),)
+ ifneq ($(strip $(MULTISUBDIR)),/64)
+ target_cpu:=x32
+ endif
+endif
+
# The SuSE PowerPC64/Linux compiler is actually a 32-bit PowerPC compiler
ifeq ($(strip $(filter-out powerpc64 suse linux%, $(target_cpu) $(target_vendor) $(target_os))),)
target_cpu:=powerpc
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 0b43d08..df4a511 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,3 +1,19 @@
+2022-01-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/104089
+ * region-model-manager.cc
+ (region_model_manager::get_or_create_constant_svalue): Assert that
+ we have a CONSTANT_CLASS_P.
+ (region_model_manager::maybe_fold_unaryop): Only fold a constant
+ when fold_unary's result is a constant or a cast of a constant.
+
+2022-01-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/104062
+ * region-model-manager.cc
+ (region_model_manager::maybe_fold_sub_svalue): Avoid casting to
+ NULL type when folding access to repeated svalue.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* analyzer.cc (is_special_named_call_p): Rename .c names to .cc.
diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc
index 903cdfde..bb93526 100644
--- a/gcc/analyzer/region-model-manager.cc
+++ b/gcc/analyzer/region-model-manager.cc
@@ -209,6 +209,7 @@ const svalue *
region_model_manager::get_or_create_constant_svalue (tree cst_expr)
{
gcc_assert (cst_expr);
+ gcc_assert (CONSTANT_CLASS_P (cst_expr));
constant_svalue **slot = m_constants_map.get (cst_expr);
if (slot)
@@ -426,7 +427,23 @@ region_model_manager::maybe_fold_unaryop (tree type, enum tree_code op,
/* Constants. */
if (tree cst = arg->maybe_get_constant ())
if (tree result = fold_unary (op, type, cst))
- return get_or_create_constant_svalue (result);
+ {
+ if (CONSTANT_CLASS_P (result))
+ return get_or_create_constant_svalue (result);
+
+ /* fold_unary can return casts of constants; try to handle them. */
+ if (op != NOP_EXPR
+ && type
+ && TREE_CODE (result) == NOP_EXPR
+ && CONSTANT_CLASS_P (TREE_OPERAND (result, 0)))
+ {
+ const svalue *inner_cst
+ = get_or_create_constant_svalue (TREE_OPERAND (result, 0));
+ return get_or_create_cast (type,
+ get_or_create_cast (TREE_TYPE (result),
+ inner_cst));
+ }
+ }
return NULL;
}
@@ -794,7 +811,8 @@ region_model_manager::maybe_fold_sub_svalue (tree type,
if (const repeated_svalue *repeated_sval
= parent_svalue->dyn_cast_repeated_svalue ())
- return get_or_create_cast (type, repeated_sval->get_inner_svalue ());
+ if (type)
+ return get_or_create_cast (type, repeated_sval->get_inner_svalue ());
return NULL;
}
diff --git a/gcc/attribs.cc b/gcc/attribs.cc
index 189f56a..497dcff 100644
--- a/gcc/attribs.cc
+++ b/gcc/attribs.cc
@@ -2655,7 +2655,7 @@ test_attribute_exclusions ()
}
void
-attribute_c_tests ()
+attribs_cc_tests ()
{
test_attribute_exclusions ();
}
diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 69b9d53..88c329f 100644
--- a/gcc/bitmap.cc
+++ b/gcc/bitmap.cc
@@ -2976,7 +2976,7 @@ test_aligned_chunk (unsigned num_bits)
/* Run all of the selftests within this file. */
void
-bitmap_c_tests ()
+bitmap_cc_tests ()
{
test_gc_alloc ();
test_set_range ();
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 2243f18..2cfebb2 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,21 @@
+2022-01-19 David Malcolm <dmalcolm@redhat.com>
+
+ * c-common.cc (c_common_c_tests): Rename to...
+ (c_common_cc_tests): ...this.
+ (c_family_tests): Update calls for .c to .cc renaming.
+ * c-common.h (c_format_c_tests): Rename to...
+ (c_format_cc_tests): ...this.
+ (c_indentation_c_tests): Rename to...
+ (c_indentation_cc_tests): ...this.
+ (c_pretty_print_c_tests): Rename to...
+ (c_pretty_print_cc_tests): ...this.
+ * c-format.cc (c_format_c_tests): Rename to...
+ (c_format_cc_tests): ...this.
+ * c-indentation.cc (c_indentation_c_tests): Rename to...
+ (c_indentation_cc_tests): ...this.
+ * c-pretty-print.cc (c_pretty_print_c_tests): Rename to...
+ (c_pretty_print_cc_tests): ...this.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* c-ada-spec.cc: Rename .c names to .cc.
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index d9674ea..f56f6df 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -9096,7 +9096,7 @@ test_fold_for_warn ()
/* Run all of the selftests within this file. */
static void
-c_common_c_tests ()
+c_common_cc_tests ()
{
test_fold_for_warn ();
}
@@ -9106,10 +9106,10 @@ c_common_c_tests ()
void
c_family_tests (void)
{
- c_common_c_tests ();
- c_format_c_tests ();
- c_indentation_c_tests ();
- c_pretty_print_c_tests ();
+ c_common_cc_tests ();
+ c_format_cc_tests ();
+ c_indentation_cc_tests ();
+ c_pretty_print_cc_tests ();
c_spellcheck_cc_tests ();
}
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index ee0c4de..28c73fe 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1512,9 +1512,9 @@ extern tree braced_lists_to_strings (tree, tree);
namespace selftest {
/* Declarations for specific families of tests within c-family,
by source file, in alphabetical order. */
- extern void c_format_c_tests (void);
- extern void c_indentation_c_tests (void);
- extern void c_pretty_print_c_tests (void);
+ extern void c_format_cc_tests (void);
+ extern void c_indentation_cc_tests (void);
+ extern void c_pretty_print_cc_tests (void);
extern void c_spellcheck_cc_tests (void);
/* The entrypoint for running all of the above tests. */
diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc
index d7878b7..a2affda 100644
--- a/gcc/c-family/c-format.cc
+++ b/gcc/c-family/c-format.cc
@@ -5424,7 +5424,7 @@ test_type_mismatch_range_labels ()
/* Run all of the selftests within this file. */
void
-c_format_c_tests ()
+c_format_cc_tests ()
{
test_get_modifier_for_format_len ();
test_get_format_for_type_printf ();
diff --git a/gcc/c-family/c-indentation.cc b/gcc/c-family/c-indentation.cc
index 30c9b25..85a3ae1 100644
--- a/gcc/c-family/c-indentation.cc
+++ b/gcc/c-family/c-indentation.cc
@@ -804,7 +804,7 @@ test_get_visual_column ()
/* Run all of the selftests within this file. */
void
-c_indentation_c_tests ()
+c_indentation_cc_tests ()
{
test_next_tab_stop ();
test_get_visual_column ();
diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc
index 0b4256c..ceedaea 100644
--- a/gcc/c-family/c-pretty-print.cc
+++ b/gcc/c-family/c-pretty-print.cc
@@ -2999,7 +2999,7 @@ test_location_wrappers ()
/* Run all of the selftests within this file. */
void
-c_pretty_print_c_tests ()
+c_pretty_print_cc_tests ()
{
test_location_wrappers ();
}
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index ea8db2f..b923a59 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -4077,7 +4077,7 @@ cgraph_node::get_fun () const
within the same process. For use by toplev::finalize. */
void
-cgraph_c_finalize (void)
+cgraph_cc_finalize (void)
{
nested_function_info::release ();
thunk_info::release ();
@@ -4261,7 +4261,7 @@ test_symbol_table_test ()
/* Run all of the selftests within this file. */
void
-cgraph_c_tests ()
+cgraph_cc_tests ()
{
test_symbol_table_test ();
}
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 43fc94e..8c512b6 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -2568,7 +2568,7 @@ asmname_hasher::equal (symtab_node *n, const_tree t)
}
/* In cgraph.cc */
-void cgraph_c_finalize (void);
+void cgraph_cc_finalize (void);
void release_function_body (tree);
cgraph_indirect_call_info *cgraph_allocate_init_indirect_info (void);
@@ -2579,7 +2579,7 @@ const char* cgraph_inline_failed_string (cgraph_inline_failed_t);
cgraph_inline_failed_type_t cgraph_inline_failed_type (cgraph_inline_failed_t);
/* In cgraphunit.cc */
-void cgraphunit_c_finalize (void);
+void cgraphunit_cc_finalize (void);
int tp_first_run_node_cmp (const void *pa, const void *pb);
/* In symtab-thunks.cc */
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index e043f9f..01f4e28 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -2535,7 +2535,7 @@ symbol_table::finalize_compilation_unit (void)
within the same process. For use by toplev::finalize. */
void
-cgraphunit_c_finalize (void)
+cgraphunit_cc_finalize (void)
{
gcc_assert (cgraph_new_nodes.length () == 0);
cgraph_new_nodes.truncate (0);
diff --git a/gcc/collect2.cc b/gcc/collect2.cc
index 0185b9d..d81c7f2 100644
--- a/gcc/collect2.cc
+++ b/gcc/collect2.cc
@@ -2552,7 +2552,7 @@ scan_libraries (const char *prog_name)
pex = pex_init (PEX_USE_PIPES, "collect2", NULL);
if (pex == NULL)
- fatal_error (input_location, "pex_init failed: %m");
+ fatal_error (input_location, "%<pex_init%> failed: %m");
errmsg = pex_run (pex, 0, ldd_file_name, real_ldd_argv, NULL, NULL, &err);
if (errmsg != NULL)
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index c1d8431..25f5670 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -375,7 +375,7 @@ riscv_subset_list::add (const char *subset, int major_version,
else
error_at (
m_loc,
- "%<-march=%s%>: Extension `%s' appear more than one time.",
+ "%<-march=%s%>: extension %qs appear more than one time",
m_arch,
subset);
@@ -613,14 +613,14 @@ riscv_subset_list::parsing_subset_version (const char *ext,
{
if (!ISDIGIT (*(p+1)))
{
- error_at (m_loc, "%<-march=%s%>: Expect number "
- "after %<%dp%>.", m_arch, version);
+ error_at (m_loc, "%<-march=%s%>: expect number "
+ "after %<%dp%>", m_arch, version);
return NULL;
}
if (!major_p)
{
- error_at (m_loc, "%<-march=%s%>: For %<%s%dp%dp?%>, version "
- "number with more than 2 level is not supported.",
+ error_at (m_loc, "%<-march=%s%>: for %<%s%dp%dp?%>, version "
+ "number with more than 2 level is not supported",
m_arch, ext, major, version);
return NULL;
}
@@ -701,8 +701,8 @@ riscv_subset_list::parse_std_ext (const char *p)
/* std_ext_p= */ true, &explicit_version_p);
if (major_version != 0 || minor_version != 0)
{
- warning_at (m_loc, 0, "version of `g` will be omitted, please "
- "specify version for individual extension.");
+ warning_at (m_loc, 0, "version of %<g%> will be omitted, please "
+ "specify version for individual extension");
}
/* We have special rule for G, we disallow rv32gm2p but allow rv32g_zicsr
@@ -901,12 +901,12 @@ riscv_subset_list::parse_multiletter_ext (const char *p,
}
add (subset, major_version, minor_version, explicit_version_p, false);
- free (subset);
p += end_of_version - subset;
+ free (subset);
if (*p != '\0' && *p != '_')
{
- error_at (m_loc, "%<-march=%s%>: %s must separate with _",
+ error_at (m_loc, "%<-march=%s%>: %s must separate with %<_%>",
m_arch, ext_type_str);
return NULL;
}
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc
index 215de1c..b7f338d 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -1943,7 +1943,7 @@ aarch64_simd_expand_builtin (int fcode, tree exp, rtx target)
}
else
error_at (EXPR_LOCATION (exp),
- "total size and element size must be a non-zero "
+ "total size and element size must be a nonzero "
"constant immediate");
/* Don't generate any RTL. */
return const0_rtx;
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index d4e22a4..ace3cb7 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -4666,7 +4666,7 @@ core_3, archs4x, archs4xd, archs4xd_slow"
/* Keep this message in sync with the one in arc.cc:arc_expand_builtin,
because *.md files do not get scanned by exgettext. */
fatal_error (input_location,
- \"operand to trap_s should be an unsigned 6-bit value\");
+ \"operand to %<trap_s%> should be an unsigned 6-bit value\");
}
[(set_attr "length" "2")
(set_attr "type" "misc")])
diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index 499e82d..0d3082b 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -192,6 +192,9 @@ define feature quirk_cm3_ldrd
# v8-m/v8.1-m VLLDM errata.
define feature quirk_vlldm
+# AES errata on some Cortex-A parts
+define feature quirk_aes_1742098
+
# Don't use .cpu assembly directive
define feature quirk_no_asmcpu
@@ -329,7 +332,7 @@ define implied vfp_base MVE MVE_FP ALL_FP
# architectures.
# xscale isn't really a 'quirk', but it isn't an architecture either and we
# need to ignore it for matching purposes.
-define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd quirk_vlldm xscale quirk_no_asmcpu
+define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd quirk_vlldm xscale quirk_no_asmcpu quirk_aes_1742098
define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7
@@ -1342,6 +1345,7 @@ begin cpu cortex-a57
cname cortexa57
tune flags LDSCHED
architecture armv8-a+crc+simd
+ isa quirk_aes_1742098
option crypto add FP_ARMv8 CRYPTO
costs cortex_a57
vendor 41
@@ -1353,6 +1357,7 @@ begin cpu cortex-a72
tune for cortex-a57
tune flags LDSCHED
architecture armv8-a+crc+simd
+ isa quirk_aes_1742098
option crypto add FP_ARMv8 CRYPTO
costs cortex_a57
vendor 41
@@ -1391,6 +1396,7 @@ begin cpu cortex-a57.cortex-a53
tune for cortex-a53
tune flags LDSCHED
architecture armv8-a+crc+simd
+ isa quirk_aes_1742098
option crypto add FP_ARMv8 CRYPTO
costs cortex_a57
end cpu cortex-a57.cortex-a53
@@ -1400,6 +1406,7 @@ begin cpu cortex-a72.cortex-a53
tune for cortex-a53
tune flags LDSCHED
architecture armv8-a+crc+simd
+ isa quirk_aes_1742098
option crypto add FP_ARMv8 CRYPTO
costs cortex_a57
end cpu cortex-a72.cortex-a53
diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
index 7825e36..04354b3 100644
--- a/gcc/config/arm/arm.cc
+++ b/gcc/config/arm/arm.cc
@@ -3638,6 +3638,15 @@ arm_option_override (void)
fix_vlldm = 0;
}
+ /* Enable fix_aes by default if required. */
+ if (fix_aes_erratum_1742098 == 2)
+ {
+ if (bitmap_bit_p (arm_active_target.isa, isa_bit_quirk_aes_1742098))
+ fix_aes_erratum_1742098 = 1;
+ else
+ fix_aes_erratum_1742098 = 0;
+ }
+
/* Hot/Cold partitioning is not currently supported, since we can't
handle literal pool placement in that case. */
if (flag_reorder_blocks_and_partition)
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index 587fc93..2a4f165 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -272,6 +272,16 @@ mfix-cmse-cve-2021-35465
Target Var(fix_vlldm) Init(2)
Mitigate issues with VLLDM on some M-profile devices (CVE-2021-35465).
+mfix-cortex-a57-aes-1742098
+Target Var(fix_aes_erratum_1742098) Init(2) Save
+Mitigate issues with AES instructions on Cortex-A57 and Cortex-A72.
+Arm erratum #1742098
+
+mfix-cortex-a72-aes-1655431
+Target Alias(mfix-cortex-a57-aes-1742098)
+Mitigate issues with AES instructions on Cortex-A57 and Cortex-A72.
+Arm erratum #1655431
+
munaligned-access
Target Var(unaligned_access) Init(2) Save
Enable unaligned word and halfword accesses to packed data.
diff --git a/gcc/config/arm/crypto.md b/gcc/config/arm/crypto.md
index 2425641..4c78507 100644
--- a/gcc/config/arm/crypto.md
+++ b/gcc/config/arm/crypto.md
@@ -19,42 +19,128 @@
;; <http://www.gnu.org/licenses/>.
-(define_insn "crypto_<crypto_pattern>"
+(define_insn "crypto_<CRYPTO_AESMC:crypto_pattern>"
[(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
(unspec:<crypto_mode>
- [(match_operand:<crypto_mode> 1 "register_operand" "w")]
+ [(match_operand:<crypto_mode> 1 "register_operand" "w")]
CRYPTO_AESMC))]
"TARGET_CRYPTO"
"<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q1"
[(set_attr "type" "<crypto_type>")]
)
-(define_insn "crypto_<crypto_pattern>"
- [(set (match_operand:V16QI 0 "register_operand" "=w")
- (unspec:V16QI
- [(xor:V16QI
- (match_operand:V16QI 1 "register_operand" "%0")
- (match_operand:V16QI 2 "register_operand" "w"))]
+(define_expand "crypto_<CRYPTO_AES:crypto_pattern>"
+ [(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
+ (unspec:<crypto_mode>
+ [(xor:<crypto_mode>
+ (match_operand:<crypto_mode> 1 "register_operand" "%0")
+ (match_operand:<crypto_mode> 2 "register_operand" "w"))]
CRYPTO_AES))]
"TARGET_CRYPTO"
+{
+ if (fix_aes_erratum_1742098)
+ {
+ rtx op1_protect = gen_reg_rtx (V16QImode);
+ emit_insn (gen_aes_op_protect (op1_protect, operands[1]));
+ operands[1] = op1_protect;
+ rtx op2_protect = gen_reg_rtx (V16QImode);
+ emit_insn (gen_aes_op_protect (op2_protect, operands[2]));
+ operands[2] = op2_protect;
+ }
+ /* Fall through to default expansion. */
+})
+
+(define_insn "*crypto_<CRYPTO_AES:crypto_pattern>_insn"
+ [(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
+ (unspec:<crypto_mode>
+ [(xor:<crypto_mode>
+ (match_operand:<crypto_mode> 1 "register_operand" "%0")
+ (match_operand:<crypto_mode> 2 "register_operand" "w"))]
+ CRYPTO_AES))]
+ "TARGET_CRYPTO"
"<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q2"
[(set_attr "type" "<crypto_type>")]
)
+;; Mitigate against AES erratum on Cortex-A57 and Cortex-A72 by
+;; performing a 128-bit operation on an operand producer. This can be
+;; eliminated only if we know that the operand was produced by a
+;; full-width operation. V16QImode matches <crypto_mode> for the AES
+;; instructions. Handle some very common cases where the source is
+;; known to be safe (transfers from core registers and memory).
+(define_insn "aes_op_protect"
+ [(set (match_operand:V16QI 0 "register_operand" "=w,w,w")
+ (unspec:V16QI [(match_operand:V16QI 1 "general_operand" "w,r,Uni")]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_CRYPTO && fix_aes_erratum_1742098"
+ {
+ switch (which_alternative)
+ {
+ case 0: return "vmov\t%q0, %q1";
+ case 1: return "vmov\t%e0, %Q1, %R1 @ V16QI\;vmov\t%f0, %J1, %K1";
+ case 2: return output_move_neon (operands);
+ default: gcc_unreachable ();
+ }
+ }
+ [(set_attr "type" "neon_move_q,neon_from_gp_q,neon_load1_4reg")
+ (set_attr "length" "4,8,8")
+ (set_attr "arm_pool_range" "*,*,1020")
+ (set_attr "thumb2_pool_range" "*,*,1018")
+ (set_attr "neg_pool_range" "*,*,996")]
+)
+
+;; Another safe case is when a movmisalign load is used as the source.
+(define_insn "*aes_op_protect_misalign_load"
+ [(set (match_operand:V16QI 0 "s_register_operand" "=w")
+ (unspec:V16QI
+ [(unspec:V16QI
+ [(match_operand:V16QI 1 "neon_permissive_struct_operand" "Um")]
+ UNSPEC_MISALIGNED_ACCESS)]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_CRYPTO && fix_aes_erratum_1742098"
+ "vld1.8\t%{q0}, %A1"
+ [(set_attr "type" "neon_load1_1reg_q")]
+)
+
+;; Similarly for the vld1 intrinsic
+(define_insn "aes_op_protect_neon_vld1v16qi"
+ [(set (match_operand:V16QI 0 "s_register_operand" "=w")
+ (unspec:V16QI
+ [(unspec:V16QI [(match_operand:V16QI 1 "neon_struct_operand" "Um")]
+ UNSPEC_VLD1)]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_NEON"
+ "vld1.8\t%h0, %A1"
+ [(set_attr "type" "neon_load1_1reg_q")]
+)
+
+;; An AESMC operation can feed directly into a subsequent AES
+;; operation without needing mitigation.
+(define_insn "*crypto_<CRYPTO_AESMC:crypto_pattern>_protected"
+ [(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
+ (unspec:<crypto_mode>
+ [(unspec:<crypto_mode>
+ [(match_operand:<crypto_mode> 1 "register_operand" "w")]
+ CRYPTO_AESMC)]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_CRYPTO && fix_aes_erratum_1742098"
+ "<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q1"
+ [(set_attr "type" "<crypto_type>")]
+)
+
;; When AESE/AESMC fusion is enabled we really want to keep the two together
;; and enforce the register dependency without scheduling or register
;; allocation messing up the order or introducing moves inbetween.
-;; Mash the two together during combine.
+;; Mash the two together during combine.
(define_insn "*aarch32_crypto_aese_fused"
[(set (match_operand:V16QI 0 "register_operand" "=w")
(unspec:V16QI
- [(unspec:V16QI
- [(xor:V16QI
- (match_operand:V16QI 1 "register_operand" "%0")
- (match_operand:V16QI 2 "register_operand" "w"))]
- UNSPEC_AESE)]
- UNSPEC_AESMC))]
+ [(unspec:V16QI [(xor:V16QI
+ (match_operand:V16QI 1 "register_operand" "%0")
+ (match_operand:V16QI 2 "register_operand" "w"))]
+ UNSPEC_AESE)]
+ UNSPEC_AESMC))]
"TARGET_CRYPTO
&& arm_fusion_enabled_p (tune_params::FUSE_AES_AESMC)"
"aese.8\\t%q0, %q2\;aesmc.8\\t%q0, %q0"
@@ -62,20 +148,38 @@
(set_attr "length" "8")]
)
+;; And similarly when mitigation is enabled, but not needed in this
+;; case.
+(define_insn "*aarch32_crypto_aese_fused_protected"
+ [(set (match_operand:V16QI 0 "register_operand" "=w")
+ (unspec:V16QI
+ [(unspec:V16QI
+ [(unspec:V16QI [(xor:V16QI
+ (match_operand:V16QI 1 "register_operand" "%0")
+ (match_operand:V16QI 2 "register_operand" "w"))]
+ UNSPEC_AESE)]
+ UNSPEC_AESMC)]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_CRYPTO && fix_aes_erratum_1742098
+ && arm_fusion_enabled_p (tune_params::FUSE_AES_AESMC)"
+ "aese.8\\t%q0, %q2\;aesmc.8\\t%q0, %q0"
+ [(set_attr "type" "crypto_aese")
+ (set_attr "length" "8")]
+)
+
;; When AESD/AESIMC fusion is enabled we really want to keep the two together
;; and enforce the register dependency without scheduling or register
;; allocation messing up the order or introducing moves inbetween.
-;; Mash the two together during combine.
+;; Mash the two together during combine.
(define_insn "*aarch32_crypto_aesd_fused"
[(set (match_operand:V16QI 0 "register_operand" "=w")
(unspec:V16QI
- [(unspec:V16QI
- [(xor:V16QI
- (match_operand:V16QI 1 "register_operand" "%0")
- (match_operand:V16QI 2 "register_operand" "w"))]
- UNSPEC_AESD)]
- UNSPEC_AESIMC))]
+ [(unspec:V16QI [(xor:V16QI
+ (match_operand:V16QI 1 "register_operand" "%0")
+ (match_operand:V16QI 2 "register_operand" "w"))]
+ UNSPEC_AESD)]
+ UNSPEC_AESIMC))]
"TARGET_CRYPTO
&& arm_fusion_enabled_p (tune_params::FUSE_AES_AESMC)"
"aesd.8\\t%q0, %q2\;aesimc.8\\t%q0, %q0"
@@ -83,31 +187,50 @@
(set_attr "length" "8")]
)
-(define_insn "crypto_<crypto_pattern>"
+(define_insn "*aarch32_crypto_aesd_fused_protected"
+ [(set (match_operand:V16QI 0 "register_operand" "=w")
+ (unspec:V16QI
+ [(unspec:V16QI
+ [(unspec:V16QI [(xor:V16QI
+ (match_operand:V16QI 1 "register_operand" "%0")
+ (match_operand:V16QI 2 "register_operand" "w"))]
+ UNSPEC_AESD)]
+ UNSPEC_AESIMC)]
+ UNSPEC_AES_PROTECT))]
+ "TARGET_CRYPTO && fix_aes_erratum_1742098
+ && arm_fusion_enabled_p (tune_params::FUSE_AES_AESMC)"
+ "aesd.8\\t%q0, %q2\;aesimc.8\\t%q0, %q0"
+ [(set_attr "type" "crypto_aese")
+ (set_attr "length" "8")]
+)
+
+(define_insn "crypto_<CRYPTO_BINARY:crypto_pattern>"
[(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
(unspec:<crypto_mode>
- [(match_operand:<crypto_mode> 1 "register_operand" "0")
- (match_operand:<crypto_mode> 2 "register_operand" "w")]
- CRYPTO_BINARY))]
+ [(match_operand:<crypto_mode> 1 "register_operand" "0")
+ (match_operand:<crypto_mode> 2 "register_operand" "w")]
+ CRYPTO_BINARY))]
"TARGET_CRYPTO"
"<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q2"
[(set_attr "type" "<crypto_type>")]
)
-(define_insn "crypto_<crypto_pattern>"
+(define_insn "crypto_<CRYPTO_TERNARY:crypto_pattern>"
[(set (match_operand:<crypto_mode> 0 "register_operand" "=w")
- (unspec:<crypto_mode> [(match_operand:<crypto_mode> 1 "register_operand" "0")
- (match_operand:<crypto_mode> 2 "register_operand" "w")
- (match_operand:<crypto_mode> 3 "register_operand" "w")]
- CRYPTO_TERNARY))]
+ (unspec:<crypto_mode>
+ [(match_operand:<crypto_mode> 1 "register_operand" "0")
+ (match_operand:<crypto_mode> 2 "register_operand" "w")
+ (match_operand:<crypto_mode> 3 "register_operand" "w")]
+ CRYPTO_TERNARY))]
"TARGET_CRYPTO"
"<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q2, %q3"
[(set_attr "type" "<crypto_type>")]
)
-/* The vec_select operation always selects index 0 from the lower V2SI subreg
- of the V4SI, adjusted for endianness. Required due to neon_vget_lane and
- neon_set_lane that change the element ordering in memory for big-endian. */
+;; The vec_select operation always selects index 0 from the lower V2SI
+;; subreg of the V4SI, adjusted for endianness. Required due to
+;; neon_vget_lane and neon_set_lane that change the element ordering
+;; in memory for big-endian.
(define_expand "crypto_sha1h"
[(set (match_operand:V4SI 0 "register_operand")
@@ -122,10 +245,10 @@
(define_insn "crypto_sha1h_lb"
[(set (match_operand:V4SI 0 "register_operand" "=w")
(unspec:V4SI
- [(vec_select:SI
+ [(vec_select:SI
(match_operand:V4SI 1 "register_operand" "w")
(parallel [(match_operand:SI 2 "immediate_operand" "i")]))]
- UNSPEC_SHA1H))]
+ UNSPEC_SHA1H))]
"TARGET_CRYPTO && INTVAL (operands[2]) == NEON_ENDIAN_LANE_N (V2SImode, 0)"
"sha1h.32\\t%q0, %q1"
[(set_attr "type" "crypto_sha1_fast")]
@@ -133,9 +256,9 @@
(define_insn "crypto_vmullp64"
[(set (match_operand:TI 0 "register_operand" "=w")
- (unspec:TI [(match_operand:DI 1 "register_operand" "w")
- (match_operand:DI 2 "register_operand" "w")]
- UNSPEC_VMULLP64))]
+ (unspec:TI [(match_operand:DI 1 "register_operand" "w")
+ (match_operand:DI 2 "register_operand" "w")]
+ UNSPEC_VMULLP64))]
"TARGET_CRYPTO"
"vmull.p64\\t%q0, %P1, %P2"
[(set_attr "type" "crypto_pmull")]
@@ -145,13 +268,13 @@
of the V4SI, adjusted for endianness. Required due to neon_vget_lane and
neon_set_lane that change the element ordering in memory for big-endian. */
-(define_expand "crypto_<crypto_pattern>"
+(define_expand "crypto_<CRYPTO_SELECTING:crypto_pattern>"
[(set (match_operand:V4SI 0 "register_operand")
(unspec:<crypto_mode>
- [(match_operand:<crypto_mode> 1 "register_operand")
- (match_operand:<crypto_mode> 2 "register_operand")
- (match_operand:<crypto_mode> 3 "register_operand")]
- CRYPTO_SELECTING))]
+ [(match_operand:<crypto_mode> 1 "register_operand")
+ (match_operand:<crypto_mode> 2 "register_operand")
+ (match_operand:<crypto_mode> 3 "register_operand")]
+ CRYPTO_SELECTING))]
"TARGET_CRYPTO"
{
rtx op4 = GEN_INT (NEON_ENDIAN_LANE_N (V2SImode, 0));
@@ -160,15 +283,15 @@
DONE;
})
-(define_insn "crypto_<crypto_pattern>_lb"
+(define_insn "crypto_<CRYPTO_SELECTING:crypto_pattern>_lb"
[(set (match_operand:V4SI 0 "register_operand" "=w")
- (unspec:<crypto_mode>
- [(match_operand:<crypto_mode> 1 "register_operand" "0")
- (vec_select:SI
- (match_operand:<crypto_mode> 2 "register_operand" "w")
- (parallel [(match_operand:SI 4 "immediate_operand" "i")]))
- (match_operand:<crypto_mode> 3 "register_operand" "w")]
- CRYPTO_SELECTING))]
+ (unspec:<crypto_mode>
+ [(match_operand:<crypto_mode> 1 "register_operand" "0")
+ (vec_select:SI
+ (match_operand:<crypto_mode> 2 "register_operand" "w")
+ (parallel [(match_operand:SI 4 "immediate_operand" "i")]))
+ (match_operand:<crypto_mode> 3 "register_operand" "w")]
+ CRYPTO_SELECTING))]
"TARGET_CRYPTO && INTVAL (operands[4]) == NEON_ENDIAN_LANE_N (V2SImode, 0)"
"<crypto_pattern>.<crypto_size_sfx>\\t%q0, %q2, %q3"
[(set_attr "type" "<crypto_type>")]
diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md
index 2782af0..7748e78 100644
--- a/gcc/config/arm/unspecs.md
+++ b/gcc/config/arm/unspecs.md
@@ -270,6 +270,7 @@
UNSPEC_AESE
UNSPEC_AESIMC
UNSPEC_AESMC
+ UNSPEC_AES_PROTECT
UNSPEC_SHA1C
UNSPEC_SHA1M
UNSPEC_SHA1P
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 9eec991..4ed390e 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -10195,7 +10195,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
flags |= SECTION_BSS; /* @nobits */
else
warning (0, "only uninitialized variables can be placed in the "
- ".noinit section");
+ "%<.noinit%> section");
}
if (decl && DECL_P (decl)
diff --git a/gcc/config/bfin/bfin.cc b/gcc/config/bfin/bfin.cc
index a89a1b4..c749b48 100644
--- a/gcc/config/bfin/bfin.cc
+++ b/gcc/config/bfin/bfin.cc
@@ -2382,10 +2382,10 @@ bfin_option_override (void)
}
if (stack_limit_rtx && TARGET_STACK_CHECK_L1)
- error ("can%'t use multiple stack checking methods together");
+ error ("cannot use multiple stack checking methods together");
if (TARGET_ID_SHARED_LIBRARY && TARGET_FDPIC)
- error ("ID shared libraries and FD-PIC mode can%'t be used together");
+ error ("ID shared libraries and FD-PIC mode cannot be used together");
/* Don't allow the user to specify -mid-shared-library and -msep-data
together, as it makes little sense from a user's point of view... */
@@ -2419,7 +2419,7 @@ bfin_option_override (void)
error ("%<-mcoreb%> should be used with %<-mmulticore%>");
if (TARGET_COREA && TARGET_COREB)
- error ("%<-mcorea%> and %<-mcoreb%> can%'t be used together");
+ error ("%<-mcorea%> and %<-mcoreb%> cannot be used together");
flag_schedule_insns = 0;
@@ -4763,7 +4763,7 @@ bfin_handle_longcall_attribute (tree *node, tree name,
&& lookup_attribute ("longcall", TYPE_ATTRIBUTES (*node))))
{
warning (OPT_Wattributes,
- "can%'t apply both longcall and shortcall attributes to the same function");
+ "cannott apply both longcall and shortcall attributes to the same function");
*no_add_attrs = true;
}
diff --git a/gcc/config/bpf/coreout.cc b/gcc/config/bpf/coreout.cc
index f8ca280..cceaaa9 100644
--- a/gcc/config/bpf/coreout.cc
+++ b/gcc/config/bpf/coreout.cc
@@ -168,11 +168,8 @@ bpf_core_reloc_add (const tree type, const char * section_name,
bpf_core_reloc_ref bpfcr = ggc_cleared_alloc<bpf_core_reloc_t> ();
ctf_container_ref ctfc = ctf_get_tu_ctfc ();
- /* Buffer the access string in the auxiliary strtab. Since the two string
- tables are concatenated, add the length of the first to the offset. */
- size_t strtab_len = ctfc_get_strtab_len (ctfc, CTF_STRTAB);
+ /* Buffer the access string in the auxiliary strtab. */
ctf_add_string (ctfc, buf, &(bpfcr->bpfcr_astr_off), CTF_AUX_STRTAB);
- bpfcr->bpfcr_astr_off += strtab_len;
bpfcr->bpfcr_type = get_btf_id (ctf_lookup_tree_type (ctfc, type));
bpfcr->bpfcr_insn_label = label;
@@ -191,7 +188,6 @@ bpf_core_reloc_add (const tree type, const char * section_name,
sec = ggc_cleared_alloc<bpf_core_section_t> ();
ctf_add_string (ctfc, section_name, &sec->name_offset, CTF_AUX_STRTAB);
- sec->name_offset += strtab_len;
if (strcmp (section_name, ""))
ctfc->ctfc_aux_strlen += strlen (section_name) + 1;
@@ -259,7 +255,7 @@ output_btfext_header (void)
uint32_t core_relo_off = 0, core_relo_len = 0;
/* Header core_relo_len is the sum total length in bytes of all CO-RE
- relocation sections. */
+ relocation sections, plus the 4 byte record size. */
size_t i;
bpf_core_section_ref sec;
core_relo_len += vec_safe_length (bpf_core_sections)
@@ -269,6 +265,9 @@ output_btfext_header (void)
core_relo_len +=
vec_safe_length (sec->relocs) * sizeof (struct btf_ext_reloc);
+ if (core_relo_len)
+ core_relo_len += sizeof (uint32_t);
+
dw2_asm_output_data (4, func_info_off, "func_info_offset");
dw2_asm_output_data (4, func_info_len, "func_info_len");
@@ -284,6 +283,9 @@ output_btfext_header (void)
static void
output_asm_btfext_core_reloc (bpf_core_reloc_ref bpfcr)
{
+ bpfcr->bpfcr_astr_off += ctfc_get_strtab_len (ctf_get_tu_ctfc (),
+ CTF_STRTAB);
+
dw2_assemble_integer (4, gen_rtx_LABEL_REF (Pmode, bpfcr->bpfcr_insn_label));
fprintf (asm_out_file, "\t%s bpfcr_insn\n", ASM_COMMENT_START);
@@ -310,15 +312,21 @@ output_btfext_core_sections (void)
{
size_t i;
bpf_core_section_ref sec;
+
+ /* BTF Ext section info. */
+ dw2_asm_output_data (4, sizeof (struct btf_ext_reloc),
+ "btfext_core_info_rec_size");
+
FOR_EACH_VEC_ELT (*bpf_core_sections, i, sec)
{
- /* BTF Ext section info. */
- dw2_asm_output_data (4, sizeof (struct btf_ext_reloc),
- "btfext_secinfo_rec_size");
-
/* Section name offset, refers to the offset of a string with the name of
the section to which these CORE relocations refer, e.g. '.text'.
The string is buffered in the BTF strings table. */
+
+ /* BTF specific strings are in CTF_AUX_STRTAB, which is concatenated
+ after CTF_STRTAB. Add the length of STRTAB to the final offset. */
+ sec->name_offset += ctfc_get_strtab_len (ctf_get_tu_ctfc (), CTF_STRTAB);
+
dw2_asm_output_data (4, sec->name_offset, "btfext_secinfo_sec_name_off");
dw2_asm_output_data (4, vec_safe_length (sec->relocs),
"btfext_secinfo_num_recs");
diff --git a/gcc/config/bpf/coreout.h b/gcc/config/bpf/coreout.h
index a9d7e36..3c7bdfd 100644
--- a/gcc/config/bpf/coreout.h
+++ b/gcc/config/bpf/coreout.h
@@ -33,7 +33,6 @@ extern "C"
struct btf_ext_section_header
{
- uint32_t kind;
uint32_t sec_name_off;
uint32_t num_records;
};
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index c623d08..b274e11 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -663,7 +663,7 @@ struct cum_args {int regs;};
/* Node: Profiling */
#define FUNCTION_PROFILER(FILE, LABELNO) \
- error ("no FUNCTION_PROFILER for CRIS")
+ error ("no %<FUNCTION_PROFILER%> for CRIS")
/* FIXME: Some of the undefined macros might be mandatory. If so, fix
documentation. */
diff --git a/gcc/config/frv/frv.cc b/gcc/config/frv/frv.cc
index d6c3993..6f1904b 100644
--- a/gcc/config/frv/frv.cc
+++ b/gcc/config/frv/frv.cc
@@ -9134,7 +9134,7 @@ frv_expand_builtin (tree exp,
case FRV_BUILTIN_IACCsetl:
if (!TARGET_FR405_BUILTINS)
{
- error ("this builtin function is only available"
+ error ("this built-in function is only available"
" on the fr405 and fr450");
return NULL_RTX;
}
@@ -9143,7 +9143,7 @@ frv_expand_builtin (tree exp,
case FRV_BUILTIN_PREFETCH:
if (!TARGET_FR500_FR550_BUILTINS)
{
- error ("this builtin function is only available on the fr500"
+ error ("this built-in function is only available on the fr500"
" and fr550");
return NULL_RTX;
}
@@ -9155,7 +9155,7 @@ frv_expand_builtin (tree exp,
case FRV_BUILTIN_MQSRAHI:
if (!TARGET_MEDIA_FR450)
{
- error ("this builtin function is only available on the fr450");
+ error ("this built-in function is only available on the fr450");
return NULL_RTX;
}
break;
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 34175fd..d8cb7b6 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -6539,7 +6539,7 @@
{
if (TARGET_DEST_FALSE_DEP_FOR_GLC
&& <maskc_dest_false_dep_for_glc_cond>)
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "v<complexopname><ssemodesuffix>\t{<round_maskc_op3>%2, %1, %0<maskc_operand3>|%0<maskc_operand3>, %1, %2<round_maskc_op3>}";
}
[(set_attr "type" "ssemul")
@@ -6750,7 +6750,7 @@
{
if (TARGET_DEST_FALSE_DEP_FOR_GLC
&& <mask_scalarc_dest_false_dep_for_glc_cond>)
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "v<complexopname>sh\t{<round_scalarc_mask_op3>%2, %1, %0<mask_scalarc_operand3>|%0<mask_scalarc_operand3>, %1, %2<round_scalarc_mask_op3>}";
}
[(set_attr "type" "ssemul")
@@ -15222,7 +15222,7 @@
&& <mask3_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1])
&& !reg_mentioned_p (operands[0], operands[2]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vpmullq\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}";
}
[(set_attr "type" "sseimul")
@@ -24658,7 +24658,7 @@
&& <mask3_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1])
&& !reg_mentioned_p (operands[0], operands[2]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vperm<ssemodesuffix>\t{%1, %2, %0<mask_operand3>|%0<mask_operand3>, %2, %1}";
}
[(set_attr "type" "sselog")
@@ -24900,7 +24900,7 @@
if (TARGET_DEST_FALSE_DEP_FOR_GLC
&& <mask6_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vperm<ssemodesuffix>\t{%2, %1, %0<mask_operand6>|%0<mask_operand6>, %1, %2}";
}
[(set_attr "type" "sselog")
@@ -24975,7 +24975,7 @@
if (TARGET_DEST_FALSE_DEP_FOR_GLC
&& <mask10_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vperm<ssemodesuffix>\t{%2, %1, %0<mask_operand10>|%0<mask_operand10>, %1, %2}";
}
[(set_attr "type" "sselog")
@@ -26880,7 +26880,7 @@
&& <mask4_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1])
&& !reg_mentioned_p (operands[0], operands[2]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vrange<ssemodesuffix>\t{%3, <round_saeonly_mask_op4>%2, %1, %0<mask_operand4>|%0<mask_operand4>, %1, %2<round_saeonly_mask_op4>, %3}";
}
[(set_attr "type" "sse")
@@ -26903,7 +26903,7 @@
&& <mask_scalar4_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1])
&& !reg_mentioned_p (operands[0], operands[2]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vrange<ssescalarmodesuffix>\t{%3, <round_saeonly_scalar_mask_op4>%2, %1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1, %<iptr>2<round_saeonly_scalar_mask_op4>, %3}";
}
[(set_attr "type" "sse")
@@ -26949,7 +26949,7 @@
if (TARGET_DEST_FALSE_DEP_FOR_GLC
&& <mask3_dest_false_dep_for_glc_cond>
&& MEM_P (operands[1]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vgetmant<ssemodesuffix>\t{%2, <round_saeonly_mask_op3>%1, %0<mask_operand3>|%0<mask_operand3>, %1<round_saeonly_mask_op3>, %2}";
}
[(set_attr "prefix" "evex")
@@ -26971,7 +26971,7 @@
&& <mask_scalar4_dest_false_dep_for_glc_cond>
&& !reg_mentioned_p (operands[0], operands[1])
&& !reg_mentioned_p (operands[0], operands[2]))
- output_asm_insn ("vxorps\t{%x0, %x0, %x0}", operands);
+ output_asm_insn ("vxorps\t%x0, %x0, %x0", operands);
return "vgetmant<ssescalarmodesuffix>\t{%3, <round_saeonly_scalar_mask_op4>%2, %1, %0<mask_scalar_operand4>|%0<mask_scalar_operand4>, %1, %<iptr>2<round_saeonly_scalar_mask_op4>, %3}";
}
[(set_attr "prefix" "evex")
@@ -28437,7 +28437,7 @@
[(match_operand:BLK 0 "memory_operand" "m")]
AESDECENCWIDEKL))])]
"TARGET_WIDEKL"
- "aes<aeswideklvariant>\t{%0}"
+ "aes<aeswideklvariant>\t%0"
[(set_attr "type" "other")])
;; Modes handled by broadcast patterns. NB: Allow V64QI and V32HI with
diff --git a/gcc/config/ia64/ia64-c.cc b/gcc/config/ia64/ia64-c.cc
index f1c8948..fa1b381 100644
--- a/gcc/config/ia64/ia64-c.cc
+++ b/gcc/config/ia64/ia64-c.cc
@@ -47,7 +47,7 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED)
type = pragma_lex (&x);
}
if (type != CPP_EOF)
- warning (OPT_Wpragmas, "malformed #pragma builtin");
+ warning (OPT_Wpragmas, "malformed %<#pragma builtin%>");
}
/* List of standard math functions which do not set matherr by default
diff --git a/gcc/config/iq2000/iq2000.cc b/gcc/config/iq2000/iq2000.cc
index 9b8349d..0627341 100644
--- a/gcc/config/iq2000/iq2000.cc
+++ b/gcc/config/iq2000/iq2000.cc
@@ -1864,7 +1864,7 @@ save_restore_insns (int store_p)
if (gp_offset < 0 || end_offset < 0)
internal_error
- ("gp_offset (%ld) or end_offset (%ld) is less than zero",
+ ("%<gp_offset%> (%ld) or %<end_offset%> (%ld) is less than zero",
(long) gp_offset, (long) end_offset);
else if (gp_offset < 32768)
@@ -2890,7 +2890,7 @@ static void
iq2000_print_operand_address (FILE * file, machine_mode mode, rtx addr)
{
if (!addr)
- error ("PRINT_OPERAND_ADDRESS, null pointer");
+ error ("%<PRINT_OPERAND_ADDRESS%>, null pointer");
else
switch (GET_CODE (addr))
@@ -3045,7 +3045,7 @@ iq2000_print_operand (FILE *file, rtx op, int letter)
break;
default:
- error ("PRINT_OPERAND: Unknown punctuation %<%c%>", letter);
+ error ("%<PRINT_OPERAND%>: Unknown punctuation %<%c%>", letter);
break;
}
@@ -3054,7 +3054,7 @@ iq2000_print_operand (FILE *file, rtx op, int letter)
if (! op)
{
- error ("PRINT_OPERAND null pointer");
+ error ("%<PRINT_OPERAND%> null pointer");
return;
}
diff --git a/gcc/config/m32c/m32c-pragma.cc b/gcc/config/m32c/m32c-pragma.cc
index 685caea..c7d01a9 100644
--- a/gcc/config/m32c/m32c-pragma.cc
+++ b/gcc/config/m32c/m32c-pragma.cc
@@ -51,14 +51,14 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED)
type = pragma_lex (&val);
if (type != CPP_EOF)
- warning (0, "junk at end of #pragma GCC memregs [0..16]");
+ warning (0, "junk at end of %<#pragma GCC memregs%> [0-16]");
if (i >= 0 && i <= 16)
{
if (!ok_to_change_target_memregs)
{
warning (0,
- "#pragma GCC memregs must precede any function decls");
+ "%<#pragma GCC memregs%> must precede any function declarations");
return;
}
target_memregs = i;
@@ -66,14 +66,14 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED)
}
else
{
- warning (0, "#pragma GCC memregs takes a number [0..16]");
+ warning (0, "%<#pragma GCC memregs%> takes a number [0-16]");
}
return;
}
}
- error ("#pragma GCC memregs takes a number [0..16]");
+ error ("%<#pragma GCC memregs%> takes a number [0-16]");
}
/* Implements the "pragma ADDRESS" pragma. This pragma takes a
@@ -101,12 +101,12 @@ m32c_pragma_address (cpp_reader * reader ATTRIBUTE_UNUSED)
type = pragma_lex (&var);
if (type != CPP_EOF)
{
- error ("junk at end of #pragma ADDRESS");
+ error ("junk at end of %<#pragma ADDRESS%>");
}
return;
}
}
- error ("malformed #pragma ADDRESS variable address");
+ error ("malformed %<#pragma ADDRESS%> variable address");
}
/* Implements REGISTER_TARGET_PRAGMAS. */
diff --git a/gcc/config/m68k/m68k.cc b/gcc/config/m68k/m68k.cc
index 1d5ef02..62898da 100644
--- a/gcc/config/m68k/m68k.cc
+++ b/gcc/config/m68k/m68k.cc
@@ -803,7 +803,7 @@ m68k_handle_fndecl_attribute (tree *node, tree name,
if (!TARGET_FIDOA
&& !strcmp (IDENTIFIER_POINTER (name), "interrupt_thread"))
{
- error ("interrupt_thread is available only on fido");
+ error ("%<interrupt_thread%> is available only on fido");
*no_add_attrs = true;
}
diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index 6c0da2b..4f9683e 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -1519,7 +1519,7 @@ mips_handle_interrupt_attr (tree *node ATTRIBUTE_UNUSED, tree name, tree args,
{
warning (OPT_Wattributes,
"argument to %qE attribute is neither eic, nor "
- "vector=<line>", name);
+ "%<vector=<line>%>", name);
*no_add_attrs = true;
}
else if (startswith (TREE_STRING_POINTER (cst), "vector="))
@@ -1535,7 +1535,7 @@ mips_handle_interrupt_attr (tree *node ATTRIBUTE_UNUSED, tree name, tree args,
{
warning (OPT_Wattributes,
"interrupt vector to %qE attribute is not "
- "vector=(sw0|sw1|hw0|hw1|hw2|hw3|hw4|hw5)",
+ "%<vector=(sw0|sw1|hw0|hw1|hw2|hw3|hw4|hw5)%>",
name);
*no_add_attrs = true;
}
@@ -19712,7 +19712,7 @@ mips_set_compression_mode (unsigned int compression_mode)
sorry ("MIPS16 %<-mxgot%> code");
if (TARGET_HARD_FLOAT_ABI && !TARGET_OLDABI)
- sorry ("hard-float MIPS16 code for ABIs other than o32 and o64");
+ sorry ("%<hard-float%> MIPS16 code for ABIs other than o32 and o64");
if (TARGET_MSA)
sorry ("MSA MIPS16 code");
diff --git a/gcc/config/mmix/mmix.cc b/gcc/config/mmix/mmix.cc
index 18053d4..439ae8f 100644
--- a/gcc/config/mmix/mmix.cc
+++ b/gcc/config/mmix/mmix.cc
@@ -977,7 +977,7 @@ void
mmix_function_profiler (FILE *stream ATTRIBUTE_UNUSED,
int labelno ATTRIBUTE_UNUSED)
{
- sorry ("function_profiler support for MMIX");
+ sorry ("%<function_profiler%> support for MMIX");
}
/* Worker function for TARGET_SETUP_INCOMING_VARARGS. For the moment,
@@ -1763,7 +1763,7 @@ mmix_print_operand (FILE *stream, rtx x, int code)
default:
/* Presumably there's a missing case above if we get here. */
- internal_error ("MMIX Internal: Missing %qc case in mmix_print_operand", code);
+ internal_error ("MMIX Internal: Missing %qc case in %<mmix_print_operand%>", code);
}
switch (GET_CODE (modified_x))
@@ -2591,7 +2591,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream,
{
char s[sizeof ("0xffffffffffffffff")];
sprintf (s, "%#" PRIx64, value);
- internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ internal_error ("MMIX Internal: %s is not a shiftable integer", s);
}
for (i = 0; i < 4; i++)
@@ -2650,7 +2650,7 @@ mmix_output_shifted_value (FILE *stream, int64_t value)
{
char s[16+2+1];
sprintf (s, "%#" PRIx64, value);
- internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ internal_error ("MMIX Internal: %s is not a shiftable integer", s);
}
for (i = 0; i < 4; i++)
diff --git a/gcc/config/msp430/driver-msp430.cc b/gcc/config/msp430/driver-msp430.cc
index 5ea2b07..b4bff42 100644
--- a/gcc/config/msp430/driver-msp430.cc
+++ b/gcc/config/msp430/driver-msp430.cc
@@ -89,7 +89,7 @@ msp430_select_hwmult_lib (int argc ATTRIBUTE_UNUSED,
{
case 1:
if (strcasecmp (argv[0], "default"))
- error ("unexpected argument to msp430_select_hwmult_lib: %s", argv[0]);
+ error ("unexpected argument to %<msp430_select_hwmult_lib%>: %s", argv[0]);
break;
default:
@@ -138,12 +138,12 @@ msp430_select_hwmult_lib (int argc ATTRIBUTE_UNUSED,
}
}
else
- error ("unexpected first argument to msp430_select_hwmult_lib: %s",
+ error ("unexpected first argument to %<msp430_select_hwmult_lib%>: %s",
argv[0]);
break;
case 0:
- error ("msp430_select_hwmult_lib needs one or more arguments");
+ error ("%<msp430_select_hwmult_lib%> needs one or more arguments");
break;
}
diff --git a/gcc/config/msp430/msp430.cc b/gcc/config/msp430/msp430.cc
index 18673ff..eb219fd 100644
--- a/gcc/config/msp430/msp430.cc
+++ b/gcc/config/msp430/msp430.cc
@@ -222,16 +222,16 @@ msp430_option_override (void)
{
if (target_cpu == MSP430_CPU_MSP430X_DEFAULT)
warning (0,
- "Unrecognized MCU name %qs, assuming that it is "
- "just a MSP430X with no hardware multiply.\n"
- "Use the %<-mcpu%> and %<-mhwmult%> options to "
- "set these explicitly.",
+ "unrecognized MCU name %qs, assuming that it is "
+ "just a MSP430X with no hardware multiply; "
+ "use the %<-mcpu%> and %<-mhwmult%> options to "
+ "set these explicitly",
target_mcu);
else
warning (0,
- "Unrecognized MCU name %qs, assuming that it "
- "has no hardware multiply.\nUse the %<-mhwmult%> "
- "option to set this explicitly.",
+ "unrecognized MCU name %qs, assuming that it "
+ "has no hardware multiply; use the %<-mhwmult%> "
+ "option to set this explicitly",
target_mcu);
}
@@ -241,9 +241,9 @@ msp430_option_override (void)
{
if (msp430_warn_mcu)
warning (0,
- "Unrecognized MCU name %qs, assuming that it just "
- "supports the MSP430X ISA.\nUse the %<-mcpu%> option "
- "to set the ISA explicitly.",
+ "unrecognized MCU name %qs, assuming that it just "
+ "supports the MSP430X ISA; use the %<-mcpu%> option "
+ "to set the ISA explicitly",
target_mcu);
}
else if (msp430_warn_mcu)
@@ -1901,7 +1901,7 @@ msp430_attr (tree * node,
/* Allow the attribute to be added - the linker script
being used may still recognise this value. */
warning (OPT_Wattributes,
- "numeric argument of %qE attribute must be in range 0..63",
+ "numeric argument of %qE attribute must be in range [0-63]",
name);
break;
@@ -2744,7 +2744,7 @@ msp430_expand_delay_cycles (rtx arg)
if (GET_CODE (arg) != CONST_INT)
{
- error ("__delay_cycles() only takes constant arguments");
+ error ("%<__delay_cycles()%> only takes constant arguments");
return NULL_RTX;
}
@@ -2754,7 +2754,7 @@ msp430_expand_delay_cycles (rtx arg)
{
if (c < 0)
{
- error ("__delay_cycles only takes non-negative cycle counts");
+ error ("%<__delay_cycles%> only takes non-negative cycle counts");
return NULL_RTX;
}
}
@@ -2775,7 +2775,7 @@ msp430_expand_delay_cycles (rtx arg)
c %= 4;
if ((unsigned long long) i > 0xffffffffULL)
{
- error ("__delay_cycles is limited to 32-bit loop counts");
+ error ("%<__delay_cycles%> is limited to 32-bit loop counts");
return NULL_RTX;
}
}
@@ -2846,7 +2846,7 @@ msp430_expand_builtin (tree exp,
if (! msp430_is_interrupt_func ())
{
- error ("MSP430 builtin functions only work inside interrupt handlers");
+ error ("MSP430 built-in functions only work inside interrupt handlers");
return NULL_RTX;
}
diff --git a/gcc/config/nds32/nds32-intrinsic.cc b/gcc/config/nds32/nds32-intrinsic.cc
index 3c297cf..2f2cd7c 100644
--- a/gcc/config/nds32/nds32-intrinsic.cc
+++ b/gcc/config/nds32/nds32-intrinsic.cc
@@ -1013,7 +1013,7 @@ nds32_expand_builtin_impl (tree exp,
/* Both v3s and v3f toolchains define TARGET_FPU_SINGLE. */
if (!TARGET_FPU_SINGLE)
{
- error ("this builtin function is only available "
+ error ("this built-in function is only available "
"on the v3s or v3f toolchain");
return NULL_RTX;
}
@@ -1025,7 +1025,7 @@ nds32_expand_builtin_impl (tree exp,
/* Only v3f toolchain defines TARGET_FPU_DOUBLE. */
if (!TARGET_FPU_DOUBLE)
{
- error ("this builtin function is only available "
+ error ("this built-in function is only available "
"on the v3f toolchain");
return NULL_RTX;
}
@@ -1040,7 +1040,7 @@ nds32_expand_builtin_impl (tree exp,
case NDS32_BUILTIN_SBUP:
if (TARGET_ISA_V3M)
{
- error ("this builtin function not support "
+ error ("this built-in function not support "
"on the v3m toolchain");
return NULL_RTX;
}
diff --git a/gcc/config/nds32/nds32-intrinsic.md b/gcc/config/nds32/nds32-intrinsic.md
index 45b10f0..d7229cd 100644
--- a/gcc/config/nds32/nds32-intrinsic.md
+++ b/gcc/config/nds32/nds32-intrinsic.md
@@ -301,8 +301,8 @@
offset = 32;
}
else
- error ("__nds32__clr_pending_hwint not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<__nds32__clr_pending_hwint%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
/* $INT_PEND type is write one clear. */
clr_hwint = GEN_INT (1 << (INTVAL (operands[0]) - offset));
@@ -359,8 +359,8 @@
operands[2] = GEN_INT (31 - (INTVAL (operands[1]) - 32));
}
else
- error ("get_pending_int not support NDS32_INT_ALZ,"
- " NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<get_pending_int%> not support %<NDS32_INT_ALZ%>,"
+ " %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
/* mfsr op0, sytem_reg */
if (system_reg != NULL_RTX)
@@ -417,8 +417,8 @@
offset = 48;
}
else
- error ("set_int_priority not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("i%<set_int_priority%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
mask = GEN_INT (~(3 << 2 * (INTVAL (operands[0]) - offset)));
priority = GEN_INT ((int) (INTVAL (operands[1])
@@ -477,8 +477,8 @@
offset = 48;
}
else
- error ("set_int_priority not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<set_int_priority%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
priority = GEN_INT (31 - 2 * (INTVAL (operands[1]) - offset));
@@ -514,8 +514,8 @@
offset = 32;
}
else
- error ("__nds32__set_trig_type_level not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<__nds32__set_trig_type_level%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
if (system_reg != NULL_RTX)
{
@@ -551,8 +551,8 @@
offset = 32;
}
else
- error ("__nds32__set_trig_type_edge not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<__nds32__set_trig_type_edge%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
if (system_reg != NULL_RTX)
{
@@ -588,8 +588,8 @@
offset = 32;
}
else
- error ("__nds32__get_trig_type not support NDS32_INT_SWI,"
- " NDS32_INT_ALZ, NDS32_INT_IDIVZE, NDS32_INT_DSSIM");
+ error ("%<__nds32__get_trig_type%> not support %<NDS32_INT_SWI%>,"
+ " %<NDS32_INT_ALZ%>, %<NDS32_INT_IDIVZE%>, %<NDS32_INT_DSSIM%>");
if (system_reg != NULL_RTX)
{
diff --git a/gcc/config/nds32/nds32-isr.cc b/gcc/config/nds32/nds32-isr.cc
index 344fb70..eef2d86 100644
--- a/gcc/config/nds32/nds32-isr.cc
+++ b/gcc/config/nds32/nds32-isr.cc
@@ -614,7 +614,7 @@ nds32_check_isr_attrs_conflict (tree func_decl, tree func_attrs)
partial_save_p = 1;
if ((save_all_p + partial_save_p) > 1)
- error ("multiple save reg attributes to function %qD", func_decl);
+ error ("multiple save register attributes to function %qD", func_decl);
/* We must check at MOST one attribute to set nested-type. */
if (lookup_attribute ("nested", func_attrs))
diff --git a/gcc/config/nds32/nds32.cc b/gcc/config/nds32/nds32.cc
index aab02ff..71fe9e8 100644
--- a/gcc/config/nds32/nds32.cc
+++ b/gcc/config/nds32/nds32.cc
@@ -3476,35 +3476,35 @@ nds32_print_operand (FILE *stream, rtx x, int code)
case 'R': /* cctl valck */
/* Note the cctl divide to 5 group and share the same name table. */
if (op_value < 0 || op_value > 4)
- error ("CCTL intrinsic function subtype out of range!");
+ error ("CCTL intrinsic function subtype out of range");
fprintf (stream, "%s", nds32_cctl_names[op_value]);
return;
case 'T': /* cctl idxwbinv */
/* Note the cctl divide to 5 group and share the same name table. */
if (op_value < 0 || op_value > 4)
- error ("CCTL intrinsic function subtype out of range!");
+ error ("CCTL intrinsic function subtype out of range");
fprintf (stream, "%s", nds32_cctl_names[op_value + 4]);
return;
case 'U': /* cctl vawbinv */
/* Note the cctl divide to 5 group and share the same name table. */
if (op_value < 0 || op_value > 4)
- error ("CCTL intrinsic function subtype out of range!");
+ error ("CCTL intrinsic function subtype out of range");
fprintf (stream, "%s", nds32_cctl_names[op_value + 8]);
return;
case 'X': /* cctl idxread */
/* Note the cctl divide to 5 group and share the same name table. */
if (op_value < 0 || op_value > 4)
- error ("CCTL intrinsic function subtype out of range!");
+ error ("CCTL intrinsic function subtype out of range");
fprintf (stream, "%s", nds32_cctl_names[op_value + 12]);
return;
case 'W': /* cctl idxwitre */
/* Note the cctl divide to 5 group and share the same name table. */
if (op_value < 0 || op_value > 4)
- error ("CCTL intrinsic function subtype out of range!");
+ error ("CCTL intrinsic function subtype out of range");
fprintf (stream, "%s", nds32_cctl_names[op_value + 16]);
return;
@@ -3941,7 +3941,7 @@ nds32_insert_attributes (tree decl, tree *attributes)
tree new_attrs = *attributes;
if (TARGET_LINUX_ABI)
- error("cannot use indirect_call attribute under linux toolchain");
+ error ("cannot use %<indirect_call%> attribute under linux toolchain");
if (lookup_attribute ("noinline", new_attrs) == NULL)
new_attrs = tree_cons (get_identifier ("noinline"), NULL, new_attrs);
@@ -3949,7 +3949,7 @@ nds32_insert_attributes (tree decl, tree *attributes)
new_attrs = tree_cons (get_identifier ("noclone"), NULL, new_attrs);
if (!TREE_PUBLIC (decl))
- error ("indirect_call attribute can%'t apply for static function");
+ error ("%<indirect_call%> attribute cannot apply for static function");
*attributes = new_attrs;
}
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 20fd893..db6a405 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -5894,7 +5894,7 @@ nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used)
if (dims[GOMP_DIM_VECTOR] > PTX_WARP_SIZE)
{
- vector_reason = G_("using vector_length (%d) due to call to"
+ vector_reason = G_("using %<vector_length (%d)%> due to call to"
" vector-partitionable routine, ignoring %d");
dims[GOMP_DIM_VECTOR] = PTX_WARP_SIZE;
}
@@ -5902,7 +5902,7 @@ nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used)
if (dims[GOMP_DIM_VECTOR] == 0)
{
- vector_reason = G_("using vector_length (%d), ignoring runtime setting");
+ vector_reason = G_("using %<vector_length (%d)%>, ignoring runtime setting");
dims[GOMP_DIM_VECTOR] = default_vector_length;
}
@@ -5916,12 +5916,12 @@ nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used)
warning_at (decl ? DECL_SOURCE_LOCATION (decl) : UNKNOWN_LOCATION, 0,
vector_reason != NULL
? vector_reason
- : G_("using vector_length (%d), ignoring %d"),
+ : G_("using %<vector_length (%d)%>, ignoring %d"),
dims[GOMP_DIM_VECTOR], old_dims[GOMP_DIM_VECTOR]);
if (dims[GOMP_DIM_WORKER] != old_dims[GOMP_DIM_WORKER])
warning_at (decl ? DECL_SOURCE_LOCATION (decl) : UNKNOWN_LOCATION, 0,
- G_("using num_workers (%d), ignoring %d"),
+ G_("using %<num_workers (%d)%>, ignoring %d"),
dims[GOMP_DIM_WORKER], old_dims[GOMP_DIM_WORKER]);
if (oacc_default_dims_p)
diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md
index ce74672..5cf190a 100644
--- a/gcc/config/nvptx/nvptx.md
+++ b/gcc/config/nvptx/nvptx.md
@@ -1410,7 +1410,7 @@
(match_operand 3 "" "")]
""
{
- sorry ("target cannot support nonlocal goto.");
+ sorry ("target cannot support nonlocal goto");
emit_insn (gen_nop ());
DONE;
})
@@ -1419,7 +1419,7 @@
[(const_int 0)]
""
{
- sorry ("target cannot support nonlocal goto.");
+ sorry ("target cannot support nonlocal goto");
})
(define_expand "allocate_stack"
@@ -1438,7 +1438,7 @@
/* The ptx documentation specifies an alloca intrinsic (for 32 bit
only) but notes it is not implemented. The assembler emits a
confused error message. Issue a blunt one now instead. */
- sorry ("target cannot support alloca.");
+ sorry ("target cannot support alloca");
emit_insn (gen_nop ());
DONE;
})
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 7c80678..6885b4b 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -3309,8 +3309,8 @@ riscv_handle_type_attribute (tree *node ATTRIBUTE_UNUSED, tree name, tree args,
&& strcmp (string, "machine"))
{
warning (OPT_Wattributes,
- "argument to %qE attribute is not \"user\", \"supervisor\", or \"machine\"",
- name);
+ "argument to %qE attribute is not %<\"user\"%>, %<\"supervisor\"%>, "
+ "or %<\"machine\"%>", name);
*no_add_attrs = true;
}
}
diff --git a/gcc/config/rs6000/aix73.h b/gcc/config/rs6000/aix73.h
index 8baa27e..0b84790 100644
--- a/gcc/config/rs6000/aix73.h
+++ b/gcc/config/rs6000/aix73.h
@@ -34,7 +34,7 @@ do { \
{ \
rs6000_long_double_type_size = 64; \
if (OPTION_SET_P (rs6000_long_double_type_size)) \
- warning (0, "soft-float and long-double-128 are incompatible"); \
+ warning (0, "%<soft-float%> and long-double-128 are incompatible"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
{ \
diff --git a/gcc/config/rs6000/rs6000-call.cc b/gcc/config/rs6000/rs6000-call.cc
index 508f7c9..e002e1f 100644
--- a/gcc/config/rs6000/rs6000-call.cc
+++ b/gcc/config/rs6000/rs6000-call.cc
@@ -3307,7 +3307,7 @@ rs6000_invalid_builtin (enum rs6000_gen_builtins fncode)
"-mvsx");
break;
case ENB_IEEE128_HW:
- error ("%qs requires ISA 3.0 IEEE 128-bit floating point", name);
+ error ("%qs requires quad-precision floating-point arithmetic", name);
break;
case ENB_DFP:
error ("%qs requires the %qs option", name, "-mhard-dfp");
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 7a4ef5e..0882ecb 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -5935,6 +5935,34 @@ const char *rs6000_machine;
const char *
rs6000_machine_from_flags (void)
{
+ /* For some CPUs, the machine cannot be determined by ISA flags. We have to
+ check them first. */
+ switch (rs6000_cpu)
+ {
+ case PROCESSOR_PPC8540:
+ case PROCESSOR_PPC8548:
+ return "e500";
+
+ case PROCESSOR_PPCE300C2:
+ case PROCESSOR_PPCE300C3:
+ return "e300";
+
+ case PROCESSOR_PPCE500MC:
+ return "e500mc";
+
+ case PROCESSOR_PPCE500MC64:
+ return "e500mc64";
+
+ case PROCESSOR_PPCE5500:
+ return "e5500";
+
+ case PROCESSOR_PPCE6500:
+ return "e6500";
+
+ default:
+ break;
+ }
+
HOST_WIDE_INT flags = rs6000_isa_flags;
/* Disable the flags that should never influence the .machine selection. */
@@ -16345,10 +16373,10 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1)
c = GEU;
if (code == SMAX || code == UMAX)
- target = emit_conditional_move (dest, c, op0, op1, mode,
+ target = emit_conditional_move (dest, { c, op0, op1, mode },
op0, op1, mode, 0);
else
- target = emit_conditional_move (dest, c, op0, op1, mode,
+ target = emit_conditional_move (dest, { c, op0, op1, mode },
op1, op0, mode, 0);
gcc_assert (target);
if (target != dest)
@@ -22741,7 +22769,7 @@ rs6000_emit_swsqrt (rtx dst, rtx src, bool recip)
if (mode == SFmode)
{
- rtx target = emit_conditional_move (e, GT, src, zero, mode,
+ rtx target = emit_conditional_move (e, { GT, src, zero, mode },
e, zero, mode, 0);
if (target != e)
emit_move_insn (e, target);
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index a6520aa..8aa41d5 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -82,7 +82,7 @@
#define RS6000_ABI_NAME "linux"
/* Copy and paste from linux64.h and freebsd64.h */
-#define INVALID_64BIT "-m%s not supported in this configuration"
+#define INVALID_64BIT "%<-m%s%> not supported in this configuration"
/* A lot of copy and paste from linux64.h and freebsd64.h */
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
diff --git a/gcc/config/rx/rx.cc b/gcc/config/rx/rx.cc
index ba82482..7c3975e 100644
--- a/gcc/config/rx/rx.cc
+++ b/gcc/config/rx/rx.cc
@@ -2477,7 +2477,7 @@ rx_expand_builtin_mvtc (tree exp)
if (INTVAL (arg1) == 1)
{
- warning (0, "invalid control register for mvtc : %d - using 'psw'",
+ warning (0, "invalid control register for mvtc: %d - using 'psw'",
(int) INTVAL (arg1));
arg1 = const0_rtx;
}
@@ -2602,7 +2602,7 @@ valid_psw_flag (rtx op, const char *which)
error ("%<__builtin_rx_%s%> takes %<C%>, %<Z%>, %<S%>, %<O%>, %<I%>, "
"or %<U%>", which);
if (!mvtc_inform_done)
- error ("use %<__builtin_rx_mvtc%> (0, ... ) to write arbitrary values to PSW");
+ error ("use %<__builtin_rx_mvtc (0, ... )%> to write arbitrary values to PSW");
mvtc_inform_done = 1;
return 0;
diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc
index dd8bce4..8d40563 100644
--- a/gcc/config/sh/sh.cc
+++ b/gcc/config/sh/sh.cc
@@ -728,7 +728,7 @@ parse_validate_atomic_model_option (const char* str)
goto got_mode_name;
}
- err_ret ("invalid atomic model name \"%s\"", tokens.front ().c_str ());
+ err_ret ("invalid atomic model name %qs", tokens.front ().c_str ());
got_mode_name:;
}
@@ -742,11 +742,11 @@ got_mode_name:;
std::string offset_str = tokens[i].substr (strlen ("gbr-offset="));
ret.tcb_gbr_offset = integral_argument (offset_str.c_str ());
if (offset_str.empty () || ret.tcb_gbr_offset == -1)
- err_ret ("could not parse gbr-offset value \"%s\" in atomic model "
+ err_ret ("could not parse gbr-offset value %qs in atomic model "
"option", offset_str.c_str ());
}
else
- err_ret ("unknown parameter \"%s\" in atomic model option",
+ err_ret ("unknown parameter %qs in atomic model option",
tokens[i].c_str ());
}
diff --git a/gcc/config/stormy16/stormy16.cc b/gcc/config/stormy16/stormy16.cc
index 36fb97e..fabf09a 100644
--- a/gcc/config/stormy16/stormy16.cc
+++ b/gcc/config/stormy16/stormy16.cc
@@ -1212,7 +1212,7 @@ xstormy16_epilogue_uses (int regno)
void
xstormy16_function_profiler (void)
{
- sorry ("function_profiler support");
+ sorry ("%<function_profiler%> support");
}
/* Update CUM to advance past argument ARG. Once this is done,
@@ -1306,7 +1306,7 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
tree t,u;
if (xstormy16_interrupt_function_p ())
- error ("cannot use va_start in interrupt function");
+ error ("cannot use %<va_start%> in interrupt function");
f_base = TYPE_FIELDS (va_list_type_node);
f_count = DECL_CHAIN (f_base);
@@ -2256,7 +2256,7 @@ xstormy16_handle_below100_attribute (tree *node,
{
if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node)))
{
- warning (OPT_Wattributes, "__BELOW100__ attribute not allowed "
+ warning (OPT_Wattributes, "%<__BELOW100__%> attribute not allowed "
"with auto storage class");
*no_add_attrs = true;
}
diff --git a/gcc/config/v850/v850-c.cc b/gcc/config/v850/v850-c.cc
index 0ff0e8c..45a3a0d 100644
--- a/gcc/config/v850/v850-c.cc
+++ b/gcc/config/v850/v850-c.cc
@@ -64,10 +64,10 @@ static int
pop_data_area (v850_data_area data_area)
{
if (data_area_stack == NULL)
- warning (OPT_Wpragmas, "#pragma GHS endXXXX found without "
+ warning (OPT_Wpragmas, "%<#pragma%> GHS endXXXX found without "
"previous startXXX");
else if (data_area != data_area_stack->data_area)
- warning (OPT_Wpragmas, "#pragma GHS endXXX does not match "
+ warning (OPT_Wpragmas, "%<#pragma%> GHS endXXX does not match "
"previous startXXX");
else
{
@@ -150,7 +150,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
if (type == CPP_COMMA)
repeat = 1;
else if (type != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs section");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs section");
if (streq (sect, "data")) kind = GHS_SECTION_KIND_DATA;
else if (streq (sect, "text")) kind = GHS_SECTION_KIND_TEXT;
@@ -181,7 +181,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
return;
bad:
- warning (OPT_Wpragmas, "malformed #pragma ghs section");
+ warning (OPT_Wpragmas, "malformed %<#pragma%> ghs section");
return;
reset:
@@ -200,7 +200,7 @@ ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs interrupt");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs interrupt");
mark_current_function_as_interrupt ();
}
@@ -211,7 +211,7 @@ ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs starttda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs starttda");
push_data_area (DATA_AREA_TDA);
}
@@ -222,7 +222,7 @@ ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs startsda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs startsda");
push_data_area (DATA_AREA_SDA);
}
@@ -233,7 +233,7 @@ ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs startzda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs startzda");
push_data_area (DATA_AREA_ZDA);
}
@@ -244,7 +244,7 @@ ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs endtda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs endtda");
pop_data_area (DATA_AREA_TDA);
}
@@ -255,7 +255,7 @@ ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs endsda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs endsda");
pop_data_area (DATA_AREA_SDA);
}
@@ -266,7 +266,7 @@ ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma ghs endzda");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma%> ghs endzda");
pop_data_area (DATA_AREA_ZDA);
}
diff --git a/gcc/config/vms/vms-c.cc b/gcc/config/vms/vms-c.cc
index aae67d2..2f74fb5 100644
--- a/gcc/config/vms/vms-c.cc
+++ b/gcc/config/vms/vms-c.cc
@@ -41,7 +41,7 @@ vms_pragma_nostandard (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma __nostandard");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma __nostandard%>");
}
/* '#pragma __standard' is simply ignored. */
@@ -52,7 +52,7 @@ vms_pragma_standard (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree x;
if (pragma_lex (&x) != CPP_EOF)
- warning (OPT_Wpragmas, "junk at end of #pragma __standard");
+ warning (OPT_Wpragmas, "junk at end of %<#pragma __standard%>");
}
/* Saved member alignment. */
@@ -271,13 +271,13 @@ vms_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
pragma_extern_prefix = saved_extern_prefix;
else
warning (OPT_Wpragmas,
- "malformed '#pragma __extern_prefix', ignoring");
+ "malformed %<#pragma __extern_prefix%>, ignoring");
return;
}
else if (tok != CPP_STRING)
{
warning (OPT_Wpragmas,
- "malformed '#pragma __extern_prefix', ignoring");
+ "malformed %<#pragma __extern_prefix%>, ignoring");
}
else
{
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index 198bd3c..7023bad 100644
--- a/gcc/config/xtensa/xtensa.cc
+++ b/gcc/config/xtensa/xtensa.cc
@@ -2392,7 +2392,7 @@ void
print_operand (FILE *file, rtx x, int letter)
{
if (!x)
- error ("PRINT_OPERAND null pointer");
+ error ("%<PRINT_OPERAND%> null pointer");
switch (letter)
{
@@ -2549,7 +2549,7 @@ void
print_operand_address (FILE *file, rtx addr)
{
if (!addr)
- error ("PRINT_OPERAND_ADDRESS, null pointer");
+ error ("%<PRINT_OPERAND_ADDRESS%>, null pointer");
switch (GET_CODE (addr))
{
@@ -3662,7 +3662,7 @@ xtensa_multibss_section_type_flags (tree decl, const char *name, int reloc)
flags |= SECTION_BSS; /* @nobits */
else
warning (0, "only uninitialized variables can be placed in a "
- ".bss section");
+ "%<.bss%> section");
}
return flags;
diff --git a/gcc/configure b/gcc/configure
index fd72270..3b228c3 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -7089,7 +7089,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
loose_warn=
save_CXXFLAGS="$CXXFLAGS"
-for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag $wf_opt; do
+for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt; do
# Do the check with the no- prefix removed since gcc silently
# accepts any -Wno-* option on purpose
case $real_option in
@@ -7147,7 +7147,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
c_loose_warn=
save_CFLAGS="$CFLAGS"
-for real_option in -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag; do
+for real_option in -Wstrict-prototypes -Wmissing-prototypes ; do
# Do the check with the no- prefix removed since gcc silently
# accepts any -Wno-* option on purpose
case $real_option in
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 40cfd38..472d1c8 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -573,11 +573,11 @@ AS_IF([test $enable_build_format_warnings = no],
[wf_opt=-Wno-format],[wf_opt=])
ACX_PROG_CXX_WARNING_OPTS(
m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ],
- [-Wcast-qual -Wno-error=format-diag $wf_opt])),
+ [-Wcast-qual $wf_opt])),
[loose_warn])
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes ],
- [-Wno-error=format-diag])), [c_loose_warn])
+ [])), [c_loose_warn])
ACX_PROG_CXX_WARNING_OPTS(
m4_quote(m4_do([-Wmissing-format-attribute ],
[-Woverloaded-virtual])), [strict_warn])
diff --git a/gcc/convert.cc b/gcc/convert.cc
index 02997d3..25cc3ff 100644
--- a/gcc/convert.cc
+++ b/gcc/convert.cc
@@ -1199,7 +1199,7 @@ test_convert_to_integer_maybe_fold ()
/* Run all of the selftests within this file. */
void
-convert_c_tests ()
+convert_cc_tests ()
{
test_convert_to_integer_maybe_fold ();
}
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0debb08..e366eed 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,43 @@
+2022-01-19 David Malcolm <dmalcolm@redhat.com>
+
+ * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
+ renaming.
+ * cp-tree.h (cp_pt_c_tests): Rename to...
+ (cp_pt_cc_tests): ...this.
+ (cp_tree_c_tests): Rename to...
+ (cp_tree_cc_tests): ...this.
+ * pt.cc (cp_pt_c_tests): Rename to...
+ (cp_pt_cc_tests): ...this.
+ * tree.cc (cp_tree_c_tests): Rename to...
+ (cp_tree_cc_tests): ...this.
+
+2022-01-19 Jason Merrill <jason@redhat.com>
+
+ * parser.cc (saved_token_sentinel::rollback): Use
+ cp_lexer_previous_token.
+
+2022-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/104055
+ * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
+ TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
+ than get_target_expr_sfinae with tf_no_cleanup, and don't set
+ TREE_CONSTANT.
+
+2022-01-18 Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/104025
+ * parser.cc (saved_token_sentinel::rollback): Call
+ cp_lexer_set_source_position.
+ (~saved_token_sentinel): Call rollback.
+
+2022-01-18 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/104074
+ * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
+ that we return false for DEPENDENT_OPERATOR_TYPE too.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* Make-lang.in: Rename .c names to .cc.
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index f73496f..dcc1674 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -7821,7 +7821,11 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
if (TREE_CODE (t) == TARGET_EXPR
&& TARGET_EXPR_INITIAL (t) == r)
return t;
- else if (TREE_CODE (t) != CONSTRUCTOR)
+ else if (TREE_CODE (t) == CONSTRUCTOR)
+ ;
+ else if (TREE_CODE (t) == TARGET_EXPR && TARGET_EXPR_CLEANUP (t))
+ r = get_target_expr (r);
+ else
{
r = get_target_expr_sfinae (r, tf_warning_or_error | tf_no_cleanup);
TREE_CONSTANT (r) = true;
diff --git a/gcc/cp/cp-lang.cc b/gcc/cp/cp-lang.cc
index 7861f93..7c8b947 100644
--- a/gcc/cp/cp-lang.cc
+++ b/gcc/cp/cp-lang.cc
@@ -278,8 +278,8 @@ run_cp_tests (void)
c_family_tests ();
/* Additional C++-specific tests. */
- cp_pt_c_tests ();
- cp_tree_c_tests ();
+ cp_pt_cc_tests ();
+ cp_tree_cc_tests ();
}
} // namespace selftest
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index e428df0..186c544 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -8641,8 +8641,8 @@ namespace selftest {
/* Declarations for specific families of tests within cp,
by source file, in alphabetical order. */
- extern void cp_pt_c_tests ();
- extern void cp_tree_c_tests (void);
+ extern void cp_pt_cc_tests ();
+ extern void cp_tree_cc_tests (void);
} // namespace selftest
#endif /* #if CHECKING_P */
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index 1ab0c25..e76842e 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -768,6 +768,14 @@ class_key_or_enum_as_string (tree t)
return "struct";
}
+/* Disable warnings about missing quoting in GCC diagnostics for
+ the pp_verbatim call. Their format strings deliberately don't
+ follow GCC diagnostic conventions. */
+#if __GNUC__ >= 10
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
/* Print out a class declaration T under the control of FLAGS,
in the form `class foo'. */
@@ -851,6 +859,10 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
flags & ~TFF_TEMPLATE_HEADER);
}
+#if __GNUC__ >= 10
+#pragma GCC diagnostic pop
+#endif
+
/* Dump into the obstack the initial part of the output for a given type.
This is necessary when dealing with things like functions returning
functions. Examples:
@@ -3618,8 +3630,8 @@ function_category (tree fn)
the pp_verbatim calls. Their format strings deliberately don't
follow GCC diagnostic conventions. */
#if __GNUC__ >= 10
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wformat-diag"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
#endif
/* Report the full context of a current template instantiation,
@@ -4230,7 +4242,7 @@ add_quotes (const char *content, bool show_color)
}
#if __GNUC__ >= 10
-# pragma GCC diagnostic pop
+#pragma GCC diagnostic pop
#endif
/* If we had %H and %I, and hence deferred printing them,
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index b262b76..ed219d7 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -1308,6 +1308,8 @@ struct saved_token_sentinel
void rollback ()
{
cp_lexer_rollback_tokens (lexer);
+ cp_lexer_set_source_position_from_token
+ (cp_lexer_previous_token (lexer));
mode = STS_DONOTHING;
}
~saved_token_sentinel ()
@@ -1315,7 +1317,7 @@ struct saved_token_sentinel
if (mode == STS_COMMIT)
cp_lexer_commit_tokens (lexer);
else if (mode == STS_ROLLBACK)
- cp_lexer_rollback_tokens (lexer);
+ rollback ();
gcc_assert (lexer->saved_tokens.length () == len);
}
@@ -18572,7 +18574,7 @@ cp_parser_template_name (cp_parser* parser,
: parser->context->object_type);
if (scope && TYPE_P (scope)
&& (!CLASS_TYPE_P (scope)
- || (check_dependency_p && dependent_type_p (scope))))
+ || (check_dependency_p && dependent_scope_p (scope))))
{
/* We're optimizing away the call to cp_parser_lookup_name, but
we still need to do this. */
@@ -18665,9 +18667,9 @@ cp_parser_template_name (cp_parser* parser,
found = true;
}
- /* "in a type-only context" */
+ /* "that follows the keyword template"..."in a type-only context" */
if (!found && scope
- && tag_type != none_type
+ && (template_keyword_p || tag_type != none_type)
&& dependentish_scope_p (scope)
&& cp_parser_nth_token_starts_template_argument_list_p (parser, 1))
found = true;
@@ -18678,7 +18680,7 @@ cp_parser_template_name (cp_parser* parser,
cp_parser_error (parser, "expected template-name");
return error_mark_node;
}
- else if (decl == error_mark_node)
+ else if (!DECL_P (decl) && !is_overloaded_fn (decl))
/* Repeat the lookup at instantiation time. */
decl = identifier;
}
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 4a2b33e..60bc35a 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -26931,16 +26931,14 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
}
return false;
}
- else if (TREE_CODE (type) == TYPENAME_TYPE)
- return false;
- else if (TREE_CODE (type) == DECLTYPE_TYPE)
- return false;
else if (TREE_CODE (type) == NULLPTR_TYPE)
return false;
- /* A bound template template parm could later be instantiated to have a valid
- nontype parm type via an alias template. */
- else if (cxx_dialect >= cxx11
- && TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ else if (TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM
+ && cxx_dialect < cxx11)
+ /* Fall through; before C++11 alias templates, a bound ttp
+ always instantiates into a class type. */;
+ else if (WILDCARD_TYPE_P (type))
+ /* Any other wildcard type not already handled above is allowed. */
return false;
else if (TREE_CODE (type) == COMPLEX_TYPE)
/* Fall through. */;
@@ -30583,7 +30581,7 @@ test_type_dependent_expression_p ()
/* Run all of the selftests within this file. */
void
-cp_pt_c_tests ()
+cp_pt_cc_tests ()
{
test_build_non_dependent_expr ();
test_type_dependent_expression_p ();
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index d27f64f..bcd44e7 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -6167,7 +6167,7 @@ test_lvalue_kind ()
/* Run all of the selftests within this file. */
void
-cp_tree_c_tests ()
+cp_tree_cc_tests ()
{
test_lvalue_kind ();
}
diff --git a/gcc/dbgcnt.cc b/gcc/dbgcnt.cc
index 5dd00d6..11a8171 100644
--- a/gcc/dbgcnt.cc
+++ b/gcc/dbgcnt.cc
@@ -272,7 +272,7 @@ test_sorted_dbg_counters ()
}
void
-dbgcnt_c_tests ()
+dbgcnt_cc_tests ()
{
test_sorted_dbg_counters ();
}
diff --git a/gcc/diagnostic-show-locus.cc b/gcc/diagnostic-show-locus.cc
index 04657883..6eafe19 100644
--- a/gcc/diagnostic-show-locus.cc
+++ b/gcc/diagnostic-show-locus.cc
@@ -5658,7 +5658,7 @@ test_line_numbers_multiline_range ()
/* Run all of the selftests within this file. */
void
-diagnostic_show_locus_c_tests ()
+diagnostic_show_locus_cc_tests ()
{
test_line_span ();
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 97e2e2c..f5f43d5 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -2466,7 +2466,7 @@ test_num_digits ()
/* Run all of the selftests within this file. */
void
-diagnostic_c_tests ()
+diagnostic_cc_tests ()
{
test_print_escaped_string ();
test_print_parseable_fixits_none ();
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 65051ff..810d618 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -775,6 +775,8 @@ Objective-C and Objective-C++ Dialects}.
-mtp=@var{name} -mtls-dialect=@var{dialect} @gol
-mword-relocations @gol
-mfix-cortex-m3-ldrd @gol
+-mfix-cortex-a57-aes-1742098 @gol
+-mfix-cortex-a72-aes-1655431 @gol
-munaligned-access @gol
-mneon-for-64bits @gol
-mslow-flash-data @gol
@@ -15051,6 +15053,9 @@ per supernode, before terminating analysis.
Maximum depth of logical expression evaluation ranger will look through
when evaluating outgoing edge ranges.
+@item relation-block-limit
+Maximum number of relations the oracle will register in a basic block.
+
@item openacc-kernels
Specify mode of OpenACC `kernels' constructs handling.
With @option{--param=openacc-kernels=decompose}, OpenACC `kernels'
@@ -21237,6 +21242,15 @@ with overlapping destination and base registers are used. This option avoids
generating these instructions. This option is enabled by default when
@option{-mcpu=cortex-m3} is specified.
+@item -mfix-cortex-a57-aes-1742098
+@itemx -mno-fix-cortex-a57-aes-1742098
+@itemx -mfix-cortex-a72-aes-1655431
+@itemx -mno-fix-cortex-a72-aes-1655431
+Enable (disable) mitigation for an erratum on Cortex-A57 and
+Cortex-A72 that affects the AES cryptographic instructions. This
+option is enabled by default when either @option{-mcpu=cortex-a57} or
+@option{-mcpu=cortex-a72} is specified.
+
@item -munaligned-access
@itemx -mno-unaligned-access
@opindex munaligned-access
diff --git a/gcc/dumpfile.cc b/gcc/dumpfile.cc
index 44ee66f..ac79aa0 100644
--- a/gcc/dumpfile.cc
+++ b/gcc/dumpfile.cc
@@ -2766,7 +2766,7 @@ test_pr87025 ()
/* Run all of the selftests within this file. */
void
-dumpfile_c_tests ()
+dumpfile_cc_tests ()
{
test_impl_location ();
for_each_line_table_case (test_capture_of_dump_calls);
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 62b468d..a5a7f63 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -12094,9 +12094,10 @@ index_rnglists (void)
if (r->label && r->idx != DW_RANGES_IDX_SKELETON)
r->idx = rnglist_idx++;
- if (!have_multiple_function_sections)
- continue;
int block_num = r->num;
+ if ((HAVE_AS_LEB128 || block_num < 0)
+ && !have_multiple_function_sections)
+ continue;
if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec))
base = false;
if (block_num > 0)
@@ -33058,7 +33059,7 @@ dwarf2out_early_finish (const char *filename)
within the same process. For use by toplev::finalize. */
void
-dwarf2out_c_finalize (void)
+dwarf2out_cc_finalize (void)
{
last_var_location_insn = NULL;
cached_next_real_insn = NULL;
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index ab2200b..656ef94 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -419,7 +419,7 @@ struct fixed_point_type_info
} scale_factor;
};
-void dwarf2out_c_finalize (void);
+void dwarf2out_cc_finalize (void);
/* Some DWARF internals are exposed for the needs of DWARF-based debug
formats. */
diff --git a/gcc/edit-context.cc b/gcc/edit-context.cc
index 92715f6..6879ddd 100644
--- a/gcc/edit-context.cc
+++ b/gcc/edit-context.cc
@@ -1788,7 +1788,7 @@ test_applying_fixits_column_validation (const line_table_case &case_)
/* Run all of the selftests within this file. */
void
-edit_context_c_tests ()
+edit_context_cc_tests ()
{
test_get_content ();
for_each_line_table_case (test_applying_fixits_insert_before);
diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 079e563..a26bcb0 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -3997,7 +3997,7 @@ make_insn_raw (rtx pattern)
|| (GET_CODE (insn) == SET
&& SET_DEST (insn) == pc_rtx)))
{
- warning (0, "ICE: emit_insn used where emit_jump_insn needed:\n");
+ warning (0, "ICE: %<emit_insn%> used where %<emit_jump_insn%> needed:");
debug_rtx (insn);
}
#endif
@@ -6097,6 +6097,13 @@ init_emit_regs (void)
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
+ /* Process stack-limiting command-line options. */
+ if (opt_fstack_limit_symbol_arg != NULL)
+ stack_limit_rtx
+ = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt_fstack_limit_symbol_arg));
+ if (opt_fstack_limit_register_no >= 0)
+ stack_limit_rtx = gen_rtx_REG (Pmode, opt_fstack_limit_register_no);
+
for (i = 0; i < (int) MAX_MACHINE_MODE; i++)
{
mode = (machine_mode) i;
@@ -6177,13 +6184,6 @@ init_emit_once (void)
/* Create the unique rtx's for certain rtx codes and operand values. */
- /* Process stack-limiting command-line options. */
- if (opt_fstack_limit_symbol_arg != NULL)
- stack_limit_rtx
- = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt_fstack_limit_symbol_arg));
- if (opt_fstack_limit_register_no >= 0)
- stack_limit_rtx = gen_rtx_REG (Pmode, opt_fstack_limit_register_no);
-
/* Don't use gen_rtx_CONST_INT here since gen_rtx_CONST_INT in this case
tries to use these variables. */
for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++)
diff --git a/gcc/et-forest.cc b/gcc/et-forest.cc
index a1b1f57..ebdcccb 100644
--- a/gcc/et-forest.cc
+++ b/gcc/et-forest.cc
@@ -872,7 +872,7 @@ test_disconnected_nodes ()
/* Run all of the selftests within this file. */
void
-et_forest_c_tests ()
+et_forest_cc_tests ()
{
test_single_node ();
test_simple_tree ();
diff --git a/gcc/expmed.cc b/gcc/expmed.cc
index 7150058..80a16ce 100644
--- a/gcc/expmed.cc
+++ b/gcc/expmed.cc
@@ -4124,8 +4124,8 @@ expand_sdiv_pow2 (scalar_int_mode mode, rtx op0, HOST_WIDE_INT d)
temp = force_reg (mode, temp);
/* Construct "temp2 = (temp2 < 0) ? temp : temp2". */
- temp2 = emit_conditional_move (temp2, LT, temp2, const0_rtx,
- mode, temp, temp2, mode, 0);
+ temp2 = emit_conditional_move (temp2, { LT, temp2, const0_rtx, mode },
+ temp, temp2, mode, 0);
if (temp2)
{
rtx_insn *seq = get_insns ();
@@ -6127,10 +6127,10 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
return 0;
if (and_them)
- tem = emit_conditional_move (target, code, op0, op1, mode,
+ tem = emit_conditional_move (target, { code, op0, op1, mode },
tem, const0_rtx, GET_MODE (tem), 0);
else
- tem = emit_conditional_move (target, code, op0, op1, mode,
+ tem = emit_conditional_move (target, { code, op0, op1, mode },
trueval, tem, GET_MODE (tem), 0);
if (tem == 0)
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 4324b18..35e4029 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -8824,8 +8824,9 @@ expand_cond_expr_using_cmove (tree treeop0 ATTRIBUTE_UNUSED,
op2 = gen_lowpart (mode, op2);
/* Try to emit the conditional move. */
- insn = emit_conditional_move (temp, comparison_code,
- op00, op01, comparison_mode,
+ insn = emit_conditional_move (temp,
+ { comparison_code, op00, op01,
+ comparison_mode },
op1, op2, mode,
unsignedp);
@@ -9716,8 +9717,9 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
start_sequence ();
/* Try to emit the conditional move. */
- insn = emit_conditional_move (target, comparison_code,
- op0, cmpop1, mode,
+ insn = emit_conditional_move (target,
+ { comparison_code,
+ op0, cmpop1, mode },
op0, op1, mode,
unsignedp);
diff --git a/gcc/fibonacci_heap.cc b/gcc/fibonacci_heap.cc
index 9911757..f4b52d6 100644
--- a/gcc/fibonacci_heap.cc
+++ b/gcc/fibonacci_heap.cc
@@ -279,7 +279,7 @@ test_struct_key ()
/* Run all of the selftests within this file. */
void
-fibonacci_heap_c_tests ()
+fibonacci_heap_cc_tests ()
{
test_empty_heap ();
test_basic_heap_operations ();
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index ff6a749..fd9c635 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -16587,6 +16587,15 @@ address_compare (tree_code code, tree type, tree op0, tree op1,
|| TREE_CODE (base1) == SSA_NAME
|| TREE_CODE (base1) == STRING_CST))
equal = (base0 == base1);
+ /* Assume different STRING_CSTs with the same content will be
+ merged. */
+ if (equal == 0
+ && TREE_CODE (base0) == STRING_CST
+ && TREE_CODE (base1) == STRING_CST
+ && TREE_STRING_LENGTH (base0) == TREE_STRING_LENGTH (base1)
+ && memcmp (TREE_STRING_POINTER (base0), TREE_STRING_POINTER (base1),
+ TREE_STRING_LENGTH (base0)) == 0)
+ equal = 1;
if (equal == 1)
{
if (code == EQ_EXPR
@@ -16775,7 +16784,7 @@ test_vec_duplicate_folding ()
/* Run all of the selftests within this file. */
void
-fold_const_c_tests ()
+fold_const_cc_tests ()
{
test_arithmetic_folding ();
test_vector_folding ();
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0e8d6d8..e044230 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2022-01-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103692
+ * array.cc (gfc_expand_constructor): Handle zero-sized array
+ constructors.
+
2022-01-17 Martin Liska <mliska@suse.cz>
* check.cc (gfc_check_all_any): Rename .c names to .cc.
diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc
index 4723043..f1d92e0 100644
--- a/gcc/fortran/array.cc
+++ b/gcc/fortran/array.cc
@@ -1883,6 +1883,9 @@ gfc_expand_constructor (gfc_expr *e, bool fatal)
gfc_expr *f;
bool rc;
+ if (gfc_is_size_zero_array (e))
+ return true;
+
/* If we can successfully get an array element at the max array size then
the array is too big to expand, so we just return. */
f = gfc_get_array_element (e, flag_max_array_constructor);
diff --git a/gcc/function-tests.cc b/gcc/function-tests.cc
index a6ecfdf..7d77615 100644
--- a/gcc/function-tests.cc
+++ b/gcc/function-tests.cc
@@ -687,7 +687,7 @@ test_expansion_to_rtl ()
/* Run all of the selftests within this file. */
void
-function_tests_c_tests ()
+function_tests_cc_tests ()
{
test_fndecl_int_void ();
test_fndecl_float_intchar ();
diff --git a/gcc/gcse.cc b/gcc/gcse.cc
index 1e3113d..b673531 100644
--- a/gcc/gcse.cc
+++ b/gcc/gcse.cc
@@ -4128,7 +4128,7 @@ make_pass_rtl_hoist (gcc::context *ctxt)
within the same process. For use by toplev::finalize. */
void
-gcse_c_finalize (void)
+gcse_cc_finalize (void)
{
test_insn = NULL;
}
diff --git a/gcc/gcse.h b/gcc/gcse.h
index ba5ee56..4a201f3 100644
--- a/gcc/gcse.h
+++ b/gcc/gcse.h
@@ -39,7 +39,7 @@ extern struct target_gcse *this_target_gcse;
#define this_target_gcse (&default_target_gcse)
#endif
-void gcse_c_finalize (void);
+void gcse_cc_finalize (void);
extern bool gcse_or_cprop_is_too_expensive (const char *);
#endif
diff --git a/gcc/ggc-tests.cc b/gcc/ggc-tests.cc
index cc5f913..6209894 100644
--- a/gcc/ggc-tests.cc
+++ b/gcc/ggc-tests.cc
@@ -462,7 +462,7 @@ namespace selftest {
/* Run all of the selftests within this file. */
void
-ggc_tests_c_tests ()
+ggc_tests_cc_tests ()
{
test_basic_struct ();
test_length ();
diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc
index 0571cf7..eb70d90 100644
--- a/gcc/gimple-ssa-store-merging.cc
+++ b/gcc/gimple-ssa-store-merging.cc
@@ -5633,7 +5633,7 @@ verify_clear_bit_region_be (void)
/* Run all of the selftests within this file. */
void
-store_merging_c_tests (void)
+store_merging_cc_tests (void)
{
verify_shift_bytes_in_array_left ();
verify_shift_bytes_in_array_right ();
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index f639807..c36cd5d 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -4082,7 +4082,9 @@ pointers_related_p (gimple *stmt, tree p, tree q, pointer_query &qry)
access_ref pref, qref;
if (!qry.get_ref (p, stmt, &pref, 0)
|| !qry.get_ref (q, stmt, &qref, 0))
- return true;
+ /* GET_REF() only rarely fails. When it does, it's likely because
+ it involves a self-referential PHI. Return a conservative result. */
+ return false;
return pref.ref == qref.ref;
}
@@ -4232,6 +4234,11 @@ pass_waccess::check_call (gcall *stmt)
if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
check_builtin (stmt);
+ /* .ASAN_MARK doesn't access any vars, only modifies shadow memory. */
+ if (gimple_call_internal_p (stmt)
+ && gimple_call_internal_fn (stmt) == IFN_ASAN_MARK)
+ return;
+
if (!m_early_checks_p)
if (tree callee = gimple_call_fndecl (stmt))
{
diff --git a/gcc/gimple.cc b/gcc/gimple.cc
index 4c02df5..5559e56 100644
--- a/gcc/gimple.cc
+++ b/gcc/gimple.cc
@@ -3510,7 +3510,7 @@ test_return_without_value ()
/* Run all of the selftests within this file. */
void
-gimple_c_tests ()
+gimple_cc_tests ()
{
test_assign_single ();
test_assign_binop ();
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index ab9874a..bf2f60c 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -6885,6 +6885,7 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, gimple_seq *pre_p,
cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
gimplify_stmt (&cleanup, &cleanup_stmts);
wce = gimple_build_wce (cleanup_stmts);
+ gimple_wce_set_cleanup_eh_only (wce, eh_only);
gimplify_seq_add_stmt (&gimplify_ctxp->conditional_cleanups, ffalse);
gimplify_seq_add_stmt (&gimplify_ctxp->conditional_cleanups, wce);
diff --git a/gcc/hash-map-tests.cc b/gcc/hash-map-tests.cc
index eea661a..c7d3dda 100644
--- a/gcc/hash-map-tests.cc
+++ b/gcc/hash-map-tests.cc
@@ -467,7 +467,7 @@ test_nonzero_empty_key ()
/* Run all of the selftests within this file. */
void
-hash_map_tests_c_tests ()
+hash_map_tests_cc_tests ()
{
test_map_of_strings_to_int ();
test_map_of_int_to_strings ();
diff --git a/gcc/hash-set-tests.cc b/gcc/hash-set-tests.cc
index 6cab17a..de5c0e7 100644
--- a/gcc/hash-set-tests.cc
+++ b/gcc/hash-set-tests.cc
@@ -293,7 +293,7 @@ test_set_of_type_with_ctor_and_dtor ()
/* Run all of the selftests within this file. */
void
-hash_set_tests_c_tests ()
+hash_set_tests_cc_tests ()
{
test_set_of_strings ();
test_set_of_type_with_ctor_and_dtor ();
diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
index f40faf8..fe250d5 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -83,7 +83,7 @@ static rtx_insn *last_active_insn (basic_block, int);
static rtx_insn *find_active_insn_before (basic_block, rtx_insn *);
static rtx_insn *find_active_insn_after (basic_block, rtx_insn *);
static basic_block block_fallthru (basic_block);
-static rtx cond_exec_get_condition (rtx_insn *);
+static rtx cond_exec_get_condition (rtx_insn *, bool);
static rtx noce_get_condition (rtx_insn *, rtx_insn **, bool);
static int noce_operand_ok (const_rtx);
static void merge_if_block (ce_if_block *);
@@ -98,6 +98,14 @@ static int dead_or_predicable (basic_block, basic_block, basic_block,
edge, int);
static void noce_emit_move_insn (rtx, rtx);
static rtx_insn *block_has_only_trap (basic_block);
+static void need_cmov_or_rewire (basic_block, hash_set<rtx_insn *> *,
+ hash_map<rtx_insn *, int> *);
+static bool noce_convert_multiple_sets_1 (struct noce_if_info *,
+ hash_set<rtx_insn *> *,
+ hash_map<rtx_insn *, int> *,
+ auto_vec<rtx> *,
+ auto_vec<rtx> *,
+ auto_vec<rtx_insn *> *, int *);
/* Count the number of non-jump active insns in BB. */
@@ -425,7 +433,7 @@ cond_exec_process_insns (ce_if_block *ce_info ATTRIBUTE_UNUSED,
/* Return the condition for a jump. Do not do any special processing. */
static rtx
-cond_exec_get_condition (rtx_insn *jump)
+cond_exec_get_condition (rtx_insn *jump, bool get_reversed = false)
{
rtx test_if, cond;
@@ -437,8 +445,10 @@ cond_exec_get_condition (rtx_insn *jump)
/* If this branches to JUMP_LABEL when the condition is false,
reverse the condition. */
- if (GET_CODE (XEXP (test_if, 2)) == LABEL_REF
- && label_ref_label (XEXP (test_if, 2)) == JUMP_LABEL (jump))
+ if (get_reversed
+ || (GET_CODE (XEXP (test_if, 2)) == LABEL_REF
+ && label_ref_label (XEXP (test_if, 2))
+ == JUMP_LABEL (jump)))
{
enum rtx_code rev = reversed_comparison_code (cond, jump);
if (rev == UNKNOWN)
@@ -770,7 +780,7 @@ static int noce_try_addcc (struct noce_if_info *);
static int noce_try_store_flag_constants (struct noce_if_info *);
static int noce_try_store_flag_mask (struct noce_if_info *);
static rtx noce_emit_cmove (struct noce_if_info *, rtx, enum rtx_code, rtx,
- rtx, rtx, rtx);
+ rtx, rtx, rtx, rtx = NULL, rtx = NULL);
static int noce_try_cmove (struct noce_if_info *);
static int noce_try_cmove_arith (struct noce_if_info *);
static rtx noce_get_alt_condition (struct noce_if_info *, rtx, rtx_insn **);
@@ -1709,7 +1719,8 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
static rtx
noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
- rtx cmp_a, rtx cmp_b, rtx vfalse, rtx vtrue)
+ rtx cmp_a, rtx cmp_b, rtx vfalse, rtx vtrue, rtx cc_cmp,
+ rtx rev_cc_cmp)
{
rtx target ATTRIBUTE_UNUSED;
int unsignedp ATTRIBUTE_UNUSED;
@@ -1741,23 +1752,30 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
end_sequence ();
}
- /* Don't even try if the comparison operands are weird
- except that the target supports cbranchcc4. */
- if (! general_operand (cmp_a, GET_MODE (cmp_a))
- || ! general_operand (cmp_b, GET_MODE (cmp_b)))
- {
- if (!have_cbranchcc4
- || GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC
- || cmp_b != const0_rtx)
- return NULL_RTX;
- }
-
unsignedp = (code == LTU || code == GEU
|| code == LEU || code == GTU);
- target = emit_conditional_move (x, code, cmp_a, cmp_b, VOIDmode,
- vtrue, vfalse, GET_MODE (x),
- unsignedp);
+ if (cc_cmp != NULL_RTX && rev_cc_cmp != NULL_RTX)
+ target = emit_conditional_move (x, cc_cmp, rev_cc_cmp,
+ vtrue, vfalse, GET_MODE (x));
+ else
+ {
+ /* Don't even try if the comparison operands are weird
+ except that the target supports cbranchcc4. */
+ if (! general_operand (cmp_a, GET_MODE (cmp_a))
+ || ! general_operand (cmp_b, GET_MODE (cmp_b)))
+ {
+ if (!have_cbranchcc4
+ || GET_MODE_CLASS (GET_MODE (cmp_a)) != MODE_CC
+ || cmp_b != const0_rtx)
+ return NULL_RTX;
+ }
+
+ target = emit_conditional_move (x, { code, cmp_a, cmp_b, VOIDmode },
+ vtrue, vfalse, GET_MODE (x),
+ unsignedp);
+ }
+
if (target)
return target;
@@ -1793,8 +1811,9 @@ noce_emit_cmove (struct noce_if_info *if_info, rtx x, enum rtx_code code,
promoted_target = gen_reg_rtx (GET_MODE (reg_vtrue));
- target = emit_conditional_move (promoted_target, code, cmp_a, cmp_b,
- VOIDmode, reg_vtrue, reg_vfalse,
+ target = emit_conditional_move (promoted_target,
+ { code, cmp_a, cmp_b, VOIDmode },
+ reg_vtrue, reg_vfalse,
GET_MODE (reg_vtrue), unsignedp);
/* Nope, couldn't do it in that mode either. */
if (!target)
@@ -3141,6 +3160,50 @@ bb_valid_for_noce_process_p (basic_block test_bb, rtx cond,
return false;
}
+/* Helper function to emit a cmov sequence encapsulated in
+ start_sequence () and end_sequence (). If NEED_CMOV is true
+ we call noce_emit_cmove to create a cmove sequence. Otherwise emit
+ a simple move. If successful, store the first instruction of the
+ sequence in TEMP_DEST and the sequence costs in SEQ_COST. */
+
+static rtx_insn*
+try_emit_cmove_seq (struct noce_if_info *if_info, rtx temp,
+ rtx cond, rtx new_val, rtx old_val, bool need_cmov,
+ unsigned *cost, rtx *temp_dest,
+ rtx cc_cmp = NULL, rtx rev_cc_cmp = NULL)
+{
+ rtx_insn *seq = NULL;
+ *cost = 0;
+
+ rtx x = XEXP (cond, 0);
+ rtx y = XEXP (cond, 1);
+ rtx_code cond_code = GET_CODE (cond);
+
+ start_sequence ();
+
+ if (need_cmov)
+ *temp_dest = noce_emit_cmove (if_info, temp, cond_code,
+ x, y, new_val, old_val, cc_cmp, rev_cc_cmp);
+ else
+ {
+ *temp_dest = temp;
+ if (if_info->then_else_reversed)
+ noce_emit_move_insn (temp, old_val);
+ else
+ noce_emit_move_insn (temp, new_val);
+ }
+
+ if (*temp_dest != NULL_RTX)
+ {
+ seq = get_insns ();
+ *cost = seq_cost (seq, if_info->speed_p);
+ }
+
+ end_sequence ();
+
+ return seq;
+}
+
/* We have something like:
if (x > y)
@@ -3198,7 +3261,6 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
rtx cond = noce_get_condition (jump, &cond_earliest, false);
rtx x = XEXP (cond, 0);
rtx y = XEXP (cond, 1);
- rtx_code cond_code = GET_CODE (cond);
/* The true targets for a conditional move. */
auto_vec<rtx> targets;
@@ -3207,97 +3269,37 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
auto_vec<rtx> temporaries;
/* The insns we've emitted. */
auto_vec<rtx_insn *> unmodified_insns;
- int count = 0;
-
- FOR_BB_INSNS (then_bb, insn)
- {
- /* Skip over non-insns. */
- if (!active_insn_p (insn))
- continue;
-
- rtx set = single_set (insn);
- gcc_checking_assert (set);
- rtx target = SET_DEST (set);
- rtx temp = gen_reg_rtx (GET_MODE (target));
- rtx new_val = SET_SRC (set);
- rtx old_val = target;
+ hash_set<rtx_insn *> need_no_cmov;
+ hash_map<rtx_insn *, int> rewired_src;
- /* If we were supposed to read from an earlier write in this block,
- we've changed the register allocation. Rewire the read. While
- we are looking, also try to catch a swap idiom. */
- for (int i = count - 1; i >= 0; --i)
- if (reg_overlap_mentioned_p (new_val, targets[i]))
- {
- /* Catch a "swap" style idiom. */
- if (find_reg_note (insn, REG_DEAD, new_val) != NULL_RTX)
- /* The write to targets[i] is only live until the read
- here. As the condition codes match, we can propagate
- the set to here. */
- new_val = SET_SRC (single_set (unmodified_insns[i]));
- else
- new_val = temporaries[i];
- break;
- }
-
- /* If we had a non-canonical conditional jump (i.e. one where
- the fallthrough is to the "else" case) we need to reverse
- the conditional select. */
- if (if_info->then_else_reversed)
- std::swap (old_val, new_val);
+ need_cmov_or_rewire (then_bb, &need_no_cmov, &rewired_src);
+ int last_needs_comparison = -1;
- /* We allow simple lowpart register subreg SET sources in
- bb_ok_for_noce_convert_multiple_sets. Be careful when processing
- sequences like:
- (set (reg:SI r1) (reg:SI r2))
- (set (reg:HI r3) (subreg:HI (r1)))
- For the second insn new_val or old_val (r1 in this example) will be
- taken from the temporaries and have the wider mode which will not
- match with the mode of the other source of the conditional move, so
- we'll end up trying to emit r4:HI = cond ? (r1:SI) : (r3:HI).
- Wrap the two cmove operands into subregs if appropriate to prevent
- that. */
- if (GET_MODE (new_val) != GET_MODE (temp))
- {
- machine_mode src_mode = GET_MODE (new_val);
- machine_mode dst_mode = GET_MODE (temp);
- if (!partial_subreg_p (dst_mode, src_mode))
- {
- end_sequence ();
- return FALSE;
- }
- new_val = lowpart_subreg (dst_mode, new_val, src_mode);
- }
- if (GET_MODE (old_val) != GET_MODE (temp))
- {
- machine_mode src_mode = GET_MODE (old_val);
- machine_mode dst_mode = GET_MODE (temp);
- if (!partial_subreg_p (dst_mode, src_mode))
- {
- end_sequence ();
- return FALSE;
- }
- old_val = lowpart_subreg (dst_mode, old_val, src_mode);
- }
-
- /* Actually emit the conditional move. */
- rtx temp_dest = noce_emit_cmove (if_info, temp, cond_code,
- x, y, new_val, old_val);
-
- /* If we failed to expand the conditional move, drop out and don't
- try to continue. */
- if (temp_dest == NULL_RTX)
- {
- end_sequence ();
- return FALSE;
- }
+ bool ok = noce_convert_multiple_sets_1
+ (if_info, &need_no_cmov, &rewired_src, &targets, &temporaries,
+ &unmodified_insns, &last_needs_comparison);
+ if (!ok)
+ return false;
- /* Bookkeeping. */
- count++;
- targets.safe_push (target);
- temporaries.safe_push (temp_dest);
- unmodified_insns.safe_push (insn);
+ /* If there are insns that overwrite part of the initial
+ comparison, we can still omit creating temporaries for
+ the last of them.
+ As the second try will always create a less expensive,
+ valid sequence, we do not need to compare and can discard
+ the first one. */
+ if (last_needs_comparison != -1)
+ {
+ end_sequence ();
+ start_sequence ();
+ ok = noce_convert_multiple_sets_1
+ (if_info, &need_no_cmov, &rewired_src, &targets, &temporaries,
+ &unmodified_insns, &last_needs_comparison);
+ /* Actually we should not fail anymore if we reached here,
+ but better still check. */
+ if (!ok)
+ return false;
}
/* We must have seen some sort of insn to insert, otherwise we were
@@ -3305,8 +3307,9 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
gcc_assert (!unmodified_insns.is_empty ());
/* Now fixup the assignments. */
- for (int i = 0; i < count; i++)
- noce_emit_move_insn (targets[i], temporaries[i]);
+ for (unsigned i = 0; i < targets.length (); i++)
+ if (targets[i] != temporaries[i])
+ noce_emit_move_insn (targets[i], temporaries[i]);
/* Actually emit the sequence if it isn't too expensive. */
rtx_insn *seq = get_insns ();
@@ -3321,7 +3324,7 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
set_used_flags (insn);
/* Mark all our temporaries and targets as used. */
- for (int i = 0; i < count; i++)
+ for (unsigned i = 0; i < targets.length (); i++)
{
set_used_flags (temporaries[i]);
set_used_flags (targets[i]);
@@ -3364,18 +3367,217 @@ noce_convert_multiple_sets (struct noce_if_info *if_info)
return TRUE;
}
+/* This goes through all relevant insns of IF_INFO->then_bb and tries to
+ create conditional moves. In case a simple move sufficis the insn
+ should be listed in NEED_NO_CMOV. The rewired-src cases should be
+ specified via REWIRED_SRC. TARGETS, TEMPORARIES and UNMODIFIED_INSNS
+ are specified and used in noce_convert_multiple_sets and should be passed
+ to this function.. */
+
+static bool
+noce_convert_multiple_sets_1 (struct noce_if_info *if_info,
+ hash_set<rtx_insn *> *need_no_cmov,
+ hash_map<rtx_insn *, int> *rewired_src,
+ auto_vec<rtx> *targets,
+ auto_vec<rtx> *temporaries,
+ auto_vec<rtx_insn *> *unmodified_insns,
+ int *last_needs_comparison)
+{
+ basic_block then_bb = if_info->then_bb;
+ rtx_insn *jump = if_info->jump;
+ rtx_insn *cond_earliest;
+
+ /* Decompose the condition attached to the jump. */
+ rtx cond = noce_get_condition (jump, &cond_earliest, false);
+
+ rtx cc_cmp = cond_exec_get_condition (jump);
+ rtx rev_cc_cmp = cond_exec_get_condition (jump, /* get_reversed */ true);
+
+ rtx_insn *insn;
+ int count = 0;
+
+ targets->truncate (0);
+ temporaries->truncate (0);
+ unmodified_insns->truncate (0);
+
+ bool second_try = *last_needs_comparison != -1;
+
+ FOR_BB_INSNS (then_bb, insn)
+ {
+ /* Skip over non-insns. */
+ if (!active_insn_p (insn))
+ continue;
+
+ rtx set = single_set (insn);
+ gcc_checking_assert (set);
+
+ rtx target = SET_DEST (set);
+ rtx temp;
+
+ rtx new_val = SET_SRC (set);
+ if (int *ii = rewired_src->get (insn))
+ new_val = simplify_replace_rtx (new_val, (*targets)[*ii],
+ (*temporaries)[*ii]);
+ rtx old_val = target;
+
+ /* As we are transforming
+ if (x > y)
+ {
+ a = b;
+ c = d;
+ }
+ into
+ a = (x > y) ...
+ c = (x > y) ...
+
+ we potentially check x > y before every set.
+ Even though the check might be removed by subsequent passes, this means
+ that we cannot transform
+ if (x > y)
+ {
+ x = y;
+ ...
+ }
+ into
+ x = (x > y) ...
+ ...
+ since this would invalidate x and the following to-be-removed checks.
+ Therefore we introduce a temporary every time we are about to
+ overwrite a variable used in the check. Costing of a sequence with
+ these is going to be inaccurate so only use temporaries when
+ needed.
+
+ If performing a second try, we know how many insns require a
+ temporary. For the last of these, we can omit creating one. */
+ if (reg_overlap_mentioned_p (target, cond)
+ && (!second_try || count < *last_needs_comparison))
+ temp = gen_reg_rtx (GET_MODE (target));
+ else
+ temp = target;
+
+ /* We have identified swap-style idioms before. A normal
+ set will need to be a cmov while the first instruction of a swap-style
+ idiom can be a regular move. This helps with costing. */
+ bool need_cmov = !need_no_cmov->contains (insn);
+
+ /* If we had a non-canonical conditional jump (i.e. one where
+ the fallthrough is to the "else" case) we need to reverse
+ the conditional select. */
+ if (if_info->then_else_reversed)
+ std::swap (old_val, new_val);
+
+
+ /* We allow simple lowpart register subreg SET sources in
+ bb_ok_for_noce_convert_multiple_sets. Be careful when processing
+ sequences like:
+ (set (reg:SI r1) (reg:SI r2))
+ (set (reg:HI r3) (subreg:HI (r1)))
+ For the second insn new_val or old_val (r1 in this example) will be
+ taken from the temporaries and have the wider mode which will not
+ match with the mode of the other source of the conditional move, so
+ we'll end up trying to emit r4:HI = cond ? (r1:SI) : (r3:HI).
+ Wrap the two cmove operands into subregs if appropriate to prevent
+ that. */
+
+ if (!CONSTANT_P (new_val)
+ && GET_MODE (new_val) != GET_MODE (temp))
+ {
+ machine_mode src_mode = GET_MODE (new_val);
+ machine_mode dst_mode = GET_MODE (temp);
+ if (!partial_subreg_p (dst_mode, src_mode))
+ {
+ end_sequence ();
+ return FALSE;
+ }
+ new_val = lowpart_subreg (dst_mode, new_val, src_mode);
+ }
+ if (!CONSTANT_P (old_val)
+ && GET_MODE (old_val) != GET_MODE (temp))
+ {
+ machine_mode src_mode = GET_MODE (old_val);
+ machine_mode dst_mode = GET_MODE (temp);
+ if (!partial_subreg_p (dst_mode, src_mode))
+ {
+ end_sequence ();
+ return FALSE;
+ }
+ old_val = lowpart_subreg (dst_mode, old_val, src_mode);
+ }
+
+ /* Try emitting a conditional move passing the backend the
+ canonicalized comparison. The backend is then able to
+ recognize expressions like
+
+ if (x > y)
+ y = x;
+
+ as min/max and emit an insn, accordingly. */
+ unsigned cost1 = 0, cost2 = 0;
+ rtx_insn *seq, *seq1, *seq2;
+ rtx temp_dest = NULL_RTX, temp_dest1 = NULL_RTX, temp_dest2 = NULL_RTX;
+
+ seq1 = try_emit_cmove_seq (if_info, temp, cond,
+ new_val, old_val, need_cmov,
+ &cost1, &temp_dest1);
+
+ /* Here, we try to pass the backend a non-canonicalized cc comparison
+ as well. This allows the backend to emit a cmov directly without
+ creating an additional compare for each. If successful, costing
+ is easier and this sequence is usually preferred. */
+ seq2 = try_emit_cmove_seq (if_info, target, cond,
+ new_val, old_val, need_cmov,
+ &cost2, &temp_dest2, cc_cmp, rev_cc_cmp);
+
+ /* Check which version is less expensive. */
+ if (seq1 != NULL_RTX && (cost1 <= cost2 || seq2 == NULL_RTX))
+ {
+ seq = seq1;
+ temp_dest = temp_dest1;
+ if (!second_try)
+ *last_needs_comparison = count;
+ }
+ else if (seq2 != NULL_RTX)
+ {
+ seq = seq2;
+ temp_dest = temp_dest2;
+ }
+ else
+ {
+ /* Nothing worked, bail out. */
+ end_sequence ();
+ return FALSE;
+ }
+
+ /* End the sub sequence and emit to the main sequence. */
+ emit_insn (seq);
+
+ /* Bookkeeping. */
+ count++;
+ targets->safe_push (target);
+ temporaries->safe_push (temp_dest);
+ unmodified_insns->safe_push (insn);
+ }
+
+ return true;
+}
+
+
+
/* Return true iff basic block TEST_BB is comprised of only
(SET (REG) (REG)) insns suitable for conversion to a series
of conditional moves. Also check that we have more than one set
(other routines can handle a single set better than we would), and
- fewer than PARAM_MAX_RTL_IF_CONVERSION_INSNS sets. */
+ fewer than PARAM_MAX_RTL_IF_CONVERSION_INSNS sets. While going
+ through the insns store the sum of their potential costs in COST. */
static bool
-bb_ok_for_noce_convert_multiple_sets (basic_block test_bb)
+bb_ok_for_noce_convert_multiple_sets (basic_block test_bb, unsigned *cost)
{
rtx_insn *insn;
unsigned count = 0;
unsigned param = param_max_rtl_if_conversion_insns;
+ bool speed_p = optimize_bb_for_speed_p (test_bb);
+ unsigned potential_cost = 0;
FOR_BB_INSNS (test_bb, insn)
{
@@ -3398,9 +3600,9 @@ bb_ok_for_noce_convert_multiple_sets (basic_block test_bb)
if (!REG_P (dest))
return false;
- if (!(REG_P (src)
- || (GET_CODE (src) == SUBREG && REG_P (SUBREG_REG (src))
- && subreg_lowpart_p (src))))
+ if (!((REG_P (src) || CONSTANT_P (src))
+ || (GET_CODE (src) == SUBREG && REG_P (SUBREG_REG (src))
+ && subreg_lowpart_p (src))))
return false;
/* Destination must be appropriate for a conditional write. */
@@ -3411,9 +3613,13 @@ bb_ok_for_noce_convert_multiple_sets (basic_block test_bb)
if (!can_conditionally_move_p (GET_MODE (dest)))
return false;
+ potential_cost += insn_cost (insn, speed_p);
+
count++;
}
+ *cost += potential_cost;
+
/* If we would only put out one conditional move, the other strategies
this pass tries are better optimized and will be more appropriate.
Some targets want to strictly limit the number of conditional moves
@@ -3461,11 +3667,24 @@ noce_process_if_block (struct noce_if_info *if_info)
to calculate a value for x.
??? For future expansion, further expand the "multiple X" rules. */
- /* First look for multiple SETS. */
+ /* First look for multiple SETS. The original costs already include
+ a base cost of COSTS_N_INSNS (2): one instruction for the compare
+ (which we will be needing either way) and one instruction for the
+ branch. When comparing costs we want to use the branch instruction
+ cost and the sets vs. the cmovs generated here. Therefore subtract
+ the costs of the compare before checking.
+ ??? Actually, instead of the branch instruction costs we might want
+ to use COSTS_N_INSNS (BRANCH_COST ()) as in other places. */
+
+ unsigned potential_cost = if_info->original_cost - COSTS_N_INSNS (1);
+ unsigned old_cost = if_info->original_cost;
if (!else_bb
&& HAVE_conditional_move
- && bb_ok_for_noce_convert_multiple_sets (then_bb))
+ && bb_ok_for_noce_convert_multiple_sets (then_bb, &potential_cost))
{
+ /* Temporarily set the original costs to what we estimated so
+ we can determine if the transformation is worth it. */
+ if_info->original_cost = potential_cost;
if (noce_convert_multiple_sets (if_info))
{
if (dump_file && if_info->transform_name)
@@ -3473,6 +3692,9 @@ noce_process_if_block (struct noce_if_info *if_info)
if_info->transform_name);
return TRUE;
}
+
+ /* Restore the original costs. */
+ if_info->original_cost = old_cost;
}
bool speed_p = optimize_bb_for_speed_p (test_bb);
@@ -3814,6 +4036,89 @@ check_cond_move_block (basic_block bb,
return TRUE;
}
+/* Find local swap-style idioms in BB and mark the first insn (1)
+ that is only a temporary as not needing a conditional move as
+ it is going to be dead afterwards anyway.
+
+ (1) int tmp = a;
+ a = b;
+ b = tmp;
+
+ ifcvt
+ -->
+
+ tmp = a;
+ a = cond ? b : a_old;
+ b = cond ? tmp : b_old;
+
+ Additionally, store the index of insns like (2) when a subsequent
+ SET reads from their destination.
+
+ (2) int c = a;
+ int d = c;
+
+ ifcvt
+ -->
+
+ c = cond ? a : c_old;
+ d = cond ? d : c; // Need to use c rather than c_old here.
+*/
+
+static void
+need_cmov_or_rewire (basic_block bb,
+ hash_set<rtx_insn *> *need_no_cmov,
+ hash_map<rtx_insn *, int> *rewired_src)
+{
+ rtx_insn *insn;
+ int count = 0;
+ auto_vec<rtx_insn *> insns;
+ auto_vec<rtx> dests;
+
+ /* Iterate over all SETs, storing the destinations
+ in DEST.
+ - If we hit a SET that reads from a destination
+ that we have seen before and the corresponding register
+ is dead afterwards, the register does not need to be
+ moved conditionally.
+ - If we encounter a previously changed register,
+ rewire the read to the original source. */
+ FOR_BB_INSNS (bb, insn)
+ {
+ rtx set, src, dest;
+
+ if (!active_insn_p (insn))
+ continue;
+
+ set = single_set (insn);
+ if (set == NULL_RTX)
+ continue;
+
+ src = SET_SRC (set);
+ if (SUBREG_P (src))
+ src = SUBREG_REG (src);
+ dest = SET_DEST (set);
+
+ /* Check if the current SET's source is the same
+ as any previously seen destination.
+ This is quadratic but the number of insns in BB
+ is bounded by PARAM_MAX_RTL_IF_CONVERSION_INSNS. */
+ if (REG_P (src))
+ for (int i = count - 1; i >= 0; --i)
+ if (reg_overlap_mentioned_p (src, dests[i]))
+ {
+ if (find_reg_note (insn, REG_DEAD, src) != NULL_RTX)
+ need_no_cmov->add (insns[i]);
+ else
+ rewired_src->put (insn, i);
+ }
+
+ insns.safe_push (insn);
+ dests.safe_push (dest);
+
+ count++;
+ }
+}
+
/* Given a basic block BB suitable for conditional move conversion,
a condition COND, and pointer maps THEN_VALS and ELSE_VALS containing
the register values depending on COND, emit the insns in the block as
diff --git a/gcc/input.cc b/gcc/input.cc
index 4a92e55..b397061 100644
--- a/gcc/input.cc
+++ b/gcc/input.cc
@@ -3885,7 +3885,7 @@ void test_cpp_utf8 ()
/* Run all of the selftests within this file. */
void
-input_c_tests ()
+input_cc_tests ()
{
test_linenum_comparisons ();
test_should_have_column_data_p ();
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index e16015f..453e9c9 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -6630,7 +6630,7 @@ make_pass_ipa_cp (gcc::context *ctxt)
within the same process. For use by toplev::finalize. */
void
-ipa_cp_c_finalize (void)
+ipa_cp_cc_finalize (void)
{
base_count = profile_count::uninitialized ();
overall_size = 0;
diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index 7e7afb0..0d7e395 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -4966,7 +4966,7 @@ make_pass_ipa_fn_summary (gcc::context *ctxt)
within the same process. For use by toplev::finalize. */
void
-ipa_fnsummary_c_finalize (void)
+ipa_fnsummary_cc_finalize (void)
{
ipa_free_fn_summary ();
}
diff --git a/gcc/ipa-fnsummary.h b/gcc/ipa-fnsummary.h
index 34c2398..e1f1d1b 100644
--- a/gcc/ipa-fnsummary.h
+++ b/gcc/ipa-fnsummary.h
@@ -428,7 +428,7 @@ void evaluate_properties_for_edge (struct cgraph_edge *e,
ipa_auto_call_arg_values *avals,
bool compute_contexts);
-void ipa_fnsummary_c_finalize (void);
+void ipa_fnsummary_cc_finalize (void);
HOST_WIDE_INT ipa_get_stack_frame_offset (struct cgraph_node *node);
void ipa_remove_from_growth_caches (struct cgraph_edge *edge);
diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
index 3852277..f8bb072 100644
--- a/gcc/ipa-inline.cc
+++ b/gcc/ipa-inline.cc
@@ -2029,7 +2029,12 @@ inline_small_functions (void)
struct cgraph_edge *next = NULL;
bool has_speculative = false;
- if (!opt_for_fn (node->decl, optimize))
+ if (!opt_for_fn (node->decl, optimize)
+ /* With -Og we do not want to perform IPA inlining of small
+ functions since there are no scalar cleanups after it
+ that would realize the anticipated win. All abstraction
+ is removed during early inlining. */
+ || opt_for_fn (node->decl, optimize_debug))
continue;
if (dump_file)
diff --git a/gcc/ipa-modref-tree.cc b/gcc/ipa-modref-tree.cc
index e0fc92f..97e497a 100644
--- a/gcc/ipa-modref-tree.cc
+++ b/gcc/ipa-modref-tree.cc
@@ -1007,7 +1007,7 @@ test_merge ()
void
-ipa_modref_tree_c_tests ()
+ipa_modref_tree_cc_tests ()
{
test_insert_search_collapse ();
test_merge ();
diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h
index 1611800..edb3b49 100644
--- a/gcc/ipa-modref-tree.h
+++ b/gcc/ipa-modref-tree.h
@@ -738,8 +738,6 @@ struct GTY((user)) modref_tree
}
};
-void modref_c_tests ();
-
void gt_ggc_mx (modref_tree <int>* const&);
void gt_ggc_mx (modref_tree <tree_node*>* const&);
void gt_pch_nx (modref_tree <int>* const&);
diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 37b5355..ad5cfd6 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -5490,7 +5490,7 @@ pass_ipa_modref::execute (function *)
/* Summaries must stay alive until end of compilation. */
void
-ipa_modref_c_finalize ()
+ipa_modref_cc_finalize ()
{
if (optimization_summaries)
ggc_delete (optimization_summaries);
diff --git a/gcc/ipa-modref.h b/gcc/ipa-modref.h
index 2f71e15..642108a 100644
--- a/gcc/ipa-modref.h
+++ b/gcc/ipa-modref.h
@@ -73,7 +73,7 @@ struct GTY(()) modref_summary
modref_summary *get_modref_function_summary (cgraph_node *func);
modref_summary *get_modref_function_summary (gcall *call, bool *interposed);
-void ipa_modref_c_finalize ();
+void ipa_modref_cc_finalize ();
void ipa_merge_modref_summary_after_inlining (cgraph_edge *e);
/* All flags that are implied by the ECF_CONST functions. */
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 12f7626..553adfc 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -1189,6 +1189,6 @@ tree build_ref_for_offset (location_t, tree, poly_int64, bool, tree,
gimple_stmt_iterator *, bool);
/* In ipa-cp.cc */
-void ipa_cp_c_finalize (void);
+void ipa_cp_cc_finalize (void);
#endif /* IPA_PROP_H */
diff --git a/gcc/ipa-reference.cc b/gcc/ipa-reference.cc
index a2f2fad..67e0c85 100644
--- a/gcc/ipa-reference.cc
+++ b/gcc/ipa-reference.cc
@@ -1322,7 +1322,7 @@ make_pass_ipa_reference (gcc::context *ctxt)
within the same process. For use by toplev::finalize. */
void
-ipa_reference_c_finalize (void)
+ipa_reference_cc_finalize (void)
{
if (ipa_ref_opt_sum_summaries != NULL)
{
diff --git a/gcc/ipa-reference.h b/gcc/ipa-reference.h
index be25beb..2048e4b 100644
--- a/gcc/ipa-reference.h
+++ b/gcc/ipa-reference.h
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
/* In ipa-reference.cc */
bitmap ipa_reference_get_read_global (struct cgraph_node *fn);
bitmap ipa_reference_get_written_global (struct cgraph_node *fn);
-void ipa_reference_c_finalize (void);
+void ipa_reference_cc_finalize (void);
int ipa_reference_var_uid (tree t);
#endif /* GCC_IPA_REFERENCE_H */
diff --git a/gcc/ipa-split.cc b/gcc/ipa-split.cc
index 6ca45f3..60021ba 100644
--- a/gcc/ipa-split.cc
+++ b/gcc/ipa-split.cc
@@ -931,8 +931,8 @@ visit_bb (basic_block bb, basic_block return_bb,
break;
}
- /* Calls that function has either the warning or error
- attribute on it should not be split off into another
+ /* Calls to functions (which have the warning or error
+ attribute on them) should not be split off into another
function. */
if (lookup_attribute ("warning", DECL_ATTRIBUTES (decl))
|| lookup_attribute ("error", DECL_ATTRIBUTES (decl)))
diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc
index 1e4cf5a..964c94a 100644
--- a/gcc/ira-costs.cc
+++ b/gcc/ira-costs.cc
@@ -2411,7 +2411,7 @@ ira_adjust_equiv_reg_cost (unsigned regno, int cost)
}
void
-ira_costs_c_finalize (void)
+ira_costs_cc_finalize (void)
{
this_target_ira_int->free_ira_costs ();
}
diff --git a/gcc/ira.h b/gcc/ira.h
index 9a22276..c128273 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -216,7 +216,7 @@ extern void ira_restore_scratches (FILE *dump_file);
extern void ira_nullify_asm_goto (rtx_insn *insn);
/* ira-costs.cc */
-extern void ira_costs_c_finalize (void);
+extern void ira_costs_cc_finalize (void);
/* ira-lives.cc */
extern rtx non_conflicting_reg_copy_p (rtx_insn *);
diff --git a/gcc/match.pd b/gcc/match.pd
index 3680b89..c68eed7 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -425,12 +425,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
{ build_minus_one_cst (type); })))
/* For unsigned integral types, FLOOR_DIV_EXPR is the same as
- TRUNC_DIV_EXPR. Rewrite into the latter in this case. */
-(simplify
- (floor_div @0 @1)
- (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
- && TYPE_UNSIGNED (type))
- (trunc_div @0 @1)))
+ TRUNC_DIV_EXPR. Rewrite into the latter in this case. Similarly
+ for MOD instead of DIV. */
+(for floor_divmod (floor_div floor_mod)
+ trunc_divmod (trunc_div trunc_mod)
+ (simplify
+ (floor_divmod @0 @1)
+ (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
+ && TYPE_UNSIGNED (type))
+ (trunc_divmod @0 @1))))
/* Combine two successive divisions. Note that combining ceil_div
and floor_div is trickier and combining round_div even more so. */
diff --git a/gcc/opt-suggestions.cc b/gcc/opt-suggestions.cc
index 84a6f26..33f2985 100644
--- a/gcc/opt-suggestions.cc
+++ b/gcc/opt-suggestions.cc
@@ -396,7 +396,7 @@ test_completion_garbage (option_proposer &proposer)
/* Run all of the selftests within this file. */
void
-opt_proposer_c_tests ()
+opt_suggestions_cc_tests ()
{
option_proposer proposer;
diff --git a/gcc/optabs-tree.cc b/gcc/optabs-tree.cc
index 78e388d..8383fe8 100644
--- a/gcc/optabs-tree.cc
+++ b/gcc/optabs-tree.cc
@@ -56,17 +56,32 @@ optab_for_tree_code (enum tree_code code, const_tree type,
case MULT_HIGHPART_EXPR:
return TYPE_UNSIGNED (type) ? umul_highpart_optab : smul_highpart_optab;
- case TRUNC_MOD_EXPR:
case CEIL_MOD_EXPR:
case FLOOR_MOD_EXPR:
case ROUND_MOD_EXPR:
+ /* {s,u}mod_optab implements TRUNC_MOD_EXPR. For scalar modes,
+ expansion has code to adjust TRUNC_MOD_EXPR into the desired other
+ modes, but for vector modes it does not. The adjustment code
+ should be instead emitted in tree-vect-patterns.cc. */
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ return unknown_optab;
+ /* FALLTHRU */
+ case TRUNC_MOD_EXPR:
return TYPE_UNSIGNED (type) ? umod_optab : smod_optab;
- case RDIV_EXPR:
- case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR:
case ROUND_DIV_EXPR:
+ /* {,u}{s,u}div_optab implements {TRUNC,EXACT}_DIV_EXPR or RDIV_EXPR.
+ For scalar modes, expansion has code to adjust TRUNC_DIV_EXPR
+ into the desired other modes, but for vector modes it does not.
+ The adjustment code should be instead emitted in
+ tree-vect-patterns.cc. */
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ return unknown_optab;
+ /* FALLTHRU */
+ case RDIV_EXPR:
+ case TRUNC_DIV_EXPR:
case EXACT_DIV_EXPR:
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usdiv_optab : ssdiv_optab;
diff --git a/gcc/optabs.cc b/gcc/optabs.cc
index 5f759d5..2486e14 100644
--- a/gcc/optabs.cc
+++ b/gcc/optabs.cc
@@ -52,6 +52,8 @@ static void prepare_float_lib_cmp (rtx, rtx, enum rtx_code, rtx *,
static rtx expand_unop_direct (machine_mode, optab, rtx, rtx, int);
static void emit_libcall_block_1 (rtx_insn *, rtx, rtx, rtx, bool);
+static rtx emit_conditional_move_1 (rtx, rtx, rtx, rtx, machine_mode);
+
/* Debug facility for use in GDB. */
void debug_optab_libfuncs (void);
@@ -624,12 +626,13 @@ expand_doubleword_shift_condmove (scalar_int_mode op1_mode, optab binoptab,
/* Select between them. Do the INTO half first because INTO_SUPERWORD
might be the current value of OUTOF_TARGET. */
- if (!emit_conditional_move (into_target, cmp_code, cmp1, cmp2, op1_mode,
+ if (!emit_conditional_move (into_target, { cmp_code, cmp1, cmp2, op1_mode },
into_target, into_superword, word_mode, false))
return false;
if (outof_target != 0)
- if (!emit_conditional_move (outof_target, cmp_code, cmp1, cmp2, op1_mode,
+ if (!emit_conditional_move (outof_target,
+ { cmp_code, cmp1, cmp2, op1_mode },
outof_target, outof_superword,
word_mode, false))
return false;
@@ -4851,8 +4854,8 @@ emit_indirect_jump (rtx loc)
is not supported. */
rtx
-emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
- machine_mode cmode, rtx op2, rtx op3,
+emit_conditional_move (rtx target, struct rtx_comparison comp,
+ rtx op2, rtx op3,
machine_mode mode, int unsignedp)
{
rtx comparison;
@@ -4874,31 +4877,33 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
/* If one operand is constant, make it the second one. Only do this
if the other operand is not constant as well. */
- if (swap_commutative_operands_p (op0, op1))
+ if (swap_commutative_operands_p (comp.op0, comp.op1))
{
- std::swap (op0, op1);
- code = swap_condition (code);
+ std::swap (comp.op0, comp.op1);
+ comp.code = swap_condition (comp.code);
}
/* get_condition will prefer to generate LT and GT even if the old
comparison was against zero, so undo that canonicalization here since
comparisons against zero are cheaper. */
- if (code == LT && op1 == const1_rtx)
- code = LE, op1 = const0_rtx;
- else if (code == GT && op1 == constm1_rtx)
- code = GE, op1 = const0_rtx;
- if (cmode == VOIDmode)
- cmode = GET_MODE (op0);
+ if (comp.code == LT && comp.op1 == const1_rtx)
+ comp.code = LE, comp.op1 = const0_rtx;
+ else if (comp.code == GT && comp.op1 == constm1_rtx)
+ comp.code = GE, comp.op1 = const0_rtx;
- enum rtx_code orig_code = code;
+ if (comp.mode == VOIDmode)
+ comp.mode = GET_MODE (comp.op0);
+
+ enum rtx_code orig_code = comp.code;
bool swapped = false;
if (swap_commutative_operands_p (op2, op3)
- && ((reversed = reversed_comparison_code_parts (code, op0, op1, NULL))
- != UNKNOWN))
+ && ((reversed =
+ reversed_comparison_code_parts (comp.code, comp.op0, comp.op1, NULL))
+ != UNKNOWN))
{
std::swap (op2, op3);
- code = reversed;
+ comp.code = reversed;
swapped = true;
}
@@ -4915,8 +4920,10 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
for (int pass = 0; ; pass++)
{
- code = unsignedp ? unsigned_condition (code) : code;
- comparison = simplify_gen_relational (code, VOIDmode, cmode, op0, op1);
+ comp.code = unsignedp ? unsigned_condition (comp.code) : comp.code;
+ comparison =
+ simplify_gen_relational (comp.code, VOIDmode,
+ comp.mode, comp.op0, comp.op1);
/* We can get const0_rtx or const_true_rtx in some circumstances. Just
punt and let the caller figure out how best to deal with this
@@ -4927,24 +4934,16 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
save_pending_stack_adjust (&save);
last = get_last_insn ();
do_pending_stack_adjust ();
- machine_mode cmpmode = cmode;
+ machine_mode cmpmode = comp.mode;
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp,
OPTAB_WIDEN, &comparison, &cmpmode);
if (comparison)
{
- class expand_operand ops[4];
-
- create_output_operand (&ops[0], target, mode);
- create_fixed_operand (&ops[1], comparison);
- create_input_operand (&ops[2], op2, mode);
- create_input_operand (&ops[3], op3, mode);
- if (maybe_expand_insn (icode, 4, ops))
- {
- if (ops[0].value != target)
- convert_move (target, ops[0].value, false);
- return target;
- }
+ rtx res = emit_conditional_move_1 (target, comparison,
+ op2, op3, mode);
+ if (res != NULL_RTX)
+ return res;
}
delete_insns_since (last);
restore_pending_stack_adjust (&save);
@@ -4956,17 +4955,88 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
/* If the preferred op2/op3 order is not usable, retry with other
operand order, perhaps it will expand successfully. */
if (swapped)
- code = orig_code;
- else if ((reversed = reversed_comparison_code_parts (orig_code, op0, op1,
+ comp.code = orig_code;
+ else if ((reversed =
+ reversed_comparison_code_parts (orig_code, comp.op0, comp.op1,
NULL))
!= UNKNOWN)
- code = reversed;
+ comp.code = reversed;
else
return NULL_RTX;
std::swap (op2, op3);
}
}
+/* Helper function that, in addition to COMPARISON, also tries
+ the reversed REV_COMPARISON with swapped OP2 and OP3. As opposed
+ to when we pass the specific constituents of a comparison, no
+ additional insns are emitted for it. It might still be necessary
+ to emit more than one insn for the final conditional move, though. */
+
+rtx
+emit_conditional_move (rtx target, rtx comparison, rtx rev_comparison,
+ rtx op2, rtx op3, machine_mode mode)
+{
+ rtx res = emit_conditional_move_1 (target, comparison, op2, op3, mode);
+
+ if (res != NULL_RTX)
+ return res;
+
+ return emit_conditional_move_1 (target, rev_comparison, op3, op2, mode);
+}
+
+/* Helper for emitting a conditional move. */
+
+static rtx
+emit_conditional_move_1 (rtx target, rtx comparison,
+ rtx op2, rtx op3, machine_mode mode)
+{
+ enum insn_code icode;
+
+ if (comparison == NULL_RTX || !COMPARISON_P (comparison))
+ return NULL_RTX;
+
+ /* If the two source operands are identical, that's just a move.
+ As the comparison comes in non-canonicalized, we must make
+ sure not to discard any possible side effects. If there are
+ side effects, just let the target handle it. */
+ if (!side_effects_p (comparison) && rtx_equal_p (op2, op3))
+ {
+ if (!target)
+ target = gen_reg_rtx (mode);
+
+ emit_move_insn (target, op3);
+ return target;
+ }
+
+ if (mode == VOIDmode)
+ mode = GET_MODE (op2);
+
+ icode = direct_optab_handler (movcc_optab, mode);
+
+ if (icode == CODE_FOR_nothing)
+ return NULL_RTX;
+
+ if (!target)
+ target = gen_reg_rtx (mode);
+
+ class expand_operand ops[4];
+
+ create_output_operand (&ops[0], target, mode);
+ create_fixed_operand (&ops[1], comparison);
+ create_input_operand (&ops[2], op2, mode);
+ create_input_operand (&ops[3], op3, mode);
+
+ if (maybe_expand_insn (icode, 4, ops))
+ {
+ if (ops[0].value != target)
+ convert_move (target, ops[0].value, false);
+ return target;
+ }
+
+ return NULL_RTX;
+}
+
/* Emit a conditional negate or bitwise complement using the
negcc or notcc optabs if available. Return NULL_RTX if such operations
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 2d98ad6..cfd7c74 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -279,8 +279,8 @@ extern void emit_indirect_jump (rtx);
#endif
/* Emit a conditional move operation. */
-rtx emit_conditional_move (rtx, enum rtx_code, rtx, rtx, machine_mode,
- rtx, rtx, machine_mode, int);
+rtx emit_conditional_move (rtx, rtx_comparison, rtx, rtx, machine_mode, int);
+rtx emit_conditional_move (rtx, rtx, rtx, rtx, rtx, machine_mode);
/* Emit a conditional negate or bitwise complement operation. */
rtx emit_conditional_neg_or_complement (rtx, rtx_code, machine_mode, rtx,
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 17e1884..dfdc4d7 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -3712,7 +3712,7 @@ test_get_option_html_page ()
/* Run all of the selftests within this file. */
void
-opts_c_tests ()
+opts_cc_tests ()
{
test_get_option_html_page ();
}
diff --git a/gcc/params.opt b/gcc/params.opt
index 665071f..b07663d 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -915,6 +915,10 @@ Common Joined UInteger Var(param_ranger_logical_depth) Init(6) IntegerRange(1, 9
Maximum depth of logical expression evaluation ranger will look through when
evaluating outgoing edge ranges.
+-param=relation-block-limit=
+Common Joined UInteger Var(param_relation_block_limit) Init(200) IntegerRange(0, 9999) Param Optimization
+Maximum number of relations the oracle will register in a basic block.
+
-param=rpo-vn-max-loop-depth=
Common Joined UInteger Var(param_rpo_vn_max_loop_depth) Init(7) IntegerRange(2, 65536) Param Optimization
Maximum depth of a loop nest to fully value-number optimistically.
diff --git a/gcc/passes.def b/gcc/passes.def
index 7880842..3e75de4 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -372,6 +372,9 @@ along with GCC; see the file COPYING3. If not see
POP_INSERT_PASSES ()
NEXT_PASS (pass_all_optimizations_g);
PUSH_INSERT_PASSES_WITHIN (pass_all_optimizations_g)
+ /* The idea is that with -Og we do not perform any IPA optimization
+ so post-IPA work should be restricted to semantically required
+ passes and all optimization work is done early. */
NEXT_PASS (pass_remove_cgraph_callee_edges);
NEXT_PASS (pass_strip_predict_hints, false /* early_p */);
/* Lower remaining pieces of GIMPLE. */
@@ -399,8 +402,6 @@ along with GCC; see the file COPYING3. If not see
number of false positives from it. */
NEXT_PASS (pass_split_crit_edges);
NEXT_PASS (pass_late_warn_uninitialized);
- NEXT_PASS (pass_local_pure_const);
- NEXT_PASS (pass_modref);
/* uncprop replaces constants by SSA names. This makes analysis harder
and thus it should be run last. */
NEXT_PASS (pass_uncprop);
diff --git a/gcc/predict.cc b/gcc/predict.cc
index 36046ab..5734e4c 100644
--- a/gcc/predict.cc
+++ b/gcc/predict.cc
@@ -4557,7 +4557,7 @@ test_prediction_value_range ()
/* Run all of the selfests within this file. */
void
-predict_c_tests ()
+predict_cc_tests ()
{
test_prediction_value_range ();
}
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc
index c765def..3ee206d 100644
--- a/gcc/pretty-print.cc
+++ b/gcc/pretty-print.cc
@@ -2613,7 +2613,7 @@ static void test_utf8 ()
/* Run all of the selftests within this file. */
void
-pretty_print_c_tests ()
+pretty_print_cc_tests ()
{
test_basic_printing ();
test_pp_format ();
diff --git a/gcc/read-rtl-function.cc b/gcc/read-rtl-function.cc
index 85faf2f..49c8880 100644
--- a/gcc/read-rtl-function.cc
+++ b/gcc/read-rtl-function.cc
@@ -2204,7 +2204,7 @@ test_loading_repeat ()
/* Run all of the selftests within this file. */
void
-read_rtl_function_c_tests ()
+read_rtl_function_cc_tests ()
{
test_edge_flags ();
test_parsing_regnos ();
diff --git a/gcc/rtl-tests.cc b/gcc/rtl-tests.cc
index 9b0a126..6957d70 100644
--- a/gcc/rtl-tests.cc
+++ b/gcc/rtl-tests.cc
@@ -310,7 +310,7 @@ test_dumping_repeat ()
/* Run all of the selftests within this file. */
void
-rtl_tests_c_tests ()
+rtl_tests_cc_tests ()
{
test_dumping_regs ();
test_dumping_insns ();
diff --git a/gcc/rtl.cc b/gcc/rtl.cc
index 02dd255..f17474b 100644
--- a/gcc/rtl.cc
+++ b/gcc/rtl.cc
@@ -870,6 +870,15 @@ dump_rtx_statistics (void)
}
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
+
+/* Disable warnings about missing quoting in GCC diagnostics for
+ the internal_error calls. Their format strings deliberately don't
+ follow GCC diagnostic conventions. */
+#if __GNUC__ >= 10
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
void
rtl_check_failed_bounds (const_rtx r, int n, const char *file, int line,
const char *func)
@@ -945,6 +954,10 @@ rtl_check_failed_code_mode (const_rtx r, enum rtx_code code, machine_mode mode,
func, trim_filename (file), line);
}
+#if __GNUC__ >= 10
+#pragma GCC diagnostic pop
+#endif
+
/* Report that line LINE of FILE tried to access the block symbol fields
of a non-block symbol. FUNC is the function that contains the line. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 648f9b8..9df2fab 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -4604,7 +4604,16 @@ word_register_operation_p (const_rtx x)
return true;
}
}
-
+
+/* Holds an rtx comparison to simplify passing many parameters pertaining to a
+ single comparison. */
+
+struct rtx_comparison {
+ rtx_code code;
+ rtx op0, op1;
+ machine_mode mode;
+};
+
/* gtype-desc.cc. */
extern void gt_ggc_mx (rtx &);
extern void gt_pch_nx (rtx &);
diff --git a/gcc/sbitmap.cc b/gcc/sbitmap.cc
index cdbd272..5ac2b6d 100644
--- a/gcc/sbitmap.cc
+++ b/gcc/sbitmap.cc
@@ -997,7 +997,7 @@ test_bit_in_range ()
/* Run all of the selftests within this file. */
void
-sbitmap_c_tests ()
+sbitmap_cc_tests ()
{
test_set_range ();
test_bit_in_range ();
diff --git a/gcc/selftest-run-tests.cc b/gcc/selftest-run-tests.cc
index 4123e54..99c3542 100644
--- a/gcc/selftest-run-tests.cc
+++ b/gcc/selftest-run-tests.cc
@@ -55,67 +55,67 @@ selftest::run_tests ()
run the tests for lowest-level code first. */
/* Sanity-check for selftests themselves. */
- selftest_c_tests ();
+ selftest_cc_tests ();
/* Low-level data structures. */
- bitmap_c_tests ();
- sbitmap_c_tests ();
- dumpfile_c_tests ();
- et_forest_c_tests ();
- hash_map_tests_c_tests ();
- hash_set_tests_c_tests ();
- vec_c_tests ();
- pretty_print_c_tests ();
+ bitmap_cc_tests ();
+ sbitmap_cc_tests ();
+ dumpfile_cc_tests ();
+ et_forest_cc_tests ();
+ hash_map_tests_cc_tests ();
+ hash_set_tests_cc_tests ();
+ vec_cc_tests ();
+ pretty_print_cc_tests ();
wide_int_cc_tests ();
- ggc_tests_c_tests ();
- sreal_c_tests ();
- fibonacci_heap_c_tests ();
- typed_splay_tree_c_tests ();
- opt_proposer_c_tests ();
- opts_c_tests ();
+ ggc_tests_cc_tests ();
+ sreal_cc_tests ();
+ fibonacci_heap_cc_tests ();
+ typed_splay_tree_cc_tests ();
+ opt_suggestions_cc_tests ();
+ opts_cc_tests ();
json_cc_tests ();
- cgraph_c_tests ();
+ cgraph_cc_tests ();
optinfo_emit_json_cc_tests ();
opt_problem_cc_tests ();
ordered_hash_map_tests_cc_tests ();
splay_tree_cc_tests ();
/* Mid-level data structures. */
- input_c_tests ();
- vec_perm_indices_c_tests ();
- tree_c_tests ();
- convert_c_tests ();
- gimple_c_tests ();
- rtl_tests_c_tests ();
- read_rtl_function_c_tests ();
+ input_cc_tests ();
+ vec_perm_indices_cc_tests ();
+ tree_cc_tests ();
+ convert_cc_tests ();
+ gimple_cc_tests ();
+ rtl_tests_cc_tests ();
+ read_rtl_function_cc_tests ();
digraph_cc_tests ();
tristate_cc_tests ();
- ipa_modref_tree_c_tests ();
+ ipa_modref_tree_cc_tests ();
/* Higher-level tests, or for components that other selftests don't
rely on. */
- diagnostic_show_locus_c_tests ();
- diagnostic_c_tests ();
+ diagnostic_show_locus_cc_tests ();
+ diagnostic_cc_tests ();
diagnostic_format_json_cc_tests ();
- edit_context_c_tests ();
- fold_const_c_tests ();
- spellcheck_c_tests ();
- spellcheck_tree_c_tests ();
- tree_cfg_c_tests ();
+ edit_context_cc_tests ();
+ fold_const_cc_tests ();
+ spellcheck_cc_tests ();
+ spellcheck_tree_cc_tests ();
+ tree_cfg_cc_tests ();
tree_diagnostic_path_cc_tests ();
- attribute_c_tests ();
+ attribs_cc_tests ();
/* This one relies on most of the above. */
- function_tests_c_tests ();
+ function_tests_cc_tests ();
/* Run any target-specific selftests. */
if (targetm.run_target_selftests)
targetm.run_target_selftests ();
- store_merging_c_tests ();
- predict_c_tests ();
- simplify_rtx_c_tests ();
- dbgcnt_c_tests ();
+ store_merging_cc_tests ();
+ predict_cc_tests ();
+ simplify_rtx_cc_tests ();
+ dbgcnt_cc_tests ();
/* Run any lang-specific selftests. */
lang_hooks.run_lang_selftests ();
diff --git a/gcc/selftest.cc b/gcc/selftest.cc
index ed5b396..89abfba 100644
--- a/gcc/selftest.cc
+++ b/gcc/selftest.cc
@@ -412,7 +412,7 @@ test_locate_file ()
/* Run all of the selftests within this file. */
void
-selftest_c_tests ()
+selftest_cc_tests ()
{
test_libiberty ();
test_assertions ();
diff --git a/gcc/selftest.h b/gcc/selftest.h
index 386c0d9..7a71563 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -218,56 +218,56 @@ class test_runner
/* Declarations for specific families of tests (by source file), in
alphabetical order. */
-extern void attribute_c_tests ();
-extern void bitmap_c_tests ();
-extern void cgraph_c_tests ();
-extern void convert_c_tests ();
-extern void diagnostic_c_tests ();
+extern void attribs_cc_tests ();
+extern void bitmap_cc_tests ();
+extern void cgraph_cc_tests ();
+extern void convert_cc_tests ();
+extern void diagnostic_cc_tests ();
extern void diagnostic_format_json_cc_tests ();
-extern void diagnostic_show_locus_c_tests ();
+extern void diagnostic_show_locus_cc_tests ();
extern void digraph_cc_tests ();
-extern void dumpfile_c_tests ();
-extern void edit_context_c_tests ();
-extern void et_forest_c_tests ();
-extern void fibonacci_heap_c_tests ();
-extern void fold_const_c_tests ();
-extern void function_tests_c_tests ();
-extern void ggc_tests_c_tests ();
-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 dumpfile_cc_tests ();
+extern void edit_context_cc_tests ();
+extern void et_forest_cc_tests ();
+extern void fibonacci_heap_cc_tests ();
+extern void fold_const_cc_tests ();
+extern void function_tests_cc_tests ();
+extern void ggc_tests_cc_tests ();
+extern void gimple_cc_tests ();
+extern void hash_map_tests_cc_tests ();
+extern void hash_set_tests_cc_tests ();
+extern void input_cc_tests ();
extern void json_cc_tests ();
extern void opt_problem_cc_tests ();
extern void optinfo_emit_json_cc_tests ();
-extern void opts_c_tests ();
+extern void opts_cc_tests ();
extern void ordered_hash_map_tests_cc_tests ();
-extern void predict_c_tests ();
-extern void pretty_print_c_tests ();
+extern void predict_cc_tests ();
+extern void pretty_print_cc_tests ();
extern void range_tests ();
extern void range_op_tests ();
extern void gimple_range_tests ();
-extern void read_rtl_function_c_tests ();
-extern void rtl_tests_c_tests ();
-extern void sbitmap_c_tests ();
-extern void selftest_c_tests ();
-extern void simplify_rtx_c_tests ();
-extern void spellcheck_c_tests ();
-extern void spellcheck_tree_c_tests ();
+extern void read_rtl_function_cc_tests ();
+extern void rtl_tests_cc_tests ();
+extern void sbitmap_cc_tests ();
+extern void selftest_cc_tests ();
+extern void simplify_rtx_cc_tests ();
+extern void spellcheck_cc_tests ();
+extern void spellcheck_tree_cc_tests ();
extern void splay_tree_cc_tests ();
-extern void sreal_c_tests ();
-extern void store_merging_c_tests ();
-extern void tree_c_tests ();
-extern void tree_cfg_c_tests ();
+extern void sreal_cc_tests ();
+extern void store_merging_cc_tests ();
+extern void tree_cc_tests ();
+extern void tree_cfg_cc_tests ();
extern void tree_diagnostic_path_cc_tests ();
extern void tristate_cc_tests ();
-extern void typed_splay_tree_c_tests ();
-extern void vec_c_tests ();
-extern void vec_perm_indices_c_tests ();
+extern void typed_splay_tree_cc_tests ();
+extern void vec_cc_tests ();
+extern void vec_perm_indices_cc_tests ();
extern void wide_int_cc_tests ();
-extern void opt_proposer_c_tests ();
-extern void dbgcnt_c_tests ();
-extern void ipa_modref_tree_c_tests ();
+extern void opt_suggestions_cc_tests ();
+extern void dbgcnt_cc_tests ();
+extern void ipa_modref_tree_cc_tests ();
extern int num_passes;
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index f17c917..bd176e8 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -8459,7 +8459,7 @@ simplify_const_poly_int_tests<N>::run ()
/* Run all of the selftests within this file. */
void
-simplify_rtx_c_tests ()
+simplify_rtx_cc_tests ()
{
test_scalar_ops ();
test_vector_ops ();
diff --git a/gcc/spellcheck-tree.cc b/gcc/spellcheck-tree.cc
index 28ad35b..0be1e41 100644
--- a/gcc/spellcheck-tree.cc
+++ b/gcc/spellcheck-tree.cc
@@ -104,7 +104,7 @@ test_find_closest_identifier ()
/* Run all of the selftests within this file. */
void
-spellcheck_tree_c_tests ()
+spellcheck_tree_cc_tests ()
{
test_find_closest_identifier ();
}
diff --git a/gcc/spellcheck.cc b/gcc/spellcheck.cc
index 6077bed..3e58344 100644
--- a/gcc/spellcheck.cc
+++ b/gcc/spellcheck.cc
@@ -515,7 +515,7 @@ test_metric_conditions ()
/* Run all of the selftests within this file. */
void
-spellcheck_c_tests ()
+spellcheck_cc_tests ()
{
test_edit_distances ();
test_get_edit_distance_cutoff ();
diff --git a/gcc/sreal.cc b/gcc/sreal.cc
index 960f0da..75c360e 100644
--- a/gcc/sreal.cc
+++ b/gcc/sreal.cc
@@ -379,7 +379,7 @@ sreal_verify_negative_division (void)
/* Run all of the selftests within this file. */
-void sreal_c_tests ()
+void sreal_cc_tests ()
{
sreal_verify_basics ();
sreal_verify_arithmetics ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fcb57e4..a28ed32 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,207 @@
+2022-01-19 Robin Dapp <rdapp@linux.ibm.com>
+
+ * gcc.dg/ifcvt-4.c: Remove s390-specific check.
+ * gcc.target/s390/ifcvt-two-insns-bool.c: New test.
+ * gcc.target/s390/ifcvt-two-insns-int.c: New test.
+ * gcc.target/s390/ifcvt-two-insns-long.c: New test.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/102860
+ * gfortran.dg/pr102860.f90: New test.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/104115
+ * gcc.dg/tree-ssa/evrp-trans2.c: New test.
+
+2022-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/104112
+ * gcc.dg/vect/pr104112-1.c: New testcase.
+ * gcc.dg/vect/pr104112-2.c: New testcase.
+
+2022-01-19 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/ext/boolcomplex-1.c: Moved to...
+ * g++.dg/ext/boolcomplex-1.C: ...here.
+ * g++.dg/opt/pr47639.c: Moved to...
+ * g++.dg/opt/pr47639.C: ...here.
+ * g++.dg/pr83979.c: Moved to...
+ * g++.dg/pr83979.C: ...here.
+ * g++.dg/tm/asm-1.c: Moved to...
+ * g++.dg/tm/asm-1.C: ...here.
+ * g++.dg/vect/pr71483.c: Moved to...
+ * g++.dg/vect/pr71483.cc: ...here.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/89074
+ * gcc.dg/tree-ssa/pr89074.c: New test.
+
+2022-01-19 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/102833
+ * gcc.dg/vect/bb-slp-17.c: Require vect64.
+
+2022-01-19 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
+
+ PR testsuite/104021
+ * gcc.dg/vect/tsvc/tsvc.h: Do not include malloc.h on dragonfly
+ and use posix_memalign ().
+
+2022-01-19 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
+
+ PR testsuite/104022
+ * g++.dg/gcov/pr16855.C: xfail the count lines for DTORs on dragonfly.
+ * g++.dg/gcov/pr16855-priority.C: Ditto. Adjust source layout so that
+ dejagnu xfail expressions work.
+
+2022-01-19 Martin Liska <mliska@suse.cz>
+
+ PR testsuite/104109
+ * lib/gcov.exp: Fix pytest detection unsupported message.
+
+2022-01-19 Kewen Lin <linkw@linux.ibm.com>
+
+ PR tree-optimization/104015
+ * gcc.dg/vect/slp-perm-9.c: Adjust.
+ * gcc.target/powerpc/pr104015-1.c: New test.
+ * gcc.target/powerpc/pr104015-2.c: New test.
+
+2022-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/104104
+ * gcc.target/i386/pr104104.c: New test.
+
+2022-01-19 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/104076
+ * g++.dg/warn/Wdangling-pointer-3.C: New test.
+
+2022-01-19 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/104103
+ * gcc.dg/torture/pr57147-2.c: Prune out expected warning.
+
+2022-01-19 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/104069
+ * gcc.dg/Wuse-after-free.c: New test.
+
+2022-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/104055
+ * g++.dg/cpp2a/consteval27.C: New test.
+
+2022-01-18 Jason Merrill <jason@redhat.com>
+
+ * lib/g++-dg.exp: Change 2a to 20.
+
+2022-01-18 Jason Merrill <jason@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/104025
+ * g++.dg/warn/pr104025.C: New test.
+
+2022-01-18 David Faust <david.faust@oracle.com>
+
+ * gcc.target/bpf/core-section-1.c: Adjust expected record size
+ occurrences.
+
+2022-01-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/104089
+ * gcc.dg/analyzer/pr104089.c: New test.
+
+2022-01-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/104062
+ * gcc.dg/analyzer/pr104062.c: New test.
+
+2022-01-18 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/104074
+ * g++.dg/cpp1z/nontype-auto20.C: New test.
+
+2022-01-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103692
+ * gfortran.dg/pr102520.f90: Adjust error messages.
+ * gfortran.dg/pr103692.f90: New test.
+
+2022-01-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/104007
+ * g++.dg/eh/new2.C: New test.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * gcc.target/powerpc/bfp/scalar-extract-exp-5.c: Update scanned
+ pattern.
+ * gcc.target/powerpc/bfp/scalar-extract-sig-5.c: Likewise.
+ * gcc.target/powerpc/bfp/scalar-insert-exp-11.c: Likewise.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR ipa/103989
+ * g++.dg/opt/pr103989.C: New testcase.
+
+2022-01-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/103987
+ * gcc.dg/torture/pr103987.c: New testcase.
+
+2022-01-18 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR target/104005
+ * gcc.target/aarch64/pr104005.c: New test.
+
+2022-01-18 Andrew Pinski <apinski@marvell.com>
+
+ PR tree-optimization/101941
+ * gcc.c-torture/compile/pr101941-1.c: New test.
+ * gcc.dg/tree-ssa/pr101941-1.c: New test.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * gcc.src/maintainers.exp: Use
+ check_effective_target_python3_module for checking of unicode
+ module.
+ * lib/target-supports.exp: Add
+ check_effective_target_python3_module.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * gcc.misc-tests/options.exp: Include renamed file.
+
+2022-01-18 Martin Liska <mliska@suse.cz>
+
+ * gcc.src/maintainers.exp: Use the new
+ check_effective_target_recent_python3.
+ * lib/target-supports.exp: Check for Python3 version >= 3.6.
+
+2022-01-18 liuhongt <hongtao.liu@intel.com>
+
+ PR target/103973
+ * g++.target/i386/pr103973-1.C: Change scan-assembler from
+ "\tucomisd" to "\t\[v\]?ucomisd".
+ * g++.target/i386/pr103973-11.C: Ditto.
+ * g++.target/i386/pr103973-13.C: Ditto.
+ * g++.target/i386/pr103973-15.C: Ditto.
+ * g++.target/i386/pr103973-3.C: Ditto.
+ * g++.target/i386/pr103973-5.C: Ditto.
+ * g++.target/i386/pr103973-7.C: Ditto.
+ * g++.target/i386/pr103973-9.C: Ditto.
+ * gcc.target/i386/pr103973-1.c: Ditto.
+ * gcc.target/i386/pr103973-11.c: Ditto.
+ * gcc.target/i386/pr103973-13.c: Ditto.
+ * gcc.target/i386/pr103973-15.c: Ditto.
+ * gcc.target/i386/pr103973-3.c: Ditto.
+ * gcc.target/i386/pr103973-5.c: Ditto.
+ * gcc.target/i386/pr103973-7.c: Ditto.
+ * gcc.target/i386/pr103973-9.c: Ditto.
+
2022-01-17 qing zhao <qing.zhao@oracle.com>
* gcc.dg/auto-init-uninit-16.c (testfunc): Delete xfail to reflect
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto20.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto20.C
new file mode 100644
index 0000000..87a2a5f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto20.C
@@ -0,0 +1,5 @@
+// PR c++/104074
+// { dg-do compile { target c++17 } }
+
+template<auto> class gr_sp;
+template<class T> using gr_rp = gr_sp<T::value + 42>;
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval27.C b/gcc/testsuite/g++.dg/cpp2a/consteval27.C
new file mode 100644
index 0000000..72d56df
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval27.C
@@ -0,0 +1,18 @@
+// PR c++/104055
+// { dg-do run { target c++20 } }
+
+int g;
+
+struct A {
+ ~A () { if (a != 17 || b != 26) __builtin_abort (); g = 42; }
+ consteval A () : a (17), b (26) {}
+ int a, b;
+};
+
+int
+main ()
+{
+ A{};
+ if (g != 42)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/eh/new2.C b/gcc/testsuite/g++.dg/eh/new2.C
new file mode 100644
index 0000000..d4a1abf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/new2.C
@@ -0,0 +1,10 @@
+// PR c++/104007
+// { dg-do run }
+
+extern "C" void abort();
+#include <new>
+
+struct S { ~S() { abort(); } };
+int main() {
+ new (std::nothrow) S[1];
+}
diff --git a/gcc/testsuite/g++.dg/ext/boolcomplex-1.c b/gcc/testsuite/g++.dg/ext/boolcomplex-1.C
index d05d9bb..d05d9bb 100644
--- a/gcc/testsuite/g++.dg/ext/boolcomplex-1.c
+++ b/gcc/testsuite/g++.dg/ext/boolcomplex-1.C
diff --git a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
index 7e39565..c7a5839 100644
--- a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
+++ b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
@@ -19,7 +19,9 @@ class Test
{
public:
Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
- ~Test (void) { fprintf (stderr, "In Test::~Test\n"); /* count(1) */ }
+ ~Test (void) {
+ fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* } */
+ }
} T1;
void
@@ -76,4 +78,4 @@ static void __attribute__ ((destructor ((65535)))) dtor_65535 ()
fprintf (stderr, "in destructor((65535))\n"); /* count(1) */
}
-/* { dg-final { run-gcov branches { -b pr16855-priority.C } } } */
+/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* } } } */
diff --git a/gcc/testsuite/g++.dg/gcov/pr16855.C b/gcc/testsuite/g++.dg/gcov/pr16855.C
index a68b05c..f9b86a4 100644
--- a/gcc/testsuite/g++.dg/gcov/pr16855.C
+++ b/gcc/testsuite/g++.dg/gcov/pr16855.C
@@ -21,7 +21,7 @@ class Test
public:
Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
~Test (void) {
- fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* } */
+ fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* } */
}
} T1;
@@ -49,4 +49,4 @@ static void __attribute__ ((destructor)) dtor_default ()
fprintf (stderr, "in destructor(())\n"); /* count(1) { xfail *-*-darwin* } */
}
-/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* } } } */
+/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* } } } */
diff --git a/gcc/testsuite/g++.dg/opt/pr103989.C b/gcc/testsuite/g++.dg/opt/pr103989.C
new file mode 100644
index 0000000..4604811
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr103989.C
@@ -0,0 +1,30 @@
+// { dg-require-effective-target c++17 }
+// { dg-options "-Og -Wall" }
+
+#include <optional>
+#include <memory>
+
+struct A {
+ A (int a) : a {a}
+ {}
+
+ const std::shared_ptr <int> x;
+ int a;
+};
+
+class B
+{
+public:
+ B (const std::optional <A>& a)
+ : a {a}
+ {
+ }
+public:
+ const std::optional <A> a;
+};
+
+int
+main ()
+{
+ B b {std::nullopt};
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr47639.c b/gcc/testsuite/g++.dg/opt/pr47639.C
index 6ee8bb7..429ad25 100644
--- a/gcc/testsuite/g++.dg/opt/pr47639.c
+++ b/gcc/testsuite/g++.dg/opt/pr47639.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-fnon-call-exceptions" }
+// { dg-options "-fnon-call-exceptions -Wno-psabi" }
typedef int __attribute__ ((vector_size (8))) vec;
diff --git a/gcc/testsuite/g++.dg/parse/no-typename1.C b/gcc/testsuite/g++.dg/parse/no-typename1.C
index 711c621..f40ea0e 100644
--- a/gcc/testsuite/g++.dg/parse/no-typename1.C
+++ b/gcc/testsuite/g++.dg/parse/no-typename1.C
@@ -6,6 +6,6 @@ template <typename T> struct A
{
template <typename U> struct B
{
- A<T>::template B<U> foo(); // { dg-error "" "" { target c++17_down } }
+ A<T>::template B<U> foo();
};
};
diff --git a/gcc/testsuite/g++.dg/pr83979.c b/gcc/testsuite/g++.dg/pr83979.C
index a39b1ea..a39b1ea 100644
--- a/gcc/testsuite/g++.dg/pr83979.c
+++ b/gcc/testsuite/g++.dg/pr83979.C
diff --git a/gcc/testsuite/g++.dg/template/nested7.C b/gcc/testsuite/g++.dg/template/nested7.C
new file mode 100644
index 0000000..3a5930c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/nested7.C
@@ -0,0 +1,12 @@
+// PR c++/102300
+
+template<typename T>
+struct holder
+{
+ template<typename F> struct fn {};
+
+ struct t1 : fn<T> {}; // pass
+ struct t2 : holder<T >::fn<T> {}; // fail
+ struct t3 : holder<T >::template fn<T> {}; // fail
+ struct t4 : holder<T*>::template fn<T> {}; // pass
+};
diff --git a/gcc/testsuite/g++.dg/tm/asm-1.c b/gcc/testsuite/g++.dg/tm/asm-1.C
index 3c8ebd2..3c8ebd2 100644
--- a/gcc/testsuite/g++.dg/tm/asm-1.c
+++ b/gcc/testsuite/g++.dg/tm/asm-1.C
diff --git a/gcc/testsuite/g++.dg/vect/pr71483.c b/gcc/testsuite/g++.dg/vect/pr71483.cc
index 77f879c..77f879c 100644
--- a/gcc/testsuite/g++.dg/vect/pr71483.c
+++ b/gcc/testsuite/g++.dg/vect/pr71483.cc
diff --git a/gcc/testsuite/g++.dg/warn/Wdangling-pointer-3.C b/gcc/testsuite/g++.dg/warn/Wdangling-pointer-3.C
new file mode 100644
index 0000000..64117bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wdangling-pointer-3.C
@@ -0,0 +1,39 @@
+/* PR middle-end/104076 - bogus -Wdangling-pointer on a conditional expression
+ { dg-do compile { target { c++11 } } }
+ { dg-options "-Wall" } */
+
+namespace std {
+
+template <class T>
+struct initializer_list
+{
+ T *array;
+ __SIZE_TYPE__ nelts;
+
+ initializer_list (const T *a, __SIZE_TYPE__ n)
+ : array (a), nelts (n) { }
+
+ initializer_list()
+ : array (), nelts () { }
+
+ T* begin () const { return array; }
+
+ const T* end () const { return array + nelts; }
+};
+
+}
+
+struct S1
+{
+ S1 (int);
+ ~S1 ();
+};
+
+struct S2 { S2 (std::initializer_list<S1>); };
+
+S2 f1();
+
+S2 f2(bool b)
+{
+ return b ? f1() : S2{0}; // { dg-bogus "-Wdangling-pointer" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/pr104025.C b/gcc/testsuite/g++.dg/warn/pr104025.C
new file mode 100644
index 0000000..9457c8e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr104025.C
@@ -0,0 +1,20 @@
+// PR c++/104025
+// { dg-do compile }
+// { dg-options "-Wmissing-template-keyword -fcompare-debug" }
+
+void bar (int);
+
+struct S { int i; };
+
+template <class C>
+struct T
+{
+ int m;
+ C c;
+ void foo ()
+ {
+ bar (c.i < m);
+ }
+};
+
+template void T<S>::foo ();
diff --git a/gcc/testsuite/gcc.dg/Wuse-after-free.c b/gcc/testsuite/gcc.dg/Wuse-after-free.c
new file mode 100644
index 0000000..9862de5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wuse-after-free.c
@@ -0,0 +1,41 @@
+/* PR middle-end/104069 - -Werror=use-after-free false positive on
+ elfutils-0.186
+ { dg-do compile }
+ { dg-options "-Wall" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* realloc (void *, size_t);
+
+void* __libdw_unzstd (size_t todo)
+{
+ void *sb = 0;
+
+ for ( ; ; )
+ {
+ // Ran only once.
+ if (!sb)
+ {
+ char *b = realloc (sb, todo);
+ if (!b)
+ break;
+
+ sb = b;
+ }
+
+ todo -= 1;
+ if (todo == 0)
+ break;
+ }
+
+ // Shrink buffer: leave only one byte for simplicity.
+ char *b = realloc (sb, 1);
+ if (b)
+ sb = b;
+ else
+ {
+ // Realloc failed mysteriously, leave 'sb' untouched.
+ }
+
+ return sb; // { dg-bogus "-Wuse-after-free" }
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104062.c b/gcc/testsuite/gcc.dg/analyzer/pr104062.c
new file mode 100644
index 0000000..7129c27
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr104062.c
@@ -0,0 +1,13 @@
+void *
+calloc (__SIZE_TYPE__, __SIZE_TYPE__);
+
+void *
+realloc (void *, __SIZE_TYPE__);
+
+void
+foo (void)
+{
+ int *ap5 = calloc (4, sizeof *ap5);
+ int *ap7 = realloc (ap5, sizeof *ap5);
+} /* { dg-warning "leak of 'ap5'" "leak of ap5" } */
+/* { dg-warning "leak of 'ap7'" "leak of ap7" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104089.c b/gcc/testsuite/gcc.dg/analyzer/pr104089.c
new file mode 100644
index 0000000..c517704
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr104089.c
@@ -0,0 +1,9 @@
+/* { dg-additional-options "-frounding-math" } */
+
+volatile _Float16 true_min = 5.96046447753906250000000000000000000e-8F16;
+
+int
+main (void)
+{
+ return __builtin_fpclassify (0, 1, 4, 3, 2, true_min);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr103874.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr103874.c
new file mode 100644
index 0000000..2f0e2d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr103874.c
@@ -0,0 +1,12 @@
+/* PR debug/103874 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -gsplit-dwarf -dA -Wno-implicit-function-declaration" } */
+
+void
+foo (void)
+{
+ {
+ bar ();
+ baz ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/ifcvt-4.c b/gcc/testsuite/gcc.dg/ifcvt-4.c
index 0525102..37aa76a 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-4.c
@@ -2,7 +2,7 @@
/* { dg-additional-options "-misel" { target { powerpc*-*-* } } } */
/* { dg-additional-options "-march=z196" { target { s390x-*-* } } } */
/* { dg-additional-options "-mtune-ctrl=^one_if_conv_insn" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* msp430-*-* nios2-*-*} } */
+/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* visium-*-*" riscv*-*-* msp430-*-* nios2-*-*} } */
/* { dg-skip-if "" { "s390x-*-*" } { "-m31" } } */
typedef int word __attribute__((mode(word)));
diff --git a/gcc/testsuite/gcc.dg/torture/pr57147-2.c b/gcc/testsuite/gcc.dg/torture/pr57147-2.c
index 036a6d0..9952e3b 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57147-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57147-2.c
@@ -17,7 +17,13 @@ static void SetNaClSwitchExpectations (void)
void TestSyscall(void)
{
SetNaClSwitchExpectations();
+
_setjmp (g_return_jmp_buf);
}
+/* sizeof g_return_jmp_buf is zero size but it's being passed to
+ a function declared to take an array of one element which might
+ trigger a warning. Prune it out:
+ { dg-prune-output "-Wstringop-overflow" } */
+
/* { dg-final { scan-tree-dump-not "setjmp" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/evrp-trans2.c b/gcc/testsuite/gcc.dg/tree-ssa/evrp-trans2.c
new file mode 100644
index 0000000..d6fe427
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/evrp-trans2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-evrp" } */
+
+#define int unsigned
+#include "evrp-trans.c"
+
+/* { dg-final { scan-tree-dump-not "kill" "evrp" } } */
+/* { dg-final { scan-tree-dump-times "keep" 13 "evrp"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr89074.c b/gcc/testsuite/gcc.dg/tree-ssa/pr89074.c
new file mode 100644
index 0000000..666dfa7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr89074.c
@@ -0,0 +1,12 @@
+/* PR c++/89074 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+
+int
+foo (void)
+{
+ const char *a = &"foo"[0];
+ const char *b = "foo";
+ return a == b;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-17.c b/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
index f8bfb4b..fc3ef42 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
@@ -57,5 +57,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target vect_int_mult } } } */
-
+/* We need V2SI vector add support for the b[] vectorization, if we don't
+ have that we might only see the store vectorized and thus 2 subgraphs. */
+/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target { vect_int_mult && vect64 } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr104112-1.c b/gcc/testsuite/gcc.dg/vect/pr104112-1.c
new file mode 100644
index 0000000..84e69b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr104112-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast" } */
+/* { dg-additional-options "-march=armv8.2-a+sve -msve-vector-bits=512" { target aarch64-*-* } } */
+
+void
+boom(int n, double *a, double *x)
+{
+ int i, j;
+ double temp;
+
+ for (j = n; j >= 1; --j)
+ {
+ temp = x[j];
+ for (i = j - 1; i >= 1; --i)
+ temp += a[i + j] * x[i];
+ x[j] = temp;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr104112-2.c b/gcc/testsuite/gcc.dg/vect/pr104112-2.c
new file mode 100644
index 0000000..7469b3c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr104112-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* Diagnose vector ops that are later decomposed. */
+/* { dg-additional-options "-Wvector-operation-performance" } */
+
+unsigned short foo (unsigned short *a, int n)
+{
+ unsigned short sum = 0;
+ for (int i = 0; i < n; ++i)
+ sum += a[i];
+ return sum;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
index 873eddf..154c00a 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
@@ -61,9 +61,7 @@ int main (int argc, const char* argv[])
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_perm_short || vect32 } || vect_load_lanes } } } } */
/* We don't try permutes with a group size of 3 for variable-length
vectors. */
-/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target { vect_perm_short && { { ! vect_perm3_short } && { ! vect_partial_vectors_usage_1 } } } xfail vect_variable_length } } } */
-/* Try to vectorize the epilogue using partial vectors. */
-/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 2 "vect" { target { vect_perm_short && { { ! vect_perm3_short } && vect_partial_vectors_usage_1 } } xfail vect_variable_length } } } */
+/* { dg-final { scan-tree-dump "permutation requires at least three vectors" "vect" { target { vect_perm_short && { ! vect_perm3_short } } xfail vect_variable_length } } } */
/* { dg-final { scan-tree-dump-not "permutation requires at least three vectors" "vect" { target vect_perm3_short } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { { ! { vect_perm3_short || vect32 } } || vect_load_lanes } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm3_short || vect32 } && { ! vect_load_lanes } } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
index 665ca74..75494c2 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__DragonFly__)
#include <malloc.h>
#endif
#include <string.h>
@@ -189,7 +189,7 @@ void set_2d_array(real_t arr[LEN_2D][LEN_2D], real_t value, int stride)
}
void init(int** ip, real_t* s1, real_t* s2){
-#if !defined (__APPLE__) && !defined (_AIX)
+#if !defined (__APPLE__) && !defined (_AIX) && !defined(__DragonFly__)
xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
*ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
#else
diff --git a/gcc/testsuite/gcc.target/arm/crypto-vaese-erratum1.c b/gcc/testsuite/gcc.target/arm/crypto-vaese-erratum1.c
new file mode 100644
index 0000000..3f16688
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/crypto-vaese-erratum1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_crypto_ok } */
+/* { dg-options "-O2 -mfix-cortex-a57-aes-1742098 -dp" } */
+/* { dg-add-options arm_crypto } */
+
+#include "arm_neon.h"
+
+uint8x16_t
+foo (uint8x16_t v)
+{
+ const uint8x16_t key1 = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
+ const uint8x16_t key2 = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
+ int i;
+
+ for (i = 0; i < 16; ++i)
+ {
+ v = vaesmcq_u8 (vaeseq_u8 (v, key1));
+ v = vaesmcq_u8 (vaeseq_u8 (v, key2));
+ }
+ return v;
+}
+
+/* { dg-final { scan-assembler "aese.8\tq\[0-9\]+, q\[0-9\]+" } } */
+/* { dg-final { scan-assembler-times "aes_op_protect/2" 2} } */
+/* { dg-final { scan-assembler-times "aes_op_protect/0" 1} } */
+/* { dg-final { scan-assembler-times "(?:aesmc|aese_fused)_protected" 1} } */
diff --git a/gcc/testsuite/gcc.target/bpf/core-section-1.c b/gcc/testsuite/gcc.target/bpf/core-section-1.c
index 031acd5..4f16b08 100644
--- a/gcc/testsuite/gcc.target/bpf/core-section-1.c
+++ b/gcc/testsuite/gcc.target/bpf/core-section-1.c
@@ -35,4 +35,4 @@ int bar_func (struct T *t)
/* { dg-final { scan-assembler-times "ascii \"foo_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"bar_sec.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */
/* { dg-final { scan-assembler-times "bpfcr_type" 2 } } */
-/* { dg-final { scan-assembler-times "btfext_secinfo_rec_size" 2 } } */
+/* { dg-final { scan-assembler-times "btfext_core_info_rec_size" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/mask-pack-prefer128.c b/gcc/testsuite/gcc.target/i386/mask-pack-prefer128.c
new file mode 100644
index 0000000..c9ea37c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mask-pack-prefer128.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=skylake-avx512 -O3 -fopenmp-simd -fdump-tree-vect-details -mprefer-vector-width=128" } */
+/* Disabling epilogues until we find a better way to deal with scans. */
+/* { dg-additional-options "--param vect-epilogues-nomask=0" } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } } */
+/* { dg-final { scan-assembler-not "maskmov" } } */
+
+#include "mask-pack.c"
diff --git a/gcc/testsuite/gcc.target/i386/mask-pack-prefer256.c b/gcc/testsuite/gcc.target/i386/mask-pack-prefer256.c
new file mode 100644
index 0000000..841f51b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mask-pack-prefer256.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=skylake-avx512 -O3 -fopenmp-simd -fdump-tree-vect-details -mprefer-vector-width=256" } */
+/* Disabling epilogues until we find a better way to deal with scans. */
+/* { dg-additional-options "--param vect-epilogues-nomask=0" } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } } */
+/* { dg-final { scan-assembler-not "maskmov" } } */
+
+#include "mask-pack.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr103771.c b/gcc/testsuite/gcc.target/i386/pr103771.c
new file mode 100644
index 0000000..a1a9952
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr103771.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-march=cascadelake -O3 -fdump-tree-vect-details -mprefer-vector-width=128" } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+
+typedef unsigned char uint8_t;
+
+static uint8_t x264_clip_uint8 (int x)
+{
+ return x & (~255) ? (-x) >> 31 : x;
+}
+
+void
+mc_weight (uint8_t* __restrict dst, uint8_t* __restrict src,
+ int i_width,int i_scale)
+{
+ for(int x = 0; x < i_width; x++)
+ dst[x] = x264_clip_uint8 (src[x] * i_scale);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr104104.c b/gcc/testsuite/gcc.target/i386/pr104104.c
new file mode 100644
index 0000000..1653cae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104104.c
@@ -0,0 +1,10 @@
+/* PR target/104104 */
+/* { dg-do assemble { target vect_simd_clones } } */
+/* { dg-require-effective-target masm_intel } */
+/* { dg-options "-march=alderlake -masm=intel -O1 -fallow-store-data-races -funroll-all-loops" } */
+
+__attribute__ ((simd)) short int
+foo (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-5.c
index 34184812..8cbb319 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-5.c
@@ -14,7 +14,7 @@ get_exponent (__ieee128 *p)
{
__ieee128 source = *p;
- return scalar_extract_exp (source); /* { dg-error "requires ISA 3.0 IEEE 128-bit floating point" } */
+ return scalar_extract_exp (source); /* { dg-error "requires quad-precision floating-point arithmetic" } */
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-5.c
index 13c64fc..f3b6473 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-5.c
@@ -12,5 +12,5 @@ get_significand (__ieee128 *p)
{
__ieee128 source = *p;
- return (long long int) __builtin_vec_scalar_extract_sig (source); /* { dg-error "requires ISA 3.0 IEEE 128-bit floating point" } */
+ return (long long int) __builtin_vec_scalar_extract_sig (source); /* { dg-error "requires quad-precision floating-point arithmetic" } */
}
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-11.c
index a5dd852..bee5460 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-11.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-11.c
@@ -16,5 +16,5 @@ insert_exponent (__ieee128 *significand_p,
__ieee128 significand = *significand_p;
unsigned long long int exponent = *exponent_p;
- return scalar_insert_exp (significand, exponent); /* { dg-error "requires ISA 3.0 IEEE 128-bit floating point" } */
+ return scalar_insert_exp (significand, exponent); /* { dg-error "requires quad-precision floating-point arithmetic" } */
}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr104015-1.c b/gcc/testsuite/gcc.target/powerpc/pr104015-1.c
new file mode 100644
index 0000000..895c243
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr104015-1.c
@@ -0,0 +1,28 @@
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* As PR104015, we don't expect vectorizer will re-try some vector modes
+ for epilogues on Power9, since Power9 doesn't support partial vector
+ by defaut. */
+
+#include <stdarg.h>
+#define N 200
+
+void __attribute__((noinline))
+foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput)
+{
+ unsigned short i, a, b, c;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ *pOutput++ = a + b + c + 3;
+ *pOutput++ = a + b + c + 12;
+ *pOutput++ = a + b + c + 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "Re-trying epilogue analysis with vector mode" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr104015-2.c b/gcc/testsuite/gcc.target/powerpc/pr104015-2.c
new file mode 100644
index 0000000..ab482b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr104015-2.c
@@ -0,0 +1,29 @@
+/* { dg-require-effective-target power10_ok } */
+/* Vector with length instructions lxvl/stxvl are only enabled for 64 bit. */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-mdejagnu-cpu=power10 -O2 -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details" } */
+
+/* Power10 support partial vector for epilogue by default, it's expected
+ vectorizer would re-try for it once. */
+
+#include <stdarg.h>
+#define N 200
+
+void __attribute__((noinline))
+foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput)
+{
+ unsigned short i, a, b, c;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ *pOutput++ = a + b + c + 3;
+ *pOutput++ = a + b + c + 12;
+ *pOutput++ = a + b + c + 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Re-trying epilogue analysis with vector mode" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/sldoi_to_mov.c b/gcc/testsuite/gcc.target/powerpc/sldoi_to_mov.c
index 2053243..1310007 100644
--- a/gcc/testsuite/gcc.target/powerpc/sldoi_to_mov.c
+++ b/gcc/testsuite/gcc.target/powerpc/sldoi_to_mov.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O2 -mvsx" } */
#include <altivec.h>
vector signed int foo1 (vector signed int a) {
diff --git a/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-bool.c b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-bool.c
new file mode 100644
index 0000000..d2f18f58
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-bool.c
@@ -0,0 +1,39 @@
+/* Check if conversion for two instructions. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -march=z13 --save-temps" } */
+
+/* { dg-final { scan-assembler "lochinle\t%r.?,1" } } */
+/* { dg-final { scan-assembler "locrnle\t.*" } } */
+#include <stdbool.h>
+#include <limits.h>
+#include <stdio.h>
+#include <assert.h>
+
+__attribute__ ((noinline))
+int foo (int *a, unsigned int n)
+{
+ int min = 999999;
+ bool bla = false;
+ for (int i = 0; i < n; i++)
+ {
+ if (a[i] < min)
+ {
+ min = a[i];
+ bla = true;
+ }
+ }
+
+ if (bla)
+ min += 1;
+ return min;
+}
+
+int main()
+{
+ int a[] = {2, 1, -13, INT_MAX, INT_MIN, 0};
+
+ int res = foo (a, sizeof (a));
+
+ assert (res == (INT_MIN + 1));
+}
diff --git a/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c
new file mode 100644
index 0000000..1ced710
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-int.c
@@ -0,0 +1,39 @@
+/* Check if conversion for two instructions. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -march=z13 --save-temps" } */
+
+/* { dg-final { scan-assembler "lochinle\t%r.?,1" } } */
+/* { dg-final { scan-assembler "locrnle\t.*" } } */
+#include <stdbool.h>
+#include <limits.h>
+#include <stdio.h>
+#include <assert.h>
+
+__attribute__ ((noinline))
+int foo (int *a, unsigned int n)
+{
+ int min = 999999;
+ int bla = 0;
+ for (int i = 0; i < n; i++)
+ {
+ if (a[i] < min)
+ {
+ min = a[i];
+ bla = 1;
+ }
+ }
+
+ if (bla)
+ min += 1;
+ return min;
+}
+
+int main()
+{
+ int a[] = {2, 1, -13, INT_MAX, INT_MIN, 0};
+
+ int res = foo (a, sizeof (a));
+
+ assert (res == (INT_MIN + 1));
+}
diff --git a/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-long.c b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-long.c
new file mode 100644
index 0000000..5a1173f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/ifcvt-two-insns-long.c
@@ -0,0 +1,39 @@
+/* Check if conversion for two instructions. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -march=z13 --save-temps" } */
+
+/* { dg-final { scan-assembler "locghinle\t%r.?,1" } } */
+/* { dg-final { scan-assembler "locgrnle\t.*" } } */
+#include <stdbool.h>
+#include <limits.h>
+#include <stdio.h>
+#include <assert.h>
+
+__attribute__ ((noinline))
+long foo (long *a, unsigned long n)
+{
+ long min = 999999;
+ long bla = 0;
+ for (int i = 0; i < n; i++)
+ {
+ if (a[i] < min)
+ {
+ min = a[i];
+ bla = 1;
+ }
+ }
+
+ if (bla)
+ min += 1;
+ return min;
+}
+
+int main()
+{
+ long a[] = {2, 1, -13, LONG_MAX, LONG_MIN, 0};
+
+ long res = foo (a, sizeof (a));
+
+ assert (res == (LONG_MIN + 1));
+}
diff --git a/gcc/testsuite/gfortran.dg/pr102520.f90 b/gcc/testsuite/gfortran.dg/pr102520.f90
index 1c98c18..d2ea8f3 100644
--- a/gcc/testsuite/gfortran.dg/pr102520.f90
+++ b/gcc/testsuite/gfortran.dg/pr102520.f90
@@ -5,8 +5,6 @@ program p
type t
end type
type(t), parameter :: a(4) = shape(1) ! { dg-error "Incompatible" }
- type(t), parameter :: b(2,2) = reshape(a,[2,2]) ! { dg-error "Incompatible" }
- type(t), parameter :: c(2,2) = transpose(b) ! { dg-error "Unclassifiable" }
+ type(t), parameter :: b(2,2) = reshape(a,[2,2]) ! { dg-error "must be an array" }
+ type(t), parameter :: c(2,2) = transpose(b) ! { dg-error "must be of rank 2" }
end
-
-! { dg-error "Different shape for array assignment" " " { target *-*-* } 7 }
diff --git a/gcc/testsuite/gfortran.dg/pr102860.f90 b/gcc/testsuite/gfortran.dg/pr102860.f90
new file mode 100644
index 0000000..d0a7356
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr102860.f90
@@ -0,0 +1,10 @@
+! PR middle-end/102860
+! { dg-do compile { target { powerpc*-*-* } } }
+! { dg-require-effective-target powerpc_vsx_ok }
+! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power10" } }
+! { dg-options "-O2 -mcpu=power10" }
+
+function foo(a)
+ integer(kind=4) :: a(1024)
+ a(:) = modulo (a(:), 39)
+end function
diff --git a/gcc/testsuite/gfortran.dg/pr103692.f90 b/gcc/testsuite/gfortran.dg/pr103692.f90
new file mode 100644
index 0000000..9687a3c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr103692.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+! PR fortran/103692 - ICE in expand_constructor
+! Contributed by G.Steinmetz
+
+program p
+ character(3), parameter :: a(4) = 'abc'
+ character(*), parameter :: b(*) = (a(2:1))
+ character(*), parameter :: y(*) = [(a(2:1))]
+ character(*), parameter :: u(*) = a(2:1)
+ character(*), parameter :: v(*) = [a(2:1)]
+ character(*), parameter :: w(-1) = (a(2:1))
+ character(*), parameter :: x(-1) = a(2:1)
+ character(5), parameter :: c(3,3) = 'def'
+ character(*), parameter :: d(*) = [(c(2:1,2:))]
+ character(*), parameter :: e(*,*) = (c(2:1,2:))
+ if (len(b) /= 3 .or. size (b) /= 0) stop 1
+ if (len(y) /= 3 .or. size (y) /= 0) stop 2
+ if (len(d) /= 5 .or. size (d) /= 0) stop 3
+ if (len(e) /= 5 .or. any (shape (e) /= [0,2])) stop 4
+end
+
+! { dg-final { scan-tree-dump-not "_gfortran_stop_numeric" "original" } }
diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
index ea7ec9e..a1bc370 100644
--- a/gcc/testsuite/lib/g++-dg.exp
+++ b/gcc/testsuite/lib/g++-dg.exp
@@ -52,7 +52,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
if { [llength $gpp_std_list] > 0 } {
set std_list $gpp_std_list
} else {
- set std_list { 98 14 17 2a }
+ set std_list { 98 14 17 20 }
}
set option_list { }
foreach x $std_list {
diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp
index 6c57515..9d5b2cd 100644
--- a/gcc/testsuite/lib/gcov.exp
+++ b/gcc/testsuite/lib/gcov.exp
@@ -276,14 +276,13 @@ proc run-gcov-pytest { args } {
set testcase [remote_download host $testcase]
set result [remote_exec host $GCOV "$testcase -i"]
+ set pytest_script [lindex $args 1]
if { ![check_effective_target_pytest3] } {
- unsupported "$script pytest python3 is missing"
+ unsupported "$pytest_script pytest python3 is missing"
return
}
- set pytest_script [lindex $args 1]
setenv GCOV_PATH $testcase
- verbose "pytest_script: $srcdir $subdir $pytest_script" 2
spawn -noecho python3 -m pytest --color=no -rap -s --tb=no $srcdir/$subdir/$pytest_script
set prefix "\[^\r\n\]*"
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 534da14..ea27e44 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -2355,19 +2355,19 @@ toplev::finalize (void)
rtl_initialized = false;
this_target_rtl->target_specific_initialized = false;
- /* Needs to be called before cgraph_c_finalize since it uses symtab. */
- ipa_reference_c_finalize ();
- ipa_fnsummary_c_finalize ();
- ipa_modref_c_finalize ();
+ /* Needs to be called before cgraph_cc_finalize since it uses symtab. */
+ ipa_reference_cc_finalize ();
+ ipa_fnsummary_cc_finalize ();
+ ipa_modref_cc_finalize ();
ipa_edge_modifications_finalize ();
- cgraph_c_finalize ();
- cgraphunit_c_finalize ();
+ cgraph_cc_finalize ();
+ cgraphunit_cc_finalize ();
symtab_thunks_cc_finalize ();
- dwarf2out_c_finalize ();
- gcse_c_finalize ();
- ipa_cp_c_finalize ();
- ira_costs_c_finalize ();
+ dwarf2out_cc_finalize ();
+ gcse_cc_finalize ();
+ ipa_cp_cc_finalize ();
+ ira_costs_cc_finalize ();
/* save_decoded_options uses opts_obstack, so these must
be cleaned up together. */
diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index 4a8e224..77178a6 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -10220,7 +10220,7 @@ test_fully_connected ()
/* Run all of the selftests within this file. */
void
-tree_cfg_c_tests ()
+tree_cfg_cc_tests ()
{
test_linear_chain ();
test_diamond ();
diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc
index 5814a71..f4fc7d1 100644
--- a/gcc/tree-vect-generic.cc
+++ b/gcc/tree-vect-generic.cc
@@ -317,7 +317,10 @@ expand_vector_piecewise (gimple_stmt_iterator *gsi, elem_op_func f,
int i;
location_t loc = gimple_location (gsi_stmt (*gsi));
- if (ret_type || !parallel_p)
+ if (nunits == 1)
+ /* Do not diagnose decomposing single element vectors. */
+ ;
+ else if (ret_type || !parallel_p)
warning_at (loc, OPT_Wvector_operation_performance,
"vector operation will be expanded piecewise");
else
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index f1410b0..4860bfd 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -154,7 +154,8 @@ along with GCC; see the file COPYING3. If not see
http://gcc.gnu.org/projects/tree-ssa/vectorization.html
*/
-static void vect_estimate_min_profitable_iters (loop_vec_info, int *, int *);
+static void vect_estimate_min_profitable_iters (loop_vec_info, int *, int *,
+ unsigned *);
static stmt_vec_info vect_is_simple_reduction (loop_vec_info, stmt_vec_info,
bool *, bool *);
@@ -831,6 +832,7 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *shared)
skip_main_loop_edge (nullptr),
skip_this_loop_edge (nullptr),
reusable_accumulators (),
+ suggested_unroll_factor (1),
max_vectorization_factor (0),
mask_skip_niters (NULL_TREE),
rgroup_compare_type (NULL_TREE),
@@ -1834,7 +1836,8 @@ vect_known_niters_smaller_than_vf (loop_vec_info loop_vinfo)
definitely no, or -1 if it's worth retrying. */
static int
-vect_analyze_loop_costing (loop_vec_info loop_vinfo)
+vect_analyze_loop_costing (loop_vec_info loop_vinfo,
+ unsigned *suggested_unroll_factor)
{
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
unsigned int assumed_vf = vect_vf_for_cost (loop_vinfo);
@@ -1868,7 +1871,8 @@ vect_analyze_loop_costing (loop_vec_info loop_vinfo)
int min_profitable_iters, min_profitable_estimate;
vect_estimate_min_profitable_iters (loop_vinfo, &min_profitable_iters,
- &min_profitable_estimate);
+ &min_profitable_estimate,
+ suggested_unroll_factor);
if (min_profitable_iters < 0)
{
@@ -2152,10 +2156,16 @@ vect_determine_partial_vectors_and_peeling (loop_vec_info loop_vinfo,
vectors to the epilogue, with the main loop continuing to operate
on full vectors.
+ If we are unrolling we also do not want to use partial vectors. This
+ is to avoid the overhead of generating multiple masks and also to
+ avoid having to execute entire iterations of FALSE masked instructions
+ when dealing with one or less full iterations.
+
??? We could then end up failing to use partial vectors if we
decide to peel iterations into a prologue, and if the main loop
then ends up processing fewer than VF iterations. */
- if (param_vect_partial_vector_usage == 1
+ if ((param_vect_partial_vector_usage == 1
+ || loop_vinfo->suggested_unroll_factor > 1)
&& !LOOP_VINFO_EPILOGUE_P (loop_vinfo)
&& !vect_known_niters_smaller_than_vf (loop_vinfo))
LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P (loop_vinfo) = true;
@@ -2222,7 +2232,8 @@ vect_determine_partial_vectors_and_peeling (loop_vec_info loop_vinfo,
for it. The different analyses will record information in the
loop_vec_info struct. */
static opt_result
-vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
+vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal,
+ unsigned *suggested_unroll_factor)
{
opt_result ok = opt_result::success ();
int res;
@@ -2382,6 +2393,12 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal)
set of rgroups. */
gcc_assert (LOOP_VINFO_MASKS (loop_vinfo).is_empty ());
+ /* Apply the suggested unrolling factor, this was determined by the backend
+ during finish_cost the first time we ran the analyzis for this
+ vector mode. */
+ if (loop_vinfo->suggested_unroll_factor > 1)
+ LOOP_VINFO_VECT_FACTOR (loop_vinfo) *= loop_vinfo->suggested_unroll_factor;
+
/* This is the point where we can re-start analysis with SLP forced off. */
start_over:
@@ -2573,7 +2590,7 @@ start_over:
return ok;
/* Check the costings of the loop make vectorizing worthwhile. */
- res = vect_analyze_loop_costing (loop_vinfo);
+ res = vect_analyze_loop_costing (loop_vinfo, suggested_unroll_factor);
if (res < 0)
{
ok = opt_result::failure_at (vect_location,
@@ -2851,15 +2868,38 @@ vect_analyze_loop_1 (class loop *loop, vec_info_shared *shared,
machine_mode vector_mode = vector_modes[mode_i];
loop_vinfo->vector_mode = vector_mode;
+ unsigned int suggested_unroll_factor = 1;
/* Run the main analysis. */
- opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal);
+ opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal,
+ &suggested_unroll_factor);
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"***** Analysis %s with vector mode %s\n",
res ? "succeeded" : " failed",
GET_MODE_NAME (loop_vinfo->vector_mode));
+ if (!main_loop_vinfo && suggested_unroll_factor > 1)
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "***** Re-trying analysis for unrolling"
+ " with unroll factor %d.\n",
+ suggested_unroll_factor);
+ loop_vec_info unroll_vinfo
+ = vect_create_loop_vinfo (loop, shared, loop_form_info, main_loop_vinfo);
+ unroll_vinfo->vector_mode = vector_mode;
+ unroll_vinfo->suggested_unroll_factor = suggested_unroll_factor;
+ opt_result new_res = vect_analyze_loop_2 (unroll_vinfo, fatal, NULL);
+ if (new_res)
+ {
+ delete loop_vinfo;
+ loop_vinfo = unroll_vinfo;
+ }
+ else
+ delete unroll_vinfo;
+ }
+
/* Remember the autodetected vector mode. */
if (vector_mode == VOIDmode)
autodetected_vector_mode = loop_vinfo->vector_mode;
@@ -2964,6 +3004,12 @@ vect_analyze_loop (class loop *loop, vec_info_shared *shared)
unsigned int mode_i = 0;
unsigned HOST_WIDE_INT simdlen = loop->simdlen;
+ /* Keep track of the VF for each mode. Initialize all to 0 which indicates
+ a mode has not been analyzed. */
+ auto_vec<poly_uint64, 8> cached_vf_per_mode;
+ for (unsigned i = 0; i < vector_modes.length (); ++i)
+ cached_vf_per_mode.safe_push (0);
+
/* First determine the main loop vectorization mode, either the first
one that works, starting with auto-detecting the vector mode and then
following the targets order of preference, or the one with the
@@ -2971,6 +3017,10 @@ vect_analyze_loop (class loop *loop, vec_info_shared *shared)
while (1)
{
bool fatal;
+ unsigned int last_mode_i = mode_i;
+ /* Set cached VF to -1 prior to analysis, which indicates a mode has
+ failed. */
+ cached_vf_per_mode[last_mode_i] = -1;
opt_loop_vec_info loop_vinfo
= vect_analyze_loop_1 (loop, shared, &loop_form_info,
NULL, vector_modes, mode_i,
@@ -2980,6 +3030,12 @@ vect_analyze_loop (class loop *loop, vec_info_shared *shared)
if (loop_vinfo)
{
+ /* Analyzis has been successful so update the VF value. The
+ VF should always be a multiple of unroll_factor and we want to
+ capture the original VF here. */
+ cached_vf_per_mode[last_mode_i]
+ = exact_div (LOOP_VINFO_VECT_FACTOR (loop_vinfo),
+ loop_vinfo->suggested_unroll_factor);
/* Once we hit the desired simdlen for the first time,
discard any previous attempts. */
if (simdlen
@@ -3060,12 +3116,10 @@ vect_analyze_loop (class loop *loop, vec_info_shared *shared)
{
/* If the target does not support partial vectors we can shorten the
number of modes to analyze for the epilogue as we know we can't pick a
- mode that has at least as many NUNITS as the main loop's vectorization
- factor, since that would imply the epilogue's vectorization factor
- would be at least as high as the main loop's and we would be
- vectorizing for more scalar iterations than there would be left. */
+ mode that would lead to a VF at least as big as the
+ FIRST_VINFO_VF. */
if (!supports_partial_vectors
- && maybe_ge (GET_MODE_NUNITS (vector_modes[mode_i]), first_vinfo_vf))
+ && maybe_ge (cached_vf_per_mode[mode_i], first_vinfo_vf))
{
mode_i++;
if (mode_i == vector_modes.length ())
@@ -3860,7 +3914,8 @@ vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
static void
vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
int *ret_min_profitable_niters,
- int *ret_min_profitable_estimate)
+ int *ret_min_profitable_estimate,
+ unsigned *suggested_unroll_factor)
{
int min_profitable_iters;
int min_profitable_estimate;
@@ -4227,7 +4282,22 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
/* Complete the target-specific cost calculations. */
finish_cost (loop_vinfo->vector_costs, loop_vinfo->scalar_costs,
- &vec_prologue_cost, &vec_inside_cost, &vec_epilogue_cost);
+ &vec_prologue_cost, &vec_inside_cost, &vec_epilogue_cost,
+ suggested_unroll_factor);
+
+ if (suggested_unroll_factor && *suggested_unroll_factor > 1
+ && LOOP_VINFO_MAX_VECT_FACTOR (loop_vinfo) != MAX_VECTORIZATION_FACTOR
+ && !known_le (LOOP_VINFO_VECT_FACTOR (loop_vinfo) *
+ *suggested_unroll_factor,
+ LOOP_VINFO_MAX_VECT_FACTOR (loop_vinfo)))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "can't unroll as unrolled vectorization factor larger"
+ " than maximum vectorization factor: %d\n",
+ LOOP_VINFO_MAX_VECT_FACTOR (loop_vinfo));
+ *suggested_unroll_factor = 1;
+ }
vec_outside_cost = (int)(vec_prologue_cost + vec_epilogue_cost);
@@ -4923,9 +4993,22 @@ vect_find_reusable_accumulator (loop_vec_info loop_vinfo,
/* Handle the case where we can reduce wider vectors to narrower ones. */
tree vectype = STMT_VINFO_VECTYPE (reduc_info);
tree old_vectype = TREE_TYPE (accumulator->reduc_input);
+ unsigned HOST_WIDE_INT m;
if (!constant_multiple_p (TYPE_VECTOR_SUBPARTS (old_vectype),
- TYPE_VECTOR_SUBPARTS (vectype)))
+ TYPE_VECTOR_SUBPARTS (vectype), &m))
return false;
+ /* Check the intermediate vector types are available. */
+ while (m > 2)
+ {
+ m /= 2;
+ tree intermediate_vectype = get_related_vectype_for_scalar_type
+ (TYPE_MODE (vectype), TREE_TYPE (vectype),
+ exact_div (TYPE_VECTOR_SUBPARTS (old_vectype), m));
+ if (!intermediate_vectype
+ || !directly_supported_p (STMT_VINFO_REDUC_CODE (reduc_info),
+ intermediate_vectype))
+ return false;
+ }
/* Non-SLP reductions might apply an adjustment after the reduction
operation, in order to simplify the initialization of the accumulator.
@@ -7194,10 +7277,13 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
This only works when we see both the reduction PHI and its only consumer
in vectorizable_reduction and there are no intermediate stmts
- participating. */
+ participating. When unrolling we want each unrolled iteration to have its
+ own reduction accumulator since one of the main goals of unrolling a
+ reduction is to reduce the aggregate loop-carried latency. */
if (ncopies > 1
&& (STMT_VINFO_RELEVANT (stmt_info) <= vect_used_only_live)
- && reduc_chain_length == 1)
+ && reduc_chain_length == 1
+ && loop_vinfo->suggested_unroll_factor == 1)
single_defuse_cycle = true;
if (single_defuse_cycle || lane_reduc_code_p)
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 95be4f3..824ebb6 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -12124,6 +12124,7 @@ supportable_narrowing_operation (enum tree_code code,
tree intermediate_type, prev_type;
machine_mode intermediate_mode, prev_mode;
int i;
+ unsigned HOST_WIDE_INT n_elts;
bool uns;
*multi_step_cvt = 0;
@@ -12133,8 +12134,9 @@ supportable_narrowing_operation (enum tree_code code,
c1 = VEC_PACK_TRUNC_EXPR;
if (VECTOR_BOOLEAN_TYPE_P (narrow_vectype)
&& VECTOR_BOOLEAN_TYPE_P (vectype)
- && TYPE_MODE (narrow_vectype) == TYPE_MODE (vectype)
- && SCALAR_INT_MODE_P (TYPE_MODE (vectype)))
+ && SCALAR_INT_MODE_P (TYPE_MODE (vectype))
+ && TYPE_VECTOR_SUBPARTS (vectype).is_constant (&n_elts)
+ && n_elts < BITS_PER_UNIT)
optab1 = vec_pack_sbool_trunc_optab;
else
optab1 = optab_for_tree_code (c1, vectype, optab_default);
@@ -12225,8 +12227,9 @@ supportable_narrowing_operation (enum tree_code code,
= lang_hooks.types.type_for_mode (intermediate_mode, uns);
if (VECTOR_BOOLEAN_TYPE_P (intermediate_type)
&& VECTOR_BOOLEAN_TYPE_P (prev_type)
- && intermediate_mode == prev_mode
- && SCALAR_INT_MODE_P (prev_mode))
+ && SCALAR_INT_MODE_P (prev_mode)
+ && TYPE_VECTOR_SUBPARTS (intermediate_type).is_constant (&n_elts)
+ && n_elts < BITS_PER_UNIT)
interm_optab = vec_pack_sbool_trunc_optab;
else
interm_optab
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 86f90ae..524c86c 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -642,6 +642,13 @@ public:
about the reductions that generated them. */
hash_map<tree, vect_reusable_accumulator> reusable_accumulators;
+ /* The number of times that the target suggested we unroll the vector loop
+ in order to promote more ILP. This value will be used to re-analyze the
+ loop for vectorization and if successful the value will be folded into
+ vectorization_factor (and therefore exactly divides
+ vectorization_factor). */
+ unsigned int suggested_unroll_factor;
+
/* Maximum runtime vectorization factor, or MAX_VECTORIZATION_FACTOR
if there is no particular limit. */
unsigned HOST_WIDE_INT max_vectorization_factor;
@@ -1465,6 +1472,7 @@ public:
unsigned int epilogue_cost () const;
unsigned int outside_cost () const;
unsigned int total_cost () const;
+ unsigned int suggested_unroll_factor () const;
protected:
unsigned int record_stmt_cost (stmt_vec_info, vect_cost_model_location,
@@ -1484,6 +1492,9 @@ protected:
/* The costs of the three regions, indexed by vect_cost_model_location. */
unsigned int m_costs[3];
+ /* The suggested unrolling factor determined at finish_cost. */
+ unsigned int m_suggested_unroll_factor;
+
/* True if finish_cost has been called. */
bool m_finished;
};
@@ -1496,6 +1507,7 @@ vector_costs::vector_costs (vec_info *vinfo, bool costing_for_scalar)
: m_vinfo (vinfo),
m_costing_for_scalar (costing_for_scalar),
m_costs (),
+ m_suggested_unroll_factor(1),
m_finished (false)
{
}
@@ -1544,6 +1556,15 @@ vector_costs::total_cost () const
return body_cost () + outside_cost ();
}
+/* Return the suggested unroll factor. */
+
+inline unsigned int
+vector_costs::suggested_unroll_factor () const
+{
+ gcc_checking_assert (m_finished);
+ return m_suggested_unroll_factor;
+}
+
#define VECT_MAX_COST 1000
/* The maximum number of intermediate steps required in multi-step type
@@ -1720,12 +1741,14 @@ add_stmt_cost (vector_costs *costs, stmt_info_for_cost *i)
static inline void
finish_cost (vector_costs *costs, const vector_costs *scalar_costs,
unsigned *prologue_cost, unsigned *body_cost,
- unsigned *epilogue_cost)
+ unsigned *epilogue_cost, unsigned *suggested_unroll_factor = NULL)
{
costs->finish_cost (scalar_costs);
*prologue_cost = costs->prologue_cost ();
*body_cost = costs->body_cost ();
*epilogue_cost = costs->epilogue_cost ();
+ if (suggested_unroll_factor)
+ *suggested_unroll_factor = costs->suggested_unroll_factor ();
}
inline void
diff --git a/gcc/tree.cc b/gcc/tree.cc
index ae159ee..c4b3661 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -15203,7 +15203,7 @@ test_escaped_strings (void)
/* Run all of the selftests within this file. */
void
-tree_c_tests ()
+tree_cc_tests ()
{
test_integer_constants ();
test_identifiers ();
diff --git a/gcc/typed-splay-tree.cc b/gcc/typed-splay-tree.cc
index 194dd99..df4457c 100644
--- a/gcc/typed-splay-tree.cc
+++ b/gcc/typed-splay-tree.cc
@@ -72,7 +72,7 @@ test_str_to_int ()
/* Run all of the selftests within this file. */
void
-typed_splay_tree_c_tests ()
+typed_splay_tree_cc_tests ()
{
test_str_to_int ();
}
diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc
index 1e495bd..32ca693 100644
--- a/gcc/value-relation.cc
+++ b/gcc/value-relation.cc
@@ -889,13 +889,14 @@ dom_oracle::register_relation (basic_block bb, relation_kind k, tree op1,
else
{
relation_chain *ptr = set_one_relation (bb, k, op1, op2);
- register_transitives (bb, *ptr);
+ if (ptr)
+ register_transitives (bb, *ptr);
}
}
// Register relation K between OP! and OP2 in block BB.
// This creates the record and searches for existing records in the dominator
-// tree to merge with.
+// tree to merge with. Return the record, or NULL if no record was created.
relation_chain *
dom_oracle::set_one_relation (basic_block bb, relation_kind k, tree op1,
@@ -940,6 +941,13 @@ dom_oracle::set_one_relation (basic_block bb, relation_kind k, tree op1,
}
else
{
+ if (m_relations[bbi].m_num_relations >= param_relation_block_limit)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Not registered due to bb being full\n");
+ return NULL;
+ }
+ m_relations[bbi].m_num_relations++;
// Check for an existing relation further up the DOM chain.
// By including dominating relations, The first one found in any search
// will be the aggregate of all the previous ones.
@@ -1040,7 +1048,8 @@ dom_oracle::register_transitives (basic_block root_bb,
value_relation nr (relation.kind (), r1, r2);
if (nr.apply_transitive (*ptr))
{
- set_one_relation (root_bb, nr.kind (), nr.op1 (), nr.op2 ());
+ if (!set_one_relation (root_bb, nr.kind (), nr.op1 (), nr.op2 ()))
+ return;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Registering transitive relation ");
diff --git a/gcc/value-relation.h b/gcc/value-relation.h
index 207defa..44d0796 100644
--- a/gcc/value-relation.h
+++ b/gcc/value-relation.h
@@ -157,6 +157,7 @@ class relation_chain_head
public:
bitmap m_names; // ssa_names with relations in this block.
class relation_chain *m_head; // List of relations in block.
+ int m_num_relations; // Number of relations in block.
relation_kind find_relation (const_bitmap b1, const_bitmap b2) const;
};
diff --git a/gcc/vec-perm-indices.cc b/gcc/vec-perm-indices.cc
index 5c2d94f..acf9022 100644
--- a/gcc/vec-perm-indices.cc
+++ b/gcc/vec-perm-indices.cc
@@ -371,7 +371,7 @@ test_vec_perm_12 (void)
/* Run selftests for this file. */
void
-vec_perm_indices_c_tests ()
+vec_perm_indices_cc_tests ()
{
test_vec_perm_12 ();
}
diff --git a/gcc/vec.cc b/gcc/vec.cc
index 1131ecb..af4a5e5d 100644
--- a/gcc/vec.cc
+++ b/gcc/vec.cc
@@ -571,7 +571,7 @@ test_auto_delete_vec ()
/* Run all of the selftests within this file. */
void
-vec_c_tests ()
+vec_cc_tests ()
{
test_init ();
test_quick_push ();