Commit graph

138052 commits

Author SHA1 Message Date
David Malcolm
c3388e6249 Implement -Wmisleading-indentation
gcc/ChangeLog:
	* doc/invoke.texi (Warning Options): Add -Wmisleading-indentation.
	(-Wmisleading-indentation): New option.
	* Makefile.in (C_COMMON_OBJS): Add c-family/c-indentation.o.

gcc/c-family/ChangeLog:
	* c-common.h (warn_for_misleading_indentation): New prototype.
	* c-indentation.c: New file.
	* c.opt (Wmisleading-indentation): New option.

gcc/c/ChangeLog:
	* c-parser.c (c_parser_if_body): Add param "if_loc", use it
	to add a call to warn_for_misleading_indentation.
	(c_parser_else_body): Likewise, adding param "else_loc".
	(c_parser_if_statement): Check for misleading indentation.
	(c_parser_while_statement): Likewise.
	(c_parser_for_statement): Likewise.

gcc/cp/ChangeLog:
	* parser.c (cp_parser_selection_statement): Add location and
	guard_kind arguments to calls to
	cp_parser_implicitly_scoped_statement.
	(cp_parser_iteration_statement): Likewise for calls to
	cp_parser_already_scoped_statement.
	(cp_parser_implicitly_scoped_statement): Add "guard_loc" and
	"guard_kind" params; use them to warn for misleading
	indentation.
	(cp_parser_already_scoped_statement): Likewise.

gcc/testsuite/ChangeLog:
	* c-c++-common/Wmisleading-indentation.c: New testcase.
	* c-c++-common/Wmisleading-indentation-2.c: New testcase.
	* c-c++-common/Wmisleading-indentation-2.md: New file.

libcpp/ChangeLog:
	* directives.c (do_line): Set seen_line_directive on line_table.
	(do_linemarker): Likewise.
	* include/line-map.h (struct line_maps): Add new field
	"seen_line_directive".

From-SVN: r223098
2015-05-12 20:57:38 +00:00
Uros Bizjak
f06ed65044 alpha.h (TARGET_SUPPORTS_WIDE_INT): New define.
* config/alpha/alpha.h (TARGET_SUPPORTS_WIDE_INT): New define.
	* config/alpha/alpha.c (alpha_rtx_costs): Handle CONST_WIDE_INT.
	(alpha_extract_integer): Ditto.
	(alpha_legitimate_constant_p): Ditto.
	(alpha_split_tmode_pair): Ditto.
	(alpha_preferred_reload_class): Add CONST_WIDE_INT.
	(alpha_expand_mov): Ditto.
	(print_operand): Remove handling of 'H' modifier.
	<case 'm'>: Remove CONST_DOUBLE handling.
	(summarize_insn): Handle CONST_WIDE_INT.
	* config/alpha/alpha.md (*andsi_internal): Remove H constraint.
	(anddi3): Ditto.
	(movti): Handle CONST_WIDE_INT.
	* config/alpha/constraints.md ('H'): Remove constraint definition.
	('G'): Do not match MODE_FLOAT class.
	* config/alpha/predicates.md (const0_operand): Also match
	const_wide_int.
	(non_add_const_operand): Ditto.
	(non_zero_const_operand): Ditto.
	(some_operand): Ditto.
	(input_operand): Ditto.  Handle CONST_WIDE_INT.
	(and_operand): Do not match const_double.
	* config/alpha/sync.md (fetchop_constr): Remove H constraint.

From-SVN: r223097
2015-05-12 22:05:23 +02:00
Andrew MacLeod
46b35980b8 re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins)
2015-05-12  Andrew MacLeod  <amacleod@redhat.com>

	PR target/65697
	* coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros.
	(enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}.
	* tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed,
	is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel,
	is_mm_seq_cst, is_mm_sync): New accessor functions.
	* builtins.c (expand_builtin_sync_operation,
	expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST.
	(expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE.
	(get_memmodel,  expand_builtin_atomic_compare_exchange,
	expand_builtin_atomic_load, expand_builtin_atomic_store,
	expand_builtin_atomic_clear): Use new accessor routines.
	(expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST.
	* optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST.
	(maybe_emit_sync_lock_test_and_set): Use new accessors and
	MEMMODEL_SYNC_ACQUIRE.
	(expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE.
	(expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load,
	expand_atomic_store): Use new accessors.
	* emit-rtl.c (need_atomic_barrier_p): Add additional enum cases.
	* tsan.c (instrument_builtin_call): Update check for memory model beyond
	final enum to use MEMMODEL_LAST.
	* c-family/c-common.c: Use new accessor for memmodel_base.
	* config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new
	accessors.
	* config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>,
	arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>,
	mem_thread_fence, *dmb): Likewise.
	* config/alpha/alpha.c (alpha_split_compare_and_swap,
	alpha_split_compare_and_swap_12): Likewise.
	* config/arm/arm.c (arm_expand_compare_and_swap,
	arm_split_compare_and_swap, arm_split_atomic_op): Likewise.
	* config/arm/sync.md (atomic_load<mode>, atomic_store<mode>,
	atomic_loaddi): Likewise.
	* config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check):
	Likewise.
	* config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise.
	* config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and
	use new accessors.
	* config/ia64/sync.md (mem_thread_fence, atomic_load<mode>,
	atomic_store<mode>, atomic_compare_and_swap<mode>,
	atomic_exchange<mode>): Use new accessors.
	* config/mips/mips.c (mips_process_sync_loop): Likewise.
	* config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise.
	* config/rs6000/rs6000.c (rs6000_pre_atomic_barrier,
	rs6000_post_atomic_barrier): Add new cases.
	(rs6000_expand_atomic_compare_and_swap): Use new accessors.
	* config/rs6000/sync.md (mem_thread_fence): Add new cases.
	(atomic_load<mode>): Add new cases and use new accessors.
	(store_quadpti): Add new cases.
	* config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new
	accessors.
	* config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors.
	* doc/extend.texi: Update docs to indicate 16 bits are used for memory
	model, not 8.

From-SVN: r223096
2015-05-12 20:01:47 +00:00
Jan Hubicka
e7a677ca1a ipa-devirt.c (type_with_linkage_p): New function.
* ipa-devirt.c (type_with_linkage_p): New function.
	(type_in_anonymous_namespace_p): Move here from tree.c; assert that
	type has linkage.
	(odr_type_p): Move here from ipa-utils.h; use type_with_linkage_p.
	(can_be_name_hashed_p): Simplify.
	(hash_odr_name): Check that type has linkage before checking if it is
	anonymous.
	(types_same_for_odr): Likewise.
	(odr_name_hasher::equal): Likewise.
	(odr_subtypes_equivalent_p): Likewise.
	(warn_types_mismatch): Likewise.
	(get_odr_type): Likewise.
	(odr_types_equivalent_p): Fix checking of TYPE_MAIN_VARIANT.
	* ipa-utils.h (odr_type_p): Move offline.
	* tree.c (need_assembler_name_p): Fix handling of types
	without linkages.
	(type_in_anonymous_namespace_p): Move to ipa-devirt.c

From-SVN: r223094
2015-05-12 18:30:40 +00:00
David Malcolm
2162235ef6 Move global state in timevar.c to a new "timer" class
gcc/ChangeLog:
	* timevar.c (timevar_enable): Delete in favor of...
	(g_timer): New global.
	(struct timevar_def): Move to timevar.h inside class timer.
	(struct timevar_stack_def): Likewise.
	(timevars): Delete global in favor of field "m_timevars" within
	class timer in timevar.h
	(stack): Likewise, in favor of field "m_stack".
	(unused_stack_instances): Likewise, in favor of field
	"m_unused_stack_instances".
	(start_time): Likewise, in favor of field "m_start_time".
	(get_time): Eliminate check for timevar_enable.
	(timer::timer): New function, built from part of timevar_init.
	(timevar_init): Rewrite idempotency test from using
	"timevar_enable" bool to using dynamic allocation of "g_timer".
	Move rest of implementation into timer's constructor.
	(timevar_push_1): Rename to...
	(timer::push): ...this, adding "m_" prefixes to variables that
	are now fields of timer.
	(timevar_pop_1): Likewise, rename to...
	(timer::pop): ...this, and add "m_" prefixes.
	(timevar_start): Replace test for "timevar_enable" with one for
	"g_timer", and move bulk of implementation to...
	(timer::start): ...here, adding "m_" prefixes.
	(timevar_stop): Likewise, from here...
	(timer::stop): ...to here.
	(timevar_cond_start): Likewise, from here...
	(timer::cond_start): ...to here.
	(timevar_cond_stop): Likewise, from here...
	(timer::cond_stop): ...to here.
	(validate_phases): Rename to...
	(timer::validate_phases): ...this, and add "m_" prefixes.  Make
	locals "total" and "tv" const.
	(timevar_print): Rename to...
	(timer::print): ...this, and add "m_" prefixes.  Make locals
	"total" and "tv" const.  Eliminate test for timevar_enable.
	* timevar.h (timevar_enable): Eliminate.
	(g_timer): New declaration.
	(timevar_push_1): Eliminate.
	(timevar_pop_1): Eliminate.
	(timevar_print): Eliminate.
	(class timer): New class.
	(timevar_push): Rewrite to use g_timer.
	(timevar_pop): Likewise.
	* toplev.c (toplev::~toplev): Likewise.

From-SVN: r223092
2015-05-12 17:29:32 +00:00
David Malcolm
2637afb722 Unbreak the JIT after conversion of md_asm_adjust to use vec<>
gcc/jit/ChangeLog:
	* jit-builtins.c: Include vec.h before target.h.

From-SVN: r223091
2015-05-12 17:19:54 +00:00
Richard Earnshaw
52c266bab2 arm-protos.h (arm_sched_autopref): Delete.
* arm-protos.h (arm_sched_autopref): Delete.
	(tune_params): Re-organize, use enums for flag values.
	(FUSE_OPS): New macro.
	* arm.c (ARM_PREFETCH_NOT_BENEFICIAL): Update.
	(ARM_PREFETCH_BENEFICIAL): Likewise.
	(ARM_FUSE_NOTHING, ARM_FUSE_MOVW_MOVT): Delete.
	(arm_slowmul_tune, arm_fastmul_tune, arm_strongarm_tune)
	(arm_xscale_tune, arm_9e_tune, arm_marvell_pj4_tune)
	(arm_v6t2_tune, arm_cortex_tune, arm_cortex_a8_tune)
	(arm_cortex_a7_tune, arm_cortex_a15_tune, arm_cortex_a53_tune)
	(arm_cortex_a57_tune,  arm_xgene1_tune, arm_cortex_a5_tune)
	(arm_cortex_a9_tune, arm_cortex_a12_tune, arm_v7m_tune)
	(arm_cortex_m7_tune, arm_v6m_tune, arm_fa726te_tune): Use new
	format.
	(arm_option_override, thumb2_reorg, arm_print_tune_info)
	(aarch_macro_fusion_pair_p): Update uses of current_tune.
	* arm.h (LOGCIAL_OP_NON_SHORT_CIRCUIT): Likewise.

From-SVN: r223090
2015-05-12 16:39:19 +00:00
Tom de Vries
cc1e0483ae check_GNU_style.sh: Fix tab size in 80 characters check
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh (col): Fix tab size.

From-SVN: r223088
2015-05-12 16:23:38 +00:00
Tom de Vries
a22e33d04a check_GNU_style.sh: Put stdin into temp file
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Put stdin into a temp file.

From-SVN: r223087
2015-05-12 16:23:29 +00:00
Tom de Vries
7f167be6ac check_GNU_style.sh: Read either from stdin, or from files
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Read either from stdin, or from files.

From-SVN: r223086
2015-05-12 16:23:19 +00:00
Tom de Vries
0648b80726 check_GNU_style.sh: Check file presence
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Check if files exists.

From-SVN: r223085
2015-05-12 16:23:11 +00:00
Tom de Vries
4171ffe90d check_GNU_style.sh: Don't use filename prefix for one patch
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Don't use a filename prefix if we're only
	processing one patch file.

From-SVN: r223084
2015-05-12 16:23:03 +00:00
Sandra Loosemore
eb2f4e8647 nios2.md (trap, ctrapsi4): Use "trap" instead of "break".
2015-05-12 Sandra Loosemore <sandra@codesourcery.com>

	gcc/
	* config/nios2/nios2.md (trap, ctrapsi4): Use "trap" instead of
	"break".

	gcc/testsuite/
	* gcc.target/nios2/nios2-trap-insn.c: Expect "trap" instead of
	"break".
	* gcc.target/nios2/nios2-stack-check-1.c: Likewise.

From-SVN: r223083
2015-05-12 12:10:21 -04:00
Chung-Lin Tang
3c8c9f0daf nios2.h (enum reg_class): Add IJMP_REGS enum value.
2015-05-12  Chung-Lin Tang  <cltang@codesourcery.com>
	    Sandra Loosemore <sandra@codesourcery.com>

	gcc/
	* config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
	value.
	(REG_CLASS_NAMES): Add "IJMP_REGS".
	(REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
	* config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
	use new "c" register constraint.
	* config/nios2/constraint.md (c): New register constraint
	corresponding to IJMP_REGS.


Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>

From-SVN: r223082
2015-05-12 11:57:22 -04:00
Yury Gribov
a92a1c274c mklog: Ignore preprocessor directives.
2015-05-12  Yury Gribov  <y.gribov@samsung.com>

	* mklog: Ignore preprocessor directives.

From-SVN: r223081
2015-05-12 15:31:02 +00:00
Arnaud Charlet
d5d3b217b3 * gnat_rm.texi, gnat_ugn.texi, doc: Documentation updates and clean ups
From-SVN: r223080
2015-05-12 17:20:38 +02:00
Arnaud Charlet
74e9ae980d * gnat_rm.texi, gnat_ugn.texi, doc: Documentation updates and clean ups
From-SVN: r223079
2015-05-12 17:19:25 +02:00
Arnaud Charlet
69031b4545 Fix typo.
From-SVN: r223078
2015-05-12 17:18:16 +02:00
Arnaud Charlet
7166d53559 [multiple changes]
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch5.adb (Analyze_Iterator_Specifications): Additional
	legality checks for array and container iterators:
	a) The domain of iteration cannot be a component that depends
	on discriminants of a mutable object. The check was recently
	added for element iterators.
	b) The cursor type cannot be a limited type at the point of the
	iteration, because the cursor will be assigned to in the body
	of the loop.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* freeze.adb (Freeze_Record_Type): Make sure that if we have
	aspect Iterator_Element, then we have either Constant_Indexing
	or Variable_Indexing.

From-SVN: r223077
2015-05-12 17:13:06 +02:00
Arnaud Charlet
4b17187f23 [multiple changes]
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* a-coormu.ads, a-coormu.adb: Add Indexing aspect, Reference_Type,
	and Reference_Control_Type to support element iterators over
	ordered multisets.
	* a-ciormu.ads, a-ciormu.adb: Ditto for
	indefinite_ordered_multisets.

2015-05-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch4.adb (Expand_N_Expression_With_Actions): Force
	the evaluation of the EWA expression.  Code cleanup.
	(Process_Transient_Object): Code cleanup.
	* exp_util.adb (Is_Aliased): Controlled transient objects found
	within EWA nodes are not aliased.
	(Is_Finalizable_Transient): Iterators are not finalizable transients.

From-SVN: r223076
2015-05-12 17:11:29 +02:00
Arnaud Charlet
7858300e04 [multiple changes]
2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb (Process_Atomic_Independent_Shared_Volatile):
	Don't allow Atomic and Volatile_Full_Access for the same entity.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch5.adb (Analyze_Iterator_Specification): Implement new
	semantics and safety checks specified in AI12-0151.

From-SVN: r223075
2015-05-12 17:07:01 +02:00
Arnaud Charlet
c8d3b4ff3f [multiple changes]
2015-05-12  Pierre-Marie de Rodat  <derodat@adacore.com>

	* sem_ch10.adb (Sem_Ch10.Analyze_Proper_Body): Generate SCOs
	for subunit in generic units.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_elab.adb (Check_A_Call): Avoid checking internal call
	from Valid_Scalars

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Process_Formals): An untagged incomplete type
	is legal in the profile of a null procedure.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Validate_Derived_Type_Instance): Handle properly
	the checks on a derived formal whose parent type is a previous
	formal that is not a derived type.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* aspects.ads, aspects.adb: Add entries for aspect Volatile_Full_Access
	* einfo.adb (Has_Volatile_Full_Access): New flag.
	(Has_Volatile_Full_Access): New flag.
	* einfo.ads (Has_Volatile_Full_Access): New flag.
	* par-prag.adb: Add dummy entry for Volatile_Full_Access.
	* sem_prag.adb (Analyze_Pragma, case Volatile_Full_Access):
	Implement new pragma.
	* snames.ads-tmpl: Add entries for pragma Volatile_Full_Access.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* targparm.ads: Minor reformatting.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* a-reatim.adb (Time_Of): Properly detect overflow when TS = 0.0.
	* a-reatim.ads: Minor reformatting.

From-SVN: r223074
2015-05-12 17:00:49 +02:00
Uros Bizjak
98b5dc6118 libgcov-util.c: Add space between string literal and macro name.
* libgcov-util.c: Add space between string literal and macro name.

From-SVN: r223073
2015-05-12 16:40:49 +02:00
Segher Boessenkool
de065fbf8d rs6000.md (*rotlsi3_internal4, [...]): Delete, revamp, transmogrify into ...
* config/rs6000/rs6000.md (*rotlsi3_internal4, *rotlsi3_internal5,
	*rotlsi3_internal6, rlwinm, 5 unnamed define_insns, and 6
	define_splits): Delete, revamp, transmogrify into ...
	(*rotlsi3_mask, *rotlsi3_mask_dot, *rotlsi3_mask_dot2,
	*ashlsi3_imm_mask, *ashlsi3_imm_mask_dot, *ashlsi3_imm_mask_dot2,
	*lshrsi3_imm_mask, *lshrsi3_imm_mask_dot, *lshrsi3_imm_mask_dot2):
	New.

From-SVN: r223072
2015-05-12 15:55:46 +02:00
Segher Boessenkool
1a93ca861c rs6000.md (rs6000_adjust_atomic_subword): Use gen_ashlsi3 and gen_andsi3 instead of gen_rlwinm.
* config/rs6000/rs6000.md (rs6000_adjust_atomic_subword): Use
	gen_ashlsi3 and gen_andsi3 instead of gen_rlwinm.

From-SVN: r223071
2015-05-12 15:49:21 +02:00
Segher Boessenkool
52a680ceaa rs6000.md (extzv): FAIL for SImode.
* config/rs6000/rs6000.md (extzv): FAIL for SImode.
	(extzvsi_internal, *extzvsi_internal1, *extzvsi_internal2,
	*rotlsi3_internal7le, *rotlsi3_internal7be, *rotlsi3_internal8le,
	*rotlsi3_internal8be, *rotlsi3_internal9le, *rotlsi3_internal9be,
	*rotlsi3_internal10le, *rotlsi3_internal10be, *rotlsi3_internal11le,
	*rotlsi3_internal11be, *rotlsi3_internal12le, *rotlsi3_internal12be,
	*lshiftrt_internal1le, *lshiftrt_internal1be, *lshiftrt_internal2le,
	*lshiftrt_internal2be, *lshiftrt_internal3le, *lshiftrt_internal3be,
	*lshiftrt_internal4le, *lshiftrt_internal4be, *lshiftrt_internal5le,
	*lshiftrt_internal5be, *lshiftrt_internal5le, *lshiftrt_internal5be,
	*rotldi3_internal7le, *rotldi3_internal7be, *rotldi3_internal8le,
	*rotldi3_internal8be, *rotldi3_internal9le, *rotldi3_internal9be,
	*rotldi3_internal10le, *rotldi3_internal10be, *rotldi3_internal11le,
	*rotldi3_internal11be, *rotldi3_internal12le, *rotldi3_internal12be,
	*rotldi3_internal13le, *rotldi3_internal13be, *rotldi3_internal14le,
	*rotldi3_internal14be, *rotldi3_internal15le, *rotldi3_internal15be,
	and 30 corresponding splitters): Delete.

From-SVN: r223070
2015-05-12 15:47:04 +02:00
Segher Boessenkool
f369372b41 rs6000.md (define_split for bswaphi): Don't use zero_extract.
* config/rs6000/rs6000.md (define_split for bswaphi): Don't use
	zero_extract.

From-SVN: r223069
2015-05-12 15:44:25 +02:00
Arnaud Charlet
65fe0167eb [multiple changes]
2015-05-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* einfo.ads: Update the documentation of flags
	Has_Inherited_Default_Init_Cond and Has_Default_Init_Cond.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* impunit.adb: Add entry for a-dhfina.ads
	* a-dhfina.ads: New file.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): if the array
	type has convention Fortran, a multidimensional iterator varies
	the first dimension fastest.

From-SVN: r223068
2015-05-12 15:44:19 +02:00
Segher Boessenkool
45ce0f05e0 combine.c (recog_for_combine_1): New function, factored out from recog_for_combine.
* combine.c (recog_for_combine_1): New function, factored out
	from recog_for_combine.
	(change_zero_ext): New function.
	(recog_for_combine): If recog fails, try again with the pattern
	modified by change_zero_ext; if that still fails, restore the
	pattern.

From-SVN: r223067
2015-05-12 15:42:21 +02:00
Segher Boessenkool
1bcc1e4102 combine.c (get_undo_marker): New function.
* combine.c (get_undo_marker): New function.
	(undo_to_marker): New function, largely factored out from ...
	(undo_all): ... this.  Adjust.

From-SVN: r223066
2015-05-12 15:37:53 +02:00
Richard Biener
7e37fe6f62 re PR tree-optimization/66101 (internal compiler error: in verify_loop_structure, at cfgloop.c:1662)
2015-05-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66101
	* tree-ssa-dce.c (remove_dead_stmt): Properly mark loops for
	fixup if we turn a loop exit edge to a fallthru edge.

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

From-SVN: r223065
2015-05-12 13:28:33 +00:00
Arnaud Charlet
caf07df9db [multiple changes]
2015-05-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* einfo.adb Node32 is now used as Encapsulating_State.
	Node37 is now used as Associated_Entity.
	(Associated_Entity): New routine.
	(Encapsulating_State): Update the assertion guard
	to include constants.
	(Set_Associated_Entity): New routine.
	(Set_Encapsulating_State): Update the assertion guard to
	include constants.
	(Write_Field10_Name): Remove the output for Encapsulating_State.
	(Write_Field32_Name): Add output for Encapsulating_State.
	(Write_Field37_Name): Add output for Associated_Entity.
	* einfo.ads New attribute Associated_Entity along with placement
	in entities. Attribute Encapsulating_State now uses Node32.
	(Associated_Entity): New routine along with pragma Inline.
	(Set_Associated_Entity): New routine along with pragma Inline.
	* inline.ads Code reformatting.
	* sem_attr.adb (Analyze_Attribute): Correct the prefix of
	attribute 'Result when the context is a generic instantiation.
	(Analyze_Attribute_Old_Result): Pragmas Depends and
	Refined_Depends are a valid context for attribute 'Result.
	(Denote_Same_Function): Allow attribute 'Result to denote
	generic functions.
	* sem_ch3.adb Add with and use clauses for Sem_Ch12.
	(Analyze_Declarations): Capture global references within the
	contracts of packages, subprograms and their respective bodies.
	* sem_ch6.adb (Analyze_Aspects_On_Body_Or_Stub): Removed.
	(Analyze_Completion_Contract): Removed.
	(Analyze_Generic_Subprogram_Body): Enchange the aspects after
	creating the generic copy. Create a generic contract for the
	template. Analyze the aspects of the generic body. Analyze the
	contract of the generic body when it is a compilation unit and
	capture global references.
	(Analyze_Subprogram_Body_Contract): Code cleanup.
	(Analyze_Subprogram_Contract): Do not save global references here.
	(Save_Global_References_In_List): Removed.
	* sem_ch7.adb (Analyze_Package_Body_Contract): Code cleanup.
	(Analyze_Package_Body_Helper): Create a generic contract for
	the template.
	(Analyze_Package_Contract): Code cleanup.
	* sem_ch10.adb Add with and use clauses for Sem_Ch12.
	(Analyze_Compilation_Unit): Capture global references in a
	generic subprogram declaration that acts as a compilation unit.
	* sem_ch12.adb Add with and use clauses for Sem_Prag. Illustrate
	the implementation of generic contracts. Alphabetize various
	subprograms.
	(Analyze_Generic_Package_Declaration):
	Create a generic contract for the template.
	(Analyze_Generic_Subprogram_Declaration): Create a generic
	contract for the template.
	(Analyze_Subprogram_Instantiation): Instantiate the contract of the
	subprogram.
	(Copy_Generic_Node): Link defining entities of the generic template
	with the corresponding defining entities of the generic copy. Update
	the processing of pragmas.
	(Instantiate_Contract): Removed.
	(Instantiate_Subprogram_Contract): New routine.
	(Requires_Delayed_Save): New routine.
	(Save_Global_References): Rename formal parameter N to Templ. Various
	cleanups.
	(Save_Global_References_In_Aspects): Moved from the spec.
	(Save_Global_References_In_Contract): New routine.
	(Save_References_In_Aggregate): New routine.
	(Save_References_In_Char_Lit_Or_Op_Symbol): New routine.
	(Save_References_In_Descendants): New routine.
	(Save_References_In_Identifier): New routine.
	(Save_References_In_Operator): New routine.
	(Save_References_In_Pragma): New routine.
	* sem_ch12.ads (Save_Global_References): Rename formal
	parameter N to Templ. Update the comment on usage.
	(Save_Global_References_In_Aspects): Moved to the body.
	(Save_Global_References_In_Contract): New routine.
	* sem_ch13.adb (Analyze_Aspect_Specifications_On_Body_Or_Stub):
	New routine.
	* sem_ch13.ads (Analyze_Aspect_Specifications_On_Body_Or_Stub):
	New routine.
	* sem_prag.adb (Add_Item_To_Name_Buffer): Add support for
	generic parameters.
	(Analyze_Contract_Cases_In_Decl_Part): Code cleanup.
	(Analyze_Depends_Global): New routine.
	(Analyze_Depends_In_Decl_Part): Code cleanup.
	(Analyze_Global_In_Decl_Part): Code cleanup.
	(Analyze_Global_Item): Constants are now valid global items. Do
	not perform state-related checks in an instance. Change the way
	renamings are handled.	(Analyze_Initial_Condition_In_Decl_Part):
	Code cleanup.
	(Analyze_Initializes_In_Decl_Part): Code cleanup.
	(Analyze_Input_Output): The analysis of attribute 'Result in
	the context of pragmas Depends or Refined_Depends now reuses
	the existing attribute analysis machinery. Constants and
	generic parameters are now valid dependency items. Do not
	perform state-related checks in an instance. Change the way
	renamings are handled.	(Analyze_Pragma): Add a "characteristics"
	section for pragmas Abstract_State, Contract_Cases, Depends,
	Extensions_Visible, Global, Initial_Condition, Initializes,
	Post, Post_Class, Postcondition, Pre, Pre_Class, Precondition,
	Refined_Depends, Refined_Global, Refined_Post, Refined_State, Test_Case.
	(Analyze_Pre_Post_Condition): Do not create a generic
	template here.
	(Analyze_Pre_Post_Condition_In_Decl_Part): Code cleanup.
	(Analyze_Refined_Depends_Global_Post): New routine.
	(Analyze_Refined_Depends_In_Decl_Part): Code cleanup.
	(Analyze_Refined_Global_In_Decl_Part): Code cleanup.
	(Analyze_Refined_Pragma): Removed.
	(Analyze_Refined_State_In_Decl_Part): Code cleanup.
	(Analyze_Test_Case_In_Decl_Part): Code cleanup.
	(Check_Dependency_Clause): Do not perform this check in an instance.
	(Check_Function_Return): Add support for generic functions.
	(Check_In_Out_States): Do not perform this check in an instance.
	(Check_Input_States): Do not perform this check in an instance.
	(Check_Mode_Restriction_In_Function): Add support for generic functions.
	(Check_Output_States): Do not perform this check in an instance.
	(Check_Postcondition_Use_In_Inlined_Subprogram): Rename
	parameter Subp_Id to Spec_Id and update comment on usage.
	(Check_Proof_In_States): Do not perform this check in an instance.
	(Check_Refined_Global_Item): Add support for constants.
	(Check_Refined_Global_List): Do not perform this check in an instance.
	(Collect_Global_Items): Reimplemented.
	(Collect_Subprogram_Inputs_Outputs): Add support for generic parameters.
	(Create_Generic_Template): Removed.
	(Find_Related_Package_Or_Body): Moved to spec.
	(Find_Role): Add support for generic parameters and constants.
	(Get_Argument): Moved to spec. Rename parameter Spec_Id to Context_Id.
	(Match_Item): Add support for constants.
	(Preanalyze_Test_Case_Arg): Reimplemented.
	(Report_Extra_Clauses): Do not perform this check in an instance.
	(Report_Extra_Constituents): Do not perform this check in an instance.
	* sem_prag.ads (Collect_Subprogram_Inputs_Outputs): Update
	the comment on usage.
	(Find_Related_Package_Or_Body): Moved from body.
	(Get_Argument): Moved from body.
	* sem_util.adb Add with and use clauses for Sem_Ch12.
	(Corresponding_Spec_Of): Add support for packages and package bodies.
	(Create_Generic_Contract): New routine.
	(Is_Contract_Annotation): Reimplemented.
	(Is_Generic_Declaration_Or_Body): New routine.
	(Is_Package_Contract_Annotation): New routine.
	(Is_Subprogram_Contract_Annotation): New routine.
	* sem_util.ads (Corresponding_Spec_Of): Update the comment on usage.
	(Create_Generic_Contract): New routine.
	(Is_Generic_Declaration_Or_Body): New routine.
	(Is_Package_Contract_Annotation): New routine.
	(Is_Subprogram_Contract_Annotation): New routine.
	* sinfo.adb (Is_Generic_Contract_Pragma): New routine.
	(Set_Is_Generic_Contract_Pragma): New routine.
	* sinfo.ads Add new attribute Is_Generic_Contract_Pragma along
	with occurrences in nodes.
	(Is_Generic_Contract_Pragma): New routine along with pragma Inline.
	(Set_Is_Generic_Contract_Pragma): New routine along with pragma Inline.
	* treepr.adb (Print_Entity_Info): Output fields 36 to 41.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* a-taster.ads: Minor comment fix: fix bad header, this is a
	pure RM unit.

From-SVN: r223064
2015-05-12 14:47:19 +02:00
Robert Dewar
c944345b5d sem_intr.adb: (Check_Shift): Diagnose bad modulus value.
2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_intr.adb: (Check_Shift): Diagnose bad modulus value.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* gnat1drv.adb (Adjust_Global_Switches): Default to suppressing
	Alignment_Checks on non-strict alignment machine.
	* sem_ch13.adb (Validate_Address_Clauses): Don't give
	compile-time alignment warnings if run time Alignment_Check
	is suppressed.

From-SVN: r223063
2015-05-12 14:42:48 +02:00
Arnaud Charlet
52ea13f2c1 [multiple changes]
2015-05-12  Thomas Quinot  <quinot@adacore.com>

	* g-sercom.ads, g-sercom-linux.adb (GNAT.Serial_Communications.
	Data_Rate): New literals B75, B110, B150, B300, B600.

2015-05-12  Doug Rupp  <rupp@adacore.com>

	* init.c (__gnat_init_float) [vxworks]: For e500v2,
	do nothing and leave the responsibility to install the handler
	and enable the exceptions to the BSP.

From-SVN: r223062
2015-05-12 14:39:52 +02:00
Richard Biener
6876e5bcd4 re PR tree-optimization/37021 (Fortran Complex reduction / multiplication not vectorized)
2015-05-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/37021
	* tree-vectorizer.h (struct _slp_tree): Add two_operators flag.
	(SLP_TREE_TWO_OPERATORS): New define.
	* tree-vect-slp.c (vect_create_new_slp_node): Initialize
	SLP_TREE_TWO_OPERATORS.
	(vect_build_slp_tree_1): Allow two mixing plus/minus in an
	SLP node.
	(vect_build_slp_tree): Adjust.
	(vect_analyze_slp_cost_1): Likewise.
	(vect_schedule_slp_instance): Vectorize mixing plus/minus by
	emitting two vector stmts and mixing the results.

	* gcc.target/i386/vect-addsub.c: New testcase.

From-SVN: r223059
2015-05-12 11:55:40 +00:00
Dominik Vogt
eed4068d5d Remove dead code in print_z_candidates.
2015-05-12  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* call.c (print_z_candidates): Remove dead code.

From-SVN: r223057
2015-05-12 11:27:52 +00:00
Andreas Krebbel
ff39d72a30 2827.md: Split zEC12_simple into zEC12_simple_int and zEC12_simple_fp.
2015-05-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/2827.md: Split zEC12_simple into zEC12_simple_int
	and zEC12_simple_fp.
	* config/s390/s390.c (s390_issue_rate): Set issue rate for zEC12
	to 1.

From-SVN: r223056
2015-05-12 11:23:48 +00:00
Alexander Monakov
570c6987d8 * gcc.target/i386/pr65753.c: Use -O2 instead of -O.
From-SVN: r223055
2015-05-12 13:36:42 +03:00
Tom de Vries
c7b38fd545 Don't take address of ap unless necessary
2015-05-12  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/66010
	* gimplify.c (gimplify_modify_expr): Handle new do_deref argument of
	ifn_va_arg.
	* gimplify.h (gimplify_va_arg_internal): Remove loc parameter.
	(gimplify_va_arg_internal): Remove loc parameter.  Assert no array-typed
	va_lists are passed, and remove corresponding handling.
	(gimplify_va_arg_expr): Only take address of ap if necessary.  Add
	do_deref argument to ifn_va_arg.
	* tree-stdarg.c (expand_ifn_va_arg_1): Handle new do_deref argument of
	ifn_va_arg.

	* c-common.c (build_va_arg): Don't mark ap addressable unless necessary.

	* gcc.dg/tree-ssa/stdarg-2.c: Undo scan xfails for f15.

From-SVN: r223054
2015-05-12 09:46:47 +00:00
Robert Dewar
fed8bd87d5 sem_ch9.adb, [...]: Minor reformatting.
2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_ch9.adb, einfo.ads, exp_intr.adb: Minor reformatting.
	* sem_disp.adb: Minor code reorganization (remove junk redundant
	null statement).
	* exp_unst.adb (Unnest_Subprogram.Uplev_Refs): Ignore uplevel
	references to bounds of types coming from original type reference.
	* checks.ads: Minor reformatting.
	* checks.adb: Minor reformatting.
	* sem_prag.adb (Analyze_Pragma, case Check): If in ignored
	assertion, then make sure we do not drag in bignum stuff.

From-SVN: r223053
2015-05-12 11:28:19 +02:00
Ed Schonberg
27fd9ad83b sem_ch9.adb (Collect_Interfaces): Initialize Direct_Primitive_Operations for a tagged synchronized type...
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch9.adb (Collect_Interfaces): Initialize
	Direct_Primitive_Operations for a tagged synchronized type,
	so it can used in ASIS mode.
	* sem_disp.adb (Check_Dispatching_Operation): If expansion is
	disabled, attach subprogram to list of Direct_Primitive_Operations
	of synchronized type itself, for ASIS use, because in this case
	Corresponding_Record_Type is not built.
	* einfo.ads: Indicate use of Direct_Primitive_Operations on
	synchronized type.

From-SVN: r223051
2015-05-12 11:20:50 +02:00
Arnaud Charlet
7c4d86c9cc [multiple changes]
2015-05-12  Pierre-Marie de Rodat  <derodat@adacore.com>

	* exp_pakd.adb: Make clearer the comment in exp_pakd.adb about
	___XP suffixes.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, sem_util.adb, sem_ch6.adb: Minor reformatting.

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* exp_unst.adb (Visit_Node): Deal with subprogram and package stubs.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* exp_intr.adb (Expand_Dispatching_Constructor_Call): The
	tag to be retrieved for the generated call is the first entry
	in the dispatch table for the return type of the instantiated
	constructor.

2015-05-12  Bob Duff  <duff@adacore.com>

	* exp_ch7.adb, exp_ch7.ads, exp_intr.adb, exp_util.adb,
	exp_util.ads: Update comments.

From-SVN: r223050
2015-05-12 11:17:45 +02:00
Kyrylo Tkachov
0d780006d4 [ARM] Fix PR 65955: Do not take REGNO on non-REG operand in movcond_addsi
PR target/65955
	* config/arm/arm.md (movcond_addsi): Check that operands[2] is a
	REG before taking its REGNO.

From-SVN: r223049
2015-05-12 09:15:09 +00:00
Arnaud Charlet
8d1fe980a2 [multiple changes]
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Add_Internal_Interface_Entities): Do no generate
	freeze nodes for these in ASIS mode, because they lead to
	elaoration order issues in gigi.

2015-05-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch6.adb (Analyze_Expression_Function): Code
	cleanup. Use Copy_Subprogram_Spec to create a proper spec.
	(Analyze_Subprogram_Body_Helper): Code cleanup. Do not
	prepare a stand alone body for inlining in GNATprove mode
	when inside a generic.	(Body_Has_Contract): Reimplemented.
	(Build_Subprogram_Declaration): New routine.
	* sem_ch10.adb (Analyze_Compilation_Unit): Capture global
	references within generic bodies by loading them.
	* sem_util.adb (Copy_Parameter_List): Code cleanup.
	(Copy_Subprogram_Spec): New routine.
	(Is_Contract_Annotation): New routine.
	* sem_util.ads (Copy_Subprogram_Spec): New routine.
	(Is_Contract_Annotation): New routine.

2015-05-12  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_attr.adb (Resolve_Attribute): Do not analyze the generated
	body of an expression function when the prefix of attribute
	'Access is the body.

From-SVN: r223048
2015-05-12 11:14:02 +02:00
Paolo Carlini
cb2e147086 re PR c++/65133 ([C++11] Result type deduction proceeds even though argument deduction fails)
2015-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/65133
	* g++.dg/cpp0x/trailing10.C: New.

From-SVN: r223047
2015-05-12 09:03:04 +00:00
Arnaud Charlet
731261c334 [multiple changes]
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Build_Derived_Enumeration_Type): The anonymous base
	created for a derived enumeration type is not a first subtype,
	even though it is defined through a full type declaration.
	* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Do not process
	aspects for the anonymous base type constructed for a derived
	scalar type, because they will be set when the first subtype
	is frozen.
	(Inherit_Aspects_At_Freeze_Point): Fix typos on handling of
	Default_Value and Default_Component_Value, that prevented the
	proper inheritance of these aspects.

2015-05-12  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch6.adb, exp_unst.adb: Minor typo fixes.

From-SVN: r223045
2015-05-12 10:54:42 +02:00
Arnaud Charlet
f8dae9bb29 [multiple changes]
2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb: Minor reformatting.

2015-05-12  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb: If we want to invoke gnatmake (gnatclean) with
	-P, then check if gprbuild (gprclean) is available; if it is,
	use gprbuild (gprclean) instead of gnatmake (gnatclean).

2015-05-12  Robert Dewar  <dewar@adacore.com>

	* debug.adb: Add flag -gnatd.3 to output diagnostic info from
	Exp_Unst.
	* einfo.ad, einfo.adb: Reorganize (and remove most of) flags used by
	Exp_Unst.
	* exp_ch6.adb (Unest_Bodies): Table for delayed calls to
	Unnest_Subprogram (Expand_N_Subprogram_Body): Add entry to table
	for later call instead of calling Unnest_Subprogram directly
	(Initialize): New procedure (Unnest_Subprograms): New procedure
	* exp_ch6.ads (Add_Extra_Actual_To_Call): Move into proper
	alpha order.
	(Initialize): New procedure.
	(Unnest_Subprograms): New procedure.
	* exp_unst.adb (Unnest_Subprogram): Major rewrite, moving
	all processing to this routine which is now called late
	after instantiating bodies. Fully handles the case of generic
	instantiations now.
	* exp_unst.ads: Major rewrite, moving all processing to
	Unnest_Subprogram.
	* frontend.adb (Frontend): Add call to Exp_Ch6.Initialize.
	(Frontend): Add call to Unnest_Subprograms.
	* sem_ch8.adb (Find_Direct_Name): Back to old calling sequence
	for Check_Nested_Access.
	* sem_util.adb (Build_Default_Subtype): Minor reformatting
	(Check_Nested_Access): Back to original VM-only form (we
	now do all the processing for Unnest_Subprogram at the time
	it is called.
	(Denotes_Same_Object): Minor reformatting
	(Note_Possible_Modification): Old calling sequence for
	Check_Nested_Access.
	* sem_util.ads (Check_Nested_Access): Back to original VM-only
	form (we now do all the processing for Unnest_Subprogram at the
	time it is called.

From-SVN: r223043
2015-05-12 10:36:45 +02:00
Robert Dewar
73cc8f6230 sem_ch3.adb, [...]: Minor reformatting.
2015-05-12  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, freeze.adb, sem_ch6.adb: Minor reformatting.

From-SVN: r223042
2015-05-12 10:34:04 +02:00
Ed Schonberg
b741083a31 sem_ch3.adb (Analyze_Object_Declaration): New function Has_Delayed_Aspect...
2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Analyze_Object_Declaration): New function
	Has_Delayed_Aspect, used to defer resolution of an aggregate
	expression when the object declaration carries aspects Address
	and/or Alignment.
	* freeze.adb (Freeze_Object_Declaration): New subsidiary procedure
	to Freeze_Entity.  In addition to the previous processing steps
	at the freeze point of an object, this procedure also handles
	aggregates in object declarations, when the declaration carries
	delayed aspects that require that the initialization of the
	object be attached to its freeze actions.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Analyze_Subprogram_Declaration): Following
	AI12-0147, null procedures and expression functions are allowed
	in protected bodies.

From-SVN: r223041
2015-05-12 10:25:39 +02:00
Arnaud Charlet
a0a1085334 [multiple changes]
2015-05-12  Tristan Gingold  <gingold@adacore.com>

	* i-cpoint.adb (Copy_Terminated_Array): Copy nothing if Length is 0.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Complete_Private_Subtype): Propagate
	Has_Delayed_Aspects flag from private to full view, to ensure
	that predicate functions are constructed.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Process_Formals): If a tagged formal is an
	incomplete class-wide type, the subprogram must have a delayed
	freeze even though the opertation is not a primitive of the
	type. THis ensures that the backend can recover the full view
	when elaborating the subprogram declaration.

2015-05-12  Ed Schonberg  <schonberg@adacore.com>

	* exp_util.adb (Get_Current_Value_Condition): Nothing to be
	done if an elsif part has been rewritten so that it is not part
	of an enclosing if_statement.

From-SVN: r223040
2015-05-12 10:21:47 +02:00