Commit Graph

179079 Commits

Author SHA1 Message Date
Bill Schmidt
26c24398d3 rs6000: r12 copy cleanup
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-28 11:47:01 -05:00
Andrew Stubbs
1c1e41b065 amdgcn: Update vec_safe_grow_cleared usage
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-28 15:43:06 +01:00
Martin Sebor
1ad755dcbb Correct calls to vec::safe_grow in conditionally compiled code.
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-28 08:31:50 -06:00
Martin Sebor
ba6373a397 PR c/96596 - ICE in match_builtin_function_types on a declaration of a 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-28 08:26:32 -06:00
Tobias Burnus
cb3c3d6331 Fortran: Fix absent-optional handling for nondescriptor arrays (PR94672)
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 13:54:10 +02:00
Przemyslaw Wirkus
b648814c02 [PATCH PR96357][GCC][AArch64]: could not split insn UNSPEC_COND_FSUB with 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-28 11:34:03 +01:00
Wei Wentao
3b062fc43e fix a typo in rtl.texi
gcc/
	* doc/rtl.texi: Fix typo.
2020-08-28 10:43:56 +01:00
Alex Coplan
43f3e69569 aarch64: Disable mem-shift-canonical test on ILP32
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-28 10:31:08 +01:00
Paul Thomas
9d463ce7f9 This patch fixes PR96624.
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-28 09:02:58 +01:00
Christophe Lyon
3ba43155d2 testsuite: Run gcc.dg/pr96579.c only on targets with dfp support.
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-28 07:59:50 +00:00
liuhongt
58d6eea0e0 Add expander for movp2hi and movp2qi.
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-28 15:45:00 +08:00
liuhongt
6ba0973037 Fix: AVX512VP2INTERSECT should imply AVX512DQ.
gcc/ChangeLog

	* common/config/i386/i386-common.c (ix86_handle_option): Set
	AVX512DQ when AVX512VP2INTERSECT exists.
2020-08-28 15:44:54 +08:00
GCC Administrator
8b394f011a Daily bump. 2020-08-28 00:16:24 +00:00
Maciej W. Rozycki
cad843c7e7 gotest: use a space rather than a middle dot in target lists
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-27 16:18:01 -07:00
Jonathan Wakely
82030d5101 libstdc++: Make std::chrono::duration use reduced ratio for period
This implements the changes from P0548 "common_type and duration". That
was a change for C++17, but as it corrects some issues introduced by DRs
I'm also treating it as a DR and changing it for all modes from C++11
up.

The main change is that duration<R,P>::period no longer denotes P, but
rather P::type, the reduced ratio. The unary operator+ and operator-
members of duration should now return a duration using that reduced
ratio.

The requirement that common_type<T>::type is the same type as
common_type<T, T>::type (rather than simply T) was already implemented
for PR 89102.

The standard says that duration::operator+() and duration::operator-()
should return common_type_t<duration>, but that seems unnecessarily
expensive to compute. This change just uses duration<rep, period> which
is the same type, so we don't need to instantiate common_type.

As an optimization, this also adds partial specializations of
common_type for two durations of the same type, a single duration, two
time_points of the same type, and a single time_point. These
specializations avoid instantiating other specializations of common_type
and one or both of __duration_common_type or __timepoint_common_type for
the cases where the answer is trivial to obtain.

libstdc++-v3/ChangeLog:

	* include/std/chrono (__duration_common_type): Ensure the
	reduced ratio is used. Remove unused partial specialization
	using __failure_type.
	(common_type): Pass reduced ratios to __duration_common_type.
	Add partial specializations for simple cases involving a single
	duration or time_point type.
	(duration::period): Use reduced ratio.
	(duration::operator+(), duration::operator-()): Return duration
	type using the reduced ratio.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc:
	Adjust expected errors.
	* testsuite/20_util/duration/requirements/reduced_period.cc: New test.
2020-08-27 22:36:03 +01:00
John David Anglin
33a55fdb1e Fix shadd-2.c scan assembler count.
2020-08-27  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/
	* gcc.target/hppa/shadd-2.c: Adjust times to 4.
2020-08-27 19:21:22 +00:00
Patrick Palka
71e9716137 libstdc++: Fix arithmetic bug in chrono::year_month::operator+
This fixes the months-based addition for year_month when the
year_month's month component is 0.

libstdc++-v3/ChangeLog:

	* include/std/chrono (year_month::operator+): Properly handle a
	month value of 0 by casting the month value to int before
	subtracting 1 from it so that the difference is sign-extended in
	the subsequent addition.
	* testsuite/std/time/year_month/1.cc: Test adding months to a
	year_month whose month component is below or above the
	normalized range of [1,12].
2020-08-27 14:11:24 -04:00
Patrick Palka
7b743c67f0 libstdc++: Fix operator overload ambiguity with calendar types
We currently don't enforce a constraint on some of the calendar types'
addition/subtraction operator overloads that take a 'months' arguments:

  Constraints: If the argument supplied by the caller for the months
  parameter is convertible to years, its implicit conversion sequence to
  years is worse than its implicit conversion sequence to months.

This constraint is relevant when adding/subtracting a duration to/from,
say, a year_month where the given duration is convertible to both
'months' and to 'years' (as in the new testcases below).  The correct
behavior here in light of this constraint is to perform the operation
through the (more efficient) 'years'-based overload, but we currently
emit an ambiguous overload error.

This patch templatizes the 'months'-based addition/subtraction operator
overloads so that in the event of an implicit-conversion tie, we select
the non-template 'years'-based overload.  This is the same approach
that the date library takes for enforcing this constraint.

libstdc++-v3/ChangeLog:

	* include/std/chrono
	(__detail::__months_years_conversion_disambiguator): Define.
	(year_month::operator+=): Templatize the 'months'-based overload
	so that the 'years'-based overload is selected in case of
	equally-ranked implicit conversion sequences to both 'months'
	and 'years' from the supplied argument.
	(year_month::operator-=): Likewise.
	(year_month::operator+): Likewise.
	(year_month::operator-): Likewise.
	(year_month_day::operator+=): Likewise.
	(year_month_day::operator-=): Likewise.
	(year_month_day::operator+): Likewise.
	(year_month_day::operator-): Likewise.
	(year_month_day_last::operator+=): Likewise.
	(year_month_day_last::operator-=): Likewise.
	(year_month_day_last::operator+): Likewise
	(year_month_day_last::operator-): Likewise.
	(year_month_day_weekday::operator+=): Likewise
	(year_month_day_weekday::operator-=): Likewise.
	(year_month_day_weekday::operator+): Likewise.
	(year_month_day_weekday::operator-): Likewise.
	(year_month_day_weekday_last::operator+=): Likewise
	(year_month_day_weekday_last::operator-=): Likewise.
	(year_month_day_weekday_last::operator+): Likewise.
	(year_month_day_weekday_last::operator-): Likewise.
	(testsuite/std/time/year_month/2.cc): New test.
	(testsuite/std/time/year_month_day/2.cc): New test.
	(testsuite/std/time/year_month_day_last/2.cc): New test.
	(testsuite/std/time/year_month_weekday/2.cc): New test.
	(testsuite/std/time/year_month_weekday_last/2.cc): New test.
2020-08-27 14:09:52 -04:00
Jakub Jelinek
04df5e7de2 ia32: Fix alignment of _Atomic fields [PR65146]
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-27 18:44:40 +02:00
Bill Schmidt
abca87c578 rs6000: Support ELFv2 sibcall for indirect calls [PR96787]
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-27 11:18:33 -05:00
Mark Eggleston
c336eda750 Fortran : ICE for division by zero in declaration PR95882
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-27 15:12:10 +01:00
Richard Biener
eb68d9d828 tree-optimization/96522 - transfer of flow-sensitive info in copy_ref_info
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-27 14:25:55 +02:00
Martin Liska
cb3874dcf8 vec: add exact argument for various grow functions.
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-27 13:29:43 +02:00
Richard Biener
9ceb3b8d8f streamline TARGET_MEM_REF dumping
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-27 13:08:13 +02:00
Alex Coplan
6b3034eaba lra: Canonicalize mult to shift in address reloads
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-27 09:49:57 +01:00
xiezhiheng
795944c456 AArch64: Add FLAG for rounding intrinsics [PR94442]
2020-08-27  Zhiheng Xie  <xiezhiheng@huawei.com>

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def: Add proper FLAG
	for rounding intrinsics.
2020-08-27 09:07:26 +01:00
xiezhiheng
d7738d4fde AArch64: Add FLAG for min/max intrinsics [PR94442]
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-27 09:07:26 +01:00
Richard Biener
ff7463172e tree-optimization/96579 - another special-operands fix in reassoc
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-27 10:02:22 +02:00
Richard Biener
989bc4ca2f tree-optimization/96565 - improve DSE with paths ending in noreturn
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-27 08:07:34 +02:00
Patrick Palka
3ae0cd94ab libstdc++: Implement remaining piece of LWG 3448
Almost all of the proposed resolution for LWG 3448 is already
implemented; the only part left is to adjust the return type of
transform_view::sentinel::operator-.

libstdc++-v3/ChangeLog:

	PR libstdc++/95322
	* include/std/ranges (transform_view::sentinel::__distance_from):
	Give this a deduced return type.
	(transform_view::sentinel::operator-): Adjust the return type so
	that it's based on the constness of the iterator rather than
	that of the sentinel.
	* testsuite/std/ranges/adaptors/95322.cc: Refer to LWG 3488.
2020-08-26 21:53:04 -04:00
Patrick Palka
4be16d1c1c libstdc++: elements_view's sentinel and iterator not comparable [LWG 3406]
This implements the proposed resolution for LWG 3406, and adds a
testcase for the example from P1994R1.

libstdc++-v3/ChangeLog:

	* include/std/ranges (elements_view::begin): Adjust constraints.
	(elements_view::end): Likewise.
	(elements_view::_Sentinel::operator==): Templatize to take both
	_Iterator<true> and _Iterator<false>.
	(elements_view::_Sentinel::operator-): Likewise.
	* testsuite/std/ranges/adaptors/elements.cc: Add testcase for
	the example from P1994R1.
	* testsuite/std/ranges/adaptors/lwg3406.cc: New test.
2020-08-26 21:52:58 -04:00
Patrick Palka
97ab5daa6c libstdc++: Implement P1994R1 changes to ranges::elements_view
The example from the paper doesn't compile without the proposed
resolution for LWG 3406, so we'll add a testcase for this once the
proposed resolution is implemented.

libstdc++-v3/ChangeLog:

	* include/std/ranges (elements_view::end): Replace these two
	overloads with four new overloads.
	(elements_view::_Iterator::operator==): Remove.
	(elements_view::_Iterator::operator-): Likewise.
	(elements_view::_Sentinel): Define.
2020-08-26 21:49:51 -04:00
GCC Administrator
57ea089421 Daily bump. 2020-08-27 00:16:27 +00:00
Clément Chigot
0c223b02b6 cmd: add -maix32 to gcc calls for aix/ppc
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-26 16:29:03 -07:00
Clément Chigot
6b0b6a3868 libgo: add FAT library support for static libraries on AIX
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-26 16:18:06 -07:00
Jeff Law
07545fbd2d Mark various tests that require a c99 libm
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-26 17:12:07 -06:00
Göran Uddeborg
8ca43e4ea5 Fix documentation of -fprofile-exclude-files
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-26 17:07:36 -06:00
H.J. Lu
8f1ea8ddcc x86: Reject target("no-general-regs-only")
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-26 12:56:18 -07:00
Jozef Lawrynowicz
703e049aa7 MSP430: Simplify and extend shift instruction patterns
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-26 20:50:58 +01:00
Jonathan Wakely
af06acfc8d libstdc++: Whitespace changes in <tuple>
libstdc++-v3/ChangeLog:

	* include/std/tuple (_Tuple_impl): Whitespaces changes for
	consistent indentation. Also use __enable_if_t alias template.
2020-08-26 19:32:30 +01:00
Jonathan Wakely
5494edae83 libstdc++: Use correct argument type for __use_alloc [PR 96803]
The _Tuple_impl constructor for allocator-extended construction from a
different tuple type uses the _Tuple_impl's own _Head type in the
__use_alloc test. That is incorrect, because the argument tuple could
have a different type. Using the wrong type might select the
leading-allocator convention when it should use the trailing-allocator
convention, or vice versa.

libstdc++-v3/ChangeLog:

	PR libstdc++/96803
	* include/std/tuple
	(_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl<U...>&)):
	Replace parameter pack with a type parameter and a pack and pass
	the first type to __use_alloc.
	* testsuite/20_util/tuple/cons/96803.cc: New test.
2020-08-26 19:32:30 +01:00
Patrick Palka
0c5df67ffc libstdc++: Fix typo in chrono::year_month_weekday::operator==
libstdc++-v3/ChangeLog:

	* include/std/chrono (year_month_weekday::operator==): Compare
	weekday_indexed instead of weekday.
	* testsuite/std/time/year_month_weekday/1.cc: Augment testcase.
2020-08-26 12:58:37 -04:00
Jonathan Wakely
9f9c0549dd libstdc++: Fix regression in hash containers
A recent change altered the layout of EBO-helper base classes, resulting
in an ambiguity when the hash function and equality predicate are the
same type.

This modifies the type of one of the base classes, so that we don't get
two base classes of the same type.

libstdc++-v3/ChangeLog:

	* include/bits/hashtable_policy.h (_Hash_code_base): Change
	index of _Hashtable_ebo_helper base class.
	* testsuite/23_containers/unordered_map/dup_types.cc: New test.
2020-08-26 17:44:23 +01:00
Tobias Burnus
b6cd5c3786 MAINTAINERS: Add myself as OpenACC maintainer
ChangeLog:

	* MAINTAINERS (Various Maintainers): Add myself as OpenACC maintainer.
2020-08-26 17:58:22 +02:00
Aldy Hernandez
bf19cbc9ce Adjust tree-ssa-dom.c for irange API.
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-26 16:03:00 +02:00
Richard Biener
2130efe6ac tree-optimization/96698 - fix ICE when vectorizing nested cycles
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-26 16:02:32 +02:00
Jonathan Wakely
3eefb302d2 libstdc++: Enable assertions in constexpr string_view members [PR 71960]
Since GCC 6.1 there is no reason we can't just use __glibcxx_assert in
constexpr functions in string_view. As long as the condition is true,
there will be no call to std::__replacement_assert that would make the
function ineligible for constant evaluation.

	PR libstdc++/71960
	* include/experimental/string_view (basic_string_view):
	Enable debug assertions.
	* include/std/string_view (basic_string_view):
	Likewise.
2020-08-26 14:48:49 +01:00
Martin Liska
2236c45479 symver: fix attribute matching.
gcc/ChangeLog:

	* cgraphunit.c (process_symver_attribute): Match only symver
	TREE_PURPOSE.
2020-08-26 15:42:31 +02:00
Patrick Palka
e9a2b5b8a3 libstdc++: Add missing extra space to ChangeLog author lines 2020-08-26 09:35:07 -04:00
Patrick Palka
121dc0c378 libstdc++: Add missing coauthors to ChangeLog entry
The corresponding commit had the Co-authored-by: lines in the middle of
the commit message instead of at the end, so the ChangeLog script didn't
consider them.
2020-08-26 09:29:39 -04:00