2014-07-31 Robert Dewar <dewar@adacore.com>
* exp_util.adb, lib-writ.adb, sem_ch12.adb, s-direio.adb: Minor
reformatting.
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb (Expand_Loop_Entry_Attribute): Update the comment
which demonstrates the expansion of while loops subject to
attribute 'Loop_Entry. The condition of a while loop along with
related condition actions is now wrapped in a function. Instead
of repeating the condition, the expansion now calls the function.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_case.adb (Check_Against_Predicate): Correct off-by-one
error when reporting of missing values in a case statement for
a type with a static predicate.
(Check_Choices): Reject a choice given by a subtype to which a
Dynamic_Predicate applies.
* sem_ch3.adb (Analyze_Subtype_Declaration): Inherit
Has_Dynamic_Predicate_Aspect flag from parent.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): A predicate
cannot apply to a subtype of an incomplete type.
(Is_Static_Choice): Treat an Others_Clause as static. The
staticness of the expression and of the range are checked
elsewhere.
2014-07-31 Pascal Obry <obry@adacore.com>
* adaint.h (__gnat_ftell64): Added.
(__gnat_fseek64): Added.
(__int64): Added.
* cstreams.c (__int64): Removed.
From-SVN: r213366
2014-07-31 Pascal Obry <obry@adacore.com>
* a-stream.ads (Stream_Element_Offset): Now a signed 64bit type.
* i-cstrea.ads, s-crtl.ads (fseek64): Offset is always a 64bit value.
(ftell64): Always returns a 64bit value.
* cstreams.c (int64): New definition.
(_FILE_OFFSET_BITS): Set to 64 to enable 64bit offset support.
(__gnat_ftell64): Always returns a 64bit value. The implemenation now
uses ftello() on UNIX.
(__gnat_fseek64): Offset is always a 64bit value. The
implementation now uses fseeko() on UNIX.
* a-ststio.adb, s-direio.adb (Set_Position): Simplify code,
always use fseek64 to set the offset.
(Size): Simplify code, always use fseek64/ftell64.
* s-direio.ads (Count): Now an int64.
* g-socket.ads (Vector_Element): Adjust definition for Length
to be a size_t. This matches the C definition and avoid using
a 64bit integer on 32bit platforms now that Count is always 64bit.
* g-socthi-mingw.adb (Ada.Streams): Removed as not used anymore.
(C_Recvmsg): Change some conversion to account for change in
Vector_Element.
(C_Sendmsg): Likewise.
2014-07-31 Robert Dewar <dewar@adacore.com>
* cstand.adb (Create_Standard): Remove handling of -gnatdm flag.
* debug.adb: Remove documentation of -gnatdm flag.
* gnat1drv.adb (Adjust_Global_Switches): Remove handling of
-gnatdm flag.
From-SVN: r213365
2014-07-31 Arnaud Charlet <charlet@adacore.com>
* lib-writ.adb (Write_Unit_Information): Fix case where U =
No_Unit.
2014-07-31 Claire Dross <dross@adacore.com>
* exp_util.adb, exp_util.ads
(Get_First_Parent_With_External_Axiomatization_For_Entity):
New routine to find the first parent of an entity with
a pragma Annotate (GNATprove, External_Axiomatization).
(Has_Annotate_Pragma_For_External_Axiomatization): New function
to check if a package has a pragma Annotate (GNATprove,
External_Axiomatization).
* einfo.ads, einfo.adb (Is_Generic_Actual_Subprogram): New
flag on the entity for the declaration created for a formal
subprogram in an instance. This is a renaming declaration,
or in GNATprove_Mode the declaration of an expression function
that captures the axiomatization of the actual.
* sem_ch6.adb (Analyze_Expression_Function): For a
Generic_Actual_Subprogram, place body immediately after the
declaration because it may be used in a subsequent declaration
in the instance.
* sem_ch12.adb (Build_Wrapper): Add code to handle instances where
the actual is a function, not an operator. Handle functions with
one and two parameters and binary and unary operators.
2014-07-31 Pascal Obry <obry@adacore.com>
* cstreams.c (__gnat_is_regular_file_fd): Removed.
* adaint.c (__gnat_is_regular_file_fd): Added.
From-SVN: r213364
2014-07-31 Robert Dewar <dewar@adacore.com>
* exp_strm.adb: Minor reformatting.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Build_Wrapper): New procedure, subsidiary to
Analyze_Associations, to create a wrapper around operators that
are actuals to formal subprograms. This is done in GNATProve
mode in order to propagate the contracts of the operators to
the body of the instance.
From-SVN: r213363
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Analyze_Attribute, case 'Old): The reference is
legal if within an aspect specification for a generic subprogram.
From-SVN: r213362
2014-07-31 Javier Miranda <miranda@adacore.com>
* gnat1drv.adb (Back_End_Inlining): Set to false if
Suppress_All_Inlining is set.
* debug.adb: Adding documentation for -gnatd.z.
* inline.adb (Add_Inlined_Body): Extend the -gnatn2
processing to -gnatn1 for calls to Inline_Always routines.
(Add_Inlined_Subprogram): Remove previous patch.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Check_One_Function): Apply properly the static
semantic rules for indexing aspects and the functions they denote.
From-SVN: r213361
2014-07-31 Javier Miranda <miranda@adacore.com>
* debug.adb: Complete documentation of -gnatd.z.
2014-07-31 Bob Duff <duff@adacore.com>
* gnat_ugn.texi: Minor doc fixes.
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): Fix posting of missing
index value.
2014-07-31 Tristan Gingold <gingold@adacore.com>
* s-unstyp.ads (Packed_Byte): Make this type universal aliasing.
(Packed_Bytes1): Make component aliased.
2014-07-31 Robert Dewar <dewar@adacore.com>
* s-unstyp.ads, s-fileio.adb: Minor reformatting.
From-SVN: r213360
* gcc-interface/utils2.c ((build_binary_op): Don't set TREE_THIS_NOTRAP
on array references here, now done more selectively in trans.c.
From-SVN: r213356
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_util.adb (Is_Effectively_Volatile): New routine.
2014-07-31 Fedor Rybin <frybin@adacore.com>
* gnat_ugn.texi: Document --test-duration option for gnattest.
2014-07-31 Javier Miranda <miranda@adacore.com>
* opt.ads (Back_End_Inlining): New variable which controls
activation of inlining by back-end expansion.
* gnat1drv.adb (Adjust_Global_Switches): Initialize Back_End_Inlining
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not build
the body to be inlined by the frontend if Back_End_Inlining
is enabled.
* exp_ch6.adb (Register_Backend_Call): Moved to inline.adb.
(Expand_Call): If backend inlining is enabled let the backend to
handle inlined subprograms.
* inline.ads (Register_Backend_Call): Moved here from exp_ch6
* inline.adb (Register_Backend_Call): Moved here from exp_ch6.
(Add_Inlined_Subprogram): Add subprograms when Back_End_Inlining is set.
(Must_Inline): Do not return Inline_Call if Back_End_Inlining is
enabled.
* debug.adb Document -gnatd.z
* fe.h Import Back_End_Inlining variable.
* gcc-interface/utils.c (create_subprog_decl): If Back_End_Inlining is
enabled then declare attribute "always inline"
2014-07-31 Robert Dewar <dewar@adacore.com>
* a-ngelfu.ads: Minor comment fix.
From-SVN: r213353
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Record_Type): Replace all calls to
Is_SPARK_Volatile with Is_Effectively_Volatile and update
related comments.
* sem_ch3.adb (Analyze_Object_Contract, Process_Discriminants):
Replace all calls to Is_SPARK_Volatile with
Is_Effectively_Volatile and update related comments.
* sem_ch5.adb (Analyze_Iterator_Specification,
Analyze_Loop_Parameter_Specification): Replace all calls to
Is_SPARK_Volatile with Is_Effectively_Volatile and update
related comments.
* sem_ch6.adb (Process_Formals): Replace all calls to
Is_SPARK_Volatile with Is_Effectively_Volatile and update
related comments.
* sem_ch12.adb (Instantiate_Object): Replace the call to
Is_SPARK_Volatile_Object with Is_Effectively_Volatile_Object
and update related comment.
* sem_prag.adb (Analyze_External_Property_In_Decl_Part,
Analyze_Global_Item): Replace all calls to Is_SPARK_Volatile
with Is_Effectively_Volatile and update related comments.
* sem_res.adb (Resolve_Actuals, Resolve_Entity_Name): Replace
all calls to Is_SPARK_Volatile with Is_Effectively_Volatile and
update related comments.
* sem_util.adb (Has_Enabled_Property,
Variable_Has_Enabled_Property): Replace all calls
to Is_SPARK_Volatile with Is_Effectively_Volatile and
update related comments.
(Is_Effectively_Volatile): New routine.
(Is_Effectively_Volatile_Object): New routine.
(Is_SPARK_Volatile): Removed.
(Is_SPARK_Volatile_Object): Removed.
* sem_util.ads (Is_Effectively_Volatile): New routine.
(Is_Effectively_Volatile_Object): New routine.
(Is_SPARK_Volatile): Removed.
(Is_SPARK_Volatile_Object): Removed.
2014-07-31 Pascal Obry <obry@adacore.com>
* s-fileio.adb (Open): Make sure a shared file gets inserted into
the global list atomically. This ensures that the file descriptor
won't be freed because another tasks is closing the file.
From-SVN: r213352
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb (Process_Range_Expr_In_Decl): Add comments on
generation of _FIRST and _LAST variables even in GNATprove_Mode.
* gnat_ugn.texi: Minor editing.
* sem_prag.adb (Ensure_Aggregate_Form): Make sure generated
aggregate is marked Comes_From_Source if argument is CFS.
From-SVN: r213351
2014-07-31 Pascal Obry <obry@adacore.com>
* s-fileio.adb: Remove obsolete comment.
2014-07-31 Vincent Celier <celier@adacore.com>
* a-strbou.ads ("=" (Bounded_String, Bounded_String): Add
overriding keyword before function to avoid error when compiler
is called with -gnatyO (check overriding indicators).
2014-07-31 Tucker Taft <taft@adacore.com>
* gnat_ugn.texi: Add a paragraph pointing the reader
to the "plugins" example.
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Expression): Document the
purpose of the parent chain traversal.
From-SVN: r213350
2014-07-31 Robert Dewar <dewar@adacore.com>
* checks.ads, checks.adb (Activate_Overflow_Check): Do not set flag for
unconstrained fpt ops.
2014-07-31 Pascal Obry <obry@adacore.com>
* s-fileio.adb (Open): Make sure a shared file gets inserted into
the global list atomically. This ensures that the file descriptor
won't be freed because another tasks is closing the file.
From-SVN: r213349
2014-07-31 Vincent Celier <celier@adacore.com>
* projects.texi: Minor spelling error fix.
2014-07-31 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document No_Elaboration_Code_All restriction.
* lib-writ.adb, lib-load.adb: Initialize No_Elab_Code field in unit
information.
* lib.ads, lib.adb (No_Elab_Code): New field in unit information.
* restrict.adb (Process_Restriction_Synonyms): Add handling
of No_Elaboration_Code_All.
* restrict.ads (Process_Restriction_Synonyms): Now handles
No_Elaboration_Code_All.
* sem_ch10.adb (Analyze_Context): Enforce transitive with for
No_Elaboration_Code_All.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Handle setting of No_Elab_Code in unit information. Handle
No_Elaboration_Code_All.
* snames.ads-tmpl (Name_No_Elaboration_Code): New name for
pragma processing.
(Name_No_Elaboration_Code_All): New name for pragma processing.
2014-07-31 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Reject array
types with a null range and use the Esize of the component
instead of its RM_Size to identify appropriate values.
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb Add with and use clause for Aspects.
(Freeze_Expression): Emit an error when a volatile constant lacks
Boolean aspect Import.
(Has_Boolean_Aspect_Import): New routine.
From-SVN: r213347
2014-07-31 Gary Dismukes <dismukes@adacore.com>
* exp_util.adb: Minor reformatting.
2014-07-31 Vincent Celier <celier@adacore.com>
* errutil.adb (Error_Msg): Make sure that all components of
the error message object are initialized.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Try_Container_Indexing): If the container type is
class-wide, use specific type to locate iteration primitives.
* sem_ch13.adb (Check_Indexing_Functions): Add legality checks for
rules in RM 4.1.6 (Illegal_Indexing): New diagnostic procedure.
Minor error message reformating.
* exp_ch5.adb (Expand_Iterator_Loop): Handle properly Iterator
aspect for a derived type.
2014-07-31 Robert Dewar <dewar@adacore.com>
* debug.adb: Document debug flag d.X.
From-SVN: r213346
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads (Find_Specific_Type): Moved here from exp_disp.adb.
* sem_util.adb (Find_Specific_Type): If type is untagged private,
retrieve full view so that primitive operations can be located.
* exp_disp.adb Move Find_Specific_Type to sem_util.
* exp_ch4.adb (Expand_N_Op_Eq): If operands are class-wide, use
Find_Specific_Type to locate primitive equality.
* exp_util.adb (Make_CW_Equivalent_Type): A class_wide equivalent
type does not require initialization.
* exp_attr.adb (Compile_Stream_Body_In_Scope): Within an instance
body all visibility is established, and the enclosing package
declarations must not be installed.
From-SVN: r213345
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.adb (Expand_N_Protected_Type_Declaration): New
predicate Discriminated_Size, to distinguish between private
components that depend on discriminants from those whose size
depends on some other non-static expression.
2014-07-31 Nicolas Setton <setton@adacore.com>
* g-exptty.adb (Close): Fix binding to Waitpid: use the
tty version.
From-SVN: r213341
2014-07-31 Richard Biener <rguenther@suse.de>
* lto-streamer.h (struct output_block): Remove global.
(struct data_in): Remove labels, num_named_labels and
num_unnamed_labels.
* lto-streamer-in.c (lto_data_in_delete): Do not free labels.
* lto-streamer-out.c (produce_asm_for_decls): Do not set global.
From-SVN: r213340
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Make_Index): Reject properly the use of 'Length
in a discrete range, when 'range was probably intended.
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_warn.adb, sem_warn.ads (Has_Junk_Name): Moved from body to spec.
From-SVN: r213339
2014-07-31 Robert Dewar <dewar@adacore.com>
* frontend.adb: Minor reformatting.
* sem.adb: Minor reformatting.
* sem_ch6.adb (Analyze_Null_Procedure): Set proper sloc for
identifiers on rewrite.
* par.adb: Minor comment updates.
* a-ngelfu.adb (Cos): Minor simplification.
* par-ch13.adb (Get_Aspect_Specifications): Improve messages
and recovery for bad aspect.
* exp_ch3.adb: Code clean up.
* sem_util.ads: Minor comment correction.
* sem_ch13.adb (Check_Array_Type): Properly handle large types.
* sem_ch3.adb: Code clean up.
* binderr.ads: Minor comment correction.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* exp_disp.adb (Expand_Interface_Conversion): A call whose
prefix is a static conversion to an interface type that is not
class-wide is not dispatching.
From-SVN: r213338
2014-07-31 Robert Dewar <dewar@adacore.com>
* inline.adb, s-traceb.adb, s-traceb-hpux.adb, memtrack.adb,
s-traceb-mastop.adb: Minor reformatting.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Expand_Record_Extension): In ASIS_Mode perform
expansion, to handle properly visibility of selected components
in instance bodies.
From-SVN: r213337
2014-07-31 Robert Dewar <dewar@adacore.com>
* par-ch13.adb (Get_Aspect_Specifications): Set Inside_Depends.
* par-ch2.adb (P_Pragma): Set Inside_Depends.
* par-ch4.adb (P_Simple_Expression): Pass Inside_Depends to
Check_Unary_Plus_Or_Minus.
* scans.ads (Inside_Depends): New flag.
* scng.adb (Scan): Pass Inside_Depends to Check_Arrow.
* style.ads: Add Inside_Depends parameter to Check_Arrow Add
Inside_Depends parameter to Check_Unary_Plus_Or_Minus.
* styleg.adb (Check_Arrow): Handle Inside_Depends case.
(Check_Unary_Plus_Or_Minus): Handle Inside_Depends case.
* styleg.ads: Add Inside_Depends parameter to Check_Arrow Add.
Inside_Depends parameter to Check_Unary_Plus_Or_Minus.
2014-07-31 Javier Miranda <miranda@adacore.com>
* s-vaflop.adb Move the body of function T_To_G before
T_To_D. Required for frontend inlining.
* inline.adb (Has_Excluded_Contract): New subprogram used to
check if a subprogram inlined by the frontend has contracts
which cannot be inlined.
2014-07-31 Bob Duff <duff@adacore.com>
* s-traceb.adb, s-traceb-hpux.adb, s-traceb-mastop.adb:
(Call_Chain): Add 1 to number of frames to skip, to account for
the fact that there's one more frame on the stack.
From-SVN: r213336
2014-07-31 Robert Dewar <dewar@adacore.com>
* checks.adb (Enable_Overflow_Check): More precise setting of
Do_Overflow_Check flag for division.
2014-07-31 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Reject packed
array types with implementation type.
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch10.adb (Process_State): Remove local variable Name. Add
local variable Decl. Partially declare an abstract state by
generating an entity and storing it in the state declaration.
* sem_prag.adb (Create_Abstract_State): Fully declare a
semi-declared abstract state.
From-SVN: r213335
2014-07-31 Robert Dewar <dewar@adacore.com>
* prj-nmsc.adb: Minor reformatting.
2014-07-31 Bob Duff <duff@adacore.com>
* s-tasdeb.adb (System.Tasking.Debug): Remove
all usage of the secondary stack from this package.
From-SVN: r213334
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): If the domain of
iteration is an array component that depends on discriminants,
create an actual subtype for it, because the preanalysis of the
iterator name does not create actual subtypes of components.
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Expression): Update the loop in charge
of finding a proper insertion place for freeze nodes to handle
N_Expression_With_Actions nodes.
From-SVN: r213333
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Has_Preelaborable_Initialization): Check that
type is tagged before checking whether a user-defined Initialize
procedure is present.
2014-07-31 Gary Dismukes <dismukes@adacore.com>
* a-ngelfu.ads (Sqrt): Augment postcondition.
2014-07-31 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb (Check_Library_Attributes): An aggegate library
directory and ALI directory must be different than all object
and library directories of aggregated projects.
2014-07-31 Vincent Celier <celier@adacore.com>
* prj-pars.adb, prj-conf.ads, prj-conf.adb (Locate_Runtime): Move spec
to package body, as it is not called from outside. Remove argument
Project_Tree, no longer used. When runtime cannot be found,
call Raise_Invalid_Config instead of failing the program.
From-SVN: r213330
2014-07-31 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Document new switch -gnato0.
* sem_ch3.ads: Minor reformatting.
* gnatlink.adb (Process_Args): Compile bind file with -gnato0
(we do not want overflow checks when incrementing elaboration
counters).
* einfo.ads: Minor reformatting.
From-SVN: r213328
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Expand_Freeze_Record_Type): Do not build an
invariant procedure for an internally generated subtype that is
created for an object of a class-wide type.
2014-07-31 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb, errutil.adb: Make code similar to Errout.
2014-07-31 Gary Dismukes <dismukes@adacore.com>
* gnat_rm.texi, sem_aux.ads, einfo.ads, sem_util.ads, sem_ch6.adb,
exp_disp.adb: Minor reformatting.
From-SVN: r213326
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb: Minor reformatting.
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Build_Invariant_Checks): If the enclosing record
is an unchecked_union, warn that invariants will not be checked
on components that have them.
2014-07-31 Robert Dewar <dewar@adacore.com>
* freeze.adb (Freeze_Entity): Check for error of
Type_Invariant'Class applied to a untagged type.
* sem_ch6.adb (Analyze_Null_Procedure): Unconditionally rewrite
as null body, so that we perform error checks even if expansion
is off.
From-SVN: r213324
2014-07-31 Marc Glisse <marc.glisse@inria.fr>
PR c++/60517
gcc/c/
* c-typeck.c (c_finish_return): Return 0 instead of the address of
a local variable.
gcc/cp/
* typeck.c (maybe_warn_about_returning_address_of_local): Return
whether it is returning the address of a local variable.
(check_return_expr): Return 0 instead of the address of a local
variable.
gcc/c-family/
* c.opt (-Wreturn-local-addr): Move to common.opt.
gcc/
* common.opt (-Wreturn-local-addr): Moved from c.opt.
* gimple-ssa-isolate-paths.c: Include diagnostic-core.h and intl.h.
(isolate_path): New argument to avoid inserting a trap.
(find_implicit_erroneous_behaviour): Handle returning the address
of a local variable.
(find_explicit_erroneous_behaviour): Likewise.
gcc/testsuite/
* c-c++-common/addrtmp.c: New file.
* c-c++-common/uninit-G.c: Adapt.
From-SVN: r213323
2014-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Build_Invariant_Procedure): If body of procedure
is already present, nothing to do.
* exp_ch3.adb (Build_Component_Invariant_Call): For an access
component, check whether the access type has an invariant before
checking the designated type.
(Build_Record_Invariant_Proc): Change suffix of generated
name to prevent ambiguity when record type has invariants
in addition to those of components, and two subprograms are
constructed. Consistent with handling of array types.
(Insert_Component_Invariant_Checks): Build invariant procedure
body when one has not been created yet, in the case of composite
types that are completions and whose full declarations carry
invariants.
From-SVN: r213322
2014-07-31 Bingfeng Mei <bmei@broadcom.com>
PR lto/61868
* toplev.c (init_random_seed): Move piece of code never called to
set_random_seed.
(set_random_seed): see above.
* gcc.dg/pr61868.c: New test.
From-SVN: r213321