1. 21 Sep, 2017 10 commits
    • Tighten tree-ssa-ccp.c:get_value_for_expr condition · 4a77e887
      bit_value_unop and bit_value_binop require constant values
      to be INTEGER_CSTs:
      
        gcc_assert ((rval.lattice_val == CONSTANT
                     && TREE_CODE (rval.value) == INTEGER_CST)
                    || wi::sext (rval.mask, TYPE_PRECISION (TREE_TYPE (rhs))) == -1);
      
      However, when deciding whether to record a constant value,
      the for_bits_p handling in get_value_for_expr used a negative
      test for ADDR_EXPR:
      
        else if (is_gimple_min_invariant (expr)
                 && (!for_bits_p || TREE_CODE (expr) != ADDR_EXPR))
      
      This patch uses a positive test for INTEGER_CST instead.
      
      Existing tests showed the need for this once polynomial constants
      are added.
      
      2017-09-21  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* tree-ssa-ccp.c (get_value_for_expr): Use a positive test for
      	INTEGER_CST rather than a negative test for ADDR_EXPR.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r253056
      Richard Sandiford committed
    • Tweak · dd72b5f9
      From-SVN: r253055
      Eric Botcazou committed
    • Add missing int_cst_rangeN checks to tree-vrp.c · 53cb6378
      The BIT_AND_EXPR handling in extract_range_from_binary_expr_1
      was using value_range_constant_singleton without first checking
      whether the range was a constant.  The earlier handling was correctly
      guarded:
      
      	  /* If either input range contains only non-negative values
      	     we can truncate the result range maximum to the respective
      	     maximum of the input range.  */
      	  if (int_cst_range0 && tree_int_cst_sgn (vr0.min) >= 0)
      	    wmax = wi::min (wmax, vr0.max, TYPE_SIGN (expr_type));
      	  if (int_cst_range1 && tree_int_cst_sgn (vr1.min) >= 0)
      	    wmax = wi::min (wmax, vr1.max, TYPE_SIGN (expr_type));
      
      so this patch uses the same guards again.
      
      Existing tests showed the need for this once polynomial constants
      are added.
      
      2017-09-21  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* tree-vrp.c (extract_range_from_binary_expr_1): Check
      	int_cst_rangeN before calling value_range_constant_singleton (&vrN).
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r253054
      Richard Sandiford committed
    • re PR tree-optimization/71351 (ICE: Segmentation fault (graphite)) · 2e1dd137
      2017-09-21  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/71351
      	* graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple::
      	graphite_create_new_loop_guard): Remove, fold remaining parts
      	into caller ...
      	(translate_isl_ast_node_for): ... here and simplify.
      
      	* gfortran.dg/graphite/pr71351.f90: New testcase.
      	* gfortran.dg/graphite/interchange-3.f90: Adjust.
      
      From-SVN: r253052
      Richard Biener committed
    • Fix tests for std::clamp · f3f08c3f
      	* testsuite/25_algorithms/clamp/1.cc: Fix order of arguments and
      	expected results when using predicate defining reverse order.
      	* testsuite/25_algorithms/clamp/constexpr.cc: Likewise.
      
      From-SVN: r253051
      Jonathan Wakely committed
    • re PR target/82260 ([x86] Unnecessary use of 8-bit registers with -Os. slightly… · a4f65ca8
      re PR target/82260 ([x86] Unnecessary use of 8-bit registers with -Os.  slightly slower and larger code)
      
      	PR target/82260
      	* config/i386/i386.md (*movqi_internal): Replace (=q,q) alternative
      	with (=Q,Q), (=R,R) and (=r,r) alternatives, only enable the
      	latter two for 64-bit, renumber alternatives, for -Os imov (=q,n)
      	alternative always use QI mode, for -Os imov (=R,R) alternative
      	always use SI mode, for imov (=Q,Q) or (=r,r) alternatives
      	ignore -Os.
      
      	* gcc.target/i386/pr82260-1.c: New test.
      	* gcc.target/i386/pr82260-2.c: New test.
      
      From-SVN: r253050
      Jakub Jelinek committed
    • s390.c (MIN_UNROLL_PROBES): Define. · d3347cd2
      	* config/s390/s390.c (MIN_UNROLL_PROBES): Define.
      	(allocate_stack_space): New function, partially extracted from
      	s390_emit_prologue.
      	(s390_emit_prologue): Track offset to most recent stack probe.
      	Code to allocate space moved into allocate_stack_space.
      	Dump actions when no stack is allocated.
      	(s390_prologue_plus_offset): New function.
      	(s390_emit_stack_probe): Likewise.
      
      	* gcc.dg/stack-check-5.c:  Add argument for s390.
      	* lib/target-supports.exp:
      	(check_effective_target_supports_stack_clash_protection): Enable for
      	s390/s390x targets.
      
      Co-Authored-By: Jeff Law <law@redhat.com>
      
      From-SVN: r253049
      Andreas Krebbel committed
    • [C++ PATCH] class member ordering · 12f71313
      https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01426.html
      	* name-lookup.c (member_name_cmp): Use DECL_UID for final
      	ordering.
      
      From-SVN: r253048
      Nathan Sidwell committed
    • enable handling of -gno- command-line options as negated prefixes · 9ed32e27
      This patch that adds -g to the set of negatable prefixes along with -f,
      -m and -W.  Besides the mapping from -gno- to negated -g in option_map
      and adding g to the [fmW] matches for negatable options, I had to
      introduce gno- as an remapping prefix, for the option searching
      machinery to backtrack to and recognize as a remapping prefix, instead
      of backtracking to -g and stopping at it as if no-* was its Joined
      argument.  Adding such remapping prefixes to preempt further
      backtracking can be accomplished by introducing the prefix as an
      Undocumented option with a Joined argument and without Driver, Target,
      Common, or any language-specific option.  Whenever we match such a fake
      options prefix, we abandon further backtracking (it matches, after all),
      but find_opt returns the same code it would if it hadn't found any
      match, so that we resort to option mapping.
      
      I've arranged for such remapping prefixes to not be considered when
      looking for and suggesting a correct spelling for misspelled options.
      While testing that, I found a few -W-started options that were not
      marked as RejectNegative but should (-Wno-a, is not something we'd like
      to suggest ;-)  I've also marked as such -g-started options that
      it makes no sense to negate, and removed the explicit -gno- ones,
      allowing their opposites to be negated.
      
      for  gcc/ChangeLog
      
      	* common.opt (Wa, Wl, Wp, g, gz=): Add
      	RejectNegative.
      	(gno-column-info): Remove.
      	(gcolumn-info): Drop RejectNegative.
      	(gno-): New prefix.
      	(gno-record-gcc-switches): Remove.
      	(grecord-gcc-switches): Drop RejectNegative.
      	(gno-split-dwarf): Remove.
      	(gsplit-dwarf): Drop RejectNegative.
      	(gno-strict-dwarf): Remove.
      	(gstrict-dwarf): Drop RejectNegative.
      	* config/darwin.opt (gfull, gused): Add RejectNegative.
      	* dwarf2out.c (gen_producer_string): Drop
      	gno-record-gcc-switches handler.
      	* optc-gen.awk: Add g to prefixes with negative forms.
      	* opts-common.c (remapping_prefix_p): New.
      	(find_opt): Check it.
      	(generate_canonical_option): Test g prefix.
      	(option_map): Add -gno- mapping.
      	(add_misspelling_candidates): Check remapping_prefix_p.
      
      for  gcc/ada/ChangeLog
      
      	* gcc-interface/lang.opt (gant, gnatO, gnat): Add
              RejectNegative.
      
      for  gcc/c-family/ChangeLog
      
      	* c.opt (gen-decls): Add RejectNegative.
      
      From-SVN: r253047
      Alexandre Oliva committed
    • Daily bump. · d8a61466
      From-SVN: r253046
      GCC Administrator committed
  2. 20 Sep, 2017 30 commits