1. 23 Jun, 2017 20 commits
    • runtime: complete defer handling in CgocallBackDone · f1857c63
          
          When C code calls a Go function, it actually calls a function
          generated by cgo. That function is written in Go, and, among other
          things, it calls the real Go function like this:
                  CgocallBack()
                  defer CgocallBackDone()
                  RealGoFunction()
          The deferred CgocallBackDone function enters syscall mode as we return
          to C. Typically the C function will then eventually return to Go.
          
          However, in the case where the C function is running on a thread
          created in C, it will not return to Go. For that case we will have
          allocated an m struct, with an associated g struct, for the duration
          of the Go code, and when the Go is complete we will return the m and g
          to a free list.
          
          That all works, but we are running in a deferred function, which means
          that we have been invoked by deferreturn, and deferreturn expects to
          do a bit of cleanup to record that the defer has been completed. Doing
          that cleanup while using an m and g that have already been returned to
          the free list is clearly a bad idea. It was kind of working because
          deferreturn was holding the g pointer in a local variable, but there
          were races with some other thread picking up and using the newly freed g.
          It was also kind of working because of a special check in freedefer;
          that check is no longer necessary.
          
          This patch changes the special case of releasing the m and g to do the
          defer cleanup in CgocallBackDone itself.
          
          This patch also checks for the special case of a panic through
          CgocallBackDone. In that special case, we don't want to release the m
          and g. Since we are returning to C code that was not called by Go
          code, we know that the panic is not going to be caught and we are
          going to exit the program. So for that special case we keep the m and
          g structs so that the rest of the panic code can use them.
          
          Reviewed-on: https://go-review.googlesource.com/46530
      
      From-SVN: r249611
      Ian Lance Taylor committed
    • rs6000-string.c: (expand_block_clear... · 8845cb37
      2017-06-23  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
      
      	* config/rs6000/rs6000-string.c: (expand_block_clear,
      	do_load_for_compare, select_block_compare_mode,
      	compute_current_alignment, expand_block_compare,
      	expand_strncmp_align_check, expand_strn_compare,
      	expand_block_move, rs6000_output_load_multiple)
      	Move functions related to string/block move/compare
      	to a separate file.
      	* config/rs6000/rs6000.c: Move above functions to rs6000-string.c.
      	* config/rs6000/rs6000-protos.h (rs6000_emit_dot_insn): Add prototype
      	for this function which is now used in two files.
      	* config/rs6000/t-rs6000: Add rule to compile rs6000-string.o.
      	* config.gcc: Add rs6000-string.o to extra_objs for
      	targets powerpc*-*-* and rs6000*-*-*.
      
      From-SVN: r249608
      Aaron Sawdey committed
    • re PR target/80510 (Optimize Power7/power8 Altivec load/stores) · 37416b69
      [gcc]
      2017-06-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	PR target/80510
      	* config/rs6000/rs6000.md (ALTIVEC_DFORM): Do not allow DImode in
      	32-bit, since indexed is not valid for DImode.
      	(mov<mode>_hardfloat32): Reorder ISA 2.07 load/stores before ISA
      	3.0 d-form load/stores to be the same as mov<mode>_hardfloat64.
      	(define_peephole2 for Altivec d-form load): Add 32-bit support.
      	(define_peephole2 for Altivec d-form store): Likewise.
      
      [gcc/testsuite]
      2017-06-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	PR target/80510
      	* gcc.target/powerpc/pr80510-1.c: Allow test to run on 32-bit.
      	* gcc.target/powerpc/pr80510-2.c: Likewise.
      
      From-SVN: r249607
      Michael Meissner committed
    • re PR ipa/81185 (Target clones support generates awkward names) · 9761349c
      2017-06-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	PR ipa/81185
      	* multiple_target.c (create_dispatcher_calls): Only create the
      	dispatcher call if the function is the default clone of a
      	versioned function.
      
      From-SVN: r249605
      Michael Meissner committed
    • trans.c (gnat_to_gnu): Initialize sync to false to avoid UB. · aa9ace3e
      	* gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false to
      	avoid UB.
      
      From-SVN: r249604
      Jakub Jelinek committed
    • Fix expand_builtin_atomic_fetch_op for pre-op (PR80902) · 08c273bb
      __atomic_add_fetch adds a value to some memory, and returns the result.
      If there is no direct support for this, expand_builtin_atomic_fetch_op
      is asked to implement this as __atomic_fetch_add (which returns the
      original value of the mem), followed by the addition.  Now, the
      __atomic_add_fetch could have been a tail call, but we shouldn't
      perform the __atomic_fetch_add as a tail call: following code would
      not be executed, and in fact thrown away because there is a barrier
      after tail calls.
      
      This fixes it.
      
      
      	PR middle-end/80902
      	* builtins.c (expand_builtin_atomic_fetch_op): If emitting code after
      	a call, force the call to not be a tail call.
      
      From-SVN: r249603
      Segher Boessenkool committed
    • os-unix-sysdep.c (__cilkrts_getticks): Adjust preprocessor test for SPARC/Linux. · eded3fe5
      	* runtime/config/sparc/os-unix-sysdep.c (__cilkrts_getticks): Adjust
      	preprocessor test for SPARC/Linux.
      	* runtime/jmpbuf.h (CILK_[UN]ADJUST_SP): Likewise.
      
      From-SVN: r249601
      Eric Botcazou committed
    • os: align siginfo argument to waitid · 3c76bd92
          
          Backport https://golang.org/cl/46511 from gc trunk, as it may fix a
          bug reported for gccgo running on MIPS
          (https://groups.google.com/d/msg/golang-dev/sDg-t1_DPw0/-AJmLxgPBQAJ).
          
          Reviewed-on: https://go-review.googlesource.com/46571
      
      From-SVN: r249599
      Ian Lance Taylor committed
    • runtime: don't crash if no p in kickoff · bb96aa67
          
          The kickoff function for g0 can be invoked without a p, for example
          from mcall(exitsyscall0) in exitsyscall after exitsyscall has cleared
          the p field. The assignment gp.param = nil will invoke a write barrier.
          If gp.param is not already nil, this will require a p. Avoid the problem
          for a specific case that is known to be OK: when the value in gp.param
          is a *g.
          
          Reviewed-on: https://go-review.googlesource.com/46512
      
      From-SVN: r249595
      Ian Lance Taylor committed
    • compiler: add go:notinheap magic comment · 5f0b897b
          
          Implement go:notinheap as the gc compiler does. A type marked as
          go:notinheap may not live in the heap, and does not require a write
          barrier. Struct and array types that incorporate notinheap types are
          themselves notinheap. Allocating a value of a notinheap type on the
          heap is an error.
          
          This is not just an optimization. There is code where a write barrier
          may not occur that was getting a write barrier with gccgo but not gc,
          because the types in question were notinheap. The case I found was
          setting the mcache field in exitsyscallfast.
          
          Reviewed-on: https://go-review.googlesource.com/46490
      
      From-SVN: r249594
      Ian Lance Taylor committed
    • contrib.texi: Add entry for Steven Pemberton's work on enquire. · ef2361cb
      	* doc/contrib.texi: Add entry for Steven Pemberton's work on
      	enquire.
      
      From-SVN: r249593
      Jeff Law committed
    • rs6000.c: Add include of ssa-propagate.h for update_call_from_tree(). · 52607f7e
      [gcc]
      
      2017-06-23  Will Schmidt  <will_schmidt@vnet.ibm.com>
      
      	* config/rs6000/rs6000.c: Add include of ssa-propagate.h for
      	update_call_from_tree().  (rs6000_gimple_fold_builtin): Add
      	handling for early expansion of vector shifts (sl,sr,sra,rl).
      	(builtin_function_type): Add vector shift right instructions
      	to the unsigned argument list.
      
      [gcc/testsuite]
      
      2017-06-23  Will Schmidt  <will_schmidt@vnet.ibm.com>
      
      	* gcc.target/powerpc/fold-vec-shift-char.c: New.
      	* gcc.target/powerpc/fold-vec-shift-int.c: New.
      	* gcc.target/powerpc/fold-vec-shift-longlong.c: New.
      	* gcc.target/powerpc/fold-vec-shift-short.c: New.
      	* gcc.target/powerpc/fold-vec-shift-left.c: New.
      	* gcc.target/powerpc/fold-vec-shift-left-fwrapv.c: New.
      	* gcc.target/powerpc/fold-vec-shift-left-longlong-fwrapv.c: New.
      	* gcc.target/powerpc/fold-vec-shift-left-longlong.c: New.
      
      From-SVN: r249591
      Will Schmidt committed
    • runtime: improve handling of panic during deferred function · 54357b3b
          
          When a panic occurs while processing a deferred function that
          recovered an earlier panic, we shouldn't report the recovered panic
          in the panic stack trace. Stop doing so by keeping track of the panic
          that triggered a defer, marking it as aborted if we see the defer again,
          and discarding aborted panics when a panic is recovered. This is what
          the gc runtime does.
          
          The test for this is TestRecursivePanic in runtime/crash_test.go.
          We don't run that test yet, but we will soon.
          
          Reviewed-on: https://go-review.googlesource.com/46461
      
      From-SVN: r249590
      Ian Lance Taylor committed
    • go-test.exp (go-set-goarch): Update MIPS architecture names. · fb68f296
      	* go.test/go-test.exp (go-set-goarch): Update MIPS architecture
              names.
      
      From-SVN: r249589
      James Cowgill committed
    • ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again. · 08f42414
      2017-06-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              rtl-optimizatoin/79286
              * ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again.
              * rtlanal.c (rtx_addr_can_trap_p_1): SYMBOL_REF_FUNCTION_P can never
              trap.  PIC register plus a const unspec without offset can never trap.
      
      From-SVN: r249588
      Bernd Edlinger committed
    • Refactor fileptr_type_node handling · 2db9b7cd
      2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
      
      gcc/
      	* tree.h (builtin_structptr_type): New type.
      	(builtin_structptr_types): Declare new array.
      	* tree.c (builtin_structptr_types): New array.
      	(free_lang_data, build_common_tree_nodes): Use it.
      
      gcc/c-family/
      	* c-common.c (c_common_nodes_and_builtins): Use builtin_structptr_types.
      
      gcc/cp/
      	* decl.c (duplicate_decls): Use builtin_structptr_types.
      
      gcc/lto/
      	* lto-lang.c (lto_init): Use builtin_structptr_types.
      
      From-SVN: r249585
      Marc Glisse committed
    • PR c++/81187 fix -Wnoexcept-type entry in manual · 70fdc808
      	PR c++/81187
      	* doc/invoke.texi (-Wnoexcept-type): Fix name of option, from
      	-Wnoexcept.
      
      From-SVN: r249584
      Jonathan Wakely committed
    • Daily bump. · 3e207313
      From-SVN: r249583
      GCC Administrator committed
  2. 22 Jun, 2017 20 commits