Commit Graph

87069 Commits

Author SHA1 Message Date
Hristian Kirtchev 9392454c58 adaint.h, adaint.c (__gnat_current_time_string): New routine.
2008-04-08  Hristian Kirtchev  <kirtchev@adacore.com>

	* adaint.h, adaint.c (__gnat_current_time_string): New routine.

	* g-timsta.adb, g-timsta.ads: New files.

From-SVN: r134017
2008-04-08 08:46:56 +02:00
Olivier Hainque 7f335c645d 2008-04-08 Olivier Hainque <hainque@adacore.com>
* s-intman-vxworks.ads, s-intman-vxworks.adb
	(Map_And_Raise_Exception): Remove. Was an import of only part of the
	required services already implemented elsewhere.
	(Notify_Exception): Delete body, import __gnat_error_handler instead.
	(Initialize): Add SA_SIGINFO to the sa_flags, to get the sigcontext
	argument passed to the handler, which we need for ZCX propagation
	purposes.

From-SVN: r134016
2008-04-08 08:46:41 +02:00
Jose Ruiz c54ec67ce7 2008-04-08 Jose Ruiz <ruiz@adacore.com>
Tristan Gingold  <gingold@adacore.com>

	* s-interr-dummy.adb, s-interr-vms.adb, s-interr-sigaction.adb
	(Install_Restricted_Handlers): New procedure
	which is a simplified version of Install_Handlers that does not store
	previously installed.

	* s-interr-vxworks.adb: Fix ACATS cxc3001
	On VxWorks interrupts can't be detached.
	(Install_Restricted_Handlers): New procedure.

	* s-interr.ads, s-interr.adb (Install_Restricted_Handlers): New
	procedure.

From-SVN: r134015
2008-04-08 08:46:28 +02:00
Hristian Kirtchev cf177287b1 a-calend-vms.ads, [...]: Add with and use clause for System.OS_Primitives.
2008-04-08  Hristian Kirtchev  <kirtchev@adacore.com>

	* a-calend-vms.ads, a-calend-vms.adb: Add with and use clause for
	System.OS_Primitives.
	Change type of various constants, parameters and local variables from
	Time to representation type OS_Time.
	(To_Ada_Time, To_Unix_Time): Correct sign of origin shift.
	Remove the declaration of constant Mili_F from several routines. New
	body for internal package Conversions_Operations.
	(Time_Of): Add default parameters for several formals.

	* a-caldel.adb: Minor reformatting

	* a-calend.ads, a-calend.adb: New body for internal package
	Conversions_Operations.
	(Time_Of): Add default parameters for several formals.

	* Makefile.rtl: Add a-ststop
	Add Ada.Calendar.Conversions to the list of runtime files.
	Add g-timsta

	* a-calcon.adb, a-calcon.ads: New files.

From-SVN: r134014
2008-04-08 08:46:17 +02:00
Tristan Gingold f9a4f2ef03 re PR target/10768 (ICEs on compilation of ada support library for avr)
2008-04-08  Tristan Gingold  <gingold@adacore.com>

PR ada/10768

	* cuintp.c: Fix 16 bits issue for AVR.
	On AVR, integer is 16 bits, so it can't be used to do math with
	Base (=32768).
	So use long_integer instead.

From-SVN: r134013
2008-04-08 08:46:04 +02:00
Tristan Gingold 682bca235f s-fileio.adb: Name_Error shouldn't be raised for a tempory file.
2008-04-08  Tristan Gingold  <gingold@adacore.com>

	* s-fileio.adb: Name_Error shouldn't be raised for a tempory file.

From-SVN: r134012
2008-04-08 08:45:53 +02:00
Robert Dewar ce4a6e8468 fe.h: Remove global Optimize_Alignment flag, no longer used
2008-04-08  Robert Dewar  <dewar@adacore.com>
	    Gary Dismukes  <dismukes@adacore.com>
	    Javier Miranda  <miranda@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* fe.h: Remove global Optimize_Alignment flag, no longer used

	* layout.adb: Test Optimize_Alignment flags rather than global switch

	* lib.ads, lib.adb: New OA_Setting field in library record

	* lib-load.adb: New OA_Setting field in library record

	* lib-writ.ads, lib-writ.adb (Collect_Withs, Write_With_Lines): Place
	units mentioned in limited_with_ clauses in the ali file, with an
	'Y' marker.
	New Ox fields in U line

	* opt.adb: New flag Optimize_Alignment_Local
	(Check_Policy_List[_Config]): New flags

	* opt.ads (Invalid_Value_Used): New flag
	New switch Optimize_Alignment_Local
	(Warn_On_Parameter_Order): New flag
	(Check_Policy_List[_Config]): New flags

	* ali.ads, ali.adb: Add indicator 'Y' to mark mark the presence of
	limited_with clauses.
	New data structures for Optimize_Alignment

	* bcheck.adb (Check_Consistent_Restriction_No_Default_Initialization):
	New procedure
	(Check_Consistent_Optimize_Alignment): Rework for new structure
	(Check_Consistent_Restrictions): Fix incorrect error message

	sem_ch10.adb (Decorate_Tagged_Type): Set the Parent field of a newly
	created class-wide type (to the Parent field of the specific type).
	(Install_Siblings): Handle properly private_with_clauses on subprogram
	bodies and on generic units.
	(Analyze_With_Clause, Install_Limited_Withed_Unit): Guard against an
	illegal limited_with_clause that names a non-existent package.
	(Check_Body_Required): Determine whether a unit named a limited_with
	clause needs a body.
	(Analyze_Context): A limited_with_clause is illegal on a unit_renaming.
	Capture Optimize_Alignment settings to set new OA_Setting field in
	library record.
	(Build_Limited_Views): Include task and protected type declarations.

	* sem_ch3.ads, sem_ch3.adb (Analyze_Object_Declaration): Handle the
	case of a possible constant redeclaration where the current object is
	an entry index constant.
	(Analyze_Object_Declaration): Generate an error in case of CPP
	class-wide object initialization.
	(Analyze_Object_Declaration): Add extra information on warnings for
	declaration of unconstrained objects.
	(Access_Type_Declaration): Set Associated_Final_Chain to Empty, to avoid
	conflicts with the setting of Stored_Constraint in the case where the
	access type entity has already been created as an E_Incomplete_Type due
	to a limited with clause.
	Use new Is_Standard_Character_Type predicate
	(Analyze_Object_Declaration): Apply access_constant check only after
	expression has been resolved, given that it may be overloaded with
	several access types.
	(Constant_Redeclaration): Additional legality checks for deferred
	constant declarations tha involve anonymous access types and/or null
	exclusion indicators.
	(Analyze_Type_Declaration): Set Optimize_Alignment flags
	(Analyze_Subtype_Declaration): Ditto
	(Analyze_Object_Declaration): Ditto
	(Analyze_Object_Declaration): Don't count tasks in generics
	Change name In_Default_Expression      => In_Spec_Expression
	Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression
	Change name Pre_Analyze_And_Resolve    => Preanalyze_And_Resolve
	(Process_Discriminants): Additional check for illegal use of default
	expressions in access discriminant specifications in a type that is not
	explicitly limited.
	(Check_Abstract_Overriding): If an inherited function dispaches on an
	access result, it must be overridden, even if the type is a null
	extension.
	(Derive_Subprogram): The formals of the derived subprogram have the
	names and defaults of the parent subprogram, even if the type is
	obtained from the actual subprogram.
	(Derive_Subprogram): In the presence of interfaces, a formal of an
	inherited operation has the derived type not only if it descends from
	the type of the formal of the parent operation, but also if it
	implements it. This is relevant for the renamings created for the
	primitive operations of the actual for a formal derived type.
	(Is_Progenitor): New predicate, to determine whether the type of a
	formal in the parent operation must be replaced by the derived type.

	* sem_util.ads, sem_util.adb (Has_Overriding_Initialize): Make
	predicate recursive to handle components that have a user-defined
	Initialize procedure. Handle controlled derived types whose ancestor
	has a user-defined Initialize procedured.
	(Note_Possible_Modification): Add Sure parameter, generate warning if
	sure modification of constant
	Use new Is_Standard_Character_Type predicate
	(Find_Parameter_Type): when determining whether a protected operation
	implements an interface operation, retrieve the type of the formal from
	the entity when the formal is an access parameter or an
	anonymous-access-to-subprogram.
	Move Copy_Parameter_List to sem_util, for use when building stubbed
	subprogram bodies.
	(Has_Access_Values): Tagged types now return False
	(Within_HSS_Or_If): New procedure
	(Set_Optimize_Alignment_Flags): New procedure
	Change name In_Default_Expression      => In_Spec_Expression
	Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression
	Change name Pre_Analyze_And_Resolve    => Preanalyze_And_Resolve

From-SVN: r134011
2008-04-08 08:45:42 +02:00
Robert Dewar 21d2799722 alloc.ads: Add entries for Obsolescent_Warnings table
2008-04-08  Robert Dewar  <dewar@adacore.com>
	    Bob Duff  <duff@adacore.com>
	    Gary Dismukes  <dismukes@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* alloc.ads: Add entries for Obsolescent_Warnings table

	* einfo.ads, einfo.adb: Minor reformatting.
	(Is_Discriminal): New subprogram.
	(Is_Prival): New subprogram.
	(Is_Protected_Component): New subprogram.
	(Is_Protected_Private): Removed.
	(Object_Ref, Set_Object_Ref): Removed.
	(Prival, Set_Prival): Change assertion.
	(Privals_Chain, Set_Privals_Chain): Removed.
	(Prival_Link, Set_Prival_Link): New subprogram.
	(Protected_Operation, Set_Protected_Operation): Removed.
	(Protection_Object, Set_Protection_Object): New subprogram.
	(Write_Field17_Name): Remove case for Object_Ref.
	(Write_Field20_Name): Add case for Prival_Link.
	(Write_Field22_Name): Remove case for Protected_Operation,
	Privals_Chain.
	Add case for Protection_Object.
	(Can_Use_Internal_Rep): Make this into a [base type only] attribute,
	so clients
	(Overlays_Constant): New flag
	(Is_Constant_Object): New predicate
	(Is_Standard_Character_Type): New predicate
	(Optimize_Alignment_Space): New flag
	(Optimize_Alignment_Time): New flag
	(Has_Postconditions): New flag
	(Obsolescent_Warrning): Field removed
	(Spec_PPC_List): New field
	(Relative_Deadline_Variable, Set_Relative_Deadline_Variable): Add
	subprograms to get and set the relative deadline associated to a task.

	* exp_attr.adb (May_Be_External_Call): Account for the case where the
	Access attribute is part of a named parameter association.
	(Expand_Access_To_Protected_Op): Test for the attribute occurring
	within an init proc and use that directly as the scope rather than
	traversing up to the protected operation's enclosing scope. Only apply
	assertion on Is_Open_Scopes in the case the scope traversal is done.
	For the init proc case use the address of the first formal (_init) as
	the protected object reference.
	Implement Invalid_Value attribute
	(Expand_N_Attribute_Reference): Case Attribute_Unrestricted_Access.
	contents of the dispatch table there is no need to duplicate the
	itypes associated with record types (i.e. the implicit full view
	of private types).
	Implement Enum_Val attribute
	(Expand_N_Attribute_Reference, case Old): Properly handle appearence
	within _Postconditions procedure
	(Expand_N_Attribute_Reference, case Result): Implement new attribute

	* exp_ch5.adb (Expand_N_Simple_Return_Statement): Handle case in which
	a return statement calls a function that is not available in
	configurable runtime.
	(Analyze_If_Statement): don't optimize simple True/False cases in -O0
	(Expand_Non_Function_Return): Generate call to _Postconditions proc
	(Expand_Simple_Function_Return): Ditto

	* frontend.adb: Add call to Sem_Aux.Initialize

	* sem_aux.ads, sem_aux.adb: New file.

	* par-prag.adb: Add entries for pragmas Precondition/Postcondition
	Add new Pragma_Relative_Deadline.
	Add support for pragmas Check and Check_Policy

	* sem_attr.ads, sem_attr.adb (Check_Not_CPP_Type): New subprogram.
	(Check_Stream_Attribute): Add missing check (not allowed in CPP types)
	(Analyze_Attribute): In case of attributes 'Alignment and 'size add
	missing check because they are not allowed in CPP tagged types.
	Add Sure parameter to Note_Possible_Modification calls
	Add implementation of Invalid_Value attribute
	Implement new attribute Has_Tagged_Values
	Implement Enum_Val attribute
	(Analyze_Attribute, case Range): Set Name_Req True for prefix of
	generated attributes.
	(Analyze_Attribute, case Result): If prefix of the attribute is
	overloaded, it always resolves to the enclosing function.
	(Analyze_Attribute, case Result): Properly deal with analysis when
	Postconditions are not active.
	(Resolve_Attribute, case Result): Properly deal with appearence during
	preanalysis in spec.
	Add processing for attribute Result

	* sem_ch6.ads, sem_ch6.adb (Check_Overriding_Indicator): Code cleanup
	for operators.
	(Analyze_Subprogram_Body): Install private_with_clauses when the body
	acts as a spec.
	(Check_Inline_Pragma): recognize an inline pragma that appears within
	the subprogram body to which it applies.
	(Analyze_Function_Return): Check that type of the expression of a return
	statement in a function with a class-wide result is not declared at a
	deeper level than the function.
	(Process_PPCs): Deal with enabling/disabling, using PPC_Enabled flag
	(Verify_Overriding_Indicator): Handle properly subprogram bodies for
	user- defined operators.
	(Install_Formals): Moved to spec to allow use from Sem_Prag for
	analysis of precondition/postcondition pragmas.
	(Analyze_Subprogram_Body.Last_Real_Spec_Entity): New name for
	Last_Formal, along with lots of comments on what this is about
	(Analyze_Subprogram_Body): Fix case where we move entities from the
	spec to the body when there are no body entities (now possible with
	precondition and postcondition pragmas).
	(Process_PPCs): New procedure
	(Analyze_Subprogram_Body): Add call to Process_PPCs

	* sem_ch8.adb (Use_One_Type): refine warning on a redundant use_type
	clause.
	(Pop_Scope): Restore Check_Policy_List on scope exit
	(Push_Scope): Save Check_Policy_List on scope entry
	Change name In_Default_Expression      => In_Spec_Expression
	Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression
	Change name Pre_Analyze_And_Resolve    => Preanalyze_And_Resolve
	(Analyze_Object_Renaming): Allow 'Reference as object
	(Analyze_Pragma, case Restriction_Warnings): Call GNAT_Pragma
	(Process_Restrictions_Or_Restriction_Warnings): Check for bad spelling
	of restriction identifier.
	Add Sure parameter to Note_Possible_Modication calls

	* sem_prag.ads, sem_prag.adb (Analyze_Pragma, case Stream_Convert):
	Don't check for primitive operations when calling Rep_Item_Too_Late.
	(Process_Import_Or_Interface): Do not place flag on formal
	subprograms.
	(Analyze_Pragma, case Export): If the entity is a deferred constant,
	propagate information to full view, which is the one elaborated by the
	back-end.
	(Make_Inline): the pragma is effective if it applies to an internally
	generated subprogram declaration for a body that carries the pragma.
	(Analyze_Pragma, case Optimize_Alignment): Set new flag
	Optimize_Alignment_Local.
	(Analyze_PPC_In_Decl_Part): New procedure
	(Get_Pragma_Arg): Moved to outer level
	(Check_Precondition_Postcondition): Change to allow new visibility
	rules for package spec
	(Analyze_Pragma, case Check_Policy): Change placement rules to be
	same as pragma Suppress/Unsuppress.
	Change name In_Default_Expression      => In_Spec_Expression
	Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression
	Change name Pre_Analyze_And_Resolve    => Preanalyze_And_Resolve
	(Check_Precondition_Postcondition): Do proper visibility preanalysis
	for the case of these pragmas appearing in the spec.
	(Check_Enabled): New function
	(Initialize): New procedure
	(Tree_Read): New procedure
	(Tree_Write): New procedure
	(Check_Precondition_Postcondition): New procedure
	Implement pragmas Check and Check_Policy
	Merge Assert processing with Check

	* sem_warn.adb (Warn_On_Known_Condition): Handle pragma Check
	New warning flag -gnatw.e

	* sinfo.ads, sinfo.adb (Has_Relative_Deadline_Pragma): New function
	returning whether a task (or main procedure) has a pragma
	Relative_Deadline.
	(Set_Has_Relative_Deadline_Pragma): Procedure to indicate that a task
	(or main procedure) has a pragma Relative_Deadline.
	Add Next_Pragma field to N_Pragma node
	(PPC_Enabled): New flag
	(Next_Pragma): Now used for Pre/Postcondition processing

	* snames.h, snames.ads, snames.adb: New standard name
	Inherit_Source_Path
	Add entry for 'Invalid_Value attribute
	Add entry for new attribute Has_Tagged_Values
	Add entry for Enum_Val attribute
	Add new standard names Aggregate, Configuration and Library.
	Add _Postconditions
	Add _Result
	Add Pragma_Precondition
	Add Pragma_Postcondition
	Add Attribute_Result
	New standard name Archive_Builder_Append_Option
	(Preset_Names): Add _relative_deadline and relative_deadline definitions
	There was also a missing non_preemptive_within_priorities.
	(Get_Pragma_Id, Is_Pragma_Name): Add support for pragma
	Relative_Deadline.
	Add support for pragmas Check and Check_Policy

	* tree_gen.adb: Call Sem_Aux.Tree_Write

	* tree_in.adb: Call Sem_Aux.Tree_Read

	* exp_ch11.adb (Expand_N_Raise_Statement): New Build_Location calling
	sequence

	* exp_intr.adb (Expand_Source_Info): New Build_Location calling
	sequence

	* exp_prag.adb (Expand_Pragma_Relative_Deadline): New procedure.
	(Expand_N_Pragma): Call the appropriate procedure for expanding pragma
	Relative_Deadline.
	(Expand_Pragma_Check): New procedure

	* sinput.ads, sinput.adb (Build_Location_String): Now appends to name
	buffer.

	* sinfo.adb (PPC_Enabled): New flag

From-SVN: r134010
2008-04-08 08:45:25 +02:00
Arnaud Charlet 1ed69f611a a-cgcaso.adb, [...]: (Swap, Sift): Avoid use of complex renaming.
2008-04-08  Arnaud Charlet  <charlet@adacore.com>
	    Matthew Heaney  <heaney@adacore.com>

	* a-cgcaso.adb, a-convec.adb: (Swap, Sift): Avoid use of complex
	renaming.

	* a-cgaaso.ads, a-secain.ads, a-slcain.ads, a-shcain.ads,  
	a-crdlli.ads, a-coormu.ads, a-ciormu.ads: modified header to conform
	to convention for non-RM specs.
	Add descriptive header, and documented each operation
	document each operation

From-SVN: r134009
2008-04-08 08:44:51 +02:00
Thomas Quinot 43c6e0cb21 g-expect-vms.adb, [...]: Fix incorrect casing of ASCII.NUL throughout.
2008-04-08  Thomas Quinot  <quinot@adacore.com>

	* g-expect-vms.adb, a-textio.adb, a-witeio.adb, exp_dbug.adb,
	g-expect.adb, g-locfil.adb, gnatchop.adb, gnatdll.adb, gnatlbr.adb,
	gnatmem.adb, g-regist.adb, i-vxwork.ads, mlib-utl.adb, i-vxwork-x86.ads,
	a-ztexio.adb, g-enblsp-vms-alpha.adb, g-enblsp-vms-ia64.adb,
	s-os_lib.adb, s-regpat.adb, s-regpat.ads: Fix incorrect casing of
	ASCII.NUL throughout.

From-SVN: r134008
2008-04-08 08:44:39 +02:00
Vincent Celier 9df6385a0c mlib-tgt-aix.adb, [...]: Renamed into...
2008-04-08  Vincent Celier  <celier@adacore.com>
	    Arnaud Charlet  <charlet@adacore.com>

	* mlib-tgt-aix.adb, mlib-tgt-darwin.adb, mlib-tgt-hpux.adb,
	mlib-tgt-irix.adb, mlib-tgt-linux.adb, mlib-tgt-lynxos.adb,
	mlib-tgt-solaris.adb, mlib-tgt-tru64.adb, mlib-tgt-vms.adb,
	mlib-tgt-vms.ads, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb,
	mlib-tgt-vxworks.adb, mlib-tgt-mingw.adb: Renamed into...

	* mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
	mlib-tgt-specific-hpux.adb, mlib-tgt-specific-irix.adb,
	mlib-tgt-specific-linux.adb, mlib-tgt-specific-lynxos.adb,
	mlib-tgt-specific-solaris.adb, mlib-tgt-specific-tru64.adb,
	mlib-tgt-vms_common.adb, mlib-tgt-vms_common.ads,
	mlib-tgt-specific-vms-alpha.adb, mlib-tgt-specific-vms-ia64.adb,
	mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb,
	mlib-tgt-specific-mingw.adb: New names.

	* Makefile.in: 
	On VxWorks platforms use s-stchop-limit.ads for s-stchop.ads
	Get rid of gnatbl.
	(EXTRA_GNATRTL_NONTASKING_OBJS): Add s-win32.o
	Files mlib-tgt-*.adb have been renamed mlib-tgt-specific-*.adb
	Minor updates for VMS

From-SVN: r134007
2008-04-08 08:44:24 +02:00
Pascal Obry 3824d9af3e a-exetim-mingw.adb, [...]: Use new s-win32.ads unit instead of declaration from s-osinte-mingw.ads.
2008-04-08  Pascal Obry  <obry@adacore.com>

	* a-exetim-mingw.adb, s-gloloc-mingw.adb, s-taprop-mingw.adb,
	s-tasinf-mingw.ad{s,b}, s-taspri-mingw.ads:
	Use new s-win32.ads unit instead of declaration
	from s-osinte-mingw.ads.
	
	* s-osinte-mingw.ads:
	Move all non tasking based interface to s-win32.ads.
	
	* s-osprim-mingw.adb:
	Remove duplicated declarations and use s-win32.ads
	unit instead.

From-SVN: r134006
2008-04-08 08:44:11 +02:00
Arnaud Charlet c4394c1546 s-osinte-vxworks6.ads: Removed, merged with s-osinte-vxworks.ads/.adb
* s-osinte-vxworks6.ads: Removed, merged with s-osinte-vxworks.ads/.adb
	* s-vxwext.ads, s-vxwext-kernel.ads, s-vxwext-rtp.ads,
	s-vxwext-rtp.adb: New files.

	* s-taprop-vxworks.adb, s-osinte-vxworks.ads, s-osinte-vxworks.adb: 
	Minor updates to accomodate changes above.

From-SVN: r134005
2008-04-08 08:43:49 +02:00
Eric Botcazou 770db697e6 s-osinte-linux-alpha.ads, [...]: Removed.
2008-04-08  Eric Botcazou  <ebotcazou@adacore.com>
	    Arnaud Charlet  <charlet@adacore.com>

	* s-osinte-linux-alpha.ads, s-osinte-linux-hppa.ads: Removed.

	s-taspri-posix-noaltstack.ads, s-linux.ads, s-linux-alpha.ads,
	s-linux-hppa.ads: New files. Disable alternate stack on ia64-hpux.

	* s-osinte-lynxos-3.ads,
	(Alternate_Stack): Remove when not needed. Simplify declaration
	otherwise.
	(Alternate_Stack_Size): New constant.

	s-osinte-mingw.ads, s-taprop-mingw.adb: Code clean up: avoid use of
	'Unrestricted_Access.

	* s-osinte-hpux.ads, s-osinte-solaris-posix.ads, s-osinte-aix.ads,
	s-osinte-lynxos.ads, s-osinte-freebsd.ads s-osinte-darwin.ads,
	s-osinte-tru64.ads, s-osinte-irix.ads, s-osinte-linux.ads,
	s-osinte-solaris.ads, s-osinte-vms.ads
	(SA_ONSTACK): New constant.
	(stack_t): New record type.
	(sigaltstack): New imported function.
	(Alternate_Stack): New imported variable.
	(Alternate_Stack_Size): New constant.

	* system-linux-x86_64.ads: (Stack_Check_Probes): Set to True.

	* s-taspri-lynxos.ads, s-taspri-solaris.ads, s-taspri-tru64.ads,
	s-taspri-hpux-dce.ads (Task_Address): New subtype of System.Address
	(Task_Address_Size): New constant size of System.Address
	(Alternate_Stack_Size): New constant.

	* s-taprop-posix.adb, s-taprop-linux.adb (Get_Stack_Attributes): Delete.
	(Enter_Task): Do not notify stack to System.Stack_Checking.Operations.
	Establish the alternate stack if the platform makes use of n alternate
	signal stack for stack overflows.
	(Create_Task): Take into account the alternate stack in the stack size.
	(Initialize): Save the address of the alternate stack into the ATCB for
	the environment task.
	(Create_Task): Fix assertions for NPTL library (vs old LinuxThreads).

	* s-parame.adb (Minimum_Stack_Size): Increase value to 16K to

	* system-linux-x86.ads: (Stack_Check_Probes): Set to True.

	* s-intman-posix.adb: 
	(Initialize): Set SA_ONSTACK for SIGSEGV if the platform makes use of an
	alternate signal stack for stack overflows.

	* init.c (__gnat_adjust_context_for_raise, Linux version): On i386 and
	x86-64, adjust the saved value of the stack pointer if the signal was
	raised by a stack checking probe.
	(HP-UX section): Use global __gnat_alternate_stack as signal handler
	stack and only for SIGSEGV.
	(Linux section): Likewise on x86 and x86-64.
	[VxWorks section]
	(__gnat_map_signal): Now static.
	(__gnat_error_handler): Not static any more.
	(__gnat_adjust_context_for_raise): New function. Signal context
	adjustment for PPC && !VTHREADS && !RTP, as required by the zcx
	propagation circuitry.
	(__gnat_error_handler): Second argument of a sigaction handler is a
	pointer, not an int, and is unused.
	Adjust signal context before mapping to exception.
	Install signal handlers for LynxOS case.

	* s-taskin.ads (Common_ATCB): New field Task_Alternate_Stack.
	(Task_Id): Set size to Task_Address_Size
	(To_Task_id): Unchecked convert from Task_Address vice System.Address
	(To_Address): Unchecked convert to Task_Address vice System.Address

	* s-tassta.adb (Task_Wrapper): Define the alternate stack and save its
	address into the ATCB if the platform makes use of an alternate signal
	stack for stack overflows.
	(Free_Task): Add call to Finalize_Attributes_Link.
	Add argument Relative_Deadline to pass the value specified for
	the task. This is not yet used for any target.

	* s-tassta.ads (Create_Task): Add argument Relative_Deadline to pass
	the value specified for the task.

From-SVN: r134004
2008-04-08 08:43:15 +02:00
Pascal Obry 42c3898c1d g-sercom.ads, [...] (Data_Rate): Add B115200.
2008-04-08  Pascal Obry  <obry@adacore.com>

	* g-sercom.ads, g-sercom.adb (Data_Rate): Add B115200.
	(Stop_Bits_Number): New type.
	(Parity_Check): Likewise.
	(Set): Add parameter to set the number of stop bits and
	the parity. Parameter timeout is now a duration instead
	of a plain integer.

	* g-sercom-linux.adb:
	Implement the stop bits and parity support for GNU/Linux.
	Fix handling of timeout, it must be given in tenth of seconds.
	
	* g-sercom-mingw.adb:
	Implement the stop bits and parity support for Windows.
	Use new s-win32.ads unit instead of declaring Win32 services
	directly into this body.
	Update handling of timeout as now a duration.

	* s-win32.ads, s-winext.ads: New files.

From-SVN: r134003
2008-04-08 08:42:41 +02:00
James E Wilson e68c63e380 Fix uninit warning reported by Andrew Pinski.
pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.

From-SVN: r134001
2008-04-07 18:57:48 -07:00
GCC Administrator 48b350ad55 Daily bump.
From-SVN: r133998
2008-04-08 00:17:30 +00:00
Jan Hubicka 3e02976304 function.h (rtl): Rename to x_rtl.
* function.h (rtl): Rename to x_rtl.
	(crtl): New define.
	(return_label, naked_return_label, stack_slot_list, parm_birth_insn,
	frame_offset, stack_check_probe_note, arg_pointer_save_area,
	used_temp_slots avail_temp_slots, temp_slot_level,
	nonlocal_goto_handler_labels): Update accesstors.
	(rtl): New global variable.
	(struct function): Move some fileds to rtl_data.
	(get_arg_pointer_save_area): Update prototype.
	* builtins.c (expand_builtin_setjmp_receiver): Update call of
	get_arg_pointer_save_area.
	* expr.c (init_expr): Update
	* function.c (get_frame_size): Update
	(assign_stack_local): Update
	(expand_function_end): Update.
	(get_art_pointer_save_area): Update
	* function.h 
	* emit-rtl.c (rtl): Declare.
	(regno_reg_rtx): Declare.
	(first_insn, last_insn, cur_insn_uid, last_location, first_label_num):
	Update.
	(gen_reg_rtx): Update.
	* varasm.c (n_deferred_constatns): Update accestor.
	(init_varasm_status): Do not allocate varasm_status.
	(force_const_mem, get_pool_size, output_constant_pool): Update.
	* stmt.c (force_label_rtx): Do not use x_ prefixes.
	(expand_nl_goto_receiver): Update get_arg_pointer_save_area.
	* m32c/m32.c (m32c_leaf_function_p, m32c_function_needs_enter): Update.
	* sparc/sparc.h (INIT_EXPANDERS): Update.
	* ia64/ia64.h (INIT_EXPANDERS): Update.

From-SVN: r133994
2008-04-07 23:52:32 +00:00
Andy Hutchinson 47583040f7 PR target/34210 PR target/35508 * config.host (avr-*-*): Add avr cpu_type and avr tmake_file. * config/t-avr: New file. Build 16bit libgcc functions.
From-SVN: r133993
2008-04-07 23:15:35 +00:00
Ian Lance Taylor 06407e30fd Makefile.def: check-gold depends upon all-binutils.
* Makefile.def: check-gold depends upon all-binutils.
	* Makefile.in: Regenerate.

From-SVN: r133992
2008-04-07 22:36:37 +00:00
Jerry DeLisle 7286c37699 PR fortran/25829 28655
2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/25829 28655
	* gfortran.dg/write_check2.f90: Update dg-error.
	* gfortran.dg/io_constraints_1.f90: Udate dg-error.

From-SVN: r133991
2008-04-07 22:10:41 +00:00
James E Wilson c3be259842 Fix bug Joern Rennecke reported.
* reload.c (push_secondary_reload): Add missing break to for loop.

From-SVN: r133990
2008-04-07 15:09:07 -07:00
Jerry DeLisle d06b3496f6 PR fortran/25829 28655
2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/25829 28655
	* io.c (io_tag): Add new tags for decimal, encoding, asynchronous,
	round, sign, and id. (match_open_element): Match new tags.
	(gfc_resolve_open): Resolve new tags. (gfc_match_open): Enable encoding
	for DEFAULT only. Update error messages. (match_dt_element): Fix match
	tag for asynchronous. Update error messages. (gfc_free_inquire): Free
	new expressions. (match_inquire_element): Match new tags.
	(gfc_match_inquire): Add constraint for ID and PENDING.
	(gfc_resolve_inquire): Resolve new tags.
	* trans-io.c (gfc_trans_inquire): Clean up whitespace and fix setting of
	mask for ID parameter.
	* ioparm.def: Fix order of parameters for pending, round, and sign.
	NOTE: These must line up with the definitions in libgfortran/io/io.h. or
	things don't work.

From-SVN: r133989
2008-04-07 22:07:44 +00:00
Jerry DeLisle 931149a6b7 PR fortran/25829 28655
2008-04-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/25829 28655
	* io/open.c (edit_modes): Set flags.async. (new_unit) Set flags.async
	and flags.status. (st_open): Initialize flags.async.
	* io/list_read.c (read_charactor): Use delim_status instead of
	flags.delim.
	* io/read.c (read_x): Use pad_status instead of flags.pad.
	* io/inquire.c (inquire_via_unit): Add new checks.
	(inquire_via_filename): Likewise.
	* io/io.h (st_parameter_inquire): Add new flags.
	(st_parameter_dt): Likewise.
	* io/unit.c (get_internal_unit): Set flags.async. (init_units): Set
	flags.async.
	* io/transfer.c: Add delim and pad option arrays. (read_sf): Use
	pad_status instead of flags.pad. (read_block): Likewise.
	(data_transfer_init): Set flags.async and add checks.
	* io/write.c (write_character): Use delim_status.
	(list_formatted_write_scalar): Likewise. (nml_write_obj): Likewise.
	(namelist_write): Likewise.

From-SVN: r133988
2008-04-07 22:05:52 +00:00
Jason Merrill c2b58ba219 re PR c++/35734 (ICE with copy constructor in derived class)
PR c++/35734
        * class.c (type_has_user_nondefault_constructor): A template
        counts as a nondefault constructor.

From-SVN: r133987
2008-04-07 16:50:21 -04:00
Aurelien Jarno d8ec5bf231 Makefile.in: Add make ifeq define for mips/mipsel support.
2008-04-07  Aurelien Jarno  <aurelien@aurel32.net>
            Xavier Grave  <grave@ipno.in2p3.fr>

        * Makefile.in: Add make ifeq define for mips/mipsel support.
        * g-soccon-linux-mips.ads, system-linux-mipsel.ads, 
        system-linux-mips.ads: New files.

Co-Authored-By: Xavier Grave <grave@ipno.in2p3.fr>

From-SVN: r133986
2008-04-07 20:08:33 +00:00
Peter Bergner 46b71b0354 PR middle-end/PR28690
PR middle-end/PR28690
	* rtlanal.c: Update copyright years.
	(commutative_operand_precedence): Give SYMBOL_REF's the same precedence
	as REG_POINTER and MEM_POINTER operands.
	* emit-rtl.c (gen_reg_rtx_and_attrs): New function.
	(set_reg_attrs_from_value): Call mark_reg_pointer as appropriate.
	* rtl.h (gen_reg_rtx_and_attrs): Add prototype for new function.
	* gcse.c: Update copyright years.
	(pre_delete): Call gen_reg_rtx_and_attrs.
	(hoist_code): Likewise.
	(build_store_vectors): Likewise.
	(delete_store): Likewise.
	* loop-invariant.c (move_invariant_reg): Likewise.
	Update copyright years.

From-SVN: r133985
2008-04-07 12:36:59 -05:00
Uros Bizjak 64ef8953e3 i386.md ("*sse_prologue_save_insn"): Use braced output control string instead of quoted.
* config/i386/i386.md ("*sse_prologue_save_insn"): Use braced output
        control string instead of quoted.

From-SVN: r133984
2008-04-07 18:54:00 +02:00
Kenneth Zadeck 84159bd8fc 2008-04-07 Kenneth Zadeck <zadeck@naturalbridge.com>
doc/rtl.texi: Rewrite of subreg section.

From-SVN: r133982
2008-04-07 15:40:43 +00:00
Kai Tietz 8502420b67 i386.c (legitimize_pic_address): Add treating of dllimport SYM_REF's.
2008-04-07  Kai Tietz  <kai.tietz@onevision.com>

        PR/35842
        * config/i386/i386.c (legitimize_pic_address): Add treating
        of dllimport SYM_REF's.
        (legitimize_dllimport_symbol): Add prototype.

From-SVN: r133981
2008-04-07 14:44:14 +02:00
Kai Tietz cd035e343a pr35842.c: New.
PR/35842
	* gcc.dg/torture/pr35842.c: New.

From-SVN: r133980
2008-04-07 14:40:43 +02:00
Aurelien Jarno 7437c8d449 sysdep.c: add __GLIBC__ to the #ifdef preprocessor macros to detect systems using GNU libc.
2008-04-07  Aurelien Jarno  <aurelien@aurel32.net>

        * sysdep.c: add __GLIBC__ to the #ifdef preprocessor macros to
        detect systems using GNU libc.
        * gsocket.h: ditto.
        * socket.c: ditto.
        * adaint.c: ditto.
        * link.c: ditto.

From-SVN: r133979
2008-04-07 12:31:41 +00:00
Aurelien Jarno 1dab7b355e s-osinte-linux-kfreebsd.ads (SC_NPROCESSORS_ONLN): New constant constant for sysconf call.
2008-04-07  Aurelien Jarno  <aurelien@aurel32.net>

        * s-osinte-linux-kfreebsd.ads (SC_NPROCESSORS_ONLN): New
        constant constant for sysconf call.
        (bit_field): New packed boolean type used by cpu_set_t.
        (cpu_set_t): New type corresponding to the C type with
        the same name. Note that on the Ada side we use a bit
        field array for the affinity mask. There is not need
        for the C macro for setting individual bit.
        (pthread_setaffinity_np): New imported routine.
        * Makefile.in: Use s-tasinf-linux.ads and s-tasinf-linux.adb
        on GNU/kFreeBSD.

From-SVN: r133978
2008-04-07 12:30:03 +00:00
Eric Botcazou 39fcde8ff2 fold-const.c (fold): New case.
* fold-const.c (fold) <ARRAY_REF>: New case.  Try to fold constant
	reference in constructor with non self-referential type.

ada/
	* utils2.c (build_binary_op): Fold ARRAY_REF and ARRAY_RANGE_REF too.

From-SVN: r133977
2008-04-07 09:47:43 +00:00
Eric Botcazou 9dd9bf80a8 Removal of Return with Depressed Stack Pointer support
Removal of Return with Depressed Stack Pointer support
	* tree.h (TYPE_RETURNS_STACK_DEPRESSED): Delete.
	(ECF_SP_DEPRESSED): Likewise.
	(ECF_LIBCALL_BLOCK, ECF_NOVOPS): Adjust.
	* calls.c (emit_call_1): Do not test ECF_SP_DEPRESSED.
	(flags_from_decl_or_type): Do not test TYPE_RETURNS_STACK_DEPRESSED.
	(expand_call): Do not test ECF_SP_DEPRESSED.
	* dse.c (dse_step0): Do not test TYPE_RETURNS_STACK_DEPRESSED.
	* function.c (keep_stack_depressed): Delete.
	(handle_epilogue_set): Likewise.
	(update_epilogue_consts): Likewise.
	(emit_equiv_load): Likewise.
	(thread_prologue_and_epilogue_insns): Remove support for Return with
	Depressed Stack Pointer.
	* print-tree.c (print_node): Do not test TYPE_RETURNS_STACK_DEPRESSED.

ada/
	* gigi.h (create_subprog_type): Remove returns_with_dsp parameter.
	* decl.c (gnat_to_gnu_entity): Adjust for above new prototype.
	* utils.c (create_subprog_type): Remove returns_with_dsp parameter.
	* trans.c (gnat_to_gnu) <N_Return_Statement>: Remove code dealing with
	Return by Depressed Stack Pointer.

From-SVN: r133976
2008-04-07 09:37:51 +00:00
Johannes Singler f9985df51b re PR libstdc++/35588 ([parallel mode] parallel std::sort and bind())
2008-04-07  Johannes Singler  <singler@ira.uka.de>

         * include/parallel/multiway_merge.h:
           Moved decisions to compiletime instead of runtime.
         * include/parallel/losertree.h:
           Removed obsolete variants, added variant that uses pointers
           in the loser tree.
         * include/parallel/types.h:
           Remove obsolete settings options from enum.
         * include/parallel/features.h:
           Remove obsolete compile-time switches.
         * include/parallel/compiletime_settings.h:
           Remove obsolete variant that copies back *after* sorting.
         * include/parallel/tags.h:
           Add one new tag for compile-time switch.
         * include/parallel/merge.h:
           Adapt to changes in multiway_merge.h.
         * include/parallel/multiway_mergesort.h:
           Adapt to changes in multiway_merge.h.
           Factor out splitting variants.
           Remove obsolete variant that copies back *after* sorting.
         * include/parallel/sort.h:
           Adapt to changes in multiway_mergesort.h.
         * testsuite/25_algorithms/sort/35588.cc:
           Added test case from / for PR 35588.

From-SVN: r133975
2008-04-07 08:27:34 +00:00
GCC Administrator 1d4cd3d0b5 Daily bump.
From-SVN: r133972
2008-04-07 00:17:32 +00:00
Richard Guenther 3633df5a3d re PR middle-end/35400 (-Wtype-limits -O2 causes ICE tree check: expected ssa_name, have addr_expr in get_value_range, at tree-vrp.c:469)
2008-04-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/35400
	* tree-vrp.c (vrp_evaluate_conditional): Only query value-range
	information from SSA_NAMEs.

	* gcc.dg/torture/pr35400.c: New testcase.
	* g++.dg/torture/pr35400.C: Likewise.

From-SVN: r133967
2008-04-06 21:20:49 +00:00
Anatoly Sokolov 5dc7780891 avr.h (avr_mega_p): Remove declaration.
* config/avr/avr.h (avr_mega_p): Remove declaration.
	(AVR_MEGA): Remove macro.
	* config/avr/avr.c (avr_mega_p): Remove variable.
	(avr_override_options): Remove inicializion of avr_mega_p.
	Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
	(print_operand): Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
	(avr_jump_mode): (Ditto.).
	(avr_output_progmem_section_asm_op): (Ditto.).
	(avr_asm_init_sections): (Ditto.).
	(avr_asm_init_sections): (Ditto.).
	(avr_rtx_costs): (Ditto.).
	* config/avr/avr.md: (Ditto.).
	* config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of 
	'__AVR_MEGA__'.

From-SVN: r133966
2008-04-07 00:54:32 +04:00
Paul Thomas 679d963737 Index...
Index: gcc/fortran/trans-stmt.c
===================================================================
*** gcc/fortran/trans-stmt.c	(revision 133728)
--- gcc/fortran/trans-stmt.c	(working copy)
*************** gfc_trans_where_2 (gfc_code * code, tree
*** 3540,3547 ****
  
  /* Translate a simple WHERE construct or statement without dependencies.
     CBLOCK is the "then" clause of the WHERE statement, where CBLOCK->EXPR
!    is the mask condition, and EBLOCK if non-NULL is the "else" clause.
!    Currently both CBLOCK and EBLOCK are restricted to single assignments.  */
  
  static tree
  gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
--- 3540,3550 ----
  
  /* Translate a simple WHERE construct or statement without dependencies.
     CBLOCK is the "then" clause of the WHERE statement, where CBLOCK->EXPR
!    is the mask condition, and EBLOCK if non-NULL is the "then" clause of
!    the ELSWHERE.  As required by 7.5.3.2, the WHERE and ELSEWHERE are
!    executed with separate loops. It should be noted that the mask expression
!    is evaluated for both loops.  Currently both CBLOCK and EBLOCK are
!    restricted to single assignments.  */
  
  static tree
  gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
*************** gfc_trans_where_3 (gfc_code * cblock, gf
*** 3561,3566 ****
--- 3564,3570 ----
    edst = eblock ? eblock->next->expr : NULL;
    esrc = eblock ? eblock->next->expr2 : NULL;
  
+   /*---------------First do the WHERE part.----------------*/
    gfc_start_block (&block);
    gfc_init_loopinfo (&loop);
  
*************** gfc_trans_where_3 (gfc_code * cblock, gf
*** 3584,3619 ****
    gfc_add_ss_to_loop (&loop, tdss);
    gfc_add_ss_to_loop (&loop, tsss);
  
-   if (eblock)
-     {
-       /* Handle the else clause.  */
-       gfc_init_se (&edse, NULL);
-       gfc_init_se (&esse, NULL);
-       edss = gfc_walk_expr (edst);
-       esss = gfc_walk_expr (esrc);
-       if (esss == gfc_ss_terminator)
- 	{
- 	  esss = gfc_get_ss ();
- 	  esss->next = gfc_ss_terminator;
- 	  esss->type = GFC_SS_SCALAR;
- 	  esss->expr = esrc;
- 	}
-       gfc_add_ss_to_loop (&loop, edss);
-       gfc_add_ss_to_loop (&loop, esss);
-     }
- 
    gfc_conv_ss_startstride (&loop);
    gfc_conv_loop_setup (&loop);
  
    gfc_mark_ss_chain_used (css, 1);
    gfc_mark_ss_chain_used (tdss, 1);
    gfc_mark_ss_chain_used (tsss, 1);
!   if (eblock)
!     {
!       gfc_mark_ss_chain_used (edss, 1);
!       gfc_mark_ss_chain_used (esss, 1);
!     }
! 
    gfc_start_scalarized_body (&loop, &body);
  
    gfc_copy_loopinfo_to_se (&cse, &loop);
--- 3588,3600 ----
    gfc_add_ss_to_loop (&loop, tdss);
    gfc_add_ss_to_loop (&loop, tsss);
  
    gfc_conv_ss_startstride (&loop);
    gfc_conv_loop_setup (&loop);
  
    gfc_mark_ss_chain_used (css, 1);
    gfc_mark_ss_chain_used (tdss, 1);
    gfc_mark_ss_chain_used (tsss, 1);
!  
    gfc_start_scalarized_body (&loop, &body);
  
    gfc_copy_loopinfo_to_se (&cse, &loop);
*************** gfc_trans_where_3 (gfc_code * cblock, gf
*** 3622,3637 ****
    cse.ss = css;
    tdse.ss = tdss;
    tsse.ss = tsss;
-   if (eblock)
-     {
-       gfc_copy_loopinfo_to_se (&edse, &loop);
-       gfc_copy_loopinfo_to_se (&esse, &loop);
-       edse.ss = edss;
-       esse.ss = esss;
-     }
  
    gfc_conv_expr (&cse, cond);
!   gfc_add_block_to_block (&body, &cse.pre);
    cexpr = cse.expr;
  
    gfc_conv_expr (&tsse, tsrc);
--- 3603,3611 ----
    cse.ss = css;
    tdse.ss = tdss;
    tsse.ss = tsss;
  
    gfc_conv_expr (&cse, cond);
!   gfc_add_block_to_block (&block, &cse.pre);
    cexpr = cse.expr;
  
    gfc_conv_expr (&tsse, tsrc);
*************** gfc_trans_where_3 (gfc_code * cblock, gf
*** 3643,3650 ****
--- 3617,3678 ----
    else
      gfc_conv_expr (&tdse, tdst);
  
+   /* Make the assignment on condition 'cond'.  */
+   tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false);  
+   tmp = build3_v (COND_EXPR, cexpr, tstmt, build_empty_stmt ());
+   gfc_add_expr_to_block (&body, tmp);
+   gfc_add_block_to_block (&body, &cse.post);
+ 
+   gfc_trans_scalarizing_loops (&loop, &body);
+   gfc_add_block_to_block (&block, &loop.pre);
+   gfc_add_block_to_block (&block, &loop.post);
+   gfc_cleanup_loop (&loop);
+ 
+ /*---------------Now do the ELSEWHERE.--------------*/
    if (eblock)
      {
+       gfc_init_loopinfo (&loop);
+  
+       /* Handle the condition.  */
+       gfc_init_se (&cse, NULL);
+       css = gfc_walk_expr (cond);
+       gfc_add_ss_to_loop (&loop, css);
+ 
+       /* Handle the then-clause.  */
+       gfc_init_se (&edse, NULL);
+       gfc_init_se (&esse, NULL);
+       edss = gfc_walk_expr (edst);
+       esss = gfc_walk_expr (esrc);
+       if (esss == gfc_ss_terminator)
+ 	{
+ 	  esss = gfc_get_ss ();
+ 	  esss->next = gfc_ss_terminator;
+ 	  esss->type = GFC_SS_SCALAR;
+ 	  esss->expr = esrc;
+ 	}
+       gfc_add_ss_to_loop (&loop, edss);
+       gfc_add_ss_to_loop (&loop, esss);
+ 
+       gfc_conv_ss_startstride (&loop);
+       gfc_conv_loop_setup (&loop);
+ 
+       gfc_mark_ss_chain_used (css, 1);
+       gfc_mark_ss_chain_used (edss, 1);
+       gfc_mark_ss_chain_used (esss, 1);
+ 
+       gfc_start_scalarized_body (&loop, &body);
+ 
+       gfc_copy_loopinfo_to_se (&cse, &loop);
+       gfc_copy_loopinfo_to_se (&edse, &loop);
+       gfc_copy_loopinfo_to_se (&esse, &loop);
+       cse.ss = css;
+       edse.ss = edss;
+       esse.ss = esss;
+ 
+       gfc_conv_expr (&cse, cond);
+       gfc_add_block_to_block (&body, &cse.pre);
+       cexpr = cse.expr;
+ 
        gfc_conv_expr (&esse, esrc);
        if (edss != gfc_ss_terminator && loop.temp_ss != NULL)
          {
*************** gfc_trans_where_3 (gfc_code * cblock, gf
*** 3653,3672 ****
          }
        else
          gfc_conv_expr (&edse, edst);
      }
  
-   tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false);
-   estmt = eblock ? gfc_trans_scalar_assign (&edse, &esse, edst->ts, false, false)
- 		 : build_empty_stmt ();
-   tmp = build3_v (COND_EXPR, cexpr, tstmt, estmt);
-   gfc_add_expr_to_block (&body, tmp);
-   gfc_add_block_to_block (&body, &cse.post);
- 
-   gfc_trans_scalarizing_loops (&loop, &body);
-   gfc_add_block_to_block (&block, &loop.pre);
-   gfc_add_block_to_block (&block, &loop.post);
-   gfc_cleanup_loop (&loop);
- 
    return gfc_finish_block (&block);
  }
  
--- 3681,3700 ----
          }
        else
          gfc_conv_expr (&edse, edst);
+  
+       /* Make the assignment on condition 'NOT.cond'.  */
+       estmt = gfc_trans_scalar_assign (&edse, &esse, edst->ts, false, false);
+       cexpr = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, cexpr);
+       tmp = build3_v (COND_EXPR, cexpr, estmt, build_empty_stmt ());
+       gfc_add_expr_to_block (&body, tmp);
+       gfc_add_block_to_block (&body, &cse.post);
+ 
+       gfc_trans_scalarizing_loops (&loop, &body);
+       gfc_add_block_to_block (&block, &loop.pre);
+       gfc_add_block_to_block (&block, &loop.post);
+       gfc_cleanup_loop (&loop);
      }
  
    return gfc_finish_block (&block);
  }
  
*************** gfc_trans_where (gfc_code * code)
*** 3698,3708 ****
  					cblock->next->expr2, 0))
  	    return gfc_trans_where_3 (cblock, NULL);
  	}
        else if (!eblock->expr
  	       && !eblock->block
  	       && eblock->next
  	       && eblock->next->op == EXEC_ASSIGN
! 	       && !eblock->next->next)
  	{
            /* A simple "WHERE (cond) x1 = y1 ELSEWHERE x2 = y2 ENDWHERE"
  	     block is dependence free if cond is not dependent on writes
--- 3726,3739 ----
  					cblock->next->expr2, 0))
  	    return gfc_trans_where_3 (cblock, NULL);
  	}
+       /* Since gfc_trans_where_3 evaluates the condition expression
+ 	 twice, do not use it if the condition is not a variable.  */
        else if (!eblock->expr
  	       && !eblock->block
  	       && eblock->next
  	       && eblock->next->op == EXEC_ASSIGN
! 	       && !eblock->next->next
! 	       && cblock->expr->expr_type == EXPR_VARIABLE)
  	{
            /* A simple "WHERE (cond) x1 = y1 ELSEWHERE x2 = y2 ENDWHERE"
  	     block is dependence free if cond is not dependent on writes
Index: gcc/testsuite/gfortran.dg/where_1.f90
===================================================================
*** gcc/testsuite/gfortran.dg/where_1.f90	(revision 0)
--- gcc/testsuite/gfortran.dg/where_1.f90	(revision 0)
***************
*** 0 ****
--- 1,61 ----
+ ! { dg-do run }
+ ! { dg-options "-fdump-tree-original" }
+ ! Tests the fix for PR35759, in which the simple WHERE was logically
+ ! wrong.  7.5.3.2 requires that the WHERE and ELSEWHERE are execute in
+ ! separate loops, whereas gfortran was implementing them as a single
+ ! loop with an 'if' and 'else'.  Since the condition expression is
+ ! evaluated twice with the fix, the use of anything other than a
+ ! variable or parameter array for the condition will trigger the more
+ ! comprehensive implementation of WHERE.  This is checked by the
+ ! check of the declaration of temp.15 in the 'original' code.
+ !
+ ! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+ !
+ program RG0023
+ 
+   integer UDA1L(6)
+   integer ::  UDA1R(6), expected(6) = (/2,0,5,0,3,0/)
+   LOGICAL LDA(5)
+   LOGICAL, parameter :: PDA(5) = (/ (i/2*2 .ne. I, i=1,5) /)
+ 
+   UDA1L(1:6) = 0
+   uda1r = (/1,2,3,4,5,6/)
+   lda = pda
+ 
+   WHERE (lda)                !          expected
+     UDA1L(1:5) = UDA1R(2:6)  !  uda1l = 2,0,4,0,6,0
+   ELSEWHERE
+     UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0
+   ENDWHERE
+ 
+   if (any (uda1l /= expected)) call abort ()
+ 
+   uda1l = 0
+ 
+   WHERE (pda)                !          expected
+     UDA1L(1:5) = UDA1R(2:6)  !  uda1l = 2,0,4,0,6,0
+   ELSEWHERE
+     UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0
+   ENDWHERE
+ 
+   if (any (uda1l /= expected)) call abort ()
+  
+   uda1l = 0
+ 
+   WHERE (lfoo ())            !          expected
+     UDA1L(1:5) = UDA1R(2:6)  !  uda1l = 2,0,4,0,6,0
+   ELSEWHERE
+     UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0
+   ENDWHERE
+ 
+   if (any (uda1l /= expected)) call abort ()
+  
+ contains
+ 
+   function lfoo () result (ltmp)
+     logical ltmp(5)
+     ltmp = lda
+   end function lfoo
+ END
+ ! { dg-final { scan-tree-dump-times "temp.18\\\[5\\\]" 1 "original" } }
+ ! { dg-final { cleanup-tree-dump "original" } }

From-SVN: r133965
2008-04-06 19:37:45 +00:00
Tobias Schlüter 9b8d1901f8 re PR fortran/35832 (Better error message for wrong arguments to I/O statements)
2008-04-06  Tobias Schlter  <tobi@gcc.gnu.org>

PR fortran/35832
fortran/
* io.c (io_tag): Add field 'value'.  Split 'spec' field in
existing io_tags.
(match_etag, match_vtag, match_ltag): Split parsing in two steps
to give better error messages.
testsuite/
* gfortran.dg/io_constraints_2.f90: Adapt to new error message.

From-SVN: r133964
2008-04-06 20:58:34 +02:00
Richard Guenther 8c51effa07 re PR target/35842 (ICE in legitimize_pic_address, at config/i386/i386.c:7666)
2008-04-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/35842
	* tree-ssa-address.c (fixed_address_object_p): Adjust to match
	is_gimple_invariant_address.

From-SVN: r133963
2008-04-06 18:04:47 +00:00
Tobias Burnus fbe88ffa16 io.c (check_io_constraints): Add constrains.
2008-04-06  Tobias Burnus  <burnus@net-b.de>

        * io.c (check_io_constraints): Add constrains. ID= requires
        asynchronous= and asynchronous= must be init expression.

2008-04-06  Tobias Burnus  <burnus@net-b.de>

        * gfortran.dg/f2003_io_1.f03: Make standard conform.
        * gfortran.dg/f2003_io_8.f03: New.

From-SVN: r133962
2008-04-06 17:38:33 +02:00
Eric Botcazou 2d091b12a0 decl.c (is_variable_size): Do not unconditionally return false on non-strict alignment platforms.
* decl.c (is_variable_size): Do not unconditionally return false
	on non-strict alignment platforms.

From-SVN: r133961
2008-04-06 13:38:41 +00:00
Francois-Xavier Coudert 3135ce84cc gcc.c (default_compilers): Sync Fortran extensions list with that in fortran/lang-specs.h.
gcc/
	* gcc.c (default_compilers): Sync Fortran extensions list with
	that in fortran/lang-specs.h.
	* doc/invoke.texi: Likewise.
	* dbxout.c (get_lang_number): Use "GNU Fortran" in "GNU F95".
	* dwarf2out.c (gen_compile_unit_die): Likewise.

gcc/fortran/
	* f95-lang.c: Set LANG_HOOKS_NAME to "GNU Fortran".

From-SVN: r133960
2008-04-06 12:36:58 +00:00
Francois-Xavier Coudert daf5afd48f * parse.c (gfc_parse_file): Use gfc_dump_parse_tree.
From-SVN: r133959
2008-04-06 12:18:56 +00:00
François-Xavier Coudert 6c1abb5c58 dump-parse-tree.c: Use fprintf, fputs and fputc instead of gfc_status and gfc_status_char.
* dump-parse-tree.c: Use fprintf, fputs and fputc instead of
	gfc_status and gfc_status_char. Remove gfc_ prefix of the gfc_show_*
	functions and make them static. Add new gfc_dump_parse_tree
	function.
	* gfortran.h (gfc_option_t): Rename verbose into dump_parse_tree.
	(gfc_status, gfc_status_char): Delete prototypes.
	* error.c (gfc_status, gfc_status_char): Remove functions.
	* scanner.c (gfc_new_file): Use printf instead of gfc_status.
	* options.c (gfc_init_options): Rename verbose into dump_parse_tree.
	(gfc_handle_module_path_options): Use gfc_fatal_error instead of
	gfc_status and exit.
	(gfc_handle_option): Rename verbose into dump_parse_tree.

From-SVN: r133958
2008-04-06 12:17:33 +00:00
Eric Botcazou 1bde5bc468 decl.c (rest_of_type_decl_compilation_no_defer): New local function used to process all the variants of the specified type.
* decl.c (rest_of_type_decl_compilation_no_defer): New local function
	used to process all the variants of the specified type.
	(gnat_to_gnu_entity): Invoke rest_of_type_decl_compilation for enumeral
	types too.  Call rest_of_type_decl_compilation_no_defer if undeferring.
	(rest_of_type_decl_compilation): Likewise.
	* utils.c (gnat_pushdecl): Propagate the name to all variants of type.

From-SVN: r133957
2008-04-06 10:22:23 +00:00
Tom G. Christensen d7d7db8b40 gthr-posix95.h (__gthread_cond_wait_recursive): Add missing &.
* gthr-posix95.h (__gthread_cond_wait_recursive): Add missing &.

From-SVN: r133955
2008-04-06 09:57:49 +00:00
Uros Bizjak 27183bba6b re PR target/12329 (x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer)
PR target/12329
        * config/i386/i386.c (ix86_function_regparm): Error if regparm(3)
        attribute is used for nested functions.

testsuite/ChangeLog:

        PR target/12329
        * gcc.target/i386/pr12329.c: New test.

From-SVN: r133954
2008-04-06 08:40:47 +02:00