aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-08-30 2020-8-21 Steve Kargl <sgk@troutmask.apl.washington.edu>Steve Kargl2-1/+28
gcc/fortran/ChangeLog: PR fortran/95352 * simplify.c (simplify_bound_dim): Add check for NULL pointer before trying to access structure member. José Rui Faustino de Sousa <jrfsousa@gmail.com> gcc/testsuite/ChangeLog: * gfortran.dg/PR95352.f90: New test.
2020-08-30 2020-8-20 José Rui Faustino de Sousa <jrfsousa@gmail.com>José Rui Faustino de Sousa2-1/+92
gcc/fortran/ChangeLog: PR fortran/94110 * interface.c (gfc_compare_actual_formal): Add code to also raise the actual argument cannot be an assumed-size array error when the dummy arguments are deferred-shape or assumed-rank pointer. gcc/testsuite/ChangeLog: PR fortran/94110 * gfortran.dg/PR94110.f90: New test.
2020-08-30x86: Fix up ssse3_pshufbv8qi splitterJakub Jelinek1-5/+2
The constant pool size optimization I was testing resulted in various ICEs in gcc.target/i386/ testsuite, the problem is that the ssse3_pshufbv8qi splitter emits invalid RTL, in V4SImode 0xf7f7f7f7 CONST_INTs shouldn't appear, instead they should have been -0x8080809 (0xf7f7f7f7 sign extended into 64 bits). 2020-08-30 Jakub Jelinek <jakub@redhat.com> * config/i386/sse.md (ssse3_pshufbv8qi): Use gen_int_mode instead of GEN_INT, and ix86_build_const_vector instead of gen_rtvec and gen_rtx_CONT_VECTOR.
2020-08-30Daily bump.GCC Administrator2-1/+7
2020-08-28rs6000: Remove ALTIVEC_BUILTIN_MASK_FOR_STOREBill Schmidt2-10/+3
It turns out that the target hook that this is supposed to satisfy disappeared in 2004. Probably time to retire it. 2020-08-28 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-builtin.def (MASK_FOR_STORE): Remove. * config/rs6000/rs6000-call.c (rs6000_expand_builtin): Remove all logic for ALTIVEC_BUILTIN_MASK_FOR_STORE.
2020-08-29Daily bump.GCC Administrator7-1/+212
2020-08-28Add -Wstringop-overread for reading past the end by string functions.Martin Sebor43-676/+1793
gcc/ChangeLog: * attribs.c (init_attr_rdwr_indices): Use global access_mode. * attribs.h (struct attr_access): Same. * builtins.c (fold_builtin_strlen): Add argument. (compute_objsize): Declare. (get_range): Declare. (check_read_access): New function. (access_ref::access_ref): Define ctor. (warn_string_no_nul): Add arguments. Handle -Wstrintop-overread. (check_nul_terminated_array): Handle source strings of different ranges of sizes. (expand_builtin_strlen): Remove warning code, call check_read_access instead. Declare locals closer to their initialization. (expand_builtin_strnlen): Same. (maybe_warn_for_bound): New function. (warn_for_access): Remove argument. Handle -Wstrintop-overread. (inform_access): Change argument type. (get_size_range): New function. (check_access): Remove unused arguments. Add new arguments. Handle -Wstrintop-overread. Move warning code to helpers and call them. Call check_nul_terminated_array. (check_memop_access): Remove unnecessary and provide additional arguments in calls. (expand_builtin_memchr): Call check_read_access. (expand_builtin_strcat): Remove unnecessary and provide additional arguments in calls. (expand_builtin_strcpy): Same. (expand_builtin_strcpy_args): Same. Avoid testing no-warning bit. (expand_builtin_stpcpy_1): Remove unnecessary and provide additional arguments in calls. (expand_builtin_stpncpy): Same. (check_strncat_sizes): Same. (expand_builtin_strncat): Remove unnecessary and provide additional arguments in calls. Adjust comments. (expand_builtin_strncpy): Remove unnecessary and provide additional arguments in calls. (expand_builtin_memcmp): Remove warning code. Call check_access. (expand_builtin_strcmp): Call check_access instead of check_nul_terminated_array. (expand_builtin_strncmp): Handle -Wstrintop-overread. (expand_builtin_fork_or_exec): Call check_access instead of check_nul_terminated_array. (expand_builtin): Same. (fold_builtin_1): Pass additional argument. (fold_builtin_n): Same. (fold_builtin_strpbrk): Remove calls to check_nul_terminated_array. (expand_builtin_memory_chk): Add comments. (maybe_emit_chk_warning): Remove unnecessary and provide additional arguments in calls. (maybe_emit_sprintf_chk_warning): Same. Adjust comments. * builtins.h (warn_string_no_nul): Add arguments. (struct access_ref): Add member and ctor argument. (struct access_data): Add members and ctor. (check_access): Adjust signature. * calls.c (maybe_warn_nonstring_arg): Return an indication of whether a warning was issued. Issue -Wstrintop-overread instead of -Wstringop-overflow. (append_attrname): Adjust to naming changes. (maybe_warn_rdwr_sizes): Same. Remove unnecessary and provide additional arguments in calls. * calls.h (maybe_warn_nonstring_arg): Return bool. * doc/invoke.texi (-Wstringop-overread): Document new option. * gimple-fold.c (gimple_fold_builtin_strcpy): Provide an additional argument in call. (gimple_fold_builtin_stpcpy): Same. * tree-ssa-uninit.c (maybe_warn_pass_by_reference): Adjust to naming changes. * tree.h (enum access_mode): New type. gcc/c-family/ChangeLog: * c.opt (Wstringop-overread): New option. gcc/testsuite/ChangeLog: * c-c++-common/Warray-bounds-7.c: Adjust expected warnings. * c-c++-common/Wrestrict.c: Remove xfail. * c-c++-common/attr-nonstring-3.c: Adjust text of expected warnings. * c-c++-common/attr-nonstring-6.c: Suppress -Wstringop-overread instead of -Wstringop-overflow. * c-c++-common/attr-nonstring-8.c: Adjust text of expected warnings. * g++.dg/torture/Wsizeof-pointer-memaccess1.C: Also suppress -Wstringop-overread. * g++.dg/torture/Wsizeof-pointer-memaccess2.C: Same. * gcc.dg/Warray-bounds-39.c: Adjust expected warnings. * gcc.dg/Warray-bounds-40.c: Also suppress -Wstringop-overread. * gcc.dg/Warray-bounds-58.c: Remove xfail. Also expect -Wstringop-overread. Adjust text of expected warnings. * gcc.dg/Wsizeof-pointer-memaccess1.c: Also suppress -Wstringop-overread. * gcc.dg/Wstringop-overflow-22.c: Adjust text of expected warnings. * gcc.dg/Wstringop-overflow-33.c: Expect -Wstringop-overread. * gcc.dg/Wstringop-overflow-9.c: Expect -Wstringop-overread. * gcc.dg/attr-nonstring-2.c: Adjust text of expected warnings. * gcc.dg/attr-nonstring-3.c: Same. * gcc.dg/attr-nonstring-4.c: Same. * gcc.dg/attr-nonstring.c: Expect -Wstringop-overread. * gcc.dg/builtin-stringop-chk-5.c: Adjust comment. * gcc.dg/builtin-stringop-chk-8.c: Enable -Wstringop-overread instead of -Wstringop-overflow. * gcc.dg/pr78902.c: Also expect -Wstringop-overread. * gcc.dg/pr79214.c: Adjust text of expected warnings. * gcc.dg/strcmpopt_10.c: Suppress valid -Wno-stringop-overread. * gcc.dg/strlenopt-57.c: Also expect -Wstringop-overread. * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Also suppress valid -Wno-stringop-overread. * gcc.dg/tree-ssa/builtins-folding-gimple-ub.c: Same. * gcc.dg/uninit-33.c: Same. * gcc.dg/warn-strnlen-no-nul-2.c: Adjust text of expected warning. * gcc.dg/warn-strnlen-no-nul.c: Same. * gcc.target/i386/strcmpopt_6.c: Suppress -Wstringop-overread. * gcc.dg/Wstringop-overread-2.c: New test. * gcc.dg/Wstringop-overread.c: New test.
2020-08-28rs6000: r12 copy cleanupBill Schmidt1-4/+2
Remove unnecessary tests before copying function address to r12. 2020-08-28 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000.c (rs6000_call_aix): Remove test for r12. (rs6000_sibcall_aix): Likewise.
2020-08-28amdgcn: Update vec_safe_grow_cleared usageAndrew Stubbs1-1/+1
An API change broke the amdgcn build. gcc/ChangeLog: * config/gcn/gcn-tree.c (gcn_goacc_get_worker_red_decl): Add "true" parameter to vec_safe_grow_cleared.
2020-08-28Correct calls to vec::safe_grow in conditionally compiled code.Martin Sebor2-2/+2
gcc/ChangeLog: * ggc-common.c (gt_pch_save): Add argument to a call. gcc/jit/ChangeLog: * jit-recording.c (recording::switch_::make_debug_string): Add argument to a call.
2020-08-28PR c/96596 - ICE in match_builtin_function_types on a declaration of a ↵Martin Sebor2-1/+16
built-in with invalid array argument gcc/c/ChangeLog: PR c/96596 * c-decl.c (match_builtin_function_types): Avoid dealing with erroneous argument type. gcc/testsuite/ChangeLog: PR c/96596 * gcc.dg/Wbuiltin-declaration-mismatch-16.c: New test.
2020-08-28Fortran: Fix absent-optional handling for nondescriptor arrays (PR94672)Tobias Burnus2-2/+56
gcc/fortran/ChangeLog: PR fortran/94672 * trans-array.c (gfc_trans_g77_array): Check against the parm decl and set the nonparm decl used for the is-present check to NULL if absent. gcc/testsuite/ChangeLog: PR fortran/94672 * gfortran.dg/optional_assumed_charlen_2.f90: New test.
2020-08-28[PATCH PR96357][GCC][AArch64]: could not split insn UNSPEC_COND_FSUB with ↵Przemyslaw Wirkus2-5/+62
AArch64 SVE Problem is related to that operand 4 (In original pattern cond_sub<mode>_any_const) is no longer the same as operand 1, and so the pattern doesn't match the split condition. Pattern cond_sub<mode>_any_const is being split by this patch into two separate patterns: * Pattern cond_sub<mode>_relaxed_const now matches const_int SVE_RELAXED_GP operand. * Pattern cond_sub<mode>_strict_const now matches const_int SVE_STRICT_GP operand. * Remove aarch64_sve_pred_dominates_p condition from both patterns. gcc/ChangeLog: PR target/96357 * config/aarch64/aarch64-sve.md (cond_sub<mode>_relaxed_const): Updated and renamed from cond_sub<mode>_any_const pattern. (cond_sub<mode>_strict_const): New pattern. gcc/testsuite/ChangeLog: PR target/96357 * gcc.target/aarch64/sve/pr96357.c: New test.
2020-08-28fix a typo in rtl.texiWei Wentao1-1/+1
gcc/ * doc/rtl.texi: Fix typo.
2020-08-28aarch64: Disable mem-shift-canonical test on ILP32Alex Coplan1-0/+1
This test fails on ILP32 since we're looking for a pattern that could only be hit on LP64. Disabling the test on ILP32 since the problematic mult pattern was never hit there, so there's nothing to test. gcc/testsuite/ChangeLog: * gcc.target/aarch64/mem-shift-canonical.c: Skip on ILP32.
2020-08-28This patch fixes PR96624.Paul Thomas2-2/+26
2020-08-28 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/96624 * simplify.c (gfc_simplify_reshape): Detect zero shape and clear index if found. gcc/testsuite/ PR fortran/96624 * gfortran.dg/reshape_8.f90 : New test.
2020-08-28testsuite: Run gcc.dg/pr96579.c only on targets with dfp support.Christophe Lyon1-1/+1
gcc.dg/pr96579.c includes gcc.dg/pr96370.c which needs target dfp. 2020-08-28 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * gcc.dg/pr96579.c: Compile only with target dfp.
2020-08-28Add expander for movp2hi and movp2qi.liuhongt3-0/+49
2020-08-30 Uros Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/96744 * config/i386/i386-expand.c (split_double_mode): Also handle E_P2HImode and E_P2QImode. * config/i386/sse.md (MASK_DWI): New define_mode_iterator. (mov<mode>): New expander for P2HI,P2QI. (*mov<mode>_internal): New define_insn_and_split to split movement of P2QI/P2HI to 2 movqi/movhi patterns after reload. gcc/testsuite/ChangeLog: * gcc.target/i386/double_mask_reg-1.c: New test.
2020-08-28Fix: AVX512VP2INTERSECT should imply AVX512DQ.liuhongt1-2/+2
gcc/ChangeLog * common/config/i386/i386-common.c (ix86_handle_option): Set AVX512DQ when AVX512VP2INTERSECT exists.
2020-08-28Daily bump.GCC Administrator8-1/+297
2020-08-27gotest: use a space rather than a middle dot in target listsMaciej W. Rozycki1-1/+1
Replace the U+00B7 middle dot character, placed after "mips64p32le" in the target lists, with a space. The U+00B7 character may not be considered whitespace by Bourne shell and any non-ASCII character may render incorrectly in some terminal devices. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/251177
2020-08-27Fix shadd-2.c scan assembler count.John David Anglin1-1/+1
2020-08-27 John David Anglin <danglin@gcc.gnu.org> gcc/testsuite/ * gcc.target/hppa/shadd-2.c: Adjust times to 4.
2020-08-27ia32: Fix alignment of _Atomic fields [PR65146]Jakub Jelinek2-5/+42
For _Atomic fields, lowering the alignment of long long or double etc. fields on ia32 is undesirable, because then one really can't perform atomic operations on those using cmpxchg8b. The following patch stops lowering the alignment in fields for _Atomic types (the x86_field_alignment change) and for -mpreferred-stack-boundary=2 also ensures we don't misalign _Atomic long long etc. automatic variables (the ix86_{local,minimum}_alignment changes). Not sure about iamcu_alignment change, I know next to nothing about IA MCU, but unless it doesn't have cmpxchg8b instruction, it would surprise me if we don't want to do it as well. clang apparently doesn't lower the field alignment for _Atomic. 2020-08-27 Jakub Jelinek <jakub@redhat.com> PR target/65146 * config/i386/i386.c (iamcu_alignment): Don't decrease alignment for TYPE_ATOMIC types. (ix86_local_alignment): Likewise. (ix86_minimum_alignment): Likewise. (x86_field_alignment): Likewise, and emit a -Wpsabi diagnostic for it. * gcc.target/i386/pr65146.c: New test.
2020-08-27rs6000: Support ELFv2 sibcall for indirect calls [PR96787]Bill Schmidt3-1/+91
Prior to P10, ELFv2 hasn't implemented nonlocal sibcalls. Now that we do, we need to be sure that r12 is set up prior to such a call. 2020-08-27 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ PR target/96787 * config/rs6000/rs6000.c (rs6000_sibcall_aix): Support indirect call for ELFv2. gcc/testsuite/ PR target/96787 * gcc.target/powerpc/pr96787-1.c: New. * gcc.target/powerpc/pr96787-2.c: New.
2020-08-27Fortran : ICE for division by zero in declaration PR95882Mark Eggleston6-0/+36
A length expression containing a divide by zero in a character declaration will result in an ICE if the constant is anymore complicated that a contant divided by a constant. The cause was that char_len_param_value can return MATCH_YES even if a divide by zero was seen. Prior to returning check whether a divide by zero was seen and if so set it to MATCH_ERROR. 2020-08-27 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran PR fortran/95882 * decl.c (char_len_param_value): Check gfc_seen_div0 and if it is set return MATCH_ERROR. 2020-08-27 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/95882 * gfortran.dg/pr95882_1.f90: New test. * gfortran.dg/pr95882_2.f90: New test. * gfortran.dg/pr95882_3.f90: New test. * gfortran.dg/pr95882_4.f90: New test. * gfortran.dg/pr95882_5.f90: New test.
2020-08-27tree-optimization/96522 - transfer of flow-sensitive info in copy_ref_infoRichard Biener3-32/+55
This removes the bogus tranfer of flow-sensitive info in copy_ref_info plus fixes one oversight in FRE when flow-sensitive non-NULLness was added to points-to info. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96522 * tree-ssa-address.c (copy_ref_info): Reset flow-sensitive info of the copied points-to. Transfer bigger alignment via the access type. * tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Reset all flow-sensitive info. * gcc.dg/torture/pr96522.c: New testcase.
2020-08-27vec: add exact argument for various grow functions.Martin Liska86-212/+222
gcc/ada/ChangeLog: * gcc-interface/trans.c (gigi): Set exact argument of a vector growth function to true. (Attribute_to_gnu): Likewise. gcc/ChangeLog: * alias.c (init_alias_analysis): Set exact argument of a vector growth function to true. * calls.c (internal_arg_pointer_based_exp_scan): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgexpand.c (expand_asm_stmt): Likewise. * cfgrtl.c (rtl_create_basic_block): Likewise. * combine.c (combine_split_insns): Likewise. (combine_instructions): Likewise. * config/aarch64/aarch64-sve-builtins.cc (function_expander::add_output_operand): Likewise. (function_expander::add_input_operand): Likewise. (function_expander::add_integer_operand): Likewise. (function_expander::add_address_operand): Likewise. (function_expander::add_fixed_operand): Likewise. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * dwarf2cfi.c (update_row_reg_save): Likewise. * early-remat.c (early_remat::init_block_info): Likewise. (early_remat::finalize_candidate_indices): Likewise. * except.c (sjlj_build_landing_pads): Likewise. * final.c (compute_alignments): Likewise. (grow_label_align): Likewise. * function.c (temp_slots_at_level): Likewise. * fwprop.c (build_single_def_use_links): Likewise. (update_uses): Likewise. * gcc.c (insert_wrapper): Likewise. * genautomata.c (create_state_ainsn_table): Likewise. (add_vect): Likewise. (output_dead_lock_vect): Likewise. * genmatch.c (capture_info::capture_info): Likewise. (parser::finish_match_operand): Likewise. * genrecog.c (optimize_subroutine_group): Likewise. (merge_pattern_info::merge_pattern_info): Likewise. (merge_into_decision): Likewise. (print_subroutine_start): Likewise. (main): Likewise. * gimple-loop-versioning.cc (loop_versioning::loop_versioning): Likewise. * gimple.c (gimple_set_bb): Likewise. * graphite-isl-ast-to-gimple.c (translate_isl_ast_node_user): Likewise. * haifa-sched.c (sched_extend_luids): Likewise. (extend_h_i_d): Likewise. * insn-addr.h (insn_addresses_new): Likewise. * ipa-cp.c (gather_context_independent_values): Likewise. (find_more_contexts_for_caller_subset): Likewise. * ipa-devirt.c (final_warning_record::grow_type_warnings): Likewise. (ipa_odr_read_section): Likewise. * ipa-fnsummary.c (evaluate_properties_for_edge): Likewise. (ipa_fn_summary_t::duplicate): Likewise. (analyze_function_body): Likewise. (ipa_merge_fn_summary_after_inlining): Likewise. (read_ipa_call_summary): Likewise. * ipa-icf.c (sem_function::bb_dict_test): Likewise. * ipa-prop.c (ipa_alloc_node_params): Likewise. (parm_bb_aa_status_for_bb): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_analyze_node): Likewise. (update_jump_functions_after_inlining): Likewise. (ipa_read_edge_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_transform_function): Likewise. * ipa-reference.c (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (execute_split_functions): Likewise. * ira.c (find_moveable_pseudos): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lto-streamer-in.c (input_eh_regions): Likewise. (input_cfg): Likewise. (input_struct_function_base): Likewise. (input_function): Likewise. * modulo-sched.c (set_node_sched_params): Likewise. (extend_node_sched_params): Likewise. (schedule_reg_moves): Likewise. * omp-general.c (omp_construct_simd_compare): Likewise. * passes.c (pass_manager::create_pass_tab): Likewise. (enable_disable_pass): Likewise. * predict.c (determine_unlikely_bbs): Likewise. * profile.c (compute_branch_probabilities): Likewise. * read-rtl-function.c (function_reader::parse_block): Likewise. * read-rtl.c (rtx_reader::read_rtx_code): Likewise. * reg-stack.c (stack_regs_mentioned): Likewise. * regrename.c (regrename_init): Likewise. * rtlanal.c (T>::add_single_to_queue): Likewise. * sched-deps.c (init_deps_data_vector): Likewise. * sel-sched-ir.c (sel_extend_global_bb_info): Likewise. (extend_region_bb_info): Likewise. (extend_insn_data): Likewise. * symtab.c (symtab_node::create_reference): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (tm_region_init): Likewise. (get_bb_regions_instrumented): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. (build_gimple_cfg): Likewise. (create_bb): Likewise. (move_block_to_fn): Likewise. * tree-complex.c (tree_lower_complex): Likewise. * tree-if-conv.c (predicate_rhs_code): Likewise. * tree-inline.c (copy_bb): Likewise. * tree-into-ssa.c (get_ssa_name_ann): Likewise. (mark_phi_for_rewrite): Likewise. * tree-object-size.c (compute_builtin_object_size): Likewise. (init_object_sizes): Likewise. * tree-predcom.c (initialize_root_vars_store_elim_1): Likewise. (initialize_root_vars_store_elim_2): Likewise. (prepare_initializers_chain_store_elim): Likewise. * tree-ssa-address.c (addr_for_mem_ref): Likewise. (multiplier_allowed_in_address_p): Likewise. * tree-ssa-coalesce.c (ssa_conflicts_new): Likewise. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. * tree-ssa-loop-ivopts.c (addr_offset_valid_p): Likewise. (get_address_cost_ainc): Likewise. * tree-ssa-loop-niter.c (discover_iteration_bound_by_body_walk): Likewise. * tree-ssa-pre.c (add_to_value): Likewise. (phi_translate_1): Likewise. (do_pre_regular_insertion): Likewise. (do_pre_partial_partial_insertion): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (update_call_from_tree): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_cmp_bitwise): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. (vn_reference_lookup_pieces): Likewise. (eliminate_dom_walker::eliminate_push_avail): Likewise. * tree-ssa-strlen.c (set_strinfo): Likewise. (get_stridx_plus_constant): Likewise. (zero_length_string): Likewise. (find_equal_ptrs): Likewise. (printf_strlen_execute): Likewise. * tree-ssa-threadedge.c (set_ssa_name_value): Likewise. * tree-ssanames.c (make_ssa_name_fn): Likewise. * tree-streamer-in.c (streamer_read_tree_bitfields): Likewise. * tree-vect-loop.c (vect_record_loop_mask): Likewise. (vect_get_loop_mask): Likewise. (vect_record_loop_len): Likewise. (vect_get_loop_len): Likewise. * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Likewise. * tree-vect-slp.c (vect_slp_convert_to_external): Likewise. (vect_bb_slp_scalar_cost): Likewise. (vect_bb_vectorization_profitable_p): Likewise. (vectorizable_slp_permutation): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (scan_store_can_perm_p): Likewise. (vectorizable_store): Likewise. * expr.c: Likewise. * vec.c (test_safe_grow_cleared): Likewise. * vec.h (vec_safe_grow): Likewise. (vec_safe_grow_cleared): Likewise. (vl_ptr>::safe_grow): Likewise. (vl_ptr>::safe_grow_cleared): Likewise. * config/c6x/c6x.c (insn_set_clock): Likewise. gcc/c/ChangeLog: * gimple-parser.c (c_parser_gimple_compound_statement): Set exact argument of a vector growth function to true. gcc/cp/ChangeLog: * class.c (build_vtbl_initializer): Set exact argument of a vector growth function to true. * constraint.cc (get_mapped_args): Likewise. * decl.c (cp_maybe_mangle_decomp): Likewise. (cp_finish_decomp): Likewise. * parser.c (cp_parser_omp_for_loop): Likewise. * pt.c (canonical_type_parameter): Likewise. * rtti.c (get_pseudo_ti_init): Likewise. gcc/fortran/ChangeLog: * trans-openmp.c (gfc_trans_omp_do): Set exact argument of a vector growth function to true. gcc/lto/ChangeLog: * lto-common.c (lto_file_finalize): Set exact argument of a vector growth function to true.
2020-08-27streamline TARGET_MEM_REF dumpingRichard Biener4-67/+30
The following streamlines TARGET_MEM_REF dumping building on what we do for MEM_REF and thus dumping things like access type, TBAA type and base/clique. I've changed it to do semantic dumping aka base + offset + step * index rather than the odd base: A, step: way. 2020-08-27 Richard Biener <rguenther@suse.de> * tree-pretty-print.c (dump_mem_ref): Handle TARGET_MEM_REFs. (dump_generic_node): Use dump_mem_ref also for TARGET_MEM_REF. * gcc.dg/tree-ssa/loop-19.c: Adjust. * gcc.dg/tree-ssa/loop-2.c: Likewise. * gcc.dg/tree-ssa/loop-3.c: Likewise.
2020-08-27lra: Canonicalize mult to shift in address reloadsAlex Coplan2-4/+66
Inside a (mem) RTX, it is canonical to write multiplications by powers of two using a (mult) [0]. Outside of a (mem), the canonical way to write multiplications by powers of two is using (ashift). Now I observed that LRA does not quite respect this RTL canonicalization rule. When compiling gcc/testsuite/gcc.dg/torture/pr34330.c with -Os -ftree-vectorize, the RTL in the dump "281r.ira" has the insn: (set (reg:SI 111) (mem:SI (plus:DI (mult:DI (reg:DI 101 [ ivtmp.9 ]) (const_int 4 [0x4])) (reg/v/f:DI 105 [ b ])))) but LRA then proceeds to generate a reload, and we get the following non-canonical insn in "282r.reload": (set (reg:DI 7 x7 [121]) (plus:DI (mult:DI (reg:DI 5 x5 [orig:101 ivtmp.9 ] [101]) (const_int 4 [0x4])) (reg/v/f:DI 1 x1 [orig:105 b ] [105]))) This patch fixes LRA to ensure that we generate canonical RTL in this case. After the patch, we get the following insn in "282r.reload": (set (reg:DI 7 x7 [121]) (plus:DI (ashift:DI (reg:DI 5 x5 [orig:101 ivtmp.9 ] [101]) (const_int 2 [0x2])) (reg/v/f:DI 1 x1 [orig:105 b ] [105]))) [0] : https://gcc.gnu.org/onlinedocs/gccint/Insn-Canonicalizations.html gcc/ChangeLog: * lra-constraints.c (canonicalize_reload_addr): New. (curr_insn_transform): Use canonicalize_reload_addr to ensure we generate canonical RTL for an address reload. gcc/testsuite/ChangeLog: * gcc.target/aarch64/mem-shift-canonical.c: New test.
2020-08-27AArch64: Add FLAG for rounding intrinsics [PR94442]xiezhiheng1-94/+94
2020-08-27 Zhiheng Xie <xiezhiheng@huawei.com> gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Add proper FLAG for rounding intrinsics.
2020-08-27AArch64: Add FLAG for min/max intrinsics [PR94442]xiezhiheng1-22/+22
2020-08-27 Zhiheng Xie <xiezhiheng@huawei.com> gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Add proper FLAG for min/max intrinsics.
2020-08-27tree-optimization/96579 - another special-operands fix in reassocRichard Biener2-2/+15
This makes sure to put special-ops expanded rhs left where expression rewrite expects it. 2020-08-27 Richard Biener <rguenther@suse.de> PR tree-optimization/96579 * tree-ssa-reassoc.c (linearize_expr_tree): If we expand rhs via special ops make sure to swap operands. * gcc.dg/pr96579.c: New testcase.
2020-08-27tree-optimization/96565 - improve DSE with paths ending in noreturnRichard Biener3-0/+30
This improves DSEs stmt walking by not considering a DEF without uses for further processing (and thus giving up when there's two paths to follow). 2020-08-26 Richard Biener <rguenther@suse.de> PR tree-optimization/96565 * tree-ssa-dse.c (dse_classify_store): Remove defs with no uses from further processing. * gcc.dg/tree-ssa/ssa-dse-40.c: New testcase. * gcc.dg/builtin-object-size-4.c: Adjust.
2020-08-27Daily bump.GCC Administrator7-1/+358
2020-08-26cmd: add -maix32 to gcc calls for aix/ppcClément Chigot1-1/+1
As gcc might now be compiled in 64bit, -maix32 must always be added to ensure that created objects will be 32bit. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/250778
2020-08-26libgo: add FAT library support for static libraries on AIXClément Chigot1-1/+1
Like shared libraries, AIX static libraries must also have both 32 and 64 bit objects. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/250777
2020-08-26Mark various tests that require a c99 libmJeff Law15-0/+15
A number of i386 math optimisation tests are looking assembly instructions that are only emitted when the compiler knows the target has a C99 libm available. Since targets like *-elf may not have such a libm, a C99 runtime requirement is added to these tests. gcc/testsuite/ChangeLog * gcc.target/i386/387-7.c: Add dg-require-effective-target c99_runtime. * gcc.target/i386/387-9.c: Likewise. * g++.target/i386/avx512bw-pr96246-1.C: Likewise. * gcc.target/i386/avx512f-rint-sfix-vec-2.c: Likewise. * gcc.target/i386/avx512f-rintf-sfix-vec-2.c: Likewise. * g++.target/i386/avx512vl-pr96246-1.C: Likewise. * gcc.target/i386/pr61403.c: Likewise. * gcc.target/i386/sse4_1-ceil-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-ceilf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-floor-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-floorf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-rint-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-rintf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-round-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-roundf-sfix-vec.c: Likewise.
2020-08-26Fix documentation of -fprofile-exclude-filesGöran Uddeborg2-9/+9
The wording of the description of -fprofile-exclude-files is easy to misunderstand. One can be led to believe a file is excluded only if it matches all of the patterns, not just one. This patch tries to clarify the function. It also adjusts the wording of -fprofile-filter-files accordingly. gcc/ PR gcov-profile/96285 * common.opt, doc/invoke.texi: Clarify wording of -fprofile-exclude-files and adjust -fprofile-filter-files to match.
2020-08-26x86: Reject target("no-general-regs-only")H.J. Lu3-0/+35
Reject target("no-general-regs-only") pragma and attribute. gcc/ PR target/96802 * config/i386/i386-options.c (ix86_valid_target_attribute_inner_p): Reject target("no-general-regs-only"). gcc/testsuite/ PR target/96802 * gcc.target/i386/pr96802-1.c: New test. * gcc.target/i386/pr96802-2.c: Likewise.
2020-08-26MSP430: Simplify and extend shift instruction patternsJozef Lawrynowicz11-374/+481
The implementation of define_expand and define_insn patterns to handle shifts in the MSP430 backend is inconsistent, resulting in missed opportunities to make best use of the architecture's features. There's now a single define_expand used as the entry point for all valid shifts, and the decision to either use a helper function to perform the shift (often required for the 430 ISA), or fall through to the define_insn patterns can be made from that expander function. Shifts by a constant amount have been grouped into one define_insn for each type of shift, instead of having different define_insn patterns for shifts by different amounts. A new target option "-mmax-inline-shift=" has been added to allow tuning of the number of shift instructions to emit inline, instead of using a library helper function. gcc/ChangeLog: * config/msp430/constraints.md (K): Change unused constraint to constraint to a const_int between 1 and 19. (P): New constraint. * config/msp430/msp430-protos.h (msp430x_logical_shift_right): Remove. (msp430_expand_shift): New. (msp430_output_asm_shift_insns): New. * config/msp430/msp430.c (msp430_rtx_costs): Remove shift costs. (CSH): Remove. (msp430_expand_helper): Remove hard-coded generation of some inline shift insns. (use_helper_for_const_shift): New. (msp430_expand_shift): New. (msp430_output_asm_shift_insns): New. (msp430_print_operand): Add new 'W' operand selector. (msp430x_logical_shift_right): Remove. * config/msp430/msp430.md (HPSI): New define_mode_iterator. (HDI): Likewise. (any_shift): New define_code_iterator. (shift_insn): New define_code_attr. Adjust unnamed insn patterns searched for by combine. (ashlhi3): Remove. (slli_1): Remove. (430x_shift_left): Remove. (slll_1): Remove. (slll_2): Remove. (ashlsi3): Remove. (ashldi3): Remove. (ashrhi3): Remove. (srai_1): Remove. (430x_arithmetic_shift_right): Remove. (srap_1): Remove. (srap_2): Remove. (sral_1): Remove. (sral_2): Remove. (ashrsi3): Remove. (ashrdi3): Remove. (lshrhi3): Remove. (srli_1): Remove. (430x_logical_shift_right): Remove. (srlp_1): Remove. (srll_1): Remove. (srll_2x): Remove. (lshrsi3): Remove. (lshrdi3): Remove. (<shift_insn><mode>3): New define_expand. (<shift_insn>hi3_430): New define_insn. (<shift_insn>si3_const): Likewise. (ashl<mode>3_430x): Likewise. (ashr<mode>3_430x): Likewise. (lshr<mode>3_430x): Likewise. (*bitbranch<mode>4_z): Replace renamed predicate msp430_bitpos with const_0_to_15_operand. * config/msp430/msp430.opt: New option -mmax-inline-shift=. * config/msp430/predicates.md (const_1_to_8_operand): New predicate. (const_0_to_15_operand): Rename msp430_bitpos predicate. (const_1_to_19_operand): New predicate. * doc/invoke.texi: Document -mmax-inline-shift=. libgcc/ChangeLog: * config/msp430/slli.S (__gnu_mspabi_sllp): New. * config/msp430/srai.S (__gnu_mspabi_srap): New. * config/msp430/srli.S (__gnu_mspabi_srlp): New. gcc/testsuite/ChangeLog: * gcc.target/msp430/emulate-srli.c: Fix expected assembler text. * gcc.target/msp430/max-inline-shift-430-no-opt.c: New test. * gcc.target/msp430/max-inline-shift-430.c: New test. * gcc.target/msp430/max-inline-shift-430x.c: New test.
2020-08-26Adjust tree-ssa-dom.c for irange API.Aldy Hernandez3-107/+67
This removes all uses of VR_ANTI_RANGE. gcc/ChangeLog: * tree-ssa-dom.c (simplify_stmt_for_jump_threading): Abstract code out to... * tree-vrp.c (find_case_label_range): ...here. Rewrite for to use irange API. (simplify_stmt_for_jump_threading): Call find_case_label_range instead of duplicating the code in simplify_stmt_for_jump_threading. * tree-vrp.h (find_case_label_range): New prototype.
2020-08-26tree-optimization/96698 - fix ICE when vectorizing nested cyclesRichard Biener4-25/+63
This fixes vectorized PHI latch edge updating and delay it until all of the loop is code generated to deal with the case that the latch def is a PHI in the same block. 2020-08-26 Richard Biener <rguenther@suse.de> PR tree-optimization/96698 * tree-vectorizer.h (loop_vec_info::reduc_latch_defs): New. (loop_vec_info::reduc_latch_slp_defs): Likewise. * tree-vect-stmts.c (vect_transform_stmt): Only record stmts to update PHI latches from, perform the update ... * tree-vect-loop.c (vect_transform_loop): ... here after vectorizing those PHIs. (info_for_reduction): Properly handle non-reduction PHIs. * gcc.dg/vect/pr96698.c: New testcase.
2020-08-26symver: fix attribute matching.Martin Liska1-0/+3
gcc/ChangeLog: * cgraphunit.c (process_symver_attribute): Match only symver TREE_PURPOSE.
2020-08-26tree-optimization/96783 - fix vectorization of negative step SLPRichard Biener3-1/+76
This appropriately uses VMAT_ELEMENTWISE when the vectors cannot be filled from a single SLP group until we get more explicit support for negative stride SLP. 2020-08-26 Richard Biener <rguenther@suse.de> PR tree-optimization/96783 * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_ELEMENTWISE for negative strides when we cannot use VMAT_STRIDED_SLP. * gcc.dg/vect/pr96783-1.c: New testcase. * gcc.dg/vect/pr96783-2.c: Likewise.
2020-08-26c++: template operator lookup cachingNathan Sidwell4-40/+108
Jason's fix to retain operator lookups inside dependent lambda functions turns out to be needed on the modules branch for all template functions. Because the context for that lookup no longer exists in imports. There were also a couple of shortcomings, which this patch fixes. (a) we conflate 'we found nothing' and 'we can redo this at instantiation time'. Fixed by making the former produce error_mark_node. That needs a fix in name-lookup to know that finding a binding containing error_mark_node, means 'stop looking' you found nothing. (b) we'd continually do lookups for every operator, if nothing needed to be retained. Fixed by always caching that information, and then dealing with it when pushing the bindings. (c) if what we found was that find by a global namespace lookup, we'd not cache that. But that'd cause us to either find decls declared after the template, potentially hiding those we expected to find. So don't do that check. This still retains only recording on lambdas. As the comment says, we could enable for all templates. gcc/cp/ * decl.c (poplevel): A local-binding tree list holds the name in TREE_PURPOSE. * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE. (lookup_name_1): Deal with local-binding error_mark_node marker. (op_unqualified_lookup): Return error_mark_node for 'nothing found'. Retain global binding, check class binding here. (maybe_save_operator_binding): Reimplement to always cache a result. (push_operator_bindings): Deal with 'ignore' marker. gcc/testsuite/ * g++.dg/lookup/operator-1.C: New. * g++.dg/lookup/operator-2.C: New.
2020-08-26lto: fix documentation about -fpie and -fpic optionsMartin Liska1-3/+14
gcc/ChangeLog: * doc/invoke.texi: Document how are pie and pic options merged.
2020-08-26AArch64: Add FLAG for add/sub arithmetic intrinsics [PR94442]xiezhiheng1-36/+40
2020-08-26 Zhiheng Xie <xiezhiheng@huawei.com> gcc/ChangeLog: * config/aarch64/aarch64-simd-builtins.def: Add proper FLAG for add/sub arithmetic intrinsics.
2020-08-26aarch64: Fix testcase gcc.target/aarch64/insv_1.cQian Jianhua1-1/+1
There are three failures in gcc.target/aarch64/insv_1.c. FAIL: gcc.target/aarch64/insv_1.c scan-assembler bfi\tx[0-9]+, x[0-9]+, 0, 8 FAIL: gcc.target/aarch64/insv_1.c scan-assembler bfi\tx[0-9]+, x[0-9]+, 16, 5 FAIL: gcc.target/aarch64/insv_1.c scan-assembler movk\tx[0-9]+, 0x1d6b, lsl 32 This patch fix the third failure which was missed "#" before immediate value in scan-assembler. gcc/testsuite/ChangeLog: * gcc.target/aarch64/insv_1.c: Add '#' in scan-assembler
2020-08-26dwarf2out: Fix up dwarf2out_next_real_insn caching [PR96729]Jakub Jelinek1-16/+20
The addition of NOTE_INSN_BEGIN_STMT and NOTE_INSN_INLINE_ENTRY notes reintroduced quadratic behavior into dwarf2out_var_location. This function needs to know the next real instruction to which the var location note applies, but the way final_scan_insn is called outside of final.c main loop doesn't make it easy to look up the next real insn in there (and for non-dwarf it is even useless). Usually next real insn is only a few notes away, but we can have hundreds of thousands of consecutive notes only followed by a real insn. dwarf2out_var_location to avoid the quadratic behavior contains a cache, it remembers the next note and when it is called again on that loc_note, it can use the previously computed dwarf2out_next_real_insn result, rather than walking the insn chain once again. But, for NOTE_INSN_{BEGIN_STMT,INLINE_ENTRY} dwarf2out_var_location is not called while the code puts into the cache those notes, which means if we have e.g. in the worst case NOTE_INSN_VAR_LOCATION and NOTE_INSN_BEGIN_STMT notes alternating, the cache is not really used. The following patch fixes it by looking up the next NOTE_INSN_VAR_LOCATION if any. While the lookup could be perhaps done together with looking for the next real insn once (e.g. in dwarf2out_next_real_insn or its copy), there are other dwarf2out_next_real_insn callers which don't need/want that behavior and if there are more than two NOTE_INSN_VAR_LOCATION notes followed by the same real insn, we need to do that "find next NOTE_INSN_VAR_LOCATION" walk anyway. On the testcase from the PR this patch speeds it 2.8times, from 0m0.674s to 0m0.236s (why it takes for the reporter more than 60s is unknown). 2020-08-26 Jakub Jelinek <jakub@redhat.com> PR debug/96729 * dwarf2out.c (dwarf2out_next_real_insn): Adjust function comment. (dwarf2out_var_location): Look for next_note only if next_real is non-NULL, in that case look for the first non-deleted NOTE_INSN_VAR_LOCATION between loc_note and next_real, if any.
2020-08-26d: Merge upstream dmd e49192807Iain Buclaw3-53/+35
1. Removes prelude assert for constructors and destructors. To trigger these asserts one needed to construct or destruct an aggregate at the null memory location. This would crash upon any data member access, which is required for a constructor or destructor to do anything useful. 2. Disables bounds checking in foreach statements, when the array is either a static or dynamic array. If we trust the array `.length' to be correct, then all elements are between `[0 .. length]', and can't can't be out of bounds. Reviewed-on: https://github.com/dlang/dmd/pull/11623 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd e49192807