Commit Graph

161127 Commits

Author SHA1 Message Date
Richard Biener
4be63d9e5e re PR bootstrap/85571 (non-bootstrap-debug miscompare with trunk)
2018-05-08  Richard Biener  <rguenther@suse.de>

	PR bootstrap/85571
	config/
	* bootstrap-lto-noplugin.mk: Disable compare.
	* bootstrap-lto.mk: Supply contrib/compare-lto for do-compare.

	contrib/
	* compare-lto: New script derived from compare-debug.

From-SVN: r260026
2018-05-08 08:50:33 +00:00
Richard Biener
ab7d466dc7 re PR tree-optimization/85588 (-fwrapv miscompilation)
2018-05-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/85588
	* gcc.dg/torture/pr85574.c: Rename to...
	* gcc.dg/torture/pr85588.c: ... this.

From-SVN: r260024
2018-05-08 07:55:24 +00:00
Thomas Koenig
b573f93198 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* check.c (gfc_check_minmaxloc): Remove error for BACK not being
	implemented.  Use gfc_logical_4_kind for BACK.
	* simplify.c (min_max_choose): Add optional argument back_val.
	Handle it.
	(simplify_minmaxloc_to_scalar): Add argument back_val. Pass
	back_val to min_max_choose.
	(simplify_minmaxloc_to_nodim): Likewise.
	(simplify_minmaxloc_to_array): Likewise.
	(gfc_simplify_minmaxloc): Add argument back, handle it.
	Pass back_val to specific simplification functions.
	(gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
	pass it on to gfc_simplify_minmaxloc.
	(gfc_simplify_maxloc): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
	comment. If BACK is true, use greater or equal (or lesser or
	equal) insteal of greater (or lesser). Mark the condition of
	having found a value which exceeds the limit as unlikely.

2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* m4/iforeach-s.m4: Remove assertion that back is zero.
	* m4/iforeach.m4: Likewise.  Remove leading 'do'
	before implementation start.
	* m4/ifunction-s.m4: Remove assertion that back is zero.
	* m4/ifunction.m4: Likewise.  Remove for loop if HAVE_BACK_ARG
	is defined.
	* m4/maxloc0.m4: Reorganize loops. Split loops between >= and =,
	depending if back is true.  Mark the condition of having
	found a value which exceeds the limit as unlikely.
	* m4/minloc0.m4: Likewise.
	* m4/maxloc1.m4: Likewise.
	* m4/minloc1.m4: Likewise.
	* m4/maxloc1s.m4: Handle back argument.
	* m4/minloc1s.m4: Likewise.
	* m4/maxloc2s.m4: Remove assertion that back is zero.
	Remove special handling of loop start. Handle back argument.
	* m4/minloc2s.m4: Likewise.
	* generated/iall_i1.c: Regenerated.
	* generated/iall_i16.c: Regenerated.
	* generated/iall_i2.c: Regenerated.
	* generated/iall_i4.c: Regenerated.
	* generated/iall_i8.c: Regenerated.
	* generated/iany_i1.c: Regenerated.
	* generated/iany_i16.c: Regenerated.
	* generated/iany_i2.c: Regenerated.
	* generated/iany_i4.c: Regenerated.
	* generated/iany_i8.c: Regenerated.
	* generated/iparity_i1.c: Regenerated.
	* generated/iparity_i16.c: Regenerated.
	* generated/iparity_i2.c: Regenerated.
	* generated/iparity_i4.c: Regenerated.
	* generated/iparity_i8.c: Regenerated.
	* generated/maxloc0_16_i1.c: Regenerated.
	* generated/maxloc0_16_i16.c: Regenerated.
	* generated/maxloc0_16_i2.c: Regenerated.
	* generated/maxloc0_16_i4.c: Regenerated.
	* generated/maxloc0_16_i8.c: Regenerated.
	* generated/maxloc0_16_r10.c: Regenerated.
	* generated/maxloc0_16_r16.c: Regenerated.
	* generated/maxloc0_16_r4.c: Regenerated.
	* generated/maxloc0_16_r8.c: Regenerated.
	* generated/maxloc0_16_s1.c: Regenerated.
	* generated/maxloc0_16_s4.c: Regenerated.
	* generated/maxloc0_4_i1.c: Regenerated.
	* generated/maxloc0_4_i16.c: Regenerated.
	* generated/maxloc0_4_i2.c: Regenerated.
	* generated/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r10.c: Regenerated.
	* generated/maxloc0_4_r16.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_4_s1.c: Regenerated.
	* generated/maxloc0_4_s4.c: Regenerated.
	* generated/maxloc0_8_i1.c: Regenerated.
	* generated/maxloc0_8_i16.c: Regenerated.
	* generated/maxloc0_8_i2.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r10.c: Regenerated.
	* generated/maxloc0_8_r16.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc0_8_s1.c: Regenerated.
	* generated/maxloc0_8_s4.c: Regenerated.
	* generated/maxloc1_16_i1.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i2.c: Regenerated.
	* generated/maxloc1_16_i4.c: Regenerated.
	* generated/maxloc1_16_i8.c: Regenerated.
	* generated/maxloc1_16_r10.c: Regenerated.
	* generated/maxloc1_16_r16.c: Regenerated.
	* generated/maxloc1_16_r4.c: Regenerated.
	* generated/maxloc1_16_r8.c: Regenerated.
	* generated/maxloc1_16_s1.c: Regenerated.
	* generated/maxloc1_16_s4.c: Regenerated.
	* generated/maxloc1_4_i1.c: Regenerated.
	* generated/maxloc1_4_i16.c: Regenerated.
	* generated/maxloc1_4_i2.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r10.c: Regenerated.
	* generated/maxloc1_4_r16.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_4_s1.c: Regenerated.
	* generated/maxloc1_4_s4.c: Regenerated.
	* generated/maxloc1_8_i1.c: Regenerated.
	* generated/maxloc1_8_i16.c: Regenerated.
	* generated/maxloc1_8_i2.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r10.c: Regenerated.
	* generated/maxloc1_8_r16.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxloc1_8_s1.c: Regenerated.
	* generated/maxloc1_8_s4.c: Regenerated.
	* generated/maxloc2_16_s1.c: Regenerated.
	* generated/maxloc2_16_s4.c: Regenerated.
	* generated/maxloc2_4_s1.c: Regenerated.
	* generated/maxloc2_4_s4.c: Regenerated.
	* generated/maxloc2_8_s1.c: Regenerated.
	* generated/maxloc2_8_s4.c: Regenerated.
	* generated/maxval_i1.c: Regenerated.
	* generated/maxval_i16.c: Regenerated.
	* generated/maxval_i2.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r10.c: Regenerated.
	* generated/maxval_r16.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_16_i1.c: Regenerated.
	* generated/minloc0_16_i16.c: Regenerated.
	* generated/minloc0_16_i2.c: Regenerated.
	* generated/minloc0_16_i4.c: Regenerated.
	* generated/minloc0_16_i8.c: Regenerated.
	* generated/minloc0_16_r10.c: Regenerated.
	* generated/minloc0_16_r16.c: Regenerated.
	* generated/minloc0_16_r4.c: Regenerated.
	* generated/minloc0_16_r8.c: Regenerated.
	* generated/minloc0_16_s1.c: Regenerated.
	* generated/minloc0_16_s4.c: Regenerated.
	* generated/minloc0_4_i1.c: Regenerated.
	* generated/minloc0_4_i16.c: Regenerated.
	* generated/minloc0_4_i2.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r10.c: Regenerated.
	* generated/minloc0_4_r16.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_4_s1.c: Regenerated.
	* generated/minloc0_4_s4.c: Regenerated.
	* generated/minloc0_8_i1.c: Regenerated.
	* generated/minloc0_8_i16.c: Regenerated.
	* generated/minloc0_8_i2.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r10.c: Regenerated.
	* generated/minloc0_8_r16.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc0_8_s1.c: Regenerated.
	* generated/minloc0_8_s4.c: Regenerated.
	* generated/minloc1_16_i1.c: Regenerated.
	* generated/minloc1_16_i16.c: Regenerated.
	* generated/minloc1_16_i2.c: Regenerated.
	* generated/minloc1_16_i4.c: Regenerated.
	* generated/minloc1_16_i8.c: Regenerated.
	* generated/minloc1_16_r10.c: Regenerated.
	* generated/minloc1_16_r16.c: Regenerated.
	* generated/minloc1_16_r4.c: Regenerated.
	* generated/minloc1_16_r8.c: Regenerated.
	* generated/minloc1_16_s1.c: Regenerated.
	* generated/minloc1_16_s4.c: Regenerated.
	* generated/minloc1_4_i1.c: Regenerated.
	* generated/minloc1_4_i16.c: Regenerated.
	* generated/minloc1_4_i2.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r10.c: Regenerated.
	* generated/minloc1_4_r16.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_4_s1.c: Regenerated.
	* generated/minloc1_4_s4.c: Regenerated.
	* generated/minloc1_8_i1.c: Regenerated.
	* generated/minloc1_8_i16.c: Regenerated.
	* generated/minloc1_8_i2.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r10.c: Regenerated.
	* generated/minloc1_8_r16.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minloc1_8_s1.c: Regenerated.
	* generated/minloc1_8_s4.c: Regenerated.
	* generated/minloc2_16_s1.c: Regenerated.
	* generated/minloc2_16_s4.c: Regenerated.
	* generated/minloc2_4_s1.c: Regenerated.
	* generated/minloc2_4_s4.c: Regenerated.
	* generated/minloc2_8_s1.c: Regenerated.
	* generated/minloc2_8_s4.c: Regenerated.
	* generated/minval_i1.c: Regenerated.
	* generated/minval_i16.c: Regenerated.
	* generated/minval_i2.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r10.c: Regenerated.
	* generated/minval_r16.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/norm2_r10.c: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/norm2_r4.c: Regenerated.
	* generated/norm2_r8.c: Regenerated.
	* generated/parity_l1.c: Regenerated.
	* generated/parity_l16.c: Regenerated.
	* generated/parity_l2.c: Regenerated.
	* generated/parity_l4.c: Regenerated.
	* generated/parity_l8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i1.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i2.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r10.c: Regenerated.
	* generated/product_r16.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c10.c: Regenerated.
	* generated/sum_c16.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i1.c: Regenerated.
	* generated/sum_i16.c: Regenerated.
	* generated/sum_i2.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r10.c: Regenerated.
	* generated/sum_r16.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/54613
	* gfortran.dg/minmaxloc_12.f90: New test case.
	* gfortran.dg/minmaxloc_13.f90: New test case.

From-SVN: r260023
2018-05-08 07:47:19 +00:00
GCC Administrator
6404980cf3 Daily bump.
From-SVN: r260021
2018-05-08 00:16:36 +00:00
Jason Merrill
6b83a3c6e3 PR c++/85646 - lambda visibility.
* decl2.c (determine_visibility): Don't mess with template arguments
	from the containing scope.
	(vague_linkage_p): Check DECL_ABSTRACT_P before looking at a 'tor
	thunk.

From-SVN: r260017
2018-05-07 19:50:16 -04:00
Nathan Sidwell
ee336e846d [C++ PATCH] Kill -fno-for-scope
https://gcc.gnu.org/ml/gcc-patches/2018-05/msg00299.html
	gcc/cp/
	Remove fno-for-scope
	* cp-tree.h (DECL_ERROR_REPORTED, DECL_DEAD_FOR_LOCAL)
	(DECL_HAS_SHADOWED_FOR_VAR_P, DECL_SHADOWED_FOR_VAR)
	(SET_DECL_SHADOWED_FOR_VAR): Delete.
	(decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert)
	(check_for_out_of_scope_variable, init_shadowed_var_for_decl):
	Don't declare.
	* name-lookup.h (struct cp_binding_level): Remove
	dead_vars_from_for field.
	* cp-lang.c (cp_init_ts): Delete.
	(LANG_HOOKS_INIT_TS): Override to cp_common_init_ts.
	* cp-objcp-common.c (shadowed_var_for_decl): Delete.
	(decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert)
	(init_shadowed_var_for_decl): Delete.
	* decl.c (poplevel): Remove shadowed for var handling.
	(cxx_init_decl_processing): Remove -ffor-scope deprecation.
	* name-lookup.c (find_local_binding): Remove shadowed for var
	handling.
	(check_local_shadow): Likewise.
	(check_for_out_of_scope_variable): Delete.
	* parser.c (cp_parser_primary_expression): Remove shadowed for var
	handling.
	* pt.c (tsubst_decl): Remove DECL_DEAD_FOR_LOCAL setting.
	* semantics.c (begin_for_scope): Always have a scope.
	(begin_for_stmt, finish_for_stmt): Remove ARM-for scope handling.
	(begin_range_for_stmt, finish_id_expression): Likewise.

	gcc/
	* doc/invoke.texi (C++ Dialect Options): Remove -ffor-scope.
	* doc/extend.texi (Deprecated Features): Remove -fno-for-scope
	(Backwards Compatibility): Likewise.

	c-family/
	* c.opt (ffor-scope): Remove functionality, issue warning.

	gcc/objcp/
	* objcp-lang.c (objcxx_init_ts): Don't call init_shadowed_var_for_decl.

	gcc/testsuite/
	* g++.dg/cpp0x/range-for10.C: Delete.
	* g++.dg/ext/forscope1.C: Delete.
	* g++.dg/ext/forscope2.C: Delete.
	* g++.dg/template/for1.C: Delete.

From-SVN: r260015
2018-05-07 23:04:22 +00:00
Jason Merrill
1d473b8b9d PR c++/85618 - ICE with initialized VLA.
* tree.c (vla_type_p): New.
	* typeck2.c (store_init_value, split_nonconstant_init_1): Check it
	rather than array_of_runtime_bound_p.

From-SVN: r260012
2018-05-07 15:22:35 -04:00
Jonathan Wakely
b83f5981c1 Document -lstdc++fs requirement for std::filesystem
* doc/xml/manual/using.xml (table.cmd_options): Document that the
	C++17 Filesystem implementation also needs -lstdc++fs.

From-SVN: r260011
2018-05-07 20:17:16 +01:00
Jeff Law
0d1f4de97d scanner.c (preprocessor_line): Call linemap_add after a line directive that changes the current filename.
* scanner.c (preprocessor_line): Call linemap_add after a line
	directive that changes the current filename.

	* gfortran.dg/linefile.f90: New test.

From-SVN: r260010
2018-05-07 12:24:59 -06:00
Jonathan Wakely
a989f6378b PR libstdc++/85671 allow copy elision in path concatenation
By performing the /= operation on a named local variable instead of a
temporary the copy made for the return value can be elided.

	PR libstdc++/85671
	* include/bits/fs_path.h (operator/): Permit copy elision.
	* include/experimental/bits/fs_path.h (operator/): Likewise.

From-SVN: r260009
2018-05-07 18:26:28 +01:00
Edward Smith-Rowland
6fa8c51f72 Moar PR libstdc++/80506
2018-05-07  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Moar PR libstdc++/80506
	* include/bits/random.tcc (gamma_distribution::__generate_impl()):
	Fix magic number used in loop condition.

Actually put the file in.
Don't know what my problem is today...

From-SVN: r260008
2018-05-07 16:59:08 +00:00
Amaan Cheval
e5f1cdb1b0 config.host (x86_64-*-rtems*): Build crti.o and crtn.o.
2018-05-07  Amaan Cheval  <amaan.cheval@gmail.com>

	* config.host (x86_64-*-rtems*): Build crti.o and crtn.o.

From-SVN: r260007
2018-05-07 16:32:09 +00:00
Edward Smith-Rowland
228aa0ec8d Moar PR libstdc++/80506
2018-05-07  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Moar PR libstdc++/80506
	* include/bits/random.tcc (gamma_distribution::__generate_impl()):
	Fix magic number used in loop condition.

From-SVN: r260004
2018-05-07 16:17:32 +00:00
Edward Smith-Rowland
eda0ab6ec6 Rollback bad commits! Sorry!
From-SVN: r260003
2018-05-07 16:13:48 +00:00
Edward Smith-Rowland
b118dfdb6d Revert 20001.
From-SVN: r260002
2018-05-07 16:02:46 +00:00
Edward Smith-Rowland
c69c7d0381 Moar PR libstdc++/80506
2018-05-07  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Moar PR libstdc++/80506
	* include/bits/random.tcc (gamma_distribution::__generate_impl()):
	Fix magic number used in loop condition.

From-SVN: r260001
2018-05-07 15:55:11 +00:00
Luis Machado
47811d7dbe re PR bootstrap/85681 (r259995 breaks bootstrap on x86_64-*-freebsd)
2018-05-07  Luis Machado  <luis.machado@linaro.org>

	PR bootstrap/85681
	Revert:
	2018-05-07  Luis Machado  <luis.machado@linaro.org>

	* config/aarch64/aarch64-protos.h (cpu_prefetch_tune)
	<prefetch_dynamic_strides>: New const bool field.
	* config/aarch64/aarch64.c (generic_prefetch_tune): Update to include
	prefetch_dynamic_strides.
	(exynosm1_prefetch_tune): Likewise.
	(thunderxt88_prefetch_tune): Likewise.
	(thunderx_prefetch_tune): Likewise.
	(thunderx2t99_prefetch_tune): Likewise.
	(qdf24xx_prefetch_tune): Likewise. Set prefetch_dynamic_strides to false.
	(aarch64_override_options_internal): Update to set
	PARAM_PREFETCH_DYNAMIC_STRIDES.
	* doc/invoke.texi (prefetch-dynamic-strides): Document new option.
	* params.def (PARAM_PREFETCH_DYNAMIC_STRIDES): New.
	* params.h (PARAM_PREFETCH_DYNAMIC_STRIDES): Define.
	* tree-ssa-loop-prefetch.c (should_issue_prefetch_p): Account for
	prefetch-dynamic-strides setting.

	2018-05-07  Luis Machado  <luis.machado@linaro.org>

	* config/aarch64/aarch64-protos.h (cpu_prefetch_tune)
	<minimum_stride>: New const int field.
	* config/aarch64/aarch64.c (generic_prefetch_tune): Update to include
	minimum_stride field.
	(exynosm1_prefetch_tune): Likewise.
	(thunderxt88_prefetch_tune): Likewise.
	(thunderx_prefetch_tune): Likewise.
	(thunderx2t99_prefetch_tune): Likewise.
	(qdf24xx_prefetch_tune): Likewise. Set minimum_stride to 2048.
	(aarch64_override_options_internal): Update to set
	PARAM_PREFETCH_MINIMUM_STRIDE.
	* doc/invoke.texi (prefetch-minimum-stride): Document new option.
	* params.def (PARAM_PREFETCH_MINIMUM_STRIDE): New.
	* params.h (PARAM_PREFETCH_MINIMUM_STRIDE): Define.
	* tree-ssa-loop-prefetch.c (should_issue_prefetch_p): Return false if
	stride is constant and is below the minimum stride threshold.

From-SVN: r260000
2018-05-07 15:47:14 +00:00
Luis Machado
fd056e39d1 Fix gcc/ChangeLog.
From-SVN: r259999
2018-05-07 14:36:39 +00:00
Luis Machado
725e2110e4 aarch64.c (qdf24xx_prefetch_tune): Set to 512.
2018-05-07  Luis Machado  <luis.machado@linaro.org>

	* config/aarch64/aarch64.c (qdf24xx_prefetch_tune) <l2_cache_size>: Set
	to 512.

From-SVN: r259998
2018-05-07 14:34:46 +00:00
Luis Machado
005e72b9dd Introduce prefetch-dynamic-strides option.
The following patch adds an option to control software prefetching of memory
references with non-constant/unknown strides.

Currently we prefetch these references if the pass thinks there is benefit to
doing so. But, since this is all based on heuristics, it's not always the case
that we end up with better performance.

For Falkor there is also the problem of conflicts with the hardware prefetcher,
so we need to be more conservative in terms of what we issue software prefetch
hints for.

This also aligns GCC with what LLVM does for Falkor.

Similarly to the previous patch, the defaults guarantee no change in behavior
for other targets and architectures.

2018-05-07  Luis Machado  <luis.machado@linaro.org>

	gcc/
	* config/aarch64/aarch64-protos.h (cpu_prefetch_tune)
	<prefetch_dynamic_strides>: New const bool field.
	* config/aarch64/aarch64.c (generic_prefetch_tune): Update to include
	prefetch_dynamic_strides.
	(exynosm1_prefetch_tune): Likewise.
	(thunderxt88_prefetch_tune): Likewise.
	(thunderx_prefetch_tune): Likewise.
	(thunderx2t99_prefetch_tune): Likewise.
	(qdf24xx_prefetch_tune): Likewise. Set prefetch_dynamic_strides to false.
	(aarch64_override_options_internal): Update to set
	PARAM_PREFETCH_DYNAMIC_STRIDES.
	* doc/invoke.texi (prefetch-dynamic-strides): Document new option.
	* params.def (PARAM_PREFETCH_DYNAMIC_STRIDES): New.
	* params.h (PARAM_PREFETCH_DYNAMIC_STRIDES): Define.
	* tree-ssa-loop-prefetch.c (should_issue_prefetch_p): Account for
	prefetch-dynamic-strides setting.

From-SVN: r259996
2018-05-07 14:12:54 +00:00
Luis Machado
57e2d1175c Introduce prefetch-minimum stride option
This patch adds a new option to control the minimum stride, for a memory
reference, after which the loop prefetch pass may issue software prefetch
hints for. There are two motivations:

* Make the pass less aggressive, only issuing prefetch hints for bigger strides
that are more likely to benefit from prefetching. I've noticed a case in cpu2017
where we were issuing thousands of hints, for example.

* For processors that have a hardware prefetcher, like Falkor, it allows the
loop prefetch pass to defer prefetching of smaller (less than the threshold)
strides to the hardware prefetcher instead. This prevents conflicts between
the software prefetcher and the hardware prefetcher.

I've noticed considerable reduction in the number of prefetch hints and
slightly positive performance numbers. This aligns GCC and LLVM in terms of
prefetch behavior for Falkor.

The default settings should guarantee no changes for existing targets. Those
are free to tweak the settings as necessary.

2018-05-07  Luis Machado  <luis.machado@linaro.org>

	Introduce option to limit software prefetching to known constant
	strides above a specific threshold with the goal of preventing
	conflicts with a hardware prefetcher.

	gcc/
	* config/aarch64/aarch64-protos.h (cpu_prefetch_tune)
	<minimum_stride>: New const int field.
	* config/aarch64/aarch64.c (generic_prefetch_tune): Update to include
	minimum_stride field.
	(exynosm1_prefetch_tune): Likewise.
	(thunderxt88_prefetch_tune): Likewise.
	(thunderx_prefetch_tune): Likewise.
	(thunderx2t99_prefetch_tune): Likewise.
	(qdf24xx_prefetch_tune): Likewise. Set minimum_stride to 2048.
	(aarch64_override_options_internal): Update to set
	PARAM_PREFETCH_MINIMUM_STRIDE.
	* doc/invoke.texi (prefetch-minimum-stride): Document new option.
	* params.def (PARAM_PREFETCH_MINIMUM_STRIDE): New.
	* params.h (PARAM_PREFETCH_MINIMUM_STRIDE): Define.
	* tree-ssa-loop-prefetch.c (should_issue_prefetch_p): Return false if
	stride is constant and is below the minimum stride threshold.

From-SVN: r259995
2018-05-07 14:08:55 +00:00
Christophe Lyon
4826f48ec9 [testsuite] gcc.dg/nextafter-2.c: Restrict to c99_runtime
2018-05-07  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.dg/nextafter-2.c: Add c99_runtime effective target
	and options.

From-SVN: r259994
2018-05-07 15:49:03 +02:00
Tom de Vries
37d6c719c4 [openacc, testsuite] Allow installed testing of libgomp to find gomp-constants.h
2018-05-07  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85677
	* testsuite/lib/libgomp.exp (libgomp_init): Move inclusion of top-level
	include directory in ALWAYS_CFLAGS out of $blddir != "" condition.

From-SVN: r259992
2018-05-07 11:33:45 +00:00
GCC Administrator
c3250a3647 Daily bump.
From-SVN: r259986
2018-05-07 00:16:17 +00:00
Jakub Jelinek
d5754d94e4 re PR c++/85659 (ICE with inline assembly inside virtual function)
PR c++/85659
	* cfgexpand.c (expand_asm_stmt): Don't create a temporary if
	the type is addressable.  Don't force op into register if it has
	BLKmode.

	* g++.dg/ext/asm14.C: New test.
	* g++.dg/ext/asm15.C: New test.
	* g++.dg/ext/asm16.C: New test.

From-SVN: r259981
2018-05-06 23:14:35 +02:00
Michael Eager
a9856a8d08 picdtr.c: Correct option -fPIE -mpic-data-is-text-relative.
2018-05-06  Michael Eager  <eager@eagercon.com>

	* gcc.target/microblaze/others/picdtr.c: Correct option
	 -fPIE -mpic-data-is-text-relative.

From-SVN: r259976
2018-05-06 11:46:07 +00:00
Andrew Sadek
b0e69bd698 picdtr.c: Add test for -fPIE -mpic-data-is-text-relative.
2018-05-06  Andrew Sadek  <andrew.sadek.se@gmail.com>

	* gcc.target/microblaze/others/picdtr.c: Add test for 
	 -fPIE -mpic-data-is-text-relative.

From-SVN: r259975
2018-05-06 11:42:06 +00:00
Andre Vehreschild
8309b221a0 re PR fortran/85507 (ICE in gfc_dep_resolver, at fortran/dependency.c:2258)
gcc/fortran/ChangeLog:

2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/85507
	* dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
	introduced by r259385.
	* trans-intrinsic.c (conv_caf_send): Always report a dependency for
	same variables in coarray assignments.

gcc/testsuite/ChangeLog:

2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/85507
	* gfortran.dg/coarray_dependency_1.f90: New test.
	* gfortran.dg/coarray_lib_comm_1.f90: Fix counting caf-expressions.

From-SVN: r259974
2018-05-06 13:19:31 +02:00
GCC Administrator
17b906c3b9 Daily bump.
From-SVN: r259973
2018-05-06 00:16:34 +00:00
Roland McGrath
f9ede95714 PR other/77609: Let the assembler choose ELF section types for miscellaneous named sections
gcc/
	PR other/77609
	* varasm.c (default_section_type_flags): Set SECTION_NOTYPE for
	any section for which we don't know a specific type it should have,
	regardless of name.  Previously this was done only for the exact
	names ".init_array", ".fini_array", and ".preinit_array".
	(default_elf_asm_named_section): Add comment about
	relationship with default_section_type_flags and SECTION_NOTYPE.
	(get_section): Don't consider it a type conflict if one side has
	SECTION_NOTYPE and the other doesn't, as long as neither has the
	SECTION_BSS et al used in the default_section_type_flags logic.

From-SVN: r259969
2018-05-05 23:35:25 +00:00
Tom de Vries
212513950c [nvptx] Add workaround for subsequent bar.syncs
2018-05-05  Tom de Vries  <tom@codesourcery.com>

	PR target/85653
	* config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_3): Define.
	(workaround_barsyncs): New function.
	(nvptx_reorg): Use workaround_barsyncs.
	* config/nvptx/nvptx.md (define_c_enum "unspecv"): Add UNSPECV_MEMBAR.
	(define_expand "nvptx_membar_cta"): New define_expand.
	(define_insn "*nvptx_membar_cta"): New insn.

From-SVN: r259967
2018-05-05 07:56:21 +00:00
Paolo Carlini
39d8c7d2c1 cvt.c (ocp_convert): Early handle the special case of a null_ptr_cst_p expr converted to a...
2018-05-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* cvt.c (ocp_convert): Early handle the special case of a
	null_ptr_cst_p expr converted to a NULLPTR_TYPE_P type.

From-SVN: r259966
2018-05-05 07:39:36 +00:00
GCC Administrator
c3f57fa100 Daily bump.
From-SVN: r259965
2018-05-05 00:16:34 +00:00
Pekka Jääskeläinen
73def6eadc [BRIGFE] Fix handling of NOPs.
From-SVN: r259958
2018-05-04 19:46:16 +00:00
Pekka Jääskeläinen
080dc24383 [BRIGFE] phsa-specific optimizations
Add flag -fassume-phsa that is on by default. If -fno-assume-phsa
is given, these optimizations are disabled.

With this flag, gccbrig can generate GENERIC that assumes we are
targeting a phsa-runtime based implementation, which allows us
to expose the work-item context accesses to retrieve WI IDs etc.
which helps optimizers.

First optimization that takes advantage of this is to get rid of
the setworkitemid calls whenever we have non-inlined calls that
use IDs internally.

Other optimizations added in this commit:

- expand absoluteid to similar level of simplicity as workitemid.
At the moment absoluteid is the best indexing ID to end up with
WG vectorization.
- propagate ID variables closer to their uses. This is mainly
to avoid known useless casts, which confuse at least scalar
evolution analysis.
- use signed long long for storing IDs. Unsigned integers have
defined wraparound semantics, which confuse at least scalar
evolution analysis, leading to unvectorizable WI loops.
- also refactor some BRIG function generation helpers to brig_function.
- no point in having the wi-loop as a for-loop. It's really
a do...while and SCEV can analyze it just fine still.
- add consts to ptrs etc. in BRIG builtin defs.
Improves optimization opportunities.
- add qualifiers to generated function parameters.
Const and restrict on the hidden local/private pointers,
the arg buffer and the context pointer help some optimizations.

From-SVN: r259957
2018-05-04 19:43:57 +00:00
Pekka Jääskeläinen
1e25c5a9bb [BRIGFE] skip multiple forward declarations of the same function
From-SVN: r259950
2018-05-04 18:04:14 +00:00
Pekka Jääskeläinen
60a3d46c17 [BRIGFE] do not allow optimizations based on known C builtins
It can break inputs that have similarly named functions.

From-SVN: r259949
2018-05-04 18:01:11 +00:00
Pekka Jääskeläinen
77c42d456e [BRIGFE] allow controlling strict aliasing from cmd line
From-SVN: r259948
2018-05-04 17:58:38 +00:00
Ian Lance Taylor
1c72513315 cmd/go: on AIX, pass -X64 first when invoking ar
Reviewed-on: https://go-review.googlesource.com/111535

From-SVN: r259946
2018-05-04 17:51:46 +00:00
Pekka Jääskeläinen
f986735ac5 [BRIGFE] The modulo in ID computation should not be needed.
The case where a dim is greater than the grid size doesn't seem
to be mentioned in the specs nor tested by PRM test suite.

From-SVN: r259944
2018-05-04 16:47:34 +00:00
Pekka Jääskeläinen
637f3cdec3 [BRIGFE] Enable whole program optimizations
HSA assumes all program scope HSAIL symbols can be queried from
the host runtime API, thus cannot be removed by the IPA.

Getting some inlining happening in the finalized binary required:
* explicitly marking the 'prog' scope functions and the launcher
function "externally_visible" to avoid the inliner removing it
* also the host_def ptr is set to externally visible, otherwise
IPA assumes it's never set
* adding the 'inline' keyword to functions to enable inlining,
otherwise GCC defaults to replaceable functions (one can link
over the previous one) which cannot be inlined
* replacing all calls to declarations with calls to definitions to
enable the inliner to find the definition
* to fix missing hidden argument types in the generated functions.
These were ignored silently until GCC started to be able to
inline calls to such functions.
* do not gimplify before fixing the call targets. Otherwise the
calls get detached and the definitions are not found. The reason
why this happens is not clear, but gimplifying only after call
target decl->def conversion fixes this.

From-SVN: r259943
2018-05-04 16:44:02 +00:00
Pekka Jääskeläinen
1b40975c87 [BRIGFE] fix an alloca stack underflow
We didn't preserve additional space for the alloca frame pointers that
are needed to be saved in the alloca space.

Fixes libgomp.c++/target-6.C execution test.

From-SVN: r259942
2018-05-04 16:40:50 +00:00
Joseph Myers
534fe82334 * uk.po: Update.
From-SVN: r259938
2018-05-04 17:27:11 +01:00
Ian Lance Taylor
cceec1556e re PR go/85630 (GCC 8.1.0: Filesystem pollution during build: .cache dir in $HOME)
PR go/85630
	* Makefile.am (CHECK_ENV): Set GOCACHE.
	(ECHO_ENV): Update for setting of GOCACHE.
	* Makefile.in: Rebuild.

From-SVN: r259937
2018-05-04 16:23:51 +00:00
Carl Love
53481a280f vsx-vector-6.h (foo): Add test for vec_max, vec_trunc.
gcc/testsuite/ChangeLog:

2018-05-04 Carl Love  <cel@us.ibm.com>
	* gcc.target/powerpc/vsx-vector-6.h (foo): Add test for vec_max,
	vec_trunc.
	* gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update xvcmpeqdp,
	xvcmpgtdp, xvcmpgedp counts. Add xxsel counts.
	* gcc.target/powerpc/vsx-vector-6-be.c (dg-final): Update xvcmpgtdp,
	xvcmpgedp counts. Add xxsel counts.

From-SVN: r259936
2018-05-04 16:17:15 +00:00
Ian Lance Taylor
772455c964 libgo: fix for unaligned read in go-unwind.c's read_encoded_value()
Change code to work properly reading unaligned data on architectures
    that don't support unaliged reads. This fixes a regression (broke
    Solaris/sparc) introduced in https://golang.org/cl/90235.
    
    Reviewed-on: https://go-review.googlesource.com/111296

From-SVN: r259935
2018-05-04 14:29:05 +00:00
Alan Modra
71d372eba9 libffi PowerPC64 ELFv1 fp arg fixes
The ELFv1 ABI says: "Single precision floating point values are mapped
to the second word in a single doubleword" and also "Floating point
registers f1 through f13 are used consecutively to pass up to 13
floating point values, one member aggregates passed by value
containing a floating point value, and to pass complex floating point
values".

libffi wasn't expecting float args in the second word, and wasn't
passing one member aggregates in fp registers.  This patch fixes those
problems, making use of the existing ELFv2 homogeneous aggregate
support since a one element fp struct is a special case of an
homogeneous aggregate.

I've also set a flag when returning pointers that might be used one
day.  This is just a tidy since the ppc64 assembly support code
currently doesn't test FLAG_RETURNS_64BITS for integer types..

	* src/powerpc/ffi_linux64.c (discover_homogeneous_aggregate):
	Compile for ELFv1 too, handling single element aggregates.
	(ffi_prep_cif_linux64_core): Call discover_homogeneous_aggregate
	for ELFv1.  Set FLAG_RETURNS_64BITS for FFI_TYPE_POINTER return.
	(ffi_prep_args64): Call discover_homogeneous_aggregate for ELFv1,
	and handle single element structs containing float or double
	as if the element wasn't wrapped in a struct.  Store floats in
	second word of doubleword slot when big-endian.
	(ffi_closure_helper_LINUX64): Similarly.

From-SVN: r259934
2018-05-04 23:17:11 +09:30
Richard Biener
dd17274465 bb-reorder.c (sanitize_hot_paths): Release hot_bbs_to_check.
2018-05-04  Richard Biener  <rguenther@suse.de>

	* bb-reorder.c (sanitize_hot_paths): Release hot_bbs_to_check.
	* gimple-ssa-store-merging.c
	(imm_store_chain_info::output_merged_store): Remove redundant create,
	release split_store vector contents on failure.
	* tree-vect-slp.c (vect_schedule_slp_instance): Avoid leaking
	scalar stmt vector on cache hit.

From-SVN: r259932
2018-05-04 13:33:15 +00:00
Segher Boessenkool
2c2aa74d1d rs6000: Remove Xilinx FP
This removes the special Xilinx FP support.  It was deprecated in
GCC 8.

After this patch all of TARGET_{DOUBLE,SINGLE}_FLOAT,
TARGET_{DF,SF}_INSN, and TARGET_{DF,SF}_FPR are replaced by
TARGET_HARD_FLOAT.  Also the fp_type attribute is deleted.


	* common/config/rs6000/rs6000-common.c (rs6000_handle_option): Remove
	Xilinx FP support.
	* config.gcc (powerpc-xilinx-eabi*): Remove.
	* config/rs6000/predicates.md (easy_fp_constant): Remove Xilinx FP
	support.
	(fusion_addis_mem_combo_load): Ditto.
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Remove Xilinx
	FP support.
	(rs6000_cpu_cpp_builtins): Ditto.
	* config/rs6000/rs6000-linux.c
	(rs6000_linux_float_exceptions_rounding_supported_p): Ditto.
	* config/rs6000/rs6000-opts.h (enum fpu_type_t): Delete.
	* config/rs6000/rs6000.c (rs6000_debug_reg_global): Remove Xilinx FP
	support.
	(rs6000_setup_reg_addr_masks): Ditto.
	(rs6000_init_hard_regno_mode_ok): Ditto.
	(rs6000_option_override_internal): Ditto.
	(legitimate_lo_sum_address_p): Ditto.
	(rs6000_legitimize_address): Ditto.
	(rs6000_legitimize_reload_address): Ditto.
	(rs6000_legitimate_address_p): Ditto.
	(abi_v4_pass_in_fpr): Ditto.
	(setup_incoming_varargs): Ditto.
	(rs6000_gimplify_va_arg): Ditto.
	(rs6000_split_multireg_move): Ditto.
	(rs6000_savres_strategy): Ditto.
	(rs6000_emit_prologue_components): Ditto.
	(rs6000_emit_epilogue_components): Ditto.
	(rs6000_emit_prologue): Ditto.
	(rs6000_emit_epilogue): Ditto.
	(rs6000_elf_file_end): Ditto.
	(rs6000_function_value): Ditto.
	(rs6000_libcall_value): Ditto.
	* config/rs6000/rs6000.h: Ditto.
	(TARGET_MINMAX_SF, TARGET_MINMAX_DF): Delete, merge to ...
	(TARGET_MINMAX): ... this.  New.
	(TARGET_SF_FPR, TARGET_DF_FPR, TARGET_SF_INSN, TARGET_DF_INSN): Delete.
	* config/rs6000/rs6000.md: Remove Xilinx FP support.
	(*movsi_internal1_single): Delete.
	* config/rs6000/rs6000.opt (msingle-float, mdouble-float, msimple-fpu,
	mfpu=, mxilinx-fpu): Delete.
	* config/rs6000/singlefp.h: Delete.
	* config/rs6000/sysv4.h: Remove Xilinx FP support.
	* config/rs6000/t-rs6000: Ditto.
	* config/rs6000/t-xilinx: Delete.
	* gcc/config/rs6000/titan.md: Adjust for fp_type removal.
	* gcc/config/rs6000/vsx.md: Remove Xilinx FP support.
	(VStype_simple): Delete.
	(VSfptype_simple, VSfptype_mul, VSfptype_div, VSfptype_sqrt): Delete.
	* config/rs6000/xfpu.h: Delete.
	* config/rs6000/xfpu.md: Delete.
	* config/rs6000/xilinx.h: Delete.
	* config/rs6000/xilinx.opt: Delete.
	* gcc/doc/invoke.texi (RS/6000 and PowerPC Options): Remove
	-msingle-float, -mdouble-float, -msimple-fpu, -mfpu=, and -mxilinx-fpu.

From-SVN: r259929
2018-05-04 11:36:50 +02:00
Jonathan Wakely
d6ed6b074f PR libstdc++/85642 fix is_nothrow_default_constructible<optional<T>>
Add missing noexcept keyword to default constructor of each
_Optional_payload specialization.

	PR libstdc++/85642 fix is_nothrow_default_constructible<optional<T>>
	* include/std/optional (_Optional_payload): Add noexcept to default
	constructor. Re-indent.
	(_Optional_payload<_Tp, true, true, true>): Likewise. Add noexcept to
	constructor for copying disengaged payloads.
	(_Optional_payload<_Tp, true, false, true>): Likewise.
	(_Optional_payload<_Tp, true, true, false>): Likewise.
	(_Optional_payload<_Tp, true, false, false>): Likewise.
	* testsuite/20_util/optional/cons/85642.cc: New.
	* testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error lines.

From-SVN: r259928
2018-05-04 09:57:23 +01:00