1. 14 Dec, 2017 10 commits
    • re PR middle-end/83415 (ICE during gimplification of assignment to read-only vector) · b7280579
      2017-12-14  Richard Biener  <rguenther@suse.de>
      
      	PR c/83415
      	c/
      	* c-fold.c (c_fully_fold_internal): Treat VIEW_CONVERT_EXPR
      	like REALPART_EXPR for the behavior of whether its operand
      	is an lvalue.
      
      	* gcc.dg/pr83415.c: New testcase.
      
      From-SVN: r255629
      Richard Biener committed
    • re PR tree-optimization/83418 (ICE in… · e729c8e0
      re PR tree-optimization/83418 (ICE in extract_range_for_var_from_comparison_expr, at vr-values.c:448)
      
      2017-12-14  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/83418
      	* vr-values.c (vr_values::extract_range_for_var_from_comparison_expr):
      	Instead of asserting we don't get unfolded comparisons deal with
      	them.
      
      	* gcc.dg/torture/pr83418.c: New testcase.
      
      From-SVN: r255628
      Richard Biener committed
    • re PR bootstrap/83396 (Bootstrap failures with Statement Frontiers) · 6dfb83e8
      	PR bootstrap/83396
      	* var-tracking.c (vt_initialize): Ignore non-DEBUG_INSNs outside of
      	basic blocks.  Assert debug bind insns don't appear outside of bbs,
      	don't reset them.  Assert insns without BLOCK_FOR_INSN are outside of
      	bb.  Simplify.
      
      	* gcc.dg/pr83396.c: New test.
      
      From-SVN: r255627
      Jakub Jelinek committed
    • re PR tree-optimization/83198 (ICE in format_floating, at gimple-ssa-sprintf.c:1900) · aa215959
      	PR tree-optimization/83198
      	* gimple-ssa-sprintf.c (format_floating): Set type solely based on
      	dir.modifier, regardless of TREE_TYPE (arg).  Assume non-REAL_CST
      	value if arg is a REAL_CST with incompatible type.
      
      	* gcc.dg/pr83198.c: New test.
      	* gcc.dg/tree-ssa/pr83198.c: New test.
      
      From-SVN: r255626
      Jakub Jelinek committed
    • [PATCH PR81228][AARCH64]Fix ICE by adding LTGT in vec_cmp<mode><v_int_equiv> · 8332c5ee
      This patch is a follow up to the existing discussions on
      https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01904.html
      Bin had earlier submitted this patch to fix the ICE that
      occurs because of the missing LTGT in aarch64-simd.md.
      That discussion opened up a new bug report PR81647 for
      an inconsistent behavior.
      
      As discussed earlier on the gcc-patches discussion and on
      the bug report, PR81647 was occurring because of how UNEQ
      was handled in aarch64-simd.md rather than LTGT.
      Since __builtin_islessgreater is guaranteed to not give an
      FP exception but LTGT might, __builtin_islessgreater gets
      converted to ~UNEQ very early on in fold_builtin_unordered_cmp.
      Thus I will post a separate patch for correcting how UNEQ and
      other unordered comparisons are handled in aarch64-simd.md.
      
      This patch is only adding the missing LTGT to plug the ICE.
      
      Testing done: Checked for regressions on bootstrapped
      aarch64-none-linux-gnu and added a new compile time test case
      that gives out LTGT to make sure it doesn't ICE
      
      *** gcc/ChangeLog ***
      
      2017-12-14  Sudakshina Das  <sudi.das@arm.com>
      	    Bin Cheng  <bin.cheng@arm.com>
      
      	PR target/81228
      	* config/aarch64/aarch64.c (aarch64_select_cc_mode): Move LTGT
      	to CCFPEmode.
      	* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_int_equiv>): Add
      	LTGT.
      
      *** gcc/testsuite/ChangeLog ***
      
      2017-12-14  Sudakshina Das  <sudi.das@arm.com>
      
      	PR target/81228
      	* gcc.dg/pr81228.c: New.
      
      Co-Authored-By: Bin Cheng <bin.cheng@arm.com>
      
      From-SVN: r255625
      Sudakshina Das committed
    • [AArch64] Specify fp16 support for Cortex-A55 and Cortex-A75 · 30af63d7
      The Cortex-A55 and Cortex-A75 processors support the fp16 extension.
      We already specify them as such in the arm port.
      This patch makes aarch64 consistent on this front.
      
      Bootstrapped and tested on aarch64-none-linux-gnu.
      Manually checked that compiling with aarch64-none-linux-gnu-gcc -mcpu=cortex-a55 -dM -E - < /dev/null
      shows __ARM_FEATURE_FP16_VECTOR_ARITHMETIC and __ARM_FEATURE_FP16_SCALAR_ARITHMETIC being specified
      as expected whereas they were not before this patch.
      
      	* config/aarch64/aarch64-cores.def (cortex-a55, cortex-a75,
      	cortex-a75.cortex-a55): Specify AARCH64_FL_F16 in the arch features.
      
      From-SVN: r255624
      Kyrylo Tkachov committed
    • re PR c++/79650 (ICE on invalid c++ code with label arithmetic in… · 9096c2c5
      re PR c++/79650 (ICE on invalid c++ code with label arithmetic in convert_nontype_argument (pt.c:6515))
      
      	PR c++/79650
      	* pt.c (convert_nontype_argument): Diagnose
      	reduced_constant_expression_p expressions that aren't INTEGER_CST.
      
      	* g++.dg/template/pr79650.C: New test.
      
      From-SVN: r255623
      Jakub Jelinek committed
    • re PR libfortran/78549 (Very slow formatted internal file output) · 606778c6
      2017-12-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
      
              PR libgfortran/78549
              * io/inquire.c (inquire_via_unit): Adjust test for existence for
              pre-connected internal units.
              * io/transfer.c (finalize_transfer): When done with a transfer
              to internal units, free the format buffer and close the stream.
              (st_read_done): Delete freeing the stream, now handled using
              sclose in finalize_transfer. (st_write_done): Likewise.
              * io/unit.c (get_unit): Return NULL for special reserved unit
              numbers, signifying not accessible to the user.
              (init_units): Insert the two special internal units into the
              unit treap. This makes these unit structures available without
              further allocations for later use by internal unit I/O. These
              units are automatically deleted by normal program termination.
              * io/unix.c (mem_close): Add a guard check to protect from double free.
      
      From-SVN: r255621
      Jerry DeLisle committed
    • Daily bump. · e69319af
      From-SVN: r255620
      GCC Administrator committed
    • 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 14 commits