1. 19 Jun, 2019 10 commits
    • Simplify setjmp and non-local goto implementation (PR84521) · 25403c41
      This fixes and simplifies the setjmp and non-local goto implementation.
      Currently the virtual frame pointer is saved when using __builtin_setjmp or
      a non-local goto.  Depending on whether a frame pointer is used, this may
      either save SP or FP with an immediate offset.  However the goto or longjmp
      always updates the hard frame pointer.
      
      A receiver veneer in the original function then assigns the hard frame pointer
      to the virtual frame pointer, which should, if it works correctly, again assign
      SP or FP.  However the special elimination code in eliminate_regs_in_insn
      doesn't do this correctly unless the frame pointer is used, and even if it
      worked by writing SP, the frame pointer would still be corrupted.
      
      A much simpler implementation is to always save and restore the hard frame
      pointer.  This avoids 2 redundant instructions which add/subtract the virtual
      frame offset.  A large amount of code can be removed as a result, including all
      implementations of TARGET_BUILTIN_SETJMP_FRAME_VALUE (all of which already use
      the hard frame pointer).  The expansion of nonlocal_goto on PA can be simplied
      to just restore the hard frame pointer. 
      
      This fixes the most obvious issues, however there are still issues on targets
      which define HARD_FRAME_POINTER_IS_FRAME_POINTER (arm, mips).
      Each function could have a different hard frame pointer, so a non-local goto
      may restore the wrong frame pointer (TARGET_BUILTIN_SETJMP_FRAME_VALUE could
      be useful for this).
      
      The i386 TARGET_BUILTIN_SETJMP_FRAME_VALUE was incorrect: if stack_realign_fp
      is true, it would save the hard frame pointer value but restore the virtual
      frame pointer which according to ix86_initial_elimination_offset can have a
      non-zero offset from the hard frame pointer.
      
      The ia64 implementation of nonlocal_goto seems incorrect since the helper
      function moves the the frame pointer value into the static chain register
      (so this patch does nothing to make it better or worse).
      
      AArch64 + x86-64 bootstrap OK, new test passes on AArch64, x86-64 and Arm.
      
      gcc/
      	PR middle-end/84521
      	* builtins.c (expand_builtin_setjmp_setup): Save
      	hard_frame_pointer_rtx.
      	(expand_builtin_setjmp_receiver): Do not emit sfp = fp move since we
      	restore fp.
      	* function.c (expand_function_start): Save hard_frame_pointer_rtx for
      	non-local goto.
      	* lra-eliminations.c (eliminate_regs_in_insn): Remove sfp = fp
      	elimination code.
      	(remove_reg_equal_offset_note): Remove unused function.
      	* reload1.c (eliminate_regs_in_insn): Remove sfp = hfp elimination
      	code.
      	* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
      	(arc_builtin_setjmp_frame_value): Remove function.
      	* config/avr/avr.c  (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
      	(avr_builtin_setjmp_frame_value): Remove function.
      	* config/i386/i386.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
      	(ix86_builtin_setjmp_frame_value): Remove function.
      	* config/pa/pa.md (nonlocal_goto): Remove FP adjustment.
      	* config/sparc/sparc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
      	(sparc_builtin_setjmp_frame_value): Remove function.
      	* config/vax/vax.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Remove.
      	(vax_builtin_setjmp_frame_value): Remove function.
      	* config/xtensa/xtensa.c (xtensa_frame_pointer_required): Force frame
      	pointer	if has_nonlocal_label.
      
      testsuite/
      	PR middle-end/84521
      	* gcc.c-torture/execute/pr84521.c: New test.
      
      From-SVN: r272473
      Wilco Dijkstra committed
    • md.texi: Document vec_shl_<mode> pattern. · 2e83f583
      	* doc/md.texi: Document vec_shl_<mode> pattern.
      	* optabs.def (vec_shl_optab): New optab.
      	* optabs.c (shift_amt_for_vec_perm_mask): Add shift_optab
      	argument, if == vec_shl_optab, check for left whole vector shift
      	pattern rather than right shift.
      	(expand_vec_perm_const): Add vec_shl_optab support.
      	* optabs-query.c (can_vec_perm_var_p): Mention also vec_shl optab
      	in the comment.
      	* tree-vect-generic.c (lower_vec_perm): Support permutations which
      	can be handled by vec_shl_optab.
      	* tree-vect-stmts.c (scan_store_can_perm_p): New function.
      	(check_scan_store): Use it.
      	(vectorizable_scan_store): If target can't do normal permutations,
      	try to use whole vector left shifts and if needed a VEC_COND_EXPR
      	after it.
      	* config/i386/sse.md (vec_shl_<mode>): New expander.
      
      	* gcc.dg/vect/vect-simd-8.c: If main is defined, don't include
      	tree-vect.h nor call check_vect.
      	* gcc.dg/vect/vect-simd-9.c: Likewise.
      	* gcc.dg/vect/vect-simd-10.c: New test.
      	* gcc.target/i386/sse2-vect-simd-8.c: New test.
      	* gcc.target/i386/sse2-vect-simd-9.c: New test.
      	* gcc.target/i386/sse2-vect-simd-10.c: New test.
      	* gcc.target/i386/avx2-vect-simd-8.c: New test.
      	* gcc.target/i386/avx2-vect-simd-9.c: New test.
      	* gcc.target/i386/avx2-vect-simd-10.c: New test.
      	* gcc.target/i386/avx512f-vect-simd-8.c: New test.
      	* gcc.target/i386/avx512f-vect-simd-9.c: New test.
      	* gcc.target/i386/avx512f-vect-simd-10.c: New test.
      
      From-SVN: r272472
      Jakub Jelinek committed
    • omp-low.c (lower_rec_input_clauses): Handle references properly in inscan clauses. · 6a2892a6
      	* omp-low.c (lower_rec_input_clauses): Handle references properly
      	in inscan clauses.
      	(lower_omp_scan): Likewise.
      cp/
      	* cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
      	like OMP_CLAUSE_SHARED.
      testsuite/
      	* g++.dg/vect/simd-3.cc: New test.
      	* g++.dg/vect/simd-4.cc: New test.
      	* g++.dg/vect/simd-5.cc: New test.
      
      From-SVN: r272471
      Jakub Jelinek committed
    • * g++.dg/ubsan/pr63956.C: Adjust expected diagnostics. · 5460b103
      From-SVN: r272470
      Jakub Jelinek committed
    • Add new micro-benchmark for string operations. · 99efe97d
      2019-06-19  Martin Liska  <mliska@suse.cz>
      
      	* bench-stringop: New file.
      
      From-SVN: r272469
      Martin Liska committed
    • compiler: stack allocate a buffer for non-escaping string ops · 20b603db
          
          For string concatenation, string to/from byte or rune slice
          conversion, and int to string conversion, if the result does not
          escape, we can allocate a small (32-element, or 4-byte for int to
          string) buffer on stack, and pass it to the runtime function. If
          the result fits in the buffer, it doesn't need to do a heap
          allocation.
          
          Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182538
      
      From-SVN: r272468
      Ian Lance Taylor committed
    • re PR fortran/89103 (Allow blank format items in format strings) · 17f62b7e
      2019-06-19  Jim MacArthur  <jim.macarthur@codethink.co.uk>
      	    Mark Eggleston  <mark.eggleston@codethink.com>
      
      	PR fortran/89103
      	* gfortran.texi: Add -fdec-blank-format-item
      	* invoke.texi: Add option to list of options.
      	* invoke.texi: Add to section on Commas in FORMAT specifications.
      	* io.c (check_format): At FMT_RPAREN goto finished if
      	-fdec-blank-format-item otherwise set error string.
      	* lang.opt: Add new option.
      	* options.c (set_dec_flags): Add SET_BITFLAG for
      	flag_dec_format_defaults.
      
      	* gfortran.dg/dec_format_empty_item_1.f: New test.
      	* gfortran.dg/dec_format_empty_item_2.f: New test.
      	* gfortran.dg/dec_format_empty_item_3.f: New test.
      
      Co-Authored-By: Mark Eggleston <mark.eggleston@codethink.com>
      
      From-SVN: r272467
      Jim MacArthur committed
    • pr88834.c: Move from here... · eb54b267
      
      gcc/testsuite/ChangeLog:
      
      2019-06-19  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
      
      	* gcc.target/aarch64/pr88834.c: Move from here...
      	* gcc.target/aarch64/sve/pr88834.c: ...to here.
      
      From-SVN: r272466
      Kugan Vivekanandarajah committed
    • tree-ssa-address.c (preferred_mem_scale_factor): Handle when mem_mode is BLKmode. · 89649081
      
      gcc/ChangeLog:
      
      2019-06-19  Kugan Vivekanandarajah  <kugan.vivekanandarajah@linaro.org>
      
      	* tree-ssa-address.c (preferred_mem_scale_factor): Handle when
      	mem_mode is BLKmode.
      
      From-SVN: r272465
      Kugan Vivekanandarajah committed
    • Daily bump. · 8666a0dc
      From-SVN: r272464
      GCC Administrator committed
  2. 18 Jun, 2019 30 commits