1. 10 Jul, 2018 8 commits
  2. 09 Jul, 2018 10 commits
    • PR middle-end/77357 - strlen of constant strings not folded · 35b4d3a6
      gcc/ChangeLog:
      
      	PR middle-end/77357
      	PR middle-end/86428
      	* builtins.c (c_strlen): Avoid out-of-bounds warnings when
      	accessing implicitly initialized array elements.
      	* expr.c (string_constant): Handle string initializers of
      	character arrays within aggregates.
      	* gimple-fold.c (fold_array_ctor_reference): Add argument.
      	Store element offset.  As a special case, handle zero size.
      	(fold_nonarray_ctor_reference): Same.
      	(fold_ctor_reference): Add argument.  Store subobject offset.
      	* gimple-fold.h (fold_ctor_reference): Add argument.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/77357
      	* gcc.dg/strlenopt-49.c: New test.
      	* gcc.dg/strlenopt-50.c: New test.
      	* gcc.dg/strlenopt-51.c: New test.
      	* gcc.dg/strlenopt-52.c: New test.
      
      From-SVN: r262522
      Martin Sebor committed
    • Improve code generation for pdp11 target. · aad2444d
      	* config/pdp11/pdp11.c (pdp11_addr_cost): New function.
      	(pdp11_insn_cost): New function.
      	(pdp11_md_asm_adjust): New function.
      	(TARGET_INVALID_WITHIN_DOLOOP): Define.
      	(pdp11_rtx_costs): Update to match machine better.
      	(output_addr_const_pdp11): Correct format mismatch warnings.
      	* config/pdp11/pdp11.h (SLOW_BYTE_ACCESS): Correct definition.
      	* config/pdp11/pdp11.md: General change to add base_cost and/or
      	length attributes for use by new pdp11_insn_cost function.
      	(MIN_BRANCH): Correct definition.
      	(MIN_SOB): Ditto.
      	(doloop_end): Use standard pattern name for looping pattern.
      	(doloop_end_nocc): New.
      	(movsf): Add another constraint alternative.
      	(zero_extendqihi2): Add constraint alternatives for not in place
      	extend.
      	(zero_extendhisi2): Remove.
      	(shift patterns): Add CC handling variants.
      	(bswaphi2): New.
      	(bswapsi2): New.
      	(rothi3): New.
      	(define_peephole2): New peephole to recognize mov that sets CC for
      	subsequent test.
      
      From-SVN: r262519
      Paul Koning committed
    • Fix overflow handling in sparc.c:sparc_fold_builtin · c36c567c
      	* config/sparc/sparc.c (sparc_fold_builtin) <SPARC_BUILTIN_PDIST,
      	SPARC_BUILTIN_PDISTN>: Adapt for signature change of wi::neg,
      	wi::add.
      
      From-SVN: r262518
      Rainer Orth committed
    • re PR c/86420 (nextafter(0x1p-1022,0) is constant folded) · 56d04c75
      	PR c/86420
      	* real.c (real_nextafter): Return true if result is denormal.
      
      	* gcc.dg/nextafter-1.c (TEST): Adjust the tests that expect denormals
      	to be returned and when first argument is not 0, so that they don't do
      	anything for NEED_EXC or NEED_ERRNO.
      
      From-SVN: r262517
      Jakub Jelinek committed
    • [testsuite] Use relative line numbers in gcc.dg/guality · eccba1ac
      Use relative line number where obvious: either the relative line number is
      '.', '.-1' or '.+1', or adjacent to another obvious case.
      
      2018-07-09  Tom de Vries  <tdevries@suse.de>
      
      	* gcc.dg/guality/asm-1.c: Use relative line numbers where obvious.
      	* gcc.dg/guality/bswaptest.c: Same.
      	* gcc.dg/guality/clztest.c: Same.
      	* gcc.dg/guality/csttest.c: Same.
      	* gcc.dg/guality/ctztest.c: Same.
      	* gcc.dg/guality/drap.c: Same.
      	* gcc.dg/guality/nrv-1.c: Same.
      	* gcc.dg/guality/pr41353-1.c: Same.
      	* gcc.dg/guality/pr41353-2.c: Same.
      	* gcc.dg/guality/pr41404-1.c: Same.
      	* gcc.dg/guality/pr43051-1.c: Same.
      	* gcc.dg/guality/pr43077-1.c: Same.
      	* gcc.dg/guality/pr43177.c: Same.
      	* gcc.dg/guality/pr43329-1.c: Same.
      	* gcc.dg/guality/pr43479.c: Same.
      	* gcc.dg/guality/pr43593.c: Same.
      	* gcc.dg/guality/pr45003-1.c: Same.
      	* gcc.dg/guality/pr45003-2.c: Same.
      	* gcc.dg/guality/pr45003-3.c: Same.
      	* gcc.dg/guality/pr48437.c: Same.
      	* gcc.dg/guality/pr48466.c: Same.
      	* gcc.dg/guality/pr49888.c: Same.
      	* gcc.dg/guality/pr54200.c: Same.
      	* gcc.dg/guality/pr54519-1.c: Same.
      	* gcc.dg/guality/pr54519-2.c: Same.
      	* gcc.dg/guality/pr54519-3.c: Same.
      	* gcc.dg/guality/pr54519-4.c: Same.
      	* gcc.dg/guality/pr54519-5.c: Same.
      	* gcc.dg/guality/pr54519-6.c: Same.
      	* gcc.dg/guality/pr54551.c: Same.
      	* gcc.dg/guality/pr54693-2.c: Same.
      	* gcc.dg/guality/pr54693.c: Same.
      	* gcc.dg/guality/pr54796.c: Same.
      	* gcc.dg/guality/pr54970.c: Same.
      	* gcc.dg/guality/pr67192.c: Same.
      	* gcc.dg/guality/pr69947.c: Same.
      	* gcc.dg/guality/pr78726.c: Same.
      	* gcc.dg/guality/rotatetest.c: Same.
      	* gcc.dg/guality/sra-1.c: Same.
      	* gcc.dg/guality/vla-2.c: Same.
      
      From-SVN: r262516
      Tom de Vries committed
    • Add missing Optimization attribute. · 8956e247
      2018-07-09  Martin Liska  <mliska@suse.cz>
      
      	* common.opt: Add back wrongly removed attribute.
      
      From-SVN: r262513
      Martin Liska committed
    • decl.c (grokdeclarator): Use rich_location::add_range in three more places;… · 7b3bc054
      decl.c (grokdeclarator): Use rich_location::add_range in three more places; include gcc-rich-location.h.
      
      /cp
      2018-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (grokdeclarator): Use rich_location::add_range in three
      	more places; include gcc-rich-location.h.
      
      /testsuite
      2018-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/diagnostic/long-short.C: New.
      	* g++.dg/diagnostic/signed-unsigned.C: Likewise.
      	* g++.dg/diagnostic/virtual-friend.C: Likewise.
      	* g++.old-deja/g++.brendan/crash11.C: Adjust.
      
      From-SVN: r262512
      Paolo Carlini committed
    • re PR debug/86413 (gcc.dg/guality/pr48437.c fail) · 1dc9cf5d
      2018-07-09  Richard Biener  <rguenther@suse.de>
      
      	PR debug/86413
      	* dwarf2out.c (gen_block_die): For an early generated DIE
      	always output high/low PC attributes.
      
      From-SVN: r262511
      Richard Biener committed
    • [debug] Handle debug references to skipped params · 74725f46
      When compiling guality/vla-1.c with -O3 -g, vla a in f1 is optimized away, but
      f1 still contains a debug expression describing the upper bound of the vla
      (D.1914):
      ...
           __attribute__((noinline))
           f1 (intD.6 iD.1900)
           {
             <bb 2>
             saved_stack.1_2 = __builtin_stack_save ();
             # DEBUG BEGIN_STMT
             # DEBUG D#3 => i_1(D) + 1
             # DEBUG D#2 => (long intD.8) D#3
             # DEBUG D#1 => D#2 + -1
             # DEBUG D.1914 => (sizetype) D#1
      ...
      
      Then f1 is cloned to a version f1.constprop with no parameters, eliminating
      parameter i, and 'DEBUG D#3 => i_1(D) + 1' turns into 'D#3 => NULL'.
      
      This patch fixes that by defining debug expressions for default defs of
      eliminated parameters in remap_ssa_name:
      ...
           __attribute__((noinline))
           f1.constprop ()
           {
             intD.6 iD.1949;
      
             <bb 3>
             # DEBUG D#8 s=> iD.1900
             # DEBUG iD.1949 => D#8
      
             <bb 2>
      +      # DEBUG D#6 s=> iD.1949
             saved_stack.1_1 = __builtin_stack_save ();
             # DEBUG BEGIN_STMT
      -      # DEBUG D#3 => NULL
      +      # DEBUG D#3 => D#6 + 1
             # DEBUG D#2 => (long intD.8) D#3
             # DEBUG D#1 => D#2 + -1
             # DEBUG D.1951 => (sizetype) D#1
      ...
      
      Bootstrapped and reg-tested on x86_64.
      
      2018-07-09  Tom de Vries  <tdevries@suse.de>
      
      	* cfgexpand.c (expand_debug_source_expr): Handle VAR_DECL.
      	* tree-inline.c (remap_ssa_name): Handle default def ssa_name mapping
      	onto VAR_DECL with abstract origin.
      
      	* gcc.dg/vla-1.c: New test.
      
      From-SVN: r262510
      Tom de Vries committed
    • Daily bump. · d2c8944b
      From-SVN: r262509
      GCC Administrator committed
  3. 08 Jul, 2018 1 commit
  4. 07 Jul, 2018 10 commits
    • RISC-V: Finish Ada port. · 11fcb8f2
      	gcc/
      	* config/riscv/riscv.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): New.
      
      From-SVN: r262501
      Jim Wilson committed
    • Fix sigsegv on -fdump-tree-all-enumerate_locals · bb120fb0
      2018-07-07  Tom de Vries  <tdevries@suse.de>
      
      	* tree-dfa.c (dump_enumerated_decls): Handle cfun->cfg == NULL.
      
      	* gcc.misc-tests/options.exp (check_for_all_options): Clean up dump
      	files.
      	(get_dump_flags): New proc.
      	(toplevel): Test all dump flags.
      
      From-SVN: r262500
      Tom de Vries committed
    • c-ada-spec.c (to_ada_name): Remove index parameter. · e730a0ef
      	* c-ada-spec.c (to_ada_name): Remove index parameter.
      	(pp_ada_tree_identifier): Likewise.
      	(dump_ada_macros): Adjust call to to_ada_name.
      	(struct overloaded_name_hash): Delete.
      	(struct overloaded_name_hasher): Likewise.
      	(overloaded_names): Likewise.
      	(compute_overloading_index): Likewise.
      	(dump_ada_decl_name): Do not call compute_overloading_index and
      	adjust calls to pp_ada_tree_identifier.
      	(dump_ada_double_name): Adjust calls to pp_ada_tree_identifier.
      	(dump_ada_import): Add spc parameter and switch to aspect syntax.
      	(dump_ada_function_declaration): Adjust call to pp_ada_tree_identifier.
      	(dump_ada_enum_type): Remove type and display_convention parameters.
      	Adjust calls to pp_ada_tree_identifier.
      	(dump_ada_node): Likewise and for dump_ada_structure.
      	(dump_nested_type) <ENUMERAL_TYPE>: Adjust call to dump_ada_enum_type
      	and tidy up.
      	<RECORD_TYPE>: Adjust call to dump_ada_structure and switch to aspect
      	syntax.
      	(print_constructor): Adjust call to pp_ada_tree_identifier.
      	(print_destructor): Likewise.
      	(dump_ada_declaration): Switch to aspect syntax.
      	(dump_ada_structure): Likewise and tidy up.  Replace display_convention
      	parameter with nested parameter.
      	(dump_ads): Emit pragma Ada_2012 in lieu of pragma Ada_2005.
      	(dump_ada_specs): Do not delete overloaded_names table.
      
      From-SVN: r262499
      Eric Botcazou committed
    • decl.c (gnat_to_gnu_entity): Add GNAT_DECL local variable and use it throughout. · 87668878
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Add GNAT_DECL local
      	variable and use it throughout.
      	<E_Variable>: If the nominal subtype of the object is unconstrained,
      	compute the Ada size separately and put in on the padding type if the
      	size is not fixed.
      	<E_Record_Type>: Minor tweak.
      	* gcc-interface/misc.c (gnat_type_max_size): Rename max_size_unit
      	into max_size_unit throughout.
      
      From-SVN: r262498
      Eric Botcazou committed
    • gigi.h (add_decl_expr): Adjust prototype. · 56b8aa0c
      	* gcc-interface/gigi.h (add_decl_expr): Adjust prototype.
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Remove useless test.
      	* gcc-interface/trans.c (add_stmt_with_node): Remove exceptions.
      	(add_decl_expr): Change type of second parameter and rename it.
      	(renaming_from_instantiation_p): New function moved from...
      	(set_expr_location_from_node): Test for exceptions here and add one
      	for actual subtypes built for unconstrained composite actuals.
      	* gcc-interface/utils.c (renaming_from_instantiation_p): ...here.
      
      From-SVN: r262497
      Eric Botcazou committed
    • trans.c (lvalue_required_p): Remove ALIASED parameter and adjust recursive calls. · 86da71db
      	* gcc-interface/trans.c (lvalue_required_p): Remove ALIASED parameter
      	and adjust recursive calls.
      	(Identifier_to_gnu): Adjust calls to lvalue_required_p.
      	(gnat_to_gnu): Likewise.
      
      From-SVN: r262496
      Eric Botcazou committed
    • decl.c (gnat_to_gnu_param): Minor tweak. · 71836434
      	* gcc-interface/decl.c (gnat_to_gnu_param): Minor tweak.
      	(gnat_to_gnu_subprog_type): New pure_flag local variable.  Set it for
      	a pure Ada function with a by-ref In parameter.  Propagate it onto the
      	function type by means of the TYPE_QUAL_RESTRICT flag.
      	* gcc-interface/utils.c (finish_subprog_decl): Set DECL_PURE_P if the
      	function type has the TYPE_QUAL_RESTRICT flag set.
      
      From-SVN: r262495
      Eric Botcazou committed
    • tree-vrp.c (vrp_int_const_binop): Change overflow type to overflow_type. · 4a669ac3
      	* tree-vrp.c (vrp_int_const_binop): Change overflow type to
      	overflow_type.
      	(combine_bound): Use wide-int overflow calculation instead of
      	rolling our own.
      	* calls.c (maybe_warn_alloc_args_overflow): Change overflow type to
      	overflow_type.
      	* fold-const.c (int_const_binop_2): Same.
      	(extract_muldiv_1): Same.
      	(fold_div_compare): Same.
      	(fold_abs_const): Same.
      	* match.pd: Same.
      	* poly-int.h (add): Same.
      	(sub): Same.
      	(neg): Same.
      	(mul): Same.
      	* predict.c (predict_iv_comparison): Same.
      	* profile-count.c (slow_safe_scale_64bit): Same.
      	* simplify-rtx.c (simplify_const_binary_operation): Same.
      	* tree-chrec.c (tree_fold_binomial): Same.
      	* tree-data-ref.c (split_constant_offset_1): Same.
      	* tree-if-conv.c (idx_within_array_bound): Same.
      	* tree-scalar-evolution.c (iv_can_overflow_p): Same.
      	* tree-ssa-phiopt.c (minmax_replacement): Same.
      	* tree-vect-loop.c (is_nonwrapping_integer_induction): Same.
      	* tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Same.
      	* vr-values.c (vr_values::adjust_range_with_scev): Same.
      	* wide-int.cc (wi::add_large): Same.
      	(wi::mul_internal): Same.
      	(wi::sub_large): Same.
      	(wi::divmod_internal): Same.
      	* wide-int.h: Change overflow type to overflow_type for neg, add,
      	mul, smul, umul, div_trunc, div_floor, div_ceil, div_round,
      	mod_trunc, mod_ceil, mod_round, add_large, sub_large,
      	mul_internal, divmod_internal.
      	(overflow_type): New enum.
      	(accumulate_overflow): New.
      
      cp/
      	* decl.c (build_enumerator): Change overflow type to overflow_type.
      	* init.c (build_new_1): Same.
      
      From-SVN: r262494
      Aldy Hernandez committed
    • re PR target/84711 (AArch32 big-endian fails when taking subreg of a vector mode to a scalar mode.) · 962b3564
      	PR target/84711
      	* gcc.dg/vect/pr84711.c: Remove unnecessary sse
      	dg-require-effective-target.  Add -msse not just on i386-*, but
      	on all i?86-* and x86_64-*.
      
      From-SVN: r262493
      Jakub Jelinek committed
    • Daily bump. · 2482ed77
      From-SVN: r262492
      GCC Administrator committed
  5. 06 Jul, 2018 11 commits
    • tree-ssa-phiopt.c (cond_removal_in_popcount_pattern): New. · 58f12ec1
      gcc/ChangeLog:
      
      2018-07-06  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
      
      	* tree-ssa-phiopt.c (cond_removal_in_popcount_pattern): New.
      	(tree_ssa_phiopt_worker): Call cond_removal_in_popcount_pattern.
      
      gcc/testsuite/ChangeLog:
      
      2018-07-06  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
      
      	* gcc.dg/tree-ssa/phi-opt-16.c: New test.
      	* gcc.dg/tree-ssa/phi-opt-17.c: New test.
      	* gcc.dg/tree-ssa/phi-opt-18.c: New test.
      	* gcc.dg/tree-ssa/phi-opt-19.c: New test.
      	* gcc.dg/tree-ssa/popcount3.c: New test.
      
      From-SVN: r262488
      Kugan Vivekanandarajah committed
    • tree-ssa-loop-niter.c (number_of_iterations_popcount): If popcount argument is… · b8b31957
      tree-ssa-loop-niter.c (number_of_iterations_popcount): If popcount argument is checked for zero before entering loop, avoid checking again.
      
      gcc/ChangeLog:
      
      2018-07-06  Kugan Vivekanandarajah  <kuganv@linaro.org>
      
      	* tree-ssa-loop-niter.c (number_of_iterations_popcount): If popcount
      	argument is checked for zero before entering loop, avoid checking again.
      
      From-SVN: r262487
      Kugan Vivekanandarajah committed
    • gimplify.h (generic_expr_could_trap_p): Set as global function. · 3f6f3319
      gcc/ChangeLog:
      
      2018-07-06  Kugan Vivekanandarajah  <kuganv@linaro.org>
      
      	* gimplify.h (generic_expr_could_trap_p): Set as global function.
      	* gimplify.h (generic_expr_could_trap_p): Likwise.
      	* tree-scalar-evolution.c (expression_expensive_p): Handle COND_EXPR.
      
      gcc/testsuite/ChangeLog:
      
      2018-07-06  Kugan Vivekanandarajah  <kuganv@linaro.org>
      
      	* gcc.dg/tree-ssa/pr64183.c: Disable final value replacement
      	to preserve the test.
      	* gcc.target/i386/pr85073.c: Likewise.
      
      From-SVN: r262486
      Kugan Vivekanandarajah committed
    • re PR tree-optimization/86401 (The "For constants M and N, if M == (1LL << cst)… · f2901002
      re PR tree-optimization/86401 (The "For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,..." opts are only in fold-const.c and in RTL)
      
      	PR tree-optimization/86401
      	* fold-const.c (fold_binary_loc) <case BIT_AND_EXPR>: Move the
      	((A & N) + B) & M -> (A + B) & M etc. optimization into ...
      	(fold_bit_and_mask): ... here.  New helper function for match.pd.
      	* fold-const.h (fold_bit_and_mask): Declare.
      	* match.pd (((A & N) + B) & M -> (A + B) & M): New optimization.
      
      	* gcc.dg/tree-ssa/pr86401-1.c: New test.
      	* gcc.dg/tree-ssa/pr86401-2.c: New test.
      	* c-c++-common/rotate-9.c: New test.
      
      From-SVN: r262485
      Jakub Jelinek committed
    • re PR target/86324 (testsuite test divkc3-1.c FAILs when compiling with -mabi=ieeelongdouble) · 8de583fc
      gcc/
      	PR target/86324
      	* target.def (translate_mode_attribute): New hook.
      	* targhooks.h (default_translate_mode_attribute): Declare.
      	* targhooks.c (default_translate_mode_attribute): New function.
      	* doc/tm.texi.in (TARGET_TRANSLATE_MODE_ATTRIBUTE): New hook.
      	* doc/tm.texi: Regenerate.
      	* config/rs6000/rs6000.c (TARGET_TRANSLATE_MODE_ATTRIBUTE): Define.
      	(rs6000_translate_mode_attribute): New function.
      
      gcc/c-family/
      	PR target/86324
      	* c-attribs.c (handle_mode_attribute): Call new translate_mode_attribute
      	target hook.
      
      gcc/testsuite/
      	PR target/86324
      	gcc.target/powerpc/pr86324-1.c: New test.
      	gcc.target/powerpc/pr86324-2.c: Likewise.
      
      From-SVN: r262484
      Peter Bergner committed
    • RISC-V: Initial riscv linux Ada port. · 7cf2b955
      	* Makefile.rtl: Add riscv*-linux* support.
      	* libgnarl/s-linux__riscv.ads: New.
      	* libgnat/system-linux-riscv.ads: New.
      
      From-SVN: r262482
      Jim Wilson committed
    • Makefile patches from initial RISC-V cross/native build. · 6cd6119c
      	* Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
      	(einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
      	* gcc-interface/Makefile.in (xoscons): Likewise.
      
      From-SVN: r262481
      Jim Wilson committed
    • functions.h (__gnu_debug::__check_string): Move... · 1e736a95
      2018-07-06  François Dumont  <fdumont@gcc.gnu.org>
      
      	* include/debug/functions.h (__gnu_debug::__check_string): Move...
      	* include/debug/string (__gnu_debug::__check_string): ... here.
      	(_GLIBCXX_DEBUG_VERIFY_STR_COND_AT): New.
      	(__glibcxx_check_string_n_constructor): New.
      	(__gnu_debug::basic_string<>(const _CharT*, size_type, const _Alloc&)):
      	Use latter.
      	(__glibcxx_check_string_constructor): New.
      	(__gnu_debug::basic_string<>(const _CharT*, const _Alloc&)):
      	Use latter.
      	* testsuite/21_strings/basic_string/debug/1_neg.cc: New.
      	* testsuite/21_strings/basic_string/debug/2_neg.cc: New.
      
      From-SVN: r262480
      François Dumont committed
    • Update internal documentation to describe that DONE and FAIL · 582d1f90
      	also apply to define_split and define_peephole2.
      
      	* doc/md.texi (define_split): Document DONE and FAIL.
      	(define_peephole2): Ditto.
      
      From-SVN: r262479
      Paul Koning committed
    • PR libstdc++/84928 use std::move in <numeric> algorithms · 5840e3b8
      P0616R0 altered the effects of the <numeric> algorithms to use std::move
      on the accumulator values (resolving LWG 2055). This implements the
      change for C++2a, but retains the previous behaviour for older
      standards.
      
      	* include/bits/stl_numeric.h (_GLIBCXX_MOVE_IF_20): Define macro to
      	conditionally move, according to __cplusplus value.
      	(accumulate, inner_product, partial_sum, adjacent_difference): Use
      	_GLIBCXX_MOVE_IF_20.
      	* testsuite/26_numerics/accumulate/lwg2055.cc: New test.
      	* testsuite/26_numerics/adjacent_difference/lwg2055.cc: New test.
      	* testsuite/26_numerics/inner_product/lwg2055.cc: New test.
      	* testsuite/26_numerics/partial_sum/lwg2055.cc: New test.
      
      From-SVN: r262477
      Jonathan Wakely committed
    • Simplify linker script patterns for std::exception_ptr · f1b3168d
      	* config/abi/pre/gnu.ver: Use wildcards to combine related patterns.
      
      From-SVN: r262475
      Jonathan Wakely committed