Commit Graph

136958 Commits

Author SHA1 Message Date
H.J. Lu
a55bbe1365 Regenerate doc/tm.texi
* doc/tm.texi: Regenerated.

From-SVN: r221151
2015-03-03 07:52:07 -08:00
Max Filippov
2e612c470d Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression
This allows a target to support both windowed and non-windowed ABI.

2015-03-03  Max Filippov  <jcmvbkbc@gmail.com>

gcc/
	* builtins.c (expand_builtin_return_addr): Add
	RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition, remove
	surrounding #ifdef.
	* config/sparc/sparc.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Change
	definition to 1.
	* config/xtensa/xtensa.h (RETURN_ADDR_IN_PREVIOUS_FRAME):
	Likewise.
	* defaults.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Define to 0 if
	undefined.
	* doc/tm.texi.in (RETURN_ADDR_IN_PREVIOUS_FRAME): Update
	paragraph.

From-SVN: r221150
2015-03-03 15:04:02 +00:00
Joern Rennecke
9dd44d1c80 MAINTAINERS (CPU Port Maintainers): Update my email address.
2015-03-03  Joern Rennecke  <gnu@amylaar.uk>

        * MAINTAINERS (CPU Port Maintainers): Update my email address.

From-SVN: r221149
2015-03-03 14:02:18 +00:00
Martin Jambor
ebde4f8e39 tree-sra.c (ipa_sra_check_caller_data): New type.
2015-03-03  Martin Jambor  <mjambor@suse.cz>
            Eric Botcazou  <ebotcazou@adacore.com>

gcc/
        * tree-sra.c (ipa_sra_check_caller_data): New type.
        (has_caller_p): Removed.
        (ipa_sra_check_caller): New function.
        (ipa_sra_preliminary_function_checks): Use it.

gcc/changelog/
        * gnat.dg/specs/pack12.ads: New test.



Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r221148
2015-03-03 14:58:15 +01:00
Martin Liska
21ce14d309 ICF: Use bit or instead of if branch.
* ipa-icf.c (sem_item_optimizer::merge_classes): Use bit or
	instead of if branch.

From-SVN: r221147
2015-03-03 12:10:57 +00:00
Martin Liska
3c031cbe7c re PR ipa/65282 (wrong code at -Os and above on x86_64-linux-gnu)
Fix PR ipa/65282.

	* gcc.dg/ipa/PR65282.c: New test.
	PR ipa/65282
	* ipa-icf.c (sem_variable::equals): Fix wrong condition.

From-SVN: r221146
2015-03-03 12:09:13 +00:00
Jeff Law
2f159d9f86 re PR tree-optimization/65241 (ICE (in remove_local_expressions_from_table, at tree-ssa-dom.c:1081))
PR tree-optimization/65241
	* tree-ssa-dom.c (lookup_avail_expr): Only modify the avail_expr
	hash table if INSERT is true.

	PR tree-optimization/65241
	* gcc.c-torture/compile/pr65241.c: New test.

From-SVN: r221145
2015-03-03 04:54:49 -07:00
Georg-Johann Lay
5cb8b86ede re PR target/65296 ([avr] fix various issues with specs file generation)
PR target/65296
	* config.gcc (extra_gcc_objs) [avr-*-rtems*]: Remove.

From-SVN: r221144
2015-03-03 11:31:05 +00:00
Georg-Johann Lay
2b4293a390 re PR target/64331 (regcprop propagates registers noted as REG_DEAD)
gcc/
	PR target/64331
	* config/avr/avr.c (context.h, tree-pass.h): Include them.
	(avr_pass_data_recompute_notes): New static variable.
	(avr_pass_recompute_notes): New class.
	(avr_register_passes): New static function.
	(avr_option_override): Call it.
gcc/testsuite/
	PR target/64331
	* gcc.target/avr/torture/pr64331.c: New test.

From-SVN: r221143
2015-03-03 11:25:04 +00:00
Georg-Johann Lay
3882207695 Fix various problems with specs file generation.
gcc/
	Fix various problems with specs file generation.
	PR target/65296
	* config.gcc (extra_gcc_objs) [avr]: Remove.
	* config/avr/driver-avr.c: Remove file.
	* config/avr/t-avr (driver-avr.o): Remove rule.
	(gen-avr-mmcu-specs): Use CXX_FOR_BUILD, CXXFLAGS_FOR_BUILD and
	INCLUDES to build.  Depend on TM_H.
	* config/avr/gen-avr-mmcu-specs.c: Tidy up code.  Fix various
	build warnings.  Fix non-matching types and non-existing %-codes.
	(tm.h): Include.
	(*lib) [!WITH_AVRLIBC]: Don't link libdev.a.
	(*libgcc) [WITH_AVRLIBC]: Add "-lm".
	* config/avr/avrlibc.h (LIBGCC_SPEC): Remove definition.
	* config/avr/avr.h (DRIVER_SELF_SPECS): Fix handling of -march=.
	(CPP_SPEC, CC1PLUS_SPEC, ASM_SPEC, LINK_SPEC, LIB_SPEC)
	(LIBGCC_SPEC): Remove definitions.

From-SVN: r221141
2015-03-03 11:03:16 +00:00
Eric Botcazou
b4b78e2db4 ia64.c (expand_vec_perm_interleave_2): Use gen_raw_REG to create a register in testing mode.
* config/ia64/ia64.c (expand_vec_perm_interleave_2): Use gen_raw_REG
	to create a register in testing mode.

From-SVN: r221139
2015-03-03 10:41:00 +00:00
Martin Liska
17d1bf760f re PR target/65263 (ICE (error: unrecognizable insn / in insn_min_length, at config/rs6000/rs6000.md) on powerpc64le-linux-gnu)
Fix PR ipa/65263.

	PR ipa/65263
	* cgraph.c (cgraph_node::has_thunk_p): New function.
	* cgraph.h (cgraph_node::has_thunk_p: Likewise.
	* ipa-icf.c (redirect_all_callers): Do not redirect thunks.
	(sem_function::merge): Assert is changed.
	* g++.dg/ipa/pr65263.C: New test.


Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>

From-SVN: r221134
2015-03-03 09:26:20 +00:00
Martin Liska
bd31fe14d2 re PR ipa/65087 (r220742 causes: ICE: in ipcp_verify_propagated_values, at ipa-cp.c:1057)
Fix PR ipa/65087.

	PR ipa/65087
	* ipa-icf.c (sem_item_optimizer::execute): Change function
	return value to boolean.
	(sem_item_optimizer::merge_classes): Likewise.
	(ipa_icf_driver): Return TODO_remove_functions in case there's
	a merge operation processed.
	* ipa-icf.h: Change function return value to boolean.


Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r221133
2015-03-03 09:21:56 +00:00
Michael Meissner
0eef284e88 PR 65138/target
2015-03-02  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR 65138/target
	* config/rs6000/rs6000-cpus.def (powerpc64le): Add new generic
	processor type for 64-bit little endian PowerPC.

	* config/rs6000/rs6000.c (rs6000_option_override_internal): If
	-mdebug=reg, print TARGET_DEFAULT.  Fix logic to use
	TARGET_DEFAULT if there is no default cpu.  Fix -mdebug=reg
	printing built-in mask so it does not pass NULL pointers.

	* doc/invoke.texi (IBM RS/6000 and PowerPC options): Document
	-mcpu=powerpc64le.

From-SVN: r221132
2015-03-03 00:59:56 +00:00
GCC Administrator
a0d620699b Daily bump.
From-SVN: r221131
2015-03-03 00:16:17 +00:00
Steve Ellcey
7096a06885 re PR target/58158 (ICE with conditional moves on GPRs with a floating point conditional on mipsel with loongson2f)
2015-03-02  Steve Ellcey  <sellcey@imgtec.com>

	PR target/58158
	* config/mips/mips.md (mov<mode>cc): Change ISA_HAS_SEL check to
	!ISA_HAS_FP_CONDMOVE.

From-SVN: r221128
2015-03-03 00:07:19 +00:00
Aldy Hernandez
29e27c0bf3 i386.md (*udivmod<mode>4_pow2): Remove reload_completed.
* config/i386/i386.md (*udivmod<mode>4_pow2): Remove
	reload_completed.

From-SVN: r221127
2015-03-02 23:52:42 +00:00
Ulrich Drepper
0ce039659d invoke.texi (Options for Code Generation Conventions): Fix URL of DSO paper.
* doc/invoke.texi (Options for Code Generation Conventions):
        Fix URL of DSO paper.

From-SVN: r221125
2015-03-02 20:44:41 +00:00
Jan Hubicka
1af8bfe516 re PR lto/65130 (ICE with LTO on valid code on x86_64-linux-gnu)
PR ipa/65130
	* ipa-inline.c (check_callers): Looks for recursion.
	(inline_to_all_callers): Give up on uninlinable or recursive edges.
	* ipa-inline-analysis.c (inline_summary_t::duplicate): Do not update
	summary of inline clones.
	(do_estimate_growth_1): Fix recursion check.

	* gcc.dg/lto/pr65130_0.c: New testcase.
	* gcc.dg/lto/pr65130_1.c: New testcase.

From-SVN: r221124
2015-03-02 20:31:21 +00:00
Jan Hubicka
b91b562cf2 re PR ipa/64988 (ICE: verify_cgraph_node failed: Alias and target's comdat groups differs with -fdeclone-ctor-dtor)
PR ipa/64988
	* ipa-inline-transform.c (clone_inlined_nodes): Do not dissolve
	comdat groups.
	* g++.dg/torture/pr64988.C: New testcase.

From-SVN: r221123
2015-03-02 20:10:56 +00:00
Tobias Burnus
bc81b5ce9b check.c (gfc_check_atomic): Properly check for coarrayness and for being coindexed.
2015-03-02  Tobias Burnus  <burnus@net-b.de>

        * check.c (gfc_check_atomic): Properly check for coarrayness
        and for being coindexed.

2015-03-02  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/coarray_atomic_6.f90: New.

From-SVN: r221122
2015-03-02 19:56:51 +01:00
Jan Hubicka
af5513e96b re PR lto/65276 (LTO: ICE add_type_duplicate, at ipa-devirt.c:1462)
PR lto/65276
	* ipa-devirt.c (add_type_duplicate): Remove odr_violated assert
	when checking TYPE_BINFO.

Co-Authored-By: Aldy Hernandez <aldyh@redhat.com>

From-SVN: r221121
2015-03-02 18:43:56 +00:00
Jonathan Wakely
7727f8f2c0 re PR libgcc/64885 (libstdc++ all_attributes failure)
PR libgcc/64885
	* gthr-single.h: Use __unused__ attribute instead of unused.
	* config/gthr-vxworks.h: Likewise.
	* config/i386/gthr-win32.h: Likewise.

From-SVN: r221120
2015-03-02 18:02:18 +00:00
Jonathan Wakely
9d8dbe732a re PR libstdc++/65279 (std::scoped_allocator_adaptor is not assignable)
PR libstdc++/65279
	* include/std/scoped_allocator (__inner_type_impl,
	scoped_allocator_adaptor): Add defaulted copy assignment and move
	assignment operators.
	* testsuite/20_util/scoped_allocator/65279.cc: New.

From-SVN: r221119
2015-03-02 17:50:55 +00:00
Jonathan Wakely
e59a2e945e re PR libstdc++/64367 (g++-v5/stdexcept:52:28: error: invalid use of non-static data member '_M_p')
PR libstdc++/64367
	* include/std/stdexcept (__sso_string): Don't use non-static member
	in sizeof.

From-SVN: r221118
2015-03-02 16:50:24 +00:00
Richard Biener
d366a1a795 re PR ipa/65270 (issues with merging memory accesses from different code paths)
2015-03-02  Richard Biener  <rguenther@suse.de>

	PR ipa/65270
	* ipa-icf-gimple.c: Include builtins.h.
	(func_checker::compare_memory_operand): Compare base alignment.

From-SVN: r221117
2015-03-02 14:31:46 +00:00
Arnaud Charlet
cd1a470ab2 [multiple changes]
2015-03-02  Robert Dewar  <dewar@adacore.com>

	* scng.adb (Scan): Ignore illegal character in relaxed
	semantics mode.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Analyze_Set_Membership); Retain Overloaded flag
	on left operand, so it can be properly resolved with type of
	alternatives of right operand.
	* sem_res.adb (Resolve_Set_Membership): Handle properly an
	overloaded left-hand side when the alternatives on the right
	hand side are literals of some universal type.	Use first
	non-overloaded alternative to find expected type.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch7.adb (Make_Set_Finalize_Address_Call): Use underlying
	type to retrieve designated type, because the purported access
	type may be a partial (private) view, when it is declared in
	the private part of a nested package, and finalization actions
	are generated when completing compilation of enclosing unit.

From-SVN: r221116
2015-03-02 14:49:31 +01:00
Robert Dewar
89f0276a49 back_end.adb (Call_Back_End): Remove previous patch...
2015-03-02  Robert Dewar  <dewar@adacore.com>

	* back_end.adb (Call_Back_End): Remove previous patch,
	the back end now gets to see the result of -gnatd.1
	(Unnest_Subprogram_Mode) processing.
	* elists.ads, elists.adb (List_Length): New function.
	* exp_unst.ads, exp_unst.adb: Major changes, first complete version.
	* sem_util.adb (Check_Nested_Access): Handle formals in
	Unnest_Subprogram_Mode.
	(Adjust_Named_Associations): Minor reformatting.
	* sprint.adb (Sprint_Node_Actual): Fix failure to print aliased
	for parameters.

From-SVN: r221115
2015-03-02 12:24:33 +01:00
Arnaud Charlet
3830827c54 [multiple changes]
2015-03-02  Robert Dewar  <dewar@adacore.com>

	* atree.ads, atree.adb (Uint24): New function
	(Set_Uint24): New procedure.
	* atree.h (Uint24): New macro for field access.
	* back_end.adb (Call_Back_End): For now, don't call back end
	if unnesting subprogs.
	* einfo.adb (Activation_Record_Component): New field
	(Subps_Index): New field.
	* einfo.ads (Activation_Record_Component): New field
	(Subps_Index): New field Minor reordering of comments into alpha order.
	* exp_unst.ads, exp_unst.adb: Continued development.

2015-03-02  Gary Dismukes  <dismukes@adacore.com>

	* exp_disp.ads: Minor reformatting.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Chain_Use_Clause): Do not chain use clause from
	ancestor to list of use clauses active in descendant unit if we
	are within the private part of an intervening parent, to prevent
	circularities in use clause list.

From-SVN: r221114
2015-03-02 12:20:29 +01:00
Javier Miranda
024d33d837 exp_ch9.adb (Build_Corresponding_Record): Propagate type invariants to the corresponding record type.
2015-03-02  Javier Miranda  <miranda@adacore.com>

	* exp_ch9.adb (Build_Corresponding_Record): Propagate type
	invariants to the corresponding record type.
	* exp_disp.ad[sb] (Set_DT_Position_Value): New subprogram
	which sets the value of the DTC_Entity associated with a given
	primitive of a tagged type and propagates the value to the
	wrapped subprogram.
	(Set_DTC_Entity_Value): Propagate the DTC
	value to the wrapped entity.
	* sem_ch13.adb (Build_Invariant_Procedure): Append the code
	associated with invariants of progenitors.
	* sem_ch3.adb (Build_Derived_Record_Type): Inherit type invariants
	of parents and progenitors.
	(Process_Full_View): Check hidden inheritance of class-wide type
	invariants.
	* sem_ch7.adb (Analyze_Package_Specification): Do not generate
	the invariant procedure for interface types; build the invariant
	procedure for tagged types inheriting invariants from their
	progenitors.
	* sem_prag.adb (Pragma_Invariant) Allow invariants in interface
	types but do not build their invariant procedure since their
	invariants will be propagated to the invariant procedure of
	types covering the interface.
	* exp_ch6.adb, exp_disp.adb, sem_ch3.adb, sem_ch7.adb,
	sem_ch8.adb, sem_disp.adb: Replace all calls to Set_DT_Position
	by calls to Set_DT_Position_Value.

From-SVN: r221113
2015-03-02 12:11:01 +01:00
Hristian Kirtchev
7c76aa3f9f sem_attr.adb (Analyze_Attribute): Factor out heavily indented code in Denote_Same_Function.
2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_attr.adb (Analyze_Attribute): Factor out heavily indented
	code in Denote_Same_Function.  Do not analyze attribute 'Result
	when it is inside procedure _Postconditions.  Remove a misplaced
	warning diagnostic. Code cleanup.
	(Denote_Same_Function): New routine.
	* sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Code
	cleanup. Warn on pre/postconditions on an inlined subprogram.
	(Analyze_Pragma, Refined_Post case): Warn on pre/postconditions on
	an inlined subprogram.
	(Analyze_Pre_Post_Condition_In_Decl_Part): Code cleanup. Warn on
	pre/post condition on an inlined subprogram.
	(Analyze_Test_Case_In_Decl_Part): Code cleanup. Warn on
	pre/postconditions on an inlined subprogram.
	(Check_Postcondition_Use_In_Inlined_Subprogram): New routine.

From-SVN: r221112
2015-03-02 12:09:11 +01:00
Arnaud Charlet
aaeb3b3a86 [multiple changes]
2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Ensure_Aggregate_Form):
	Ensure that the name denoted by the Chars of a pragma argument
	association has the proper Sloc when converted into an aggregate.

2015-03-02  Bob Duff  <duff@adacore.com>

	* sem_ch6.adb (Check_Private_Overriding): Capture
	Incomplete_Or_Partial_View in a constant. This is cleaner and
	more efficient.

2015-03-02  Gary Dismukes  <dismukes@adacore.com>

	* einfo.ads, exp_unst.ads: Minor reformatting.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* a-strsea.adb (Find_Token): Ensure that the range of iteration
	does not perform any improper character access. This prevents
	erroneous access in the unusual case of an empty string target
	and a From parameter less than Source'First.

2015-03-02  Robert Dewar  <dewar@adacore.com>

	* elists.adb (List_Length): Fix incorrect result.

From-SVN: r221111
2015-03-02 12:07:34 +01:00
Bob Duff
acf624f280 sem_ch6.adb (Check_Private_Overriding): Refine the legality checks here.
2015-03-02  Bob Duff  <duff@adacore.com>

	* sem_ch6.adb (Check_Private_Overriding): Refine the legality
	checks here. It used to check that the function is merely
	overriding SOMEthing. Now it checks that the function is
	overriding a corresponding public operation. This is a correction
	to the implementation of the rule in RM-3.9.3(10).

From-SVN: r221110
2015-03-02 12:05:03 +01:00
Robert Dewar
5a271a7f3a debug.adb: Document new debug flag -gnatd.1.
2015-03-02  Robert Dewar  <dewar@adacore.com>

	* debug.adb: Document new debug flag -gnatd.1.
	* einfo.ads, einfo.adb (Has_Nested_Subprogram): New flag.
	(Has_Uplevel_Reference): New flag (Is_Static_Type): New flag.
	(Uplevel_Reference_Noted):New flag (Uplevel_References): New field.
	* elists.ads elists.adb (List_Length): New function.
	* exp_ch6.adb (Expand_N_Subprogram_Body): Call Unnest_Subprogram
	when appropriate (Process_Preconditions): Minor code
	reorganization and reformatting
	* exp_unst.ads, exp_unst.adb: New files.
	* gnat1drv.adb (Adjust_Global_Switches): Set
	Unnest_Subprogram_Mode if -gnatd.1
	* namet.ads, namet.adb (Name_Find_Str): New version of Name_Find with
	string argument.
	* opt.ads (Unnest_Subprogram_Mode): New flag.
	* par-ch3.adb (P_Identifier_Declarations): Fixes to -gnatd.2 handling.
	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set
	Has_Nested_Subprogram flag.
	* sem_ch8.adb (Find_Direct_Name): New calling sequence for
	Check_Nested_Access.
	(Find_Selected_Component): Minor comment addition.
	* sem_util.adb (Check_Nested_Access): New version for use with Exp_Unst.
	(Note_Possible_Modification): New calling sequence for
	Check_Nested_Access.
	* sem_util.ads (Check_Nested_Access): New version for use with Exp_Unst.
	* gcc-interface/Make-lang.in (GNAT1_OBJS): Add exp_unst.o

From-SVN: r221109
2015-03-02 12:03:29 +01:00
Pierre-Marie de Rodat
aef308d0d6 utils.c (gnat_pushdecl): For non-artificial pointer types...
2015-03-02  Pierre-Marie de Rodat  <derodat@adacore.com>                  
                                                                          
	* gcc-interface/utils.c (gnat_pushdecl): For non-artificial pointer     
	types, preserve the original type and create copies just like the C
	front-end does.  For artificial ones, do not define a name for
	the original type.
	(create_type_decl): When gnat_pushdecl made the input type the
	original type for the new declaration, do not define a stub   
	declaration for it.
	* gcc-interface/utils2.c (build_binary_op): Accept two different        
	pointer types when they point to the same type.

From-SVN: r221108
2015-03-02 11:59:32 +01:00
Hristian Kirtchev
184a23e94a exp_util.adb (Possible_Bit_Aligned_Component): Do not process an unanalyzed node.
2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_util.adb (Possible_Bit_Aligned_Component): Do not process
	an unanalyzed node.
	* sem_util.adb (Kill_Current_Values): Do not invalidate and
	de-null a constant.

From-SVN: r221107
2015-03-02 11:52:59 +01:00
Ilya Enkovich
df265bd262 re PR target/65184 (ICE: in expand_expr_addr_expr_1, at expr.c:7760 with -mabi=ms -fcheck-pointer-bounds -mmpx)
gcc/

	PR target/65184
	* gcc/config/i386/i386.c (ix86_pass_by_reference) Bounds
	are never passed by reference.

gcc/testsuite/

	PR target/65184
	* gcc.target/i386/pr65184.c: New.

From-SVN: r221106
2015-03-02 10:47:54 +00:00
Ilya Enkovich
321a5ceb81 re PR target/65183 (ICE: verify_ssa failed: virtual use of statement not up-to-date with -fcheck-pointer-bounds -fchkp-use-nochk-string-functions -mmpx)
gcc/

	PR target/65183
	* tree-chkp.c (chkp_check_lower): Don't check against
	zero bounds for already instrumented functions.
	(chkp_check_upper): Likewise.
	(chkp_fini): Clean pass local data to avoid wrong reusage.

gcc/testsuite/

	PR target/65183
	* gcc.target/i386/pr65183.c: New.

From-SVN: r221105
2015-03-02 10:41:09 +00:00
Ilya Enkovich
3307944165 MAINTAINERS (Various Maintainers): Add myself as libmpx, pointer bounds checker and i386 MPX maintainer.
* MAINTAINERS (Various Maintainers): Add myself as libmpx,
	pointer bounds checker and i386 MPX maintainer.

From-SVN: r221104
2015-03-02 10:17:26 +00:00
Arnaud Charlet
e0c23ac71c [multiple changes]
2015-03-02  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, exp_attr.adb, checks.adb, exp_aggr.adb: Minor
	reformatting.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb: extend use of Available_Subtype.

2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Duplication_Error): Remove the special handling
	of 'Class or _Class in the context of pre/postconditions.
	(Process_Class_Wide_Condition): Remove the special handling of
	'Class or _Class in the context of pre/postconditions.
	* sem_util.adb (Original_Aspect_Pragma_Name): Names Pre_Class
	and Post_Class no longer need to be converted to _Pre and _Post.
	* sem_util.ads (Original_Aspect_Pragma_Name): Update the comment
	on usage.

2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch6.adb (Process_Preconditions): Modify the
	mechanism that find the first source declaration to correct exit
	the loop once it has been found.

2015-03-02  Gary Dismukes  <dismukes@adacore.com>

	* a-strsea.adb: Minor typo fix.

2015-03-02  Bob Duff  <duff@adacore.com>

	* einfo.ads: Minor comment fixes.

From-SVN: r221103
2015-03-02 10:28:56 +01:00
Arnaud Charlet
e99991618f [multiple changes]
2015-03-02  Gary Dismukes  <dismukes@adacore.com>

	* einfo.adb, checks.adb: Minor reformatting and typo fixes.

2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Get_Assoc_Expr): If the Default_Component_Value
	is defined for the array type, use it instead of a Default_Value
	specified for the component type itself.

From-SVN: r221102
2015-03-02 10:26:39 +01:00
Arnaud Charlet
c9d70ab181 [multiple changes]
2015-03-02  Thomas Quinot  <quinot@adacore.com>

	* exp_attr.adb (Expand_N_Attribute_Reference, case Input): When
	expanding a 'Input attribute reference for a class-wide type,
	do not generate a separate object declaration for the controlling
	tag dummy object; instead, generate the expression inline in the
	dispatching call. Otherwise, the declaration (which involves a
	call to String'Input, returning a dynamically sized value on the
	secondary stack) will be expanded outside of proper secondary
	stack mark/release operations, and will thus cause a secondary
	stack leak.

2015-03-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* checks.adb (Add_Validity_Check): Change the names of all
	formal parameters to better illustrate their purpose. Update
	the subprogram documentation. Update all occurrences of the
	formal parameters. Generate a pre/postcondition pragma by
	calling Build_Pre_Post_Condition.
	(Build_PPC_Pragma): Removed.
	(Build_Pre_Post_Condition): New routine.
	* einfo.adb Node8 is no longer used as Postcondition_Proc. Node14
	is now used as Postconditions_Proc. Flag240 is now renamed to
	Has_Expanded_Contract.	(First_Formal): The routine can now
	operate on generic subprograms.
	(First_Formal_With_Extras): The routine can now operate on generic
	subprograms.
	(Has_Expanded_Contract): New routine.
	(Has_Postconditions): Removed.
	(Postcondition_Proc): Removed.
	(Postconditions_Proc): New routine.
	(Set_Has_Expanded_Contract): New routine.
	(Set_Has_Postconditions): Removed.
	(Set_Postcondition_Proc): Removed.
	(Set_Postconditions_Proc): New routine.
	(Write_Entity_Flags): Remove the output of Has_Postconditions. Add
	the output of Has_Expanded_Contract.
	(Write_Field8_Name): Remove the output of Postcondition_Proc.
	(Write_Field14_Name): Add the output of Postconditions_Proc.
	* einfo.ads New attributes Has_Expanded_Contract and
	Postconditions_Proc along with occurrences in entities.
	Remove attributes Has_Postconditions and Postcondition_Proc
	along with occurrences in entities.
	(Has_Expanded_Contract): New routine along with pragma Inline.
	(Has_Postconditions): Removed along with pragma Inline.
	(Postcondition_Proc): Removed along with pragma Inline.
	(Postconditions_Proc): New routine along with pragma Inline.
	(Set_Has_Expanded_Contract): New routine along with pragma Inline.
	(Set_Has_Postconditions): Removed along with pragma Inline.
	(Set_Postcondition_Proc): Removed along with pragma Inline.
	(Set_Postconditions_Proc): New routine along with pragma Inline.
	* exp_ch6.adb (Add_Return): Code cleanup. Update the
	generation of the call to the _Postconditions routine of
	the procedure.	(Expand_Non_Function_Return): Reformat the
	comment on usage. Code cleanup.  Update the generation of
	the call to the _Postconditions routine of the procedure or
	entry [family].
	(Expand_Simple_Function_Return): Update the
	generation of the _Postconditions routine of the function.
	(Expand_Subprogram_Contract): Reimplemented.
	* exp_ch6.ads (Expand_Subprogram_Contract): Update the parameter
	profile along the comment on usage.
	* exp_ch9.adb (Build_PPC_Wrapper): Code cleanup.
	(Expand_N_Task_Type_Declaration): Generate pre/postconditions
	wrapper when the entry [family] has a contract with
	pre/postconditions.
	* exp_prag.adb (Expand_Attributes_In_Consequence): New routine.
	(Expand_Contract_Cases): This routine and its subsidiaries now
	analyze all generated code.
	(Expand_Old_In_Consequence): Removed.
	* sem_attr.adb Add with and use clause for Sem_Prag.
	(Analyze_Attribute): Reimplment the analysis of attribute 'Result.
	(Check_Use_In_Test_Case): Use routine Test_Case_Arg to obtain
	"Ensures".
	* sem_ch3.adb (Analyze_Declarations): Analyze the contract of
	a generic subprogram.
	(Analyze_Object_Declaration): Do not create a contract node.
	(Derive_Subprogram): Do not create a contract node.
	* sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Do
	not create a contract node.
	(Analyze_Completion_Contract): New routine.
	(Analyze_Function_Return): Alphabetize.
	(Analyze_Generic_Subprogram_Body): Alphabetize. Do not create a
	contract node.	Do not copy pre/postconditions to the original
	generic template.
	(Analyze_Null_Procedure): Do not create a contract node.
	(Analyze_Subprogram_Body_Contract): Reimplemented.
	(Analyze_Subprogram_Body_Helper): Do not mark the enclosing scope
	as having postconditions. Do not create a contract node. Analyze
	the subprogram body contract of a body that acts as a compilation
	unit. Expand the subprogram contract after the declarations have
	been analyzed.
	(Analyze_Subprogram_Contract): Reimplemented.
	(Analyze_Subprogram_Specification): Do not create a contract node.
	(List_Inherited_Pre_Post_Aspects): Code cleanup.
	* sem_ch6.adb (Analyze_Subprogram_Body_Contract): Update the
	comment on usage.
	(Analyze_Subprogram_Contract): Update the
	parameter profile and the comment on usage.
	* sem_ch7.adb (Analyze_Package_Body_Helper): Do not create a
	contract node.
	(Analyze_Package_Declaration): Do not create a
	contract node.
	(Is_Subp_Or_Const_Ref): Ensure that the prefix has an entity.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Do not create a
	contract node.
	* sem_ch9.adb (Analyze_Entry_Declaration): Do not create a
	contract node.
	* sem_ch10.adb (Analyze_Compilation_Unit): Move local variables to
	their proper section and alphabetize them. Analyze the contract of
	a [generic] subprogram after all Pragmas_After have been analyzed.
	(Analyze_Subprogram_Body_Stub_Contract): Alphabetize.
	* sem_ch12.adb (Analyze_Generic_Package_Declaration): Do not
	create a contract node.
	(Analyze_Generic_Subprogram_Declaration):
	Alphabetize local variables. Do not create a contract
	node. Do not generate aspects out of pragmas for ASIS.
	(Analyze_Subprogram_Instantiation): Instantiate
	the contract of the subprogram.  Do not create a
	contract node.	(Instantiate_Contract): New routine.
	(Instantiate_Subprogram_Body): Alphabetize local variables.
	(Save_Global_References_In_Aspects): New routine.
	(Save_References): Do not save the global references found within
	the aspects of a generic subprogram.
	* sem_ch12.ads (Save_Global_References_In_Aspects): New routine.
	* sem_ch13.adb (Analyze_Aspect_Specifications): Do not use
	Original_Node for establishing linkages.
	(Insert_Pragma): Insertion in a subprogram body takes precedence over
	the case where the subprogram body is also a compilation unit.
	* sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Use
	Get_Argument to obtain the proper expression. Install the generic
	formals when the related context is a generic subprogram.
	(Analyze_Depends_In_Decl_Part): Use Get_Argument to obtain
	the proper expression. Use Corresponding_Spec_Of to obtain
	the spec. Install the generic formal when the related context
	is a generic subprogram.
	(Analyze_Global_In_Decl_Part): Use Get_Argument to obtain the proper
	expression. Use Corresponding_Spec_Of to obtain the spec. Install the
	generic formal when the related context is a generic subprogram.
	(Analyze_Initial_Condition_In_Decl_Part): Use Get_Argument
	to obtain the proper expression. Remove the call to
	Check_SPARK_Aspect_For_ASIS as the analysis is now done
	automatically.
	(Analyze_Pragma): Update all occurrences
	to Original_Aspect_Name. Pragmas Contract_Cases, Depends,
	Extensions_Visible, Global, Postcondition, Precondition and
	Test_Case now carry generic templates when the related context
	is a generic subprogram. The same pragmas are no longer
	forcefully fully analyzed when the context is a subprogram
	that acts as a compilation unit. Pragmas Abstract_State,
	Initial_Condition, Initializes and Refined_State have been clean
	up. Pragmas Post, Post_Class, Postcondition, Pre, Pre_Class
	and Precondition now use the same routine for analysis. Pragma
	Refined_Post does not need to check the use of 'Result or
	the lack of a post-state in its expression. Reimplement the
	analysis of pragma Test_Case.
	(Analyze_Pre_Post_Condition): New routine.
	(Analyze_Pre_Post_Condition_In_Decl_Part):
	Reimplemented.
	(Analyze_Refined_Depends_In_Decl_Part): Use Get_Argument to obtain the
	proper expression.
	(Analyze_Refined_Global_In_Decl_Part): Use Get_Argument to obtain
	the proper expression.
	(Analyze_Test_Case_In_Decl_Part): Reimplemented.
	(Check_Pre_Post): Removed.
	(Check_Precondition_Postcondition): Removed.
	(Check_SPARK_Aspect_For_ASIS): Removed.
	(Check_Test_Case): Removed.
	(Collect_Subprogram_Inputs_Outputs): Use Get_Argument
	to obtain the proper expression. Use Corresponding_Spec_Of to
	find the proper spec.
	(Create_Generic_Template): New routine.
	(Duplication_Error): New routine.
	(Expression_Function_Error): New routine.
	(Find_Related_Subprogram_Or_Body): Moved to the spec
	of Sem_Prag. Emit precise error messages. Account for cases of
	rewritten expression functions, generic instantiations, handled
	sequence of statements and pragmas from aspects.
	(Get_Argument): New routine.
	(Make_Aspect_For_PPC_In_Gen_Sub_Decl): Removed.
	(Preanalyze_CTC_Args): Removed.
	(Process_Class_Wide_Condition): New routine.
	* sem_prag.ads (Analyze_Test_Case_In_Decl_Part): Update
	the parameter profile along with the comment on usage.
	(Find_Related_Subprogram_Or_Body): Moved from the body of Sem_Prag.
	(Make_Aspect_For_PPC_In_Gen_Sub_Decl): Removed.
	(Test_Case_Arg): New routine.
	* sem_util.adb Add with and use clauses for Sem_Ch6.
	(Add_Contract_Item): This routine now creates a contract
	node the first time an item is added. Remove the duplicate
	aspect/pragma checks.
	(Check_Result_And_Post_State): Reimplemented.
	(Corresponding_Spec_Of): New routine.
	(Get_Ensures_From_CTC_Pragma): Removed.
	(Get_Requires_From_CTC_Pragma): Removed.
	(Has_Significant_Contract): New routine.
	(Inherit_Subprogram_Contract): Inherit only if the source
	has a contract.
	(Install_Generic_Formals): New routine.
	(Original_Aspect_Name): Removed.
	(Original_Aspect_Pragma_Name): New routine.
	* sem_util.ads (Check_Result_And_Post_State): Reimplemented.
	(Corresponding_Spec_Of): New routine.
	(Get_Ensures_From_CTC_Pragma): Removed.
	(Get_Requires_From_CTC_Pragma): Removed.
	(Has_Significant_Contract): New routine.
	(Install_Generic_Formals): New routine.
	(Original_Aspect_Name): Removed.
	(Original_Aspect_Pragma_Name): New routine.
	* sem_warn.adb Add with and use clauses for Sem_Prag.
	(Within_Postcondition): Use Test_Case_Arg to extract "Ensures".

From-SVN: r221101
2015-03-02 10:24:38 +01:00
Ed Schonberg
95e00a3a82 sem_ch8.adb (Available_Subtype): Optimization in Find_Selected_Component...
2015-03-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Available_Subtype): Optimization in
	Find_Selected_Component: when safe, use existing subtype of
	array component, possibly discriminant-dependent, rather than
	creating new subtype declaration for it. In this fashion different
	occurrences of the component have the same subtype, rather than
	just equivalent ones. Simplifies value tracing in GNATProve.

From-SVN: r221100
2015-03-02 10:07:01 +01:00
Martin Liska
c4c0f336bc ipa-icf.c (sem_variable::equals): Improve debug output; get variable constructor.
2015-02-28  Martin Liska  <mliska@suse.cz>
	    Jan Hubicka   <hubicka@ucw.cz>

	* ipa-icf.c (sem_variable::equals): Improve debug output;
	get variable constructor.
	(sem_variable::parse): Do not filter out too early; give up on
	volatile and register vars.
	(sem_item_optimizer::filter_removed_items): Filter out nonreadonly
	variables.
	* ipa-icf.h (sem_variable::init): Do not set ctor.
	(sem_variable::ctor): Remove.

gcc/testsuite/ChangeLog:

2015-02-28  Martin Liska  <mliska@suse.cz>
	    Jan Hubicka   <hubicka@ucw.cz>

	* gcc.dg/ipa/ipa-icf-35.c: New test.
	* gcc.dg/ipa/ipa-icf-36.c: New test.
	* gcc.dg/ipa/ipa-icf-37.c: New test.

Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>

From-SVN: r221099
2015-03-02 07:51:28 +00:00
Aldy Hernandez
34a108c813 re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu)
PR middle-end/65233
	* ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs.

From-SVN: r221097
2015-03-02 05:22:03 +00:00
Jan Hubicka
4630573709 ipa-icf.c: Include stor-layout.h
* ipa-icf.c: Include stor-layout.h
	(sem_function::compare_cgraph_references): Rename to ...
	(sem_item::compare_cgraph_references): ... this one.
	(sem_variable::equals_wpa): New function
	(sem_variable::equals): Do not check stuff already verified by
	equals_wpa.
	(sem_variable::equals): Reorg based on varasm.c:compare_constant.
	* ipa-icf.h (sem_item): Add compare_cgraph_references.
	(sem_function): Remove compare_cgraph_references.
	(sem_variable): Turns equals_wpa into non-inline.

From-SVN: r221096
2015-03-02 00:54:46 +00:00
GCC Administrator
3c37b96b87 Daily bump.
From-SVN: r221095
2015-03-02 00:16:11 +00:00
Jan Hubicka
a8d9381738 ipa-icf.c (sem_function::init): Fix formating; skip GIMPLE_PREDICT.
* ipa-icf.c (sem_function::init): Fix formating; skip GIMPLE_PREDICT.
	(sem_item::add_expr): New function.
	(sem_function::hash_stmt): Handle operands of most statements.
	(sem_variable::get_hash): Hash the actual constructor.
	* ipa-icf.h (sem_item): Add add_expr.
	(sem_function): Update prototype of hash_stmt

From-SVN: r221092
2015-03-01 22:22:26 +00:00
Joseph Myers
f7f64d539a * sv.po: Update.
From-SVN: r221091
2015-03-01 22:13:09 +00:00
Martin Liska
b6cddc7fb6 re PR ipa/65245 (internal compiler error: in address_matters_p, at symtab.c:1908)
2015-02-28  Martin Liska  <mliska@suse.cz>
	    Jan Hubicka   <hubicka@ucw.cz>

	PR ipa/65245
	* ipa-icf-gimple.c (func_checker::compare_function_decl):
	Remove.
	(func_checker::compare_variable_decl): Skip symtab vars.
	(func_checker::compare_cst_or_decl): Update.
	* ipa-icf.c (sem_function::parse): Do not consider aliases.
	(sem_function::compare_cgraph_references): Add ADDRESS parameter;
	use correct symtab predicates.
	(sem_function::equals_wpa): Update uses of compare_cgraph_references.
	(sem_variable::parse):  Update comment.
	(sem_item_optimizer::build_graph): Consider ultimate aliases
	for references.

	* gcc.dg/ipa/ipa-icf-34.c: New test.


Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>

From-SVN: r221090
2015-03-01 20:23:21 +00:00