Representation information generated when user calls the compiler with -gnatR
switch is not available when running the frontend inside CodePeer or GNATprove.
Do not query such information in that case, as this leads to spurious messages
that it is not available.
There is no impact on compilation.
2018-06-11 Yannick Moy <moy@adacore.com>
gcc/ada/
* gnat1drv.adb: Do not check representation information in CodePeer and
GNATprove modes, as these modes call a special backend instead of gigi,
so do not have the information.
From-SVN: r261414
Calls to subprograms whose body was an extended return of an unconstrained
type were marked as not inlined, while the subprogram itself was marked as
always inlined. This was inconsistent and could lead to crash in GNATprove.
Now such subprograms are marked as not candidates for inlining.
This mostly impacts GNATprove, as it relates to frontend inlining which is
not used anymore in normal compilation.
2018-06-11 Yannick Moy <moy@adacore.com>
gcc/ada/
* inline.adb (Build_Body_To_Inline): Consider case of extended return
of unconstrained type as one case where inlining is not supported.
(Expand_Inlined_Call): Remove special case for body as extended return
of unconstrained type.
From-SVN: r261413
This fixes the code checking SPARK RM 7.2.6(3) so that generic child units
are not forced to use Part_Of to relate their abstract state to the state
of their parent.
2018-06-11 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_prag.adb (Analyze_Part_Of): Only allow Part_Of on non-generic
unit.
(Check_Missing_Part_Of): Do not force Part_Of on generic unit.
gcc/testsuite/
* gnat.dg/part_of1-instantiation.adb,
gnat.dg/part_of1-instantiation.ads,
gnat.dg/part_of1-private_generic.adb,
gnat.dg/part_of1-private_generic.ads, gnat.dg/part_of1.ads: New
testcase.
From-SVN: r261412
Splitting AND THEN expressions in contracts into separate pragma Check
is only useful for compilation when the error message points to a failed
conjunct. For proof it is of no use; for flow analysis it is annoying.
Also, it makes debugging harder. Now it is disabled in GNATprove_Mode.
Compilation is not affected, so no test provided.
2018-06-11 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_ch13.adb (Analyze_Aspect_Specifications): Don't split AND THEN
expressions in Pre/Post contracts while in GNATprove_Mode.
From-SVN: r261411
Pre- and postconditions with top-level AND THEN expressions are broken down
into checks of indivudial conjuncts for more precise error reporting. This
rewrite interfers with detection of potentially unevaluadted use of 'Old,
e.g. a contract like "Pre => Foo and then Bar" is rewritten into a two
pragmas Check, for expressions "Foo" and "Bar", but the latter remains
potentially unevaluted. This patch fixes detection of the AND THEN rewrite.
This fixes inlining in the GNATprove mode, i.e. the following testc case must
not emit a warning like:
contract1.adb:14:07: info:
no contextual analysis of "Foo" (in potentially unevaluated context)
2018-06-11 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_util.adb (Is_Potentially_Unevaluated): Fix detection of contracts
with AND THEN expressions broken down into individual conjuncts.
gcc/testsuite/
* gnat.dg/contract1.adb: New testcase.
From-SVN: r261410
The compiler generates wrong code when an array aggregate with an others choice
whose expression has nested object allocations (ie. others => new R (new S)) is
used to initialize an array of access to discriminated types whose discriminant
is an access type.
2018-06-11 Javier Miranda <miranda@adacore.com>
gcc/ada/
* sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
(Is_Static_Coextension): Adding documentation.
* sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
(Is_Static_Coextension): Extending the assertion.
* sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
setting flag Is_Dynamic_Coextension (and vice versa).
gcc/testsuite/
* gnat.dg/aggr23.adb, gnat.dg/aggr23_q.adb, gnat.dg/aggr23_tt.ads: New
testcase.
From-SVN: r261406
2018-06-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb (Search_Subprograms): Handle explicitly stubs at the top
level of a compilation unit, becuase they may contain nested
subprograms that need an activation record.
From-SVN: r261405
This patch fixes a crash on a unit with a function with the GNAT-specific
Inline_Always pragma whose body is an extended return statement, when compiling
with no optimization level specified.
2018-06-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* inline.adb (Expand_Inlined_Call): If no optimization level is
specified, the expansion of a call to an Inline_Always function is
fully performed in the front-end even on a target that support back-end
inlining.
gcc/testsuite/
* gnat.dg/inline_always1.adb: New testcase.
From-SVN: r261402
This patch modifies the creation of markers for variable references in the
context of SPARK elaboration checks. Previously, prior to checking whether a
reference requires such a marker, the compiler performed a logarithmic look up
to determine whether the reference appears within a call. This action caused
the compiler to degrade when a source program contains multiple (100,000s)
references. Now, the compiler no longer performs the look up immediately.
2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* sem_ch8.adb (Find_Direct_Name): Mode the declaration of
Is_Assignment_LHS further in. Use predicate
Needs_Variable_Reference_Marker to determine whether to create a
variable marker.
(Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
in. Use predicate Needs_Variable_Reference_Marker to determine whether
to create a variable marker.
* sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
checks that determine whether the identifier or expanded name is a
suitable variable reference. The checks are now performed by
Needs_Variable_Reference_Marker.
* sem_res.adb (Resolve_Actuals): Use predicate
Needs_Variable_Reference_Marker to determine whether to create a
variable marker.
* sem_util.adb (Needs_Variable_Reference_Marker): New routine.
* sem_util.ads (Needs_Variable_Reference_Marker): New routine.
From-SVN: r261400
This patch fixes a compiler abort on an instantiation of a generic nested
within another instance, when the outer instance is declared in the visible
part of a package and the inner intance is in the private part of the same
package.
2018-06-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch12.adb (Install_Body): In order to determine the placement of
the freeze node for an instance of a generic nested within another
instance, take into account that the outer instance may be declared in
the visible part of a package and the inner intance may be in the
private part of the same package.
gcc/testsuite/
* gnat.dg/nested_generic2.adb, gnat.dg/nested_generic2.ads,
gnat.dg/nested_generic2_g1.adb, gnat.dg/nested_generic2_g1.ads,
gnat.dg/nested_generic2_g2.ads: New testcase.
From-SVN: r261398
This just removes obsolete code. No functional changes.
2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* errout.adb (Special_Msg_Delete): Remove handling of Atomic and VFA.
From-SVN: r261397
2018-06-11 Nicolas Roche <roche@adacore.com>
gcc/ada/
* libgnat/s-valuti.adb (Bad_Value): Ensure that we do not generate a
stack overflow while raising a constraint error.
From-SVN: r261396
2018-06-11 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* repinfo.ads (Rep_Value): Use a single line.
* repinfo.adb (Rep_Value): Likewise.
(List_Attr): Do not use string concatenation.
From-SVN: r261395
2018-06-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb (Visit_Node): Check reference to formal parameter of
current procedure, because the bounds of its type may be uplevel
references.
From-SVN: r261394
/cp
2018-06-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokfndecl): Use the location_t argument in two more places.
/testsuite
2018-06-10 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/template/friend64.C: New.
* g++.old-deja/g++.other/friend4.C: Test the location too.
* g++.old-deja/g++.pt/crash23.C: Likewise.
From-SVN: r261389
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.h (gfc_expr): Add no_bounds_check field.
* frontend-passes.c (get_array_inq_function): Set no_bounds_check
on function and function argument.
(inline_matmul_assign): Set no_bounds_check on zero expression
and on lhs of zero expression.
Also handle A1B2 case if realloc on assigment is active.
* trans-array.c (gfc_conv_array_ref): Don't do range checking
if expr has no_bounds_check set.
(gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
has it set.
* trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
on lss and lss if the corresponding expressions have it set.
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.dg/inline_matmul_23.f90: New test.
From-SVN: r261388
2018-06-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85088
* decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
and remove a TODO note.
* gfortran.h: Add a comment to sym_intent.
2018-06-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85088
* gfortran.dg/intent_decl_1.f90: New test case.
From-SVN: r261386
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/38351
* resolve.c (resolve_operator): Provide better error message for
derived type entity used in an binary intrinsic numeric operator.
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/38351
* gfortran.dg/pr38351.f90: New test.
* gfortran.dg/typebound_operator_4.f03: Adjust for new error message.
From-SVN: r261363
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85138
PR fortran/85996
PR fortran/86051
* decl.c (gfc_match_char_spec): Use private namespace in attempt to
reduce a charlen to a constant.
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85138
PR fortran/85996
PR fortran/86051
* gfortran.dg/pr85138_1.f90: New test.
* gfortran.dg/pr85138_2.f90: Ditto.
* gfortran.dg/pr85996.f90: Ditto.
From-SVN: r261362
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78278
* data.c (gfc_assign_data_value): Re-arrange code to allow for
an error for double initialization of CHARACTER entities.
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78278
* gfortran.dg/data_bounds_1.f90: Add -std=gnu option.
* gfortran.dg/data_char_1.f90: Ditto.
* gfortran.dg/pr78571.f90: Ditto.
* gfortran.dg/pr78278.f90: New test.
From-SVN: r261361
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/63514
* symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/63514
* gfortran.dg/pr63514.f90: New test.
From-SVN: r261360
Now we make temporaries for allocations on stack (CL 86242). This
function is no longer used. Remove.
Reviewed-on: https://go-review.googlesource.com/92618
* go-gcc.cc (class Gcc_backend): Remove
stack_allocation_expression method.
From-SVN: r261353
2018-06-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/85631
* trans.h (gfc_ss): Add field no_bounds_check.
* trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
ss->no_bounds_check is set, do not use runtime checks.
* trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
for reallocatable lhs.
2018-06-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/85631
* gfortran.dg/bounds_check_20.f90: New test.
From-SVN: r261348
gcc/testsuite/ChangeLog:
2018-06-08 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/p8vector-builtin-3.c: Add vec_pack test. Update
vpkudum counts.
* gcc.target/powerpc/p9-extract-3.c: Make second argument of
vec_extract a signed int.
* gcc.target/powerpc/vec-cmp.c: Add vec_cmple, vec_cmpge tests. Update,
vcmpgtsb, vcmpgtub, vcmpgtsh, vcmpgtuh, vcmpgtsw, vcmpgtsw, vcmpgtuw,
vcmpgtsd, vcmpgtud.
* gcc.target/powerpc/vsx-extract-4.c: Make second argument of
vec_extract a signed int.
* gcc.target/powerpc/vsx-extract-5.c: Make second argument of
vec_extract a signed int.
* gcc.target/powerpc/vsx-vector-7.c (foo): Add tests for vec_sel and
vec_xor builtins. Update xxsel, xxlxor counts.
From-SVN: r261347
2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78571
* data.c (create_character_initializer): Return early if type is
incompatible with CHARACTER.
2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78571
* gfortran.dg/pr78571.f90: New test.
From-SVN: r261343
gcc/testsuite/ChangeLog:
2018-06-08 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/vsx-vector-6-be.p7.c: Rename this file to
vsx-vector-6.p7.c.
* gcc.target/powerpc/vsx-vector-6-le.p9.c: Rename this file to
vsx-vector-6.p9.c.
* gcc.target/powerpc/vsx-vector-6-be.p8.c: Move instruction counts
for BE system that are different then for an LE system from this file
into vsx-vector-6-le.c using be target qualifier. Remove this file.
* gcc.target/powerpc/vsx-vector-6-le.c: Add le qualifiers as needed for
the various instruction counts. Rename file to vsx-vector-6.p8.c.
From-SVN: r261333