aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
AgeCommit message (Collapse)AuthorFilesLines
2020-08-03doc: fix a typo in tm.texiWei Wentao2-2/+2
gcc/ * doc/tm.texi.in (VECTOR_STORE_FLAG_VALUE): Fix a typo. * doc/tm.texi: Regenerate.
2020-08-03doc: Add missing comma after octeontx2f95mmRichard Sandiford1-1/+1
gcc/ * doc/invoke.texi: Add missing comma after octeontx2f95mm entry.
2020-08-03aarch64: Add A64FX machine modelQian Jianhua1-0/+1
This patch add support for Fujitsu A64FX, as the first step of adding A64FX machine model. A64FX is used in FUJITSU Supercomputer PRIMEHPC FX1000, PRIMEHPC FX700, and supercomputer Fugaku. The official microarchitecture information of A64FX can be read at https://github.com/fujitsu/A64FX. 2020-08-03 Qian jianhua <qianjh@cn.fujitsu.com> gcc/ * config/aarch64/aarch64-cores.def (a64fx): New core. * config/aarch64/aarch64-tune.md: Regenerated. * config/aarch64/aarch64.c (a64fx_prefetch_tune, a64fx_tunings): New. * doc/invoke.texi: Add a64fx to the list.
2020-08-03mark match.pd ! not implemented on GENERICRichard Biener1-1/+2
This makes us error when the ! operator modifier is encountered when not targeting GIMPLE. 2020-08-03 Richard Biener <rguenther@suse.de> * genmatch.c (parser::gimple): New. (parser::parser): Initialize gimple flag member. (parser::parse_expr): Error on ! operator modifier when not targeting GIMPLE. (main): Pass down gimple flag to parser ctor. * doc/match-and-simplify.texi: Amend accordingly.
2020-08-01C-SKY: Add -mfloat-abi= option.Jojo R1-0/+18
gcc/ChangeLog: * config/csky/csky_opts.h (float_abi_type): New. * config/csky/csky.h (TARGET_SOFT_FLOAT): New. (TARGET_HARD_FLOAT): New. (TARGET_HARD_FLOAT_ABI): New. (OPTION_DEFAULT_SPECS): Use mfloat-abi. * config/csky/csky.opt (mfloat-abi): New. * doc/invoke.texi (C-SKY Options): Document -mfloat-abi=.
2020-07-31Amend match.pd syntax with force-simplified resultsRichard Biener1-0/+15
This adds a ! marker to result expressions that should simplify (and if not fail the simplification). This can for example be used like (simplify (plus (vec_cond:s @0 @1 @2) @3) (vec_cond @0 (plus! @1 @3) (plus! @2 @3))) to make the simplification only apply in case both plus operations in the result end up simplified to a simple operand. 2020-07-31 Richard Biener <rguenther@suse.de> * genmatch.c (expr::force_leaf): Add and initialize. (expr::gen_transform): Honor force_leaf by passing NULL as sequence argument to maybe_push_res_to_seq. (parser::parse_expr): Allow ! marker on result expression operations. * doc/match-and-simplify.texi: Amend.
2020-07-31RISC-V: Add support for TLS stack protector canary accessCooper Qu1-1/+21
gcc/ * config/riscv/riscv-opts.h (stack_protector_guard): New enum. * config/riscv/riscv.c (riscv_option_override): Handle the new options. * config/riscv/riscv.md (stack_protect_set): New pattern to handle flexible stack protector guard settings. (stack_protect_set_<mode>): Ditto. (stack_protect_test): Ditto. (stack_protect_test_<mode>): Ditto. * config/riscv/riscv.opt (mstack-protector-guard=, mstack-protector-guard-reg=, mstack-protector-guard-offset=): New options. * doc/invoke.texi (Option Summary) [RISC-V Options]: Add -mstack-protector-guard=, -mstack-protector-guard-reg=, and -mstack-protector-guard-offset=. (RISC-V Options): Ditto. Signed-off-by: cooper <cooper.qu@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
2020-07-29Don't make -gsplit-dwarf imply -gFangrui Song1-5/+5
-gsplit-dwarf introduces order dependency: it overrides previous -g0 and -g1. Don't imply -g so that it can be plugged into a build without worrying that unnecessary debugging information may be generated. 2020-05-13 Fangrui Song <maskray@google.com> PR debug/95096 * opts.c (common_handle_option): Don't make -gsplit-dwarf imply -g. * doc/invoke.texi (-gsplit-dwarf): Update documentation.
2020-07-27LTO: Add -fcf-protection=checkH.J. Lu1-2/+7
Mixing -fcf-protection and -fcf-protection=none objects are allowed. Linker just merges -fcf-protection values from all input objects. Add -fcf-protection=check for the final link with LTO. An error is issued if LTO object files are compiled with different -fcf-protection values. Otherwise, -fcf-protection=check is ignored at the compile time. Without explicit -fcf-protection at link time, -fcf-protection values from LTO object files are merged at the final link. gcc/ PR bootstrap/96203 * common.opt: Add -fcf-protection=check. * flag-types.h (cf_protection_level): Add CF_CHECK. * lto-wrapper.c (merge_and_complain): Issue an error for mismatching -fcf-protection values with -fcf-protection=check. Otherwise, merge -fcf-protection values. * doc/invoke.texi: Document -fcf-protection=check. gcc/testsuite/ PR bootstrap/96203 * gcc.target/i386/pr96203-1.c: New test. * gcc.target/i386/pr96203-2.c: Likewise.
2020-07-26rs6000: add option -mblock-ops-unaligned-vsxAaron Sawdey1-0/+8
This option is mostly being added to provide -mno-block-ops-unaligned-vsx. The default is set the same as -mefficient-unaligned-vsx. This option will control the use of unaligned VSX loads/stores in the inline expansion of memcpy() and memmove(). The use case for this would be if you're compiling code that is doing a memcpy to memory mapped device memory that is cache-inhibited. On some powerpc processors this requires the unaligned vsx ops to be emulated by the kernel which is very slow. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_option_override_internal): Set the default value for -mblock-ops-unaligned-vsx. * config/rs6000/rs6000.opt: Add -mblock-ops-unaligned-vsx. * doc/invoke.texi: Document -mblock-ops-unaligned-vsx.
2020-07-22doc: fix a typo in languages.texiWei Wentao1-1/+1
gcc/ * doc/languages.texi: Fix “then”/“than” typo.
2020-07-21Add TARGET_LOWER_LOCAL_DECL_ALIGNMENT [PR95237]Sunil K Pandey2-0/+7
Default for this hook is NOP. For x86, in 32 bit mode, this hook sets alignment of long long on stack to 32 bits if preferred stack boundary is 32 bits. - This patch prevents lowering of alignment from following macros. LOCAL_ALIGNMENT STACK_SLOT_ALIGNMENT LOCAL_DECL_ALIGNMENT - This patch fixes gcc.target/i386/pr69454-2.c gcc.target/i386/stackalign/longlong-1.c - Regression test on x86-64, no new fail introduced. Tested on x86-64. gcc/c/ChangeLog: PR target/95237 * c-decl.c (finish_decl): Call target hook lower_local_decl_alignment to lower local decl alignment. gcc/ChangeLog: PR target/95237 * config/i386/i386-protos.h (ix86_local_alignment): Add another function parameter may_lower alignment. Default is false. * config/i386/i386.c (ix86_lower_local_decl_alignment): New function. (ix86_local_alignment): Amend ix86_local_alignment to accept another parameter may_lower. If may_lower is true, new align may be lower than incoming alignment. If may_lower is false, new align will be greater or equal to incoming alignment. (TARGET_LOWER_LOCAL_DECL_ALIGNMENT): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_LOWER_LOCAL_DECL_ALIGNMENT): New hook. * target.def (lower_local_decl_alignment): New hook. gcc/cp/ChangeLog: PR target/95237 * decl.c (cp_finish_decl): Call target hook lower_local_decl_alignment to lower local decl alignment. gcc/testsuite/ChangeLog: PR target/95237 * c-c++-common/pr95237-1.c: New test. * c-c++-common/pr95237-2.c: New test. * c-c++-common/pr95237-3.c: New test. * c-c++-common/pr95237-4.c: New test. * c-c++-common/pr95237-5.c: New test. * c-c++-common/pr95237-6.c: New test. * c-c++-common/pr95237-7.c: New test. * c-c++-common/pr95237-8.c: New test. * c-c++-common/pr95237-9.c: New test.
2020-07-19vect: Support length-based partial vectors approachKewen Lin1-0/+9
Power9 supports vector load/store instruction lxvl/stxvl which allow us to operate partial vectors with one specific length. This patch extends some of current mask-based partial vectors support code for length-based approach, also adds some length specific support code. So far it assumes that we can only have one partial vectors approach at the same time, it will disable to use partial vectors if both approaches co-exist. Like the description of optab len_load/len_store, the length-based approach can have two flavors, one is length in bytes, the other is length in lanes. This patch is mainly implemented and tested for length in bytes, but as Richard S. suggested, most of code has considered both flavors. This also introduces one parameter vect-partial-vector-usage allow users to control when the loop vectorizer considers using partial vectors as an alternative to falling back to scalar code. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_option_override_internal): Set param_vect_partial_vector_usage to 0 explicitly. * doc/invoke.texi (vect-partial-vector-usage): Document new option. * optabs-query.c (get_len_load_store_mode): New function. * optabs-query.h (get_len_load_store_mode): New declare. * params.opt (vect-partial-vector-usage): New. * tree-vect-loop-manip.c (vect_set_loop_controls_directly): Add the handlings for vectorization using length-based partial vectors, call vect_gen_len for length generation, and rename some variables with items instead of scalars. (vect_set_loop_condition_partial_vectors): Add the handlings for vectorization using length-based partial vectors. (vect_do_peeling): Allow remaining eiters less than epilogue vf for LOOP_VINFO_USING_PARTIAL_VECTORS_P. * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Init epil_using_partial_vectors_p. (_loop_vec_info::~_loop_vec_info): Call release_vec_loop_controls for lengths destruction. (vect_verify_loop_lens): New function. (vect_analyze_loop): Add handlings for epilogue of loop when it's marked to use vectorization using partial vectors. (vect_analyze_loop_2): Add the check to allow only one vectorization approach using partial vectorization at the same time. Check param vect-partial-vector-usage for partial vectors decision. Mark LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P if the epilogue is considerable to use partial vectors. Call release_vec_loop_controls for lengths destruction. (vect_estimate_min_profitable_iters): Adjust for loop vectorization using length-based partial vectors. (vect_record_loop_mask): Init factor to 1 for vectorization using mask-based partial vectors. (vect_record_loop_len): New function. (vect_get_loop_len): Likewise. * tree-vect-stmts.c (check_load_store_for_partial_vectors): Add checks for vectorization using length-based partial vectors. Factor some code to lambda function get_valid_nvectors. (vectorizable_store): Add handlings when using length-based partial vectors. (vectorizable_load): Likewise. (vect_gen_len): New function. * tree-vectorizer.h (struct rgroup_controls): Add field factor mainly for length-based partial vectors. (vec_loop_lens): New typedef. (_loop_vec_info): Add lens and epil_using_partial_vectors_p. (LOOP_VINFO_EPIL_USING_PARTIAL_VECTORS_P): New macro. (LOOP_VINFO_LENS): Likewise. (LOOP_VINFO_FULLY_WITH_LENGTH_P): Likewise. (vect_record_loop_len): New declare. (vect_get_loop_len): Likewise. (vect_gen_len): Likewise.
2020-07-17Testuite: Document environment setting directivesTamar Christina1-0/+12
This document some of the existing DejaGnu directives to modify environment variables before test or compiler invocations. gcc/ChangeLog: * doc/sourcebuild.texi (dg-set-compiler-env-var, dg-set-target-env-var): Document.
2020-07-16doc: Document TARGET_TRULY_NOOP_TRUNCATION requires trunc?i?i2 patterns.Roger Sayle1-1/+3
2020-07-16 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog: * target.def (TARGET_TRULY_NOOP_TRUNCATION): Clarify that targets that return false, indicating SUBREGs shouldn't be used, also need to provide a trunc?i?i2 optab that performs this truncation. * doc/tm.texi: Regenerate.
2020-07-14diagnostics: Support conversion of tabs to spaces [PR49973] [PR86904]Lewis Hyatt1-5/+63
Supports conversion of tabs to spaces when outputting diagnostics. Also adds -fdiagnostics-column-unit and -fdiagnostics-column-origin options to control how the column number is output, thereby resolving the two PRs. gcc/c-family/ChangeLog: PR other/86904 * c-indentation.c (should_warn_for_misleading_indentation): Get global tabstop from the new source. * c-opts.c (c_common_handle_option): Remove handling of -ftabstop, which is now a common option. * c.opt: Likewise. gcc/ChangeLog: PR preprocessor/49973 PR other/86904 * common.opt: Handle -ftabstop here instead of in c-family options. Add -fdiagnostics-column-unit= and -fdiagnostics-column-origin= options. * opts.c (common_handle_option): Handle the new options. * diagnostic-format-json.cc (json_from_expanded_location): Add diagnostic_context argument. Use it to convert column numbers as per the new options. (json_from_location_range): Likewise. (json_from_fixit_hint): Likewise. (json_end_diagnostic): Pass the new context argument to helper functions above. Add "column-origin" field to the output. (test_unknown_location): Add the new context argument to calls to helper functions. (test_bad_endpoints): Likewise. * diagnostic-show-locus.c (exploc_with_display_col::exploc_with_display_col): Support tabstop parameter. (layout_point::layout_point): Make use of class exploc_with_display_col. (layout_range::layout_range): Likewise. (struct line_bounds): Clarify that the units are now always display columns. Rename members accordingly. Add constructor. (layout::print_source_line): Add support for tab expansion. (make_range): Adapt to class layout_range changes. (layout::maybe_add_location_range): Likewise. (layout::layout): Adapt to class exploc_with_display_col changes. (layout::calculate_x_offset_display): Support tabstop parameter. (layout::print_annotation_line): Adapt to struct line_bounds changes. (layout::print_line): Likewise. (line_label::line_label): Add diagnostic_context argument. (get_affected_range): Likewise. (get_printed_columns): Likewise. (layout::print_any_labels): Adapt to struct line_label changes. (class correction): Add m_tabstop member. (correction::correction): Add tabstop argument. (correction::compute_display_cols): Use m_tabstop. (class line_corrections): Add m_context member. (line_corrections::line_corrections): Add diagnostic_context argument. (line_corrections::add_hint): Use m_context to handle tabstops. (layout::print_trailing_fixits): Adapt to class line_corrections changes. (test_layout_x_offset_display_utf8): Support tabstop parameter. (test_layout_x_offset_display_tab): New selftest. (test_one_liner_colorized_utf8): Likewise. (test_tab_expansion): Likewise. (test_diagnostic_show_locus_one_liner_utf8): Call the new tests. (diagnostic_show_locus_c_tests): Likewise. (test_overlapped_fixit_printing): Adapt to helper class and function changes. (test_overlapped_fixit_printing_utf8): Likewise. (test_overlapped_fixit_printing_2): Likewise. * diagnostic.h (enum diagnostics_column_unit): New enum. (struct diagnostic_context): Add members for the new options. (diagnostic_converted_column): Declare. (json_from_expanded_location): Add new context argument. * diagnostic.c (diagnostic_initialize): Initialize new members. (diagnostic_converted_column): New function. (maybe_line_and_column): Be willing to output a column of 0. (diagnostic_get_location_text): Convert column number as per the new options. (diagnostic_report_current_module): Likewise. (assert_location_text): Add origin and column_unit arguments for testing the new functionality. (test_diagnostic_get_location_text): Test the new functionality. * doc/invoke.texi: Document the new options and behavior. * input.h (location_compute_display_column): Add tabstop argument. * input.c (location_compute_display_column): Likewise. (test_cpp_utf8): Add selftests for tab expansion. * tree-diagnostic-path.cc (default_tree_make_json_for_path): Pass the new context argument to json_from_expanded_location(). libcpp/ChangeLog: PR preprocessor/49973 PR other/86904 * include/cpplib.h (struct cpp_options): Removed support for -ftabstop, which is now handled by diagnostic_context. (class cpp_display_width_computation): New class. (cpp_byte_column_to_display_column): Add optional tabstop argument. (cpp_display_width): Likewise. (cpp_display_column_to_byte_column): Likewise. * charset.c (cpp_display_width_computation::cpp_display_width_computation): New function. (cpp_display_width_computation::advance_display_cols): Likewise. (compute_next_display_width): Removed and implemented this functionality in a new function... (cpp_display_width_computation::process_next_codepoint): ...here. (cpp_byte_column_to_display_column): Added tabstop argument. Reimplemented in terms of class cpp_display_width_computation. (cpp_display_column_to_byte_column): Likewise. * init.c (cpp_create_reader): Remove handling of -ftabstop, which is now handled by diagnostic_context. gcc/testsuite/ChangeLog: PR preprocessor/49973 PR other/86904 * c-c++-common/Wmisleading-indentation-3.c: Adjust expected output for new defaults. * c-c++-common/Wmisleading-indentation.c: Likewise. * c-c++-common/diagnostic-format-json-1.c: Likewise. * c-c++-common/diagnostic-format-json-2.c: Likewise. * c-c++-common/diagnostic-format-json-3.c: Likewise. * c-c++-common/diagnostic-format-json-4.c: Likewise. * c-c++-common/diagnostic-format-json-5.c: Likewise. * c-c++-common/missing-close-symbol.c: Likewise. * g++.dg/diagnostic/bad-binary-ops.C: Likewise. * g++.dg/parse/error4.C: Likewise. * g++.old-deja/g++.brendan/crash11.C: Likewise. * g++.old-deja/g++.pt/overload2.C: Likewise. * g++.old-deja/g++.robertl/eb109.C: Likewise. * gcc.dg/analyzer/malloc-paths-9.c: Likewise. * gcc.dg/bad-binary-ops.c: Likewise. * gcc.dg/format/branch-1.c: Likewise. * gcc.dg/format/pr79210.c: Likewise. * gcc.dg/plugin/diagnostic-test-expressions-1.c: Likewise. * gcc.dg/plugin/diagnostic-test-string-literals-1.c: Likewise. * gcc.dg/redecl-4.c: Likewise. * gfortran.dg/diagnostic-format-json-1.F90: Likewise. * gfortran.dg/diagnostic-format-json-2.F90: Likewise. * gfortran.dg/diagnostic-format-json-3.F90: Likewise. * go.dg/arrayclear.go: Add a comment explaining why adding a comment was necessary to work around a dejagnu bug. * c-c++-common/diagnostic-units-1.c: New test. * c-c++-common/diagnostic-units-2.c: New test. * c-c++-common/diagnostic-units-3.c: New test. * c-c++-common/diagnostic-units-4.c: New test. * c-c++-common/diagnostic-units-5.c: New test. * c-c++-common/diagnostic-units-6.c: New test. * c-c++-common/diagnostic-units-7.c: New test. * c-c++-common/diagnostic-units-8.c: New test.
2020-07-14doc: Fix some typosNathan Sidwell2-2/+1
gty calls gt_clear*e*_cache not gt_clear_cache. I know not why it is named so, but at least document it correctly. invoke.texi had a duplicate opindex. gcc/ * doc/gty.texi: Fic gt_cleare_cache name. * doc/invoke.texi: Remove duplicate opindex Wabi-tag.
2020-07-13doc: Clarify __builtin_return_address [PR94891]Szabolcs Nagy1-2/+15
The expected semantics and valid usage of __builtin_return_address is not clear since it exposes implementation internals that are normally not meaningful to portable c code. This documentation change tries to clarify the semantics in case the return address is stored in a mangled form. This affects AArch64 when pointer authentication is used for the return address signing (i.e. -mbranch-protection=pac-ret). 2020-07-13 Szabolcs Nagy <szabolcs.nagy@arm.com> gcc/ChangeLog: PR target/94891 * doc/extend.texi: Update the text for __builtin_return_address.
2020-07-10arm: Implement Armv8.1-M low overhead loopsAndrea Corallo1-0/+11
gcc/ChangeLog 2020-06-18 Andrea Corallo <andrea.corallo@arm.com> Mihail-Calin Ionescu <mihail.ionescu@arm.com> Iain Apreotesei <iain.apreotesei@arm.com> * config/arm/arm-protos.h (arm_target_insn_ok_for_lob): New prototype. * config/arm/arm.c (TARGET_INVALID_WITHIN_DOLOOP): Define. (arm_invalid_within_doloop): Implement invalid_within_doloop hook. (arm_target_insn_ok_for_lob): New function. * config/arm/arm.h (TARGET_HAVE_LOB): Define macro. * config/arm/thumb2.md (*doloop_end_internal, doloop_begin) (dls_insn): Add new patterns. (doloop_end): Modify to select LR when LOB is available. * config/arm/unspecs.md: Add new unspec. * doc/sourcebuild.texi (arm_v8_1_lob_ok) (arm_thumb2_ok_no_arm_v8_1_lob): Document new target supports options. gcc/testsuite/ChangeLog 2020-06-18 Andrea Corallo <andrea.corallo@arm.com> Mihail-Calin Ionescu <mihail.ionescu@arm.com> Iain Apreotesei <iain.apreotesei@arm.com> * gcc.target/arm/lob.h: New header. * gcc.target/arm/lob1.c: New testcase. * gcc.target/arm/lob2.c: Likewise. * gcc.target/arm/lob3.c: Likewise. * gcc.target/arm/lob4.c: Likewise. * gcc.target/arm/lob5.c: Likewise. * gcc.target/arm/lob6.c: Likewise. * gcc.target/arm/unsigned-extend-2.c: Do not run when generating low loop overhead. * gcc.target/arm/ivopts.c: Fix check for low loop overhead. * lib/target-supports.exp (check_effective_target_arm_v8_1_lob) (check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob): New procs.
2020-07-10Initial Sapphire Rapids and Alder Lake support from ISA r40Cui,Lili2-0/+19
gcc/ * common/config/i386/cpuinfo.h (get_intel_cpu): Handle sapphirerapids. * common/config/i386/i386-common.c (processor_names): Add sapphirerapids and alderlake. (processor_alias_table): Add sapphirerapids and alderlake. * common/config/i386/i386-cpuinfo.h (processor_subtypes): Add INTEL_COREI7_ALDERLAKE and INTEL_COREI7_ALDERLAKE. * config.gcc: Add -march=sapphirerapids and alderlake. * config/i386/driver-i386.c (host_detect_local_cpu) Handle sapphirerapids and alderlake. * config/i386/i386-c.c (ix86_target_macros_internal): Handle sapphirerapids and alderlake. * config/i386/i386-options.c (m_SAPPHIRERAPIDS) : Define. (m_ALDERLAKE): Ditto. (m_CORE_AVX512) : Add m_SAPPHIRERAPIDS. (processor_cost_table): Add sapphirerapids and alderlake. (ix86_option_override_internal) Handle PTA_WAITPKG, PTA_ENQCMD, PTA_CLDEMOTE, PTA_SERIALIZE, PTA_TSXLDTRK. * config/i386/i386.h (ix86_size_cost) : Define SAPPHIRERAPIDS and ALDERLAKE. (processor_type) : Add PROCESSOR_SAPPHIRERAPIDS and PROCESSOR_ALDERLAKE. (PTA_ENQCMD): New. (PTA_CLDEMOTE): Ditto. (PTA_SERIALIZE): Ditto. (PTA_TSXLDTRK): New. (PTA_SAPPHIRERAPIDS): Ditto. (PTA_ALDERLAKE): Ditto. (processor_type) : Add PROCESSOR_SAPPHIRERAPIDS and PROCESSOR_ALDERLAKE. * doc/extend.texi: Add sapphirerapids and alderlake. * doc/invoke.texi: Add sapphirerapids and alderlake. gcc/testsuite/ * gcc.target/i386/funcspec-56.inc: Handle new march. * g++.target/i386/mv16.C: Handle new march
2020-07-09aarch64: New Straight Line Speculation (SLS) mitigation flagsMatthew Malcomson1-0/+12
Here we introduce the flags that will be used for straight line speculation. The new flag introduced is `-mharden-sls=`. This flag can take arguments of `none`, `all`, or a comma seperated list of one or more of `retbr` or `blr`. `none` indicates no special mitigation of the straight line speculation vulnerability. `all` requests all mitigations currently implemented. `retbr` requests that the RET and BR instructions have a speculation barrier inserted after them. `blr` requests that BLR instructions are replaced by a BL to a function stub using a BR with a speculation barrier after it. Setting this on a per-function basis using attributes or the like is not enabled, but may be in the future. gcc/ChangeLog: 2020-06-02 Matthew Malcomson <matthew.malcomson@arm.com> * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p): New. (aarch64_harden_sls_blr_p): New. * config/aarch64/aarch64.c (enum aarch64_sls_hardening_type): New. (aarch64_harden_sls_retbr_p): New. (aarch64_harden_sls_blr_p): New. (aarch64_validate_sls_mitigation): New. (aarch64_override_options): Parse options for SLS mitigation. * config/aarch64/aarch64.opt (-mharden-sls): New option. * doc/invoke.texi: Document new option.
2020-07-09RISC-V: Implement __builtin_thread_pointerKito Cheng1-0/+11
RISC-V has a dedicate register for thread pointer which is specified in psABI doc, so we could support __builtin_thread_pointer in straightforward way. Note: clang/llvm was supported __builtin_thread_pointer for RISC-V port recently. - https://reviews.llvm.org/rGaabc24acf0d5f8677bd22fe9c108581e07c3e180 gcc/ChangeLog: * config/riscv/riscv.md (get_thread_pointer<mode>): New. (TP_REGNUM): Ditto. * doc/extend.texi (Target Builtins): Add RISC-V built-in section. Document __builtin_thread_pointer. gcc/testsuite/ChangeLog: * gcc.target/riscv/read-thread-pointer.c: New.
2020-07-08[PATCH, rs6000]Add support to enable vmsumudm behind vec_msum builtin.Will Schmidt1-0/+10
gcc/ChangeLog: 2020-07-08 Will Schmidt <will_schmidt@vnet.ibm.com> * config/rs6000/altivec.h (vec_vmsumudm): New define. * config/rs6000/altivec.md (UNSPEC_VMSUMUDM): New unspec. (altivec_vmsumudm): New define_insn. * config/rs6000/rs6000-builtin.def (altivec_vmsumudm): New BU_ALTIVEC_3 entry. (vmsumudm): New BU_ALTIVEC_OVERLOAD_3 entry. * config/rs6000/rs6000-call.c (altivec_overloaded_builtins): Add entries for ALTIVEC_BUILTIN_VMSUMUDM variants of vec_msum. * doc/extend.texi: Add document for vmsumudm behind vmsum. gcc/testsuite/ChangeLog: 2020-07-08 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/builtins-msum-runnable.c: New test. * gcc.target/powerpc/vsx-builtin-msum.c: New test.
2020-07-08IFN/optabs: Support vector load/store with lengthKewen Lin1-0/+26
This patch is to add the internal function and optabs support for vector load/store with length. For the vector load/store with length optab, the length item would be measured in lanes by default. For the targets which support length measured in bytes like Power, they should only define VnQI modes to wrap the other same size vector modes. If the length is larger than total lane/byte count of the given mode, the behavior is undefined. For the remaining lanes/bytes which isn't specified by length, they would be taken as undefined value. gcc/ChangeLog: * doc/md.texi (len_load_@var{m}): Document. (len_store_@var{m}): Likewise. * internal-fn.c (len_load_direct): New macro. (len_store_direct): Likewise. (expand_len_load_optab_fn): Likewise. (expand_len_store_optab_fn): Likewise. (direct_len_load_optab_supported_p): Likewise. (direct_len_store_optab_supported_p): Likewise. (expand_mask_load_optab_fn): New macro. Original renamed to ... (expand_partial_load_optab_fn): ... here. Add handlings for len_load_optab. (expand_mask_store_optab_fn): New macro. Original renamed to ... (expand_partial_store_optab_fn): ... here. Add handlings for len_store_optab. (internal_load_fn_p): Handle IFN_LEN_LOAD. (internal_store_fn_p): Handle IFN_LEN_STORE. (internal_fn_stored_value_index): Handle IFN_LEN_STORE. * internal-fn.def (LEN_LOAD): New internal function. (LEN_STORE): Likewise. * optabs.def (len_load_optab, len_store_optab): New optab.
2020-07-07Fix a typo in doc/generic.texiQian Jianhua1-1/+1
gcc/ * doc/generic.texi: Fix typo.
2020-07-01aarch64: Add 64 bit setter getter fpsr fpcrAndrea Corallo1-0/+5
gcc/ChangeLog * config/aarch64/aarch64-builtins.c (aarch64_builtins): Add enums for 64bits fpsr/fpcr getter setters builtin variants. (aarch64_init_fpsr_fpcr_builtins): New function. (aarch64_general_init_builtins): Modify to make use of the later. (aarch64_expand_fpsr_fpcr_setter): New function. (aarch64_general_expand_builtin): Modify to make use of the later. * config/aarch64/aarch64.md (@aarch64_set_<fpscr_name><GPI:mode>) (@aarch64_get_<fpscr_name><GPI:mode>): New patterns replacing and generalizing 'get_fpcr', 'set_fpsr'. * config/aarch64/iterators.md (GET_FPSCR, SET_FPSCR): New int iterators. (fpscr_name): New int attribute. * doc/extend.texi (__builtin_aarch64_get_fpcr64) (__builtin_aarch64_set_fpcr64, __builtin_aarch64_get_fpsr64) (__builtin_aarch64_set_fpsr64): Add into AArch64 Built-in Functions. gcc/testsuite/ChangeLog * gcc.target/aarch64/get_fpcr64_1.c: New test. * gcc.target/aarch64/set_fpcr64_1.c: New test. * gcc.target/aarch64/get_fpsr64_1.c: New test. * gcc.target/aarch64/set_fpsr64_1.c: New test.
2020-07-01gcov: rename 2 options.Martin Liska1-4/+4
gcc/ChangeLog: * doc/gcov.texi: Rename 2 options. * gcov.c (print_usage): Rename -i,--json-format to -j,--json-format and -j,--human-readable to -H,--human-readable. (process_args): Fix up parsing. Document obsolete options and how are they changed. gcc/testsuite/ChangeLog: * g++.dg/gcov/loop.C: Use -H option instead of -j option.
2020-06-29rs6000: Documentation updates for "future" renameSegher Boessenkool1-33/+29
2020-06-29 Segher Boessenkool <segher@kernel.crashing.org> * doc/extend.texi: Change references to "future architecture" to "ISA 3.1", "-mcpu=future" to "-mcpu=power10", and remove vaguer references to "future" (because the future is now).
2020-06-29testsuite: clarify scan-dump file globbing behaviorFrederik Harwath1-0/+13
The test commands for scanning optimization dump files perform globbing on the argument that specifies the suffix of the dump files to be scanned. This behavior is currently undocumented. Furthermore, the current implementation of "scan-dump" and similar procedures yields an error whenever the file name globbing matches more than one file (due to an attempt to call "open" on multiple files) while a failure to match any file results in an unresolved test. This commit documents the globbing behavior. The dump scanning procedures are changed to make the test unresolved if globbing matches more than one file. gcc/ChangeLog: 2020-06-29 Frederik Harwath <frederik@codesourcery.com> * doc/sourcebuild.texi: Describe globbing of the dump file scanning commands "suffix" argument. gcc/testsuite/ChangeLog: 2020-06-29 Frederik Harwath <frederik@codesourcery.com> * lib/scandump.exp (glob-dump-file): New proc. (scan-dump): Use glob-dump-file for file name expansion. (scan-dump-times): Likewise. (scan-dump-dem): Likewise. (scan-dump-dem-not): Likewise. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
2020-06-26rs6000: Add support for __builtin_cpu_is ("power10")Peter Bergner1-0/+6
Add support for __builtin_cpu_is ("power10"). Also add documentation for the recently added "arch_3_1" and "mma" __builtin_cpu_supports arguments. 2020-06-25 Peter Bergner <bergner@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (cpu_is_info) <power10>: New. * doc/extend.texi (PowerPC Built-in Functions): Document power10, arch_3_1 and mma. gcc/testsuite/ * gcc.target/powerpc/cpu-builtin-1.c: Add tests for power10, arch_3_1 and mma.
2020-06-26c++: Change the default dialect to C++17.Marek Polacek2-3/+3
Since GCC 9, C++17 support is no longer experimental. It was too late to change the default C++ dialect to C++17 in GCC 10, but I think now it's time to pull the trigger (C++14 was made the default in GCC 6.1). We're still missing two C++17 library features, but that shouldn't stop us. See <https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017> and <https://gcc.gnu.org/projects/cxx-status.html#cxx17> for the C++17 status. I won't list all C++17 features here, but just a few heads-up: - trigraphs were removed (hardly anyone cares, unless your keyboard is missing the # key), - operator++(bool) was removed (so some tests now run in C++14 and down only), - the keyword register was removed (some legacy code might trip on this), - noexcept specification is now part of the type system and C++17 does not allow dynamic exception specifications anymore (the empty throw specification is still available, but it is deprecated), - the evaluation order rules are different in C++17, - static constexpr data members are now implicitly inline (which makes them definitions), - C++17 requires guaranteed copy elision, meaning that a copy/move constructor call might be elided completely. That means that if something relied on a constructor being instantiated via e.g. copying a function parameter, it might now fail. I'll post an update for cxx-status.html and add a new caveat to changes.html once this is in. gcc/ChangeLog: * doc/invoke.texi (C Dialect Options): Adjust -std default for C++. * doc/standards.texi (C Language): Correct the default dialect. (C++ Language): Update the default for C++ to gnu++17. gcc/c-family/ChangeLog: * c-opts.c (c_common_init_options): Default to gnu++17. gcc/testsuite/ChangeLog: * c-c++-common/torture/vector-subscript-3.c: In C++17, define away the keyword register. * g++.dg/cpp1z/attributes-enum-1a.C: Only run pre-C++17. * g++.dg/cpp1z/fold7a.C: Likewise. * g++.dg/cpp1z/nontype3a.C: Likewise. * g++.dg/cpp1z/utf8-2a.C: Likewise. * g++.dg/parse/error11.C: Update expected diagnostics for C++17. * g++.dg/torture/pr34850.C: Add -Wno-attribute-warning. * g++.dg/torture/pr49394.C: In C++17, use noexcept(false). * g++.dg/torture/pr82154.C: Use -std=c++14. * lib/target-supports.exp: Set to C++17. * obj-c++.dg/try-catch-9.mm: Use -Wno-register. libgomp/ChangeLog: * testsuite/libgomp.c++/atomic-3.C: Use -std=gnu++14.
2020-06-22arm: Fix the failing mve scalar shift execution tests.Srinath Parvathaneni1-0/+9
In GCC testsuite the MVE scalar shift execution tests (mve_scalar_shifts[1-4].c) are failings because of executing them on target hardware which doesn't support MVE instructions. This patch restricts those tests to execute only on target hardware that support MVE instructions. 2020-06-22 Srinath Parvathaneni <srinath.parvathaneni@arm.com> gcc/ * doc/sourcebuild.texi (arm_v8_1m_mve_fp_ok): Add item. (arm_mve_hw): Likewise. gcc/testsuite/ * gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c: Modify. * gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c: Likewise. * gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c: Likewise. * gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c: Likewise. * lib/target-supports.exp (check_effective_target_arm_mve_hw): Define.
2020-06-21rs6000: Add MMA built-in function definitions and test cases.Peter Bergner1-0/+95
Add the Matrix-Multiply Assist (MMA) built-ins. The MMA accumulators are INOUT operands for most MMA instructions, but they are also very expensive to move around. For this reason, we have implemented a built-in API where the accumulators are passed using pass-by-reference/pointers, so the user won't use one accumulator as input and another as output, which wouldentail a lot of copies. However, using pointers gives us poor code generation when we expand the built-ins at normal expand time. We therefore expand the MMA built-ins early into gimple, converting the pass-by-reference calls to an internal built-in that uses pass-by-value calling convention, where we can enforce the input and output accumulators are the same. This gives us much better code generation. 2020-06-20 Peter Bergner <bergner@linux.ibm.com> gcc/ * config/rs6000/predicates.md (mma_assemble_input_operand): New. * config/rs6000/rs6000-builtin.def (BU_MMA_1, BU_MMA_V2, BU_MMA_3, BU_MMA_5, BU_MMA_6, BU_VSX_1): Add support macros for defining MMA built-in functions. (ASSEMBLE_ACC, ASSEMBLE_PAIR, DISASSEMBLE_ACC, DISASSEMBLE_PAIR, PMXVBF16GER2, PMXVBF16GER2NN, PMXVBF16GER2NP, PMXVBF16GER2PN, PMXVBF16GER2PP, PMXVF16GER2, PMXVF16GER2NN, PMXVF16GER2NP, PMXVF16GER2PN, PMXVF16GER2PP, PMXVF32GER, PMXVF32GERNN, PMXVF32GERNP, PMXVF32GERPN, PMXVF32GERPP, PMXVF64GER, PMXVF64GERNN, PMXVF64GERNP, PMXVF64GERPN, PMXVF64GERPP, PMXVI16GER2, PMXVI16GER2PP, PMXVI16GER2S, PMXVI16GER2SPP, PMXVI4GER8, PMXVI4GER8PP, PMXVI8GER4, PMXVI8GER4PP, PMXVI8GER4SPP, XVBF16GER2, XVBF16GER2NN, XVBF16GER2NP, XVBF16GER2PN, XVBF16GER2PP, XVCVBF16SP, XVCVSPBF16, XVF16GER2, XVF16GER2NN, XVF16GER2NP, XVF16GER2PN, XVF16GER2PP, XVF32GER, XVF32GERNN, XVF32GERNP, XVF32GERPN, XVF32GERPP, XVF64GER, XVF64GERNN, XVF64GERNP, XVF64GERPN, XVF64GERPP, XVI16GER2, XVI16GER2PP, XVI16GER2S, XVI16GER2SPP, XVI4GER8, XVI4GER8PP, XVI8GER4, XVI8GER4PP, XVI8GER4SPP, XXMFACC, XXMTACC, XXSETACCZ): Add MMA built-ins. * config/rs6000/rs6000.c (rs6000_emit_move): Use CONST_INT_P. Allow zero constants. (print_operand) <case 'A'>: New output modifier. (rs6000_split_multireg_move): Add support for inserting accumulator priming and depriming instructions. Add support for splitting an assemble accumulator pattern. * config/rs6000/rs6000-call.c (mma_init_builtins, mma_expand_builtin, rs6000_gimple_fold_mma_builtin): New functions. (RS6000_BUILTIN_M): New macro. (def_builtin): Handle RS6000_BTC_QUAD and RS6000_BTC_PAIR attributes. (bdesc_mma): Add new MMA built-in support. (htm_expand_builtin): Use RS6000_BTC_OPND_MASK. (rs6000_invalid_builtin): Add handling of RS6000_BTM_FUTURE and RS6000_BTM_MMA. (rs6000_builtin_valid_without_lhs): Handle RS6000_BTC_VOID attribute. (rs6000_gimple_fold_builtin): Call rs6000_builtin_is_supported_p and rs6000_gimple_fold_mma_builtin. (rs6000_expand_builtin): Call mma_expand_builtin. Use RS6000_BTC_OPND_MASK. (rs6000_init_builtins): Adjust comment. Call mma_init_builtins. (htm_init_builtins): Use RS6000_BTC_OPND_MASK. (builtin_function_type): Handle VSX_BUILTIN_XVCVSPBF16 and VSX_BUILTIN_XVCVBF16SP. * config/rs6000/rs6000.h (RS6000_BTC_QUINARY, RS6000_BTC_SENARY, RS6000_BTC_OPND_MASK, RS6000_BTC_QUAD, RS6000_BTC_PAIR, RS6000_BTC_QUADPAIR, RS6000_BTC_GIMPLE): New defines. (RS6000_BTC_PREDICATE, RS6000_BTC_ABS, RS6000_BTC_DST, RS6000_BTC_TYPE_MASK, RS6000_BTC_ATTR_MASK): Adjust values. * config/rs6000/mma.md (MAX_MMA_OPERANDS): New define_constant. (UNSPEC_MMA_ASSEMBLE_ACC, UNSPEC_MMA_PMXVBF16GER2, UNSPEC_MMA_PMXVBF16GER2NN, UNSPEC_MMA_PMXVBF16GER2NP, UNSPEC_MMA_PMXVBF16GER2PN, UNSPEC_MMA_PMXVBF16GER2PP, UNSPEC_MMA_PMXVF16GER2, UNSPEC_MMA_PMXVF16GER2NN, UNSPEC_MMA_PMXVF16GER2NP, UNSPEC_MMA_PMXVF16GER2PN, UNSPEC_MMA_PMXVF16GER2PP, UNSPEC_MMA_PMXVF32GER, UNSPEC_MMA_PMXVF32GERNN, UNSPEC_MMA_PMXVF32GERNP, UNSPEC_MMA_PMXVF32GERPN, UNSPEC_MMA_PMXVF32GERPP, UNSPEC_MMA_PMXVF64GER, UNSPEC_MMA_PMXVF64GERNN, UNSPEC_MMA_PMXVF64GERNP, UNSPEC_MMA_PMXVF64GERPN, UNSPEC_MMA_PMXVF64GERPP, UNSPEC_MMA_PMXVI16GER2, UNSPEC_MMA_PMXVI16GER2PP, UNSPEC_MMA_PMXVI16GER2S, UNSPEC_MMA_PMXVI16GER2SPP, UNSPEC_MMA_PMXVI4GER8, UNSPEC_MMA_PMXVI4GER8PP, UNSPEC_MMA_PMXVI8GER4, UNSPEC_MMA_PMXVI8GER4PP, UNSPEC_MMA_PMXVI8GER4SPP, UNSPEC_MMA_XVBF16GER2, UNSPEC_MMA_XVBF16GER2NN, UNSPEC_MMA_XVBF16GER2NP, UNSPEC_MMA_XVBF16GER2PN, UNSPEC_MMA_XVBF16GER2PP, UNSPEC_MMA_XVF16GER2, UNSPEC_MMA_XVF16GER2NN, UNSPEC_MMA_XVF16GER2NP, UNSPEC_MMA_XVF16GER2PN, UNSPEC_MMA_XVF16GER2PP, UNSPEC_MMA_XVF32GER, UNSPEC_MMA_XVF32GERNN, UNSPEC_MMA_XVF32GERNP, UNSPEC_MMA_XVF32GERPN, UNSPEC_MMA_XVF32GERPP, UNSPEC_MMA_XVF64GER, UNSPEC_MMA_XVF64GERNN, UNSPEC_MMA_XVF64GERNP, UNSPEC_MMA_XVF64GERPN, UNSPEC_MMA_XVF64GERPP, UNSPEC_MMA_XVI16GER2, UNSPEC_MMA_XVI16GER2PP, UNSPEC_MMA_XVI16GER2S, UNSPEC_MMA_XVI16GER2SPP, UNSPEC_MMA_XVI4GER8, UNSPEC_MMA_XVI4GER8PP, UNSPEC_MMA_XVI8GER4, UNSPEC_MMA_XVI8GER4PP, UNSPEC_MMA_XVI8GER4SPP, UNSPEC_MMA_XXMFACC, UNSPEC_MMA_XXMTACC): New. (MMA_ACC, MMA_VV, MMA_AVV, MMA_PV, MMA_APV, MMA_VVI4I4I8, MMA_AVVI4I4I8, MMA_VVI4I4I2, MMA_AVVI4I4I2, MMA_VVI4I4, MMA_AVVI4I4, MMA_PVI4I2, MMA_APVI4I2, MMA_VVI4I4I4, MMA_AVVI4I4I4): New define_int_iterator. (acc, vv, avv, pv, apv, vvi4i4i8, avvi4i4i8, vvi4i4i2, avvi4i4i2, vvi4i4, avvi4i4, pvi4i2, apvi4i2, vvi4i4i4, avvi4i4i4): New define_int_attr. (*movpxi): Add zero constant alternative. (mma_assemble_pair, mma_assemble_acc): New define_expand. (*mma_assemble_acc): New define_insn_and_split. (mma_<acc>, mma_xxsetaccz, mma_<vv>, mma_<avv>, mma_<pv>, mma_<apv>, mma_<vvi4i4i8>, mma_<avvi4i4i8>, mma_<vvi4i4i2>, mma_<avvi4i4i2>, mma_<vvi4i4>, mma_<avvi4i4>, mma_<pvi4i2>, mma_<apvi4i2>, mma_<vvi4i4i4>, mma_<avvi4i4i4>): New define_insn. * config/rs6000/rs6000.md (define_attr "type"): New type mma. * config/rs6000/vsx.md (UNSPEC_VSX_XVCVBF16SP): New. (UNSPEC_VSX_XVCVSPBF16): Likewise. (XVCVBF16): New define_int_iterator. (xvcvbf16): New define_int_attr. (vsx_<xvcvbf16>): New define_insn. * doc/extend.texi: Document the mma built-ins.
2020-06-21rs6000: Add base support and types for defining MMA built-ins.Peter Bergner1-2/+10
Add the new -mmma option as well as the initial MMA support, which includes the target specific __vector_pair and __vector_quad types, the POImode and PXImode partial integer modes they are mapped to, and their associated move patterns. Support for the restrictions on the registers these modes can be assigned to as also been added. 2020-06-20 Peter Bergner <bergner@linux.ibm.com> Michael Meissner <meissner@linux.ibm.com> gcc/ * config/rs6000/mma.md: New file. * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define __MMA__ for mma. * config/rs6000/rs6000-call.c (rs6000_init_builtins): Add support for __vector_pair and __vector_quad types. * config/rs6000/rs6000-cpus.def (OTHER_FUTURE_MASKS): Add OPTION_MASK_MMA. (POWERPC_MASKS): Likewise. * config/rs6000/rs6000-modes.def (OI, XI): New integer modes. (POI, PXI): New partial integer modes. * config/rs6000/rs6000.c (TARGET_INVALID_CONVERSION): Define. (rs6000_hard_regno_nregs_internal): Use VECTOR_ALIGNMENT_P. (rs6000_hard_regno_mode_ok_uncached): Likewise. Add support for POImode being allowed in VSX registers and PXImode being allowed in FP registers. (rs6000_modes_tieable_p): Adjust comment. Add support for POImode and PXImode. (rs6000_debug_reg_global) <print_tieable_modes>: Add OImode, POImode XImode, PXImode, V2SImode, V2SFmode and CCFPmode.. (rs6000_setup_reg_addr_masks): Use VECTOR_ALIGNMENT_P. Set up appropriate addr_masks for vector pair and vector quad addresses. (rs6000_init_hard_regno_mode_ok): Add support for vector pair and vector quad registers. Setup reload handlers for POImode and PXImode. (rs6000_builtin_mask_calculate): Add support for RS6000_BTM_MMA. (rs6000_option_override_internal): Error if -mmma is specified without -mcpu=future. (rs6000_slow_unaligned_access): Use VECTOR_ALIGNMENT_P. (quad_address_p): Change size test to less than 16 bytes. (reg_offset_addressing_ok_p): Add support for ISA 3.1 vector pair and vector quad instructions. (avoiding_indexed_address_p): Likewise. (rs6000_emit_move): Disallow POImode and PXImode moves involving constants. (rs6000_preferred_reload_class): Prefer VSX registers for POImode and FP registers for PXImode. (rs6000_split_multireg_move): Support splitting POImode and PXImode move instructions. (rs6000_mangle_type): Adjust comment. Add support for mangling __vector_pair and __vector_quad types. (rs6000_opt_masks): Add entry for mma. (rs6000_builtin_mask_names): Add RS6000_BTM_MMA and RS6000_BTM_FUTURE. (rs6000_function_value): Use VECTOR_ALIGNMENT_P. (address_to_insn_form): Likewise. (reg_to_non_prefixed): Likewise. (rs6000_invalid_conversion): New function. * config/rs6000/rs6000.h (MASK_MMA): Define. (BIGGEST_ALIGNMENT): Set to 512 if MMA support is enabled. (VECTOR_ALIGNMENT_P): New helper macro. (ALTIVEC_VECTOR_MODE): Use VECTOR_ALIGNMENT_P. (RS6000_BTM_MMA): Define. (RS6000_BTM_COMMON): Add RS6000_BTM_MMA and RS6000_BTM_FUTURE. (rs6000_builtin_type_index): Add RS6000_BTI_vector_pair and RS6000_BTI_vector_quad. (vector_pair_type_node): New. (vector_quad_type_node): New. * config/rs6000/rs6000.md: Include mma.md. (define_mode_iterator RELOAD): Add POI and PXI. * config/rs6000/t-rs6000 (MD_INCLUDES): Add mma.md. * config/rs6000/rs6000.opt (-mmma): New. * doc/invoke.texi: Document -mmma.
2020-06-17Fix typo in attribute access example.Forrest Timour1-1/+1
Fix typo in documentation example of access function attribute where the ref-indices should be one-indexed instead of zero-indexed. gcc/ChangeLog: * doc/extend.texi (attribute access): Fix a typo.
2020-06-15gcc: xtensa: add -mabi option for call0/windowed ABIMax Filippov1-1/+25
2020-06-15 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/elf.h (ASM_SPEC, LINK_SPEC): Pass ABI switch to assembler/linker. * config/xtensa/linux.h (ASM_SPEC, LINK_SPEC): Ditto. * config/xtensa/uclinux.h (ASM_SPEC, LINK_SPEC): Ditto. * config/xtensa/xtensa.c (xtensa_option_override): Initialize xtensa_windowed_abi if needed. * config/xtensa/xtensa.h (TARGET_WINDOWED_ABI_DEFAULT): New macro. (TARGET_WINDOWED_ABI): Redefine to xtensa_windowed_abi. * config/xtensa/xtensa.opt (xtensa_windowed_abi): New target option variable. (mabi=call0, mabi=windowed): New options. * doc/invoke.texi: Document new -mabi= Xtensa-specific options. gcc/testsuite/ * gcc.target/xtensa/mabi-call0.c: New test. * gcc.target/xtensa/mabi-windowed.c: New test. libgcc/ * configure: Regenerate. * configure.ac: Use AC_COMPILE_IFELSE instead of manual preprocessor invocation to check for __XTENSA_CALL0_ABI__.
2020-06-09gcov: improve --coverage small exampleMartin Liska1-1/+2
Pushed to master. gcc/ChangeLog: PR gcov-profile/95365 * doc/gcov.texi: Compile and link one example in 2 steps.
2020-06-04Implement a solution for PR middle-end/10138 and PR middle-end/95136.Martin Sebor1-2/+10
PR middle-end/10138 - warn for uninitialized arrays passed as const arguments PR middle-end/95136 - missing -Wuninitialized on an array access with a variable offset gcc/c-family/ChangeLog: PR middle-end/10138 PR middle-end/95136 * c-attribs.c (append_access_attrs): Handle attr_access::none. (handle_access_attribute): Same. gcc/ChangeLog: PR middle-end/10138 PR middle-end/95136 * attribs.c (init_attr_rdwr_indices): Move function here. * attribs.h (rdwr_access_hash, rdwr_map): Define. (attr_access): Add 'none'. (init_attr_rdwr_indices): Declared function. * builtins.c (warn_for_access)): New function. (check_access): Call it. * builtins.h (checK-access): Add an optional argument. * calls.c (rdwr_access_hash, rdwr_map): Move to attribs.h. (init_attr_rdwr_indices): Declare extern. (append_attrname): Handle attr_access::none. (maybe_warn_rdwr_sizes): Same. (initialize_argument_information): Update comments. * doc/extend.texi (attribute access): Document 'none'. * tree-ssa-uninit.c (struct wlimits): New. (maybe_warn_operand): New function. (maybe_warn_pass_by_reference): Same. (warn_uninitialized_vars): Refactor code into maybe_warn_operand. Also call for function calls. (pass_late_warn_uninitialized::execute): Adjust comments. (execute_early_warn_uninitialized): Same. gcc/testsuite/ChangeLog: PR middle-end/10138 PR middle-end/95136 * c-c++-common/Wsizeof-pointer-memaccess1.c: Prune out valid Wuninitialized. * c-c++-common/uninit-pr51010.c: Adjust expected warning format. * c-c++-common/goacc/uninit-dim-clause.c: Same. * c-c++-common/goacc/uninit-firstprivate-clause.c: Same. * c-c++-common/goacc/uninit-if-clause.c: Same. * c-c++-common/gomp/pr70550-1.c: Same. * c-c++-common/gomp/pr70550-2.c: Adjust. * g++.dg/20090107-1.C: Same. * g++.dg/20090121-1.C: Same. * g++.dg/ext/attr-access.C: Avoid -Wuninitialized. * gcc.dg/tree-ssa/forwprop-6.c: Prune out -Wuninitialized. * gcc.dg/Warray-bounds-52.c: Prune out valid -Wuninitialized. * gcc.dg/Warray-bounds-53.c: Same. * gcc.dg/Warray-bounds-54.c: Same. * gcc.dg/Wstringop-overflow-33.c: New test. * gcc.dg/attr-access-none.c: New test. * gcc.dg/attr-access-read-only.c: Adjust. * gcc.dg/attr-access-read-write.c: Same. * gcc.dg/attr-access-write-only.c: Same. * gcc.dg/pr71581.c: Adjust text of expected warning. * gcc.dg/uninit-15.c: Same. * gcc.dg/uninit-32.c: New test. * gcc.dg/uninit-33.c: New test. * gcc.dg/uninit-34.c: New test. * gcc.dg/uninit-36.c: New test. * gcc.dg/uninit-B-O0.c: Adjust text of expected warning. * gcc.dg/uninit-I-O0.c: Same. * gcc.dg/uninit-pr19430-O0.c: Same. * gcc.dg/uninit-pr19430.c: Same. * gcc.dg/uninit-pr95136.c: New test. * gfortran.dg/assignment_4.f90: Expect -Wuninitialized. * gfortran.dg/goacc/uninit-dim-clause.f95: Adjust text of expected warning. * gfortran.dg/goacc/uninit-firstprivate-clause.f95 * gfortran.dg/goacc/uninit-if-clause.f95 * gfortran.dg/pr66545_2.f90
2020-06-02aarch64: Add initial support for -mcpu=zeusKyrylo Tkachov1-1/+1
This patch adds support for the Arm Zeus CPU. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ 2020-06-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/aarch64-cores.def (zeus): Define. * config/aarch64/aarch64-tune.md: Regenerate. * doc/invoke.texi (AArch64 Options): Document zeus -mcpu option.
2020-06-02Make TOPN counter dynamically allocated.Martin Liska1-0/+5
gcc/ChangeLog: * coverage.c (get_coverage_counts): Skip sanity check for TOP N counters as they have variable number of counters. * gcov-dump.c (main): Add new option -r. (print_usage): Likewise. (tag_counters): All new raw format. * gcov-io.h (struct gcov_kvp): New. (GCOV_TOPN_VALUES): Remove. (GCOV_TOPN_VALUES_COUNTERS): Likewise. (GCOV_TOPN_MEM_COUNTERS): New. (GCOV_TOPN_DISK_COUNTERS): Likewise. (GCOV_TOPN_MAXIMUM_TRACKED_VALUES): Likewise. * ipa-profile.c (ipa_profile_generate_summary): Use GCOV_TOPN_MAXIMUM_TRACKED_VALUES. (ipa_profile_write_edge_summary): Likewise. (ipa_profile_read_edge_summary): Likewise. (ipa_profile): Remove usage of GCOV_TOPN_VALUES. * profile.c (sort_hist_values): Sort variable number of counters. (compute_value_histograms): Special case for TOP N counters that have dynamic number of key-value pairs. * value-prof.c (dump_histogram_value): Dump variable number of key-value pairs. (stream_in_histogram_value): Stream in variable number of key-value pairs for TOP N counter. (get_nth_most_common_value): Deal with variable number of key-value pairs. (dump_ic_profile): Use GCOV_TOPN_MAXIMUM_TRACKED_VALUES for loop iteration. (gimple_find_values_to_profile): Set GCOV_TOPN_MEM_COUNTERS to n_counters. * doc/gcov-dump.texi: Document new -r option. libgcc/ChangeLog: * libgcov-driver.c (prune_topn_counter): Remove. (prune_counters): Likewise. (merge_one_data): Special case TOP N counters as they have variable length. (write_top_counters): New. (write_one_data): Special case TOP N. (dump_one_gcov): Do not prune TOP N counters. * libgcov-merge.c (merge_topn_values_set): Remove. (__gcov_merge_topn): Use gcov_topn_add_value. * libgcov-profiler.c (__gcov_topn_values_profiler_body): Likewise here. * libgcov.h (gcov_counter_add): New. (gcov_counter_set_if_null): Likewise. (gcov_topn_add_value): New.
2020-05-28Add documentation for missing params.Martin Liska1-5/+33
The patch fixes various issues spotted by check-params-in-docs.py script. I'm going to install the patch. gcc/ChangeLog: PR web/95380 * doc/invoke.texi: Add missing params, remove max-once-peeled-insns and rename ipcp-unit-growth to ipa-cp-unit-growth.
2020-05-28Add support for __builtin_bswap128Eric Botcazou1-2/+8
This patch introduces a new builtin named __builtin_bswap128 on targets where TImode is supported, i.e. 64-bit targets only in practice. The implementation simply reuses the existing double word path in optab, so no routine is added to libgcc (which means that you get two calls to _bswapdi2 in the worst case). gcc/ChangeLog: * builtin-types.def (BT_UINT128): New primitive type. (BT_FN_UINT128_UINT128): New function type. * builtins.def (BUILT_IN_BSWAP128): New GCC builtin. * doc/extend.texi (__builtin_bswap128): Document it. * builtins.c (expand_builtin): Deal with BUILT_IN_BSWAP128. (is_inexpensive_builtin): Likewise. * fold-const-call.c (fold_const_call_ss): Likewise. * fold-const.c (tree_call_nonnegative_warnv_p): Likewise. * tree-ssa-ccp.c (evaluate_stmt): Likewise. * tree-vect-stmts.c (vect_get_data_ptr_increment): Likewise. (vectorizable_call): Likewise. * optabs.c (expand_unop): Always use the double word path for it. * tree-core.h (enum tree_index): Add TI_UINT128_TYPE. * tree.h (uint128_type_node): New global type. * tree.c (build_common_tree_nodes): Build it if TImode is supported. gcc/testsuite/ChangeLog: * gcc.dg/builtin-bswap-10.c: New test. * gcc.dg/builtin-bswap-11.c: Likewise. * gcc.dg/builtin-bswap-12.c: Likewise. * gcc.target/i386/builtin-bswap-5.c: Likewise.
2020-05-26revamp dump and aux output namesAlexandre Oliva1-47/+338
This patch simplifies (!!!) the logic governing the naming of dump files and auxiliary output files in the driver, in the compiler, and in the LTO wrapper. No changes are made to the naming of primary outputs, there are often ways to restore past behavior, and a number of inconsistencies are fixed. Some internal options are removed (-auxbase and -auxbase-strip), sensible existing uses of -dumpdir and -dumpbase options remain unchanged, additional useful cases are added, making for what is still admittedly quite complex. Extensive documentation and testcases provide numerous examples, from normal to corner cases. The most visible changes are: - aux and dump files now always go in the same directory, that defaults to the directory of the primary output, but that can be overridden with -dumpdir, -save-temps=*, or, preserving past behavior, with a -dumpbase with a directory component. - driver and compiler now have the same notion of naming of auxiliary outputs, e.g. .dwo files will no longer be in one location while the debug info suggests they are elsewhere, and -save-temps and .dwo auxiliary outputs now go in the same location as .su, .ci and coverage data, with consistent naming. - explicitly-specified primary output names guide not only the location of aux and dump outputs: the output base name is also used in their base name, as a prefix when also linking (e.g. foo.c bar.c -o foobar creates foobar-foo.dwo and foobar-bar.dwo with -gsplit-dwarf), or as the base name instead of the input name (foo.c -c -o whatever.o creates whatever.su rather than foo.su with -fstack-usage). The preference for the input file base name, quite useful for our testsuite, can be restored with -dumpbase "". When compiling and linking tests in the testsuite with additional inputs, we now use this flag. Files named in dejagnu board ldflags, libs, and ldscripts are now quoted in the gcc testsuite with -Wl, so that they are not counted as additional inputs by the compiler driver. - naming a -dumpbase when compiling multiple sources used to cause dumps from later compiles to overwrite those of earlier ones; it is now used as a prefix when compiling multiple sources, like an executable name above. - the dumpbase, explicitly specified or computed from output or input names, now also governs the naming of aux outputs; since aux outputs usually replaced the suffix from the input name, while dump outputs append their own additional suffixes, a -dumpbase-ext option is introduced to enable a chosen suffix to be dropped from dumpbase to form aux output names. - LTO dump and aux outputs were quite a mess, sometimes leaking temporary output names into -save-temps output names, sometimes conversely generating desirable aux outputs in temporary locations. They now obey the same logic of compiler aux and dump outputs, landing in the expected location and taking the linker output name or an explicit dumpbase overrider into account. - Naming of -fdump-final-insns outputs now follows the dump file naming logic for the .gkd files, and the .gk dump files generated in the second -fcompare-debug compilation get the .gk inserted before the suffix that -dumpbase-ext drops in aux outputs. gcc/ChangeLog: * common.opt (aux_base_name): Define. (dumpbase, dumpdir): Mark as Driver options. (-dumpbase, -dumpdir): Likewise. (dumpbase-ext, -dumpbase-ext): New. (auxbase, auxbase-strip): Drop. * doc/invoke.texi (-dumpbase, -dumpbase-ext, -dumpdir): Document. (-o): Introduce the notion of primary output, mention it influences auxiliary and dump output names as well, add examples. (-save-temps): Adjust, move examples into -dump*. (-save-temps=cwd, -save-temps=obj): Likewise. (-fdump-final-insns): Adjust. * dwarf2out.c (gen_producer_string): Drop auxbase and auxbase_strip; add dumpbase_ext. * gcc.c (enum save_temps): Add SAVE_TEMPS_DUMP. (save_temps_prefix, save_temps_length): Drop. (save_temps_overrides_dumpdir): New. (dumpdir, dumpbase, dumpbase_ext): New. (dumpdir_length, dumpdir_trailing_dash_added): New. (outbase, outbase_length): New. (The Specs Language): Introduce %". Adjust %b and %B. (ASM_FINAL_SPEC): Use %b.dwo for an aux output name always. Precede object file with %w when it's the primary output. (cpp_debug_options): Do not pass on incoming -dumpdir, -dumpbase and -dumpbase-ext options; recompute them with %:dumps. (cc1_options): Drop auxbase with and without compare-debug; use cpp_debug_options instead of dumpbase. Mark asm output with %w when it's the primary output. (static_spec_functions): Drop %:compare-debug-auxbase-opt and %:replace-exception. Add %:dumps. (driver_handle_option): Implement -save-temps=*/-dumpdir mutual overriding logic. Save dumpdir, dumpbase and dumpbase-ext options. Do not save output_file in save_temps_prefix. (adds_single_suffix_p): New. (single_input_file_index): New. (process_command): Combine output dir, output base name, and dumpbase into dumpdir and outbase. (set_collect_gcc_options): Pass a possibly-adjusted -dumpdir. (do_spec_1): Optionally dumpdir instead of save_temps_prefix, and outbase instead of input_basename in %b, %B and in -save-temps aux files. Handle empty argument %". (driver::maybe_run_linker): Adjust dumpdir and auxbase. (compare_debug_dump_opt_spec_function): Adjust gkd dump file naming. Spec-quote the computed -fdump-final-insns file name. (debug_auxbase_opt): Drop. (compare_debug_self_opt_spec_function): Drop auxbase-strip computation. (compare_debug_auxbase_opt_spec_function): Drop. (not_actual_file_p): New. (replace_extension_spec_func): Drop. (dumps_spec_func): New. (convert_white_space): Split-out parts into... (quote_string, whitespace_to_convert_p): ... these. New. (quote_spec_char_p, quote_spec, quote_spec_arg): New. (driver::finalize): Release and reset new variables; drop removed ones. * lto-wrapper.c (HAVE_TARGET_EXECUTABLE_SUFFIX): Define if... (TARGET_EXECUTABLE_SUFFIX): ... is defined; define this to the empty string otherwise. (DUMPBASE_SUFFIX): Drop leading period. (debug_objcopy): Use concat. (run_gcc): Recognize -save-temps=* as -save-temps too. Obey -dumpdir. Pass on empty dumpdir and dumpbase with a directory component. Simplify temp file names. * opts.c (finish_options): Drop aux base name handling. (common_handle_option): Drop auxbase-strip handling. * toplev.c (print_switch_values): Drop auxbase, add dumpbase-ext. (process_options): Derive aux_base_name from dump_base_name and dump_base_ext. (lang_dependent_init): Compute dump_base_ext along with dump_base_name. Disable stack usage and callgraph-info during lto generation and compare-debug recompilation. gcc/fortran/ChangeLog: * options.c (gfc_get_option_string): Drop auxbase, add dumpbase_ext. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h: Drop auxbase and auxbase-strip. Use %:dumps instead of -dumpbase. Add %w for implicit .s primary output. * switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and dumpbase-ext. Drop auxbase and auxbase-strip. lto-plugin/ChangeLog: * lto-plugin.c (skip_in_suffix): New. (exec_lto_wrapper): Use skip_in_suffix and concat to build non-temporary output names. (onload): Look for -dumpdir in COLLECT_GCC_OPTIONS, and override link_output_name with it. contrib/ChangeLog: * compare-debug: Adjust for .gkd files named as dump files, with the source suffix rather than the object suffix. gcc/testsuite/ChangeLog: * gcc.misc-tests/outputs.exp: New. * gcc.misc-tests/outputs-0.c: New. * gcc.misc-tests/outputs-1.c: New. * gcc.misc-tests/outputs-2.c: New. * lib/gcc-defs.exp (gcc_adjusted_linker_flags): New. (gcc_adjust_linker_flags): New. (dg-additional-files-options): Call it. Pass -dumpbase "" when there are additional sources. * lib/profopt.exp (profopt-execute): Pass the executable suffix with -dumpbase-ext. * lib/scandump.exp (dump-base): Mention -dumpbase "" use. * lib/scanltranstree.exp: Adjust dump suffix expectation. * lib/scanwpaipa.exp: Likewise.
2020-05-22lto/95190 - amend -flto docs for diagnostic option handlingRichard Biener1-0/+8
This documents new GCC 10 behavior on diagnostic options and -flto. 2020-05-22 Richard Biener <rguenther@suse.de> PR lto/95190 * doc/invoke.texi (flto): Document behavior of diagnostic options.
2020-05-21Add outline-atomics to target attribute.Martin Liska1-0/+6
* common/config/aarch64/aarch64-common.c (aarch64_handle_option): Handle OPT_moutline_atomics. * config/aarch64/aarch64.c: Add outline-atomics to aarch64_attributes. * doc/extend.texi: Document the newly added target attribute. * gcc.target/aarch64/target_attr_20.c: New test. * gcc.target/aarch64/target_attr_21.c: New test.
2020-05-19TESTSUITE: Fix tests for 16-bit targetsJozef Lawrynowicz1-2/+22
gcc/ChangeLog: 2020-05-19 Jozef Lawrynowicz <jozef.l@mittosystems.com> * doc/sourcebuild.texi: Document new short_eq_int, ptr_eq_short, msp430_small, msp430_large and size24plus DejaGNU effective targets. Improve grammar in descriptions for size20plus and size32plus effective targets. gcc/testsuite/ChangeLog: 2020-05-19 Jozef Lawrynowicz <jozef.l@mittosystems.com> * c-c++-common/builtin-has-attribute-7.c: Require size24plus. * c-c++-common/cpp/pr63831-1.c: Store result in _has_cpp_attribute in a long. * c-c++-common/pr81376.c: Skip scan-tree-dump for short_eq_int. Extend test for short_eq_int. * g++.dg/abi/scoped1.C: Skip dg-warning tests for short_eq_int. * g++.dg/cpp0x/constexpr-70001-1.C: Require size24plus. * g++.dg/cpp0x/constexpr-bitfield3.C: Require int32plus. * g++.dg/cpp0x/enum13.C: Skip dg-warning for short_eq_int. * g++.dg/cpp0x/initlist5.C: Add dg-error for short_eq_int. * g++.dg/cpp0x/initlist7.C: Add dg-warning for !int32plus. * g++.dg/cpp0x/nullptr04.C: Skip dg-error for ptr_eq_short. * g++.dg/cpp0x/variadic-value1.C: Add typedef for int32_t. * g++.dg/cpp1y/constexpr-arith-overflow.C: Fix test for sizeof(int) == sizeof(short). * g++.dg/cpp1y/digit-sep-neg.C: Add typedef for int32_t. * g++.dg/cpp1y/pr57644.C: Add typedef for uint32_t. * g++.dg/cpp1y/pr77321.C: Require size24plus. * g++.dg/cpp1y/var-templ4.C: Add typedef for int32_t. * g++.dg/cpp1z/direct-enum-init1.C: Skip dg-error for short_eq_int. * g++.dg/delayedfold/fwrapv1.C: Skip for int16. * g++.dg/expr/bitfield9.C: Add typedef for int32_t. * g++.dg/ext/attribute-test-1.C: Add typedef for uint32_t. * g++.dg/ext/bitfield1.C: Add typedef for int32_t. * g++.dg/ext/flexary13.C: Add typedef for int32_t. * g++.dg/ext/utf-cvt.C: Adjust dg-warning for int16. * g++.dg/ext/vector28.C: Add typedef for int32_t. * g++.dg/ext/vla15.C: Add typedef for int32_t. * g++.dg/init/array11.C: Require size32plus. * g++.dg/init/array15.C: Require size24plus. * g++.dg/init/array4.C: Require size20plus. * g++.dg/init/const7.C: Skip dg-message for ptr_eq_short. * g++.dg/init/new38.C: Relax regex in dg-error. * g++.dg/init/new44.C: Skip dg-error for msp430_small. Adjust test for 16-bit size_t. Add special case for msp430 -mlarge. * g++.dg/init/value9.C: Add typedef for int32_t. * g++.dg/ipa/pr77333.C: Add typedef for int32_t. * g++.dg/lto/20080908-1_0.C: Add typedef for int32_t. * g++.dg/opt/pr55717.C: Add typedef for uint32_t. * g++.dg/opt/pr60597.C: Add typedef for int32_t. * g++.dg/opt/pr81715.C: Require size20plus. * g++.dg/opt/reload3.C: Add typedef for uint32_t. * g++.dg/opt/temp2.C: Require size20plus. * g++.dg/opt/thunk1.C: Likewise. * g++.dg/other/error23.C: Dont assume __SIZEOF_INT__ == 4. * g++.dg/other/pr31078.C: Adjust typedef for 32-bit int. * g++.dg/parse/concat1.C: Skip dg-error for size20plus. * g++.dg/parse/defarg5.C: Add typedef for int32_t and uint32_t. * g++.dg/pr48484.C: Add typedef for int32_t. * g++.dg/pr53037-2.C: Likewise. * g++.dg/pr53037-3.C: Likewise. * g++.dg/pr66655.C: Use int32_t. * g++.dg/pr66655.h: Add typedef for int32_t. * g++.dg/pr66655_1.cc: Use int32_t. * g++.dg/pr67351.C: Define 32-bit uint. * g++.dg/template/array30.C: Add typedef for int32_t. * g++.dg/template/constant1.C: Extend test for 8-bit and 16-bit int. * g++.dg/template/constant2.C: Likewise. * g++.dg/template/friend18.C: Add typedef for int32_t. * g++.dg/template/pr68978.C: Likewise. * g++.dg/torture/pr37421.C: Require int_eq_float. * g++.dg/torture/pr88861.C: Handle 16-bit int. * g++.dg/tree-ssa/pr19807.C: Likewise. * g++.dg/tree-ssa/pr27291.C: Fix typedef for uint32_t. * g++.dg/tree-ssa/pr49516.C: Fix typedefs for int{16,32}_t and uint{32,64}_t. * g++.dg/warn/Wconversion-integer.C: Add typedefs for {u,}int32_t. * g++.dg/warn/Wconversion-null-2.C: Adjust g() declaration. * g++.dg/warn/Wconversion-null.C: Likewise. * g++.dg/warn/Wconversion3.C: Skip dg-warning for short_eq_int. * g++.dg/warn/Wduplicated-branches1.C: Add dg-warning for short_eq_int. * g++.dg/warn/Wplacement-new-size-5.C: Add typedef for int32_t. * g++.dg/warn/Wplacement-new-size.C: Likewise. * g++.dg/warn/Wstrict-aliasing-5.C: Add typedef for uint32_t. * g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: Add typedef for {u,}int32_t. * g++.dg/warn/Wtype-limits-Wextra.C: Adjust dg-warning for short_eq_int. * g++.dg/warn/Wtype-limits.C: Likewise. * g++.old-deja/g++.brendan/enum11.C: Add typedef for uint32_t. * g++.old-deja/g++.bugs/900227_01.C: Skip dg-error for ptr_eq_short. * g++.old-deja/g++.mike/ns15.C: Require size20plus. * g++.old-deja/g++.other/exprstmt1.C: Add typedef for uint32_t. * g++.old-deja/g++.other/inline12.C: Adjust udword typedef. * g++.old-deja/g++.other/new6.C: Add typedef for int32_t. * g++.old-deja/g++.pt/crash16.C: Skip for int16. * g++.old-deja/g++.robertl/eb76.C: Likewise. * g++.old-deja/g++.warn/flow1.C: Add typedef for int32_t. * gcc.dg/Walloca-14.c: Adjust -Walloca-larger-than= parameter for !ptr32plus. * gcc.dg/Warray-bounds-32.c: Adjust dg-warning for size20plus. * gcc.dg/Wbuiltin-declaration-mismatch-4.c: Adjust dg-warning for short_eq_int. Handle case where ptrdiff_t/size_t is __int20. * gcc.dg/concat2.c: Skip dg-error for size20plus. * gcc.dg/fold-convmaxconv-1.c: Add typedef for {u,}int32_t. * gcc.dg/fold-convminconv-1.c: Likewise. * gcc.dg/graphite/scop-4.c: Require size20plus. * gcc.dg/loop-versioning-1.c: Adjust test for small size_t. * gcc.dg/loop-versioning-2.c: Require size20plus. * gcc.dg/lto/20081210-1_0.c: Adjust typedef for uintptr_t. * gcc.dg/lto/pr85870_0.c: Add typedef for uint32_t. * gcc.dg/lto/pr85870_1.c: Likewise. * gcc.dg/pr36227.c: Adjust typedef for ptrcast. * gcc.dg/pr42611.c: First check for size_t equality with void * before trying other types. * gcc.dg/pr59963-2.c: Skip dg-warning for int16 instead of xfail. * gcc.dg/pr68317.c: Add typedef for int32_t. * gcc.dg/pr78973.c: Adjust dg-warning for int16. * gcc.dg/pr85859.c: Cast using __INTPTR_TYPE__ instead of long. * gcc.dg/pr86179.c: Add typedef for {u,}int32_t. * gcc.dg/torture/20181024-1.c: Require size32plus. * gcc.dg/torture/pr71598-2.c: Skip for short_eq_int. * gcc.dg/torture/pr86034.c: Add typedef for int32_t. * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Adjust dg-warning for int16 and msp430 -mlarge. * gcc.dg/tree-ssa/integer-addr.c: Use __INTPTR_MAX__ for a large constant that is a valid address. * gcc.dg/tree-ssa/loop-interchange-10.c: Add typedef for int32_t. * gcc.dg/tree-ssa/pr84436-3.c: Adjust dg-final for int16. * gcc.dg/tree-ssa/pr84648.c: Add typedef for uint32_t. * gcc.dg/tree-ssa/scev-8.c: Cast to char if sizeof(int) == sizeof(short). * gcc.dg/tree-ssa/ssa-dom-thread-8.c: Adjust test for msp430 -mlarge. * lib/target-supports.exp (check_effective_target_size24plus): New. (check_effective_target_short_eq_int): New. (check_effective_target_ptr_eq_short): New. (check_effective_target_msp430_small): New. (check_effective_target_msp430_large): New.
2020-05-19bpf: do not save/restore callee-saved registers in function prolog/epilogJose E. Marchesi1-1/+5
BPF considers that every call to a function allocates a fresh set of registers that are available to the callee, of which the first five may have bee initialized with the function arguments. This is implemented by both interpreter and JIT in the Linux kernel. This is enforced by the kernel BPF verifier, which will reject any code in which non-initialized registers are accessed before being written. Consequently, the spill instructions generated in function prologue were causing the verifier to reject our compiled programs. This patch makes GCC to not save/restore callee-saved registers in function prologue/epilogue, unless xBPF mode is enabled. 2020-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> gcc/ * config/bpf/bpf.c (bpf_compute_frame_layout): Include space for callee saved registers only in xBPF. (bpf_expand_prologue): Save callee saved registers only in xBPF. (bpf_expand_epilogue): Likewise for restoring. * doc/invoke.texi (eBPF Options): Document this is activated by -mxbpf. gcc/testsuite/ * gcc.target/bpf/xbpf-callee-saved-regs-1.c: New test. * gcc.target/bpf/xbpf-callee-saved-regs-2.c: Likewise.
2020-05-19bpf: add support for the -mxbpf optionJose E. Marchesi1-1/+5
This patch adds support for a new option -mxbpf. This tells GCC to generate code for an expanded version of BPF that relaxes some of the restrictions imposed by BPF. 2020-05-19 Jose E. Marchesi <jose.marchesi@oracle.com> gcc/ * config/bpf/bpf.opt (mxbpf): New option. * doc/invoke.texi (Option Summary): Add -mxbpf. (eBPF Options): Document -mxbbpf.
2020-05-18bootstrap: Update requirement to C++11.Jason Merrill1-7/+9
There was general agreement last November that we would move to allowing C++11 features to be used in GCC 11; this patch implements that direction. ChangeLog 2020-05-18 Jason Merrill <jason@redhat.com> * configure.ac: Update bootstrap dialect to -std=c++11. config/ChangeLog 2020-05-18 Jason Merrill <jason@redhat.com> * ax_cxx_compile_stdcxx.m4: Import from autoconf archive with an adjustment to try the default mode. gcc/ChangeLog 2020-05-18 Jason Merrill <jason@redhat.com> * aclocal.m4: Add ax_cxx_compile_stdcxx.m4. * configure.ac: Use AX_CXX_COMPILE_STDCXX(11).
2020-05-14Skip jit tests for targets that don't support -lgccjitH.J. Lu1-0/+3
Since libgccjit.so is linked into jit tests, skip jit tests for targets that don't support -lgccjit. gcc/ PR jit/94778 * doc/sourcebuild.texi: Document effective target lgccjit. gcc/testsuite/ PR jit/94778 * jit.dg/jit.exp: Skip jit tests for targets that don't support -lgccjit. * lib/target-supports.exp (check_effective_target_lgccjit): New.