141847 Commits

Author SHA1 Message Date
Evandro Menezes
783879e617 [PATCH] [AArch64] Distinct costs for sign and zero extension
gcc/

	* config/aarch64/aarch64-protos.h (cpu_addrcost_table): Split member
	for register extension into sign and zero register extension.
	* config/aarch64/aarch64.c (generic_addrcost_table): Infer values
	for sign and zero register extension.
	(cortexa57_addrcost_table): Likewise.
	(xgene1_addrcost_table): Likewise.

From-SVN: r229431
2015-10-27 11:57:01 +00:00
Richard Sandiford
4a334cbaf8 Move min(max...) and max(min...) folds to match.pd
This handles both integer and floating-point arguments.  It's needed
for the follow-on patch to move fmin and fmax to match.pd.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* fold-const.c (fold_minmax): Delete.
	(fold_binary_loc): Don't call it.
	* match.pd: Add rules previously handled by fold_minmax.

From-SVN: r229430
2015-10-27 11:56:18 +00:00
Arnaud Charlet
2f97d24cad [multiple changes]
2015-10-27  Tristan Gingold  <gingold@adacore.com>

	* bindgen.adb (System_BB_CPU_Primitives_Multiprocessors_Used):
	New variable.
	(Gen_Adainit): Call Start_All_CPUs if the above
	variable is set to true.

2015-10-27  Emmanuel Briot  <briot@adacore.com>

	* adaint.c, s-os_lib.adb, s-os_lib.ads (Copy_File_Attributes): New
	subprogram.

From-SVN: r229429
2015-10-27 12:56:12 +01:00
Richard Sandiford
4e48e02be8 Split constant handling out of fold_builtin_fma
Just makes an upcoming patch a bit clearer.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_fma): Remove constant handling.
	(fold_builtin_3): Handle constant fma arguments here.

From-SVN: r229428
2015-10-27 11:55:38 +00:00
Richard Sandiford
efc8f0d8d1 Remove constant handling from fold_builtin_{,f}abs
fold_builtin_fabs and fold_builtin_abs had code to handle constant
arguments, but this simply duplicated what the following fold_build1_loc
would do for ABS_EXPR.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_fabs): Remove constant handling.
	(fold_builtin_abs): Likewise.

From-SVN: r229427
2015-10-27 11:54:51 +00:00
Hristian Kirtchev
cd8d6792e3 namet.adb, namet.ads: Minor reformatting.
2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* namet.adb, namet.ads: Minor reformatting.

From-SVN: r229426
2015-10-27 12:54:29 +01:00
Richard Sandiford
461e414589 Move copysign folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_copysign): Delete.
	(fold_builtin_2): Handle constant copysign arguments here.
	* match.pd: Add rules previously handled by fold_builtin_copysign.

From-SVN: r229425
2015-10-27 11:53:45 +00:00
Arnaud Charlet
7f54dc8348 [multiple changes]
2015-10-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Analyze_Allocator): Do not perform legality check
	on allocators for limited objects in a qualified expression,
	because expression has not been resolved.
	* sem_res.adb (Resolve_Allocator): Perform check on legality of
	limited objects after resolution.  Add sem_ch3.adb to context.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Refined_Global_In_Decl_Part): Add variable
	States.
	(Check_Refined_Global_Item): An object or state acts as a
	constituent only when the corresponding encapsulating state
	appears in pragma Global.
	(Collect_Global_Item): Add a state with non-null visible refinement to
	list States.

2015-10-27  Gary Dismukes  <dismukes@adacore.com>

	* sem_util.ads, par.adb, sem_ch6.adb: Minor reformatting and a few
	typo corrections.

2015-10-27  Pierre-Marie de Rodat  <derodat@adacore.com>

	* namet.ads, namet.adb (Name_Equals): New function.
	* namet.h (Name_Equals): New macro.

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

	* exp_ch6.adb (Build_Procedure_Form): Use 'RESULT' for the extra
	parameter, to avoid ambiguity when generating tmps using _xxx which
	might end up reusing _result.

From-SVN: r229424
2015-10-27 12:53:08 +01:00
Richard Sandiford
7317ef4ae5 Move signbit folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_signbit): Delete.
	(fold_builtin_2): Handle constant signbit arguments here.
	* match.pd: Add rules previously handled by fold_builtin_signbit.

gcc/testsuite/
	PR tree-optimization/68097
	* gcc.dg/torture/builtin-nonneg-1.c: Skip at -O0.  Add
	--param max-ssa-name-query-depth=3 to dg-options.

From-SVN: r229423
2015-10-27 11:52:54 +00:00
Richard Sandiford
c53233c660 Fold comparisons between sqrt and zero
The expression:

      signbit(sqrt(x))

is always 0 for -ffast-math.  The signbit fold first converts it to:

      sqrt(x) < 0

and whether we realise that this is false depends on a race between two
folders: the sqrt comparison folder, which wants to convert it to

      x < 0*0

and the generic tree_expr_nonnegative_p rule for ... < 0, which would
give the hoped-for 0.

The sqrt code already handles comparisons with negative values specially,
so this patch simply extends that idea to comparisons with zero.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* match.pd: Handle sqrt(x) cmp 0 specially.

gcc/testsuite/
	* gcc.dg/torture/builtin-sqrt-cmp-1.c: New test.

From-SVN: r229422
2015-10-27 11:51:43 +00:00
Arnaud Charlet
3f8c04e73c [multiple changes]
2015-10-27  Javier Miranda  <miranda@adacore.com>

	* sem_util.ads, sem_util.adb (Defining_Identifier): Adding a formal to
	indicate the needed behavior in case of nodes with errors.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Eval_Attribute): If the prefix of attribute
	Enum_Rep is an object that is a generated loop variable for an
	element iterator, no folding is possible.
	* sem_res.adb (Resolve_Entity_Name): Do not check for a missing
	initialization in the case of a constant that is an object
	renaming.
	* exp_attr.adb (Expand_N_Attribute_Reference, case Enum_Rep):
	If the prefix is a constant that renames an expression there is
	nothing to evaluate statically.

2015-10-27  Vincent Celier  <celier@adacore.com>

	* gnatlink.adb: Always delete the response file, even when the
	invocation of gcc to link failed.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
	Do not inherit the SPARK_Mode from the context if it has been
	set already.
	(Build_Subprogram_Declaration): Relocate relevant
	pragmas from the subprogram body to the generated corresponding
	spec. Do not copy aspect SPARK_Mode as this leads to circularity
	in Copy_Separate_Tree. Inherit the attributes that describe
	pragmas Ghost and SPARK_Mode.
	(Move_Pragmas): New routine.

From-SVN: r229421
2015-10-27 12:50:29 +01:00
Hristian Kirtchev
2bfad6eb41 inline.adb (Is_Expression_Function): Removed.
2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* inline.adb (Is_Expression_Function): Removed.
	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): An internally
	generated subprogram body that completes an expression function
	inherits the SPARK_Mode from the spec.
	* sem_res.adb (Resolve_Call): Update all calls to
	Is_Expression_Function.
	* sem_util.ads, sem_util.adb (Is_Expression_Function): Reimplemented.
	(Is_Expression_Function_Or_Completion): New routine.

From-SVN: r229420
2015-10-27 12:46:38 +01:00
Hristian Kirtchev
cdabbb5265 lib-xref-spark_specific.adb, [...]: Minor reformatting.
2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* lib-xref-spark_specific.adb, a-dirval-mingw.adb, exp_ch6.adb,
	sem_ch8.adb, s-os_lib.adb: Minor reformatting.

From-SVN: r229419
2015-10-27 12:23:07 +01:00
Arnaud Charlet
f6f401140a [multiple changes]
2015-10-27  Yannick Moy  <moy@adacore.com>

	* lib-xref-spark_specific.adb
	(Enclosing_Subprogram_Or_Library_Package): detect library-level
	subprograms and handle entries as subprograms, i.e. now both
	library-level subprograms and entry bodies act as enclosing
	scopes.
	(Traverse_Declarations_Or_Statements): process entry bodies just
	like subprogram bodies.
	* lib-xref.ads (Enclosing_Subprogram_Or_Library_Package): comment
	simplified while keeping its the meaning and minor typo fixed
	("of" -> "or").
	* spark_xrefs.ads (Xref Section): fix in description of the ALI
	line for subprogram calls; such lines start with captial "F"
	followed by a space.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Find_Direct_Name): A parameter association is
	a legal context for applying an implicit dereference.
	(Analyze_Expanded_Name): Minor code cleanup.

From-SVN: r229418
2015-10-27 12:21:23 +01:00
Arnaud Charlet
3f8743e802 sinput.ads, [...]: Fix typos.
2015-10-27  Arnaud Charlet  <charlet@adacore.com>

	* sinput.ads, spark_xrefs.ads, lib-xref.adb: Fix typos.

From-SVN: r229417
2015-10-27 12:20:01 +01:00
Arnaud Charlet
5c12e9fbef [multiple changes]
2015-10-27  Pascal Obry  <obry@adacore.com>

	* a-dirval-mingw.adb: Remove some characters from Invalid_Character set.

2015-10-27  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Rewrite_Function_Call_For_C): Use a named
	associaion for the added actual in the call because previous
	actuals may also have been given by explicit associations.
	* lib-xref.adb: Minor style fixes.

From-SVN: r229416
2015-10-27 12:15:27 +01:00
Arnaud Charlet
b3010f3667 [multiple changes]
2015-10-27  Arnaud Charlet  <charlet@adacore.com>

	* gnat1drv.adb: Remove hard coded restrictions.

2015-10-27  Pascal Obry  <obry@adacore.com>

	* a-dirval-mingw.adb: Minor reformatting.

From-SVN: r229415
2015-10-27 12:13:20 +01:00
Arnaud Charlet
a1e1820b83 [multiple changes]
2015-10-27  Javier Miranda  <miranda@adacore.com>

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve previous patch.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch12.adb (Analyze_Formal_Package_Declaration): Code cleanup. Set
	and restore the value of global flag Ignore_Pragma_SPARK_Mode. A
	formal package declaration acts as a package instantation with
	respect to SPARK_Mode legality.

2015-10-27  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Check_Constituent_Usage): Use
	logical operators rather than short circuit operators. Emit an
	error when a state with visible refinement is not refined.
	* snames.ads-tmpl: Add names for detecting
	predefined potentially blocking subprograms.

2015-10-27  Arnaud Charlet  <charlet@adacore.com>

	* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Revert previous
	change.
	(Expand_Array_Aggregate): Rewrite previous change here
	as done for other non GCC back-ends.
	(Build_Record_Aggr_Code): Add special case.

From-SVN: r229414
2015-10-27 12:12:14 +01:00
Ilya Enkovich
cbf3bf3292 tree-vect-generic.c (expand_vector_operations_1): Check optab type before using it.
gcc/

	* tree-vect-generic.c (expand_vector_operations_1): Check
	optab type before using it.

From-SVN: r229413
2015-10-27 11:08:16 +00:00
Kyrylo Tkachov
2d6bc7fa9e [AArch64] Enable autoprefetcher modelling in the scheduler
* config/aarch64/aarch64-protos.h
	(struct tune_params): Add autoprefetcher_model field.
	* config/aarch64/aarch64.c: Include params.h
	(generic_tunings): Specify autoprefetcher_model value.
	(cortexa53_tunings): Likewise.
	(cortexa57_tunings): Likewise.
	(cortexa72_tunings): Likewise.
	(thunderx_tunings): Likewise.
	(xgene1_tunings): Likewise.
	(aarch64_first_cycle_multipass_dfa_lookahead_guard): New function.
	(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define.
	(aarch64_override_options_internal): Set
	PARAM_SCHED_AUTOPREF_QUEUE_DEPTH param.

From-SVN: r229412
2015-10-27 10:57:32 +00:00
Thomas Schwinge
b3962a4a87 [PR testsuite/68063] Add missing private clause in libgomp.c++/member-1.C
PR testsuite/68063
	* testsuite/libgomp.c++/member-1.C (A::m1): Add missing private clause.

From-SVN: r229411
2015-10-27 11:32:32 +01:00
Richard Sandiford
8acda9b2c0 Move expN folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_exponent): Delete.
	(fold_builtin_2): Handle constant expN arguments here.
	* match.pd: Fold expN(logN(x)) -> x.

From-SVN: r229410
2015-10-27 09:32:11 +00:00
Richard Sandiford
5ddc84ca83 Move powi folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_powi): Delete.
	(fold_builtin_2): Handle constant powi arguments here.
	* match.pd: Add rules previously handled by fold_builtin_powi.

gcc/testsuite/
	* gcc.dg/builtins-52.c: Add -O to dg-options.

From-SVN: r229409
2015-10-27 09:31:28 +00:00
Richard Sandiford
b4838d7701 Move pow folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_pow): Delete in favor of...
	(fold_const_builtin_pow): ...this new function.  Only handle constant
	arguments.
	(fold_builtin_2): Update accordingly.
	* match.pd: Add rules previously handled by fold_builtin_pow.

gcc/testsuite/
	* gcc.dg/torture/builtin-math-1.c: Skip at -O0.

From-SVN: r229408
2015-10-27 09:30:32 +00:00
Richard Sandiford
4d7836c436 Move hypot folds to match.pd
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_hypot): Delete.
	(fold_builtin_2): Handle constant hypot arguments here.
	* match.pd: Fold hypot(x, 0) and hypot(0, x) to x.  Canonicalize
	hypot(x, x) to fabs(x)*sqrt(2).

From-SVN: r229407
2015-10-27 09:29:40 +00:00
Richard Sandiford
4aecfe1986 Don't create SSA names until in SSA form
An upcoming patch adds a fold from hypot(x,x) to fabs(x)*sqrt(2).
This is unusual in that it could trigger in the gimplifier but would
require new SSA names to be created.  This patch makes sure that we
use the usual:

	  if (gimple_in_ssa_p (cfun))
	    res = make_ssa_name (type);
	  else
	    res = create_tmp_reg (type);

formula to cope with cases where we're not yet in SSA form.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* gimple-match-head.c (maybe_push_res_to_seq): Use create_tmp_reg
	instead of make_ssa_name if not yet in SSA form.

From-SVN: r229406
2015-10-27 09:07:44 +00:00
Richard Biener
61183076f1 cfg.c (free_edge): Add function argument and use it instead of cfun.
2015-10-27  Richard Biener  <rguenther@suse.de>

	* cfg.c (free_edge): Add function argument and use it instead of cfun.
	(clear_edges): Likewise.
	* cfg.h (clear_edges): Adjust prototype.
	* cfgexpand.c (pass_expand::execute): Adjust.
	* cfgloop.c (release_recorded_exits): Add function argument and use
	it instead of cfun.
	* cfgloop.h (release_recorded_exits): Adjust prototype.
	(loops_state_satisfies_p): Add overload with function argument.
	(loops_state_set): Likewise.
	(loops_state_clear): Likewise.
	(struct loop_iterator): Add function argument to constructor
	and iterator and use it instead of cfun.
	(FOR_EACH_LOOP_FN): New macro.
	(loop_optimizer_finalize): Add overload with function argument.
	* loop-init.c (loop_optimizer_init): Adjust.
	(fix_loop_structure): Likewise.
	(loop_optimizer_finaliz): Add function argument and use it
	instead of cfun.
	* tree-cfg.c (delete_tree_cfg_annotations): Likewise.
	* tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype.
	* cgraph.c (release_function_body): Do not push/pop cfun.
	* final.c (rest_of_clean_state): Adjust.
	* graphite.c (graphite_finalize): Likewise.
	* tree-ssa-copy.c (fini_copy_prop): Likewise.
	* tree-ssa-dce.c (perform_tree_ssa_dce): Likewise.
	* tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise.
	(tree_unroll_loops_completely): Likewise.
	(pass_complete_unrolli::execute): Likewise.
	* tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates):
	Add function argument and use it instead of cfun.
	* tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates):
	Adjust prototype.
	* tree-ssa-loop.c (tree_ssa_loop_done): Adjust.
	* tree-ssa.c (delete_tree_ssa): Add function argument and use it
	instead of cfun.
	* tree-ssa.h (delete_tree_ssa): Adjust prototype.
	* tree-ssanames.c (fini_ssanames): Add function argument and use it
	instead of cfun.
	* tree-ssanames.c (fini_ssanames): Adjust prototype.
	* tree-vrp.c (execute_vrp): Adjust.
	* value-prof.c (free_histograms): Add function argument and use it
	instead of cfun.
	* value-prof.h (free_histograms): Adjust prototype.

From-SVN: r229405
2015-10-27 08:56:03 +00:00
Thomas Schwinge
88bae6f494 [PR c/64765, c/64880] Support OpenACC Combined Directives in C, C++
gcc/c-family/
	PR c/64765
	PR c/64880
	* c-common.h (c_oacc_split_loop_clauses): Declare function.
	* c-omp.c (c_oacc_split_loop_clauses): New function.
	gcc/c/
	PR c/64765
	PR c/64880
	* c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
	parameters, and handle these.  Adjust all users.
	(c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
	into...
	(c_parser_oacc_kernels_parallel): ... this new function.  Adjust
	all users.
	* c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
	declare functions.
	(c_finish_omp_construct): Declare function.
	* c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
	Merge functions into...
	(c_finish_omp_construct): ... this new function.
	gcc/cp/
	PR c/64765
	PR c/64880
	* cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't
	declare functions.
	(finish_omp_construct): Declare function.
	* parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses
	formal parameters, and handle these.  Adjust all users.
	(cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions
	into...
	(cp_parser_oacc_kernels_parallel): ... this new function.  Adjust
	all users.
	* semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into...
	(finish_omp_construct): ... this new function.
	gcc/
	* tree.h (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES)
	(OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES, OACC_KERNELS_COMBINED)
	(OACC_PARALLEL_COMBINED): Don't define macros.  Adjust all users.
	gcc/testsuite/
	PR c/64765
	PR c/64880
	* c-c++-common/goacc/loop-1.c: Don't skip for C++.  Don't prune
	sorry message.
	(PR64765): New function.
	* gfortran.dg/goacc/coarray_2.f90: XFAIL.
	* gfortran.dg/goacc/combined_loop.f90: Extend.  Don't prune
	sorry message.
	* gfortran.dg/goacc/cray.f95: Refine prune directive.
	* gfortran.dg/goacc/parameter.f95: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/combdir-1.c: New file.
	* testsuite/libgomp.oacc-fortran/combdir-1.f90: Likewise.

From-SVN: r229404
2015-10-27 09:39:15 +01:00
Tom de Vries
5acdb61b69 Add var in push_fields_onto_fieldstack
2015-10-27  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (push_fields_onto_fieldstack): Add and use var
	field_type.

From-SVN: r229403
2015-10-27 07:09:58 +00:00
Bin Cheng
5b92e1895e loop-invariant.c (struct def): New field can_prop_to_addr_uses.
* loop-invariant.c (struct def): New field can_prop_to_addr_uses.
	(inv_can_prop_to_addr_use): New function.
	(record_use): Call can_prop_to_addr_uses, set the new field.
	(get_inv_cost): Count cost if inv can't be propagated into its
	address uses.

From-SVN: r229402
2015-10-27 05:26:27 +00:00
John David Anglin
bda9c2451e re PR libffi/65441 (FAIL: libffi.call/float2.c -W -Wall -Wno-psabi (test for excess errors))
PR libffi/65441
	* testsuite/lib/libffi.exp: Load target-supports-dg.exp.
	* testsuite/libffi.call/float2.c: Don't run on hppa*-*-hpux*.

From-SVN: r229400
2015-10-27 00:39:32 +00:00
GCC Administrator
f3e7688d8e Daily bump.
From-SVN: r229399
2015-10-27 00:16:12 +00:00
Jason Merrill
6337bd75e2 DR 2179
DR 2179
	* pt.c (process_partial_specialization): Handle error_mark_node
	from most_specialized_partial_spec.

From-SVN: r229395
2015-10-26 17:17:50 -04:00
Doug Evans
59010ede55 * config/linux.h (INCLUDE_DEFAULTS): Add INCLUDE_DEFAULTS_MUSL_LOCAL.
From-SVN: r229392
2015-10-26 20:07:43 +00:00
Louis Krupp
388902dab9 re PR fortran/66056 (ICEs and endless compilation for lonely labels/numbers in type)
2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66056
	* fortran.h: Include namespace pointer in statement label
	structure.
	* symbol.c (gfc_get_st_label): Store pointer to namespace
	that owns the statement label tree in each label.
	(gfc_free_st_label): Use namespace owning statement label
	tree when deleting statement label.
	* io.c: Initialize format_asterisk with NULL namespace pointer.

2015-10-26  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66056
	* gfortran.dg/empty_label_typedecl.f90: New test

From-SVN: r229390
2015-10-26 19:18:08 +00:00
Mike Frysinger
96f3dd0a66 libjava: fix locale handling when sorting JNI methods
When building under LANG=cs_CZ.UTF-8, the JNI method check fails:

/bin/bash ../../scripts/check_jni_methods.sh
Found a problem with the JNI methods declared and implemented.
(<) missing in implementation, (>) missing in header files
> Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent
> Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState
... lots more ...

While the sed commands are run under LC_ALL=C, the two sort commands are
not, and they end up producing unexpected output (for the test).  Once we
run both under LC_ALL=C, the check passes.  While we're here, we can also
combine latter the `sort|uniq` into `sort -u` to match the earlier code.

URL: https://bugs.gentoo.org/563710
Reported-by: Miroslav Šulc <fordfrog@gentoo.org>

From-SVN: r229388
2015-10-26 18:32:41 +00:00
Steven G. Kargl
15c918bc76 re PR fortran/36192 (ICE with wrong index types and bad parens)
2015-10-26  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/36192
	* array.c (gfc_ref_dimen_size): Check for BT_INTEGER before calling
	mpz_set.


2015-10-26  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/36192
	* gfortran.dg/pr36192.f90: New test.

From-SVN: r229387
2015-10-26 17:39:07 +00:00
Eric Botcazou
f6c1575958 match.pd (fold_widened_comparison): Apply simplifications to all integral types.
* match.pd (fold_widened_comparison): Apply simplifications to all
	integral types.

From-SVN: r229384
2015-10-26 17:02:48 +00:00
Simon Dardis
f52a73a48e target.def (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): New hook.
gcc/
	* target.def (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): New hook.
	* doc/tm.texi.in (TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P): Document.
	* doc/tm.texi: Regenerated.
	* reorg.c (dbr_schedule): Use new hook.
	* config/mips/mips.c (mips_no_speculation_in_delay_slots_p): New.

testsuite/
	* gcc.target/mips/ds-schedule-1.c: New.
	* gcc.target/mips/ds-schedule-2.c: New.

From-SVN: r229383
2015-10-26 16:29:31 +00:00
Thomas Schwinge
bdeb752cf8 abort might not flush all open streams before process termination
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/abort-1.c: Print to stderr.
	* testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.

From-SVN: r229382
2015-10-26 17:25:04 +01:00
Thomas Schwinge
ecd4fd4382 libgomp testsuite: Remove some explicit acc_device_nvidia usage.
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
	acc_device_nvidia usage.
	* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.

From-SVN: r229381
2015-10-26 17:24:54 +01:00
Thomas Schwinge
aa8b7d3051 libgomp: Additional acc_shutdown bug fixing and testing
libgomp/
	* oacc-init.c (acc_shutdown): Call gomp_init_targets_once.
	* testsuite/libgomp.oacc-c-c++-common/lib-8.c: New file.

From-SVN: r229380
2015-10-26 17:24:44 +01:00
Thomas Schwinge
7c8f138de6 [libgomp/66518] Resolve XFAIL in libgomp.oacc-c-c++-common/lib-3.c
libgomp/
	PR libgomp/66518
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Resolve XFAIL.

From-SVN: r229379
2015-10-26 17:24:28 +01:00
Thomas Schwinge
8baa7864a6 [PR libgomp/65437, libgomp/66518] Initialize runtime in acc_update_device, acc_update_self
libgomp/
	PR libgomp/65437
	PR libgomp/66518
	* oacc-mem.c (update_dev_host): Call goacc_lazy_initialize.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Remove XFAIL.

From-SVN: r229378
2015-10-26 17:24:17 +01:00
Arnaud Charlet
4039e17351 [multiple changes]
2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Add_Item_To_Name_Buffer): Update the comment on usage.
	Add an output string for loop parameters.
	(Analyze_Global_Items): Loop parameters are now a
	valid global item. The share the legality checks of constants.
	(Analyze_Input_Output): Loop parameters are now a valid dependency item.
	(Find_Role): Loop parameters share the role of constants.

2015-10-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Resolve_Generalized_Indexing): In ASIS mode,
	preserve the Generalized_ indexing link if the context is not
	a spec expression that will be analyzed anew.

2015-10-26  Javier Miranda  <miranda@adacore.com>

	* exp_ch6.ads, exp_ch6.adb (Build_Procedure_Body_Form): Promote it to
	library level (to invoke this routine from the semantic analyzer).
	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): When generating
	C code, invoke Build_Procedure_Body_Form to transform a function
	that returns a constrained array type into a procedure with an
	out parameter that carries the return value.

2015-10-26  Arnaud Charlet  <charlet@adacore.com>

	* a-reatim.ads: Add "Clock_Time with Synchronous" contract in package
	Ada.Real_Time.
	* a-taside.ads: Add "Tasking_State with Synchronous" contract in
	package Ada.Task_Identification.
	* sem_ch12.adb: minor typo in comment

From-SVN: r229377
2015-10-26 16:44:32 +01:00
Hristian Kirtchev
58996b09ca contracts.adb (Analyze_Object_Contract): Set and restore the SPARK_Mode for both constants and objects.
2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* contracts.adb (Analyze_Object_Contract): Set and restore
	the SPARK_Mode for both constants and objects. Factor out the
	semantic checks concerning Ghost objects.
	* freeze.adb (Freeze_Array_Type): A Ghost array type cannot have a
	concurrent component type.
	(Freeze_Entity): A Ghost type cannot also be concurrent.
	(Freeze_Record_Type): A Ghost record type cannot have a concurrent
	component.
	* sem_prag.adb (Analyze_Abstract_State): A Ghost abstract
	state cannot also be synchronized.
	(Check_Ghost_Synchronous): New routine.
	* sem_util.adb (Yields_Synchronized_Object): Correct the case
	of record components to account for the case where the type has
	no component list.

2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* expander.adb (Expand): Expand a single protected declaration.
	* exp_ch9.ads, exp_ch9.adb (Expand_N_Single_Protected_Declaration): New
	routine.

2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_res.adb (Is_OK_Volatile_Context): A volatile object may appear
	in an object declaration as long as it denotes the name.

From-SVN: r229376
2015-10-26 16:40:10 +01:00
Jeff Law
c67e519463 [PATCH] [PR tree-optimization/68013] Make sure first block in FSM path
is in VISITED_BBs

	PR tree-optimization/68013
	* tree-ssa-threadbackward.c
	(fsm_find_control_statement_thread_paths): Make sure the first block
	in the path is in VISITED_BBs.

	PR tree-optimization/68013
	* gcc.c-torture/compile/pr68013.c: New test.

From-SVN: r229375
2015-10-26 09:36:04 -06:00
Arnaud Charlet
335dde2981 [multiple changes]
2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch9.adb (Analyze_Single_Protected_Declaration): The anonymous
	object no longer comes from source.
	(Analyze_Single_Task_Declaration): The anonymous object no longer
	comes from source.
	* sem_prag.adb (Analyze_Pragma): The analysis of pragma SPARK_Mode
	now recognizes the internal anonymous object created for a single
	concurren type as a valid context.
	(Find_Related_Context): The internal anonymous object created for a
	single concurrent type is now a valid context.
	(Find_Related_Declaration_Or_Body): The internal anonymous object
	created for a single concurrent type is now a valid context.

2015-10-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.adb (Inherit_Rep_Item_Chain): Another another guard
	to prevent circularities in the rep_item_chain of the full view
	of a type extension in a child unit that extends a private type
	from the parent.

From-SVN: r229374
2015-10-26 16:35:49 +01:00
Arnaud Charlet
378dc6ca34 [multiple changes]
2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* atree.ads, atree.adb (Ekind_In): New 10 and 11 parameter versions.
	* contracts.ads, contracts.adb (Analyze_Initial_Declaration_Contract):
	New routine.
	* sem_ch6.adb (Analyze_Generic_Subprogram_Body):
	Analyze the contract of the initial declaration.
	(Analyze_Subprogram_Body_Helper): Analyze the contract of the
	initial declaration.
	* sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the contract
	of the initial declaration.
	* sem_ch9.adb (Analyze_Entry_Body): Analyze the contract of
	the initial declaration.
	(Analyze_Protected_Body): Analyze
	the contract of the initial declaration.
	(Analyze_Task_Body): Analyze the contract of the initial declaration.
	* sem_prag.adb (Add_Entity_To_Name_Buffer): Use "type" rather
	than "unit" as it makes the error messages sound better.
	(Add_Item_To_Name_Buffer): Update comment on usage. The routine
	now supports discriminants and current instances of concurrent
	types.
	(Analyze_Depends_In_Decl_Part): Install the discriminants
	of a task type.
	(Analyze_Global_In_Decl_Part): Install the discriminants of a task type.
	(Analyze_Global_Item): Add processing for current instances of
	concurrent types and include discriminants as valid global items.
	(Analyze_Input_Output): Discriminants and current instances of
	concurrent types are now valid items. Update various error messages.
	(Check_Usage): Current instances of protected and task types behaves
	as formal parameters.
	(Collect_Subprogram_Inputs_Outputs): There is
	no longer need to manually analyze [Refined_]Global thanks to
	freezing of initial declaration contracts.  Add processing for
	the current instance of a concurrent type.
	(Find_Role): Add categorizations for discriminants, protected and task
	types.
	(Is_CCT_Instance): New routine.
	(Match_Items): Update the comment on usage. Update internal comments.
	* sem_prag.ads (Collect_Subprogram_Inputs_Outputs): Update the
	comment on usage.
	* sem_util.adb (Entity_Of): Ensure that the entity is an object
	when traversing a potential renaming chain.
	(Fix_Msg): Use "type" rather than "unit" as it makes the error messages
	sound better.
	* sem_util.ads (Fix_Msg): Update the comment on usage.

2015-10-26  Arnaud Charlet  <charlet@adacore.com>

	* par.adb (Par): Do not generate an error when generating
	SCIL for predefined units or new children of system and co.

2015-10-26  Ed Schonberg  <schonberg@adacore.com>

	* einfo.adb: Access_Disp_Table applies to a private
	extension.

From-SVN: r229373
2015-10-26 16:34:11 +01:00
Richard Biener
e802444145 re PR rtl-optimization/67443 (DSE removes required store instruction)
2015-10-26  Richard Biener  <rguenther@suse.de>
	Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR middle-end/67443
	* alias.c (ao_ref_from_mem): Remove promoted subreg handling.
	Properly prune ref->ref for accesses outside of ref.

	* gcc.target/s390/pr67443.c: New testcase.

Co-Authored-By: Dominik Vogt <vogt@linux.vnet.ibm.com>

From-SVN: r229372
2015-10-26 15:24:45 +00:00