gcc.git
4 years ago[ARM][GCC][4/1x]: MVE intrinsics with unary operand.
Srinath Parvathaneni [Tue, 17 Mar 2020 14:21:50 +0000 (14:21 +0000)]
[ARM][GCC][4/1x]: MVE intrinsics with unary operand.

This patch supports following MVE ACLE intrinsics with unary operand.

vctp16q, vctp32q, vctp64q, vctp8q, vpnot.

Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more details.
[1] https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/mve-intrinsics

There are few conflicts in defining the machine registers, resolved by re-ordering VPR_REGNUM, APSRQ_REGNUM and APSRGE_REGNUM.

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm-builtins.c (hi_UP): Define mode.
* config/arm/arm.h (IS_VPR_REGNUM): Move.
* config/arm/arm.md (VPR_REGNUM): Define before APSRQ_REGNUM.
(APSRQ_REGNUM): Modify.
(APSRGE_REGNUM): Modify.
* config/arm/arm_mve.h (vctp16q): Define macro.
(vctp32q): Likewise.
(vctp64q): Likewise.
(vctp8q): Likewise.
(vpnot): Likewise.
(__arm_vctp16q): Define intrinsic.
(__arm_vctp32q): Likewise.
(__arm_vctp64q): Likewise.
(__arm_vctp8q): Likewise.
(__arm_vpnot): Likewise.
* config/arm/arm_mve_builtins.def (UNOP_UNONE_UNONE): Use builtin
qualifier.
* config/arm/mve.md (mve_vctp<mode1>qhi): Define RTL pattern.
(mve_vpnothi): Likewise.

gcc/testsuite/ChangeLog:

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/vctp16q.c: New test.
* gcc.target/arm/mve/intrinsics/vctp32q.c: Likewise.
* gcc.target/arm/mve/intrinsics/vctp64q.c: Likewise.
* gcc.target/arm/mve/intrinsics/vctp8q.c: Likewise.
* gcc.target/arm/mve/intrinsics/vpnot.c: Likewise.

4 years ago[ARM][GCC][3/1x]: MVE intrinsics with unary operand.
Srinath Parvathaneni [Tue, 17 Mar 2020 12:23:42 +0000 (12:23 +0000)]
[ARM][GCC][3/1x]: MVE intrinsics with unary operand.

This patch supports following MVE ACLE intrinsics with unary operand.

vdupq_n_s8, vdupq_n_s16, vdupq_n_s32, vabsq_s8, vabsq_s16, vabsq_s32, vclsq_s8, vclsq_s16, vclsq_s32, vclzq_s8, vclzq_s16, vclzq_s32, vnegq_s8, vnegq_s16, vnegq_s32, vaddlvq_s32, vaddvq_s8, vaddvq_s16, vaddvq_s32, vmovlbq_s8, vmovlbq_s16, vmovltq_s8, vmovltq_s16, vmvnq_s8, vmvnq_s16, vmvnq_s32, vrev16q_s8, vrev32q_s8, vrev32q_s16, vqabsq_s8, vqabsq_s16, vqabsq_s32, vqnegq_s8, vqnegq_s16, vqnegq_s32, vcvtaq_s16_f16, vcvtaq_s32_f32, vcvtnq_s16_f16, vcvtnq_s32_f32, vcvtpq_s16_f16, vcvtpq_s32_f32, vcvtmq_s16_f16, vcvtmq_s32_f32, vmvnq_u8, vmvnq_u16, vmvnq_u32, vdupq_n_u8, vdupq_n_u16, vdupq_n_u32, vclzq_u8, vclzq_u16, vclzq_u32, vaddvq_u8, vaddvq_u16, vaddvq_u32, vrev32q_u8, vrev32q_u16, vmovltq_u8, vmovltq_u16, vmovlbq_u8, vmovlbq_u16, vrev16q_u8, vaddlvq_u32, vcvtpq_u16_f16, vcvtpq_u32_f32, vcvtnq_u16_f16, vcvtmq_u16_f16, vcvtmq_u32_f32, vcvtaq_u16_f16, vcvtaq_u32_f32, vdupq_n, vabsq, vclsq, vclzq, vnegq, vaddlvq, vaddvq, vmovlbq, vmovltq, vmvnq, vrev16q, vrev32q, vqabsq, vqnegq.

A new register class "EVEN_REGS" which allows only even registers is added in this patch.

The new constraint "e" allows only reigsters of EVEN_REGS class.

Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more details.
[1] https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/mve-intrinsics

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm.h (enum reg_class): Define new class EVEN_REGS.
* config/arm/arm_mve.h (vdupq_n_s8): Define macro.
(vdupq_n_s16): Likewise.
(vdupq_n_s32): Likewise.
(vabsq_s8): Likewise.
(vabsq_s16): Likewise.
(vabsq_s32): Likewise.
(vclsq_s8): Likewise.
(vclsq_s16): Likewise.
(vclsq_s32): Likewise.
(vclzq_s8): Likewise.
(vclzq_s16): Likewise.
(vclzq_s32): Likewise.
(vnegq_s8): Likewise.
(vnegq_s16): Likewise.
(vnegq_s32): Likewise.
(vaddlvq_s32): Likewise.
(vaddvq_s8): Likewise.
(vaddvq_s16): Likewise.
(vaddvq_s32): Likewise.
(vmovlbq_s8): Likewise.
(vmovlbq_s16): Likewise.
(vmovltq_s8): Likewise.
(vmovltq_s16): Likewise.
(vmvnq_s8): Likewise.
(vmvnq_s16): Likewise.
(vmvnq_s32): Likewise.
(vrev16q_s8): Likewise.
(vrev32q_s8): Likewise.
(vrev32q_s16): Likewise.
(vqabsq_s8): Likewise.
(vqabsq_s16): Likewise.
(vqabsq_s32): Likewise.
(vqnegq_s8): Likewise.
(vqnegq_s16): Likewise.
(vqnegq_s32): Likewise.
(vcvtaq_s16_f16): Likewise.
(vcvtaq_s32_f32): Likewise.
(vcvtnq_s16_f16): Likewise.
(vcvtnq_s32_f32): Likewise.
(vcvtpq_s16_f16): Likewise.
(vcvtpq_s32_f32): Likewise.
(vcvtmq_s16_f16): Likewise.
(vcvtmq_s32_f32): Likewise.
(vmvnq_u8): Likewise.
(vmvnq_u16): Likewise.
(vmvnq_u32): Likewise.
(vdupq_n_u8): Likewise.
(vdupq_n_u16): Likewise.
(vdupq_n_u32): Likewise.
(vclzq_u8): Likewise.
(vclzq_u16): Likewise.
(vclzq_u32): Likewise.
(vaddvq_u8): Likewise.
(vaddvq_u16): Likewise.
(vaddvq_u32): Likewise.
(vrev32q_u8): Likewise.
(vrev32q_u16): Likewise.
(vmovltq_u8): Likewise.
(vmovltq_u16): Likewise.
(vmovlbq_u8): Likewise.
(vmovlbq_u16): Likewise.
(vrev16q_u8): Likewise.
(vaddlvq_u32): Likewise.
(vcvtpq_u16_f16): Likewise.
(vcvtpq_u32_f32): Likewise.
(vcvtnq_u16_f16): Likewise.
(vcvtmq_u16_f16): Likewise.
(vcvtmq_u32_f32): Likewise.
(vcvtaq_u16_f16): Likewise.
(vcvtaq_u32_f32): Likewise.
(__arm_vdupq_n_s8): Define intrinsic.
(__arm_vdupq_n_s16): Likewise.
(__arm_vdupq_n_s32): Likewise.
(__arm_vabsq_s8): Likewise.
(__arm_vabsq_s16): Likewise.
(__arm_vabsq_s32): Likewise.
(__arm_vclsq_s8): Likewise.
(__arm_vclsq_s16): Likewise.
(__arm_vclsq_s32): Likewise.
(__arm_vclzq_s8): Likewise.
(__arm_vclzq_s16): Likewise.
(__arm_vclzq_s32): Likewise.
(__arm_vnegq_s8): Likewise.
(__arm_vnegq_s16): Likewise.
(__arm_vnegq_s32): Likewise.
(__arm_vaddlvq_s32): Likewise.
(__arm_vaddvq_s8): Likewise.
(__arm_vaddvq_s16): Likewise.
(__arm_vaddvq_s32): Likewise.
(__arm_vmovlbq_s8): Likewise.
(__arm_vmovlbq_s16): Likewise.
(__arm_vmovltq_s8): Likewise.
(__arm_vmovltq_s16): Likewise.
(__arm_vmvnq_s8): Likewise.
(__arm_vmvnq_s16): Likewise.
(__arm_vmvnq_s32): Likewise.
(__arm_vrev16q_s8): Likewise.
(__arm_vrev32q_s8): Likewise.
(__arm_vrev32q_s16): Likewise.
(__arm_vqabsq_s8): Likewise.
(__arm_vqabsq_s16): Likewise.
(__arm_vqabsq_s32): Likewise.
(__arm_vqnegq_s8): Likewise.
(__arm_vqnegq_s16): Likewise.
(__arm_vqnegq_s32): Likewise.
(__arm_vmvnq_u8): Likewise.
(__arm_vmvnq_u16): Likewise.
(__arm_vmvnq_u32): Likewise.
(__arm_vdupq_n_u8): Likewise.
(__arm_vdupq_n_u16): Likewise.
(__arm_vdupq_n_u32): Likewise.
(__arm_vclzq_u8): Likewise.
(__arm_vclzq_u16): Likewise.
(__arm_vclzq_u32): Likewise.
(__arm_vaddvq_u8): Likewise.
(__arm_vaddvq_u16): Likewise.
(__arm_vaddvq_u32): Likewise.
(__arm_vrev32q_u8): Likewise.
(__arm_vrev32q_u16): Likewise.
(__arm_vmovltq_u8): Likewise.
(__arm_vmovltq_u16): Likewise.
(__arm_vmovlbq_u8): Likewise.
(__arm_vmovlbq_u16): Likewise.
(__arm_vrev16q_u8): Likewise.
(__arm_vaddlvq_u32): Likewise.
(__arm_vcvtpq_u16_f16): Likewise.
(__arm_vcvtpq_u32_f32): Likewise.
(__arm_vcvtnq_u16_f16): Likewise.
(__arm_vcvtmq_u16_f16): Likewise.
(__arm_vcvtmq_u32_f32): Likewise.
(__arm_vcvtaq_u16_f16): Likewise.
(__arm_vcvtaq_u32_f32): Likewise.
(__arm_vcvtaq_s16_f16): Likewise.
(__arm_vcvtaq_s32_f32): Likewise.
(__arm_vcvtnq_s16_f16): Likewise.
(__arm_vcvtnq_s32_f32): Likewise.
(__arm_vcvtpq_s16_f16): Likewise.
(__arm_vcvtpq_s32_f32): Likewise.
(__arm_vcvtmq_s16_f16): Likewise.
(__arm_vcvtmq_s32_f32): Likewise.
(vdupq_n): Define polymorphic variant.
(vabsq): Likewise.
(vclsq): Likewise.
(vclzq): Likewise.
(vnegq): Likewise.
(vaddlvq): Likewise.
(vaddvq): Likewise.
(vmovlbq): Likewise.
(vmovltq): Likewise.
(vmvnq): Likewise.
(vrev16q): Likewise.
(vrev32q): Likewise.
(vqabsq): Likewise.
(vqnegq): Likewise.
* config/arm/arm_mve_builtins.def (UNOP_SNONE_SNONE): Use it.
(UNOP_SNONE_NONE): Likewise.
(UNOP_UNONE_UNONE): Likewise.
(UNOP_UNONE_NONE): Likewise.
* config/arm/constraints.md (e): Define new constriant to allow only
even registers.
* config/arm/mve.md (mve_vqabsq_s<mode>): Define RTL pattern.
(mve_vnegq_s<mode>): Likewise.
(mve_vmvnq_<supf><mode>): Likewise.
(mve_vdupq_n_<supf><mode>): Likewise.
(mve_vclzq_<supf><mode>): Likewise.
(mve_vclsq_s<mode>): Likewise.
(mve_vaddvq_<supf><mode>): Likewise.
(mve_vabsq_s<mode>): Likewise.
(mve_vrev32q_<supf><mode>): Likewise.
(mve_vmovltq_<supf><mode>): Likewise.
(mve_vmovlbq_<supf><mode>): Likewise.
(mve_vcvtpq_<supf><mode>): Likewise.
(mve_vcvtnq_<supf><mode>): Likewise.
(mve_vcvtmq_<supf><mode>): Likewise.
(mve_vcvtaq_<supf><mode>): Likewise.
(mve_vrev16q_<supf>v16qi): Likewise.
(mve_vaddlvq_<supf>v4si): Likewise.

gcc/testsuite/ChangeLog:

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/vabsq_s16.c: New test.
* gcc.target/arm/mve/intrinsics/vabsq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vabsq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddlvq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddlvq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vaddvq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclsq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclsq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclsq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vclzq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtaq_s16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtaq_s32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtaq_u16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtaq_u32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtmq_s16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtmq_s32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtmq_u16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtmq_u32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtnq_s16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtnq_s32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtnq_u16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtpq_s16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtpq_s32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtpq_u16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtpq_u32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovlbq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovlbq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovlbq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovlbq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovltq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovltq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovltq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmovltq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vnegq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vnegq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vnegq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqabsq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqabsq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqabsq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqnegq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqnegq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vqnegq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev16q_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev16q_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev32q_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev32q_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev32q_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev32q_u8.c: Likewise.

4 years agoFix up duplicated duplicated words mostly in comments
Jakub Jelinek [Tue, 17 Mar 2020 12:52:19 +0000 (13:52 +0100)]
Fix up duplicated duplicated words mostly in comments

In the r10-7197-gbae7b38cf8a21e068ad5c0bab089dedb78af3346 commit I've
noticed duplicated word in a message, which lead me to grep for those and
we have a tons of them.
I've used
grep -v 'long long\|optab optab\|template template\|double double' *.[chS] */*.[chS] *.def config/*/* 2>/dev/null | grep ' \([a-zA-Z]\+\) \1 '
Note, the command will not detect the doubled words at the start or end of
line or when one of the words is at the end of line and the next one at the
start of another one.
Some of it is fairly obvious, e.g. all the "the the" cases which is
something I've posted and committed patch for already e.g. in 2016,
other cases are often valid, e.g. "that that" seems to look mostly ok to me.
Some cases are quite hard to figure out, I've left out some of them from the
patch (e.g. "and and" in some cases isn't talking about bitwise/logical and
and so looks incorrect, but in other cases it is talking about those
operations).
In most cases the right solution seems to be to remove one of the duplicated
words, but not always.

I think most important are the ones with user visible messages (in the patch
3 of the first 4 hunks), the rest is just comments (and internal
documentation; for that see the doc/tm.texi changes).

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

* lra-spills.c (remove_pseudos): Fix up duplicated word issue in
a dump message.
* tree-sra.c (create_access_replacement): Fix up duplicated word issue
in a comment.
* read-rtl-function.c (find_param_by_name,
function_reader::parse_enum_value, function_reader::get_insn_by_uid):
Likewise.
* spellcheck.c (get_edit_distance_cutoff): Likewise.
* tree-data-ref.c (create_ifn_alias_checks): Likewise.
* tree.def (SWITCH_EXPR): Likewise.
* selftest.c (assert_str_contains): Likewise.
* ipa-param-manipulation.h (class ipa_param_body_adjustments):
Likewise.
* tree-ssa-math-opts.c (convert_expand_mult_copysign): Likewise.
* tree-ssa-loop-split.c (find_vdef_in_loop): Likewise.
* langhooks.h (struct lang_hooks_for_decls): Likewise.
* ipa-prop.h (struct ipa_param_descriptor): Likewise.
* tree-ssa-strlen.c (handle_builtin_string_cmp, handle_store):
Likewise.
* tree-ssa-dom.c (simplify_stmt_for_jump_threading): Likewise.
* tree-ssa-reassoc.c (reassociate_bb): Likewise.
* tree.c (component_ref_size): Likewise.
* hsa-common.c (hsa_init_compilation_unit_data): Likewise.
* gimple-ssa-sprintf.c (get_string_length, format_string,
format_directive): Likewise.
* omp-grid.c (grid_process_kernel_body_copy): Likewise.
* input.c (string_concat_db::get_string_concatenation,
test_lexer_string_locations_ucn4): Likewise.
* cfgexpand.c (pass_expand::execute): Likewise.
* gimple-ssa-warn-restrict.c (builtin_memref::offset_out_of_bounds,
maybe_diag_overlap): Likewise.
* rtl.c (RTX_CODE_HWINT_P_1): Likewise.
* shrink-wrap.c (spread_components): Likewise.
* tree-ssa-dse.c (initialize_ao_ref_for_dse, valid_ao_ref_for_dse):
Likewise.
* tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
Likewise.
* dwarf2out.c (dwarf2out_early_finish): Likewise.
* gimple-ssa-store-merging.c: Likewise.
* ira-costs.c (record_operand_costs): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Likewise.
* target.def (dispatch): Likewise.
(validate_dims, gen_ccmp_first): Fix up duplicated word issue
in documentation text.
* doc/tm.texi: Regenerated.
* config/i386/x86-tune.def (X86_TUNE_PARTIAL_FLAG_REG_STALL): Fix up
duplicated word issue in a comment.
* config/i386/i386.c (ix86_test_loading_unspec): Likewise.
* config/i386/i386-features.c (remove_partial_avx_dependency):
Likewise.
* config/msp430/msp430.c (msp430_select_section): Likewise.
* config/gcn/gcn-run.c (load_image): Likewise.
* config/aarch64/aarch64-sve.md (sve_ld1r<mode>): Likewise.
* config/aarch64/aarch64.c (aarch64_gen_adjusted_ldpstp): Likewise.
* config/aarch64/falkor-tag-collision-avoidance.c
(single_dest_per_chain): Likewise.
* config/nvptx/nvptx.c (nvptx_record_fndecl): Likewise.
* config/fr30/fr30.c (fr30_arg_partial_bytes): Likewise.
* config/rs6000/rs6000-string.c (expand_cmp_vec_sequence): Likewise.
* config/rs6000/rs6000-p8swap.c (replace_swapped_load_constant):
Likewise.
* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Likewise.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Likewise.
* config/rs6000/rs6000-logue.c
(rs6000_emit_probe_stack_range_stack_clash): Likewise.
* config/nds32/nds32-md-auxiliary.c (nds32_split_ashiftdi3): Likewise.
Fix various other issues in the comment.
c-family/
* c-common.c (resolve_overloaded_builtin): Fix up duplicated word
issue in a diagnostic message.
cp/
* pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
(lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
in a comment.
* parser.c (cp_parser_statement, cp_parser_linkage_specification,
cp_parser_placeholder_type_specifier,
cp_parser_constraint_requires_parens): Likewise.
* name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
fortran/
* array.c (gfc_check_iter_variable): Fix up duplicated word issue
in a comment.
* arith.c (gfc_arith_concat): Likewise.
* resolve.c (gfc_resolve_ref): Likewise.
* frontend-passes.c (matmul_lhs_realloc): Likewise.
* module.c (gfc_match_submodule, load_needed): Likewise.
* trans-expr.c (gfc_init_se): Likewise.

4 years ago[GCC][PATCH][ARM] Add multilib mapping for Armv8.1-M+MVE with -mfloat-abi=hard
Mihail Ionescu [Tue, 17 Mar 2020 12:39:39 +0000 (12:39 +0000)]
[GCC][PATCH][ARM] Add multilib mapping for Armv8.1-M+MVE with -mfloat-abi=hard

This patch adds a new multilib for armv8.1-m.main+mve with hard float abi. For
armv8.1-m.main+mve soft and softfp, the v8-M multilibs will be reused.
The following mappings are also updated:
"-mfloat-abi=hard -march=armv8.1-m.main+mve.fp -> armv8-m.main+fp/hard"
"-mfloat-abi=softfp -march=armv8.1-m.main+mve.fp -> armv8-m.main+fp/softfp"
"-mfloat-abi=soft -march=armv8.1-m.main+mve.fp -> armv8-m.main/nofp"
gcc/ChangeLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/arm/t-rmprofile: create new multilib for
armv8.1-m.main+mve hard float and reuse v8-m.main ones for
v8.1-m.main+mve .

gcc/testsuite/ChangeLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

* gcc.target/arm/multilib.exp: Add new v8.1-M entry.

libgcc/ChangLog:

2020-03-17  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/arm/t-arm: Do not compile cmse_nonsecure_call.S for v8.1-m.

4 years agotree-ssa-strlen: Fix up count_nonzero_bytes* [PR94015]
Jakub Jelinek [Tue, 17 Mar 2020 12:36:41 +0000 (13:36 +0100)]
tree-ssa-strlen: Fix up count_nonzero_bytes* [PR94015]

As I said already yesterday in another PR, I'm afraid the mixing of apples
and oranges (what we are actually computing, whether what bytes are zero or
non-zero in the native representation of EXP itself or what EXP points to)
in a single function where it performs some handling which must be specific
to one or the other case unconditionally and only from time to time
determines something based on if nbytes is 0 or not will continue to bite us
again and again.
So, this patch performs at least a partial cleanup to separate those two
cases into two functions.
In addition to the separation, the patch uses e.g. ctor_for_folding so that
it does handle volatile loads properly and various other checks instead of
directly using DECL_INITIAL or does guard native_encode_expr call the way it
is guarded elsewhere (that host and target byte sizes are expected).

I've left other issues I found as is for now, like the *allnonnul being IMHO
wrongly computed (if we don't know anything about the bytes, such as if
_1 = MEM[s_2(D)];
MEM[whatever] = _1;
where nothing really is known about strlen(s) etc., the code right now
clears *nulterm and *allnul, but keeps *allnonnull set), but the callers
seem to never use that value for anything (so the question is why is it
computed and how exactly should it be defined).  Another thing I find quite
weird is the distinction between count_nonzero_bytes failing (return false)
and when it succeeds, but sets values to a don't know state (the warning is
only issued if it succeeds), plus what lenrange[2] is for.  The size of the
store should be visible already from the store statement.  Also the looking
at the type of the MEM_REF first operand to determine if it is is_char_store
is really weird, because both in user code and through sccvn where pointer
conversions are useless the type of the MEM_REF operand doesn't have to have
anything to do with what the code actually does.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94015
* tree-ssa-strlen.c (count_nonzero_bytes): Split portions of the
function where EXP is address of the bytes being stored rather than
the bytes themselves into count_nonzero_bytes_addr.  Punt on zero
sized MEM_REF.  Use VAR_P macro and handle CONST_DECL like VAR_DECLs.
Use ctor_for_folding instead of looking at DECL_INITIAL.  Punt before
calling native_encode_expr if host or target doesn't have 8-bit
chars.  Formatting fixes.
(count_nonzero_bytes_addr): New function.

* gcc.dg/pr94015.c: New test.

4 years ago[ARM][GCC][2/1x]: MVE intrinsics with unary operand.
Srinath Parvathaneni [Tue, 17 Mar 2020 12:03:30 +0000 (12:03 +0000)]
[ARM][GCC][2/1x]: MVE intrinsics with unary operand.

This patch supports following MVE ACLE intrinsics with unary operand.

vmvnq_n_s16, vmvnq_n_s32, vrev64q_s8, vrev64q_s16, vrev64q_s32, vcvtq_s16_f16, vcvtq_s32_f32, vrev64q_u8, vrev64q_u16, vrev64q_u32, vmvnq_n_u16, vmvnq_n_u32, vcvtq_u16_f16, vcvtq_u32_f32, vrev64q.

Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more details.
[1] https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/mve-intrinsics

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm-builtins.c (UNOP_SNONE_SNONE_QUALIFIERS): Define.
(UNOP_SNONE_NONE_QUALIFIERS): Likewise.
(UNOP_SNONE_IMM_QUALIFIERS): Likewise.
(UNOP_UNONE_NONE_QUALIFIERS): Likewise.
(UNOP_UNONE_UNONE_QUALIFIERS): Likewise.
(UNOP_UNONE_IMM_QUALIFIERS): Likewise.
* config/arm/arm_mve.h (vmvnq_n_s16): Define macro.
(vmvnq_n_s32): Likewise.
(vrev64q_s8): Likewise.
(vrev64q_s16): Likewise.
(vrev64q_s32): Likewise.
(vcvtq_s16_f16): Likewise.
(vcvtq_s32_f32): Likewise.
(vrev64q_u8): Likewise.
(vrev64q_u16): Likewise.
(vrev64q_u32): Likewise.
(vmvnq_n_u16): Likewise.
(vmvnq_n_u32): Likewise.
(vcvtq_u16_f16): Likewise.
(vcvtq_u32_f32): Likewise.
(__arm_vmvnq_n_s16): Define intrinsic.
(__arm_vmvnq_n_s32): Likewise.
(__arm_vrev64q_s8): Likewise.
(__arm_vrev64q_s16): Likewise.
(__arm_vrev64q_s32): Likewise.
(__arm_vrev64q_u8): Likewise.
(__arm_vrev64q_u16): Likewise.
(__arm_vrev64q_u32): Likewise.
(__arm_vmvnq_n_u16): Likewise.
(__arm_vmvnq_n_u32): Likewise.
(__arm_vcvtq_s16_f16): Likewise.
(__arm_vcvtq_s32_f32): Likewise.
(__arm_vcvtq_u16_f16): Likewise.
(__arm_vcvtq_u32_f32): Likewise.
(vrev64q): Define polymorphic variant.
* config/arm/arm_mve_builtins.def (UNOP_SNONE_SNONE): Use it.
(UNOP_SNONE_NONE): Likewise.
(UNOP_SNONE_IMM): Likewise.
(UNOP_UNONE_UNONE): Likewise.
(UNOP_UNONE_NONE): Likewise.
(UNOP_UNONE_IMM): Likewise.
* config/arm/mve.md (mve_vrev64q_<supf><mode>): Define RTL pattern.
(mve_vcvtq_from_f_<supf><mode>): Likewise.
(mve_vmvnq_n_<supf><mode>): Likewise.

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/vcvtq_s16_f16.c: New test.
* gcc.target/arm/mve/intrinsics/vcvtq_s32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_u16_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_u32_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_n_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_n_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_n_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmvnq_n_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_u8.c: Likewise.

4 years ago[ARM][GCC][1/1x]: Patch to support MVE ACLE intrinsics with unary operand.
Srinath Parvathaneni [Tue, 17 Mar 2020 11:50:54 +0000 (11:50 +0000)]
[ARM][GCC][1/1x]: Patch to support MVE ACLE intrinsics with unary operand.

This patch supports MVE ACLE intrinsics vcvtq_f16_s16, vcvtq_f32_s32, vcvtq_f16_u16, vcvtq_f32_u32n vrndxq_f16, vrndxq_f32, vrndq_f16, vrndq_f32, vrndpq_f16, vrndpq_f32, vrndnq_f16, vrndnq_f32, vrndmq_f16, vrndmq_f32, vrndaq_f16, vrndaq_f32, vrev64q_f16, vrev64q_f32, vnegq_f16, vnegq_f32, vdupq_n_f16, vdupq_n_f32, vabsq_f16, vabsq_f32, vrev32q_f16, vcvttq_f32_f16, vcvtbq_f32_f16.

Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more details.
[1] https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/mve-intrinsics

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm-builtins.c (UNOP_NONE_NONE_QUALIFIERS): Define macro.
(UNOP_NONE_SNONE_QUALIFIERS): Likewise.
(UNOP_NONE_UNONE_QUALIFIERS): Likewise.
* config/arm/arm_mve.h (vrndxq_f16): Define macro.
(vrndxq_f32): Likewise.
(vrndq_f16) Likewise.
(vrndq_f32): Likewise.
(vrndpq_f16): Likewise.
(vrndpq_f32): Likewise.
(vrndnq_f16): Likewise.
(vrndnq_f32): Likewise.
(vrndmq_f16): Likewise.
(vrndmq_f32): Likewise.
(vrndaq_f16): Likewise.
(vrndaq_f32): Likewise.
(vrev64q_f16): Likewise.
(vrev64q_f32): Likewise.
(vnegq_f16): Likewise.
(vnegq_f32): Likewise.
(vdupq_n_f16): Likewise.
(vdupq_n_f32): Likewise.
(vabsq_f16): Likewise.
(vabsq_f32): Likewise.
(vrev32q_f16): Likewise.
(vcvttq_f32_f16): Likewise.
(vcvtbq_f32_f16): Likewise.
(vcvtq_f16_s16): Likewise.
(vcvtq_f32_s32): Likewise.
(vcvtq_f16_u16): Likewise.
(vcvtq_f32_u32): Likewise.
(__arm_vrndxq_f16): Define intrinsic.
(__arm_vrndxq_f32): Likewise.
(__arm_vrndq_f16): Likewise.
(__arm_vrndq_f32): Likewise.
(__arm_vrndpq_f16): Likewise.
(__arm_vrndpq_f32): Likewise.
(__arm_vrndnq_f16): Likewise.
(__arm_vrndnq_f32): Likewise.
(__arm_vrndmq_f16): Likewise.
(__arm_vrndmq_f32): Likewise.
(__arm_vrndaq_f16): Likewise.
(__arm_vrndaq_f32): Likewise.
(__arm_vrev64q_f16): Likewise.
(__arm_vrev64q_f32): Likewise.
(__arm_vnegq_f16): Likewise.
(__arm_vnegq_f32): Likewise.
(__arm_vdupq_n_f16): Likewise.
(__arm_vdupq_n_f32): Likewise.
(__arm_vabsq_f16): Likewise.
(__arm_vabsq_f32): Likewise.
(__arm_vrev32q_f16): Likewise.
(__arm_vcvttq_f32_f16): Likewise.
(__arm_vcvtbq_f32_f16): Likewise.
(__arm_vcvtq_f16_s16): Likewise.
(__arm_vcvtq_f32_s32): Likewise.
(__arm_vcvtq_f16_u16): Likewise.
(__arm_vcvtq_f32_u32): Likewise.
(vrndxq): Define polymorphic variants.
(vrndq): Likewise.
(vrndpq): Likewise.
(vrndnq): Likewise.
(vrndmq): Likewise.
(vrndaq): Likewise.
(vrev64q): Likewise.
(vnegq): Likewise.
(vabsq): Likewise.
(vrev32q): Likewise.
(vcvtbq_f32): Likewise.
(vcvttq_f32): Likewise.
(vcvtq): Likewise.
* config/arm/arm_mve_builtins.def (VAR2): Define.
(VAR1): Define.
* config/arm/mve.md (mve_vrndxq_f<mode>): Add RTL pattern.
(mve_vrndq_f<mode>): Likewise.
(mve_vrndpq_f<mode>): Likewise.
(mve_vrndnq_f<mode>): Likewise.
(mve_vrndmq_f<mode>): Likewise.
(mve_vrndaq_f<mode>): Likewise.
(mve_vrev64q_f<mode>): Likewise.
(mve_vnegq_f<mode>): Likewise.
(mve_vdupq_n_f<mode>): Likewise.
(mve_vabsq_f<mode>): Likewise.
(mve_vrev32q_fv8hf): Likewise.
(mve_vcvttq_f32_f16v4sf): Likewise.
(mve_vcvtbq_f32_f16v4sf): Likewise.
(mve_vcvtq_to_f_<supf><mode>): Likewise.

gcc/testsuite/ChangeLog:

2020-03-17  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/vabsq_f16.c: New test.
* gcc.target/arm/mve/intrinsics/vabsq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtbq_f32_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_f16_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_f16_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_f32_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvtq_f32_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vcvttq_f32_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vdupq_n_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vnegq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vnegq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev32q_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrev64q_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndaq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndaq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndmq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndmq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndnq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndnq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndpq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndpq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndxq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vrndxq_f32.c: Likewise.

4 years ago[ARM][GCC][4/x]: MVE ACLE vector interleaving store intrinsics.
Srinath Parvathaneni [Tue, 17 Mar 2020 10:19:31 +0000 (10:19 +0000)]
[ARM][GCC][4/x]: MVE ACLE vector interleaving store intrinsics.

This patch supports MVE ACLE intrinsics vst4q_s8, vst4q_s16, vst4q_s32, vst4q_u8, vst4q_u16, vst4q_u32, vst4q_f16 and vst4q_f32.

In this patch arm_mve_builtins.def file is added to the source code in which the builtins for MVE ACLE intrinsics are defined using builtin qualifiers.

Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more details.
[1] https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/mve-intrinsics

2020-03-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    Mihail Ionescu  <mihail.ionescu@arm.com>
    Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm-builtins.c (CF): Define mve_builtin_data.
(VAR1): Define.
(ARM_BUILTIN_MVE_PATTERN_START): Define.
(arm_init_mve_builtins): Define function.
(arm_init_builtins): Add TARGET_HAVE_MVE check.
(arm_expand_builtin_1): Check the range of fcode.
(arm_expand_mve_builtin): Define function to expand MVE builtins.
(arm_expand_builtin): Check the range of fcode.
* config/arm/arm_mve.h (__ARM_FEATURE_MVE): Define MVE floating point
types.
(__ARM_MVE_PRESERVE_USER_NAMESPACE): Define to protect user namespace.
(vst4q_s8): Define macro.
(vst4q_s16): Likewise.
(vst4q_s32): Likewise.
(vst4q_u8): Likewise.
(vst4q_u16): Likewise.
(vst4q_u32): Likewise.
(vst4q_f16): Likewise.
(vst4q_f32): Likewise.
(__arm_vst4q_s8): Define inline builtin.
(__arm_vst4q_s16): Likewise.
(__arm_vst4q_s32): Likewise.
(__arm_vst4q_u8): Likewise.
(__arm_vst4q_u16): Likewise.
(__arm_vst4q_u32): Likewise.
(__arm_vst4q_f16): Likewise.
(__arm_vst4q_f32): Likewise.
(__ARM_mve_typeid): Define macro with MVE types.
(__ARM_mve_coerce): Define macro with _Generic feature.
(vst4q): Define polymorphic variant for different vst4q builtins.
* config/arm/arm_mve_builtins.def: New file.
* config/arm/iterators.md (VSTRUCT): Modify to allow XI and OI
modes in MVE.
* config/arm/mve.md (MVE_VLD_ST): Define iterator.
(unspec): Define unspec.
(mve_vst4q<mode>): Define RTL pattern.
* config/arm/neon.md (mov<mode>): Modify expand to allow XI and OI
modes in MVE.
(neon_mov<mode>): Modify RTL define_insn to allow XI and OI modes
in MVE.
(define_split): Allow OI mode split for MVE after reload.
(define_split): Allow XI mode split for MVE after reload.
* config/arm/t-arm (arm.o): Add entry for arm_mve_builtins.def.
(arm-builtins.o): Likewise.

2020-03-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    Mihail Ionescu  <mihail.ionescu@arm.com>
    Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/vst4q_f16.c: New test.
* gcc.target/arm/mve/intrinsics/vst4q_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vst4q_u8.c: Likewise.

4 years agotestsuite: Fix pr94185.C testcase on i686-linux with C++98 [PR94185]
Jakub Jelinek [Tue, 17 Mar 2020 10:12:59 +0000 (11:12 +0100)]
testsuite: Fix pr94185.C testcase on i686-linux with C++98 [PR94185]

I'm getting on i686-linux
FAIL: g++.target/i386/pr94185.C  -std=gnu++98 (test for excess errors)
This is because of a diagnostic that 4294967295 is unsigned only in ISO C90.
Adding U suffix fixes it and the testcase still ICEs with unfixed gcc and
passes with current trunk.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

PR target/94185
* g++.target/i386/pr94185.C (l): Use 4294967295U instead of 4294967295
to avoid FAIL with -m32 -std=c++98.

4 years agoc: ignore initializers for elements of variable-size types [PR93577]
Christophe Lyon [Tue, 17 Mar 2020 09:26:08 +0000 (09:26 +0000)]
c: ignore initializers for elements of variable-size types [PR93577]

2020-03-17  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* c-typeck.c (process_init_element): Handle constructor_type with
type size represented by POLY_INT_CST.

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Remove
superfluous dg-error.
* gcc.target/aarch64/sve/acle/general-c/sizeless-2.c: Likewise.

4 years agostrlen: Punt on UB reads past end of string literal [PR94187]
Jakub Jelinek [Tue, 17 Mar 2020 09:43:46 +0000 (10:43 +0100)]
strlen: Punt on UB reads past end of string literal [PR94187]

The gcc.dg/pr68785.c test which contains:
int
foo (void)
{
  return *(int *) "";
}
has UB in the program if it is ever called, but causes UB in the compiler
as well as at least in theory non-reproduceable code generation.
The problem is that nbytes is in this case 4, prep is the
TREE_STRING_POINTER of a "" string literal with TREE_STRING_LENGTH of 1 and
we do:
4890              for (const char *p = prep; p != prep + nbytes; ++p)
4891                if (*p)
4892                  {
4893                    *allnul = false;
4894                    break;
4895                  }
and so read the bytes after the STRING_CST payload, which can be random.
I think we should just punt in this case.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94187
* tree-ssa-strlen.c (count_nonzero_bytes): Punt if
nchars - offset < nbytes.

4 years agoexpand: Don't depend on warning flags in code generation of strnlen [PR94189]
Jakub Jelinek [Tue, 17 Mar 2020 09:42:35 +0000 (10:42 +0100)]
expand: Don't depend on warning flags in code generation of strnlen [PR94189]

The following testcase FAILs with -O2 -fcompare-debug, but the reason isn't
that we'd emit different code based on -g or non-debug, but rather that
we emit different code depending on whether -w is used or not (or e.g.
-Wno-stringop-overflow or whether some other pass emitted some other warning
already on the call).

Code generation shouldn't depend on whether we emit a warning or not if at
all possible.

The following patch punts (i.e. doesn't optimize the strnlen call to a
constant value) if we would emit the warning if it was enabled.
In the PR there is an alternate patch which does optimize the strnlen call
no matter if we emit the warning or not, though I think I prefer the version
below, e.g. the strnlen call might be crossing field boundaries, which is in
strict reading undefined, but I'd be afraid people do that in the real
world programs.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/94189
* builtins.c (expand_builtin_strnlen): Do return NULL_RTX if we would
emit a warning if it was enabled and don't depend on TREE_NO_WARNING
for code-generation.

* gcc.dg/pr94189.c: New test.

4 years agoFilter a test-case with gas.
Martin Liska [Tue, 17 Mar 2020 08:43:46 +0000 (09:43 +0100)]
Filter a test-case with gas.

PR lto/94157
* gcc.dg/lto/pr94157_0.c: Add gas effective
target filter.

4 years agoc++: Add test for PR 93901.
Jason Merrill [Tue, 17 Mar 2020 01:16:35 +0000 (21:16 -0400)]
c++: Add test for PR 93901.

4 years agoUpdate gcc sv.po.
Joseph Myers [Tue, 17 Mar 2020 00:34:39 +0000 (00:34 +0000)]
Update gcc sv.po.

* sv.po: Update.

4 years agoDaily bump.
GCC Administrator [Tue, 17 Mar 2020 00:16:15 +0000 (00:16 +0000)]
Daily bump.

4 years agod: Fix assignment to anonymous union member corrupts sibling members in struct
Iain Buclaw [Mon, 16 Mar 2020 22:53:20 +0000 (23:53 +0100)]
d: Fix assignment to anonymous union member corrupts sibling members in struct

gcc/d/ChangeLog:

PR d/92309
* types.cc (fixup_anonymous_offset): Don't set DECL_FIELD_OFFSET on
anonymous fields.

gcc/testsuite/ChangeLog:

PR d/92309
* gdc.dg/pr92309.d: New test.

4 years agolibstdc++: Add default constructor to net::service_already_exists (PR 94199)
Jonathan Wakely [Mon, 16 Mar 2020 22:53:42 +0000 (22:53 +0000)]
libstdc++: Add default constructor to net::service_already_exists (PR 94199)

The service_already_exists exception type specified in the TS doesn't
have any constructors defined. Since its base class isn't default
constructible, that means has no usable constructors. This may be a
defect in the TS.

This patch fixes it by adding a default constructor, but making it
private. The make_service function is declared as a friend to be able to
call that private constructor.

PR libstdc++/94199
* include/experimental/executor (service_already_exists): Add default
constructor. Declare make_service to be a friend.
* testsuite/experimental/net/execution_context/make_service.cc: New
test.

4 years agod: Fix multiple definition error when using mixins and interfaces.
Iain Buclaw [Mon, 16 Mar 2020 22:04:49 +0000 (23:04 +0100)]
d: Fix multiple definition error when using mixins and interfaces.

gcc/d/ChangeLog:

PR d/92216
* decl.cc (make_thunk): Don't set TREE_PUBLIC on thunks if the target
function is external to the current compilation.

gcc/testsuite/ChangeLog:

PR d/92216
* gdc.dg/imports/pr92216.d: New.
* gdc.dg/pr92216.d: New test.

4 years agoc: Handle MEM_REF in c_fully_fold* [PR94179]
Jakub Jelinek [Mon, 16 Mar 2020 21:58:41 +0000 (22:58 +0100)]
c: Handle MEM_REF in c_fully_fold* [PR94179]

The recent match.pd changes can generate a MEM_REF which can be seen by the
C FE folding routines.  Unlike the C++ FE, they weren't expected in the C FE
yet.  MEM_REF should be handled like INDIRECT_REF, except that it has two
operands rather than just one and that we should preserve the type of the
second operand.  Given that it already has to be an INTEGER_CST with pointer
type, I think we are fine, the recursive call should return the INTEGER_CST
unmodified and STRIP_TYPE_NOPS will not strip anything.

2020-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c/94179
* c-fold.c (c_fully_fold_internal): Handle MEM_REF.

* gcc.c-torture/compile/pr94179.c: New test.

4 years agoFix PR94185: Do not reuse insn alternative after changing memory subreg.
Vladimir N. Makarov [Mon, 16 Mar 2020 20:42:19 +0000 (16:42 -0400)]
Fix PR94185: Do not reuse insn alternative after changing memory subreg.

2020-03-16  Vladimir Makarov  <vmakarov@redhat.com>

PR target/94185
* lra-spills.c (remove_pseudos): Do not reuse insn alternative
after changing memory subreg.

2020-03-16  Vladimir Makarov  <vmakarov@redhat.com>

PR target/94185
* g++.target/i386/pr94185.C: New test.

4 years ago[testsuite] Avoid duplicate test names in sizeless tests
Richard Sandiford [Thu, 12 Mar 2020 11:54:27 +0000 (11:54 +0000)]
[testsuite] Avoid duplicate test names in sizeless tests

Jeff pointed out that using:

   N:  ... /* { dg-error {...} } */
 N+1:      /* { dg-error {...} "" { target *-*-* } .-1 } */

led to two identical test names for line N.  Fixed by adding
a proper test name instead of "".

2020-03-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Add a test
name to .-1 dg-error tests.
* gcc.target/aarch64/sve/acle/general-c/sizeless-2.c: Likewise.

4 years ago[ARM][GCC][3/x]: MVE ACLE intrinsics framework patch.
Srinath Parvathaneni [Mon, 16 Mar 2020 17:33:03 +0000 (17:33 +0000)]
[ARM][GCC][3/x]: MVE ACLE intrinsics framework patch.

This patch is part of MVE ACLE intrinsics framework.

The patch supports the use of emulation for the single-precision arithmetic
operations for MVE. This changes are to support the MVE ACLE intrinsics which
operates on vector floating point arithmetic operations.

Please refer to Arm reference manual [1] for more details.
[1] https://developer.arm.com/docs/ddi0553/latest

2020-03-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
        Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config/arm/arm.c (arm_libcall_uses_aapcs_base): Modify function to add
emulator calls for dobule precision arithmetic operations for MVE.

2020-03-16  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/mve_libcall1.c: New test.
* gcc.target/arm/mve/intrinsics/mve_libcall2.c: Likewise.

4 years ago[ARM][GCC][2/x]: MVE ACLE intrinsics framework patch.
Srinath Parvathaneni [Mon, 16 Mar 2020 17:22:39 +0000 (17:22 +0000)]
[ARM][GCC][2/x]: MVE ACLE intrinsics framework patch.

This patch is part of MVE ACLE intrinsics framework.
This patches add support to update (read/write) the APSR (Application Program Status Register)
register and FPSCR (Floating-point Status and Control Register) register for MVE.
This patch also enables thumb2 mov RTL patterns for MVE.

A new feature bit vfp_base is added. This bit is enabled for all VFP, MVE and MVE with floating point
extensions. This bit is used to enable the macro TARGET_VFP_BASE. For all the VFP instructions, RTL patterns,
status and control registers are guarded by TARGET_HAVE_FLOAT. But this patch modifies that and the
common instructions, RTL patterns, status and control registers bewteen MVE and VFP are guarded by
TARGET_VFP_BASE macro.

The RTL pattern set_fpscr and get_fpscr are updated to use VFPCC_REGNUM because few MVE intrinsics
set/get carry bit of FPSCR register.

Please refer to Arm reference manual [1] for more details.
[1] https://developer.arm.com/docs/ddi0553/latest

2020-03-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    Mihail Ionescu  <mihail.ionescu@arm.com>
    Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* common/config/arm/arm-common.c (arm_asm_auto_mfpu): When vfp_base
feature bit is on and -mfpu=auto is passed as compiler option, do not
generate error on not finding any matching fpu. Because in this case
fpu is not required.
* config/arm/arm-cpus.in (vfp_base): Define feature bit, this bit is
enabled for MVE and also for all VFP extensions.
(VFPv2): Modify fgroup to enable vfp_base feature bit when ever VFPv2
is enabled.
(MVE): Define fgroup to enable feature bits mve, vfp_base and armv7em.
(MVE_FP): Define fgroup to enable feature bits is fgroup MVE and FPv5
along with feature bits mve_float.
(mve): Modify add options in armv8.1-m.main arch for MVE.
(mve.fp): Modify add options in armv8.1-m.main arch for MVE with
floating point.
* config/arm/arm.c (use_return_insn): Replace the
check with TARGET_VFP_BASE.
(thumb2_legitimate_index_p): Replace TARGET_HARD_FLOAT with
TARGET_VFP_BASE.
(arm_rtx_costs_internal): Replace "TARGET_HARD_FLOAT || TARGET_HAVE_MVE"
with TARGET_VFP_BASE, to allow cost calculations for copies in MVE as
well.
(arm_get_vfp_saved_size): Replace TARGET_HARD_FLOAT with
TARGET_VFP_BASE, to allow space calculation for VFP registers in MVE
as well.
(arm_compute_frame_layout): Likewise.
(arm_save_coproc_regs): Likewise.
(arm_fixed_condition_code_regs): Modify to enable using VFPCC_REGNUM
in MVE as well.
(arm_hard_regno_mode_ok): Replace "TARGET_HARD_FLOAT || TARGET_HAVE_MVE"
with equivalent macro TARGET_VFP_BASE.
(arm_expand_epilogue_apcs_frame): Likewise.
(arm_expand_epilogue): Likewise.
(arm_conditional_register_usage): Likewise.
(arm_declare_function_name): Add check to skip printing .fpu directive
in assembly file when TARGET_VFP_BASE is enabled and fpu_to_print is
"softvfp".
* config/arm/arm.h (TARGET_VFP_BASE): Define.
* config/arm/arm.md (arch): Add "mve" to arch.
(eq_attr "arch" "mve"): Enable on TARGET_HAVE_MVE is true.
(vfp_pop_multiple_with_writeback): Replace "TARGET_HARD_FLOAT
|| TARGET_HAVE_MVE" with equivalent macro TARGET_VFP_BASE.
* config/arm/constraints.md (Uf): Define to allow modification to FPCCR
in MVE.
* config/arm/thumb2.md (thumb2_movsfcc_soft_insn): Modify target guard
to not allow for MVE.
* config/arm/unspecs.md (UNSPEC_GET_FPSCR): Move to volatile unspecs
enum.
(VUNSPEC_GET_FPSCR): Define.
* config/arm/vfp.md (thumb2_movhi_vfp): Add support for VMSR and VMRS
instructions which move to general-purpose Register from Floating-point
Special register and vice-versa.
(thumb2_movhi_fp16): Likewise.
(thumb2_movsi_vfp): Add support for VMSR and VMRS instructions along
with MCR and MRC instructions which set and get Floating-point Status
and Control Register (FPSCR).
(movdi_vfp): Modify pattern to enable Single-precision scalar float move
in MVE.
(thumb2_movdf_vfp): Modify pattern to enable Double-precision scalar
float move patterns in MVE.
(thumb2_movsfcc_vfp): Modify pattern to enable single float conditional
code move patterns of VFP also in MVE by adding TARGET_VFP_BASE check.
(thumb2_movdfcc_vfp): Modify pattern to enable double float conditional
code move patterns of VFP also in MVE by adding TARGET_VFP_BASE check.
(push_multi_vfp): Add support to use VFP VPUSH pattern for MVE by adding
TARGET_VFP_BASE check.
(set_fpscr): Add support to set FPSCR register for MVE. Modify pattern
using VFPCC_REGNUM as few MVE intrinsics use carry bit of FPSCR
register.
(get_fpscr): Add support to get FPSCR register for MVE. Modify pattern
using VFPCC_REGNUM as few MVE intrinsics use carry bit of FPSCR
register.

2020-03-16  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c: New test.
* gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_fpu1.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_fpu2.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_fpu3.c: Likewise.

4 years ago[ARM][GCC][1/x]: MVE ACLE intrinsics framework patch.
Srinath Parvathaneni [Mon, 16 Mar 2020 17:06:29 +0000 (17:06 +0000)]
[ARM][GCC][1/x]: MVE ACLE intrinsics framework patch.

This patch creates the required framework for MVE ACLE intrinsics.

The following changes are done in this patch to support MVE ACLE intrinsics.

Header file arm_mve.h is added to source code, which contains the definitions of MVE ACLE intrinsics
and different data types used in MVE. Machine description file mve.md is also added which contains the
RTL patterns defined for MVE.

A new reigster "p0" is added which is used in by MVE predicated patterns. A new register class "VPR_REG"
is added and its contents are defined in REG_CLASS_CONTENTS.

The vec-common.md file is modified to support the standard move patterns. The prefix of neon functions
which are also used by MVE is changed from "neon_" to "simd_".
eg: neon_immediate_valid_for_move changed to simd_immediate_valid_for_move.

In the patch standard patterns mve_move, mve_store and move_load for MVE are added and neon.md and vfp.md
files are modified to support this common patterns.

Please refer to Arm reference manual [1] for more details.

[1] https://developer.arm.com/docs/ddi0553/latest

2020-03-06  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    Mihail Ionescu  <mihail.ionescu@arm.com>
    Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* config.gcc (arm_mve.h): Include mve intrinsics header file.
* config/arm/aout.h (p0): Add new register name for MVE predicated
cases.
* config/arm-builtins.c (ARM_BUILTIN_SIMD_LANE_CHECK): Define macro
common to Neon and MVE.
(ARM_BUILTIN_NEON_LANE_CHECK): Renamed to ARM_BUILTIN_SIMD_LANE_CHECK.
(arm_init_simd_builtin_types): Disable poly types for MVE.
(arm_init_neon_builtins): Move a check to arm_init_builtins function.
(arm_init_builtins): Use ARM_BUILTIN_SIMD_LANE_CHECK instead of
ARM_BUILTIN_NEON_LANE_CHECK.
(mve_dereference_pointer): Add function.
(arm_expand_builtin_args): Call to mve_dereference_pointer when MVE is
enabled.
(arm_expand_neon_builtin): Moved to arm_expand_builtin function.
(arm_expand_builtin): Moved from arm_expand_neon_builtin function.
* config/arm/arm-c.c (__ARM_FEATURE_MVE): Define macro for MVE and MVE
with floating point enabled.
* config/arm/arm-protos.h (neon_immediate_valid_for_move): Renamed to
simd_immediate_valid_for_move.
(simd_immediate_valid_for_move): Renamed from
neon_immediate_valid_for_move function.
* config/arm/arm.c (arm_options_perform_arch_sanity_checks): Generate
error if vfpv2 feature bit is disabled and mve feature bit is also
disabled for HARD_FLOAT_ABI.
(use_return_insn): Check to not push VFP regs for MVE.
(aapcs_vfp_allocate): Add MVE check to have same Procedure Call Standard
as Neon.
(aapcs_vfp_allocate_return_reg): Likewise.
(thumb2_legitimate_address_p): Check to return 0 on valid Thumb-2
address operand for MVE.
(arm_rtx_costs_internal): MVE check to determine cost of rtx.
(neon_valid_immediate): Rename to simd_valid_immediate.
(simd_valid_immediate): Rename from neon_valid_immediate.
(simd_valid_immediate): MVE check on size of vector is 128 bits.
(neon_immediate_valid_for_move): Rename to
simd_immediate_valid_for_move.
(simd_immediate_valid_for_move): Rename from
neon_immediate_valid_for_move.
(neon_immediate_valid_for_logic): Modify call to neon_valid_immediate
function.
(neon_make_constant): Modify call to neon_valid_immediate function.
(neon_vector_mem_operand): Return VFP register for POST_INC or PRE_DEC
for MVE.
(output_move_neon): Add MVE check to generate vldm/vstm instrcutions.
(arm_compute_frame_layout): Calculate space for saved VFP registers for
MVE.
(arm_save_coproc_regs): Save coproc registers for MVE.
(arm_print_operand): Add case 'E' to print memory operands for MVE.
(arm_print_operand_address): Check to print register number for MVE.
(arm_hard_regno_mode_ok): Check for arm hard regno mode ok for MVE.
(arm_modes_tieable_p): Check to allow structure mode for MVE.
(arm_regno_class): Add VPR_REGNUM check.
(arm_expand_epilogue_apcs_frame): MVE check to calculate epilogue code
for APCS frame.
(arm_expand_epilogue): MVE check for enabling pop instructions in
epilogue.
(arm_print_asm_arch_directives): Modify function to disable print of
.arch_extension "mve" and "fp" for cases where MVE is enabled with
"SOFT FLOAT ABI".
(arm_vector_mode_supported_p): Check for modes available in MVE interger
and MVE floating point.
(arm_array_mode_supported_p): Add TARGET_HAVE_MVE check for array mode
pointer support.
(arm_conditional_register_usage): Enable usage of conditional regsiter
for MVE.
(fixed_regs[VPR_REGNUM]): Enable VPR_REG for MVE.
(arm_declare_function_name): Modify function to disable print of
.arch_extension "mve" and "fp" for cases where MVE is enabled with
"SOFT FLOAT ABI".
* config/arm/arm.h (TARGET_HAVE_MVE): Disable for soft float abi and
when target general registers are required.
(TARGET_HAVE_MVE_FLOAT): Likewise.
(FIXED_REGISTERS): Add bit for VFP_REG class which is enabled in arm.c
for MVE.
(CALL_USED_REGISTERS): Set bit for VFP_REG class in CALL_USED_REGISTERS
which indicate this is not available for across function calls.
(FIRST_PSEUDO_REGISTER): Modify.
(VALID_MVE_MODE): Define valid MVE mode.
(VALID_MVE_SI_MODE): Define valid MVE SI mode.
(VALID_MVE_SF_MODE): Define valid MVE SF mode.
(VALID_MVE_STRUCT_MODE): Define valid MVE struct mode.
(VPR_REGNUM): Add Vector Predication Register in arm_regs_in_sequence
for MVE.
(IS_VPR_REGNUM): Macro to check for VPR_REG register.
(REG_ALLOC_ORDER): Add VPR_REGNUM entry.
(enum reg_class): Add VPR_REG entry.
(REG_CLASS_NAMES): Add VPR_REG entry.
* config/arm/arm.md (VPR_REGNUM): Define.
(conds): Check is_mve_type attrbiute to differentiate "conditional" and
"unconditional" instructions.
(arm_movsf_soft_insn): Modify RTL to not allow for MVE.
(movdf_soft_insn): Modify RTL to not allow for MVE.
(vfp_pop_multiple_with_writeback): Enable for MVE.
(include "mve.md"): Include mve.md file.
* config/arm/arm_mve.h: Add MVE intrinsics head file.
* config/arm/constraints.md (Up): Constraint to enable "p0" register in MVE
for vector predicated operands.
* config/arm/iterators.md (VNIM1): Define.
(VNINOTM1): Define.
(VHFBF_split): Define
* config/arm/mve.md: New file.
(mve_mov<mode>): Define RTL for move, store and load in MVE.
(mve_mov<mode>): Define move RTL pattern with vec_duplicate operator for
second operand.
* config/arm/neon.md (neon_immediate_valid_for_move): Rename with
simd_immediate_valid_for_move.
(neon_mov<mode>): Split pattern and move expand pattern "movv8hf" which
is common to MVE and  NEON to vec-common.md file.
(vec_init<mode><V_elem_l>): Add TARGET_HAVE_MVE check.
* config/arm/predicates.md (vpr_register_operand): Define.
* config/arm/t-arm: Add mve.md file.
* config/arm/types.md (mve_move): Add MVE instructions mve_move to
attribute "type".
(mve_store): Add MVE instructions mve_store to attribute "type".
(mve_load): Add MVE instructions mve_load to attribute "type".
(is_mve_type): Define attribute.
* config/arm/vec-common.md (mov<mode>): Modify RTL expand to support
standard move patterns in MVE along with NEON and IWMMXT with mode
iterator VNIM1.
(mov<mode>): Modify RTL expand to support standard move patterns in NEON
and IWMMXT with mode iterator V8HF.
(movv8hf): Define RTL expand to support standard "movv8hf" pattern in
NEON and MVE.
* config/arm/vfp.md (neon_immediate_valid_for_move): Rename to
simd_immediate_valid_for_move.

2020-03-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Mihail Ionescu  <mihail.ionescu@arm.com>
            Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

* gcc.target/arm/mve/intrinsics/mve_vector_float.c: New test.
* gcc.target/arm/mve/intrinsics/mve_vector_float1.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_float2.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_int.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_int1.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_int2.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint1.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_vector_uint2.c: Likewise.
* gcc.target/arm/mve/mve.exp: New file.
* lib/target-supports.exp
(check_effective_target_arm_v8_1m_mve_fp_ok_nocache): Proc to check
armv8.1-m.main+mve.fp and returning corresponding options.
(check_effective_target_arm_v8_1m_mve_fp_ok): Proc to call
check_effective_target_arm_v8_1m_mve_fp_ok_nocache to check support of
MVE with floating point on the current target.
(add_options_for_arm_v8_1m_mve_fp): Proc to call
check_effective_target_arm_v8_1m_mve_fp_ok to return corresponding
compiler options for MVE with floating point.
(check_effective_target_arm_v8_1m_mve_ok_nocache): Modify to test and
return hard float-abi on success.

4 years agolibphobos: Reset libtool_VERSION to 1:0:0
Iain Buclaw [Mon, 16 Mar 2020 16:00:07 +0000 (17:00 +0100)]
libphobos: Reset libtool_VERSION to 1:0:0

libphobos/ChangeLog:

2020-03-16  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/92792
* Makefile.in: Regenerate.
* configure: Regenerate.
* configure.ac (libtool_VERSION): Reset to 1:0:0.
* libdruntime/Makefile.in: Regenerate.

4 years agoFix ChangeLog formatting from my commit last friday.
Aaron Sawdey [Mon, 16 Mar 2020 14:29:05 +0000 (09:29 -0500)]
Fix ChangeLog formatting from my commit last friday.

4 years agox32 does not support MS ABI, skip testcases that require it.
Uros Bizjak [Mon, 16 Mar 2020 13:38:06 +0000 (14:38 +0100)]
x32 does not support MS ABI, skip testcases that require it.

* testsuite/20_util/bind/91371.cc: Skip for x32.
* testsuite/20_util/is_function/91371.cc: Ditto.
* testsuite/20_util/is_member_function_pointer/91371.cc: Ditto.
* testsuite/20_util/is_object/91371.cc: Ditto.

4 years agoi386: Use ix86_output_ssemov for SImode TYPE_SSEMOV
H.J. Lu [Mon, 16 Mar 2020 10:48:55 +0000 (03:48 -0700)]
i386: Use ix86_output_ssemov for SImode TYPE_SSEMOV

There is no need to set mode attribute to XImode since ix86_output_ssemov
can properly encode xmm16-xmm31 registers with and without AVX512VL.

Remove ext_sse_reg_operand since it is no longer needed.

gcc/

PR target/89229
* config/i386/i386.md (*movsi_internal): Call ix86_output_ssemov
for TYPE_SSEMOV.  Remove ext_sse_reg_operand and TARGET_AVX512VL
check.
* config/i386/predicates.md (ext_sse_reg_operand): Removed.

gcc/testsuite/

PR target/89229
* gcc.target/i386/pr89229-7a.c: New test.
* gcc.target/i386/pr89229-7b.c: Likewise.
* gcc.target/i386/pr89229-7c.c: Likewise.

4 years agod/dmd: Merge upstream dmd b061bd744
Iain Buclaw [Mon, 16 Mar 2020 08:48:54 +0000 (09:48 +0100)]
d/dmd: Merge upstream dmd b061bd744

Fixes an ICE in the parser, and deprecates a previously allowed style of
syntax that deviated from GNU-style extended asm.

Reviewed-on: https://github.com/dlang/dmd/pull/10916

gcc/testsuite/ChangeLog:

2020-03-16  Iain Buclaw  <ibuclaw@gdcproject.org>

* gdc.dg/asm1.d: Add new test for ICE in asm parser.
* gdc.dg/asm5.d: New test.

4 years agolibphobos: Merge upstream druntime 6c45dd3a, phobos 68cc18adb.
Iain Buclaw [Sun, 15 Mar 2020 12:59:14 +0000 (13:59 +0100)]
libphobos: Merge upstream druntime 6c45dd3a, phobos 68cc18adb.

Surrounds the gcc-style asm operands with parentheses, as the old style
is now deprecated.

Reviewed-on: https://github.com/dlang/druntime/pull/2986

4 years agotree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]
Jakub Jelinek [Mon, 16 Mar 2020 08:03:59 +0000 (09:03 +0100)]
tree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]

The following testcase fails with -fcompare-debug.  The problem is that
bar is marked as address_taken only with -g and not without.
I've tracked it down to insert_init_stmt calling gimple_regimplify_operands
even on DEBUG_STMTs.  That function will just insert normal stmts before
the DEBUG_STMT if the DEBUG_STMT operand isn't gimple val or invariant.
While DCE will turn those statements into debug temporaries, it can cause
differences in SSA_NAMEs and more importantly, the ipa references are
generated from those before the DCE happens.
On the testcase, the DEBUG_STMT value is (int)bar.

We could generate DEBUG_STMTs with debug temporaries instead, but I fail to
see the reason to do that, DEBUG_STMTs allow other expressions and all we
want to ensure is that the expressions aren't too large (arbitrarily
complex), but during inlining/function versioning I don't see why something
would queue a DEBUG_STMT with arbitrarily complex expressions in there.

2020-03-16  Jakub Jelinek  <jakub@redhat.com>

PR debug/94167
* tree-inline.c (insert_init_stmt): Don't gimple_regimplify_operands
DEBUG_STMTs.

* gcc.dg/pr94167.c: New test.

4 years agotree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]
Jakub Jelinek [Mon, 16 Mar 2020 08:02:21 +0000 (09:02 +0100)]
tree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]

The following testcase fails with -fcompare-debug.  The problem is that
bar is marked as address_taken only with -g and not without.
I've tracked it down to insert_init_stmt calling gimple_regimplify_operands
even on DEBUG_STMTs.  That function will just insert normal stmts before
the DEBUG_STMT if the DEBUG_STMT operand isn't gimple val or invariant.
While DCE will turn those statements into debug temporaries, it can cause
differences in SSA_NAMEs and more importantly, the ipa references are
generated from those before the DCE happens.
On the testcase, the DEBUG_STMT value is (int)bar.

We could generate DEBUG_STMTs with debug temporaries instead, but I fail to
see the reason to do that, DEBUG_STMTs allow other expressions and all we
want to ensure is that the expressions aren't too large (arbitrarily
complex), but during inlining/function versioning I don't see why something
would queue a DEBUG_STMT with arbitrarily complex expressions in there.

2020-03-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94166
* tree-ssa-reassoc.c (sort_by_mach_mode): Use SSA_NAME_VERSION
as secondary comparison key.

* gcc.dg/pr94166.c: New test.

4 years agoUpdate post order number for merged SCC.
Bin Cheng [Mon, 16 Mar 2020 03:09:14 +0000 (11:09 +0800)]
Update post order number for merged SCC.

Function loop_distribution::break_alias_scc_partitions needs to compute
SCC with runtime alias edges skipped.  As a result, partitions could be
re-assigned larger post order number than SCC's precedent partition and
distributed before the precedent one.  This fixes the issue by updating
the merged partition to the minimal post order in SCC.

gcc/
    PR tree-optimization/94125
    * tree-loop-distribution.c
    (loop_distribution::break_alias_scc_partitions): Update post order
    number for merged scc.

gcc/testsuite/
    PR tree-optimization/94125
    * gcc.dg/tree-ssa/pr94125.c: New test.

4 years agoDaily bump.
GCC Administrator [Mon, 16 Mar 2020 00:16:17 +0000 (00:16 +0000)]
Daily bump.

4 years agoi386: Use ix86_output_ssemov for SFmode TYPE_SSEMOV
H.J. Lu [Sun, 15 Mar 2020 17:21:08 +0000 (10:21 -0700)]
i386: Use ix86_output_ssemov for SFmode TYPE_SSEMOV

There is no need to set mode attribute to V16SFmode since ix86_output_ssemov
can properly encode xmm16-xmm31 registers with and without AVX512VL.

gcc/

PR target/89229
* config/i386/i386.c (ix86_output_ssemov): Handle MODE_SI and
MODE_SF.
* config/i386/i386.md (*movsf_internal): Call ix86_output_ssemov
for TYPE_SSEMOV.  Remove TARGET_PREFER_AVX256, TARGET_AVX512VL
and ext_sse_reg_operand check.

gcc/testsuite/

PR target/89229
* gcc.target/i386/pr89229-6a.c: New test.
* gcc.target/i386/pr89229-6b.c: Likewise.
* gcc.target/i386/pr89229-6c.c: Likewise.

4 years agocoroutines: Fix indentation (NFC).
Iain Sandoe [Sun, 15 Mar 2020 14:22:18 +0000 (14:22 +0000)]
coroutines: Fix indentation (NFC).

Whitespace-only change.

gcc/cp/ChangeLog:

2020-03-15  Iain Sandoe  <iain@sandoe.co.uk>

* coroutines.cc (co_await_expander): Fix indentation.

4 years agodriver: Fix redundant descriptions in options
Lewis Hyatt [Sun, 15 Mar 2020 12:58:30 +0000 (08:58 -0400)]
driver: Fix redundant descriptions in options

Addresses issues where the two-column format of options descriptions was
used, but the columns were separated by spaces rather than a single tab,
causing the help output to be more verbose than intended.

gcc/ChangeLog:

2020-03-15  Lewis Hyatt  <lhyatt@gmail.com>

* common.opt: Avoid redundancy in the help text.
* config/arc/arc.opt: Likewise.
* config/cr16/cr16.opt: Likewise.

gcc/c-family/ChangeLog:

2020-03-15  Lewis Hyatt  <lhyatt@gmail.com>

* c.opt: Avoid redundancy in the help text.

gcc/fortran/ChangeLog:

2020-03-15  Lewis Hyatt  <lhyatt@gmail.com>

* lang.opt: Avoid redundancy in the help text.

gcc/testsuite/ChangeLog:

2020-03-15  Lewis Hyatt  <lhyatt@gmail.com>

* gcc.misc-tests/help.exp: Adapt to new output for
-Walloc-size-larger-than= option.

4 years agotree-nested: Fix handling of *reduction clauses with C array sections [PR93566]
Jakub Jelinek [Sun, 15 Mar 2020 00:27:40 +0000 (01:27 +0100)]
tree-nested: Fix handling of *reduction clauses with C array sections [PR93566]

tree-nested.c didn't handle C array sections in {,task_,in_}reduction clauses.

2020-03-14  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93566
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Handle {,in_,task_}reduction clauses
with C/C++ array sections.

* testsuite/libgomp.c/pr93566.c: New test.

4 years agoDaily bump.
GCC Administrator [Sun, 15 Mar 2020 00:16:14 +0000 (00:16 +0000)]
Daily bump.

4 years agoi386: Use ix86_output_ssemov for DImode TYPE_SSEMOV
H.J. Lu [Sat, 14 Mar 2020 23:06:55 +0000 (16:06 -0700)]
i386: Use ix86_output_ssemov for DImode TYPE_SSEMOV

There is no need to set mode attribute to XImode since ix86_output_ssemov
can properly encode xmm16-xmm31 registers with and without AVX512VL.

gcc/

PR target/89229
* config/i386/i386.md (*movdi_internal): Call ix86_output_ssemov
for TYPE_SSEMOV.  Remove ext_sse_reg_operand and TARGET_AVX512VL
check.

gcc/testsuite/

PR target/89229
* gcc.target/i386/pr89229-5a.c: New test.
* gcc.target/i386/pr89229-5b.c: Likewise.
* gcc.target/i386/pr89229-5c.c: Likewise.

4 years agoc++: Fix ICE-after-error on partial spec [92068]
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)]
c++: Fix ICE-after-error on partial spec [92068]

Here the template arguments for the partial specialization are valid
arguments for the template, but not for a partial specialization, because
'd' can never be deduced to anything other than an empty pack.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/92068
* pt.c (process_partial_specialization): Error rather than crash on
extra pack expansion.

4 years agoc++: Find parameter pack in typedef in lambda [92909].
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)]
c++: Find parameter pack in typedef in lambda [92909].

find_parameter_packs_r doesn't look through typedefs, which is normally
correct, but that means we need to handle their declarations specially.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/92909
* pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
DECL_ORIGINAL_TYPE of a typedef.

4 years agoc++: Fix CTAD with multiple-arg ctor template [93248].
Jason Merrill [Sat, 14 Mar 2020 21:10:39 +0000 (17:10 -0400)]
c++: Fix CTAD with multiple-arg ctor template [93248].

When cp_unevaluated_operand is set, tsubst_decl thinks that if it sees a
PARM_DECL that isn't already in local_specializations, we're in a decltype
in a trailing return type or some such, and so we only want a substitution
for a single PARM_DECL.  In this case, we want the whole chain, so make sure
cp_unevaluated_operand is cleared.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

PR c++/93248
* pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
substituting DECL_ARGUMENTS.

4 years agolibphobos: Merge upstream druntime 7915b6a3
Iain Buclaw [Sat, 14 Mar 2020 18:30:24 +0000 (19:30 +0100)]
libphobos: Merge upstream druntime 7915b6a3

Includes port fixes for Musl on ARM, AArch64, and SystemZ targets.

Reviewed-on: https://github.com/dlang/druntime/pull/2751
             https://github.com/dlang/druntime/pull/2843
             https://github.com/dlang/druntime/pull/2844
             https://github.com/dlang/druntime/pull/2898

4 years agors6000/test: Fix selector in fold-vec-mule-misc.c
Segher Boessenkool [Mon, 17 Feb 2020 12:13:21 +0000 (12:13 +0000)]
rs6000/test: Fix selector in fold-vec-mule-misc.c

Run tests should use vmx_hw, not just powerpc_altivec_ok.

gcc/testsuite/
PR target/94176
* gcc.target/powerpc/fold-vec-mule-misc.c: Use vmx_hw selector.

4 years agoFix doubled indefinite articles, mostly in comments.
Jakub Jelinek [Sat, 14 Mar 2020 07:15:08 +0000 (08:15 +0100)]
Fix doubled indefinite articles, mostly in comments.

2020-03-14  Jakub Jelinek  <jakub@redhat.com>

* gimple-fold.c (gimple_fold_builtin_strncpy): Change
"a an" to "an" in a comment.
* hsa-common.h (is_a_helper): Likewise.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Likewise.
* config/arc/arc.c (arc600_corereg_hazard): Likewise.
* config/s390/s390.c (s390_indirect_branch_via_thunk): Likewise.

* logic.cc (formula::formula): Change "a an" to "an" in a comment.
* parser.c (cp_debug_parser): Change "a an" to "an" in a string
literal.

4 years agoDaily bump.
GCC Administrator [Sat, 14 Mar 2020 00:16:22 +0000 (00:16 +0000)]
Daily bump.

4 years agoFix UBSAN error, shifting 64 bit value by 64.
Aaron Sawdey [Fri, 13 Mar 2020 23:14:22 +0000 (18:14 -0500)]
Fix UBSAN error, shifting 64 bit value by 64.

2020-03-13  Aaron Sawdey  <acsawdey@linux.ibm.com>

PR target/92379
* config/rs6000/rs6000.c (num_insns_constant_multi) Don't shift a
64-bit value by 64 bits (UB).

4 years agoanalyzer: handle NOP_EXPR in get_lvalue [PR94099,PR94105]
David Malcolm [Tue, 10 Mar 2020 23:03:37 +0000 (19:03 -0400)]
analyzer: handle NOP_EXPR in get_lvalue [PR94099,PR94105]

PR analyzer/94099 and PR analyzer/94105 both report ICEs relating to
calling region_model::get_lvalue on a NOP_EXPR.

PR analyzer/94099's ICE happens when generating a checker_path when
encountering an unhandled tree code (NOP_EXPR) in get_lvalue with a
NULL context (from for_each_state_change).

PR analyzer/94105 ICE happens when handling an ARRAY_REF where the
first operand is a NOP_EXPR: the unhandled tree code gives us
a symbolic_region, but the case for ARRAY_REF assumes we have an
array_region.

This patch fixes the ICEs by handling NOP_EXPR within
region_model::get_lvalue, and bulletproofs both of the above sources
of failure.

gcc/analyzer/ChangeLog:
PR analyzer/94099
PR analyzer/94105
* diagnostic-manager.cc (for_each_state_change): Bulletproof
against errors in get_rvalue by passing a
tentative_region_model_context and rejecting if there's an error.
* region-model.cc (region_model::get_lvalue_1): When handling
ARRAY_REF, handle results of error-handling.  Handle NOP_EXPR.

gcc/testsuite/ChangeLog:
PR analyzer/94099
PR analyzer/94105
* gcc.dg/analyzer/pr94099.c: New test.
* gcc.dg/analyzer/pr94105.c: New test.

4 years agod/dmd: Merge upstream dmd e9420cfbf
Iain Buclaw [Fri, 13 Mar 2020 20:03:02 +0000 (21:03 +0100)]
d/dmd: Merge upstream dmd e9420cfbf

1. Implement DIP 1010 - (Static foreach)

Support for 'static foreach' has been added.  'static foreach' is a conditional
compilation construct that is to 'foreach' what 'static if' is to 'if'.  It is
a convenient way to generate declarations and statements by iteration.

    import std.conv: to;

    static foreach(i; 0 .. 10)
    {

        // a 'static foreach' body does not introduce a nested scope
        // (similar to 'static if').

        // The following mixin declaration is at module scope:
        // declares 10 variables x0, x1, ..., x9
        mixin('enum x' ~ to!string(i) ~ ' = i;');
    }

    import std.range: iota;
    // all aggregate types that can be iterated with a standard 'foreach'
    // loop are also supported by static foreach:
    static foreach(i; iota(10))
    {
        // we access the declarations generated in the first 'static foreach'
        pragma(msg, "x", i, ": ", mixin(`x` ~ to!string(i)));
        static assert(mixin(`x` ~ to!string(i)) == i);
    }

    void main()
    {
        import std.conv: text;
        import std.typecons: tuple;
        import std.algorithm: map;
        import std.stdio: writeln;

        // 'static foreach' has both declaration and statement forms
        // (similar to 'static if').

        static foreach(x; iota(3).map!(i => tuple(text("x", i), i)))
        {
            // generates three local variables x0, x1 and x2.
            mixin(text(`int `,x[0],` = x[1];`));

            scope(exit) // this is within the scope of 'main'
            {
                writeln(mixin(x[0]));
            }
        }

        writeln(x0," ",x1," ",x2); // first runtime output
    }

2. Aliases can be created directly from a '__trait'.

Aliases can be created directly from the traits that return symbol(s) or
tuples.  This includes 'getMember', 'allMembers', 'derivedMembers', 'parent',
'getOverloads', 'getVirtualFunctions', 'getVirtualMethods', 'getUnitTests',
'getAttributes' and finally 'getAliasThis'.  Previously an 'AliasSeq' was
necessary in order to alias their return.  Now the grammar allows to write
shorter declarations:

    struct Foo
    {
        static int a;
    }

    alias oldWay = AliasSeq!(__traits(getMember, Foo, "a"))[0];
    alias newWay = __traits(getMember, Foo, "a");

To permit this it was more interesting to include '__trait' in the basic types
rather than just changing the alias syntax. So additionally, wherever a type
appears a '__trait' can be used, for example in a variable declaration:

    struct Foo { static struct Bar {} }
    const(__traits(getMember, Foo, "Bar")) fooBar;
    static assert(is(typeof(fooBar) == const(Foo.Bar)));

3. fix Issue 10100 - Identifiers with double underscores and allMembers

The identifer whitelist has been converted into a blacklist of all possible
internal D language declarations.

Reviewed-on: https://github.com/dlang/dmd/pull/10791

4 years agotestsuite: Fix misquoted string in bfcvt-nosimd.c
Vasee Vinayagamoorthy [Fri, 13 Mar 2020 19:43:34 +0000 (19:43 +0000)]
testsuite: Fix misquoted string in bfcvt-nosimd.c

2020-03-13  Vasee Vinayagamoorthy  <vaseeharan.vinayagamoorthy@arm.com>

gcc/testsuite/
* gcc.target/aarch64/advsimd-intrinsics/bfcvt-nosimd.c: Fix DejaGnu
typo.

4 years agoPR92303: Try to simplify memory subreg.
Vladimir N. Makarov [Fri, 13 Mar 2020 18:58:57 +0000 (14:58 -0400)]
PR92303: Try to simplify memory subreg.

2020-03-13  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/92303
* lra-spills.c (remove_pseudos): Try to simplify memory subreg.

4 years agoPR c/94040 - ICE on a call to an invalid redeclaration of strftime
Martin Sebor [Fri, 13 Mar 2020 18:29:33 +0000 (12:29 -0600)]
PR c/94040 - ICE on a call to an invalid redeclaration of strftime

gcc/testsuite/ChangeLog:

       * gcc.dg/torture/pr54261-1.c: Correct built-in declartion.

4 years agoFix wrong year in ChangeLog.
Eric Botcazou [Fri, 13 Mar 2020 17:02:40 +0000 (18:02 +0100)]
Fix wrong year in ChangeLog.

4 years agoPR c/94040 - ICE on a call to an invalid redeclaration of strftime
Martin Sebor [Fri, 13 Mar 2020 16:28:26 +0000 (10:28 -0600)]
PR c/94040 - ICE on a call to an invalid redeclaration of strftime

gcc/c/ChangeLog:

PR c/94040
* c-decl.c (builtin_structptr_type_count): New constant.
(match_builtin_function_types): Reject decls that are incompatible
in types pointed to by pointers.
(diagnose_mismatched_decls): Adjust comments.

gcc/testsuite/ChangeLog:

PR c/94040
* gcc.dg/Wbuiltin-declaration-mismatch-12.c: Relax test to look
for warning name rather than the exact text.
* gcc.dg/Wbuiltin-declaration-mismatch-14.c: New test.
* gcc.dg/Wbuiltin-declaration-mismatch-15.c: New test.
* gcc.dg/pr62090.c: Prune expected warning.
* gcc.dg/pr89314.c: Look for warning name rather than text.

4 years agotestsuite: Assorted x32 testsuite fixes
Uros Bizjak [Fri, 13 Mar 2020 15:34:32 +0000 (16:34 +0100)]
testsuite: Assorted x32 testsuite fixes

* gcc.target/i386/pr64409.c: Do not limit compilation to x32 targets.
(dg-error): Quote 'ms_abi' attribute.
* gcc.target/i386/pr71958.c: Do not limit compilation to x32 targets.
Require maybe_x32 effective target.
(dg-options): Add -mx32.
(dg-error): Quote 'ms_abi' attribute.
* gcc.target/i386/pr90096.c (dg-error): Update relative
location of target x32 error.

4 years agodf: Don't abuse bb->aux (PR94148, PR94042)
Segher Boessenkool [Thu, 12 Mar 2020 07:12:50 +0000 (07:12 +0000)]
df: Don't abuse bb->aux (PR94148, PR94042)

The df dataflow solvers use the aux field in the basic_block struct,
although that is reserved for any use by passes.  And not only that,
it is required that you set all such fields to NULL before calling
the solvers, or you quietly get wrong results.

This changes the solvers to use a local array for last_change_age
instead, just like it already had a local array for last_visit_age.

PR rtl-optimization/94148
PR rtl-optimization/94042
* df-core.c (BB_LAST_CHANGE_AGE): Delete.
(df_worklist_propagate_forward): New parameter last_change_age, use
that instead of bb->aux.
(df_worklist_propagate_backward): Ditto.
(df_worklist_dataflow_doublequeue): Use a local array last_change_age.

4 years agoc++: Redundant -Wdeprecated-declarations warning in build_over_call [PR67960]
Patrick Palka [Thu, 12 Mar 2020 18:38:42 +0000 (14:38 -0400)]
c++: Redundant -Wdeprecated-declarations warning in build_over_call [PR67960]

In build_over_call, we are emitting a redundant -Wdeprecated-declarations
warning about the deprecated callee function, first from mark_used and again
from build_addr_func <- decay_conversion <- cp_build_addr_expr <- mark_used.

It seems this second deprecation warning coming from build_addr_func will always
be redundant, so we can safely use a warning_sentinel to disable it before
calling build_addr_func.  (And any deprecation warning that could come from
build_addr_func would be for FN, so we wouldn't be suppressing too much.)

gcc/cp/ChangeLog:

PR c++/67960
* call.c (build_over_call): Use a warning_sentinel to disable
warn_deprecated_decl before calling build_addr_func.

gcc/testsuite/ChangeLog:

PR c++/67960
* g++.dg/diagnostic/pr67960.C: New test.
* g++.dg/diagnostic/pr67960-2.C: New test.

4 years agotree-optimization/94163 constrain alignment set by PRE
Richard Biener [Fri, 13 Mar 2020 12:56:26 +0000 (13:56 +0100)]
tree-optimization/94163 constrain alignment set by PRE

This avoids HWI -> unsigned truncation to end up with zero alignment
which set_ptr_info_alignment ICEs on.

2020-03-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/94163
* tree-ssa-pre.c (create_expression_by_pieces): Check
whether alignment would be zero.

4 years agoDo not strcat to result of getenv.
Martin Liska [Fri, 13 Mar 2020 12:50:01 +0000 (13:50 +0100)]
Do not strcat to result of getenv.

PR lto/94157
* lto-wrapper.c (run_gcc): Use concat for appending
to collect_gcc_options.
PR lto/94157
* gcc.dg/lto/pr94157_0.c: New test.

4 years ago[testsuite] Fix PR93935 to guard case under vect_hw_misalign
Kewen Lin [Fri, 13 Mar 2020 10:51:21 +0000 (05:51 -0500)]
[testsuite] Fix PR93935 to guard case under vect_hw_misalign

This patch is to apply the same fix as r267528 to another similar case
bb-slp-over-widen-2.c which requires misaligned vector access.

gcc/testsuite/ChangeLog

    PR testsuite/93935
    * gcc.dg/vect/bb-slp-over-widen-2.c: Expect basic block vectorized
    messages only on vect_hw_misalign targets.

4 years agoaarch64: Fix another bug in aarch64_add_offset_1 [PR94121]
Jakub Jelinek [Fri, 13 Mar 2020 10:33:16 +0000 (11:33 +0100)]
aarch64: Fix another bug in aarch64_add_offset_1 [PR94121]

> I'm getting this ICE with -mabi=ilp32:
>
> during RTL pass: fwprop1
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c: In function 'bar':
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c:16:1: internal compiler error: in decompose, at rtl.h:2279

That is a preexisting issue, caused by another bug in the same function.
When mode is SImode and moffset is 0x80000000 (or anything else with the
bit 31 set), we need to sign-extend it.

2020-03-13  Jakub Jelinek  <jakub@redhat.com>

PR target/94121
* config/aarch64/aarch64.c (aarch64_add_offset_1): Use gen_int_mode
instead of GEN_INT.

4 years agoi386: Use ix86_output_ssemov for DFmode TYPE_SSEMOV
H.J. Lu [Fri, 13 Mar 2020 09:48:59 +0000 (02:48 -0700)]
i386: Use ix86_output_ssemov for DFmode TYPE_SSEMOV

There is no need to set mode attribute to XImode nor V8DFmode since
ix86_output_ssemov can properly encode xmm16-xmm31 registers with and
without AVX512VL.

gcc/

PR target/89229
* config/i386/i386.c (ix86_output_ssemov): Handle MODE_DF.
* config/i386/i386.md (*movdf_internal): Call ix86_output_ssemov
for TYPE_SSEMOV.  Remove TARGET_AVX512F, TARGET_PREFER_AVX256,
TARGET_AVX512VL and ext_sse_reg_operand check.

gcc/testsuite/

PR target/89229
* gcc.target/i386/pr89229-4a.c: New test.
* gcc.target/i386/pr89229-4b.c: Likewise.
* gcc.target/i386/pr89229-4c.c: Likewise.

4 years agoaarch64: Add --params to control the number of recip steps [PR94154]
Bu Le [Thu, 12 Mar 2020 22:39:12 +0000 (22:39 +0000)]
aarch64: Add --params to control the number of recip steps [PR94154]

-mlow-precision-div hard-coded the number of iterations to 2 for double
and 1 for float.  This patch adds a --param to control the number.

2020-03-13  Bu Le  <bule1@huawei.com>

gcc/
PR target/94154
* config/aarch64/aarch64.opt (-param=aarch64-float-recp-precision=)
(-param=aarch64-double-recp-precision=): New options.
* doc/invoke.texi: Document them.
* config/aarch64/aarch64.c (aarch64_emit_approx_div): Use them
instead of hard-coding the choice of 1 for float and 2 for double.

4 years agoFix incorrect filling of delay slots in branchy code at -O2
Eric Botcazou [Fri, 13 Mar 2020 08:58:44 +0000 (09:58 +0100)]
Fix incorrect filling of delay slots in branchy code at -O2

The issue is that relax_delay_slots can streamline the CFG in some cases,
in particular remove BARRIERs, but removing BARRIERs changes the way the
instructions are associated with (basic) blocks by the liveness analysis
code in resource.c (find_basic_block) and thus can cause entries in the
cache maintained by resource.c to become outdated, thus producing wrong
answers downstream.

The fix is to invalidate the cache entries affected by the removal of
BARRIERs in relax_delay_slots, i.e. for the instructions down to the
next BARRIER.

PR rtl-optimization/94119
* resource.h (clear_hashed_info_until_next_barrier): Declare.
* resource.c (clear_hashed_info_until_next_barrier): New function.
* reorg.c (add_to_delay_list): Fix formatting.
(relax_delay_slots): Call clear_hashed_info_until_next_barrier on
the next instruction after removing a BARRIER.

4 years agoFix unaligned load with small memcpy on the ARM
Eric Botcazou [Fri, 13 Mar 2020 08:16:29 +0000 (09:16 +0100)]
Fix unaligned load with small memcpy on the ARM

store_integral_bit_field is ready to handle BLKmode fields, there is
even a subtlety with their handling on big-endian targets, see e.g.
PR middle-end/50325, but not if they are unaligned, so the fix is
simply to call extract_bit_field for them in order to generate an
unaligned load.  As a bonus, this subsumes  the big-endian specific
path that was added under PR middle-end/50325.

PR middle-end/92071
* expmed.c (store_integral_bit_field): For fields larger than a
word, call extract_bit_field on the value if the mode is BLKmode.
Remove specific path for big-endian targets and tidy things up a
little bit.

4 years agoDaily bump.
GCC Administrator [Fri, 13 Mar 2020 00:16:15 +0000 (00:16 +0000)]
Daily bump.

4 years agoRemove no-op register to register copies in CSE just like we remove no-op memory...
Richard Sandiford [Thu, 12 Mar 2020 22:09:27 +0000 (16:09 -0600)]
Remove no-op register to register copies in CSE just like we remove no-op memory to memory copies.

        PR rtl-optimization/90275
        * cse.c (cse_insn): Delete no-op register moves too.

        PR rtl-optimization/90275
        * gcc.c-torture/compile/pr90275.c: New test.

4 years agoSupport for the CPEN control register was removed in rev .50 of the RXv1 Instruction...
Jeff Law [Thu, 12 Mar 2020 19:41:28 +0000 (13:41 -0600)]
Support for the CPEN control register was removed in rev .50 of the RXv1 Instruction Set Architecture manual in Feb 2009.  This patch removes it from GCC.

* config/rx/rx.md (CTRLREG_CPEN): Remove.
* config/rx/rx.c (rx_print_operand): Remove CTRLREG_CPEN support.

4 years agomaintainer-scripts: Fix up gcc_release without -l, where mkdir was using umask 077...
Jakub Jelinek [Thu, 12 Mar 2020 17:30:16 +0000 (18:30 +0100)]
maintainer-scripts: Fix up gcc_release without -l, where mkdir was using umask 077 after migration

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* gcc_release (upload_files): Without -l, pass -m 755 to the mkdir
command invoked through ssh.

4 years agomaintainer-scripts: Fix jit documentation build with update_web_docs_git
Jakub Jelinek [Thu, 12 Mar 2020 13:46:28 +0000 (14:46 +0100)]
maintainer-scripts: Fix jit documentation build with update_web_docs_git

scripts/update_web_docs_git -r 9.3.0 -d gcc-9.3.0
failed after the sourceware upgrade, there is no python-sphinx10 package and
python3-sphinx is new enough that the docs build succeeded.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* update_web_docs_git: Drop SPHINXBUILD=/usr/bin/sphinx-1.0-build.

4 years agotree-optimization/94103 avoid CSE of loads with padding
Richard Biener [Thu, 12 Mar 2020 13:18:35 +0000 (14:18 +0100)]
tree-optimization/94103 avoid CSE of loads with padding

VN currently replaces a load of a 16 byte entity 128 bits of precision
(TImode) with the result of a load of a 16 byte entity with 80 bits of
mode precision (XFmode).  That will go downhill since if the padding
bits are not actually filled with memory contents those bits are
missing.

2020-03-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/94103
* tree-ssa-sccvn.c (visit_reference_op_load): Avoid type
punning when the mode precision is not sufficient.

* gcc.target/i386/pr94103.c: New testcase.

4 years agolibstdc++: Fix test failure due to -Wnonnull warnings
Jonathan Wakely [Thu, 12 Mar 2020 11:03:04 +0000 (11:03 +0000)]
libstdc++: Fix test failure due to -Wnonnull warnings

This test fails in the Fedora RPM build (but not elsewhere, for unknown
reasons). The warning is correct, we're passing a null pointer.

* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
a null pointer to functions with nonnull(1) attribute.

4 years agoi386: Use ix86_output_ssemov for MMX TYPE_SSEMOV
H.J. Lu [Thu, 12 Mar 2020 10:47:45 +0000 (03:47 -0700)]
i386: Use ix86_output_ssemov for MMX TYPE_SSEMOV

There is no need to set mode attribute to XImode since ix86_output_ssemov
can properly encode xmm16-xmm31 registers with and without AVX512VL.

PR target/89229
* config/i386/i386.c (ix86_output_ssemov): Handle MODE_DI,
MODE_V1DF and MODE_V2SF.
* config/i386/mmx.md (MMXMODE:*mov<mode>_internal): Call
ix86_output_ssemov for TYPE_SSEMOV.  Remove ext_sse_reg_operand
check.

4 years ago[Fortran, OpenACC] Reject vars of different scope in $acc declare (PR94120)
Tobias Burnus [Thu, 12 Mar 2020 09:57:56 +0000 (10:57 +0100)]
[Fortran, OpenACC] Reject vars of different scope in $acc declare (PR94120)

2020-03-12  Tobias Burnus  <tobias@codesourcery.com>

        PR middle-end/94120
        * openmp.c (gfc_match_oacc_declare): Accept function-result
        variables; reject variables declared in a different scoping unit.

2020-03-12  Tobias Burnus  <tobias@codesourcery.com>

        PR middle-end/94120
        * gfortran.dg/goacc/pr78260-2.f90: Correct scan-tree-dump-times.
        Extend test case to result variables.
        * gfortran.dg/goacc/declare-2.f95: Actually check module-declaration
        restriction of OpenACC.
        * gfortran.dg/goacc/declare-3.f95: Remove case where this
        restriction is violated.
        * gfortran.dg/goacc/pr94120-1.f90: New.
        * gfortran.dg/goacc/pr94120-2.f90: New.
        * gfortran.dg/goacc/pr94120-3.f90: New.

4 years agodoc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description
Jakub Jelinek [Thu, 12 Mar 2020 08:35:30 +0000 (09:35 +0100)]
doc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description

When looking into PR94134, I've noticed bugs in the
ASM_OUTPUT_ALIGNED_DECL_LOCAL documentation.  varasm.c has:
  #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
                                   size, align);
    return true;
  #elif defined ASM_OUTPUT_ALIGNED_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
    return true;
  #else
    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
    return false;
  #endif
and the ASM_OUTPUT_ALIGNED_LOCAL documentation properly mentions:
Like @code{ASM_OUTPUT_LOCAL} and mentions the same macro in another place.
The ASM_OUTPUT_ALIGNED_DECL_LOCAL description mentions non-existing macros
ASM_OUTPUT_ALIGNED_DECL and ASM_OUTPUT_DECL instead of the right ones
ASM_OUTPUT_ALIGNED_LOCAL and ASM_OUTPUT_LOCAL.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

* doc/tm.texi.in (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change
ASM_OUTPUT_ALIGNED_DECL in description to ASM_OUTPUT_ALIGNED_LOCAL
and ASM_OUTPUT_DECL to ASM_OUTPUT_LOCAL.
* doc/tm.texi: Regenerated.

4 years agotree-dse: Fix mem* head trimming if call has lhs [PR94130]
Jakub Jelinek [Thu, 12 Mar 2020 08:34:00 +0000 (09:34 +0100)]
tree-dse: Fix mem* head trimming if call has lhs [PR94130]

As the testcase shows, if DSE decides to head trim {mem{set,cpy,move},strncpy}
and the call has lhs, it is incorrect to leave the lhs as is, because it
will then point to the adjusted address (base + head_trim) instead of the
original base.
The following patch fixes that by dropping the lhs of the call and assigning
lhs the original base in a following statement.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94130
* tree-ssa-dse.c: Include gimplify.h.
(increment_start_addr): If stmt has lhs, drop the lhs from call and
set it after the call to the original value of the first argument.
Formatting fixes.
(decrement_count): Formatting fix.

* gcc.c-torture/execute/pr94130.c: New test.

4 years agoc++: Tweak reshape_init_array_1 [PR94124]
Jakub Jelinek [Thu, 12 Mar 2020 07:28:05 +0000 (08:28 +0100)]
c++: Tweak reshape_init_array_1 [PR94124]

Isn't it wasteful to first copy perhaps a large constructor (recursively)
and then truncate it to very few elts (zero in this case)?

> We should certainly avoid copying if they're the same.  The code above for
> only copying the bits that aren't going to be thrown away seems pretty
> straightforward, might as well use it even if the savings aren't likely to
> be large.

Calling vec_safe_truncate with the same number of elts the vector already
has is a nop, so IMHO we just should make sure we only unshare if it
changed.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

PR c++/94124
* decl.c (reshape_init_array_1): Don't unshare constructor if there
aren't any trailing zero elts, otherwise only unshare the first
nelts.

4 years agoUpdate myself to MAINTAINERS
Bin Bin Lv [Thu, 12 Mar 2020 03:32:40 +0000 (23:32 -0400)]
Update myself to MAINTAINERS

This updates myself to the right place in MAINTAINERS.

gcc/ChangeLog

2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>

* MAINTAINERS (Write After Approval): Update myself.

4 years ago[rs6000] Fix a wrong GC issue
Bin Bin Lv [Thu, 12 Mar 2020 02:25:31 +0000 (22:25 -0400)]
[rs6000] Fix a wrong GC issue

The source file rs6000.c was split up into several smaller source files
through commit 1acf024.  However, variable "altivec_builtin_mask_for_load" and
"builtin_mode_to_type[MAX_MACHINE_MODE][2]" were marked with the wrong syntax
"GTY(([options])) type name", which led these two variables were not marked as
roots correctly and wrongly GCed.  And when "altivec_builtin_mask_for_load"
was wrongly GCed, the compiling for openJDK is failed with ICEs enabling
precompiled header under mcpu=power7.  So roots must be declared using one of
the following syntaxes: "extern GTY(([options])) type name;" and "static
GTY(([options])) type name;".

And the following patch adds variable "altivec_builtin_mask_for_load" and
"builtin_mode_to_type[MAX_MACHINE_MODE][2]" into the roots array.

Bootstrap and regression tests were done on powerpc64le-linux-gnu (LE) with no
regressions.

gcc/ChangeLog

2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>

* config/rs6000/rs6000-internal.h (altivec_builtin_mask_for_load,
builtin_mode_to_type): Remove the declaration.
* config/rs6000/rs6000.h (altivec_builtin_mask_for_load,
builtin_mode_to_type): Add an extern GTY(()) declaration.
* config/rs6000/rs6000.c (altivec_builtin_mask_for_load,
builtin_mode_to_type): Remove the GTY(()) declaration.

4 years agoAdd myself to MAINTAINERS
Bin Bin Lv [Thu, 12 Mar 2020 01:41:18 +0000 (21:41 -0400)]
Add myself to MAINTAINERS

This adds myself to MAINTAINERS in the Write After Approval section.

gcc/ChangeLog

2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>

* MAINTAINERS (Write After Approval): Add myself.

4 years agotestsuite: Fix concepts-using2.C failure on 32-bit targets [PR93907]
Jakub Jelinek [Thu, 12 Mar 2020 00:28:55 +0000 (01:28 +0100)]
testsuite: Fix concepts-using2.C failure on 32-bit targets [PR93907]

The test FAILs on 32-bit targets that don't have __int128 type.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

PR c++/93907
* g++.dg/cpp2a/concepts-using2.C (cc): Use long long instead of
__int128 if __SIZEOF_INT128__ isn't defined.

4 years agoDaily bump.
GCC Administrator [Thu, 12 Mar 2020 00:16:14 +0000 (00:16 +0000)]
Daily bump.

4 years agoc++: Fix ICE with concepts and aliases [PR93907].
Jason Merrill [Wed, 11 Mar 2020 04:53:01 +0000 (00:53 -0400)]
c++: Fix ICE with concepts and aliases [PR93907].

The problem here was that we were checking satisfaction once with 'e', a
typedef of 'void', and another time with 'void' directly, and treated them
as different for hashing based on the assumption that
canonicalize_type_argument would have already removed a typedef that wasn't
a complex dependent alias.  But that wasn't happening here, so let's add a
call.

gcc/cp/ChangeLog
2020-03-11  Jason Merrill  <jason@redhat.com>

PR c++/93907
* constraint.cc (tsubst_parameter_mapping): Canonicalize type
argument.

4 years agoc++: Fix wrong modifying const object error for COMPONENT_REF [PR94074]
Marek Polacek [Fri, 6 Mar 2020 22:30:11 +0000 (17:30 -0500)]
c++: Fix wrong modifying const object error for COMPONENT_REF [PR94074]

I got a report that building Chromium fails with the "modifying a const
object" error.  After some poking I realized it's a bug in GCC, not in
their codebase.

Much like with ARRAY_REFs, which can be const even though the array
itself isn't, COMPONENT_REFs can be const although neither the object
nor the field were declared const.  So let's dial down the checking.
Here the COMPONENT_REF was const because of the "const_cast<const U &>(m)"
thing -- cxx_eval_component_reference then builds a COMPONENT_REF with
TREE_TYPE (t).

While looking into this I noticed that we don't detect modifying a const
object in certain cases like in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94074#c2>.  That's because
we never evaluate an X::X() CALL_EXPR -- there's none.  Fixed as per
Jason's suggestion by setting TREE_READONLY on a CONSTRUCTOR after
initialization in cxx_eval_store_expression.

2020-03-11  Marek Polacek  <polacek@redhat.com>
    Jason Merrill  <jason@redhat.com>

PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
* constexpr.c (cref_has_const_field): New function.
(modifying_const_object_p): Consider a COMPONENT_REF
const only if any of its fields are const.
(cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
as readonly after its initialization has been done.

* g++.dg/cpp1y/constexpr-tracking-const17.C: New test.
* g++.dg/cpp1y/constexpr-tracking-const18.C: New test.
* g++.dg/cpp1y/constexpr-tracking-const19.C: New test.
* g++.dg/cpp1y/constexpr-tracking-const20.C: New test.
* g++.dg/cpp1y/constexpr-tracking-const21.C: New test.
* g++.dg/cpp1y/constexpr-tracking-const22.C: New test.

4 years agolibstdc++: Add a test that takes the split_view of a non-forward range
Patrick Palka [Wed, 11 Mar 2020 15:08:49 +0000 (11:08 -0400)]
libstdc++: Add a test that takes the split_view of a non-forward range

This adds a tests that verifies taking the split_view of a non-forward range
works correctly.  Doing so revealed a typo in one of _OuterIter's constructors.

It also revealed that the default constructor of
__gnu_test::test_range::iterator misbehaves, because by delegating to
Iter<T>(nullptr, nullptr) we perform a null-pointer deref at runtime in
input_iterator_wrapper's constructor due to the ITERATOR_VERIFY check therein.
Instead of delegating to this constructor it seems we can just inherit the
protected default constructor, which does not contain this ITERATOR_VERIFY
check.

libstdc++-v3/ChangeLog:

* include/std/ranges (split_view::_OuterIter::_OuterIter): Typo fix,
'address' -> 'std::__addressof'.
* testsuite/std/ranges/adaptors/split.cc: Test taking the split_view of
a non-forward input_range.
* testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Make
default constructor protected instead of deleted, like with
input_iterator_wrapper.
(test_range::iterator): Add comment explaining that this type is used
only when the underlying wrapper is input_iterator_wrapper or
output_iterator_wrapper.  Remove delegating defaulted constructor so
that the inherited default constructor is used instead.

4 years agoBug fix: cannot convert 'const short int*' to 'const __bf16*'
Delia Burduv [Wed, 11 Mar 2020 18:01:26 +0000 (18:01 +0000)]
Bug fix: cannot convert 'const short int*' to 'const __bf16*'

This patch fixes a bug introduced by my earlier patch (
https://gcc.gnu.org/pipermail/gcc-patches/2020-March/541680.html ).
It introduces a new scalar builtin type that was missing in the original
patch.

Bootstrapped cleanly on arm-none-linux-gnueabihf.
Tested for regression on arm-none-linux-gnueabihf. No regression from
before the original patch.
Tests that failed or became unsupported because of the original tests
now work as they did before it.

* config/arm/arm-builtins.c
(arm_init_simd_builtin_scalar_types): New.
* config/arm/arm_neon.h (vld2_bf16): Used new builtin type.
(vld2q_bf16): Used new builtin type.
(vld3_bf16): Used new builtin type.
(vld3q_bf16): Used new builtin type.
(vld4_bf16): Used new builtin type.
(vld4q_bf16): Used new builtin type.
(vld2_dup_bf16): Used new builtin type.
(vld2q_dup_bf16): Used new builtin type.
(vld3_dup_bf16): Used new builtin type.
(vld3q_dup_bf16): Used new builtin type.
(vld4_dup_bf16): Used new builtin type.
(vld4q_dup_bf16): Used new builtin type.

4 years agopdp11: Fix handling of common (local and global) vars [PR94134]
Jakub Jelinek [Wed, 11 Mar 2020 17:35:13 +0000 (18:35 +0100)]
pdp11: Fix handling of common (local and global) vars [PR94134]

As mentioned in the PR, the generic code decides to put the a variable into
lcomm_section, which is a NOSWITCH section and thus the generic code doesn't
switch into a particular section before using
ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL, on many targets that results just in
.lcomm (or for non-local .comm) directives which don't need a switch to some
section, other targets put switch_to_section (bss_section) at the start of
that macro.
pdp11 doesn't do that (and doesn't have bss_section), and so emits the
lcomm/comm variables in whatever section is current (it has only .text/.data
and for DEC assembler rodata).

The following patch fixes that by putting it always into data section, and
additionally avoids emitting an empty line in the assembly for the lcomm
vars.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR target/94134
* config/pdp11/pdp11.c (pdp11_asm_output_var): Call switch_to_section
at the start to switch to data section.  Don't print extra newline if
.globl directive has not been emitted.

* gcc.c-torture/execute/pr94134.c: New test.

4 years agoRISC-V: Fix testsuite regression due to recent IRA changes.
Kito Cheng [Wed, 11 Mar 2020 09:48:10 +0000 (17:48 +0800)]
RISC-V: Fix testsuite regression due to recent IRA changes.

After IRA changes, atomic version will use one more register, but
non-atomic still use 2 registers, however this testcase isn't testing for
atomic feature, so I decide change the testcase to always use COUNT++
to test.

ChangeLog

gcc/testsuite/

Kito Cheng  <kito.cheng@sifive.com>

* gcc.target/riscv/interrupt-2.c: Update testcase and expected output.

4 years agofold undefined pointer offsetting
Richard Biener [Wed, 11 Mar 2020 14:34:47 +0000 (15:34 +0100)]
fold undefined pointer offsetting

This avoids breaking the old broken pointer offsetting via
(T)(ptr - ((T)0)->x) which should have used offsetof.  Breakage
was exposed by the introduction of POINTER_DIFF_EXPR and making
PTA not considering that producing a pointer.  The mitigation
for simple cases is to canonicalize

  _2 = _1 - 8B;
  o_9 = (struct obj *) _2;

to

  o_9 = &MEM[_1 + -8B];

eliding one statement and the offending pointer subtraction.

2020-03-11  Richard Biener  <rguenther@suse.de>

* match.pd ((T *)(ptr - ptr-cst) -> &MEM[ptr + -ptr-cst]):
New pattern.

* gcc.dg/torture/20200311-1.c: New testcase.

4 years ago[testsuite] Add @ lines to check-function-bodies fluff
Matthew Malcomson [Wed, 11 Mar 2020 14:06:21 +0000 (14:06 +0000)]
[testsuite] Add @ lines to check-function-bodies fluff

When using `check-function-bodies`, the subroutine `parse_function_bodies` uses
the `fluff` regexp to remove uninteresting assembly lines.

Arm targets generate assembly with some lines prefixed by `@`, these lines are
left by this process.

As an example of some lines prefixed by `@': the assembly output from the
`stacktest1` function in "bfloat16_simd_3_1.c" is:

        .align  2
        .global stacktest1
        .arch armv8.2-a
        .syntax unified
        .arm
        .fpu neon-fp-armv8
        .type   stacktest1, %function
stacktest1:
        @ args = 0, pretend = 0, frame = 8
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        sub     sp, sp, #8
        add     r3, sp, #6
        vst1.16 {d0[0]}, [r3]
        vld1.16 {d0[0]}, [r3]
        add     sp, sp, #8
        @ sp needed
        bx      lr
        .size   stacktest1, .-stacktest1

It seems that previous uses of `check-function-bodies` in the arm backend have
avoided problems with such lines since they use the `...` regexp in each place
such fluff occurs.

I'm currently writing a patch that I'd like to match the entire function body,
so I'd like to remove such `@` lines automatically.

gcc/testsuite/ChangeLog:

2020-03-11  Matthew Malcomson  <matthew.malcomson@arm.com>

* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
counted as fluff.

4 years agoFix GIMPLE verification failure in LTO mode on Ada code
Eric Botcazou [Wed, 11 Mar 2020 10:29:39 +0000 (11:29 +0100)]
Fix GIMPLE verification failure in LTO mode on Ada code

The issue is that tree_is_indexable doesn't return the same result for
a FIELD_DECL with QUAL_UNION_TYPE and the QUAL_UNION_TYPE, resulting
in two instances of the QUAL_UNION_TYPE in the bytecode.  The result
for the type is the correct one (false, since it is variably modified)
while the result for the field is falsely true because:

  else if (TREE_CODE (t) == FIELD_DECL
           && lto_variably_modified_type_p (DECL_CONTEXT (t)))
    return false;

is not satisfied.  The reason for this is that the DECL_QUALIFIER of
fields of a QUAL_UNION_TYPE depends on a discriminant in Ada, which
means that the size of the type does too (CONTAINS_PLACEHOLDER_P),
which in turn means that it is reset to a mere PLACEHOLDER_EXPR by
free_lang_data, which finally means that the size of DECL_CONTEXT is
too, so RETURN_TRUE_IF_VAR is false.

In other words, the CONTAINS_PLACEHOLDER_P property of the DECL_QUALIFIER
of fields of a QUAL_UNION_TYPE hides the variably_modified_type_p property
of  these fields, if you look from the outside.

PR middle-end/93961
* tree.c (variably_modified_type_p) <RECORD_TYPE>: Recurse into
fields whose type is a qualified union.

4 years agoFix internal error on locally-defined subpools
Eric Botcazou [Wed, 11 Mar 2020 09:47:34 +0000 (10:47 +0100)]
Fix internal error on locally-defined subpools

If the type is derived in the current compilation unit, and Allocate
is not overridden on derivation (as is typically the case with
Root_Storage_Pool_With_Subpools), the entity for Allocate of the
derived type is an alias for System.Storage_Pools.Subpools.Allocate.

The main assertion in gnat_to_gnu_entity fails in this case, since
this is not a definition and Is_Public is false (since the entity
is nested in the same compilation unit).

2020-03-11  Richard Wai  <richard@annexi-strayline.com>

* gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
the Alias of the entitiy, if is present, in the main assertion.

4 years agoaarch64: Fix ICE in aarch64_add_offset_1 [PR94121]
Jakub Jelinek [Wed, 11 Mar 2020 09:54:22 +0000 (10:54 +0100)]
aarch64: Fix ICE in aarch64_add_offset_1 [PR94121]

abs_hwi asserts that the argument is not HOST_WIDE_INT_MIN and as the
(invalid) testcase shows, the function can be called with such an offset.
The following patch is IMHO minimal fix, absu_hwi unlike abs_hwi allows even
that value and will return (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN
in that case.  The function then uses moffset in two spots which wouldn't
care if the value is (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN or
HOST_WIDE_INT_MIN and wouldn't accept it (!moffset and
aarch64_uimm12_shift (moffset)), then in one spot where the signedness of
moffset does matter and using unsigned is the right thing -
moffset < 0x1000000 - and finally has code which will handle even this
value right; the assembler doesn't really care for DImode immediates if
        mov     x1, -9223372036854775808
or
        mov     x1, 9223372036854775808
is used and similarly it doesn't matter if we add or sub it in DImode.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR target/94121
* config/aarch64/aarch64.c (aarch64_add_offset_1): Use absu_hwi
instead of abs_hwi, change moffset type to unsigned HOST_WIDE_INT.

* gcc.dg/pr94121.c: New test.

4 years agovalue-prof: Fix abs uses in value-prof.c [PR93962]
Jakub Jelinek [Wed, 11 Mar 2020 08:34:59 +0000 (09:34 +0100)]
value-prof: Fix abs uses in value-prof.c [PR93962]

Jeff has recently fixed dump_histogram_value to use std::abs instead of abs,
because on FreeBSD apparently the ::abs isn't overloaded and only has
int abs (int);
Seems on Solaris /usr/include/iso/stdlib_iso.h abs has:
int abs (int);
long abs (long);
overloads but already not
long long abs (long long);
and there is another abs use in get_nth_most_common_value, also on int64_t.
The long long std::abs (long long); overload is there only in C++11 and we
in GCC10 still support C++98.

Martin has said that a counter should never be INT64_MIN, so IMHO it is
better to use abs_hwi which will assert that.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR bootstrap/93962
* value-prof.c (dump_histogram_value): Use abs_hwi instead of
std::abs.
(get_nth_most_common_value): Use abs_hwi instead of abs.

4 years agodfp: Fix decimal_to_binary [PR94111]
Jakub Jelinek [Wed, 11 Mar 2020 08:33:52 +0000 (09:33 +0100)]
dfp: Fix decimal_to_binary [PR94111]

As e.g. decimal_from_decnumber shows, the REAL_VALUE_TYPE representation
contains a decimal128 embedded in ->sig only if it is rvc_normal, for
other kinds like rvc_inf or rvc_nan, ->sig is ignored and everything is
contained in the REAL_VALUE_TYPE flags (cl, sign, signalling and decimal).
decimal_to_binary which is used when folding a decimal{32,64,128} constant
to a binary floating point type ignores this and thus folds infinities and
NaNs into +0.0.
The following patch fixes that by only doing that for rvc_normal.
Similarly to the binary to decimal folding, it goes through a string, in
order to e.g. deal with canonical NaN mantissas, or binary float formats
that don't support infinities and/or NaNs.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/94111
* dfp.c (decimal_to_binary): Only use decimal128ToString if from->cl
is rvc_normal, otherwise use real_to_decimal to print the number to
string.

* gcc.dg/dfp/pr94111.c: New test.

4 years agoldist: Further fixes for -ftrapv [PR94114]
Jakub Jelinek [Wed, 11 Mar 2020 08:32:22 +0000 (09:32 +0100)]
ldist: Further fixes for -ftrapv [PR94114]

As the testcase shows, arithmetics that for -ftrapv would need multiple
basic blocks can show up not just in nb_bytes expressions where we
are calling rewrite_to_non_trapping_overflow for a while already,
but also in the pointer expression to the start of the region.
While the testcase covers just the first hunk and I've failed to create
a testcase for the latter, it is at least in theory possible too, so I've
adjusted that hunk too.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94114
* tree-loop-distribution.c (generate_memset_builtin): Call
rewrite_to_non_trapping_overflow even on mem.
(generate_memcpy_builtin): Call rewrite_to_non_trapping_overflow even
on dest and src.

* gcc.dg/pr94114.c: New test.

4 years agolibstdc++: LWG 3286 ranges::size is not required to be valid after ...
Patrick Palka [Mon, 9 Mar 2020 16:10:16 +0000 (12:10 -0400)]
libstdc++: LWG 3286 ranges::size is not required to be valid after ...

... a call to ranges::begin on an input range.

This implements LWG 3286.  The new wording for the single-argument constructor
for subrange is implemented by splitting the constructor into two delegating
constructors, one constrained by _S_store_size and the other by !_S_store_size.

Tested on x86_64-pc-linux-gnu, both added tests fail before the patch and pass
with the patch.

libstdc++-v3/ChangeLog:

LWG 3286 ranges::size is not required to be valid after a call to
ranges::begin on an input range
* include/std/ranges (subrange::subrange): Split single-argument
constructor into two, one constrained by _S_store_size and another by
!_S_store_size.
(take_view::begin): Call size() before calling ranges::begin(_M_base).
* testsuite/std/ranges/adaptors/lwg3286.cc: New test.
* testsuite/std/ranges/subrange/lwg3286.cc: New test.

4 years agoFix length computation for movsi_insv which resulted in regressions due to out of...
Jeff Law [Wed, 11 Mar 2020 04:16:19 +0000 (22:16 -0600)]
Fix length computation for movsi_insv which resulted in regressions due to out of range branches on the bfin port.

* config/bfin/bfin.md (movsi_insv): Add length attribute.