1. 04 Aug, 2011 13 commits
    • [multiple changes] · 01f0729a
      2011-08-04  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* sem_elab.adb (Check_Internal_Call_Continue): Change the type of the
      	elaboration counter to Standard_Short_Integer.
      	* sem_util.adb (Build_Elaboration_Entity): Likewise.
      	* bindgen.adb (Gen_Elab_Externals_Ada): Adjust to above change.
      	(Gen_Elab_Externals_C): Likewise.
      
      2011-08-04  Ed Falis  <falis@adacore.com>
      
      	* system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
      	system-vxworks-ppc.ads, system-vxworks-m68k.ads,
      	system-vxworks-mips.ads, system-vxworks-x86.ads
      	(Always_Compatible_Rep): set to False for all VxWorks targets.
      
      From-SVN: r177321
      Arnaud Charlet committed
    • [multiple changes] · 2c1b72d7
      2011-08-04  Robert Dewar  <dewar@adacore.com>
      
      	* par_sco.adb, prj-proc.adb, make.adb, bindgen.adb, prj.adb, prj.ads,
      	makeutl.adb, makeutl.ads, prj-nmsc.adb, exp_ch5.adb, exp_ch12.adb,
      	exp_ch7.ads, exp_util.ads, sem_util.ads, g-comlin.ads, exp_ch6.adb,
      	exp_ch6.ads, lib-xref.ads, exp_ch7.adb, exp_util.adb, exp_dist.adb,
      	exp_strm.adb, gnatcmd.adb, freeze.adb, g-comlin.adb, lib-xref-alfa.adb,
      	sem_attr.adb, sem_prag.adb, sem_util.adb, sem_elab.adb, sem_ch8.adb,
      	sem_ch11.adb, sem_eval.adb, sem_ch13.adb, sem_disp.adb, a-fihema.adb:
      	Minor reformatting and code reorganization.
      
      2011-08-04  Emmanuel Briot  <briot@adacore.com>
      
      	* projects.texi: Added doc for aggregate projects.
      
      From-SVN: r177320
      Arnaud Charlet committed
    • [multiple changes] · 824e9320
      2011-08-04  Emmanuel Briot  <briot@adacore.com>
      
      	* prj-proc.adb, prj-nmsc.adb, prj-env.adb (Process_Declarative_Items):
      	Add support for overriding the Project_Path in aggregate projects.
      
      2011-08-04  Robert Dewar  <dewar@adacore.com>
      
      	* a-cofove.ads: Minor reformatting.
      
      2011-08-04  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Update the comment
      	on the generated code.
      	(Build_Finalize_Statements): Update the comment on the generated code.
      	(Build_Initialize_Statements): Update the comment on the generated code.
      	(Build_Object_Declarations): Add local variable Result. The object
      	declarations are now built in sequence.
      	* rtsfind.ads: Add RE_Exception_Occurrence_Access to tables RE_Id and
      	RE_Unit_Table.
      
      2011-08-04  Robert Dewar  <dewar@adacore.com>
      
      	* checks.adb, alfa.adb, alfa.ads: Minor reformatting.
      
      2011-08-04  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* einfo.ads (Elaboration_Entity): Document new definition and use.
      	(Elaboration_Entity_Required): Adjust to above change.
      	* exp_attr.adb (Expand_N_Attribute_Reference): Likewise.
      	* exp_ch12.adb: And with and use for Snames.
      	(Expand_N_Generic_Instantiation): Test 'Elaborated attribute.
      	* exp_util.adb (Set_Elaboration_Flag): Likewise.
      	* sem_attr.adb (Analyze_Attribute) <Check_Library_Unit>: Delete.
      	<Check_Unit_Name>: Deal with N_Expanded_Name.
      	<Attribute_Elaborated>: Extend to all unit names.
      	* sem_elab.adb: And with and use for Uintp.
      	(Check_Internal_Call_Continue): Adjust to Elaboration_Entity change.
      	* sem_util.ads (Build_Elaboration_Entity): Adjust comment.
      	* sem_util.adb (Build_Elaboration_Entity): Change type to Integer.
      	* bindgen.adb (Gen_Elab_Externals_Ada): New local subprogram taken
      	from Gen_Adainit_Ada.
      	(Gen_Elab_Externals_C): Likewise, but taken from Gen_Adainit_C.
      	(Gen_Adafinal_Ada): Remove redundant test.  In the non-main program
      	case, do not call System.Standard_Library.Adafinal; instead call
      	finalize_library if needed.
      	(Gen_Adafinal_C): Likewise.
      	(Gen_Adainit_Ada): Do not set SSL.Finalize_Library_Objects in the
      	non-main program case.
      	(Gen_Adainit_C): Generate a couple of external declarations here.
      	In the main program case, set SSL.Finalize_Library_Objects.
      	(Gen_Elab_Calls_Ada): Adjust to Elaboration_Entity change.
      	(Gen_Elab_Calls_C): Likewise.
      	(Gen_Finalize_Library_Ada): Likewise.  Skip SAL interface units.
      	(Gen_Finalize_Library_C): Likewise.  Generate a full function.
      	(Gen_Main_C): Put back call to Ada_Final and don't finalize library
      	objects here.
      	(Gen_Output_File_Ada): Generate pragma Linker_Destructor for Ada_Final
      	if -a is specified.  Call Gen_Elab_Externals_Ada.  Move around call to
      	Gen_Adafinal_Ada.
      	(Gen_Output_File_C): Generate __attribute__((destructor)) for Ada_Final
      	if -a is specified.  Call Gen_Elab_Externals_C.  Remove useless couple
      	of external declarations.  Call Gen_Finalize_Library_C.
      
      From-SVN: r177318
      Arnaud Charlet committed
    • prj.adb, [...] (Complete_Mains, [...]): new subprogram. · 316d9d4f
      2011-08-04  Emmanuel Briot  <briot@adacore.com>
      
      	* prj.adb, prj.ads, makeutl.adb, makeutl.ads (Complete_Mains,
      	Compute_Compilation_Phases): new subprogram.
      	(Builder_Data, Builder_Project_Tree_Data): new subprogram and type
      	The number of mains as well as the various compilation phases that
      	need to be run are now project tree specific, since various
      	aggregated trees might have different requirements. In particular,
      	they do not all require bind or link phases.
      
      From-SVN: r177317
      Emmanuel Briot committed
    • re PR middle-end/49905 (Better sanity checking on sprintf src & dest to produce… · 8dd00781
      re PR middle-end/49905 (Better sanity checking on sprintf src & dest to produce warning for dodgy code ?)
      
      	PR middle-end/49905
      	* tree.h (init_attributes): New prototype.
      	* attribs.c (init_attributes): No longer static.
      
      	* decl.c (cxx_init_decl_processing): Add alloc_size (1) attribute
      	for operator new and operator new [].  Call init_attributes.
      
      	* g++.dg/ext/builtin-object-size3.C: New test.
      
      From-SVN: r177316
      Jakub Jelinek committed
    • 2011-08-04 Emmanuel Briot <briot@adacore.com> · 9434c32e
      	* prj.adb, prj.ads, makeutl.adb, makeutl.ads, prj-env.adb
      	(Project_Tree_Appdata): New type.
      	It is now possible to associate application-specific data to a project
      	tree. In particular, this is used in the gprbuild builder to avoid a
      	number of global tables and htables, especially now that there can be
      	several project trees loaded at once because of aggregate projects.
      	(Debug_Name): new procedure.
      	* projects.texi: Clarify syntax of "**" for Source_Dirs
      
      From-SVN: r177315
      Emmanuel Briot committed
    • Constify maybe_suffix. · 6eb9142a
      From-SVN: r177314
      Ramana Radhakrishnan committed
    • Fix a bug in cfg fixup · 63a73071
      From-SVN: r177313
      David Li committed
    • Fix a bug that broke -freorder-functions · 90037898
      From-SVN: r177311
      David Li committed
    • re PR go/49889 (Calling a function whose name is obscured by a local variable… · 22508cae
      re PR go/49889 (Calling a function whose name is obscured by a local variable does not produce an error)
      
      	PR go/49889
      gccgo : Fixed bug 49889.
              Now the compiler emits a proper error when a function
              called in a tuple assignment statement can not be
              typed as a function.
      
      From-SVN: r177310
      Ian Lance Taylor committed
    • rs6000.c (rs6000_emit_epilogue): Simplify use_backchain_to_restore_sp initialisation. · ea6c2b0e
      	* config/rs6000/rs6000.c (rs6000_emit_epilogue): Simplify
      	use_backchain_to_restore_sp initialisation.
      	(rs6000_legitimate_offset_address_p): Simplify offset test.
      
      From-SVN: r177309
      Alan Modra committed
    • filebuf_sputn_unbuf.cc: Include unistd.h for unlink. · c7c2e831
      2011-08-03  Benjamin Kosnik  <bkoz@redhat.com>
      
      	* testsuite/performance/27_io/filebuf_sputn_unbuf.cc: Include
      	unistd.h for unlink.
      	* testsuite/performance/27_io/ofstream_insert_int.cc: Same.
      	* testsuite/performance/27_io/ifstream_extract_int.cc: Same.
      	* testsuite/performance/27_io/ifstream_getline-2.cc: Same.
      	* testsuite/performance/27_io/fstream_seek_write.cc: Same.
      	* testsuite/performance/27_io/ifstream_extract_chars.cc: Same.
      	* testsuite/performance/27_io/ofstream_insert_float.cc: Same.
      	* testsuite/performance/27_io/ifstream_extract_float.cc: Same.
      	* testsuite/performance/27_io/filebuf_sputc.cc: Same.
      
      From-SVN: r177307
      Benjamin Kosnik committed
    • Daily bump. · 17ab6390
      From-SVN: r177305
      GCC Administrator committed
  2. 03 Aug, 2011 27 commits
    • spu: Use define_c_enum. · 4b39813a
      From-SVN: r177301
      Richard Henderson committed
    • re PR target/34888 (Stack patterns for AVR not optimal) · a6365e99
      PR target/34888
              * config/avr/avr.md: New splitter for REG_ARGS_SIZE 0.
      
      From-SVN: r177300
      Richard Henderson committed
    • tuple: Mark more constructors constexpr. · 2c4caf0a
      2011-08-03  Benjamin Kosnik  <bkoz@redhat.com>
      
      	* include/std/tuple: Mark more constructors constexpr.
      	* testsuite/20_util/tuple/cons/constexpr.cc: Split into and extend as:
      	* testsuite/20_util/tuple/cons/constexpr-2.cc: ...this.
      	* testsuite/20_util/tuple/cons/constexpr-3.cc: ... and this.
      	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust line numbers.
      
      2011-08-03  Benjamin Kosnik  <bkoz@redhat.com>
      	    François Dumont  <francois.cppdevs@free.fr>
      
      	* testsuite/23_containers/array/at_neg.cc: Move...
      	* testsuite/23_containers/array/at.cc: ...here. Remove
      	-fno-exceptions, call const at member function.
      
      
      Co-Authored-By: François Dumont <francois.cppdevs@free.fr>
      
      From-SVN: r177299
      Benjamin Kosnik committed
    • Remove changelog entry accidentally committed in r175057 · 4ac2beb5
      From-SVN: r177298
      Jonathan Wakely committed
    • re PR tree-optimization/49948 (ICE with -ftree-parallelize-loops: "address… · cb3d2e33
      re PR tree-optimization/49948 (ICE with -ftree-parallelize-loops: "address taken, but ADDRESSABLE bit not set")
      
      	PR tree-optimization/49948
      	* gimple.c (walk_stmt_load_store_addr_ops): Walk CONSTRUCTOR elements.
      
      	* gcc.dg/pr49948.c: New test.
      
      From-SVN: r177291
      Jakub Jelinek committed
    • m32c.c (class_sizes): Remove. · 35bdbc69
      	* config/m32c/m32c.c (class_sizes): Remove.
      	(reduce_class): Change arguments and return type to reg_class_t.
      	Change type cc var to HARD_REG_SET. Change type best var to
      	reg_class_t. Change type best_size var to unsigned int. Remove
      	initialization class_sizes var. Use reg_class_size array instead
      	of class_sizes. Use reg_class_contents array instead
      	of class_contents.
      
      From-SVN: r177290
      Anatoly Sokolov committed
    • prj.ads, [...] (Queue.Insert): now also inserts the "roots" for a main. · 41ba34db
      2011-08-03  Emmanuel Briot  <briot@adacore.com>
      
      	* prj.ads, makeutl.adb, makeutl.ads (Queue.Insert): now also inserts
      	the "roots" for a main.
      	(Fill_From_Project): add support for aggregate projects. Main units
      	in aggregated projects are now automatically added in the list of
      	files to build (although this fails later on in gprbuild, because
      	these files are not using the root proejct tree, so this needs
      	further cleanup)
      	* gcc-interface/Make-lang.in: Update dependencies.
      
      From-SVN: r177287
      Emmanuel Briot committed
    • [multiple changes] · fccd42a9
      2011-08-03  Yannick Moy  <moy@adacore.com>
      
      	* sem_ch4.adb (Analyze_Conditional_Expression): only allow boolean
      	conditional expression in ALFA.
      	* sem_res.adb (Resolve_Conditional_Expression): mark non-boolean
      	expressions as not in ALFA.
      
      2011-08-03  Robert Dewar  <dewar@adacore.com>
      
      	* a-cofove.adb: Minor reformatting.
      
      2011-08-03  Emmanuel Briot  <briot@adacore.com>
      
      	* make.adb, prj.adb, prj.ads, makeutl.adb, makeutl.ads
      	(Insert_Project_Sources, Insert_withed_Sources_For): moved from the
      	gprbuild sources.
      	These packages are more logically placed in the Queue package, since
      	they manipulate the queue. It is also likely that they can be adapted
      	for gnatmake, thus sharing more code.
      	(Finish_Program, Fail_Program): moved from the gprbuild sources, so
      	that we could move the above.
      
      2011-08-03  Emmanuel Briot  <briot@adacore.com>
      
      	* errutil.adb (Finalize): clean up the list of error messages on exit.
      	Calling this subprogram multiple times will no longer show duplicate
      	error messages on stderr.
      
      2011-08-03  Emmanuel Briot  <briot@adacore.com>
      
      	* g-comlin.adb, g-comlin.ads (Set_Command_Line): ignore the parameter
      	Getopt_Switches when we have already define a command line
      	configuration.
      
      From-SVN: r177286
      Arnaud Charlet committed
    • sem_ch11.adb (Analyze_Raise_xxx_Error): do not mark such nodes as not in ALFA. · 5e8c8e44
      2011-08-03  Yannick Moy  <moy@adacore.com>
      
      	* sem_ch11.adb (Analyze_Raise_xxx_Error): do not mark such nodes as not
      	in ALFA. Instead, they are considered as assertions to prove.
      	* sem_ch4.adb (Analyze_Conditional_Expression): do not always mark such
      	nodes as not in ALFA. Instead, include conditional expressions in ALFA
      	if they have no ELSE part, or if they occur in pre- and postconditions,
      	where the Condition cannot have side-effects in ALFA
      	(Analyze_Membership_Op): do not mark such nodes as not in ALFA
      	(Analyze_Type_Conversion): do not always mark such nodes as not in ALFA.
      	Instead, include type conversion between scalar types in ALFA.
      	* sem_ch6.adb (Process_Formals): correctly mark a parameter in ALFA
      	if-and-only-if its type is in ALFA.
      
      From-SVN: r177285
      Yannick Moy committed
    • [multiple changes] · 5ffe0bab
      2011-08-03  Thomas Quinot  <quinot@adacore.com>
      
      	* scos.adb, get_scos.adb, put_scos.adb
      	New code letter for decisions: G (entry guard)
      	* par_sco.adb
      	(Traverse_Subprogram_Body): Rename to...
      	(Traverse_Subprogram_Or_Task_Body): New subrpogram.
      	(Traverse_Protected_Body): New subprogram
      	(Traverse_Declarations_Or_Statements): Add traversal of task bodies,
      	protected bodies and entry bodies.
      
      2011-08-03  Yannick Moy  <moy@adacore.com>
      
      	* einfo.adb, einfo.ads (Is_Postcondition_Proc): new flag for procedure
      	entities with get/set subprograms, which is set on procedure entities
      	generated by the compiler for a postcondition.
      	* sem_ch6.adb (Process_PPCs): set new flag on postcondition procedures
      	* alfa.adb, alfa.ads (Get_Entity_For_Decl): new function returning the
      	entity for a declaration
      	(Get_Unique_Entity_For_Decl): new function returning an entity which
      	represents a declaration, so that matching spec and body have the same
      	entity.
      
      2011-08-03  Robert Dewar  <dewar@adacore.com>
      
      	* a-except-2005.adb, a-cfhama.adb, a-cfhase.adb, a-cfhase.ads,
      	a-cforma.adb, a-cforse.ads, a-cforse.adb: Minor reformatting
      
      2011-08-03  Yannick Moy  <moy@adacore.com>
      
      	* lib-xref-alfa.adb (Detect_And_Add_ALFA_Scope): make the subprogram
      	library-level because retriction No_Implicit_Dynamic_Code in the
      	front-end prevents its definition as a local subprogram
      	(Traverse_Compilation_Unit): extract new procedure from Add_ALFA_File,
      	for reuse in other contexts
      	(Traverse_Declarations_Or_Statements,
      	Traverse_Handled_Statement_Sequence, Traverse_Package_Body,
      	Traverse_Package_Declaration, Traverse_Subprogram_Body): make all these
      	procedures take a callback parameter to be called on all declarations
      	* lib-xref.ads
      	(Traverse_All_Compilation_Units): new generic function to traverse a
      	compilation unit and call a callback parameter on all declarations
      
      From-SVN: r177284
      Arnaud Charlet committed
    • [multiple changes] · f9ad6b62
      2011-08-03  Javier Miranda  <miranda@adacore.com>
      
      	* sem_prag.adb (Process_Interface_Name): Allow duplicated export names
      	in Java since they are always enclosed in a namespace that
      	differentiates them, and overloaded entities are supported by the VM.
      
      2011-08-03  Ed Schonberg  <schonberg@adacore.com>
      
      	* checks.adb (Determine_Range): If a computed bound of an operation is
      	outside the range of the base type of the expression, and overflow
      	checks are enabled, the result is unknown and cannot be used for any
      	subsequent constant folding.
      	* sem_eval.adb (Compile_Time_Compare): if the bounds of one operand are
      	unknown, so is the result of the comparison.
      
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* a-except-2005.adb (Raise_From_Controlled_Operation): Add new formal
      	From_Abort. When finalization was triggered by an abort, propagate
      	Standard'Abort_Signal rather than Program_Error.
      	* a-except-2005.ads (Raise_From_Controlled_Operation): Add new formal
      	From_Abort.
      	* a-except.adb (Raise_From_Controlled_Operation): Add new formal
      	From_Abort. When finalization was triggered by an abort, propagate
      	Standard'Abort_Signal rather than Program_Error.
      	* a-except.ads:(Raise_From_Controlled_Operation): Add new formal
      	From_Abort.
      	* exp_ch7.adb:(Build_Adjust_Or_Finalize_Statements): New local variable
      	Abort_Id. Update the calls to Build_Object_Declarations and
      	Build_Raise_Statement to include Abort_Id.
      	(Build_Adjust_Statements): New local variable Abort_Id. Update the
      	calls to Build_Object_Declarations and Build_Raise_Statement to include
      	Abort_Id.
      	(Build_Finalize_Statements): New local variable Abort_Id. Update the
      	calls to Build_Object_Declarations and Build_Raise_Statement to include
      	Abort_Id.
      	(Build_Components): Create an entity for Abort_Id when exceptions are
      	allowed on the target.
      	(Build_Finalizer): New local variable Abort_Id.
      	(Build_Initialize_Statements): New local variable Abort_Id. Update the
      	calls to Build_Object_Declarations and Build_Raise_Statement to include
      	Abort_Id.
      	(Build_Object_Declarations): Add new formal Abort_Id. Create the
      	declaration of flag Abort_Id to preserve the original abort status
      	before finalization code is executed.
      	(Build_Raise_Statement): Add new formal Abort_Id. Pass Abort_Id to
      	runtime routine Raise_From_Controlled_Operation.
      	(Create_Finalizer): Update the call to Build_Raise_Statement to include
      	Abort_Id. Update the call to Build_Object_Declarations to include
      	Abort_Id. Update the layout of the finalizer body.
      	(Make_Handler_For_Ctrl_Operation): Add an actual for From_Abort.
      	(Process_Transient_Objects): New local variable Abort_Id. Remove the
      	clunky code to create all flags and objects related to
      	exception propagation and replace it with a call to
      	Build_Object_Declarations. Update the call to Build_Raise_Statement to
      	include Abort_Id.
      	* exp_ch7.ads (Build_Object_Declarations): Moved from body to spec.
      	Add new formal Abort_Id and associated comment on its use.
      	(Build_Raise_Statement): Add new formal Abort_Id and associated comment
      	on its use.
      	* exp_intr.adb (Expand_Unc_Deallocation): New local variable Abort_Id.
      	Remove the clunky code to create all flags and objects related to
      	exception propagation and replace it with a call to
      	Build_Object_Declarations. Update the call to Build_Raise_Statement.
      
      2011-08-03  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* s-tassta.adb: Fix minor typos.
      
      2011-08-03  Robert Dewar  <dewar@adacore.com>
      
      	* rtsfind.ads, makeutl.ads, prj.ads, prj.adb, make.adb,
      	lib-writ.adb, makeutl.adb, s-soflin.ads, clean.adb: Minor reformatting.
      
      From-SVN: r177283
      Arnaud Charlet committed
    • [multiple changes] · 1cdfa9be
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch7.adb (Create_Finalizer): Treat freeze nodes in similar fashion
      	to packages. This ensures that the finalizer body will not end up
      	inside the freeze node.
      	(Process_Declarations): Add code to detect whether a freeze node has a
      	nested finalization collection.
      
      2011-08-03  Pascal Obry  <obry@adacore.com>
      
      	* g-awk.adb, g-awk.ads: Make GNAT.AWK API compatible with Ada 2005.
      	(Current_Session): Return a not null access to Session_Type.
      	(Default_Session): Likewise.
      
      From-SVN: r177282
      Arnaud Charlet committed
    • [multiple changes] · 243cae0a
      2011-08-03  Robert Dewar  <dewar@adacore.com>
      
      	* a-cfdlli.adb, bindgen.adb, exp_ch4.adb, exp_ch13.adb, sem_warn.adb,
      	exp_ch3.adb, exp_ch3.ads: Minor reformatting.
      
      2011-08-03  Pascal Obry  <obry@adacore.com>
      
      	* g-awk.ads: Minor comment fix.
      
      2011-08-03  Sergey Rybin  <rybin@adacore.com>
      
      	* tree_io.ads (ASIS_Version_Number): Update because of the changes in
      	the tree structure related to discriminant constraints.
      	Original_Discriminant cannot be used any more for computing the
      	defining name for the reference to a discriminant.
      
      2011-08-03  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_disp.adb (Is_Tag_Indeterminate): If the return type of the
      	function is not visibly tagged, this is not a dispatching call and
      	therfore is not Tag_Indeterminate, even if the function is marked as
      	dispatching on result.
      
      From-SVN: r177281
      Arnaud Charlet committed
    • [multiple changes] · f553e7bc
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch13.adb: Add with and use clauses for Restrict and Rident.
      	(Expand_N_Free_Statement): Add a guard to protect against run-times
      	which do not support controlled types.
      	* exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Add a guard to protect
      	against run-times which do not support controlled types.
      	* exp_ch4.adb (Complete_Controlled_Allocation): Add a guard to protect
      	against run-times which do not support controlled types.
      	* exp_ch7.adb (Build_Finalization_Collection): Add a guard to protect
      	against run-times which do not support controlled types.
      	* exp_util.adb (Needs_Finalization): Code reformatting. Add a guard to
      	protect against run-times which do not support controlled types.
      
      2011-08-03  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* exp_intr.adb: Put back with and use clauses for Exp_Ch11.
      	(Expand_Unc_Deallocation): Expand the AT_END handler at the very end.
      
      From-SVN: r177280
      Arnaud Charlet committed
    • Fix a typo. · 78277376
      From-SVN: r177279
      H.J. Lu committed
    • [multiple changes] · e4982b64
      2011-08-03  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_ch5.adb (Expand_Iterator_Loop): indicate that the cursor is
      	modified in the source, to prevent spurious warnings when compiling
      	with -gnatg.
      
      2011-08-03  Thomas Quinot  <quinot@adacore.com>
      
      	* a-except-2005.adb: Minor reformatting.
      
      2011-08-03  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_warn.adb (Check_One_Unit): if the only mention of a withed unit
      	is a renaming declaration in the private part of a package, do not emit
      	a warning that the with_clause could be moved because the renaming may
      	be used in the body or in a child unit.
      
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration):
      	Propagate the Comes_From_Source attribute from the original return
      	object to the renaming.
      
      2011-08-03  Jose Ruiz  <ruiz@adacore.com>
      
      	* exp_ch7.adb (Build_Raise_Statement): Do not call
      	Raise_From_Controlled_Operation when this routine is not present in
      	the run-time library.
      	(Cleanup_Protected_Object, Cleanup_Task): For restricted run-time
      	libraries (Ravenscar), tasks are non-terminating, and protected objects
      	and tasks can only appear at library level, so we do not want
      	finalization of protected objects nor tasks.
      	* exp_intr.adb: Minor clarification in comment.
      	bindgen.adb (Gen_Adainit_Ada, Gen_Main_C, Gen_Output_File_Ada,
      	Gen_Output_File_C): Remove references to finalization of library-level
      	objects when using restricted run-time libraries.
      
      2011-08-03  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch3.adb (Build_Discriminant_Constraints): Set
      	Original_Discriminant only if the parent type is a generic formal.
      
      From-SVN: r177278
      Arnaud Charlet committed
    • Add a testcase for PR middle-end/47383. · ac88396b
      2011-08-03  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR middle-end/47383
      	* gcc.dg/torture/pr47383.c: Likewise.
      
      From-SVN: r177277
      H.J. Lu committed
    • exp_ch13.adb: Add with and use clause for Targparm; · deb8dacc
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch13.adb: Add with and use clause for Targparm;
      	(Expand_N_Free_Statement): Prevent the generation of a custom
      	Deallocate on .NET/JVM targets since this requires pools and address
      	arithmetic.
      	* exp_ch4.adb (Expand_Allocator_Expression): When compiling for
      	.NET/JVM targets, attach the newly allocated object to the access
      	type's finalization collection. Do not generate a call to
      	Set_Finalize_Address_Ptr on .NET/JVM because this routine does not
      	exist in the runtime.
      	(Expand_N_Allocator): When compiling for .NET/JVM targets, do not
      	create a custom Allocate for object that do not require initialization.
      	Attach a newly allocated object to the access type's finalization
      	collection on .NET/JVM.
      	* exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add special processing for
      	assignment of controlled types on .NET/JVM. The two hidden pointers
      	Prev and Next and stored and later restored after the assignment takes
      	place.
      	* exp_ch6.adb (Expand_Call): Add local constant Curr_S. Add specialized
      	kludge for .NET/JVM to recognize a particular piece of code coming from
      	Heap_Management and change the call to Finalize into Deep_Finalize.
      	* exp_ch7.adb (Build_Finalization_Collection): Allow the creation of
      	finalization collections on .NET/JVM only for types derived from
      	Controlled. Separate the association of storage pools with a collection
      	and only allow it on non-.NET/JVM targets.
      	(Make_Attach_Call): New routine.
      	(Make_Detach_Call): New routine.
      	(Process_Object_Declarations): Suppress the generation of
      	build-in-place return object clean up code on .NET/JVM since it uses
      	pools.
      	* exp_ch7.ads (Make_Attach_Call): New routine.
      	(Make_Detach_Call): New routine.
      	* exp_intr.adb Add with and use clause for Targparm.
      	(Expand_Unc_Deallocation): Detach a controlled object from a collection
      	on .NET/JVM targets.
      	* rtsfind.ads: Add entries RE_Attach, RE_Detach and
      	RE_Root_Controlled_Ptr to tables RE_Id and RE_Unit_Table.
      	* snames.ads-tmpl: Add name Name_Prev. Move Name_Prev to the special
      	names used in finalization.
      
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* a-fihema.adb: Add with and use clauses for System.Soft_Links.
      	(Attach, Detach): Lock the current task when chaining an object onto a
      	collection.
      
      From-SVN: r177276
      Hristian Kirtchev committed
    • a-except.adb, [...] (Raise_From_Controlled_Operation): Rewritten to create the… · df3e68b1
      a-except.adb, [...] (Raise_From_Controlled_Operation): Rewritten to create the message strings when...
      
      2011-08-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* a-except.adb, a-except-2005.adb (Raise_From_Controlled_Operation):
      	Rewritten to create the message strings when the exception is not
      	raised by an abort during finalization.
      	* a-except.ads, a-except-2005.ads: Add pragma Export for procedure
      	Raise_From_Controlled_Operation and update its associated comment.
      	* a-fihema.ads, a-fihema.adb: New GNAT unit.
      	Ada.Finalization.Heap_Management provides key functionality
      	associated with controlled objects on the heap, their creation,
      	finalization and reclamation. Type Finalization_Collection is
      	effectively a wrapper which sits ontop of a storage pool and performs
      	all necessary bookkeeping for all the objects it contains. Each
      	access-to-controlled or access-to-class-wide type receives a collection
      	as part of its expansion. The compiler generates buffer code and
      	invokes Allocate / Deallocate to create and destroy allocated
      	controlled objects.
      	* a-finali.adb ("="): Removed.
      	* a-finali.ads ("="): Removed. Controlled types no longer carry hidden
      	fields Prev and Next.
      	* ali.adb (Scan_ALI): Add parsing code to process PF / Has_Finalizer.
      	A library unit with at least one controlled object on the library level
      	has a special finalizer which is invoked by the binder. To signal this,
      	ali files carry field PF.
      	* ali.ads: New field in type Unit_Record called Has_Finalizer. Add
      	associated comment on field usage.
      	* a-tags.adb (Get_RC_Offset): Removed.
      	(Needs_Finalization): New routine.
      	* a-tags.ads: Update the structure of the GNAT dispatch tables.
      	Dispatch tables now carry field Needs_Finalization which provides
      	runtime indication whether a type is controlled or has controlled
      	components or both. Remove field RC_Offset.
      	(Get_RC_Offset): Removed along with its associated pragma Export.
      	Since tagged types with controlled components no longer carry hidden
      	field _controller, the special mechanism to retrieve its location is no
      	longer needed.
      	(Needs_Finalization): New routine.
      	* atree.ads, atree.adb (Elist24): New routine.
      	(Set_Elist24): New routine.
      	* atree.h: Add a define clause for Elist24.
      	* bindgen.adb New library-level variable Lib_Final_Built.
      	(Gen_Adafinal_Ada): Reimplemented. Depending on the restrictions or the
      	presence of a VM target, the routine generates calls to the proper
      	library finalization routine.
      	(Gen_Adainit_Ada): Import Finalize_Library_Objects only on non-VM
      	targets. Set the correct library finalization routine depending on
      	whether the library has controlled objects or this is a VM compilation.
      	(Gen_Finalize_Library_Ada): New routine. This procedure generates calls
      	to library-level finalizers of compiled units in reverse order of
      	elaboration. It also produces exception management code and reraises a
      	potential exception after all units have been finalized.
      	(Gen_Finalize_Library_C): New routine. This procedure generates calls to
      	library-level finalizers of compiled units in reverse order of
      	elaboration.
      	(Gen_Finalize_Library_Defs_C): New routine. This procedure generates the
      	definitions of all library-level finalizers available to the compilation
      	(Gen_Main_Ada): Directly call Adafinal which now contails all target
      	dependent code.
      	(Gen_Main_C): Add new local constant Needs_Library_Finalization. Call
      	System.Standard_Library.Adafinal directly. If the library needs
      	finalization actions, create the sequence of finalization calls.
      	(Gen_Output_File_Ada): Alphabetize local variables and constants.
      	Generate a with clause for System.Soft_Links when compiling for a VM.
      	Remove the code which imports System.Standard_Library.Adafinal as
      	Do_Finalize. Generate the library finalization routine.
      	(Gen_Output_File_C): Add new local constant Needs_Library_Finalization.
      	If the library needs finalization actions, create all the definitions
      	of library- level finalizers.
      	(Has_Finalizer): New routine. Determines whether at least one compiled
      	unit has a library-level finalizer.
      	Add type Qualification_Mode.
      	(Set_Unit_Name): Add a formal which controls the replacement of a dot.
      	* einfo.adb: New usage of field 15 as Return_Flag.
      	Remove Finalization_Chain_Entity from the usages of field 19.
      	Remove Associated_Final_Chain from the usages of field 23.
      	New usage of field 23 as Associated_Collection.
      	New usage of field 24 as Finalizer.
      	New usage of flag 252 as Is_Processed_Transient.
      	(Associated_Final_Chain): Removed.
      	(Associated_Collection): New routine.
      	(Finalization_Chain_Entity): Removed.
      	(Finalizer): New routine.
      	(Is_Finalizer): New routine.
      	(Is_Processed_Transient): New routine.
      	(Return_Flag): New routine.
      	(Set_Associated_Final_Chain): Removed.
      	(Set_Associated_Collection): New routine.
      	(Set_Finalization_Chain_Entity): Removed.
      	(Set_Finalizer): New routine.
      	(Set_Is_Processed_Transient): New routine.
      	(Set_Return_Flag): New routine.
      	(Write_Entity_Flags): Include Is_Processed_Transient to the list of
      	displayed flags.
      	(Write_Field8_Name): Alphabetize the output.
      	(Write_Field11_Name): Alphabetize the output.
      	(Write_Field12_Name): Alphabetize the output.
      	(Write_Field13_Name): Alphabetize the output.
      	(Write_Field14_Name): Alphabetize the output.
      	(Write_Field15_Name): Alphabetize the output.
      	(Write_Field16_Name): Alphabetize the output.
      	(Write_Field17_Name): Alphabetize the output.
      	(Write_Field18_Name): Alphabetize the output.
      	(Write_Field19_Name): Alphabetize the output. Remove the output of
      	Finalization_Chain_Entity.
      	(Write_Field20_Name): Alphabetize the output.
      	(Write_Field21_Name): Alphabetize the output.
      	(Write_Field22_Name): Alphabetize the output.
      	(Write_Field23_Name): Alphabetize the output. Remove the output of
      	Associated_Final_Chain. Add output for Associated_Collection.
      	(Write_Field24_Name): Alphabetize the output.
      	(Write_Field25_Name): Add output for Finalizer.
      	(Write_Field26_Name): Alphabetize the output.
      	(Write_Field27_Name): Alphabetize the output.
      	(Write_Field28_Name): Alphabetize the output.
      	* einfo.ads: Add new field description for Associated_Collection and
      	its uses in nodes.
      	Remove Associated_Final_Chain and its uses in nodes.
      	Remove Finalization_Chain_Entity and its uses in nodes.
      	Add new field description for Finalizer and its uses in nodes.
      	Add new synthesized attribute Is_Finalizer.
      	Add new flag description for Is_Processed_Transient and its uses in
      	nodes.
      	Add new field description for Return_Flag and its uses in nodes.
      	(Associated_Final_Chain): Removed along with its pragma Inline.
      	(Associated_Collection): New routine and pragma Inline.
      	(Finalization_Chain_Entity): Removed along with its pragma Inline.
      	(Finalizer): New routine and pragma Inline.
      	(Is_Finalizer): New routine and pragma Inline.
      	(Is_Processed_Transient): New routine and pragma Inline.
      	(Return_Flag): New routine and pragma Inline.
      	(Set_Associated_Final_Chain): Removed along with its pragma Inline.
      	(Set_Associated_Collection): New routine and pragma Inline.
      	(Set_Finalization_Chain_Entity): Removed along with its pragma Inline.
      	(Set_Finalizer): New routine and pragma Inline.
      	(Set_Is_Processed_Transient): New routine and pragma Inline.
      	(Set_Return_Flag): New routine and pragma Inline.
      	* exp_aggr.adb: Alphabetize subprograms.
      	(Build_Array_Aggr_Code): Remove formal Flist and its associated comment.
      	(Build_Record_Aggr_Code): Remove formals Flist and Obj along with their
      	associated comments. Remove local variables External_Final_List and
      	Attach.
      	Rename Ctrl_Stuff_Done to Finalization_Done. Rename local variable A to
      	Ancestor. Remove the retrieval of finalization lists. Update the call to
      	Make_Adjust_Call.
      	(Convert_Aggr_In_Allocator): Remove the retrieval of finalization
      	lists. Update the call to Late_Expansion.
      	(Convert_Aggr_In_Assignment): Update the call to Late_Expansion.
      	(Convert_Aggr_In_Object_Decl): Update the call to Late_Expansion.
      	(Gen_Assign): Remove the retrieval of the finalization list used to
      	build the assignment. Update the calls to Make_Init_Call and
      	Make_Adjust_Call.
      	(Gen_Ctrl_Actions_For_Aggr): Renamed to Generate_Finalization_Actions.
      	Remove the mechanism to determine attachment levels and finalization
      	list retrieval. Remove the processing for coextensions.
      	(Init_Controller): Removed. Controllers no longer exist.
      	(Late_Expansion): Remove formals Flist and Obj along with their
      	associated comments. Update the calls to Build_Record_Aggr_Code and
      	Build_Array_Aggr_Code.
      	* exp_ch13.adb (Expand_N_Free_Statement): New routine.
      	(Expand_N_Freeze_Entity): Add special processing for finalizers which
      	appear in entry bodies, protected subprograms and task bodies.
      	* exp_ch13.ads (Expand_N_Free_Statement): New routine.
      	* exp_ch3.adb (Add_Final_Chain): Removed.
      	(Build_Array_Init_Proc): Alphabetize local variables.
      	(Build_Assignment): Alphabetize local variables. Update the call to
      	Maked_Adjust_Call.
      	(Build_Class_Wide_Master): Rename local variables to better reflect
      	their role.
      	(Build_Discriminant_Assignments): Code reformatting.
      	(Build_Init_Call_Thru): Code reformatting.
      	(Build_Init_Procedure): Code reformatting. Generate a special version
      	of Deep_Finalize which is capable of finalizing all initialized
      	components and ignore the rest.
      	(Build_Init_Statements): Rename local variables to better reflect their
      	role.
      	Reimplement the mechanism to include the creation and update of an index
      	variable called a "counter". It is used as a bookmark for tracing
      	initialized and non-initialized components.
      	(Build_Initialization_Call): Remove local variable Controller_Typ.
      	Alphabetize all local variables. Remove the initialization of the
      	record controller and update the call to Make_Init_Call.
      	(Build_Record_Init_Proc): Rename formal Pe to Rec_Ent.
      	New local variable Counter.
      	(Constrain_Array): Alphabetize.
      	(Expand_Freeze_Array_Type): Create a collection instead of a
      	finalization list.
      	(Expand_Freeze_Class_Wide_Type): New routine. Creates TSS primitive
      	Finalize_Address which is used in conjunction with allocated controlled
      	objects.
      	(Expand_N_Object_Declaration): Remove the creation of a finalization
      	list for anonymous access types. Update the calls to Make_Init_Call and
      	Make_Adjust_Call.
      	(Expand_Freeze_Record_Type): Remove local variable Flist. Remove the
      	retrieval of finalization lists. Remove the expansion of the record
      	controller. Create TSS primitive Finalize_Address used in conjunction
      	with controlled objects on the heap. Create finalization collections
      	for access-to-controlled record components.
      	(Expand_Record_Controller): Removed.
      	(Freeze_Type): Remove the freezing of record controllers. Freezing of
      	class-wide types now requires additional processing. Create
      	finalization collections for access-to-controlled types.
      	(Increment_Counter): New routine.
      	(Make_Counter): New routine.
      	(Make_Eq_If): Remove the mention of Name_uController.
      	(Make_Predefined_Primitive_Specs): There is no longer need to skip
      	types coming from System.Finalization_Root.
      	(Predef_Deep_Spec): Reimplemented to reflect the new parameter profiles.
      	(Predefined_Primitive_Bodies): There is no longer need to skip types
      	coming from System.Finalization_Root.
      	(Stream_Operation_OK): Do not generate stream routines for
      	type Ada.Finalization.Heap_Management.Finalization_Collection.
      	* exp_ch3.ads: Alphabetize subprograms.
      	* exp_ch4.adb: Remove with and use clause for Sem_Ch8.
      	Add with and use clause for Lib.
      	(Complete_Coextension_Finalization): Removed.
      	(Complete_Controlled_Allocation): New routine. Create a finalization
      	collection for anonymous access-to-controlled types. Create a custom
      	Allocate which interfaces with the back end and the machinery in
      	Heap_Management.
      	(Expand_Allocator_Expression): Add necessary calls to
      	Complete_Controlled_Allocation. Remove the retrieval of finalization
      	lists. Update the calls to Make_Adjust_Call. Generate a call to
      	Ada.Finalization.Heap_Management.Set_Finalize_Address_Ptr to decorate
      	the associated collection.
      	(Expand_N_Allocator): Remove the processing for dynamic coextensions.
      	Code clean up. Remove the retrieval of finalization lists and
      	attachment levels.
      	Update the call to Make_Init_Call. Generate a call to
      	Ada.Finalization.Heap_Management.Set_Finalize_Address_Ptr to decorate
      	the associated collection.
      	(Get_Allocator_Final_List): Removed. Finalization lists are not
      	available.
      	(Suitable_Element): Remove the mention of Name_uController.
      	* exp_ch5.adb: Remove with and use clauses for Ttypes and Uintp.
      	(Make_Tag_Ctrl_Assignment): Rewritten to simply do a finalization of
      	the left hand side, carry out the assignment and adjust the left hand
      	side.
      	* exp_ch6.adb (Add_Final_List_Actual_To_Build_In_Place_Call): Removed.
      	(Add_Collection_Actual_To_Build_In_Place_Call): New routine.
      	(BIP_Formal_Suffix): Rename BIP_Final_List and BIPfinallist to
      	BIP_Collection and BIPcollection.
      	(Build_Heap_Allocator): New routine used to allocate the return object
      	of a build-in-place function onto a collection.
      	(Expand_Ctrl_Function_Call): Moved from Exp_Ch7.
      	(Expand_Call): Do not replace direct calls to Deep routines with their
      	aliases.
      	(Expand_N_Extended_Return_Statement): Give all variables shorter names
      	and update their occurrences. Add a special return flag to monitor the
      	[ab]normal execution of the function. The flag is set right before the
      	return statement.
      	Rewrite the mechanism used to allocate a build-in-place return object
      	on the heap or on a storage pool.
      	(Is_Direct_Deep_Call): New routine.
      	(Make_Build_In_Place_Call_In_Allocator): Add a collection to a
      	build-in-place function call instead of a final list. Build a call to
      	Set_Finalize_Address_Ptr to decorate the associated collection.
      	(Make_Build_In_Place_Call_In_Anonymous_Context): Create a temporary in
      	order to name the build-in-place function call's result for later
      	finalization. Add a collection to a build-in-place function call
      	instead of a final list.
      	(Make_Build_In_Place_Call_In_Assignment): Add a collection to a
      	build-in-place function call instead of a final list. Remove the code
      	which moves one final list and transforms it into the actual in a
      	nested build-in-place call.
      	(Make_Build_In_Place_Call_In_Object_Declaration): Add a collection to a
      	build-in-place function call instead of a final list.
      	(Move_Final_List): Removed.
      	(Needs_BIP_Collection): New routine.
      	(Needs_BIP_Final_List): Removed.
      	* exp_ch6.ads: Replace BIP_Final_List with BIP_Collection in
      	enumeration type BIP_Formal_Kind.
      	Update the related comment.
      	(Needs_BIP_Collection): New routine.
      	(Needs_BIP_Final_List): Removed.
      	* exp_ch7.adb: Add with and use clauses for Elists, Exp_Ch6, Stringt
      	and Ttypes. Remove with and use clauses for Sem_Type. Alphabetize the
      	majority of subprograms in this unit. Add Name_Finalize_Address to
      	array Name_Of and TSS_Finalize_Address to array Deep_Name_Of.
      	(Build_Adjust_Or_Finalize_Statements): Create the adjust or finalization
      	statements for an array type.
      	(Build_Adjust_Statements): Create the adjust statements for a record
      	type.
      	(Build_Cleanup_Statements): New routine. A procedure which given any
      	construct containing asynchronous calls, references to _master, or is a
      	task body, a task allocation or a protected body produces the necessary
      	runtime calls to clean up these constructs.
      	(Build_Exception_Handler): New routine.
      	(Build_Final_List): Removed.
      	(Build_Finalization_Collection): New routine. A core procedure which
      	creates a collection to service heap allocated controlled objects
      	associated with an access-to-controlled type.
      	(Build_Finalize_Statements): Create the finalization statements for a
      	record types.
      	(Build_Finalizer): New routine. A core procedure which given any
      	construct with declarations and/or statements detects all objects which
      	need any type of clean up (controlled objects, protected objects) and
      	generates all necessary code to clean up the said objects in the proper
      	order.
      	(Build_Finalizer_Call): New routine.
      	(Build_Initialize_Statements): Create the initialization statements for
      	an array type. The generated routine contains code to finalize partially
      	initialized arrays.
      	(Build_Object_Declarations): New routine.
      	(Build_Raise_Statement): New routine.
      	(Clean_Simple_Protected_Objects): Removed.
      	(Controller_Component): Removed.
      	(Enclosing_Function): New routine.
      	(Expand_Cleanup_Actions): Create a finalizer for a construct which has
      	either declarations or statements or both.
      	(Expand_N_Package_Body): Create a finalizer for a non-generic package.
      	(Expand_N_Package_Declaration): Create a finalizer for a non-generic
      	package.
      	(Find_Final_List): Removed.
      	(Global_Flist_Ref): Removed.
      	(In_Finalization_Root): Removed.
      	(Insert_Actions_In_Scope_Around): Determine the range of the transient
      	scope in terms of tree nodes. Process all transient variables within
      	that range.
      	(Make_Adjust_Call): Rewritten. There is no longer an attach call
      	generated after the adjust.
      	(Make_Attach_Call): Removed.
      	(Make_Call): New routine.
      	(Make_Clean): Removed.
      	(Make_Deep_Array_Body): Rewritten to simply invoke the appropriate
      	build routines.
      	(Make_Deep_Proc): Rewritten to generate the new profile signature used
      	in Deep routines.
      	(Make_Deep_Record_Body): Rewritten to simply invoke the appropriate
      	build routines.
      	(Make_Final_Call): Modified to simply create a call to either
      	Deep_Finalize or Finalize.
      	(Make_Finalize_Address_Body): New routine.
      	(Make_Finalize_Address_Stmts): New routine. A function which produces
      	TSS primitive Finalize_Address used in conjunction with heap allocated
      	controlled objects.
      	(Make_Handler_For_Ctrl_Operation): Add specialized code for .NET/JVM.
      	(Make_Init_Call): Rewritten. There is no longer an attach call
      	generated after initialization.
      	(Make_Local_Deep_Finalize): New routine.
      	(Make_Set_Finalize_Address_Ptr_Call): New routine.
      	(Make_Transient_Block): Remove the finalization list retrieval and
      	manipulation.
      	(Needs_Finalization): Moved to Exp_Util.
      	(Parent_Field_Type): New routine.
      	(Preprocess_Components): New routine.
      	(Process_Transient_Objects): New routine.
      	(Wrap_HSS_In_Block): New routine.
      	(Wrap_Transient_Declaration): Remove finalization list management and
      	controller insertion.
      	(Wrap_Transient_Expression): Code reformatting.
      	(Wrap_Transient_Statement): Code reformatting.
      	* exp_ch7.ads (Build_Final_List): Removed.
      	(Build_Finalization_Collection): New routine.
      	(Build_Raise_Statement): New routine.
      	(Controller_Component): Removed.
      	(Expand_Ctrl_Function_Call): Moved to Exp_Ch6.
      	(Find_Final_List): Removed.
      	(In_Finalization_Root): Removed.
      	(Is_Simple_Protected_Type): Update related comment.
      	(Make_Adjust_Call): New parameter profile and associated comments.
      	(Make_Attach_Call): Removed.
      	(Make_Final_Call): New parameter profile and associated comments.
      	(Make_Finalize_Address_Body): New routine.
      	(Make_Init_Call): New parameter profile and associated comments.
      	(Make_Local_Deep_Finalize): New routine.
      	(Make_Set_Finalize_Address_Ptr_Call): New routine.
      	(Needs_Finalization): Moved to Exp_Util.
      	* exp_ch9.adb (Add_Object_Pointer): Code reformatting.
      	(Expand_N_Protected_Body): Remove the handling of finalization lists.
      	(Find_Protection_Type): Moved to Exp_Util.
      	* exp_disp.adb: Remove with and use clauses for Exp_Ch7.
      	(Make_DT): Update sequence of dispatch table initialization. Remove the
      	initialization of field RC_Offset. Add initialization of field Needs_
      	Finalization.
      	* exp_intr.adb (Expand_Unc_Deallocation): Code reformatting.
      	Reimplement how an object is first finalized, then deallocated.
      	* exp_strm.adb (Build_Record_Or_Elementary_Input_Function):
      	Code reformatting.
      	* exp_tss.ads: Add special suffix for TSS primitive Finalize_Address.
      	Register TSS_Finalize_Address with type TSS_Names.
      	* exp_util.adb (Build_Allocate_Deallocate_Proc): New routine. This core
      	procedure provides the interface between an allocation / deallocation
      	and the support machinery in Ada.Finalization.Heap_Management.
      	(Find_Init_Call): Code reformatting.
      	(Find_Init_Call_In_List): Code reformatting.
      	(Find_Protection_Type): Moved from Exp_Ch9.
      	(Find_Prim_Op): Reimplement to add preference of recovered primitive.
      	(Has_Controlled_Coextensions): Removed.
      	(Has_Controlled_Objects): New routine.
      	(In_Library_Level_Package_Body): New routine.
      	(Insert_Action_After): New routine.
      	(Is_Finalizable_Transient): New routine. This predicate determines
      	whether an object declaration is one of the many variants of controlled
      	transients.
      	(Is_Null_Access_BIP_Func_Call): New routine.
      	(Is_Non_BIP_Func_Call): New routine.
      	(Is_Related_To_Func_Return): New routine.
      	(Needs_Finalization): Moved from Exp_Ch7.
      	* exp_util.ads (Build_Allocate_Deallocate_Proc): New routine.
      	(Find_Protection_Type): Moved from Exp_Ch9.
      	(Has_Controlled_Coextensions): Removed.
      	(Has_Controlled_Objects): New routine.
      	(In_Library_Level_Package_Body): New routine.
      	(Insert_Action_After): New routine.
      	(Is_Finalizable_Transient): New routine.
      	(Is_Null_Access_BIP_Func_Call): New routine.
      	(Is_Non_BIP_Func_Call): New routine.
      	(Is_Related_To_Func_Return): New routine.
      	(Needs_Finalization): Moved from Exp_ch7.
      	* expander.adb (Expand): Add a case for N_Free_Statement.
      	* freeze.adb (Freeze_All): Replace the generation of a finalization
      	list with a collection for access-to-controlled types.
      	(Freeze_Entity): Code reformatting.
      	(Freeze_Record_Type): Remove the freezing of a record controller
      	component.
      	(Freeze_Subprogram): Code reformatting.
      	* inline.adb (Cleanup_Scopes): Remove the reset of the scope
      	finalization list.
      	* lib-writ.adb (Write_Unit_Information): Output "PF" when a package
      	has a library-level finalizer.
      	* lib-writ.ads: Add "PF" to the sequence of unit attributes.
      	* a-filico.ads, a-filico.adb, s-finimp.ads, s-finimp.adb: Removed.
      	* Makefile.rtl: Remove a-filico and s-finimp from the list of object
      	files. Add a-fihema to the list of object files.
      	* par-ch4.adb:
      	Alphabetize the associations in type Is_Parameterless_Attribute.
      	* rtsfind.ads: Ada.Finalization_List.Controller and
      	System.Finalization_Implementation are no longer a GNAT unit.
      	Update the range of type Ada_Finalization_Child. Remove the following
      	recoverable entities:
      	
      	   RE_Attach_To_Final_List
      	   RE_Deep_Tag_Attach
      	   RE_Finalize_List
      	   RE_Finalize_One
      	   RE_Finalizable_Ptr_Ptr
      	   RE_Global_Final_List
      	   RE_Limited_Record_Controller
      	   RE_List_Controller
      	   RE_Move_Final_List
      	   RE_Record_Controller
      	   RE_Simple_List_Controller
      	
      	Add the following recoverable entities:
      	
      	   RE_Add_Offset_To_Address
      	   RE_Allocate
      	   RE_Base_Pool
      	   RE_Deallocate
      	   RE_Exception_Identity
      	   RE_Finalization_Collection
      	   RE_Finalization_Collection_Ptr
      	   RE_Needs_Finalization
      	   RE_Save_Library_Occurrence
      	   RE_Set_Finalize_Address_Ptr
      	   RE_Set_Storage_Pool_Ptr
      	   RE_Storage_Count
      	* sem_aggr.adb (Resolve_Record_Aggregate): Remove mention of
      	Name_uController.
      	* sem_aux.adb (First_Discriminant): Remove mention of Name_uController.
      	(First_Stored_Discriminant): Remove the mention of Name_uController.
      	* sem_aux.ads: Comment reformatting.
      	* sem_ch10.adb (Build_Chain): Signal the class-wide creation machinery
      	to redecorate an already existing class-wide type.
      	(Decorate_Tagged_Type): New parameter profile and associated comment.
      	Create a "shadow class-wide type" for a shadow entity.
      	* sem_ch11.adb (Analyze_Exception_Handlers): Remove the dubious setting
      	of the final chain along with the associated comment.
      	* sem_ch3.adb (Access_Type_Declaration): Add new local variable
      	Full_Desig and set it to the full view of the designated type.
      	Initialize the finalization collection to empty.
      	(Build_Derived_Record_Type): Alphabetize local variables. Code
      	reformatting.
      	(Collect_Fixed_Components): Remove the mention of Name_uController.
      	(Create_Constrained_Components): Remove the mention of Name_uController.
      	(Make_Class_Wide_Type): Add specialized code to redecorate an existing
      	class-wide type of a shadow entity.
      	(Process_Full_View): Update the machinery which marks type
      	Limited_Controlled's entity as limited.
      	* sem_ch4.adb (Analyze_One_Call): Code reformatting.
      	* sem_ch6.adb (Create_Extra_Formals): Do not generate a finalization
      	list, instead make a collection build-in-place formal.
      	* sem_ch8.adb (Analyze_Object_Renaming): Look at the available view of
      	a designated type in order to establish a match between the renaming
      	and the renamed entity.
      	(Find_Selected_Component): Add guard to prevent spurious exceptions
      	from being raised on .NET/JVM.
      	* sem_disp.adb (Check_Dispatching_Operation): Include Finalize_Address
      	to the list of primitive that need special processing. Update arrays
      	C_Names and D_Names.
      	(Replace_Types): Handle class-wide types.
      	* sem_elab.adb (Check_A_Call): Since Deep_Initialize now has a
      	different parameter profile, look at the first formal.
      	* sem_prag.adb: Remove with and use clauses for Exp_Ch7. Add with and
      	use clauses for Exp_Util.
      	* sem_res.adb: Remove with and use clauses for Elists.
      	(Propagate_Coextensions): Removed.
      	(Resolve_Allocator): Do not propagate the list of coextensions from one
      	allocator to another.
      	* sem_util.adb (Build_Actual_Subtype_Of_Component): Rename variable
      	Deaccessed_T to Desig_Typ.
      	(Enter_Name): Remove the mention of Name_uController.
      	(Gather_Components): Remove the mention of Name_uController.
      	(Incomplete_Or_Private_View): New routine.
      	(Is_Coextension_Root): Removed.
      	(Is_Fully_Initialized_Type): Remove the mention of Name_uController.
      	* sem_util.ads (Incomplete_Or_Private_View): New routine.
      	(Is_Coextension_Root): Removed.
      	* s-finroo.ads: Remove with clause for Ada.Unchecked_Conversion.
      	Controlled types are now derived from a null tagged record. Remove
      	types Finalizable_Ptr, Finalizable and Empty_Root_Controlled.
      	* sinfo.adb (Coextensions): Removed.
      	(Set_Coextensions): Removed.
      	* sinfo.ads: Remove Coextensions from the explanation of node fields
      	and its uses in nodes.
      	Update the field usage of N_Allocator.
      	(Coextensions): Removed along with its pragma Inline.
      	(Set_Coextensions): Removed along with its pragma Inline.
      	* snames.ads-tmpl: Remove names
      	
      	  Name_uClean
      	  Name_uController
      	  Name_uFinal_List
      	  Name_uLocal_Final_List
      	  Name_Finalization_Root
      	  Name_Next
      	  Name_Prev
      	
      	Add names
      	
      	  Name_uFinalizer
      	  Name_Finalize_Address
      	* s-pooglo.adb (Allocate): Add overriding indicator.
      	(Deallocate): Add overriding indicator.
      	(Storage_Size): Add overriding indicator.
      	* s-soflin.adb (Adafinal_NT): Invoke Finalize_Library_Objects rather
      	than Finalize_Global_List.
      	(Null_Finalize_Global_List): Removed.
      	(Save_Library_Occurrence): New routine.
      	* s-soflin.ads: Remove variable Finalize_Global_List along with its
      	initialization. Add variable Finalize_Library_Objects along with its
      	pragma Export. Add variables Library_Exception and
      	Library_Exception_Set along with their pragma Export.
      	(Null_Finalize_Global_List): Removed.
      	(Save_Library_Occurrence): New routine.
      	* s-tassta.adb (Finalize_Global_Tasks): Call Finalize_Library_Objects
      	rather than Finalize_Global_List.
      	* tbuild.adb (Unchecked_Convert_To): Capture and set the parent field
      	of the constructed node.
      
      From-SVN: r177275
      Hristian Kirtchev committed
    • * gnat.dg/specs/debug1.ads: Add missing -margs switch. · de29d850
      From-SVN: r177274
      Arnaud Charlet committed
    • * link.c: Include "auto-host.h" before system headers. · 2ee06322
      From-SVN: r177272
      Rainer Orth committed
    • Add testcases for PR target/47744. · 72c2f810
      2011-08-03  H.J. Lu  <hongjiu.lu@intel.com>
      
      	PR target/47744
      	* gcc.dg/torture/pr47744-1.c: New.
      	* gcc.dg/torture/pr47744-2.c: Likewise.
      	* gcc.dg/torture/pr47744-3.c: Likewise.
      
      From-SVN: r177271
      H.J. Lu committed
    • re PR middle-end/49958 (fold performs invalid association) · a130fb24
      2011-08-03  Richard Guenther  <rguenther@suse.de>
      
      	PR middle-end/49958
      	* fold-const.c (fold_binary_loc): Only associate
      	(+ (+ (* a b) c) (* d e)) as (+ (+ (* a b) (* d e)) c) if
      	overflow wraps.
      
              * gcc.dg/torture/pr49958.c: New testcase.
      
      From-SVN: r177270
      Richard Guenther committed
    • make.adb (Gnatmake): Add to table Library_Projs only library projects that are not extended. · f77b022b
      2011-08-03  Vincent Celier  <celier@adacore.com>
      
      	* make.adb (Gnatmake): Add to table Library_Projs only library projects
      	that are not extended. Do not check if a library project that is
      	extended should be regenerated. Do not add to table Library_Paths the
      	libraries that are in extended projects. Link only with libraries that
      	are in libray projects that are not extended.
      	* prj-nmsc.adb (Check_Library_Attributes): Do not reset flag Library
      	for a library project that is extended.
      
      From-SVN: r177269
      Vincent Celier committed
    • re PR rtl-optimization/49941 (segmentation fault in redirect_jump_2) · 276e0224
      	PR rtl-optimization/49941
      	* jump.c (mark_jump_label): Comment.
      	(mark_jump_label_1): Set JUMP_LABEL for return jumps.
      	* emit-rtl.c (copy_rtx_if_shared_1, copy_insn_1): Leave RETURN shared.
      	(mark_used_flags): Don't mark RETURN.
      
      From-SVN: r177268
      Alan Modra committed
    • re PR middle-end/49938 (ICE in interpret_loop_phi, at tree-scalar-evolution.c:1645) · eb723fa3
      2011-08-03  Richard Guenther  <rguenther@suse.de>
      
      	PR tree-optimization/49938
      	* tree-scalar-evolution.c (interpret_loop_phi): Gracefully
      	deal with a POLYNOMIAL_CHREC.
      
      	* g++.dg/torture/pr49938.C: New testcase.
      
      From-SVN: r177267
      Richard Guenther committed