1. 14 Dec, 2017 1 commit
    • poly_int: add poly-int.h · e535b963
      This patch adds a new "poly_int" class to represent polynomial integers
      of the form:
      
        C0 + C1*X1 + C2*X2 ... + Cn*Xn
      
      It also adds poly_int-based typedefs for offsets and sizes of various
      precisions.  In these typedefs, the Ci coefficients are compile-time
      constants and the Xi indeterminates are run-time invariants.  The number
      of coefficients is controlled by the target and is initially 1 for all
      ports.
      
      Most routines can handle general coefficient counts, but for now a few
      are specific to one or two coefficients.  Support for other coefficient
      counts can be added when needed.
      
      The patch also adds a new macro, IN_TARGET_CODE, that can be
      set to indicate that a TU contains target-specific rather than
      target-independent code.  When this macro is set and the number of
      coefficients is 1, the poly-int.h classes define a conversion operator
      to a constant.  This allows most existing target code to work without
      modification.  The main exceptions are:
      
      - values passed through ..., which need an explicit conversion to a
        constant
      
      - ?: expression in which one arm ends up being a polynomial and the
        other remains a constant.  In these cases it would be valid to convert
        the constant to a polynomial and the polynomial to a constant, so a
        cast is needed to break the ambiguity.
      
      The patch also adds a new target hook to return the estimated
      value of a polynomial for costing purposes.
      
      The patch also adds operator<< on wide_ints (it was already defined
      for offset_int and widest_int).  I think this was originally excluded
      because >> is ambiguous for wide_int, but << is useful for converting
      bytes to bits, etc., so is worth defining on its own.  The patch also
      adds operator% and operator/ for offset_int and widest_int, since those
      types are always signed.  These changes allow the poly_int interface to
      be more predictable.
      
      I'd originally tried adding the tests as selftests, but that ended up
      bloating cc1 by at least a third.  It also took a while to build them
      at -O2.  The patch therefore uses plugin tests instead, where we can
      force the tests to be built at -O0.  They still run in negligible time
      when built that way.
      
      2017-12-14  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* poly-int.h: New file.
      	* poly-int-types.h: Likewise.
      	* coretypes.h: Include them.
      	(POLY_INT_CONVERSION): Define.
      	* target.def (estimated_poly_value): New hook.
      	* doc/tm.texi.in (TARGET_ESTIMATED_POLY_VALUE): New hook.
      	* doc/tm.texi: Regenerate.
      	* doc/poly-int.texi: New file.
      	* doc/gccint.texi: Include it.
      	* doc/rtl.texi: Describe restrictions on subreg modes.
      	* Makefile.in (TEXI_GCCINT_FILES): Add poly-int.texi.
      	* genmodes.c (NUM_POLY_INT_COEFFS): Provide a default definition.
      	(emit_insn_modes_h): Emit a definition of NUM_POLY_INT_COEFFS.
      	* targhooks.h (default_estimated_poly_value): Declare.
      	* targhooks.c (default_estimated_poly_value): New function.
      	* target.h (estimated_poly_value): Likewise.
      	* wide-int.h (WI_UNARY_RESULT): Use wi::binary_traits.
      	(wi::unary_traits): Delete.
      	(wi::binary_traits::signed_shift_result_type): Define for
      	offset_int << HOST_WIDE_INT, etc.
      	(generic_wide_int::operator <<=): Define for all types and use
      	wi::lshift instead of <<.
      	(wi::hwi_with_prec): Add a default constructor.
      	(wi::ints_for): New class.
      	(operator <<): Define for all wide-int types.
      	(operator /): New function.
      	(operator %): Likewise.
      	* selftest.h (ASSERT_KNOWN_EQ, ASSERT_KNOWN_EQ_AT, ASSERT_MAYBE_NE)
      	(ASSERT_MAYBE_NE_AT): New macros.
      
      gcc/testsuite/
      	* gcc.dg/plugin/poly-int-tests.h,
      	gcc.dg/plugin/poly-int-test-1.c,
      	gcc.dg/plugin/poly-int-01_plugin.c,
      	gcc.dg/plugin/poly-int-02_plugin.c,
      	gcc.dg/plugin/poly-int-03_plugin.c,
      	gcc.dg/plugin/poly-int-04_plugin.c,
      	gcc.dg/plugin/poly-int-05_plugin.c,
      	gcc.dg/plugin/poly-int-06_plugin.c,
      	gcc.dg/plugin/poly-int-07_plugin.c: New tests.
      	* gcc.dg/plugin/plugin.exp: Run them.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r255617
      Richard Sandiford committed
  2. 13 Dec, 2017 16 commits
  3. 12 Dec, 2017 23 commits
    • re PR tree-optimization/83298 (wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu) · df80fc53
      	PR tree-optimization/83298
      	PR tree-optimization/83362
      	PR tree-optimization/83383
      	* gimple-ssa-evrp-analyze.h (class evrp_range_analyzer): Make
      	push_value_range a public interface.  Add new argument to
      	record_ranges_from_stmt.
      	* gimple-ssa-evrp-analyze.c
      	(evrp_range_analyzer::record_ranges_from_stmt): Add new argument.
      	Update comments.  Handle recording temporary equivalences.
      	* tree-ssa-dom.c (dom_opt_opt_walker::before_dom_children): Add
      	new argument to call to evrp_range_analyzer::record_ranges_from_stmt.
      	* gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Likewise.
      	* tree-ssa-threadedge.c: Include alloc-pool.h, vr-values.h and
      	gimple-ssa-evrp-analyze.h.
      	(record_temporary_equivalences_from_phis): Add new argument.  When
      	the PHI arg is an SSA_NAME, set the result's range to the range
      	of the PHI arg.
      	(record_temporary_equivalences_from_stmts_at_dest): Record ranges
      	from statements too.
      	(thread_through_normal_block): Accept new argument, evrp_range_analyzer.
      	Pass it down to children as needed.
      	(thread_outgoing_edges): Likewise.
      	(thread_across_edge): Likewise.   Push/pop range state as needed.
      	* tree-ssa-threadedge.h (thread_outgoing_edges): Update prototype.
      
      	PR tree-optimization/83298
      	PR tree-optimization/83362
      	PR tree-optimization/83383
      	* gcc.c-torture/execute/pr83298.c: New test.
      	* gcc.c-torture/execute/pr83362.c New test.
      	* gcc.c-torture/execute/pr83383.c New test.
      
      From-SVN: r255593
      Jeff Law committed
    • re PR target/82190 (Possibly latent miscompilation issue on ppc64le-linux-gnu… · 708eab9b
      re PR target/82190 (Possibly latent miscompilation issue on ppc64le-linux-gnu for memcpy-bi.c with -fweb -fno-optimize-strlen)
      
      2017-12-12  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
      
      	PR target/82190
      	* config/rs6000/rs6000-string.c (expand_block_compare,
      	expand_strn_compare): Fix set_mem_size() calls.
      
      From-SVN: r255592
      Aaron Sawdey committed
    • Remove type_dependent_init_p. · 48f43f95
      	* decl.c (value_dependent_init_p): Check the type of a CONSTRUCTOR.
      	(type_dependent_init_p): Remove.
      
      From-SVN: r255591
      Jason Merrill committed
    • PR c++/82115 - ICE with variable initialized with its own address. · 5eb63cfd
      	* cp-tree.h (struct lang_decl_base): Add dependent_init_p.
      	(DECL_DEPENDENT_INIT_P, SET_DECL_DEPENDENT_INIT_P): New.
      	* decl.c (cp_finish_decl): Set it.
      	(duplicate_decls): Copy it.
      	* pt.c (tsubst_decl): Clear it.
      	(value_dependent_expression_p): Revert earlier change.  Check it.
      
      From-SVN: r255590
      Jason Merrill committed
    • i386.c (PTA_SKYLAKE_AVX512): Add PTA_CLWB. · 331e2db3
      	* config/i386/i386.c (PTA_SKYLAKE_AVX512): Add PTA_CLWB.
      	(PTA_CANNONLAKE): Remove PTA_CLWB.
      
      From-SVN: r255589
      Uros Bizjak committed
    • re PR target/83332 (new test case gfortran.dg/vect/pr81303.f fails (r255499)) · 95e5bea0
      2017-12-12  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
      
      	PR target/83332
      	* config/rs6000/vector.md (vcondv2dfv2di): New define_expand.
      	(vcondv2div2df): Likewise.
      	(vconduv2dfv2di): Likewise.
      
      From-SVN: r255588
      Bill Schmidt committed
    • intrinsic.texi (MAXLOC): Remove double description of return value. · 8eedea2c
      2017-12-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	* intrinsic.texi (MAXLOC): Remove double description
      	of return value.
      	(MINLOC): Likewise.
      
      From-SVN: r255587
      Thomas Koenig committed
    • builtins.def (BUILT_IN_NEXTAFTER, [...]): Use ATTR_MATHFN_ERRNO instead of… · be194538
      builtins.def (BUILT_IN_NEXTAFTER, [...]): Use ATTR_MATHFN_ERRNO instead of ATTR_MATHFN_FPROUNDING_ERRNO.
      
      	* builtins.def (BUILT_IN_NEXTAFTER, BUILT_IN_NEXTAFTERF,
      	BUILT_IN_NEXTAFTERL, BUILT_IN_NEXTTOWARD, BUILT_IN_NEXTTOWARDF,
      	BUILT_IN_NEXTTOWARDL): Use ATTR_MATHFN_ERRNO instead of
      	ATTR_MATHFN_FPROUNDING_ERRNO.
      
      From-SVN: r255586
      Jakub Jelinek committed
    • PR libstdc++/83395 fix invocable traits for INVOKE<cv void> · 91d01b33
      	PR libstdc++/83395
      	* include/std/type_traits (__is_invocable_impl): Remove partial
      	specialization for INVOKE<void> and restore is_void<R> check in
      	primary template.
      	(__is_nt_invocable_impl): Likewise.
      	* testsuite/20_util/is_invocable/83395.cc: New test.
      	* testsuite/20_util/is_nothrow_invocable/83395.cc: New test.
      
      From-SVN: r255584
      Jonathan Wakely committed
    • Updated email in MAINTAINERS file. · 71b2d137
      From-SVN: r255583
      Steven Munroe committed
    • go-lang.c (TARGET_AIX): Define if not defined. · acdef7f8
      	* go-lang.c (TARGET_AIX): Define if not defined.
      	(go_langhook_init): Set nil_check_size_threshold to -1 on AIX.
      
      Co-Authored-By: Ian Lance Taylor <iant@golang.org>
      
      From-SVN: r255582
      Tony Reix committed
    • configure.ac: Remove logic adding gdb to noconfigsdirs for or1k. · 842df93e
      2017-12-12  Stafford Horne  <shorne@gmail.com>
      
      	* configure.ac: Remove logic adding gdb to noconfigsdirs for or1k.
      	* configure: Regenerate.
      
      From-SVN: r255581
      Stafford Horne committed
    • Fix g++.old-deja/g++.pt/const2.C on Solaris · 2f1392ae
      	* lib/gcc-dg.exp (process-message): Avoid additional whitespace in
      	$expmsg.
      
      From-SVN: r255580
      Rainer Orth committed
    • re PR tree-optimization/83385 ([graphite] Wrong code w/ -O1 -floop-nest-optimize) · a365945b
      2017-12-12  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/83385
      	* graphite-scop-detection.c (get_order, order): Remove.
      	(bb_to_rpo): New global.
      	(cmp_pbbs): Adjust.
      	(build_scops): Sort pbbs in RPO order.
      
      	* gcc.dg/graphite/pr83385.c: New testcase.
      
      From-SVN: r255579
      Richard Biener committed
    • [Patch combine] Don't create vector mode ZERO_EXTEND from subregs · c5060cad
      The code in simplify set to handle transforming the paradoxical subreg
      expression:
      
        (set FOO (subreg:M (mem:N BAR) 0))
      
      in to:
      
        (set FOO (zero_extend:M (mem:N BAR)))
      
      Does not consider the case where M is a vector mode, allowing it to
      construct (for example):
      
        (zero_extend:V4SI (mem:SI))
      
      For one, this has the wrong semantics - but fortunately we fail long
      before then in expand_compound_operation.
      
      We need to explicitly reject vector modes from this transformation.
      
      gcc/
      
      	* combine.c (simplify_set): Do not transform subregs to zero_extends
      	if the destination mode is a vector mode.
      
      From-SVN: r255578
      James Greenhalgh committed
    • re PR c/82679 (Uses of typedefs of arrays of _Atomic-qualified types are rejected) · 49e6a6c0
      	PR c/82679
      	* c-decl.c (grokdeclarator): Check declspecs insted of atomicp.
      
      	* gcc.dg/c11-atomic-5.c: New test.
      
      From-SVN: r255577
      Marek Polacek committed
    • re PR rtl-optimization/83363 (wrong code at -O2 -fno-forward-propagate) · 6c939c2e
      	PR rtl-optimization/83363
      	PR rtl-optimization/83364
      	* gcc.dg/pr83363.c: New test.
      	* gcc.dg/pr83364.c: New test.
      
      From-SVN: r255576
      Jakub Jelinek committed
    • re PR tree-optimization/83359 (ICE in expand_LOOP_DIST_ALIAS, at internal-fn.c:2362) · 555758de
      	PR tree-optimization/83359
      	* tree-cfg.h (fold_loop_internal_call): Declare.
      	* tree-vectorizer.c (fold_loop_internal_call): Moved to ...
      	* tree-cfg.c (fold_loop_internal_call): ... here.  No longer static.
      	(find_loop_dist_alias): New function.
      	(move_sese_region_to_fn): If any dloop->orig_loop_num value is
      	updated, also adjust any corresponding LOOP_DIST_ALIAS internal
      	calls.
      
      	* gcc.dg/graphite/pr83359.c: New test.
      
      From-SVN: r255575
      Jakub Jelinek committed
    • re PR tree-optimization/80631 (Compiling with -O3 -mavx2 gives wrong code) · 12c667b5
      	PR tree-optimization/80631
      	* tree-vect-loop.c (get_initial_def_for_reduction): Fix comment typo.
      	(vect_create_epilog_for_reduction): Add INDUC_VAL and INDUC_CODE
      	arguments, for INTEGER_INDUC_COND_REDUCTION use INDUC_VAL instead of
      	hardcoding zero as the value if COND_EXPR is never true.  For
      	INTEGER_INDUC_COND_REDUCTION don't emit the final COND_EXPR if
      	INDUC_VAL is equal to INITIAL_DEF, and use INDUC_CODE instead of
      	hardcoding MAX_EXPR as the reduction operation.
      	(is_nonwrapping_integer_induction): Allow negative step.
      	(vectorizable_reduction): Compute INDUC_VAL and INDUC_CODE for
      	vect_create_epilog_for_reduction, if no value is suitable, don't
      	use INTEGER_INDUC_COND_REDUCTION for now.  Formatting fixes.
      
      	* gcc.dg/vect/pr80631-1.c: New test.
      	* gcc.dg/vect/pr80631-2.c: New test.
      	* gcc.dg/vect/pr65947-13.c: Expect integer induc cond reduction
      	vectorization.
      
      From-SVN: r255574
      Jakub Jelinek committed
    • re PR middle-end/81889 (bogus warnings with -Wmaybe-uninitialized -O3) · 5b0c69ae
      2017-12-12  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/81889
      	* tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness): Use
      	range info from the non-wrapping IV instead of just the range
      	of the type.
      
      	* gfortran.dg/pr81889.f90: New testcase.
      	* gcc.dg/tree-ssa/pr64183.c: Adjust.
      
      From-SVN: r255573
      Richard Biener committed
    • Enable VAES support [2/5] · e157d456
      gcc/
      	* config.gcc: Add vaesintrin.h.
      	* config/i386/i386-builtin-types.def (V64QI_FTYPE_V64QI_V64QI): New type.
      	* config/i386/i386-builtin.def (__builtin_ia32_vaesdec_v16qi,
      	__builtin_ia32_vaesdec_v32qi, __builtin_ia32_vaesdec_v64qi): New builtins.
      	* config/i386/i386.c (ix86_expand_args_builtin): Handle new type.
      	* config/i386/immintrin.h: Include vaesintrin.h.
      	* config/i386/sse.md (vaesdec_<mode>): New pattern.
      	* config/i386/vaesintrin.h (_mm256_aesdec_epi128, _mm512_aesdec_epi128,
      	_mm_aesdec_epi128): New intrinsics.
      
      gcc/testsuite/
      	* gcc.target/i386/avx512-check.h: Handle bit_VAES.
      	* gcc.target/i386/avx512f-aesdec-2.c: New test.
      	* gcc.target/i386/avx512fvl-vaes-1.c: Ditto.
      	* gcc.target/i386/avx512vl-aesdec-2.c: Ditto.
      	* gcc.target/i386/i386.exp (check_effective_target_avx512vaes): New.
      
      From-SVN: r255572
      Julia Koval committed
    • Enable VAES support [1/5] · b7b0a4fa
      gcc/
      	* common/config/i386/i386-common.c (OPTION_MASK_ISA_VAES_SET,
      	OPTION_MASK_ISA_VAES_UNSET): New.
      	(ix86_handle_option): Handle -mvaes.
      	* config/i386/cpuid.h: Define bit_VAES.
      	* config/i386/driver-i386.c (host_detect_local_cpu): Detect -mvaes.
      	* config/i386/i386-c.c (__VAES__): New.
      	* config/i386/i386.c (ix86_target_string): Add -mvaes.
      	(ix86_valid_target_attribute_inner_p): Ditto.
      	* config/i386/i386.h (TARGET_VAES, TARGET_VAES_P): New.
      	* config/i386/i386.opt: Add -mvaes.
      	* doc/invoke.texi: Ditto.
      
      From-SVN: r255571
      Julia Koval committed
    • [IEPM] Introduce debug hook for inline entry point markers · 102d484d
      The inline_entry hook will be given a definition in a later patch.
      
      for  gcc/ChangeLog
      
      	* debug.h (gcc_debug_hooks): Add inline_entry.
      	* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise.
      	* debug.c (do_nothing_debug_hooks): Likewise.
      	* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
      	* dwarf2out.c (dwarf2_debug_hooks): Likewise.
      	(dwarf2_lineno_debug_hooks): Likewise.
      
      From-SVN: r255570
      Alexandre Oliva committed