2017-09-09 Paul Thomas <pault@gcc.gnu.org>
* decl.c : Add decl_type_param_list, type_param_spec_list as
static variables to hold PDT spec lists.
(build_sym): Copy 'type_param_spec_list' to symbol spec_list.
(build_struct): Copy the 'saved_kind_expr' to the component
'kind_expr'. Check that KIND or LEN components appear in the
decl_type_param_list. These should appear as symbols in the
f2k_derived namespace. If the component is itself a PDT type,
copy the decl_type_param_list to the component param_list.
(gfc_match_kind_spec): If the KIND expression is parameterized
set KIND to zero and store the expression in 'saved_kind_expr'.
(insert_parameter_exprs): New function.
(gfc_insert_kind_parameter_exprs): New function.
(gfc_insert_parameter_exprs): New function.
(gfc_get_pdt_instance): New function.
(gfc_match_decl_type_spec): Match the decl_type_spec_list if it
is present. If it is, call 'gfc_get_pdt_instance' to obtain the
specific instance of the PDT.
(match_attr_spec): Match KIND and LEN attributes. Check for the
standard and for type/kind of the parameter. They are also not
allowed outside a derived type definition.
(gfc_match_data_decl): Null the decl_type_param_list and the
type_param_spec_list on entry and free them on exit.
(gfc_match_formal_arglist): If 'typeparam' is true, add the
formal symbol to the f2k_derived namespace.
(gfc_match_derived_decl): Register the decl_type_param_list
if this is a PDT. If this is a type extension, gather up all
the type parameters and put them in the right order.
*dump-parse-tree.c (show_attr): Signal PDT templates and the
parameter attributes.
(show_components): Output parameter atrributes and component
parameter list.
(show_symbol): Show variable parameter lists.
* expr.c (expr.c): Copy the expression parameter list.
(gfc_is_constant_expr): Pass on symbols representing PDT
parameters.
(gfc_check_init_expr): Break on PDT KIND parameters and
PDT parameter expressions.
(gfc_check_assign): Assigning to KIND or LEN components is an
error.
(derived_parameter_expr): New function.
(gfc_derived_parameter_expr): New function.
(gfc_spec_list_type): New function.
* gfortran.h : Add enum gfc_param_spec_type. Add the PDT attrs
to the structure symbol_attr. Add the 'kind_expr' and
'param_list' field to the gfc_component structure. Comment on
the reuse of the gfc_actual_arglist structure as storage for
type parameter spec lists. Add the new field 'spec_type' to
this structure. Add 'param_list' fields to gfc_symbol and
gfc_expr. Add prototypes for gfc_insert_kind_parameter_exprs,
gfc_insert_parameter_exprs, gfc_add_kind, gfc_add_len,
gfc_derived_parameter_expr and gfc_spec_list_type.
* interface.c (gfc_compare_derived_types): Treat PDTs in the
same way as sequence types.
* match.c : Add variable 'type_param_spec_list'.
(gfc_op2string, gfc_match_member_sep, gfc_match_label): Remove
trailing whitespace.
(match_derived_type_spec): Match PDTs and find specific
instance.
(gfc_match_type_spec): Remove more trailing whitespace.
(gfc_match_allocate): Assumed or deferred parameters cannot
appear here. Copy the type parameter spec list to the expr for
the allocatable entity. Free 'type_param_spec_list'.
(gfc_match_common, gfc_match_namelist, gfc_match_module): Still
more trailing whitespace to remove.
(gfc_match_type_is): Allow PDT typespecs.
* match.h : Modify prototypes for gfc_match_formal_arglist and
gfc_match_actual_arglist.
* module.c (ab_attribute, mstring attr_bits): PDT attributes
added.
(mio_symbol_attribute): PDT attributes handled.
(mio_component): Deal with 'kind_expr' field.
(mio_full_f2k_derived): For PDT templates, transfer the formal
namespace symroot to the f2k_derived namespace.
*primary.c (match_keyword_arg, gfc_match_actual_arglist): Add
modifications to handle PDT spec lists. These are flagged in
both cases by new boolean arguments, whose prototype defaults
are false.
(gfc_match_structure_constructor, match_variable): Remove yet
more trailing whitespace.
* resolve.c (get_pdt_spec_expr, get_pdt_constructor): New
functions.
(resolve_structure_cons): If the constructor is a PDT template,
call get_pdt_constructor to build it using the parameter lists
and then get the specific instance of the PDT.
(resolve_component): PDT strings need a hidden string length
component like deferred characters.
(resolve_symbol): Dummy PDTs cannot have deferred parameters.
* symbol.c (gfc_add_kind, gfc_add_len): New functions.
(free_components): Free 'kind_expr' and 'param_list' fields.
(gfc_free_symbol): Free the 'param_list' field.
(gfc_find_sym_tree): If the current state is a PDT template,
look for the symtree in the f2k_derived namspaces.
trans-array.c (structure_alloc_comps): Allocate and deallocate
PDTs. Check dummy arguments for compliance of LEN parameters.
Add the new functions to the preceeding enum.
(gfc_allocate_pdt_comp, gfc_deallocate_pdt_comp and
gfc_check_pdt_dummy): New functions calling above.
* trans-array.h : Add prototypes for these functions.
trans-decl.c (gfc_get_symbol_decl): Call gfc_defer_symbol_init
as appropriate for PDT symbols.
(gfc_trans_deferred_vars): Allocate/deallocate PDT entities as
they come into and out of scope. Exclude pdt_types from being
'gcc_unreachable'.
(gfc_trans_subcomponent_assign): PDT array components must be
handles as if they are allocatable.
* trans-stmt.c (gfc_trans_allocate): Handle initialization of
PDT entities.
(gfc_trans_deallocate): Likewise.
* trans-types.c (gfc_get_derived_type): PDT templates must not
arrive here. PDT string components are handles as if deferred.
Similarly, PDT arrays are treated as if allocatable. PDT
strings are pointer types.
* trans.c (gfc_deferred_strlen): Handle PDT strings in the same
way as deferred characters.
2017-09-09 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/pdt_1.f03 : New test.
* gfortran.dg/pdt_2.f03 : New test.
* gfortran.dg/pdt_3.f03 : New test.
* gfortran.dg/pdt_4.f03 : New test.
* gfortran.dg/pdt_5.f03 : New test.
From-SVN: r251925
PR bootstrap/81926
* cp-objcp-common.c (struct debug_type_hasher): New class.
(debug_type_hash): New variable.
(cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
From-SVN: r251922
The code that lowers field references can sometimes introduce a double
pointer indirection in cases where it is not/safe appropriate. For
example, in
var p **struct { f int }
p.f = 0
the assignment LHS was being incorrectly lowered to (*(*p)).f.
Detect this situation and issue an error.
Fixesgolang/go#21770
Reviewed-on: https://go-review.googlesource.com/62330
From-SVN: r251918
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_aux.adb, sem_aux.ads (Get_Called_Entity): New function to
return the entity associated with the call.
* sem_util.adb, sem_util.ads (Check_Function_Writable_Actuals):
Replace the internal Get_Function_Id with the new
Sem_Aux.Get_Called_Entity.
(Iterate_Call_Parameters): New
procedure to iterate on formals and actuals at the same time.
* sem_ch12.adb (Analyze_Subprogram_Instantiation):
Set SPARK_Mode from spec when set, for analysis
of instance. Restore after analysis of instance.
(Instantiate_Subprogram_Body): Set SPARK_Mode from body when
set, for analysis of body instance. Restored automatically at
the end of the subprogram.
* gnat1drv.adb (Adjust_Global_Switches): Set
Check_Validity_Of_Parameters to False in GNATprove mode.
* opt.ads (Check_Validity_Of_Parameters): Document switch to
set option.
From-SVN: r251900
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.adb (NCT_Tables_In_Use): Move to library level from...
(New_Copy_Tree): ...there. Reset the hash tables only if they
were used in the previous invocation.
* s-htable.adb: Fix typo.
2017-09-08 Bob Duff <duff@adacore.com>
* a-ssicst.adb (Open): Set File.Last_Op to the appropriate value.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_aggr.adb: minor style fix.
2017-09-08 Bob Duff <duff@adacore.com>
* sprint.adb (Write_Corresponding_Source): Ignore if there is
no current source file.
(Write_Name_With_Col_Check, Write_Name_With_Col_Check_Sloc):
Print something helpful in case N is invalid.
* sprint.ads: Minor comment fix.
From-SVN: r251897
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb: (Aggr_Assignment_OK_For_Backend): Add early return for
access types.
From-SVN: r251896
2017-09-08 Bob Duff <duff@adacore.com>
* par-prag.adb, sem_prag.adb, snames.ads-tmpl: Implement pragma
Ada_2020, along the same lines as the other Ada version pragmas.
2017-09-08 Gary Dismukes <dismukes@adacore.com>
* sem_ch12.adb: Minor typo fixes and reformatting.
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_aggr.adb (Resolve_Record_Aggregate):
Rewrite bounds of aggregate subexpressions which may depend on
discriminants of the enclosing aggregate.
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_ch5.adb: Prevent assertion failure on illegal code.
2017-09-08 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb (Add_SPARK_Xrefs.Is_SPARK_Scope): Avoid
calling Renamed_Entity on an entity which cannot be a renaming.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb: Add with & use clause for Urealp.
(Aggr_Assignment_OK_For_Backend): Accept (almost all)
elementary types instead of just discrete types.
* sem_eval.adb (Expr_Value): Deal with N_Null for access types.
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>:
Be prepared for the FP zero value in the memset case. Add small
guard.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* s-htable.adb (Static_HTable.Reset): Use aggregate instead
of loop.
From-SVN: r251894
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* exp_aggr.adb (Expand_Array_Aggregate): Use New_Copy_Tree instead
of New_Copy because the latter leaves the syntactic structure of
the tree inconsistent (a child is accessible through two parents)
and prevents proper replication of itypes by subsequent calls
to New_Copy_Tree.
* exp_ch4.adb (Expand_Concatenate): Use New_Copy_Tree instead of
New_Copy because the latter leaves the syntactic structure of the
tree inconsistent (a child is accessible through two parents)
and prevents proper replication of itypes by subsequent calls
to New_Copy_Tree.
* sem_util.adb (In_Subtree): New routine.
(New_Copy_Tree): Reimplemented.
* sem_util.ads (In_Subtree): New routine.
(New_Copy_Tree): Reimplemented.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Resolve_Aspect_Expressions): The expression
for aspect Default_Value is a static scalar value, but it does
not freeze the type. Yhis allows for subsequent representation
clauses for the type.
2017-09-08 Javier Miranda <miranda@adacore.com>
* sem_ch8.adb (Find_Direct_Name.Undefined): Do
not add entries into the undefined reference table when we are
compiling with errors ignored.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Check_Formal_Packages): Do not apply conformance
check if the instance is within an enclosing instance body. The
formal package was legal in the enclosing generic, and is
legal in the enclosing instantiation. This optimisation may be
applicable elsewhere, and it also removes spurious errors that
may arise with on-the-fly processing of instantiations that
contain Inline_Always subprograms.
2017-09-08 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Disregard empty argument of GNAT driver.
2017-09-08 Justin Squirek <squirek@adacore.com>
* checks.adb (Insert_Valid_Check): Manually decorate
the generated temporary for range valdity checks.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* usage.adb (Usage): Document new -gnatw.q/-gnatw.Q switches.
2017-09-08 Justin Squirek <squirek@adacore.com>
* switch-c.adb (Scan_Front_End_Switches): Add new warning switch
case to handle underscore flags.
* warnsw.adb, warnsw.ads (Set_Underscore_Warning_Switch): Create
new procedure to handle underscores.
From-SVN: r251893
2017-09-08 Javier Miranda <miranda@adacore.com>
* exp_ch4.adb (Expand_N_Op_Divide): Reordering code that handles
divisions with fixed point results to avoid generating twice
the runtime check on divide by zero.
* checks.adb (Apply_Divide_Checks): Ensure that operands are
not evaluated twice (once for their runtime checks and once for
their regular computation).
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Part_Of): Add missing
return statements after issuing errors. Add detection of
out-of-order item and single concurrent type.
From-SVN: r251892
2017-09-08 Bob Duff <duff@adacore.com>
* s-ststop.ads, s-ststop.adb, rtsfind.ads (String_Input_Tag):
New routine to read the Tag robustly.
* exp_attr.adb (Input): Change the expansion of 'Input,
in the class-wide case, to call String_Input_Tag instead of
String_Input_Blk_IO.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* s-rident.ads (Restriction_Id): reorder enum
literals, so that Pure_Barriers is no longer in range of the
Cunit_Boolean_Restrictions subtype.
2017-09-08 Nicolas Roche <roche@adacore.com>
* a-taster.ads, a-taster.adb: Move to libgnarl
* gcc-interface/Makefile.in: Remove obsolete targets. Code cleanups.
Add support for files in libgnarl.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_N_Type_Conversion): Do not apply
accessibility check to an interface conversion, whose purpose
is to perform a pointer adjustment in a dispatching call.
* exp_ch6.adb (Expand_Call_JHelper): Add accessibility checks
when the actual is a construct that involves a dereference of an
expression that includes a formal of the enclosing subprogram,
In such cases, the accessibility level of the actual is that of
the corresponding formal, which is passed in as an additional
actual in the outer call.
From-SVN: r251886
2017-09-08 Bob Duff <duff@adacore.com>
* exp_intr.adb (Add_Source_Info): Do not decode
file names; they were not encoded in the first place.
2017-09-08 Bob Duff <duff@adacore.com>
* a-tags.adb (Internal_Tag): Unsuppress checks, so we get
exceptions instead of crashes. Check for absurdly long strings
and empty strings. Empty strings cause trouble because they can
have super-null ranges (e.g. 100..10), which causes Ext_Copy to
be empty, which causes an array index out of bounds.
* s-ststop.adb (Input): Unsuppress checks, so we get exceptions
instead of crashes.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.adb (Is_CCT_Instance): allow use in
the context of protected types.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* a-tigeli.adb: minor remove extra whitespace.
From-SVN: r251885
2017-09-08 Gary Dismukes <dismukes@adacore.com>
* par-ch4.adb: Reformatting of an error message.
2017-09-08 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
identifiers to ensure their correct decoration of names on
aspect expressions.
2017-09-08 Yannick Moy <moy@adacore.com>
* exp_attr.adb (Expand_Loop_Entry_Attribute): Do
not skip a loop coming from source which is rewritten into a loop.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Wrap_Imported_Subprogram): Indicate that the
wrapper has convention Ada, to prevent spurious warnings on
unconstrained array parameters.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
(Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
From-SVN: r251884
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* exp_intr.adb (Append_Entity_Name): Move to ...
* sem_util.ads, sem_util.adb: ... here to share it.
(Subprogram_Name): New subprogram, to compute the name of the enclosing
subprogram/entity.
* errutil.adb (Error_Msg): Fill new field Node.
* erroutc.ads (Subprogram_Name_Ptr): New.
(Error_Msg_Object): New field Node.
* erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
* errout.adb (Error_Msg): New variant with node id parameter.
Fill new parameter Node when emitting messages. Revert previous
changes for Include_Subprogram_In_Messages.
* sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
generating warning message.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* par-ch4.adb (P_Iterated_Component_Association): Place construct
under -gnat2020 flag, given that it is a future feature of
the language.
* sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
defining identifier as referenced to prevent spurious warnings:
corresponding loop is expanded into one or more loops whose
variable has the same name, and the expression uses those names
and not the original one.
From-SVN: r251883
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_elab.adb (Check_A_Call): Do not consider
references to internal variables for SPARK semantics.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* inline.adb (In_Package_Spec): refine type of
the parameter from Node_Id to Entity_Id.
2017-09-08 Justin Squirek <squirek@adacore.com>
* exp_ch5.adb (Expand_Formal_Container_Loop):
Reset the scope of the loop parameter after it is reanalyzed.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.ads (Set_Rep_Info): New inline procedure.
* sem_util.adb (Set_Rep_Info): Implement it.
* sem_ch3.adb (Process_Subtype): If the case of a constraint present,
always copy the representation aspects onto the subtype.
From-SVN: r251882
2017-09-08 Georges-Alex Jaloyan <jaloyan@adacore.com>
* g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_key):
Correction of the return type from access type to option type.
(Simple_HTable): Moving the Instance_Data to ads file.
From-SVN: r251881
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_prag.adb: Use System.Case_Util.To_Lower to simplify code.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* opt.ads (Include_Subprogram_In_Messages): New variable.
* errout.ads (Current_Subprogram_Ptr): New variable.
* errout.adb (Error_Msg): Prepend current subprogram info
in messages if Include_Subprogram_In_Messages is set.
* sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to
Current_Subprogram.
* gnat1drv.adb (Adjust_Global_Switches): Set
Include_Subprogram_In_Messages when -gnatdJ is set.
* debug.adb: Document and reserve -gnatdJ.
2017-09-08 Georges-Axel Jaloyan <jaloyan@adacore.com>
* g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New
functions to iterate over simple hastables.
(Load_Factor_HTable): Remove obsolete and inefficient implementation.
2017-09-08 Javier Miranda <miranda@adacore.com>
* exp_ch6.adb (Unqual_BIP_Function_Call): Adding
missing checks on the presence of Entity() before checking the
entity attributes.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Reorder some
statements, use local variable and remove unnecessary processing.
From-SVN: r251880
2017-09-08 Javier Miranda <miranda@adacore.com>
* exp_ch6.ads (Make_Build_In_Place_Iface_Call_In_Allocator): New
subprogram.
(Make_Build_In_Place_Iface_Call_In_Anonymous_Context): New subprogram.
(Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
subprogram.
(Unqual_BIP_Iface_Function_Call): New subprogram.
* exp_ch6.adb (Replace_Renaming_Declaration_Id): New
subprogram containing code that was previously inside
Make_Build_In_Place_Call_In_Object_Declaration since it is also
required for one of the new subprograms.
(Expand_Actuals):
Invoke Make_Build_In_Place_Iface_Call_In_Anonymous_Context
(Expand_N_Extended_Return_Statement): Extend the
cases covered by an assertion on expected BIP object
declarations.
(Make_Build_In_Place_Call_In_Assignment):
Removing unused code; found working on this ticket.
(Make_Build_In_Place_Call_In_Object_Declaration): Move the code
that replaces the internal name of the renaming declaration
into the new subprogram Replace_Renaming_Declaration_Id.
(Make_Build_In_Place_Iface_Call_In_Allocator): New subprogram.
(Make_Build_In_Place_Iface_Call_In_Anonymous_Context):
New subprogram.
(Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
subprogram.
(Unqual_BIP_Iface_Function_Call): New subprogram.
* exp_ch3.adb (Expand_N_Object_Declaration): Invoke the new
subprogram Make_Build_In_Place_Iface_Call_In_Object_Declaration.
* exp_attr.adb (Expand_N_Attribute_Reference): Invoke the new
subprogram Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
* exp_ch4.adb (Expand_Allocator_Expression): Invoke the new
subprogram Make_Build_In_Place_Iface_Call_In_Allocator.
(Expand_N_Indexed_Component): Invoke the new subprogram
Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
(Expand_N_Selected_Component): Invoke the new subprogram
Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
(Expand_N_Slice): Invoke the new subprogram
Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
* exp_ch8.adb (Expand_N_Object_Renaming_Declaration):
Invoke the new subprogram
Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
2017-09-08 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Expand_Interface_Conversion): Fix handling of
access to interface types. Remove also the accessibility check.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch6.adb (Freeze_Expr_Types): Really freeze
all the types that are referenced by the expression.
(Analyze_Expression_Function): Call Freeze_Expr_Types for
a completion instead of manually freezing the type of the
expression.
(Analyze_Subprogram_Body_Helper): Do not call Freeze_Expr_Types here.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_prag.adb (Replace_Discriminals_Of_Protected_Op):
New procedure, auxiliary to Expand_Pragma_Check, to handle
references to the discriminants of a protected type within a
precondition of a protected operation. This is needed because
the original precondition has been analyzed in the context of
the protected declaration, but in the body of the operation
references to the discriminants have been replaved by references
to the discriminants of the target object, and these references
are only created when expanding the protected body.
From-SVN: r251879
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Pragma): Issue more precise error messages on
Loop_Variant.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Build_Record_VS_Func): If the record is an
unchecked union, do not emit checks for its (non-existent)
discriminants, or for variant parts that depend on them.
2017-09-08 Justin Squirek <squirek@adacore.com>
* sem_ch4.adb (Find_Equality_Types.Try_One_Interp,
Find_Comparison_Type.Try_One_Interp): Add check for generic
instances.
From-SVN: r251878
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* style.adb: Fix typo.
2017-09-08 Javier Miranda <miranda@adacore.com>
* einfo.adb (Underlying_Type): Add missing support for class-wide
types that come from the limited view.
* exp_attr.adb (Attribute_Address): Check class-wide type
interfaces using the underlying type to handle limited-withed
types.
(Attribute_Tag): Check class-wide type interfaces using
the underlying type to handle limited-withed types.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_Predicated_Loop): Handle properly a loop
over a subtype of a type with a static predicate, taking into
account the predicate function of the parent type and the bounds
given in the loop specification.
* sem_ch3.adb (Inherit_Predicate_Flags): For qn Itype created for
a loop specification that is a subtype indication whose type mark
is a type with a static predicate, inherit predicate function,
used to build case statement for rewritten loop.
2017-09-08 Justin Squirek <squirek@adacore.com>
* lib-load.adb: Modify printing of error message to exclude file
line number.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
don't inline subprograms declared in both visible and private
parts of a package.
(In_Package_Spec): previously In_Package_Visible_Spec; now
detects subprograms declared both in visible and private parts
of a package spec.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Build_Invariant_Procedure_Declaration): If
the type is an anonymous array in an object declaration, whose
component type has an invariant, use the object declaration
as the insertion point for the invariant procedure, given that
there is no explicit type declaration for an anonymous array type.
2017-09-08 Bob Duff <duff@adacore.com>
* a-cbprqu.ads, a-cbdlli.adb: Suppress warnings.
From-SVN: r251876
2017-09-08 Bob Duff <duff@adacore.com>
* s-trasym.ads (Hexa_Traceback): If
Suppress_Hex is True, print "..." instead of a hexadecimal
address.
* s-trasym.adb: Ignore No_Hex in this version.
Misc cleanup.
2017-09-08 Bob Duff <duff@adacore.com>
* debug.adb: Minor reformatting.
2017-09-08 Bob Duff <duff@adacore.com>
* a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the
code so it doesn't trigger an "uninit var" warning.
2017-09-08 Nicolas Roche <roche@adacore.com>
* s-hibaen.ads: Remove obsolete file.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* a-locale.ads: Add comment explaining the state of this package.
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.adb (Is_CCT_Instance): Allow calls in the context
of packages.
* sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body):
allow calls in the context of package spec (for pragma
Initializes) and bodies (for pragma Refined_State).
2017-09-08 Bob Duff <duff@adacore.com>
* checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the
new Exp.
From-SVN: r251875
2017-09-08 Bob Duff <duff@adacore.com>
PR ada/80888
* a-textio.adb, a-witeio.adb, a-ztexio.adb (Set_WCEM): Use
Default_WCEM by default (i.e. if the encoding is not specified
by the Form string).
From-SVN: r251874
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* debug.adb (dA): Adjust comment.
* gnat1drv.adb (Gnat1drv): Likewise.
* opt.ads (List_Representation_Info_Extended): New variable.
* repinfo.adb (List_Record_Info): Split implementation into...
(Compute_Max_Length): ...this. Recurse on records if requested.
(List_Record_Layout): Likewise.
* switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
statement, accept '0' and set List_Representation_Info_Extended
on 'e'.
* usage.adb (Usage): Document new -gnatRe variant.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
Do not save the given entity in the global variable Default_Pool
if the pragma appears within a generic unit.
2017-09-08 Bob Duff <duff@adacore.com>
* errout.adb (Delete_Warning): Do not
decrement Warnings_Treated_As_Errors. This is called before
Warnings_Treated_As_Errors has been incremented to account for
this warning. Decrementing it here can lead to negative values
of Warnings_Treated_As_Errors, raising Constraint_Error in
checks-on builds, and causing the compiler to return an error
code in checks-off builds.
From-SVN: r251873
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
entities of named concurrent types as Ref_Id and not of anonymous
concurrent objects (because callers already know when a conversion
is necessary and can easily do it); also, do not expect protected
types or protected objects as Context_Id (because no flow-related
SPARK pragmas are attached there); reflect these changes in a
more precise comment.
2017-09-08 Olivier Hainque <hainque@adacore.com>
* g-altive.ads: Add documentation.
2017-09-08 Bob Duff <duff@adacore.com>
* sem_util.ads, debug.adb: Minor comment fix.
* erroutc.ads: Comment fix.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
for compatibility of component types of formal and actual in an
instantiation of a child unit, when the component type of the
formal is itself a formal of an enclosing generic.
From-SVN: r251872
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from
sem_prag.adb to make it available for GNATprove; for concurrent
types replace custom scope climbing with Scope_Same_Or_Within; for
single concurrent objects add scope climbing (with Scope_Within),
which was not there (that's the primary semantic change of this
commit); also, when comparing a single concurrent object with
its corresponding concurrent type rely on equality of types,
not of objects (because that's simpler to code).
* sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads.
(Analyze_Global_Item): adjust special-casing of references to the
current instance of a concurrent unit in the Global contracts
of task types and single tasks objects; similar for references
in the protected operations and entries of protected types and
single protected objects (in all these cases the current instance
behaves as an implicit parameter and must not be mentioned in
the Global contract).
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Introduce temporary for
function calls returning a record within a subprogram call,
for C generation.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded
name that designates the current instance of a child unit in its
own body and appears as the prefix of a reference to an entity
local to the child unit.
* exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
Minor reformatting.
2017-09-08 Yannick Moy <moy@adacore.com>
* sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that
may be intentional.
2017-09-08 Tristan Gingold <gingold@adacore.com>
* sem_warn.adb (Check_Unused_Withs): Remove test that disabled
warnings on internal units in configurable run time mode.
From-SVN: r251871
2017-09-08 Bob Duff <duff@adacore.com>
* sem_ch3.adb (Build_Derived_Private_Type): Inherit
representation items from interfaces that the derived type
implements, not just from the parent type.
* sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
this to return an empty list when there are no interfaces.
* einfo.ads, sem_ch13.adb: Minor comment fixes.
* sem_attr.adb: Minor comment fix.
2017-09-08 Doug Rupp <rupp@adacore.com>
* sigtramp-vxworks.c [i386]: Adjust the kernel context for
x86-vx7.
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.adb (Expand_N_Allocator): Generate a
call to Allocate_Any_Controlled when the allocation does not
require any initialization.
From-SVN: r251870
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_util.adb (Copy_Node_With_Replacement):
Update the Renamed_Object field of a replicated object renaming
declaration.
2017-09-08 Patrick Bernardi <bernardi@adacore.com>
* exp_ch9.adb (Is_Pure_Barrier): Allow type
conversions and components of objects. Simplified the detection
of the Count attribute by identifying the corresponding run-time
calls.
2017-09-08 Yannick Moy <moy@adacore.com>
* exp_ch9.adb, exp_disp.adb, repinfo.adb, sem_ch12.adb, sem_dim.adb,
sem_type.adb, sinfo.ads: Minor reformatting.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Has_Incomplete_Compoent): New predicate, subsidiary
of Freeze_Profile, used to inhibit the freezing of the profile
of an expression function declared within a nested package, when
some type in the profile depends on a private type declared in
an enclosing package.
2017-09-08 Bob Duff <duff@adacore.com>
* gnat1drv.adb (Gnat1drv): Do not set the Force_ALI_Tree_File flag in
the subunit case. It's still OK to set it in the "missing subunits"
case, because that won't cause the obsolete .ali files that cause
confusion.
2017-09-08 Bob Duff <duff@adacore.com>
* sinput-l.adb: Remove unused "with Unchecked_Conversion;". It's
unclear why this didn't cause a warning.
* a-uncdea.ads, a-unccon.ads: Add "Ada." to names in the
pragmas. It's unclear why this didn't cause an error.
From-SVN: r251869
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration):
Reimplemented.
(Expand_SPARK_Potential_Renaming): Code clean up.
* sem_prag.adb (Analyze_Initialization_Item): Add a guard in case
the item does not have a proper entity.
(Analyze_Input_Item): Add a guard in case the item does not have a
proper entity.
(Collect_States_And_Objects): Include object renamings in the
items being collected.
(Resolve_State): Update the documentation of this routine.
* sem_util.adb (Entity_Of): Add circuitry to handle
renamings of function results.
(Remove_Entity): New routine.
(Remove_Overloaded_Entity): Take advantage of factorization.
* sem_util.ads (Entity_Of): Update the documentation
of this routine.
(Remove_Entity): New routine.
(Remove_Overloaded_Entity): Update the documentation of this
routine.
2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.adb (List_Record_Info): During first loop,
do not override the normalized position and first bit
if they have already been set. Move fallback code
for the packed case to the case where it belongs.
* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
Also adjust the normalized position of components.
(Adjust_Record_For_Reverse_Bit_Order_Ada_95): Likewise.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* exp_disp.adb (Make_DT, Set_All_DT_Position): Handle properly
the placement of a primitive operation O that renames an operation
R declared in an inner package, and which is thus not a primitive
of the dispatching type of O. In this case O is a new primitive
and does not inherit its dispatch table position from R (which
has none).
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_dim.adb (Analyze_Dimension_If_Expression,
Analyze_Dimension_Case_Expression): new subprograms to verify
the dimensional correctness of Ada2012 conditional expressions,
and set properly the dimensions of the construct.
* sem_res.adb (Resolve_If_Expression, Resolve_Case_Expression)):
call Analyze_Dimension.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_type.adb (Expand_Interface_Conversion): Prevent an infinite
loop on an interface declared as a private extension of another
synchronized interface.
From-SVN: r251868
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Check_Generic_Parent): New procedure within
Analyze_Associations, to handle actual packages that depend on
previous instances. If a package IAP that is an instantiation is
used as an actual in a subsequent instantiation SI in the same
scope, and IAP has a body, IAP must be frozen before SI. If
the generic parent of IAP is itself declared in a previous
instantiation in the same scope, that instantiation must also
be frozen before SI.
(Install_Body): Prevent double insertion of freeze node for
instance.
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Resolve_State): Update the
comment on documentation. Generate a reference to the state once
resolution takes place.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications, case
Linker_Section): If the aspect applies to an object declaration
with explicit initialization, do not delay the freezing of the
object, to prevent access-before-elaboration in the generated
initialization code.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
(Integer_Value (Item)) when the size of the fixed decimal type
is larger than Integer.
From-SVN: r251866
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Check_Generic_Parent): New procedure within
Analyze_Associations, to handle actual packages that depend on
previous instances. If a package IAP that is an instantiation is
used as an actual in a subsequent instantiation SI in the same
scope, and IAP has a body, IAP must be frozen before SI. If
the generic parent of IAP is itself declared in a previous
instantiation in the same scope, that instantiation must also
be frozen before SI.
(Install_Body): Prevent double insertion of freeze node for
instance.
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Resolve_State): Update the
comment on documentation. Generate a reference to the state once
resolution takes place.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications, case
Linker_Section): If the aspect applies to an object declaration
with explicit initialization, do not delay the freezing of the
object, to prevent access-before-elaboration in the generated
initialization code.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
(Integer_Value (Item)) when the size of the fixed decimal type
is larger than Integer.
From-SVN: r251865