Commit Graph

157631 Commits

Author SHA1 Message Date
Richard Biener
a851ce04f7 re PR fortran/83017 (DO CONCURRENT not parallelizing)
2017-11-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/83017
	* tree-parloops.c (MIN_PER_THREAD): Use --param parloops-min-per-thread.
	(gen_parallel_loop): Properly count iterations.
	(parallelize_loops): Handle loop->can_be_parallel independent
	of flag_loop_parallelize_all.  Make static profitability test match
	the runtime one.
	* params.def (PARAM_PARLOOPS_MIN_PER_THREAD): New.
	* invoke.texi (parloops-min-per-thread): Document.

	* gcc.dg/autopar/pr49960.c: Adjust.

From-SVN: r254867
2017-11-17 13:15:34 +00:00
Vineet Gupta
e716496a55 [ARC] Update GLIBC_DYNAMIC_LINKER
Update GLIBC_DYNAMIC_LINKER per glibc upstreaming review comments:
http://lists.infradead.org/pipermail/linux-snps-arc/2017-June/002634.html

gcc/
	* config/arc/linux.h: GLIBC_DYNAMIC_LINKER update per glibc
	upstreaming review comments

From-SVN: r254866
2017-11-17 13:22:57 +01:00
Sudakshina Das
fdb5fa0c87 [ARM] Fix test armv8_2-fp16-move-1.c
2017-11-17  Sudakshina Das  <sudi.das@arm.com>

	* gcc.target/arm/armv8_2-fp16-move-1.c: Edit vmov scan-assembler
	directives.

From-SVN: r254863
2017-11-17 11:12:09 +00:00
Tamar Christina
6f20350099 expr.c (copy_blkmode_to_reg): Fix bitsize for targets with fast unaligned access.
2017-11-17  Tamar Christina  <tamar.christina@arm.com>

	* expr.c (copy_blkmode_to_reg): Fix bitsize for targets
	with fast unaligned access.
	* doc/sourcebuild.texi (word_mode_no_slow_unalign): New.
	
gcc/testsuite/
2017-11-17  Tamar Christina  <tamar.christina@arm.com>

	* gcc.dg/struct-simple.c: New.
	* lib/target-supports.exp
	(check_effective_target_word_mode_no_slow_unalign): New.

From-SVN: r254862
2017-11-17 10:47:52 +00:00
Thomas Preud'homme
7326cf0fb0 [ARM] Rework expectation for call to Armv8-M nonsecure function
Testcase gcc.target/arm/cmse/cmse-14.c checks whether bar is called via
__gnu_cmse_nonsecure_call libcall and not via a direct call. However the
pattern is a bit surprising in that it needs to explicitely allow "by"
due to allowing anything before the 'b'.

This patch rewrites the logic to look for b as a first non-whitespace
letter followed iby anything (to match bl and conditional branches)
followed by some spaces and then bar.

2017-11-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * gcc.target/arm/cmse/cmse-14.c: Change logic to match branch
    instruction to bar.

From-SVN: r254861
2017-11-17 10:01:33 +00:00
Thomas Preud'homme
cdee9e6b79 [ARM] Fix selection of effective target for cmse tests
Some of the tests in the gcc.target/arm/cmse directory (eg.
gcc.target/arm/cmse/mainline/bitfield-4.c) are failing when run without
an architecture specified in RUNTESTFLAGS due to them not adding the
option to select an Armv8-M architecture.

This patch fixes the issue by adding the right option from the exp file
so that no architecture fiddling is necessary in the individual tests.

2017-11-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * gcc.target/arm/cmse/cmse.exp: Add option to select Armv8-M Baseline
    or Armv8-M Mainline when running the respective tests.
    * gcc.target/arm/cmse/baseline/cmse-11.c: Remove architecture check and
    selection.
    * gcc.target/arm/cmse/baseline/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/baseline/cmse-2.c: Likewise.
    * gcc.target/arm/cmse/baseline/cmse-6.c: Likewise.
    * gcc.target/arm/cmse/baseline/softfp.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-8.c: Likewise.

From-SVN: r254860
2017-11-17 10:01:21 +00:00
Thomas Preud'homme
cbabe49571 [ARM] Fix ICE in Armv8-M Security Extensions code
Commit r253825 which introduced some sanity checks for sbitmap revealed
a bug in the conversion of cmse_nonsecure_entry_clear_before_return ()
to using bitmap structure. bitmap_and expects that the two bitmaps have
the same length, yet the code in
cmse_nonsecure_entry_clear_before_return () have different size for
to_clear_bitmap and to_clear_arg_regs_bitmap, with the assumption that
bitmap_and would behave has if the bits not allocated were in fact zero.
This commit makes sure both bitmap are equally sized.

2017-11-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.c (cmse_nonsecure_entry_clear_before_return): Allocate
    to_clear_arg_regs_bitmap to the same size as to_clear_bitmap.

From-SVN: r254859
2017-11-17 10:00:02 +00:00
Richard Biener
c5e8a8c94a tree-ssa-pre.c (phi_translate_1): Remove redundant constant folding of references.
2017-11-17  Richard Biener  <rguenther@suse.de>

	* tree-ssa-pre.c (phi_translate_1): Remove redundant constant
	folding of references.

From-SVN: r254858
2017-11-17 09:06:54 +00:00
Jakub Jelinek
fa30ba9949 re PR testsuite/82997 (gcc.dg/cpp/sysmac1.c and gcc.dg/cpp/macsyntx.c fail starting with r254707)
PR testsuite/82997
	* gcc.dg/cpp/macsyntx.c (var1, rest): Don't expect
	"requires at least one" warning.
	* gcc.dg/cpp/sysmac1.c (foo): Likewise.
	* gcc.dg/cpp/macsyntx2.c: New test.
	* gcc.dg/cpp/sysmac3.c: New test.
	* gcc.dg/cpp/sysmac3.h: New file.

From-SVN: r254857
2017-11-17 08:42:28 +01:00
Qing Zhao
caed5c9271 re PR middle-end/78809 (Inline strcmp with small constant strings)
2017-11-15  Qing Zhao <qing.zhao@oracle.com>

	PR middle-end/78809
	* gimple-fold.c (gimple_fold_builtin_string_compare): Add handling
	of replacing call to strncmp with corresponding call to strcmp when
	meeting conditions.

	PR middle-end/78809
	* gcc.dg/strcmpopt_1.c: New test.

From-SVN: r254856
2017-11-16 22:32:05 -07:00
Sergey Shalnov
5958557b75 Enable option -mprefer-avx256 as default for Intel Skylake configuration
gcc/
	* config/i386/x86-tune.def (X86_TUNE_AVX256_OPTIMAL): Add tuning
	option prefer-avx256 for skylake-avx512 configuration.
	* config/i386/i386.c (ix86_option_override_internal): Ditto.
	(get_builtin_code_for_version): Ditto.

From-SVN: r254855
2017-11-17 04:56:57 +00:00
Chung-Ju Wu
71d8eff176 [NDS32] Reserve more register numbers for new registers in the future.
gcc/
	* config/nds32/nds32.h (FIRST_PSEUDO_REGISTER): Modify.
	(FIXED_REGISTERS): Reserve more register numbers.
	(CALL_USED_REGISTERS): Likewise.
	(REG_ALLOC_ORDER): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	(REGISTER_NAMES): Likewise.

Co-Authored-By: Monk Chiang <sh.chiang04@gmail.com>

From-SVN: r254854
2017-11-17 04:52:20 +00:00
Chung-Ju Wu
3d7f09de5a Add nds32 vector modes.
gcc/
	* config/nds32/nds32-modes.def: Add vector mode V4QI V2HI V8QI V4HI
	V2SI.
	* config/nds32/iterators.md: Add vector mode iterators and attributes.

Co-Authored-By: Kito Cheng <kito.cheng@gmail.com>

From-SVN: r254853
2017-11-17 04:36:01 +00:00
GCC Administrator
dc8d52b145 Daily bump.
From-SVN: r254852
2017-11-17 00:16:14 +00:00
Marc Glisse
c261ba2c8b Tweak vector::_M_realloc_insert for code size
2017-11-17  Marc Glisse  <marc.glisse@inria.fr>

	* include/bits/vector.tcc (vector::_M_realloc_insert): Cache old
	values before the allocation.

From-SVN: r254849
2017-11-16 23:51:20 +00:00
Steven Munroe
b1e35f49e8 Had a small thinko in the implementation of mmintrin.h _mm_add_pi32 that only shows when compiling for power9.
Had a small thinko in the implementation of mmintrin.h _mm_add_pi32 that only shows
when compiling for power9. A trivial and obvious 2 line patch to fix it.

From-SVN: r254848
2017-11-16 22:50:16 +00:00
Joseph Myers
1e39313ac0 Add -std=c18 etc. option aliases.
ISO C17 won't go to ballot until December, meaning publication of the
standard won't be until 2018, leaving ambiguity as to whether people
will end up referring to the standard as C17, as it's currently known
and which corresponds to the __STDC_VERSION__ value, or C18 based on
the publication date.

In case people end up referring to this standard as C18, this patch
adds corresponding option aliases -std=c18, -std=iso9899:2018,
-std=gnu18 so people can use those names based on publication date if
they wish.  The "expected to be" explanations in help texts and the
manual can be removed as and when the standard is published, hopefully
before GCC 8 is out.

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

gcc:
	* doc/invoke.texi (-std=c17): Refer to 2018 expected publication
	date of C17.
	(-std=c18, -std=iso9899:2018, -std=gnu18): Document option
	aliases.

gcc/c-family:
	* c.opt (-std=c17, std=gnu17, -std=iso9899:2017): Refer to 2018
	expected publication date of C17.
	(-std=c18, -std=gnu18, -std=iso9899:2018): New option aliases.

gcc/testsuite:
	* gcc.dg/c18-version-1.c, gcc.dg/c18-version-2.c: New tests.

From-SVN: r254847
2017-11-16 22:23:30 +00:00
Thomas Koenig
727bd12ea3 re PR bootstrap/82856 (--enable-maintainter-mode broken by incompatiblity of gcc's required automake and modern Perl)
2017-11-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR bootstrap/82856
	* doc/install.texi: Document incompatibility of Perl >=5.6.26
	with the required version of automake 1.11.6.

From-SVN: r254845
2017-11-16 20:24:00 +00:00
Pat Haugen
375aa4bcc7 power9.md (power9fpdiv): New automaton and cpu_unit defined for it.
* rs6000/power9.md (power9fpdiv): New automaton and cpu_unit defined
	for it.
	(DU_C2_3_power9): Correct reservation combinations.
	(FP_DIV_power9, VEC_DIV_power9): New.
	(power9-alu): Split out rotate/shift...
	(power9-rot): ...to here, correct dispatch resource.
	(power9-cracked-alu, power9-mul, power9-mul-compare): Correct dispatch
	resource.
	(power9-fp): Correct latency.
	(power9-sdiv): Add div/sqrt resource.
	(power9-ddiv): Correct latency, add div/sqrt resource.
	(power9-sqrt, power9-dsqrt): Add div/sqrt resource.
	(power9-vecfdiv, power9-vecdiv): Correct latency, add div/sqrt
	resource.
	(power9-qpdiv, power9-qpmul): Adjust resource usage.

From-SVN: r254844
2017-11-16 20:14:22 +00:00
Jason Merrill
6296cf8e09 PR c++/79092 - non-type args of different types are different
* tree.c (cp_tree_equal): Check the type of constants.
	* pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
	when comparing to previously deduced argument.
	(maybe_convert_nontype_argument): New.
	(convert_nontype_argument): Call it.
	(tsubst_copy_and_build): Handle partial instantiation of
	IMPLICIT_CONV_EXPR.
	(unify): Ignore type when deducing from array bound.
	(dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
	(value_dependent_expression_p): Any type-dependent expression is
	value-dependent.  Handle IMPLICIT_CONV_EXPR.
	* cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
	* mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.

From-SVN: r254843
2017-11-16 15:13:48 -05:00
Michael Meissner
285346b5eb rs6000.c (rs6000_expand_builtin): Do not do the switch statement mapping KF built-ins to TF built-ins if...
[gcc]
2017-11-15  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_expand_builtin): Do not do the
	switch statement mapping KF built-ins to TF built-ins if we don't
	have the proper ISA 3.0 assembler support.

[gcc/testsuite]
2017-11-15  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/bfp/bfp.exp: Look for *.c files, not *.c*
	files to prevent ~ files from getting recognized.
	* gcc.target/powerpc/dfp/dfp.exp: Likewise.
	* gcc.target/powerpc/vsu/vsu.exp: Likewise.

From-SVN: r254839
2017-11-16 18:35:42 +00:00
Sergio Durigan Junior
9d99775c34 Makefile.am: Remove references to c-compiler-name.h and cp-compiler-name.h
* Makefile.am: Remove references to c-compiler-name.h and
	cp-compiler-name.h
	* Makefile.in: Regenerate.
	* compiler-name.hh: New file.
	* libcc1.cc: Don't include c-compiler-name.h.  Include
	compiler-name.hh.
	* libcp1.cc: Don't include cp-compiler-name.h.  Include
	compiler-name.hh.

Co-Authored-By: Pedro Alves <palves@redhat.com>

From-SVN: r254838
2017-11-16 11:15:33 -07:00
Henry Linjamäki
dc03239c2d [BRIGFE] Reduce the number of type conversions due to
the untyped HSAIL regs.

Instead of always representing the HSAIL's untyped registers as
unsigned int, the gccbrig now pre-analyzes the BRIG code and
builds the register variables as a type used the most when storing
or reading data to/from each register. This reduces the total
conversions which cannot be always optimized away.

From-SVN: r254837
2017-11-16 17:20:45 +00:00
Jan Hubicka
35a282e0bc tree-emutls.c (lower_emutls_data): Remove unused bb_freq.
* tree-emutls.c (lower_emutls_data): Remove unused bb_freq.
	(lower_emutls_function_body): Do not compute it.

From-SVN: r254836
2017-11-16 16:53:50 +00:00
Jan Hubicka
c2e87766d3 ipa-split.c (split_bb_info): Turn time to sreal.
* ipa-split.c (split_bb_info): Turn time to sreal.
	(split_point): Likewise.
	(dump_split_point): Likewise.
	(fine_split_points): Likewise.
	(execute_split_functions): Only zero split_bbs; turn time to sreals.

From-SVN: r254835
2017-11-16 16:52:20 +00:00
Jan Hubicka
b71289b1ef ipa-fnsummary.c (analyze_function_body): Accumulate time consistently in sreal.
* ipa-fnsummary.c (analyze_function_body): Accumulate time consistently
	in sreal.
	* gcc.dg/ipa/ipcp-2.c: Lower threshold.

From-SVN: r254834
2017-11-16 16:50:47 +00:00
Martin Sebor
913f8c088e PR middle-end/63477 - Bogus warning with -O3 -Warray-bounds: array subscript
PR middle-end/63477 - Bogus warning with -O3 -Warray-bounds: array subscript
is above array bounds

gcc/testsuite/ChangeLog:

	PR middle-end/63477
	* gcc.dg/pr63477.c: New test.

From-SVN: r254833
2017-11-16 09:48:36 -07:00
Jan Hubicka
b00ff621f6 predict.c (combine_predictions_for_bb): Preserve zero predicted eges.
* predict.c (combine_predictions_for_bb): Preserve zero predicted	
	eges.
	(expensive_function_p): Remove useless assert.
	(determine_unlikely_bbs): Propagate also forward; determine cold blocks

From-SVN: r254832
2017-11-16 16:41:22 +00:00
Jason Merrill
aef0c806eb Remove wrong ChangeLog entry
From-SVN: r254831
2017-11-16 11:24:53 -05:00
Martin Sebor
8a5ee94a08 PR tree-optimization/82588 - missing -Warray-bounds on a excessively large index
PR tree-optimization/82588 - missing -Warray-bounds on a excessively large index
PR tree-optimization/82583 - missing -Warray-bounds on out-of-bounds inner indic

gcc/ChangeLog:

	PR tree-optimization/82588
	PR tree-optimization/82583
	* tree-vrp.c (check_array_ref): Handle flexible array members,
	string literals, and inner indices.
	(search_for_addr_array): Add detail to diagnostics.

gcc/testsuite/ChangeLog:

	PR tree-optimization/82588
	PR tree-optimization/82583
	* c-c++-common/Warray-bounds.c: New test.
	* gcc.dg/Warray-bounds-11.c: Adjust.
	* gcc.dg/Warray-bounds-22.c: New test.

From-SVN: r254830
2017-11-16 09:12:36 -07:00
Doug Rupp
79cefe9d7d Makefile.in: Merge Aarch64 and ARM "ifeq" blocks.
2017-11-16  Doug Rupp  <rupp@adacore.com>

	* gcc-interface/Makefile.in: Merge Aarch64 and ARM "ifeq" blocks.

From-SVN: r254829
2017-11-16 16:06:48 +00:00
Pierre-Marie de Rodat
d2ca577995 [multiple changes]
2017-11-16  Steve Baird  <baird@adacore.com>

	* debug.adb: Update another comment to indicate gnat2scil's use of the
	-gnatd.7 switch.

2017-11-16  Bob Duff  <duff@adacore.com>

	* exp_ch6.adb (Expand_Call_Helper): Avoid creating a transient scope in
	the case of nested build-in-place calls.

From-SVN: r254827
2017-11-16 15:56:41 +00:00
Pierre-Marie de Rodat
c82387ccc4 [multiple changes]
2017-11-16  Joel Brobecker  <brobecker@adacore.com>

	* doc/gnat_ugn/gnat_utility_programs.rst: Document the switches
	available in gnatsymbolize.

2017-11-16  Steve Baird  <baird@adacore.com>

	* debug.adb: Update comment to indicate gnat2scil's use of the -gnatd.7
	switch.

From-SVN: r254826
2017-11-16 15:49:46 +00:00
Pierre-Marie de Rodat
a3f9da7084 [multiple changes]
2017-11-16  Gary Dismukes  <dismukes@adacore.com>

	* doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, sem_ch6.adb,
	sem_elab.adb: Minor editorial corrections.
	* gnat_ugn.texi: Regenerate.

2017-11-16  Joel Brobecker  <brobecker@adacore.com>

	* doc/gnat_ugn/gnat_utility_programs.rst (GNAT UGN): Add
	gnatsymbolize documentation.
	* gnat_ugn.texi: Regenerate.

2017-11-16  Steve Baird  <baird@adacore.com>

	* sem_ch3.adb (Build_Derived_Record_Type): Replace all uses of
	"Scope (Parent_Type)" with "Scope (Parent_Base)".

From-SVN: r254825
2017-11-16 15:44:12 +00:00
Nathan Sidwell
5f3682ffce [PATCH] New lang hook
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01340.html
	PR c++/82836
	PR c++/82737
	* tree.h (COPY_DECL_RTL): Rename parms for clarity.
	(SET_DECL_ASSEMBLER_NAME): Forward to
	overwrite_decl_assembler_name.
	(COPY_DECL_ASSEMBLER_NAME): Rename parms for clarity.
	(overwrite_decl_assembler_name): Declare.
	* tree.c (overwrite_decl_assembler_name): New.
	* langhooks-def.h (lhd_overwrite_decl_assembler_name): Declare.
	(LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME): Provide default.
	(LANG_HOOKS_INITIALIZER): Add it.
	* langhooks.h (struct lang_hooks): Add overwrite_decl_assembler_name.
	* langhooks.c (lhd_set_decl_assembler_name): Use
	SET_DECL_ASSEMBLER_NAME.
	(lhd_overwrite_decl_assembler_name): Default implementation.

	PR c++/82836
	PR c++/82737
	* cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
	Override.
	* cp-tree.h (overwrite_mangling): Declare.
	* decl2.c (struct mangled_decl_hash): Entries are deletable.
	(overwrite_mangling): New.

	PR c++/82836
	PR c++/82737
	* g++.dg/pr82836.C: New.

From-SVN: r254823
2017-11-16 14:54:54 +00:00
Jonathan Wakely
a930324dab Add noexcept to std::shared_future copy operations (LWG DR 2799)
* include/std/future (shared_future): Add noexcept to copy constructor
	and copy-assignment operator (LWG 2799).

From-SVN: r254821
2017-11-16 14:39:41 +00:00
Pekka Jääskeläinen
6748a40f13 [BRIG] added documentation in gccbrig.texi
From-SVN: r254820
2017-11-16 13:59:16 +00:00
Hristian Kirtchev
7fb62ca1b7 opt.ads: Elaboration warnings are now on by default.
2017-11-16  Hristian Kirtchev  <kirtchev@adacore.com>

	* opt.ads: Elaboration warnings are now on by default. Add a comment
	explaining why this is needed.
	* sem_ch9.adb (Analyze_Requeue): Preserve the status of elaboration
	warnings.
	* sem_ch12.adb (Analyze_Package_Instantiation): Preserve the status of
	elaboration warnings.
	(Analyze_Subprogram_Instantiation): Preserve the status of elaboration
	warnings.
	* sem_elab.adb: Update the structure of Call_Attributes and
	Instantiation_Attributes.
	(Build_Call_Marker): Propagate the status of elaboration warnings from
	the call to the marker.
	(Extract_Call_Attributes): Extract the status of elaboration warnings.
	(Extract_Instantiation_Attributes): Extract the status of elaboration
	warnings.
	(Process_Conditional_ABE_Activation_Impl): Elaboration diagnostics are
	now dependent on the status of elaboration warnings.
	(Process_Conditional_ABE_Call_Ada): Elaboration diagnostics are now
	dependent on the status of elaboration warnings.
	(Process_Conditional_ABE_Instantiation_Ada): Elaboration diagnostics
	are now dependent on the status of elaboration warnings.
	(Process_Guaranteed_ABE_Activation_Impl): Remove pragma Unreferenced
	for formal Call_Attrs. Elaboration diagnostics are now dependent on the
	status of elaboration warnings.
	(Process_Guaranteed_ABE_Call): Elaboration diagnostics are now
	dependent on the status of elaboration warnings.
	(Process_Guaranteed_ABE_Instantiation): Elaboration diagnostics are now
	dependent on the status of elaboration warnings.
	* sem_prag.adb (Analyze_Pragma): Remove the unjustified warning
	concerning pragma Elaborate.
	* sem_res.adb (Resolve_Call): Preserve the status of elaboration
	warnings.
	(Resolve_Entry_Call): Propagate flag Is_Elaboration_Warnings_OK_Node
	from the procedure call to the entry call.
	* sem_util.adb (Mark_Elaboration_Attributes): Add formal parameter
	Warnings.
	(Mark_Elaboration_Attributes_Node): Preserve the status of elaboration
	warnings
	* sem_util.ads (Mark_Elaboration_Attributes): Add formal parameter
	Warnings. Update the comment on usage.
	* sinfo.adb (Is_Dispatching_Call): Update to use Flag6.
	(Is_Elaboration_Warnings_OK_Node): New routine.
	(Set_Is_Dispatching_Call): Update to use Flag6.
	(Set_Is_Elaboration_Warnings_OK_Node): New routine.
	* sinfo.ads: Attribute Is_Dispatching_Call now uses Flag6. Add new
	attribute Is_Elaboration_Warnings_OK_Node along with occurrences
	in nodes.
	(Is_Elaboration_Warnings_OK_Node): New routine along with pragma
	Inline.
	(Set_Is_Elaboration_Warnings_OK_Node): New routine along with pragma
	Inline.
	* doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update various
	sections to indicate how to suppress elaboration warnings.  Document
	switches -gnatwl and -gnatwL.
	* gnat_ugn.texi: Regenerate.

From-SVN: r254819
2017-11-16 13:17:19 +00:00
Pierre-Marie de Rodat
403bc026ac [multiple changes]
2017-11-16  Sylvain Dailler  <dailler@adacore.com>

	* sem_util.adb (Get_Enum_Lit_From_Pos): Add a condition for Pos
	lower than 0.

2017-11-16  Bob Duff  <duff@adacore.com>

	* sem_ch13.adb (Check_Expr_Constants): Avoid error message in case of
	System'To_Address.

From-SVN: r254818
2017-11-16 12:53:46 +00:00
Nathan Sidwell
c757ad4cf6 [PR c++/81060] ICE with invalid initialzer via lambda
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01323.html
	PR c++/81060
	* decl.c (xref_tag_1): Push lambda into current scope.
	* name-lookup.c (do_pushtag): Don't deal with ts_lambda here.

	PR c++81060
	* g++.dg/cpp0x/lambda/lambda-template13.C: Avoid undefined
	template using local type error.
	* g++.dg/cpp0x/pr81060.C: New.

From-SVN: r254817
2017-11-16 12:11:36 +00:00
Wilco Dijkstra
81825e283f Canonicalize constant multiplies in division
This patch implements some of the optimizations discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026.

Canonicalize x / (C1 * y) into (x * C2) / y.

This moves constant multiplies out of the RHS of a division in order
to allow further simplifications (such as (C1 * x) / (C2 * y) ->
(C3 * x) / y) and to enable more reciprocal CSEs.

2017-11-16  Wilco Dijkstra  <wdijkstr@arm.com>
	    Jackson Woodruff  <jackson.woodruff@arm.com>

    gcc/
	PR tree-optimization/71026
	* match.pd: Canonicalize constant multiplies in division.

    gcc/testsuite/
	PR tree-optimization/71026
	* gcc.dg/cse_recip.c: New test.

Co-Authored-By: Jackson Woodruff <jackson.woodruff@arm.com>

From-SVN: r254816
2017-11-16 11:54:49 +00:00
Wilco Dijkstra
efeee67f4c Set default to -fomit-frame-pointer
Almost all targets add an explict -fomit-frame-pointer in the target specific
options.  Rather than doing this in a target-specific way, do this in the
generic options so it works identically across all targets.  In many cases the
target no longer needs to define TARGET_OPTION_OPTIMIZATION_TABLE, reducing
the amount of target code.

    gcc/
	* opts.c (default_options_table): Add OPT_fomit_frame_pointer entry.
	* common/config/alpha/alpha-common.c (TARGET_OPTION_OPTIMIZATION_TABLE):
 	Remove OPT_fomit_frame_pointer entry.
	* common/config/arc/arc-common.c: Likewise.
	* common/config/arm/arm-common.c: Likewise.
	* common/config/avr/avr-common.c: Likewise.
	* common/config/c6x/c6x-common.c: Likewise.
	* common/config/cr16/cr16-common.c: Likewise.
	* common/config/cris/cris-common.c: Likewise.
	* common/config/epiphany/epiphany-common.c: Likewise.
	* common/config/fr30/fr30-common.c: Likewise.
	* common/config/frv/frv-common.c: Likewise.
	* common/config/ia64/ia64-common.c: Likewise.
	* common/config/iq2000/iq2000-common.c: Likewise.
	* common/config/lm32/lm32-common.c: Likewise.
	* common/config/m32r/m32r-common.c: Likewise.
	* common/config/mcore/mcore-common.c: Likewise.
	* common/config/microblaze/microblaze-common.c: Likewise.
	* common/config/mips/mips-common.c: Likewise.
	* common/config/mmix/mmix-common.c: Likewise.
	* common/config/mn10300/mn10300-common.c: Likewise.
	* common/config/nios2/nios2-common.c: Likewise.
	* common/config/pa/pa-common.c: Likewise.
	* common/config/pdp11/pdp11-common.c: Likewise.
	* common/config/powerpcspe/powerpcspe-common.c: Likewise.
	* common/config/riscv/riscv-common.c: Likewise.
	* common/config/rs6000/rs6000-common.c: Likewise.
	* common/config/rx/rx-common.c: Likewise.
	* common/config/s390/s390-common.c: Likewise.
	* common/config/sh/sh-common.c: Likewise.
	* common/config/sparc/sparc-common.c: Likewise.
	* common/config/tilegx/tilegx-common.c: Likewise.
	* common/config/tilepro/tilepro-common.c: Likewise.
	* common/config/v850/v850-common.c: Likewise.
	* common/config/visium/visium-common.c: Likewise.
	* common/config/xstormy16/xstormy16-common.c: Likewise.
	* common/config/xtensa/xtensa-common.c: Likewise.

    doc/
	* invoke.texi (-fomit-frame-pointer): Update documentation.

From-SVN: r254815
2017-11-16 11:44:30 +00:00
Wilco Dijkstra
9e780144ce [AArch64] Fix frame tests
Improve the AArch64 frame tests - add -f(no-)omit-frame-pointer,
update checks and add missing tests.  As a result all tests now
pass. 

    gcc/testsuite/
	* gcc.target/aarch64/lr_free_2.c: Fix test.
	* gcc.target/aarch64/spill_1.c: Likewise.
	* gcc.target/aarch64/test_frame_11.c: Likewise.
	* gcc.target/aarch64/test_frame_12.c: Likewise.
	* gcc.target/aarch64/test_frame_13.c: Likewise.
	* gcc.target/aarch64/test_frame_14.c: Likewise.
	* gcc.target/aarch64/test_frame_15.c: Likewise.
	* gcc.target/aarch64/test_frame_3.c: Likewise.
	* gcc.target/aarch64/test_frame_5.c: Likewise.
	* gcc.target/aarch64/test_frame_9.c: Likewise.

From-SVN: r254814
2017-11-16 11:30:43 +00:00
Jan Hubicka
8e43e9cd60 * tree-cfg.c (gimple_find_sub_bbs): Do not compute freq.
From-SVN: r254813
2017-11-16 11:21:42 +00:00
Jan Hubicka
62003be57d cfg.c (scale_bbs_frequencies_int, [...]): Remove.
* cfg.c (scale_bbs_frequencies_int,
	cale_bbs_frequencies_gcov_type): Remove.
	* cfg.h (scale_bbs_frequencies_int,
	cale_bbs_frequencies_gcov_type): Remove.

From-SVN: r254812
2017-11-16 11:08:12 +00:00
Jan Hubicka
2a00666935 * tree-ssa-loop-manip.c
(scale_dominated_blocks_in_loop): Update to profile counts.
	(tree_transform_and_unroll_loop): Likewise.

From-SVN: r254811
2017-11-16 11:06:49 +00:00
Jan Hubicka
00fa28d1b4 tree-vect-loop-manip.c (vect_do_peeling): Do not use scale_bbs_frequencies_int.
* tree-vect-loop-manip.c (vect_do_peeling): Do not use
	scale_bbs_frequencies_int.

From-SVN: r254810
2017-11-16 11:04:40 +00:00
Jan Hubicka
6786ba1aaa * final.c (compute_alignments): Use counts rather than frequencies.
From-SVN: r254809
2017-11-16 11:03:23 +00:00
Paolo Carlini
debc8f4a0c re PR c++/70383 (Bogus error when attempting to capture a reference to function by copy)
2017-11-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70383
	* g++.dg/cpp0x/lambda/lambda-70383.C: New.

From-SVN: r254808
2017-11-16 10:36:51 +00:00
Jan Hubicka
692dc070ff cfgloopanal.c: Include sreal.h
* cfgloopanal.c: Include sreal.h
	(average_num_loop_insns): Use counts and sreal for accounting.

From-SVN: r254807
2017-11-16 10:36:04 +00:00