Commit Graph

150114 Commits

Author SHA1 Message Date
Uros Bizjak 4dec376c23 * config/i386/i386.md: Move some more patterns around.
From-SVN: r242850
2016-11-24 22:12:19 +01:00
Vladimir Makarov 3f156a6ce0 re PR rtl-optimization/77541 (wrong code with 512bit vectors of int128 @ -O1)
2016-11-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77541
	* lra-constraints.c (struct input_reload): Add field match_p.
	(get_reload_reg): Check modes of input reloads to generate unique
	value reload pseudo.
	(match_reload): Add input reload pseudo for the current insn.

2016-11-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/77541
	* gcc.target/i386/pr77541.c: New.

From-SVN: r242848
2016-11-24 19:54:27 +00:00
Steven G. Kargl fba5a793b3 re PR fortran/78500 (ICE in gfc_check_vardef_context, at fortran/expr.c:5289)
2016-11-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78500
	* expr.c (gfc_check_vardef_contextm): Fix NULL pointer dereference.
	* interface.c (matching_typebound_op): Ditto.

2016-11-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78500
	* gfortran.dg/class_result_4.f90: New test.

From-SVN: r242846
2016-11-24 18:27:58 +00:00
James Greenhalgh 11e554b3b5 [Patch AArch64 13/17] Enable _Float16 for AArch64
gcc/

	* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Update
	__FLT_EVAL_METHOD__ and __FLT_EVAL_METHOD_C99__ when we switch
	architecture levels.
	* config/aarch64/aarch64.c (aarch64_promoted_type): Only promote
	the aarch64_fp16_type_node, not all HFmode types.
	(aarch64_libgcc_floating_mode_supported_p): Support HFmode.
	(aarch64_scalar_mode_supported_p): Likewise.
	(aarch64_excess_precision): New.
	(TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Define.
	(TARGET_SCALAR_MODE_SUPPORTED_P): Likewise.
	(TARGET_C_EXCESS_PRECISION): Likewise.

gcc/testsuite/

	* gcc.target/aarch64/_Float16_1.c: New.
	* gcc.target/aarch64/_Float16_2.c: Likewise.
	* gcc.target/aarch64/_Float16_3.c: Likewise.

From-SVN: r242845
2016-11-24 18:19:29 +00:00
James Greenhalgh 2e5f8203d2 [Patch libgcc AArch64 12/17] Enable hfmode soft-float conversions and truncations
gcc/

	* config/aarch64/aarch64-c.c (aarch64_scalar_mode_supported_p): New.
	(TARGET_SCALAR_MODE_SUPPORTED_P): Define.

libgcc/

	* config/aarch64/sfp-machine.h (_FP_NANFRAC_H): Define.
	(_FP_NANSIGN_H): Likewise.
	* config/aarch64/t-softfp (softfp_extensions): Add hftf.
	(softfp_truncations): Add tfhf.
	(softfp_extras): Add required conversion functions.

From-SVN: r242844
2016-11-24 18:16:55 +00:00
James Greenhalgh bf1e3646d1 [Patch AArch64 11/17] Add floatdihf2 and floatunsdihf2 patterns
gcc/

	* config/aarch64/aarch64.md (<optab>sihf2): Convert to expand.
	(<optab>dihf2): Likewise.
	(aarch64_fp16_<optab><mode>hf2): New.

gcc/testsuite/

	* gcc.target/aarch64/floatdihf2_1.c: New.

From-SVN: r242843
2016-11-24 18:14:36 +00:00
Alexander Monakov e210b51b58 Allow -fopenmp in NVPTX mkoffload
PR target/67822
	* config/nvptx/mkoffload.c (main): Allow -fopenmp.

From-SVN: r242842
2016-11-24 21:10:42 +03:00
Eric Botcazou 94331892c3 sparc-common.c (sparc_option_optimization_table): Enable REE at -O2 and higher.
* common/config/sparc/sparc-common.c (sparc_option_optimization_table):
	Enable REE at -O2 and higher.
	* config/sparc/sparc.c (sparc_option_override): Disable it by default
	in 32-bit mode.

From-SVN: r242841
2016-11-24 15:30:17 +00:00
Kyrylo Tkachov 33a002b0ab [TER] PR target/48863 : Don't replace expressions across local register variable definitions
PR target/48863
	PR inline-asm/70184
	* tree-ssa-ter.c (temp_expr_table): Add reg_vars_cnt field.
	(new_temp_expr_table): Initialise reg_vars_cnt.
	(free_temp_expr_table): Release reg_vars_cnt.
	(process_replaceable): Add reg_vars_cnt argument, set reg_vars_cnt
	field of TAB.
	(find_replaceable_in_bb): Use the above to record register variable
	write occurrences and cancel replacement across them.

	* gcc.target/arm/pr48863.c: New test.

From-SVN: r242840
2016-11-24 15:22:34 +00:00
Eric Botcazou 4da41abf84 re PR rtl-optimization/78437 (invalid sign-extend conversion in REE pass)
PR rtl-optimization/78437
	* ree.c (get_uses): New function.
	(combine_reaching_defs): When a copy is needed, return false if any
	reaching use of the source register reads it in a mode larger than
	the mode it is set in and WORD_REGISTER_OPERATIONS is true.

From-SVN: r242839
2016-11-24 15:01:32 +00:00
Martin Liska 0d56d3c17b Dump probability for edges a frequency for BBs
* gimple-pretty-print.c (dump_edge_probability): New function.
	(dump_gimple_switch): Dump label edge probabilities.
	(dump_gimple_cond): Likewise.
	(dump_gimple_label): Dump
	(dump_gimple_bb_header): Dump basic block frequency.
	(pp_cfg_jump): Replace e->dest argument with e.
	(dump_implicit_edges): Likewise.
	* tree-ssa-loop-ivopts.c (get_scaled_computation_cost_at):
	Use gimple_bb (at) instead of at->bb.
	* gcc.dg/builtin-unreachable-6.c: Update test to not to scan
	parts for frequencies/probabilities.
	* gcc.dg/pr34027-1.c: Likewise.
	* gcc.dg/strict-overflow-2.c: Likewise.
	* gcc.dg/tree-ssa/20040703-1.c: Likewise.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Likewise.
	* gcc.dg/tree-ssa/pr32044.c: Likewise.
	* gcc.dg/tree-ssa/vector-3.c: Likewise.
	* gcc.dg/tree-ssa/vrp101.c: Likewise.
	* gcc.dg/tree-ssa/dump-2.c: New test.

From-SVN: r242837
2016-11-24 12:58:45 +00:00
Bernd Schmidt 8cac4d8587 common.opt (flimit-function-alignment): New.
gcc/
	* common.opt (flimit-function-alignment): New.
	* doc/invoke.texi (-flimit-function-alignment): Document.
	* emit-rtl.h (struct rtl_data): Add max_insn_address field.
	* final.c (shorten_branches): Set it.
	* varasm.c (assemble_start_function): Limit alignment if
	requested.

gcc/testsuite/
	* gcc.target/i386/align-limit.c: New test.

From-SVN: r242836
2016-11-24 12:54:56 +00:00
Richard Biener eb2afa1a80 re PR tree-optimization/71595 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704)
2016-11-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71595
	* cfgloopmanip.h (remove_path): Add irred_invalidated and
	loop_closed_ssa_invalidated parameters, defaulted to NULL.
	* cfgloopmanip.c (remove_path): Likewise, pass them along to
	called functions.  Only fix irred flags if the caller didn't
	request state.
	* tree-ssa-loop-ivcanon.c (unloop_loops): Use add_bb_to_loop.
	(unloop_loops): Pass irred_invalidated and loop_closed_ssa_invalidated
	to remove_path.

	* gcc.dg/torture/pr71595.c: New testcase.

From-SVN: r242835
2016-11-24 12:25:22 +00:00
Bernd Schmidt 2d8fec87b1 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* ifcvt.c (noce_conversion_profitable_p): Check original cost in all
	cases, and additionally test against max_seq_cost for speed
	optimization.
	(noce_process_if_block): Compute an estimate for the original cost when
	optimizing for speed, using the minimum of then and else block costs.

testsuite/
	PR rtl-optimization/78120
	* gcc.target/i386/pr78120.c: New test.

From-SVN: r242834
2016-11-24 12:22:16 +00:00
Bernd Schmidt 334442f282 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* rtlanal.c (insn_rtx_cost): Use set_rtx_cost.

From-SVN: r242833
2016-11-24 12:17:52 +00:00
Bernd Schmidt 7998af1f4b re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* config/i386/i386.c (ix86_rtx_costs): Fully handle SETs.

From-SVN: r242832
2016-11-24 12:16:47 +00:00
Bin Cheng 21aaaf1e05 match.pd: Refine type conversion in result expr for below pattern: (cond (cmp (convert1?
* match.pd: Refine type conversion in result expr for below pattern:
	(cond (cmp (convert1? x) c1) (convert2? x) c2) -> (minmax (x c)).

From-SVN: r242831
2016-11-24 12:09:19 +00:00
Eric Botcazou 3b08cde8dd re PR middle-end/78429 (ICE in set_value_range, at tree-vrp.c on non-standard boolean)
PR middle-end/78429
	* tree.h (wi::fits_to_boolean_p): New predicate.
	(wi::fits_to_tree_p): Use it for boolean types.
	* tree.c (int_fits_type_p): Likewise.

From-SVN: r242829
2016-11-24 12:02:53 +00:00
Martin Liska bf2df7a9b3 cp_parser_range_for: use safe_push instead of quick_push (PR
PR bootstrap/78493
	* parser.c (cp_parser_range_for): Use safe_push instead of quick_push.
	PR bootstrap/78493
	* g++.dg/cpp1z/decomp18.C: New test.

From-SVN: r242828
2016-11-24 11:26:12 +00:00
Naveen H.S adf86091b1 ldp_stp_1.c: Add -mcpu=generic.
2016-11-23  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* gcc.target/aarch64/ldp_stp_1.c : Add -mcpu=generic.
	* gcc.target/aarch64/store-pair-1.c : Likewise.

From-SVN: r242827
2016-11-24 10:24:15 +00:00
Richard Biener c14988fe8d re PR middle-end/71762 (~X & Y to X < Y doesn't work for uninitialized values)
2016-11-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/71762
	* match.pd ((~X & Y) -> X < Y, (X & ~Y) -> Y < X,
	(~X | Y) -> X <= Y, (X | ~Y) -> Y <= X): Remove.

	* gcc.dg/torture/pr71762-1.c: New testcase.
	* gcc.dg/torture/pr71762-2.c: Likewise.
	* gcc.dg/torture/pr71762-3.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-28.c: XFAIL.

From-SVN: r242822
2016-11-24 09:45:01 +00:00
Naveen H.S 3884190f00 fmaxmin.c: Add -fno-vect-cost-model.
2016-11-23  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* gcc.target/aarch64/fmaxmin.c : Add -fno-vect-cost-model.
	* gcc.target/aarch64/fmul_fcvt_2.c : Likewise.
	* gcc.target/aarch64/vect-abs-compile.c : Likewise.
	* gcc.target/aarch64/vect-clz.c : Likewise.
	* gcc.target/aarch64/vect-fcm-eq-d.c : Likewise.
	* gcc.target/aarch64/vect-fcm-ge-d.c : Likewise.
	* gcc.target/aarch64/vect-fcm-gt-d.c : Likewise.
	* gcc.target/aarch64/vect-fmovd-zero.c : Likewise.
	* gcc.target/aarch64/vect-fmovd.c : Likewise.
	* gcc.target/aarch64/vect-fmovf-zero.c : Likewise.
	* gcc.target/aarch64/vect-fmovf.c : Likewise.
	* gcc.target/aarch64/vect_ctz_1.c : Likewise.

From-SVN: r242821
2016-11-24 09:42:36 +00:00
Martin Liska 47044ef2f5 Fix print_node for CONSTRUCTORs
* print-tree.c (struct bucket): Remove.
	(print_node): Add new argument which drives whether a tree node
	is printed briefly or not.
	(debug_tree): Replace a custom hash table with hash_set<T>.
	* print-tree.h (print_node): Add the argument.

From-SVN: r242820
2016-11-24 09:42:18 +00:00
Chung-Lin Tang 665ad37b6a nios2.c (nios2_init_libfuncs): Add ATTRIBUTE_UNUSED.
2016-11-24  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nios2/nios2.c (nios2_init_libfuncs): Add ATTRIBUTE_UNUSED.

From-SVN: r242819
2016-11-24 09:28:02 +00:00
Peter Bergner 90b725f0b0 re PR target/78458 (LRA ICE building libgcc for powerpc-linux-gnuspe e500v2)
gcc/
	PR target/78458
	* config/rs6000/rs6000.h (HARD_REGNO_CALLER_SAVE_MODE): Return MODE
	if it is at least NREGS wide.

gcc/testsuite/
	PR target/78458
	* gcc.target/powerpc/pr78458.c: New.

From-SVN: r242818
2016-11-23 20:07:51 -06:00
GCC Administrator 890a4eb056 Daily bump.
From-SVN: r242817
2016-11-24 00:16:15 +00:00
Joseph Myers 6fa42ea366 Fix e500 offset handling for TImode.
Given my previous fix for a missing insn pattern for e500, building
glibc runs into an assembler error "Error: operand out of range (256
is not between 0 and 248)".  This comes from an insn:

(insn 115 1209 1210 (set (reg:DF 27 27 [orig:294 _129 ] [294])
        (subreg:DF (mem/c:TI (plus:SI (reg/f:SI 1 1)
                    (const_int 256 [0x100])) [14 %sfp+256 S16 A128]) 0)) 1909 {*frob_df_ti}
     (nil))

This patch adjusts the offset handling for TImode - and TDmode and
PTImode in case such subregs can arise for them - to be the same as
for TFmode, so that proper SPE offset checks are made in the
TARGET_E500_DOUBLE case.

This allows the glibc build to complete.  Testing shows 372 FAILs
across the gcc, g++ and libstdc++ testsuites; more cleanup is
certainly needed, but this gets to the point where the toolchain at
least builds so it's possible to compare test results when fixing
bugs.

	* config/rs6000/rs6000.c (rs6000_legitimate_offset_address_p): For
	TARGET_E500_DOUBLE. handle TDmode, TImode and PTImode the same as
	TFmode, IFmode and KFmode.

From-SVN: r242814
2016-11-23 23:34:05 +00:00
Joseph Myers 03f24169cd Add another e500 subreg pattern.
Building glibc for powerpc-linux-gnuspe --enable-e500-double, given
the patch <https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02404.html>
applied, fails with errors such as:

../sysdeps/ieee754/ldbl-128ibm/s_modfl.c: In function '__modfl':
../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: error: unrecognizable insn:
 }
 ^
(insn 31 30 32 2 (set (reg:DF 203)
        (subreg:DF (reg:TI 202) 8)) "../sysdeps/ieee754/ldbl-128ibm/s_modfl.c":44 -1
     (nil))
../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: internal compiler error: in extract_insn, at recog.c:2311

This patch adds an insn pattern similar to various patterns already
present to handle extracting such a subreg.  This allows the glibc
build to get further, until it runs into an assembler error for which
I have another patch.

gcc:
	* config/rs6000/spe.md (*frob_<SPE64:mode>_ti_8): New insn
	pattern.

gcc/testsuite:
	* gcc.c-torture/compile/20161123-1.c: New test.

From-SVN: r242813
2016-11-23 23:32:54 +00:00
Segher Boessenkool 469585df2d combine: Query can_change_dest_mode before changing dest mode
As reported in https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02388.html .

Changing the mode of a hard register can lead to problems, or at least
it can make worse code if the result will need reloads.


	* combine.c (change_zero_ext): Only change the mode of a hard register
	destination if can_change_dest_mode holds for that.

From-SVN: r242812
2016-11-24 00:30:38 +01:00
Jeff Law 188a209119 * varasm.c (assemble_name): Increase buffer size for name.
From-SVN: r242810
2016-11-23 15:48:45 -07:00
Uros Bizjak 11a669fbeb * config/i386/i386.md: Move some insn patterns around.
From-SVN: r242809
2016-11-23 23:25:12 +01:00
Jeff Law a2556bdf78 * config/spu/spu.md (floatunsdidf2): Remove unused local variable.
From-SVN: r242807
2016-11-23 15:17:29 -07:00
Jakub Kicinski 03a4ffcd5f * doc/extend.texi: Constify first argument to __builtin_object_size.
From-SVN: r242804
2016-11-23 15:05:18 -07:00
Bernd Edlinger d5c45ad752 opth-gen.awk: Use unsigned shifts for bit masks.
2016-11-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* opth-gen.awk: Use unsigned shifts for bit masks.  Allow all bits
	to be used.  Add brackets around macro argument.

From-SVN: r242803
2016-11-23 14:53:12 -07:00
Steven G. Kargl 91c9fb42c0 re PR fortran/78297 (ICE in finish_equivalences, at fortran/trans-common.c:1246)
2016-11-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78297
	* trans-common.c (finish_equivalences): Do not dereference a NULL pointer.

2016-11-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78297
	* gfortran.dg/pr78297.f90: New test.

From-SVN: r242802
2016-11-23 21:44:05 +00:00
David Edelsohn 15a3cdd8b0 * gcc.target/powerpc/builtins-3.c: Add -maltivec and -mvsx options.
From-SVN: r242800
2016-11-23 16:06:28 -05:00
Uros Bizjak cf919e352b i386.md (*<any_or:code>hi_1): Fix operand 2 constraints.
* config/i386/i386.md (*<any_or:code>hi_1): Fix operand 2 constraints.

From-SVN: r242796
2016-11-23 21:23:44 +01:00
Jakub Jelinek c944c6a2b2 re PR sanitizer/69278 (Confusion option handling for -sanitize-recovery=alll)
PR sanitizer/69278
	* opts.c (parse_sanitizer_options): For -fsanitize=undefined,
	restore enabling also SANITIZE_UNREACHABLE and SANITIZE_RETURN.

	* g++.dg/ubsan/return-7.C: New test.
	* c-c++-common/ubsan/unreachable-4.c: New test.

From-SVN: r242795
2016-11-23 20:51:27 +01:00
Jakub Jelinek 871a2c6c8b re PR tree-optimization/78482 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu)
PR tree-optimization/78482
	* gcc.dg/torture/pr78482.c (c, d): Use signed char instead of char.
	(bar): New function.
	(main): Call bar instead of printf.

From-SVN: r242794
2016-11-23 20:50:23 +01:00
Jakub Jelinek c39dad64b8 re PR middle-end/69183 (ICE when using OpenMP PRIVATE keyword in OMP DO loop not explicitly encapsulated in OMP PARALLEL region)
PR middle-end/69183
	* omp-low.c (build_outer_var_ref): Change lastprivate argument
	to code, pass it recursively, adjust uses.  For OMP_CLAUSE_PRIVATE
	on worksharing constructs, treat it like clauses on simd construct.
	Formatting fix.
	(lower_rec_input_clauses): For OMP_CLAUSE_PRIVATE_OUTER_REF pass
	OMP_CLAUSE_PRIVATE as last argument to build_outer_var_ref.
	(lower_lastprivate_clauses): Pass OMP_CLAUSE_LASTPRIVATE instead
	of true as last argument to build_outer_var_ref.

	* gfortran.dg/gomp/pr69183.f90: New test.

From-SVN: r242793
2016-11-23 20:28:41 +01:00
Kito Cheng 62567da0df re PR target/78230 (Compile pr66178.c fail for mips64el-elf with N64 abi)
PR target/78230
	* gcc.dg/torture/pr66178.c (test): Use uintptr_t instead of int.
	(test2) Ditto.

From-SVN: r242792
2016-11-23 12:20:33 -07:00
Uros Bizjak 46e89251c4 i386.md (*movqi_internal): Calculate mode attribute of alternatives 7,8,9 depending on TARGET_AVX512DQ.
* gcc.target/config/i386.md (*movqi_internal): Calculate mode
	attribute of alternatives 7,8,9 depending on TARGET_AVX512DQ.
	<TYPE_MSKMOV>: Emit kmovw for MODE_HI insn mode attribute.
	(*k<logic><mode>): Calculate mode attribute depending on
	TARGET_AVX512DQ.  Emit k<logic>w for MODE_HI insn mode attribute.
	(*andqi_1): Calculate mode attribute of alternative 3 depending
	on TARGET_AVX512DQ.  Emit kandw for MODE_HI insn mode attribute.
	(kandn<mode>): Calculate mode attribute of alternative 2 depending
	on TARGET_AVX512DQ.  Emit kandnw for MODE_HI insn mode attribute.
	(kxnor<mode>): Merge insn patterns using SWI1248_AVX512BW mode
	iterator.  Calculate mode attribute of alternative 1 depending
	on TARGET_AVX512DQ.  Emit kxnorw for MODE_HI insn mode attribute.
	(*one_cmplqi2_1): Calculate mode attribute of alternative 2 depending
	on TARGET_AVX512DQ.  Emit knotw for MODE_HI insn mode attribute.

From-SVN: r242791
2016-11-23 20:05:53 +01:00
Jakub Jelinek 25cb6b33f7 re PR c++/77907 (Add "const" to argument of constexpr constructor causes the object to be left in unconstructed state)
PR c++/77907
	* cp-gimplify.c (cp_fold) <case CALL_EXPR>: When calling constructor
	and maybe_constant_value returns non-CALL_EXPR, create INIT_EXPR
	with the object on lhs and maybe_constant_value returned expr on rhs.

	* g++.dg/cpp0x/pr77907.C: New test.

From-SVN: r242790
2016-11-23 19:45:27 +01:00
Alexander Monakov 6103184e81 OpenMP offloading to NVPTX: libgomp changes
* Makefile.am (libgomp_la_SOURCES): Add atomic.c, icv.c, icv-device.c.
	* Makefile.in. Regenerate.
	* configure.ac [nvptx*-*-*] (libgomp_use_pthreads): Set and use it...
	(LIBGOMP_USE_PTHREADS): ...here; new define.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* config/posix/affinity.c: Move to...
	* affinity.c: ...here (new file).  Guard use of Pthreads-specific
	interface by LIBGOMP_USE_PTHREADS. 
	* critical.c: Split out GOMP_atomic_{start,end} into...
	* atomic.c: ...here (new file).
	* env.c: Split out ICV definitions into...
	* icv.c: ...here (new file) and...
	* icv-device.c: ...here. New file.
	* config/linux/lock.c (gomp_init_lock_30): Move to generic lock.c.
	(gomp_destroy_lock_30): Ditto.
	(gomp_set_lock_30): Ditto.
	(gomp_unset_lock_30): Ditto.
	(gomp_test_lock_30): Ditto.
	(gomp_init_nest_lock_30): Ditto.
	(gomp_destroy_nest_lock_30): Ditto.
	(gomp_set_nest_lock_30): Ditto.
	(gomp_unset_nest_lock_30): Ditto.
	(gomp_test_nest_lock_30): Ditto.
	* lock.c: New.
	* config/nvptx/lock.c: New.
	* config/nvptx/bar.c: New.
	* config/nvptx/bar.h: New.
	* config/nvptx/doacross.h: New.
	* config/nvptx/error.c: New.
	* config/nvptx/icv-device.c: New.
	* config/nvptx/mutex.h: New.
	* config/nvptx/pool.h: New.
	* config/nvptx/proc.c: New.
	* config/nvptx/ptrlock.h: New.
	* config/nvptx/sem.h: New.
	* config/nvptx/simple-bar.h: New.
	* config/nvptx/target.c: New.
	* config/nvptx/task.c: New.
	* config/nvptx/team.c: New.
	* config/nvptx/time.c: New.
	* config/posix/simple-bar.h: New.
	* libgomp.h: Guard pthread.h inclusion.  Include simple-bar.h.
	(gomp_num_teams_var): Declare.
	(struct gomp_thread_pool): Change threads_dock member to
	gomp_simple_barrier_t.
	[__nvptx__] (gomp_thread): New implementation.
	(gomp_thread_attr): Guard by LIBGOMP_USE_PTHREADS.
	(gomp_thread_destructor): Ditto.
	(gomp_init_thread_affinity): Ditto.
	* team.c: Guard uses of Pthreads-specific interfaces by
	LIBGOMP_USE_PTHREADS.  Adjust all uses of threads_dock.
	(gomp_free_thread) [__nvptx__]: Do not call 'free'.

	* config/nvptx/alloc.c: Delete.
	* config/nvptx/barrier.c: Ditto.
	* config/nvptx/fortran.c: Ditto.
	* config/nvptx/iter.c: Ditto.
	* config/nvptx/iter_ull.c: Ditto.
	* config/nvptx/loop.c: Ditto.
	* config/nvptx/loop_ull.c: Ditto.
	* config/nvptx/ordered.c: Ditto.
	* config/nvptx/parallel.c: Ditto.
	* config/nvptx/priority_queue.c: Ditto.
	* config/nvptx/sections.c: Ditto.
	* config/nvptx/single.c: Ditto.
	* config/nvptx/splay-tree.c: Ditto.
	* config/nvptx/work.c: Ditto.

	* testsuite/libgomp.fortran/fortran.exp (lang_link_flags): Pass
	-foffload=-lgfortran in addition to -lgfortran.
	* testsuite/libgomp.oacc-fortran/fortran.exp (lang_link_flags): Ditto.

	* plugin/plugin-nvptx.c: Include <limits.h>.
	(struct targ_fn_descriptor): Add new fields.
	(struct ptx_device): Ditto.  Set them...
	(nvptx_open_device): ...here.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(GOMP_OFFLOAD_get_caps): Add GOMP_OFFLOAD_CAP_OPENMP_400.
	(link_ptx): Adjust log sizes.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(nvptx_set_clocktick): New.  Use it...
	(GOMP_OFFLOAD_load_image): ...here.  Set new targ_fn_descriptor
	fields.
	(GOMP_OFFLOAD_dev2dev): New.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_stacks_size): New.
	(nvptx_stacks_alloc): New.
	(nvptx_stacks_free): New.
	(GOMP_OFFLOAD_run): New.
	(GOMP_OFFLOAD_async_run): New (stub).

Co-Authored-By: Dmitry Melnik <dm@ispras.ru>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r242789
2016-11-23 21:36:41 +03:00
Jeff Law 6251fe936f * config/mcore/mcore.c (emit_new_cond_insn): Fix prototype.
From-SVN: r242788
2016-11-23 11:15:49 -07:00
Jeff Law 7d1f0a00ed iq2000.c (iq2000_rtx_costs): Avoid multiplication in boolean context warning.
* config/iq2000/iq2000.c (iq2000_rtx_costs): Avoid multiplication
	in boolean context warning.

From-SVN: r242787
2016-11-23 11:10:53 -07:00
Prathamesh Kulkarni cfe3d65388 re PR middle-end/78153 (strlen return value can be assumed to be less than PTRDIFF_MAX)
2016-11-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR middle-end/78153
	* gimple-fold.c (fold_stmt_1): Handle case for GIMPLE_RETURN.
	* tree-vrp.c (extract_range_basic): Handle case for
	CFN_BUILT_IN_STRLEN.

testsuite/
	* gcc.dg/tree-ssa/pr78153-1.c: New test.
	* gcc.dg/tree-ssa/pr78153-2.c: Likewise.

From-SVN: r242786
2016-11-23 18:04:14 +00:00
Jeff Law 017fdefeb3 * config/ia64/ia64.c (ia64_emit_insn_before): Fix prototype.
From-SVN: r242785
2016-11-23 10:55:57 -07:00
James Greenhalgh 5774b1fa53 [Patch ARM 17/17] Enable _Float16 for ARM and fix PR target/63250
gcc/

	PR target/63250
	* config/arm/arm-builtins.c (arm_simd_floatHF_type_node): Rename to...
	(arm_fp16_type_node): ...This, make visibile.
	(arm_simd_builtin_std_type): Rename arm_simd_floatHF_type_node to
	arm_fp16_type_node.
	(arm_init_simd_builtin_types): Likewise.
	(arm_init_fp16_builtins): Likewise.
	* config/arm/arm.c (arm_excess_precision): New.
	(arm_floatn_mode): Likewise.
	(TARGET_C_EXCESS_PRECISION): Likewise.
	(TARGET_FLOATN_MODE): Likewise.
	(arm_promoted_type): Only promote arm_fp16_type_node.
	* config/arm/arm.h (arm_fp16_type_node): Declare.

gcc/testsuite/

	PR target/63250
	* lib/target-supports.exp (add_options_for_float16): Add
	-mfp16-format=ieee when testign arm*-*-*.

From-SVN: r242784
2016-11-23 17:36:21 +00:00
James Greenhalgh 5e0f10a0f5 [Patch 16/17 libgcc ARM] Half to double precision conversions
gcc/

	* config/arm/arm.c (arm_convert_to_type): Delete.
	(TARGET_CONVERT_TO_TYPE): Delete.
	(arm_init_libfuncs): Enable trunc_optab from DFmode to HFmode.
	(arm_libcall_uses_aapcs_base): Add trunc_optab from DF- to HFmode.
	* config/arm/arm.h (TARGET_FP16_TO_DOUBLE): New.
	* config/arm/arm.md (truncdfhf2): Only convert through SFmode if we
	are in fast math mode, and have no single step hardware instruction.
	(extendhfdf2): Only expand through SFmode if we don't have a
	single-step hardware instruction.
	* config/arm/vfp.md (*truncdfhf2): New.
	(extendhfdf2): Likewise.

gcc/testsuite/

	* gcc.target/arm/fp16-rounding-alt-1.c (ROUNDED): Change expected
	result.
	* gcc.target/arm/fp16-rounding-ieee-1.c (ROUNDED): Change expected
	result.

From-SVN: r242783
2016-11-23 17:33:39 +00:00