1. 09 Dec, 2016 24 commits
  2. 08 Dec, 2016 16 commits
    • PR c/77531 - __attribute__((alloc_size(1,2))) could also warn on multiplication overflow · 8bd9f164
      PR c/77531 - __attribute__((alloc_size(1,2))) could also warn on multiplication overflow
      PR c/78284 - warn on malloc with very large arguments
      
      gcc/c-family/ChangeLog:
      
      	PR c/78284
      	* c.opt (-Walloc-zero, -Walloc-size-larger-than): New options.
      
      gcc/ChangeLog:
      
      	PR c/78284
      	* builtin-attrs.def (ATTR_ALLOC_SIZE, ATTR_RETURNS_NONNULL): New
      	identifier tree nodes.
      	(ATTR_ALLOCA_SIZE_1_NOTHROW_LEAF_LIST): New attribute list.
      	(ATTR_MALLOC_SIZE_1_NOTHROW_LIST): Same.
      	(ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST): Same.
      	(ATTR_MALLOC_SIZE_1_2_NOTHROW_LEAF_LIST): Same.
      	(ATTR_ALLOC_SIZE_2_NOTHROW_LEAF_LIST): Same.
      	* builtins.c (expand_builtin_alloca): Call
      	maybe_warn_alloc_args_overflow.
      	* builtins.def (aligned_alloc, calloc, malloc, realloc):
      	Add attribute alloc_size.
      	(alloca): Add attribute alloc_size and returns_nonnull.
      	* calls.h (maybe_warn_alloc_args_overflow): Declare.
      	* calls.c (alloc_max_size, operand_signed_p): New functions.
      	(maybe_warn_alloc_args_overflow): Define.
      	(initialize_argument_information): Diagnose overflow in functions
      	declared with attaribute alloc_size.
      	* doc/invoke.texi (Warning Options): Document -Walloc-zero and
      	-Walloc-size-larger-than.
      
      gcc/testsuite/ChangeLog:
      
      	PR c/78284
      	* gcc.dg/attr-alloc_size-3.c: New test.
      	* gcc.dg/attr-alloc_size-4.c: New test.
      	* gcc.dg/attr-alloc_size-5.c: New test.
      	* gcc.dg/attr-alloc_size-6.c: New test.
      	* gcc.dg/attr-alloc_size-7.c: New test.
      	* gcc.dg/attr-alloc_size-8.c: New test.
      	* gcc.dg/attr-alloc_size-9.c: New test.
      	* gcc/testsuite/gcc.dg/errno-1.c: Adjust.
      
      From-SVN: r243470
      Martin Sebor committed
    • parallel_algorithm_assert2.cc: Move dg-do run first. · 410aa898
              * testsuite/25_algorithms/headers/algorithm/
              parallel_algorithm_assert2.cc: Move dg-do run first.
      
      From-SVN: r243468
      David Edelsohn committed
    • * gcc.target/i386/pr78671.c: Require int128 effective target. · ccc6bcc7
      From-SVN: r243465
      Uros Bizjak committed
    • re PR fortran/65173 (ICE while compiling wrong code) · d0803c0c
      2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>
      
      	PR fortran/65173
      	PR fortran/69064
      	PR fortran/69859
      	PR fortran/78350
      	* gfortran.h (gfc_namespace): Remove old_cl_list member.
      	* parse.c (use_modules, next_statement): old_cl_list is gone.
      	(clear_default_charlen): Remove no longer used function.
      	(reject_statement): Do not try ot clean up gfc_charlen structure(s)
      	that may have been added to a cl_list list.
      	* symbol.c (gfc_new_charlen): old_cl_list structure is gone.
      
      2016-12-07  Steven G. Kargl  <kargl@gcc.gnu.org>
      
      	PR fortran/65173
      	PR fortran/69064
      	PR fortran/69859
      	PR fortran/78350
      	* gfortran.dg/misplaced_implicit_character.f90: Adjust errors.
      	* gfortran.dg/charlen_01.f90: New test.
      	* gfortran.dg/charlen_02.f90: Ditto.
      	* gfortran.dg/charlen_03.f90: Ditto.
      	* gfortran.dg/charlen_04.f90: Ditto.
      	* gfortran.dg/charlen_05.f90: Ditto.
      	* gfortran.dg/charlen_06.f90: Ditto.
      	* gfortran.dg/charlen_07.f90: Ditto.
      	* gfortran.dg/charlen_08.f90: Ditto.
      	* gfortran.dg/charlen_09.f90: Ditto.
      	* gfortran.dg/charlen_10.f90: Ditto.
      	* gfortran.dg/charlen_11.f90: Ditto.
      	* gfortran.dg/charlen_12.f90: Ditto.
      	* gfortran.dg/charlen_13.f90: Ditto.
      	* gfortran.dg/charlen_14.f90: Ditto.
      	* gfortran.dg/charlen_15.f90: Ditto.
      	* gfortran.dg/charlen_16.f90: Ditto.
      
      From-SVN: r243463
      Steven G. Kargl committed
    • re PR rtl-optimization/78671 (ICE: in extract_constrain_insn, at recog.c:2213… · 7e964f49
      re PR rtl-optimization/78671 (ICE: in extract_constrain_insn, at recog.c:2213 with -Og -march=skylake-avx512)
      
      2016-12-08  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/78671
      	* lra-assign.c (lra-assigns.c): Check prohibited regs for an
      	allocno class.
      
      2016-12-08  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/78671
      	* gcc.target/i386/pr78671.c: New.
      
      From-SVN: r243462
      Vladimir Makarov committed
    • PR c/78165 - avoid printing type suffix for constants in %E output · 060162e0
      gcc/c-family/ChangeLog:
      
      	PR c/78165
                 * c-pretty-print (pp_c_integer_constant): Avoid formatting type
                   suffix.
      gcc/testsuite/ChangeLog:
      
      From-SVN: r243461
      Martin Sebor committed
    • runtime: mark non-x86 aeshashbody parameters as unused · 560bcfdc
          
          Avoids warnings during the build.
          
          Reviewed-on: https://go-review.googlesource.com/34142
      
      From-SVN: r243459
      Ian Lance Taylor committed
    • This patch fixes an issue in aarch64_classify_address. · 80d43579
      This patch fixes an issue in aarch64_classify_address.  TImode and TFmode
      can either use a 64-bit LDP/STP or 128-bit LDR/STR.  The addressing mode
      must be carefully modelled as the intersection of both.  This is done for
      the immediate offsets, however load_store_pair_p must be set as well to
      avoid LDP with a PC-relative address if aarch64_pcrelative_literal_loads
      is true.
      
          gcc/
      	PR target/78733
      	* config/aarch64/aarch64.c (aarch64_classify_address):
      	Set load_store_pair_p for TImode and TFmode.
      
          testsuite/
      	* gcc.target/aarch64/pr78733.c: New test.
      
      From-SVN: r243456
      Wilco Dijkstra committed
    • i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P. · 7bf65250
      	* gcc.target/i386/i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
      	(HARD_REGNO_NREGS_HAS_PADDING): Ditto.  Simplify macro.
      
      From-SVN: r243455
      Uros Bizjak committed
    • * es.po: Update. · eb6f6edd
      From-SVN: r243453
      Joseph Myers committed
    • re PR c++/78551 (Internal compiler error with constexpr initialization of union) · d6b46fca
      	PR c++/78551
      	* constexpr.c (extract_string_elt): New.  Broken out of ...
      	(cxx_eval_array_reference): ... here.  Call it.
      	(cxx_eval_store_expression): Convert init by STRING_CST into
      	CONSTRUCTOR, if needed.
      
      	PR c++/78551
      	* g++.dg/cpp1y/pr78551.C: New.
      
      From-SVN: r243448
      Nathan Sidwell committed
    • Introduce emit_status::ensure_regno_capacity · f44986d7
      gcc/ChangeLog:
      	* emit-rtl.c (gen_reg_rtx): Move regno_pointer_align and
      	regno_reg_rtx resizing logic to...
      	(emit_status::ensure_regno_capacity): ...this new method,
      	and ensure that the buffers are large enough.
      	(init_emit): Allocate regno_reg_rtx using ggc_cleared_vec_alloc
      	rather than ggc_vec_alloc.
      	* function.h (emit_status::ensure_regno_capacity): New method.
      
      From-SVN: r243447
      David Malcolm committed
    • runtime: copy memory hash code from Go 1.7 · 453060a9
          
          Rewrite the AES hashing code from gc assembler to C code using
          intrinsics.  The resulting code generates the same hash code for the
          same input as the gc code--that doesn't matter as such, but testing it
          ensures that the C code does something useful.
          
          Also change mips64pe32le to mips64p32le in configure script--noticed
          during CL review.
          
          Reviewed-on: https://go-review.googlesource.com/34022
      
      From-SVN: r243445
      Ian Lance Taylor committed
    • runtime: allocate _panic struct on heap · b2264b09
          
          The gc library allocates a _panic struct on the stack. This does not
          work for gccgo, because when a deferred function recovers the panic we
          unwind the stack up to that point so that returning from the function
          will work correctly.
          
          Allocating on the stack fine if the panic is not recovered, and it
          works fine if the panic is recovered by a function that
          returns. However, it fails if the panic is recovered by a function
          that itself panics, and if that second panic is then recovered by a
          function higher up on the stack. When we unwind the stack to that
          second panic, the g will wind up pointing at a panic farther down on
          the stack. Even then everything will often work fine, except when the
          deferred function catching the second panic makes a bunch of calls
          that use stack space before returning. In that case the code can
          overwrite the panic struct, which will then cause disaster when we
          remove the struct from the linked list, as the link field will be
          garbage. This case is rare enough that all the x86 tests were passing,
          but there was a failure on ppc64le.
          
          Before https://golang.org/cl/33414 we allocated the panic struct on
          the heap, so go back to doing that again.
          
          Fixes golang/go#18228.
          
          Reviewed-on: https://go-review.googlesource.com/34027
      
      From-SVN: r243444
      Ian Lance Taylor committed
    • re PR libstdc++/78264 (ICE in build_noexcept_spec, at cp/except.c:1196) · 0a7577bb
      	PR libstdc++/78264
      	* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM): Turn _N into _NE.
      	(_GLIBCXX_NOEXCEPT_QUAL): Likewise.
      
      From-SVN: r243443
      Eric Botcazou committed
    • compiler: make Slice_construction_expression::do_flatten idempotent · 55dccc1e
          
          Because of the way we handle call expressions with multiple results,
          it's possible for expressions to be flattened more than once.  In the
          case of Slice_construction_expression, allocating the slice storage
          multiple times caused a compiler crash as one of the
          Temporary_statement's wound up not getting a backend expression.
          
          Test case is https://golang.org/cl/34020.
          
          Reviewed-on: https://go-review.googlesource.com/34026
      
      From-SVN: r243442
      Ian Lance Taylor committed